Replacing persist mechanism with oils_persist.
This changeset isn't as scary as it looks, I promise. :-)
In XUL you can say, <element attribute1="foo" attribute2="bar" persist="attribute1 attribute2" />
and whenever those specified attributes change, the new values will be remembered the next time that element is loaded.
Problems with persist:
* No longer works with remote XUL in Xulrunner 1.9 series, only chrome. Mozilla did this for security reasons.
* Persist was tied to the window.location of each interface, so:
1) Settings would be lost on any "upgrade" that effectively changed the URL. For example, /xul/rel_1_2/server/ versus /xul/rel_1_4/server/
2) Some interfaces still make use of URL params, which effectively breaks persistance (because the URL changes constantly), and allows localstore.rdf to grow without limit (thanks to Jeff for noticing that last bit)
The solution:
* We renamed all occurances of @persist to @oils_persist, in case Mozilla changes the behavior again.
* We created a persist_helper() function and call it alongside font_helper() in the @onload for most windows (all that currently have elements using @oils_persist, at least)
persist_helper grabs all elements that have an @oils_persist, and constructs look-up keys based on the location.hostname, location.path, and element.id, and uses the Mozilla preference system to look for preferences with those
keys. These keys don't include URL parameters. For <checkbox> elements, an event listener is added that will set the preference whenever the element fires a command event (is checked or unchecked).
TODO:
* Tweak the keys further so that they're BUILD_ID (version) agnostic
* Add more event listeners to accomodate @oils_persist on other elements like window, splitter, and grippy.
* Possibly remove persist_helper (and font_helper) from the inline @onload, and load it through a window.addEventListener('load',function(){ persist_helper(); },false); in the global util overlay instead.
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13953
dcc99617-32d9-48b4-a31d-
7c20da2025e4