CodeMirror 5.36.0 modularized (#3184)

* v5.35.1

* codemirror 5.35.1

* v5.35.1

* v5.35.1

* v5.35.1

* v5.35.1

* v5.35.1

* adding search&replace and autocomplete

* update version number

* add jump-to-line.js required for search&replace

* adding show-hint.js required by autocomplete

* adding basic autocomplete for any word

* adding autocomplete css

* adding new files to tiddlywiki.files

* forgot adding search.js

* minify 'em all

* Delete vim.js

* Delete sublime.js

* Delete emacs.js

* Delete anyword-hint.js

* Delete show-hint.css

* Delete show-hint.js

* Update config.tid

* Update tiddlywiki.files

* Update tiddlywiki.files

* Update config.tid

* Update config.tid

* Update config.tid

* Delete dialog.js

* Delete dialog.css

* Delete jump-to-line.js

* Delete search.js

* Delete searchcursor.js

* Update tiddlywiki.files

* Update tiddlywiki.files

* Update tiddlywiki.files

* add search-and-replace cm-addon as plugin

* add autocomplete cm-addon as plugin

* add fullscreen-editing cm-addon as plugin

* add keymaps as plugins + cleanup

* add highlighting modes as plugins

* small update on usage.tid

* moved multiplex.js to htmlembedded mode - the only one using it

* config/CodeMirror update

* how to disable line numbers

* how to change CM theme

* add closebrackets and closetags addons

* packaging a base-addon

* move meta.js from codemirror to base addon

* inputStyle: textarea -> prevents contenteditable on mobile browsers, keeps focus when clicking toolbar buttons, prevents import on paste

* default config no line numbers

* temporary add panel plugin for demo

* put base-plugin back to codemirror editor

* searchcursor to searchnreplace plugin

* bad copypasta mistake

* another typo

* stripped down meta.js + moved matchbrackets to closebrackets plugin

* remove panel

* change module-type to codemirro and make init "require" dynamic.

* make config handling dynamic with sensible defaults

* make cm settings translateable

* delete multids. they will be replaced

* add auto-config tiddlers

* dynamically create config structure for CM

* fix filename

* change typo

* kitchensink config, plus change plugin description for better sorting.

* add matchBrackets config tiddler

* RIP codeblock

* removed install instructions from readme - codemirror usage tiddler still todo

* control panel settings for cm base

* add setting for auto-close tags

* adding fontfamily settings and theme settings

* change tags for settings from $:/tags/ControlPanel/Settings to $:/tags/ControlPanel/Settings/CodeMirror

* more usage info

* more usage info

* update to v5.36.0

* ugly hack enables highlighting and tag-closing for vnd.tiddlywiki and x-tiddlywiki

* disable auto-indent for vnd.tiddlywiki & x-tiddlywiki and add some hidden settings

* remove engine.js hack

* meta.js -> tw-meta.js

* codemirror settings tab

* rename tiddler to tw-meta.js

* make editor font monospace or sans-serif - dropdown select

* make editor font monospace or sans-serif - dropdown select

* now using correct tiddler for editor font setting

* better usage doc

* make markdown-mode require tw-meta

* add more themes info

* add active-line highlighting option

* mini usage change

* add integer type to engine.js config-getter

* blink rate config type string

* correct engine.js

* license for base-plugin, usage link in settings tab

* codemirrordemo hellothere update

* codemirrordemo hellothere update

* Update license.tid

* codemirror demo sidebarlayout, license

* license headers to addon files

* license formatting & forgot what year we have

* license formatting & forgot what year we have & codemirror demo sitetitle sitesubtitle

* more informations 'try-this-style' for codemirrordemo hellothere

* codemirror demo sitetitle & cm fontfamily

* hellothere

* font-family setting must be editor-font-family, not code-font-family

* add basic keyboard shortcuts table

* shortcuts change to not interfere with toolbar shortcuts - needs testing - vim and emacs todo

* formatting

* controlpanel change keymap - default keymap is default

* ctrl-T becomes Alt-T in default keymap

* adjustments for codemirror demo

* demo: hellothere - hint for sidebar keymap cheatsheet

* toolbar focus fix + remove console log

* engine.js cleanup

* formatting

* reverting focus fix

* indenting engine.js

* hoping that indenting gets better
This commit is contained in:
BurningTreeC 2018-04-06 18:34:50 +02:00 committed by Jeremy Ruston
parent 02529a51d0
commit 3d64d7d126
144 changed files with 1263 additions and 19750 deletions

View File

@ -0,0 +1,5 @@
title: $:/config/DefaultSidebarTab
$:/codemirrordemo/sidebar/cheatsheet

View File

@ -1,11 +1,43 @@
title: HelloThere
This is a demo of TiddlyWiki5 incorporating a plugin for the [[CodeMirror|http://codemirror.net/]] text editor for the web.
This is a demo of [[TiddlyWiki5|https://tiddlywiki.com]] incorporating a plugin for the [[CodeMirror|http://codemirror.net/]] text editor for the web.
Try editing the tiddler LoremIpsum to try out the editor.
The ~CodeMirror plugin can be extended with ~AddOns for more functionality:
To add the plugin to your own TiddlyWiki5, just drag this link to the browser window:
* Search and Replace
* Text - Autocompletion
* Syntax highlighting
* Fullscreen editing
* Keymaps in the style of Emacs, Sublime Text or Vim
* Closing Brackets
* Closing Tags
NOTE: This demo has the ''Sublime Text'' keymap installed.
!!!Try editing the tiddler [[Draft of 'LoremIpsum']] to try out the editor.
Some commands and functions to try:
* Ctrl+F : Search panel to search for expressions
* Ctrl+H (sublime text shortcut, default is Ctrl+Shift+R) : Search and Replace
* Ctrl+Space : Triggers Autocompletion
* typing an opening bracket like `{` automatically creates the closing bracket `}`
* tiddlers with type `application/javascript`, `application/json`, `text/css`, `text/html`, `text/xml`, `text/x-markdown` and `text/x-tiddlywiki` have Syntax Highlighting
* tiddlers with type `text/html` automatically close tags like `<div>` when the closing `>` gets typed
* Multiple cursors: holding Ctrl pressed while selecting words results in multiple cursors. If you type, all selections will update
This demo uses the ''Sublime Text Keymap'' - See the Sidebar Tab ''Keymap'' or the [[Sublime Text Keymap Readme|$:/plugins/tiddlywiki/codemirror-keymap-sublime-text/readme]] for all available keyboard shortcuts
To add the base plugin to your own ~TiddlyWiki5, just drag this link to the browser window:
[[$:/plugins/tiddlywiki/codemirror]]
{{$:/plugins/tiddlywiki/codemirror/readme}}
[[CodeMirror plugin Readme|$:/plugins/tiddlywiki/codemirror/readme]]
[[CodeMirror plugin Usage|$:/plugins/tiddlywiki/codemirror/usage]]
To add ~AddOns to your ~CodeMirror plugin, go to ~ControlPanel - Plugins and drag the desired ~AddOn to your wiki browser window
The configuration for ~AddOns is done automatically, configuration for sensible settings can be done in ~ControlPanel - Settings - ~CodeMirror

View File

@ -0,0 +1,4 @@
title: $:/config/codemirror/keyMap
type: string
sublime

View File

@ -0,0 +1,57 @@
caption: Keymap
tags: $:/tags/SideBar
title: $:/codemirrordemo/sidebar/cheatsheet
|Shortcut |Function |h
|Shift-Tab |indentLess |
|Shift-Ctrl-K |deleteLine |
|Alt-Q |wrapLines |
|Alt-T |transposeChars |
|Alt-Left |goSubwordLeft |
|Alt-Right |goSubwordRight |
|Ctrl-Up |scrollLineUp |
|Ctrl-Down |scrollLineDown |
|Alt-L |selectLine |
|Shift-Alt-L |splitSelectionByLine |
|Ctrl-Esc |singleSelectionTop |
|Shift-Enter |insertLineAfter |
|Shift-Ctrl-Enter |insertLineBefore |
|Ctrl-D |selectNextOccurrence |
|Shift-Ctrl-Space |selectScope |
|Shift-Ctrl-M |selectBetweenBrackets |
|Alt-M |goToBracket |
|Shift-Ctrl-Up |swapLineUp |
|Shift-Ctrl-Down |swapLineDown |
|Ctrl-/ |toggleCommentIndented |
|Ctrl-J |joinLines |
|Shift-Ctrl-D |duplicateLine |
|F9 |sortLines |
|Ctrl-F9 |sortLinesInsensitive |
|F2 |nextBookmark |
|Shift-F2 |prevBookmark |
|Ctrl-F2 |toggleBookmark |
|Shift-Ctrl-F2 |clearBookmarks |
|Alt-F2 |selectBookmarks |
|Backspace |smartBackspace |
|Ctrl-K Ctrl-K |delLineRight |
|Ctrl-K Alt-U |upcaseAtCursor |
|Ctrl-K Alt-L |downcaseAtCursor |
|Ctrl-K Ctrl-Space |setSublimeMark |
|Ctrl-K Ctrl-A |selectToSublimeMark |
|Ctrl-K Alt-D |deleteToSublimeMark |
|Ctrl-K Ctrl-X |swapWithSublimeMark |
|Ctrl-K Ctrl-Y |sublimeYank |
|Ctrl-K Ctrl-C |showInCenter |
|Ctrl-K Ctrl-G |clearBookmarks |
|Ctrl-K Ctrl-Backspace |delLineLeft |
|Ctrl-K Ctrl-0 |unfoldAll |
|Ctrl-K Ctrl-J |unfoldAll |
|Ctrl-Alt-Up |addCursorToPrevLine |
|Ctrl-Alt-Down |addCursorToNextLine |
|Ctrl-F3 |findUnder |
|Shift-Ctrl-F3 |findUnderPrevious |
|Shift-Ctrl-[ |fold |
|Shift-Ctrl-] |unfold |
|Ctrl-H |replace |

View File

@ -1,3 +1,3 @@
title: $:/SiteSubtitle
a demo of the CodeMirror plugin for TiddlyWiki5
~CodeMirror plugins for ~TiddlyWiki

View File

@ -1,3 +1,3 @@
title: $:/SiteTitle
codemirrordemo
~CodeMirror Demo

View File

@ -0,0 +1,4 @@
title: $:/config/codemirror/lineNumbers
type: bool
true

View File

@ -0,0 +1,3 @@
title: $:/themes/tiddlywiki/vanilla/options/sidebarlayout
fluid-fixed

View File

@ -0,0 +1,4 @@
title: $:/config/codemirror/styleActiveLine
type: bool
true

View File

@ -1,7 +1,18 @@
{
"description": "Demo of the CodeMirror plugin",
"plugins": [
"tiddlywiki/codemirror"
"tiddlywiki/codemirror",
"tiddlywiki/codemirror-closebrackets",
"tiddlywiki/codemirror-closetag",
"tiddlywiki/codemirror-autocomplete",
"tiddlywiki/codemirror-search-replace",
"tiddlywiki/codemirror-fullscreen-editing",
"tiddlywiki/codemirror-mode-xml",
"tiddlywiki/codemirror-mode-javascript",
"tiddlywiki/codemirror-mode-css",
"tiddlywiki/codemirror-mode-x-tiddlywiki",
"tiddlywiki/codemirror-mode-markdown",
"tiddlywiki/codemirror-keymap-sublime-text"
],
"themes": [
"tiddlywiki/vanilla",

View File

@ -0,0 +1,7 @@
title: $:/config/codemirror/autocomplete
extend: extraKeys
type: json
{
"Ctrl-Space": "autocomplete"
}

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var r=/[\w$]+/;e.registerHelper("hint","anyword",function(t,o){for(var i=o&&o.word||r,n=o&&o.range||500,f=t.getCursor(),s=t.getLine(f.line),a=f.ch,c=a;c&&i.test(s.charAt(c-1));)--c;for(var l=c!=a&&s.slice(c,a),d=o&&o.list||[],u={},p=new RegExp(i.source,"g"),g=-1;g<=1;g+=2)for(var h=f.line,m=Math.min(Math.max(h+g*n,t.firstLine()),t.lastLine())+g;h!=m;h+=g)for(var y,b=t.getLine(h);y=p.exec(b);)h==f.line&&y[0]===l||l&&0!=y[0].lastIndexOf(l,0)||Object.prototype.hasOwnProperty.call(u,y[0])||(u[y[0]]=!0,d.push(y[0]));return{list:d,from:e.Pos(f.line,c),to:e.Pos(f.line,a)}})});

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],e):e(CodeMirror)}(function(e){"use strict";var r={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};e.registerHelper("hint","css",function(t){var o=t.getCursor(),s=t.getTokenAt(o),i=e.innerMode(t.getMode(),s.state);if("css"==i.mode.name){if("keyword"==s.type&&0=="!important".indexOf(s.string))return{list:["!important"],from:e.Pos(o.line,s.start),to:e.Pos(o.line,s.end)};var n=s.start,a=o.ch,d=s.string.slice(0,a-n);/[^\w$_-]/.test(d)&&(d="",n=a=o.ch);var c=e.resolveMode("text/css"),f=[],l=i.state.state;return"pseudo"==l||"variable-3"==s.type?p(r):"block"==l||"maybeprop"==l?p(c.propertyKeywords):"prop"==l||"parens"==l||"at"==l||"params"==l?(p(c.valueKeywords),p(c.colorKeywords)):"media"!=l&&"media_parens"!=l||(p(c.mediaTypes),p(c.mediaFeatures)),f.length?{list:f,from:e.Pos(o.line,n),to:e.Pos(o.line,a)}:void 0}function p(e){for(var r in e)d&&0!=r.lastIndexOf(d,0)||f.push(r)}})});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){var e=t.Pos;function r(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r])}function n(n,i,l,f){var c=n.getCursor(),p=l(n,c);if(!/\b(?:string|comment)\b/.test(p.type)){var u=t.innerMode(n.getMode(),p.state);if("json"!==u.mode.helperType){p.state=u.state,/^[\w$_]*$/.test(p.string)?p.end>c.ch&&(p.end=c.ch,p.string=p.string.slice(0,c.ch-p.start)):p={start:c.ch,end:c.ch,string:"",state:p.state,type:"."==p.string?"property":null};for(var d=p;"property"==d.type;){if("."!=(d=l(n,e(c.line,d.start))).string)return;if(d=l(n,e(c.line,d.start)),!g)var g=[];g.push(d)}return{list:function(t,e,n,i){var l=[],f=t.string,c=i&&i.globalScope||window;function p(t){0!=t.lastIndexOf(f,0)||function(t,e){if(!Array.prototype.indexOf){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1}return-1!=t.indexOf(e)}(l,t)||l.push(t)}function u(t){"string"==typeof t?r(o,p):t instanceof Array?r(s,p):t instanceof Function&&r(a,p),function(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var r=t;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(e);else for(var n in t)e(n)}(t,p)}if(e&&e.length){var d,g=e.pop();for(g.type&&0===g.type.indexOf("variable")?(i&&i.additionalContext&&(d=i.additionalContext[g.string]),i&&!1===i.useGlobalScope||(d=d||c[g.string])):"string"==g.type?d="":"atom"==g.type?d=1:"function"==g.type&&(null==c.jQuery||"$"!=g.string&&"jQuery"!=g.string||"function"!=typeof c.jQuery?null!=c._&&"_"==g.string&&"function"==typeof c._&&(d=c._()):d=c.jQuery());null!=d&&e.length;)d=d[e.pop().string];null!=d&&u(d)}else{for(var y=t.state.localVars;y;y=y.next)p(y.name);for(var y=t.state.globalVars;y;y=y.next)p(y.name);i&&!1===i.useGlobalScope||u(c),r(n,p)}return l}(p,g,i,f),from:e(c.line,p.start),to:e(c.line,p.end)}}}}function i(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}t.registerHelper("hint","javascript",function(t,e){return n(t,l,function(t,e){return t.getTokenAt(e)},e)}),t.registerHelper("hint","coffeescript",function(t,e){return n(t,f,i,e)});var o="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),s="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),a="prototype apply call bind".split(" "),l="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),f="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")});

