From 02f99fa1610576a0b882f4f58f0d3f58c6a210db Mon Sep 17 00:00:00 2001 From: nyatla Date: Mon, 15 Apr 2013 13:46:21 +0000 Subject: [PATCH] git-svn-id: http://svn.osdn.jp/svnroot/mimic/trunk@213 47198e57-cb75-475f-84c4-a814cd6f29e0 --- misc/html.mbed/MiMicILAsm.js | 354 ------------------------ misc/html.mbed/MiMicILEditor.html | 24 +- misc/html.mbed/MiMicJSEditor.html | 21 +- misc/html.mbed/{codemirror => c}/LICENSE | 0 misc/html.mbed/c/codemirror-mini.css | 1 + misc/html.mbed/c/codemirror-mini.js | 1 + misc/html.mbed/{codemirror => c}/codemirror.css | 0 misc/html.mbed/{codemirror => c}/codemirror.js | 0 misc/html.mbed/c/css-mini.js | 1 + misc/html.mbed/c/htmlmixed-mini.js | 1 + misc/html.mbed/c/javascript-mini.js | 1 + misc/html.mbed/c/xml-mini.js | 1 + misc/html.mbed/index.html | 2 +- misc/html.mbed/m/LPC1769.All-mini.js | 1 + misc/html.mbed/m/LPCX17xx_h-mini.js | 1 + misc/html.mbed/m/LPCXPresso1769.All-mini.js | 1 + misc/html.mbed/m/MbedM3.All-mini.js | 1 + misc/html.mbed/m/MiMicCore-mini.js | 1 + misc/html.mbed/m/MiMicILAsm-mini.js | 1 + misc/html.mbed/memDump.html | 290 +++++++++++++++++-- misc/html.mbed/setup.html | 31 ++- misc/html.mbed/slib.js | 4 +- 22 files changed, 329 insertions(+), 409 deletions(-) delete mode 100644 misc/html.mbed/MiMicILAsm.js rename misc/html.mbed/{codemirror => c}/LICENSE (100%) create mode 100644 misc/html.mbed/c/codemirror-mini.css create mode 100644 misc/html.mbed/c/codemirror-mini.js rename misc/html.mbed/{codemirror => c}/codemirror.css (100%) rename misc/html.mbed/{codemirror => c}/codemirror.js (100%) create mode 100644 misc/html.mbed/c/css-mini.js create mode 100644 misc/html.mbed/c/htmlmixed-mini.js create mode 100644 misc/html.mbed/c/javascript-mini.js create mode 100644 misc/html.mbed/c/xml-mini.js create mode 100644 misc/html.mbed/m/LPC1769.All-mini.js create mode 100644 misc/html.mbed/m/LPCX17xx_h-mini.js create mode 100644 misc/html.mbed/m/LPCXPresso1769.All-mini.js create mode 100644 misc/html.mbed/m/MbedM3.All-mini.js create mode 100644 misc/html.mbed/m/MiMicCore-mini.js create mode 100644 misc/html.mbed/m/MiMicILAsm-mini.js diff --git a/misc/html.mbed/MiMicILAsm.js b/misc/html.mbed/MiMicILAsm.js deleted file mode 100644 index 417f828..0000000 --- a/misc/html.mbed/MiMicILAsm.js +++ /dev/null @@ -1,354 +0,0 @@ - -function strtrim(s){return s.replace(/^\s+|\s+$/g, "")} - - -/** - * MiMicILAsm - MiMicILテキストから、MiMicBCを生成します。 - @param i_def - 定数値を格納した連想配列です。 - */ -function MiMicILAsm(i_def) -{ - this._def=i_def; -} -MiMicILAsm.prototype= -{ - version:"MiMicILAsm/1.1.0", - _exception:new Object(), - _def:undefined, - OPR_WM :0x0001, - OPR_INT :0x0002, - OPRSET_NONE :0x0101, - OPRSET_WM :0x0102, - OPRSET_INT :0x0103, - OPRSET_WM_WM :0x0104, - OPRSET_WM_INT :0x0105, - - _log:new String(), - /* - * MiMicILのニーモニックを記述したテキストデータをアセンブルします。 - * - */ - assemble:function(i_asm) - { - var is_error=false; - var ret=new String(); - this._log=new String(); - var lines=i_asm.replace(/\r/g,"\n").split("\n"); - for(var i=0;i0){ - var bc=this._line2bc(i,l); - //エラーが無いときだけ - if(ret==null || bc==null){ - ret=null; - }else{ - ret=ret.concat(this._line2bc(i,l)); - } - } - } - return ret; - }, - getErrors:function(){return this._log;}, - - //インストラクションをバイトコードへ変換する。 - //i_ist:トリミング済のインストラクションライン - _line2bc:function(i_ln,i_ist) - { - var _t=this; - //ログの追記 - function logMsg(i_level,i_str) - { - _t._log+="["+i_level+"] Line("+i_ln+")"+i_str+"\r\n"; - } - //桁数を指定してHEXを出力 - function hexout(i_val,i_digit) - { - var s=(i_val>>>0).toString(16).toLowerCase(); - if(s.length>i_digit){ - logMsg("ERROR","Range Error. value="+i_val+" digit="+i_digit); - throw _t._exception; - } - while(s.length - - + + - - - + + + - + + + + + - - - - - diff --git a/misc/html.mbed/codemirror/LICENSE b/misc/html.mbed/c/LICENSE similarity index 100% rename from misc/html.mbed/codemirror/LICENSE rename to misc/html.mbed/c/LICENSE diff --git a/misc/html.mbed/c/codemirror-mini.css b/misc/html.mbed/c/codemirror-mini.css new file mode 100644 index 0000000..bd1f5b9 --- /dev/null +++ b/misc/html.mbed/c/codemirror-mini.css @@ -0,0 +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:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid black;z-index:3}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7;z-index:1}.cm-tab{display:inline-block}.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:black}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-property{color:black}.cm-s-default .cm-operator{color:black}.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:#f00}.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-link{text-decoration:underline}.cm-invalidchar{color:#f00}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:white;color:black}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;padding-right:30px;height:100%;outline:0;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%;padding-bottom:30px;margin-bottom:-32px;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;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:0;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}} \ No newline at end of file diff --git a/misc/html.mbed/c/codemirror-mini.js b/misc/html.mbed/c/codemirror-mini.js new file mode 100644 index 0000000..ee4f8da --- /dev/null +++ b/misc/html.mbed/c/codemirror-mini.js @@ -0,0 +1 @@ +window.CodeMirror=(function(){var bw=/gecko\/\d/i.test(navigator.userAgent);var cl=/MSIE \d/.test(navigator.userAgent);var bt=cl&&(document.documentMode==null||document.documentMode<8);var bs=cl&&(document.documentMode==null||document.documentMode<9);var bU=/WebKit\//.test(navigator.userAgent);var co=bU&&/Qt\/\d+\.\d+/.test(navigator.userAgent);var b2=/Chrome\//.test(navigator.userAgent);var dE=/Opera\//.test(navigator.userAgent);var ac=/Apple Computer/.test(navigator.vendor);var ay=/KHTML\//.test(navigator.userAgent);var bF=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent);var bZ=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);var dB=/PhantomJS/.test(navigator.userAgent);var df=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent);var cG=df||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);var bf=df||/Mac/.test(navigator.platform);var aj=/windows/i.test(navigator.platform);var cS=dE&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);if(cS){cS=Number(cS[1])}var a5=bf&&(co||dE&&(cS==null||cS<12.11));var bJ=bw||(cl&&!bs);var dZ=false,av=false;function z(d4,d5){if(!(this instanceof z)){return new z(d4,d5)}this.options=d5=d5||{};for(var d6 in dg){if(!d5.hasOwnProperty(d6)&&dg.hasOwnProperty(d6)){d5[d6]=dg[d6]}}bn(d5);var ea=typeof d5.value=="string"?0:d5.value.first;var d9=this.display=f(d4,ea);d9.wrapper.CodeMirror=this;cC(this);if(d5.autofocus&&!cG){cV(this)}this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,focused:false,suppressEdits:false,pasteIncoming:false,draggingText:false,highlight:new d3()};bO(this);if(d5.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}var d8=d5.value;if(typeof d8=="string"){d8=new W(d5.value,d5.mode)}bV(this,cB)(this,d8);if(cl){setTimeout(bA(dx,this,true),20)}dQ(this);var eb;try{eb=(document.activeElement==d9.input)}catch(d7){}if(eb||(d5.autofocus&&!cG)){setTimeout(bA(bE,this),20)}else{an(this)}bV(this,function(){for(var ed in aB){if(aB.propertyIsEnumerable(ed)){aB[ed](this,d5[ed],bl)}}for(var ec=0;ecd6.maxLineLength){d6.maxLineLength=d7;d6.maxLine=d8}})}function bn(d4){var d6=false;for(var d5=0;d5d9.scroller.clientWidth;var d5=d7>d9.scroller.clientHeight;if(d5){d9.scrollbarV.style.display="block";d9.scrollbarV.style.bottom=d8?i(d9.measure)+"px":"0";d9.scrollbarV.firstChild.style.height=(d7-d9.scroller.clientHeight+d9.scrollbarV.clientHeight)+"px"}else{d9.scrollbarV.style.display=""}if(d8){d9.scrollbarH.style.display="block";d9.scrollbarH.style.right=d5?i(d9.measure)+"px":"0";d9.scrollbarH.firstChild.style.width=(d9.scroller.scrollWidth-d9.scroller.clientWidth+d9.scrollbarH.clientWidth)+"px"}else{d9.scrollbarH.style.display=""}if(d8&&d5){d9.scrollbarFiller.style.display="block";d9.scrollbarFiller.style.height=d9.scrollbarFiller.style.width=i(d9.measure)+"px"}else{d9.scrollbarFiller.style.display=""}if(bF&&i(d9.measure)===0){d9.scrollbarV.style.minWidth=d9.scrollbarH.style.minHeight=bZ?"18px":"12px"}}function be(d9,d8,d7){var d6=d9.scroller.scrollTop,d4=d9.wrapper.clientHeight;if(typeof d7=="number"){d6=d7}else{if(d7){d6=d7.top;d4=d7.bottom-d7.top}}d6=Math.floor(d6-di(d9));var d5=Math.ceil(d6+d4);return{from:aX(d8,d6),to:aX(d8,d5)}}function cZ(d4){var ea=d4.display;if(!ea.alignWidgets&&(!ea.gutters.firstChild||!d4.options.fixedGutter)){return}var d7=cu(ea)-ea.scroller.scrollLeft+d4.doc.scrollLeft;var d9=ea.gutters.offsetWidth,d6=d7+"px";for(var eb=ea.lineDiv.firstChild;eb;eb=eb.nextSibling){if(eb.alignable){for(var d8=0,d5=eb.alignable;d8em.showingFrom&&d6.tod5&&em.showingTo-d5<20){d5=Math.min(d8,em.showingTo)}if(av){el=a3(t(et,dm(et,el)));while(d5=eo[0].to){eo=[]}else{eo=dw(eo,es)}if(av){for(var en=0;enef.from){ef.to=er}else{eo.splice(en--,1);break}}}}var ei=0;for(var en=0;end5){ef.to=d5}if(ef.from>=ef.to){eo.splice(en--,1)}else{ei+=ef.to-ef.from}}if(ei==d5-el&&el==em.showingFrom&&d5==em.showingTo){h(ea);return}eo.sort(function(ev,eu){return ev.from-eu.from});var eb=document.activeElement;if(ei<(d5-el)*0.7){em.lineDiv.style.display="none"}bu(ea,el,d5,eo,d7);em.lineDiv.style.display="";if(document.activeElement!=eb&&eb.offsetHeight){eb.focus()}var eg=el!=em.showingFrom||d5!=em.showingTo||em.lastSizeC!=em.wrapper.clientHeight;if(eg){em.lastSizeC=em.wrapper.clientHeight}em.showingFrom=el;em.showingTo=d5;cF(ea,100);var d9=em.lineDiv.offsetTop;for(var ek=em.lineDiv.firstChild,eh;ek;ek=ek.nextSibling){if(ek.lineObj){if(bt){var ee=ek.offsetTop+ek.offsetHeight;eh=ee-d9;d9=ee}else{var ec=ai(ek);eh=ec.bottom-ec.top}var ed=ek.lineObj.height-eh;if(eh<2){eh=ap(em)}if(ed>0.001||ed<-0.001){dX(ek.lineObj,eh);var ej=ek.lineObj.widgets;if(ej){for(var en=0;end5){b5(ea,[],d4)}return true}function h(d4){var d5=d4.display.viewOffset=a2(d4,dm(d4.doc,d4.display.showingFrom));d4.display.mover.style.top=d5+"px"}function dw(ed,eb){for(var d8=0,d6=eb.length||0;d8=d9.to){d4.push(d9)}else{if(ea.from>d9.from){d4.push({from:d9.from,to:ea.from})}if(ea.tod7){while(ee.lineObj!=ep){ee=d8(ee)}if(ef&&d5<=d7&&ee.lineNumber){n(ee.lineNumber,cN(ed.options,d7))}ee=ee.nextSibling}else{if(ep.widgets){for(var ek=0,eo=ee,em;eo&&ek<20;++ek,eo=eo.nextSibling){if(eo.lineObj==ep&&/div/i.test(eo.nodeName)){em=eo;break}}}var eh=ae(ed,ep,d7,ec,em);if(eh!=em){d4.insertBefore(eh,ee)}else{while(ee!=em){ee=d8(ee)}ee=ee.nextSibling}eh.lineObj=ep}}++d7});while(ee){ee=d8(ee)}}function ae(d9,ec,ed,eg,d5){var em=cp(d9,ec);var ep=ec.gutterMarkers,en=d9.display,ea;if(!d9.options.lineNumbers&&!ep&&!ec.bgClass&&!ec.wrapClass&&!ec.widgets){return em}if(d5){d5.alignable=null;var eq=true,d6=0;for(var ei=d5.firstChild,eh;ei;ei=eh){eh=ei.nextSibling;if(!/\bCodeMirror-linewidget\b/.test(ei.className)){d5.removeChild(ei)}else{for(var eo=0,d8=true;eo3){ea(ez,ex.top,null,ex.bottom);ez=ei;if(ex.bottom=d4.display.showingTo){return}var d5=+new Date+d4.options.workTime;var d6=bd(d7.mode,ch(d4,d7.frontier));var d9=[],d8;d7.iter(d7.frontier,Math.min(d7.first+d7.size,d4.display.showingTo+500),function(ea){if(d7.frontier>=d4.display.showingFrom){var ec=ea.styles;ea.styles=dH(d4,ea,d6);var ed=!ec||ec.length!=ea.styles.length;for(var eb=0;!ed&&ebd5){cF(d4,d4.options.workDelay);return true}});if(d9.length){bV(d4,function(){for(var ea=0;ead6;--eb){if(eb<=d8.first){return d8.first}var ec=dm(d8,eb-1);if(ec.stateAfter){return eb}var ea=a6(ec.text,null,d9.options.tabSize);if(d7==null||d5>ea){d7=eb-1;d5=ea}}return d7}function ch(d4,d9){var d7=d4.doc,d6=d4.display;if(!d7.mode.startState){return true}var d8=bC(d4,d9),d5=d8>d7.first&&dm(d7,d8-1).stateAfter;if(!d5){d5=bc(d7.mode)}else{d5=bd(d7.mode,d5)}d7.iter(d8,d9,function(ea){cf(d4,ea,d5);var eb=d8==d9-1||d8%5==0||d8>=d6.showingFrom&&d8d7?d8.left:d8.right,top:d8.top,bottom:d8.bottom}}function dh(d4,d5){var d7=d4.display.measureLineCache;for(var d8=0;d8100){var d6=document.createDocumentFragment();var ec=10,ek=ej.childNodes.length;for(var eo=0,ee=Math.ceil(ek/ec);eoef||ed=ef||eh<=eg&&ef>=ed||Math.min(ef,ed)-Math.max(eh,eg)>=(ef-eh)>>1){d4[en]=Math.min(eh,eg);d4[en+1]=Math.max(ef,ed);break}}if(en==d4.length){d4.push(eh,ef)}var ep=ei.right;if(d7.measureRight){ep=ai(d7.measureRight).left}er[eo]={left:ei.left-d5.left,right:ep-d5.left,top:en}}}for(var eo=0,d7;eoee){return ek(ee,d8)}var d7=d8?eg.to:eg.from,ej=d8?eg.from:eg.to;if(d7==ee){if(ei&&eg.level<(ec=eh[ei-1]).level){d4=ek(ec.level%2?ec.from:ec.to-1,true)}else{d4=ek(d8&&eg.from!=eg.to?ee-1:ee)}if(d8==el){eb=d4}else{d9=d4}}else{if(ej==ee){var ec=eiec){return c6(ea.first+ea.size-1,dm(ea,ec).text.length,true)}if(d8<0){d8=0}for(;;){var d6=dm(ea,d5);var ed=bT(eb,d6,d5,d8,d7);var d9=cP(d6);var d4=d9&&d9.find();if(d9&&ed.ch>=d4.from.ch){d5=d4.to.line}else{return ed}}}function bT(ef,d6,ei,eh,eg){var ee=eg-a2(ef,d6);var eb=false,eo=2*ef.display.wrapper.clientWidth;var en=a0(ef,d6);function er(et){var eu=cs(ef,I(ei,et),"line",d6,en);eb=true;if(ee>eu.bottom){return eu.left-eo}else{if(eed5){return c6(ei,d7,ea)}for(;;){if(ek?d7==ep||d7==q(d6,ep,1):d7-ep<=1){var d9=eh-eleh){d7=es;d5=d8;if(ea=eb){d5+=1000}em-=ec}else{ep=es;el=d8;d4=eb;em=ec}}}var af;function ap(d6){if(d6.cachedTextHeight!=null){return d6.cachedTextHeight}if(af==null){af=dU("pre");for(var d5=0;d5<49;++d5){af.appendChild(document.createTextNode("x"));af.appendChild(dU("br"))}af.appendChild(document.createTextNode("x"))}a7(d6.measure,af);var d4=af.offsetHeight/50;if(d4>3){d6.cachedTextHeight=d4}cv(d6.measure);return d4||1}function cj(d7){if(d7.cachedCharWidth!=null){return d7.cachedCharWidth}var d4=dU("span","x");var d6=dU("pre",[d4]);a7(d7.measure,d6);var d5=d4.offsetWidth;if(d5>2){d7.cachedCharWidth=d5}return d5||10}var cz=0;function bK(d4){d4.curOp={changes:[],updateInput:null,userSelChange:null,textChanged:null,selectionChanged:false,updateMaxLine:false,updateScrollPos:false,id:++cz};if(!bz++){aK=[]}}function T(eg){var eb=eg.curOp,ef=eg.doc,ec=eg.display;eg.curOp=null;if(eb.updateMaxLine){dW(eg)}if(ec.maxLineChanged&&!eg.options.lineWrapping){var d5=c0(eg,ec.maxLine);ec.sizer.style.minWidth=Math.max(0,d5+3+aF)+"px";ec.maxLineChanged=false;var ed=Math.max(0,ec.sizer.offsetLeft+ec.sizer.offsetWidth-ec.scroller.clientWidth);if(ed1000||ef.indexOf("\n")>-1){ea.value=ee.display.prevInput=""}else{ee.display.prevInput=ef}if(d6){T(ee)}ee.state.pasteIncoming=false;return true}function dx(d4,d6){var d5,d7,d8=d4.doc;if(!dL(d8.sel.from,d8.sel.to)){d4.display.prevInput="";d5=b1&&(d8.sel.to.line-d8.sel.from.line>100||(d7=d4.getSelection()).length>1000);if(d5){d4.display.input.value="-"}else{d4.display.input.value=d7||d4.getSelection()}if(d4.state.focused){cn(d4.display.input)}}else{if(d6){d4.display.prevInput=d4.display.input.value=""}}d4.display.inaccurateSelection=d5}function cV(d4){if(d4.options.readOnly!="nocursor"&&(!cG||document.activeElement!=d4.display.input)){d4.display.input.focus()}}function P(d4){return d4.options.readOnly||d4.doc.cantEdit}function dQ(d4){var d9=d4.display;ba(d9.scroller,"mousedown",bV(d4,cO));ba(d9.scroller,"dblclick",bV(d4,bH));ba(d9.lineSpace,"selectstart",function(eb){if(!ax(d9,eb)){bH(eb)}});if(!bJ){ba(d9.scroller,"contextmenu",function(eb){Z(d4,eb)})}ba(d9.scroller,"scroll",function(){if(d9.scroller.clientHeight){D(d4,d9.scroller.scrollTop);aV(d4,d9.scroller.scrollLeft,true);ad(d4,"scroll",d4)}});ba(d9.scrollbarV,"scroll",function(){if(d9.scroller.clientHeight){D(d4,d9.scrollbarV.scrollTop)}});ba(d9.scrollbarH,"scroll",function(){if(d9.scroller.clientHeight){aV(d4,d9.scrollbarH.scrollLeft)}});ba(d9.scroller,"mousewheel",function(eb){b(d4,eb)});ba(d9.scroller,"DOMMouseScroll",function(eb){b(d4,eb)});function ea(){if(d4.state.focused){setTimeout(bA(cV,d4),0)}}ba(d9.scrollbarH,"mousedown",ea);ba(d9.scrollbarV,"mousedown",ea);ba(d9.wrapper,"scroll",function(){d9.wrapper.scrollTop=d9.wrapper.scrollLeft=0});function d7(){d9.cachedCharWidth=d9.cachedTextHeight=null;Q(d4);bN(d4,bA(N,d4))}ba(window,"resize",d7);function d6(){for(var eb=d9.wrapper.parentNode;eb&&eb!=document.body;eb=eb.parentNode){}if(eb){setTimeout(d6,5000)}else{cE(window,"resize",d7)}}setTimeout(d6,5000);ba(d9.input,"keyup",bV(d4,function(eb){if(d4.options.onKeyEvent&&d4.options.onKeyEvent(d4,U(eb))){return}if(eb.keyCode==16){d4.doc.sel.shift=false}}));ba(d9.input,"input",bA(u,d4));ba(d9.input,"keydown",bV(d4,m));ba(d9.input,"keypress",bV(d4,bB));ba(d9.input,"focus",bA(bE,d4));ba(d9.input,"blur",bA(an,d4));function d5(eb){if(d4.options.onDragEvent&&d4.options.onDragEvent(d4,U(eb))){return}cM(eb)}if(d4.options.dragDrop){ba(d9.scroller,"dragstart",function(eb){G(d4,eb)});ba(d9.scroller,"dragenter",d5);ba(d9.scroller,"dragover",d5);ba(d9.scroller,"drop",bV(d4,aE))}ba(d9.scroller,"paste",function(eb){if(ax(d9,eb)){return}cV(d4);u(d4)});ba(d9.input,"paste",function(){d4.state.pasteIncoming=true;u(d4)});function d8(){if(d9.inaccurateSelection){d9.prevInput="";d9.inaccurateSelection=false;d9.input.value=d4.getSelection();cn(d9.input)}}ba(d9.input,"cut",d8);ba(d9.input,"copy",d8);if(ay){ba(d9.sizer,"mouseup",function(){if(document.activeElement==d9.input){d9.input.blur()}cV(d4)})}}function ax(d5,d4){for(var d6=B(d4);d6!=d5.wrapper;d6=d6.parentNode){if(!d6){return true}if(/\bCodeMirror-(?:line)?widget\b/.test(d6.className)||d6.parentNode==d5.sizer&&d6!=d5.mover){return true}}}function bv(d5,ea,d7){var d9=d5.display;if(!d7){var d8=B(ea);if(d8==d9.scrollbarH||d8==d9.scrollbarH.firstChild||d8==d9.scrollbarV||d8==d9.scrollbarV.firstChild||d8==d9.scrollbarFiller){return null}}var d4,eb,d6=ai(d9.lineSpace);try{d4=ea.clientX;eb=ea.clientY}catch(ea){return null}return dP(d5,d4-d6.left,eb-d6.top)}var b8,b3;function cO(el){var d7=this,eg=d7.display,en=d7.doc,ef=en.sel;ef.shift=el.shiftKey;if(ax(eg,el)){if(!bU){eg.scroller.draggable=false;setTimeout(function(){eg.scroller.draggable=true},100)}return}if(k(d7,el)){return}var d6=bv(d7,el);switch(dO(el)){case 3:if(bJ){Z.call(d7,d7,el)}return;case 2:if(d6){dS(d7.doc,d6)}setTimeout(bA(cV,d7),20);bH(el);return}if(!d6){if(B(el)==eg.scroller){bH(el)}return}if(!d7.state.focused){bE(d7)}var d4=+new Date,d5="single";if(b3&&b3.time>d4-400&&dL(b3.pos,d6)){d5="triple";bH(el);setTimeout(bA(cV,d7),20);aH(d7,d6.line)}else{if(b8&&b8.time>d4-400&&dL(b8.pos,d6)){d5="double";b3={time:d4,pos:d6};bH(el);var ei=X(dm(en,d6.line).text,d6);dS(d7.doc,ei.from,ei.to)}else{b8={time:d4,pos:d6}}}var d8=d6;if(d7.options.dragDrop&&c5&&!P(d7)&&!dL(ef.from,ef.to)&&!dn(d6,ef.from)&&!dn(ef.to,d6)&&d5=="single"){var eh=bV(d7,function(eo){if(bU){eg.scroller.draggable=false}d7.state.draggingText=false;cE(document,"mouseup",eh);cE(eg.scroller,"drop",eh);if(Math.abs(el.clientX-eo.clientX)+Math.abs(el.clientY-eo.clientY)<10){bH(eo);dS(d7.doc,d6);cV(d7)}});if(bU){eg.scroller.draggable=true}d7.state.draggingText=eh;if(eg.scroller.dragDrop){eg.scroller.dragDrop()}ba(document,"mouseup",eh);ba(eg.scroller,"drop",eh);return}bH(el);if(d5=="single"){dS(d7.doc,dM(en,d6))}var em=ef.from,ec=ef.to;function ej(ep){if(d5=="single"){dS(d7.doc,dM(en,d6),ep);return}em=dM(en,em);ec=dM(en,ec);if(d5=="double"){var eo=X(dm(en,ep.line).text,ep);if(dn(ep,em)){dS(d7.doc,eo.from,ec)}else{dS(d7.doc,em,eo.to)}}else{if(d5=="triple"){if(dn(ep,em)){dS(d7.doc,ec,dM(en,I(ep.line,0)))}else{dS(d7.doc,em,dM(en,I(ep.line+1,0)))}}}}var ed=ai(eg.wrapper);var d9=0;function ek(eq){var eo=++d9;var es=bv(d7,eq,true);if(!es){return}if(!dL(es,d8)){if(!d7.state.focused){bE(d7)}d8=es;ej(es);var er=be(eg,en);if(es.line>=er.to||es.lineed.bottom?20:0;if(ep){setTimeout(bV(d7,function(){if(d9!=eo){return}eg.scroller.scrollTop+=ep;ek(eq)}),50)}}}function eb(eo){d9=Infinity;var ep=bv(d7,eo);if(ep){ej(ep)}bH(eo);cV(d7);cE(document,"mousemove",ee);cE(document,"mouseup",ea)}var ee=bV(d7,function(eo){if(!cl&&!dO(eo)){eb(eo)}else{ek(eo)}});var ea=bV(d7,eb);ba(document,"mousemove",ee);ba(document,"mouseup",ea)}function aE(ea){var ec=this;if(ax(ec.display,ea)||(ec.options.onDragEvent&&ec.options.onDragEvent(ec,U(ea)))){return}bH(ea);var eb=bv(ec,ea,true),d4=ea.dataTransfer.files;if(!eb||P(ec)){return}if(d4&&d4.length&&window.FileReader&&window.File){var d6=d4.length,ee=Array(d6),d5=0;var d7=function(eh,eg){var ef=new FileReader;ef.onload=function(){ee[eg]=ef.result;if(++d5==d6){eb=dM(ec.doc,eb);aC(ec.doc,{from:eb,to:eb,text:ar(ee.join("\n")),origin:"paste"},"around")}};ef.readAsText(eh)};for(var d8=0;d8=Math.floor(ai(eb.gutters).right)){return false}bH(ea);if(!dt(ec,"gutterClick")){return true}var d9=ai(eb.lineDiv);if(d4>d9.bottom){return true}d4-=d9.top-eb.viewOffset;for(var d7=0;d7=d5){var ed=aX(ec.doc,d4);var d6=ec.options.gutters[d7];M(ec,"gutterClick",ec,ed,d6,ea);break}}return true}function G(d5,d7){if(ax(d5.display,d7)){return}var d4=d5.getSelection();d7.dataTransfer.setData("Text",d4);if(d7.dataTransfer.setDragImage){var d6=dU("img",null,null,"position: fixed; left: 0; top: 0;");if(dE){d6.width=d6.height=1;d5.display.wrapper.appendChild(d6);d6._top=d6.offsetTop}if(ac){if(d5.display.dragImg){d6=d5.display.dragImg}else{d5.display.dragImg=d6;d6.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";d5.display.wrapper.appendChild(d6)}}d7.dataTransfer.setDragImage(d6,0,0);if(dE){d6.parentNode.removeChild(d6)}}}function D(d4,d5){if(Math.abs(d4.doc.scrollTop-d5)<2){return}d4.doc.scrollTop=d5;if(!bw){cm(d4,[],d5)}if(d4.display.scroller.scrollTop!=d5){d4.display.scroller.scrollTop=d5}if(d4.display.scrollbarV.scrollTop!=d5){d4.display.scrollbarV.scrollTop=d5}if(bw){cm(d4,[])}}function aV(d4,d6,d5){if(d5?d6==d4.doc.scrollLeft:Math.abs(d4.doc.scrollLeft-d6)<2){return}d6=Math.min(d6,d4.display.scroller.scrollWidth-d4.display.scroller.clientWidth);d4.doc.scrollLeft=d6;cZ(d4);if(d4.display.scroller.scrollLeft!=d6){d4.display.scroller.scrollLeft=d6}if(d4.display.scrollbarH.scrollLeft!=d6){d4.display.scrollbarH.scrollLeft=d6}}var du=0,bo=null;if(cl){bo=-0.53}else{if(bw){bo=15}else{if(b2){bo=-0.7}else{if(ac){bo=-1/3}}}}function b(ea,d5){var ed=d5.wheelDeltaX,ec=d5.wheelDeltaY;if(ed==null&&d5.detail&&d5.axis==d5.HORIZONTAL_AXIS){ed=d5.detail}if(ec==null&&d5.detail&&d5.axis==d5.VERTICAL_AXIS){ec=d5.detail}else{if(ec==null){ec=d5.wheelDelta}}if(ec&&bf&&bU){for(var eb=d5.target;eb!=d9;eb=eb.parentNode){if(eb.lineObj){ea.display.currentWheelTarget=eb;break}}}var d7=ea.display,d9=d7.scroller;if(ed&&!bw&&!dE&&bo!=null){if(ec){D(ea,Math.max(0,Math.min(d9.scrollTop+ec*bo,d9.scrollHeight-d9.clientHeight)))}aV(ea,Math.max(0,Math.min(d9.scrollLeft+ed*bo,d9.scrollWidth-d9.clientWidth)));bH(d5);d7.wheelStartX=null;return}if(ec&&bo!=null){var d4=ec*bo;var d8=ea.doc.scrollTop,d6=d8+d7.wrapper.clientHeight;if(d4<0){d8=Math.max(0,d8+d4-50)}else{d6=Math.min(ea.doc.height,d6+d4+50)}cm(ea,[],{top:d8,bottom:d6})}if(du<20){if(d7.wheelStartX==null){d7.wheelStartX=d9.scrollLeft;d7.wheelStartY=d9.scrollTop;d7.wheelDX=ed;d7.wheelDY=ec;setTimeout(function(){if(d7.wheelStartX==null){return}var ee=d9.scrollLeft-d7.wheelStartX;var eg=d9.scrollTop-d7.wheelStartY;var ef=(eg&&d7.wheelDY&&eg/d7.wheelDY)||(ee&&d7.wheelDX&&ee/d7.wheelDX);d7.wheelStartX=d7.wheelStartY=null;if(!ef){return}bo=(bo*du+ef)/(du+1);++du},200)}else{d7.wheelDX+=ed;d7.wheelDY+=ec}}}function dR(d5,d8,d4){if(typeof d8=="string"){d8=cX[d8];if(!d8){return false}}if(d5.display.pollingFast&&bp(d5)){d5.display.pollingFast=false}var d9=d5.doc,d7=d9.sel.shift,d6=false;try{if(P(d5)){d5.state.suppressEdits=true}if(d4){d9.sel.shift=false}d6=d8(d5)!=bk}finally{d9.sel.shift=d7;d5.state.suppressEdits=false}return d6}function cc(d4){var d5=d4.state.keyMaps.slice(0);if(d4.options.extraKeys){d5.push(d4.options.extraKeys)}d5.push(d4.options.keyMap);return d5}var V;function dr(d4,ea){var d5=dT(d4.options.keyMap),d8=d5.auto;clearTimeout(V);if(d8&&!cW(ea)){V=setTimeout(function(){if(dT(d4.options.keyMap)==d5){d4.options.keyMap=(d8.call?d8.call(null,d4):d8)}},50)}var d7=dz(ea,true),d9=false;if(!d7){return false}var d6=cc(d4);if(ea.shiftKey){d9=g("Shift-"+d7,d6,function(eb){return dR(d4,eb,true)})||g(d7,d6,function(eb){if(typeof eb=="string"&&/^go[A-Z]/.test(eb)){return dR(d4,eb)}})}else{d9=g(d7,d6,function(eb){return dR(d4,eb)})}if(d9=="stop"){d9=false}if(d9){bH(ea);l(d4);if(bs){ea.oldKeyCode=ea.keyCode;ea.keyCode=0}}return d9}function cI(d4,d7,d5){var d6=g("'"+d5+"'",cc(d4),function(d8){return dR(d4,d8,true)});if(d6){bH(d7);l(d4)}return d6}var b7=null;function m(d7){var d4=this;if(!d4.state.focused){bE(d4)}if(cl&&d7.keyCode==27){d7.returnValue=false}if(d4.options.onKeyEvent&&d4.options.onKeyEvent(d4,U(d7))){return}var d5=d7.keyCode;d4.doc.sel.shift=d5==16||d7.shiftKey;var d6=dr(d4,d7);if(dE){b7=d6?d5:null;if(!d6&&d5==88&&!b1&&(bf?d7.metaKey:d7.ctrlKey)){d4.replaceSelection("")}}}function bB(d8){var d4=this;if(d4.options.onKeyEvent&&d4.options.onKeyEvent(d4,U(d8))){return}var d7=d8.keyCode,d5=d8.charCode;if(dE&&d7==b7){b7=null;bH(d8);return}if(((dE&&(!d8.which||d8.which<10))||ay)&&dr(d4,d8)){return}var d6=String.fromCharCode(d5==null?d7:d5);if(this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!P(this)&&this.doc.mode.electricChars.indexOf(d6)>-1){setTimeout(bV(d4,function(){L(d4,d4.doc.sel.to.line,"smart")}),75)}if(cI(d4,d8,d6)){return}u(d4)}function bE(d4){if(d4.options.readOnly=="nocursor"){return}if(!d4.state.focused){ad(d4,"focus",d4);d4.state.focused=true;if(d4.display.wrapper.className.search(/\bCodeMirror-focused\b/)==-1){d4.display.wrapper.className+=" CodeMirror-focused"}dx(d4,true)}aJ(d4);l(d4)}function an(d4){if(d4.state.focused){ad(d4,"blur",d4);d4.state.focused=false;d4.display.wrapper.className=d4.display.wrapper.className.replace(" CodeMirror-focused","")}clearInterval(d4.display.blinker);setTimeout(function(){if(!d4.state.focused){d4.doc.sel.shift=false}},150)}var dI;function Z(ec,d7){var d9=ec.display,d5=ec.doc.sel;if(ax(d9,d7)){return}var eb=bv(ec,d7),d4=d9.scroller.scrollTop;if(!eb||dE){return}if(dL(d5.from,d5.to)||dn(eb,d5.from)||!dn(eb,d5.to)){bV(ec,a8)(ec.doc,eb,eb)}var d8=d9.input.style.cssText;d9.inputDiv.style.position="absolute";d9.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(d7.clientY-5)+"px; left: "+(d7.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);";cV(ec);dx(ec,true);if(dL(d5.from,d5.to)){d9.input.value=d9.prevInput=" "}function ea(){d9.inputDiv.style.position="relative";d9.input.style.cssText=d8;if(bs){d9.scrollbarV.scrollTop=d9.scroller.scrollTop=d4}aJ(ec);if(d9.input.selectionStart!=null&&(!cl||bs)){clearTimeout(dI);var ee=d9.input.value=" "+(dL(d5.from,d5.to)?"":d9.input.value),ed=0;d9.prevInput=" ";d9.input.selectionStart=1;d9.input.selectionEnd=ee.length;var ef=function(){if(d9.prevInput==" "&&d9.input.selectionStart==0){bV(ec,cX.selectAll)(ec)}else{if(ed++<10){dI=setTimeout(ef,500)}else{dx(ec)}}};dI=setTimeout(ef,200)}}if(bJ){cM(d7);var d6=function(){cE(window,"mouseup",d6);setTimeout(ea,20)};ba(window,"mouseup",d6)}else{setTimeout(ea,50)}}function bR(d4){return I(d4.from.line+d4.text.length-1,dK(d4.text).length+(d4.text.length==1?d4.from.ch:0))}function cY(d8,ea,d9){if(!dn(ea.from,d9)){return dM(d8,d9)}var d7=(ea.text.length-1)-(ea.to.line-ea.from.line);if(d9.line>ea.to.line+d7){var d6=d9.line-d7,d5=d8.first+d8.size-1;if(d6>d5){return I(d5,dm(d8,d5).text.length)}return dA(d9,dm(d8,d6).text.length)}if(d9.line==ea.to.line+d7){return dA(d9,dK(ea.text).length+(ea.text.length==1?ea.from.ch:0)+dm(d8,ea.to.line).text.length-ea.to.ch)}var d4=d9.line-ea.from.line;return dA(d9,ea.text[d4].length+(d4?0:ea.from.ch))}function ds(d5,d8,d6){if(d6&&typeof d6=="object"){return{anchor:cY(d5,d8,d6.anchor),head:cY(d5,d8,d6.head)}}if(d6=="start"){return{anchor:d8.from,head:d8.from}}var d4=bR(d8);if(d6=="around"){return{anchor:d8.from,head:d4}}if(d6=="end"){return{anchor:d4,head:d4}}var d7=function(eb){if(dn(eb,d8.from)){return eb}if(!dn(d8.to,eb)){return d4}var d9=eb.line+d8.text.length-(d8.to.line-d8.from.line)-1,ea=eb.ch;if(eb.line==d8.to.line){ea+=d4.ch-d8.to.ch}return I(d9,ea)};return{anchor:d7(d5.sel.anchor),head:d7(d5.sel.head)}}function cr(d5,d6){var d4={canceled:false,from:d6.from,to:d6.to,text:d6.text,origin:d6.origin,update:function(ea,d9,d8,d7){if(ea){this.from=dM(d5,ea)}if(d9){this.to=dM(d5,d9)}if(d8){this.text=d8}if(d7!==undefined){this.origin=d7}},cancel:function(){this.canceled=true}};ad(d5,"beforeChange",d5,d4);if(d5.cm){ad(d5.cm,"beforeChange",d5.cm,d4)}if(d4.canceled){return null}return{from:d4.from,to:d4.to,text:d4.text,origin:d4.origin}}function aC(d7,d9,d8,d6){if(d7.cm){if(!d7.cm.curOp){return bV(d7.cm,aC)(d7,d9,d8,d6)}if(d7.cm.state.suppressEdits){return}}if(dt(d7,"beforeChange")||d7.cm&&dt(d7.cm,"beforeChange")){d9=cr(d7,d9);if(!d9){return}}var d5=dZ&&!d6&&bI(d7,d9.from,d9.to);if(d5){for(var d4=d5.length-1;d4>=1;--d4){ak(d7,{from:d5[d4].from,to:d5[d4].to,text:[""]})}if(d5.length){ak(d7,{from:d5[0].from,to:d5[0].to,text:d9.text},d8)}}else{ak(d7,d9,d8)}}function ak(d6,d8,d7){var d5=ds(d6,d8,d7);c2(d6,d8,d5,d6.cm?d6.cm.curOp.id:NaN);cD(d6,d8,d5,cJ(d6,d8));var d4=[];cy(d6,function(ea,d9){if(!d9&&b6(d4,ea.history)==-1){ck(ea.history,d8);d4.push(ea.history)}cD(ea,d8,null,cJ(ea,d8))})}function bh(ec,d9){if(ec.cm&&ec.cm.state.suppressEdits){return}var d8=ec.history;var d5=(d9=="undo"?d8.done:d8.undone).pop();if(!d5){return}d8.dirtyCounter+=d9=="undo"?-1:1;var ea={changes:[],anchorBefore:d5.anchorAfter,headBefore:d5.headAfter,anchorAfter:d5.anchorBefore,headAfter:d5.headBefore};(d9=="undo"?d8.undone:d8.done).push(ea);for(var d6=d5.changes.length-1;d6>=0;--d6){var eb=d5.changes[d6];eb.origin=d9;ea.changes.push(cd(ec,eb));var d4=d6?ds(ec,eb,null):{anchor:d5.anchorBefore,head:d5.headBefore};cD(ec,eb,d4,cA(ec,eb));var d7=[];cy(ec,function(ee,ed){if(!ed&&b6(d7,ee.history)==-1){ck(ee.history,eb);d7.push(ee.history)}cD(ee,eb,null,cA(ee,eb))})}}function dv(d4,d6){function d5(d7){return I(d7.line+d6,d7.ch)}d4.first+=d6;if(d4.cm){N(d4.cm,d4.first,d4.first,d6)}d4.sel.head=d5(d4.sel.head);d4.sel.anchor=d5(d4.sel.anchor);d4.sel.from=d5(d4.sel.from);d4.sel.to=d5(d4.sel.to)}function cD(d8,d9,d7,d5){if(d8.cm&&!d8.cm.curOp){return bV(d8.cm,cD)(d8,d9,d7,d5)}if(d9.to.lined8.lastLine()){return}if(d9.from.lined6){d9={from:d9.from,to:I(d6,dm(d8,d6).text.length),text:[d9.text[0]],origin:d9.origin}}d9.removed=dV(d8,d9.from,d9.to);if(!d7){d7=ds(d8,d9,null)}if(d8.cm){ag(d8.cm,d9,d5,d7)}else{dF(d8,d9,d5,d7)}}function ag(ee,ea,d7,d4){var ed=ee.doc,d9=ee.display,eb=ea.from,ec=ea.to;var d5=false,d6=eb.line;if(!ee.options.lineWrapping){d6=a3(t(ed,dm(ed,eb.line)));ed.iter(d6,ec.line+1,function(eh){if(eh==d9.maxLine){d5=true;return true}})}dF(ed,ea,d7,d4,aA(ee));if(!ee.options.lineWrapping){ed.iter(d6,eb.line+ea.text.length,function(ei){var eh=cK(ed,ei);if(eh>d9.maxLineLength){d9.maxLine=ei;d9.maxLineLength=eh;d9.maxLineChanged=true;d5=false}});if(d5){ee.curOp.updateMaxLine=true}}ed.frontier=Math.min(ed.frontier,eb.line);cF(ee,400);var eg=ea.text.length-(ec.line-eb.line)-1;N(ee,eb.line,ec.line+1,eg);if(dt(ee,"change")){var d8={from:eb,to:ec,text:ea.text,removed:ea.removed,origin:ea.origin};if(ee.curOp.textChanged){for(var ef=ee.curOp.textChanged;ef.next;ef=ef.next){}ef.next=d8}else{ee.curOp.textChanged=d8}}}function at(d7,d6,d9,d8,d4){if(!d8){d8=d9}if(dn(d8,d9)){var d5=d8;d8=d9;d9=d5}if(typeof d6=="string"){d6=ar(d6)}aC(d7,{from:d9,to:d8,text:d6,origin:d4},null)}function I(d4,d5){if(!(this instanceof I)){return new I(d4,d5)}this.line=d4;this.ch=d5}z.Pos=I;function dL(d5,d4){return d5.line==d4.line&&d5.ch==d4.ch}function dn(d5,d4){return d5.lined4){return I(d4,dm(d5,d4).text.length)}return dA(d6,dm(d5,d6.line).text.length)}function dA(d6,d5){var d4=d6.ch;if(d4==null||d4>d5){return I(d6.line,d5)}else{if(d4<0){return I(d6.line,0)}else{return d6}}}function bi(d5,d4){return d4>=d5.first&&d4=d6.ch:d4.to>d6.ch))){if(ea){ad(d5,"beforeCursorEnter");if(d5.explicitlyCleared){if(!ef.markedSpans){break}else{--d8;continue}}}if(!d5.atomic){continue}var eb=d5.find()[d7<0?"from":"to"];if(dL(eb,d6)){eb.ch+=d7;if(eb.ch<0){if(eb.line>ed.first){eb=dM(ed,I(eb.line-1))}else{eb=null}}else{if(eb.ch>ef.text.length){if(eb.line(window.innerHeight||document.documentElement.clientHeight)){d4=false}}if(d4!=null&&!dB){var d7=d9.cursor.style.display=="none";if(d7){d9.cursor.style.display="";d9.cursor.style.left=d8.left+"px";d9.cursor.style.top=(d8.top-d9.viewOffset)+"px"}d9.cursor.scrollIntoView(d4);if(d7){d9.cursor.style.display="none"}}}function v(d4,eb,d8){if(d8==null){d8=0}for(;;){var d9=false,d7=cs(d4,eb);var ea=y(d4,d7.left,d7.top-d8,d7.left,d7.bottom+d8);var d5=d4.doc.scrollTop,d6=d4.doc.scrollLeft;if(ea.scrollTop!=null){D(d4,ea.scrollTop);if(Math.abs(d4.doc.scrollTop-d5)>1){d9=true}}if(ea.scrollLeft!=null){aV(d4,ea.scrollLeft);if(Math.abs(d4.doc.scrollLeft-d6)>1){d9=true}}if(!d9){return d7}}}function x(d4,d6,d8,d5,d7){var d9=y(d4,d6,d8,d5,d7);if(d9.scrollTop!=null){D(d4,d9.scrollTop)}if(d9.scrollLeft!=null){aV(d4,d9.scrollLeft)}}function y(ef,d7,ee,d5,ed){var ec=ef.display,ek=di(ec);ee+=ek;ed+=ek;var eh=ec.scroller.clientHeight-aF,d8=ec.scroller.scrollTop,ej={};var d6=ef.doc.height+aZ(ec);var d4=eed6-10;if(eed8+eh){ej.scrollTop=(eb?d6:ed)-eh}}var eg=ec.scroller.clientWidth-aF,ei=ec.scroller.scrollLeft;d7+=ec.gutters.offsetWidth;d5+=ec.gutters.offsetWidth;var ea=ec.gutters.offsetWidth;var d9=d7eg+ei-3){ej.scrollLeft=d5+10-eg}}return ej}function w(d4,d6,d5){d4.curOp.updateScrollPos={scrollLeft:d6,scrollTop:d5}}function bM(d5,d7,d6){var d8=d5.curOp.updateScrollPos||(d5.curOp.updateScrollPos={scrollLeft:d5.doc.scrollLeft,scrollTop:d5.doc.scrollTop});var d4=d5.display.scroller;d8.scrollTop=Math.max(0,Math.min(d4.scrollHeight-d4.clientHeight,d8.scrollTop+d6));d8.scrollLeft=Math.max(0,Math.min(d4.scrollWidth-d4.clientWidth,d8.scrollLeft+d7))}function L(eg,d7,ef,d6){var ee=eg.doc;if(!ef){ef="add"}if(ef=="smart"){if(!eg.doc.mode.indent){ef="prev"}else{var d5=ch(eg,d7)}}var ea=eg.options.tabSize;var eh=dm(ee,d7),d9=a6(eh.text,null,ea);var d4=eh.text.match(/^\s*/)[0],ec;if(ef=="smart"){ec=eg.doc.mode.indent(d5,eh.text.slice(d4.length),eh.text);if(ec==bk){if(!d6){return}ef="prev"}}if(ef=="prev"){if(d7>ee.first){ec=a6(dm(ee,d7-1).text,null,ea)}else{ec=0}}else{if(ef=="add"){ec=d9+eg.options.indentUnit}else{if(ef=="subtract"){ec=d9-eg.options.indentUnit}}}ec=Math.max(0,ec);var ed="",eb=0;if(eg.options.indentWithTabs){for(var d8=Math.floor(ec/ea);d8;--d8){eb+=ea;ed+="\t"}}if(eb=ef.first+ef.size){return(d8=false)}ek=el;return eb=dm(ef,el)}function d9(em){var el=(d6?q:O)(eb,d4,d7,true);if(el==null){if(!em&&d5()){if(d6){d4=(d7<0?bQ:bG)(eb)}else{d4=d7<0?eb.text.length:0}}else{return(d8=false)}}else{d4=el}return true}if(eg=="char"){d9()}else{if(eg=="column"){d9(true)}else{if(eg=="word"||eg=="group"){var ed=null,ei=eg=="group";for(var ea=true;;ea=false){if(d7<0&&!d9(!ea)){break}var eh=eb.text.charAt(d4)||"\n";var ec=bD(eh)?"w":!ei?null:/\s/.test(eh)?null:"p";if(ed&&ed!=ec){if(d7<0){d7=1;d9()}break}if(ec){ed=ec}if(d7>0&&!d9(!ea)){break}}}}}var ej=a9(ef,I(ek,d4),d7,true);if(!d8){ej.hitSide=true}return ej}function aN(ec,d7,d4,eb){var ea=ec.doc,d9=d7.left,d8;if(eb=="page"){var d6=Math.min(ec.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);d8=d7.top+d4*(d6-(d4<0?1.5:0.5)*ap(ec.display))}else{if(eb=="line"){d8=d4>0?d7.bottom+3:d7.top-3}}for(;;){var d5=dP(ec,d9,d8);if(!d5.outside){break}if(d4<0?d8<=0:d8>=ea.height){d5.hitSide=true;break}d8+=d4*5}return d5}function X(d7,d9){var d8=d9.ch,d6=d9.ch;if(d7){if(d9.after===false||d6==d7.length){--d8}else{++d6}var d5=d7.charAt(d8);var d4=bD(d5)?bD:/\s/.test(d5)?function(ea){return/\s/.test(ea)}:function(ea){return !/\s/.test(ea)&&!bD(ea)};while(d8>0&&d4(d7.charAt(d8-1))){--d8}while(d6d4)&&d9.top>d6.offsetHeight){ea=d9.top-d6.offsetHeight}else{if(d9.bottom+d6.offsetHeight<=d4){ea=d9.bottom}}if(d5+d6.offsetWidth>ec){d5=ec-d6.offsetWidth}}}d6.style.top=(ea+di(d8))+"px";d6.style.left=d6.style.right="";if(ed=="right"){d5=d8.sizer.clientWidth-d6.offsetWidth;d6.style.right="0px"}else{if(ed=="left"){d5=0}else{if(ed=="middle"){d5=(d8.sizer.clientWidth-d6.offsetWidth)/2}}d6.style.left=d5+"px"}if(eb){x(this,d5,ea,d5+d6.offsetWidth,ea+d6.offsetHeight)}},triggerOnKeyDown:bV(null,m),execCommand:function(d4){return cX[d4](this)},findPosH:function(ea,d7,d8,d5){var d4=1;if(d7<0){d4=-1;d7=-d7}for(var d6=0,d9=dM(this.doc,ea);d62){d6.dependencies=[];for(var d5=2;d50&&d6.ch=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.posd5},eatSpace:function(){var d4=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>d4},skipToEnd:function(){this.pos=this.string.length},skipTo:function(d4){var d5=this.string.indexOf(d4,this.pos);if(d5>-1){this.pos=d5;return true}},backUp:function(d4){this.pos-=d4},column:function(){if(this.lastColumnPos0){return null}if(d6&&d5!==false){this.pos+=d6[0].length}return d6}},current:function(){return this.string.slice(this.start,this.pos)}};z.StringStream=da;function F(d5,d4){this.lines=[];this.type=d4;this.doc=d5}z.TextMarker=F;F.prototype.clear=function(){if(this.explicitlyCleared){return}var eb=this.doc.cm,d5=eb&&!eb.curOp;if(d5){bK(eb)}var d6=null,d9=null;for(var d7=0;d7eb.display.maxLineLength){eb.display.maxLine=d4;eb.display.maxLineLength=d8;eb.display.maxLineChanged=true}}}if(d6!=null&&eb){N(eb,d6,d9+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.collapsed&&this.doc.cantEdit){this.doc.cantEdit=false;if(eb){cR(eb)}}if(d5){T(eb)}M(this,"clear")};F.prototype.find=function(){var d9,d8;for(var d5=0;d5=d6:ec.to>d6);(eb||(eb=[])).push({from:ec.from,to:d7?null:ec.to,marker:d9})}}}return eb}function ab(d5,d7,ea){if(d5){for(var d8=0,eb;d8=d7:ec.to>d7);if(d6||d9.type=="bookmark"&&ec.from==d7&&(!ea||ec.marker.insertLeft)){var d4=ec.from==null||(d9.inclusiveLeft?ec.from<=d7:ec.from0&&ea){for(var d7=0;d7d7)&&(!d9||d9.width5000){d6=false;ec.pos=Math.min(ed.length,ec.start+50000);d4=null}var d7=ec.current();ec.start=ec.pos;if(!d6||ea!=d4){if(ee){d9(ee,ea)}ee=d7;ea=d4}else{ee=ee+d7}}if(ee){d9(ee,ea)}}function dH(d4,d5,d9){var d7=[d4.state.modeGen];r(d4,d5.text,d4.doc.mode,d9,function(eb,ec){d7.push(eb,ec)});for(var ea=0;ea="\ud800"&&d4<"\udbff"&&d8d8)){if(ek.to!=null&&ep>ek.to){ep=ek.to;eo=""}if(eh.className){d4+=" "+eh.className}if(eh.startStyle&&ek.from==d8){eg+=" "+eh.startStyle}if(eh.endStyle&&ek.to==ep){eo+=" "+eh.endStyle}if(eh.collapsed&&(!d6||d6.marker.widthd8&&ep>ek.from){ep=ek.from}}if(eh.type=="bookmark"&&ek.from==d8&&eh.replacedWith){ed=eh.replacedWith}}if(d6&&(d6.from||0)==d8){K(ei,(d6.to==null?em:d6.to)-d8,d6.from!=null&&d6.marker.replacedWith);if(d6.to==null){return d6.marker.find()}}if(ed&&!d6){K(ei,0,ed)}}if(d8>=em){break}var ee=Math.min(em,ep);while(true){if(ef){var d5=d8+ef.length;if(!d6){var d7=d5>ee?ef.slice(0,ee-d8):ef;ei.addToken(ei,d7,en?en+d4:d4,eg,d8+d7.length==ep?eo:"")}if(d5>=ee){ef=ef.slice(ee-d8);d8=ee;break}d8=d5;eg=""}ef=eb[el++];en=j(eb[el++])}}}function dF(el,ec,d8,eg,ea){function d7(em){return d8?d8[em]:null}function eb(em,eo,en){cL(em,eo,en,ea);M(em,"change",em,ec)}var eh=ec.from,d5=ec.to,ee=ec.text;var ed=dm(el,eh.line),d4=dm(el,d5.line);var d6=dK(ee),ej=d7(ee.length-1),ef=d5.line-eh.line;if(eh.ch==0&&d5.ch==0&&d6==""){for(var ei=0,ek=ee.length-1,d9=[];ei1){el.remove(eh.line+1,ef-1)}el.insert(eh.line+1,d9)}}}M(el,"change",el,ec);a8(el,eg.anchor,eg.head,null,true)}function de(d5){this.lines=d5;this.parent=null;for(var d6=0,d7=d5.length,d4=0;d650){while(d4.lines.length>50){var d7=d4.lines.splice(d4.lines.length-25,25);var ea=new de(d7);d4.height-=ea.height;this.children.splice(d6+1,0,ea);ea.parent=this}this.maybeSpill()}break}d5-=d9}},maybeSpill:function(){if(this.children.length<=10){return}var d7=this;do{var d5=d7.children.splice(d7.children.length-5,5);var d6=new dD(d5);if(!d7.parent){var d8=new dD(d7.children);d8.parent=d7;d7.children=[d8,d6];d7=d8}else{d7.size-=d6.size;d7.height-=d6.height;var d4=b6(d7.parent.children,d7);d7.parent.children.splice(d4+1,0,d6)}d6.parent=d7.parent}while(d7.children.length>10);d7.parent.maybeSpill()},iterN:function(d4,eb,ea){for(var d5=0,d8=this.children.length;d5=d8.ch)){d7.push(d6.marker.parent||d6.marker)}}}return d7},getAllMarks:function(){var d4=[];this.iter(function(d6){var d5=d6.markedSpans;if(d5){for(var d7=0;d7d5){d4=d5;return true}d5-=d8;++d6});return dM(this,I(d6,d4))},indexFromPos:function(d5){d5=dM(this,d5);var d4=d5.ch;if(d5.lined7){d7=d4.from}if(d4.to!=null&&d4.tod6-600)||eb.origin.charAt(0)=="*"))){var d5=dK(ea.changes);if(dL(eb.from,eb.to)&&dL(eb.from,d5.to)){d5.to=bR(eb)}else{ea.changes.push(cd(d9,eb))}ea.anchorAfter=d8.anchor;ea.headAfter=d8.head}else{ea={changes:[cd(d9,eb)],anchorBefore:d9.sel.anchor,headBefore:d9.sel.head,anchorAfter:d8.anchor,headAfter:d8.head};d7.done.push(ea);while(d7.done.length>d7.undoDepth){d7.done.shift()}if(d7.dirtyCounter<0){d7.dirtyCounter=NaN}else{d7.dirtyCounter++}}d7.lastTime=d6;d7.lastOp=d4;d7.lastOrigin=eb.origin}function aG(d6){if(!d6){return null}for(var d5=0,d4;d5-1){dK(ed)[d4]=eb[d4];delete eb[d4]}}}}}}return d5}function dc(d7,d6,d5,d4){if(d50}z.on=ba;z.off=cE;z.signal=ad;var aF=30;var bk=z.Pass={toString:function(){return"CodeMirror.Pass"}};function d3(){this.id=null}d3.prototype={set:function(d4,d5){clearTimeout(this.id);this.id=setTimeout(d5,d4)}};function a6(d6,d4,d8,d9,d5){if(d4==null){d4=d6.search(/[^\s\u00a0]/);if(d4==-1){d4=d6.length}}for(var d7=d9||0,ea=d5||0;d7"\x80"&&(d4.toUpperCase()!=d4.toLowerCase()||az.test(d4))}function db(d4){for(var d5 in d4){if(d4.hasOwnProperty(d5)&&d4[d5]){return false}}return true}var dy=/[\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]/;function dU(d4,d8,d7,d6){var d9=document.createElement(d4);if(d7){d9.className=d7}if(d6){d9.style.cssText=d6}if(typeof d8=="string"){n(d9,d8)}else{if(d8){for(var d5=0;d50;--d4){d5.removeChild(d5.firstChild)}return d5}function a7(d4,d5){return cv(d4).appendChild(d5)}function n(d4,d5){if(bs){d4.innerHTML="";d4.appendChild(document.createTextNode(d5))}else{d4.textContent=d5}}function ai(d4){return d4.getBoundingClientRect()}z.replaceGetRect=function(d4){ai=d4};var c5=function(){if(bs){return false}var d4=dU("div");return"draggable" in d4||"dragDrop" in d4}();var bj=/^$/;if(bw){bj=/$'/}else{if(ac&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)){bj=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/}else{if(bU){bj=/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.]|\?[\w~`@#$%\^&*(_=+{[|><]/}}}var cQ;function i(d4){if(cQ!=null){return cQ}var d5=dU("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");a7(d4,d5);if(d5.offsetWidth){cQ=d5.offsetHeight-d5.clientHeight}return cQ||0}var dN;function aL(d4){if(dN==null){var d5=dU("span","\u200b");a7(d4,dU("span",[d5,document.createTextNode("x")]));if(d4.firstChild.offsetHeight!=0){dN=d5.offsetWidth<=1&&d5.offsetHeight>2&&!bt}}if(dN){return dU("span","\u200b")}else{return dU("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}}var ar="\n\nb".split(/\n/).length!=3?function(d9){var ea=0,d4=[],d8=d9.length;while(ea<=d8){var d7=d9.indexOf("\n",ea);if(d7==-1){d7=d9.length}var d6=d9.slice(ea,d9.charAt(d7-1)=="\r"?d7-1:d7);var d5=d6.indexOf("\r");if(d5!=-1){d4.push(d6.slice(0,d5));ea+=d5+1}else{d4.push(d6);ea=d7+1}}return d4}:function(d4){return d4.split(/\r\n?|\n/)};z.splitLines=ar;var aP=window.getSelection?function(d5){try{return d5.selectionStart!=d5.selectionEnd}catch(d4){return false}}:function(d6){try{var d4=d6.ownerDocument.selection.createRange()}catch(d5){}if(!d4||d4.parentElement()!=d6){return false}return d4.compareEndPoints("StartToEnd",d4)!=0};var b1=(function(){var d4=dU("div");if("oncopy" in d4){return true}d4.setAttribute("oncopy","return;");return typeof d4.oncopy=="function"})();var dq={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",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"};z.keyNames=dq;(function(){for(var d4=0;d4<10;d4++){dq[d4+48]=String(d4)}for(var d4=65;d4<=90;d4++){dq[d4]=String.fromCharCode(d4)}for(var d4=1;d4<=12;d4++){dq[d4+111]=dq[d4+63235]="F"+d4}})();function cw(d4,d9,d8,d7){if(!d4){return d7(d9,d8,"ltr")}for(var d6=0;d6d9||d9==d8&&d5.to==d9){d7(Math.max(d5.from,d9),Math.min(d5.to,d8),d5.level==1?"rtl":"ltr")}}}function cg(d4){return d4.level%2?d4.to:d4.from}function d0(d4){return d4.level%2?d4.from:d4.to}function bG(d5){var d4=a(d5);return d4?cg(d4[0]):0}function bQ(d5){var d4=a(d5);if(!d4){return d5.text.length}return d0(dK(d4))}function aQ(d5,d8){var d6=dm(d5.doc,d8);var d9=t(d5.doc,d6);if(d9!=d6){d8=a3(d9)}var d4=a(d9);var d7=!d4?0:d4[0].level%2?bQ(d9):bG(d9);return I(d8,d7)}function cq(d6,d9){var d5,d7;while(d5=cP(d7=dm(d6.doc,d9))){d9=d5.find().to.line}var d4=a(d7);var d8=!d4?d7.text.length:d4[0].level%2?bG(d7):bQ(d7);return I(d9,d8)}function q(ee,d4,d6,ea){var ec=a(ee);if(!ec){return O(ee,d4,d6,ea)}var ed=ea?function(eg,ef){do{eg+=ef}while(eg>0&&dy.test(ee.text.charAt(eg)));return eg}:function(eg,ef){return eg+ef};var d7=ec[0].level;for(var d8=0;d8d4)||(eb&&(d5.from==d4||d5.to==d4))){break}}var d9=ed(d4,d5.level%2?-d6:d6);while(d9!=null){if(d5.level%2==d7){if(d9d5.to){d5=ec[d8+=d6];d9=d5&&(d6>0==d5.level%2?ed(d5.to,-1):ed(d5.from,1))}else{break}}else{if(d9==cg(d5)){d5=ec[--d8];d9=d5&&d0(d5)}else{if(d9==d0(d5)){d5=ec[++d8];d9=d5&&cg(d5)}else{break}}}}return d9<0||d9>ee.text.length?null:d9}function O(d4,d8,d5,d6){var d7=d8+d5;if(d6){while(d7>0&&dy.test(d4.text.charAt(d7))){d7+=d5}}return d7<0||d7>d4.text.length?null:d7}var aD=(function(){var ea="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL";var d8="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr";function d7(ed){if(ed<=255){return ea.charAt(ed)}else{if(1424<=ed&&ed<=1524){return"R"}else{if(1536<=ed&&ed<=1791){return d8.charAt(ed-1536)}else{if(1792<=ed&&ed<=2220){return"r"}else{return"L"}}}}}var d4=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var ec=/[stwN]/,d6=/[LRr]/,d5=/[Lb1n]/,d9=/[1n]/;var eb="L";return function(en){if(!d4.test(en)){return false}var et=en.length,ej=[];for(var es=0,ef;es*\/]/.test(q)){return g(null,"select-op")}else{if(q=="."&&s.match(/^-?[_a-z][_a-z0-9-]*/i)){return g("qualifier","qualifier")}else{if(q==":"){return g("operator",q)}else{if(/[;{}\[\]\(\)]/.test(q)){return g(null,q)}else{if(q=="u"&&s.match("rl(")){s.backUp(1);r.tokenize=f;return g("property","variable")}else{s.eatWhile(/[\w\\\-]/);return g("property","variable")}}}}}}}}}}}}}}function m(p,q){return function(u,s){var t=false,r;while((r=u.next())!=null){if(r==p&&!t){break}t=!t&&r=="\\"}if(!t){if(q){u.backUp(1)}s.tokenize=c}return g("string","string")}}function f(q,p){q.next();if(!q.match(/\s*[\"\']/,false)){p.tokenize=m(")",true)}else{p.tokenize=c}return g(null,"(")}return{startState:function(p){return{tokenize:c,baseIndent:p||0,stack:[]}},token:function(t,s){s.tokenize=s.tokenize||c;if(s.tokenize==c&&t.eatSpace()){return null}var r=s.tokenize(t,s);if(r&&typeof r!="string"){r=g(r[0],r[1])}var q=s.stack[s.stack.length-1];if(r=="variable"){if(i=="variable-definition"){s.stack.push("propertyValue")}return"variable-2"}else{if(r=="property"){if(q=="propertyValue"){if(h[t.current()]){r="string-2"}else{if(l[t.current()]){r="keyword"}else{r="variable-2"}}}else{if(q=="rule"){if(!j[t.current()]){r+=" error"}}else{if(q=="block"){if(j[t.current()]){r="property"}else{if(l[t.current()]){r="keyword"}else{if(h[t.current()]){r="string-2"}else{r="tag"}}}}else{if(!q||q=="@media{"){r="tag"}else{if(q=="@media"){if(n[t.current()]){r="attribute"}else{if(/^(only|not)$/i.test(t.current())){r="keyword"}else{if(t.current().toLowerCase()=="and"){r="error"}else{if(k[t.current()]){r="error"}else{r="attribute error"}}}}}else{if(q=="@mediaType"){if(n[t.current()]){r="attribute"}else{if(t.current().toLowerCase()=="and"){r="operator"}else{if(/^(only|not)$/i.test(t.current())){r="error"}else{if(k[t.current()]){r="error"}else{r="error"}}}}}else{if(q=="@mediaType("){if(j[t.current()]){}else{if(n[t.current()]){r="error"}else{if(t.current().toLowerCase()=="and"){r="operator"}else{if(/^(only|not)$/i.test(t.current())){r="error"}else{r+=" error"}}}}}else{r="error"}}}}}}}}else{if(r=="atom"){if(!q||q=="@media{"||q=="block"){r="builtin"}else{if(q=="propertyValue"){if(!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){r+=" error"}}else{r="error"}}}else{if(q=="@media"&&i=="{"){r="error"}}}}if(i=="{"){if(q=="@media"||q=="@mediaType"){s.stack.pop();s.stack[s.stack.length-1]="@media{"}else{var u=a?"block":"rule";s.stack.push(u)}}else{if(i=="}"){var p=s.stack[s.stack.length-1];if(p=="interpolation"){r="operator"}s.stack.pop();if(q=="propertyValue"){s.stack.pop()}}else{if(i=="interpolation"){s.stack.push("interpolation")}else{if(i=="@media"){s.stack.push("@media")}else{if(q=="@media"&&/\b(keyword|attribute)\b/.test(r)){s.stack.push("@mediaType")}else{if(q=="@mediaType"&&t.current()==","){s.stack.pop()}else{if(q=="@mediaType"&&i=="("){s.stack.push("@mediaType(")}else{if(q=="@mediaType("&&i==")"){s.stack.pop()}else{if((q=="rule"||q=="block")&&i==":"){s.stack.push("propertyValue")}else{if(q=="propertyValue"&&i==";"){s.stack.pop()}}}}}}}}}}return r},indent:function(q,p){var r=q.stack.length;if(/^\}/.test(p)){r-=q.stack[q.stack.length-1]=="propertyValue"?2:1}return q.baseIndent+r*e},electricChars:"}"}});(function(){function b(k){var j={};for(var h=0;h=2&&k==">"){m.tokenize=null;break}l=(k=="-")?l+1:0}return["comment","comment"]}if(j.eat("!")){i.tokenize=h;return h(j,i)}},"/":function(i,h){if(i.eat("*")){h.tokenize=a;return a(i,h)}return false}},name:"css-base"});CodeMirror.defineMIME("text/x-scss",{atMediaTypes:e,atMediaFeatures:g,propertyKeywords:d,colorKeywords:c,valueKeywords:f,allowNested:true,hooks:{"$":function(h){h.match(/^[\w-]+/);if(h.peek()==":"){return["variable","variable-definition"]}return["variable","variable"]},"/":function(i,h){if(i.eat("/")){i.skipToEnd();return["comment","comment"]}else{if(i.eat("*")){h.tokenize=a;return a(i,h)}else{return["operator","operator"]}}},"#":function(h){if(h.eat("{")){return["operator","interpolation"]}else{h.eatWhile(/[\w\\\-]/);return["atom","hash"]}}},name:"css-base"})})(); \ No newline at end of file diff --git a/misc/html.mbed/c/htmlmixed-mini.js b/misc/html.mbed/c/htmlmixed-mini.js new file mode 100644 index 0000000..6e3460e --- /dev/null +++ b/misc/html.mbed/c/htmlmixed-mini.js @@ -0,0 +1 @@ +CodeMirror.defineMode("htmlmixed",function(b,c){var a=CodeMirror.getMode(b,{name:"xml",htmlMode:true});var m=CodeMirror.getMode(b,"css");var k=[],j=c&&c.scriptTypes;k.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:CodeMirror.getMode(b,"javascript")});if(j){for(var d=0;d"){var t=s.string.slice(Math.max(0,s.pos-100),s.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);t=t?t[1]:"";if(t&&/[\"\']/.test(t.charAt(0))){t=t.slice(1,t.length-1)}for(var n=0;n"){q.token=f;q.localMode=m;q.localState=m.startState(a.indent(q.htmlState,""))}}return p}function g(r,n,o){var q=r.current();var p=q.search(n),i;if(p>-1){r.backUp(q.length-p)}else{if(i=q.match(/<\/?$/)){r.backUp(q.length);if(!r.match(n,false)){r.match(q[0])}}}return o}function l(n,i){if(n.match(/^<\/\s*script\s*>/i,false)){i.token=e;i.localState=i.localMode=null;return e(n,i)}return g(n,/<\/\s*script\s*>/,i.localMode.token(n,i.localState))}function f(n,i){if(n.match(/^<\/\s*style\s*>/i,false)){i.token=e;i.localState=i.localMode=null;return e(n,i)}return g(n,/<\/\s*style\s*>/,m.token(n,i.localState))}return{startState:function(){var i=a.startState();return{token:e,localMode:null,localState:null,htmlState:i}},copyState:function(n){if(n.localState){var i=CodeMirror.copyState(n.localMode,n.localState)}return{token:n.token,localMode:n.localMode,localState:i,htmlState:CodeMirror.copyState(a,n.htmlState)}},token:function(n,i){return i.token(n,i)},indent:function(n,i){if(!n.localMode||/^\s*<\//.test(i)){return a.indent(n.htmlState,i)}else{if(n.localMode.indent){return n.localMode.indent(n.localState,i)}else{return CodeMirror.Pass}}},electricChars:"/{}:",innerMode:function(i){return{state:i.localState||i.htmlState,mode:i.localMode||a}}}},"xml","javascript","css");CodeMirror.defineMIME("text/html","htmlmixed"); \ No newline at end of file diff --git a/misc/html.mbed/c/javascript-mini.js b/misc/html.mbed/c/javascript-mini.js new file mode 100644 index 0000000..a5e838e --- /dev/null +++ b/misc/html.mbed/c/javascript-mini.js @@ -0,0 +1 @@ +CodeMirror.defineMode("javascript",function(L,P){var w=L.indentUnit;var T=P.json;var A=P.typescript;var b=function(){function af(ah){return{type:ah,style:"keyword"}}var aa=af("keyword a"),Y=af("keyword b"),X=af("keyword c");var Z=af("operator"),ad={type:"atom",style:"atom"};var ab={"if":aa,"while":aa,"with":aa,"else":Y,"do":Y,"try":Y,"finally":Y,"return":X,"break":X,"continue":X,"new":X,"delete":X,"throw":X,"var":af("var"),"const":af("var"),let:af("var"),"function":af("function"),"catch":af("catch"),"for":af("for"),"switch":af("switch"),"case":af("case"),"default":af("default"),"in":Z,"typeof":Z,"instanceof":Z,"true":ad,"false":ad,"null":ad,"undefined":ad,"NaN":ad,"Infinity":ad,"this":af("this")};if(A){var ag={type:"variable",style:"variable-3"};var ac={"interface":af("interface"),"class":af("class"),"extends":af("extends"),constructor:af("constructor"),"public":af("public"),"private":af("private"),"protected":af("protected"),"static":af("static"),"super":af("super"),string:ag,number:ag,bool:ag,any:ag};for(var ae in ac){ab[ae]=ac[ae]}}return ab}();var Q=/[+\-*&%=<>!?|~^]/;function V(Z,Y,X){Y.tokenize=X;return X(Z,Y)}function h(aa,X){var Z=false,Y;while((Y=aa.next())!=null){if(Y==X&&!Z){return false}Z=!Z&&Y=="\\"}return Z}var W,p;function E(Z,Y,X){W=Z;p=X;return Y}function l(ab,Z){var X=ab.next();if(X=='"'||X=="'"){return V(ab,Z,B(X))}else{if(/[\[\]{}\(\),;\:\.]/.test(X)){return E(X)}else{if(X=="0"&&ab.eat(/x/i)){ab.eatWhile(/[\da-f]/i);return E("number","number")}else{if(/\d/.test(X)||X=="-"&&ab.eat(/\d/)){ab.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return E("number","number")}else{if(X=="/"){if(ab.eat("*")){return V(ab,Z,f)}else{if(ab.eat("/")){ab.skipToEnd();return E("comment","comment")}else{if(Z.lastType=="operator"||Z.lastType=="keyword c"||/^[\[{}\(,;:]$/.test(Z.lastType)){h(ab,"/");ab.eatWhile(/[gimy]/);return E("regexp","string-2")}else{ab.eatWhile(Q);return E("operator",null,ab.current())}}}}else{if(X=="#"){ab.skipToEnd();return E("error","error")}else{if(Q.test(X)){ab.eatWhile(Q);return E("operator",null,ab.current())}else{ab.eatWhile(/[\w\$_]/);var aa=ab.current(),Y=b.propertyIsEnumerable(aa)&&b[aa];return(Y&&Z.lastType!=".")?E(Y.type,Y.style,aa):E("variable","variable",aa)}}}}}}}}function B(X){return function(Z,Y){if(!h(Z,X)){Y.tokenize=l}return E("string","string")}}function f(aa,Z){var X=false,Y;while(Y=aa.next()){if(Y=="/"&&X){Z.tokenize=l;break}X=(Y=="*")}return E("comment","comment")}var k={atom:true,number:true,variable:true,string:true,regexp:true,"this":true};function u(ac,Y,X,ab,Z,aa){this.indented=ac;this.column=Y;this.type=X;this.prev=Z;this.info=aa;if(ab!=null){this.align=ab}}function x(Z,Y){for(var X=Z.localVars;X;X=X.next){if(X.name==Y){return true}}}function H(ab,Y,X,aa,ac){var ad=ab.cc;v.state=ab;v.stream=ac;v.marked=null,v.cc=ad;if(!ab.lexical.hasOwnProperty("align")){ab.lexical.align=true}while(true){var Z=ad.length?ad.pop():T?y:z;if(Z(X,aa)){while(ad.length&&ad[ad.length-1].lex){ad.pop()()}if(v.marked){return v.marked}if(X=="variable"&&x(ab,aa)){return"variable-2"}return Y}}}var v={state:null,column:null,marked:null,cc:null};function a(){for(var X=arguments.length-1;X>=0;X--){v.cc.push(arguments[X])}}function J(){a.apply(null,arguments);return true}function m(Y){function X(ab){for(var aa=ab;aa;aa=aa.next){if(aa.name==Y){return true}}return false}var Z=v.state;if(Z.context){v.marked="def";if(X(Z.localVars)){return}Z.localVars={name:Y,next:Z.localVars}}else{if(X(Z.globalVars)){return}Z.globalVars={name:Y,next:Z.globalVars}}}var G={name:"this",next:{name:"arguments"}};function t(){v.state.context={prev:v.state.context,vars:v.state.localVars};v.state.localVars=G}function s(){v.state.localVars=v.state.context.vars;v.state.context=v.state.context.prev}function j(Y,Z){var X=function(){var aa=v.state;aa.lexical=new u(aa.indented,v.stream.column(),Y,null,aa.lexical,Z)};X.lex=true;return X}function I(){var X=v.state;if(X.lexical.prev){if(X.lexical.type==")"){X.indented=X.lexical.indented}X.lexical=X.lexical.prev}}I.lex=true;function c(X){return function(Y){if(Y==X){return J()}else{if(X==";"){return a()}else{return J(arguments.callee)}}}}function z(X){if(X=="var"){return J(j("vardef"),M,c(";"),I)}if(X=="keyword a"){return J(j("form"),y,z,I)}if(X=="keyword b"){return J(j("form"),z,I)}if(X=="{"){return J(j("}"),n,I)}if(X==";"){return J()}if(X=="function"){return J(i)}if(X=="for"){return J(j("form"),c("("),j(")"),g,c(")"),I,z,I)}if(X=="variable"){return J(j("stat"),F)}if(X=="switch"){return J(j("form"),y,j("}","switch"),c("{"),n,I,I)}if(X=="case"){return J(y,c(":"))}if(X=="default"){return J(c(":"))}if(X=="catch"){return J(j("form"),t,c("("),q,c(")"),z,I,s)}return a(j("stat"),y,c(";"),I)}function y(X){if(k.hasOwnProperty(X)){return J(O)}if(X=="function"){return J(i)}if(X=="keyword c"){return J(D)}if(X=="("){return J(j(")"),D,c(")"),I,O)}if(X=="operator"){return J(y)}if(X=="["){return J(j("]"),R(y,"]"),I,O)}if(X=="{"){return J(j("}"),R(o,"}"),I,O)}return J()}function D(X){if(X.match(/[;\}\)\],]/)){return a()}return a(y)}function O(X,Y){if(X=="operator"){if(/\+\+|--/.test(Y)){return J(O)}if(Y=="?"){return J(y,c(":"),y)}return J(y)}if(X==";"){return}if(X=="("){return J(j(")"),R(y,")"),I,O)}if(X=="."){return J(S,O)}if(X=="["){return J(j("]"),y,c("]"),I,O)}}function F(X){if(X==":"){return J(I,z)}return a(O,c(";"),I)}function S(X){if(X=="variable"){v.marked="property";return J()}}function o(X,Y){if(X=="variable"){v.marked="property";if(Y=="get"||Y=="set"){return J(C)}}else{if(X=="number"||X=="string"){v.marked=X+" property"}}if(k.hasOwnProperty(X)){return J(c(":"),y)}}function C(X){if(X==":"){return J(y)}if(X!="variable"){return J(c(":"),y)}v.marked="property";return J(i)}function R(Z,X){function Y(aa){if(aa==","){return J(Z,Y)}if(aa==X){return J()}return J(c(X))}return function(aa){if(aa==X){return J()}else{return a(Z,Y)}}}function n(X){if(X=="}"){return J()}return a(z,n)}function r(X){if(X==":"){return J(U)}return a()}function U(X){if(X=="variable"){v.marked="variable-3";return J()}return a()}function M(X,Y){if(X=="variable"){m(Y);return A?J(r,K):J(K)}return a()}function K(X,Y){if(Y=="="){return J(y,K)}if(X==","){return J(M)}}function g(X){if(X=="var"){return J(M,c(";"),e)}if(X==";"){return J(e)}if(X=="variable"){return J(N)}return J(e)}function N(X,Y){if(Y=="in"){return J(y)}return J(O,e)}function e(X,Y){if(X==";"){return J(d)}if(Y=="in"){return J(y)}return J(y,c(";"),d)}function d(X){if(X!=")"){J(y)}}function i(X,Y){if(X=="variable"){m(Y);return J(i)}if(X=="("){return J(j(")"),t,R(q,")"),I,z,s)}}function q(X,Y){if(X=="variable"){m(Y);return A?J(r):J()}}return{startState:function(X){return{tokenize:l,lastType:null,cc:[],lexical:new u((X||0)-w,0,"block",false),localVars:P.localVars,globalVars:P.globalVars,context:P.localVars&&{vars:P.localVars},indented:0}},token:function(Z,Y){if(Z.sol()){if(!Y.lexical.hasOwnProperty("align")){Y.lexical.align=false}Y.indented=Z.indentation()}if(Z.eatSpace()){return null}var X=Y.tokenize(Z,Y);if(W=="comment"){return X}Y.lastType=W;return H(Y,X,W,p,Z)},indent:function(ac,X){if(ac.tokenize==f){return CodeMirror.Pass}if(ac.tokenize!=l){return 0}var ab=X&&X.charAt(0),Z=ac.lexical;if(Z.type=="stat"&&ab=="}"){Z=Z.prev}var aa=Z.type,Y=ab==aa;if(aa=="vardef"){return Z.indented+(ac.lastType=="operator"||ac.lastType==","?4:0)}else{if(aa=="form"&&ab=="{"){return Z.indented}else{if(aa=="form"){return Z.indented+w}else{if(aa=="stat"){return Z.indented+(ac.lastType=="operator"||ac.lastType==","?w:0)}else{if(Z.info=="switch"&&!Y){return Z.indented+(/^(?:case|default)\b/.test(X)?w:2*w)}else{if(Z.align){return Z.column+(Y?0:1)}else{return Z.indented+(Y?0:w)}}}}}}},electricChars:":{}",jsonMode:T}});CodeMirror.defineMIME("text/javascript","javascript");CodeMirror.defineMIME("text/ecmascript","javascript");CodeMirror.defineMIME("application/javascript","javascript");CodeMirror.defineMIME("application/ecmascript","javascript");CodeMirror.defineMIME("application/json",{name:"javascript",json:true});CodeMirror.defineMIME("text/typescript",{name:"javascript",typescript:true});CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:true}); \ No newline at end of file diff --git a/misc/html.mbed/c/xml-mini.js b/misc/html.mbed/c/xml-mini.js new file mode 100644 index 0000000..4af9149 --- /dev/null +++ b/misc/html.mbed/c/xml-mini.js @@ -0,0 +1 @@ +CodeMirror.defineMode("xml",function(A,k){var r=A.indentUnit;var z=k.multilineTagIndentFactor||1;var x=k.htmlMode?{autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:true}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false};var a=k.alignCDATA;var f,g;function o(H,G){function E(J){G.tokenize=J;return J(H,G)}var F=H.next();if(F=="<"){if(H.eat("!")){if(H.eat("[")){if(H.match("CDATA[")){return E(w("atom","]]>"))}else{return null}}else{if(H.match("--")){return E(w("comment","-->"))}else{if(H.match("DOCTYPE",true,true)){H.eatWhile(/[\w\._\-]/);return E(B(1))}else{return null}}}}else{if(H.eat("?")){H.eatWhile(/[\w\._\-]/);G.tokenize=w("meta","?>");return"meta"}else{var C=H.eat("/");f="";var I;while((I=H.eat(/[^\s\u00a0=<>\"\'\/?]/))){f+=I}if(!f){return"error"}g=C?"closeTag":"openTag";G.tokenize=n;return"tag"}}}else{if(F=="&"){var D;if(H.eat("#")){if(H.eat("x")){D=H.eatWhile(/[a-fA-F\d]/)&&H.eat(";")}else{D=H.eatWhile(/[\d]/)&&H.eat(";")}}else{D=H.eatWhile(/[\w\.\-:]/)&&H.eat(";")}return D?"atom":"error"}else{H.eatWhile(/[^&<]/);return null}}}function n(E,D){var C=E.next();if(C==">"||(C=="/"&&E.eat(">"))){D.tokenize=o;g=C==">"?"endTag":"selfcloseTag";return"tag"}else{if(C=="="){g="equals";return null}else{if(/[\'\"]/.test(C)){D.tokenize=j(C);return D.tokenize(E,D)}else{E.eatWhile(/[^\s\u00a0=<>\"\']/);return"word"}}}}function j(C){return function(E,D){while(!E.eol()){if(E.next()==C){D.tokenize=n;break}}return"string"}}function w(D,C){return function(F,E){while(!F.eol()){if(F.match(C)){E.tokenize=o;break}F.next()}return D}}function B(C){return function(F,E){var D;while((D=F.next())!=null){if(D=="<"){E.tokenize=B(C+1);return E.tokenize(F,E)}else{if(D==">"){if(C==1){E.tokenize=o;break}else{E.tokenize=B(C-1);return E.tokenize(F,E)}}}}return"meta"}}var l,y,h;function b(){for(var C=arguments.length-1;C>=0;C--){l.cc.push(arguments[C])}}function e(){b.apply(null,arguments);return true}function i(C,E){var D=x.doNotIndent.hasOwnProperty(C)||(l.context&&l.context.noIndent);l.context={prev:l.context,tagName:C,indent:l.indented,startOfLine:E,noIndent:D}}function u(){if(l.context){l.context=l.context.prev}}function d(C){if(C=="openTag"){l.tagName=f;l.tagStart=y.column();return e(m,c(l.startOfLine))}else{if(C=="closeTag"){var D=false;if(l.context){if(l.context.tagName!=f){if(x.implicitlyClosed.hasOwnProperty(l.context.tagName.toLowerCase())){u()}D=!l.context||l.context.tagName!=f}}else{D=true}if(D){h="error"}return e(s(D))}}return e()}function c(C){return function(E){var D=l.tagName;l.tagName=l.tagStart=null;if(E=="selfcloseTag"||(E=="endTag"&&x.autoSelfClosers.hasOwnProperty(D.toLowerCase()))){q(D.toLowerCase());return e()}if(E=="endTag"){q(D.toLowerCase());i(D,C);return e()}return e()}}function s(C){return function(D){if(C){h="error"}if(D=="endTag"){u();return e()}h="error";return e(arguments.callee)}}function q(D){var C;while(true){if(!l.context){return}C=l.context.tagName.toLowerCase();if(!x.contextGrabbers.hasOwnProperty(C)||!x.contextGrabbers[C].hasOwnProperty(D)){return}u()}}function m(C){if(C=="word"){h="attribute";return e(p,m)}if(C=="endTag"||C=="selfcloseTag"){return b()}h="error";return e(m)}function p(C){if(C=="equals"){return e(v,m)}if(!x.allowMissing){h="error"}else{if(C=="word"){h="attribute"}}return(C=="endTag"||C=="selfcloseTag")?b():e()}function v(C){if(C=="string"){return e(t)}if(C=="word"&&x.allowUnquoted){h="string";return e()}h="error";return(C=="endTag"||C=="selfCloseTag")?b():e()}function t(C){if(C=="string"){return e(t)}else{return b()}}return{startState:function(){return{tokenize:o,cc:[],indented:0,startOfLine:true,tagName:null,tagStart:null,context:null}},token:function(F,E){if(!E.tagName&&F.sol()){E.startOfLine=true;E.indented=F.indentation()}if(F.eatSpace()){return null}h=g=f=null;var D=E.tokenize(F,E);E.type=g;if((D||g)&&D!="comment"){l=E;y=F;while(true){var C=E.cc.pop()||d;if(C(g||D)){break}}}E.startOfLine=false;return h||D},indent:function(F,C,E){var D=F.context;if((F.tokenize!=n&&F.tokenize!=o)||D&&D.noIndent){return E?E.match(/^(\s*)/)[0].length:0}if(F.tagName){return F.tagStart+r*z}if(a&&/Internet contents
  • MiMic Website
    MiMic Website! There is information of MiMic.
  • -
  • JavascriptAPI reference
    MiMic Javascript API reference.
  • MiMic for Mbed repository
    MiMic for Mbed primary page. Source code here.
  • +
  • JavascriptAPI reference
    MiMic Javascript API reference.
  • MiMic project(SorceForge)
    MiMic for LPCXpresso and APIsfor other languages(PHP,Unit3D) . This is core library of MiMic.
  • MiMic online samples(jsdo.it)
    Online sample programs using MiMic Javascript API.Those are tagged 'MiMic' programs at jsdo.it. jsdo.it is JavaScript sharing service.
  • diff --git a/misc/html.mbed/m/LPC1769.All-mini.js b/misc/html.mbed/m/LPC1769.All-mini.js new file mode 100644 index 0000000..b3158d5 --- /dev/null +++ b/misc/html.mbed/m/LPC1769.All-mini.js @@ -0,0 +1 @@ +var LPC1769;(function(){var g=MiMicLib.isUndef;var a={_EE:function(n){return{NG:[n|0,"Unknown exception in LPC1769"],INVALID_ARG:[n|1,"Invalid argument"],INVALID_PIN:[n|2,"Invalid pin"],INVALID_CFG:[n|3,"Invalid configulation"],VM_RUNTIME:[n|4,"MVM runtime error"],}}(MiMicError.NG[0]|MiMicError.MID_MiMic|MiMicError.CAID_LPCXPresso1769),_BCF:{setBit:function m(p,r,o,q,n){try{n.push(p);n.push(~(r<=0}};a.I2c=function c(){throw new MiMicException("Not imprement.")};a.Dma=function k(){throw new MiMicException("Not imprement.")};a.Uart=function f(){throw new MiMicException("Not imprement.")};a.Usb=function e(){throw new MiMicException("Not imprement.")};LPC1769=a}());(function(){var f=LPC1769;var p=f._BCF;var a=f._EE;var e=MiMicLib.isUndef;function b(t){try{var v="";for(var s=0;s0){d(p);var j=arguments[1].length;for(var m=0;m0){this._mcu.callMiMicWithCheck(o+j.END,m)}}catch(n){throw new MiMicException(n)}return},clonePinOptAssoc:function i(l){var m=new Array();if(e(l)){if(l.length!=this.pins.length){throw new MiMicException()}for(var n=0;n>4)&4095)}return v}catch(w){throw new MiMicException(w)}}};a.AdcPin=function e(r,s,u){try{this._aport=new a.AdcPort(r,[s],u)}catch(t){throw new MiMicException(t)}};a.AdcPin.prototype={_aport:null,getValue:function f(){try{return this._aport.getValues()[0]}catch(r){throw new MiMicException(r)}},setOpt:function g(s){try{this._aport.setOpt(s)}catch(r){throw new MiMicException(r)}}}}());(function(){var g=LPC1769;var p=g._BCF;var a=g._EE;var f=MiMicLib.isUndef;var n=MiMicLib.cloneAssoc;var j=MiMicLib.isArray;g.Gpio=function r(t,v){try{this._mcu=t;t.registerPhl(this,"GPIO")}catch(u){throw new MiMicException(u)}};g.Gpio.prototype={_FIO_DIR:[537509888,537509920,537509952,537509984,537510016],_FIO_PIN:[537509908,537509940,537509972,537510004,537510036],_FIO_SET:[537509912,537509944,537509976,537510008,537510040],_FIO_CLR:[537509916,537509948,537509980,537510012,537510044],_FIO_MASK:[537509904,537509936,537509968,537510000,537510032],_mcu:null,BCF_getValues:function l(u,v,t){try{t.push(this._FIO_PIN[u],this._FIO_MASK[u],~v);return"EA00EA01EA02DF0201DB0300EE03"}catch(w){throw new MiMicException(w)}},BCF_setValues:function h(v,w,u,t){try{t.push(this._FIO_PIN[v],this._FIO_MASK[v],~w,u);return"EA00EA01EA02EA03DF0201DF0300"}catch(x){throw new MiMicException(x)}},BCF_setDirs:function e(u,v,w,t){try{return p.setBit(this._FIO_DIR[u],v,w,0,t)}catch(x){throw new MiMicException(x)}},getPin:function q(t,v){try{return new g.GpioPin(this,t,v)}catch(u){throw new MiMicException(u)}},getPort:function s(t,v){try{return new g.GpioPort(this,t,v)}catch(u){throw new MiMicException(u)}}};function k(u){try{var v=new Array();for(var w=0;w>y)&1);w|=(t<=0;y--){var t=((u>>this._pininfo[y].bit)&1);w=(w<<1)|t}return w}catch(z){throw new MiMicException(z)}},outPatt:function i(x){try{var w=new Array();var B="";for(var z=0;z>y)&1);u|=(t<=0}};a.I2c=function c(){throw new MiMicException("Not imprement.")};a.Dma=function k(){throw new MiMicException("Not imprement.")};a.Uart=function f(){throw new MiMicException("Not imprement.")};a.Usb=function e(){throw new MiMicException("Not imprement.")};LPC1769=a}());(function(){var f=LPC1769;var p=f._BCF;var a=f._EE;var e=MiMicLib.isUndef;function b(t){try{var v="";for(var s=0;s0){d(p);var j=arguments[1].length;for(var m=0;m0){this._mcu.callMiMicWithCheck(o+j.END,m)}}catch(n){throw new MiMicException(n)}return},clonePinOptAssoc:function i(l){var m=new Array();if(e(l)){if(l.length!=this.pins.length){throw new MiMicException()}for(var n=0;n>4)&4095)}return v}catch(w){throw new MiMicException(w)}}};a.AdcPin=function e(r,s,u){try{this._aport=new a.AdcPort(r,[s],u)}catch(t){throw new MiMicException(t)}};a.AdcPin.prototype={_aport:null,getValue:function f(){try{return this._aport.getValues()[0]}catch(r){throw new MiMicException(r)}},setOpt:function g(s){try{this._aport.setOpt(s)}catch(r){throw new MiMicException(r)}}}}());(function(){var g=LPC1769;var p=g._BCF;var a=g._EE;var f=MiMicLib.isUndef;var n=MiMicLib.cloneAssoc;var j=MiMicLib.isArray;g.Gpio=function r(t,v){try{this._mcu=t;t.registerPhl(this,"GPIO")}catch(u){throw new MiMicException(u)}};g.Gpio.prototype={_FIO_DIR:[537509888,537509920,537509952,537509984,537510016],_FIO_PIN:[537509908,537509940,537509972,537510004,537510036],_FIO_SET:[537509912,537509944,537509976,537510008,537510040],_FIO_CLR:[537509916,537509948,537509980,537510012,537510044],_FIO_MASK:[537509904,537509936,537509968,537510000,537510032],_mcu:null,BCF_getValues:function l(u,v,t){try{t.push(this._FIO_PIN[u],this._FIO_MASK[u],~v);return"EA00EA01EA02DF0201DB0300EE03"}catch(w){throw new MiMicException(w)}},BCF_setValues:function h(v,w,u,t){try{t.push(this._FIO_PIN[v],this._FIO_MASK[v],~w,u);return"EA00EA01EA02EA03DF0201DF0300"}catch(x){throw new MiMicException(x)}},BCF_setDirs:function e(u,v,w,t){try{return p.setBit(this._FIO_DIR[u],v,w,0,t)}catch(x){throw new MiMicException(x)}},getPin:function q(t,v){try{return new g.GpioPin(this,t,v)}catch(u){throw new MiMicException(u)}},getPort:function s(t,v){try{return new g.GpioPort(this,t,v)}catch(u){throw new MiMicException(u)}}};function k(u){try{var v=new Array();for(var w=0;w>y)&1);w|=(t<=0;y--){var t=((u>>this._pininfo[y].bit)&1);w=(w<<1)|t}return w}catch(z){throw new MiMicException(z)}},outPatt:function i(x){try{var w=new Array();var B="";for(var z=0;z>y)&1);u|=(t<=0}};a.I2c=function c(){throw new MiMicException("Not imprement.")};a.Dma=function k(){throw new MiMicException("Not imprement.")};a.Uart=function f(){throw new MiMicException("Not imprement.")};a.Usb=function e(){throw new MiMicException("Not imprement.")};LPC1769=a}());(function(){var f=LPC1769;var p=f._BCF;var a=f._EE;var e=MiMicLib.isUndef;function b(t){try{var v="";for(var s=0;s0){d(p);var j=arguments[1].length;for(var m=0;m0){this._mcu.callMiMicWithCheck(o+j.END,m)}}catch(n){throw new MiMicException(n)}return},clonePinOptAssoc:function i(l){var m=new Array();if(e(l)){if(l.length!=this.pins.length){throw new MiMicException()}for(var n=0;n>4)&4095)}return v}catch(w){throw new MiMicException(w)}}};a.AdcPin=function e(r,s,u){try{this._aport=new a.AdcPort(r,[s],u)}catch(t){throw new MiMicException(t)}};a.AdcPin.prototype={_aport:null,getValue:function f(){try{return this._aport.getValues()[0]}catch(r){throw new MiMicException(r)}},setOpt:function g(s){try{this._aport.setOpt(s)}catch(r){throw new MiMicException(r)}}}}());(function(){var g=LPC1769;var p=g._BCF;var a=g._EE;var f=MiMicLib.isUndef;var n=MiMicLib.cloneAssoc;var j=MiMicLib.isArray;g.Gpio=function r(t,v){try{this._mcu=t;t.registerPhl(this,"GPIO")}catch(u){throw new MiMicException(u)}};g.Gpio.prototype={_FIO_DIR:[537509888,537509920,537509952,537509984,537510016],_FIO_PIN:[537509908,537509940,537509972,537510004,537510036],_FIO_SET:[537509912,537509944,537509976,537510008,537510040],_FIO_CLR:[537509916,537509948,537509980,537510012,537510044],_FIO_MASK:[537509904,537509936,537509968,537510000,537510032],_mcu:null,BCF_getValues:function l(u,v,t){try{t.push(this._FIO_PIN[u],this._FIO_MASK[u],~v);return"EA00EA01EA02DF0201DB0300EE03"}catch(w){throw new MiMicException(w)}},BCF_setValues:function h(v,w,u,t){try{t.push(this._FIO_PIN[v],this._FIO_MASK[v],~w,u);return"EA00EA01EA02EA03DF0201DF0300"}catch(x){throw new MiMicException(x)}},BCF_setDirs:function e(u,v,w,t){try{return p.setBit(this._FIO_DIR[u],v,w,0,t)}catch(x){throw new MiMicException(x)}},getPin:function q(t,v){try{return new g.GpioPin(this,t,v)}catch(u){throw new MiMicException(u)}},getPort:function s(t,v){try{return new g.GpioPort(this,t,v)}catch(u){throw new MiMicException(u)}}};function k(u){try{var v=new Array();for(var w=0;w>y)&1);w|=(t<=0;y--){var t=((u>>this._pininfo[y].bit)&1);w=(w<<1)|t}return w}catch(z){throw new MiMicException(z)}},outPatt:function i(x){try{var w=new Array();var B="";for(var z=0;z>y)&1);u|=(t<>>0).toString(16).toLowerCase();if(d.length>c){throw new MiMicException(EE.NG)}var a=c-d.length;return f[a]+d}catch(g){throw new MiMicException(g)}},assocToStr:function assocToStr(b){var c="";for(k in b){c+=k+":"+b[k]+","}return c}};var MiMicError={OK:[0,"OK"],NG:[1073741824,"NG"],isOK:function(a){return(1073741824&a)==0},MID_MiMic:3735552,CAID_RemoteMCU:256,CAID_LPCXPresso1769:512};function MiMicException(){var d;if(typeof arguments.callee.caller=="function"){if(arguments.callee.caller.name.toString().length>0){d="function '"+arguments.callee.caller.name+"."}else{var b=arguments.callee.caller.toString();d="closure '"+b.substring(0,b.indexOf("{"))+"...'"}}else{d="root document"}var c="";switch(arguments.length){case 0:this.code=MiMicError.NG[0];this.message=d+" code(0x"+this.code.toString(16)+")"+MiMicError.NG[1];return;case 1:var a=arguments[0];if(a instanceof MiMicException){this.code=a.code;c=" \nfrom "+a.message}else{if(typeof a=="object"&&a.length==2){this.code=a[0];c=a[1]}else{this.code=MiMicError.NG[0];c=MiMicError.NG[1]+" "+(((typeof a)!="undefined")?a.toString():"v==undefined")}}this.message=d+" code(0x"+this.code.toString(16)+")"+c;return;case 2:var a=arguments[0];if(a instanceof MiMicException){this.code=a.code;this.message=d+" code(0x"+this.code.toString(16)+")\nfrom "+a.message+":"+arguments[1];return}else{if(typeof a!="string"&&a.length==2){this.code=a[0];this.message=d+" code(0x"+this.code.toString(16)+")"+a[1]+":"+arguments[1]}else{break}}return;default:break}throw new MiMicException("Invalid MiMicException argument.")}MiMicException.prototype={code:MiMicError.OK,message:"",alert:function(){alert(this.message)},toString:function(){return"MiMicException:"+this.message}};var MiMicRemoteMcuInterface;(function(){var EE=function(i_base){return{NG:[i_base|0,"Unknown exception in MiMicRemoteMcuInterface"],TCP_CONNECT:[i_base|1,"TCP CONNECT FAILED"],HTTP:[i_base|2,"HTTP FAILED"]}}(MiMicError.NG[0]|MiMicError.MID_MiMic|MiMicError.CAID_RemoteMCU);MiMicRemoteMcuInterface=function MiMicRemoteMcuInterface(i_path){this._mimic_path=i_path+((i_path.indexOf("/")==-1)?"/mvm/":"")};MiMicRemoteMcuInterface.prototype={_mimic_path:null,_keep_alive:null,_last_xhr_res_time:0,_xhrGet:function(i_url,i_async,i_callback){var xhr=window.XDomainRequest?new XDomainRequest():new XMLHttpRequest();var prog=0;try{if(i_async){xhr.onreadystatechange=function(){if(xhr.readyState==4){this._last_xhr_res_time=MiMicLib.getNow();i_callback(xhr)}}}xhr.open("GET",i_url,i_async);prog=1;xhr.send(null);if(!i_async){this._last_xhr_res_time=MiMicLib.getNow()}prog=2}catch(e){throw new MiMicException(function(){switch(prog){case 1:return EE.HTTP}return EE.TCP_CONNECT}(),"url="+i_url)}return xhr},_isOnline_parseResponse:function(res){function isok(i_s){function parse_version_tag(i_v){var t=i_v.split("/");var n=t[1].split(".");return{name:t[0],major:parseInt(n[0]),minor:parseInt(n[1])}}try{var l=i_s.split(";");var rmcu=parse_version_tag(l[0]);var mcut=l[1];return((rmcu.name=="ModRemoteMcu")&&(rmcu.major==1)&&(rmcu.minor>=0))}catch(e){throw MiMicException(e)}}try{if(res.status!=200){return false}var ret=eval("("+res.responseText+")");if(!isok(ret.application)){return false}}catch(e){return false}return true},_parseMvmResult:function(i_mvmresult){function isok(i_s){var l=i_s.split(";");return((l[0].indexOf("ModRemoteMcu/1.")==0)&&(l[1]=="Json/1.0"))}var ret=eval("("+i_mvmresult+")");if(isok(ret.version)){if(ret.result!=undefined){if(ret.result!=0||ret.stream!=undefined){return ret}}}throw new MiMicException(EE.NG,"Invalid json version:'"+ret.version+"'")},isConnected:function isConnected(){return this._keep_alive!=null},execBc:function execBc(i_bc){try{if(this._keep_alive==null){throw new MiMicException(EE.NG,"disconnected")}var res=this._xhrGet("http://"+this._mimic_path+"mvm.api?v=1&bc="+i_bc,false);if(res.status!=200){throw new MiMicException(EE.HTTP,"i_bc="+i_bc+",XHR.status="+res.status)}return this._parseMvmResult(res.responseText,false)}catch(e){throw new MiMicException(e)}},connect:function connect(i_callback){try{var _t=this;if(this._keep_alive!=null){return}function xhrStatus(i_is_async,i_cb){try{return _t._xhrGet("http://"+_t._mimic_path+"status.api",i_is_async,i_cb)}catch(e){return null}}function intervalProc(){var now=MiMicLib.getNow();var lt=now-_t._last_xhr_res_time;if(lt<3000){return}var res=xhrStatus(false,null);if((res==null)||(!_t._isOnline_parseResponse(res))){if(_t._keep_alive!=null){clearInterval(_t._keep_alive.tid);_t._keep_alive=null;i_callback(false)}}i_callback(true)}var res=xhrStatus(false,null);if((res==null)||(!_t._isOnline_parseResponse(res))){throw new MiMicException("Bad response from "+this._mimic_path)}this._keep_alive={tid:setInterval(intervalProc,500)}}catch(e){throw new MiMicException(e)}return},disconnect:function disconnect(){try{if(this._keep_alive!=null){clearInterval(this._keep_alive.tid);this._keep_alive=null}}catch(e){throw new MiMicException(e)}}}}()); \ No newline at end of file diff --git a/misc/html.mbed/m/MiMicILAsm-mini.js b/misc/html.mbed/m/MiMicILAsm-mini.js new file mode 100644 index 0000000..b52824d --- /dev/null +++ b/misc/html.mbed/m/MiMicILAsm-mini.js @@ -0,0 +1 @@ +function strtrim(a){return a.replace(/^\s+|\s+$/g,"")}function MiMicILAsm(a){this._def=a}MiMicILAsm.prototype={version:"MiMicILAsm/1.1.0",_exception:new Object(),_def:undefined,OPR_WM:1,OPR_INT:2,OPRSET_NONE:257,OPRSET_WM:258,OPRSET_INT:259,OPRSET_WM_WM:260,OPRSET_WM_INT:261,_log:new String(),assemble:function(a){var g=false;var d=new String();this._log=new String();var c=a.replace(/\r/g,"\n").split("\n");for(var e=0;e0){var f=this._line2bc(e,b);if(d==null||f==null){d=null}else{d=d.concat(this._line2bc(e,b))}}}return d},getErrors:function(){return this._log},_line2bc:function(m,p){var w=this;function n(i,e){w._log+="["+i+"] Line("+m+")"+e+"\r\n"}function o(e,i){var x=(e>>>0).toString(16).toLowerCase();if(x.length>i){n("ERROR","Range Error. value="+e+" digit="+i);throw w._exception}while(x.length - - + + + + + + + + + + - -

    Memory Dump

    -MiMic IP Address
    -Memory address(32bit)
    -blocks address(32bit)
    -
    - + +

    MemoryDump

    +
    + +
    Dump Result
    + + + + diff --git a/misc/html.mbed/setup.html b/misc/html.mbed/setup.html index d9b95c9..142dd11 100644 --- a/misc/html.mbed/setup.html +++ b/misc/html.mbed/setup.html @@ -11,23 +11,34 @@ .table{ width:480px; } - .text_row{ - background-color:#eeeeee; + .table td + { + margin:2px 2px 2px 2px; + padding:2px 2px 2px 2px; } - - .input_row{ - background-color:#bbffbb; + .text_row, .input_row{ + height:25px; + background-color:#4169E1; + color:white; + border:solid 1px #aaaaaa; + font-weight:bold; } .td1{ + font-weight:bold; font-size:14px; - margin:2px 2px 2px 2px; - padding:2px 2px 2px 2px; width:120px; } .input_row input{ width:200px; + border:solid 1px #aaaaaa; + } + button{ + font-weight:bold; + text-align:center; + font-size:12px; + padding:0px; + width:60px;height:40px; } -