[open-ils-commits] r16242 - in trunk/Open-ILS/xul/staff_client/chrome/content: OpenILS util (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Apr 15 12:02:51 EDT 2010


Author: phasefx
Date: 2010-04-15 12:02:48 -0400 (Thu, 15 Apr 2010)
New Revision: 16242

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
   trunk/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul
Log:
toward making fancy prompt dimensions sticky, just need to give the oils_persist mechanism support for resize events


Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js	2010-04-15 15:38:41 UTC (rev 16241)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js	2010-04-15 16:02:48 UTC (rev 16242)
@@ -66,8 +66,14 @@
         }
     }
 
-    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++) {
@@ -126,7 +132,7 @@
             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++) {

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul	2010-04-15 15:38:41 UTC (rev 16241)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/fancy_prompt.xul	2010-04-15 16:02:48 UTC (rev 16242)
@@ -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();



More information about the open-ils-commits mailing list