toward making fancy prompt dimensions sticky, just need to give the oils_persist...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Apr 2010 16:02:48 +0000 (16:02 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 15 Apr 2010 16:02:48 +0000 (16:02 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16242 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul

index e4b1b85..ec9bdfa 100644 (file)
         }
     }
 
-    function persist_helper() {
+    function persist_helper(base_key_suffix) {
         try {
+            if (base_key_suffix) {
+                base_key_suffix = base_key_suffix.replace(/[^A-Za-z]/g,'_') + '_';
+            } else {
+                base_key_suffix = '';
+            }
+
             function gen_event_handler(etype,node) {
                 return function(ev) {
                     try {
@@ -90,7 +96,7 @@
                             target = ev.target;
                         }
                         var filename = location.pathname.split('/')[ location.pathname.split('/').length - 1 ];
-                        var base_key = 'oils_persist_' + String(location.hostname + '_' + filename + '_' + target.getAttribute('id')).replace('/','_','g') + '_';
+                        var base_key = 'oils_persist_' + String(location.hostname + '_' + filename + '_' + target.getAttribute('id')).replace('/','_','g') + '_' + base_key_suffix;
                         var attribute_list = target.getAttribute('oils_persist').split(' ');
                         dump('on_oils_persist: <<< ' + target.nodeName + '.id = ' + target.id + '\t' + bk + '\n');
                         for (var j = 0; j < attribute_list.length; j++) {
             var nodes = document.getElementsByAttribute('oils_persist','*');
             for (var i = 0; i < nodes.length; i++) {
                 var filename = location.pathname.split('/')[ location.pathname.split('/').length - 1 ];
-                var base_key = 'oils_persist_' + String(location.hostname + '_' + filename + '_' + nodes[i].getAttribute('id')).replace('/','_','g') + '_';
+                var base_key = 'oils_persist_' + String(location.hostname + '_' + filename + '_' + nodes[i].getAttribute('id')).replace('/','_','g') + '_' + base_key_suffix;
                 var attribute_list = nodes[i].getAttribute('oils_persist').split(' ');
                 dump('persist_helper: >>> ' + nodes[i].nodeName + '.id = ' + nodes[i].id + '\t' + base_key + '\n');
                 for (var j = 0; j < attribute_list.length; j++) {
index 8d32d89..5a7aeea 100644 (file)
@@ -19,7 +19,8 @@
 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
 
 <window id="fancy_prompt_win" 
-    onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
+    onload="try { my_init(); font_helper(); persist_helper( xul_param('title',{'modal_xulG':true}) ); } catch(E) { alert(E); }"
+    oils_persist="width height"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
     <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
@@ -38,7 +39,7 @@
         function my_init() {
             try {
                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-                        if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
+                if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
                 JSAN.errorLevel = "die"; // none, warn, or die
                 JSAN.addRepository('/xul/server/');
                 JSAN.use('util.error'); g.error = new util.error();