app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js in glebtv-ckeditor-4.1.1.7 vs app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js in glebtv-ckeditor-4.2.1
- old
+ new
@@ -1 +1 @@
-(function(){function i(n){for(var r={name:"autoCloseBrackets",Backspace:function(t){if(t.somethingSelected())return CodeMirror.Pass;var i=t.getCursor(),r=t.getLine(i.line);if(i.ch&&i.ch<r.length&&n.indexOf(r.slice(i.ch-1,i.ch+1))%2==0)t.replaceRange("",CodeMirror.Pos(i.line,i.ch-1),CodeMirror.Pos(i.line,i.ch+1));else return CodeMirror.Pass}},u=[],i=0;i<n.length;i+=2)(function(n,i){function e(t){var r=t.getSelection();t.replaceSelection(n+r+i)}function f(n){var t=n.getCursor(),r=n.getRange(t,CodeMirror.Pos(t.line,t.ch+1));if(r!=i||n.somethingSelected())return CodeMirror.Pass;n.execCommand("goCharRight")}n!=i&&u.push(i),r["'"+n+"'"]=function(r){if(r.somethingSelected())return e(r);if(n!=i||f(r)==CodeMirror.Pass){var o=r.getCursor(),s=CodeMirror.Pos(o.line,o.ch+1),h=r.getLine(o.line),c=h.charAt(o.ch);if(h.length==o.ch||u.indexOf(c)>=0||t.test(c))r.replaceSelection(n+i,{head:s,anchor:s});else return CodeMirror.Pass}},n!=i&&(r["'"+i+"'"]=f)})(n.charAt(i),n.charAt(i+1));return r}var n="()[]{}''\"\"",t=/\s/;CodeMirror.defineOption("autoCloseBrackets",!1,function(t,r,u){var f=u&&u!=CodeMirror.Init;r&&!f?t.addKeyMap(i(typeof r=="string"?r:n)):!r&&f&&t.removeKeyMap("autoCloseBrackets")})})(),function(){function n(n,u){var e=n.getCursor(),o=n.getTokenAt(e),l=CodeMirror.innerMode(n.getMode(),o.state),s=l.state,a,c,v,f;if(l.mode.name!="xml")return CodeMirror.Pass;var h=n.getOption("autoCloseTags"),y=l.mode.configuration=="html",p=typeof h=="object"&&h.dontCloseTags||y&&i,w=typeof h=="object"&&h.indentTags||y&&r;if(u==">"&&s.tagName){if(f=s.tagName,o.end>e.ch&&(f=f.slice(0,f.length-o.end+e.ch)),a=f.toLowerCase(),o.type=="tag"&&s.type=="closeTag"||o.string.indexOf("/")>-1||p&&t(p,a)>-1)return CodeMirror.Pass;c=w&&t(w,a)>-1,v=c?CodeMirror.Pos(e.line+1,0):CodeMirror.Pos(e.line,e.ch+1),n.replaceSelection(">"+(c?"\n\n":"")+"<\/"+f+">",{head:v,anchor:v}),c&&(n.indentLine(e.line+1),n.indentLine(e.line+2));return}if(u=="/"&&o.string=="<"){f=s.context&&s.context.tagName,f&&n.replaceSelection("/"+f+">","end");return}return CodeMirror.Pass}function t(n,t){if(n.indexOf)return n.indexOf(t);for(var i=0,r=n.length;i<r;++i)if(n[i]==t)return i;return-1}CodeMirror.defineOption("autoCloseTags",!1,function(t,i,r){if(i&&(r==CodeMirror.Init||!r)){var u={name:"autoCloseTags"};(typeof i!="object"||i.whenClosing)&&(u["'/'"]=function(t){return n(t,"/")}),(typeof i!="object"||i.whenOpening)&&(u["'>'"]=function(t){return n(t,">")}),t.addKeyMap(u)}else!i&&r!=CodeMirror.Init&&r&&t.removeKeyMap("autoCloseTags")});var i=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],r=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"]}(),function(){function i(n){var e=n.getCursor(),t=n.getTokenAt(e),i=CodeMirror.innerMode(n.getMode(),t.state).mode,r,o,u,f,s;if(t.type=="comment"&&i.blockCommentStart&&(o=t.string.indexOf(i.blockCommentEnd),u=n.getRange(CodeMirror.Pos(e.line,0),CodeMirror.Pos(e.line,t.end)),o==-1||o!=t.string.length-i.blockCommentEnd.length))if(t.string.indexOf(i.blockCommentStart)==0){if(r=u.slice(0,t.start),!/^\s*$/.test(r))for(r="",s=0;s<t.start;++s)r+=" "}else(f=u.indexOf(i.blockCommentContinue))!=-1&&f+i.blockCommentContinue.length>t.start&&/^\s*$/.test(u.slice(0,f))&&(r=u.slice(0,f));if(r!=null)n.replaceSelection("\n"+r+i.blockCommentContinue,"end");else return CodeMirror.Pass}for(var t=["clike","css","javascript"],n=0;n<t.length;++n)CodeMirror.extendMode(t[n],{blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * "});CodeMirror.defineOption("continueComments",null,function(n,t,r){r&&r!=CodeMirror.Init&&n.removeKeyMap("continueComment");var u={name:"continueComment"};u[typeof t=="string"?t:"Enter"]=i,n.addKeyMap(u)})}(),function(){function u(t){function a(r,u,f){var e,a,s,l;if(r.text)for(e=o?0:r.text.length-1,a=o?r.text.length:-1,f!=null&&(e=f+h);e!=a;e+=h)if(s=r.text.charAt(e),p.test(s)&&t.getTokenAt(n(u,e+1)).type==y)if(l=i[s],l.charAt(1)==">"==o)c.push(s);else{if(c.pop()!=l.charAt(0))return{pos:e,match:!1};if(!c.length)return{pos:e,match:!0}}}var f=t.getCursor(),s=t.getLineHandle(f.line),u=f.ch-1,l=u>=0&&i[s.text.charAt(u)]||i[s.text.charAt(++u)],r,e,v;if(!l)return null;var o=l.charAt(1)==">",h=o?1:-1,y=t.getTokenAt(n(f.line,u+1)).type,c=[s.text.charAt(u)],p=/[(){}[\]]/;for(r=f.line,v=o?Math.min(r+100,t.lineCount()):Math.max(-1,r-100);r!=v;r+=h)if(e=r==f.line?a(s,r,u):a(t.getLineHandle(r),r),e)break;return{from:n(f.line,u),to:e&&n(r,e.pos),match:e&&e.match}}function f(t,i){var f=u(t),e;if(f&&!(t.getLine(f.from.line).length>r)&&(!f.to||!(t.getLine(f.to.line).length>r))){var s=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",c=t.markText(f.from,n(f.from.line,f.from.ch+1),{className:s}),h=f.to&&t.markText(f.to,n(f.to.line,f.to.ch+1),{className:s});if(o&&t.state.focused&&t.display.input.focus(),e=function(){t.operation(function(){c.clear(),h&&h.clear()})},i)setTimeout(e,800);else return e}}function e(n){n.operation(function(){t&&(t(),t=null),n.somethingSelected()||(t=f(n,!1))})}var o=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),n=CodeMirror.Pos,r=1e3,i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},t=null;CodeMirror.defineOption("matchBrackets",!1,function(n,t){if(t)n.on("cursorActivity",e);else n.off("cursorActivity",e)}),CodeMirror.defineExtension("matchBrackets",function(){f(this,!0)}),CodeMirror.defineExtension("findMatchingBracket",function(){return u(this)})}(),CodeMirror.newFoldFunction=function(n,t){if(t==null&&(t="↔"),typeof t=="string"){var i=document.createTextNode(t);t=document.createElement("span"),t.appendChild(i),t.className="CodeMirror-foldmarker"}return function(i,r){var u,e,o,f,s,h;if(typeof r=="number"&&(r=CodeMirror.Pos(r,0)),u=n(i,r),u){for(e=i.findMarksAt(u.from),o=0,f=0;f<e.length;++f)e[f].__isFold&&(++o,e[f].clear());if(!o){s=t.cloneNode(!0);CodeMirror.on(s,"mousedown",function(){h.clear()});h=i.markText(u.from,u.to,{replacedWith:s,clearOnEnter:!0,__isFold:!0})}}}},CodeMirror.braceRangeFinder=function(n,t){for(var f=t.line,l=n.getLine(f),y=l.length,s,a,e,v,p,h,w,r,u,i,o,c;;){if(e=l.lastIndexOf("{",y),e<t.ch)break;if(a=n.getTokenAt(CodeMirror.Pos(f,e+1)).type,!/^(comment|string)/.test(a)){s=e;break}y=e-1}if(s!=null&&!(l.lastIndexOf("}")>s)){v=1,p=n.lineCount();n:for(r=f+1;r<p;++r)for(u=n.getLine(r),i=0;;){if(o=u.indexOf("{",i),c=u.indexOf("}",i),o<0&&(o=u.length),c<0&&(c=u.length),i=Math.min(o,c),i==u.length)break;if(n.getTokenAt(CodeMirror.Pos(r,i+1)).type==a)if(i==o)++v;else if(!--v){h=r,w=i;break n}++i}if(h!=null&&h!=f+1)return{from:CodeMirror.Pos(f,s+1),to:CodeMirror.Pos(h,w)}}},CodeMirror.tagRangeFinder=function(){var n="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",t=new RegExp("<(/?)(["+n+"]["+i+"]*)","g");return function(n,i){function l(){if(!(e>=n.lastLine()))return r=0,o=n.getLine(++e),!0}function a(){for(var n,t,i;;){if(n=o.indexOf(">",r),n==-1)if(l())continue;else return;return t=o.lastIndexOf("/",n),i=t>-1&&/^\s*$/.test(o.slice(t+1,n)),r=n+1,i?"selfClose":"regular"}}function v(){for(;;){t.lastIndex=r;var n=t.exec(o);if(!n)if(l())continue;else return;return r=n.index+n[0].length,n}}for(var e=i.line,r=i.ch,o=n.getLine(e),u=[],y,h,c,s;;){if(h=v(),!h||e!=i.line||!(c=a()))return;if(!h[1]&&c!="selfClose"){u.push(h[2]),y=r;break}}for(;;){var f=v(),c,p=e,w=r-(f?f[0].length:0);if(!f||!(c=a()))return;if(c!="selfClose")if(f[1]){for(s=u.length-1;s>=0;--s)if(u[s]==f[2]){u.length=s;break}if(!u.length)return{from:CodeMirror.Pos(i.line,y),to:CodeMirror.Pos(p,w)}}else u.push(f[2])}}}(),function(){CodeMirror.defineExtension("autoFormatAll",function(n,t){function v(){h+="\n",e=!0,++a}for(var r=this,f=r.getMode(),o=r.getRange(n,t).split("\n"),s=CodeMirror.copyState(f,r.getTokenAt(n).state),y=r.getOption("tabSize"),h="",a=0,e=n.ch==0,i,u=0;u<o.length;++u){for(i=new CodeMirror.StringStream(o[u],y);!i.eol();){var c=CodeMirror.innerMode(f,s),p=f.token(i,s),l=i.current();i.start=i.pos,(!e||/\S/.test(l))&&(h+=l,e=!1),!e&&c.mode.newlineAfterToken&&c.mode.newlineAfterToken(p,l,i.string.slice(i.pos)||o[u+1]||"",c.state)&&v()}!i.pos&&f.blankLine&&f.blankLine(s),!e&&u<o.length-1&&v()}r.operation(function(){r.replaceRange(h,n,t);for(var i=n.line+1,u=n.line+a;i<=u;++i)r.indentLine(i,"smart");r.setCursor({line:0,ch:0})})})}(),function(){CodeMirror.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(n,t){return/^[;{}]$/.test(t)}}),CodeMirror.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(n,t,i,r){return this.jsonMode?/^[\[,{]$/.test(t)||/^}/.test(i):t==";"&&r.lexical&&r.lexical.type==")"?!1:/^[;{}]$/.test(t)&&!/^;/.test(i)}});var n=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;CodeMirror.extendMode("xml",{commentStart:"<!--",commentEnd:"-->",newlineAfterToken:function(t,i,r,u){var f=!1;return this.configuration=="html"&&(f=u.context?n.test(u.context.tagName):!1),!f&&(t=="tag"&&/>$/.test(i)&&u.context||/^</.test(r))}}),CodeMirror.defineExtension("commentRange",function(n,t,i){var r=this,u=CodeMirror.innerMode(r.getMode(),r.getTokenAt(t).state).mode;r.operation(function(){if(n)r.replaceRange(u.commentEnd,i),r.replaceRange(u.commentStart,t),t.line==i.line&&t.ch==i.ch&&r.setCursor(t.line,t.ch+u.commentStart.length);else{var f=r.getRange(t,i),e=f.indexOf(u.commentStart),o=f.lastIndexOf(u.commentEnd);e>-1&&o>-1&&o>e&&(f=f.substr(0,e)+f.substring(e+u.commentStart.length,o)+f.substr(o+u.commentEnd.length)),r.replaceRange(f,t,i)}})}),CodeMirror.defineExtension("autoIndentRange",function(n,t){var i=this;this.operation(function(){for(var r=n.line;r<=t.line;r++)i.indentLine(r,"smart")})}),CodeMirror.defineExtension("autoFormatRange",function(n,t){function v(){h+="\n",e=!0,++a}for(var i=this,f=i.getMode(),o=i.getRange(n,t).split("\n"),s=CodeMirror.copyState(f,i.getTokenAt(n).state),y=i.getOption("tabSize"),h="",a=0,e=n.ch==0,r,u=0;u<o.length;++u){for(r=new CodeMirror.StringStream(o[u],y);!r.eol();){var c=CodeMirror.innerMode(f,s),p=f.token(r,s),l=r.current();r.start=r.pos,(!e||/\S/.test(l))&&(h+=l,e=!1),!e&&c.mode.newlineAfterToken&&c.mode.newlineAfterToken(p,l,r.string.slice(r.pos)||o[u+1]||"",c.state)&&v()}!r.pos&&f.blankLine&&f.blankLine(s),!e&&u<o.length-1&&v()}i.operation(function(){i.replaceRange(h,n,t);for(var r=n.line+1,u=n.line+a;r<=u;++r)i.indentLine(r,"smart");i.setSelection(n,i.getCursor(!1))})})}(),function(){function r(n){this.minChars=typeof n=="object"&&n.minChars||t,this.style=typeof n=="object"&&n.style||i,this.overlay=null}function n(n){n.operation(function(){var t=n._matchHighlightState,i;(t.overlay&&(n.removeOverlay(t.overlay),t.overlay=null),n.somethingSelected())&&((i=n.getSelection().replace(/^\s+|\s+$/g,""),i.length<t.minChars)||n.addOverlay(t.overlay=u(i,t.style)))})}function u(n,t){return{token:function(i){if(i.match(n))return t;i.next(),i.skipTo(n.charAt(0))||i.skipToEnd()}}}var t=2,i="matchhighlight";CodeMirror.defineOption("highlightSelectionMatches",!1,function(t,i,u){var e=u&&u!=CodeMirror.Init,f;if(i&&!e){t._matchHighlightState=new r(i);t.on("cursorActivity",n)}else!i&&e&&(f=t._matchHighlightState.overlay,f&&t.removeOverlay(f),t._matchHighlightState=null,t.off("cursorActivity",n))})}()
+(function(){function i(n){for(var r={name:"autoCloseBrackets",Backspace:function(t){if(t.somethingSelected())return CodeMirror.Pass;var i=t.getCursor(),r=t.getLine(i.line);if(i.ch&&i.ch<r.length&&n.indexOf(r.slice(i.ch-1,i.ch+1))%2==0)t.replaceRange("",CodeMirror.Pos(i.line,i.ch-1),CodeMirror.Pos(i.line,i.ch+1));else return CodeMirror.Pass}},u="",i=0;i<n.length;i+=2)(function(n,i){function e(t){var r=t.getSelection();t.replaceSelection(n+r+i)}function f(n){var t=n.getCursor(),r=n.getRange(t,CodeMirror.Pos(t.line,t.ch+1));if(r!=i||n.somethingSelected())return CodeMirror.Pass;n.execCommand("goCharRight")}n!=i&&(u+=i),r["'"+n+"'"]=function(r){if(n=="'"&&r.getTokenAt(r.getCursor()).type=="comment")return CodeMirror.Pass;if(r.somethingSelected())return e(r);if(n!=i||f(r)==CodeMirror.Pass){var o=r.getCursor(),s=CodeMirror.Pos(o.line,o.ch+1),h=r.getLine(o.line),c=h.charAt(o.ch);if(h.length==o.ch||u.indexOf(c)>=0||t.test(c))r.replaceSelection(n+i,{head:s,anchor:s});else return CodeMirror.Pass}},n!=i&&(r["'"+i+"'"]=f)})(n.charAt(i),n.charAt(i+1));return r}var n="()[]{}''\"\"",t=/\s/;CodeMirror.defineOption("autoCloseBrackets",!1,function(t,r,u){var f=u&&u!=CodeMirror.Init;r&&!f?t.addKeyMap(i(typeof r=="string"?r:n)):!r&&f&&t.removeKeyMap("autoCloseBrackets")})})(),function(){function n(n,u){var e=n.getCursor(),o=n.getTokenAt(e),l=CodeMirror.innerMode(n.getMode(),o.state),s=l.state,a,c,v,f;if(l.mode.name!="xml")return CodeMirror.Pass;var h=n.getOption("autoCloseTags"),y=l.mode.configuration=="html",p=typeof h=="object"&&h.dontCloseTags||y&&i,w=typeof h=="object"&&h.indentTags||y&&r;if(u==">"&&s.tagName){if(f=s.tagName,o.end>e.ch&&(f=f.slice(0,f.length-o.end+e.ch)),a=f.toLowerCase(),o.type=="tag"&&s.type=="closeTag"||o.string.indexOf("/")==o.string.length-1||p&&t(p,a)>-1)return CodeMirror.Pass;c=w&&t(w,a)>-1,v=c?CodeMirror.Pos(e.line+1,0):CodeMirror.Pos(e.line,e.ch+1),n.replaceSelection(">"+(c?"\n\n":"")+"<\/"+f+">",{head:v,anchor:v}),c&&(n.indentLine(e.line+1),n.indentLine(e.line+2));return}if(u=="/"&&o.string=="<"){f=s.context&&s.context.tagName,f&&n.replaceSelection("/"+f+">","end");return}return CodeMirror.Pass}function t(n,t){if(n.indexOf)return n.indexOf(t);for(var i=0,r=n.length;i<r;++i)if(n[i]==t)return i;return-1}CodeMirror.defineOption("autoCloseTags",!1,function(t,i,r){if(i&&(r==CodeMirror.Init||!r)){var u={name:"autoCloseTags"};(typeof i!="object"||i.whenClosing)&&(u["'/'"]=function(t){return n(t,"/")}),(typeof i!="object"||i.whenOpening)&&(u["'>'"]=function(t){return n(t,">")}),t.addKeyMap(u)}else!i&&r!=CodeMirror.Init&&r&&t.removeKeyMap("autoCloseTags")});var i=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],r=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"]}(),function(){function i(n){var e=n.getCursor(),t=n.getTokenAt(e),i=CodeMirror.innerMode(n.getMode(),t.state).mode,r,o,u,f,s;if(t.type=="comment"&&i.blockCommentStart&&(o=t.string.indexOf(i.blockCommentEnd),u=n.getRange(CodeMirror.Pos(e.line,0),CodeMirror.Pos(e.line,t.end)),o==-1||o!=t.string.length-i.blockCommentEnd.length))if(t.string.indexOf(i.blockCommentStart)==0){if(r=u.slice(0,t.start),!/^\s*$/.test(r))for(r="",s=0;s<t.start;++s)r+=" "}else(f=u.indexOf(i.blockCommentContinue))!=-1&&f+i.blockCommentContinue.length>t.start&&/^\s*$/.test(u.slice(0,f))&&(r=u.slice(0,f));if(r!=null)n.replaceSelection("\n"+r+i.blockCommentContinue,"end");else return CodeMirror.Pass}for(var t=["clike","css","javascript"],n=0;n<t.length;++n)CodeMirror.extendMode(t[n],{blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * "});CodeMirror.defineOption("continueComments",null,function(n,t,r){r&&r!=CodeMirror.Init&&n.removeKeyMap("continueComment");var u={name:"continueComment"};u[typeof t=="string"?t:"Enter"]=i,n.addKeyMap(u)})}(),function(){function r(t){function a(r,u,f){var e,a,v,s,l;if(r.text){if(e=o?0:r.text.length-1,a=o?r.text.length:-1,r.text.length>y)return null;for(v=r.text.length<1e3,f!=null&&(e=f+h);e!=a;e+=h)if(s=r.text.charAt(e),w.test(s)&&(!v||t.getTokenAt(n(u,e+1)).type==p))if(l=i[s],l.charAt(1)==">"==o)c.push(s);else{if(c.pop()!=l.charAt(0))return{pos:e,match:!1};if(!c.length)return{pos:e,match:!0}}}}var y=t.state._matchBrackets.maxScanLineLength||1e4,f=t.getCursor(),s=t.getLineHandle(f.line),u=f.ch-1,l=u>=0&&i[s.text.charAt(u)]||i[s.text.charAt(++u)],r,e,v;if(!l)return null;var o=l.charAt(1)==">",h=o?1:-1,p=t.getTokenAt(n(f.line,u+1)).type,c=[s.text.charAt(u)],w=/[(){}[\]]/;for(r=f.line,v=o?Math.min(r+100,t.lineCount()):Math.max(-1,r-100);r!=v;r+=h)if(e=r==f.line?a(s,r,u):a(t.getLineHandle(r),r),e)break;return{from:n(f.line,u),to:e&&n(r,e.pos),match:e&&e.match}}function u(t,i){var o=t.state._matchBrackets.maxHighlightLineLength||1e3,u=r(t),f;if(u&&!(t.getLine(u.from.line).length>o)&&(!u.to||!(t.getLine(u.to.line).length>o))){var s=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",c=t.markText(u.from,n(u.from.line,u.from.ch+1),{className:s}),h=u.to&&t.markText(u.to,n(u.to.line,u.to.ch+1),{className:s});if(e&&t.state.focused&&t.display.input.focus(),f=function(){t.operation(function(){c.clear(),h&&h.clear()})},i)setTimeout(f,800);else return f}}function f(n){n.operation(function(){t&&(t(),t=null),n.somethingSelected()||(t=u(n,!1))})}var e=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),n=CodeMirror.Pos,i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},t=null;CodeMirror.defineOption("matchBrackets",!1,function(n,t,i){if(i&&i!=CodeMirror.Init&&n.off("cursorActivity",f),t){n.state._matchBrackets=typeof t=="object"?t:{};n.on("cursorActivity",f)}}),CodeMirror.defineExtension("matchBrackets",function(){u(this,!0)}),CodeMirror.defineExtension("findMatchingBracket",function(){return r(this)})}(),CodeMirror.newFoldFunction=function(n,t){if(t==null&&(t="↔"),typeof t=="string"){var i=document.createTextNode(t);t=document.createElement("span"),t.appendChild(i),t.className="CodeMirror-foldmarker"}return function(i,r){var u,e,o,f,s,h;if(typeof r=="number"&&(r=CodeMirror.Pos(r,0)),u=n(i,r),u){for(e=i.findMarksAt(u.from),o=0,f=0;f<e.length;++f)e[f].__isFold&&(++o,e[f].clear());if(!o){s=t.cloneNode(!0);CodeMirror.on(s,"mousedown",function(){h.clear()});h=i.markText(u.from,u.to,{replacedWith:s,clearOnEnter:!0,__isFold:!0})}}}},CodeMirror.braceRangeFinder=function(n,t){for(var e=t.line,s=n.getLine(e),h=s.length,c,v,p,b,l,k,u,f,i,o,a;h>0;){var r=s.lastIndexOf("{",h),y="{",w="}";if(r<t.ch){if(r=s.lastIndexOf("[",h),r<t.ch)break;y="[",w="]"}if(v=n.getTokenAt(CodeMirror.Pos(e,r+1)).type,!/^(comment|string)/.test(v)){c=r;break}h=r-1}if(c!=null&&!(s.lastIndexOf(y)>c)){p=1,b=n.lineCount();n:for(u=e+1;u<b;++u)for(f=n.getLine(u),i=0;;){if(o=f.indexOf(y,i),a=f.indexOf(w,i),o<0&&(o=f.length),a<0&&(a=f.length),i=Math.min(o,a),i==f.length)break;if(n.getTokenAt(CodeMirror.Pos(u,i+1)).type==v)if(i==o)++p;else if(!--p){l=u,k=i;break n}++i}if(l!=null&&l!=e+1)return{from:CodeMirror.Pos(e,c+1),to:CodeMirror.Pos(l,k)}}},CodeMirror.tagRangeFinder=function(){var n="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",t=new RegExp("<(/?)(["+n+"]["+i+"]*)","g");return function(n,i){function l(){if(!(e>=n.lastLine()))return r=0,o=n.getLine(++e),!0}function a(){for(var n,t,i;;){if(n=o.indexOf(">",r),n==-1)if(l())continue;else return;return t=o.lastIndexOf("/",n),i=t>-1&&/^\s*$/.test(o.slice(t+1,n)),r=n+1,i?"selfClose":"regular"}}function v(){for(;;){t.lastIndex=r;var n=t.exec(o);if(!n)if(l())continue;else return;return r=n.index+n[0].length,n}}for(var e=i.line,r=i.ch,o=n.getLine(e),u=[],y,h,c,s;;){if(h=v(),!h||e!=i.line||!(c=a()))return;if(!h[1]&&c!="selfClose"){u.push(h[2]),y=r;break}}for(;;){var f=v(),c,p=e,w=r-(f?f[0].length:0);if(!f||!(c=a()))return;if(c!="selfClose")if(f[1]){for(s=u.length-1;s>=0;--s)if(u[s]==f[2]){u.length=s;break}if(!u.length)return{from:CodeMirror.Pos(i.line,y),to:CodeMirror.Pos(p,w)}}else u.push(f[2])}}}(),function(){CodeMirror.defineExtension("autoFormatAll",function(n,t){function v(){h+="\n",e=!0,++a}for(var r=this,f=r.getMode(),o=r.getRange(n,t).split("\n"),s=CodeMirror.copyState(f,r.getTokenAt(n).state),y=r.getOption("tabSize"),h="",a=0,e=n.ch==0,i,u=0;u<o.length;++u){for(i=new CodeMirror.StringStream(o[u],y);!i.eol();){var c=CodeMirror.innerMode(f,s),p=f.token(i,s),l=i.current();i.start=i.pos,(!e||/\S/.test(l))&&(h+=l,e=!1),!e&&c.mode.newlineAfterToken&&c.mode.newlineAfterToken(p,l,i.string.slice(i.pos)||o[u+1]||"",c.state)&&v()}!i.pos&&f.blankLine&&f.blankLine(s),!e&&u<o.length-1&&v()}r.operation(function(){r.replaceRange(h,n,t);for(var i=n.line+1,u=n.line+a;i<=u;++i)r.indentLine(i,"smart");r.setCursor({line:0,ch:0})})})}(),function(){function n(n){for(var f=[/for\s*?\((.*?)\)/g,/&#?[a-z0-9]+;[\s\S]/g,/\"(.*?)((\")|$)/g,/\/\*(.*?)(\*\/|$)/g,/^\/\/.*/g],u=[],i,t,r=0;r<f.length;r++)for(i=0;i<n.length;)if(t=n.substr(i).match(f[r]),t!=null)u.push({start:i+t.index,end:i+t.index+t[0].length}),i+=t.index+Math.max(1,t[0].length);else break;return u.sort(function(n,t){return n.start-t.start}),u}CodeMirror.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(n,t){return/^[;{}]$/.test(t)}}),CodeMirror.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",wordWrapChars:[";","\\{","\\}"],autoFormatLineBreaks:function(t){var r=0,e=this.jsonMode?function(n){return n.replace(/([,{])/g,"$1\n").replace(/}/g,"\n}")}:function(n){return n.replace(/(;|\{|\})([^\r\n;])/g,"$1\n$2")},u=n(t),f="",i;if(u!=null){for(i=0;i<u.length;i++)u[i].start>r&&(f+=e(t.substring(r,u[i].start)),r=u[i].start),u[i].start<=r&&u[i].end>=r&&(f+=t.substring(r,u[i].end),r=u[i].end);r<t.length&&(f+=e(t.substr(r)))}else f=e(t);return f.replace(/^\n*|\n*$/,"")}});CodeMirror.extendMode("xml",{commentStart:"<!--",commentEnd:"-->",noBreak:!1,noBreakEmpty:null,tagType:"",tagName:"",isXML:!1,newlineAfterToken:function(n,t,i){var o="a|b|bdi|bdo|big|center|cite|del|em|font|i|img|ins|s|small|span|strike|strong|sub|sup|u",e="label|li|option|textarea|title|"+o,f=!1,r=null,u="",s;if(this.isXML=this.configuration=="xml"?!0:!1,n=="comment"||/<!--/.test(i))return!1;if(n=="tag"){if(t.indexOf("<")==0&&!t.indexOf("<\/")==0&&(this.tagType="open",r=t.match(/^<\s*?([\w]+?)$/i),this.tagName=r!=null?r[1]:"",u=this.tagName.toLowerCase(),("|"+e+"|").indexOf("|"+u+"|")!=-1&&(this.noBreak=!0)),t.indexOf(">")==0&&this.tagType=="open")return(this.tagType="",s=this.isXML?"[^<]*?":"",RegExp("^"+s+"<\/s*?"+this.tagName+"s*?>","i").test(i))?(this.noBreak=!1,this.isXML||(this.tagName=""),!1):(f=this.noBreak,this.noBreak=!1,f?!1:!0);if(t.indexOf("<\/")==0&&(this.tagType="close",r=t.match(/^<\/\s*?([\w]+?)$/i),r!=null&&(u=r[1].toLowerCase()),("|"+o+"|").indexOf("|"+u+"|")!=-1&&(this.noBreak=!0)),t.indexOf(">")==0&&this.tagType=="close")return(this.tagType="",i.indexOf("<")==0&&(r=i.match(/^<\/?\s*?([\w]+?)(\s|>)/i),u=r!=null?r[1].toLowerCase():"",("|"+e+"|").indexOf("|"+u+"|")==-1))?(this.noBreak=!1,!0):(f=this.noBreak,this.noBreak=!1,f?!1:!0)}return i.indexOf("<")==0?(this.noBreak=!1,this.isXML&&this.tagName!="")?(this.tagName="",!1):(r=i.match(/^<\/?\s*?([\w]+?)(\s|>)/i),u=r!=null?r[1].toLowerCase():"",("|"+e+"|").indexOf("|"+u+"|")!=-1?!1:!0):!1}}),CodeMirror.defineExtension("commentRange",function(n,t,i){var r=this,u=CodeMirror.innerMode(r.getMode(),r.getTokenAt(t).state).mode;r.operation(function(){if(n)r.replaceRange(u.commentEnd,i),r.replaceRange(u.commentStart,t),t.line==i.line&&t.ch==i.ch&&r.setCursor(t.line,t.ch+u.commentStart.length);else{var f=r.getRange(t,i),e=f.indexOf(u.commentStart),o=f.lastIndexOf(u.commentEnd);e>-1&&o>-1&&o>e&&(f=f.substr(0,e)+f.substring(e+u.commentStart.length,o)+f.substr(o+u.commentEnd.length)),r.replaceRange(f,t,i)}})}),CodeMirror.defineExtension("autoIndentRange",function(n,t){var i=this;this.operation(function(){for(var r=n.line;r<=t.line;r++)i.indentLine(r,"smart")})}),CodeMirror.defineExtension("autoFormatRange",function(n,t){function v(){h+="\n",e=!0,++a}for(var i=this,f=i.getMode(),o=i.getRange(n,t).split("\n"),s=CodeMirror.copyState(f,i.getTokenAt(n).state),y=i.getOption("tabSize"),h="",a=0,e=n.ch==0,r,u=0;u<o.length;++u){for(r=new CodeMirror.StringStream(o[u],y);!r.eol();){var c=CodeMirror.innerMode(f,s),p=f.token(r,s),l=r.current();r.start=r.pos,(!e||/\S/.test(l))&&(h+=l,e=!1),!e&&c.mode.newlineAfterToken&&c.mode.newlineAfterToken(p,l,r.string.slice(r.pos)||o[u+1]||"",c.state)&&v()}!r.pos&&f.blankLine&&f.blankLine(s),!e&&u<o.length-1&&v()}i.operation(function(){i.replaceRange(h,n,t);for(var r=n.line+1,u=n.line+a;r<=u;++r)i.indentLine(r,"smart");i.setSelection(n,i.getCursor(!1))})})}(),function(){function r(n){this.minChars=typeof n=="object"&&n.minChars||t,this.style=typeof n=="object"&&n.style||i,this.overlay=null}function n(n){n.operation(function(){var t=n.state.matchHighlighter,i;(t.overlay&&(n.removeOverlay(t.overlay),t.overlay=null),n.somethingSelected())&&((i=n.getSelection().replace(/^\s+|\s+$/g,""),i.length<t.minChars)||n.addOverlay(t.overlay=u(i,t.style)))})}function u(n,t){return{token:function(i){if(i.match(n))return t;i.next(),i.skipTo(n.charAt(0))||i.skipToEnd()}}}var t=2,i="matchhighlight";CodeMirror.defineOption("highlightSelectionMatches",!1,function(t,i,u){var e=u&&u!=CodeMirror.Init,f;if(i&&!e){t.state.matchHighlighter=new r(i);t.on("cursorActivity",n)}else!i&&e&&(f=t.state.matchHighlighter.overlay,f&&t.removeOverlay(f),t.state.matchHighlighter=null,t.off("cursorActivity",n))})}()
\ No newline at end of file