Talk:Adding preferences to an extension
From MDC
Why is infoReceived() skipped when refreshInformation() is triggered by changing the "symbol" preference in the options window?
VisualFuture 16:40, 17 March 2008 (PDT)
All references to the preferences should be
extensions.stockwatcher2.*
rather than
stockwatcher2.*
as explained in the article's on this site called "Extension Ettiquette".
--[[User::RtpHarry|RtpHarry]] 14:39, 31 August 2006 (GMT)
One could use something like this to avoid repeated code in oncommand.
<popupset id="mainPopupSet">
<menupopup id="stockmenu" oncommand="var val=event.target.value; if(val) StockWatcher.watchStock(val)">
<menuitem label="Refresh Now" default="true"
oncommand="StockWatcher.refreshInformation()"/>
<menuseparator/>
<menuitem label="Apple (AAPL)" value="AAPL"/>
<menuitem label="Google (GOOG)" value="GOOG"/>
<menuitem label="Microsoft (MSFT)" value="MSFT"/>
<menuitem label="Yahoo! (YHOO)" value="YHOO"/>
</menupopup>
</popupset>
--Nickolay 13:36, 26 April 2006 (PDT)
Oh, and I would use an anonymous wrapper function here, in order to be able to use this in refreshInformation:
window.setInterval(this.refreshInformation, 10*60*1000);
--Nickolay 05:02, 27 April 2006 (PDT)