{ "tiddlers": { "$:/config/EditorTypeMappings/application/javascript": { "title": "$:/config/EditorTypeMappings/application/javascript", "text": "codemirror" }, "$:/config/EditorTypeMappings/application/json": { "title": "$:/config/EditorTypeMappings/application/json", "text": "codemirror" }, "$:/config/EditorTypeMappings/application/x-tiddler-dictionary": { "title": "$:/config/EditorTypeMappings/application/x-tiddler-dictionary", "text": "codemirror" }, "$:/config/EditorTypeMappings/text/css": { "title": "$:/config/EditorTypeMappings/text/css", "text": "codemirror" }, "$:/config/EditorTypeMappings/text/html": { "title": "$:/config/EditorTypeMappings/text/html", "text": "codemirror" }, "$:/config/EditorTypeMappings/text/plain": { "title": "$:/config/EditorTypeMappings/text/plain", "text": "codemirror" }, "$:/config/EditorTypeMappings/text/vnd.tiddlywiki": { "title": "$:/config/EditorTypeMappings/text/vnd.tiddlywiki", "text": "codemirror" }, "$:/config/EditorTypeMappings/text/x-markdown": { "title": "$:/config/EditorTypeMappings/text/x-markdown", "text": "codemirror" }, "$:/config/EditorTypeMappings/text/x-tiddlywiki": { "title": "$:/config/EditorTypeMappings/text/x-tiddlywiki", "text": "codemirror" }, "$:/config/codemirror/cursorBlinkRate": { "title": "$:/config/codemirror/cursorBlinkRate", "type": "integer", "text": "530" }, "$:/config/codemirror/extraKeysTW": { "title": "$:/config/codemirror/extraKeysTW", "extend": "extraKeys", "type": "json", "text": "{\n\t\"Ctrl-Esc\": \"singleSelection\",\n\t\"Esc\": \"\",\n\t\"Ctrl-S\": \"\",\n\t\"Ctrl-U\": \"\",\n\t\"Ctrl-T\": \"\",\n\t\"Alt-T\": \"transposeChars\",\n\t\"Alt-U\": \"undoSelection\",\n\t\"Shift-Alt-U\": \"redoSelection\",\n\t\"Cmd-U\": \"\",\n\t\"Tab\": \"indentAuto()\",\n\t\"Enter\": \"newLineAndIndent()\"\n}\n" }, "$:/config/codemirror/indentUnit": { "title": "$:/config/codemirror/indentUnit", "type": "integer", "text": "2" }, "$:/config/codemirror/indentWithTabs": { "title": "$:/config/codemirror/indentWithTabs", "type": "bool", "text": "true" }, "$:/config/codemirror/inputStyle": { "title": "$:/config/codemirror/inputStyle", "type": "string", "text": "textarea" }, "$:/config/codemirror/keyMap": { "title": "$:/config/codemirror/keyMap", "type": "string", "text": "default" }, "$:/config/codemirror/lineNumbers": { "title": "$:/config/codemirror/lineNumbers", "type": "bool", "text": "false" }, "$:/config/codemirror/lineWrapping": { "title": "$:/config/codemirror/lineWrapping", "type": "bool", "text": "true" }, "$:/config/codemirror/showCursorWhenSelecting": { "title": "$:/config/codemirror/showCursorWhenSelecting", "type": "bool", "text": "true" }, "$:/config/codemirror/smartIndent": { "title": "$:/config/codemirror/smartIndent", "type": "bool", "text": "true" }, "$:/config/codemirror/styleActiveLine": { "title": "$:/config/codemirror/styleActiveLine", "type": "bool", "text": "false" }, "$:/config/codemirror/tabSize": { "title": "$:/config/codemirror/tabSize", "type": "integer", "text": "2" }, "$:/config/codemirror/theme": { "title": "$:/config/codemirror/theme", "type": "string", "text": "tiddlywiki" }, "$:/language/codemirror/homeUrl": { "title": "$:/language/codemirror/homeUrl", "text": "http://codemirror.net" }, "$:/language/codemirror/addOnUrl": { "title": "$:/language/codemirror/addOnUrl", "text": "http://codemirror.net/doc/manual.html#addons" }, "$:/language/codemirror/configUrl": { "title": "$:/language/codemirror/configUrl", "text": "http://codemirror.net/doc/manual.html#config" }, "$:/language/codemirror/controlPanel/hint": { "title": "$:/language/codemirror/controlPanel/hint", "text": "These settings let you customise the behaviour of [[CodeMirror|$:/plugins/tiddlywiki/codemirror]]." }, "$:/language/codemirror/controlPanel/keyboard": { "title": "$:/language/codemirror/controlPanel/keyboard", "text": "Keyboard shortcuts" }, "$:/language/codemirror/controlPanel/usage": { "title": "$:/language/codemirror/controlPanel/usage", "text": "Usage information" }, "$:/language/codemirror/cursorBlinkRate/hint": { "title": "$:/language/codemirror/cursorBlinkRate/hint", "text": "Cursor blink rate" }, "$:/language/codemirror/editorFont/hint": { "title": "$:/language/codemirror/editorFont/hint", "text": "Editor font family" }, "$:/language/codemirror/editorFont/info": { "title": "$:/language/codemirror/editorFont/info", "text": "Set the font family for the ~CodeMirror text-editor" }, "$:/language/codemirror/indentUnit/hint": { "title": "$:/language/codemirror/indentUnit/hint", "text": "How many spaces a block should be indented" }, "$:/language/codemirror/indentWithTabs/hint": { "title": "$:/language/codemirror/indentWithTabs/hint", "text": "Enable indenting with tabs" }, "$:/language/codemirror/indentWithTabs/info": { "title": "$:/language/codemirror/indentWithTabs/info", "text": "Whether, when indenting, the first N*`tabSize` spaces should be replaced by N tabs." }, "$:/language/codemirror/keyMap/hint": { "title": "$:/language/codemirror/keyMap/hint", "text": "~CodeMirror keymap" }, "$:/language/codemirror/keyMap/info": { "title": "$:/language/codemirror/keyMap/info", "text": "~The Keyboard KeyMap used within the ~CodeMirror text-editor" }, "$:/language/codemirror/lineNumbers/hint": { "title": "$:/language/codemirror/lineNumbers/hint", "text": "Enable line numbers" }, "$:/language/codemirror/lineNumbers/info": { "title": "$:/language/codemirror/lineNumbers/info", "text": "Whether to show line numbers to the left of the editor." }, "$:/language/codemirror/lineWrapping/hint": { "title": "$:/language/codemirror/lineWrapping/hint", "text": "Enable line wrapping" }, "$:/language/codemirror/lineWrapping/info": { "title": "$:/language/codemirror/lineWrapping/info", "text": "Whether CodeMirror should scroll or wrap for long lines. Defaults to `false` (scroll)." }, "$:/language/codemirror/showCursorWhenSelecting/hint": { "title": "$:/language/codemirror/showCursorWhenSelecting/hint", "text": "Show cursor, when selecting" }, "$:/language/codemirror/showCursorWhenSelecting/info": { "title": "$:/language/codemirror/showCursorWhenSelecting/info", "text": "Whether the cursor should be drawn when a selection is active." }, "$:/language/codemirror/smartIndent/hint": { "title": "$:/language/codemirror/smartIndent/hint", "text": "Enable smart indent" }, "$:/language/codemirror/smartIndent/info": { "title": "$:/language/codemirror/smartIndent/info", "text": "Whether to use the context-sensitive indentation that the mode provides (or just indent the same as the line before). Defaults to `true`." }, "$:/language/codemirror/styleActiveLine/hint": { "title": "$:/language/codemirror/styleActiveLine/hint", "text": "Highlight active line" }, "$:/language/codemirror/styleActiveLine/info": { "title": "$:/language/codemirror/styleActiveLine/info", "text": "Whether or not to highlight the active text-editor line" }, "$:/language/codemirror/tabSize/hint": { "title": "$:/language/codemirror/tabSize/hint", "text": "Width of a tab character" }, "$:/language/codemirror/theme/hint": { "title": "$:/language/codemirror/theme/hint", "text": "Select a theme" }, "$:/language/codemirror/theme/info": { "title": "$:/language/codemirror/theme/info", "text": "Choose between ~CodeMirror themes" }, "$:/plugins/tiddlywiki/codemirror/edit-codemirror.js": { "title": "$:/plugins/tiddlywiki/codemirror/edit-codemirror.js", "text": "/*\\\ntitle: $:/plugins/tiddlywiki/codemirror/edit-codemirror.js\ntype: application/javascript\nmodule-type: widget\n\nEdit-codemirror widget\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar editTextWidgetFactory = require(\"$:/core/modules/editor/factory.js\").editTextWidgetFactory,\n\tCodeMirrorEngine = require(\"$:/plugins/tiddlywiki/codemirror/engine.js\").CodeMirrorEngine;\n\nexports[\"edit-codemirror\"] = editTextWidgetFactory(CodeMirrorEngine,CodeMirrorEngine);\n\n})();\n", "type": "application/javascript", "module-type": "widget" }, "$:/plugins/tiddlywiki/codemirror/engine.js": { "title": "$:/plugins/tiddlywiki/codemirror/engine.js", "text": "/*\\\ntitle: $:/plugins/tiddlywiki/codemirror/engine.js\ntype: application/javascript\nmodule-type: library\n\nText editor engine based on a CodeMirror instance\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true */\n/*global $tw: false */\n\"use strict\";\n\nvar CODEMIRROR_OPTIONS = \"$:/config/CodeMirror\",\nHEIGHT_VALUE_TITLE = \"$:/config/TextEditor/EditorHeight/Height\",\nCONFIG_FILTER = \"[all[shadows+tiddlers]prefix[$:/config/codemirror/]]\"\n\t\n// Install CodeMirror\nif($tw.browser && !window.CodeMirror) {\n\n\tvar modules = $tw.modules.types[\"codemirror\"];\n\tvar req = Object.getOwnPropertyNames(modules);\n\n\twindow.CodeMirror = require(\"$:/plugins/tiddlywiki/codemirror/lib/codemirror.js\");\n\t// Install required CodeMirror plugins\n\tif(req) {\n\t\tif($tw.utils.isArray(req)) {\n\t\t\tfor(var index=0; index 0) {\n\t\tvar anchorPos = this.cm.indexFromPos(selections[0].anchor),\n\t\theadPos = this.cm.indexFromPos(selections[0].head);\n\t}\n\tvar operation = {\n\t\ttext: this.cm.getValue(),\n\t\tselStart: Math.min(anchorPos,headPos),\n\t\tselEnd: Math.max(anchorPos,headPos),\n\t\tcutStart: null,\n\t\tcutEnd: null,\n\t\treplacement: null,\n\t\tnewSelStart: null,\n\t\tnewSelEnd: null\n\t};\n\toperation.selection = operation.text.substring(operation.selStart,operation.selEnd);\n\treturn operation;\n};\n\n/*\nExecute a text operation\n*/\nCodeMirrorEngine.prototype.executeTextOperation = function(operation) {\n\t// Perform the required changes to the text area and the underlying tiddler\n\tvar newText = operation.text;\n\tif(operation.replacement !== null) {\n\t\tthis.cm.replaceRange(operation.replacement,this.cm.posFromIndex(operation.cutStart),this.cm.posFromIndex(operation.cutEnd));\n\t\tthis.cm.setSelection(this.cm.posFromIndex(operation.newSelStart),this.cm.posFromIndex(operation.newSelEnd));\n\t\tnewText = operation.text.substring(0,operation.cutStart) + operation.replacement + operation.text.substring(operation.cutEnd);\n\t}\n\tthis.cm.focus();\n\treturn newText;\n};\n\nexports.CodeMirrorEngine = CodeMirrorEngine;\n\n})();\n", "type": "application/javascript", "module-type": "library" }, "$:/plugins/tiddlywiki/codemirror/lib/codemirror.js": { "text": "!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=e||self).CodeMirror=t()}(this,function(){\"use strict\";var e=navigator.userAgent,t=navigator.platform,d=/gecko\\/\\d/i.test(e),n=/MSIE \\d/.test(e),r=/Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(e),i=/Edge\\/(\\d+)/.exec(e),w=n||r||i,v=w&&(n?document.documentMode||6:+(i||r)[1]),f=!i&&/WebKit\\//.test(e),r=f&&/Qt\\/\\d+\\.\\d+/.test(e),o=!i&&/Chrome\\//.test(e),p=/Opera\\//.test(e),c=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(e),u=/PhantomJS/.test(e),s=!i&&/AppleWebKit/.test(e)&&/Mobile\\/\\w+/.test(e),a=/Android/.test(e),h=s||a||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),g=s||/Mac/.test(t),m=/\\bCrOS\\b/.test(e),y=/win/i.test(t),e=p&&e.match(/Version\\/(\\d*\\.\\d*)/);(e=e&&Number(e[1]))&&15<=e&&(f=!(p=!1));var b=g&&(r||p&&(null==e||e<12.11)),x=d||w&&9<=v;function C(e){return new RegExp(\"(^|\\\\s)\"+e+\"(?:$|\\\\s)\\\\s*\")}var S,L=function(e,t){var n=e.className,r=C(t).exec(n);r&&(t=n.slice(r.index+r[0].length),e.className=n.slice(0,r.index)+(t?r[1]+t:\"\"))};function k(e){for(var t=e.childNodes.length;0t)return i;o.to==t&&(o.from!=o.to&&\"before\"==n?r=i:oe=i),o.from==t&&(o.from!=o.to&&\"before\"!=n?r=i:oe=i)}return null!=r?r:oe}var se,ae,ue,ce,he,de,fe,pe=(se=\"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\",ae=\"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\",ue=/[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/,ce=/[stwN]/,he=/[LRr]/,de=/[Lb1n]/,fe=/[1n]/,function(e,t){var n=\"ltr\"==t?\"L\":\"R\";if(0==e.length||\"ltr\"==t&&!ue.test(e))return!1;for(var r,i=e.length,o=[],l=0;l=e.size)throw new Error(\"There is no line \"+(t+e.first)+\" in the document.\");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?rt(n,$e(e,n).text.length):(e=$e(e,(n=t).line).text.length,null==(t=n.ch)||e=this.string.length},_e.prototype.sol=function(){return this.pos==this.lineStart},_e.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},_e.prototype.next=function(){if(this.post},_e.prototype.eatSpace=function(){for(var e=this.pos;/[\\s\\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},_e.prototype.skipToEnd=function(){this.pos=this.string.length},_e.prototype.skipTo=function(e){e=this.string.indexOf(e,this.pos);if(-1e.options.maxHighlightLength&&je(e.doc.mode,r.state),o=pt(e,t,r),i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))),t.styles}function mt(n,r,e){var t=n.doc,i=n.display;if(!t.mode.startState)return new ft(t,!0,r);var o=function(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;lt.first&&$e(t,o-1).stateAfter,s=l?ft.fromSaved(t,l,o):new ft(t,Ye(t.mode),o);return t.iter(o,r,function(e){vt(n,e.text,s);var t=s.line;e.stateAfter=t==r-1||t%5==0||t>=i.viewFrom&&tt.start)return o}throw new Error(\"Mode \"+e.name+\" failed to advance stream.\")}ft.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ft.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,\"\"),size:this.baseTokens[this.baseTokenPos]-e}},ft.prototype.nextLine=function(){this.line++,0e.options.maxHighlightLength?(s=!1,l&&vt(e,t,r,c.pos),c.pos=t.length,null):Ct(bt(n,c,r.state,h),o);if(!h||(d=h[0].name)&&(f=\"m-\"+(f?d+\" \"+f:d)),!s||u!=f){for(;a=t:l.to>t),(r=r||[]).push(new Tt(s,l.from,o?null:l.to)))}return r}(n,i,e),s=function(e,t,n){var r;if(e)for(var i=0;i=t:l.to>t))&&(l.from!=t||\"bookmark\"!=s.type||n&&!l.marker.insertLeft)||(o=null==l.from||(s.inclusiveLeft?l.from<=t:l.frome.lastLine())return t;var n,r=$e(e,t);if(!Ut(e,r))return t;for(;n=It(r);)r=n.find(1,!0).line;return Je(r)+1}function Ut(e,t){var n=kt&&t.markedSpans;if(n)for(var r,i=0;in.maxLineLength&&(n.maxLineLength=t,n.maxLine=e)})}var Xt=function(e,t,n){this.text=e,Dt(this,t),this.height=n?n(this):1};Xt.prototype.lineNo=function(){return Je(this)},ke(Xt);var Yt={},_t={};function $t(e,t){if(!e||/^\\s*$/.test(e))return null;t=t.addModeClass?_t:Yt;return t[e]||(t[e]=e.replace(/\\S+/g,\"cm-$&\"))}function qt(e,t){var n=N(\"span\",null,null,f?\"padding-right: .1px\":null),r={pre:N(\"pre\",[n],\"CodeMirror-line\"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption(\"lineWrapping\")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=Qt,function(e){if(null!=He)return He;var t=T(e,document.createTextNode(\"AخA\")),n=S(t,0,1).getBoundingClientRect(),t=S(t,1,2).getBoundingClientRect();return k(e),n&&n.left!=n.right&&(He=t.right-n.right<3)}(e.display.measure)&&(l=me(o,e.doc.direction))&&(r.addToken=function(h,d){return function(e,t,n,r,i,o,l){n=n?n+\" cm-force-border\":\"cm-force-border\";for(var s=e.pos,a=s+t.length;;){for(var u=void 0,c=0;cs&&u.from<=s);c++);if(u.to>=a)return h(e,t,n,r,i,o,l);h(e,t.slice(0,u.to-s),n,r,null,o,l),r=null,t=t.slice(u.to-s),s=u.to}}}(r.addToken,l)),r.map=[],function(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var l=1;lg||S.collapsed&&C.to==g&&C.from==g)){if(null!=C.to&&C.to!=g&&y>C.to&&(y=C.to,c=\"\"),S.className&&(u+=\" \"+S.className),S.css&&(a=(a?a+\";\":\"\")+S.css),S.startStyle&&C.from==g&&(h+=\" \"+S.startStyle),S.endStyle&&C.to==y&&(w=w||[]).push(S.endStyle,C.to),S.title&&((f=f||{}).title=S.title),S.attributes)for(var L in S.attributes)(f=f||{})[L]=S.attributes[L];S.collapsed&&(!d||Ft(d.marker,S)<0)&&(d=C)}else C.from>g&&y>C.from&&(y=C.from)}if(w)for(var k=0;kn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ln(e,t,n,r){return Mn(e,Tn(e,t),n,r)}function kn(e,t){if(t>=e.display.viewFrom&&t=e.lineN&&tt)&&(i=(o=a-s)-1,a<=t&&(l=\"right\")),null!=i){if(r=e[u+2],s==a&&n==(r.insertLeft?\"left\":\"right\")&&(l=n),\"left\"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],l=\"left\";if(\"right\"==n&&i==a-s)for(;u=i.text.length?(t=i.text.length,u=\"before\"):t<=0&&(t=0,u=\"after\"),!a)return s(\"before\"==u?t-1:t,\"before\"==u);function c(e,t,n){return s(n?e-1:e,1==a[t].level!=n)}var h=le(a,t,u),e=oe,h=c(t,h,\"before\"==u);return null!=e&&(h.other=c(t,e,\"before\"!=u)),h}function Gn(e,t){var n=0;t=ct(e.doc,t),e.options.lineWrapping||(n=_n(e.display)*t.ch);t=$e(e.doc,t.line),e=Vt(t)+vn(e.display);return{left:n,right:n,top:e,bottom:e+t.height}}function Un(e,t,n,r,i){n=rt(e,t,n);return n.xRel=i,r&&(n.outside=r),n}function Vn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Un(r.first,0,null,-1,-1);var i=et(r,n),o=r.first+r.size-1;if(o=a||f.to<=s||(d=1!=f.level,d=Mn(e,r,d?Math.min(a,f.to)-1:Math.max(s,f.from)).right,d=da&&(u={from:u.from,to:a,level:u.level});return u}:function(n,r,i,o,l,s,a){var e=ie(function(e){var t=l[e],e=1!=t.level;return Xn(Bn(n,rt(i,e?t.to:t.from,e?\"before\":\"after\"),\"line\",r,o),s,a,!0)},0,l.length-1),t=l[e];{var u;0a&&(t=l[e-1]))}return t})(n,e,t,o,c,r,i),u=1!=f.level,s=u?f.from:f.to-1,a=u?f.to:f.from-1);var h=null,d=null,c=ie(function(e){var t=Mn(n,o,e);return t.top+=l,t.bottom+=l,Xn(t,r,i,!1)&&(t.top<=i&&t.left<=r&&(h=e,d=t),1)},s,a),f=!1;{var p,g;d?(p=r-d.left=u.bottom?1:0)}return c=re(e.text,c,1),Un(t,c,g,f,r-p)}(e,l,i,t,n),a=function(e,t){var n,r=kt&&e.markedSpans;if(r)for(var i=0;it)&&(!n||Ft(n,o.marker)<0)&&(n=o.marker)}return n}(l,s.ch+(0r},e,i)}}function jn(e,t,n,r){return Kn(e,t,n=n||Tn(e,t),In(e,t,Mn(e,n,r),\"line\").top)}function Xn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Yn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Nn){Nn=M(\"pre\",null,\"CodeMirror-line-like\");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode(\"x\")),Nn.appendChild(M(\"br\"));Nn.appendChild(document.createTextNode(\"x\"))}T(e.measure,Nn);var n=Nn.offsetHeight/50;return 3=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(l.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=l.viewTo?kt&&Bt(e.doc,t)l.viewFrom?rr(e):(l.viewFrom+=r,l.viewTo+=r):t<=l.viewFrom&&n>=l.viewTo?rr(e):t<=l.viewFrom?(i=ir(e,n,n+r,1))?(l.view=l.view.slice(i.index),l.viewFrom=i.lineN,l.viewTo+=r):rr(e):n>=l.viewTo?(o=ir(e,t,t,-1))?(l.view=l.view.slice(0,o.index),l.viewTo=o.lineN):rr(e):(i=ir(e,t,t,-1),o=ir(e,n,n+r,1),i&&o?(l.view=l.view.slice(0,i.index).concat(tn(e,i.lineN,o.lineN)).concat(l.view.slice(o.index)),l.viewTo+=r):rr(e));e=l.externalMeasured;e&&(n=i.lineN&&t=r.viewTo||(null==(t=r.view[er(e,t)]).node||-1==R(t=t.changes||(t.changes=[]),n)&&t.push(n))}function rr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ir(e,t,n,r){var i,o=er(e,t),l=e.display.view;if(!kt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,a=0;a=e.display.viewTo||n.to().linet||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?\"rtl\":\"ltr\",o),i=!0)}i||r(t,n,\"ltr\")}(C,g||0,null==m?b:m,function(e,t,n,r){var i,o,l,s,a=\"ltr\"==n,u=w(e,a?\"left\":\"right\"),c=w(t-1,a?\"right\":\"left\"),h=null==g&&0==e,d=null==m&&t==b,f=0==r,p=!C||r==C.length-1;c.top-u.top<=3?(i=(k?d:h)&&p,r=(k?h:d)&&f?S:(a?u:c).left,i=i?L:(a?c:u).right,T(r,u.top,i-r,u.bottom)):(n=a?(o=k&&h&&f?S:u.left,l=k?L:x(e,n,\"before\"),s=k?S:x(t,n,\"after\"),k&&d&&p?L:c.right):(o=k?x(e,n,\"before\"):S,l=!k&&h&&f?L:u.right,s=!k&&d&&p?S:c.left,k?x(t,n,\"after\"):L),T(o,u.top,l-o,u.bottom),u.bottome.display.sizerWidth&&((a=Math.ceil(a/_n(e.display)))>e.display.maxLineLength&&(e.display.maxLineLength=a,e.display.maxLine=o.line,e.display.maxLineChanged=!0))}}}function mr(e){if(e.widgets)for(var t=0;t=r&&(o=et(t,Vt($e(t,n))-e.wrapper.clientHeight),r=n)),{from:o,to:Math.max(r,o+1)}}function yr(e,t){var n=e.display,r=Yn(e.display);t.top<0&&(t.top=0);var i=(e.curOp&&null!=e.curOp.scrollTop?e.curOp:n.scroller).scrollTop,o=Cn(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+yn(n),a=t.tops-r;t.topi+o&&((u=Math.min(t.top,(r?s:t.bottom)-o))!=i&&(l.scrollTop=u));var i=e.options.fixedGutter?0:n.gutters.offsetWidth,u=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-i,e=xn(e)-n.gutters.offsetWidth,n=t.right-t.left>e;return n&&(t.right=t.left+e),t.left<10?l.scrollLeft=0:t.lefte+u-3&&(l.scrollLeft=t.right+(n?0:10)-e),l}function br(e,t){null!=t&&(Cr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc:e.curOp).scrollTop+t)}function wr(e){Cr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function xr(e,t,n){null==t&&null==n||Cr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Cr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Sr(e,Gn(e,t.from),Gn(e,t.to),t.margin))}function Sr(e,t,n,r){r=yr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});xr(e,r.scrollLeft,r.scrollTop)}function Lr(e,t){Math.abs(e.doc.scrollTop-t)<2||(d||Kr(e,{top:t}),kr(e,t,!0),d&&Kr(e),zr(e,100))}function kr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Tr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Yr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Mr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+yn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+wn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}e=function(e,t,n){this.cm=n;var r=this.vert=M(\"div\",[M(\"div\",null,null,\"min-width: 1px\")],\"CodeMirror-vscrollbar\"),i=this.horiz=M(\"div\",[M(\"div\",null,null,\"height: 100%; min-height: 1px\")],\"CodeMirror-hscrollbar\");r.tabIndex=i.tabIndex=-1,e(r),e(i),ye(r,\"scroll\",function(){r.clientHeight&&t(r.scrollTop,\"vertical\")}),ye(i,\"scroll\",function(){i.clientWidth&&t(i.scrollLeft,\"horizontal\")}),this.checkedZeroWidth=!1,w&&v<8&&(this.horiz.style.minHeight=this.vert.style.minWidth=\"18px\")};e.prototype.update=function(e){var t,n=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;return r?(this.vert.style.display=\"block\",this.vert.style.bottom=n?i+\"px\":\"0\",t=e.viewHeight-(n?i:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+\"px\"):(this.vert.style.display=\"\",this.vert.firstChild.style.height=\"0\"),n?(this.horiz.style.display=\"block\",this.horiz.style.right=r?i+\"px\":\"0\",this.horiz.style.left=e.barLeft+\"px\",t=e.viewWidth-e.barLeft-(r?i:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+t)+\"px\"):(this.horiz.style.display=\"\",this.horiz.firstChild.style.width=\"0\"),!this.checkedZeroWidth&&0=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Gr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}(t[n]);for(var r=0;r(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null==i||u||(t=M(\"div\",\"​\",null,\"position: absolute;\\n top: \"+(t.top-n.viewOffset-vn(e.display))+\"px;\\n height: \"+(t.bottom-t.top+wn(e)+n.barHeight)+\"px;\\n left: \"+t.left+\"px; width: \"+Math.max(2,t.right-t.left)+\"px;\"),e.display.lineSpace.appendChild(t),t.scrollIntoView(i),e.display.lineSpace.removeChild(t)))}(t,i))}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var s=0;s=l.display.viewTo||(s=+new Date+l.options.workTime,a=mt(l,c.highlightFrontier),u=[],c.iter(a.line,Math.min(c.first+c.size,l.display.viewTo+500),function(e){if(a.line>=l.display.viewFrom){var t=e.styles,n=e.text.length>l.options.maxHighlightLength?je(c.mode,a.state):null,r=pt(l,e,a,!0);n&&(a.state=n),e.styles=r.styles;n=e.styleClasses,r=r.classes;r?e.styleClasses=r:n&&(e.styleClasses=null);for(var i=!t||t.length!=e.styles.length||n!=r&&(!n||!r||n.bgClass!=r.bgClass||n.textClass!=r.textClass),o=0;!i&&os)return zr(l,l.options.workDelay),!0}),c.highlightFrontier=a.line,c.modeFrontier=Math.max(c.modeFrontier,a.line),u.length&&Er(l,function(){for(var e=0;e=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==or(e))return!1;_r(e)&&(rr(e),t.dims=$n(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),kt&&(o=Bt(e.doc,o),l=Gt(e.doc,l));var s=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;r=o,i=l,0==(l=(o=e).display).view.length||r>=l.viewTo||i<=l.viewFrom?(l.view=tn(o,r,i),l.viewFrom=r):(l.viewFrom>r?l.view=tn(o,r,l.viewFrom).concat(l.view):l.viewFromi&&(l.view=l.view.slice(0,er(o,i)))),l.viewTo=i,n.viewOffset=Vt($e(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+\"px\";o=or(e);if(!s&&0==o&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;l=function(e){if(e.hasFocus())return null;var t=O();if(!t||!A(e.display.lineDiv,t))return null;var n={activeElt:t};return!window.getSelection||(t=window.getSelection()).anchorNode&&t.extend&&A(e.display.lineDiv,t.anchorNode)&&(n.anchorNode=t.anchorNode,n.anchorOffset=t.anchorOffset,n.focusNode=t.focusNode,n.focusOffset=t.focusOffset),n}(e);return 4=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Ur(e,t))break;gr(e);var i=Mr(e);lr(e),Nr(e,i),Xr(e,i),t.force=!1}t.signal(e,\"update\",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,\"viewportChange\",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Kr(e,t){var n=new Gr(e,t);Ur(e,n)&&(gr(e),Vr(e,n),t=Mr(e),lr(e),Nr(e,t),Xr(e,t),n.finish())}function jr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+\"px\"}function Xr(e,t){e.display.sizer.style.minHeight=t.docHeight+\"px\",e.display.heightForcer.style.top=t.docHeight+\"px\",e.display.gutters.style.height=t.docHeight+e.display.barHeight+wn(e)+\"px\"}function Yr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=qn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+\"px\",l=0;ll.clientWidth,a=l.scrollHeight>l.clientHeight;if(r&&s||i&&a){if(i&&g&&f)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var h=0;hs-(e.cm?e.cm.options.historyEventDelay:500)||\"*\"==t.origin.charAt(0)))&&(o=(a=i).lastOp==r?(xi(a.done),Y(a.done)):a.done.length&&!Y(a.done).ranges?Y(a.done):1i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||xe(e,\"historyAdded\")}function Si(e,t,n,r){var i,o,l,s=e.history,a=r&&r.origin;n==s.lastSelOp||a&&s.lastSelOrigin==a&&(s.lastModTime==s.lastSelTime&&s.lastOrigin==a||(i=e,o=a,l=Y(s.done),e=t,\"*\"==(o=o.charAt(0))||\"+\"==o&&l.ranges.length==e.ranges.length&&l.somethingSelected()==e.somethingSelected()&&new Date-i.history.lastSelTime<=(i.cm?i.cm.options.historyEventDelay:500)))?s.done[s.done.length-1]=t:Li(t,s.done),s.lastSelTime=+new Date,s.lastSelOrigin=a,s.lastSelOp=n,r&&!1!==r.clearRedo&&xi(s.undone)}function Li(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ki(t,n,e,r){var i=n[\"spans_\"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,r),function(e){e.markedSpans&&((i=i||(n[\"spans_\"+t.id]={}))[o]=e.markedSpans),++o})}function Ti(e,t){var n=t[\"spans_\"+e.id];if(!n)return null;for(var r=[],i=0;i=t.ch:s.to>t.ch))){if(i&&(xe(a,\"beforeCursorEnter\"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(a.atomic){if(n){var h=a.find(r<0?1:-1),s=void 0;if((r<0?c:u)&&(h=Ui(e,h,-r,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(s=it(h,n))&&(r<0?s<0:0e.first?ct(e,rt(t.line-1)):null:0e.lastLine()||(t.from.linei&&(t={from:t.from,to:rt(i,$e(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),n=n||ci(e,t),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=Je(zt($e(r,o.line))),r.iter(a,l.line+1,function(e){if(e==i.maxLine)return s=!0}));-1i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiert.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&tr(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Ri(t.doc)),t&&ln(t,\"markerCleared\",t,this,r,i),n&&Fr(t),this.parent&&this.parent.clear()}},lo.prototype.find=function(e,t){var n,r;null==e&&\"bookmark\"==this.type&&(e=1);for(var i=0;i=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(i,o,l){i=ct(this,i),o=ct(this,o);var s=[],a=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var n=0;n=r.to||null==r.from&&a!=i.line||null!=r.from&&a==o.line&&r.from>=o.ch||l&&!l(r.marker)||s.push(r.marker.parent||r.marker)}++a}),s},getAllMarks:function(){var r=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var n=0;nt&&(t=e.from),null!=e.to&&e.toe.text.length?null:n}function Fo(e,t,n){e=Ho(e,t.ch,n);return null==e?null:new rt(t.line,e,n<0?\"after\":\"before\")}function Eo(e,t,n,r,i){if(e){\"rtl\"==t.doc.direction&&(i=-i);var o=me(n,t.doc.direction);if(o){var l,s,a,e=i<0?Y(o):o[0],o=i<0==(1==e.level)?\"after\":\"before\";return 0=n.text.length?(s.ch=n.text.length,s.sticky=\"before\"):s.ch<=0&&(s.ch=0,s.sticky=\"after\");var r=le(a,s.ch,s.sticky),i=a[r];if(\"ltr\"==t.doc.direction&&i.level%2==0&&(0s.ch:i.from=i.from&&d>=c.begin)){var f=h?\"before\":\"after\";return new rt(s.line,d,f)}}f=function(e,t,n){for(var r=function(e,t){return t?new rt(s.line,u(e,1),\"before\"):new rt(s.line,e,\"after\")};0<=e&&el.doc.first&&((n=$e(l.doc,e.line-1).text)&&(e=new rt(e.line,1),l.replaceRange(t.charAt(0)+l.doc.lineSeparator()+n.charAt(n.length-1),rt(e.line-1,n.length-1),e,\"+transpose\")))),i.push(new oi(e,e)));l.setSelections(i)})},newlineAndIndent:function(r){return Er(r,function(){for(var e=r.listSelections(),t=e.length-1;0<=t;t--)r.replaceRange(r.doc.lineSeparator(),e[t].anchor,e[t].head,\"+input\");e=r.listSelections();for(var n=0;nc&&t.push(new oi(rt(s,c),rt(s,K(u,l,n))))}t.length||t.push(new oi(f,f)),Ei(g,li(d,y.ranges.slice(0,v).concat(t),v),{origin:\"*mouse\",scroll:!1}),d.scrollIntoView(e)}else{var h,r=m,i=Jo(d,e,p.unit),e=r.anchor,e=0=n.to||o.linea.bottom?20:0)&&setTimeout(Pr(d,function(){u==i&&(l.scroller.scrollTop+=r,e(t))}),50))}:n)(e)}),i=Pr(d,n);d.state.selectingText=i,ye(l.wrapper.ownerDocument,\"mousemove\",r),ye(l.wrapper.ownerDocument,\"mouseup\",i)})(e,r,t,o)}(l,t,i,e):Oe(e)==s.scroller&&Te(e):2==n?(t&&Oi(l.doc,t),setTimeout(function(){return s.input.focus()},20)):3==n&&(x?l.display.input.onContextMenu(e):dr(l)))))}function Jo(e,t,n){if(\"char\"==n)return new oi(t,t);if(\"word\"==n)return e.findWordAt(t);if(\"line\"==n)return new oi(rt(t.line,0),ct(e.doc,rt(t.line+1,0)));t=n(e,t);return new oi(t.from,t.to)}function el(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Te(t);var l=e.display,r=l.lineDiv.getBoundingClientRect();if(o>r.bottom||!Le(e,n))return Ne(t);o-=r.top-l.viewOffset;for(var s=0;s=i)return xe(e,n,e,et(e.doc,o),e.display.gutterSpecs[s].className,t),Ne(t)}}function tl(e,t){return el(e,t,\"gutterClick\",!0)}function nl(e,t){var n,r;mn(e.display,t)||(r=t,Le(n=e,\"gutterContextMenu\")&&el(n,r,\"gutterContextMenu\",!1))||Ce(e,t,\"contextmenu\")||x||e.display.input.onContextMenu(t)}function rl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\\s*cm-s-\\S+/g,\"\")+e.options.theme.replace(/(^|\\s)\\s*/g,\" cm-s-\"),Hn(e)}Zo.prototype.compare=function(e,t,n){return this.time+400>e&&0==it(t,this.pos)&&n==this.button};var il={toString:function(){return\"CodeMirror.Init\"}},ol={},ll={};function sl(e,t,n){!t!=!(n&&n!=il)&&(n=e.display.dragFunctions,(t=t?ye:we)(e.display.scroller,\"dragstart\",n.start),t(e.display.scroller,\"dragenter\",n.enter),t(e.display.scroller,\"dragover\",n.over),t(e.display.scroller,\"dragleave\",n.leave),t(e.display.scroller,\"drop\",n.drop))}function al(e){e.options.lineWrapping?(D(e.display.wrapper,\"CodeMirror-wrap\"),e.display.sizer.style.minWidth=\"\",e.display.sizerWidth=null):(L(e.display.wrapper,\"CodeMirror-wrap\"),jt(e)),Qn(e),tr(e),Hn(e),setTimeout(function(){return Nr(e)},100)}function ul(e,t){var n=this;if(!(this instanceof ul))return new ul(e,t);this.options=t=t?E(t):{},E(ol,t,!1);var r=t.value;\"string\"==typeof r?r=new ho(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i,o=new ul.inputStyles[t.inputStyle](this),o=this.display=new Qr(e,r,o,t);for(i in rl(o.wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=\" CodeMirror-wrap\"),Dr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new I,keySeq:null,specialChars:null},t.autofocus&&!h&&o.input.focus(),w&&v<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(r){var i=r.display;ye(i.scroller,\"mousedown\",Pr(r,Qo)),ye(i.scroller,\"dblclick\",w&&v<11?Pr(r,function(e){var t;Ce(r,e)||(!(t=Jn(r,e))||tl(r,e)||mn(r.display,e)||(Te(e),t=r.findWordAt(t),Oi(r.doc,t.anchor,t.head)))}):function(e){return Ce(r,e)||Te(e)});ye(i.scroller,\"contextmenu\",function(e){return nl(r,e)}),ye(i.input.getField(),\"contextmenu\",function(e){i.scroller.contains(e.target)||nl(r,e)});var n,o={end:0};function l(){i.activeTouch&&(n=setTimeout(function(){return i.activeTouch=null},1e3),(o=i.activeTouch).end=+new Date)}function s(e,t){if(null==t.left)return 1;var n=t.left-e.left,e=t.top-e.top;return 400o.first?P($e(o,t-1).text,null,l):0:\"add\"==n?u=a+e.options.indentUnit:\"subtract\"==n?u=a-e.options.indentUnit:\"number\"==typeof n&&(u=a+n),u=Math.max(0,u);var h=\"\",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/l);f;--f)d+=l,h+=\"\\t\";if(dl,a=Ee(t),u=null;if(s&&1l?\"cut\":\"+input\")};ji(e.doc,g),ln(e,\"inputRead\",e,g)}t&&!s&&ml(e,t),wr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function gl(e,t){var n=e.clipboardData&&e.clipboardData.getData(\"Text\");return n&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Er(t,function(){return pl(t,n,0,null,\"paste\")}),1)}function ml(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;0<=r;r--){var i=n.ranges[r];if(!(100=r.first+r.size||(i=new rt(n,i.ch,i.sticky),!(a=$e(r,n))))return;i=Eo(s,r.cm,a,i.line,u)}else i=t;return 1}if(\"char\"==l||\"codepoint\"==l)n();else if(\"column\"==l)n(!0);else if(\"word\"==l||\"group\"==l)for(var c=null,h=\"group\"==l,d=r.cm&&r.cm.getHelper(i,\"wordChars\"),f=!0;!(o<0)||n(!f);f=!1){var p=a.text.charAt(i.ch)||\"\\n\",p=J(p,d)?\"w\":h&&\"\\n\"==p?\"n\":!h||/\\s/.test(p)?null:\"p\";if(!h||f||p||(p=\"s\"),c&&c!=p){o<0&&(o=1,n(),i.sticky=\"after\");break}if(p&&(c=p),0=s.height){l.hitSide=!0;break}o+=5*n}return l}e=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new I,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Cl(e,t){var n=kn(e,t.line);if(!n||n.hidden)return null;var r=$e(e.doc,t.line),n=Sn(n,r,t.line),r=me(r,e.doc.direction),e=\"left\";r&&(e=le(r,t.ch)%2?\"right\":\"left\");e=On(n.map,t.ch,e);return e.offset=\"right\"==e.collapse?e.end:e.start,e}function Sl(e,t){return t&&(e.bad=!0),e}function Ll(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Sl(e.clipPos(rt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i=t.display.viewTo||i.line=t.display.viewFrom&&Cl(t,r)||{node:n[0].measure.map[2],offset:0},s=i.linet.firstLine()&&(i=rt(i.line-1,$e(t.doc,i.line-1).length)),r.ch==$e(t.doc,r.line).text.length&&r.linen.viewTo-1)return!1;m=i.line==n.viewFrom||0==(m=er(t,i.line))?(e=Je(n.view[0].line),n.view[0].node):(e=Je(n.view[m].line),n.view[m-1].node.nextSibling);var o,r=er(t,r.line),r=r==n.view.length-1?(o=n.viewTo-1,n.lineDiv.lastChild):(o=Je(n.view[r+1].line)-1,n.view[r+1].node.previousSibling);if(!m)return!1;for(var l=t.doc.splitLines(function(l,e,t,s,a){var n=\"\",u=!1,c=l.doc.lineSeparator(),h=!1;function d(){u&&(n+=c,h&&(n+=c),u=h=!1)}function f(e){e&&(d(),n+=e)}for(;!function e(t){if(1==t.nodeType){var n=t.getAttribute(\"cm-text\");if(n)f(n);else if(n=t.getAttribute(\"cm-marker\"))(n=l.findMarks(rt(s,0),rt(a+1,0),(o=+n,function(e){return e.id==o}))).length&&(r=n[0].find(0))&&f(qe(l.doc,r.from,r.to).join(c));else if(\"false\"!=t.getAttribute(\"contenteditable\")){var r=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(/^br$/i.test(t.nodeName)||0!=t.textContent.length){r&&d();for(var i=0;ii.ch&&f.charCodeAt(f.length-u-1)==p.charCodeAt(p.length-u-1);)a--,u++;l[l.length-1]=f.slice(0,f.length-u).replace(/^\\u200b+/,\"\"),l[0]=l[0].slice(a).replace(/\\u200b+$/,\"\");var m=rt(e,a),r=rt(o,s.length?Y(s).length-u:0);return 1n&&(hl(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&wr(this));else{for(var o=i.from(),l=i.to(),i=Math.max(n,o.line),n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1,s=i;s>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]o)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=o&&(a=e.bottom),u+t.offsetWidth>l&&(u=l-t.offsetWidth)),t.style.top=a+\"px\",t.style.left=t.style.right=\"\",\"right\"==i?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right=\"0px\"):(\"left\"==i?u=0:\"middle\"==i&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+\"px\"),n&&(n=this,t={left:u,top:a,right:u+t.offsetWidth,bottom:a+t.offsetHeight},null!=(t=yr(n,t)).scrollTop&&Lr(n,t.scrollTop),null!=t.scrollLeft&&Tr(n,t.scrollLeft))},triggerOnKeyDown:Ir(Xo),triggerOnKeyPress:Ir(_o),triggerOnKeyUp:Yo,triggerOnMouseDown:Ir(Qo),execCommand:function(e){if(Io.hasOwnProperty(e))return Io[e].call(null,this)},triggerElectric:Ir(function(e){ml(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ct(this.doc,e),l=0;l span::selection,.CodeMirror-line > span > span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line > span::-moz-selection,.CodeMirror-line > span > span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:none}\n", "type": "text/vnd.tiddlywiki", "title": "$:/plugins/tiddlywiki/codemirror/lib/codemirror.css", "tags": "[[$:/tags/Stylesheet]]" }, "$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.css": { "text": ".CodeMirror-dialog {\n position: absolute;\n left: 0; right: 0;\n background: inherit;\n z-index: 15;\n padding: .1em .8em;\n overflow: hidden;\n color: inherit;\n}\n\n.CodeMirror-dialog-top {\n border-bottom: 1px solid #eee;\n top: 0;\n}\n\n.CodeMirror-dialog-bottom {\n border-top: 1px solid #eee;\n bottom: 0;\n}\n\n.CodeMirror-dialog input {\n border: none;\n outline: none;\n background: transparent;\n width: 20em;\n color: inherit;\n font-family: monospace;\n}\n\n.CodeMirror-dialog button {\n font-size: 70%;\n}\n", "type": "text/css", "title": "$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.css", "tags": "[[$:/tags/Stylesheet]]" }, "$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.js": { "text": "!function(e){\"object\"==typeof exports&&\"object\"==typeof module?e(require(\"../../lib/codemirror\")):\"function\"==typeof define&&define.amd?define([\"../../lib/codemirror\"],e):e(CodeMirror)}(function(s){function f(e,o,n){var t=e.getWrapperElement(),i=t.appendChild(document.createElement(\"div\"));return i.className=n?\"CodeMirror-dialog CodeMirror-dialog-bottom\":\"CodeMirror-dialog CodeMirror-dialog-top\",\"string\"==typeof o?i.innerHTML=o:i.appendChild(o),s.addClass(t,\"dialog-opened\"),i}function p(e,o){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=o}s.defineExtension(\"openDialog\",function(e,o,n){n=n||{},p(this,null);var t=f(this,e,n.bottom),i=!1,r=this;function u(e){if(\"string\"==typeof e)a.value=e;else{if(i)return;i=!0,s.rmClass(t.parentNode,\"dialog-opened\"),t.parentNode.removeChild(t),r.focus(),n.onClose&&n.onClose(t)}}var l,a=t.getElementsByTagName(\"input\")[0];return a?(a.focus(),n.value&&(a.value=n.value,!1!==n.selectValueOnOpen&&a.select()),n.onInput&&s.on(a,\"input\",function(e){n.onInput(e,a.value,u)}),n.onKeyUp&&s.on(a,\"keyup\",function(e){n.onKeyUp(e,a.value,u)}),s.on(a,\"keydown\",function(e){n&&n.onKeyDown&&n.onKeyDown(e,a.value,u)||((27==e.keyCode||!1!==n.closeOnEnter&&13==e.keyCode)&&(a.blur(),s.e_stop(e),u()),13==e.keyCode&&o(a.value,e))}),!1!==n.closeOnBlur&&s.on(t,\"focusout\",function(e){null!==e.relatedTarget&&u()})):(l=t.getElementsByTagName(\"button\")[0])&&(s.on(l,\"click\",function(){u(),r.focus()}),!1!==n.closeOnBlur&&s.on(l,\"blur\",u),l.focus()),u}),s.defineExtension(\"openConfirm\",function(e,o,n){p(this,null);var t=f(this,e,n&&n.bottom),i=t.getElementsByTagName(\"button\"),r=!1,u=this,l=1;function a(){r||(r=!0,s.rmClass(t.parentNode,\"dialog-opened\"),t.parentNode.removeChild(t),u.focus())}i[0].focus();for(var c=0;c-1&&t.substring(a+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var m=0;m<> |<$edit-text tiddler=\"$:/config/codemirror/cursorBlinkRate\" default=\"\" placeholder=\"cursorBlinkRate\" tag=\"input\"/> |\n" }, "$:/core/ui/ControlPanel/Settings/codemirror/editorFont": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/editorFont", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/editorFont/hint}}", "text": "\\define lingo-base() $:/language/ThemeTweaks/\n\n|<$link to=\"$:/themes/tiddlywiki/vanilla/settings/editorfontfamily\"><> |<$edit-text tiddler=\"$:/themes/tiddlywiki/vanilla/settings/editorfontfamily\" default=\"\" tag=\"input\"/> | |\n" }, "$:/core/ui/ControlPanel/Settings/codemirror/indentUnit": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/indentUnit", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/indentUnit/hint}}", "text": "\\define lingo-base() $:/language/codemirror/indentUnit/\n\n|<$link to=\"$:/config/codemirror/indentUnit\"><> |<$edit-text tiddler=\"$:/config/codemirror/indentUnit\" default=\"\" placeholder=\"indentUnit\" tag=\"input\"/> |\n" }, "$:/core/ui/ControlPanel/Settings/codemirror/indentWithTabs": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/indentWithTabs", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/indentWithTabs/hint}}", "text": "\\define lingo-base() $:/language/codemirror/indentWithTabs/\n<>\n\n<$checkbox tiddler=\"$:/config/codemirror/indentWithTabs\" field=\"text\" checked=\"true\" unchecked=\"false\" default=\"true\"> <$link to=\"$:/config/codemirror/indentWithTabs\"><> \n" }, "$:/core/ui/ControlPanel/Settings/codemirror/keyMap": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/keyMap", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/keyMap/hint}}", "text": "\\define lingo-base() $:/language/codemirror/keyMap\n\n<$link to=\"$:/config/codemirror/keyMap\"><>\n\n<$select tiddler=\"$:/config/codemirror/keyMap\" default=\"default\">\n\n<$list filter=\"[all[shadows+tiddlers]module-type[codemirror-keymap]!has[draft.of]get[text]]\">\n\n\n\n\n" }, "$:/core/ui/ControlPanel/Settings/codemirror/lineNumbers": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/lineNumbers", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/lineNumbers/hint}}", "text": "\\define lingo-base() $:/language/codemirror/lineNumbers/\n<>\n\n<$checkbox tiddler=\"$:/config/codemirror/lineNumbers\" field=\"text\" checked=\"true\" unchecked=\"false\" default=\"false\"> <$link to=\"$:/config/codemirror/lineNumbers\"><> \n\n" }, "$:/core/ui/ControlPanel/Settings/codemirror/lineWrapping": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/lineWrapping", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/lineWrapping/hint}}", "text": "\\define lingo-base() $:/language/codemirror/lineWrapping/\n<>\n\n<$checkbox tiddler=\"$:/config/codemirror/lineWrapping\" field=\"text\" checked=\"true\" unchecked=\"false\" default=\"true\"> <$link to=\"$:/config/codemirror/lineWrapping\"><> \n\n" }, "$:/core/ui/ControlPanel/Settings/codemirror/showCursorWhenSelecting": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/showCursorWhenSelecting", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/showCursorWhenSelecting/hint}}", "text": "\\define lingo-base() $:/language/codemirror/showCursorWhenSelecting/\n<>\n\n<$checkbox tiddler=\"$:/config/codemirror/showCursorWhenSelecting\" field=\"text\" checked=\"true\" unchecked=\"false\" default=\"true\"> <$link to=\"$:/config/codemirror/showCursorWhenSelecting\"><> \n\n" }, "$:/core/ui/ControlPanel/Settings/codemirror/smartIndent": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/smartIndent", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/smartIndent/hint}}", "text": "\\define lingo-base() $:/language/codemirror/smartIndent/\n<>\n\n<$checkbox tiddler=\"$:/config/codemirror/smartIndent\" field=\"text\" checked=\"true\" unchecked=\"false\" default=\"true\"> <$link to=\"$:/config/codemirror/smartIndent\"><> \n" }, "$:/core/ui/ControlPanel/Settings/codemirror/styleActiveLine": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/styleActiveLine", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/styleActiveLine/hint}}", "text": "\\define lingo-base() $:/language/codemirror/styleActiveLine/\n<>\n\n<$checkbox tiddler=\"$:/config/codemirror/styleActiveLine\" field=\"text\" checked=\"true\" unchecked=\"false\" default=\"false\"> <$link to=\"$:/config/codemirror/styleActiveLine\"><> \n\n" }, "$:/core/ui/ControlPanel/Settings/codemirror/tabSize": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/tabSize", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/tabSize/hint}}", "text": "\\define lingo-base() $:/language/codemirror/tabSize/\n\n|<$link to=\"$:/config/codemirror/tabSize\"><> |<$edit-text tiddler=\"$:/config/codemirror/tabSize\" default=\"\" placeholder=\"tabSize\" tag=\"input\"/> |\n" }, "$:/core/ui/ControlPanel/Settings/codemirror/theme": { "title": "$:/core/ui/ControlPanel/Settings/codemirror/theme", "tags": "$:/tags/ControlPanel/Settings/CodeMirror", "caption": "{{$:/language/codemirror/theme/hint}}", "text": "\\define lingo-base() $:/language/codemirror/\n\n<$link to=\"$:/config/codemirror/theme\"><>\n\n<$select tiddler=\"$:/config/codemirror/theme\" default=\"default\">\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/Stylesheet]module-type[codemirror-theme]!has[draft.of]get[name]]\">\n\n\n\n\n//see the [[CodeMirror Usage|$:/plugins/tiddlywiki/codemirror/usage]] how to add themes//\n" }, "$:/plugins/tiddlywiki/codemirror/styles": { "title": "$:/plugins/tiddlywiki/codemirror/styles", "tags": "[[$:/tags/Stylesheet]]", "module-type": "codemirror-theme", "name": "tiddlywiki", "text": "\\define set-fat-cursor-background-css(colour,colourA,colourB)\n<$set name=\"backgroundColour\" value=<>>\n.cm-s-tiddlywiki.cm-fat-cursor .CodeMirror-cursor { background: <>; }\n.cm-s-tiddlywiki .cm-animate-fat-cursor { background-color: <>; }\n\n\\end\n\\define set-fat-cursor-background-colours(palette)\n<$macrocall $name=\"set-fat-cursor-background-css\" colour={{$palette$##foreground}} colourA=\"#77ee77\" colourB=\"#586e75\"/>\n\\end\n\\define set-fat-cursor-background()\n<$macrocall $name=\"set-fat-cursor-background-colours\" palette={{$:/palette}}/>\n\\end\n\\define set-selection-background-css(colour,colourA,colourB,tiddlerEditorBackground)\n<$wikify name=\"tiddlerEditorBackground\" text={{{ [[$tiddlerEditorBackground$]lowercase[]] }}}>\n<$set name=\"backgroundColour\" value=<>>\n<$set name=\"backgroundColour\" value={{{ [lowercase[]matchthen[]] ~[] }}}>\n.cm-s-tiddlywiki div.CodeMirror-selected { background: <>; color: <>; }\n.cm-s-tiddlywiki.CodeMirror ::selection { background: <>; color: <>; }\n.cm-s-tiddlywiki .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: <>; color: <>; }\n.cm-s-tiddlywiki .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: <>; color: <>; }\n\n\n\n\\end\n\\define set-selection-background-colours(palette)\n<$macrocall $name=\"set-selection-background-css\" colour={{$palette$##foreground}} colourA={{{ [{$palette$##selection-background}!match[]!prefix[<<]!suffix[>>]] ~#073642 }}} colourB={{{ [{$palette$##selection-background}!match[]!prefix[<<]!suffix[>>]] ~#eee8d5 }}} tiddlerEditorBackground={{$palette$##tiddler-editor-background}}/>\n\\end\n\\define set-selection-background()\n<$macrocall $name=\"set-selection-background-colours\" palette={{$:/palette}}/>\n\\end\n\n\\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock\n\n/* Make the editor resize to fit its content */\n\n.CodeMirror {\n\theight: auto;\n\tborder: 1px solid <>;\n\tline-height: 1.5;\n\tfont-family: {{$:/themes/tiddlywiki/vanilla/settings/editorfontfamily}};\n\tfont-size: {{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}};\n}\n\n.CodeMirror-scroll {\n\toverflow-x: auto;\n\toverflow-y: hidden;\n}\n\n.cm-s-tiddlywiki {\n color-profile: sRGB;\n rendering-intent: auto;\n}\n\n.cm-s-tiddlywiki.CodeMirror, .cm-s-tiddlywiki .CodeMirror-gutters { background-color: <>; color: <>; }\n.cm-s-tiddlywiki .CodeMirror-gutters {background: <>; border-right: 1px solid <>;}\n.cm-s-tiddlywiki .CodeMirror-linenumber {color: <>;}\n.cm-s-tiddlywiki .CodeMirror-cursor { border-left: 2px solid <>; }\n.cm-s-tiddlywiki span.cm-comment { color: #586e75; font-style:italic; font-weight:normal; }\n.cm-s-tiddlywiki .CodeMirror-activeline-background, .cm-s-tiddlywiki .CodeMirror-activeline-gutter .CodeMirror-linenumber { background: rgba(127,127,127,0.2); }\n.cm-s-tiddlywiki span.cm-matchhighlight { color: <>; background-color: <>; font-weight: normal;}\n.cm-s-tiddlywiki .CodeMirror-widget { text-shadow: none; }\n.cm-s-tiddlywiki .CodeMirror-dialog { background: <>; }\n.cm-s-tiddlywiki .cm-header { color: #586e75; }\n.cm-s-tiddlywiki .cm-quote { color: #93a1a1; }\n.cm-s-tiddlywiki .cm-keyword { color: #cb4b16; }\n.cm-s-tiddlywiki .cm-atom { color: #d33682; }\n.cm-s-tiddlywiki .cm-number { color: #d33682; }\n.cm-s-tiddlywiki .cm-def { color: #2aa198; }\n.cm-s-tiddlywiki .cm-variable { color: #839496; }\n.cm-s-tiddlywiki .cm-variable-2 { color: #b58900; }\n.cm-s-tiddlywiki .cm-variable-3, .cm-s-tiddlywiki .cm-type { color: #6c71c4; }\n.cm-s-tiddlywiki .cm-property { color: #2aa198; }\n.cm-s-tiddlywiki .cm-operator { color: #6c71c4; }\n.cm-s-tiddlywiki .cm-comment { color: #586e75; font-style:italic; }\n.cm-s-tiddlywiki .cm-string { color: #859900; }\n.cm-s-tiddlywiki .cm-string-2 { color: #b58900; }\n.cm-s-tiddlywiki .cm-meta { color: #859900; }\n.cm-s-tiddlywiki .cm-qualifier { color: #b58900; }\n.cm-s-tiddlywiki .cm-builtin { color: #d33682; }\n.cm-s-tiddlywiki .cm-bracket { color: #cb4b16; }\n.cm-s-tiddlywiki .CodeMirror-matchingbracket { color: #859900; }\n.cm-s-tiddlywiki .CodeMirror-nonmatchingbracket { color: #dc322f; }\n.cm-s-tiddlywiki .cm-tag { color: #93a1a1; }\n.cm-s-tiddlywiki .cm-attribute { color: #2aa198; }\n.cm-s-tiddlywiki .cm-hr { color: transparent; border-top: 1px solid #586e75; display: block; }\n.cm-s-tiddlywiki .cm-link { color: #93a1a1; cursor: pointer; }\n.cm-s-tiddlywiki .cm-special { color: #6c71c4; }\n.cm-s-tiddlywiki .cm-em { color: #999; text-decoration: underline; text-decoration-style: dotted; }\n.cm-s-tiddlywiki .cm-error,\n.cm-s-tiddlywiki .cm-invalidchar { color: #586e75; border-bottom: 1px dotted #dc322f; }\n.cm-s-tiddlywiki .CodeMirror-matchingbracket { color: #859900; }\n.cm-s-tiddlywiki .CodeMirror-nonmatchingbracket { color: #dc322f; }\n.cm-s-tiddlywiki .cm-searching { background: rgba(243, 155, 53, .3); outline: 1px solid #F39B35; }\n<>\n<>\n" }, "$:/core/ui/ControlPanel/Settings/CodeMirror": { "title": "$:/core/ui/ControlPanel/Settings/CodeMirror", "tags": "$:/tags/ControlPanel/SettingsTab", "caption": "CodeMirror", "list-after": "$:/core/ui/ControlPanel/Settings/TiddlyWiki", "text": "\\define lingo-base() $:/language/codemirror/controlPanel/\n\n<>\n\n<$link to=\"$:/plugins/tiddlywiki/codemirror/usage\"><>\n\n<$link to=\"$:/plugins/tiddlywiki/codemirror/keyboard\"><>\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings/CodeMirror]]\">\n\n
\n\n!! <$link><$transclude field=\"caption\"/>\n\n<$transclude/>\n\n
\n\n\n" }, "$:/core/ui/ControlPanel/Settings": { "title": "$:/core/ui/ControlPanel/Settings", "tags": "$:/tags/ControlPanel", "caption": "{{$:/language/ControlPanel/Settings/Caption}}", "text": "
\n<$macrocall $name=\"tabs\" tabsList=\"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/SettingsTab]!has[draft.of]]\" default=\"$:/core/ui/ControlPanel/Settings/TiddlyWiki\" explicitState=\"$:/state/tab--697582678\"/>\n
\n" }, "$:/core/ui/ControlPanel/Settings/TiddlyWiki": { "title": "$:/core/ui/ControlPanel/Settings/TiddlyWiki", "tags": "$:/tags/ControlPanel/SettingsTab", "caption": "TiddlyWiki", "text": "\\define lingo-base() $:/language/ControlPanel/Settings/\n\n<>\n\n<$list filter=\"[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings]]\">\n\n
\n\n!! <$link><$transclude field=\"caption\"/>\n\n<$transclude/>\n\n
\n\n\n" }, "$:/plugins/tiddlywiki/codemirror/usage": { "title": "$:/plugins/tiddlywiki/codemirror/usage", "text": "! Configuration\n\nConfiguration for the ~CodeMirror text-editor can be done from within the CodeMirror Settings Tab in the [[ControlPanel|$:/ControlPanel]] (Settings - ~CodeMirror)\n\n\n!!Setting a different Theme\n\n~CodeMirror themes are available in the [ext[official GitHub repository|https://github.com/codemirror/CodeMirror/tree/master/theme]]\n\nMore themes can be found at https://github.com/FarhadG/code-mirror-themes/tree/master/themes and previewed [ext[here|http://farhadg.github.io/code-mirror-themes/]]\n\n\nTo add a theme to your wiki, follow these four steps:\n\n* choose one of the CSS files and copy its content to a new tiddler\n* remove all comments from the top and tag the tiddler with <>\n* add a field \"module-type\" with the value \"codemirror-theme\". add a field \"name\" with the exact ''name'' of the theme as value\n* save the tiddler and go to the Settings tab in $:/ControlPanel - look for the \"theme\" dropdown to select your newly added theme\n\n\n!!Line Numbers\n\nTo show or hide the Line Numbers at the left, go to ~ControlPanel - Settings - ~CodeMirror and look for the \"Line Numbers\" checkbox\n\n\n!!Line Wrapping\n\nControls if long lines get visually wrapped to a new line if they're too long to fit the editor width or if the editor should scroll horizontally\n\nTo change the line-wrapping behaviour, go to ~ControlPanel - Settings - ~CodeMirror and look for the \"Line Wrapping\" checkbox\n\n\n!!Show Cursor when selecting\n\nDefines whether the Mouse cursor should be visually shown or hidden when making a text-selection\n\nTo change the show-cursor-when-selecting behaviour, go to ~ControlPanel - Settings - ~CodeMirror and look for the \"Show cursor when selecting\" checkbox\n\n\n!!~CodeMirror Font Family\n\nThe Font-Family used within the ~CodeMirror text-editor defaults to \"monospace\" which will choose your configured monospace system-font\n\nThat setting can be overridden entering one or more Font-Families in the \"Font Family\" input field at ~ControlPanel - Settings - ~CodeMirror\n\n* The entries must be separated by semicolons ','\n* Font-Family Names that contain spaces must be quoted like \"My Font\"\n* If a list of Font-Families is specified, the last Font-Family found on the user-system gets used, non-existing fonts get ignored\n* If none of the specified Font-Families is available, ~CodeMirror uses the default \"monospace\"\n\n\n!!\"Hidden\" Settings:\n\n!!!Cursor Blink Rate\n\nThe cursor blink-rate defines how fast (in milliseconds) the cursor blinks inside the textarea\n\nYou can change it by editing $:/config/codemirror/cursorBlinkRate\n\"0\" disables blinking\n\n!!!Tabsize\n\nThe Tabsize defines the width of a tab character. Default is 4.\n\nYou can change it by editing $:/config/codemirror/tabSize\n\n!!!Indent Unit\n\nNot enabled for vnd.tiddlywiki and x-tiddlywiki\n\nDefines how many spaces a text-block should be indented. Defaults to 2.\n\nYou can change it by editing $:/config/codemirror/indentUnit\n\n" } } }