First cut at increasing font size for catalogue in staff client user/artunit/xul_client_zoom
authorArt Rhyno <art632000@yahoo.ca>
Fri, 10 Aug 2012 02:27:51 +0000 (22:27 -0400)
committerArt Rhyno <art632000@yahoo.ca>
Fri, 10 Aug 2012 02:27:51 +0000 (22:27 -0400)
My XUL skills are rusty and thin, so I took a simplistic approach
to increasing font size. I have added two buttons, one that will use the
'font-adjust-size' property to increase the font, using a value of '1'. The other
button resets the font to normal. I thought about using the XUL preferences
as a way to create an increment but the preferences seem to be meant to
be retained across sessions. I also suspect there's a browser directive
that increases the size much more elegantly but I couldn't unearth it. Did
I mention this was a first cut at this?

Signed-off-by: Art Rhyno <art632000@yahoo.ca>
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/util/browser.js
Open-ILS/xul/staff_client/chrome/content/util/browser.xul
Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul

index 4ad7f61..332bdc7 100644 (file)
@@ -58,6 +58,8 @@
 <!ENTITY common.browser.forward.accesskey "d">
 <!ENTITY common.browser.backward.label "Go Back">
 <!ENTITY common.browser.backward.accesskey "B">
+<!ENTITY common.browser.zoomin.label "Larger">
+<!ENTITY common.browser.zoomout.label "Normal">
 <!ENTITY common.browser.reload.label "Reload">
 <!ENTITY common.browser.reload.accesskey "l">
 <!ENTITY common.browser.print.label "Print Page">
index fb0078a..dae2cd1 100644 (file)
@@ -133,6 +133,30 @@ util.browser.prototype = {
                                 }
                             }
                         ],
+                        'cmd_zoom_in' : [
+                            ['command'],
+                            function() {
+                                try {
+                                    var doc = obj.get_content().document;
+                                    doc.documentElement.style.setProperty('font-size-adjust','1.0','important');
+                                } catch(E) {
+                                    var err = 'cmd_zoom_in: ' + E;
+                                    obj.error.sdump('D_ERROR',err);
+                                }
+                            }
+                        ],
+                        'cmd_zoom_out' : [
+                            ['command'],
+                            function() {
+                                try {
+                                    var doc = obj.get_content().document;
+                                    doc.documentElement.style.setProperty('font-size-adjust','0','important');
+                                } catch(E) {
+                                    var err = 'cmd_zoom_out: ' + E;
+                                    obj.error.sdump('D_ERROR',err);
+                                }
+                            }
+                        ],
                         'cmd_find' : [
                             ['command'],
                             function() {
@@ -263,7 +287,7 @@ util.browser.prototype = {
             if (!obj.push_xulG) return;
             var cw = this.get_content();
             cw.IAMXUL = true;
-            cw.XUL_BUILD_ID = '/xul/server/'.split(/\//)[2];
+            cw.XUL_BUILD_ID = '/xul/server/server/'.split(/\//)[2];
             cw.xulG = obj.passthru_content_params || {};
             cw.xulG.fromBack = obj.from_back;
             if (!cw.xulG.set_tab) { cw.xulG.set_tab = function(a,b,c) { return window.xulG.set_tab(a,b,c); }; }
index 4356f62..6295050 100644 (file)
         <command id="cmd_view_source" />
         <command id="cmd_find" />
         <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_reload" label="&common.browser.reload.label;" accesskey="&common.browser.reload.accesskey;" />
+        <command id="cmd_zoom_in" label="&common.browser.zoomin.label;" />
+        <command id="cmd_zoom_out" label="&common.browser.zoomout.label;" />
     </commandset>
 
     <popupset>
     <vbox flex="1">
         <hbox>
             <button id="back" command="cmd_back" disabled="true" hidden="true"/>
-            <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
             <button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
+            <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
+            <button id="zoom_in" command="cmd_zoom_in" disabled="false" hidden="false"/>
+            <button id="zoom_out" command="cmd_zoom_out" disabled="false" hidden="false"/>
             <spacer flex="1"/>
             <label id="debug" value="Debug" disabled="true" popup="debug_popup" />
             <button id="browser_print" command="cmd_print" hidden="true"/>
index 353889a..ed9feaa 100644 (file)
@@ -6,7 +6,7 @@
 <!-- STYLESHEETS -->
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
-<?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
+<?xml-stylesheet href="/xul/server/server/skin/global.css" type="text/css"?>
 
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
 <!-- LOCALIZATION -->
@@ -16,7 +16,7 @@
 
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
 <!-- OVERLAYS -->
-<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+<?xul-overlay href="/xul/server/server/OpenILS/util_overlay.xul"?>
 
 <window id="util_browser_win" 
     onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
@@ -29,7 +29,7 @@
     </script>
         <scripts id="openils_util_scripts"/>
 
-    <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
+    <script type="text/javascript" src="/xul/server/server/main/JSAN.js"/>
     <script>
     <![CDATA[
 
@@ -37,7 +37,7 @@
             try {
                         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
                 JSAN.errorLevel = "die"; // none, warn, or die
-                JSAN.addRepository('/xul/server/');
+                JSAN.addRepository('/xul/server/server/');
                 JSAN.use('util.error'); g.error = new util.error();
                 g.error.sdump('D_TRACE','my_init() for util_browser.xul');
 
         <command id="cmd_view_source" />
         <command id="cmd_find" />
         <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_reload" label="&common.browser.reload.label;" accesskey="&common.browser.reload.accesskey;" />
+        <command id="cmd_zoom_in" label="&common.browser.zoomin.label;" />
+        <command id="cmd_zoom_out" label="&common.browser.zoomout.label;" />
     </commandset>
 
     <popupset>
     <vbox flex="1">
         <hbox id="browser_toolbar">
             <button id="back" command="cmd_back" disabled="true" hidden="true"/>
-            <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
             <button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
+            <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
+            <button id="zoom_in" command="cmd_zoom_in" disabled="false" hidden="false"/>
+            <button id="zoom_out" command="cmd_zoom_out" disabled="false" hidden="false"/>
             <spacer flex="1"/>
-            <label id="debug" value="Debug" disabled="true" popup="debug_popup" />
+            <label id="debug" value="Debug" disabled="false" popup="debug_popup" />
             <button id="browser_print" command="cmd_print" hidden="true"/>
         </hbox>
         <browser id="browser_browser" flex="1" autoscroll="false" type="content" oils_force_external="true" />