clipboard
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Aug 2006 01:09:24 +0000 (01:09 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Aug 2006 01:09:24 +0000 (01:09 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5354 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_browser.js
Open-ILS/xul/staff_client/server/cat/copy_browser.xul
Open-ILS/xul/staff_client/server/cat/copy_buckets.js
Open-ILS/xul/staff_client/server/cat/copy_buckets.xul
Open-ILS/xul/staff_client/server/cat/copy_buckets_overlay.xul
Open-ILS/xul/staff_client/server/cat/record_buckets.js
Open-ILS/xul/staff_client/server/cat/record_buckets.xul
Open-ILS/xul/staff_client/server/cat/record_buckets_overlay.xul
Open-ILS/xul/staff_client/server/cat/z3950.js
Open-ILS/xul/staff_client/server/cat/z3950.xul

index 5daa45c..f09bdb5 100644 (file)
@@ -31,6 +31,10 @@ cat.copy_browser.prototype = {
                        obj.controller.init(
                                {
                                        control_map : {
+                                               'sel_clip' : [
+                                                       ['command'],
+                                                       function() { obj.list.clipboard(); }
+                                               ],
                                                'cmd_broken' : [
                                                        ['command'],
                                                        function() { alert('Not Yet Implemented'); }
@@ -1234,6 +1238,7 @@ cat.copy_browser.prototype = {
                                        'on_select' : function(ev) {
                                                JSAN.use('util.functional');
                                                var sel = obj.list.retrieve_selection();
+                                               obj.controller.view.sel_clip.disabled = sel.length < 1;
                                                obj.sel_list = util.functional.map_list(
                                                        sel,
                                                        function(o) { return o.getAttribute('retrieve_id'); }
index 3e0df8a..1c4a9b9 100644 (file)
@@ -64,6 +64,7 @@
 
        <commandset id="cat_copy_browser">
                <command id="cmd_broken" />
+               <command id="sel_clip" />
                <command id="cmd_clear" />
                <command id="cmd_show_my_libs" />
                <command id="cmd_show_all_libs" />
@@ -86,6 +87,8 @@
 
        <popupset>
                <popup id="copy_browser_actions">
+                       <menuitem command="sel_clip" label="Copy to Clipboard" accesskey="C"/>
+                                                       <menuseparator/>
                        <menuitem command="cmd_add_items" label="Add Items" accesskey="I"/>
                        <menuitem command="cmd_add_items_to_buckets" label="Add Items to Buckets" accesskey="A"/>
                        <menuitem command="cmd_edit_items" label="Edit Item Attributes" accesskey="E"/>
                        <menubar>
                                <menu label="Actions for Selected Rows" accesskey="f">
                                        <menupopup>
+                                                       <menuitem command="sel_clip" label="Copy to Clipboard" accesskey="C"/>
+                                                       <menuseparator/>
                                                        <menuitem command="cmd_add_items" label="Add Items" accesskey="I"/>
                                                        <menuitem command="cmd_add_items_to_buckets" label="Add Items to Buckets" accesskey="A"/>
                                                        <menuitem command="cmd_edit_items" label="Edit Item Attributes" accesskey="E"/>
index 84e159d..af166f8 100644 (file)
@@ -80,6 +80,7 @@ cat.copy_buckets.prototype = {
                                        try {
                                                JSAN.use('util.functional');
                                                var sel = obj.list2.retrieve_selection();
+                                               document.getElementById('clip_button').disabled = sel.length < 1;
                                                obj.selection_list2 = util.functional.map_list(
                                                        sel,
                                                        function(o) { return JSON2js(o.getAttribute('retrieve_id')); }
@@ -107,6 +108,10 @@ cat.copy_buckets.prototype = {
                obj.controller.init(
                        {
                                'control_map' : {
+                                       'sel_clip' : [
+                                               ['command'],
+                                               function() { obj.list2.clipboard(); }
+                                       ],
                                        'copy_buckets_menulist_placeholder' : [
                                                ['render'],
                                                function(e) {
index 911967a..5b98be3 100644 (file)
@@ -76,6 +76,7 @@
        </script>
 
        <commandset id="copy_buckets_cmds">
+               <command id="sel_clip" />
                <command id="cmd_copy_buckets_submit_barcode" />
                <command id="cmd_copy_buckets_print" />
                <command id="cmd_copy_buckets_reprint" />
index 8a9f3d2..f6a0d9b 100644 (file)
@@ -40,6 +40,7 @@
        <button command="copy_buckets_new_bucket" label="New Bucket"/>
        <button command="copy_buckets_delete_bucket" label="Delete Bucket"/>
        <spacer flex="1"/>
+       <button id="clip_button" command="sel_clip" label="Copy to Clipboard" disabled="true" />
        <button command="copy_buckets_delete_item" label="Delete Selected" disabled="true" image="/xul/server/skin/media/images/icon_delete.gif"/>
        <button command="copy_buckets_export" label="Add Selected" disabled="true" image="/xul/server/skin/media/images/up_arrow.gif"/>
 </hbox>
index a7eceee..ddff62b 100644 (file)
@@ -82,6 +82,7 @@ cat.record_buckets.prototype = {
                                        try {
                                                JSAN.use('util.functional');
                                                var sel = obj.list2.retrieve_selection();
+                                               document.getElementById('clip_button').disabled = sel.length < 1;
                                                obj.selection_list2 = util.functional.map_list(
                                                        sel,
                                                        function(o) { return JSON2js(o.getAttribute('retrieve_id')); }
@@ -109,6 +110,10 @@ cat.record_buckets.prototype = {
                obj.controller.init(
                        {
                                'control_map' : {
+                                       'sel_clip' : [
+                                               ['command'],
+                                               function() { obj.list2.clipboard(); }
+                                       ],
                                        'record_buckets_menulist_placeholder' : [
                                                ['render'],
                                                function(e) {
index 6523236..7853810 100644 (file)
@@ -81,6 +81,7 @@
        </script>
 
        <commandset id="record_buckets_cmds">
+               <command id="sel_clip" />
                <command id="cmd_record_buckets_submit_barcode" />
                <command id="cmd_record_buckets_print" />
                <command id="cmd_record_buckets_reprint" />
index 0f80cb3..7f367ed 100644 (file)
@@ -40,6 +40,7 @@
        <button id="record_buckets_new_bucket" label="New Bucket"/>
        <button id="record_buckets_delete_bucket" label="Delete Bucket"/>
        <spacer flex="1"/>
+       <button id="clip_button" command="sel_clip" label="Copy to Clipboard" disabled="true" />
        <button id="record_buckets_delete_item" label="Delete Selected" disabled="true" image="/xul/server/skin/media/images/icon_delete.gif"/>
        <button id="record_buckets_export" label="Add Selected" disabled="true" image="/xul/server/skin/media/images/up_arrow.gif"/>
 </hbox>
index f45cf61..7668e53 100644 (file)
@@ -47,6 +47,7 @@ cat.z3950.prototype = {
                                                try {
                                                        JSAN.use('util.functional');
                                                        var sel = obj.list.retrieve_selection();
+                                                       document.getElementById('clip_button').disabled = sel.length < 1;
                                                        var list = util.functional.map_list(
                                                                sel,
                                                                function(o) { return o.getAttribute('retrieve_id'); }
@@ -69,6 +70,10 @@ cat.z3950.prototype = {
                        obj.controller.init(
                                {
                                        control_map : {
+                                               'sel_clip' : [
+                                                       ['command'],
+                                                       function() { obj.list.clipboard(); }
+                                               ],
                                                'cmd_broken' : [
                                                        ['command'],
                                                        function() { alert('Not Yet Implemented'); }
index 69ec8dd..805ef97 100644 (file)
@@ -75,6 +75,7 @@
 
        <commandset id="cat_z3950_cmds">
                <command id="cmd_broken" />
+               <command id="sel_clip" />
        </commandset>
 
        <groupbox flex="1">
                        <vbox id="result_message" />
                        <hbox>
                                <button id="page_next" label="Fetch More Results" accesskey="M" disabled="true"/>
+                               <button id="clip_button" command="sel_clip" label="Copy to Clipboard" disabled="true"/>
                                <spacer flex="1"/>
                                <button id="marc_view" label="MARC View" accesskey="V" disabled="true"/>
                                <button id="marc_import_overlay" label="MARC Editor for Overlay" accesskey="O" disabled="true"/>