@hgsj/vue-print-directive 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ljj-vue-print-directive-1.0.0.tgz +0 -0
- package/package.json +14 -0
- package/print.js +1 -0
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hgsj/vue-print-directive",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A Vue.js plugin for printing HTML elements",
|
|
5
|
+
"main": "print.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"directive"
|
|
11
|
+
],
|
|
12
|
+
"author": "fix",
|
|
13
|
+
"license": "MIT"
|
|
14
|
+
}
|
package/print.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(){var z=['string','directive','text','removeChild','value','myIframe','checkbox','outerHTML','log','appendChild','object','248EOqBHb','prototype','selected','343791CqOuXQ','<style>','dom','contentWindow','8WURhfF','nodeType','OPTION','print','$print','body','input','removeAttribute','extend','textarea','position:absolute;width:0;height:0;top:-10px;left:-10px;','close','{display:none;}</style>','3671830GhErqQ','innerHTML','4447323CaOZrX','length','.no-print','children','checked','select','addEventListener','document','$el','tagName','contentDocument','3163miawLq','querySelector','4123938ivHIHX','open','querySelectorAll','nodeName','isDOM','type','setAttribute','1802820ykKlym','style','options','onload','toPrint','select-one','style,link','noPrint','4202988RTBtnt','install','err'];a=function(){return z;};return a();}var o=b;function b(c,d){var e=a();return b=function(f,g){f=f-0x82;var h=e[f];return h;},b(c,d);}(function(c,d){var m=b,e=c();while(!![]){try{var f=-parseInt(m(0xbf))/0x1*(-parseInt(m(0x9e))/0x2)+parseInt(m(0x88))/0x3+-parseInt(m(0x90))/0x4+parseInt(m(0xb2))/0x5+-parseInt(m(0xc1))/0x6+parseInt(m(0xa1))/0x7+parseInt(m(0xa5))/0x8*(parseInt(m(0xb4))/0x9);if(f===d)break;else e['push'](e['shift']());}catch(g){e['push'](e['shift']());}}}(a,0x820e4));const Print=function(c,d){var n=b;if(!(this instanceof Print))return new Print(c,d);this[n(0x8a)]=this[n(0xad)]({'noPrint':n(0xb6)},d),typeof c===n(0x93)?this[n(0xa3)]=document[n(0xc0)](c):(this[n(0x85)](c),this[n(0xa3)]=this[n(0x85)](c)?c:c[n(0xbc)]),this['init']();};Print[o(0x9f)]={'init':function(){var c=this['getStyle']()+this['getHtml']();this['writeIframe'](c);},'extend':function(c,d){for(var e in d){c[e]=d[e];}return c;},'getStyle':function(){var p=o,c='',d=document[p(0x83)](p(0x8e));for(var e=0x0;e<d['length'];e++){c+=d[e]['outerHTML'];}return c+=p(0xa2)+(this[p(0x8a)][p(0x8f)]?this[p(0x8a)][p(0x8f)]:'.no-print')+p(0xb1),c;},'getHtml':function(){var q=o,c=document[q(0x83)](q(0xab)),d=document[q(0x83)]('textarea'),e=document[q(0x83)](q(0xb9));for(var f=0x0;f<c['length'];f++){if(c[f][q(0x86)]==q(0x99)||c[f][q(0x86)]=='radio')c[f][q(0xb8)]==!![]?c[f][q(0x87)](q(0xb8),'checked'):c[f][q(0xac)](q(0xb8));else c[f][q(0x86)]==q(0x95)?c[f][q(0x87)](q(0x97),c[f][q(0x97)]):c[f][q(0x87)](q(0x97),c[f][q(0x97)]);}for(var g=0x0;g<d[q(0xb5)];g++){d[g][q(0x86)]==q(0xae)&&(d[g][q(0xb3)]=d[g]['value']);}for(var h=0x0;h<e[q(0xb5)];h++){if(e[h]['type']==q(0x8d)){var j=e[h][q(0xb7)];for(var l in j){j[l][q(0xbd)]==q(0xa7)&&(j[l][q(0xa0)]==!![]?j[l][q(0x87)](q(0xa0),q(0xa0)):j[l][q(0xac)](q(0xa0)));}}}return this['dom'][q(0x9a)];},'writeIframe':function(c){var r=o,d,e,g=document['createElement']('iframe'),h=document[r(0xaa)][r(0x9c)](g);g['id']=r(0x98),g[r(0x87)](r(0x89),r(0xaf)),d=h[r(0xa4)]||h[r(0xbe)],e=h[r(0xbe)]||h[r(0xa4)][r(0xbb)],e[r(0x82)](),e['write'](c),e[r(0xb0)]();var i=this;g[r(0x8b)]=function(){var s=r;i[s(0x8c)](d),setTimeout(function(){var t=s;document[t(0xaa)][t(0x96)](g);},0x64);};},'toPrint':function(c){var v=o;try{setTimeout(function(){var u=b;c['focus']();try{!c[u(0xbb)]['execCommand'](u(0xa8),![],null)&&c['print']();}catch(d){c['print']();}c['close']();},0xa);}catch(d){console[v(0x9b)](v(0x92),d);}},'isDOM':typeof HTMLElement==='object'?function(c){return c instanceof HTMLElement;}:function(c){var w=o;return c&&typeof c===w(0x9d)&&c[w(0xa6)]===0x1&&typeof c[w(0x84)]===w(0x93);}};const MyPlugin={};MyPlugin[o(0x91)]=function(c,d){var x=o;c['print']=Print,c[x(0x9f)][x(0xa9)]=Print,c[x(0x94)](x(0xa8),{'bind':function(e,f){var y=x;e[y(0xba)]('click',function(){Print(f['value']||e);});}});};export default MyPlugin;
|