View File

@ -0,0 +1,36 @@
.CodeMirror-hints {
position: absolute;
z-index: 10;
overflow: hidden;
list-style: none;
margin: 0;
padding: 2px;
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
border-radius: 3px;
border: 1px solid silver;
background: white;
font-size: 90%;
font-family: monospace;
max-height: 20em;
overflow-y: auto;
}
.CodeMirror-hint {
margin: 0;
padding: 0 4px;
border-radius: 2px;
white-space: pre;
color: black;
cursor: pointer;
}
li.CodeMirror-hint-active {
background: #08f;
color: white;
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";var e=t.Pos;t.registerHelper("hint","xml",function(r,s){var n=s&&s.schemaInfo,a=s&&s.quoteChar||'"';if(n){var i=r.getCursor(),o=r.getTokenAt(i);o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start));var l=t.innerMode(r.getMode(),o.state);if("xml"==l.mode.name){var f,g,c=[],h=!1,p=/\btag\b/.test(o.type)&&!/>$/.test(o.string),u=p&&/^\w/.test(o.string);if(u){var d=r.getLine(i.line).slice(Math.max(0,o.start-2),o.start),m=/<\/$/.test(d)?"close":/<$/.test(d)?"open":null;m&&(g=o.start-("close"==m?2:1))}else p&&"<"==o.string?m="open":p&&"</"==o.string&&(m="close");if(!p&&!l.state.tagName||m){u&&(f=o.string),h=m;var v=l.state.context,y=v&&n[v.tagName],x=v?y&&y.children:n["!top"];if(x&&"close"!=m)for(var O=0;O<x.length;++O)f&&0!=x[O].lastIndexOf(f,0)||c.push("<"+x[O]);else if("close"!=m)for(var b in n)!n.hasOwnProperty(b)||"!top"==b||"!attrs"==b||f&&0!=b.lastIndexOf(f,0)||c.push("<"+b);v&&(!f||"close"==m&&0==v.tagName.lastIndexOf(f,0))&&c.push("</"+v.tagName+">")}else{var w=(y=n[l.state.tagName])&&y.attrs,I=n["!attrs"];if(!w&&!I)return;if(w){if(I){var P={};for(var A in I)I.hasOwnProperty(A)&&(P[A]=I[A]);for(var A in w)w.hasOwnProperty(A)&&(P[A]=w[A]);w=P}}else w=I;if("string"==o.type||"="==o.string){var M,N=(d=r.getRange(e(i.line,Math.max(0,i.ch-60)),e(i.line,"string"==o.type?o.start:o.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!N||!w.hasOwnProperty(N[1])||!(M=w[N[1]]))return;if("function"==typeof M&&(M=M.call(this,r)),"string"==o.type){f=o.string;var $=0;/['"]/.test(o.string.charAt(0))&&(a=o.string.charAt(0),f=o.string.slice(1),$++);var C=o.string.length;/['"]/.test(o.string.charAt(C-1))&&(a=o.string.charAt(C-1),f=o.string.substr($,C-2)),h=!0}for(O=0;O<M.length;++O)f&&0!=M[O].lastIndexOf(f,0)||c.push(a+M[O]+a)}else for(var j in"attribute"==o.type&&(f=o.string,h=!0),w)!w.hasOwnProperty(j)||f&&0!=j.lastIndexOf(f,0)||c.push(j)}return{list:c,from:h?e(i.line,null==g?o.start:g):i,to:h?e(i.line,o.end):i}}}})});

