diff --git a/index.html b/index.html index de3957e..2b35544 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,10 @@ + + + + @@ -18,11 +22,43 @@

Sticker Print Demo

-
- - +
+
+ +
+
+
+ + +
+
+ + + \ No newline at end of file diff --git a/lib/zebra-browser-print/BrowserPrint-3.1.250.min.js b/lib/zebra-browser-print/BrowserPrint-3.1.250.min.js new file mode 100644 index 0000000..509159a --- /dev/null +++ b/lib/zebra-browser-print/BrowserPrint-3.1.250.min.js @@ -0,0 +1,17 @@ +var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(e,g,k){if(null==e)throw new TypeError("The 'this' value for String.prototype."+k+" must not be null or undefined");if(g instanceof RegExp)throw new TypeError("First argument to String.prototype."+k+" must not be a regular expression");return e+""};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1; +$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(e,g,k){e!=Array.prototype&&e!=Object.prototype&&(e[g]=k.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this); +$jscomp.polyfill=function(e,g,k,h){if(g){k=$jscomp.global;e=e.split(".");for(h=0;h=g}},"es6","es3"); +var BrowserPrint=function(){function e(a,c){var b=new XMLHttpRequest;"withCredentials"in b?b.open(a,c,!0):"undefined"!=typeof XDomainRequest?(b=new XDomainRequest,b.open(a,c)):b=null;return b}function g(a,c,b,d){void 0!==a&&(void 0===b&&(b=a.sendFinishedCallback),void 0===d&&(d=a.sendErrorCallback));return h(c,b,d)}function k(a,c,b){void 0===c&&(c=f.defaultSuccessCallback);void 0===b&&(b=f.defaultErrorCallback);return h(a,c,b)}function h(a,c,b){a.onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&& +200===a.status?""===a.responseType?c(a.responseText):c(a.response):a.readyState===XMLHttpRequest.DONE&&(b?b(a.response):console.log("error occurred with no errorCallback set."))};return a}var f={},p={},q=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);navigator.userAgent.indexOf("Trident/7.0");var m="http://127.0.0.1:9100/";q&&"https:"===location.protocol&&(m="https://127.0.0.1:9101/");f.Device=function(a){var c=this;this.name=a.name;this.deviceType=a.deviceType;this.connection=a.connection; +this.uid=a.uid;this.version=2;this.provider=a.provider;this.manufacturer=a.manufacturer;this.readRetries="bluetooth"===this.connection?1:0;this.sendErrorCallback=function(b){};this.sendFinishedCallback=function(b){};this.readErrorCallback=function(b){};this.readFinishedCallback=function(b){};this.send=function(b,a,l){var d=e("POST",m+"write");d&&(g(c,d,a,l),d.send(JSON.stringify({device:{name:this.name,uid:this.uid,connection:this.connection,deviceType:this.deviceType,version:this.version,provider:this.provider, +manufacturer:this.manufacturer},data:b})))};this.sendUrl=function(b,a,l,r){var d=e("POST",m+"write");d&&(g(c,d,a,l),b={device:{name:this.name,uid:this.uid,connection:this.connection,deviceType:this.deviceType,version:this.version,provider:this.provider,manufacturer:this.manufacturer},url:b},null!=r&&void 0!=r&&(b.options=r),d.send(JSON.stringify(b)))};this.sendFile=function(b,a,l){if("string"===typeof b)f.loadFileFromUrl(b,function(b){c.sendFile(b,a,l)},l);else{var d=e("POST",m+"write");if(d){d.responseType= +"text";k(d,a,l);var n=new FormData,g={};g.device=c;n.append("json",JSON.stringify(g));n.append("blob",b);d.send(n)}}};this.convertAndSendFile=function(b,a,l,c){c||(c={});c.action||(c.action="print");f.convert(b,this,c,a,l)};this.read=function(b,a){var d=e("POST",m+"read");d&&(void 0!==c&&(void 0===b&&(b=c.readFinishedCallback),void 0===a&&(a=c.readErrorCallback)),h(d,b,a),d.send(JSON.stringify({device:{name:this.name,uid:this.uid,connection:this.connection,deviceType:this.deviceType,version:this.version, +provider:this.provider,manufacturer:this.manufacturer}})))};this.readUntilStringReceived=function(a,d,c,e,f){f||(f="");void 0===e&&(e=this.readRetries);d=function(b,d,c,l,e){return function(f){if(f&&0!==f.length)l=0;else if(0>=l){d(e);return}f=e+f;""!==a&&-1