2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Example Template for remote xul -->
5 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
7 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
8 <?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
9 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
11 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
13 <!DOCTYPE window PUBLIC "" ""[
14 <!--#include virtual="/opac/locale/en-US/lang.dtd"-->
17 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
19 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
21 <window id="util_list_clipboard_win"
22 onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
23 width="300" height="300" persist="width height"
24 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
26 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
28 <script type="text/javascript">
29 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
31 <scripts id="openils_util_scripts"/>
33 <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
37 function $(id) { return document.getElementById(id); }
38 function $c(n) { return document.createElement(n); }
42 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
43 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
44 JSAN.errorLevel = "die"; // none, warn, or die
45 JSAN.addRepository('/xul/server/');
46 JSAN.use('util.error'); g.error = new util.error();
47 g.error.sdump('D_TRACE','my_init() for util_list_clipboard.xul');
49 JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.stash_retrieve();
50 if (! g.data.list_clipboard ) {
53 for (var i = 0; i < g.data.list_clipboard.length; i++) {
54 var data_row = g.data.list_clipboard[i];
60 try { g.error.standard_unexpected_error_alert('util/list_clipboard.xul',E); } catch(F) { alert(E); }
64 function make_grid(data_row) {
66 var vbox = $c('vbox'); vbox.setAttribute('flex','1'); $('area').appendChild(vbox);
67 var grid = $c('grid'); grid.setAttribute('flex','1'); grid.setAttribute('style','border: solid black'); vbox.appendChild(grid);
68 var columns = $c('columns'); grid.appendChild(columns);
69 var c1 = $c('column'); c1.setAttribute('flex','1'); columns.appendChild(c1);
70 var c2 = $c('column'); c2.setAttribute('flex','1'); columns.appendChild(c2);
71 var rows = $c('rows'); grid.appendChild(rows);
74 data_row2.push( { 'label' : j, 'value' : data_row[j] } );
76 data_row2.sort( function(a,b) { if ( a.label < b.label ) return -1; else return 1; } );
77 for (var j = 0; j < data_row2.length; j++) {
78 var label = data_row2[j].label;
79 var value = data_row2[j].value;
80 if (value == '???' || value == '' || value == 'undefined') continue;
82 var l1 = $c('label'); l1.setAttribute('value',label); row.appendChild(l1);
83 var l2 = $c('label'); l2.setAttribute('value',value);
84 l2.setAttribute('style','text-decoration: underline; color: blue; -moz-user-focus: normal');
85 l2.setAttribute('onfocus','this.setAttribute("class","clipboard_outline_me")');
86 l2.setAttribute('onblur','this.setAttribute("class","")');
87 l2.setAttribute('onclick','copy_to_clipboard(event); window.close();');
89 rows.appendChild(row);
90 if (!g.focus) { g.focus = true; l2.focus(); }
93 try { g.error.standard_unexpected_error_alert('util/list_clipboard.xul, make_grid',E); } catch(F) { alert(E); }
100 <description style="font-weight: bold">Choose the data to copy into the clipboard:</description>
102 <hbox id="area" flex="1" style="overflow: scroll">
105 <hbox><spacer flex="1"/><button label="Close" accesskey="C" oncommand="window.close()"/></hbox>