View File

@ -0,0 +1,54 @@
{
"tiddlers": [
{
"file": "addon/hint/anyword-hint.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/hint/anyword-hint.js",
"module-type": "codemirror"
}
},{
"file": "addon/hint/css-hint.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/hint/css-hint.js",
"module-type": "codemirror"
}
},{
"file": "addon/hint/html-hint.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/hint/html-hint.js",
"module-type": "codemirror"
}
},{
"file": "addon/hint/javascript-hint.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/hint/javascript-hint.js",
"module-type": "codemirror"
}
},{
"file": "addon/hint/show-hint.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/hint/show-hint.js",
"module-type": "codemirror"
}
},{
"file": "addon/hint/show-hint.css",
"fields": {
"type": "text/css",
"title": "$:/plugins/tiddlywiki/codemirror/addon/hint/show-hint.css",
"tags": "[[$:/tags/Stylesheet]]"
}
},{
"file": "addon/hint/xml-hint.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/hint/xml-hint.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-autocomplete",
"description": "CodeMirror AddOn: Autocompletion",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,8 @@
title: $:/plugins/tiddlywiki/codemirror-autocomplete/readme
This plugin enhances the [[CodeMirror|http://codemirror.net]] text editor with Autocompletion functionality. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed
It adds Autocompletion for ''html'', ''javascript'' and ''xml'' and also for ''already present words'' within a text-editor instance
The ''Keyboard Shortcut'' for autocompletion is `Ctrl+Space`

View File

@ -0,0 +1,4 @@
title: $:/config/codemirror/autoCloseBrackets
type: bool
true

View File

@ -0,0 +1,4 @@
title: $:/config/codemirror/matchBrackets
type: bool
true

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},r=e.Pos;function n(e,r){return"pairs"==r&&"string"==typeof e?e:"object"==typeof e&&null!=e[r]?e[r]:t[r]}e.defineOption("autoCloseBrackets",!1,function(t,r,o){o&&o!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),r&&(a(n(r,"pairs")),t.state.closeBrackets=r,t.addKeyMap(i))});var i={Backspace:function(t){var i=s(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var a=n(i,"pairs"),o=t.listSelections(),c=0;c<o.length;c++){if(!o[c].empty())return e.Pass;var f=l(t,o[c].head);if(!f||a.indexOf(f)%2!=0)return e.Pass}for(var c=o.length-1;c>=0;c--){var h=o[c].head;t.replaceRange("",r(h.line,h.ch-1),r(h.line,h.ch+1),"+delete")}},Enter:function(t){var r=s(t),i=r&&n(r,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var a=t.listSelections(),o=0;o<a.length;o++){if(!a[o].empty())return e.Pass;var c=l(t,a[o].head);if(!c||i.indexOf(c)%2!=0)return e.Pass}t.operation(function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),a=t.listSelections();for(var r=0;r<a.length;r++){var n=a[r].head.line;t.indentLine(n,null,!0),t.indentLine(n+1,null,!0)}})}};function a(e){for(var t=0;t<e.length;t++){var r=e.charAt(t),n="'"+r+"'";i[n]||(i[n]=o(r))}}function o(t){return function(i){return function(t,i){var a=s(t);if(!a||t.getOption("disableInput"))return e.Pass;var o=n(a,"pairs"),l=o.indexOf(i);if(-1==l)return e.Pass;for(var c,f=n(a,"triples"),h=o.charAt(l+1)==i,d=t.listSelections(),u=l%2==0,g=0;g<d.length;g++){var p,v=d[g],m=v.head,b=t.getRange(m,r(m.line,m.ch+1));if(u&&!v.empty())p="surround";else if(!h&&u||b!=i)if(h&&m.ch>1&&f.indexOf(i)>=0&&t.getRange(r(m.line,m.ch-2),m)==i+i){if(m.ch>2&&/\bstring/.test(t.getTokenTypeAt(r(m.line,m.ch-2))))return e.Pass;p="addFour"}else if(h){var C=0==m.ch?" ":t.getRange(r(m.line,m.ch-1),m);if(e.isWordChar(b)||C==i||e.isWordChar(C))return e.Pass;p="both"}else{if(!u||!(t.getLine(m.line).length==m.ch||(x=b,P=o,void 0,k=P.lastIndexOf(x),k>-1&&k%2==1)||/\s/.test(b)))return e.Pass;p="both"}else p=!h||(S=m,void 0,O=(y=t).getTokenAt(r(S.line,S.ch+1)),!/\bstring/.test(O.type)||O.start!=S.ch||0!=S.ch&&/\bstring/.test(y.getTokenTypeAt(S)))?f.indexOf(i)>=0&&t.getRange(m,r(m.line,m.ch+3))==i+i+i?"skipThree":"skip":"both";if(c){if(c!=p)return e.Pass}else c=p}var x,P,k;var y,S,O;var R=l%2?o.charAt(l-1):i,A=l%2?i:o.charAt(l+1);t.operation(function(){if("skip"==c)t.execCommand("goCharRight");else if("skipThree"==c)for(var n=0;n<3;n++)t.execCommand("goCharRight");else if("surround"==c){for(var i=t.getSelections(),n=0;n<i.length;n++)i[n]=R+i[n]+A;t.replaceSelections(i,"around"),i=t.listSelections().slice();for(var n=0;n<i.length;n++)i[n]=(a=i[n],void 0,o=e.cmpPos(a.anchor,a.head)>0,{anchor:new r(a.anchor.line,a.anchor.ch+(o?-1:1)),head:new r(a.head.line,a.head.ch+(o?1:-1))});t.setSelections(i)}else"both"==c?(t.replaceSelection(R+A,null),t.triggerElectric(R+A),t.execCommand("goCharLeft")):"addFour"==c&&(t.replaceSelection(R+R+R+R,"before"),t.execCommand("goCharRight"));var a,o})}(i,t)}}function s(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){var n=e.getRange(r(t.line,t.ch-1),r(t.line,t.ch+1));return 2==n.length?n:null}a(t.pairs+"`")});

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=t.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function i(t,e,i){var c=t.getLineHandle(e.line),o=e.ch-1,l=i&&i.afterCursor;null==l&&(l=/(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className));var h=!l&&o>=0&&r[c.text.charAt(o)]||r[c.text.charAt(++o)];if(!h)return null;var s=">"==h.charAt(1)?1:-1;if(i&&i.strict&&s>0!=(o==e.ch))return null;var u=t.getTokenTypeAt(n(e.line,o+1)),f=a(t,n(e.line,o+(s>0?1:0)),s,u||null,i);return null==f?null:{from:n(e.line,o),to:f&&f.pos,match:f&&f.ch==h.charAt(0),forward:s>0}}function a(t,e,i,a,c){for(var o=c&&c.maxScanLineLength||1e4,l=c&&c.maxScanLines||1e3,h=[],s=c&&c.bracketRegex?c.bracketRegex:/[(){}[\]]/,u=i>0?Math.min(e.line+l,t.lastLine()+1):Math.max(t.firstLine()-1,e.line-l),f=e.line;f!=u;f+=i){var m=t.getLine(f);if(m){var g=i>0?0:m.length-1,d=i>0?m.length:-1;if(!(m.length>o))for(f==e.line&&(g=e.ch-(i<0?1:0));g!=d;g+=i){var k=m.charAt(g);if(s.test(k)&&(void 0===a||t.getTokenTypeAt(n(f,g+1))==a))if(">"==r[k].charAt(1)==i>0)h.push(k);else{if(!h.length)return{pos:n(f,g),ch:k};h.pop()}}}}return f-i!=(i>0?t.lastLine():t.firstLine())&&null}function c(t,r,a){for(var c=t.state.matchBrackets.maxHighlightLineLength||1e3,o=[],l=t.listSelections(),h=0;h<l.length;h++){var s=l[h].empty()&&i(t,l[h].head,a);if(s&&t.getLine(s.from.line).length<=c){var u=s.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";o.push(t.markText(s.from,n(s.from.line,s.from.ch+1),{className:u})),s.to&&t.getLine(s.to.line).length<=c&&o.push(t.markText(s.to,n(s.to.line,s.to.ch+1),{className:u}))}}if(o.length){e&&t.state.focused&&t.focus();var f=function(){t.operation(function(){for(var t=0;t<o.length;t++)o[t].clear()})};if(!r)return f;setTimeout(f,800)}}function o(t){t.operation(function(){t.state.matchBrackets.currentlyHighlighted&&(t.state.matchBrackets.currentlyHighlighted(),t.state.matchBrackets.currentlyHighlighted=null),t.state.matchBrackets.currentlyHighlighted=c(t,!1,t.state.matchBrackets)})}t.defineOption("matchBrackets",!1,function(e,n,r){r&&r!=t.Init&&(e.off("cursorActivity",o),e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)),n&&(e.state.matchBrackets="object"==typeof n?n:{},e.on("cursorActivity",o))}),t.defineExtension("matchBrackets",function(){c(this,!0)}),t.defineExtension("findMatchingBracket",function(t,e,n){return(n||"boolean"==typeof e)&&(n?(n.strict=e,e=n):e=e?{strict:!0}:null),i(this,t,e)}),t.defineExtension("scanForBracket",function(t,e,n,r){return a(this,t,e,n,r)})});

View File

@ -0,0 +1,19 @@
{
"tiddlers": [
{
"file": "addon/edit/closebrackets.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/edit/closebrackets.js",
"module-type": "codemirror"
}
},{
"file": "addon/edit/matchbrackets.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-closebrackets",
"description": "CodeMirror AddOn: Close Brackets",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,7 @@
title: $:/plugins/tiddlywiki/codemirror-closebrackets/readme
This plugin adds the ability to automatically insert the closing brackets when you type an opening bracket.
Also enables highlighting of matching brackets.
It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed

View File

@ -0,0 +1,4 @@
title: $:/language/codemirror/
autoCloseTags/hint: Auto-close tags
autoCloseTags/info: Whether or not to automatically close tags

View File

@ -0,0 +1,4 @@
title: $:/config/codemirror/autoCloseTags
type: bool
true

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){e.defineOption("autoCloseTags",!1,function(i,s,l){if(l!=e.Init&&l&&i.removeKeyMap("autoCloseTags"),s){var d={name:"autoCloseTags"};("object"!=typeof s||s.whenClosing)&&(d["'/'"]=function(t){return(n=t).getOption("disableInput")?e.Pass:o(n,!0);var n}),("object"!=typeof s||s.whenOpening)&&(d["'>'"]=function(o){return function(o){if(o.getOption("disableInput"))return e.Pass;for(var i=o.listSelections(),s=[],l=o.getOption("autoCloseTags"),d=0;d<i.length;d++){if(!i[d].empty())return e.Pass;var c=i[d].head,f=o.getTokenAt(c),g=e.innerMode(o.getMode(),f.state),u=g.state;if("xml"!=g.mode.name||!u.tagName)return e.Pass;var m="html"==g.mode.configuration,h="object"==typeof l&&l.dontCloseTags||m&&t,p="object"==typeof l&&l.indentTags||m&&n,v=u.tagName;f.end>c.ch&&(v=v.slice(0,v.length-f.end+c.ch));var b=v.toLowerCase();if(!v||"string"==f.type&&(f.end!=c.ch||!/[\"\']/.test(f.string.charAt(f.string.length-1))||1==f.string.length)||"tag"==f.type&&"closeTag"==u.type||f.string.indexOf("/")==f.string.length-1||h&&a(h,b)>-1||r(o,v,c,u,!0))return e.Pass;var y=p&&a(p,b)>-1;s[d]={indent:y,text:">"+(y?"\n\n":"")+"</"+v+">",newPos:y?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var x="object"==typeof l&&l.dontIndentOnAutoClose,d=i.length-1;d>=0;d--){var P=s[d];o.replaceRange(P.text,i[d].head,i[d].anchor,"+insert");var T=o.listSelections().slice(0);T[d]={head:P.newPos,anchor:P.newPos},o.setSelections(T),!x&&P.indent&&(o.indentLine(P.newPos.line,null,!0),o.indentLine(P.newPos.line+1,null,!0))}}(o)}),i.addKeyMap(d)}});var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function o(t,n){for(var o=t.listSelections(),a=[],i=n?"/":"</",s=t.getOption("autoCloseTags"),l="object"==typeof s&&s.dontIndentOnSlash,d=0;d<o.length;d++){if(!o[d].empty())return e.Pass;var c,f=o[d].head,g=t.getTokenAt(f),u=e.innerMode(t.getMode(),g.state),m=u.state;if(n&&("string"==g.type||"<"!=g.string.charAt(0)||g.start!=f.ch-1))return e.Pass;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)c=i+"script";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;c=i+"style"}else{if(!m.context||!m.context.tagName||r(t,m.context.tagName,f,m))return e.Pass;c=i+m.context.tagName}">"!=t.getLine(f.line).charAt(g.end)&&(c+=">"),a[d]=c}if(t.replaceSelections(a),o=t.listSelections(),!l)for(d=0;d<o.length;d++)(d==o.length-1||o[d].head.line<o[d+1].head.line)&&t.indentLine(o[d].head.line)}function a(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,o=e.length;n<o;++n)if(e[n]==t)return n;return-1}function r(t,n,o,a,r){if(!e.scanForClosingTag)return!1;var i=Math.min(t.lastLine()+1,o.line+500),s=e.scanForClosingTag(t,o,null,i);if(!s||s.tag!=n)return!1;for(var l=a.context,d=r?1:0;l&&l.tagName==n;l=l.prev)++d;o=s.to;for(var c=1;c<d;c++){var f=e.scanForClosingTag(t,o,null,i);if(!f||f.tag!=n)return!1;o=f.to}return!0}e.commands.closeTag=function(e){return o(e)}});

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var n=e.Pos;var t="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("<(/?)(["+t+"][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function r(e,n,t,i){this.line=n,this.ch=t,this.cm=e,this.text=e.getLine(n),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function u(e,t){var i=e.cm.getTokenTypeAt(n(e.line,t));return i&&/\btag\b/.test(i)}function f(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function o(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function l(e){for(;;){var n=e.text.indexOf(">",e.ch);if(-1==n){if(f(e))continue;return}if(u(e,n+1)){var t=e.text.lastIndexOf("/",n),i=t>-1&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,i?"selfClose":"regular"}e.ch=n+1}}function c(e){for(;;){var n=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==n){if(o(e))continue;return}if(u(e,n+1)){i.lastIndex=n,e.ch=n;var t=i.exec(e.text);if(t&&t.index==n)return t}else e.ch=n}}function a(e){for(;;){i.lastIndex=e.ch;var n=i.exec(e.text);if(!n){if(f(e))continue;return}if(u(e,n.index+1))return e.ch=n.index+n[0].length,n;e.ch=n.index+1}}function s(e){for(;;){var n=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==n){if(o(e))continue;return}if(u(e,n+1)){var t=e.text.lastIndexOf("/",n),i=t>-1&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,i?"selfClose":"regular"}e.ch=n}}function h(e,t){for(var i=[];;){var r,u=a(e),f=e.line,o=e.ch-(u?u[0].length:0);if(!u||!(r=l(e)))return;if("selfClose"!=r)if(u[1]){for(var c=i.length-1;c>=0;--c)if(i[c]==u[2]){i.length=c;break}if(c<0&&(!t||t==u[2]))return{tag:u[2],from:n(f,o),to:n(e.line,e.ch)}}else i.push(u[2])}}function F(e,t){for(var i=[];;){var r=s(e);if(!r)return;if("selfClose"!=r){var u=e.line,f=e.ch,o=c(e);if(!o)return;if(o[1])i.push(o[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!t||t==o[2]))return{tag:o[2],from:n(e.line,e.ch),to:n(u,f)}}}else c(e)}}e.registerHelper("fold","xml",function(e,t){for(var i=new r(e,t.line,0);;){var u,f=a(i);if(!f||!(u=l(i))||i.line!=t.line)return;if(!f[1]&&"selfClose"!=u){var o=n(i.line,i.ch),c=h(i,f[2]);return c&&{from:o,to:c.from}}}}),e.findMatchingTag=function(e,t,i){var u=new r(e,t.line,t.ch,i);if(-1!=u.text.indexOf(">")||-1!=u.text.indexOf("<")){var f=l(u),o=f&&n(u.line,u.ch),a=f&&c(u);if(f&&a&&(x=t,!(((s=u).line-x.line||s.ch-x.ch)>0))){var s,x,g={from:n(u.line,u.ch),to:o,tag:a[2]};return"selfClose"==f?{open:g,close:null,at:"open"}:a[1]?{open:F(u,a[2]),close:g,at:"close"}:{open:g,close:h(u=new r(e,o.line,o.ch,i),a[2]),at:"open"}}}},e.findEnclosingTag=function(e,n,t,i){for(var u=new r(e,n.line,n.ch,t);;){var f=F(u,i);if(!f)break;var o=h(new r(e,n.line,n.ch,t),f.tag);if(o)return{open:f,close:o}}},e.scanForClosingTag=function(e,n,t,i){return h(new r(e,n.line,n.ch,i?{from:0,to:i}:null),t)}});

View File

@ -0,0 +1,19 @@
{
"tiddlers": [
{
"file": "addon/fold/xml-fold.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/fold/xml-fold.js",
"module-type": "codemirror"
}
},{
"file": "addon/edit/closetag.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/edit/closetag.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-closetag",
"description": "CodeMirror AddOn: Auto-Close Tags",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,5 @@
title: $:/plugins/tiddlywiki/codemirror-closetag/readme
This plugin adds the ability to ''automatically close Tags''. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed

View File

@ -0,0 +1,9 @@
title: $:/core/ui/ControlPanel/Settings/codemirror/autoCloseTags
tags: $:/tags/ControlPanel/Settings/CodeMirror
caption: {{$:/language/codemirror/autoCloseTags/hint}}
\define lingo-base() $:/language/codemirror/autoCloseTags/
<<lingo hint>>
<$checkbox tiddler="$:/config/codemirror/autoCloseTags" field="text" checked="true" unchecked="false" default="true"> <$link to="$:/config/codemirror/autoCloseTags"><<lingo info>></$link> </$checkbox>

View File

@ -0,0 +1,7 @@
title: $:/config/codemirror/fullscreen
extend: extraKeys
type: json
{
"F11": "togglefullscreen"
}

View File

@ -0,0 +1,6 @@
.CodeMirror-fullscreen {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
height: auto;
z-index: 9;
}

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineOption("fullScreen",!1,function(t,l,o){var r,n;(o==e.Init&&(o=!1),!o!=!l)&&(l?(n=(r=t).getWrapperElement(),r.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:n.style.width,height:n.style.height},n.style.width="",n.style.height="auto",n.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",r.refresh()):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var l=e.state.fullScreenRestore;t.style.width=l.width,t.style.height=l.height,window.scrollTo(l.scrollLeft,l.scrollTop),e.refresh()}(t))}),e.toggleFullscreen=function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},e.commands.togglefullscreen=e.toggleFullscreen});

View File

@ -0,0 +1,19 @@
{
"tiddlers": [
{
"file": "addon/fullscreen/fullscreen.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/fullscreen/fullscreen.js",
"module-type": "codemirror"
}
},{
"file": "addon/fullscreen/fullscreen.css",
"fields": {
"type": "text/css",
"title": "$:/plugins/tiddlywiki/codemirror/addon/fullscreen/fullscreen.css",
"tags": "[[$:/tags/Stylesheet]]"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-fullscreen",
"description": "CodeMirror AddOn: Fullscreen Editing",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,6 @@
title: $:/plugins/tiddlywiki/codemirror-fullscreen/readme
This plugin adds a ''Fullscreen editing Mode'' to the [[CodeMirror|http://codemirror.net]] text editor. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed
Pressing ''F11'' with the focus within the editor-textarea will make the editor go fullscreen, pressing ''F11'' again leaves fullscreen-mode

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/codemirror/keymaps/emacs
module-type: codemirror-keymap
emacs

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
{
"tiddlers": [
{
"file": "keymap/emacs.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/keymap/emacs.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-keymap-emacs",
"description": "CodeMirror Keymap: Emacs",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,5 @@
title: $:/plugins/tiddlywiki/codemirror-keymap-emacs/readme
This plugin adds a ''Keymap'' with some of the most important ''Emacs'' keyboard shortcuts
For more information about available ''keyboard shortcuts'' see the [ext[CodeMirror emacs demo|https://codemirror.net/demo/emacs.html]]

View File

@ -0,0 +1,24 @@
title: $:/config/codemirror/extraKeysTW
extend: extraKeys
type: json
{
"Ctrl-M": "",
"Alt-M": "goToBracket",
"Ctrl-Enter": "",
"Shift-Enter": "insertLineAfter",
"Esc": "",
"Ctrl-Esc": "singleSelectionTop",
"Ctrl-L": "",
"Shift-Ctrl-L": "",
"Alt-L": "selectLine",
"Shift-Alt-L": "splitSelectionByLine",
"Ctrl-T": "",
"Alt-T": "transposeChars",
"Ctrl-K Ctrl-U": "",
"Ctrl-K Ctrl-L": "",
"Ctrl-K Ctrl-W": "",
"Ctrl-K Alt-U": "upcaseAtCursor",
"Ctrl-K Alt-L": "downcaseAtCursor",
"Ctrl-K Alt-D": "deleteToSublimeMark"
}

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/codemirror/keymaps/sublime
module-type: codemirror-keymap
sublime

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
{
"tiddlers": [
{
"file": "keymap/sublime.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/keymap/sublime.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-keymap-sublime-text",
"description": "CodeMirror Keymap: Sublime Text",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,58 @@
title: $:/plugins/tiddlywiki/codemirror-keymap-sublime-text/readme
This plugin adds a ''Keymap'' with the most important ''Sublime Text'' keyboard shortcuts
Shortcuts that interfere with ~TiddlyWiki shortcuts differ from the original sublime shortcuts to preserve functionality
|Shortcut |Function |h
|Shift-Tab |indentLess |
|Shift-Ctrl-K |deleteLine |
|Alt-Q |wrapLines |
|Alt-T |transposeChars |
|Alt-Left |goSubwordLeft |
|Alt-Right |goSubwordRight |
|Ctrl-Up |scrollLineUp |
|Ctrl-Down |scrollLineDown |
|Alt-L |selectLine |
|Shift-Alt-L |splitSelectionByLine |
|Ctrl-Esc |singleSelectionTop |
|Shift-Enter |insertLineAfter |
|Shift-Ctrl-Enter |insertLineBefore |
|Ctrl-D |selectNextOccurrence |
|Shift-Ctrl-Space |selectScope |
|Shift-Ctrl-M |selectBetweenBrackets |
|Alt-M |goToBracket |
|Shift-Ctrl-Up |swapLineUp |
|Shift-Ctrl-Down |swapLineDown |
|Ctrl-/ |toggleCommentIndented |
|Ctrl-J |joinLines |
|Shift-Ctrl-D |duplicateLine |
|F9 |sortLines |
|Ctrl-F9 |sortLinesInsensitive |
|F2 |nextBookmark |
|Shift-F2 |prevBookmark |
|Ctrl-F2 |toggleBookmark |
|Shift-Ctrl-F2 |clearBookmarks |
|Alt-F2 |selectBookmarks |
|Backspace |smartBackspace |
|Ctrl-K Ctrl-K |delLineRight |
|Ctrl-K Alt-U |upcaseAtCursor |
|Ctrl-K Alt-L |downcaseAtCursor |
|Ctrl-K Ctrl-Space |setSublimeMark |
|Ctrl-K Ctrl-A |selectToSublimeMark |
|Ctrl-K Alt-D |deleteToSublimeMark |
|Ctrl-K Ctrl-X |swapWithSublimeMark |
|Ctrl-K Ctrl-Y |sublimeYank |
|Ctrl-K Ctrl-C |showInCenter |
|Ctrl-K Ctrl-G |clearBookmarks |
|Ctrl-K Ctrl-Backspace |delLineLeft |
|Ctrl-K Ctrl-0 |unfoldAll |
|Ctrl-K Ctrl-J |unfoldAll |
|Ctrl-Alt-Up |addCursorToPrevLine |
|Ctrl-Alt-Down |addCursorToNextLine |
|Ctrl-F3 |findUnder |
|Shift-Ctrl-F3 |findUnderPrevious |
|Shift-Ctrl-[ |fold |
|Shift-Ctrl-] |unfold |
|Ctrl-H |replace |

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/codemirror/keymaps/vim
module-type: codemirror-keymap
vim

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
{
"tiddlers": [
{
"file": "keymap/vim.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/keymap/vim.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-keymap-vim",
"description": "CodeMirror Keymap: Vim",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,5 @@
title: $:/plugins/tiddlywiki/codemirror-keymap-vim/readme
This plugin adds a ''Keymap'' with some of the most important ''Vim'' keyboard shortcuts
For information about available ''keyboard shortcuts'' see the [ext[CodeMirror vim demo|https://codemirror.net/demo/vim.html]]

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
{
"tiddlers": [
{
"file": "mode/css/css.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/mode/css/css.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-mode-css",
"description": "CodeMirror Mode: CSS Highlighting",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,5 @@
title: $:/plugins/tiddlywiki/codemirror-mode-css/readme
This plugin adds Syntax Highlighting for CSS tiddlers (text/css) to the [[CodeMirror|http://codemirror.net]] text editor. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.multiplexingMode=function(n){var i=Array.prototype.slice.call(arguments,1);function t(e,n,i,t){if("string"==typeof n){var r=e.indexOf(n,i);return t&&r>-1?r+n.length:r}var o=n.exec(i?e.slice(i):e);return o?o.index+i+(t?o[0].length:0):-1}return{startState:function(){return{outer:e.startState(n),innerActive:null,inner:null}},copyState:function(i){return{outer:e.copyState(n,i.outer),innerActive:i.innerActive,inner:i.innerActive&&e.copyState(i.innerActive.mode,i.inner)}},token:function(r,o){if(o.innerActive){var c=o.innerActive;a=r.string;if(!c.close&&r.sol())return o.innerActive=o.inner=null,this.token(r,o);if((v=c.close?t(a,c.close,r.pos,c.parseDelimiters):-1)==r.pos&&!c.parseDelimiters)return r.match(c.close),o.innerActive=o.inner=null,c.delimStyle&&c.delimStyle+" "+c.delimStyle+"-close";v>-1&&(r.string=a.slice(0,v));var l=c.mode.token(r,o.inner);return v>-1&&(r.string=a),v==r.pos&&c.parseDelimiters&&(o.innerActive=o.inner=null),c.innerStyle&&(l=l?l+" "+c.innerStyle:c.innerStyle),l}for(var s=1/0,a=r.string,u=0;u<i.length;++u){var v,d=i[u];if((v=t(a,d.open,r.pos))==r.pos){d.parseDelimiters||r.match(d.open),o.innerActive=d;var f=0;if(n.indent){var m=n.indent(o.outer,"");m!==e.Pass&&(f=m)}return o.inner=e.startState(d.mode,f),d.delimStyle&&d.delimStyle+" "+d.delimStyle+"-open"}-1!=v&&v<s&&(s=v)}s!=1/0&&(r.string=a.slice(0,s));var p=n.token(r,o.outer);return s!=1/0&&(r.string=a),p},indent:function(i,t){var r=i.innerActive?i.innerActive.mode:n;return r.indent?r.indent(i.innerActive?i.inner:i.outer,t):e.Pass},blankLine:function(t){var r=t.innerActive?t.innerActive.mode:n;if(r.blankLine&&r.blankLine(t.innerActive?t.inner:t.outer),t.innerActive)"\n"===t.innerActive.close&&(t.innerActive=t.inner=null);else for(var o=0;o<i.length;++o){var c=i[o];"\n"===c.open&&(t.innerActive=c,t.inner=e.startState(c.mode,r.indent?r.indent(t.outer,""):0))}},electricChars:n.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:n}}}}});

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlembedded",function(i,t){var d=t.closeComment||"--%>";return e.multiplexingMode(e.getMode(i,"htmlmixed"),{open:t.openComment||"<%--",close:d,delimStyle:"comment",mode:{token:function(e){return e.skipTo(d)||e.skipToEnd(),"comment"}}},{open:t.open||t.scriptStartRegex||"<%",close:t.close||t.scriptEndRegex||"%>",mode:e.getMode(i,t.scriptingModeSpec)})},"htmlmixed"),e.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),e.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),e.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),e.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})});

View File

@ -0,0 +1,19 @@
{
"tiddlers": [
{
"file": "addon/mode/multiplex.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/mode/multiplex.js",
"module-type": "codemirror"
}
},{
"file": "mode/htmlembedded/htmlembedded.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/mode/htmlembedded/htmlembedded.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-mode-htmlembedded",
"description": "CodeMirror Mode: Embedded-HTML Highlighting",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/codemirror-mode-htmlembedded/readme
This plugin adds Syntax Highlighting for Embedded-HTML tiddlers (application/x-aspx, application/x-ejs, application/x-jsp and application/x-erb) to the [[CodeMirror|http://codemirror.net]] text editor. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],t):t(CodeMirror)}(function(t){"use strict";var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var a={};function n(t,e){var n,l=t.match(a[n=e]||(a[n]=new RegExp("\\s+"+n+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")));return l?/^\s*(.*?)\s*$/.exec(l[2])[1]:""}function l(t,e){return new RegExp((e?"^":"")+"</s*"+t+"s*>","i")}function r(t,e){for(var a in t)for(var n=e[a]||(e[a]=[]),l=t[a],r=l.length-1;r>=0;r--)n.unshift(l[r])}t.defineMode("htmlmixed",function(a,o){var c=t.getMode(a,{name:"xml",htmlMode:!0,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag}),i={},s=o&&o.tags,u=o&&o.scriptTypes;if(r(e,i),s&&r(s,i),u)for(var m=u.length-1;m>=0;m--)i.script.unshift(["type",u[m].matches,u[m].mode]);function d(e,r){var o,s=c.token(e,r.htmlState),u=/\btag\b/.test(s);if(u&&!/[<>\s\/]/.test(e.current())&&(o=r.htmlState.tagName&&r.htmlState.tagName.toLowerCase())&&i.hasOwnProperty(o))r.inTag=o+" ";else if(r.inTag&&u&&/>$/.test(e.current())){var m=/^([\S]+) (.*)/.exec(r.inTag);r.inTag=null;var p=">"==e.current()&&function(t,e){for(var a=0;a<t.length;a++){var l=t[a];if(!l[0]||l[1].test(n(e,l[0])))return l[2]}}(i[m[1]],m[2]),f=t.getMode(a,p),g=l(m[1],!0),h=l(m[1],!1);r.token=function(t,e){return t.match(g,!1)?(e.token=d,e.localState=e.localMode=null,null):(a=t,n=h,l=e.localMode.token(t,e.localState),r=a.current(),(o=r.search(n))>-1?a.backUp(r.length-o):r.match(/<\/?$/)&&(a.backUp(r.length),a.match(n,!1)||a.match(r)),l);var a,n,l,r,o},r.localMode=f,r.localState=t.startState(f,c.indent(r.htmlState,""))}else r.inTag&&(r.inTag+=e.current(),e.eol()&&(r.inTag+=" "));return s}return{startState:function(){return{token:d,inTag:null,localMode:null,localState:null,htmlState:t.startState(c)}},copyState:function(e){var a;return e.localState&&(a=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:a,htmlState:t.copyState(c,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,a,n){return!e.localMode||/^\s*<\//.test(a)?c.indent(e.htmlState,a):e.localMode.indent?e.localMode.indent(e.localState,a,n):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||c}}}},"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")});

View File

@ -0,0 +1,12 @@
{
"tiddlers": [
{
"file": "mode/htmlmixed/htmlmixed.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/mode/htmlmixed/htmlmixed.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-mode-htmlmixed",
"description": "CodeMirror Mode: HTML Highlighting",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/codemirror-mode-htmlmixed/readme
This plugin adds Syntax Highlighting for HTML tiddlers (text/html) to the [[CodeMirror|http://codemirror.net]] text editor. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
{
"tiddlers": [
{
"file": "mode/javascript/javascript.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-mode-javascript",
"description": "CodeMirror Mode: Javascript Highlighting",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/codemirror-mode-javascript/readme
This plugin adds Syntax Highlighting for Javascript tiddlers (application/javascript) to the [[CodeMirror|http://codemirror.net]] text editor. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
{
"tiddlers": [
{
"file": "mode/markdown/markdown.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/mode/markdown/markdown.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-mode-markdown",
"description": "CodeMirror Mode: Markdown Highlighting",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/codemirror-mode-markdown/readme
This plugin adds Syntax Highlighting for Markdown tiddlers (text/x-markdown) to the [[CodeMirror|http://codemirror.net]] text editor. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tiddlywiki",function(){var e={},t={allTags:!0,closeAll:!0,list:!0,newJournal:!0,newTiddler:!0,permaview:!0,saveChanges:!0,search:!0,slider:!0,tabs:!0,tag:!0,tagging:!0,tags:!0,tiddler:!0,timeline:!0,today:!0,version:!0,option:!0,with:!0,filter:!0},r=/[\w_\-]/i,n=/^\-\-\-\-+$/,i=/^\/\*\*\*$/,o=/^\*\*\*\/$/,u=/^<<<$/,a=/^\/\/\{\{\{$/,f=/^\/\/\}\}\}$/,c=/^<!--\{\{\{-->$/,m=/^<!--\}\}\}-->$/,l=/^\{\{\{$/,k=/^\}\}\}$/,d=/.*?\}\}\}/;function h(e,t,r){return t.tokenize=r,r(e,t)}function s(t,k){var d=t.sol(),s=t.peek();if(k.block=!1,d&&/[<\/\*{}\-]/.test(s)){if(t.match(l))return k.block=!0,h(t,k,$);if(t.match(u))return"quote";if(t.match(i)||t.match(o))return"comment";if(t.match(a)||t.match(f)||t.match(c)||t.match(m))return"comment";if(t.match(n))return"hr"}if(t.next(),d&&/[\/\*!#;:>|]/.test(s)){if("!"==s)return t.skipToEnd(),"header";if("*"==s)return t.eatWhile("*"),"comment";if("#"==s)return t.eatWhile("#"),"comment";if(";"==s)return t.eatWhile(";"),"comment";if(":"==s)return t.eatWhile(":"),"comment";if(">"==s)return t.eatWhile(">"),"quote";if("|"==s)return"header"}if("{"==s&&t.match(/\{\{/))return h(t,k,$);if(/[hf]/i.test(s)&&/[ti]/i.test(t.peek())&&t.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return"link";if('"'==s)return"string";if("~"==s)return"brace";if(/[\[\]]/.test(s)&&t.match(s))return"brace";if("@"==s)return t.eatWhile(r),"link";if(/\d/.test(s))return t.eatWhile(/\d/),"number";if("/"==s){if(t.eat("%"))return h(t,k,b);if(t.eat("/"))return h(t,k,v)}if("_"==s&&t.eat("_"))return h(t,k,w);if("-"==s&&t.eat("-")){if(" "!=t.peek())return h(t,k,x);if(" "==t.peek())return"brace"}return"'"==s&&t.eat("'")?h(t,k,p):"<"==s&&t.eat("<")?h(t,k,z):(t.eatWhile(/[\w\$_]/),e.propertyIsEnumerable(t.current())?"keyword":null)}function b(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=s;break}n="%"==r}return"comment"}function p(e,t){for(var r,n=!1;r=e.next();){if("'"==r&&n){t.tokenize=s;break}n="'"==r}return"strong"}function $(e,t){var r=t.block;return r&&e.current()?"comment":!r&&e.match(d)?(t.tokenize=s,"comment"):r&&e.sol()&&e.match(k)?(t.tokenize=s,"comment"):(e.next(),"comment")}function v(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=s;break}n="/"==r}return"em"}function w(e,t){for(var r,n=!1;r=e.next();){if("_"==r&&n){t.tokenize=s;break}n="_"==r}return"underlined"}function x(e,t){for(var r,n=!1;r=e.next();){if("-"==r&&n){t.tokenize=s;break}n="-"==r}return"strikethrough"}function z(e,r){if("<<"==e.current())return"macro";var n=e.next();return n?">"==n&&">"==e.peek()?(e.next(),r.tokenize=s,"macro"):(e.eatWhile(/[\w\$_]/),t.propertyIsEnumerable(e.current())?"keyword":null):(r.tokenize=s,null)}return{startState:function(){return{tokenize:s}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)}}}),e.defineMIME("text/x-tiddlywiki","tiddlywiki")});

View File

@ -0,0 +1,19 @@
{
"tiddlers": [
{
"file": "mode/tiddlywiki/tiddlywiki.css",
"fields": {
"type": "text/css",
"title": "$:/plugins/tiddlywiki/codemirror/mode/tiddlywiki/tiddlywiki.css",
"tags": "[[$:/tags/Stylesheet]]"
}
},{
"file": "mode/tiddlywiki/tiddlywiki.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/mode/tiddlywiki/tiddlywiki.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki",
"description": "CodeMirror Mode: Tiddlywiki Classic Highlighting",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/codemirror-mode-x-tiddlywiki/readme
This plugin adds Syntax Highlighting for ~TiddlyWiki Classic tiddlers (text/x-tiddlywiki) to the [[CodeMirror|http://codemirror.net]] text editor. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
{
"tiddlers": [
{
"file": "mode/xml/xml.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/mode/xml/xml.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-mode-xml",
"description": "CodeMirror Mode: XML Highlighting",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/codemirror-mode-xml/readme
This plugin is a requirement for other Syntax-highlighting plugins and adds Highlighting for XML tiddlers (application/xml) to the [[CodeMirror|http://codemirror.net]] text editor. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed

View File

@ -0,0 +1,3 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function o(e,o){var r=Number(o);return/^[-+]/.test(o)?e.getCursor().line+r:r-1}e.commands.jumpToLine=function(e){var r,i,t,s,n,l=e.getCursor();r=e,i='Jump to line: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use line:column or scroll% syntax)</span>',t="Jump to line:",s=l.line+1+":"+l.ch,n=function(r){var i;if(r)if(i=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(r))e.setCursor(o(e,i[1]),Number(i[2]));else if(i=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(r)){var t=Math.round(e.lineCount()*Number(i[1])/100);/^[-+]/.test(i[1])&&(t=l.line+t+1),e.setCursor(t-1,l.ch)}else(i=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(r))&&e.setCursor(o(e,i[1]),l.ch)},r.openDialog?r.openDialog(i,n,{value:s,selectValueOnOpen:!0}):n(prompt(t,s))},e.keyMap.default["Alt-G"]="jumpToLine"});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,26 @@
{
"tiddlers": [
{
"file": "addon/search/search.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/search/search.js",
"module-type": "codemirror"
}
},{
"file": "addon/search/jump-to-line.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/search/jump-to-line.js",
"module-type": "codemirror"
}
},{
"file": "addon/search/searchcursor.js",
"fields": {
"type": "application/javascript",
"title": "$:/plugins/tiddlywiki/codemirror/addon/search/searchcursor.js",
"module-type": "codemirror"
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/codemirror-search-replace",
"description": "CodeMirror AddOn: Search and Replace",
"author": "JeremyRuston",
"list": "readme"
}

View File

@ -0,0 +1,15 @@
title: $:/plugins/tiddlywiki/codemirror-search-replace/readme
This plugin enhances the [[CodeMirror|http://codemirror.net]] text editor with Search and Replace functionality. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed
It adds these Keyboard Shortcuts to ~CodeMirror:
|Shortcut |Function |h
|Ctrl-F / Cmd-F |Start searching |
|Ctrl-G / Cmd-G / Shift-F3 |Find next |
|Shift-Ctrl-G / Shift-Cmd-G / F3 |Find previous |
|Shift-Ctrl-F / Cmd-Option-F |Replace |
|Shift-Ctrl-R / Shift-Cmd-Option-F |Replace all |
|Alt-F |Persistent search (dialog doesn't autoclose, enter to find next, Shift-Enter to find previous) |
|Alt-G |Jump to line |

View File

@ -0,0 +1,22 @@
title: $:/language/codemirror/
homeUrl: http://codemirror.net
addOnUrl: http://codemirror.net/doc/manual.html#addons
configUrl: http://codemirror.net/doc/manual.html#config
controlPanel/hint: These settings let you customise the behaviour of [[CodeMirror|$:/plugins/tiddlywiki/codemirror]].
controlPanel/usage: Usage information
editorFont/hint: Editor font family
editorFont/info: Set the font family for the ~CodeMirror text-editor
controlPanel/keyboard: Keyboard shortcuts
keyMap/hint: ~CodeMirror keymap
keyMap/info: ~The Keyboard KeyMap used within the ~CodeMirror text-editor
lineNumbers/hint: Enable line numbers
lineNumbers/info: Whether to show line numbers to the left of the editor.
lineWrapping/hint: Enable line wrapping
lineWrapping/info: Whether CodeMirror should scroll or wrap for long lines. Defaults to `false` (scroll).
showCursorWhenSelecting/hint: Show cursor, when selecting
showCursorWhenSelecting/info: Whether the cursor should be drawn when a selection is active.
styleActiveLine/hint: Highlight active line
styleActiveLine/info: Whether or not to highlight the active text-editor line
theme/hint: Select a theme
theme/info: Choose between ~CodeMirror themes

View File

@ -1,25 +0,0 @@
title: $:/config/CodeMirror
type: application/json
{
"require": [
"$:/plugins/tiddlywiki/codemirror/addon/dialog/dialog.js",
"$:/plugins/tiddlywiki/codemirror/addon/search/searchcursor.js",
"$:/plugins/tiddlywiki/codemirror/addon/edit/matchbrackets.js",
"$:/plugins/tiddlywiki/codemirror/addon/mode/multiplex.js",
"$:/plugins/tiddlywiki/codemirror/mode/css/css.js",
"$:/plugins/tiddlywiki/codemirror/mode/htmlembedded/htmlembedded.js",
"$:/plugins/tiddlywiki/codemirror/mode/htmlmixed/htmlmixed.js",
"$:/plugins/tiddlywiki/codemirror/mode/javascript/javascript.js",
"$:/plugins/tiddlywiki/codemirror/mode/markdown/markdown.js",
"$:/plugins/tiddlywiki/codemirror/mode/meta.js",
"$:/plugins/tiddlywiki/codemirror/mode/tiddlywiki/tiddlywiki.js",
"$:/plugins/tiddlywiki/codemirror/mode/xml/xml.js",
"$:/plugins/tiddlywiki/codemirror/keymap/vim.js",
"$:/plugins/tiddlywiki/codemirror/keymap/emacs.js"
],
"configuration": {
"matchBrackets": true,
"showCursorWhenSelecting": true
}
}

View File

@ -0,0 +1,4 @@
title: $:/config/codemirror/cursorBlinkRate
type: string
530

View File

@ -0,0 +1,15 @@
title: $:/config/codemirror/extraKeysTW
extend: extraKeys
type: json
{
"Ctrl-Esc": "singleSelection",
"Esc": "",
"Ctrl-S": "",
"Ctrl-U": "",
"Ctrl-T": "",
"Alt-T": "transposeChars",
"Alt-U": "undoSelection",
"Shift-Alt-U": "redoSelection",
"Cmd-U": ""
}

View File

@ -0,0 +1,3 @@
title: $:/config/codemirror/indentUnit
2

View File

@ -0,0 +1,4 @@
title: $:/config/codemirror/inputStyle
type: string
textarea

Some files were not shown because too many files have changed in this diff Show More