XWWitPark/witpark_jzzs/xw_jzzs_web/public/lib/summernote/summernote.js

2 lines
68 KiB
JavaScript
Raw Normal View History

2024-09-12 00:10:00 +00:00
/* 2020-9-22 15:23:19 | 版权所有 军懋国兴 */
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(window.jQuery)}(function(N){Array.prototype.reduce||(Array.prototype.reduce=function(e){var t,n=Object(this),o=n.length>>>0,i=0;if(2===arguments.length)t=arguments[1];else{for(;i<o&&!(i in n);)i++;if(o<=i)throw new TypeError("Reduce of empty array with no initial value");t=n[i++]}for(;i<o;i++)i in n&&(t=e(t,n[i],i,n));return t}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(e){for(var t,n=Object(this),o=n.length>>>0,i=[],r=2<=arguments.length?arguments[1]:void 0,a=0;a<o;a++){a in n&&(t=n[a],e.call(r,t,a,n)&&i.push(t))}return i});var n,e="function"==typeof define&&define.amd,S={isMac:-1<navigator.appVersion.indexOf("Mac"),isMSIE:-1<navigator.userAgent.indexOf("MSIE")||-1<navigator.userAgent.indexOf("Trident"),isFF:-1<navigator.userAgent.indexOf("Firefox"),jqueryVersion:parseFloat(N.fn.jquery),isSupportAmd:e,hasCodeMirror:e?require.specified("CodeMirror"):!!window.CodeMirror,isFontInstalled:function(e){var t="Comic Sans MS"===e?"Courier New":"Comic Sans MS",n=N("<div>").css({position:"absolute",left:"-9999px",top:"-9999px",fontSize:"200px"}).text("mmmmmmmmmwwwwwww").appendTo(document.body),o=n.css("fontFamily",t).width(),i=n.css("fontFamily",e+","+t).width();return n.remove(),o!==i},isW3CRangeSupport:!!document.createRange},p=(n=0,{eq:function(t){return function(e){return t===e}},eq2:function(e,t){return e===t},peq2:function(n){return function(e,t){return e[n]===t[n]}},ok:function(){return!0},fail:function(){return!1},self:function(e){return e},not:function(e){return function(){return!e.apply(e,arguments)}},and:function(t,n){return function(e){return t(e)&&n(e)}},uniqueId:function(e){var t=++n+"";return e?e+t:t},rect2bnd:function(e){var t=N(document);return{top:e.top+t.scrollTop(),left:e.left+t.scrollLeft(),width:e.right-e.left,height:e.bottom-e.top}},invertObject:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[e[t]]=t);return n}}),v={head:t,last:i,initial:function(e){return e.slice(0,e.length-1)},tail:r,prev:function(e,t){var n=e.indexOf(t);return-1===n?null:e[n-1]},next:function(e,t){var n=e.indexOf(t);return-1===n?null:e[n+1]},find:function(e,t){for(var n=0,o=e.length;n<o;n++){var i=e[n];if(t(i))return i}},contains:a,all:function(e,t){for(var n=0,o=e.length;n<o;n++)if(!t(e[n]))return!1;return!0},sum:function(e,n){return n=n||p.self,e.reduce(function(e,t){return e+n(t)},0)},from:function(e){for(var t=[],n=-1,o=e.length;++n<o;)t[n]=e[n];return t},clusterBy:function(e,o){return e.length?r(e).reduce(function(e,t){var n=i(e);return o(i(n),t)?n[n.length]=t:e[e.length]=[t],e},[[t(e)]]):[]},compact:function(e){for(var t=[],n=0,o=e.length;n<o;n++)e[n]&&t.push(e[n]);return t},unique:function(e){for(var t=[],n=0,o=e.length;n<o;n++)a(t,e[n])||t.push(e[n]);return t}};function t(e){return e[0]}function i(e){return e[e.length-1]}function r(e){return e.slice(1)}function a(e,t){return-1!==N.inArray(t,e)}var o,s,l,d,c,u,f,h,g,m,b,C=String.fromCharCode(160),F=(o=x("LI"),s=x("TABLE"),l=function(e){return e&&/^UL|^OL/.test(e.nodeName.toUpperCase())},d=x("BLOCKQUOTE"),c=function(e){return L(e)||d(e)||y(e)},u=x("A"),f=x("BODY"),h=S.isMSIE?"&nbsp;":"<br>",g=function(e,t){for(;e;){if(t(e))return e;if(y(e))break;e=e.parentNode}return null},m=function(e){for(var t=0;e=e.previousSibling;)t+=1;return t},b=x("TEXTAREA"),{NBSP_CHAR:C,ZERO_WIDTH_NBSP_CHAR:"\ufeff",blank:h,emptyPara:"<p>"+h+"</p>",makePredByNodeName:x,isEditable:y,isControlSizing:function(e){return e&&N(e).hasClass("note-control-sizing")},buildLayoutInfo:k,makeLayoutInfo:function(e){var t,n=N(e).closest(".note-editor, .note-air-editor, .note-air-layout");return n.length?(t=n.is(".note-editor, .note-air-editor")?n:N("#note-editor-"+v.last(n.attr("id").split("-"))),k(t)):null},isText:w,isVoid:T,isPara:P,isPurePara:function(e){return P(e)&&!o(e)},isInline:I,isBodyInline:function(e){return I(e)&&!g(e,P)},isBody:f,isParaInline:function(e){return I(e)&&!!g(e,P)},isList:l,isTable:s,isCell:L,isBlockquote:d,isBodyContainer:c,isAnchor:u,isDiv:x("DIV"),isLi:o,isBR:x("BR"),isSpan:x("S