From 83fe3d95782bafd65987a60a1ebe139b0aeeddad Mon Sep 17 00:00:00 2001 From: hello Date: Wed, 20 Jan 2021 18:52:47 +0800 Subject: [PATCH] =?UTF-8?q?add:=20jqpring=E6=B7=BB=E5=8A=A0jquery=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E6=89=93=E5=8D=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/navs.json | 4 + lib/layui/lay/okmodules/jqprint.js | 139 +++++++++++++++++++++++++++++ lib/layui/layui.js | 3 +- pages/tripartite/jqprint.html | 69 ++++++++++++++ 4 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 lib/layui/lay/okmodules/jqprint.js create mode 100644 pages/tripartite/jqprint.html diff --git a/data/navs.json b/data/navs.json index b756b2f..b55a668 100644 --- a/data/navs.json +++ b/data/navs.json @@ -377,6 +377,10 @@ { "title": "okLayx", "href": "pages/tripartite/okLayx.html" + }, + { + "title": "jqprint", + "href": "pages/tripartite/jqprint.html" } ] }, diff --git a/lib/layui/lay/okmodules/jqprint.js b/lib/layui/lay/okmodules/jqprint.js new file mode 100644 index 0000000..5f4fa03 --- /dev/null +++ b/lib/layui/lay/okmodules/jqprint.js @@ -0,0 +1,139 @@ +// ----------------------------------------------------------------------- +// Eros Fratini - eros@recoding.it +// jqprint 0.3 +// +// - 19/06/2009 - some new implementations, added Opera support +// - 11/05/2009 - first sketch +// +// Printing plug-in for jQuery, evolution of jPrintArea: http://plugins.jquery.com/project/jPrintArea +// requires jQuery 1.3.x +// +// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php +//------------------------------------------------------------------------ +"use strict"; +layui.define(["jquery"], function (exports) { + var $ = layui.jquery; + var opt; + $.fn.jqprint = function (options) { + opt = $.extend({}, $.fn.jqprint.defaults, options); + + var $element = (this instanceof layui.jquery) ? this : $(this); + + if (opt.operaSupport && $.support.opera) + { + var tab = window.open("","jqPrint-preview"); + tab.document.open(); + + var doc = tab.document; + } + else + { + var $iframe = $("