never mind that one... the more i think of it the more wrong i see i was!
 
 
----- Original Message -----
Sent: Wednesday, June 05, 2002 12:04 PM
Subject: Re: [DQSD-Users] playing around with add-ons

i'm getting over my head a bit here, but...
 
would we need something to work "almost" like a .h file or a prototype?  if so would it work to include a <method> tag in the xml files and edit loader.js to load the methods?
 
 
i.e. clc.xml could have the following line..
 
<method>mathexp(t)</method>
 
i'm not sure what you would have to add to loader.js... but something to parse the <method> tags and then load the methods?
 
 
JB
 
----- Original Message -----
From: Glenn Carr
Sent: Wednesday, June 05, 2002 11:37 AM
Subject: Re: [DQSD-Users] playing around with add-ons

But, it could be optional if there were some mechanism for adding 'autodetect' routines for any search/add-on.
----- Original Message -----
Sent: Wednesday, June 05, 2002 10:20 AM
Subject: Re: [DQSD-Users] playing around with add-ons

thanks, Glenn.
 
that worked!
 
i didn't understand the problem you mentioned at first.  but now i get it.  add-ons are basically meant to be optional.  but the mathexp() function is not optional so clc could not be optional.
 
but it does work with the add-on structure.
 
JB
----- Original Message -----
From: Glenn Carr
Sent: Wednesday, June 05, 2002 10:44 AM
Subject: Re: [DQSD-Users] playing around with add-ons

John,
 
At first I thought the problem was with the path in the 'src' attribute of the <script/> block.  But, even if the path is correct ("addons/clc/calculate.js") it wouldn't load.  Then I realized that the script in loader.js was just doing an eval on the contents of the <script/> tag which in the case of <script src="javascript:void(0);"></script> was an empty string.
 
So, I added a fix/hack to loader.js to actually read the contents of the script in these cases.  I've checked it in.  See if it works for you.
 
The only problem with making the clc stuff an add-on is that search.htm requires that 'mathexp' exist.  search.htm could be changed to check to see if 'mathexp' is a function (like it does with the other 'autodetect_' routines), but there probably needs to be a more generic mechanism for adding functions that patterns and try to apply a search to it automatically.  Currently that list is language translations, urls, phone numbers, currency conversions, and math expressions.  Something to think about.
 
Anyway, thanks for testing this John.
 
Later,
Glenn
----- Original Message -----
Sent: Wednesday, June 05, 2002 8:27 AM
Subject: [DQSD-Users] playing around with add-ons

i was playing around with the add-on idea.  i remember that a while back it was mentioned that things like the calculator and calendar might/should be moved to be add-ons.  so i gave it a try to move clc to become an add-on.  here are the steps i tried and then my failed result.  any help?
 
1. created directory under addons called clc
2. moved clc.xml and calculate.js into that directory
3. removed "<script src="calculate.js"></script>" from search.htm
4. placed "<script src="calculate.js"></script>" into clc.xml
5. reloaded toolbar and entered "2+4"
 
but then i got a javascript error on search.htm in line 166 which is:
"if (mathexp(t)) return false;"
 
this function mathexp(t) is defined in calculate.js.  so somehow it appears that search.htm is not aware of the function in calculate.js
 
what step(s) did i miss?  am i going about this all wrong?
 
thanks,
JB

Reply via email to