META-INF.web.lib.js.lib.jquery.jqprint-0.3.js Maven / Gradle / Ivy
(function(c){var d;c.fn.jqprint=function(i){d=c.extend({},c.fn.jqprint.defaults,i);var j=(this instanceof jQuery)?this:c(this);if(d.operaSupport&&c.browser.opera){var h=window.open("","jqPrint-preview");h.document.open();var a=h.document}else{var b=c("");if(!d.debug){b.css({position:"absolute",width:"0px",height:"0px",left:"-600px",top:"-600px"})}b.appendTo("body");var a=b[0].contentWindow.document}if(d.importCSS){if(c("link[media=print]").length>0){c("link[media=print]").each(function(){a.write("")})}else{c("link").each(function(){a.write("")})}}if(d.printContainer){a.write(j.outer())}else{j.each(function(){a.write(c(this).html())})}a.close();(d.operaSupport&&c.browser.opera?h:b[0].contentWindow).focus();setTimeout(function(){(d.operaSupport&&c.browser.opera?h:b[0].contentWindow).print();if(h){h.close()}},1000)};c.fn.jqprint.defaults={debug:false,importCSS:true,printContainer:true,operaSupport:true};jQuery.fn.outer=function(){return c(c("").html(this.clone())).html()}})(jQuery);