rich 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rich/version.rb +1 -1
- data/vendor/assets/ckeditor/ckeditor-contrib/plugins/MediaEmbed/icons/mediaembed.png +0 -0
- data/vendor/assets/ckeditor/ckeditor/build-config.js +1 -3
- data/vendor/assets/ckeditor/ckeditor/ckeditor.js +16 -12
- data/vendor/assets/ckeditor/ckeditor/lang/en.js +1 -1
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +74 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/css/codemirror.css +6 -1
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +3 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +2 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +3 -3
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +4 -4
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/{util → addon/foldcode}/foldcode.js +4 -4
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +2 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/format/formatting.js +5 -5
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +2 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/search/search.js +5 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +5 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +25 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.js +188 -168
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.min.js +187 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +25 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +13 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/{css.js → mode/css.js} +0 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/mode/htmlmixed.js +5 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/{javascript.js → mode/javascript.js} +7 -7
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/{xml.js → mode/xml.js} +0 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/af.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ar.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/bg.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/bn.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/bs.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ca.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/cs.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/cy.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/da.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/de.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/el.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/en-au.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/en-ca.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/en-gb.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/en.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/eo.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/es.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/et.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/eu.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/fa.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/fi.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/fo.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/fr-ca.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/fr.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/gl.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/gu.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/he.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/hi.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/hr.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/hu.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/is.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/it.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ja.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ka.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/km.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ko.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ku.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/lt.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/lv.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/mk.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/mn.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ms.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/nb.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/nl.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/no.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/pl.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/pt-br.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/pt.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ro.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ru.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/sk.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/sl.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/sr-latn.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/sr.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/sv.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/th.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/tr.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ug.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/uk.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/vi.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/zh-cn.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/zh.js +11 -0
- data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/plugin.js +186 -0
- data/vendor/assets/ckeditor/ckeditor/samples/index.html +0 -6
- data/vendor/assets/ckeditor/ckeditor/skins/moono/editor.css +1 -1
- data/vendor/assets/ckeditor/ckeditor/skins/moono/editor_gecko.css +1 -1
- data/vendor/assets/ckeditor/ckeditor/skins/moono/editor_ie.css +1 -1
- data/vendor/assets/ckeditor/ckeditor/skins/moono/editor_ie7.css +1 -1
- data/vendor/assets/ckeditor/ckeditor/skins/moono/editor_ie8.css +1 -1
- data/vendor/assets/ckeditor/ckeditor/skins/moono/editor_iequirks.css +1 -1
- data/vendor/assets/ckeditor/ckeditor/skins/moono/icons.png +0 -0
- metadata +83 -31
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/continuecomment.js +0 -2
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/htmlmixed.js +0 -4
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/closetag.js +0 -3
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/colorize.js +0 -1
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/continuecomment.js +0 -2
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/continuelist.js +0 -1
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/dialog.css +0 -32
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/dialog.js +0 -3
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/formatting.js +0 -4
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/javascript-hint.js +0 -5
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/loadmode.js +0 -3
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/match-highlighter.js +0 -2
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/matchbrackets.js +0 -4
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/multiplex.js +0 -4
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/overlay.js +0 -2
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/pig-hint.js +0 -6
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/runmode-standalone.js +0 -5
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/runmode.js +0 -2
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/search.js +0 -5
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/searchcursor.js +0 -5
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/simple-hint.css +0 -16
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/simple-hint.js +0 -4
- data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/xml-hint.js +0 -3
- data/vendor/assets/ckeditor/ckeditor/samples/plugins/autogrow/autogrow.html +0 -99
- data/vendor/assets/ckeditor/ckeditor/samples/plugins/divarea/divarea.html +0 -62
data/lib/rich/version.rb
CHANGED
Binary file
|
@@ -871,19 +871,23 @@ this.typesCount=0},fireChange:function(){this.hasUndo=!!this.getNextImage(!0);th
|
|
871
871
|
this.editor,b;a.bookmarks&&(c.focus(),b=c.getSelection());this.locked=1;this.editor.loadSnapshot(a.contents);a.bookmarks?b.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(c=this.editor.document.getBody().$.createTextRange(),c.collapse(!0),c.select());this.locked=0;this.index=a.index;this.update();this.fireChange()},getNextImage:function(a){var c=this.snapshots,b=this.currentImage,d;if(b)if(a)for(d=this.index-1;0<=d;d--){if(a=c[d],!b.equals(a,!0))return a.index=d,a}else for(d=this.index+1;d<c.length;d++)if(a=
|
872
872
|
c[d],!b.equals(a,!0))return a.index=d,a;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var a=this.getNextImage(!0);if(a)return this.restoreImage(a),!0}return!1},redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var a=this.getNextImage(!1);if(a)return this.restoreImage(a),!0}return!1},update:function(){this.locked||this.snapshots.splice(this.index,1,this.currentImage=
|
873
873
|
new i(this.editor))},lock:function(){if(!this.locked){var a=this.editor.getSnapshot();this.locked={update:this.currentImage&&a==this.currentImage.contents?a:null}}},unlock:function(){if(this.locked){var a=this.locked.update,c=this.editor.getSnapshot();this.locked=null;"string"==typeof a&&c!=a&&this.update()}}}})();CKEDITOR.plugins.add("wsc",{requires:"dialog",init:function(a){a.addCommand("checkspell",new CKEDITOR.dialogCommand("checkspell")).modes={wysiwyg:!CKEDITOR.env.opera&&!CKEDITOR.env.air&&document.domain==window.location.hostname};"undefined"==typeof a.plugins.scayt&&a.ui.addButton&&a.ui.addButton("SpellChecker",{label:a.lang.wsc.toolbar,command:"checkspell",toolbar:"spellchecker,10"});CKEDITOR.dialog.add("checkspell",this.path+"dialogs/wsc.js")}});
|
874
|
-
CKEDITOR.config.wsc_customerId=CKEDITOR.config.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";CKEDITOR.config.wsc_customLoaderScript=CKEDITOR.config.wsc_customLoaderScript||null;(function(){CKEDITOR.plugins.add("codemirror",{lang:"af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh",init:function(
|
875
|
-
"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",
|
876
|
-
|
877
|
-
d.
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
874
|
+
CKEDITOR.config.wsc_customerId=CKEDITOR.config.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";CKEDITOR.config.wsc_customLoaderScript=CKEDITOR.config.wsc_customLoaderScript||null;(function(){CKEDITOR.plugins.add("codemirror",{icons:"AutoFormat,CommentSelectedRange,UncommentSelectedRange",lang:"af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh",init:function(b){function c(){var a=[f+"js/codemirror.modes.min.js",f+"js/codemirror.addons.min.js"];d.enableSearchTools&&a.push(f+"js/codemirror.search-addons.min.js");return a}
|
875
|
+
function j(a){function b(){return{from:window["codemirror_"+a.id].getCursor(!0),to:window["codemirror_"+a.id].getCursor(!1)}}var g=a.ui.space("contents").getDocument().createElement("textarea");g.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",a.config.sourceAreaTabSize||4)));var c=[a.lang.editor,a.name].join();g.setAttributes({dir:"ltr",tabIndex:CKEDITOR.env.webkit?
|
876
|
+
-1:a.tabIndex,role:"textbox","aria-label":c});g.addClass("cke_source cke_reset cke_enable_context_menu");a.ui.space("contents").append(g);window["editable_"+a.id]=a.editable(new e(a,g));window["editable_"+a.id].setData(a.getData(1));window["editable_"+a.id].editorID=a.id;a.fire("ariaWidget",this);var f,c=window["editable_"+a.id],g=c.getParent();codemirror=a.id;window["codemirror_"+a.id]=CodeMirror.fromTextArea(c.$,{mode:"text/html",matchBrackets:d.matchBrackets,workDelay:300,workTime:35,lineNumbers:d.lineNumbers,
|
877
|
+
lineWrapping:d.lineWrapping,autoCloseTags:d.autoCloseTags,autoCloseBrackets:d.autoCloseBrackets,highlightSelectionMatches:d.highlightMatches,theme:d.theme,onKeyEvent:function(e,c){if(d.enableCodeFormatting)if("keydown"==c.type&&c.ctrlKey&&75==c.keyCode&&!c.shiftKey&&!c.altKey){var f=b();window["codemirror_"+a.id].commentRange(!0,f.from,f.to)}else"keydown"==c.type&&c.ctrlKey&&75==c.keyCode&&c.shiftKey&&!c.altKey?(f=b(),window["codemirror_"+a.id].commentRange(!1,f.from,f.to),d.autoFormatOnUncomment&&
|
878
|
+
window["codemirror_"+a.id].autoFormatRange(f.from,f.to)):"keydown"==c.type&&(c.ctrlKey&&75==c.keyCode&&!c.shiftKey&&c.altKey)&&window["codemirror_"+a.id].autoFormatRange(f.from,f.to)}});c=g.$.clientHeight+"px";g=g.$.clientWidth+"px";window["codemirror_"+a.id].config=d;d.autoFormatOnStart&&window["codemirror_"+a.id].autoFormatAll({line:0,ch:0},{line:window["codemirror_"+a.id].lineCount(),ch:0});window["codemirror_"+a.id].on("change",function(){clearTimeout(f);f=setTimeout(function(){window["codemirror_"+
|
879
|
+
a.id].save()},300)});window["codemirror_"+a.id].setSize(g,c);if(d.lineNumbers&&d.enableCodeFolding)window["codemirror_"+a.id].on("gutterClick",CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder));d.highlightActiveLine&&(window["codemirror_"+a.id].hlLine=window["codemirror_"+a.id].addLineClass(0,"background","activeline"),window["codemirror_"+a.id].on("cursorActivity",function(){var b=window["codemirror_"+a.id].getLineHandle(window["codemirror_"+a.id].getCursor().line);b!=window["codemirror_"+a.id].hlLine&&
|
880
|
+
(window["codemirror_"+a.id].removeLineClass(window["codemirror_"+a.id].hlLine,"background","activeline"),window["codemirror_"+a.id].hlLine=window["codemirror_"+a.id].addLineClass(b,"background","activeline"))}))}var f=this.path,d=CKEDITOR.tools.extend({theme:"default",matchBrackets:!0,lineNumbers:!0,lineWrapping:!0,autoCloseTags:!0,autoCloseBrackets:!0,enableSearchTools:!0,enableCodeFolding:!0,enableCodeFormatting:!0,autoFormatOnStart:!1,autoFormatOnModeChange:!0,autoFormatOnUncomment:!0,highlightActiveLine:!0,
|
881
|
+
highlightMatches:!0,showFormatButton:!0,showCommentButton:!0,showUncommentButton:!0},b.config.codemirror||{},!0),i=b.lang.codemirror;b.config.codemirror_theme&&(d.theme=b.config.codemirror_theme);b.config.codemirror_autoFormatOnStart&&(d.autoFormatOnStart=b.config.codemirror_autoFormatOnStart);CKEDITOR.document.appendStyleSheet(f+"css/codemirror.min.css");d.theme.length&&"default"!=d.theme&&CKEDITOR.document.appendStyleSheet(f+"theme/"+d.theme+".css");CKEDITOR.scriptLoader.load(f+"js/codemirror.min.js",
|
882
|
+
function(){CKEDITOR.scriptLoader.load(c())});if(b.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var h=CKEDITOR.plugins.sourcearea;b.addMode("source",function(a){if(typeof CodeMirror=="undefined")CKEDITOR.scriptLoader.load([f+"js/codemirror.min.js"].concat(c()),function(){j(b);a()});else{j(b);a()}});b.addCommand("source",h.commands.source);b.ui.addButton&&b.ui.addButton("Source",{label:b.lang.codemirror.toolbar,command:"source",toolbar:"mode,10"});d.enableCodeFormatting&&(b.addCommand("autoFormat",h.commands.autoFormat),
|
883
|
+
b.addCommand("commentSelectedRange",h.commands.commentSelectedRange),b.addCommand("uncommentSelectedRange",h.commands.uncommentSelectedRange),b.ui.addButton&&(d.showFormatButton&&b.ui.addButton("autoFormat",{label:i.autoFormat,command:"autoFormat",toolbar:"mode,20"}),d.showCommentButton&&b.ui.addButton("CommentSelectedRange",{label:i.commentSelectedRange,command:"commentSelectedRange",toolbar:"mode,30"}),d.showUncommentButton&&b.ui.addButton("UncommentSelectedRange",{label:i.uncommentSelectedRange,
|
884
|
+
command:"uncommentSelectedRange",toolbar:"mode,40"})));b.on("mode",function(){b.getCommand("source").setState(b.mode=="source"?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});b.on("resize",function(){if(window["editable_"+b.id]&&b.mode=="source"){var a=window["editable_"+b.id].getParent();window["codemirror_"+b.id].setSize(a.$.clientWidth+"px",a.$.clientHeight+"px")}})}}});var e=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(b){this.setValue(b);this.editor.fire("dataReady")},
|
885
|
+
getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(b){this[(b?"set":"remove")+"Attribute"]("readOnly","readonly")},editorID:null,detach:function(){window["codemirror_"+this.editorID].toTextArea();e.baseProto.detach.call(this);this.clearCustomData();this.remove()}}})})();
|
886
|
+
CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(e){"wysiwyg"==e.mode&&e.fire("saveSnapshot");e.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);e.setMode("source"==e.mode?"wysiwyg":"source")},canUndo:!1},autoFormat:{modes:{wysiwyg:0,source:1},editorFocus:!1,readOnly:1,exec:function(e){var b=window["codemirror_"+e.id].getCursor(!0),c=window["codemirror_"+e.id].getCursor(!1);window["codemirror_"+e.id].autoFormatRange(b,c)},canUndo:!0},
|
887
|
+
commentSelectedRange:{modes:{wysiwyg:0,source:1},editorFocus:!1,readOnly:1,exec:function(e){var b=window["codemirror_"+e.id].getCursor(!0),c=window["codemirror_"+e.id].getCursor(!1);window["codemirror_"+e.id].commentRange(!0,b,c)},canUndo:!0},uncommentSelectedRange:{modes:{wysiwyg:0,source:1},editorFocus:!1,readOnly:1,exec:function(e){var b=window["codemirror_"+e.id].getCursor(!0),c=window["codemirror_"+e.id].getCursor(!1);window["codemirror_"+e.id].commentRange(!1,b,c);window["codemirror_"+e.id].config.autoFormatOnUncomment&&
|
888
|
+
window["codemirror_"+e.id].autoFormatRange(b,c)},canUndo:!0}}};CKEDITOR.plugins.add("iframedialog",{requires:"dialog",onLoad:function(){CKEDITOR.dialog.addIframe=function(e,d,a,j,f,l,g){a={type:"iframe",src:a,width:"100%",height:"100%"};a.onContentLoad="function"==typeof l?l:function(){var a=this.getElement().$.contentWindow;if(a.onDialogEvent){var b=this.getDialog(),c=function(b){return a.onDialogEvent(b)};b.on("ok",c);b.on("cancel",c);b.on("resize",c);b.on("hide",function(a){b.removeListener("ok",c);b.removeListener("cancel",c);b.removeListener("resize",c);
|
882
889
|
a.removeListener()});a.onDialogEvent({name:"load",sender:this,editor:b._.editor})}};var h={title:d,minWidth:j,minHeight:f,contents:[{id:"iframe",label:d,expand:!0,elements:[a]}]},i;for(i in g)h[i]=g[i];this.add(e,function(){return h})};(function(){var e=function(d,a,j){if(!(3>arguments.length)){var f=this._||(this._={}),e=a.onContentLoad&&CKEDITOR.tools.bind(a.onContentLoad,this),g=CKEDITOR.tools.cssLength(a.width),h=CKEDITOR.tools.cssLength(a.height);f.frameId=CKEDITOR.tools.getNextId()+"_iframe";
|
883
890
|
d.on("load",function(){CKEDITOR.document.getById(f.frameId).getParent().setStyles({width:g,height:h})});var i={src:"%2",id:f.frameId,frameborder:0,allowtransparency:!0},k=[];"function"==typeof a.onContentLoad&&(i.onload="CKEDITOR.tools.callFunction(%1);");CKEDITOR.ui.dialog.uiElement.call(this,d,a,k,"iframe",{width:g,height:h},i,"");j.push('<div style="width:'+g+";height:"+h+';" id="'+this.domId+'"></div>');k=k.join("");d.on("show",function(){var b=CKEDITOR.document.getById(f.frameId).getParent(),
|
884
891
|
c=CKEDITOR.tools.addFunction(e),c=k.replace("%1",c).replace("%2",CKEDITOR.tools.htmlEncode(a.src));b.setHtml(c)})}};e.prototype=new CKEDITOR.ui.dialog.uiElement;CKEDITOR.dialog.addUIElement("iframe",{build:function(d,a,j){return new e(d,a,j)}})})()}});(function(){function i(b,h,d){var e=[],g=[],a;for(a=0;a<b.styleSheets.length;a++){var c=b.styleSheets[a];if(!(c.ownerNode||c.owningElement).getAttribute("data-cke-temp")&&!(c.href&&"chrome://"==c.href.substr(0,9)))try{for(var f=c.cssRules||c.rules,c=0;c<f.length;c++)g.push(f[c].selectorText)}catch(i){}}a=g.join(" ");a=a.replace(/(,|>|\+|~)/g," ");a=a.replace(/\[[^\]]*/g,"");a=a.replace(/#[^\s]*/g,"");a=a.replace(/\:{1,2}[^\s]*/g,"");a=a.replace(/\s+/g," ");a=a.split(" ");b=[];for(g=0;g<a.length;g++)f=
|
885
892
|
a[g],d.test(f)&&!h.test(f)&&-1==CKEDITOR.tools.indexOf(b,f)&&b.push(f);for(a=0;a<b.length;a++)d=b[a].split("."),h=d[0].toLowerCase(),d=d[1],e.push({name:h+"."+d,element:h,attributes:{"class":d}});return e}CKEDITOR.plugins.add("stylesheetparser",{onLoad:function(){var b=CKEDITOR.editor.prototype;b.getStylesSet=CKEDITOR.tools.override(b.getStylesSet,function(b){return function(d){var e=this;b.call(this,function(b){d(e._.stylesDefinitions=b.concat(i(e.document.$,e.config.stylesheetParser_skipSelectors||
|
886
|
-
/(^body\.|^\.)/i,e.config.stylesheetParser_validSelectors||/\w+\.\w+/)))})}})}})})();(function()
|
887
|
-
"getBody":"getDocumentElement"]().append(e);f=e.getDocumentPosition(f).y+e.$.offsetHeight;e.remove();c.setStyle("overflow-y",b);b=f+(a.config.autoGrow_bottomSpace||0);e=a.config.autoGrow_maxHeight||Infinity;b=Math.max(b,void 0!=a.config.autoGrow_minHeight?a.config.autoGrow_minHeight:200);b=Math.min(b,e);b!=d&&(b=a.fire("autoGrow",{currentHeight:d,newHeight:b}).newHeight,a.resize(a.container.getStyle("width"),b,!0));c.$.scrollHeight>c.$.clientHeight&&b<e?c.setStyle("overflow-y","hidden"):c.removeStyle("overflow-y")}}};
|
888
|
-
CKEDITOR.plugins.add("autogrow",{init:function(a){if(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE)a.on("instanceReady",function(){if(a.editable().isInline())a.ui.space("contents").setStyle("height","auto");else{a.addCommand("autogrow",{exec:g,modes:{wysiwyg:1},readOnly:1,canUndo:!1,editorFocus:!1});var c={contentDom:1,key:1,selectionChange:1,insertElement:1,mode:1},d;for(d in c)a.on(d,function(a){"wysiwyg"==a.editor.mode&&setTimeout(function(){g(a.editor);g(a.editor)},100)});a.on("afterCommandExec",
|
889
|
-
function(b){"maximize"==b.data.name&&"wysiwyg"==b.editor.mode&&(b.data.command.state==CKEDITOR.TRISTATE_ON?h(a).removeStyle("overflow"):g(a))});a.config.autoGrow_onStartup&&a.execCommand("autogrow")}})}})})();CKEDITOR.plugins.add("divarea",{afterInit:function(a){a.addMode("wysiwyg",function(c){var b=CKEDITOR.dom.element.createFromHtml('<div class="cke_wysiwyg_div cke_reset" hidefocus="true"></div>');a.ui.space("contents").append(b);b=a.editable(b);b.detach=CKEDITOR.tools.override(b.detach,function(a){return function(){a.apply(this,arguments);this.remove()}});a.setData(a.getData(1),c);a.fire("contentDom")})}});CKEDITOR.config.plugins='dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,clipboard,button,panelbutton,panel,floatpanel,colorbutton,colordialog,templates,menu,contextmenu,div,resize,toolbar,elementspath,list,indent,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,forms,format,htmlwriter,horizontalrule,iframe,wysiwygarea,image,smiley,justify,link,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,menubutton,scayt,stylescombo,tab,table,tabletools,undo,wsc,codemirror,iframedialog,stylesheetparser,autogrow,divarea';CKEDITOR.config.skin='moono';(function() {var icons = ( 'about,0,bold,32,italic,64,strike,96,subscript,128,superscript,160,underline,192,bidiltr,224,bidirtl,256,blockquote,288,copy-rtl,320,copy,352,cut-rtl,384,cut,416,paste-rtl,448,paste,480,bgcolor,512,textcolor,544,templates-rtl,576,templates,608,creatediv,640,bulletedlist-rtl,672,bulletedlist,704,numberedlist-rtl,736,numberedlist,768,indent-rtl,800,indent,832,outdent-rtl,864,outdent,896,find-rtl,928,find,960,replace,992,flash,1024,button,1056,checkbox,1088,form,1120,hiddenfield,1152,imagebutton,1184,radio,1216,select-rtl,1248,select,1280,textarea-rtl,1312,textarea,1344,textfield-rtl,1376,textfield,1408,horizontalrule,1440,iframe,1472,image,1504,smiley,1536,justifyblock,1568,justifycenter,1600,justifyleft,1632,justifyright,1664,anchor-rtl,1696,anchor,1728,link,1760,unlink,1792,maximize,1824,newpage-rtl,1856,newpage,1888,pagebreak-rtl,1920,pagebreak,1952,pastetext-rtl,1984,pastetext,2016,pastefromword-rtl,2048,pastefromword,2080,preview-rtl,2112,preview,2144,print,2176,removeformat,2208,save,2240,selectall,2272,showblocks-rtl,2304,showblocks,2336,source-rtl,2368,source,2400,specialchar,2432,scayt,2464,table,2496,redo-rtl,2528,redo,2560,undo-rtl,2592,undo,2624,spellchecker,2656' ),path = CKEDITOR.getUrl( 'plugins/icons.png' ),icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ] };})();CKEDITOR.lang.languages={"en":1};}());
|
893
|
+
/(^body\.|^\.)/i,e.config.stylesheetParser_validSelectors||/\w+\.\w+/)))})}})}})})();CKEDITOR.config.plugins='dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,clipboard,button,panelbutton,panel,floatpanel,colorbutton,colordialog,templates,menu,contextmenu,div,resize,toolbar,elementspath,list,indent,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,forms,format,htmlwriter,horizontalrule,iframe,wysiwygarea,image,smiley,justify,link,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,menubutton,scayt,stylescombo,tab,table,tabletools,undo,wsc,codemirror,iframedialog,stylesheetparser';CKEDITOR.config.skin='moono';(function() {var icons = ( 'about,0,bold,32,italic,64,strike,96,subscript,128,superscript,160,underline,192,bidiltr,224,bidirtl,256,blockquote,288,copy-rtl,320,copy,352,cut-rtl,384,cut,416,paste-rtl,448,paste,480,bgcolor,512,textcolor,544,templates-rtl,576,templates,608,creatediv,640,bulletedlist-rtl,672,bulletedlist,704,numberedlist-rtl,736,numberedlist,768,indent-rtl,800,indent,832,outdent-rtl,864,outdent,896,find-rtl,928,find,960,replace,992,flash,1024,button,1056,checkbox,1088,form,1120,hiddenfield,1152,imagebutton,1184,radio,1216,select-rtl,1248,select,1280,textarea-rtl,1312,textarea,1344,textfield-rtl,1376,textfield,1408,horizontalrule,1440,iframe,1472,image,1504,smiley,1536,justifyblock,1568,justifycenter,1600,justifyleft,1632,justifyright,1664,anchor-rtl,1696,anchor,1728,link,1760,unlink,1792,maximize,1824,newpage-rtl,1856,newpage,1888,pagebreak-rtl,1920,pagebreak,1952,pastetext-rtl,1984,pastetext,2016,pastefromword-rtl,2048,pastefromword,2080,preview-rtl,2112,preview,2144,print,2176,removeformat,2208,save,2240,selectall,2272,showblocks-rtl,2304,showblocks,2336,source-rtl,2368,source,2400,specialchar,2432,scayt,2464,table,2496,redo-rtl,2528,redo,2560,undo-rtl,2592,undo,2624,spellchecker,2656,AutoFormat,2688,CommentSelectedRange,2720,UncommentSelectedRange,2752' ),path = CKEDITOR.getUrl( 'plugins/icons.png' ),icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ] };})();CKEDITOR.lang.languages={"en":1};}());
|
@@ -2,4 +2,4 @@
|
|
2
2
|
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
3
3
|
For licensing, see LICENSE.html or http://ckeditor.com/license
|
4
4
|
*/
|
5
|
-
CKEDITOR.lang['en']={"dir":"ltr","editor":"Rich Text Editor","common":{"editorHelp":"Press ALT 0 for help","browseServer":"Browse Server","url":"URL","protocol":"Protocol","upload":"Upload","uploadSubmit":"Send it to the Server","image":"Image","flash":"Flash","form":"Form","checkbox":"Checkbox","radio":"Radio Button","textField":"Text Field","textarea":"Textarea","hiddenField":"Hidden Field","button":"Button","select":"Selection Field","imageButton":"Image Button","notSet":"<not set>","id":"Id","name":"Name","langDir":"Language Direction","langDirLtr":"Left to Right (LTR)","langDirRtl":"Right to Left (RTL)","langCode":"Language Code","longDescr":"Long Description URL","cssClass":"Stylesheet Classes","advisoryTitle":"Advisory Title","cssStyle":"Style","ok":"OK","cancel":"Cancel","close":"Close","preview":"Preview","resize":"Resize","generalTab":"General","advancedTab":"Advanced","validateNumberFailed":"This value is not a number.","confirmNewPage":"Any unsaved changes to this content will be lost. Are you sure you want to load new page?","confirmCancel":"Some of the options have been changed. Are you sure to close the dialog?","options":"Options","target":"Target","targetNew":"New Window (_blank)","targetTop":"Topmost Window (_top)","targetSelf":"Same Window (_self)","targetParent":"Parent Window (_parent)","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","styles":"Style","cssClasses":"Stylesheet Classes","width":"Width","height":"Height","align":"Alignment","alignLeft":"Left","alignRight":"Right","alignCenter":"Center","alignTop":"Top","alignMiddle":"Middle","alignBottom":"Bottom","invalidValue":"Invalid value.","invalidHeight":"Height must be a number.","invalidWidth":"Width must be a number.","invalidCssLength":"Value specified for the \"%1\" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"Value specified for the \"%1\" field must be a positive number with or without a valid HTML measurement unit (px or %).","invalidInlineStyle":"Value specified for the inline style must consist of one or more tuples with the format of \"name : value\", separated by semi-colons.","cssLengthTooltip":"Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1<span class=\"cke_accessibility\">, unavailable</span>"},"about":{"copy":"Copyright © $1. All rights reserved.","dlgTitle":"About CKEditor","help":"Check $1 for help.","moreInfo":"For licensing information please visit our web site:","title":"About CKEditor","userGuide":"CKEditor User's Guide"},"basicstyles":{"bold":"Bold","italic":"Italic","strike":"Strike Through","subscript":"Subscript","superscript":"Superscript","underline":"Underline"},"bidi":{"ltr":"Text direction from left to right","rtl":"Text direction from right to left"},"blockquote":{"toolbar":"Block Quote"},"clipboard":{"copy":"Copy","copyError":"Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).","cut":"Cut","cutError":"Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).","paste":"Paste","pasteArea":"Paste Area","pasteMsg":"Please paste inside the following box using the keyboard (<strong>Ctrl/Cmd+V</strong>) and hit OK","securityMsg":"Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.","title":"Paste"},"colorbutton":{"auto":"Automatic","bgColorTitle":"Background Color","colors":{"000":"Black","800000":"Maroon","8B4513":"Saddle Brown","2F4F4F":"Dark Slate Gray","008080":"Teal","000080":"Navy","4B0082":"Indigo","696969":"Dark Gray","B22222":"Fire Brick","A52A2A":"Brown","DAA520":"Golden Rod","006400":"Dark Green","40E0D0":"Turquoise","0000CD":"Medium Blue","800080":"Purple","808080":"Gray","F00":"Red","FF8C00":"Dark Orange","FFD700":"Gold","008000":"Green","0FF":"Cyan","00F":"Blue","EE82EE":"Violet","A9A9A9":"Dim Gray","FFA07A":"Light Salmon","FFA500":"Orange","FFFF00":"Yellow","00FF00":"Lime","AFEEEE":"Pale Turquoise","ADD8E6":"Light Blue","DDA0DD":"Plum","D3D3D3":"Light Grey","FFF0F5":"Lavender Blush","FAEBD7":"Antique White","FFFFE0":"Light Yellow","F0FFF0":"Honeydew","F0FFFF":"Azure","F0F8FF":"Alice Blue","E6E6FA":"Lavender","FFF":"White"},"more":"More Colors...","panelTitle":"Colors","textColorTitle":"Text Color"},"colordialog":{"clear":"Clear","highlight":"Highlight","options":"Color Options","selected":"Selected Color","title":"Select color"},"templates":{"button":"Templates","emptyListMsg":"(No templates defined)","insertOption":"Replace actual contents","options":"Template Options","selectPromptMsg":"Please select the template to open in the editor","title":"Content Templates"},"contextmenu":{"options":"Context Menu Options"},"div":{"IdInputLabel":"Id","advisoryTitleInputLabel":"Advisory Title","cssClassInputLabel":"Stylesheet Classes","edit":"Edit Div","inlineStyleInputLabel":"Inline Style","langDirLTRLabel":"Left to Right (LTR)","langDirLabel":"Language Direction","langDirRTLLabel":"Right to Left (RTL)","languageCodeInputLabel":" Language Code","remove":"Remove Div","styleSelectLabel":"Style","title":"Create Div Container","toolbar":"Create Div Container"},"toolbar":{"toolbarCollapse":"Collapse Toolbar","toolbarExpand":"Expand Toolbar","toolbarGroups":{"document":"Document","clipboard":"Clipboard/Undo","editing":"Editing","forms":"Forms","basicstyles":"Basic Styles","paragraph":"Paragraph","links":"Links","insert":"Insert","styles":"Styles","colors":"Colors","tools":"Tools"},"toolbars":"Editor toolbars"},"elementspath":{"eleLabel":"Elements path","eleTitle":"%1 element"},"list":{"bulletedlist":"Insert/Remove Bulleted List","numberedlist":"Insert/Remove Numbered List"},"indent":{"indent":"Increase Indent","outdent":"Decrease Indent"},"find":{"find":"Find","findOptions":"Find Options","findWhat":"Find what:","matchCase":"Match case","matchCyclic":"Match cyclic","matchWord":"Match whole word","notFoundMsg":"The specified text was not found.","replace":"Replace","replaceAll":"Replace All","replaceSuccessMsg":"%1 occurrence(s) replaced.","replaceWith":"Replace with:","title":"Find and Replace"},"fakeobjects":{"anchor":"Anchor","flash":"Flash Animation","hiddenfield":"Hidden Field","iframe":"IFrame","unknown":"Unknown Object"},"flash":{"access":"Script Access","accessAlways":"Always","accessNever":"Never","accessSameDomain":"Same domain","alignAbsBottom":"Abs Bottom","alignAbsMiddle":"Abs Middle","alignBaseline":"Baseline","alignTextTop":"Text Top","bgcolor":"Background color","chkFull":"Allow Fullscreen","chkLoop":"Loop","chkMenu":"Enable Flash Menu","chkPlay":"Auto Play","flashvars":"Variables for Flash","hSpace":"HSpace","properties":"Flash Properties","propertiesTab":"Properties","quality":"Quality","qualityAutoHigh":"Auto High","qualityAutoLow":"Auto Low","qualityBest":"Best","qualityHigh":"High","qualityLow":"Low","qualityMedium":"Medium","scale":"Scale","scaleAll":"Show all","scaleFit":"Exact Fit","scaleNoBorder":"No Border","title":"Flash Properties","vSpace":"VSpace","validateHSpace":"HSpace must be a number.","validateSrc":"URL must not be empty.","validateVSpace":"VSpace must be a number.","windowMode":"Window mode","windowModeOpaque":"Opaque","windowModeTransparent":"Transparent","windowModeWindow":"Window"},"font":{"fontSize":{"label":"Size","voiceLabel":"Font Size","panelTitle":"Font Size"},"label":"Font","panelTitle":"Font Name","voiceLabel":"Font"},"forms":{"button":{"title":"Button Properties","text":"Text (Value)","type":"Type","typeBtn":"Button","typeSbm":"Submit","typeRst":"Reset"},"checkboxAndRadio":{"checkboxTitle":"Checkbox Properties","radioTitle":"Radio Button Properties","value":"Value","selected":"Selected"},"form":{"title":"Form Properties","menu":"Form Properties","action":"Action","method":"Method","encoding":"Encoding"},"hidden":{"title":"Hidden Field Properties","name":"Name","value":"Value"},"select":{"title":"Selection Field Properties","selectInfo":"Select Info","opAvail":"Available Options","value":"Value","size":"Size","lines":"lines","chkMulti":"Allow multiple selections","opText":"Text","opValue":"Value","btnAdd":"Add","btnModify":"Modify","btnUp":"Up","btnDown":"Down","btnSetValue":"Set as selected value","btnDelete":"Delete"},"textarea":{"title":"Textarea Properties","cols":"Columns","rows":"Rows"},"textfield":{"title":"Text Field Properties","name":"Name","value":"Value","charWidth":"Character Width","maxChars":"Maximum Characters","type":"Type","typeText":"Text","typePass":"Password","typeEmail":"Email","typeSearch":"Search","typeTel":"Telephone Number","typeUrl":"URL"}},"format":{"label":"Format","panelTitle":"Paragraph Format","tag_address":"Address","tag_div":"Normal (DIV)","tag_h1":"Heading 1","tag_h2":"Heading 2","tag_h3":"Heading 3","tag_h4":"Heading 4","tag_h5":"Heading 5","tag_h6":"Heading 6","tag_p":"Normal","tag_pre":"Formatted"},"horizontalrule":{"toolbar":"Insert Horizontal Line"},"iframe":{"border":"Show frame border","noUrl":"Please type the iframe URL","scrolling":"Enable scrollbars","title":"IFrame Properties","toolbar":"IFrame"},"image":{"alertUrl":"Please type the image URL","alt":"Alternative Text","border":"Border","btnUpload":"Send it to the Server","button2Img":"Do you want to transform the selected image button on a simple image?","hSpace":"HSpace","img2Button":"Do you want to transform the selected image on a image button?","infoTab":"Image Info","linkTab":"Link","lockRatio":"Lock Ratio","menu":"Image Properties","resetSize":"Reset Size","title":"Image Properties","titleButton":"Image Button Properties","upload":"Upload","urlMissing":"Image source URL is missing.","vSpace":"VSpace","validateBorder":"Border must be a whole number.","validateHSpace":"HSpace must be a whole number.","validateVSpace":"VSpace must be a whole number."},"smiley":{"options":"Smiley Options","title":"Insert a Smiley","toolbar":"Smiley"},"justify":{"block":"Justify","center":"Center","left":"Align Left","right":"Align Right"},"link":{"acccessKey":"Access Key","advanced":"Advanced","advisoryContentType":"Advisory Content Type","advisoryTitle":"Advisory Title","anchor":{"toolbar":"Anchor","menu":"Edit Anchor","title":"Anchor Properties","name":"Anchor Name","errorName":"Please type the anchor name","remove":"Remove Anchor"},"anchorId":"By Element Id","anchorName":"By Anchor Name","charset":"Linked Resource Charset","cssClasses":"Stylesheet Classes","emailAddress":"E-Mail Address","emailBody":"Message Body","emailSubject":"Message Subject","id":"Id","info":"Link Info","langCode":"Language Code","langDir":"Language Direction","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","menu":"Edit Link","name":"Name","noAnchors":"(No anchors available in the document)","noEmail":"Please type the e-mail address","noUrl":"Please type the link URL","other":"<other>","popupDependent":"Dependent (Netscape)","popupFeatures":"Popup Window Features","popupFullScreen":"Full Screen (IE)","popupLeft":"Left Position","popupLocationBar":"Location Bar","popupMenuBar":"Menu Bar","popupResizable":"Resizable","popupScrollBars":"Scroll Bars","popupStatusBar":"Status Bar","popupToolbar":"Toolbar","popupTop":"Top Position","rel":"Relationship","selectAnchor":"Select an Anchor","styles":"Style","tabIndex":"Tab Index","target":"Target","targetFrame":"<frame>","targetFrameName":"Target Frame Name","targetPopup":"<popup window>","targetPopupName":"Popup Window Name","title":"Link","toAnchor":"Link to anchor in the text","toEmail":"E-mail","toUrl":"URL","toolbar":"Link","type":"Link Type","unlink":"Unlink","upload":"Upload"},"liststyle":{"armenian":"Armenian numbering","bulletedTitle":"Bulleted List Properties","circle":"Circle","decimal":"Decimal (1, 2, 3, etc.)","decimalLeadingZero":"Decimal leading zero (01, 02, 03, etc.)","disc":"Disc","georgian":"Georgian numbering (an, ban, gan, etc.)","lowerAlpha":"Lower Alpha (a, b, c, d, e, etc.)","lowerGreek":"Lower Greek (alpha, beta, gamma, etc.)","lowerRoman":"Lower Roman (i, ii, iii, iv, v, etc.)","none":"None","notset":"<not set>","numberedTitle":"Numbered List Properties","square":"Square","start":"Start","type":"Type","upperAlpha":"Upper Alpha (A, B, C, D, E, etc.)","upperRoman":"Upper Roman (I, II, III, IV, V, etc.)","validateStartNumber":"List start number must be a whole number."},"magicline":{"title":"Insert paragraph here"},"maximize":{"maximize":"Maximize","minimize":"Minimize"},"newpage":{"toolbar":"New Page"},"pagebreak":{"alt":"Page Break","toolbar":"Insert Page Break for Printing"},"pastetext":{"button":"Paste as plain text","title":"Paste as Plain Text"},"pastefromword":{"confirmCleanup":"The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?","error":"It was not possible to clean up the pasted data due to an internal error","title":"Paste from Word","toolbar":"Paste from Word"},"preview":{"preview":"Preview"},"print":{"toolbar":"Print"},"removeformat":{"toolbar":"Remove Format"},"save":{"toolbar":"Save"},"selectall":{"toolbar":"Select All"},"showblocks":{"toolbar":"Show Blocks"},"sourcearea":{"toolbar":"Source"},"specialchar":{"options":"Special Character Options","title":"Select Special Character","toolbar":"Insert Special Character"},"scayt":{"about":"About SCAYT","aboutTab":"About","addWord":"Add Word","allCaps":"Ignore All-Caps Words","dic_create":"Create","dic_delete":"Delete","dic_field_name":"Dictionary name","dic_info":"Initially the User Dictionary is stored in a Cookie. However, Cookies are limited in size. When the User Dictionary grows to a point where it cannot be stored in a Cookie, then the dictionary may be stored on our server. To store your personal dictionary on our server you should specify a name for your dictionary. If you already have a stored dictionary, please type its name and click the Restore button.","dic_rename":"Rename","dic_restore":"Restore","dictionariesTab":"Dictionaries","disable":"Disable SCAYT","emptyDic":"Dictionary name should not be empty.","enable":"Enable SCAYT","ignore":"Ignore","ignoreAll":"Ignore All","ignoreDomainNames":"Ignore Domain Names","langs":"Languages","languagesTab":"Languages","mixedCase":"Ignore Words with Mixed Case","mixedWithDigits":"Ignore Words with Numbers","moreSuggestions":"More suggestions","opera_title":"Not supported by Opera","options":"Options","optionsTab":"Options","title":"Spell Check As You Type","toggle":"Toggle SCAYT","noSuggestions":"No suggestion"},"stylescombo":{"label":"Styles","panelTitle":"Formatting Styles","panelTitle1":"Block Styles","panelTitle2":"Inline Styles","panelTitle3":"Object Styles"},"table":{"border":"Border size","caption":"Caption","cell":{"menu":"Cell","insertBefore":"Insert Cell Before","insertAfter":"Insert Cell After","deleteCell":"Delete Cells","merge":"Merge Cells","mergeRight":"Merge Right","mergeDown":"Merge Down","splitHorizontal":"Split Cell Horizontally","splitVertical":"Split Cell Vertically","title":"Cell Properties","cellType":"Cell Type","rowSpan":"Rows Span","colSpan":"Columns Span","wordWrap":"Word Wrap","hAlign":"Horizontal Alignment","vAlign":"Vertical Alignment","alignBaseline":"Baseline","bgColor":"Background Color","borderColor":"Border Color","data":"Data","header":"Header","yes":"Yes","no":"No","invalidWidth":"Cell width must be a number.","invalidHeight":"Cell height must be a number.","invalidRowSpan":"Rows span must be a whole number.","invalidColSpan":"Columns span must be a whole number.","chooseColor":"Choose"},"cellPad":"Cell padding","cellSpace":"Cell spacing","column":{"menu":"Column","insertBefore":"Insert Column Before","insertAfter":"Insert Column After","deleteColumn":"Delete Columns"},"columns":"Columns","deleteTable":"Delete Table","headers":"Headers","headersBoth":"Both","headersColumn":"First column","headersNone":"None","headersRow":"First Row","invalidBorder":"Border size must be a number.","invalidCellPadding":"Cell padding must be a positive number.","invalidCellSpacing":"Cell spacing must be a positive number.","invalidCols":"Number of columns must be a number greater than 0.","invalidHeight":"Table height must be a number.","invalidRows":"Number of rows must be a number greater than 0.","invalidWidth":"Table width must be a number.","menu":"Table Properties","row":{"menu":"Row","insertBefore":"Insert Row Before","insertAfter":"Insert Row After","deleteRow":"Delete Rows"},"rows":"Rows","summary":"Summary","title":"Table Properties","toolbar":"Table","widthPc":"percent","widthPx":"pixels","widthUnit":"width unit"},"undo":{"redo":"Redo","undo":"Undo"},"wsc":{"btnIgnore":"Ignore","btnIgnoreAll":"Ignore All","btnReplace":"Replace","btnReplaceAll":"Replace All","btnUndo":"Undo","changeTo":"Change to","errorLoading":"Error loading application service host: %s.","ieSpellDownload":"Spell checker not installed. Do you want to download it now?","manyChanges":"Spell check complete: %1 words changed","noChanges":"Spell check complete: No words changed","noMispell":"Spell check complete: No misspellings found","noSuggestions":"- No suggestions -","notAvailable":"Sorry, but service is unavailable now.","notInDic":"Not in dictionary","oneChange":"Spell check complete: One word changed","progress":"Spell check in progress...","title":"Spell Check","toolbar":"Check Spelling"},"codemirror":{"toolbar":"Source"}};
|
5
|
+
CKEDITOR.lang['en']={"dir":"ltr","editor":"Rich Text Editor","common":{"editorHelp":"Press ALT 0 for help","browseServer":"Browse Server","url":"URL","protocol":"Protocol","upload":"Upload","uploadSubmit":"Send it to the Server","image":"Image","flash":"Flash","form":"Form","checkbox":"Checkbox","radio":"Radio Button","textField":"Text Field","textarea":"Textarea","hiddenField":"Hidden Field","button":"Button","select":"Selection Field","imageButton":"Image Button","notSet":"<not set>","id":"Id","name":"Name","langDir":"Language Direction","langDirLtr":"Left to Right (LTR)","langDirRtl":"Right to Left (RTL)","langCode":"Language Code","longDescr":"Long Description URL","cssClass":"Stylesheet Classes","advisoryTitle":"Advisory Title","cssStyle":"Style","ok":"OK","cancel":"Cancel","close":"Close","preview":"Preview","resize":"Resize","generalTab":"General","advancedTab":"Advanced","validateNumberFailed":"This value is not a number.","confirmNewPage":"Any unsaved changes to this content will be lost. Are you sure you want to load new page?","confirmCancel":"Some of the options have been changed. Are you sure to close the dialog?","options":"Options","target":"Target","targetNew":"New Window (_blank)","targetTop":"Topmost Window (_top)","targetSelf":"Same Window (_self)","targetParent":"Parent Window (_parent)","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","styles":"Style","cssClasses":"Stylesheet Classes","width":"Width","height":"Height","align":"Alignment","alignLeft":"Left","alignRight":"Right","alignCenter":"Center","alignTop":"Top","alignMiddle":"Middle","alignBottom":"Bottom","invalidValue":"Invalid value.","invalidHeight":"Height must be a number.","invalidWidth":"Width must be a number.","invalidCssLength":"Value specified for the \"%1\" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"Value specified for the \"%1\" field must be a positive number with or without a valid HTML measurement unit (px or %).","invalidInlineStyle":"Value specified for the inline style must consist of one or more tuples with the format of \"name : value\", separated by semi-colons.","cssLengthTooltip":"Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1<span class=\"cke_accessibility\">, unavailable</span>"},"about":{"copy":"Copyright © $1. All rights reserved.","dlgTitle":"About CKEditor","help":"Check $1 for help.","moreInfo":"For licensing information please visit our web site:","title":"About CKEditor","userGuide":"CKEditor User's Guide"},"basicstyles":{"bold":"Bold","italic":"Italic","strike":"Strike Through","subscript":"Subscript","superscript":"Superscript","underline":"Underline"},"bidi":{"ltr":"Text direction from left to right","rtl":"Text direction from right to left"},"blockquote":{"toolbar":"Block Quote"},"clipboard":{"copy":"Copy","copyError":"Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).","cut":"Cut","cutError":"Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).","paste":"Paste","pasteArea":"Paste Area","pasteMsg":"Please paste inside the following box using the keyboard (<strong>Ctrl/Cmd+V</strong>) and hit OK","securityMsg":"Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.","title":"Paste"},"colorbutton":{"auto":"Automatic","bgColorTitle":"Background Color","colors":{"000":"Black","800000":"Maroon","8B4513":"Saddle Brown","2F4F4F":"Dark Slate Gray","008080":"Teal","000080":"Navy","4B0082":"Indigo","696969":"Dark Gray","B22222":"Fire Brick","A52A2A":"Brown","DAA520":"Golden Rod","006400":"Dark Green","40E0D0":"Turquoise","0000CD":"Medium Blue","800080":"Purple","808080":"Gray","F00":"Red","FF8C00":"Dark Orange","FFD700":"Gold","008000":"Green","0FF":"Cyan","00F":"Blue","EE82EE":"Violet","A9A9A9":"Dim Gray","FFA07A":"Light Salmon","FFA500":"Orange","FFFF00":"Yellow","00FF00":"Lime","AFEEEE":"Pale Turquoise","ADD8E6":"Light Blue","DDA0DD":"Plum","D3D3D3":"Light Grey","FFF0F5":"Lavender Blush","FAEBD7":"Antique White","FFFFE0":"Light Yellow","F0FFF0":"Honeydew","F0FFFF":"Azure","F0F8FF":"Alice Blue","E6E6FA":"Lavender","FFF":"White"},"more":"More Colors...","panelTitle":"Colors","textColorTitle":"Text Color"},"colordialog":{"clear":"Clear","highlight":"Highlight","options":"Color Options","selected":"Selected Color","title":"Select color"},"templates":{"button":"Templates","emptyListMsg":"(No templates defined)","insertOption":"Replace actual contents","options":"Template Options","selectPromptMsg":"Please select the template to open in the editor","title":"Content Templates"},"contextmenu":{"options":"Context Menu Options"},"div":{"IdInputLabel":"Id","advisoryTitleInputLabel":"Advisory Title","cssClassInputLabel":"Stylesheet Classes","edit":"Edit Div","inlineStyleInputLabel":"Inline Style","langDirLTRLabel":"Left to Right (LTR)","langDirLabel":"Language Direction","langDirRTLLabel":"Right to Left (RTL)","languageCodeInputLabel":" Language Code","remove":"Remove Div","styleSelectLabel":"Style","title":"Create Div Container","toolbar":"Create Div Container"},"toolbar":{"toolbarCollapse":"Collapse Toolbar","toolbarExpand":"Expand Toolbar","toolbarGroups":{"document":"Document","clipboard":"Clipboard/Undo","editing":"Editing","forms":"Forms","basicstyles":"Basic Styles","paragraph":"Paragraph","links":"Links","insert":"Insert","styles":"Styles","colors":"Colors","tools":"Tools"},"toolbars":"Editor toolbars"},"elementspath":{"eleLabel":"Elements path","eleTitle":"%1 element"},"list":{"bulletedlist":"Insert/Remove Bulleted List","numberedlist":"Insert/Remove Numbered List"},"indent":{"indent":"Increase Indent","outdent":"Decrease Indent"},"find":{"find":"Find","findOptions":"Find Options","findWhat":"Find what:","matchCase":"Match case","matchCyclic":"Match cyclic","matchWord":"Match whole word","notFoundMsg":"The specified text was not found.","replace":"Replace","replaceAll":"Replace All","replaceSuccessMsg":"%1 occurrence(s) replaced.","replaceWith":"Replace with:","title":"Find and Replace"},"fakeobjects":{"anchor":"Anchor","flash":"Flash Animation","hiddenfield":"Hidden Field","iframe":"IFrame","unknown":"Unknown Object"},"flash":{"access":"Script Access","accessAlways":"Always","accessNever":"Never","accessSameDomain":"Same domain","alignAbsBottom":"Abs Bottom","alignAbsMiddle":"Abs Middle","alignBaseline":"Baseline","alignTextTop":"Text Top","bgcolor":"Background color","chkFull":"Allow Fullscreen","chkLoop":"Loop","chkMenu":"Enable Flash Menu","chkPlay":"Auto Play","flashvars":"Variables for Flash","hSpace":"HSpace","properties":"Flash Properties","propertiesTab":"Properties","quality":"Quality","qualityAutoHigh":"Auto High","qualityAutoLow":"Auto Low","qualityBest":"Best","qualityHigh":"High","qualityLow":"Low","qualityMedium":"Medium","scale":"Scale","scaleAll":"Show all","scaleFit":"Exact Fit","scaleNoBorder":"No Border","title":"Flash Properties","vSpace":"VSpace","validateHSpace":"HSpace must be a number.","validateSrc":"URL must not be empty.","validateVSpace":"VSpace must be a number.","windowMode":"Window mode","windowModeOpaque":"Opaque","windowModeTransparent":"Transparent","windowModeWindow":"Window"},"font":{"fontSize":{"label":"Size","voiceLabel":"Font Size","panelTitle":"Font Size"},"label":"Font","panelTitle":"Font Name","voiceLabel":"Font"},"forms":{"button":{"title":"Button Properties","text":"Text (Value)","type":"Type","typeBtn":"Button","typeSbm":"Submit","typeRst":"Reset"},"checkboxAndRadio":{"checkboxTitle":"Checkbox Properties","radioTitle":"Radio Button Properties","value":"Value","selected":"Selected"},"form":{"title":"Form Properties","menu":"Form Properties","action":"Action","method":"Method","encoding":"Encoding"},"hidden":{"title":"Hidden Field Properties","name":"Name","value":"Value"},"select":{"title":"Selection Field Properties","selectInfo":"Select Info","opAvail":"Available Options","value":"Value","size":"Size","lines":"lines","chkMulti":"Allow multiple selections","opText":"Text","opValue":"Value","btnAdd":"Add","btnModify":"Modify","btnUp":"Up","btnDown":"Down","btnSetValue":"Set as selected value","btnDelete":"Delete"},"textarea":{"title":"Textarea Properties","cols":"Columns","rows":"Rows"},"textfield":{"title":"Text Field Properties","name":"Name","value":"Value","charWidth":"Character Width","maxChars":"Maximum Characters","type":"Type","typeText":"Text","typePass":"Password","typeEmail":"Email","typeSearch":"Search","typeTel":"Telephone Number","typeUrl":"URL"}},"format":{"label":"Format","panelTitle":"Paragraph Format","tag_address":"Address","tag_div":"Normal (DIV)","tag_h1":"Heading 1","tag_h2":"Heading 2","tag_h3":"Heading 3","tag_h4":"Heading 4","tag_h5":"Heading 5","tag_h6":"Heading 6","tag_p":"Normal","tag_pre":"Formatted"},"horizontalrule":{"toolbar":"Insert Horizontal Line"},"iframe":{"border":"Show frame border","noUrl":"Please type the iframe URL","scrolling":"Enable scrollbars","title":"IFrame Properties","toolbar":"IFrame"},"image":{"alertUrl":"Please type the image URL","alt":"Alternative Text","border":"Border","btnUpload":"Send it to the Server","button2Img":"Do you want to transform the selected image button on a simple image?","hSpace":"HSpace","img2Button":"Do you want to transform the selected image on a image button?","infoTab":"Image Info","linkTab":"Link","lockRatio":"Lock Ratio","menu":"Image Properties","resetSize":"Reset Size","title":"Image Properties","titleButton":"Image Button Properties","upload":"Upload","urlMissing":"Image source URL is missing.","vSpace":"VSpace","validateBorder":"Border must be a whole number.","validateHSpace":"HSpace must be a whole number.","validateVSpace":"VSpace must be a whole number."},"smiley":{"options":"Smiley Options","title":"Insert a Smiley","toolbar":"Smiley"},"justify":{"block":"Justify","center":"Center","left":"Align Left","right":"Align Right"},"link":{"acccessKey":"Access Key","advanced":"Advanced","advisoryContentType":"Advisory Content Type","advisoryTitle":"Advisory Title","anchor":{"toolbar":"Anchor","menu":"Edit Anchor","title":"Anchor Properties","name":"Anchor Name","errorName":"Please type the anchor name","remove":"Remove Anchor"},"anchorId":"By Element Id","anchorName":"By Anchor Name","charset":"Linked Resource Charset","cssClasses":"Stylesheet Classes","emailAddress":"E-Mail Address","emailBody":"Message Body","emailSubject":"Message Subject","id":"Id","info":"Link Info","langCode":"Language Code","langDir":"Language Direction","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","menu":"Edit Link","name":"Name","noAnchors":"(No anchors available in the document)","noEmail":"Please type the e-mail address","noUrl":"Please type the link URL","other":"<other>","popupDependent":"Dependent (Netscape)","popupFeatures":"Popup Window Features","popupFullScreen":"Full Screen (IE)","popupLeft":"Left Position","popupLocationBar":"Location Bar","popupMenuBar":"Menu Bar","popupResizable":"Resizable","popupScrollBars":"Scroll Bars","popupStatusBar":"Status Bar","popupToolbar":"Toolbar","popupTop":"Top Position","rel":"Relationship","selectAnchor":"Select an Anchor","styles":"Style","tabIndex":"Tab Index","target":"Target","targetFrame":"<frame>","targetFrameName":"Target Frame Name","targetPopup":"<popup window>","targetPopupName":"Popup Window Name","title":"Link","toAnchor":"Link to anchor in the text","toEmail":"E-mail","toUrl":"URL","toolbar":"Link","type":"Link Type","unlink":"Unlink","upload":"Upload"},"liststyle":{"armenian":"Armenian numbering","bulletedTitle":"Bulleted List Properties","circle":"Circle","decimal":"Decimal (1, 2, 3, etc.)","decimalLeadingZero":"Decimal leading zero (01, 02, 03, etc.)","disc":"Disc","georgian":"Georgian numbering (an, ban, gan, etc.)","lowerAlpha":"Lower Alpha (a, b, c, d, e, etc.)","lowerGreek":"Lower Greek (alpha, beta, gamma, etc.)","lowerRoman":"Lower Roman (i, ii, iii, iv, v, etc.)","none":"None","notset":"<not set>","numberedTitle":"Numbered List Properties","square":"Square","start":"Start","type":"Type","upperAlpha":"Upper Alpha (A, B, C, D, E, etc.)","upperRoman":"Upper Roman (I, II, III, IV, V, etc.)","validateStartNumber":"List start number must be a whole number."},"magicline":{"title":"Insert paragraph here"},"maximize":{"maximize":"Maximize","minimize":"Minimize"},"newpage":{"toolbar":"New Page"},"pagebreak":{"alt":"Page Break","toolbar":"Insert Page Break for Printing"},"pastetext":{"button":"Paste as plain text","title":"Paste as Plain Text"},"pastefromword":{"confirmCleanup":"The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?","error":"It was not possible to clean up the pasted data due to an internal error","title":"Paste from Word","toolbar":"Paste from Word"},"preview":{"preview":"Preview"},"print":{"toolbar":"Print"},"removeformat":{"toolbar":"Remove Format"},"save":{"toolbar":"Save"},"selectall":{"toolbar":"Select All"},"showblocks":{"toolbar":"Show Blocks"},"sourcearea":{"toolbar":"Source"},"specialchar":{"options":"Special Character Options","title":"Select Special Character","toolbar":"Insert Special Character"},"scayt":{"about":"About SCAYT","aboutTab":"About","addWord":"Add Word","allCaps":"Ignore All-Caps Words","dic_create":"Create","dic_delete":"Delete","dic_field_name":"Dictionary name","dic_info":"Initially the User Dictionary is stored in a Cookie. However, Cookies are limited in size. When the User Dictionary grows to a point where it cannot be stored in a Cookie, then the dictionary may be stored on our server. To store your personal dictionary on our server you should specify a name for your dictionary. If you already have a stored dictionary, please type its name and click the Restore button.","dic_rename":"Rename","dic_restore":"Restore","dictionariesTab":"Dictionaries","disable":"Disable SCAYT","emptyDic":"Dictionary name should not be empty.","enable":"Enable SCAYT","ignore":"Ignore","ignoreAll":"Ignore All","ignoreDomainNames":"Ignore Domain Names","langs":"Languages","languagesTab":"Languages","mixedCase":"Ignore Words with Mixed Case","mixedWithDigits":"Ignore Words with Numbers","moreSuggestions":"More suggestions","opera_title":"Not supported by Opera","options":"Options","optionsTab":"Options","title":"Spell Check As You Type","toggle":"Toggle SCAYT","noSuggestions":"No suggestion"},"stylescombo":{"label":"Styles","panelTitle":"Formatting Styles","panelTitle1":"Block Styles","panelTitle2":"Inline Styles","panelTitle3":"Object Styles"},"table":{"border":"Border size","caption":"Caption","cell":{"menu":"Cell","insertBefore":"Insert Cell Before","insertAfter":"Insert Cell After","deleteCell":"Delete Cells","merge":"Merge Cells","mergeRight":"Merge Right","mergeDown":"Merge Down","splitHorizontal":"Split Cell Horizontally","splitVertical":"Split Cell Vertically","title":"Cell Properties","cellType":"Cell Type","rowSpan":"Rows Span","colSpan":"Columns Span","wordWrap":"Word Wrap","hAlign":"Horizontal Alignment","vAlign":"Vertical Alignment","alignBaseline":"Baseline","bgColor":"Background Color","borderColor":"Border Color","data":"Data","header":"Header","yes":"Yes","no":"No","invalidWidth":"Cell width must be a number.","invalidHeight":"Cell height must be a number.","invalidRowSpan":"Rows span must be a whole number.","invalidColSpan":"Columns span must be a whole number.","chooseColor":"Choose"},"cellPad":"Cell padding","cellSpace":"Cell spacing","column":{"menu":"Column","insertBefore":"Insert Column Before","insertAfter":"Insert Column After","deleteColumn":"Delete Columns"},"columns":"Columns","deleteTable":"Delete Table","headers":"Headers","headersBoth":"Both","headersColumn":"First column","headersNone":"None","headersRow":"First Row","invalidBorder":"Border size must be a number.","invalidCellPadding":"Cell padding must be a positive number.","invalidCellSpacing":"Cell spacing must be a positive number.","invalidCols":"Number of columns must be a number greater than 0.","invalidHeight":"Table height must be a number.","invalidRows":"Number of rows must be a number greater than 0.","invalidWidth":"Table width must be a number.","menu":"Table Properties","row":{"menu":"Row","insertBefore":"Insert Row Before","insertAfter":"Insert Row After","deleteRow":"Delete Rows"},"rows":"Rows","summary":"Summary","title":"Table Properties","toolbar":"Table","widthPc":"percent","widthPx":"pixels","widthUnit":"width unit"},"undo":{"redo":"Redo","undo":"Undo"},"wsc":{"btnIgnore":"Ignore","btnIgnoreAll":"Ignore All","btnReplace":"Replace","btnReplaceAll":"Replace All","btnUndo":"Undo","changeTo":"Change to","errorLoading":"Error loading application service host: %s.","ieSpellDownload":"Spell checker not installed. Do you want to download it now?","manyChanges":"Spell check complete: %1 words changed","noChanges":"Spell check complete: No words changed","noMispell":"Spell check complete: No misspellings found","noSuggestions":"- No suggestions -","notAvailable":"Sorry, but service is unavailable now.","notInDic":"Not in dictionary","oneChange":"Spell check complete: One word changed","progress":"Spell check in progress...","title":"Spell Check","toolbar":"Check Spelling"},"codemirror":{"toolbar":"Source","autoFormat":"Format Selection","commentSelectedRange":"Comment Selection","uncommentSelectedRange":"Uncomment Selection"}};
|
@@ -0,0 +1,74 @@
|
|
1
|
+
/* Extra for the CKEditor CodeMirror Plugin */
|
2
|
+
|
3
|
+
.CodeMirror {font:13px/1.4em monospace;}
|
4
|
+
|
5
|
+
.CodeMirror .activeline { background: #e8f2ff; }
|
6
|
+
|
7
|
+
.CodeMirror .CodeMirror-foldmarker {
|
8
|
+
color: blue;
|
9
|
+
text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
|
10
|
+
font-family: arial;
|
11
|
+
line-height: .3;
|
12
|
+
cursor: pointer;
|
13
|
+
}
|
14
|
+
|
15
|
+
/* Fixes for themes */
|
16
|
+
.cm-s-cobalt .CodeMirror-selected { background: #b36539 !important; }
|
17
|
+
.cm-s-erlang-dark .CodeMirror-selected { background: #b36539 !important; }
|
18
|
+
.cm-s-lesser-dark .CodeMirror-selected {background: #45443B !important;}
|
19
|
+
.cm-s-monokai .CodeMirror-selected {background: #49483E !important;}
|
20
|
+
.cm-s-night .CodeMirror-selected { background: #447 !important; }
|
21
|
+
.cm-s-rubyblue .CodeMirror-selected { background: #38566F !important; }
|
22
|
+
.cm-s-twilight .CodeMirror-selected { background: #323232 !important; }
|
23
|
+
.cm-s-xq-dark .CodeMirror-selected { background: #a8f !important; }
|
24
|
+
|
25
|
+
.cm-s-blackboard .activeline,
|
26
|
+
.cm-s-cobalt .activeline,
|
27
|
+
.cm-s-erlang-dark .activeline,
|
28
|
+
.cm-s-lesser-dark .activeline,
|
29
|
+
.cm-s-monokai .activeline,
|
30
|
+
.cm-s-night .activeline,
|
31
|
+
.cm-s-rubyblue .activeline,
|
32
|
+
.cm-s-vibrant-ink .activeline,
|
33
|
+
.cm-s-xq-dark .activeline { background: #757575; }
|
34
|
+
.cm-s-twilight .activeline { background:#494949; }
|
35
|
+
|
36
|
+
.CodeMirror-focused .cm-matchhighlight {
|
37
|
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==);
|
38
|
+
background-position: bottom;
|
39
|
+
background-repeat: repeat-x;
|
40
|
+
}
|
41
|
+
|
42
|
+
/* Dialog Addon */
|
43
|
+
.CodeMirror-dialog {
|
44
|
+
position: absolute;
|
45
|
+
left: 0; right: 0;
|
46
|
+
background: white;
|
47
|
+
z-index: 15;
|
48
|
+
padding: .1em .8em;
|
49
|
+
overflow: hidden;
|
50
|
+
color: #333;
|
51
|
+
}
|
52
|
+
|
53
|
+
.CodeMirror-dialog-top {
|
54
|
+
border-bottom: 1px solid #eee;
|
55
|
+
top: 0;
|
56
|
+
}
|
57
|
+
|
58
|
+
.CodeMirror-dialog-bottom {
|
59
|
+
border-top: 1px solid #eee;
|
60
|
+
bottom: 0;
|
61
|
+
}
|
62
|
+
|
63
|
+
.CodeMirror-dialog input {
|
64
|
+
border: none;
|
65
|
+
outline: none;
|
66
|
+
background: transparent;
|
67
|
+
width: 20em;
|
68
|
+
color: inherit;
|
69
|
+
font-family: monospace;
|
70
|
+
}
|
71
|
+
|
72
|
+
.CodeMirror-dialog button {
|
73
|
+
font-size: 70%;
|
74
|
+
}
|
@@ -61,7 +61,7 @@
|
|
61
61
|
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
|
62
62
|
|
63
63
|
/* DEFAULT THEME */
|
64
|
-
|
64
|
+
|
65
65
|
.cm-s-default .cm-keyword {color: #708;}
|
66
66
|
.cm-s-default .cm-atom {color: #219;}
|
67
67
|
.cm-s-default .cm-number {color: #164;}
|
@@ -148,6 +148,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
148
148
|
.CodeMirror-gutters {
|
149
149
|
position: absolute; left: 0; top: 0;
|
150
150
|
height: 100%;
|
151
|
+
padding-bottom: 30px;
|
151
152
|
z-index: 3;
|
152
153
|
}
|
153
154
|
.CodeMirror-gutter {
|
@@ -199,6 +200,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
199
200
|
overflow: auto;
|
200
201
|
}
|
201
202
|
|
203
|
+
.CodeMirror-widget {
|
204
|
+
display: inline-block;
|
205
|
+
}
|
206
|
+
|
202
207
|
.CodeMirror-wrap .CodeMirror-scroll {
|
203
208
|
overflow-x: hidden;
|
204
209
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
.CodeMirror{font-family:monospace;height:300px}.CodeMirror-scroll{overflow:auto}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7}.CodeMirror-linenumbers{}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:transparent;background:rgba(0,200,0,.4);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800,endColorstr=#4c00c800)}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id){filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite{}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable{color:#000}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-property{color:#000}.cm-s-default .cm-operator{color:#000}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-error{color:red}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-emstrong{font-style:italic;font-weight:bold}.cm-link{text-decoration:underline}.cm-invalidchar{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror{line-height:1;position:relative;overflow:hidden}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;padding-right:30px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0;z-index:6}.CodeMirror-gutters{position:absolute;left:0;top:0;height:100%;padding-bottom:30px;z-index:3}.CodeMirror-gutter{height:100%;display:inline-block;*zoom:1;*display:inline}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;-o-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-widget{display:inline-block}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;visibility:hidden;border-right:none;width:0}.CodeMirror-focused div.CodeMirror-cursor{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}@media print{.CodeMirror div.CodeMirror-cursor{visibility:hidden}}.CodeMirror{font:13px/1.4em monospace}.CodeMirror .activeline{background:#e8f2ff}.CodeMirror .CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.cm-s-cobalt .CodeMirror-selected{background:#b36539!important}.cm-s-erlang-dark .CodeMirror-selected{background:#b36539!important}.cm-s-lesser-dark .CodeMirror-selected{background:#45443b!important}.cm-s-monokai .CodeMirror-selected{background:#49483e!important}.cm-s-night .CodeMirror-selected{background:#447!important}.cm-s-rubyblue .CodeMirror-selected{background:#38566f!important}.cm-s-twilight .CodeMirror-selected{background:#323232!important}.cm-s-xq-dark .CodeMirror-selected{background:#a8f!important}.cm-s-blackboard .activeline,.cm-s-cobalt .activeline,.cm-s-erlang-dark .activeline,.cm-s-lesser-dark .activeline,.cm-s-monokai .activeline,.cm-s-night .activeline,.cm-s-rubyblue .activeline,.cm-s-vibrant-ink .activeline,.cm-s-xq-dark .activeline{background:#757575}.cm-s-twilight .activeline{background:#494949}.CodeMirror-focused .cm-matchhighlight{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==);background-position:bottom;background-repeat:repeat-x}.CodeMirror-dialog{position:absolute;left:0;right:0;background:#fff;z-index:15;padding:.1em .8em;overflow:hidden;color:#333}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:none;background:transparent;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
(function(){function j(a,f,b){a=a.getWrapperElement().appendChild(document.createElement("div"));a.className=b?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top";a.innerHTML=f;return a}CodeMirror.defineExtension("openDialog",function(a,f,b){function d(){g||(g=!0,e.parentNode.removeChild(e))}var e=j(this,a,b&&b.bottom),g=!1,h=this,c=e.getElementsByTagName("input")[0];if(c)CodeMirror.on(c,"keydown",function(a){if(13==a.keyCode||27==a.keyCode)CodeMirror.e_stop(a),
|
2
|
+
d(),h.focus(),13==a.keyCode&&f(c.value)}),b&&b.value&&(c.value=b.value),c.focus(),CodeMirror.on(c,"blur",d);else if(a=e.getElementsByTagName("button")[0])CodeMirror.on(a,"click",function(){d();h.focus()}),a.focus(),CodeMirror.on(a,"blur",d);return d});CodeMirror.defineExtension("openConfirm",function(a,f,b){function d(){g||(g=!0,e.parentNode.removeChild(e),h.focus())}var e=j(this,a,b&&b.bottom),a=e.getElementsByTagName("button"),g=!1,h=this,c=1;a[0].focus();for(b=0;b<a.length;++b){var i=a[b];(function(a){CodeMirror.on(i,
|
3
|
+
"click",function(b){CodeMirror.e_preventDefault(b);d();a&&a(h)})})(f[b]);CodeMirror.on(i,"blur",function(){--c;setTimeout(function(){0>=c&&d()},200)});CodeMirror.on(i,"focus",function(){++c})}})})();
|
@@ -0,0 +1,2 @@
|
|
1
|
+
(function(){function f(b){for(var c={name:"autoCloseBrackets"},a=0;a<b.length;a+=2)(function(a,b){function e(a){var d=a.getCursor();if(a.getRange(d,CodeMirror.Pos(d.line,d.ch+1))!=b)return CodeMirror.Pass;a.execCommand("goCharRight")}c["'"+a+"'"]=function(c){if(!(a==b&&e(c)!=CodeMirror.Pass)){var d=c.getCursor("start"),d=CodeMirror.Pos(d.line,d.ch+1);c.replaceSelection(a+b,{head:d,anchor:d})}};a!=b&&(c["'"+b+"'"]=e)})(b.charAt(a),b.charAt(a+1));return c}CodeMirror.defineOption("autoCloseBrackets",
|
2
|
+
!1,function(b,c,a){a=a&&a!=CodeMirror.Init;c&&!a?b.addKeyMap(f(typeof c=="string"?c:"()[]{}''\"\"")):!c&&a&&b.removeKeyMap("autoCloseBrackets")})})();
|
@@ -1,3 +1,3 @@
|
|
1
|
-
(function(){function
|
2
|
-
|
3
|
-
{name:"autoCloseTags"};if(typeof
|
1
|
+
(function(){function h(b,c){var a=b.getCursor(),e=b.getTokenAt(a),g=CodeMirror.innerMode(b.getMode(),e.state),f=g.state;if("xml"!=g.mode.name)return CodeMirror.Pass;var d=b.getOption("autoCloseTags"),i="html"==g.mode.configuration,g="object"==typeof d&&d.dontCloseTags||i&&k,i="object"==typeof d&&d.indentTags||i&&l;if(">"==c&&f.tagName){d=f.tagName;e.end>a.ch&&(d=d.slice(0,d.length-e.end+a.ch));var h=d.toLowerCase();if("tag"==e.type&&"closeTag"==f.type||/\/\s*$/.test(e.string)||g&&-1<j(g,h))return CodeMirror.Pass;
|
2
|
+
f=(e=i&&-1<j(i,h))?CodeMirror.Pos(a.line+1,0):CodeMirror.Pos(a.line,a.ch+1);b.replaceSelection(">"+(e?"\n\n":"")+"</"+d+">",{head:f,anchor:f});e&&(b.indentLine(a.line+1),b.indentLine(a.line+2))}else if("/"==c&&"<"==e.string)(d=f.context&&f.context.tagName)&&b.replaceSelection("/"+d+">","end");else return CodeMirror.Pass}function j(b,c){if(b.indexOf)return b.indexOf(c);for(var a=0,e=b.length;a<e;++a)if(b[a]==c)return a;return-1}CodeMirror.defineOption("autoCloseTags",!1,function(b,c,a){if(c&&(a==CodeMirror.Init||
|
3
|
+
!a)){a={name:"autoCloseTags"};if(typeof c!="object"||c.whenClosing)a["'/'"]=function(a){return h(a,"/")};if(typeof c!="object"||c.whenOpening)a["'>'"]=function(a){return h(a,">")};b.addKeyMap(a)}else!c&&(a!=CodeMirror.Init&&a)&&b.removeKeyMap("autoCloseTags")});var k="area base br col command embed hr img input keygen link meta param source track wbr".split(" "),l="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".split(" ")})();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(){function
|
2
|
-
|
3
|
-
{className:f})
|
4
|
-
function(){return
|
1
|
+
(function(){function l(b){function e(a,c,d){if(a.text){var g=j?0:a.text.length-1,f=j?a.text.length:-1;for(null!=d&&(g=d+h);g!=f;g+=h)if(d=a.text.charAt(g),m.test(d)&&b.getTokenAt(i(c,g+1)).type==l){var e=o[d];if(">"==e.charAt(1)==j)p.push(d);else{if(p.pop()!=e.charAt(0))return{pos:g,match:!1};if(!p.length)return{pos:g,match:!0}}}}}var a=b.getCursor(),f=b.getLineHandle(a.line),d=a.ch-1,c=0<=d&&o[f.text.charAt(d)]||o[f.text.charAt(++d)];if(!c)return null;for(var j=">"==c.charAt(1),h=j?1:-1,l=b.getTokenAt(i(a.line,
|
2
|
+
d+1)).type,p=[f.text.charAt(d)],m=/[(){}[\]]/,c=a.line,k,n=j?Math.min(c+100,b.lineCount()):Math.max(-1,c-100);c!=n&&!(k=c==a.line?e(f,c,d):e(b.getLineHandle(c),c));c+=h);return{from:i(a.line,d),to:k&&i(c,k.pos),match:k&&k.match}}function m(b,e){var a=l(b);if(a&&!(b.getLine(a.from.line).length>n||a.to&&b.getLine(a.to.line).length>n)){var f=a.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",d=b.markText(a.from,i(a.from.line,a.from.ch+1),{className:f}),c=a.to&&b.markText(a.to,i(a.to.line,
|
3
|
+
a.to.ch+1),{className:f});r&&b.state.focused&&b.display.input.focus();a=function(){b.operation(function(){d.clear();c&&c.clear()})};if(e)setTimeout(a,800);else return a}}function q(b){b.operation(function(){h&&(h(),h=null);b.somethingSelected()||(h=m(b,!1))})}var r=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||8>document.documentMode),i=CodeMirror.Pos,n=1E3,o={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},h=null;CodeMirror.defineOption("matchBrackets",!1,function(b,e){if(e)b.on("cursorActivity",
|
4
|
+
q);else b.off("cursorActivity",q)});CodeMirror.defineExtension("matchBrackets",function(){m(this,!0)});CodeMirror.defineExtension("findMatchingBracket",function(){return l(this)})})();
|
data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/{util → addon/foldcode}/foldcode.js
RENAMED
@@ -1,7 +1,7 @@
|
|
1
1
|
CodeMirror.tagRangeFinder=function(h,e){for(var f=RegExp("^[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][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-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*"),b=h.getLine(e.line),a=!1,d=null,c=e.ch;!a;){c=b.indexOf("<",
|
2
2
|
c);if(-1==c)return;if(c+1<b.length&&"/"==b[c+1])c++;else if(b.substr(c+1).match(f)){var g=b.indexOf(">",c+1);if(-1==g){for(var a=e.line+1,l=!1,j=h.lineCount();a<j&&!l;){var i=h.getLine(a),g=i.indexOf(">");if(-1!=g&&(l=!0,i=i.lastIndexOf("/",g),-1!=i&&i<g&&(i=b.substr(i,g-i+1),!i.match(/\/\s*\>/))))return;a++}a=!0}else j=b.lastIndexOf("/",g),-1==j?a=!0:(i=b.substr(j,g-j+1),i.match(/\/\s*\>/)||(a=!0));a&&((d=b.substr(c+1).match(f))?(d=d[0],-1!=b.indexOf("</"+d+">",c)&&(a=!1)):a=!1);a||c++}else c++}if(a){f=
|
3
|
-
RegExp("(\\<\\/"+d+"\\>)|(\\<"+d+"\\>)|(\\<"+d+"\\s)|(\\<"+d+"$)");d="</"+d+">";c=1;a=e.line+1;for(j=h.lineCount();a<j;){b=h.getLine(a);if(b=b.match(f))for(l=0;l<b.length;l++)if(b[l]==d?c--:c++,!c)return{from:
|
4
|
-
CodeMirror.braceRangeFinder=function(h,e){for(var f=e.line,b=h.getLine(f),a=b.length,d,c;;){a=b.lastIndexOf("{",a);if(a<e.ch)break;c=h.getTokenAt(
|
5
|
-
j;l=k;break a}++k}if(!(null==g||g==f+1))return{from:
|
6
|
-
CodeMirror.newFoldFunction=function(h,e){null==e&&(e="↔");if("string"==typeof e){var f=document.createTextNode(e),e=document.createElement("span");e.appendChild(f);e.className="CodeMirror-foldmarker"}return function(b,a){"number"==typeof a&&(a=
|
3
|
+
RegExp("(\\<\\/"+d+"\\>)|(\\<"+d+"\\>)|(\\<"+d+"\\s)|(\\<"+d+"$)");d="</"+d+">";c=1;a=e.line+1;for(j=h.lineCount();a<j;){b=h.getLine(a);if(b=b.match(f))for(l=0;l<b.length;l++)if(b[l]==d?c--:c++,!c)return{from:CodeMirror.Pos(e.line,g+1),to:CodeMirror.Pos(a,b.index)};a++}}};
|
4
|
+
CodeMirror.braceRangeFinder=function(h,e){for(var f=e.line,b=h.getLine(f),a=b.length,d,c;;){a=b.lastIndexOf("{",a);if(a<e.ch)break;c=h.getTokenAt(CodeMirror.Pos(f,a+1)).type;if(!/^(comment|string)/.test(c)){d=a;break}a-=1}if(!(null==d||b.lastIndexOf("}")>d)){var b=1,a=h.lineCount(),g,l,j=f+1;a:for(;j<a;++j)for(var i=h.getLine(j),k=0;;){var m=i.indexOf("{",k),k=i.indexOf("}",k);0>m&&(m=i.length);0>k&&(k=i.length);k=Math.min(m,k);if(k==i.length)break;if(h.getTokenAt(CodeMirror.Pos(j,k+1)).type==c)if(k==
|
5
|
+
m)++b;else if(!--b){g=j;l=k;break a}++k}if(!(null==g||g==f+1))return{from:CodeMirror.Pos(f,d+1),to:CodeMirror.Pos(g,l)}}};CodeMirror.indentRangeFinder=function(h,e){for(var f=h.getOption("tabSize"),b=h.getLine(e.line),a=CodeMirror.countColumn(b,null,f),d=e.line+1,c=h.lineCount();d<c;++d){var g=h.getLine(d);if(CodeMirror.countColumn(g,null,f)<a&&CodeMirror.countColumn(h.getLine(d-1),null,f)>a)return{from:CodeMirror.Pos(e.line,b.length),to:CodeMirror.Pos(d,g.length)}}};
|
6
|
+
CodeMirror.newFoldFunction=function(h,e){null==e&&(e="↔");if("string"==typeof e){var f=document.createTextNode(e),e=document.createElement("span");e.appendChild(f);e.className="CodeMirror-foldmarker"}return function(b,a){"number"==typeof a&&(a=CodeMirror.Pos(a,0));var d=h(b,a);if(d){for(var c=b.findMarksAt(d.from),g=0,f=0;f<c.length;++f)c[f].__isFold&&(++g,c[f].clear());if(!g){c=e.cloneNode(!0);CodeMirror.on(c,"mousedown",function(){j.clear()});var j=b.markText(d.from,d.to,{replacedWith:c,clearOnEnter:!0,
|
7
7
|
__isFold:!0})}}}};
|
@@ -0,0 +1,2 @@
|
|
1
|
+
(function(){CodeMirror.defineExtension("autoFormatAll",function(e,m){for(var b=this,f=b.getMode(),h=b.getRange(e,m).split("\n"),i=CodeMirror.copyState(f,b.getTokenAt(e).state),n=b.getOption("tabSize"),d="",j=0,c=0==e.ch,g=0;g<h.length;++g){for(var a=new CodeMirror.StringStream(h[g],n);!a.eol();){var k=CodeMirror.innerMode(f,i),o=f.token(a,i),l=a.current();a.start=a.pos;if(!c||/\S/.test(l))d+=l,c=!1;if(!c&&k.mode.newlineAfterToken&&k.mode.newlineAfterToken(o,l,a.string.slice(a.pos)||h[g+1]||"",k.state))d+=
|
2
|
+
"\n",c=!0,++j}!a.pos&&f.blankLine&&f.blankLine(i);!c&&g<h.length-1&&(d+="\n",c=!0,++j)}b.operation(function(){b.replaceRange(d,e,m);for(var a=e.line+1,c=e.line+j;a<=c;++a)b.indentLine(a,"smart");b.setCursor({line:0,ch:0})})})})();
|
@@ -1,5 +1,5 @@
|
|
1
|
-
(function(){CodeMirror.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(
|
2
|
-
CodeMirror.extendMode("xml",{commentStart:"<\!--",commentEnd:"--\>",newlineAfterToken:function(
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
(function(){CodeMirror.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(e,c){return/^[;{}]$/.test(c)}});CodeMirror.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(e,c,b,a){return this.jsonMode?/^[\[,{]$/.test(c)||/^}/.test(b):";"==c&&a.lexical&&")"==a.lexical.type?!1:/^[;{}]$/.test(c)&&!/^;/.test(b)}});var l=/^(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)$/;
|
2
|
+
CodeMirror.extendMode("xml",{commentStart:"<\!--",commentEnd:"--\>",newlineAfterToken:function(e,c,b,a){var d=!1;"html"==this.configuration&&(d=a.context?l.test(a.context.tagName):!1);return!d&&("tag"==e&&/>$/.test(c)&&a.context||/^</.test(b))}});CodeMirror.defineExtension("commentRange",function(e,c,b){var a=this,d=CodeMirror.innerMode(a.getMode(),a.getTokenAt(c).state).mode;a.operation(function(){if(e)a.replaceRange(d.commentEnd,b),a.replaceRange(d.commentStart,c),c.line==b.line&&c.ch==b.ch&&a.setCursor(c.line,
|
3
|
+
c.ch+d.commentStart.length);else{var g=a.getRange(c,b),i=g.indexOf(d.commentStart),f=g.lastIndexOf(d.commentEnd);-1<i&&(-1<f&&f>i)&&(g=g.substr(0,i)+g.substring(i+d.commentStart.length,f)+g.substr(f+d.commentEnd.length));a.replaceRange(g,c,b)}})});CodeMirror.defineExtension("autoIndentRange",function(e,c){var b=this;this.operation(function(){for(var a=e.line;a<=c.line;a++)b.indentLine(a,"smart")})});CodeMirror.defineExtension("autoFormatRange",function(e,c){for(var b=this,a=b.getMode(),d=b.getRange(e,
|
4
|
+
c).split("\n"),g=CodeMirror.copyState(a,b.getTokenAt(e).state),i=b.getOption("tabSize"),f="",m=0,j=0==e.ch,k=0;k<d.length;++k){for(var h=new CodeMirror.StringStream(d[k],i);!h.eol();){var n=CodeMirror.innerMode(a,g),l=a.token(h,g),o=h.current();h.start=h.pos;if(!j||/\S/.test(o))f+=o,j=!1;if(!j&&n.mode.newlineAfterToken&&n.mode.newlineAfterToken(l,o,h.string.slice(h.pos)||d[k+1]||"",n.state))f+="\n",j=!0,++m}!h.pos&&a.blankLine&&a.blankLine(g);!j&&k<d.length-1&&(f+="\n",j=!0,++m)}b.operation(function(){b.replaceRange(f,
|
5
|
+
e,c);for(var a=e.line+1,d=e.line+m;a<=d;++a)b.indentLine(a,"smart");b.setSelection(e,b.getCursor(!1))})})})();
|
@@ -0,0 +1,2 @@
|
|
1
|
+
(function(){function e(a){this.minChars="object"==typeof a&&a.minChars||f;this.style="object"==typeof a&&a.style||g;this.overlay=null}function d(a){a.operation(function(){var b=a._matchHighlightState;b.overlay&&(a.removeOverlay(b.overlay),b.overlay=null);if(a.somethingSelected()){var c=a.getSelection().replace(/^\s+|\s+$/g,"");c.length<b.minChars||a.addOverlay(b.overlay=h(c,b.style))}})}function h(a,b){return{token:function(c){if(c.match(a))return b;c.next();c.skipTo(a.charAt(0))||c.skipToEnd()}}}
|
2
|
+
var f=2,g="matchhighlight";CodeMirror.defineOption("highlightSelectionMatches",!1,function(a,b,c){c=c&&c!=CodeMirror.Init;if(b&&!c){a._matchHighlightState=new e(b);a.on("cursorActivity",d)}else if(!b&&c){(b=a._matchHighlightState.overlay)&&a.removeOverlay(b);a._matchHighlightState=null;a.off("cursorActivity",d)}})})();
|
@@ -0,0 +1,5 @@
|
|
1
|
+
(function(){function n(a){return"string"==typeof a?{token:function(b){if(b.match(a))return"searching";b.next();b.skipTo(a.charAt(0))||b.skipToEnd()}}:{token:function(b){if(b.match(a))return"searching";for(;!b.eol()&&!(b.next(),b.match(a,!1)););}}}function f(){this.overlay=this.posFrom=this.posTo=this.query=null}function g(a,b,c){return a.getSearchCursor(b,c,"string"==typeof b&&b==b.toLowerCase())}function h(a,b,c,d){a.openDialog?a.openDialog(b,d):d(prompt(c,""))}function o(a,b,c,d){if(a.openConfirm)a.openConfirm(b,
|
2
|
+
d);else if(confirm(c))d[0]()}function k(a){var b=a.match(/^\/(.*)\/([a-z]*)$/);return b?RegExp(b[1],-1==b[2].indexOf("i")?"":"i"):a}function i(a,b){var c=a._searchState||(a._searchState=new f);if(c.query)return l(a,b);h(a,p,"Search for:",function(d){a.operation(function(){d&&!c.query&&(c.query=k(d),a.removeOverlay(c.overlay),c.overlay=n(d),a.addOverlay(c.overlay),c.posFrom=c.posTo=a.getCursor(),l(a,b))})})}function l(a,b){a.operation(function(){var c=a._searchState||(a._searchState=new f),d=g(a,c.query,
|
3
|
+
b?c.posFrom:c.posTo);if(!d.find(b)&&(d=g(a,c.query,b?CodeMirror.Pos(a.lastLine()):CodeMirror.Pos(a.firstLine(),0)),!d.find(b)))return;a.setSelection(d.from(),d.to());c.posFrom=d.from();c.posTo=d.to()})}function j(a){a.operation(function(){var b=a._searchState||(a._searchState=new f);b.query&&(b.query=null,a.removeOverlay(b.overlay))})}function m(a,b){h(a,q,"Replace:",function(c){c&&(c=k(c),h(a,r,"Replace with:",function(d){if(b)a.operation(function(){for(var b=g(a,c);b.findNext();)if("string"!=typeof c){var e=
|
4
|
+
a.getRange(b.from(),b.to()).match(c);b.replace(d.replace(/\$(\d)/,function(a,b){return e[b]}))}else b.replace(d)});else{j(a);var e=g(a,c,a.getCursor()),f=function(){var b=e.from(),d;if(!(d=e.findNext()))if(e=g(a,c),!(d=e.findNext())||b&&e.from().line==b.line&&e.from().ch==b.ch)return;a.setSelection(e.from(),e.to());o(a,s,"Replace?",[function(){h(d)},f])},h=function(a){e.replace("string"==typeof c?d:d.replace(/\$(\d)/,function(b,c){return a[c]}));f()};f()}}))})}var p='Search: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>',
|
5
|
+
q='Replace: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>',r='With: <input type="text" style="width: 10em"/>',s="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";CodeMirror.commands.find=function(a){j(a);i(a)};CodeMirror.commands.findNext=i;CodeMirror.commands.findPrev=function(a){i(a,!0)};CodeMirror.commands.clearSearch=j;CodeMirror.commands.replace=m;CodeMirror.commands.replaceAll=function(a){m(a,!0)}})();
|
@@ -0,0 +1,5 @@
|
|
1
|
+
(function(){function m(e,a,f,c){this.atOccurrence=!1;this.cm=e;null==c&&"string"==typeof a&&(c=!1);f=f?e.clipPos(f):i(0,0);this.pos={from:f,to:f};if("string"!=typeof a)a.global||(a=RegExp(a.source,a.ignoreCase?"ig":"g")),this.matches=function(n,h){if(n){a.lastIndex=0;for(var g=e.getLine(h.line).slice(0,h.ch),d=a.exec(g),b=0;d;){b+=d.index+1;g=g.slice(b);a.lastIndex=0;var c=a.exec(g);if(c)d=c;else break}b--}else a.lastIndex=h.ch,g=e.getLine(h.line),b=(d=a.exec(g))&&d.index;if(d&&d[0])return{from:i(h.line,
|
2
|
+
b),to:i(h.line,b+d[0].length),match:d}};else{c&&(a=a.toLowerCase());var j=c?function(a){return a.toLowerCase()}:function(a){return a},k=a.split("\n");this.matches=1==k.length?a.length?function(c,h){var g=j(e.getLine(h.line)),d=a.length,b;if(c?h.ch>=d&&-1!=(b=g.lastIndexOf(a,h.ch-d)):-1!=(b=g.indexOf(a,h.ch)))return{from:i(h.line,b),to:i(h.line,b+d)}}:function(){}:function(a,c){var g=c.line,d=a?k.length-1:0,b=k[d],f=j(e.getLine(g)),l=a?f.indexOf(b)+b.length:f.lastIndexOf(b);if(!(a?l>=c.ch||l!=b.length:
|
3
|
+
l<=c.ch||l!=f.length-b.length))for(;!(a?!g:g==e.lineCount()-1);){f=j(e.getLine(g+=a?-1:1));b=k[a?--d:++d];if(0<d&&d<k.length-1)if(f!=b)break;else continue;d=a?f.lastIndexOf(b):f.indexOf(b)+b.length;if(a?d!=f.length-b.length:d!=b.length)break;b=i(c.line,l);g=i(g,d);return{from:a?g:b,to:a?b:g}}}}}var i=CodeMirror.Pos;m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function a(a){a=i(a,0);f.pos={from:a,to:a};return f.atOccurrence=!1}
|
4
|
+
for(var f=this,c=this.cm.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,c))return(!this.pos.from||!this.pos.to)&&console.log(this.matches,this.pos),this.atOccurrence=!0,this.pos.match||!0;if(e){if(!c.line)return a(0);c=i(c.line-1,this.cm.getLine(c.line-1).length)}else{var j=this.cm.lineCount();if(c.line==j-1)return a(j);c=i(c.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(e){this.atOccurrence&&
|
5
|
+
(e=CodeMirror.splitLines(e),this.cm.replaceRange(e,this.pos.from,this.pos.to),this.pos.to=i(this.pos.from.line+e.length-1,e[e.length-1].length+(1==e.length?this.pos.from.ch:0)))}};CodeMirror.defineExtension("getSearchCursor",function(e,a,f){return new m(this,e,a,f)})})();
|
@@ -0,0 +1,25 @@
|
|
1
|
+
(function(){function d(h){for(var c={name:"autoCloseBrackets"},e=0;e<h.length;e+=2)(function(a,f){function b(a){var b=a.getCursor();if(a.getRange(b,CodeMirror.Pos(b.line,b.ch+1))!=f)return CodeMirror.Pass;a.execCommand("goCharRight")}c["'"+a+"'"]=function(g){if(a!=f||b(g)==CodeMirror.Pass){var i=g.getCursor("start"),i=CodeMirror.Pos(i.line,i.ch+1);g.replaceSelection(a+f,{head:i,anchor:i})}};a!=f&&(c["'"+f+"'"]=b)})(h.charAt(e),h.charAt(e+1));return c}CodeMirror.defineOption("autoCloseBrackets",!1,
|
2
|
+
function(h,c,e){e=e&&e!=CodeMirror.Init;c&&!e?h.addKeyMap(d(typeof c=="string"?c:"()[]{}''\"\"")):!c&&e&&h.removeKeyMap("autoCloseBrackets")})})();
|
3
|
+
(function(){function d(a,f){var b=a.getCursor(),g=a.getTokenAt(b),i=CodeMirror.innerMode(a.getMode(),g.state),d=i.state,k,j;if("xml"!=i.mode.name)return CodeMirror.Pass;var l=a.getOption("autoCloseTags"),n="html"==i.mode.configuration,i="object"==typeof l&&l.dontCloseTags||n&&c,l="object"==typeof l&&l.indentTags||n&&e;if(">"==f&&d.tagName){if(j=d.tagName,g.end>b.ch&&(j=j.slice(0,j.length-g.end+b.ch)),k=j.toLowerCase(),"tag"==g.type&&"closeTag"==d.type||/\/\s*$/.test(g.string)||i&&-1<h(i,k))return CodeMirror.Pass;
|
4
|
+
d=(g=l&&-1<h(l,k))?CodeMirror.Pos(b.line+1,0):CodeMirror.Pos(b.line,b.ch+1);a.replaceSelection(">"+(g?"\n\n":"")+"</"+j+">",{head:d,anchor:d});g&&(a.indentLine(b.line+1),a.indentLine(b.line+2))}else if("/"==f&&"<"==g.string)(j=d.context&&d.context.tagName)&&a.replaceSelection("/"+j+">","end");else return CodeMirror.Pass}function h(a,f){if(a.indexOf)return a.indexOf(f);for(var b=0,g=a.length;b<g;++b)if(a[b]==f)return b;return-1}CodeMirror.defineOption("autoCloseTags",!1,function(a,f,b){if(f&&(b==CodeMirror.Init||
|
5
|
+
!b)){b={name:"autoCloseTags"};(typeof f!="object"||f.whenClosing)&&(b["'/'"]=function(a){return d(a,"/")});(typeof f!="object"||f.whenOpening)&&(b["'>'"]=function(a){return d(a,">")});a.addKeyMap(b)}else!f&&b!=CodeMirror.Init&&b&&a.removeKeyMap("autoCloseTags")});var c="area base br col command embed hr img input keygen link meta param source track wbr".split(" "),e="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".split(" ")})();
|
6
|
+
(function(){function d(f){function g(e,c,h){var d,k,j,l;if(e.text){d=q?0:e.text.length-1;k=q?e.text.length:-1;for(null!=h&&(d=h+r);d!=k;d+=r)if(j=e.text.charAt(d),t.test(j)&&f.getTokenAt(a(c,d+1)).type==u)if(l=b[j],">"==l.charAt(1)==q)s.push(j);else{if(s.pop()!=l.charAt(0))return{pos:d,match:!1};if(!s.length)return{pos:d,match:!0}}}}var e=f.getCursor(),c=f.getLineHandle(e.line),h=e.ch-1,d=0<=h&&b[c.text.charAt(h)]||b[c.text.charAt(++h)],o,p;if(!d)return null;var q=">"==d.charAt(1),r=q?1:-1,u=f.getTokenAt(a(e.line,
|
7
|
+
h+1)).type,s=[c.text.charAt(h)],t=/[(){}[\]]/,d=e.line;for(p=q?Math.min(d+100,f.lineCount()):Math.max(-1,d-100);d!=p&&!(o=d==e.line?g(c,d,h):g(f.getLineHandle(d),d),o);d+=r);return{from:a(e.line,h),to:o&&a(d,o.pos),match:o&&o.match}}function h(b,g){var c=d(b);if(c&&!(b.getLine(c.from.line).length>f)&&(!c.to||!(b.getLine(c.to.line).length>f))){var h=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",l=b.markText(c.from,a(c.from.line,c.from.ch+1),{className:h}),n=c.to&&b.markText(c.to,
|
8
|
+
a(c.to.line,c.to.ch+1),{className:h});if(e&&b.state.focused&&b.display.input.focus(),c=function(){b.operation(function(){l.clear();n&&n.clear()})},g)setTimeout(c,800);else return c}}function c(b){b.operation(function(){g&&(g(),g=null);b.somethingSelected()||(g=h(b,!1))})}var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||8>document.documentMode),a=CodeMirror.Pos,f=1E3,b={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},g=null;CodeMirror.defineOption("matchBrackets",!1,
|
9
|
+
function(b,a){if(a)b.on("cursorActivity",c);else b.off("cursorActivity",c)});CodeMirror.defineExtension("matchBrackets",function(){h(this,!0)});CodeMirror.defineExtension("findMatchingBracket",function(){return d(this)})})();
|
10
|
+
CodeMirror.tagRangeFinder=function(d,h){for(var c=RegExp("^[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][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-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*"),e=d.getLine(h.line),a=!1,f=null,b=h.ch,g,i,m,k,
|
11
|
+
j,l,n;!a;){if(b=e.indexOf("<",b),-1==b)return;if(b+1<e.length&&"/"==e[b+1])b++;else if(e.substr(b+1).match(c)){if(g=e.indexOf(">",b+1),-1==g){var a=h.line+1,o=!1;for(k=d.lineCount();a<k&&!o;){if(i=d.getLine(a),g=i.indexOf(">"),-1!=g&&(o=!0,m=i.lastIndexOf("/",g),-1!=m&&m<g&&(j=e.substr(m,g-m+1),!j.match(/\/\s*\>/))))return;a++}a=!0}else k=e.lastIndexOf("/",g),-1==k?a=!0:(j=e.substr(k,g-k+1),j.match(/\/\s*\>/)||(a=!0));a&&(l=e.substr(b+1),f=l.match(c),f?(f=f[0],-1!=e.indexOf("</"+f+">",b)&&(a=!1)):
|
12
|
+
a=!1);a||b++}else b++}if(a){c=RegExp("(\\<\\/"+f+"\\>)|(\\<"+f+"\\>)|(\\<"+f+"\\s)|(\\<"+f+"$)");b="</"+f+">";i=1;a=h.line+1;for(k=d.lineCount();a<k;){if(e=d.getLine(a),n=e.match(c),n)for(f=0;f<n.length;f++)if(n[f]==b?i--:i++,!i)return{from:CodeMirror.Pos(h.line,g+1),to:CodeMirror.Pos(a,n.index)};a++}}};
|
13
|
+
CodeMirror.braceRangeFinder=function(d,h){for(var c=h.line,e=d.getLine(c),a=e.length,f,b,g,i,m,k,j,l,n;!(g=e.lastIndexOf("{",a),g<h.ch);){if(b=d.getTokenAt(CodeMirror.Pos(c,g+1)).type,!/^(comment|string)/.test(b)){f=g;break}a=g-1}if(null!=f&&!(e.lastIndexOf("}")>f)){e=1;a=d.lineCount();g=c+1;a:for(;g<a;++g){k=d.getLine(g);for(j=0;!(l=k.indexOf("{",j),n=k.indexOf("}",j),0>l&&(l=k.length),0>n&&(n=k.length),j=Math.min(l,n),j==k.length);){if(d.getTokenAt(CodeMirror.Pos(g,j+1)).type==b)if(j==l)++e;else if(!--e){i=
|
14
|
+
g;m=j;break a}++j}}if(null!=i&&i!=c+1)return{from:CodeMirror.Pos(c,f+1),to:CodeMirror.Pos(i,m)}}};CodeMirror.indentRangeFinder=function(d,h){for(var c=d.getOption("tabSize"),e=d.getLine(h.line),a=CodeMirror.countColumn(e,null,c),f,b=h.line+1,g=d.lineCount();b<g;++b)if(f=d.getLine(b),CodeMirror.countColumn(f,null,c)<a&&CodeMirror.countColumn(d.getLine(b-1),null,c)>a)return{from:CodeMirror.Pos(h.line,e.length),to:CodeMirror.Pos(b,f.length)}};
|
15
|
+
CodeMirror.newFoldFunction=function(d,h){if(null==h&&(h="↔"),"string"==typeof h){var c=document.createTextNode(h),h=document.createElement("span");h.appendChild(c);h.className="CodeMirror-foldmarker"}return function(c,a){var f,b,g,i,m;if("number"==typeof a&&(a=CodeMirror.Pos(a,0)),f=d(c,a),f){b=c.findMarksAt(f.from);for(i=g=0;i<b.length;++i)b[i].__isFold&&(++g,b[i].clear());g||(b=h.cloneNode(!0),CodeMirror.on(b,"mousedown",function(){m.clear()}),m=c.markText(f.from,f.to,{replacedWith:b,clearOnEnter:!0,
|
16
|
+
__isFold:!0}))}}};
|
17
|
+
(function(){CodeMirror.defineExtension("autoFormatAll",function(d,h){for(var c=this,e=c.getMode(),a=c.getRange(d,h).split("\n"),f=CodeMirror.copyState(e,c.getTokenAt(d).state),b=c.getOption("tabSize"),g="",i=0,m=0==d.ch,k,j=0;j<a.length;++j){for(k=new CodeMirror.StringStream(a[j],b);!k.eol();){var l=CodeMirror.innerMode(e,f),n=e.token(k,f),o=k.current();k.start=k.pos;(!m||/\S/.test(o))&&(g+=o,m=!1);if(!m&&l.mode.newlineAfterToken&&l.mode.newlineAfterToken(n,o,k.string.slice(k.pos)||a[j+1]||"",l.state))g+=
|
18
|
+
"\n",m=!0,++i}!k.pos&&e.blankLine&&e.blankLine(f);!m&&j<a.length-1&&(g+="\n",m=!0,++i)}c.operation(function(){c.replaceRange(g,d,h);for(var b=d.line+1,a=d.line+i;b<=a;++b)c.indentLine(b,"smart");c.setCursor({line:0,ch:0})})})})();
|
19
|
+
(function(){CodeMirror.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(d,c){return/^[;{}]$/.test(c)}});CodeMirror.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(d,c,e,a){return this.jsonMode?/^[\[,{]$/.test(c)||/^}/.test(e):";"==c&&a.lexical&&")"==a.lexical.type?!1:/^[;{}]$/.test(c)&&!/^;/.test(e)}});var d=/^(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)$/;
|
20
|
+
CodeMirror.extendMode("xml",{commentStart:"<\!--",commentEnd:"--\>",newlineAfterToken:function(h,c,e,a){var f=!1;return"html"==this.configuration&&(f=a.context?d.test(a.context.tagName):!1),!f&&("tag"==h&&/>$/.test(c)&&a.context||/^</.test(e))}});CodeMirror.defineExtension("commentRange",function(d,c,e){var a=this,f=CodeMirror.innerMode(a.getMode(),a.getTokenAt(c).state).mode;a.operation(function(){if(d)a.replaceRange(f.commentEnd,e),a.replaceRange(f.commentStart,c),c.line==e.line&&c.ch==e.ch&&a.setCursor(c.line,
|
21
|
+
c.ch+f.commentStart.length);else{var b=a.getRange(c,e),g=b.indexOf(f.commentStart),i=b.lastIndexOf(f.commentEnd);-1<g&&-1<i&&i>g&&(b=b.substr(0,g)+b.substring(g+f.commentStart.length,i)+b.substr(i+f.commentEnd.length));a.replaceRange(b,c,e)}})});CodeMirror.defineExtension("autoIndentRange",function(d,c){var e=this;this.operation(function(){for(var a=d.line;a<=c.line;a++)e.indentLine(a,"smart")})});CodeMirror.defineExtension("autoFormatRange",function(d,c){for(var e=this,a=e.getMode(),f=e.getRange(d,
|
22
|
+
c).split("\n"),b=CodeMirror.copyState(a,e.getTokenAt(d).state),g=e.getOption("tabSize"),i="",m=0,k=0==d.ch,j,l=0;l<f.length;++l){for(j=new CodeMirror.StringStream(f[l],g);!j.eol();){var n=CodeMirror.innerMode(a,b),o=a.token(j,b),p=j.current();j.start=j.pos;(!k||/\S/.test(p))&&(i+=p,k=!1);if(!k&&n.mode.newlineAfterToken&&n.mode.newlineAfterToken(o,p,j.string.slice(j.pos)||f[l+1]||"",n.state))i+="\n",k=!0,++m}!j.pos&&a.blankLine&&a.blankLine(b);!k&&l<f.length-1&&(i+="\n",k=!0,++m)}e.operation(function(){e.replaceRange(i,
|
23
|
+
d,c);for(var b=d.line+1,a=d.line+m;b<=a;++b)e.indentLine(b,"smart");e.setSelection(d,e.getCursor(!1))})})})();
|
24
|
+
(function(){function d(f){this.minChars="object"==typeof f&&f.minChars||e;this.style="object"==typeof f&&f.style||a;this.overlay=null}function h(a){a.operation(function(){var b=a._matchHighlightState,d;(b.overlay&&(a.removeOverlay(b.overlay),b.overlay=null),a.somethingSelected())&&((d=a.getSelection().replace(/^\s+|\s+$/g,""),d.length<b.minChars)||a.addOverlay(b.overlay=c(d,b.style)))})}function c(a,b){return{token:function(c){if(c.match(a))return b;c.next();c.skipTo(a.charAt(0))||c.skipToEnd()}}}
|
25
|
+
var e=2,a="matchhighlight";CodeMirror.defineOption("highlightSelectionMatches",!1,function(a,b,c){var c=c&&c!=CodeMirror.Init,e;if(b&&!c){a._matchHighlightState=new d(b);a.on("cursorActivity",h)}else!b&&c&&(e=a._matchHighlightState.overlay,e&&a.removeOverlay(e),a._matchHighlightState=null,a.off("cursorActivity",h))})})();
|
@@ -1,168 +1,188 @@
|
|
1
|
-
window.CodeMirror=function(){function
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
a.options.theme.replace(/(^|\s)\s*/g," cm-s-");
|
9
|
-
b;d=
|
10
|
-
b){var c=b+2*a.lineSpace.offsetTop;a.sizer.style.minHeight=a.heightForcer.style.top=c+"px";var c=Math.max(c,a.scroller.scrollHeight),d=a.scroller.scrollWidth>a.scroller.clientWidth,e=c>a.scroller.clientHeight;e?(a.scrollbarV.style.display="block",a.scrollbarV.style.bottom=d?
|
11
|
-
"px":"0",a.scrollbarH.firstChild.style.width=a.scroller.scrollWidth-a.scroller.clientWidth+a.scrollbarH.clientWidth+"px"):a.scrollbarH.style.display="";d&&e?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=a.scrollbarFiller.style.width=
|
12
|
-
d=c:c&&(d=c.top,e=c.bottom-c.top);d=Math.floor(d-a.lineSpace.offsetTop);a=Math.ceil(d+e);return{from:
|
13
|
-
|
14
|
-
return
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
c
|
23
|
-
b
|
24
|
-
|
25
|
-
"
|
26
|
-
|
27
|
-
|
28
|
-
b(
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
r
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
b.
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
a
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
d.
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
b
|
60
|
-
|
61
|
-
|
62
|
-
var
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
b.
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
b
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
b)
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
(
|
85
|
-
d.
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
b[
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
f
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
c
|
100
|
-
|
101
|
-
|
102
|
-
a=
|
103
|
-
d.
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
a[c
|
110
|
-
|
111
|
-
|
112
|
-
b,
|
113
|
-
null
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
a
|
123
|
-
return!0}
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
a
|
132
|
-
|
133
|
-
|
134
|
-
b){
|
135
|
-
|
136
|
-
a.
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
a
|
144
|
-
|
145
|
-
a
|
146
|
-
|
147
|
-
"
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
this)},
|
160
|
-
this.
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
for(
|
1
|
+
window.CodeMirror=function(){function k(a,b){if(!(this instanceof k))return new k(a,b);this.options=b=b||{};for(var c in Fb)!b.hasOwnProperty(c)&&Fb.hasOwnProperty(c)&&(b[c]=Fb[c]);Gb(b);c=this.display=yd(a,"string"==typeof b.value?0:b.value.first);c.wrapper.CodeMirror=this;qc(this);b.autofocus&&!Hb&&D(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new Ib};rc(this);b.lineWrapping&&(this.display.wrapper.className+=
|
2
|
+
" CodeMirror-wrap");var d=b.value;"string"==typeof d&&(d=new I(b.value,b.mode));s(this,sc)(this,d);E&&setTimeout(J(Z,this,!0),20);zd(this);var e;try{e=document.activeElement==c.input}catch(f){}e||b.autofocus&&!Hb?setTimeout(J($,this),20):Jb(this);s(this,function(){for(var a in ia)if(ia.propertyIsEnumerable(a))ia[a](this,b[a],tc);for(a=0;a<Kb.length;++a)Kb[a](this)})()}function yd(a,b){var c={},d=c.input=q("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none;");
|
3
|
+
P?d.style.width="1000px":d.setAttribute("wrap","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");c.inputDiv=q("div",[d],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");c.scrollbarH=q("div",[q("div",null,null,"height: 1px")],"CodeMirror-hscrollbar");c.scrollbarV=q("div",[q("div",null,null,"width: 1px")],"CodeMirror-vscrollbar");c.scrollbarFiller=q("div",null,"CodeMirror-scrollbar-filler");c.lineDiv=q("div");c.selectionDiv=q("div",null,null,"position: relative; z-index: 1");
|
4
|
+
c.cursor=q("div"," ","CodeMirror-cursor");c.otherCursor=q("div"," ","CodeMirror-cursor CodeMirror-secondarycursor");c.measure=q("div",null,"CodeMirror-measure");c.lineSpace=q("div",[c.measure,c.selectionDiv,c.lineDiv,c.cursor,c.otherCursor],null,"position: relative; outline: none");c.mover=q("div",[q("div",[c.lineSpace],"CodeMirror-lines")],null,"position: relative");c.sizer=q("div",[c.mover],"CodeMirror-sizer");c.heightForcer=q("div"," ",null,"position: absolute; height: "+za+"px");c.gutters=q("div",
|
5
|
+
null,"CodeMirror-gutters");c.lineGutter=null;var e=q("div",[c.sizer,c.heightForcer,c.gutters],null,"position: relative; min-height: 100%");c.scroller=q("div",[e],"CodeMirror-scroll");c.scroller.setAttribute("tabIndex","-1");c.wrapper=q("div",[c.inputDiv,c.scrollbarH,c.scrollbarV,c.scrollbarFiller,c.scroller],"CodeMirror");ja&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0);a.appendChild?a.appendChild(c.wrapper):a(c.wrapper);Wa&&(d.style.width="0px");P||(c.scroller.draggable=!0);Lb?(c.inputDiv.style.height=
|
6
|
+
"1px",c.inputDiv.style.position="absolute"):ja&&(c.scrollbarH.style.minWidth=c.scrollbarV.style.minWidth="18px");c.viewOffset=c.lastSizeC=0;c.showingFrom=c.showingTo=b;c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null;c.prevInput="";c.alignWidgets=!1;c.pollingFast=!1;c.poll=new Ib;c.draggingText=!1;c.cachedCharWidth=c.cachedTextHeight=null;c.measureLineCache=[];c.measureLineCachePos=0;c.inaccurateSelection=!1;c.maxLine=null;c.maxLineLength=0;c.maxLineChanged=!1;c.wheelDX=c.wheelDY=c.wheelStartX=
|
7
|
+
c.wheelStartY=null;return c}function Xa(a){a.doc.mode=k.getMode(a.options,a.doc.modeOption);a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;Ya(a,100);a.state.modeGen++;a.curOp&&w(a)}function uc(a){var b=Za(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Ad(a.display)-3);return function(e){return aa(a.doc,e)?0:c?(Math.ceil(e.text.length/d)||1)*b:b}}function vc(a){var b=a.doc,c=uc(a);b.iter(function(a){var b=
|
8
|
+
c(a);b!=a.height&&L(a,b)})}function rc(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");ka(a)}function Aa(a){qc(a);w(a)}function qc(a){var b=a.display.gutters,c=a.options.gutters;$a(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(q("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none"}function ab(a,
|
9
|
+
b){if(0==b.height)return 0;for(var c=b.text.length,d,e=b;d=ba(e,-1);)d=d.find(),e=r(a,d.from.line),c+=d.from.ch-d.to.ch;for(e=b;d=Ba(e);)d=d.find(),c-=e.text.length-d.from.ch,e=r(a,d.to.line),c+=e.text.length-d.to.ch;return c}function Mb(a){var b=a.display,c=a.doc;b.maxLine=r(c,c.first);b.maxLineLength=ab(c,b.maxLine);b.maxLineChanged=!0;c.iter(function(a){var e=ab(c,a);e>b.maxLineLength&&(b.maxLineLength=e,b.maxLine=a)})}function Gb(a){for(var b=!1,c=0;c<a.gutters.length;++c)"CodeMirror-linenumbers"==
|
10
|
+
a.gutters[c]&&(a.lineNumbers?b=!0:a.gutters.splice(c--,1));!b&&a.lineNumbers&&a.gutters.push("CodeMirror-linenumbers")}function wc(a,b){var c=b+2*a.lineSpace.offsetTop;a.sizer.style.minHeight=a.heightForcer.style.top=c+"px";var c=Math.max(c,a.scroller.scrollHeight),d=a.scroller.scrollWidth>a.scroller.clientWidth,e=c>a.scroller.clientHeight;e?(a.scrollbarV.style.display="block",a.scrollbarV.style.bottom=d?bb(a.measure)+"px":"0",a.scrollbarV.firstChild.style.height=c-a.scroller.clientHeight+a.scrollbarV.clientHeight+
|
11
|
+
"px"):a.scrollbarV.style.display="";d?(a.scrollbarH.style.display="block",a.scrollbarH.style.right=e?bb(a.measure)+"px":"0",a.scrollbarH.firstChild.style.width=a.scroller.scrollWidth-a.scroller.clientWidth+a.scrollbarH.clientWidth+"px"):a.scrollbarH.style.display="";d&&e?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=a.scrollbarFiller.style.width=bb(a.measure)+"px"):a.scrollbarFiller.style.display="";Bd&&0===bb(a.measure)&&(a.scrollbarV.style.minWidth=a.scrollbarH.style.minHeight=
|
12
|
+
Cd?"18px":"12px")}function Nb(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?d=c:c&&(d=c.top,e=c.bottom-c.top);d=Math.floor(d-a.lineSpace.offsetTop);a=Math.ceil(d+e);return{from:cb(b,d),to:cb(b,a)}}function xc(a){var b=a.display;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=Ob(b)-b.scroller.scrollLeft+a.doc.scrollLeft,d=b.gutters.offsetWidth,e=c+"px",f=b.lineDiv.firstChild;f;f=f.nextSibling)if(f.alignable)for(var g=0,h=f.alignable;g<h.length;++g)h[g].style.left=
|
13
|
+
e;a.options.fixedGutter&&(b.gutters.style.left=c+d+"px")}}function Dd(a){if(!a.options.lineNumbers)return!1;var b=a.doc,b=""+a.options.lineNumberFormatter(b.first+b.size-1+a.options.firstLineNumber),a=a.display;if(b.length!=a.lineNumChars){var c=a.measure.appendChild(q("div",[q("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),d=c.firstChild.offsetWidth,c=c.offsetWidth-d;a.lineGutter.style.width="";a.lineNumInnerWidth=Math.max(d,a.lineGutter.offsetWidth-c);a.lineNumWidth=a.lineNumInnerWidth+
|
14
|
+
c;a.lineNumChars=a.lineNumInnerWidth?b.length:-1;a.lineGutter.style.width=a.lineNumWidth+"px";return!0}return!1}function Ob(a){return z(a.scroller).left-z(a.sizer).left}function db(a,b,c){var d=a.display.showingFrom,e=a.display.showingTo;if(b=yc(a,b,c))M(a,"update",a),(a.display.showingFrom!=d||a.display.showingTo!=e)&&M(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo);Pb(a);wc(a.display,a.doc.height);return b}function yc(a,b,c){var d=a.display,e=a.doc;if(d.wrapper.clientWidth){var f=
|
15
|
+
Nb(d,e,c);if(!(0==b.length&&f.from>d.showingFrom&&f.to<d.showingTo)){Dd(a)&&(b=[{from:e.first,to:e.first+e.size}]);var g=d.sizer.style.marginLeft=d.gutters.offsetWidth+"px";d.scrollbarH.style.left=a.options.fixedGutter?g:"0";var h=Infinity;if(a.options.lineNumbers)for(g=0;g<b.length;++g)if(b[g].diff){h=b[g].from;break}var g=e.first+e.size,j=Math.max(f.from-a.options.viewportMargin,e.first),f=Math.min(g,f.to+a.options.viewportMargin);d.showingFrom<j&&20>j-d.showingFrom&&(j=Math.max(e.first,d.showingFrom));
|
16
|
+
d.showingTo>f&&20>d.showingTo-f&&(f=Math.min(g,d.showingTo));if(Ca)for(j=F(la(e,r(e,j)));f<g&&aa(e,r(e,f));)++f;var i=[{from:Math.max(d.showingFrom,e.first),to:Math.min(d.showingTo,g)}],i=i[0].from>=i[0].to?[]:Ed(i,b);if(Ca)for(g=0;g<i.length;++g)for(var b=i[g],l;l=Ba(r(e,b.to-1));)if(l=l.find().from.line,l>b.from)b.to=l;else{i.splice(g--,1);break}for(g=l=0;g<i.length;++g)b=i[g],b.from<j&&(b.from=j),b.to>f&&(b.to=f),b.from>=b.to?i.splice(g--,1):l+=b.to-b.from;if(l==f-j&&j==d.showingFrom&&f==d.showingTo)zc(a);
|
17
|
+
else{i.sort(function(a,b){return a.from-b.from});g=document.activeElement;l<0.7*(f-j)&&(d.lineDiv.style.display="none");Fd(a,j,f,i,h);d.lineDiv.style.display="";document.activeElement!=g&&g.offsetHeight&&g.focus();if(j!=d.showingFrom||f!=d.showingTo||d.lastSizeC!=d.wrapper.clientHeight)d.lastSizeC=d.wrapper.clientHeight;d.showingFrom=j;d.showingTo=f;Ya(a,100);h=d.lineDiv.offsetTop;for(j=d.lineDiv.firstChild;j;j=j.nextSibling)if(j.lineObj&&(ja?(i=j.offsetTop+j.offsetHeight,g=i-h,h=i):(g=z(j),g=g.bottom-
|
18
|
+
g.top),i=j.lineObj.height-g,2>g&&(g=Za(d)),0.001<i||-0.001>i))if(L(j.lineObj,g),i=j.lineObj.widgets)for(g=0;g<i.length;++g)i[g].height=i[g].node.offsetHeight;zc(a);Nb(d,e,c).to>f&&yc(a,[],c);return!0}}}else d.showingFrom=d.showingTo=e.first,d.viewOffset=0}function zc(a){var b=a.display.viewOffset=ma(a,r(a.doc,a.display.showingFrom));a.display.mover.style.top=b+"px"}function Ed(a,b){for(var c=0,d=b.length||0;c<d;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,j=a.length;h<j;++h){var i=a[h];e.to<=i.from&&
|
19
|
+
e.diff?f.push({from:i.from+g,to:i.to+g}):e.to<=i.from||e.from>=i.to?f.push(i):(e.from>i.from&&f.push({from:i.from,to:e.from}),e.to<i.to&&f.push({from:e.to+g,to:i.to+g}))}a=f}return a}function Gd(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,f=0;e;e=e.nextSibling,++f)c[a.options.gutters[f]]=e.offsetLeft,d[a.options.gutters[f]]=e.offsetWidth;return{fixedPos:Ob(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function Fd(a,b,c,d,e){function f(b){var c=
|
20
|
+
b.nextSibling;P&&na&&a.display.currentWheelTarget==b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b);return c}var g=Gd(a),h=a.display,j=a.options.lineNumbers;!d.length&&(!P||!a.display.currentWheelTarget)&&$a(h.lineDiv);var i=h.lineDiv,l=i.firstChild,m=d.shift(),n=b;for(a.doc.iter(b,c,function(b){m&&m.to==n&&(m=d.shift());if(aa(a.doc,b)){if(0!=b.height&&L(b,0),b.widgets&&l.previousSibling)for(var c=0;c<b.widgets.length;++c)if(b.widgets[c].showIfHidden){var h=l.previousSibling;
|
21
|
+
if(/pre/i.test(h.nodeName)){var k=q("div",null,null,"position: relative");h.parentNode.replaceChild(k,h);k.appendChild(h);h=k}k=h.appendChild(q("div",[b.widgets[c].node],"CodeMirror-linewidget"));Qb(b.widgets[c],k,h,g)}}else if(m&&m.from<=n&&m.to>n){for(;l.lineObj!=b;)l=f(l);j&&(e<=n&&l.lineNumber)&&Ac(l.lineNumber,""+a.options.lineNumberFormatter(n+a.options.firstLineNumber));l=l.nextSibling}else{if(b.widgets)for(var o=0,r=l;r&&20>o;++o,r=r.nextSibling)if(r.lineObj==b&&/div/i.test(r.nodeName)){c=
|
22
|
+
r;break}var o=a,N=n,G=c,r=Bc(o,b),p=b.gutterMarkers,s=o.display;if(!o.options.lineNumbers&&!p&&!b.bgClass&&!b.wrapClass&&!b.widgets)h=r;else{if(G){G.alignable=null;for(var v=!0,u=0,t=G.firstChild,x;t;t=x)if(x=t.nextSibling,/\bCodeMirror-linewidget\b/.test(t.className)){for(var w=0,z=!0;w<b.widgets.length;++w){var y=b.widgets[w],B=!1;y.above||(B=z,z=!1);if(y.node==t.firstChild){Qb(y,t,G,g);++u;B&&G.insertBefore(r,t);break}}if(w==b.widgets.length){v=!1;break}}else G.removeChild(t);v&&u==b.widgets.length&&
|
23
|
+
(h=G,G.className=b.wrapClass||"")}h||(h=q("div",null,b.wrapClass,"position: relative"),h.appendChild(r));b.bgClass&&h.insertBefore(q("div"," ",b.bgClass+" CodeMirror-linebackground"),h.firstChild);if(o.options.lineNumbers||p){k=h.insertBefore(q("div",null,null,"position: absolute; left: "+(o.options.fixedGutter?g.fixedPos:-g.gutterTotalWidth)+"px"),h.firstChild);o.options.fixedGutter&&(h.alignable||(h.alignable=[])).push(k);if(o.options.lineNumbers&&(!p||!p["CodeMirror-linenumbers"]))h.lineNumber=
|
24
|
+
k.appendChild(q("div",""+o.options.lineNumberFormatter(N+o.options.firstLineNumber),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+g.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+s.lineNumInnerWidth+"px"));if(p)for(w=0;w<o.options.gutters.length;++w)y=o.options.gutters[w],(N=p.hasOwnProperty(y)&&p[y])&&k.appendChild(q("div",[N],"CodeMirror-gutter-elt","left: "+g.gutterLeft[y]+"px; width: "+g.gutterWidth[y]+"px"))}ja&&(h.style.zIndex=2);if(b.widgets&&h!=G){w=0;for(G=b.widgets;w<G.length;++w)y=
|
25
|
+
G[w],p=q("div",[y.node],"CodeMirror-linewidget"),Qb(y,p,h,g),y.above?h.insertBefore(p,o.options.lineNumbers&&0!=b.height?k:r):h.appendChild(p),M(y,"redraw")}}if(h!=c)i.insertBefore(h,l);else{for(;l!=c;)l=f(l);l=l.nextSibling}h.lineObj=b}++n});l;)l=f(l)}function Qb(a,b,c,d){a.noHScroll&&((c.alignable||(c.alignable=[])).push(b),c=d.wrapperWidth,b.style.left=d.fixedPos+"px",a.coverGutter||(c-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=c+"px");a.coverGutter&&(b.style.zIndex=
|
26
|
+
5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function Pb(a){var b=a.display,c=t(a.doc.sel.from,a.doc.sel.to);if(c||a.options.showCursorWhenSelecting){var d=a.display,e=Q(a,a.doc.sel.head,"div");d.cursor.style.left=e.left+"px";d.cursor.style.top=e.top+"px";d.cursor.style.height=Math.max(0,e.bottom-e.top)*a.options.cursorHeight+"px";d.cursor.style.display="";e.other?(d.otherCursor.style.display="",d.otherCursor.style.left=e.other.left+"px",d.otherCursor.style.top=
|
27
|
+
e.other.top+"px",d.otherCursor.style.height=0.85*(e.other.bottom-e.other.top)+"px"):d.otherCursor.style.display="none"}else b.cursor.style.display=b.otherCursor.style.display="none";c?b.selectionDiv.style.display="none":Hd(a);a=Q(a,a.doc.sel.head,"div");c=z(b.wrapper);d=z(b.lineDiv);b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+d.top-c.top))+"px";b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+d.left-c.left))+"px"}function Hd(a){function b(a,b,
|
28
|
+
c,d){0>b&&(b=0);g.appendChild(q("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?h-a:c)+"px; height: "+(d-b)+"px"))}function c(c,d,f,g){var i=r(e,c),l=i.text.length,m=g?Infinity:-Infinity;Id(O(i),d||0,null==f?l:f,function(e,n,k){var r=eb(a,o(c,"rtl"==k?n-1:e),"div",i),k=eb(a,o(c,"rtl"==k?e:n-1),"div",i),q=r.left,p=k.right;3<k.top-r.top&&(b(q,r.top,null,r.bottom),q=j,r.bottom<k.top&&b(q,r.bottom,null,k.top));null==f&&n==l&&(p=h);null==d&&0==e&&(q=
|
29
|
+
j);m=g?Math.min(k.top,m):Math.max(k.bottom,m);q<j+1&&(q=j);b(q,k.top,p-q,k.bottom)});return m}var d=a.display,e=a.doc,f=a.doc.sel,g=document.createDocumentFragment(),h=d.lineSpace.offsetWidth,j=R(a.display.measure,q("pre",null,null,"text-align: left")).appendChild(q("span","x")).offsetLeft;if(f.from.line==f.to.line)c(f.from.line,f.from.ch,f.to.ch);else{for(var i=r(e,f.from.line),l=i,m=[f.from.line,f.from.ch],n;l=Ba(l);){l=l.find();m.push(l.from.ch,l.to.line,l.to.ch);if(l.to.line==f.to.line){m.push(f.to.ch);
|
30
|
+
n=!0;break}l=r(e,l.to.line)}if(n)for(f=0;f<m.length;f+=3)c(m[f],m[f+1],m[f+2]);else m=r(e,f.to.line),i=f.from.ch?c(f.from.line,f.from.ch,null,!1):ma(a,i)-d.viewOffset,f=f.to.ch?c(f.to.line,ba(m,-1)?null:0,f.to.ch,!0):ma(a,m)-d.viewOffset,i<f&&b(j,i,null,f)}R(d.selectionDiv,g);d.selectionDiv.style.display=""}function fb(a){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="";b.blinker=setInterval(function(){b.cursor.offsetHeight&&(b.cursor.style.visibility=
|
31
|
+
b.otherCursor.style.visibility=(c=!c)?"":"hidden")},a.options.cursorBlinkRate)}function Ya(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.showingTo&&a.state.highlight.set(b,J(Jd,a))}function Jd(a){var b=a.doc;b.frontier<b.first&&(b.frontier=b.first);if(!(b.frontier>=a.display.showingTo)){var c=+new Date+a.options.workTime,d=oa(b.mode,Da(a,b.frontier)),e=[],f;b.iter(b.frontier,Math.min(b.first+b.size,a.display.showingTo+500),function(g){if(b.frontier>=a.display.showingFrom){var h=g.styles;g.styles=
|
32
|
+
Cc(a,g,d);for(var j=!h||h.length!=g.styles.length,i=0;!j&&i<h.length;++i)j=h[i]!=g.styles[i];j&&(f&&f.end==b.frontier?f.end++:e.push(f={start:b.frontier,end:b.frontier+1}));g.stateAfter=oa(b.mode,d)}else{Dc(a,g,d);g.stateAfter=b.frontier%5==0?oa(b.mode,d):null}++b.frontier;if(+new Date>c){Ya(a,a.options.workDelay);return true}});e.length&&s(a,function(){for(var a=0;a<e.length;++a)w(this,e[a].start,e[a].end)})()}}function Kd(a,b){for(var c,d,e=a.doc,f=b,g=b-100;f>g;--f){if(f<=e.first)return e.first;
|
33
|
+
var h=r(e,f-1);if(h.stateAfter)return f;h=pa(h.text,null,a.options.tabSize);if(null==d||c>h)d=f-1,c=h}return d}function Da(a,b){var c=a.doc,d=a.display;if(!c.mode.startState)return!0;var e=Kd(a,b),f=e>c.first&&r(c,e-1).stateAfter,f=f?oa(c.mode,f):Ec(c.mode);c.iter(e,b,function(g){Dc(a,g,f);g.stateAfter=e==b-1||0==e%5||e>=d.showingFrom&&e<d.showingTo?oa(c.mode,f):null;++e});return f}function Fc(a,b,c,d){for(var e=-1,d=d||gb(a,b),a=c;;a+=e){var f=d[a];if(f)break;0>e&&0==a&&(e=1)}return{left:a<c?f.right:
|
34
|
+
f.left,right:a>c?f.left:f.right,top:f.top,bottom:f.bottom}}function gb(a,b){for(var c=a.display,d=a.display.measureLineCache,e=0;e<d.length;++e){var f=d[e];if(f.text==b.text&&f.markedSpans==b.markedSpans&&c.scroller.clientWidth==f.width&&f.classes==b.textClass+"|"+b.bgClass+"|"+b.wrapClass)return f.measure}var g=a.display,h=Gc(b.text.length),f=Bc(a,b,h);if(E&&!ja&&!a.options.lineWrapping&&100<f.childNodes.length){for(var j=document.createDocumentFragment(),i=f.childNodes.length,e=0,l=Math.ceil(i/
|
35
|
+
10);e<l;++e){for(var m=q("div",null,null,"display: inline-block"),n=0;10>n&&i;++n)m.appendChild(f.firstChild),--i;j.appendChild(m)}f.appendChild(j)}R(g.measure,f);i=z(g.lineDiv);l=[];j=Gc(b.text.length);m=f.offsetHeight;ca&&g.measure.first!=f&&R(g.measure,f);for(e=0;e<h.length;++e)if(g=h[e]){for(var A=z(g),k=Math.max(0,A.top-i.top),o=Math.min(A.bottom-i.top,m),n=0;n<l.length;n+=2){var r=l[n],p=l[n+1];if(!(r>o||p<k))if(r<=k&&p>=o||k<=r&&o>=p||Math.min(o,p)-Math.max(k,r)>=o-k>>1){l[n]=Math.min(k,r);
|
36
|
+
l[n+1]=Math.max(o,p);break}}n==l.length&&l.push(k,o);k=A.right;g.measureRight&&(k=z(g.measureRight).left);j[e]={left:A.left-i.left,right:k-i.left,top:n}}for(e=0;e<j.length;++e)if(g=j[e])h=g.top,g.top=l[h],g.bottom=l[h+1];a.options.lineWrapping||(e=f.lastChild,3==e.nodeType&&(e=f.appendChild(q("span",""))),j.width=z(e).right-i.left);f={text:b.text,width:c.scroller.clientWidth,markedSpans:b.markedSpans,measure:j,classes:b.textClass+"|"+b.bgClass+"|"+b.wrapClass};16==d.length?d[++c.measureLineCachePos%
|
37
|
+
16]=f:d.push(f);return j}function ka(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0;a.display.cachedCharWidth=a.display.cachedTextHeight=null;a.display.maxLineChanged=!0;a.display.lineNumChars=null}function Hc(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=hb(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=ma(a,b);"local"!=d&&(b-=a.display.viewOffset);"page"==d&&(a=z(a.display.lineSpace),b+=a.top+(window.pageYOffset||
|
38
|
+
(document.documentElement||document.body).scrollTop),a=a.left+(window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=a,c.right+=a);c.top+=b;c.bottom+=b;return c}function eb(a,b,c,d){d||(d=r(a.doc,b.line));return Hc(a,d,Fc(a,d,b.ch),c)}function Q(a,b,c,d,e){function f(b,f){var g=Fc(a,d,b,e);f?g.left=g.right:g.right=g.left;return Hc(a,d,g,c)}d=d||r(a.doc,b.line);e||(e=gb(a,d));var g=O(d),b=b.ch;if(!g)return f(b);for(var h,j,i=g[0].level,l=0;l<g.length;++l){var m=g[l],n=m.level%
|
39
|
+
2,A;if(m.from<b&&m.to>b)return f(b,n);var k=n?m.from:m.to;if((n?m.to:m.from)==b)m=l&&m.level<(A=g[l-1]).level?f(A.level%2?A.from:A.to-1,!0):f(n&&m.from!=m.to?b-1:b),n==i?h=m:j=m;else if(k==b&&(A=l<g.length-1&&g[l+1],n||!(A&&A.from==A.to)))m=A&&m.level<A.level?f(A.level%2?A.to-1:A.from):f(n?b:b-1,!0),n==i?h=m:j=m}i&&!b&&(j=f(g[0].to-1));if(!h)return j;j&&(h.other=j);return h}function ib(a,b,c){a=new o(a,b);c&&(a.outside=!0);return a}function Rb(a,b,c){var d=a.doc,c=c+a.display.viewOffset;if(0>c)return ib(d.first,
|
40
|
+
0,!0);var e=cb(d,c),f=d.first+d.size-1;if(e>f)return ib(d.first+d.size-1,r(d,f).text.length,!0);for(0>b&&(b=0);;){var f=r(d,e),e=Ld(a,f,e,b,c),g=(f=Ba(f))&&f.find();if(f&&e.ch>=g.from.ch)e=g.to.line;else return e}}function Ld(a,b,c,d,e){function f(d){d=Q(a,o(c,d),"line",b,i);h=!0;if(g>d.bottom)return Math.max(0,d.left-j);if(g<d.top)return d.left+j;h=!1;return d.left}var g=e-ma(a,b),h=!1,j=a.display.wrapper.clientWidth,i=gb(a,b),l=O(b),m=b.text.length,n=jb(b),A=kb(b),k=f(n),e=h,r=f(A),q=h;if(d>r)return ib(c,
|
41
|
+
A,q);for(;;){if(l?A==n||A==Sb(b,n,1):1>=A-n){for(n=(d=d-k<r-d)?n:A;Tb.test(b.text.charAt(n));)++n;e=ib(c,n,d?e:q);e.after=d;return e}var p=Math.ceil(m/2),s=n+p;if(l)for(var s=n,N=0;N<p;++N)s=Sb(b,s,1);N=f(s);if(N>d){A=s;r=N;if(q=h)r+=1E3;m-=p}else n=s,k=N,e=h,m=p}}function Za(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==da){da=q("pre");for(var b=0;49>b;++b)da.appendChild(document.createTextNode("x")),da.appendChild(q("br"));da.appendChild(document.createTextNode("x"))}R(a.measure,
|
42
|
+
da);b=da.offsetHeight/50;3<b&&(a.cachedTextHeight=b);$a(a.measure);return b||1}function Ad(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=q("span","x"),c=q("pre",[b]);R(a.measure,c);b=b.offsetWidth;2<b&&(a.cachedCharWidth=b);return b||10}function qa(a){a.curOp={changes:[],updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,updateMaxLine:!1,updateScrollPos:!1,id:++Md};lb++||(W=[])}function ra(a){var b=a.curOp,c=a.doc,d=a.display;a.curOp=null;b.updateMaxLine&&Mb(a);
|
43
|
+
if(d.maxLineChanged&&!a.options.lineWrapping){var e=gb(a,d.maxLine).width;d.sizer.style.minWidth=Math.max(0,e+3+za)+"px";d.maxLineChanged=!1;e=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);e<c.scrollLeft&&!b.updateScrollPos&&sa(a,Math.min(d.scroller.scrollLeft,e),!0)}var f,g;b.updateScrollPos?f=b.updateScrollPos:b.selectionChanged&&d.scroller.clientHeight&&(f=Q(a,c.sel.head),f=Ub(a,f.left,f.top,f.left,f.bottom));if(b.changes.length||f&&null!=f.scrollTop)g=db(a,b.changes,
|
44
|
+
f&&f.scrollTop);!g&&b.selectionChanged&&Pb(a);if(b.updateScrollPos)d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=f.scrollTop,d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=f.scrollLeft,xc(a);else if(f&&(c=Ic(a,a.doc.sel.head),a.state.focused)){d=a.display;f=z(d.sizer);g=null;if(0>c.top+f.top)g=!0;else if(c.bottom+f.top>(window.innerHeight||document.documentElement.clientHeight))g=!1;if(null!=g&&!Nd){if(f="none"==d.cursor.style.display)d.cursor.style.display="",d.cursor.style.left=
|
45
|
+
c.left+"px",d.cursor.style.top=c.top-d.viewOffset+"px";d.cursor.scrollIntoView(g);f&&(d.cursor.style.display="none")}}b.selectionChanged&&fb(a);a.state.focused&&b.updateInput&&Z(a,b.userSelChange);c=b.maybeHiddenMarkers;d=b.maybeUnhiddenMarkers;if(c)for(g=0;g<c.length;++g)c[g].lines.length||H(c[g],"hide");if(d)for(g=0;g<d.length;++g)d[g].lines.length&&H(d[g],"unhide");var h;--lb||(h=W,W=null);b.textChanged&&H(a,"change",a,b.textChanged);b.selectionChanged&&H(a,"cursorActivity",a);if(h)for(g=0;g<h.length;++g)h[g]()}
|
46
|
+
function s(a,b){return function(){var c=a||this,d=!c.curOp;d&&qa(c);try{var e=b.apply(c,arguments)}finally{d&&ra(c)}return e}}function Ea(a){return function(){var b=this.cm&&!this.cm.curOp,c;b&&qa(this.cm);try{c=a.apply(this,arguments)}finally{b&&ra(this.cm)}return c}}function Jc(a,b){var c=!a.curOp,d;c&&qa(a);try{d=b()}finally{c&&ra(a)}return d}function w(a,b,c,d){null==b&&(b=a.doc.first);null==c&&(c=a.doc.first+a.doc.size);a.curOp.changes.push({from:b,to:c,diff:d})}function mb(a){a.display.pollingFast||
|
47
|
+
a.display.poll.set(a.options.pollInterval,function(){Vb(a);a.state.focused&&mb(a)})}function Fa(a){function b(){!Vb(a)&&!c?(c=!0,a.display.poll.set(60,b)):(a.display.pollingFast=!1,mb(a))}var c=!1;a.display.pollingFast=!0;a.display.poll.set(20,b)}function Vb(a){var b=a.display.input,c=a.display.prevInput,d=a.doc,e=d.sel;if(!a.state.focused||Od(b)||Ga(a))return!1;var f=b.value;if(f==c&&t(e.from,e.to))return!1;if(E&&f&&0===b.selectionStart)return Z(a,!0),!1;var g=!a.curOp;g&&qa(a);e.shift=!1;for(var h=
|
48
|
+
0,j=Math.min(c.length,f.length);h<j&&c[h]==f[h];)++h;j=e.from;e=e.to;h<c.length?j=o(j.line,j.ch-(c.length-h)):a.state.overwrite&&(t(j,e)&&!a.state.pasteIncoming)&&(e=o(e.line,Math.min(r(d,e.line).text.length,e.ch+(f.length-h))));c=a.curOp.updateInput;Ha(a.doc,{from:j,to:e,text:ta(f.slice(h)),origin:a.state.pasteIncoming?"paste":"+input"},"end");a.curOp.updateInput=c;1E3<f.length?b.value=a.display.prevInput="":a.display.prevInput=f;g&&ra(a);a.state.pasteIncoming=!1;return!0}function Z(a,b){var c,d,
|
49
|
+
e=a.doc;t(e.sel.from,e.sel.to)?b&&(a.display.prevInput=a.display.input.value=""):(a.display.prevInput="",c=Kc&&(100<e.sel.to.line-e.sel.from.line||1E3<(d=a.getSelection()).length),a.display.input.value=c?"-":d||a.getSelection(),a.state.focused&&Lc(a.display.input));a.display.inaccurateSelection=c}function D(a){"nocursor"!=a.options.readOnly&&(!Hb||document.activeElement!=a.display.input)&&a.display.input.focus()}function Ga(a){return a.options.readOnly||a.doc.cantEdit}function zd(a){function b(){a.state.focused&&
|
50
|
+
setTimeout(J(D,a),0)}function c(){g.cachedCharWidth=g.cachedTextHeight=null;ka(a);Jc(a,J(w,a))}function d(){for(var a=g.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(d,5E3):S(window,"resize",c)}function e(b){(!a.options.onDragEvent||!a.options.onDragEvent(a,Ia(b)))&&nb(b)}function f(){g.inaccurateSelection&&(g.prevInput="",g.inaccurateSelection=!1,g.input.value=a.getSelection(),Lc(g.input))}var g=a.display;v(g.scroller,"mousedown",s(a,Pd));v(g.scroller,"dblclick",s(a,y));v(g.lineSpace,
|
51
|
+
"selectstart",function(a){ua(g,a)||y(a)});Wb||v(g.scroller,"contextmenu",function(b){Mc(a,b)});v(g.scroller,"scroll",function(){Ja(a,g.scroller.scrollTop);sa(a,g.scroller.scrollLeft,!0);H(a,"scroll",a)});v(g.scrollbarV,"scroll",function(){Ja(a,g.scrollbarV.scrollTop)});v(g.scrollbarH,"scroll",function(){sa(a,g.scrollbarH.scrollLeft)});v(g.scroller,"mousewheel",function(b){Nc(a,b)});v(g.scroller,"DOMMouseScroll",function(b){Nc(a,b)});v(g.scrollbarH,"mousedown",b);v(g.scrollbarV,"mousedown",b);v(g.wrapper,
|
52
|
+
"scroll",function(){g.wrapper.scrollTop=g.wrapper.scrollLeft=0});v(window,"resize",c);setTimeout(d,5E3);v(g.input,"keyup",s(a,function(b){if((!a.options.onKeyEvent||!a.options.onKeyEvent(a,Ia(b)))&&16==b.keyCode)a.doc.sel.shift=!1}));v(g.input,"input",J(Fa,a));v(g.input,"keydown",s(a,Oc));v(g.input,"keypress",s(a,Qd));v(g.input,"focus",J($,a));v(g.input,"blur",J(Jb,a));a.options.dragDrop&&(v(g.scroller,"dragstart",function(b){var c=a;if(!ua(c.display,b)){var d=c.getSelection();b.dataTransfer.setData("Text",
|
53
|
+
d);b.dataTransfer.setDragImage&&!Xb&&(d=q("img",null,null,"position: fixed; left: 0; top: 0;"),T&&(d.width=d.height=1,c.display.wrapper.appendChild(d),d._top=d.offsetTop),b.dataTransfer.setDragImage(d,0,0),T&&d.parentNode.removeChild(d))}}),v(g.scroller,"dragenter",e),v(g.scroller,"dragover",e),v(g.scroller,"drop",s(a,Rd)));v(g.scroller,"paste",function(b){if(!ua(g,b)){D(a);Fa(a)}});v(g.input,"paste",function(){a.state.pasteIncoming=true;Fa(a)});v(g.input,"cut",f);v(g.input,"copy",f);Lb&&v(g.sizer,
|
54
|
+
"mouseup",function(){document.activeElement==g.input&&g.input.blur();D(a)})}function ua(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||/\bCodeMirror-(?:line)?widget\b/.test(c.className)||c.parentNode==a.sizer&&c!=a.mover)return!0}function Ka(a,b,c){var d=a.display;if(!c&&(c=b.target||b.srcElement,c==d.scrollbarH||c==d.scrollbarH.firstChild||c==d.scrollbarV||c==d.scrollbarV.firstChild||c==d.scrollbarFiller))return null;var e,f,d=z(d.lineSpace);try{e=b.clientX,f=b.clientY}catch(g){return null}return Rb(a,
|
55
|
+
e-d.left,f-d.top)}function Pd(a){function b(a){if("single"==l)B(e.doc,p(g,j),a);else if(A=p(g,A),k=p(g,k),"double"==l){var b=Pc(r(g,a.line).text,a);x(a,A)?B(e.doc,b.from,k):B(e.doc,A,b.to)}else"triple"==l&&(x(a,A)?B(e.doc,k,p(g,o(a.line,0))):B(e.doc,A,p(g,o(a.line+1,0))))}function c(a){var d=++u,h=Ka(e,a,!0);if(h)if(t(h,m)){var i=a.clientY<q.top?-20:a.clientY>q.bottom?20:0;i&&setTimeout(s(e,function(){u==d&&(f.scroller.scrollTop+=i,c(a))}),50)}else{e.state.focused||$(e);m=h;b(h);var j=Nb(f,g);(h.line>=
|
56
|
+
j.to||h.line<j.from)&&setTimeout(s(e,function(){u==d&&c(a)}),150)}}function d(a){u=Infinity;var c=Ka(e,a);c&&b(c);y(a);D(e);S(document,"mousemove",w);S(document,"mouseup",C)}var e=this,f=e.display,g=e.doc,h=g.sel;h.shift=a.shiftKey;if(ua(f,a))P||(f.scroller.draggable=!1,setTimeout(function(){f.scroller.draggable=!0},100));else if(!Sd(e,a)){var j=Ka(e,a);switch(Qc(a)){case 3:Wb&&Mc.call(e,e,a);return;case 2:j&&B(e.doc,j);setTimeout(J(D,e),20);y(a);return}if(j){e.state.focused||$(e);var i=+new Date,
|
57
|
+
l="single";ob&&ob.time>i-400&&t(ob.pos,j)?(l="triple",y(a),setTimeout(J(D,e),20),Td(e,j.line)):pb&&pb.time>i-400&&t(pb.pos,j)?(l="double",ob={time:i,pos:j},y(a),i=Pc(r(g,j.line).text,j),B(e.doc,i.from,i.to)):pb={time:i,pos:j};var m=j;if(e.options.dragDrop&&Ud&&!Ga(e)&&!t(h.from,h.to)&&!x(j,h.from)&&!x(h.to,j)&&"single"==l){var n=s(e,function(b){if(P)f.scroller.draggable=false;e.state.draggingText=false;S(document,"mouseup",n);S(f.scroller,"drop",n);if(Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-
|
58
|
+
b.clientY)<10){y(b);B(e.doc,j);D(e)}});P&&(f.scroller.draggable=!0);e.state.draggingText=n;f.scroller.dragDrop&&f.scroller.dragDrop();v(document,"mouseup",n);v(f.scroller,"drop",n)}else{y(a);"single"==l&&B(e.doc,p(g,j));var A=h.from,k=h.to,q=z(f.wrapper),u=0,w=s(e,function(a){!E&&!Qc(a)?d(a):c(a)}),C=s(e,d);v(document,"mousemove",w);v(document,"mouseup",C)}}else(a.target||a.srcElement)==f.scroller&&y(a)}}function Rd(a){var b=this;if(!(ua(b.display,a)||b.options.onDragEvent&&b.options.onDragEvent(b,
|
59
|
+
Ia(a)))){y(a);var c=Ka(b,a,!0),d=a.dataTransfer.files;if(c&&!Ga(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,a=function(a,d){var h=new FileReader;h.onload=function(){f[d]=h.result;++g==e&&(c=p(b.doc,c),X(b.doc,f.join(""),c,"around","paste"))};h.readAsText(a)},h=0;h<e;++h)a(d[h],h);else if(b.state.draggingText&&!x(c,b.doc.sel.from)&&!x(b.doc.sel.to,c))b.state.draggingText(a),setTimeout(J(D,b),20);else try{if(f=a.dataTransfer.getData("Text")){var h=b.doc.sel.from,
|
60
|
+
j=b.doc.sel.to;Y(b.doc,c,c);b.state.draggingText&&X(b.doc,"",h,j,"paste");b.replaceSelection(f,null,"paste");D(b);$(b)}}catch(i){}}}function Sd(a,b){var c=a.display;try{var d=b.clientX,e=b.clientY}catch(f){return!1}if(d>=Math.floor(z(c.gutters).right))return!1;y(b);if(!va(a,"gutterClick"))return!0;var g=z(c.lineDiv);if(e>g.bottom)return!0;e-=g.top-c.viewOffset;for(g=0;g<a.options.gutters.length;++g){var h=c.gutters.childNodes[g];if(h&&z(h).right>=d){c=cb(a.doc,e);M(a,"gutterClick",a,c,a.options.gutters[g],
|
61
|
+
b);break}}return!0}function Ja(a,b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,wa||db(a,[],b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbarV.scrollTop!=b&&(a.display.scrollbarV.scrollTop=b),wa&&db(a,[]))}function sa(a,b,c){if(!(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b)))if(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,xc(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),
|
62
|
+
a.display.scrollbarH.scrollLeft!=b)a.display.scrollbarH.scrollLeft=b}function Nc(a,b){var c=b.wheelDeltaX,d=b.wheelDeltaY;null==c&&(b.detail&&b.axis==b.HORIZONTAL_AXIS)&&(c=b.detail);null==d&&b.detail&&b.axis==b.VERTICAL_AXIS?d=b.detail:null==d&&(d=b.wheelDelta);if(d&&na&&P)for(var e=b.target;e!=g;e=e.parentNode)if(e.lineObj){a.display.currentWheelTarget=e;break}var f=a.display,g=f.scroller;if(c&&!wa&&!T&&null!=K)d&&Ja(a,Math.max(0,Math.min(g.scrollTop+d*K,g.scrollHeight-g.clientHeight))),sa(a,Math.max(0,
|
63
|
+
Math.min(g.scrollLeft+c*K,g.scrollWidth-g.clientWidth))),y(b),f.wheelStartX=null;else{if(d&&null!=K){var e=d*K,h=a.doc.scrollTop,j=h+f.wrapper.clientHeight;0>e?h=Math.max(0,h+e-50):j=Math.min(a.doc.height,j+e+50);db(a,[],{top:h,bottom:j})}20>qb&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=c,f.wheelDY=d,setTimeout(function(){if(f.wheelStartX!=null){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,a=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;
|
64
|
+
f.wheelStartX=f.wheelStartY=null;if(a){K=(K*qb+a)/(qb+1);++qb}}},200)):(f.wheelDX+=c,f.wheelDY+=d))}}function rb(a,b,c){if("string"==typeof b&&(b=Yb[b],!b))return!1;a.display.pollingFast&&Vb(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Ga(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=Rc}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function Sc(a){var b=a.state.keyMaps.slice(0);b.push(a.options.keyMap);a.options.extraKeys&&b.unshift(a.options.extraKeys);
|
65
|
+
return b}function Tc(a,b){var c=Zb(a.options.keyMap),d=c.auto;clearTimeout(Uc);d&&!Vc(b)&&(Uc=setTimeout(function(){Zb(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d)},50));var e=Wc(b,!0),f=!1;if(!e)return!1;f=Sc(a);f=b.shiftKey?La("Shift-"+e,f,function(b){return rb(a,b,!0)})||La(e,f,function(b){if("string"==typeof b&&/^go[A-Z]/.test(b))return rb(a,b)}):La(e,f,function(b){return rb(a,b)});"stop"==f&&(f=!1);f&&(y(b),fb(a),ca&&(b.oldKeyCode=b.keyCode,b.keyCode=0));return f}function Vd(a,
|
66
|
+
b,c){if(c=La("'"+c+"'",Sc(a),function(b){return rb(a,b,!0)}))y(b),fb(a);return c}function Oc(a){this.state.focused||$(this);E&&27==a.keyCode&&(a.returnValue=!1);if(!this.options.onKeyEvent||!this.options.onKeyEvent(this,Ia(a))){var b=a.keyCode;this.doc.sel.shift=16==b||a.shiftKey;var c=Tc(this,a);T&&($b=c?b:null,!c&&(88==b&&!Kc&&(na?a.metaKey:a.ctrlKey))&&this.replaceSelection(""))}}function Qd(a){var b=this;if(!b.options.onKeyEvent||!b.options.onKeyEvent(b,Ia(a))){var c=a.keyCode,d=a.charCode;if(T&&
|
67
|
+
c==$b)$b=null,y(a);else if(!(T&&(!a.which||10>a.which)||Lb)||!Tc(b,a))c=String.fromCharCode(null==d?c:d),this.options.electricChars&&(this.doc.mode.electricChars&&this.options.smartIndent&&!Ga(this)&&-1<this.doc.mode.electricChars.indexOf(c))&&setTimeout(s(b,function(){sb(b,b.doc.sel.to.line,"smart")}),75),Vd(b,a,c)||Fa(b)}}function $(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(H(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=
|
68
|
+
" CodeMirror-focused"),Z(a,!0)),mb(a),fb(a))}function Jb(a){a.state.focused&&(H(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused",""));clearInterval(a.display.blinker);setTimeout(function(){if(!a.state.focused)a.doc.sel.shift=false},150)}function Mc(a,b){function c(){d.inputDiv.style.position="relative";d.input.style.cssText=h;ca&&(d.scrollbarV.scrollTop=d.scroller.scrollTop=g);mb(a);if(null!=d.input.selectionStart&&(!E||ca)){clearTimeout(ac);
|
69
|
+
var b=d.input.value=" "+(t(e.from,e.to)?"":d.input.value),c=0;d.prevInput=" ";d.input.selectionStart=1;d.input.selectionEnd=b.length;var f=function(){d.prevInput==" "&&d.input.selectionStart==0?s(a,Yb.selectAll)(a):c++<10?ac=setTimeout(f,500):Z(a)};ac=setTimeout(f,200)}}var d=a.display,e=a.doc.sel;if(!ua(d,b)){var f=Ka(a,b),g=d.scroller.scrollTop;if(f&&!T){(t(e.from,e.to)||x(f,e.from)||!x(f,e.to))&&s(a,Y)(a.doc,f,f);var h=d.input.style.cssText;d.inputDiv.style.position="absolute";d.input.style.cssText=
|
70
|
+
"position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: white; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);";D(a);Z(a,!0);t(e.from,e.to)&&(d.input.value=d.prevInput=" ");if(Wb){nb(b);var j=function(){S(window,"mouseup",j);setTimeout(c,20)};v(window,"mouseup",j)}else setTimeout(c,50)}}}function bc(a){return o(a.from.line+a.text.length-1,C(a.text).length+
|
71
|
+
(1==a.text.length?a.from.ch:0))}function Xc(a,b,c){if(!x(b.from,c))return p(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d)return b=c.line-d,d=a.first+a.size-1,b>d?o(d,r(a,d).text.length):tb(c,r(a,b).text.length);if(c.line==b.to.line+d)return tb(c,C(b.text).length+(1==b.text.length?b.from.ch:0)+r(a,b.to.line).text.length-b.to.ch);a=c.line-b.from.line;return tb(c,b.text[a].length+(a?0:b.from.ch))}function cc(a,b,c){if(c&&"object"==typeof c)return{anchor:Xc(a,b,c.anchor),head:Xc(a,
|
72
|
+
b,c.head)};if("start"==c)return{anchor:b.from,head:b.from};var d=bc(b);if("around"==c)return{anchor:b.from,head:d};if("end"==c)return{anchor:d,head:d};c=function(a){if(x(a,b.from))return a;if(!x(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,g=a.ch;a.line==b.to.line&&(g+=d.ch-b.to.ch);return o(c,g)};return{anchor:c(a.sel.anchor),head:c(a.sel.head)}}function Wd(a,b){var c={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,update:function(b,c,f,g){b&&(this.from=p(a,
|
73
|
+
b));c&&(this.to=p(a,c));f&&(this.text=f);void 0!==g&&(this.origin=g)},cancel:function(){this.canceled=!0}};H(a,"beforeChange",a,c);a.cm&&H(a.cm,"beforeChange",a.cm,c);return c.canceled?null:{from:c.from,to:c.to,text:c.text,origin:c.origin}}function Ha(a,b,c,d){if(a.cm){if(!a.cm.curOp)return s(a.cm,Ha)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(va(a,"beforeChange")||a.cm&&va(a.cm,"beforeChange"))if(b=Wd(a,b),!b)return;if(d=Yc&&!d&&Xd(a,b.from,b.to)){for(var e=d.length-1;1<=e;--e)dc(a,{from:d[e].from,
|
74
|
+
to:d[e].to,text:[""]});d.length&&dc(a,{from:d[0].from,to:d[0].to,text:b.text},c)}else dc(a,b,c)}function dc(a,b,c){c=cc(a,b,c);Yd(a,b,c,a.cm?a.cm.curOp.id:NaN);Ma(a,b,c,ec(a,b));var d=[];xa(a,function(a,c){!c&&-1==U(d,a.history)&&(Zc(a.history,b),d.push(a.history));Ma(a,b,null,ec(a,b))})}function $c(a,b){var c=a.history,d=("undo"==b?c.done:c.undone).pop();if(d){c.dirtyCounter+="undo"==b?-1:1;var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore};
|
75
|
+
("undo"==b?c.undone:c.done).push(e);for(c=d.changes.length-1;0<=c;--c){var f=d.changes[c];f.origin=b;e.changes.push(fc(a,f));var g=c?cc(a,f,null):{anchor:d.anchorBefore,head:d.headBefore};Ma(a,f,g,ad(a,f));var h=[];xa(a,function(a,b){!b&&-1==U(h,a.history)&&(Zc(a.history,f),h.push(a.history));Ma(a,f,null,ad(a,f))})}}}function bd(a,b){function c(a){return o(a.line+b,a.ch)}a.first+=b;a.cm&&w(a.cm,a.first,a.first,b);a.sel.head=c(a.sel.head);a.sel.anchor=c(a.sel.anchor);a.sel.from=c(a.sel.from);a.sel.to=
|
76
|
+
c(a.sel.to)}function Ma(a,b,c,d){if(a.cm&&!a.cm.curOp)return s(a.cm,Ma)(a,b,c,d);if(b.to.line<a.first)bd(a,b.text.length-1-(b.to.line-b.from.line));else if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);bd(a,e);b={from:o(a.first,0),to:o(b.to.line+e,b.to.ch),text:[C(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:o(e,r(a,e).text.length),text:[b.text[0]],origin:b.origin});c||(c=cc(a,b,null));a.cm?Zd(a.cm,b,d,c):gc(a,b,d,c)}}
|
77
|
+
function Zd(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,j=!1,i=g.line;a.options.lineWrapping||(i=F(la(e,r(e,g.line))),e.iter(i,h.line+1,function(a){if(a==f.maxLine)return j=!0}));gc(e,b,c,d,uc(a));a.options.lineWrapping||(e.iter(i,g.line+b.text.length,function(a){var b=ab(e,a);if(b>f.maxLineLength){f.maxLine=a;f.maxLineLength=b;f.maxLineChanged=true;j=false}}),j&&(a.curOp.updateMaxLine=!0));e.frontier=Math.min(e.frontier,g.line);Ya(a,400);w(a,g.line,h.line+1,b.text.length-(h.line-g.line)-1);
|
78
|
+
if(va(a,"change"))if(b={from:g,to:h,text:b.text,origin:b.origin},a.curOp.textChanged){for(a=a.curOp.textChanged;a.next;a=a.next);a.next=b}else a.curOp.textChanged=b}function X(a,b,c,d,e){d||(d=c);if(x(d,c))var f=d,d=c,c=f;"string"==typeof b&&(b=ta(b));Ha(a,{from:c,to:d,text:b,origin:e},null)}function o(a,b){if(!(this instanceof o))return new o(a,b);this.line=a;this.ch=b}function t(a,b){return a.line==b.line&&a.ch==b.ch}function x(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function ea(a){return o(a.line,
|
79
|
+
a.ch)}function p(a,b){if(b.line<a.first)return o(a.first,0);var c=a.first+a.size-1;return b.line>c?o(c,r(a,c).text.length):tb(b,r(a,b.line).text.length)}function tb(a,b){var c=a.ch;return null==c||c>b?o(a.line,b):0>c?o(a.line,0):a}function fa(a,b){return b>=a.first&&b<a.first+a.size}function B(a,b,c,d){if(a.sel.shift||a.sel.extend){var e=a.sel.anchor;if(c){var f=x(b,e);f!=x(c,e)?(e=b,b=c):f!=x(b,c)&&(b=c)}Y(a,e,b,d)}else Y(a,b,c||b,d);a.cm&&(a.cm.curOp.userSelChange=!0)}function Y(a,b,c,d,e){if(!e&&
|
80
|
+
va(a,"beforeSelectionChange")||a.cm&&va(a.cm,"beforeSelectionChange"))b={anchor:b,head:c},H(a,"beforeSelectionChange",a,b),a.cm&&H(a.cm,"beforeSelectionChange",a.cm,b),b.anchor=p(a,b.anchor),b.head=p(a,b.head),c=b.head,b=b.anchor;var f=a.sel;f.goalColumn=null;if(e||!t(b,f.anchor))b=ub(a,b,d,"push"!=e);if(e||!t(c,f.head))c=ub(a,c,d,"push"!=e);if(!t(f.anchor,b)||!t(f.head,c))f.anchor=b,f.head=c,d=x(c,b),f.from=d?c:b,f.to=d?b:c,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0),M(a,"cursorActivity",
|
81
|
+
a)}function cd(a){Y(a.doc,a.doc.sel.from,a.doc.sel.to,null,"push")}function ub(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=r(a,f.line),j;if(h.markedSpans){for(var i=0;i<h.markedSpans.length;++i){var l=h.markedSpans[i],m=l.marker;if((null==l.from||(m.inclusiveLeft?l.from<=f.ch:l.from<f.ch))&&(null==l.to||(m.inclusiveRight?l.to>=f.ch:l.to>f.ch)))if(d&&m.clearOnEnter)(j||(j=[])).push(m);else if(m.atomic){i=m.find()[0>g?"from":"to"];if(t(i,f)&&(i.ch+=g,0>i.ch?i=i.line>a.first?p(a,o(i.line-
|
82
|
+
1)):null:i.ch>h.text.length&&(i=i.line<a.first+a.size-1?o(i.line+1,0):null),!i)){if(e){if(!d)return ub(a,b,c,!0);a.cantEdit=!0;return o(a.first,0)}e=!0;i=b;g=-g}f=i;continue a}}if(j)for(i=0;i<j.length;++i)j[i].clear()}return f}}function Ic(a,b){for(;;){var c=!1,d=Q(a,b),e=Ub(a,d.left,d.top,d.left,d.bottom),f=a.doc.scrollTop,g=a.doc.scrollLeft;null!=e.scrollTop&&(Ja(a,e.scrollTop),1<Math.abs(a.doc.scrollTop-f)&&(c=!0));null!=e.scrollLeft&&(sa(a,e.scrollLeft),1<Math.abs(a.doc.scrollLeft-g)&&(c=!0));
|
83
|
+
if(!c)return d}}function dd(a,b,c,d,e){b=Ub(a,b,c,d,e);null!=b.scrollTop&&Ja(a,b.scrollTop);null!=b.scrollLeft&&sa(a,b.scrollLeft)}function Ub(a,b,c,d,e){var f=a.display,g=f.lineSpace.offsetTop,c=c+g,e=e+g,h=f.scroller.clientHeight-za,j=f.scroller.scrollTop,i={},a=a.doc.height+2*g,l=c<g+10,g=e+g>a-10;c<j?i.scrollTop=l?0:Math.max(0,c):e>j+h&&(i.scrollTop=(g?a:e)-h);c=f.scroller.clientWidth-za;e=f.scroller.scrollLeft;b+=f.gutters.offsetWidth;d+=f.gutters.offsetWidth;f=f.gutters.offsetWidth;h=b<f+10;
|
84
|
+
b<e+f||h?(h&&(b=0),i.scrollLeft=Math.max(0,b-10-f)):d>c+e-3&&(i.scrollLeft=d+10-c);return i}function sb(a,b,c,d){var e=a.doc;c||(c="add");if("smart"==c)if(a.doc.mode.indent)var f=Da(a,b);else c="prev";var g=a.options.tabSize,h=r(e,b),j=pa(h.text,null,g),i=h.text.match(/^\s*/)[0],l;if("smart"==c&&(l=a.doc.mode.indent(f,h.text.slice(i.length),h.text),l==Rc)){if(!d)return;c="prev"}"prev"==c?l=b>e.first?pa(r(e,b-1).text,null,g):0:"add"==c?l=j+a.options.indentUnit:"subtract"==c&&(l=j-a.options.indentUnit);
|
85
|
+
l=Math.max(0,l);c="";d=0;if(a.options.indentWithTabs)for(e=Math.floor(l/g);e;--e)d+=g,c+="\t";d<l&&(c+=ed(l-d));c!=i&&X(a.doc,c,o(b,0),o(b,i.length),"+input");h.stateAfter=null}function vb(a,b,c){var d=b,e=b,f=a.doc;"number"==typeof b?e=r(f,Math.max(f.first,Math.min(b,f.first+f.size-1))):d=F(b);if(null!=d&&c(e,d))w(a,d,d+1);else return null;return e}function hc(a,b,c,d,e){function f(b){var d=(e?Sb:fd)(j,h,c,!0);if(null==d){if(b=!b)b=g+c,b<a.first||b>=a.first+a.size?b=i=!1:(g=b,b=j=r(a,b));if(b)h=
|
86
|
+
e?(0>c?kb:jb)(j):0>c?j.text.length:0;else return i=!1}else h=d;return!0}var g=b.line,h=b.ch,j=r(a,g),i=!0;if("char"==d)f();else if("column"==d)f(!0);else if("word"==d)for(b=!1;!(0>c)||f();){if(wb(j.text.charAt(h)))b=!0;else if(b){0>c&&(c=1,f());break}if(0<c&&!f())break}b=ub(a,o(g,h),c,!0);i||(b.hitSide=!0);return b}function gd(a,b,c,d){var e=a.doc,f=b.left,g;"page"==d?(d=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=b.top+c*d):"line"==d&&(g=0<
|
87
|
+
c?b.bottom+3:b.top-3);for(;;){var h=Rb(a,f,g);if(!h.outside)break;if(0>c?0>=g:g>=e.height){h.hitSide=!0;break}g+=5*c}return h}function Pc(a,b){var c=b.ch,d=b.ch;if(a){!1===b.after||d==a.length?--c:++d;for(var e=a.charAt(c),e=wb(e)?wb:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!wb(a)};0<c&&e(a.charAt(c-1));)--c;for(;d<a.length&&e(a.charAt(d));)++d}return{from:o(b.line,c),to:o(b.line,d)}}function Td(a,b){B(a.doc,o(b,0),p(a.doc,o(b+1,0)))}function u(a,b,c,d){k.defaults[a]=
|
88
|
+
b;c&&(ia[a]=d?function(a,b,d){d!=tc&&c(a,b,d)}:c)}function oa(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=e.concat([]));c[d]=e}return c}function Ec(a,b,c){return a.startState?a.startState(b,c):!0}function Zb(a){return"string"==typeof a?V[a]:a}function La(a,b,c){function d(b){var b=Zb(b),e=b[a];if(!1===e)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";b=b.fallthrough;if(null==b)return!1;if("[object Array]"!=
|
89
|
+
Object.prototype.toString.call(b))return d(b);for(var e=0,f=b.length;e<f;++e){var i=d(b[e]);if(i)return i}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return f}}function Vc(a){a=ga[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a}function Wc(a,b){var c=ga[a.keyCode];if(null==c||a.altGraphKey)return!1;a.altKey&&(c="Alt-"+c);if(hd?a.metaKey:a.ctrlKey)c="Ctrl-"+c;if(hd?a.ctrlKey:a.metaKey)c="Cmd-"+c;!b&&a.shiftKey&&(c="Shift-"+c);return c}function Na(a,b){this.pos=this.start=0;this.string=
|
90
|
+
a;this.tabSize=b||8}function ha(a,b){this.lines=[];this.type=b;this.doc=a}function Oa(a,b,c,d,e){if(d&&d.shared)return $d(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return s(a.cm,Oa)(a,b,c,d,e);var f=new ha(a,e);if("range"==e&&!x(b,c))return f;d&&xb(d,f);f.replacedWith&&(f.collapsed=!0,f.replacedWith=q("span",[f.replacedWith],"CodeMirror-widget"));f.collapsed&&(Ca=!0);var g=b.line,h=0,j,i,l=a.cm,m;a.iter(g,c.line+1,function(d){l&&(f.collapsed&&!l.options.lineWrapping&&la(a,d)==l.display.maxLine)&&(m=true);var e=
|
91
|
+
{from:null,to:null,marker:f};h=h+d.text.length;if(g==b.line){e.from=b.ch;h=h-b.ch}if(g==c.line){e.to=c.ch;h=h-(d.text.length-c.ch)}if(f.collapsed){g==c.line&&(i=ba(d,c.ch));g==b.line?j=ba(d,b.ch):L(d,0)}d.markedSpans=d.markedSpans?d.markedSpans.concat([e]):[e];e.marker.attachLine(d);++g});f.collapsed&&a.iter(b.line,c.line+1,function(b){aa(a,b)&&L(b,0)});f.readOnly&&(Yc=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory());if(f.collapsed){if(j!=i)throw Error("Inserting collapsed marker overlapping an existing one");
|
92
|
+
f.size=h;f.atomic=!0}l&&(m&&(l.curOp.updateMaxLine=!0),(f.className||f.startStyle||f.endStyle||f.collapsed)&&w(l,b.line,c.line+1),f.atomic&&cd(l));return f}function Pa(a,b){this.markers=a;this.primary=b;for(var c=0,d=this;c<a.length;++c)a[c].parent=this,v(a[c],"clear",function(){d.clear()})}function $d(a,b,c,d,e){d=xb(d);d.shared=!1;var f=[Oa(a,b,c,d,e)],g=f[0];xa(a,function(a){f.push(Oa(a,p(a,b),p(a,c),d,e));for(var j=0;j<a.linked.length;++j)if(a.linked[j].isParent)return;g=C(f)});return new Pa(f,
|
93
|
+
g)}function Qa(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function ec(a,b){var c=fa(a,b.from.line)&&r(a,b.from.line).markedSpans,d=fa(a,b.to.line)&&r(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=t(b.from,b.to);if(c)for(var h=0,j;h<c.length;++h){var i=c[h],l=i.marker;if(null==i.from||(l.inclusiveLeft?i.from<=e:i.from<e)||"bookmark"==l.type&&i.from==e&&(!g||!i.marker.insertLeft)){var m=null==i.to||(l.inclusiveRight?i.to>=e:i.to>e);(j||(j=
|
94
|
+
[])).push({from:i.from,to:m?null:i.to,marker:l})}}c=j;if(d)for(var h=0,n;h<d.length;++h)if(j=d[h],i=j.marker,null==j.to||(i.inclusiveRight?j.to>=f:j.to>f)||"bookmark"==i.type&&j.from==f&&(!g||j.marker.insertLeft))l=null==j.from||(i.inclusiveLeft?j.from<=f:j.from<f),(n||(n=[])).push({from:l?null:j.from-f,to:null==j.to?null:j.to-f,marker:i});d=n;g=1==b.text.length;n=C(b.text).length+(g?e:0);if(c)for(f=0;f<c.length;++f)h=c[f],null==h.to&&((j=Qa(d,h.marker))?g&&(h.to=null==j.to?null:j.to+n):h.to=e);if(d)for(f=
|
95
|
+
0;f<d.length;++f)(h=d[f],null!=h.to&&(h.to+=n),null==h.from)?(j=Qa(c,h.marker),j||(h.from=n,g&&(c||(c=[])).push(h))):(h.from+=n,g&&(c||(c=[])).push(h));e=[c];if(!g){var g=b.text.length-2,k;if(0<g&&c)for(f=0;f<c.length;++f)null==c[f].to&&(k||(k=[])).push({from:null,to:null,marker:c[f].marker});for(f=0;f<g;++f)e.push(k);e.push(d)}return e}function ad(a,b){var c;if(c=b["spans_"+a.id]){for(var d=0,e=[];d<b.text.length;++d)e.push(ae(c[d]));c=e}else c=null;d=ec(a,b);if(!c)return d;if(!d)return c;for(e=
|
96
|
+
0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g){var h=0;a:for(;h<g.length;++h){for(var j=g[h],i=0;i<f.length;++i)if(f[i].marker==j.marker)continue a;f.push(j)}}else g&&(c[e]=g)}return c}function Xd(a,b,c){var d=null;a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;if(c.readOnly&&(!d||-1==U(d,c)))(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b)for(var c=d[b],e=c.find(),f=0;f<a.length;++f){var g=
|
97
|
+
a[f];if(!x(g.to,e.from)&&!x(e.to,g.from)){var h=[f,1];(x(g.from,e.from)||!c.inclusiveLeft&&t(g.from,e.from))&&h.push({from:g.from,to:e.from});(x(e.to,g.to)||!c.inclusiveRight&&t(g.to,e.to))&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-1}}return a}function ba(a,b){var c=Ca&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)if(e=c[f],e.marker.collapsed&&(null==e.from||e.from<b)&&(null==e.to||e.to>b)&&(!d||d.width<e.marker.width))d=e.marker;return d}function Ba(a){return ba(a,a.text.length+
|
98
|
+
1)}function la(a,b){for(var c;c=ba(b,-1);)b=r(a,c.find().from.line);return b}function aa(a,b){var c=Ca&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed&&(null==d.from||0==d.from&&d.marker.inclusiveLeft&&ic(a,b,d)))return!0}function ic(a,b,c){if(null==c.to)return b=c.marker.find().to,b=r(a,b.line),ic(a,b,Qa(b.markedSpans,c.marker));if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var d,e=0;e<b.markedSpans.length;++e)if(d=b.markedSpans[e],d.marker.collapsed&&
|
99
|
+
d.from==c.to&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&ic(a,b,d))return!0}function id(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function jd(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function kd(a){return function(){var b=!this.cm.curOp;b&&qa(this.cm);try{var c=a.apply(this,arguments)}finally{b&&ra(this.cm)}return c}}function hb(a){if(null!=a.height)return a.height;(!a.node.parentNode||1!=a.node.parentNode.nodeType)&&
|
100
|
+
R(a.cm.display.measure,q("div",[a.node],null,"position: relative"));return a.height=a.node.offsetHeight}function be(a,b,c,d){var e=new jc(a,c,d);e.noHScroll&&(a.display.alignWidgets=!0);vb(a,b,function(b){(b.widgets||(b.widgets=[])).push(e);e.line=b;if(!aa(a.doc,b)||e.showIfHidden){var c=ma(a,b)<a.display.scroller.scrollTop;L(b,b.height+hb(e));if(c)a.curOp.updateScrollPos={scrollTop:a.doc.scrollTop+e.height,scrollLeft:a.doc.scrollLeft}}return true});return e}function Ra(a,b,c){a={text:a};jd(a,b);
|
101
|
+
a.height=c?c(a):1;return a}function ya(a,b,c,d){a.text=b;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);id(a);jd(a,c);b=d?d(a):1;b!=a.height&&L(a,b);M(a,"change")}function ld(a,b,c,d,e){var f=a.options.flattenSpans,g="",h=null,a=new Na(b,a.options.tabSize);for(""==b&&c.blankLine&&c.blankLine(d);!a.eol();){var j=c.token(a,d);5E3<a.pos&&(f=!1,a.pos=Math.min(b.length,a.start+5E4),j=null);var i=a.current();a.start=a.pos;!f||h!=j?(g&&e(g,h),g=i,h=j):g+=i}g&&e(g,
|
102
|
+
h)}function Cc(a,b,c){var d=[a.state.modeGen];ld(a,b.text,a.doc.mode,c,function(a,b){d.push(a,b)});for(c=0;c<a.state.overlays.length;++c){var e=a.state.overlays[c],f=1;ld(a,b.text,e.mode,!0,function(a,b){for(var c=f,i=a.length;i;){var l=d[f],m=l.length;if(m<=i)i=i-m;else{d.splice(f,1,l.slice(0,i),d[f+1],l.slice(i));i=0}f=f+2}if(b)if(e.opaque){d.splice(c,f-c,a,b);f=c+2}else for(;c<f;c=c+2){l=d[c+1];d[c+1]=l?l+" "+b:b}})}return d}function Dc(a,b,c){var d=a.doc.mode,a=new Na(b.text,a.options.tabSize);
|
103
|
+
for(""==b.text&&d.blankLine&&d.blankLine(c);!a.eol()&&5E3>=a.pos;)d.token(a,c),a.start=a.pos}function md(a){return!a?null:nd[a]||(nd[a]="cm-"+a.replace(/ +/g," cm-"))}function Bc(a,b,c){for(var d,e=b,f,g,h=!0;d=ba(e,-1);)h=!1,e=r(a.doc,d.find().from.line),f||(f=e);d={pre:q("pre"),col:0,pos:0,display:!c,measure:null,addedOne:!1,cm:a};e.textClass&&(d.pre.className=e.textClass);do{d.measure=e==b&&c;d.pos=0;d.addToken=d.measure?ce:od;c&&(g&&e!=b&&!d.addedOne)&&(c[0]=d.pre.appendChild(kc(a.display.measure)),
|
104
|
+
d.addedOne=!0);var j=e;g=d;var i=e;if(!i.styles||i.styles[0]!=a.state.modeGen)i.styles=Cc(a,i,i.stateAfter=Da(a,F(i)));a:{var l=j,i=i.styles;if(j=l.markedSpans)for(var l=l.text.length,m=0,n=1,k="",o=void 0,p=0,s=void 0,u=void 0,v=void 0,t=void 0;;){if(p==m){for(var s=u=v="",t=null,p=Infinity,w=null,y=0;y<j.length;++y){var x=j[y],z=x.marker;if(x.from<=m&&(null==x.to||x.to>m)){if(null!=x.to&&p>x.to&&(p=x.to,u=""),z.className&&(s+=" "+z.className),z.startStyle&&x.from==m&&(v+=" "+z.startStyle),z.endStyle&&
|
105
|
+
x.to==p&&(u+=" "+z.endStyle),z.collapsed&&(!t||t.marker.width<z.width))t=x}else x.from>m&&p>x.from&&(p=x.from);"bookmark"==z.type&&(x.from==m&&z.replacedWith)&&(w=z.replacedWith)}if(t&&(t.from||0)==m)if(pd(g,(null==t.to?l:t.to)-m,null!=t.from&&t.marker.replacedWith),null==t.to){i=t.marker.find();break a}w&&!t&&pd(g,0,w)}if(m>=l)break;for(w=Math.min(l,p);;){if(k){y=m+k.length;t||(x=y>w?k.slice(0,w-m):k,g.addToken(g,x,o?o+s:s,v,m+x.length==p?u:""));if(y>=w){k=k.slice(w-m);m=w;break}m=y;v=""}k=i[n++];
|
106
|
+
o=md(i[n++])}}else for(var n=1;n<i.length;n+=2)g.addToken(g,i[n],md(i[n+1]));i=void 0}g=e==f;i&&(e=r(a.doc,i.to.line),h=!1)}while(i);c&&!d.addedOne&&(c[0]=d.pre.appendChild(h?q("span"," "):kc(a.display.measure)));!d.pre.firstChild&&!aa(a.doc,b)&&d.pre.appendChild(document.createTextNode(" "));var B;if(c&&E&&(B=O(e)))if(e=B.length-1,B[e].from==B[e].to&&--e,b=B[e],B=B[e-1],b.from+1==b.to&&(B&&b.level<B.level)&&(c=c[d.pos-1]))c.parentNode.insertBefore(c.measureRight=kc(a.display.measure),c.nextSibling);
|
107
|
+
return d.pre}function od(a,b,c,d,e){if(b){if(lc.test(b))for(var f=document.createDocumentFragment(),g=0;;){lc.lastIndex=g;var h=lc.exec(b),j=h?h.index-g:b.length-g;j&&(f.appendChild(document.createTextNode(b.slice(g,g+j))),a.col+=j);if(!h)break;g+=j+1;"\t"==h[0]?(h=a.cm.options.tabSize,h-=a.col%h,f.appendChild(q("span",ed(h),"cm-tab")),a.col+=h):(j=q("span","•","cm-invalidchar"),j.title="\\u"+h[0].charCodeAt(0).toString(16),f.appendChild(j),a.col+=1)}else{a.col+=b.length;var f=document.createTextNode(b)}if(c||
|
108
|
+
d||e||a.measure)return b=c||"",d&&(b+=d),e&&(b+=e),a.pre.appendChild(q("span",[f],b));a.pre.appendChild(f)}}function ce(a,b,c,d,e){for(var f=0;f<b.length;++f){var g=b.charAt(f),h=0==f;"\ud800"<=g&&"\udbff">g&&f<b.length-1?(g=b.slice(f,f+2),++f):f&&(a.cm.options.lineWrapping&&yb.test(b.slice(f-1,f+1)))&&a.pre.appendChild(q("wbr"));a.measure[a.pos]=od(a,g,c,h&&d,f==b.length-1&&e);a.pos+=g.length}b.length&&(a.addedOne=!0)}function pd(a,b,c){c&&(a.display||(c=c.cloneNode(!0)),a.pre.appendChild(c),a.measure&&
|
109
|
+
b&&(a.measure[a.pos]=c,a.addedOne=!0));a.pos+=b}function gc(a,b,c,d,e){function f(a){return c?c[a]:null}var g=b.from,h=b.to,j=b.text,i=r(a,g.line),l=r(a,h.line),m=C(j),n=f(j.length-1),k=h.line-g.line;if(0==g.ch&&0==h.ch&&""==m){for(var o=0,p=j.length-1,q=[];o<p;++o)q.push(Ra(j[o],f(o),e));ya(l,l.text,n,e);k&&a.remove(g.line,k);q.length&&a.insert(g.line,q)}else if(i==l)if(1==j.length)ya(i,i.text.slice(0,g.ch)+m+i.text.slice(h.ch),n,e);else{q=[];o=1;for(p=j.length-1;o<p;++o)q.push(Ra(j[o],f(o),e));
|
110
|
+
q.push(Ra(m+i.text.slice(h.ch),n,e));ya(i,i.text.slice(0,g.ch)+j[0],f(0),e);a.insert(g.line+1,q)}else if(1==j.length)ya(i,i.text.slice(0,g.ch)+j[0]+l.text.slice(h.ch),f(0),e),a.remove(g.line+1,k);else{ya(i,i.text.slice(0,g.ch)+j[0],f(0),e);ya(l,m+l.text.slice(h.ch),n,e);o=1;p=j.length-1;for(q=[];o<p;++o)q.push(Ra(j[o],f(o),e));1<k&&a.remove(g.line+1,k-1);a.insert(g.line+1,q)}M(a,"change",a,b);Y(a,d.anchor,d.head,null,!0)}function zb(a){this.lines=a;this.parent=null;for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=
|
111
|
+
this,d+=a[b].height;this.height=d}function Sa(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;d<e;++d){var f=a[d],b=b+f.chunkSize(),c=c+f.height;f.parent=this}this.size=b;this.height=c;this.parent=null}function xa(a,b,c){function d(a,f,g){if(a.linked)for(var h=0;h<a.linked.length;++h){var j=a.linked[h];if(j.doc!=f){var i=g&&j.sharedHist;if(!c||i)b(j.doc,i),d(j.doc,a,i)}}}d(a,null,!0)}function sc(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;vc(a);Xa(a);a.options.lineWrapping||
|
112
|
+
Mb(a);a.options.mode=b.modeOption;w(a)}function r(a,b){for(b-=a.first;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(b<e){a=d;break}b-=e}return a.lines[b]}function qd(a,b,c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(a){a=a.text;e==c.line&&(a=a.slice(0,c.ch));e==b.line&&(a=a.slice(b.ch));d.push(a);++e});return d}function mc(a,b,c){var d=[];a.iter(b,c,function(a){d.push(a.text)});return d}function L(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function F(a){if(null==
|
113
|
+
a.parent)return null;for(var b=a.parent,a=U(b.lines,a),c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a+b.first}function cb(a,b){var c=a.first;a:do{for(var d=0,e=a.children.length;d<e;++d){var f=a.children[d],g=f.height;if(b<g){a=f;continue a}b-=g;c+=f.chunkSize()}return c}while(!a.lines);d=0;for(e=a.lines.length;d<e;++d){f=a.lines[d].height;if(b<f)break;b-=f}return c+d}function ma(a,b){for(var b=la(a.doc,b),c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=
|
114
|
+
d.lines[e];if(f==b)break;else c+=f.height}for(f=d.parent;f;d=f,f=d.parent)for(e=0;e<f.children.length;++e){var g=f.children[e];if(g==d)break;else c+=g.height}return c}function O(a){var b=a.order;null==b&&(b=a.order=de(a.text));return b}function Ab(){return{done:[],undone:[],undoDepth:Infinity,lastTime:0,lastOp:null,lastOrigin:null,dirtyCounter:0}}function rd(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]=
|
115
|
+
{}))[f]=c.markedSpans);++f})}function fc(a,b){var c={from:b.from,to:bc(b),text:qd(a,b.from,b.to)};rd(a,c,b.from.line,b.to.line+1);xa(a,function(a){rd(a,c,b.from.line,b.to.line+1)},!0);return c}function Yd(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g=C(e.done);if(g&&(e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&e.lastTime>f-600||"*"==b.origin.charAt(0)))){var h=C(g.changes);t(b.from,b.to)&&t(b.from,h.to)?h.to=bc(b):g.changes.push(fc(a,b));g.anchorAfter=c.anchor;
|
116
|
+
g.headAfter=c.head}else{g={changes:[fc(a,b)],anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head};for(e.done.push(g);e.done.length>e.undoDepth;)e.done.shift();0>e.dirtyCounter?e.dirtyCounter=NaN:e.dirtyCounter++}e.lastTime=f;e.lastOp=d;e.lastOrigin=b.origin}function ae(a){if(!a)return null;for(var b=0,c;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return!c?a:c.length?c:null}function Bb(a,b){for(var c=0,d=[];c<a.length;++c){var e=
|
117
|
+
a[c],f=e.changes,g=[];d.push({changes:g,anchorBefore:e.anchorBefore,headBefore:e.headBefore,anchorAfter:e.anchorAfter,headAfter:e.headAfter});for(e=0;e<f.length;++e){var h=f[e],j;g.push({from:h.from,to:h.to,text:h.text});if(b)for(var i in h)if((j=i.match(/^spans_(\d+)$/))&&-1<U(b,Number(j[1])))C(g)[i]=h[i],delete h[i]}}return d}function Cb(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function sd(a,b,c,d){for(var e=0;e<a.length;++e){for(var f=a[e],g=!0,h=0;h<f.changes.length;++h){var j=
|
118
|
+
f.changes[h];f.copied||(j.from=ea(j.from),j.to=ea(j.to));if(c<j.from.line)j.from.line+=d,j.to.line+=d;else if(b<=j.to.line){g=!1;break}}f.copied||(f.anchorBefore=ea(f.anchorBefore),f.headBefore=ea(f.headBefore),f.anchorAfter=ea(f.anchorAfter),f.readAfter=ea(f.headAfter),f.copied=!0);g?(Cb(f.anchorBefore),Cb(f.headBefore),Cb(f.anchorAfter),Cb(f.headAfter)):(a.splice(0,e+1),e=0)}}function Zc(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;sd(a.done,c,d,e);sd(a.undone,c,d,e)}function ee(){nb(this)}
|
119
|
+
function Ia(a){a.stop||(a.stop=ee);return a}function y(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function td(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function nb(a){y(a);td(a)}function Qc(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));na&&(a.ctrlKey&&1==b)&&(b=3);return b}function v(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))}function S(a,
|
120
|
+
b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else if(a=a._handlers&&a._handlers[b])for(b=0;b<a.length;++b)if(a[b]==c){a.splice(b,1);break}}function H(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function M(a,b){function c(a){return function(){a.apply(null,e)}}var d=a._handlers&&a._handlers[b];if(d){var e=Array.prototype.slice.call(arguments,2);W||(++lb,
|
121
|
+
W=[],setTimeout(fe,0));for(var f=0;f<d.length;++f)W.push(c(d[f]))}}function fe(){--lb;var a=W;W=null;for(var b=0;b<a.length;++b)a[b]()}function va(a,b){var c=a._handlers&&a._handlers[b];return c&&0<c.length}function Ib(){this.id=null}function pa(a,b,c){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var d=0,e=0;d<b;++d)"\t"==a.charAt(d)?e+=c-e%c:++e;return e}function ed(a){for(;Db.length<=a;)Db.push(C(Db)+" ");return Db[a]}function C(a){return a[a.length-1]}function Lc(a){Wa?(a.selectionStart=
|
122
|
+
0,a.selectionEnd=a.value.length):a.select()}function U(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function xb(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function Gc(a){for(var b=[],c=0;c<a;++c)b.push(void 0);return b}function J(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function wb(a){return/\w/.test(a)||""<a&&(a.toUpperCase()!=a.toLowerCase()||ge.test(a))}function ud(a){for(var b in a)if(a.hasOwnProperty(b)&&
|
123
|
+
a[b])return!1;return!0}function q(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)Ac(a,b);else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function $a(a){if(E)for(;a.firstChild;)a.removeChild(a.firstChild);else a.innerHTML="";return a}function R(a,b){return $a(a).appendChild(b)}function Ac(a,b){ca?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function z(a){return a.getBoundingClientRect()}function bb(a){if(null!=
|
124
|
+
Eb)return Eb;var b=q("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");R(a,b);b.offsetWidth&&(Eb=b.offsetHeight-b.clientHeight);return Eb||0}function kc(a){if(null==nc){var b=q("span","");R(a,q("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(nc=1>=b.offsetWidth&&2<b.offsetHeight&&!ja)}return nc?q("span",""):q("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function Id(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=0;e<a.length;++e){var f=
|
125
|
+
a[e];if(f.from<c&&f.to>b||b==c&&f.to==b)d(Math.max(f.from,b),Math.min(f.to,c),1==f.level?"rtl":"ltr")}}function oc(a){return a.level%2?a.from:a.to}function jb(a){return(a=O(a))?a[0].level%2?a[0].to:a[0].from:0}function kb(a){var b=O(a);return!b?a.text.length:oc(C(b))}function vd(a,b){var c=r(a.doc,b),d=la(a.doc,c);d!=c&&(b=F(d));c=O(d);d=!c?0:c[0].level%2?kb(d):jb(d);return o(b,d)}function he(a,b){for(var c,d;c=Ba(d=r(a.doc,b));)b=c.find().to.line;c=O(d);d=!c?d.text.length:c[0].level%2?jb(d):kb(d);
|
126
|
+
return o(b,d)}function Sb(a,b,c,d){var e=O(a);if(!e)return fd(a,b,c,d);for(var d=d?function(b,c){do b+=c;while(0<b&&Tb.test(a.text.charAt(b)));return b}:function(a,b){return a+b},f=e[0].level,g=0;g<e.length;++g){var h=e[g],j=h.level%2==f;if(h.from<b&&h.to>b||j&&(h.from==b||h.to==b))break}for(b=d(b,h.level%2?-c:c);null!=b;)if(h.level%2==f)if(b<h.from||b>h.to)b=(h=e[g+=c])&&(0<c==h.level%2?d(h.to,-1):d(h.from,1));else break;else if(b==(h.level%2?h.to:h.from))b=(h=e[--g])&&oc(h);else if(b==oc(h))b=(h=
|
127
|
+
e[++g])&&(h.level%2?h.to:h.from);else break;return 0>b||b>a.text.length?null:b}function fd(a,b,c,d){b+=c;if(d)for(;0<b&&Tb.test(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var wa=/gecko\/\d/i.test(navigator.userAgent),E=/MSIE \d/.test(navigator.userAgent),ja=E&&(null==document.documentMode||8>document.documentMode),ca=E&&(null==document.documentMode||9>document.documentMode),P=/WebKit\//.test(navigator.userAgent),ie=P&&/Qt\/\d+\.\d+/.test(navigator.userAgent),wd=/Chrome\//.test(navigator.userAgent),
|
128
|
+
T=/Opera\//.test(navigator.userAgent),Xb=/Apple Computer/.test(navigator.vendor),Lb=/KHTML\//.test(navigator.userAgent),Bd=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),Cd=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),Nd=/PhantomJS/.test(navigator.userAgent),Wa=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),Hb=Wa||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),na=Wa||/Mac/.test(navigator.platform),je=/windows/i.test(navigator.platform),
|
129
|
+
Ta=T&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Ta&&(Ta=Number(Ta[1]));var hd=na&&(ie||T&&(null==Ta||12.11>Ta)),Wb=wa||E&&!ca,Yc=!1,Ca=!1,da,Md=0,pb,ob,qb=0,K=null;E?K=-0.53:wa?K=15:wd?K=-0.7:Xb&&(K=-1/3);var Uc,$b=null,ac;k.Pos=o;k.prototype={focus:function(){window.focus();D(this);$(this);Fa(this)},setOption:function(a,b){var c=this.options,d=c[a];c[a]==b&&"mode"!=a||(c[a]=b,ia.hasOwnProperty(a)&&s(this,ia[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},
|
130
|
+
addKeyMap:function(a){this.state.keyMaps.push(a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(("string"==typeof a?b[c].name:b[c])==a)return b.splice(c,1),!0},addOverlay:s(null,function(a,b){var c=a.token?a:k.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque});this.state.modeGen++;w(this)}),removeOverlay:s(null,function(a){for(var b=this.state.overlays,c=0;c<b.length;++c)if(b[c].modeSpec==
|
131
|
+
a){b.splice(c,1);this.state.modeGen++;w(this);break}}),indentLine:s(null,function(a,b,c){"string"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");fa(this.doc,a)&&sb(this,a,b,c)}),indentSelection:s(null,function(a){var b=this.doc.sel;if(t(b.from,b.to))return sb(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),b=b.from.line;b<=c;++b)sb(this,b,a)}),getTokenAt:function(a){for(var b=this.doc,a=p(b,a),c=Da(this,a.line),d=this.doc.mode,b=r(b,a.line),b=new Na(b.text,
|
132
|
+
this.options.tabSize);b.pos<a.ch&&!b.eol();){b.start=b.pos;var e=d.token(b,c)}return{start:b.start,end:b.pos,string:b.current(),className:e||null,type:e||null,state:c}},getStateAfter:function(a){var b=this.doc,a=Math.max(b.first,Math.min(null==a?b.first+b.size-1:a,b.first+b.size-1));return Da(this,a+1)},cursorCoords:function(a,b){var c;c=this.doc.sel;c=null==a?c.head:"object"==typeof a?p(this.doc,a):a?c.from:c.to;return Q(this,c,b||"page")},charCoords:function(a,b){return eb(this,p(this.doc,a),b||
|
133
|
+
"page")},coordsChar:function(a){var b=z(this.display.lineSpace);return Rb(this,a.left-b.left-(window.pageXOffset||(document.documentElement||document.body).scrollLeft),a.top-b.top-(window.pageYOffset||(document.documentElement||document.body).scrollTop))},defaultTextHeight:function(){return Za(this.display)},setGutterMarker:s(null,function(a,b,c){return vb(this,a,function(a){var e=a.gutterMarkers||(a.gutterMarkers={});e[b]=c;!c&&ud(e)&&(a.gutterMarkers=null);return!0})}),clearGutter:s(null,function(a){var b=
|
134
|
+
this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,w(b,d,d+1),ud(c.gutterMarkers)&&(c.gutterMarkers=null));++d})}),addLineClass:s(null,function(a,b,c){return vb(this,a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[e]){if(RegExp("\\b"+c+"\\b").test(a[e]))return!1;a[e]+=" "+c}else a[e]=c;return!0})}),removeLineClass:s(null,function(a,b,c){return vb(this,a,function(a){var e="text"==b?"textClass":"background"==b?
|
135
|
+
"bgClass":"wrapClass",f=a[e];if(f)if(null==c)a[e]=null;else{var g=f.replace(RegExp("^"+c+"\\b\\s*|\\s*\\b"+c+"\\b"),"");if(g==f)return!1;a[e]=g||null}else return!1;return!0})}),addLineWidget:s(null,function(a,b,c){return be(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!fa(this.doc,a))return null;var b=a,a=r(this.doc,a);if(!a)return null}else if(b=F(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,
|
136
|
+
bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display,a=Q(this,p(this.doc,a)),g=a.bottom,h=a.left;b.style.position="absolute";f.sizer.appendChild(b);if("over"==d)g=a.top;else if("above"==d||"near"==d){var j=Math.max(f.wrapper.clientHeight,this.doc.height),i=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>j)&&a.top>
|
137
|
+
b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=j&&(g=a.bottom);h+b.offsetWidth>i&&(h=i-b.offsetWidth)}b.style.top=g+f.lineSpace.offsetTop+"px";b.style.left=b.style.right="";"right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px");c&&dd(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:s(null,Oc),execCommand:function(a){return Yb[a](this)},findPosH:function(a,b,c,d){var e=
|
138
|
+
1;0>b&&(e=-1,b=-b);for(var f=0,a=p(this.doc,a);f<b&&!(a=hc(this.doc,a,e,c,d),a.hitSide);++f);return a},moveH:s(null,function(a,b){var c=this.doc.sel,c=c.shift||c.extend||t(c.from,c.to)?hc(this.doc,c.head,a,b,this.options.rtlMoveVisually):0>a?c.from:c.to;B(this.doc,c,c,a)}),deleteH:s(null,function(a,b){var c=this.doc.sel;t(c.from,c.to)?X(this.doc,"",c.from,hc(this.doc,c.head,a,b,!1),"+delete"):X(this.doc,"",c.from,c.to,"+delete");this.curOp.userSelChange=!0}),findPosV:function(a,b,c,d){var e=1;0>b&&
|
139
|
+
(e=-1,b=-b);for(var f=0,a=p(this.doc,a);f<b&&!(a=Q(this,a,"div"),null==d?d=a.left:a.left=d,a=gd(this,a,e,c),a.hitSide);++f);return a},moveV:s(null,function(a,b){var c=this.doc.sel,d=Q(this,c.head,"div");null!=c.goalColumn&&(d.left=c.goalColumn);var e=gd(this,d,a,b);"page"==b&&(this.display.scrollbarV.scrollTop+=eb(this,e,"div").top-d.top);B(this.doc,e,e,a);c.goalColumn=d.left}),toggleOverwrite:function(){this.display.cursor.className=(this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+
|
140
|
+
" CodeMirror-overwrite":this.display.cursor.className.replace(" CodeMirror-overwrite","")},scrollTo:s(null,function(a,b){this.curOp.updateScrollPos={scrollLeft:a,scrollTop:b}}),getScrollInfo:function(){var a=this.display.scroller,b=za;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:function(a){"number"==typeof a&&(a=o(a,0));!a||null!=a.line?(a=a?p(this.doc,a):this.doc.sel.head,Ic(this,
|
141
|
+
a)):dd(this,a.left,a.top,a.right,a.bottom)},setSize:function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(""+a)?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a));null!=b&&(this.display.wrapper.style.height=c(b));this.refresh()},on:function(a,b){v(this,a,b)},off:function(a,b){S(this,a,b)},operation:function(a){return Jc(this,a)},refresh:s(null,function(){ka(this);this.curOp.updateScrollPos={scrollTop:this.doc.scrollTop,scrollLeft:this.doc.scrollLeft};w(this)}),swapDoc:s(null,function(a){var b=
|
142
|
+
this.doc;b.cm=null;sc(this,a);ka(this);this.curOp.updateScrollPos={scrollTop:a.scrollTop,scrollLeft:a.scrollLeft};return b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};var ia=k.optionHandlers={},Fb=k.defaults={},tc=k.Init={toString:function(){return"CodeMirror.Init"}};u("value","",function(a,b){a.setValue(b)},!0);u("mode",
|
143
|
+
null,function(a,b){a.doc.modeOption=b;Xa(a)},!0);u("indentUnit",2,Xa,!0);u("indentWithTabs",!1);u("smartIndent",!0);u("tabSize",4,function(a){Xa(a);ka(a);w(a)},!0);u("electricChars",!0);u("rtlMoveVisually",!je);u("theme","default",function(a){rc(a);Aa(a)},!0);u("keyMap","default",function(a){var b=V[a.options.keyMap].style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(b?" cm-keymap-"+b:"")});u("extraKeys",null);u("onKeyEvent",null);u("onDragEvent",null);
|
144
|
+
u("lineWrapping",!1,function(a){if(a.options.lineWrapping){a.display.wrapper.className=a.display.wrapper.className+" CodeMirror-wrap";a.display.sizer.style.minWidth=""}else{a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap","");Mb(a)}vc(a);w(a);ka(a);setTimeout(function(){wc(a.display,a.doc.height)},100)},!0);u("gutters",[],function(a){Gb(a.options);Aa(a)},!0);u("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?Ob(a.display)+"px":"0";a.refresh()},!0);u("lineNumbers",
|
145
|
+
!1,function(a){Gb(a.options);Aa(a)},!0);u("firstLineNumber",1,Aa,!0);u("lineNumberFormatter",function(a){return a},Aa,!0);u("showCursorWhenSelecting",!1,Pb,!0);u("readOnly",!1,function(a,b){if(b=="nocursor"){Jb(a);a.display.input.blur()}else b||Z(a,true)});u("dragDrop",!0);u("cursorBlinkRate",530);u("cursorHeight",1);u("workTime",100);u("workDelay",100);u("flattenSpans",!0);u("pollInterval",100);u("undoDepth",40,function(a,b){a.doc.history.undoDepth=b});u("viewportMargin",10,function(a){a.refresh()},
|
146
|
+
!0);u("tabindex",null,function(a,b){a.display.input.tabIndex=b||""});u("autofocus",null);var xd=k.modes={},pc=k.mimeModes={};k.defineMode=function(a,b){!k.defaults.mode&&"null"!=a&&(k.defaults.mode=a);if(2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}xd[a]=b};k.defineMIME=function(a,b){pc[a]=b};k.resolveMode=function(a){if("string"==typeof a&&pc.hasOwnProperty(a))a=pc[a];else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return k.resolveMode("application/xml");
|
147
|
+
return"string"==typeof a?{name:a}:a||{name:"null"}};k.getMode=function(a,b){var b=k.resolveMode(b),c=xd[b.name];if(!c)return k.getMode(a,"text/plain");c=c(a,b);if(Ua.hasOwnProperty(b.name)){var d=Ua[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;return c};k.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});k.defineMIME("text/plain","null");var Ua=k.modeExtensions={};k.extendMode=function(a,b){var c=Ua.hasOwnProperty(a)?
|
148
|
+
Ua[a]:Ua[a]={};xb(b,c)};k.defineExtension=function(a,b){k.prototype[a]=b};k.defineOption=u;var Kb=[];k.defineInitHook=function(a){Kb.push(a)};k.copyState=oa;k.startState=Ec;k.innerMode=function(a,b){for(;a.innerMode;)var c=a.innerMode(b),b=c.state,a=c.mode;return c||{mode:a,state:b}};var Yb=k.commands={selectAll:function(a){a.setSelection(o(a.firstLine(),0),o(a.lastLine()))},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!t(b,c);!d&&a.getLine(b.line).length==b.ch?a.replaceRange("",
|
149
|
+
b,o(b.line+1,0),"+delete"):a.replaceRange("",b,d?c:o(b.line),"+delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",o(b,0),o(b),"+delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection(o(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(o(a.lastLine()))},goLineStart:function(a){a.extendSelection(vd(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=vd(a,b.line),d=a.getLineHandle(c.line),e=O(d);
|
150
|
+
!e||0==e[0].level?(d=Math.max(0,d.text.search(/\S/)),a.extendSelection(o(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d))):a.extendSelection(c)},goLineEnd:function(a){a.extendSelection(he(a,a.getCursor().line))},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},
|
151
|
+
goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t",
|
152
|
+
"end","+input")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection("\t","end","+input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);0<b.ch&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),o(b.line,b.ch-1),o(b.line,b.ch+1))},newlineAndIndent:function(a){s(a,function(){a.replaceSelection("\n","end","+input");a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},V=k.keyMap={};V.basic=
|
153
|
+
{Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};V.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft",
|
154
|
+
"Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordBefore","Ctrl-Delete":"delWordAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"};V.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd",
|
155
|
+
"Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordBefore","Ctrl-Alt-Backspace":"delWordAfter","Alt-Delete":"delWordAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]};V["default"]=na?V.macDefault:V.pcDefault;V.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp",
|
156
|
+
"Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};k.lookupKey=La;k.isModifierKey=Vc;k.keyName=Wc;k.fromTextArea=function(a,b){function c(){a.value=i.getValue()}b||(b={});b.value=a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);if(null==
|
157
|
+
b.autofocus){var d=document.body;try{d=document.activeElement}catch(e){}b.autofocus=d==a||null!=a.getAttribute("autofocus")&&d==document.body}if(a.form){v(a.form,"submit",c);var f=a.form,g=f.submit;try{var h=f.submit=function(){c();f.submit=g;f.submit();f.submit=h}}catch(j){}}a.style.display="none";var i=k(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);i.save=c;i.getTextArea=function(){return a};i.toTextArea=function(){c();a.parentNode.removeChild(i.getWrapperElement());a.style.display=
|
158
|
+
"";if(a.form){S(a.form,"submit",c);if(typeof a.form.submit=="function")a.form.submit=g}};return i};Na.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},eatWhile:function(a){for(var b=
|
159
|
+
this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){return pa(this.string,this.start,this.tabSize)},indentation:function(){return pa(this.string,null,this.tabSize)},match:function(a,b,c){if("string"==typeof a){if((c?
|
160
|
+
this.string.toLowerCase():this.string).indexOf(c?a.toLowerCase():a,this.pos)==this.pos)return!1!==b&&(this.pos+=a.length),!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}},current:function(){return this.string.slice(this.start,this.pos)}};k.StringStream=Na;k.TextMarker=ha;ha.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;b&&qa(a);for(var c=null,d=null,e=0;e<this.lines.length;++e){var f=this.lines[e],
|
161
|
+
g=Qa(f.markedSpans,this);null!=g.to&&(d=F(f));for(var h=f,j=f.markedSpans,i=g,l=void 0,m=0;m<j.length;++m)j[m]!=i&&(l||(l=[])).push(j[m]);h.markedSpans=l;null!=g.from?c=F(f):this.collapsed&&(!aa(this.doc,f)&&a)&&L(f,Za(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=la(a.doc,this.lines[e]),g=ab(a.doc,f),g>a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&w(a,c,d+1);this.lines.length=0;this.explicitlyCleared=
|
162
|
+
!0;this.collapsed&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&cd(a));b&&ra(a);M(this,"clear")}};ha.prototype.find=function(){for(var a,b,c=0;c<this.lines.length;++c){var d=this.lines[c],e=Qa(d.markedSpans,this);if(null!=e.from||null!=e.to)d=F(d),null!=e.from&&(a=o(d,e.from)),null!=e.to&&(b=o(d,e.to))}return"bookmark"==this.type?a:a&&{from:a,to:b}};ha.prototype.getOptions=function(a){var b=this.replacedWith;return{className:this.className,inclusiveLeft:this.inclusiveLeft,inclusiveRight:this.inclusiveRight,
|
163
|
+
atomic:this.atomic,collapsed:this.collapsed,clearOnEnter:this.clearOnEnter,replacedWith:a?b&&b.cloneNode(!0):b,readOnly:this.readOnly,startStyle:this.startStyle,endStyle:this.endStyle}};ha.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;if(!b.maybeHiddenMarkers||-1==U(b.maybeHiddenMarkers,this))(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};ha.prototype.detachLine=function(a){this.lines.splice(U(this.lines,a),1);!this.lines.length&&
|
164
|
+
this.doc.cm&&(a=this.doc.cm.curOp,(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this))};k.SharedTextMarker=Pa;Pa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();M(this,"clear")}};Pa.prototype.find=function(){return this.primary.find()};Pa.prototype.getOptions=function(a){a=this.primary.getOptions(a);a.shared=!0;return a};var jc=k.LineWidget=function(a,b,c){for(var d in c)c.hasOwnProperty(d)&&(this[d]=
|
165
|
+
c[d]);this.cm=a;this.node=b};jc.prototype.clear=kd(function(){var a=this.line.widgets,b=F(this.line);if(null!=b&&a){for(var c=0;c<a.length;++c)a[c]==this&&a.splice(c--,1);a.length||(this.line.widgets=null);L(this.line,Math.max(0,this.line.height-hb(this)));w(this.cm,b,b+1)}});jc.prototype.changed=kd(function(){var a=this.height;this.height=null;if(a=hb(this)-a)L(this.line,this.line.height+a),a=F(this.line),w(this.cm,a,a+1)});var nd={},lc=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g;zb.prototype={chunkSize:function(){return this.lines.length},
|
166
|
+
removeInner:function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;id(f);M(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertInner:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));a=0;for(c=b.length;a<c;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};Sa.prototype={chunkSize:function(){return this.size},
|
167
|
+
removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(a<e){var f=Math.min(b,e-a),g=d.height;d.removeInner(a,f);this.height-=g-d.height;e==f&&(this.children.splice(c--,1),d.parent=null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-b&&(c=[],this.collapse(c),this.children=[new zb(c)],this.children[0].parent=this)},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=
|
168
|
+
b.length;this.height+=c;for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<=g){f.insertInner(a,b,c);if(f.lines&&50<f.lines.length){for(;50<f.lines.length;)a=f.lines.splice(f.lines.length-25,25),a=new zb(a),f.height-=a.height,this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new Sa(b);if(a.parent){a.size-=b.size;a.height-=
|
169
|
+
b.height;var c=U(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new Sa(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<g){g=Math.min(b,g-a);if(f.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=g}}};var ke=0,I=k.Doc=function(a,b,c){if(!(this instanceof I))return new I(a,b,c);null==c&&(c=0);Sa.call(this,[new zb([Ra("",
|
170
|
+
null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.history=Ab();this.frontier=c;c=o(c,0);this.sel={from:c,to:c,head:c,anchor:c,shift:!1,extend:!1,goalColumn:null};this.id=++ke;this.modeOption=b;"string"==typeof a&&(a=ta(a));gc(this,{from:c,to:c,text:a},null,{head:c,anchor:c})};I.prototype=function(a,b){function c(){}c.prototype=a;var d=new c;b&&xb(b,d);return d}(Sa.prototype,{iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,
|
171
|
+
a)},insert:function(a,b){for(var c=0,d=0,e=b.length;d<e;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=mc(this,this.first,this.first+this.size);return!1===a?b:b.join(a||"\n")},setValue:function(a){var b=o(this.first,0),c=this.first+this.size-1;Ha(this,{from:b,to:o(c,r(this,c).text.length),text:ta(a),origin:"setValue"},{head:b,anchor:b},!0)},replaceRange:function(a,b,c,d){b=p(this,b);c=c?p(this,c):b;X(this,a,
|
172
|
+
b,c,d)},getRange:function(a,b,c){a=qd(this,p(this,a),p(this,b));return!1===c?a:a.join(c||"\n")},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},setLine:function(a,b){fa(this,a)&&X(this,b,o(a,0),p(this,o(a)))},removeLine:function(a){fa(this,a)&&X(this,"",o(a,0),p(this,o(a+1,0)))},getLineHandle:function(a){if(fa(this,a))return r(this,a)},getLineNumber:function(a){return F(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+
|
173
|
+
this.size-1},clipPos:function(a){return p(this,a)},getCursor:function(a){var b=this.sel;return ea(null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||!1===a?b.to:b.from)},somethingSelected:function(){return!t(this.sel.head,this.sel.anchor)},setCursor:Ea(function(a,b,c){a=p(this,"number"==typeof a?o(a,b||0):a);c?B(this,a):Y(this,a,a)}),setSelection:Ea(function(a,b){Y(this,p(this,a),p(this,b||a))}),extendSelection:Ea(function(a,b){B(this,p(this,a),b&&p(this,b))}),getSelection:function(a){return this.getRange(this.sel.from,
|
174
|
+
this.sel.to,a)},replaceSelection:function(a,b,c){Ha(this,{from:this.sel.from,to:this.sel.to,text:ta(a),origin:c},b||"around")},undo:Ea(function(){$c(this,"undo")}),redo:Ea(function(){$c(this,"redo")}),setExtending:function(a){this.sel.extend=a},historySize:function(){var a=this.history;return{undo:a.done.length,redo:a.undone.length}},clearHistory:function(){this.history=Ab()},markClean:function(){this.history.dirtyCounter=0;this.history.lastOp=this.history.lastOrigin=null},isClean:function(){return 0==
|
175
|
+
this.history.dirtyCounter},getHistory:function(){return{done:Bb(this.history.done),undone:Bb(this.history.undone)}},setHistory:function(a){var b=this.history=Ab();b.done=a.done.slice(0);b.undone=a.undone.slice(0)},markText:function(a,b,c){return Oa(this,p(this,a),p(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft},a=p(this,a);return Oa(this,a,a,c,"bookmark")},findMarksAt:function(a){var a=p(this,a),b=[],c=r(this,a.line).markedSpans;
|
176
|
+
if(c)for(var d=0;d<c.length;++d){var e=c[d];if((null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch))b.push(e.marker.parent||e.marker)}return b},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)null!=b[c].from&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first;this.iter(function(d){d=d.text.length+1;if(d>a)return b=a,!0;a-=d;++c});return p(this,o(c,b))},indexFromPos:function(a){var a=p(this,a),b=a.ch;if(a.line<this.first||
|
177
|
+
0>a.ch)return 0;this.iter(this.first,a.line,function(a){b+=a.text.length+1});return b},copy:function(a){var b=new I(mc(this,this.first,this.first+this.size),this.modeOption,this.first);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn};a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||
|
178
|
+
(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.to<c&&(c=a.to);b=new I(mc(this,b,c),a.mode||this.modeOption,b);a.sharedHist&&(b.history=this.history);(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];return b},unlinkDoc:function(a){a instanceof k&&(a=a.doc);if(this.linked)for(var b=0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);
|
179
|
+
break}if(a.history==this.history){var c=[a.id];xa(a,function(a){c.push(a.id)},!0);a.history=Ab();a.history.done=Bb(this.history.done,c);a.history.undone=Bb(this.history.undone,c)}},iterLinkedDocs:function(a){xa(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});I.prototype.eachLine=I.prototype.iter;var le=["iter","insert","remove","copy","getEditor"],Va;for(Va in I.prototype)I.prototype.hasOwnProperty(Va)&&0>U(le,Va)&&(k.prototype[Va]=function(a){return function(){return a.apply(this.doc,
|
180
|
+
arguments)}}(I.prototype[Va]));k.e_stop=nb;k.e_preventDefault=y;k.e_stopPropagation=td;var W,lb=0;k.on=v;k.off=S;k.signal=H;var za=30,Rc=k.Pass={toString:function(){return"CodeMirror.Pass"}};Ib.prototype={set:function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)}};k.countColumn=pa;var Db=[""],ge=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/,Tb=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;
|
181
|
+
k.replaceGetRect=function(a){z=a};var Ud=function(){if(ca)return!1;var a=q("div");return"draggable"in a||"dragDrop"in a}(),yb=/^$/;wa?yb=/$'/:Xb?yb=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:wd&&(yb=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var Eb,nc,ta=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=
|
182
|
+
g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)};k.splitLines=ta;var Od=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return!b||b.parentElement()!=a?!1:0!=b.compareEndPoints("StartToEnd",b)},Kc=function(){var a=q("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),ga={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",
|
183
|
+
16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};k.keyNames=ga;
|
184
|
+
(function(){for(var a=0;10>a;a++)ga[a+48]=""+a;for(a=65;90>=a;a++)ga[a]=String.fromCharCode(a);for(a=1;12>=a;a++)ga[a+111]=ga[a+63235]="F"+a})();var de=function(){function a(a){return 255>=a?b.charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1791>=a?c.charAt(a-1536):1792<=a&&2220>=a?"r":"L"}var b="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",
|
185
|
+
c="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/;return function(b){if(!d.test(b))return!1;for(var c=b.length,l=[],m=0,n;m<c;++m)l.push(a(b.charCodeAt(m)));for(var m=0,k="L";m<c;++m)n=l[m],"m"==n?l[m]=k:
|
186
|
+
k=n;m=0;for(k="L";m<c;++m)n=l[m],"1"==n&&"r"==k?l[m]="n":f.test(n)&&(k=n,"r"==n&&(l[m]="R"));m=1;for(k=l[0];m<c-1;++m){n=l[m];if("+"==n&&"1"==k&&"1"==l[m+1])l[m]="1";else if(","==n&&k==l[m+1]&&("1"==k||"n"==k))l[m]=k;k=n}for(m=0;m<c;++m)if(n=l[m],","==n)l[m]="N";else if("%"==n){for(k=m+1;k<c&&"%"==l[k];++k);var o=m&&"!"==l[m-1]||k<c-1&&"1"==l[k]?"1":"N";for(n=m;n<k;++n)l[n]=o;m=k-1}m=0;for(k="L";m<c;++m)n=l[m],"L"==k&&"1"==n?l[m]="L":f.test(n)&&(k=n);for(m=0;m<c;++m)if(e.test(l[m])){for(k=m+1;k<c&&
|
187
|
+
e.test(l[k]);++k);n="L"==(k<c-1?l[k]:"L");o="L"==(m?l[m-1]:"L")||n?"L":"R";for(n=m;n<k;++n)l[n]=o;m=k-1}for(var k=[],q,m=0;m<c;)if(g.test(l[m])){n=m;for(++m;m<c&&g.test(l[m]);++m);k.push({from:n,to:m,level:0})}else{var p=m,o=k.length;for(++m;m<c&&"L"!=l[m];++m);for(n=p;n<m;)if(h.test(l[n])){p<n&&k.splice(o,0,{from:p,to:n,level:1});p=n;for(++n;n<m&&h.test(l[n]);++n);k.splice(o,0,{from:p,to:n,level:2});p=n}else++n;p<m&&k.splice(o,0,{from:p,to:m,level:1})}if(1==k[0].level&&(q=b.match(/^\s+/)))k[0].from=
|
188
|
+
q[0].length,k.unshift({from:0,to:q[0].length,level:0});if(1==C(k).level&&(q=b.match(/\s+$/)))C(k).to-=q[0].length,k.push({from:c-q[0].length,to:c,level:0});k[0].level!=C(k).level&&k.push({from:c,to:c,level:k[0].level});return k}}();k.version="3.1";return k}();
|