META-INF.resources.kindeditor.kindeditor-all-min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of filemanager Show documentation
Show all versions of filemanager Show documentation
KindEditor(http://kindeditor.org/) is a lightweight, Open Source(LGPL), cross browser, web based WYSIWYG HTML editor.
kind-file-manager is the upload manager and file manager for kindeditor,
it use Servlet 3.0 technology, and can be deployed as a single web fragment jar.
The newest version!
/* KindEditor 4.1.10 (2013-11-23), Copyright (C) kindsoft.net, Licence: http://www.kindsoft.net/license.php */(function(b,d){function f(a){if(!a)return!1;return Object.prototype.toString.call(a)==="[object Array]"}function j(a){if(!a)return!1;return Object.prototype.toString.call(a)==="[object Function]"}function e(a,c){for(var g=0,b=c.length;g=0}function o(a,c){c=c||"px";return a&&/^\d+$/.test(a)?a+c:a}function l(a){var c;return a&&(c=/(\d+)/.exec(a))?parseInt(c[1],10):0}function s(a){return a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function v(a){return a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function p(a){var c=a.split("-"),a="";h(c,function(c,b){a+=c>0?b.charAt(0).toUpperCase()+
b.substr(1):b});return a}function r(a){function c(a){a=parseInt(a,10).toString(16).toUpperCase();return a.length>1?a:"0"+a}return a.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,function(a,b,d,k){return"#"+c(b)+c(d)+c(k)})}function z(a,c){var c=c===d?",":c,g={},b=f(a)?a:a.split(c),t;h(b,function(a,c){if(t=/^(\d+)\.\.(\d+)$/.exec(c))for(var b=parseInt(t[1],10);b<=parseInt(t[2],10);b++)g[b.toString()]=!0;else g[c]=!0});return g}function D(a,c){return Array.prototype.slice.call(a,c||0)}function q(a,
c){return a===d?c:a}function A(a,c,g){g||(g=c,c=null);var b;if(c){var d=function(){};d.prototype=c.prototype;b=new d;h(g,function(a,c){b[a]=c})}else b=g;b.constructor=a;a.prototype=b;a.parent=c?c.prototype:null}function B(a){var c;if(c=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(a))a=c[0];c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;c.lastIndex=0;c.test(a)&&(a=a.replace(c,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));
if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+a+")");throw"JSON parse error";}function G(a,c,g){a.addEventListener?a.addEventListener(c,g,fb):a.attachEvent&&a.attachEvent("on"+c,g)}function C(a,c,g){a.removeEventListener?a.removeEventListener(c,g,fb):a.detachEvent&&a.detachEvent("on"+c,g)}function u(a,c){this.init(a,c)}function I(a){try{delete a[ma]}catch(c){a.removeAttribute&&
a.removeAttribute(ma)}}function E(a,c,g){if(c.indexOf(",")>=0)h(c.split(","),function(){E(a,this,g)});else{var b=a[ma]||null;b||(a[ma]=++gb,b=gb);L[b]===d&&(L[b]={});var t=L[b][c];t&&t.length>0?C(a,c,t[0]):(L[b][c]=[],L[b].el=a);t=L[b][c];t.length===0&&(t[0]=function(c){var g=c?new u(a,c):d;h(t,function(c,b){c>0&&b&&b.call(a,g)})});e(g,t)<0&&t.push(g);G(a,c,t[0])}}function T(a,c,g){if(c&&c.indexOf(",")>=0)h(c.split(","),function(){T(a,this,g)});else{var b=a[ma]||null;if(b)if(c===d)b in L&&(h(L[b],
function(c,g){c!="el"&&g.length>0&&C(a,c,g[0])}),delete L[b],I(a));else if(L[b]){var t=L[b][c];if(t&&t.length>0){g===d?(C(a,c,t[0]),delete L[b][c]):(h(t,function(a,c){a>0&&c===g&&t.splice(a,1)}),t.length==1&&(C(a,c,t[0]),delete L[b][c]));var k=0;h(L[b],function(){k++});k<2&&(delete L[b],I(a))}}}}function qa(a,c){if(c.indexOf(",")>=0)h(c.split(","),function(){qa(a,this)});else{var g=a[ma]||null;if(g){var b=L[g][c];if(L[g]&&b&&b.length>0)b[0]()}}}function $(a,c,g){c=/^\d{2,}$/.test(c)?c:c.toUpperCase().charCodeAt(0);
E(a,"keydown",function(b){b.ctrlKey&&b.which==c&&!b.shiftKey&&!b.altKey&&(g.call(a),b.stop())})}function M(a){for(var c={},g=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g,b;b=g.exec(a);){var d=m(b[1].toLowerCase());b=m(r(b[2]));c[d]=b}return c}function K(a){for(var c={},g=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,b;b=g.exec(a);){var d=(b[1]||b[2]||b[4]||b[6]).toLowerCase();c[d]=(b[2]?b[3]:b[4]?b[5]:b[7])||""}return c}function O(a,c){return a=
/\s+class\s*=/.test(a)?a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(a,b,d,k){return(" "+d+" ").indexOf(" "+c+" ")<0?d===""?b+c+k:b+d+" "+c+k:a}):a.substr(0,a.length-1)+' class="'+c+'">'}function Q(a){var c="";h(M(a),function(a,b){c+=a+":"+b+";"});return c}function R(a,c,g,b){function t(a){for(var a=a.split("/"),c=[],g=0,b=a.length;g0&&c.pop():d!==""&&d!="."&&c.push(d)}return"/"+c.join("/")}function k(c,g){if(a.substr(0,c.length)===c){for(var d=[],t=
0;t0&&(t+="/"+d.join("/"));b=="/"&&(t+="/");return t+a.substr(c.length)}else if(i=/^(.*)\//.exec(c))return k(i[1],++g)}c=q(c,"").toLowerCase();a.substr(0,5)!="data:"&&(a=a.replace(/([^:])\/\//g,"$1/"));if(e(c,["absolute","relative","domain"])<0)return a;g=g||location.protocol+"//"+location.host;if(b===d)var w=location.pathname.match(/^(\/.*)\//),b=w?w[1]:"";var i;if(i=/^(\w+:\/\/[^\/]*)/.exec(a)){if(i[1]!==g)return a}else if(/^\w+:/.test(a))return a;/^\//.test(a)?
a=g+t(a.substr(1)):/^\w+:\/\//.test(a)||(a=g+t(b+"/"+a));c==="relative"?a=k(g+b,0).substr(2):c==="absolute"&&a.substr(0,g.length)===g&&(a=a.substr(g.length));return a}function H(a,c,g,b,d){a==null&&(a="");var g=g||"",b=q(b,!1),d=q(d,"\t"),k="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(a,c,g,b){return c+g.replace(/<(?:br|br\s[^>]*)>/ig,"\n")+b}),a=a.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig,""),a=a.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig,
"$1
$2"),a=a.replace(/\u200B/g,""),a=a.replace(/\u00A9/g,"©"),a=a.replace(/\u00AE/g,"®"),a=a.replace(/<[^>]+/g,function(a){return a.replace(/\s+/g," ")}),w={};c&&(h(c,function(a,c){for(var g=a.split(","),b=0,d=g.length;b]*)>)([\s\S]*?)(<\/script>)/ig,"")),w.style||(a=a.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig,"")));var i=[],a=a.replace(/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g,
function(a,f,n,l,o,j,s){var f=f||"",n=n||"",m=l.toLowerCase(),r=o||"",l=j?" "+j:"",s=s||"";if(c&&!w[m])return"";l===""&&hb[m]&&(l=" /");ib[m]&&(f&&(f=" "),s&&(s=" "));Ma[m]&&(n?s="\n":f="\n");b&&m=="br"&&(s="\n");if(jb[m]&&!Ma[m])if(b){n&&i.length>0&&i[i.length-1]===m?i.pop():i.push(m);s=f="\n";o=0;for(j=n?i.length:i.length-1;o=0&&(p[a]=R(b,g));(c&&a!=="style"&&!w[m]["*"]&&!w[m][a]||m==="body"&&a==="contenteditable"||/^kindeditor_\d+$/.test(a))&&delete p[a];if(a==="style"&&b!==""){var d=M(b);h(d,function(a){c&&!w[m].style&&!w[m]["."+a]&&delete d[a]});
var V="";h(d,function(a,c){V+=a+":"+c+";"});p.style=V}});r="";h(p,function(a,c){a==="style"&&c===""||(c=c.replace(/"/g,"""),r+=" "+a+'="'+c+'"')})}m==="font"&&(m="span");return f+"<"+n+m+r+l+">"+s}),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(a,c,g,b){return c+g.replace(/\n/g,'\n')+b}),a=a.replace(/\n\s*\n/g,"\n"),a=a.replace(/\n/g,"\n");return m(a)}function U(a,c){a=a.replace(//ig,
"").replace(//ig,"").replace(/"];f(g)||(g=[g]);h(g,function(a,c){c&&d.push('')});b&&d.push("");d.push("