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