browser staff : printing cont.
authorBill Erickson <berick@esilibrary.com>
Wed, 16 Apr 2014 15:23:31 +0000 (11:23 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 16 Apr 2014 15:23:31 +0000 (11:23 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/staff/services/grid.js
Open-ILS/web/js/ui/default/staff/services/printstore.js

index d524cab..a9f1918 100644 (file)
@@ -431,7 +431,7 @@ angular.module('egGridMod',
             }
 
             grid.printCSV = function() {
-                egPrintStore.print('text/csv', grid.generateCSV())
+                egPrintStore.print('text/plain', grid.generateCSV())
                 .then(function() { console.debug('print complete') });
             }
 
index d3c3081..501c026 100644 (file)
@@ -16,7 +16,7 @@ angular.module('egCoreMod')
     service.pending = [];
     service.socket = null;
     service.hatchAvailable = null;
-    service.hatchURL = 'ws://localhost:8080/hatch/'; // TODO: configuration/ssl
+    service.hatchURL = 'wss://localhost:8443/hatch'; 
 
     service.hatchSend = function(msg) {
 
@@ -102,27 +102,29 @@ angular.module('egCoreMod')
             }
 
             var srcMsg = service.messages[msgObj.msgid];
-            delete service.messages[msgObj.msgid];
-            srcMsg.deferred.resolve(msgObj);
+            if (srcMsg) {
+                delete service.messages[msgObj.msgid];
+                srcMsg.deferred.resolve(msgObj);
+            }
         }
     }
 
-    service.browserPrint = function(mime, data) {
+    service.browserPrint = function(contentType, content) {
         // let our local print container handle printing
-        service.onBrowserPrint(mime, data);
+        service.onBrowserPrint(contentType, content);
     }
 
-    service.print = function(mime, data) {
+    service.print = function(contentType, content) {
         if (service.hatchAvailable === false) {
-            service.browserPrint(mime, data);
+            service.browserPrint(contentType, content);
             return $q.when();
         } 
         
         return service.hatchSend({
             key : 'no-op', 
             action : 'print',
-            mime : mime
-            value : data, 
+            content : content
+            contentType : contentType
             //printer : printer // TODO: prefs, etc.
         });
     }