You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
14 KiB
1 line
14 KiB
|
2 months ago
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.printJS=t():e.printJS=t()}(window,function(){return r={},o.m=n={"./src/index.js":function(e,t,n){"use strict";n.r(t);n("./src/sass/index.scss");n=n("./src/js/init.js").default.init;"undefined"!=typeof window&&(window.printJS=n),t.default=n},"./src/js/browser.js":function(e,t,n){"use strict";n.r(t);var r={isFirefox:function(){return"undefined"!=typeof InstallTrigger},isIE:function(){return-1!==navigator.userAgent.indexOf("MSIE")||!!document.documentMode},isEdge:function(){return!r.isIE()&&!!window.StyleMedia},isChrome:function(e){return!!(0<arguments.length&&void 0!==e?e:window).chrome},isSafari:function(){return 0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")||-1!==navigator.userAgent.toLowerCase().indexOf("safari")},isIOSChrome:function(){return-1!==navigator.userAgent.toLowerCase().indexOf("crios")}};t.default=r},"./src/js/functions.js":function(e,t,n){"use strict";n.r(t),n.d(t,"addWrapper",function(){return r}),n.d(t,"capitalizePrint",function(){return l}),n.d(t,"collectStyles",function(){return s}),n.d(t,"addHeader",function(){return d}),n.d(t,"cleanUp",function(){return c}),n.d(t,"isRawHTML",function(){return u});var o=n("./src/js/modal.js"),i=n("./src/js/browser.js");function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){return'<div style="'+("font-family:"+t.font+" !important; font-size: "+t.font_size+" !important; width:100%;")+'">'+e+"</div>"}function l(e){return e.charAt(0).toUpperCase()+e.slice(1)}function s(e,t){for(var n="",r=(document.defaultView||window).getComputedStyle(e,""),o=0;o<r.length;o++)(-1!==t.targetStyles.indexOf("*")||-1!==t.targetStyle.indexOf(r[o])||function(e,t){for(var n=0;n<e.length;n++)if("object"===a(t)&&-1!==t.indexOf(e[n]))return!0;return!1}(t.targetStyles,r[o]))&&r.getPropertyValue(r[o])&&(n+=r[o]+":"+r.getPropertyValue(r[o])+";");return n+="max-width: "+t.maxWidth+"px !important; font-size: "+t.font_size+" !important;"}function d(e,t){var n,r,o=document.createElement("div");u(t.header)?o.innerHTML=t.header:(n=document.createElement("h1"),r=document.createTextNode(t.header),n.appendChild(r),n.setAttribute("style",t.headerStyle),o.appendChild(n)),e.insertBefore(o,e.childNodes[0])}function c(t){t.showModal&&o.default.close(),t.onLoadingEnd&&t.onLoadingEnd(),(t.showModal||t.onLoadingStart)&&window.URL.revokeObjectURL(t.printable);var n="mouseover";(i.default.isChrome()||i.default.isFirefox())&&(n="focus");function r(){window.removeEventListener(n,r),t.onPrintDialogClose();var e=document.getElementById(t.frameId);e&&e.remove()}window.addEventListener(n,r)}function u(e){return new RegExp("<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>").test(e)}},"./src/js/html.js":function(e,t,n){"use strict";n.r(t);var l=n("./src/js/functions.js"),r=n("./src/js/print.js");function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.default={print:function(e,t){var n,n="object"===o(n=e.printable)&&n&&(n instanceof HTMLElement||1===n.nodeType)?e.printable:document.getElementById(e.printable);n?(e.printableElement=function e(t,n){var r=t.cloneNode();var o=Array.prototype.slice.call(t.childNodes);for(var i=0;i<o.length;i++){var a;-1===n.ignoreElements.indexOf(o[i].id)&&(a=e(o[i],n),r.appendChild(a))}n.scanStyles&&1===t.nodeType&&r.setAttribute("style",Object(l.collectStyles)(t,n));switch(t.tagName){case"SELECT":r.value=t.value;break;case"CANVAS":r.getContext("2d").drawImage(t,0,0)}return r}(n,e),e.header&&Object(l.addHeader)(e.printableElement,e),r.default.send(e,t)):window.console.error("Invalid HTML element id: "+e.printable)}}},"./src/js/image.js":function(e,t,n
|