add magic debug controls to chrome interfaces
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 20 May 2010 04:53:50 +0000 (04:53 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 20 May 2010 04:53:50 +0000 (04:53 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16456 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul
Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_offline.xul

index da81227..d70a2ab 100644 (file)
         <script type="text/javascript" src="global_util.js" />   
         <messagecatalog id="offlineStrings" src='chrome://open_ils_staff_client/locale/offline.properties'/>
         <messagecatalog id="authStrings" src='chrome://open_ils_staff_client/locale/auth.properties'/>
+        <hbox id="debug_box" hidden="true" flex="1" style="border: red thin dashed">
+            <label value="Debug:" />
+            <textbox id="debug_tb" flex="1"/>
+            <button label="Execute" oncommand="try { var dtb = document.getElementById('debug_tb'); alert( eval( dtb.value ) ); } catch(E) { alert(E); }; dtb.focus();"/>
+            <button label="Inspect" oncommand="try { var dtb = document.getElementById('debug_tb'); var dx = eval( dtb.value ); var ds = ''; for (var di in dx) { ds += di + '=' + dx[di] + '\r\n'; }; window.open('data:text/plain;charset=UTF-8,'+window.escape(ds),'debug_win','chrome,resizable,modal'); } catch(E) { alert(E); }; dtb.focus();"/>
+            <button label="js2JSON" oncommand="try { var dtb = document.getElementById('debug_tb'); alert( js2JSON( eval( dtb.value ) ) ); } catch(E) { alert(E); }; dtb.focus();"/>
+        </hbox>
+        <keyset><key id="debug_box_key" keycode="VK_F7" modifiers="control,shift" oncommand="var dtb = document.getElementById('debug_tb'); var dx = document.getElementById('debug_box'); dx.hidden = !dx.hidden; if (!dx.hidden) dtb.focus();"/></keyset>
         <script>dump('finished openils_util_overlay\n');</script>
     </scripts>
 
index 3a4e482..8eac145 100644 (file)
         <script type="text/javascript" src="util/md5.js" />
         <script type="text/javascript" src="util/JSON_v1.js" />
         <script type="text/javascript" src="global_util.js" />   
+        <hbox id="debug_box" hidden="true" flex="1" style="border: red thin dashed">
+            <label value="Debug:" />
+            <textbox id="debug_tb" flex="1"/>
+            <button label="Execute" oncommand="try { var dtb = document.getElementById('debug_tb'); alert( eval( dtb.value ) ); } catch(E) { alert(E); }; dtb.focus();"/>
+            <button label="Inspect" oncommand="try { var dtb = document.getElementById('debug_tb'); var dx = eval( dtb.value ); var ds = ''; for (var di in dx) { ds += di + '=' + dx[di] + '\r\n'; }; window.open('data:text/plain;charset=UTF-8,'+window.escape(ds),'debug_win','chrome,resizable,modal'); } catch(E) { alert(E); }; dtb.focus();"/>
+            <button label="js2JSON" oncommand="try { var dtb = document.getElementById('debug_tb'); alert( js2JSON( eval( dtb.value ) ) ); } catch(E) { alert(E); }; dtb.focus();"/>
+        </hbox>
+        <keyset><key id="debug_box_key" keycode="VK_F7" modifiers="control,shift" oncommand="var dtb = document.getElementById('debug_tb'); var dx = document.getElementById('debug_box'); dx.hidden = !dx.hidden; if (!dx.hidden) dtb.focus();"/></keyset>
     </scripts>
     <script>dump('Loaded OpenILS/util_overlay_offline.xul\n');</script>