[open-ils-commits] [GIT] Evergreen ILS branch master updated. 2e447f31f3cd379b8323d646be7e10333153f498

Evergreen Git git at git.evergreen-ils.org
Thu Sep 12 13:40:54 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  2e447f31f3cd379b8323d646be7e10333153f498 (commit)
       via  8f3ced2f524541486ca463c11146dab63547543b (commit)
      from  a9d88279ea90355b9c683218f8d0b0192970f40f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2e447f31f3cd379b8323d646be7e10333153f498
Author: Bill Erickson <berick at esilibrary.com>
Date:   Wed Sep 11 13:49:07 2013 -0400

    LP#1084758 store staff client tpac (etc) zoom pref
    
    Staff client pages loaded via browser.xul which have a name (via
    internal XUL URL param) now have the ability to store and load a per-
    page zoom value preference.  This includes (at minimum) the embedded
    TPAC.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/xul/staff_client/chrome/content/util/browser.js b/Open-ILS/xul/staff_client/chrome/content/util/browser.js
index fb0078a..20cb4dc 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/browser.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.js
@@ -166,6 +166,39 @@ util.browser.prototype = {
         }
     },
 
+    /*
+     * If the browser page is given a name (e.g. the catalog is "Catalog") 
+     * and the user applies a zoom value (ctrl+ / ctrl-), store the value
+     * in the oils.util.browser.zoom.<name> pref.  On page load, if a value
+     * is set for the given page, load and apply the value to the page.
+     */
+    'apply_zoom' : function(val, delta) {
+        var name = xul_param('name');
+        if (!name) return;
+        var key = 'oils.util.browser.zoom.' + name; // pref key
+        var viewer = this.controller.view.browser_browser.markupDocumentViewer;
+
+        var prefs = Components.classes[
+            '@mozilla.org/preferences-service;1'].getService(
+                Components.interfaces['nsIPrefBranch']);
+
+        if (!val) {
+            if (delta) {
+                val = viewer.fullZoom;
+                val += delta
+            } else {
+                if (prefs.prefHasUserValue(key))
+                    val = prefs.getCharPref(key);
+            }
+        } 
+
+        val = Number(val);
+        if (!val || isNaN(val) || val < 0) return;
+
+        viewer.fullZoom = val;
+        prefs.setCharPref(key, ''+val);
+    },
+
     'reload' : function() {
         var obj = this;
         if (obj.lock_reload) {
@@ -465,6 +498,7 @@ util.browser.prototype = {
                                 var alert_string = 'document has stopped: ' + new Date() + '\n'; dump(alert_string);
                                 try {
                                     obj.push_variables(); obj.updateNavButtons();
+                                    obj.apply_zoom();
                                 } catch(E) {
                                     var err_msg = 'browser.js STATE_IS_DOCUMENT STATE_STOP error with push_variables or updateNavButtons: ' + E + '\n';
                                     dump(err_msg);
diff --git a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
index 616c63b..29ab51f 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
@@ -110,9 +110,9 @@
         <command id="cmd_back" label="&common.browser.backward.label;" accesskey="&common.browser.backward.accesskey;" />
         <command id="cmd_reload" label="&common.browser.reload.label;" accesskey="&common.browser.reload.accesskey;" />
         <command id="cmd_forward" label="&common.browser.forward.label;" accesskey="&common.browser.forward.accesskey;" />
-        <command id="cmd_zoom_in" oncommand="g.browser.controller.view.browser_browser.markupDocumentViewer.fullZoom += 0.1;" />
-        <command id="cmd_zoom_out" oncommand="g.browser.controller.view.browser_browser.markupDocumentViewer.fullZoom -= 0.1;" />
-        <command id="cmd_zoom_reset" oncommand="g.browser.controller.view.browser_browser.markupDocumentViewer.fullZoom = 1;" />
+        <command id="cmd_zoom_in" oncommand="g.browser.apply_zoom(null, 0.1);" />
+        <command id="cmd_zoom_out" oncommand="g.browser.apply_zoom(null, -0.1);" />
+        <command id="cmd_zoom_reset" oncommand="g.browser.apply_zoom(1);" />
     </commandset>
 
     <keyset>

commit 8f3ced2f524541486ca463c11146dab63547543b
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue May 8 10:56:08 2012 -0400

    Add Zoom support to browser views
    
    Currently tied to CTRL with +/-/0 like Firefox uses.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
index 9cf55cb..616c63b 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
@@ -110,8 +110,18 @@
         <command id="cmd_back" label="&common.browser.backward.label;" accesskey="&common.browser.backward.accesskey;" />
         <command id="cmd_reload" label="&common.browser.reload.label;" accesskey="&common.browser.reload.accesskey;" />
         <command id="cmd_forward" label="&common.browser.forward.label;" accesskey="&common.browser.forward.accesskey;" />
+        <command id="cmd_zoom_in" oncommand="g.browser.controller.view.browser_browser.markupDocumentViewer.fullZoom += 0.1;" />
+        <command id="cmd_zoom_out" oncommand="g.browser.controller.view.browser_browser.markupDocumentViewer.fullZoom -= 0.1;" />
+        <command id="cmd_zoom_reset" oncommand="g.browser.controller.view.browser_browser.markupDocumentViewer.fullZoom = 1;" />
     </commandset>
 
+    <keyset>
+        <key key="-" command="cmd_zoom_out"   modifiers="accel"/>
+        <key key="+" command="cmd_zoom_in"    modifiers="accel"/>
+        <key key="=" command="cmd_zoom_in"    modifiers="accel"/>
+        <key key="0" command="cmd_zoom_reset" modifiers="accel"/>
+    </keyset>
+
     <popupset>
         <menupopup id="debug_popup">
             <menuitem label="&common.browser.view_source.label;" accesskey="&common.browser.view_source.accesskey;" command="cmd_view_source" />
diff --git a/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul b/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
index 43b2181..8c7f527 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
@@ -117,8 +117,18 @@
         <command id="cmd_back" label="&common.browser.backward.label;" accesskey="&common.browser.backward.accesskey;" />
         <command id="cmd_reload" label="&common.browser.reload.label;" accesskey="&common.browser.reload.accesskey;" />
         <command id="cmd_forward" label="&common.browser.forward.label;" accesskey="&common.browser.forward.accesskey;" />
+        <command id="cmd_zoom_in" oncommand="g.browser.controller.view.browser_browser.markupDocumentViewer.fullZoom += 0.1;" />
+        <command id="cmd_zoom_out" oncommand="g.browser.controller.view.browser_browser.markupDocumentViewer.fullZoom -= 0.1;" />
+        <command id="cmd_zoom_reset" oncommand="g.browser.controller.view.browser_browser.markupDocumentViewer.fullZoom = 1;" />
     </commandset>
 
+    <keyset>
+        <key key="-" command="cmd_zoom_out"   modifiers="accel"/>
+        <key key="+" command="cmd_zoom_in"    modifiers="accel"/>
+        <key key="=" command="cmd_zoom_in"    modifiers="accel"/>
+        <key key="0" command="cmd_zoom_reset" modifiers="accel"/>
+    </keyset>
+
     <popupset>
         <menupopup id="debug_popup">
             <menuitem label="&common.browser.view_source.label;" accesskey="&common.browser.view_source.accesskey;" command="cmd_view_source" />

-----------------------------------------------------------------------

Summary of changes:
 .../staff_client/chrome/content/util/browser.js    |   34 ++++++++++++++++++++
 .../staff_client/chrome/content/util/browser.xul   |   10 ++++++
 .../staff_client/chrome/content/util/rbrowser.xul  |   10 ++++++
 3 files changed, 54 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list