Debug in Admin->Offline Transaction Management collab/phasefx/copy_profile_directory_path_to_clipboard
authorJason Etheridge <jason@esilibrary.com>
Mon, 8 Apr 2013 20:28:19 +0000 (16:28 -0400)
committerJason Etheridge <jason@esilibrary.com>
Mon, 8 Apr 2013 20:28:19 +0000 (16:28 -0400)
This adds the same faded Debug label that you see in various interfaces like the
one that wraps the embedded OPAC, but when you click on it, instead of letting
you modify a URL, etc., it copies the path for the user/profile directory to the
clipboard and shows the same directory in an alert popup.  This is the directory
where a local copy of offline transactions are preserved.

As a bonus, since the label is localized, I went ahead and updated the Debug
label from the browser wrapper interface with the same DTD entity.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/util/browser.xul
Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.js
Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.xul

index d52ae78..14dd65b 100644 (file)
 <!ENTITY staff.search_prefs.clear.label "Clear All">
 <!ENTITY staff.search_prefs.clear.accesskey "C">
 <!ENTITY staff.search_prefs.cleared_message "Preferences cleared">
+<!ENTITY staff.debug.obscure_label "Debug">
index 4356f62..9a442f0 100644 (file)
             <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
             <button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
             <spacer flex="1"/>
-            <label id="debug" value="Debug" disabled="true" popup="debug_popup" />
+            <label id="debug" value="&staff.debug.obscure_label;" disabled="true" 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" />
index 5531527..96804b9 100644 (file)
@@ -50,6 +50,9 @@ admin.offline_manage_xacts.prototype = {
         x = obj.$('retrieve_details');
         x.addEventListener('command',function() { try{obj.retrieve_details();}catch(E){alert(E);} },false);
 
+        x = obj.$('debug');
+        x.addEventListener('click',function() { try{obj.debug();;}catch(E){alert(E);} },false);
+
         obj.$('deck').selectedIndex = 0;
     },
 
@@ -509,6 +512,16 @@ admin.offline_manage_xacts.prototype = {
         }
     },
 
+    'debug' : function() {
+        var obj = this;
+
+        JSAN.use('util.file');
+        var file = new util.file('temp');
+        var s = file._file.path.replace(/temp$/,'');
+        copy_to_clipboard(s);
+        alert(s);
+    },
+
     'upload' : function() {
         var obj = this;
 
index 860327f..dc8f784 100644 (file)
@@ -61,6 +61,7 @@
                 <button id="create" label="&staff.server.admin.offline.xacts.create.label;" disabled="true"/>
                 <button id="execute" label="&staff.server.admin.offline.xacts.execute.label;" disabled="true"/>
                 <spacer flex="1"/>
+                <label id="debug" value="&staff.debug.obscure_label;" disabled="true"/>
                 <button id="upload" label="&staff.server.admin.offline.xacts.upload.label;" disabled="true"/>
             </hbox>
             <tree id="session_tree" enableColumnDrag="true" seltype="single" flex="1"/>