|
|
/*This file is part of Ext JS 3.4
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
GNU General Public License UsageThis file may be used under the terms of the GNU General Public License version 3.0 aspublished by the Free Software Foundation and appearing in the file LICENSE included in thepackaging of this file.
Please review the following information to ensure the GNU General Public License version 3.0requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you are unsure which license is appropriate for your use, please contact the sales departmentat http://www.sencha.com/contact.
Build date: 2013-04-03 15:07:25*/var CodeMirror=(function(){function v(aN,aK){var b2={},bk=v.defaults;for(var aA in bk){if(bk.hasOwnProperty(aA)){b2[aA]=(aK&&aK.hasOwnProperty(aA)?aK:bk)[aA]}}var aE=document.createElement("div");aE.className="CodeMirror"+(b2.lineWrapping?" CodeMirror-wrap":"");aE.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor"> </pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>';if(aN.appendChild){aN.appendChild(aE)}else{aN(aE)}var bY=aE.firstChild,bn=bY.firstChild,bl=aE.lastChild,bN=bl.firstChild,ch=bN.firstChild,aI=ch.firstChild,aZ=aI.firstChild,bv=aI.nextSibling.firstChild,aw=bv.firstChild,bd=aw.nextSibling,bh=bd.nextSibling,ar=bh.nextSibling;cE();if(t){bn.style.width="0px"}if(!f){bv.draggable=true}bv.style.outline="none";if(b2.tabindex!=null){bn.tabIndex=b2.tabindex}if(b2.autofocus){bA()}if(!b2.gutter&&!b2.lineNumbers){aI.style.display="none"}if(m){bY.style.height="1px",bY.style.position="absolute"}try{cu("x")}catch(b9){if(b9.message.match(/runtime/i)){b9=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")}throw b9}var b8=new A(),ax=new A(),cQ;var cc,cz=new i([new ai([new e("")])]),ci,ck;bU();var cX={from:{line:0,ch:0},to:{line:0,ch:0},inverted:false};var cj,br,a0,bG=0,bc,co=false,ct=false;var cq,b7,aC,cO,aQ,bg,aT,cB;var be=0,cR=0,bM=0,bO=0;var b5;var bE="",aG;var aq={};at(function(){aX(b2.value||"");cq=false})();var a9=new k();s(bl,"mousedown",at(cl));s(bl,"dblclick",at(bX));s(bv,"selectstart",U);if(!O){s(bl,"contextmenu",a2)}s(bl,"scroll",function(){bG=bl.scrollTop;ce([]);if(b2.fixedGutter){aI.style.left=bl.scrollLeft+"px"}if(b2.onScroll){b2.onScroll(ca)}});s(window,"resize",function(){ce(true)});s(bn,"keyup",at(cm));s(bn,"input",aR);s(bn,"keydown",at(cd));s(bn,"keypress",at(bo));s(bn,"focus",cV);s(bn,"blur",aF);if(b2.dragDrop){s(bv,"dragstart",aJ);function bD(c0){if(b2.onDragEvent&&b2.onDragEvent(ca,P(c0))){return}x(c0)}s(bl,"dragenter",bD);s(bl,"dragover",bD);s(bl,"drop",at(ao))}s(bl,"paste",function(){bA();aR()});s(bn,"paste",aR);s(bn,"cut",at(function(){if(!b2.readOnly){bt("")}}));if(m){s(bN,"mouseup",function(){if(document.activeElement==bn){bn.blur()}bA()})}var cx;try{cx=(document.activeElement==bn)}catch(b9){}if(cx||b2.autofocus){setTimeout(cV,20)}else{aF()}function bs(c0){return c0>=0&&c0<cz.size}var ca=aE.CodeMirror={getValue:b3,setValue:at(aX),getSelection:b4,replaceSelection:at(bt),focus:function(){window.focus();bA();cV();aR()},setOption:function(c1,c2){var c0=b2[c1];b2[c1]=c2;if(c1=="mode"||c1=="indentUnit"){bU()}else{if(c1=="readOnly"&&c2=="nocursor"){aF();bn.blur()}else{if(c1=="readOnly"&&!c2){cD(true)}else{if(c1=="theme"){cE()}else{if(c1=="lineWrapping"&&c0!=c2){at(cH)()}else{if(c1=="tabSize"){ce(true)}}}}}}if(c1=="lineNumbers"||c1=="gutter"||c1=="firstLineNumber"||c1=="theme"){bf();ce(true)}},getOption:function(c0){return b2[c0]},undo:at(cU),redo:at(cK),indentLine:at(function(c1,c0){if(typeof c0!="string"){if(c0==null){c0=b2.smartIndent?"smart":"prev"}else{c0=c0?"add":"subtract"}}if(bs(c1)){bz(c1,c0)}}),indentSelection:at(cC),historySize:function(){return{undo:a9.done.length,redo:a9.undone.length}},clearHistory:function(){a9=new k()},matchBrackets:at(function(){cf(true)}),getTokenAt:at(function(c0){c0=aU(c0);return cG(c0.line).getTokenAt(cc,cv(c0.line),c0.ch)}),getStateAfter:function(c0){c0=b0(c0==null?cz.size-1:c0);return cv(c0+1)},cursorCoords:function(c1,c0){if(c1==null){c1=cX.inverted}return this.charCoords(c1?cX.from:cX.to,c0)},charCoords:func
|