From 3d9ce7f2459ccf32ab16fb0f0484253d740a219d Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Tue, 1 May 2018 01:31:00 +0300 Subject: [PATCH 01/36] Missing space (#20260) --- libraries/src/Form/Field/TagField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Form/Field/TagField.php b/libraries/src/Form/Field/TagField.php index fac09bb18507b..ecd7326bd8416 100644 --- a/libraries/src/Form/Field/TagField.php +++ b/libraries/src/Form/Field/TagField.php @@ -116,7 +116,7 @@ protected function getInput() */ protected function getOptions() { - $published = $this->element['published']?: array(0, 1); + $published = $this->element['published'] ?: array(0, 1); $app = Factory::getApplication(); $tag = $app->getLanguage()->getTag(); From 539603fbcde66ff860c832037d2404b81aca5bb3 Mon Sep 17 00:00:00 2001 From: Quy Date: Mon, 30 Apr 2018 15:31:48 -0700 Subject: [PATCH 02/36] Tiny JLanguage::loadLanguage() code improvement (#20257) --- libraries/src/Language/Language.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libraries/src/Language/Language.php b/libraries/src/Language/Language.php index 0f384d5937b27..72acb92a1739c 100644 --- a/libraries/src/Language/Language.php +++ b/libraries/src/Language/Language.php @@ -791,13 +791,10 @@ protected function loadLanguage($filename, $extension = 'unknown') $strings = $this->parse($filename); } - if ($strings) + if (is_array($strings) && count($strings)) { - if (is_array($strings) && count($strings)) - { - $this->strings = array_replace($this->strings, $strings, $this->override); - $result = true; - } + $this->strings = array_replace($this->strings, $strings, $this->override); + $result = true; } // Record the result of loading the extension's file. From 960e1effa472db4f0732f3552f8f493b0fa43cc1 Mon Sep 17 00:00:00 2001 From: Quy Date: Mon, 30 Apr 2018 15:32:17 -0700 Subject: [PATCH 03/36] [com_content] Remove redundant check (#20254) --- components/com_content/views/form/view.html.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/components/com_content/views/form/view.html.php b/components/com_content/views/form/view.html.php index 267f4c4a29a86..a5d5ae02de5c8 100644 --- a/components/com_content/views/form/view.html.php +++ b/components/com_content/views/form/view.html.php @@ -72,10 +72,7 @@ public function display($tpl = null) if (!empty($this->item->id)) { $this->item->tags->getItemTags('com_content.article', $this->item->id); - } - if (!empty($this->item) && isset($this->item->id)) - { $this->item->images = json_decode($this->item->images); $this->item->urls = json_decode($this->item->urls); From e99b38dc22fc61ebaa1384cda2c3a60379a1383b Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Tue, 1 May 2018 01:32:56 +0300 Subject: [PATCH 04/36] Update articles.php (#20245) --- components/com_content/models/articles.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/com_content/models/articles.php b/components/com_content/models/articles.php index 6be0ecfce88e0..a3afe075ea1cd 100644 --- a/components/com_content/models/articles.php +++ b/components/com_content/models/articles.php @@ -377,11 +377,11 @@ protected function getListQuery() } elseif (is_array($authorId)) { - $authorId = ArrayHelper::toInteger($authorId); - $authorId = implode(',', $authorId); + $authorId = array_filter($authorId, 'is_numeric'); if ($authorId) { + $authorId = implode(',', $authorId); $type = $this->getState('filter.author_id.include', true) ? 'IN' : 'NOT IN'; $authorWhere = 'a.created_by ' . $type . ' (' . $authorId . ')'; } From f632960538a3d18a48bd08ec363dffdec6e2057b Mon Sep 17 00:00:00 2001 From: Quy Date: Fri, 4 May 2018 15:06:13 -0700 Subject: [PATCH 05/36] [com_config] Capitalize label (#20299) --- administrator/language/en-GB/en-GB.com_config.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_config.ini b/administrator/language/en-GB/en-GB.com_config.ini index 2c8110a6d10ac..fef4b2ae96afe 100644 --- a/administrator/language/en-GB/en-GB.com_config.ini +++ b/administrator/language/en-GB/en-GB.com_config.ini @@ -114,7 +114,7 @@ COM_CONFIG_FIELD_MAIL_FROM_EMAIL_DESC="The email address that will be used to se COM_CONFIG_FIELD_MAIL_FROM_EMAIL_LABEL="From Email" COM_CONFIG_FIELD_MAIL_FROM_NAME_DESC="Text displayed in the header "From:" field when sending a site email. Usually the site name." COM_CONFIG_FIELD_MAIL_FROM_NAME_LABEL="From Name" -COM_CONFIG_FIELD_MAIL_REPLY_TO_EMAIL_LABEL="Reply To email" +COM_CONFIG_FIELD_MAIL_REPLY_TO_EMAIL_LABEL="Reply To Email" COM_CONFIG_FIELD_MAIL_REPLY_TO_EMAIL_DESC="The email address that will be used to receive end user(s) reply" COM_CONFIG_FIELD_MAIL_REPLY_TO_NAME_LABEL="Reply To Name" COM_CONFIG_FIELD_MAIL_REPLY_TO_NAME_DESC="Text displayed in the header "To:" field when end user(s) replying to received email" From 3ca70d0dca5ac5caf643bb447eb1dab5c84703d4 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 5 May 2018 20:14:50 +0200 Subject: [PATCH 06/36] Implement Issue Templates as discussen in #20298 https://github.com/joomla/joomla-cms/issues/20298 --- .github/ISSUE_TEMPLATE/Bug_report.md | 23 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/Custom.md | 16 ++++++++++++++++ .github/ISSUE_TEMPLATE/Feature_request.md | 15 +++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/Bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/Custom.md create mode 100644 .github/ISSUE_TEMPLATE/Feature_request.md diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md new file mode 100644 index 0000000000000..f234699b23618 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -0,0 +1,23 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +### Steps to reproduce the issue + + + +### Expected result + + + +### Actual result + + + +### System information (as much as possible) + + + +### Additional comments diff --git a/.github/ISSUE_TEMPLATE/Custom.md b/.github/ISSUE_TEMPLATE/Custom.md new file mode 100644 index 0000000000000..1c32a221edc25 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Custom.md @@ -0,0 +1,16 @@ +--- +name: Fix this template +about: Suggest a fix it + +--- + +### What needs to be fixed + + +### Why this should be fixed + + +### How would you fix it + + +### Side Effects expected diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md new file mode 100644 index 0000000000000..e853c4610a791 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -0,0 +1,15 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +### Is your feature request related to a problem? Please describe. + + + +### Describe the solution you'd like + + + +### Additional context From dfa167c75236945cf5bd6a9776ae007b614da3da Mon Sep 17 00:00:00 2001 From: Ramil Valitov Date: Sat, 5 May 2018 23:15:51 +0300 Subject: [PATCH 07/36] [fix] openbase_dir processing (#20280) --- libraries/joomla/filesystem/folder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/joomla/filesystem/folder.php b/libraries/joomla/filesystem/folder.php index 81ddc8e5a9ef9..76db95ce57a0a 100644 --- a/libraries/joomla/filesystem/folder.php +++ b/libraries/joomla/filesystem/folder.php @@ -247,7 +247,7 @@ public static function create($path = '', $mode = 0755) { $test = $pathObject->clean($test); - if (strpos($path, $test) === 0) + if (strpos($path, $test) === 0 || strpos($path, realpath($test)) === 0) { $inBaseDir = true; break; From 13491f611f2c1cfdcc7fa5f54ce466214ccc83dd Mon Sep 17 00:00:00 2001 From: Elijah Madden Date: Sun, 6 May 2018 05:16:12 +0900 Subject: [PATCH 08/36] CodeMirror updated to version 5.37.0 (#20269) --- .../codemirror/addon/edit/continuelist.js | 2 +- .../codemirror/addon/edit/continuelist.min.js | 2 +- .../editors/codemirror/addon/fold/xml-fold.js | 8 +- .../codemirror/addon/fold/xml-fold.min.js | 2 +- .../codemirror/addon/hint/javascript-hint.js | 4 +- .../addon/hint/javascript-hint.min.js | 2 +- .../codemirror/addon/hint/show-hint.js | 11 +- .../codemirror/addon/hint/show-hint.min.js | 2 +- .../editors/codemirror/addon/hint/sql-hint.js | 19 +- .../codemirror/addon/hint/sql-hint.min.js | 2 +- .../editors/codemirror/addon/merge/merge.css | 6 + media/editors/codemirror/addon/merge/merge.js | 3 +- .../codemirror/addon/merge/merge.min.css | 2 +- .../codemirror/addon/merge/merge.min.js | 2 +- .../codemirror/addon/mode/multiplex.js | 10 +- .../codemirror/addon/mode/multiplex.min.js | 2 +- .../addon/search/match-highlighter.js | 2 +- .../addon/search/match-highlighter.min.js | 2 +- media/editors/codemirror/keymap/emacs.js | 1 + media/editors/codemirror/keymap/emacs.min.js | 2 +- media/editors/codemirror/keymap/vim.js | 188 +++++++++++++++++- media/editors/codemirror/keymap/vim.min.js | 6 +- media/editors/codemirror/lib/addons.js | 20 +- media/editors/codemirror/lib/addons.min.js | 4 +- media/editors/codemirror/lib/codemirror.js | 65 +++--- .../editors/codemirror/lib/codemirror.min.js | 8 +- media/editors/codemirror/mode/clike/clike.js | 4 + .../codemirror/mode/clike/clike.min.js | 2 +- .../codemirror/mode/javascript/javascript.js | 26 ++- .../mode/javascript/javascript.min.js | 2 +- .../codemirror/mode/markdown/markdown.js | 4 +- .../codemirror/mode/markdown/markdown.min.js | 2 +- .../editors/codemirror/mode/python/python.js | 99 ++++++++- .../codemirror/mode/python/python.min.js | 2 +- media/editors/codemirror/mode/soy/soy.js | 1 + media/editors/codemirror/mode/soy/soy.min.js | 2 +- media/editors/codemirror/mode/sql/sql.js | 30 ++- media/editors/codemirror/mode/sql/sql.min.js | 4 +- .../codemirror/mode/velocity/velocity.js | 2 +- .../codemirror/mode/velocity/velocity.min.js | 2 +- .../editors/codemirror/theme/gruvbox-dark.css | 34 ++++ media/editors/codemirror/theme/idea.css | 31 +++ media/editors/codemirror/theme/lucario.css | 37 ++++ media/editors/codemirror/theme/ssms.css | 16 ++ plugins/editors/codemirror/codemirror.xml | 2 +- 45 files changed, 563 insertions(+), 116 deletions(-) create mode 100644 media/editors/codemirror/theme/gruvbox-dark.css create mode 100644 media/editors/codemirror/theme/idea.css create mode 100644 media/editors/codemirror/theme/lucario.css create mode 100644 media/editors/codemirror/theme/ssms.css diff --git a/media/editors/codemirror/addon/edit/continuelist.js b/media/editors/codemirror/addon/edit/continuelist.js index b83dc505ff56c..4e7d39287429c 100644 --- a/media/editors/codemirror/addon/edit/continuelist.js +++ b/media/editors/codemirror/addon/edit/continuelist.js @@ -66,7 +66,7 @@ var newNumber = (parseInt(startItem[3], 10) + lookAhead - skipCount); var nextNumber = (parseInt(nextItem[3], 10)), itemNumber = nextNumber; - if (startIndent === nextIndent) { + if (startIndent === nextIndent && !isNaN(nextNumber)) { if (newNumber === nextNumber) itemNumber = nextNumber + 1; if (newNumber > nextNumber) itemNumber = newNumber + 1; cm.replaceRange( diff --git a/media/editors/codemirror/addon/edit/continuelist.min.js b/media/editors/codemirror/addon/edit/continuelist.min.js index da14112694522..e7e653a79e6f8 100644 --- a/media/editors/codemirror/addon/edit/continuelist.min.js +++ b/media/editors/codemirror/addon/edit/continuelist.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b){var d=b.line,e=0,f=0,g=c.exec(a.getLine(d)),h=g[1];do{e+=1;var i=d+e,j=a.getLine(i),k=c.exec(j);if(k){var l=k[1],m=parseInt(g[3],10)+e-f,n=parseInt(k[3],10),o=n;if(h===l)m===n&&(o=n+1),m>n&&(o=m+1),a.replaceRange(j.replace(c,l+o+k[4]+k[5]),{line:i,ch:0},{line:i,ch:j.length});else{if(h.length>l.length)return;if(h.length[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,d=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,e=/[*+-]\s/;a.commands.newlineAndIndentContinueMarkdownList=function(f){if(f.getOption("disableInput"))return a.Pass;for(var g=f.listSelections(),h=[],i=0;i\s*$/.test(n)||f.replaceRange("",{line:j.line,ch:0},{line:j.line,ch:j.ch+1}),h[i]="\n";else{var q=o[1],r=o[5],s=!(e.test(o[2])||o[2].indexOf(">")>=0),t=s?parseInt(o[3],10)+1+o[4]:o[2].replace("x"," ");h[i]="\n"+q+t+r,s&&b(f,j)}}f.replaceSelections(h)}})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b){var d=b.line,e=0,f=0,g=c.exec(a.getLine(d)),h=g[1];do{e+=1;var i=d+e,j=a.getLine(i),k=c.exec(j);if(k){var l=k[1],m=parseInt(g[3],10)+e-f,n=parseInt(k[3],10),o=n;if(h!==l||isNaN(n)){if(h.length>l.length)return;if(h.lengthn&&(o=m+1),a.replaceRange(j.replace(c,l+o+k[4]+k[5]),{line:i,ch:0},{line:i,ch:j.length})}}while(k)}var c=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,d=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,e=/[*+-]\s/;a.commands.newlineAndIndentContinueMarkdownList=function(f){if(f.getOption("disableInput"))return a.Pass;for(var g=f.listSelections(),h=[],i=0;i\s*$/.test(n)||f.replaceRange("",{line:j.line,ch:0},{line:j.line,ch:j.ch+1}),h[i]="\n";else{var q=o[1],r=o[5],s=!(e.test(o[2])||o[2].indexOf(">")>=0),t=s?parseInt(o[3],10)+1+o[4]:o[2].replace("x"," ");h[i]="\n"+q+t+r,s&&b(f,j)}}f.replaceSelections(h)}})); \ No newline at end of file diff --git a/media/editors/codemirror/addon/fold/xml-fold.js b/media/editors/codemirror/addon/fold/xml-fold.js index 3acf952d9d2fa..867ecb5cb3724 100644 --- a/media/editors/codemirror/addon/fold/xml-fold.js +++ b/media/editors/codemirror/addon/fold/xml-fold.js @@ -137,12 +137,14 @@ CodeMirror.registerHelper("fold", "xml", function(cm, start) { var iter = new Iter(cm, start.line, 0); for (;;) { - var openTag = toNextTag(iter), end; - if (!openTag || !(end = toTagEnd(iter)) || iter.line != start.line) return; + var openTag = toNextTag(iter) + if (!openTag || iter.line != start.line) return + var end = toTagEnd(iter) + if (!end) return if (!openTag[1] && end != "selfClose") { var startPos = Pos(iter.line, iter.ch); var endPos = findMatchingClose(iter, openTag[2]); - return endPos && {from: startPos, to: endPos.from}; + return endPos && cmp(endPos.from, startPos) > 0 ? {from: startPos, to: endPos.from} : null } } }); diff --git a/media/editors/codemirror/addon/fold/xml-fold.min.js b/media/editors/codemirror/addon/fold/xml-fold.min.js index c7036f3215084..c74f165958076 100644 --- a/media/editors/codemirror/addon/fold/xml-fold.min.js +++ b/media/editors/codemirror/addon/fold/xml-fold.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b){return a.line-b.line||a.ch-b.ch}function c(a,b,c,d){this.line=b,this.ch=c,this.cm=a,this.text=a.getLine(b),this.min=d?Math.max(d.from,a.firstLine()):a.firstLine(),this.max=d?Math.min(d.to-1,a.lastLine()):a.lastLine()}function d(a,b){var c=a.cm.getTokenTypeAt(m(a.line,b));return c&&/\btag\b/.test(c)}function e(a){if(!(a.line>=a.max))return a.ch=0,a.text=a.cm.getLine(++a.line),!0}function f(a){if(!(a.line<=a.min))return a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0}function g(a){for(;;){var b=a.text.indexOf(">",a.ch);if(b==-1){if(e(a))continue;return}{if(d(a,b+1)){var c=a.text.lastIndexOf("/",b),f=c>-1&&!/\S/.test(a.text.slice(c+1,b));return a.ch=b+1,f?"selfClose":"regular"}a.ch=b+1}}}function h(a){for(;;){var b=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(b==-1){if(f(a))continue;return}if(d(a,b+1)){p.lastIndex=b,a.ch=b;var c=p.exec(a.text);if(c&&c.index==b)return c}else a.ch=b}}function i(a){for(;;){p.lastIndex=a.ch;var b=p.exec(a.text);if(!b){if(e(a))continue;return}{if(d(a,b.index+1))return a.ch=b.index+b[0].length,b;a.ch=b.index+1}}}function j(a){for(;;){var b=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(b==-1){if(f(a))continue;return}{if(d(a,b+1)){var c=a.text.lastIndexOf("/",b),e=c>-1&&!/\S/.test(a.text.slice(c+1,b));return a.ch=b+1,e?"selfClose":"regular"}a.ch=b}}}function k(a,b){for(var c=[];;){var d,e=i(a),f=a.line,h=a.ch-(e?e[0].length:0);if(!e||!(d=g(a)))return;if("selfClose"!=d)if(e[1]){for(var j=c.length-1;j>=0;--j)if(c[j]==e[2]){c.length=j;break}if(j<0&&(!b||b==e[2]))return{tag:e[2],from:m(f,h),to:m(a.line,a.ch)}}else c.push(e[2])}}function l(a,b){for(var c=[];;){var d=j(a);if(!d)return;if("selfClose"!=d){var e=a.line,f=a.ch,g=h(a);if(!g)return;if(g[1])c.push(g[2]);else{for(var i=c.length-1;i>=0;--i)if(c[i]==g[2]){c.length=i;break}if(i<0&&(!b||b==g[2]))return{tag:g[2],from:m(a.line,a.ch),to:m(e,f)}}}else h(a)}}var m=a.Pos,n="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",o=n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",p=new RegExp("<(/?)(["+n+"]["+o+"]*)","g");a.registerHelper("fold","xml",(function(a,b){for(var d=new c(a,b.line,0);;){var e,f=i(d);if(!f||!(e=g(d))||d.line!=b.line)return;if(!f[1]&&"selfClose"!=e){var h=m(d.line,d.ch),j=k(d,f[2]);return j&&{from:h,to:j.from}}}})),a.findMatchingTag=function(a,d,e){var f=new c(a,d.line,d.ch,e);if(f.text.indexOf(">")!=-1||f.text.indexOf("<")!=-1){var i=g(f),j=i&&m(f.line,f.ch),n=i&&h(f);if(i&&n&&!(b(f,d)>0)){var o={from:m(f.line,f.ch),to:j,tag:n[2]};return"selfClose"==i?{open:o,close:null,at:"open"}:n[1]?{open:l(f,n[2]),close:o,at:"close"}:(f=new c(a,j.line,j.ch,e),{open:o,close:k(f,n[2]),at:"open"})}}},a.findEnclosingTag=function(a,b,d,e){for(var f=new c(a,b.line,b.ch,d);;){var g=l(f,e);if(!g)break;var h=new c(a,b.line,b.ch,d),i=k(h,g.tag);if(i)return{open:g,close:i}}},a.scanForClosingTag=function(a,b,d,e){var f=new c(a,b.line,b.ch,e?{from:0,to:e}:null);return k(f,d)}})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b){return a.line-b.line||a.ch-b.ch}function c(a,b,c,d){this.line=b,this.ch=c,this.cm=a,this.text=a.getLine(b),this.min=d?Math.max(d.from,a.firstLine()):a.firstLine(),this.max=d?Math.min(d.to-1,a.lastLine()):a.lastLine()}function d(a,b){var c=a.cm.getTokenTypeAt(m(a.line,b));return c&&/\btag\b/.test(c)}function e(a){if(!(a.line>=a.max))return a.ch=0,a.text=a.cm.getLine(++a.line),!0}function f(a){if(!(a.line<=a.min))return a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0}function g(a){for(;;){var b=a.text.indexOf(">",a.ch);if(b==-1){if(e(a))continue;return}{if(d(a,b+1)){var c=a.text.lastIndexOf("/",b),f=c>-1&&!/\S/.test(a.text.slice(c+1,b));return a.ch=b+1,f?"selfClose":"regular"}a.ch=b+1}}}function h(a){for(;;){var b=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(b==-1){if(f(a))continue;return}if(d(a,b+1)){p.lastIndex=b,a.ch=b;var c=p.exec(a.text);if(c&&c.index==b)return c}else a.ch=b}}function i(a){for(;;){p.lastIndex=a.ch;var b=p.exec(a.text);if(!b){if(e(a))continue;return}{if(d(a,b.index+1))return a.ch=b.index+b[0].length,b;a.ch=b.index+1}}}function j(a){for(;;){var b=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(b==-1){if(f(a))continue;return}{if(d(a,b+1)){var c=a.text.lastIndexOf("/",b),e=c>-1&&!/\S/.test(a.text.slice(c+1,b));return a.ch=b+1,e?"selfClose":"regular"}a.ch=b}}}function k(a,b){for(var c=[];;){var d,e=i(a),f=a.line,h=a.ch-(e?e[0].length:0);if(!e||!(d=g(a)))return;if("selfClose"!=d)if(e[1]){for(var j=c.length-1;j>=0;--j)if(c[j]==e[2]){c.length=j;break}if(j<0&&(!b||b==e[2]))return{tag:e[2],from:m(f,h),to:m(a.line,a.ch)}}else c.push(e[2])}}function l(a,b){for(var c=[];;){var d=j(a);if(!d)return;if("selfClose"!=d){var e=a.line,f=a.ch,g=h(a);if(!g)return;if(g[1])c.push(g[2]);else{for(var i=c.length-1;i>=0;--i)if(c[i]==g[2]){c.length=i;break}if(i<0&&(!b||b==g[2]))return{tag:g[2],from:m(a.line,a.ch),to:m(e,f)}}}else h(a)}}var m=a.Pos,n="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",o=n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",p=new RegExp("<(/?)(["+n+"]["+o+"]*)","g");a.registerHelper("fold","xml",(function(a,d){for(var e=new c(a,d.line,0);;){var f=i(e);if(!f||e.line!=d.line)return;var h=g(e);if(!h)return;if(!f[1]&&"selfClose"!=h){var j=m(e.line,e.ch),l=k(e,f[2]);return l&&b(l.from,j)>0?{from:j,to:l.from}:null}}})),a.findMatchingTag=function(a,d,e){var f=new c(a,d.line,d.ch,e);if(f.text.indexOf(">")!=-1||f.text.indexOf("<")!=-1){var i=g(f),j=i&&m(f.line,f.ch),n=i&&h(f);if(i&&n&&!(b(f,d)>0)){var o={from:m(f.line,f.ch),to:j,tag:n[2]};return"selfClose"==i?{open:o,close:null,at:"open"}:n[1]?{open:l(f,n[2]),close:o,at:"close"}:(f=new c(a,j.line,j.ch,e),{open:o,close:k(f,n[2]),at:"open"})}}},a.findEnclosingTag=function(a,b,d,e){for(var f=new c(a,b.line,b.ch,d);;){var g=l(f,e);if(!g)break;var h=new c(a,b.line,b.ch,d),i=k(h,g.tag);if(i)return{open:g,close:i}}},a.scanForClosingTag=function(a,b,d,e){var f=new c(a,b.line,b.ch,e?{from:0,to:e}:null);return k(f,d)}})); \ No newline at end of file diff --git a/media/editors/codemirror/addon/hint/javascript-hint.js b/media/editors/codemirror/addon/hint/javascript-hint.js index 9c39b168e966f..f6ab2a2e89751 100644 --- a/media/editors/codemirror/addon/hint/javascript-hint.js +++ b/media/editors/codemirror/addon/hint/javascript-hint.js @@ -32,7 +32,9 @@ // Find the token at the cursor var cur = editor.getCursor(), token = getToken(editor, cur); if (/\b(?:string|comment)\b/.test(token.type)) return; - token.state = CodeMirror.innerMode(editor.getMode(), token.state).state; + var innerMode = CodeMirror.innerMode(editor.getMode(), token.state); + if (innerMode.mode.helperType === "json") return; + token.state = innerMode.state; // If it's not a 'word-style' token, ignore the token. if (!/^[\w$_]*$/.test(token.string)) { diff --git a/media/editors/codemirror/addon/hint/javascript-hint.min.js b/media/editors/codemirror/addon/hint/javascript-hint.min.js index da75e21620ed0..fa853411f2ee0 100644 --- a/media/editors/codemirror/addon/hint/javascript-hint.min.js +++ b/media/editors/codemirror/addon/hint/javascript-hint.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){function b(a,b){for(var c=0,d=a.length;cf.ch&&(g.end=f.ch,g.string=g.string.slice(0,f.ch-g.start)):g={start:f.ch,end:f.ch,string:"",state:g.state,type:"."==g.string?"property":null};for(var h=g;"property"==h.type;){if(h=d(b,j(f.line,h.start)),"."!=h.string)return;if(h=d(b,j(f.line,h.start)),!k)var k=[];k.push(h)}return{list:i(g,k,c,e),from:j(f.line,g.start),to:j(f.line,g.end)}}}function e(a,b){return d(a,n,(function(a,b){return a.getTokenAt(b)}),b)}function f(a,b){var c=a.getTokenAt(b);return b.ch==c.start+1&&"."==c.string.charAt(0)?(c.end=c.start,c.string=".",c.type="property"):/^\.[\w$_]*$/.test(c.string)&&(c.type="property",c.start++,c.string=c.string.replace(/\./,"")),c}function g(a,b){return d(a,o,f,b)}function h(a,b){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var c=a;c;c=Object.getPrototypeOf(c))Object.getOwnPropertyNames(c).forEach(b);else for(var d in a)b(d)}function i(a,d,e,f){function g(a){0!=a.lastIndexOf(n,0)||c(j,a)||j.push(a)}function i(a){"string"==typeof a?b(k,g):a instanceof Array?b(l,g):a instanceof Function&&b(m,g),h(a,g)}var j=[],n=a.string,o=f&&f.globalScope||window;if(d&&d.length){var p,q=d.pop();for(q.type&&0===q.type.indexOf("variable")?(f&&f.additionalContext&&(p=f.additionalContext[q.string]),f&&f.useGlobalScope===!1||(p=p||o[q.string])):"string"==q.type?p="":"atom"==q.type?p=1:"function"==q.type&&(null==o.jQuery||"$"!=q.string&&"jQuery"!=q.string||"function"!=typeof o.jQuery?null!=o._&&"_"==q.string&&"function"==typeof o._&&(p=o._()):p=o.jQuery());null!=p&&d.length;)p=p[d.pop().string];null!=p&&i(p)}else{for(var r=a.state.localVars;r;r=r.next)g(r.name);for(var r=a.state.globalVars;r;r=r.next)g(r.name);f&&f.useGlobalScope===!1||i(o),b(e,g)}return j}var j=a.Pos;a.registerHelper("hint","javascript",e),a.registerHelper("hint","coffeescript",g);var k="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),l="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),m="prototype apply call bind".split(" "),n="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(" "),o="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(" ")})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){function b(a,b){for(var c=0,d=a.length;cf.ch&&(g.end=f.ch,g.string=g.string.slice(0,f.ch-g.start)):g={start:f.ch,end:f.ch,string:"",state:g.state,type:"."==g.string?"property":null};for(var k=g;"property"==k.type;){if(k=d(b,j(f.line,k.start)),"."!=k.string)return;if(k=d(b,j(f.line,k.start)),!l)var l=[];l.push(k)}return{list:i(g,l,c,e),from:j(f.line,g.start),to:j(f.line,g.end)}}}}function e(a,b){return d(a,n,(function(a,b){return a.getTokenAt(b)}),b)}function f(a,b){var c=a.getTokenAt(b);return b.ch==c.start+1&&"."==c.string.charAt(0)?(c.end=c.start,c.string=".",c.type="property"):/^\.[\w$_]*$/.test(c.string)&&(c.type="property",c.start++,c.string=c.string.replace(/\./,"")),c}function g(a,b){return d(a,o,f,b)}function h(a,b){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var c=a;c;c=Object.getPrototypeOf(c))Object.getOwnPropertyNames(c).forEach(b);else for(var d in a)b(d)}function i(a,d,e,f){function g(a){0!=a.lastIndexOf(n,0)||c(j,a)||j.push(a)}function i(a){"string"==typeof a?b(k,g):a instanceof Array?b(l,g):a instanceof Function&&b(m,g),h(a,g)}var j=[],n=a.string,o=f&&f.globalScope||window;if(d&&d.length){var p,q=d.pop();for(q.type&&0===q.type.indexOf("variable")?(f&&f.additionalContext&&(p=f.additionalContext[q.string]),f&&f.useGlobalScope===!1||(p=p||o[q.string])):"string"==q.type?p="":"atom"==q.type?p=1:"function"==q.type&&(null==o.jQuery||"$"!=q.string&&"jQuery"!=q.string||"function"!=typeof o.jQuery?null!=o._&&"_"==q.string&&"function"==typeof o._&&(p=o._()):p=o.jQuery());null!=p&&d.length;)p=p[d.pop().string];null!=p&&i(p)}else{for(var r=a.state.localVars;r;r=r.next)g(r.name);for(var r=a.state.globalVars;r;r=r.next)g(r.name);f&&f.useGlobalScope===!1||i(o),b(e,g)}return j}var j=a.Pos;a.registerHelper("hint","javascript",e),a.registerHelper("hint","coffeescript",g);var k="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),l="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),m="prototype apply call bind".split(" "),n="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(" "),o="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(" ")})); \ No newline at end of file diff --git a/media/editors/codemirror/addon/hint/show-hint.js b/media/editors/codemirror/addon/hint/show-hint.js index 62c683cb8cc64..81a63fc9921e8 100644 --- a/media/editors/codemirror/addon/hint/show-hint.js +++ b/media/editors/codemirror/addon/hint/show-hint.js @@ -397,12 +397,13 @@ }); CodeMirror.registerHelper("hint", "fromList", function(cm, options) { - var cur = cm.getCursor(), token = cm.getTokenAt(cur); - var to = CodeMirror.Pos(cur.line, token.end); - if (token.string && /\w/.test(token.string[token.string.length - 1])) { - var term = token.string, from = CodeMirror.Pos(cur.line, token.start); + var cur = cm.getCursor(), token = cm.getTokenAt(cur) + var term, from = CodeMirror.Pos(cur.line, token.start), to = cur + if (token.start < cur.ch && /\w/.test(token.string.charAt(cur.ch - token.start - 1))) { + term = token.string.substr(0, cur.ch - token.start) } else { - var term = "", from = to; + term = "" + from = cur } var found = []; for (var i = 0; i < options.words.length; i++) { diff --git a/media/editors/codemirror/addon/hint/show-hint.min.js b/media/editors/codemirror/addon/hint/show-hint.min.js index d3f5fe746ba8a..1fc4c65859357 100644 --- a/media/editors/codemirror/addon/hint/show-hint.min.js +++ b/media/editors/codemirror/addon/hint/show-hint.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b){this.cm=a,this.options=b,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var c=this;a.on("cursorActivity",this.activityFunc=function(){c.cursorActivity()})}function c(a,b,c){var d=a.options.hintOptions,e={};for(var f in o)e[f]=o[f];if(d)for(var f in d)void 0!==d[f]&&(e[f]=d[f]);if(c)for(var f in c)void 0!==c[f]&&(e[f]=c[f]);return e.hint.resolve&&(e.hint=e.hint.resolve(a,b)),e}function d(a){return"string"==typeof a?a:a.text}function e(a,b){function c(a,c){var e;e="string"!=typeof c?function(a){return c(a,b)}:d.hasOwnProperty(c)?d[c]:c,f[a]=e}var d={Up:function(){b.moveFocus(-1)},Down:function(){b.moveFocus(1)},PageUp:function(){b.moveFocus(-b.menuSize()+1,!0)},PageDown:function(){b.moveFocus(b.menuSize()-1,!0)},Home:function(){b.setFocus(0)},End:function(){b.setFocus(b.length-1)},Enter:b.pick,Tab:b.pick,Esc:b.close},e=a.options.customKeys,f=e?{}:d;if(e)for(var g in e)e.hasOwnProperty(g)&&c(g,e[g]);var h=a.options.extraKeys;if(h)for(var g in h)h.hasOwnProperty(g)&&c(g,h[g]);return f}function f(a,b){for(;b&&b!=a;){if("LI"===b.nodeName.toUpperCase()&&b.parentNode==a)return b;b=b.parentNode}}function g(b,c){this.completion=b,this.data=c,this.picked=!1;var g=this,h=b.cm,i=this.hints=document.createElement("ul");i.className="CodeMirror-hints",this.selectedHint=c.selectedHint||0;for(var j=c.list,m=0;mi.clientHeight+1,z=h.getScrollInfo();if(x>0){var A=w.bottom-w.top,B=q.top-(q.bottom-w.top);if(B-A>0)i.style.top=(s=q.top-A)+"px",t=!1;else if(A>v){i.style.height=v-5+"px",i.style.top=(s=q.bottom-w.top)+"px";var C=h.getCursor();c.from.ch!=C.ch&&(q=h.cursorCoords(C),i.style.left=(r=q.left)+"px",w=i.getBoundingClientRect())}}var D=w.right-u;if(D>0&&(w.right-w.left>u&&(i.style.width=u-5+"px",D-=w.right-w.left-u),i.style.left=(r=q.left-D)+"px"),y)for(var E=i.firstChild;E;E=E.nextSibling)E.style.paddingRight=h.display.nativeBarWidth+"px";if(h.addKeyMap(this.keyMap=e(b,{moveFocus:function(a,b){g.changeActive(g.selectedHint+a,b)},setFocus:function(a){g.changeActive(a)},menuSize:function(){return g.screenAmount()},length:j.length,close:function(){b.close()},pick:function(){g.pick()},data:c})),b.options.closeOnUnfocus){var F;h.on("blur",this.onBlur=function(){F=setTimeout((function(){b.close()}),100)}),h.on("focus",this.onFocus=function(){clearTimeout(F)})}return h.on("scroll",this.onScroll=function(){var a=h.getScrollInfo(),c=h.getWrapperElement().getBoundingClientRect(),d=s+z.top-a.top,e=d-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return t||(e+=i.offsetHeight),e<=c.top||e>=c.bottom?b.close():(i.style.top=d+"px",void(i.style.left=r+z.left-a.left+"px"))}),a.on(i,"dblclick",(function(a){var b=f(i,a.target||a.srcElement);b&&null!=b.hintId&&(g.changeActive(b.hintId),g.pick())})),a.on(i,"click",(function(a){var c=f(i,a.target||a.srcElement);c&&null!=c.hintId&&(g.changeActive(c.hintId),b.options.completeOnSingleClick&&g.pick())})),a.on(i,"mousedown",(function(){setTimeout((function(){h.focus()}),20)})),a.signal(c,"select",j[this.selectedHint],i.childNodes[this.selectedHint]),!0}function h(a,b){if(!a.somethingSelected())return b;for(var c=[],d=0;d0?b(a):d(e+1)}))}var f=h(a,e);d(0)};return f.async=!0,f.supportsSelection=!0,f}return(d=b.getHelper(b.getCursor(),"hintWords"))?function(b){return a.hint.fromList(b,{words:d})}:a.hint.anyword?function(b,c){return a.hint.anyword(b,c)}:function(){}}var k="CodeMirror-hint",l="CodeMirror-hint-active";a.showHint=function(a,b,c){if(!b)return a.showHint(c);c&&c.async&&(b.async=!0);var d={hint:b};if(c)for(var e in c)d[e]=c[e];return a.showHint(d)},a.defineExtension("showHint",(function(d){d=c(this,this.getCursor("start"),d);var e=this.listSelections();if(!(e.length>1)){if(this.somethingSelected()){if(!d.hint.supportsSelection)return;for(var f=0;f=this.data.list.length?b=c?this.data.list.length-1:0:b<0&&(b=c?0:this.data.list.length-1),this.selectedHint!=b){var d=this.hints.childNodes[this.selectedHint];d.className=d.className.replace(" "+l,""),d=this.hints.childNodes[this.selectedHint=b],d.className+=" "+l,d.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=d.offsetTop+d.offsetHeight-this.hints.clientHeight+3),a.signal(this.data,"select",this.data.list[this.selectedHint],d)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},a.registerHelper("hint","auto",{resolve:j}),a.registerHelper("hint","fromList",(function(b,c){var d=b.getCursor(),e=b.getTokenAt(d),f=a.Pos(d.line,e.end);if(e.string&&/\w/.test(e.string[e.string.length-1]))var g=e.string,h=a.Pos(d.line,e.start);else var g="",h=f;for(var i=[],j=0;j,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};a.defineOption("hintOptions",null)})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b){this.cm=a,this.options=b,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var c=this;a.on("cursorActivity",this.activityFunc=function(){c.cursorActivity()})}function c(a,b,c){var d=a.options.hintOptions,e={};for(var f in o)e[f]=o[f];if(d)for(var f in d)void 0!==d[f]&&(e[f]=d[f]);if(c)for(var f in c)void 0!==c[f]&&(e[f]=c[f]);return e.hint.resolve&&(e.hint=e.hint.resolve(a,b)),e}function d(a){return"string"==typeof a?a:a.text}function e(a,b){function c(a,c){var e;e="string"!=typeof c?function(a){return c(a,b)}:d.hasOwnProperty(c)?d[c]:c,f[a]=e}var d={Up:function(){b.moveFocus(-1)},Down:function(){b.moveFocus(1)},PageUp:function(){b.moveFocus(-b.menuSize()+1,!0)},PageDown:function(){b.moveFocus(b.menuSize()-1,!0)},Home:function(){b.setFocus(0)},End:function(){b.setFocus(b.length-1)},Enter:b.pick,Tab:b.pick,Esc:b.close},e=a.options.customKeys,f=e?{}:d;if(e)for(var g in e)e.hasOwnProperty(g)&&c(g,e[g]);var h=a.options.extraKeys;if(h)for(var g in h)h.hasOwnProperty(g)&&c(g,h[g]);return f}function f(a,b){for(;b&&b!=a;){if("LI"===b.nodeName.toUpperCase()&&b.parentNode==a)return b;b=b.parentNode}}function g(b,c){this.completion=b,this.data=c,this.picked=!1;var g=this,h=b.cm,i=this.hints=document.createElement("ul");i.className="CodeMirror-hints",this.selectedHint=c.selectedHint||0;for(var j=c.list,m=0;mi.clientHeight+1,z=h.getScrollInfo();if(x>0){var A=w.bottom-w.top,B=q.top-(q.bottom-w.top);if(B-A>0)i.style.top=(s=q.top-A)+"px",t=!1;else if(A>v){i.style.height=v-5+"px",i.style.top=(s=q.bottom-w.top)+"px";var C=h.getCursor();c.from.ch!=C.ch&&(q=h.cursorCoords(C),i.style.left=(r=q.left)+"px",w=i.getBoundingClientRect())}}var D=w.right-u;if(D>0&&(w.right-w.left>u&&(i.style.width=u-5+"px",D-=w.right-w.left-u),i.style.left=(r=q.left-D)+"px"),y)for(var E=i.firstChild;E;E=E.nextSibling)E.style.paddingRight=h.display.nativeBarWidth+"px";if(h.addKeyMap(this.keyMap=e(b,{moveFocus:function(a,b){g.changeActive(g.selectedHint+a,b)},setFocus:function(a){g.changeActive(a)},menuSize:function(){return g.screenAmount()},length:j.length,close:function(){b.close()},pick:function(){g.pick()},data:c})),b.options.closeOnUnfocus){var F;h.on("blur",this.onBlur=function(){F=setTimeout((function(){b.close()}),100)}),h.on("focus",this.onFocus=function(){clearTimeout(F)})}return h.on("scroll",this.onScroll=function(){var a=h.getScrollInfo(),c=h.getWrapperElement().getBoundingClientRect(),d=s+z.top-a.top,e=d-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return t||(e+=i.offsetHeight),e<=c.top||e>=c.bottom?b.close():(i.style.top=d+"px",void(i.style.left=r+z.left-a.left+"px"))}),a.on(i,"dblclick",(function(a){var b=f(i,a.target||a.srcElement);b&&null!=b.hintId&&(g.changeActive(b.hintId),g.pick())})),a.on(i,"click",(function(a){var c=f(i,a.target||a.srcElement);c&&null!=c.hintId&&(g.changeActive(c.hintId),b.options.completeOnSingleClick&&g.pick())})),a.on(i,"mousedown",(function(){setTimeout((function(){h.focus()}),20)})),a.signal(c,"select",j[this.selectedHint],i.childNodes[this.selectedHint]),!0}function h(a,b){if(!a.somethingSelected())return b;for(var c=[],d=0;d0?b(a):d(e+1)}))}var f=h(a,e);d(0)};return f.async=!0,f.supportsSelection=!0,f}return(d=b.getHelper(b.getCursor(),"hintWords"))?function(b){return a.hint.fromList(b,{words:d})}:a.hint.anyword?function(b,c){return a.hint.anyword(b,c)}:function(){}}var k="CodeMirror-hint",l="CodeMirror-hint-active";a.showHint=function(a,b,c){if(!b)return a.showHint(c);c&&c.async&&(b.async=!0);var d={hint:b};if(c)for(var e in c)d[e]=c[e];return a.showHint(d)},a.defineExtension("showHint",(function(d){d=c(this,this.getCursor("start"),d);var e=this.listSelections();if(!(e.length>1)){if(this.somethingSelected()){if(!d.hint.supportsSelection)return;for(var f=0;f=this.data.list.length?b=c?this.data.list.length-1:0:b<0&&(b=c?0:this.data.list.length-1),this.selectedHint!=b){var d=this.hints.childNodes[this.selectedHint];d.className=d.className.replace(" "+l,""),d=this.hints.childNodes[this.selectedHint=b],d.className+=" "+l,d.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=d.offsetTop+d.offsetHeight-this.hints.clientHeight+3),a.signal(this.data,"select",this.data.list[this.selectedHint],d)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},a.registerHelper("hint","auto",{resolve:j}),a.registerHelper("hint","fromList",(function(b,c){var d,e=b.getCursor(),f=b.getTokenAt(e),g=a.Pos(e.line,f.start),h=e;f.start,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};a.defineOption("hintOptions",null)})); \ No newline at end of file diff --git a/media/editors/codemirror/addon/hint/sql-hint.js b/media/editors/codemirror/addon/hint/sql-hint.js index 5d20eea625420..62b69c948f7e2 100644 --- a/media/editors/codemirror/addon/hint/sql-hint.js +++ b/media/editors/codemirror/addon/hint/sql-hint.js @@ -275,10 +275,23 @@ if (search.charAt(0) == "." || search.charAt(0) == identifierQuote) { start = nameCompletion(cur, token, result, editor); } else { - addMatches(result, search, defaultTable, function(w) {return w;}); - addMatches(result, search, tables, function(w) {return w;}); + addMatches(result, search, defaultTable, function(w) {return {text:w, className: "CodeMirror-hint-table CodeMirror-hint-default-table"};}); + addMatches( + result, + search, + tables, + function(w) { + if (typeof w === 'object') { + w.className = "CodeMirror-hint-table"; + } else { + w = {text: w, className: "CodeMirror-hint-table"}; + } + + return w; + } + ); if (!disableKeywords) - addMatches(result, search, keywords, function(w) {return w.toUpperCase();}); + addMatches(result, search, keywords, function(w) {return {text: w.toUpperCase(), className: "CodeMirror-hint-keyword"};}); } return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)}; diff --git a/media/editors/codemirror/addon/hint/sql-hint.min.js b/media/editors/codemirror/addon/hint/sql-hint.min.js index 7f1c90ff30829..4403319422be9 100644 --- a/media/editors/codemirror/addon/hint/sql-hint.min.js +++ b/media/editors/codemirror/addon/hint/sql-hint.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../mode/sql/sql")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/sql/sql"],a):a(CodeMirror)})((function(a){"use strict";function b(a){return"[object Array]"==Object.prototype.toString.call(a)}function c(b){var c=b.doc.modeOption;return"sql"===c&&(c="text/x-sql"),a.resolveMode(c).keywords}function d(b){var c=b.doc.modeOption;return"sql"===c&&(c="text/x-sql"),a.resolveMode(c).identifierQuote||"`"}function e(a){return"string"==typeof a?a:a.text}function f(a,c){return b(c)&&(c={columns:c}),c.text||(c.text=a),c}function g(a){var c={};if(b(a))for(var d=a.length-1;d>=0;d--){var g=a[d];c[e(g).toUpperCase()]=f(e(g),g)}else if(a)for(var h in a)c[h.toUpperCase()]=f(h,a[h]);return c}function h(a){return q[a.toUpperCase()]}function i(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function j(a,b){var c=a.length,d=e(b).substr(0,c);return a.toUpperCase()===d.toUpperCase()}function k(a,c,d,e){if(b(d))for(var f=0;f0)&&w(m,i[n])<=0){j={start:l,end:i[n]};break}l=i[n]}if(j.start)for(var p=c.getRange(j.start,j.end,!1),n=0;nm.ch&&(u.end=m.ch,u.string=u.string.slice(0,m.ch-u.start)),u.string.match(/^[.`"\w@]\w*$/)?(l=u.string,i=u.start,j=u.end):(i=j=m.ch,l=""),"."==l.charAt(0)||l.charAt(0)==t?i=n(m,u,o,a):(k(o,l,r,(function(a){return a})),k(o,l,q,(function(a){return a})),f||k(o,l,s,(function(a){return a.toUpperCase()}))),{list:o,from:v(m.line,i),to:v(m.line,j)}}))})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../mode/sql/sql")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/sql/sql"],a):a(CodeMirror)})((function(a){"use strict";function b(a){return"[object Array]"==Object.prototype.toString.call(a)}function c(b){var c=b.doc.modeOption;return"sql"===c&&(c="text/x-sql"),a.resolveMode(c).keywords}function d(b){var c=b.doc.modeOption;return"sql"===c&&(c="text/x-sql"),a.resolveMode(c).identifierQuote||"`"}function e(a){return"string"==typeof a?a:a.text}function f(a,c){return b(c)&&(c={columns:c}),c.text||(c.text=a),c}function g(a){var c={};if(b(a))for(var d=a.length-1;d>=0;d--){var g=a[d];c[e(g).toUpperCase()]=f(e(g),g)}else if(a)for(var h in a)c[h.toUpperCase()]=f(h,a[h]);return c}function h(a){return q[a.toUpperCase()]}function i(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function j(a,b){var c=a.length,d=e(b).substr(0,c);return a.toUpperCase()===d.toUpperCase()}function k(a,c,d,e){if(b(d))for(var f=0;f0)&&w(m,i[n])<=0){j={start:l,end:i[n]};break}l=i[n]}if(j.start)for(var p=c.getRange(j.start,j.end,!1),n=0;nm.ch&&(u.end=m.ch,u.string=u.string.slice(0,m.ch-u.start)),u.string.match(/^[.`"\w@]\w*$/)?(l=u.string,i=u.start,j=u.end):(i=j=m.ch,l=""),"."==l.charAt(0)||l.charAt(0)==t?i=n(m,u,o,a):(k(o,l,r,(function(a){return{text:a,className:"CodeMirror-hint-table CodeMirror-hint-default-table"}})),k(o,l,q,(function(a){return"object"==typeof a?a.className="CodeMirror-hint-table":a={text:a,className:"CodeMirror-hint-table"},a})),f||k(o,l,s,(function(a){return{text:a.toUpperCase(),className:"CodeMirror-hint-keyword"}}))),{list:o,from:v(m.line,i),to:v(m.line,j)}}))})); \ No newline at end of file diff --git a/media/editors/codemirror/addon/merge/merge.css b/media/editors/codemirror/addon/merge/merge.css index bda3d9f8061a8..dadd7f59c788f 100644 --- a/media/editors/codemirror/addon/merge/merge.css +++ b/media/editors/codemirror/addon/merge/merge.css @@ -48,6 +48,12 @@ color: #555; line-height: 1; } +.CodeMirror-merge-scrolllock:after { + content: "\21db\00a0\00a0\21da"; +} +.CodeMirror-merge-scrolllock.CodeMirror-merge-scrolllock-enabled:after { + content: "\21db\21da"; +} .CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right { position: absolute; diff --git a/media/editors/codemirror/addon/merge/merge.js b/media/editors/codemirror/addon/merge/merge.js index dc2e77c60edab..5b87b5e62a7e9 100644 --- a/media/editors/codemirror/addon/merge/merge.js +++ b/media/editors/codemirror/addon/merge/merge.js @@ -211,7 +211,7 @@ function setScrollLock(dv, val, action) { dv.lockScroll = val; if (val && action != false) syncScroll(dv, DIFF_INSERT) && makeConnections(dv); - dv.lockButton.innerHTML = val ? "\u21db\u21da" : "\u21db  \u21da"; + (val ? CodeMirror.addClass : CodeMirror.rmClass)(dv.lockButton, "CodeMirror-merge-scrolllock-enabled"); } // Updating the marks for editor content @@ -664,6 +664,7 @@ function getChunks(diff) { var chunks = []; + if (!diff.length) return chunks; var startEdit = 0, startOrig = 0; var edit = Pos(0, 0), orig = Pos(0, 0); for (var i = 0; i < diff.length; ++i) { diff --git a/media/editors/codemirror/addon/merge/merge.min.css b/media/editors/codemirror/addon/merge/merge.min.css index 2145a21ed922a..24a20a1da1c52 100644 --- a/media/editors/codemirror/addon/merge/merge.min.css +++ b/media/editors/codemirror/addon/merge/merge.min.css @@ -1 +1 @@ -.CodeMirror-merge{position:relative;border:1px solid #ddd;white-space:pre}.CodeMirror-merge,.CodeMirror-merge .CodeMirror{height:350px}.CodeMirror-merge-2pane .CodeMirror-merge-pane{width:47%}.CodeMirror-merge-2pane .CodeMirror-merge-gap{width:6%}.CodeMirror-merge-3pane .CodeMirror-merge-pane{width:31%}.CodeMirror-merge-3pane .CodeMirror-merge-gap{width:3.5%}.CodeMirror-merge-pane{display:inline-block;white-space:normal;vertical-align:top}.CodeMirror-merge-pane-rightmost{position:absolute;right:0;z-index:1}.CodeMirror-merge-gap{z-index:2;display:inline-block;height:100%;-moz-box-sizing:border-box;box-sizing:border-box;overflow:hidden;border-left:1px solid #ddd;border-right:1px solid #ddd;position:relative;background:#f8f8f8}.CodeMirror-merge-scrolllock-wrap{position:absolute;bottom:0;left:50%}.CodeMirror-merge-scrolllock{position:relative;left:-50%;cursor:pointer;color:#555;line-height:1}.CodeMirror-merge-copy,.CodeMirror-merge-copy-reverse{position:absolute;color:#44c;cursor:pointer}.CodeMirror-merge-copybuttons-left,.CodeMirror-merge-copybuttons-right{position:absolute;left:0;top:0;right:0;bottom:0;line-height:1}.CodeMirror-merge-copy{z-index:3}.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy{left:2px}.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy{right:2px}.CodeMirror-merge-l-inserted,.CodeMirror-merge-r-inserted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);background-position:bottom left;background-repeat:repeat-x}.CodeMirror-merge-l-deleted,.CodeMirror-merge-r-deleted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==);background-position:bottom left;background-repeat:repeat-x}.CodeMirror-merge-r-chunk{background:#ffffe0}.CodeMirror-merge-r-chunk-start{border-top:1px solid #ee8}.CodeMirror-merge-r-chunk-end{border-bottom:1px solid #ee8}.CodeMirror-merge-r-connect{fill:#ffffe0;stroke:#ee8;stroke-width:1px}.CodeMirror-merge-l-chunk{background:#eef}.CodeMirror-merge-l-chunk-start{border-top:1px solid #88e}.CodeMirror-merge-l-chunk-end{border-bottom:1px solid #88e}.CodeMirror-merge-l-connect{fill:#eef;stroke:#88e;stroke-width:1px}.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk{background:#dfd}.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start{border-top:1px solid #4e4}.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end{border-bottom:1px solid #4e4}.CodeMirror-merge-collapsed-widget:before{content:"(...)"}.CodeMirror-merge-collapsed-widget{cursor:pointer;color:#88b;background:#eef;border:1px solid #ddf;font-size:90%;padding:0 3px;border-radius:4px}.CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt{display:none} \ No newline at end of file +.CodeMirror-merge{position:relative;border:1px solid #ddd;white-space:pre}.CodeMirror-merge,.CodeMirror-merge .CodeMirror{height:350px}.CodeMirror-merge-2pane .CodeMirror-merge-pane{width:47%}.CodeMirror-merge-2pane .CodeMirror-merge-gap{width:6%}.CodeMirror-merge-3pane .CodeMirror-merge-pane{width:31%}.CodeMirror-merge-3pane .CodeMirror-merge-gap{width:3.5%}.CodeMirror-merge-pane{display:inline-block;white-space:normal;vertical-align:top}.CodeMirror-merge-pane-rightmost{position:absolute;right:0;z-index:1}.CodeMirror-merge-gap{z-index:2;display:inline-block;height:100%;-moz-box-sizing:border-box;box-sizing:border-box;overflow:hidden;border-left:1px solid #ddd;border-right:1px solid #ddd;position:relative;background:#f8f8f8}.CodeMirror-merge-scrolllock-wrap{position:absolute;bottom:0;left:50%}.CodeMirror-merge-scrolllock{position:relative;left:-50%;cursor:pointer;color:#555;line-height:1}.CodeMirror-merge-copy,.CodeMirror-merge-copy-reverse{position:absolute;color:#44c;cursor:pointer}.CodeMirror-merge-scrolllock:after{content:"\21db\00a0\00a0\21da"}.CodeMirror-merge-scrolllock.CodeMirror-merge-scrolllock-enabled:after{content:"\21db\21da"}.CodeMirror-merge-copybuttons-left,.CodeMirror-merge-copybuttons-right{position:absolute;left:0;top:0;right:0;bottom:0;line-height:1}.CodeMirror-merge-copy{z-index:3}.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy{left:2px}.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy{right:2px}.CodeMirror-merge-l-inserted,.CodeMirror-merge-r-inserted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);background-position:bottom left;background-repeat:repeat-x}.CodeMirror-merge-l-deleted,.CodeMirror-merge-r-deleted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==);background-position:bottom left;background-repeat:repeat-x}.CodeMirror-merge-r-chunk{background:#ffffe0}.CodeMirror-merge-r-chunk-start{border-top:1px solid #ee8}.CodeMirror-merge-r-chunk-end{border-bottom:1px solid #ee8}.CodeMirror-merge-r-connect{fill:#ffffe0;stroke:#ee8;stroke-width:1px}.CodeMirror-merge-l-chunk{background:#eef}.CodeMirror-merge-l-chunk-start{border-top:1px solid #88e}.CodeMirror-merge-l-chunk-end{border-bottom:1px solid #88e}.CodeMirror-merge-l-connect{fill:#eef;stroke:#88e;stroke-width:1px}.CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk{background:#dfd}.CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start{border-top:1px solid #4e4}.CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end{border-bottom:1px solid #4e4}.CodeMirror-merge-collapsed-widget:before{content:"(...)"}.CodeMirror-merge-collapsed-widget{cursor:pointer;color:#88b;background:#eef;border:1px solid #ddf;font-size:90%;padding:0 3px;border-radius:4px}.CodeMirror-merge-collapsed-line .CodeMirror-gutter-elt{display:none} \ No newline at end of file diff --git a/media/editors/codemirror/addon/merge/merge.min.js b/media/editors/codemirror/addon/merge/merge.min.js index 0d1928618b587..471606b03f128 100644 --- a/media/editors/codemirror/addon/merge/merge.min.js +++ b/media/editors/codemirror/addon/merge/merge.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b){this.mv=a,this.type=b,this.classes="left"==b?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}function c(b){b.diffOutOfDate&&(b.diff=z(b.orig.getValue(),b.edit.getValue(),b.mv.options.ignoreWhitespace),b.chunks=A(b.diff),b.diffOutOfDate=!1,a.signal(b.edit,"updateDiff",b.diff))}function d(b){function d(a){W=!0,p=!1,"full"==a&&(b.svg&&J(b.svg),b.copyButtons&&J(b.copyButtons),j(b.edit,m.marked,b.classes),j(b.orig,o.marked,b.classes),m.from=m.to=o.from=o.to=0),c(b),b.showDifferences&&(k(b.edit,b.diff,m,DIFF_INSERT,b.classes),k(b.orig,b.diff,o,DIFF_DELETE,b.classes)),"align"==b.mv.options.connect&&s(b),n(b),null!=b.needsScrollSync&&f(b,b.needsScrollSync),W=!1}function e(a){W||(b.dealigned=!0,g(a))}function g(a){W||p||(clearTimeout(l),a===!0&&(p=!0),l=setTimeout(d,a===!0?20:250))}function h(a,c){b.diffOutOfDate||(b.diffOutOfDate=!0,m.from=m.to=o.from=o.to=0),e(c.text.length-1!=c.to.line-c.from.line)}function i(){b.diffOutOfDate=!0,b.dealigned=!0,d("full")}var l,m={from:0,to:0,marked:[]},o={from:0,to:0,marked:[]},p=!1;return b.edit.on("change",h),b.orig.on("change",h),b.edit.on("swapDoc",i),b.orig.on("swapDoc",i),"align"==b.mv.options.connect&&(a.on(b.edit.state.trackAlignable,"realign",e),a.on(b.orig.state.trackAlignable,"realign",e)),b.edit.on("viewportChange",(function(){g(!1)})),b.orig.on("viewportChange",(function(){g(!1)})),d(),d}function e(a,b){a.edit.on("scroll",(function(){f(a,!0)&&n(a)})),a.orig.on("scroll",(function(){f(a,!1)&&n(a),b&&f(b,!0)&&n(b)}))}function f(a,b){if(a.diffOutOfDate)return a.lockScroll&&null==a.needsScrollSync&&(a.needsScrollSync=b),!1;if(a.needsScrollSync=null,!a.lockScroll)return!0;var c,d,e=+new Date;if(b?(c=a.edit,d=a.orig):(c=a.orig,d=a.edit),c.state.scrollSetBy==a&&(c.state.scrollSetAt||0)+250>e)return!1;var f=c.getScrollInfo();if("align"==a.mv.options.connect)q=f.top;else{var h,i,j=.5*f.clientHeight,k=f.top+j,l=c.lineAtHeight(k,"local"),m=D(a.chunks,l,b),n=g(c,b?m.edit:m.orig),o=g(d,b?m.orig:m.edit),p=(k-n.top)/(n.bot-n.top),q=o.top-j+p*(o.bot-o.top);if(q>f.top&&(i=f.top/j)<1)q=q*i+f.top*(1-i);else if((h=f.height-f.clientHeight-f.top)h&&(i=h/j)<1&&(q=q*i+(r.height-r.clientHeight-h)*(1-i))}}return d.scrollTo(f.left,q),d.state.scrollSetAt=e,d.state.scrollSetBy=a,!0}function g(a,b){var c=b.after;return null==c&&(c=a.lastLine()+1),{top:a.heightAtLine(b.before||0,"local"),bot:a.heightAtLine(c,"local")}}function h(a,b,c){a.lockScroll=b,b&&0!=c&&f(a,DIFF_INSERT)&&n(a),a.lockButton.innerHTML=b?"⇛⇚":"⇛  ⇚"}function i(a,b,c){for(var d=c.classLocation,e=0;e20||c.from-f.to>20?(j(a,c.marked,e),m(a,b,d,c.marked,f.from,f.to,e),c.from=f.from,c.to=f.to):(f.fromc.to&&(m(a,b,d,c.marked,c.to,f.to,e),c.to=f.to))}))}function l(a,b,c,d,e,f){for(var g=c.classLocation,h=a.getLineHandle(b),i=0;it&&(o&&(h(n,t),o=!1),n=u)}else if(o=!0,r==c){var v=M(i,s,!0),w=P(j,i),x=O(k,v);Q(w,x)||d.push(a.markText(w,x,{className:m})),i=v}}o&&h(n,i.line+1)}function n(a){if(a.showDifferences){if(a.svg){J(a.svg);var b=a.gap.offsetWidth;K(a.svg,"width",b,"height",a.gap.offsetHeight)}a.copyButtons&&J(a.copyButtons);for(var c=a.edit.getViewport(),d=a.orig.getViewport(),e=a.mv.wrap.getBoundingClientRect().top,f=e-a.edit.getScrollerElement().getBoundingClientRect().top+a.edit.getScrollInfo().top,g=e-a.orig.getScrollerElement().getBoundingClientRect().top+a.orig.getScrollInfo().top,h=0;h=c.from&&i.origFrom<=d.to&&i.origTo>=d.from&&v(a,i,g,f,b)}}}function o(a,b){for(var c=0,d=0,e=0;ea&&f.editFrom<=a)return null;if(f.editFrom>a)break;c=f.editTo,d=f.origTo}return d+(a-c)}function p(a,b,c){for(var d=a.state.trackAlignable,e=a.firstLine(),f=0,g=[],h=0;;h++){for(var i=b[h],j=i?c?i.origFrom:i.editFrom:1e9;fl){f++,e--;continue a}if(m.editTo>k){if(m.editFrom<=k)continue a;break}h+=m.origTo-m.origFrom-(m.editTo-m.editFrom),g++}if(k==l-h)i[d]=l,f++;else if(k1&&c.push(u(a[f],b[f],h))}}function u(a,b,c){var d=!0;b>a.lastLine()&&(b--,d=!1);var e=document.createElement("div");return e.className="CodeMirror-merge-spacer",e.style.height=c+"px",e.style.minWidth="1px",a.addLineWidget(b,e,{height:c,above:d,mergeSpacer:!0,handleMouseEvents:!0})}function v(a,b,c,d,e){var f="left"==a.type,g=a.orig.heightAtLine(b.origFrom,"local",!0)-c;if(a.svg){var h=g,i=a.edit.heightAtLine(b.editFrom,"local",!0)-d;if(f){var j=h;h=i,i=j}var k=a.orig.heightAtLine(b.origTo,"local",!0)-c,l=a.edit.heightAtLine(b.editTo,"local",!0)-d;if(f){var j=k;k=l,l=j}var m=" C "+e/2+" "+i+" "+e/2+" "+h+" "+(e+2)+" "+h,n=" C "+e/2+" "+k+" "+e/2+" "+l+" -1 "+l;K(a.svg.appendChild(document.createElementNS(V,"path")),"d","M -1 "+i+m+" L "+(e+2)+" "+k+n+" z","class",a.classes.connect)}if(a.copyButtons){var o=a.copyButtons.appendChild(I("div","left"==a.type?"⇝":"⇜","CodeMirror-merge-copy")),p=a.mv.options.allowEditingOriginals;if(o.title=p?"Push to left":"Revert chunk",o.chunk=b,o.style.top=(b.origTo>b.origFrom?g:a.edit.heightAtLine(b.editFrom,"local")-d)+"px",p){var q=a.edit.heightAtLine(b.editFrom,"local")-d,r=a.copyButtons.appendChild(I("div","right"==a.type?"⇝":"⇜","CodeMirror-merge-copy-reverse"));r.title="Push to right",r.chunk={editFrom:b.origFrom,editTo:b.origTo,origFrom:b.editFrom,origTo:b.editTo},r.style.top=q+"px","right"==a.type?r.style.left="2px":r.style.right="2px"}}}function w(a,b,c,d){if(!a.diffOutOfDate){var e=d.origTo>c.lastLine()?U(d.origFrom-1):U(d.origFrom,0),f=U(d.origTo,0),g=d.editTo>b.lastLine()?U(d.editFrom-1):U(d.editFrom,0),h=U(d.editTo,0),i=a.mv.options.revertChunk;i?i(a.mv,c,e,f,b,g,h):b.replaceRange(c.getRange(e,f),g,h)}}function x(b){var c=b.lockButton=I("div",null,"CodeMirror-merge-scrolllock");c.title="Toggle locked scrolling";var d=I("div",[c],"CodeMirror-merge-scrolllock-wrap");a.on(c,"click",(function(){h(b,!b.lockScroll)}));var e=[d];if(b.mv.options.revertButtons!==!1&&(b.copyButtons=I("div",null,"CodeMirror-merge-copybuttons-"+b.type),a.on(b.copyButtons,"click",(function(a){var c=a.target||a.srcElement;if(c.chunk)return"CodeMirror-merge-copy-reverse"==c.className?void w(b,b.orig,b.edit,c.chunk):void w(b,b.edit,b.orig,c.chunk)})),e.unshift(b.copyButtons)),"align"!=b.mv.options.connect){var f=document.createElementNS&&document.createElementNS(V,"svg");f&&!f.createSVGRect&&(f=null),b.svg=f,f&&e.push(f)}return b.gap=I("div",e,"CodeMirror-merge-gap")}function y(a){return"string"==typeof a?a:a.getValue()}function z(a,b,c){Y||(Y=new diff_match_patch);for(var d=Y.diff_main(a,b),e=0;ek&&(g&&b.push({origFrom:d,origTo:l,editFrom:c,editTo:k}),c=n,d=o)}else M(i==DIFF_INSERT?e:f,h[1])}return(c<=e.line||d<=f.line)&&b.push({origFrom:d,origTo:f.line+1,editFrom:c,editTo:e.line+1}),b}function B(a,b){if(b==a.length-1)return!0;var c=a[b+1][1];return!(1==c.length&&b1||b==a.length-3)&&10==c.charCodeAt(0)))}function C(a,b){if(0==b)return!0;var c=a[b-1][1];return 10==c.charCodeAt(c.length-1)&&(1==b||(c=a[b-2][1],10==c.charCodeAt(c.length-1)))}function D(a,b,c){for(var d,e,f,g,h=0;hb?(e=i.editFrom,g=i.origFrom):k>b&&(e=i.editTo,g=i.origTo)),k<=b?(d=i.editTo,f=i.origTo):j<=b&&(d=i.editFrom,f=i.origFrom)}return{edit:{before:d,after:e},orig:{before:f,after:g}}}function E(b,c,d){function e(){g.clear(),b.removeLineClass(c,"wrap","CodeMirror-merge-collapsed-line")}b.addLineClass(c,"wrap","CodeMirror-merge-collapsed-line");var f=document.createElement("span");f.className="CodeMirror-merge-collapsed-widget",f.title="Identical text collapsed. Click to expand.";var g=b.markText(U(c,0),U(d-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:f,clearOnEnter:!0});return g.explicitlyCleared&&e(),a.on(f,"click",e),g.on("clear",e),a.on(f,"click",e),{mark:g,clear:e}}function F(a,b){function c(){for(var a=0;a=0&&hb){var k=[{line:i,cm:d}];a.left&&k.push({line:o(i,a.left.chunks),cm:a.left.orig}),a.right&&k.push({line:o(i,a.right.chunks),cm:a.right.orig});var l=F(j,k);a.options.onCollapse&&a.options.onCollapse(a,i,j,l)}}}function I(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f0;--b)a.removeChild(a.firstChild)}function K(a){for(var b=1;b0?a:b}function Q(a,b){return a.line==b.line&&a.ch==b.ch}function R(a,b,c){for(var d=a.length-1;d>=0;d--){var e=a[d],f=(c?e.origTo:e.editTo)-1;if(fb)return f}}function T(b,d){var e=null,f=b.state.diffViews,g=b.getCursor().line;if(f)for(var h=0;he:k0)break}this.signal(),this.alignable.splice(c,0,a,b)},find:function(a){for(var b=0;b-1){var j=this.alignable[f+1];j==$?this.alignable.splice(f,2):this.alignable[f+1]=j&~$}g>-1&&c&&this.set(a+c,$)}},a.commands.goNextDiff=function(a){return T(a,1)},a.commands.goPrevDiff=function(a){return T(a,-1)}})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b){this.mv=a,this.type=b,this.classes="left"==b?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}function c(b){b.diffOutOfDate&&(b.diff=z(b.orig.getValue(),b.edit.getValue(),b.mv.options.ignoreWhitespace),b.chunks=A(b.diff),b.diffOutOfDate=!1,a.signal(b.edit,"updateDiff",b.diff))}function d(b){function d(a){W=!0,p=!1,"full"==a&&(b.svg&&J(b.svg),b.copyButtons&&J(b.copyButtons),j(b.edit,m.marked,b.classes),j(b.orig,o.marked,b.classes),m.from=m.to=o.from=o.to=0),c(b),b.showDifferences&&(k(b.edit,b.diff,m,DIFF_INSERT,b.classes),k(b.orig,b.diff,o,DIFF_DELETE,b.classes)),"align"==b.mv.options.connect&&s(b),n(b),null!=b.needsScrollSync&&f(b,b.needsScrollSync),W=!1}function e(a){W||(b.dealigned=!0,g(a))}function g(a){W||p||(clearTimeout(l),a===!0&&(p=!0),l=setTimeout(d,a===!0?20:250))}function h(a,c){b.diffOutOfDate||(b.diffOutOfDate=!0,m.from=m.to=o.from=o.to=0),e(c.text.length-1!=c.to.line-c.from.line)}function i(){b.diffOutOfDate=!0,b.dealigned=!0,d("full")}var l,m={from:0,to:0,marked:[]},o={from:0,to:0,marked:[]},p=!1;return b.edit.on("change",h),b.orig.on("change",h),b.edit.on("swapDoc",i),b.orig.on("swapDoc",i),"align"==b.mv.options.connect&&(a.on(b.edit.state.trackAlignable,"realign",e),a.on(b.orig.state.trackAlignable,"realign",e)),b.edit.on("viewportChange",(function(){g(!1)})),b.orig.on("viewportChange",(function(){g(!1)})),d(),d}function e(a,b){a.edit.on("scroll",(function(){f(a,!0)&&n(a)})),a.orig.on("scroll",(function(){f(a,!1)&&n(a),b&&f(b,!0)&&n(b)}))}function f(a,b){if(a.diffOutOfDate)return a.lockScroll&&null==a.needsScrollSync&&(a.needsScrollSync=b),!1;if(a.needsScrollSync=null,!a.lockScroll)return!0;var c,d,e=+new Date;if(b?(c=a.edit,d=a.orig):(c=a.orig,d=a.edit),c.state.scrollSetBy==a&&(c.state.scrollSetAt||0)+250>e)return!1;var f=c.getScrollInfo();if("align"==a.mv.options.connect)q=f.top;else{var h,i,j=.5*f.clientHeight,k=f.top+j,l=c.lineAtHeight(k,"local"),m=D(a.chunks,l,b),n=g(c,b?m.edit:m.orig),o=g(d,b?m.orig:m.edit),p=(k-n.top)/(n.bot-n.top),q=o.top-j+p*(o.bot-o.top);if(q>f.top&&(i=f.top/j)<1)q=q*i+f.top*(1-i);else if((h=f.height-f.clientHeight-f.top)h&&(i=h/j)<1&&(q=q*i+(r.height-r.clientHeight-h)*(1-i))}}return d.scrollTo(f.left,q),d.state.scrollSetAt=e,d.state.scrollSetBy=a,!0}function g(a,b){var c=b.after;return null==c&&(c=a.lastLine()+1),{top:a.heightAtLine(b.before||0,"local"),bot:a.heightAtLine(c,"local")}}function h(b,c,d){b.lockScroll=c,c&&0!=d&&f(b,DIFF_INSERT)&&n(b),(c?a.addClass:a.rmClass)(b.lockButton,"CodeMirror-merge-scrolllock-enabled")}function i(a,b,c){for(var d=c.classLocation,e=0;e20||c.from-f.to>20?(j(a,c.marked,e),m(a,b,d,c.marked,f.from,f.to,e),c.from=f.from,c.to=f.to):(f.fromc.to&&(m(a,b,d,c.marked,c.to,f.to,e),c.to=f.to))}))}function l(a,b,c,d,e,f){for(var g=c.classLocation,h=a.getLineHandle(b),i=0;it&&(o&&(h(n,t),o=!1),n=u)}else if(o=!0,r==c){var v=M(i,s,!0),w=P(j,i),x=O(k,v);Q(w,x)||d.push(a.markText(w,x,{className:m})),i=v}}o&&h(n,i.line+1)}function n(a){if(a.showDifferences){if(a.svg){J(a.svg);var b=a.gap.offsetWidth;K(a.svg,"width",b,"height",a.gap.offsetHeight)}a.copyButtons&&J(a.copyButtons);for(var c=a.edit.getViewport(),d=a.orig.getViewport(),e=a.mv.wrap.getBoundingClientRect().top,f=e-a.edit.getScrollerElement().getBoundingClientRect().top+a.edit.getScrollInfo().top,g=e-a.orig.getScrollerElement().getBoundingClientRect().top+a.orig.getScrollInfo().top,h=0;h=c.from&&i.origFrom<=d.to&&i.origTo>=d.from&&v(a,i,g,f,b)}}}function o(a,b){for(var c=0,d=0,e=0;ea&&f.editFrom<=a)return null;if(f.editFrom>a)break;c=f.editTo,d=f.origTo}return d+(a-c)}function p(a,b,c){for(var d=a.state.trackAlignable,e=a.firstLine(),f=0,g=[],h=0;;h++){for(var i=b[h],j=i?c?i.origFrom:i.editFrom:1e9;fl){f++,e--;continue a}if(m.editTo>k){if(m.editFrom<=k)continue a;break}h+=m.origTo-m.origFrom-(m.editTo-m.editFrom),g++}if(k==l-h)i[d]=l,f++;else if(k1&&c.push(u(a[f],b[f],h))}}function u(a,b,c){var d=!0;b>a.lastLine()&&(b--,d=!1);var e=document.createElement("div");return e.className="CodeMirror-merge-spacer",e.style.height=c+"px",e.style.minWidth="1px",a.addLineWidget(b,e,{height:c,above:d,mergeSpacer:!0,handleMouseEvents:!0})}function v(a,b,c,d,e){var f="left"==a.type,g=a.orig.heightAtLine(b.origFrom,"local",!0)-c;if(a.svg){var h=g,i=a.edit.heightAtLine(b.editFrom,"local",!0)-d;if(f){var j=h;h=i,i=j}var k=a.orig.heightAtLine(b.origTo,"local",!0)-c,l=a.edit.heightAtLine(b.editTo,"local",!0)-d;if(f){var j=k;k=l,l=j}var m=" C "+e/2+" "+i+" "+e/2+" "+h+" "+(e+2)+" "+h,n=" C "+e/2+" "+k+" "+e/2+" "+l+" -1 "+l;K(a.svg.appendChild(document.createElementNS(V,"path")),"d","M -1 "+i+m+" L "+(e+2)+" "+k+n+" z","class",a.classes.connect)}if(a.copyButtons){var o=a.copyButtons.appendChild(I("div","left"==a.type?"⇝":"⇜","CodeMirror-merge-copy")),p=a.mv.options.allowEditingOriginals;if(o.title=p?"Push to left":"Revert chunk",o.chunk=b,o.style.top=(b.origTo>b.origFrom?g:a.edit.heightAtLine(b.editFrom,"local")-d)+"px",p){var q=a.edit.heightAtLine(b.editFrom,"local")-d,r=a.copyButtons.appendChild(I("div","right"==a.type?"⇝":"⇜","CodeMirror-merge-copy-reverse"));r.title="Push to right",r.chunk={editFrom:b.origFrom,editTo:b.origTo,origFrom:b.editFrom,origTo:b.editTo},r.style.top=q+"px","right"==a.type?r.style.left="2px":r.style.right="2px"}}}function w(a,b,c,d){if(!a.diffOutOfDate){var e=d.origTo>c.lastLine()?U(d.origFrom-1):U(d.origFrom,0),f=U(d.origTo,0),g=d.editTo>b.lastLine()?U(d.editFrom-1):U(d.editFrom,0),h=U(d.editTo,0),i=a.mv.options.revertChunk;i?i(a.mv,c,e,f,b,g,h):b.replaceRange(c.getRange(e,f),g,h)}}function x(b){var c=b.lockButton=I("div",null,"CodeMirror-merge-scrolllock");c.title="Toggle locked scrolling";var d=I("div",[c],"CodeMirror-merge-scrolllock-wrap");a.on(c,"click",(function(){h(b,!b.lockScroll)}));var e=[d];if(b.mv.options.revertButtons!==!1&&(b.copyButtons=I("div",null,"CodeMirror-merge-copybuttons-"+b.type),a.on(b.copyButtons,"click",(function(a){var c=a.target||a.srcElement;if(c.chunk)return"CodeMirror-merge-copy-reverse"==c.className?void w(b,b.orig,b.edit,c.chunk):void w(b,b.edit,b.orig,c.chunk)})),e.unshift(b.copyButtons)),"align"!=b.mv.options.connect){var f=document.createElementNS&&document.createElementNS(V,"svg");f&&!f.createSVGRect&&(f=null),b.svg=f,f&&e.push(f)}return b.gap=I("div",e,"CodeMirror-merge-gap")}function y(a){return"string"==typeof a?a:a.getValue()}function z(a,b,c){Y||(Y=new diff_match_patch);for(var d=Y.diff_main(a,b),e=0;ek&&(g&&b.push({origFrom:d,origTo:l,editFrom:c,editTo:k}),c=n,d=o)}else M(i==DIFF_INSERT?e:f,h[1])}return(c<=e.line||d<=f.line)&&b.push({origFrom:d,origTo:f.line+1,editFrom:c,editTo:e.line+1}),b}function B(a,b){if(b==a.length-1)return!0;var c=a[b+1][1];return!(1==c.length&&b1||b==a.length-3)&&10==c.charCodeAt(0)))}function C(a,b){if(0==b)return!0;var c=a[b-1][1];return 10==c.charCodeAt(c.length-1)&&(1==b||(c=a[b-2][1],10==c.charCodeAt(c.length-1)))}function D(a,b,c){for(var d,e,f,g,h=0;hb?(e=i.editFrom,g=i.origFrom):k>b&&(e=i.editTo,g=i.origTo)),k<=b?(d=i.editTo,f=i.origTo):j<=b&&(d=i.editFrom,f=i.origFrom)}return{edit:{before:d,after:e},orig:{before:f,after:g}}}function E(b,c,d){function e(){g.clear(),b.removeLineClass(c,"wrap","CodeMirror-merge-collapsed-line")}b.addLineClass(c,"wrap","CodeMirror-merge-collapsed-line");var f=document.createElement("span");f.className="CodeMirror-merge-collapsed-widget",f.title="Identical text collapsed. Click to expand.";var g=b.markText(U(c,0),U(d-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:f,clearOnEnter:!0});return g.explicitlyCleared&&e(),a.on(f,"click",e),g.on("clear",e),a.on(f,"click",e),{mark:g,clear:e}}function F(a,b){function c(){for(var a=0;a=0&&hb){var k=[{line:i,cm:d}];a.left&&k.push({line:o(i,a.left.chunks),cm:a.left.orig}),a.right&&k.push({line:o(i,a.right.chunks),cm:a.right.orig});var l=F(j,k);a.options.onCollapse&&a.options.onCollapse(a,i,j,l)}}}function I(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f0;--b)a.removeChild(a.firstChild)}function K(a){for(var b=1;b0?a:b}function Q(a,b){return a.line==b.line&&a.ch==b.ch}function R(a,b,c){for(var d=a.length-1;d>=0;d--){var e=a[d],f=(c?e.origTo:e.editTo)-1;if(fb)return f}}function T(b,d){var e=null,f=b.state.diffViews,g=b.getCursor().line;if(f)for(var h=0;he:k0)break}this.signal(),this.alignable.splice(c,0,a,b)},find:function(a){for(var b=0;b-1){var j=this.alignable[f+1];j==$?this.alignable.splice(f,2):this.alignable[f+1]=j&~$}g>-1&&c&&this.set(a+c,$)}},a.commands.goNextDiff=function(a){return T(a,1)},a.commands.goPrevDiff=function(a){return T(a,-1)}})); \ No newline at end of file diff --git a/media/editors/codemirror/addon/mode/multiplex.js b/media/editors/codemirror/addon/mode/multiplex.js index 3d8b34c452013..a084f7025a682 100644 --- a/media/editors/codemirror/addon/mode/multiplex.js +++ b/media/editors/codemirror/addon/mode/multiplex.js @@ -50,7 +50,15 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { if (found == stream.pos) { if (!other.parseDelimiters) stream.match(other.open); state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); + + // Get the outer indent, making sure to handle CodeMirror.Pass + var outerIndent = 0; + if (outer.indent) { + var possibleOuterIndent = outer.indent(state.outer, ""); + if (possibleOuterIndent !== CodeMirror.Pass) outerIndent = possibleOuterIndent; + } + + state.inner = CodeMirror.startState(other.mode, outerIndent); return other.delimStyle && (other.delimStyle + " " + other.delimStyle + "-open"); } else if (found != -1 && found < cutOff) { cutOff = found; diff --git a/media/editors/codemirror/addon/mode/multiplex.min.js b/media/editors/codemirror/addon/mode/multiplex.min.js index bb9e6d551cec0..8dd1c9a885a69 100644 --- a/media/editors/codemirror/addon/mode/multiplex.min.js +++ b/media/editors/codemirror/addon/mode/multiplex.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";a.multiplexingMode=function(b){function c(a,b,c,d){if("string"==typeof b){var e=a.indexOf(b,c);return d&&e>-1?e+b.length:e}var f=b.exec(c?a.slice(c):a);return f?f.index+c+(d?f[0].length:0):-1}var d=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:a.startState(b),innerActive:null,inner:null}},copyState:function(c){return{outer:a.copyState(b,c.outer),innerActive:c.innerActive,inner:c.innerActive&&a.copyState(c.innerActive.mode,c.inner)}},token:function(e,f){if(f.innerActive){var g=f.innerActive,h=e.string;if(!g.close&&e.sol())return f.innerActive=f.inner=null,this.token(e,f);var i=g.close?c(h,g.close,e.pos,g.parseDelimiters):-1;if(i==e.pos&&!g.parseDelimiters)return e.match(g.close),f.innerActive=f.inner=null,g.delimStyle&&g.delimStyle+" "+g.delimStyle+"-close";i>-1&&(e.string=h.slice(0,i));var j=g.mode.token(e,f.inner);return i>-1&&(e.string=h),i==e.pos&&g.parseDelimiters&&(f.innerActive=f.inner=null),g.innerStyle&&(j=j?j+" "+g.innerStyle:g.innerStyle),j}for(var k=1/0,h=e.string,l=0;l-1?e+b.length:e}var f=b.exec(c?a.slice(c):a);return f?f.index+c+(d?f[0].length:0):-1}var d=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:a.startState(b),innerActive:null,inner:null}},copyState:function(c){return{outer:a.copyState(b,c.outer),innerActive:c.innerActive,inner:c.innerActive&&a.copyState(c.innerActive.mode,c.inner)}},token:function(e,f){if(f.innerActive){var g=f.innerActive,h=e.string;if(!g.close&&e.sol())return f.innerActive=f.inner=null,this.token(e,f);var i=g.close?c(h,g.close,e.pos,g.parseDelimiters):-1;if(i==e.pos&&!g.parseDelimiters)return e.match(g.close),f.innerActive=f.inner=null,g.delimStyle&&g.delimStyle+" "+g.delimStyle+"-close";i>-1&&(e.string=h.slice(0,i));var j=g.mode.token(e,f.inner);return i>-1&&(e.string=h),i==e.pos&&g.parseDelimiters&&(f.innerActive=f.inner=null),g.innerStyle&&(j=j?j+" "+g.innerStyle:g.innerStyle),j}for(var k=1/0,h=e.string,l=0;l=b.options.minChars&&f(a,m,!1,b.options.style)}}))}function i(a,b,c){var d=a.getRange(b,c);if(null!==d.match(/^\w+$/)){if(b.ch>0){var e={line:b.line,ch:b.ch-1},f=a.getRange(e,b);if(null===f.match(/\W/))return!1}if(c.ch=b.options.minChars&&f(a,m,!1,b.options.style)}}))}function i(a,b,c){var d=a.getRange(b,c);if(null!==d.match(/^\w+$/)){if(b.ch>0){var e={line:b.line,ch:b.ch-1},f=a.getRange(e,b);if(null===f.match(/\W/))return!1}if(c.ch50&&I.shift()}function d(a){return I.length?void(I[I.length-1]+=a):c(a)}function e(a){return I[I.length-(a?Math.min(a,1):1)]||""}function f(){return I.length>1&&I.pop(),e()}function g(a,e,f,g,h){null==h&&(h=a.getRange(e,f)),"grow"==g&&J&&J.cm==a&&b(e,J.pos)&&a.isClean(J.gen)?d(h):g!==!1&&c(h),a.replaceRange("",e,f,"+delete"),J="grow"==g?{cm:a,pos:e,gen:a.changeGeneration()}:null}function h(a,b,c){return a.findPosH(b,c,"char",!0)}function i(a,b,c){return a.findPosH(b,c,"word",!0)}function j(a,b,c){return a.findPosV(b,c,"line",a.doc.sel.goalColumn)}function k(a,b,c){return a.findPosV(b,c,"page",a.doc.sel.goalColumn)}function l(a,b,c){for(var d=b.line,e=a.getLine(d),f=/\S/.test(c<0?e.slice(0,b.ch):e.slice(b.ch)),g=a.firstLine(),h=a.lastLine();;){if(d+=c,dh)return a.clipPos(H(d-c,c<0?0:null));e=a.getLine(d);var i=/\S/.test(e);if(i)f=!0;else if(f)return H(d,0)}}function m(a,b,c){for(var d=b.line,e=b.ch,f=a.getLine(b.line),g=!1;;){var h=f.charAt(e+(c<0?-1:0));if(h){if(g&&/[!?.]/.test(h))return H(d,e+(c>0?1:0));g||(g=/\w/.test(h)),e+=c}else{if(d==(c<0?a.firstLine():a.lastLine()))return H(d,e);if(f=a.getLine(d+c),!/\S/.test(f))return H(d,e);d+=c,e=c<0?f.length:0}}}function n(a,c,d){var e;if(a.findMatchingBracket&&(e=a.findMatchingBracket(c,{strict:!0}))&&e.match&&(e.forward?1:-1)==d)return d>0?H(e.to.line,e.to.ch+1):e.to;for(var f=!0;;f=!1){var g=a.getTokenAt(c),h=H(c.line,d<0?g.start:g.end);if(!(f&&d>0&&g.end==c.ch)&&/\w/.test(g.string))return h;var i=a.findPosH(h,d,"char");if(b(h,i))return c;c=i}}function o(a,b){var c=a.state.emacsPrefix;return c?(w(a),"-"==c?-1:Number(c)):b?null:1}function p(a){var b="string"==typeof a?function(b){b.execCommand(a)}:a;return function(a){var c=o(a);b(a);for(var d=1;d1&&"+input"==b.origin){for(var d=b.text.join("\n"),e="",f=1;f',c,{bottom:!0}):c(prompt(b,""))}function D(a,b){var c=a.getCursor(),d=a.findPosH(c,1,"word");a.replaceRange(b(a.getRange(c,d)),c,d),a.setCursor(d)}function E(a){for(var b=a.getCursor(),c=b.line,d=b.ch,e=[];c>=a.firstLine();){for(var f=a.getLine(c),g=null==d?f.length:d;g>0;){var d=f.charAt(--g);if(")"==d)e.push("(");else if("]"==d)e.push("[");else if("}"==d)e.push("{");else if(/[\(\{\[]/.test(d)&&(!e.length||e.pop()!=d))return a.extendSelection(H(c,g))}--c,d=null}}function F(a){a.execCommand("clearSearch"),B(a)}function G(a){M[a]=function(b){u(b,a)},L["Ctrl-"+a]=function(b){u(b,a)},K["Ctrl-"+a]=!0}var H=a.Pos,I=[],J=null,K={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0};a.emacs={kill:g,killRegion:t,repeated:p};for(var L=a.keyMap.emacs=a.normalizeKeyMap({"Ctrl-W":function(a){g(a,a.getCursor("start"),a.getCursor("end"),!0)},"Ctrl-K":p((function(a){var b=a.getCursor(),c=a.clipPos(H(b.line)),d=a.getRange(b,c);/\S/.test(d)||(d+="\n",c=H(b.line+1,0)),g(a,b,c,"grow",d)})),"Alt-W":function(a){c(a.getSelection()),B(a)},"Ctrl-Y":function(a){var b=a.getCursor();a.replaceRange(e(o(a)),b,b,"paste"),a.setSelection(b,a.getCursor())},"Alt-Y":function(a){a.replaceSelection(f(),"around","paste")},"Ctrl-Space":A,"Ctrl-Shift-2":A,"Ctrl-F":r(h,1),"Ctrl-B":r(h,-1),Right:r(h,1),Left:r(h,-1),"Ctrl-D":function(a){s(a,h,1,!1)},Delete:function(a){t(a,!1)||s(a,h,1,!1)},"Ctrl-H":function(a){s(a,h,-1,!1)},Backspace:function(a){t(a,!1)||s(a,h,-1,!1)},"Alt-F":r(i,1),"Alt-B":r(i,-1),"Alt-D":function(a){s(a,i,1,"grow")},"Alt-Backspace":function(a){s(a,i,-1,"grow")},"Ctrl-N":r(j,1),"Ctrl-P":r(j,-1),Down:r(j,1),Up:r(j,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":r(k,-1),"Ctrl-V":r(k,1),PageUp:r(k,-1),PageDown:r(k,1),"Ctrl-Up":r(l,-1),"Ctrl-Down":r(l,1),"Alt-A":r(m,-1),"Alt-E":r(m,1),"Alt-K":function(a){s(a,m,1,"grow")},"Ctrl-Alt-K":function(a){s(a,n,1,"grow")},"Ctrl-Alt-Backspace":function(a){s(a,n,-1,"grow")},"Ctrl-Alt-F":r(n,1),"Ctrl-Alt-B":r(n,-1,"grow"),"Shift-Ctrl-Alt-2":function(a){var b=a.getCursor();a.setSelection(q(a,b,n,1),b)},"Ctrl-Alt-T":function(a){var b=n(a,a.getCursor(),-1),c=n(a,b,1),d=n(a,c,1),e=n(a,d,-1);a.replaceRange(a.getRange(e,d)+a.getRange(c,e)+a.getRange(b,c),b,d)},"Ctrl-Alt-U":p(E),"Alt-Space":function(a){for(var b=a.getCursor(),c=b.ch,d=b.ch,e=a.getLine(b.line);c&&/\s/.test(e.charAt(c-1));)--c;for(;d0?a.setCursor(b-1):void C(a,"Goto line",(function(b){var c;b&&!isNaN(c=Number(b))&&c==(0|c)&&c>0&&a.setCursor(c-1)}))},"Ctrl-X Tab":function(a){a.indentSelection(o(a,!0)||a.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(a){a.setSelection(a.getCursor("head"),a.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":p("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(a){g(a,a.getCursor(),m(a,a.getCursor(),1),"grow")},"Ctrl-X H":"selectAll","Ctrl-Q Tab":p("insertTab"),"Ctrl-U":y}),M={"Ctrl-G":w},N=0;N<10;++N)G(String(N));G("-")})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b){return a.line==b.line&&a.ch==b.ch}function c(a){I.push(a),I.length>50&&I.shift()}function d(a){return I.length?void(I[I.length-1]+=a):c(a)}function e(a){return I[I.length-(a?Math.min(a,1):1)]||""}function f(){return I.length>1&&I.pop(),e()}function g(a,e,f,g,h){null==h&&(h=a.getRange(e,f)),"grow"==g&&J&&J.cm==a&&b(e,J.pos)&&a.isClean(J.gen)?d(h):g!==!1&&c(h),a.replaceRange("",e,f,"+delete"),J="grow"==g?{cm:a,pos:e,gen:a.changeGeneration()}:null}function h(a,b,c){return a.findPosH(b,c,"char",!0)}function i(a,b,c){return a.findPosH(b,c,"word",!0)}function j(a,b,c){return a.findPosV(b,c,"line",a.doc.sel.goalColumn)}function k(a,b,c){return a.findPosV(b,c,"page",a.doc.sel.goalColumn)}function l(a,b,c){for(var d=b.line,e=a.getLine(d),f=/\S/.test(c<0?e.slice(0,b.ch):e.slice(b.ch)),g=a.firstLine(),h=a.lastLine();;){if(d+=c,dh)return a.clipPos(H(d-c,c<0?0:null));e=a.getLine(d);var i=/\S/.test(e);if(i)f=!0;else if(f)return H(d,0)}}function m(a,b,c){for(var d=b.line,e=b.ch,f=a.getLine(b.line),g=!1;;){var h=f.charAt(e+(c<0?-1:0));if(h){if(g&&/[!?.]/.test(h))return H(d,e+(c>0?1:0));g||(g=/\w/.test(h)),e+=c}else{if(d==(c<0?a.firstLine():a.lastLine()))return H(d,e);if(f=a.getLine(d+c),!/\S/.test(f))return H(d,e);d+=c,e=c<0?f.length:0}}}function n(a,c,d){var e;if(a.findMatchingBracket&&(e=a.findMatchingBracket(c,{strict:!0}))&&e.match&&(e.forward?1:-1)==d)return d>0?H(e.to.line,e.to.ch+1):e.to;for(var f=!0;;f=!1){var g=a.getTokenAt(c),h=H(c.line,d<0?g.start:g.end);if(!(f&&d>0&&g.end==c.ch)&&/\w/.test(g.string))return h;var i=a.findPosH(h,d,"char");if(b(h,i))return c;c=i}}function o(a,b){var c=a.state.emacsPrefix;return c?(w(a),"-"==c?-1:Number(c)):b?null:1}function p(a){var b="string"==typeof a?function(b){b.execCommand(a)}:a;return function(a){var c=o(a);b(a);for(var d=1;d1&&"+input"==b.origin){for(var d=b.text.join("\n"),e="",f=1;f',c,{bottom:!0}):c(prompt(b,""))}function D(a,b){var c=a.getCursor(),d=a.findPosH(c,1,"word");a.replaceRange(b(a.getRange(c,d)),c,d),a.setCursor(d)}function E(a){for(var b=a.getCursor(),c=b.line,d=b.ch,e=[];c>=a.firstLine();){for(var f=a.getLine(c),g=null==d?f.length:d;g>0;){var d=f.charAt(--g);if(")"==d)e.push("(");else if("]"==d)e.push("[");else if("}"==d)e.push("{");else if(/[\(\{\[]/.test(d)&&(!e.length||e.pop()!=d))return a.extendSelection(H(c,g))}--c,d=null}}function F(a){a.execCommand("clearSearch"),B(a)}function G(a){M[a]=function(b){u(b,a)},L["Ctrl-"+a]=function(b){u(b,a)},K["Ctrl-"+a]=!0}var H=a.Pos,I=[],J=null,K={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0};a.emacs={kill:g,killRegion:t,repeated:p};for(var L=a.keyMap.emacs=a.normalizeKeyMap({"Ctrl-W":function(a){g(a,a.getCursor("start"),a.getCursor("end"),!0)},"Ctrl-K":p((function(a){var b=a.getCursor(),c=a.clipPos(H(b.line)),d=a.getRange(b,c);/\S/.test(d)||(d+="\n",c=H(b.line+1,0)),g(a,b,c,"grow",d)})),"Alt-W":function(a){c(a.getSelection()),B(a)},"Ctrl-Y":function(a){var b=a.getCursor();a.replaceRange(e(o(a)),b,b,"paste"),a.setSelection(b,a.getCursor())},"Alt-Y":function(a){a.replaceSelection(f(),"around","paste")},"Ctrl-Space":A,"Ctrl-Shift-2":A,"Ctrl-F":r(h,1),"Ctrl-B":r(h,-1),Right:r(h,1),Left:r(h,-1),"Ctrl-D":function(a){s(a,h,1,!1)},Delete:function(a){t(a,!1)||s(a,h,1,!1)},"Ctrl-H":function(a){s(a,h,-1,!1)},Backspace:function(a){t(a,!1)||s(a,h,-1,!1)},"Alt-F":r(i,1),"Alt-B":r(i,-1),"Alt-Right":r(i,1),"Alt-Left":r(i,-1),"Alt-D":function(a){s(a,i,1,"grow")},"Alt-Backspace":function(a){s(a,i,-1,"grow")},"Ctrl-N":r(j,1),"Ctrl-P":r(j,-1),Down:r(j,1),Up:r(j,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":r(k,-1),"Ctrl-V":r(k,1),PageUp:r(k,-1),PageDown:r(k,1),"Ctrl-Up":r(l,-1),"Ctrl-Down":r(l,1),"Alt-A":r(m,-1),"Alt-E":r(m,1),"Alt-K":function(a){s(a,m,1,"grow")},"Ctrl-Alt-K":function(a){s(a,n,1,"grow")},"Ctrl-Alt-Backspace":function(a){s(a,n,-1,"grow")},"Ctrl-Alt-F":r(n,1),"Ctrl-Alt-B":r(n,-1,"grow"),"Shift-Ctrl-Alt-2":function(a){var b=a.getCursor();a.setSelection(q(a,b,n,1),b)},"Ctrl-Alt-T":function(a){var b=n(a,a.getCursor(),-1),c=n(a,b,1),d=n(a,c,1),e=n(a,d,-1);a.replaceRange(a.getRange(e,d)+a.getRange(c,e)+a.getRange(b,c),b,d)},"Ctrl-Alt-U":p(E),"Alt-Space":function(a){for(var b=a.getCursor(),c=b.ch,d=b.ch,e=a.getLine(b.line);c&&/\s/.test(e.charAt(c-1));)--c;for(;d0?a.setCursor(b-1):void C(a,"Goto line",(function(b){var c;b&&!isNaN(c=Number(b))&&c==(0|c)&&c>0&&a.setCursor(c-1)}))},"Ctrl-X Tab":function(a){a.indentSelection(o(a,!0)||a.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(a){a.setSelection(a.getCursor("head"),a.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":p("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(a){g(a,a.getCursor(),m(a,a.getCursor(),1),"grow")},"Ctrl-X H":"selectAll","Ctrl-Q Tab":p("insertTab"),"Ctrl-U":y}),M={"Ctrl-G":w},N=0;N<10;++N)G(String(N));G("-")})); \ No newline at end of file diff --git a/media/editors/codemirror/keymap/vim.js b/media/editors/codemirror/keymap/vim.js index 529654a3b5387..ef79585f7dbc1 100644 --- a/media/editors/codemirror/keymap/vim.js +++ b/media/editors/codemirror/keymap/vim.js @@ -93,6 +93,8 @@ { keys: 'gE', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, bigWord: true, inclusive: true }}, { keys: '{', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: false, toJumplist: true }}, { keys: '}', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: true, toJumplist: true }}, + { keys: '(', type: 'motion', motion: 'moveBySentence', motionArgs: { forward: false }}, + { keys: ')', type: 'motion', motion: 'moveBySentence', motionArgs: { forward: true }}, { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: true }}, { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false }}, { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true }}, @@ -423,6 +425,9 @@ function isWhiteSpaceString(k) { return (/^\s*$/).test(k); } + function isEndOfSentenceSymbol(k) { + return '.?!'.indexOf(k) != -1; + } function inArray(val, arr) { for (var i = 0; i < arr.length; i++) { if (arr[i] == val) { @@ -866,7 +871,7 @@ if (vim.insertMode) { command = handleKeyInsertMode(); } else { command = handleKeyNonInsertMode(); } if (command === false) { - return undefined; + return !vim.insertMode && key.length === 1 ? function() { return true; } : undefined; } else if (command === true) { // TODO: Look into using CodeMirror's multi-key handling. // Return no-op since we are caching the key. Counts as handled, but @@ -1811,6 +1816,10 @@ var dir = motionArgs.forward ? 1 : -1; return findParagraph(cm, head, motionArgs.repeat, dir); }, + moveBySentence: function(cm, head, motionArgs) { + var dir = motionArgs.forward ? 1 : -1; + return findSentence(cm, head, motionArgs.repeat, dir); + }, moveByScroll: function(cm, head, motionArgs, vim) { var scrollbox = cm.getScrollInfo(); var curEnd = null; @@ -3534,6 +3543,179 @@ return { start: start, end: end }; } + function findSentence(cm, cur, repeat, dir) { + + /* + Takes an index object + { + line: the line string, + ln: line number, + pos: index in line, + dir: direction of traversal (-1 or 1) + } + and modifies the line, ln, and pos members to represent the + next valid position or sets them to null if there are + no more valid positions. + */ + function nextChar(cm, idx) { + if (idx.pos + idx.dir < 0 || idx.pos + idx.dir >= idx.line.length) { + idx.ln += idx.dir; + if (!isLine(cm, idx.ln)) { + idx.line = null; + idx.ln = null; + idx.pos = null; + return; + } + idx.line = cm.getLine(idx.ln); + idx.pos = (idx.dir > 0) ? 0 : idx.line.length - 1; + } + else { + idx.pos += idx.dir; + } + } + + /* + Performs one iteration of traversal in forward direction + Returns an index object of the new location + */ + function forward(cm, ln, pos, dir) { + var line = cm.getLine(ln); + var stop = (line === ""); + + var curr = { + line: line, + ln: ln, + pos: pos, + dir: dir, + } + + var last_valid = { + ln: curr.ln, + pos: curr.pos, + } + + var skip_empty_lines = (curr.line === ""); + + // Move one step to skip character we start on + nextChar(cm, curr); + + while (curr.line !== null) { + last_valid.ln = curr.ln; + last_valid.pos = curr.pos; + + if (curr.line === "" && !skip_empty_lines) { + return { ln: curr.ln, pos: curr.pos, }; + } + else if (stop && curr.line !== "" && !isWhiteSpaceString(curr.line[curr.pos])) { + return { ln: curr.ln, pos: curr.pos, }; + } + else if (isEndOfSentenceSymbol(curr.line[curr.pos]) + && !stop + && (curr.pos === curr.line.length - 1 + || isWhiteSpaceString(curr.line[curr.pos + 1]))) { + stop = true; + } + + nextChar(cm, curr); + } + + /* + Set the position to the last non whitespace character on the last + valid line in the case that we reach the end of the document. + */ + var line = cm.getLine(last_valid.ln); + last_valid.pos = 0; + for(var i = line.length - 1; i >= 0; --i) { + if (!isWhiteSpaceString(line[i])) { + last_valid.pos = i; + break; + } + } + + return last_valid; + + } + + /* + Performs one iteration of traversal in reverse direction + Returns an index object of the new location + */ + function reverse(cm, ln, pos, dir) { + var line = cm.getLine(ln); + + var curr = { + line: line, + ln: ln, + pos: pos, + dir: dir, + } + + var last_valid = { + ln: curr.ln, + pos: null, + }; + + var skip_empty_lines = (curr.line === ""); + + // Move one step to skip character we start on + nextChar(cm, curr); + + while (curr.line !== null) { + + if (curr.line === "" && !skip_empty_lines) { + if (last_valid.pos !== null) { + return last_valid; + } + else { + return { ln: curr.ln, pos: curr.pos }; + } + } + else if (isEndOfSentenceSymbol(curr.line[curr.pos]) + && last_valid.pos !== null + && !(curr.ln === last_valid.ln && curr.pos + 1 === last_valid.pos)) { + return last_valid; + } + else if (curr.line !== "" && !isWhiteSpaceString(curr.line[curr.pos])) { + skip_empty_lines = false; + last_valid = { ln: curr.ln, pos: curr.pos } + } + + nextChar(cm, curr); + } + + /* + Set the position to the first non whitespace character on the last + valid line in the case that we reach the beginning of the document. + */ + var line = cm.getLine(last_valid.ln); + last_valid.pos = 0; + for(var i = 0; i < line.length; ++i) { + if (!isWhiteSpaceString(line[i])) { + last_valid.pos = i; + break; + } + } + return last_valid; + } + + var curr_index = { + ln: cur.line, + pos: cur.ch, + }; + + while (repeat > 0) { + if (dir < 0) { + curr_index = reverse(cm, curr_index.ln, curr_index.pos, dir); + } + else { + curr_index = forward(cm, curr_index.ln, curr_index.pos, dir); + } + repeat--; + } + + return Pos(curr_index.ln, curr_index.pos); + } + // TODO: perhaps this finagling of start and end positions belonds // in codemirror/replaceRange? function selectCompanionObject(cm, head, symb, inclusive) { @@ -3552,8 +3734,8 @@ // cursor is on a matching open bracket. var offset = curChar === openSym ? 1 : 0; - start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, null, {'bracketRegex': bracketRegexp}); - end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, null, {'bracketRegex': bracketRegexp}); + start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, undefined, {'bracketRegex': bracketRegexp}); + end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, undefined, {'bracketRegex': bracketRegexp}); if (!start || !end) { return { start: cur, end: cur }; diff --git a/media/editors/codemirror/keymap/vim.min.js b/media/editors/codemirror/keymap/vim.min.js index 326f5a1c830c5..8e51b16aa438a 100644 --- a/media/editors/codemirror/keymap/vim.min.js +++ b/media/editors/codemirror/keymap/vim.min.js @@ -1,3 +1,3 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/dialog/dialog"),require("../addon/edit/matchbrackets.js")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/dialog/dialog","../addon/edit/matchbrackets"],a):a(CodeMirror)})((function(a){"use strict";var b=[{keys:"",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"",type:"keyToKey",toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0}},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:'"',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],c=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],d=a.Pos,e=function(){function e(b){b.setOption("disableInput",!0),b.setOption("showCursorWhenSelecting",!1),a.signal(b,"vim-mode-change",{mode:"normal"}),b.on("cursorActivity",hb),B(b),a.on(b.getInputField(),"paste",o(b))}function f(b){b.setOption("disableInput",!1),b.off("cursorActivity",hb),a.off(b.getInputField(),"paste",o(b)),b.state.vim=null}function g(b,c){this==a.keyMap.vim&&(a.rmClass(b.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==b.getOption("inputStyle")&&null!=document.body.style.caretColor&&(l(b),b.getInputField().style.caretColor="")),c&&c.attach==h||f(b)}function h(b,c){this==a.keyMap.vim&&(a.addClass(b.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==b.getOption("inputStyle")&&null!=document.body.style.caretColor&&(k(b),b.getInputField().style.caretColor="transparent")),c&&c.attach==h||e(b)}function i(a){for(var b=a.listSelections(),c=[],e=0;e")}function o(a){var b=a.state.vim;return b.onPasteFn||(b.onPasteFn=function(){b.insertMode||(a.setCursor(P(a.getCursor(),0,1)),Hb.enterInsertMode(a,{},b))}),b.onPasteFn}function p(a,b){for(var c=[],d=a;d=a.firstLine()&&b<=a.lastLine()}function r(a){return/^[a-z]$/.test(a)}function s(a){return"()[]{}".indexOf(a)!=-1}function t(a){return qb.test(a)}function u(a){return/^[A-Z]$/.test(a)}function v(a){return/^\s*$/.test(a)}function w(a,b){for(var c=0;c"==b.slice(-11)){var c=b.length-11,d=a.slice(0,c),e=b.slice(0,c);return d==e&&a.length>c?"full":0==e.indexOf(d)&&"partial"}return a==b?"full":0==b.indexOf(a)&&"partial"}function T(a){var b=/^.*(<[^>]+>)$/.exec(a),c=b?b[1]:a.slice(-1);if(c.length>1)switch(c){case"":c="\n";break;case"":c=" ";break;default:c=""}return c}function U(a,b,c){return function(){for(var d=0;d2&&(b=Y.apply(void 0,Array.prototype.slice.call(arguments,1))),X(a,b)?a:b}function Z(a,b){return arguments.length>2&&(b=Z.apply(void 0,Array.prototype.slice.call(arguments,1))),X(a,b)?b:a}function $(a,b,c){var d=X(a,b),e=X(b,c);return d&&e}function _(a,b){return a.getLine(b).length}function aa(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function ba(a){return a.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function ca(a,b,c){var e=_(a,b),f=new Array(c-e+1).join(" ");a.setCursor(d(b,e)),a.replaceRange(f,a.getCursor())}function da(a,b){var c=[],e=a.listSelections(),f=V(a.clipPos(b)),g=!W(b,f),h=a.getCursor("head"),i=fa(e,h),j=W(e[i].head,e[i].anchor),k=e.length-1,l=k-i>i?k:0,m=e[l].anchor,n=Math.min(m.line,f.line),o=Math.max(m.line,f.line),p=m.ch,q=f.ch,r=e[l].head.ch-p,s=q-p;r>0&&s<=0?(p++,g||q--):r<0&&s>=0?(p--,j||q++):r<0&&s==-1&&(p--,q++);for(var t=n;t<=o;t++){var u={anchor:new d(t,p),head:new d(t,q)};c.push(u)}return a.setSelections(c),b.ch=q,m.ch=p,m}function ea(a,b,c){for(var d=[],e=0;ej&&(f.line=j),f.ch=_(a,f.line)}return{ranges:[{anchor:g,head:f}],primary:0}}if("block"==c){for(var k=Math.min(g.line,f.line),l=Math.min(g.ch,f.ch),m=Math.max(g.line,f.line),n=Math.max(g.ch,f.ch)+1,o=m-k+1,p=f.line==k?0:o-1,q=[],r=0;r0&&f&&v(f);f=e.pop())c.line--,c.ch=0;f?(c.line--,c.ch=_(a,c.line)):c.ch=0}}function oa(a,b,c){b.ch=0,c.ch=0,c.line++}function pa(a){if(!a)return 0;var b=a.search(/\S/);return b==-1?a.length:b}function qa(a,b,c,e,f){for(var g=la(a),h=a.getLine(g.line),i=g.ch,j=f?rb[0]:sb[0];!j(h.charAt(i));)if(i++,i>=h.length)return null;e?j=sb[0]:(j=rb[0],j(h.charAt(i))||(j=rb[1]));for(var k=i,l=i;j(h.charAt(k))&&k=0;)l--;if(l++,b){for(var m=k;/\s/.test(h.charAt(k))&&k0;)l--;l||(l=n)}}return{start:d(g.line,l),end:d(g.line,k)}}function ra(a,b,c){W(b,c)||Bb.jumpList.add(a,b,c)}function sa(a,b){Bb.lastCharacterSearch.increment=a,Bb.lastCharacterSearch.forward=b.forward,Bb.lastCharacterSearch.selectedCharacter=b.selectedCharacter}function ta(a,b,c,e){var f=V(a.getCursor()),g=c?1:-1,h=c?a.lineCount():-1,i=f.ch,j=f.line,k=a.getLine(j),l={lineText:k,nextCh:k.charAt(i),lastCh:null,index:i,symb:e,reverseSymb:(c?{")":"(","}":"{"}:{"(":")","{":"}"})[e],forward:c,depth:0,curMoveThrough:!1},m=Ib[e];if(!m)return f;var n=Jb[m].init,o=Jb[m].isComplete;for(n&&n(l);j!==h&&b;){if(l.index+=g,l.nextCh=l.lineText.charAt(l.index),!l.nextCh){if(j+=g,l.lineText=a.getLine(j)||"",g>0)l.index=0;else{var p=l.lineText.length;l.index=p>0?p-1:0}l.nextCh=l.lineText.charAt(l.index)}o(l)&&(f.line=j,f.ch=l.index,b--)}return l.nextCh||l.curMoveThrough?d(j,l.index):f}function ua(a,b,c,d,e){var f=b.line,g=b.ch,h=a.getLine(f),i=c?1:-1,j=d?sb:rb;if(e&&""==h){if(f+=i,h=a.getLine(f),!q(a,f))return null;g=c?0:h.length}for(;;){if(e&&""==h)return{from:0,to:0,line:f};for(var k=i>0?h.length:-1,l=k,m=k;g!=k;){for(var n=!1,o=0;o0?0:h.length}}function va(a,b,c,e,f,g){var h=V(b),i=[];(e&&!f||!e&&f)&&c++;for(var j=!(e&&f),k=0;k0;)h(n,e)&&c--,n+=e;return new d(n,0)}var o=a.state.vim;if(o.visualLine&&h(k,1,!0)){var p=o.sel.anchor;h(p.line,-1,!0)&&(f&&p.line==k||(k+=1))}var q=g(k);for(n=k;n<=m&&c;n++)h(n,1,!0)&&(f&&g(n)==q||c--);for(j=new d(n,0),n>m&&!q?q=!0:f=!1,n=k;n>l&&(f&&g(n)!=q&&n!=k||!h(n,-1,!0));n--);return i=new d(n,0),{start:i,end:j}}function Ba(a,b,c,e){var f,g,h=b,i={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[c],j={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[c],k=a.getLine(h.line).charAt(h.ch),l=k===j?1:0;if(f=a.scanForBracket(d(h.line,h.ch+l),-1,null,{bracketRegex:i}),g=a.scanForBracket(d(h.line,h.ch+l),1,null,{bracketRegex:i}),!f||!g)return{start:h,end:h};if(f=f.pos,g=g.pos,f.line==g.line&&f.ch>g.ch||f.line>g.line){var m=f;f=g,g=m}return e?g.ch+=1:f.ch+=1,{start:f,end:g}}function Ca(a,b,c,e){var f,g,h,i,j=V(b),k=a.getLine(j.line),l=k.split(""),m=l.indexOf(c);if(j.ch-1&&!f;h--)l[h]==c&&(f=h+1);else f=j.ch+1;if(f&&!g)for(h=f,i=l.length;h'+b+"",{bottom:!0,duration:5e3}):alert(b)}function Pa(a,b){var c=''+(a||"")+'';return b&&(c+=' '+b+""),c}function Qa(a,b){var c=(b.prefix||"")+" "+(b.desc||""),d=Pa(b.prefix,b.desc);Fa(a,d,c,b.onClose,b)}function Ra(a,b){if(a instanceof RegExp&&b instanceof RegExp){for(var c=["global","multiline","ignoreCase","source"],d=0;d=b&&a<=c:a==b}function Ya(a){var b=a.getScrollInfo(),c=6,d=10,e=a.coordsChar({left:0,top:c+b.top},"local"),f=b.clientHeight-d+b.top,g=a.coordsChar({left:0,top:f},"local");return{top:e.line,bottom:g.line}}function Za(a,b,c){if("'"==c){var d=a.doc.history.done,e=d[d.length-2];return e&&e.ranges&&e.ranges[0].head}if("."==c){if(0==a.doc.history.lastModTime)return;var f=a.doc.history.done.filter((function(a){if(void 0!==a.changes)return a}));f.reverse();var g=f[0].changes[0].to;return g}var h=b.marks[c];return h&&h.find()}function $a(b,c,d,e,f,g,h,i,j){function k(){b.operation((function(){for(;!p;)l(),m();n()}))}function l(){var a=b.getRange(g.from(),g.to()),c=a.replace(h,i);g.replace(c)}function m(){for(;g.findNext()&&Xa(g.from(),e,f);)if(d||!q||g.from().line!=q.line)return b.scrollIntoView(g.from(),30),b.setSelection(g.from(),g.to()),q=g.from(),void(p=!1);p=!0}function n(a){if(a&&a(),b.focus(),q){b.setCursor(q);var c=b.state.vim;c.exMode=!1,c.lastHPos=c.lastHSPos=q.ch}j&&j()}function o(c,d,e){a.e_stop(c);var f=a.keyName(c);switch(f){case"Y":l(),m();break;case"N":m();break;case"A":var g=j;j=void 0, -b.operation(k),j=g;break;case"L":l();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":n(e)}return p&&n(e),!0}b.state.vim.exMode=!0;var p=!1,q=g.from();return m(),p?void Oa(b,"No matches for "+h.source):c?void Qa(b,{prefix:"replace with "+i+" (y/n/a/q/l)",onKeyDown:o}):(k(),void(j&&j()))}function _a(b){var c=b.state.vim,d=Bb.macroModeState,e=Bb.registerController.getRegister("."),f=d.isPlaying,g=d.lastInsertModeChanges,h=[];if(!f){for(var i=g.inVisualBlock&&c.lastSelection?c.lastSelection.visualBlock.height:1,j=g.changes,h=[],k=0;k1&&(mb(b,c,c.insertModeRepeat-1,!0),c.lastEditInputState.repeatOverride=c.insertModeRepeat),delete c.insertModeRepeat,c.insertMode=!1,b.setCursor(b.getCursor().line,b.getCursor().ch-1),b.setOption("keyMap","vim"),b.setOption("disableInput",!0),b.toggleOverwrite(!1),e.setText(g.changes.join("")),a.signal(b,"vim-mode-change",{mode:"normal"}),d.isRecording&&eb(d)}function ab(a){b.unshift(a)}function bb(a,b,c,d,e){var f={keys:a,type:b};f[b]=c,f[b+"Args"]=d;for(var g in e)f[g]=e[g];ab(f)}function cb(b,c,d,e){var f=Bb.registerController.getRegister(e);if(":"==e)return f.keyBuffer[0]&&Pb.processCommand(b,f.keyBuffer[0]),void(d.isPlaying=!1);var g=f.keyBuffer,h=0;d.isPlaying=!0,d.replaySearchQueries=f.searchQueries.slice(0);for(var i=0;i|<\w+>|./.exec(l),k=j[0],l=l.substring(j.index+k.length),a.Vim.handleKey(b,k,"macro"),c.insertMode){var m=f.insertModeChanges[h++].changes;Bb.macroModeState.lastInsertModeChanges.changes=m,nb(b,m,1),_a(b)}d.isPlaying=!1}function db(a,b){if(!a.isPlaying){var c=a.latestRegister,d=Bb.registerController.getRegister(c);d&&d.pushText(b)}}function eb(a){if(!a.isPlaying){var b=a.latestRegister,c=Bb.registerController.getRegister(b);c&&c.pushInsertModeChanges&&c.pushInsertModeChanges(a.lastInsertModeChanges)}}function fb(a,b){if(!a.isPlaying){var c=a.latestRegister,d=Bb.registerController.getRegister(c);d&&d.pushSearchQuery&&d.pushSearchQuery(b)}}function gb(a,b){var c=Bb.macroModeState,d=c.lastInsertModeChanges;if(!c.isPlaying)for(;b;){if(d.expectCursorActivityForChange=!0,"+input"==b.origin||"paste"==b.origin||void 0===b.origin){var e=b.text.join("\n");d.maybeReset&&(d.changes=[],d.maybeReset=!1),a.state.overwrite&&!/\n/.test(e)?d.changes.push([e]):d.changes.push(e)}b=b.next}}function hb(a){var b=a.state.vim;if(b.insertMode){var c=Bb.macroModeState;if(c.isPlaying)return;var d=c.lastInsertModeChanges;d.expectCursorActivityForChange?d.expectCursorActivityForChange=!1:d.maybeReset=!0}else a.curOp.isVimOp||jb(a,b);b.visualMode&&ib(a)}function ib(a){var b=a.state.vim,c=N(a,V(b.sel.head)),d=P(c,0,1);b.fakeCursor&&b.fakeCursor.clear(),b.fakeCursor=a.markText(c,d,{className:"cm-animate-fat-cursor"})}function jb(b,c){var d=b.getCursor("anchor"),e=b.getCursor("head");if(c.visualMode&&!b.somethingSelected()?ma(b,!1):c.visualMode||c.insertMode||!b.somethingSelected()||(c.visualMode=!0,c.visualLine=!1,a.signal(b,"vim-mode-change",{mode:"visual"})),c.visualMode){var f=X(e,d)?0:-1,g=X(e,d)?-1:0;e=P(e,0,f),d=P(d,0,g),c.sel={anchor:d,head:e},ya(b,c,"<",Y(e,d)),ya(b,c,">",Z(e,d))}else c.insertMode||(c.lastHPos=b.getCursor().ch)}function kb(a){this.keyName=a}function lb(b){function c(){return e.maybeReset&&(e.changes=[],e.maybeReset=!1),e.changes.push(new kb(f)),!0}var d=Bb.macroModeState,e=d.lastInsertModeChanges,f=a.keyName(b);f&&(f.indexOf("Delete")==-1&&f.indexOf("Backspace")==-1||a.lookupKey(f,"vim-insert",c))}function mb(a,b,c,d){function e(){h?Eb.processAction(a,b,b.lastEditActionCommand):Eb.evalInput(a,b)}function f(c){if(g.lastInsertModeChanges.changes.length>0){c=b.lastEditActionCommand?c:1;var d=g.lastInsertModeChanges;nb(a,d.changes,c)}}var g=Bb.macroModeState;g.isPlaying=!0;var h=!!b.lastEditActionCommand,i=b.inputState;if(b.inputState=b.lastEditInputState,h&&b.lastEditActionCommand.interlaceInsertRepeat)for(var j=0;j"]),xb=[].concat(tb,ub,vb,["-",'"',".",":","/"]),yb={};x("filetype",void 0,"string",["ft"],(function(a,b){if(void 0!==b){if(void 0===a){var c=b.getOption("mode");return"null"==c?"":c}var c=""==a?"null":a;b.setOption("mode",c)}}));var zb=function(){function a(a,b,h){function i(b){var e=++d%c,f=g[e];f&&f.clear(),g[e]=a.setBookmark(b)}var j=d%c,k=g[j];if(k){var l=k.find();l&&!W(l,b)&&i(b)}else i(b);i(h),e=d,f=d-c+1,f<0&&(f=0)}function b(a,b){d+=b,d>e?d=e:d0?1:-1,k=a.getCursor();do if(d+=j,h=g[(c+d)%c],h&&(i=h.find())&&!W(k,i))break;while(df)}return h}var c=100,d=-1,e=0,f=0,g=new Array(c);return{cachedCursor:void 0,add:a,move:b}},Ab=function(a){return a?{changes:a.changes,expectCursorActivityForChange:a.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};A.prototype={exitMacroRecordMode:function(){var a=Bb.macroModeState;a.onRecordingDone&&a.onRecordingDone(),a.onRecordingDone=void 0,a.isRecording=!1},enterMacroRecordMode:function(a,b){var c=Bb.registerController.getRegister(b);c&&(c.clear(),this.latestRegister=b,a.openDialog&&(this.onRecordingDone=a.openDialog("(recording)["+b+"]",null,{bottom:!0})),this.isRecording=!0)}};var Bb,Cb,Db={buildKeyMap:function(){},getRegisterController:function(){return Bb.registerController},resetVimGlobalState_:C,getVimGlobalState_:function(){return Bb},maybeInitVimState_:B,suppressErrorLogging:!1,InsertModeKey:kb,map:function(a,b,c){Pb.map(a,b,c)},unmap:function(a,b){Pb.unmap(a,b)},setOption:y,getOption:z,defineOption:x,defineEx:function(a,b,c){if(b){if(0!==a.indexOf(b))throw new Error('(Vim.defineEx) "'+b+'" is not a prefix of "'+a+'", command not registered')}else b=a;Ob[a]=c,Pb.commandMap_[b]={name:a,shortName:b,type:"api"}},handleKey:function(a,b,c){var d=this.findKey(a,b,c);if("function"==typeof d)return d()},findKey:function(c,d,e){function f(){var a=Bb.macroModeState;if(a.isRecording){if("q"==d)return a.exitMacroRecordMode(),E(c),!0;"mapping"!=e&&db(a,d)}}function g(){if(""==d)return E(c),l.visualMode?ma(c):l.insertMode&&_a(c),!0}function h(b){for(var e;b;)e=/<\w+-.+?>|<\w+>|./.exec(b),d=e[0],b=b.substring(e.index+d.length),a.Vim.handleKey(c,d,"mapping")}function i(){if(g())return!0;for(var a=l.inputState.keyBuffer=l.inputState.keyBuffer+d,e=1==d.length,f=Eb.matchCommand(a,b,l.inputState,"insert");a.length>1&&"full"!=f.type;){var a=l.inputState.keyBuffer=a.slice(1),h=Eb.matchCommand(a,b,l.inputState,"insert");"none"!=h.type&&(f=h)}if("none"==f.type)return E(c),!1;if("partial"==f.type)return Cb&&window.clearTimeout(Cb),Cb=window.setTimeout((function(){l.insertMode&&l.inputState.keyBuffer&&E(c)}),z("insertModeEscKeysTimeout")),!e;if(Cb&&window.clearTimeout(Cb),e){for(var i=c.listSelections(),j=0;j0||this.motionRepeat.length>0)&&(a=1,this.prefixRepeat.length>0&&(a*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(a*=parseInt(this.motionRepeat.join(""),10))),a},F.prototype={setText:function(a,b,c){this.keyBuffer=[a||""],this.linewise=!!b,this.blockwise=!!c},pushText:function(a,b){b&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(a)},pushInsertModeChanges:function(a){this.insertModeChanges.push(Ab(a))},pushSearchQuery:function(a){this.searchQueries.push(a)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},H.prototype={pushText:function(a,b,c,d,e){d&&"\n"!==c.charAt(c.length-1)&&(c+="\n");var f=this.isValidRegister(a)?this.getRegister(a):null;if(!f){switch(b){case"yank":this.registers[0]=new F(c,d,e);break;case"delete":case"change":c.indexOf("\n")==-1?this.registers["-"]=new F(c,d):(this.shiftNumericRegisters_(),this.registers[1]=new F(c,d))}return void this.unnamedRegister.setText(c,d,e)}var g=u(a);g?f.pushText(c,d):f.setText(c,d,e),this.unnamedRegister.setText(f.toString(),d)},getRegister:function(a){return this.isValidRegister(a)?(a=a.toLowerCase(),this.registers[a]||(this.registers[a]=new F),this.registers[a]):this.unnamedRegister},isValidRegister:function(a){return a&&w(a,xb)},shiftNumericRegisters_:function(){for(var a=9;a>=2;a--)this.registers[a]=this.getRegister(""+(a-1))}},I.prototype={nextMatch:function(a,b){var c=this.historyBuffer,d=b?-1:1;null===this.initialPrefix&&(this.initialPrefix=a);for(var e=this.iterator+d;b?e>=0:e=c.length?(this.iterator=c.length,this.initialPrefix):e<0?a:void 0},pushInput:function(a){var b=this.historyBuffer.indexOf(a);b>-1&&this.historyBuffer.splice(b,1),a.length&&this.historyBuffer.push(a)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var Eb={matchCommand:function(a,b,c,d){var e=R(a,b,d,c);if(!e.full&&!e.partial)return{type:"none"};if(!e.full&&e.partial)return{type:"partial"};for(var f,g=0;g"==f.keys.slice(-11)){var i=T(a);if(!i)return{type:"none"};c.selectedCharacter=i}return{type:"full",command:f}},processCommand:function(a,b,c){switch(b.inputState.repeatOverride=c.repeatOverride,c.type){case"motion":this.processMotion(a,b,c);break;case"operator":this.processOperator(a,b,c);break;case"operatorMotion":this.processOperatorMotion(a,b,c);break;case"action":this.processAction(a,b,c);break;case"search":this.processSearch(a,b,c);break;case"ex":case"keyToEx":this.processEx(a,b,c)}},processMotion:function(a,b,c){b.inputState.motion=c.motion,b.inputState.motionArgs=O(c.motionArgs),this.evalInput(a,b)},processOperator:function(a,b,c){var d=b.inputState;if(d.operator){if(d.operator==c.operator)return d.motion="expandToLine",d.motionArgs={linewise:!0},void this.evalInput(a,b);E(a)}d.operator=c.operator,d.operatorArgs=O(c.operatorArgs),b.visualMode&&this.evalInput(a,b)},processOperatorMotion:function(a,b,c){var d=b.visualMode,e=O(c.operatorMotionArgs);e&&d&&e.visualLine&&(b.visualLine=!0),this.processOperator(a,b,c),d||this.processMotion(a,b,c)},processAction:function(a,b,c){var d=b.inputState,e=d.getRepeat(),f=!!e,g=O(c.actionArgs)||{};d.selectedCharacter&&(g.selectedCharacter=d.selectedCharacter),c.operator&&this.processOperator(a,b,c),c.motion&&this.processMotion(a,b,c),(c.motion||c.operator)&&this.evalInput(a,b),g.repeat=e||1,g.repeatIsExplicit=f,g.registerName=d.registerName,E(a),b.lastMotion=null,c.isEdit&&this.recordLastEdit(b,d,c),Hb[c.action](a,g,b)},processSearch:function(b,c,d){function e(a,e,f){Bb.searchHistoryController.pushInput(a),Bb.searchHistoryController.reset();try{Sa(b,a,e,f)}catch(c){return Oa(b,"Invalid regex: "+a),void E(b)}Eb.processMotion(b,c,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:d.searchArgs.toJumplist}})}function f(a){b.scrollTo(m.left,m.top),e(a,!0,!0);var c=Bb.macroModeState;c.isRecording&&fb(c,a)}function g(c,d,e){var f,g,h=a.keyName(c);"Up"==h||"Down"==h?(f="Up"==h,g=c.target?c.target.selectionEnd:0,d=Bb.searchHistoryController.nextMatch(d,f)||"",e(d),g&&c.target&&(c.target.selectionEnd=c.target.selectionStart=Math.min(g,c.target.value.length))):"Left"!=h&&"Right"!=h&&"Ctrl"!=h&&"Alt"!=h&&"Shift"!=h&&Bb.searchHistoryController.reset();var j;try{j=Sa(b,d,!0,!0)}catch(a){}j?b.scrollIntoView(Va(b,!i,j),30):(Wa(b),b.scrollTo(m.left,m.top))}function h(c,d,e){var f=a.keyName(c);"Esc"==f||"Ctrl-C"==f||"Ctrl-["==f||"Backspace"==f&&""==d?(Bb.searchHistoryController.pushInput(d),Bb.searchHistoryController.reset(),Sa(b,l),Wa(b),b.scrollTo(m.left,m.top),a.e_stop(c),E(b),e(),b.focus()):"Up"==f||"Down"==f?a.e_stop(c):"Ctrl-U"==f&&(a.e_stop(c),e(""))}if(b.getSearchCursor){var i=d.searchArgs.forward,j=d.searchArgs.wholeWordOnly;Ea(b).setReversed(!i);var k=i?"/":"?",l=Ea(b).getQuery(),m=b.getScrollInfo();switch(d.searchArgs.querySrc){case"prompt":var n=Bb.macroModeState;if(n.isPlaying){var o=n.replaySearchQueries.shift();e(o,!0,!1)}else Qa(b,{onClose:f,prefix:k,desc:Mb,onKeyUp:g,onKeyDown:h});break;case"wordUnderCursor":var p=qa(b,!1,!0,!1,!0),q=!0;if(p||(p=qa(b,!1,!0,!1,!1),q=!1),!p)return;var o=b.getLine(p.start.line).substring(p.start.ch,p.end.ch);o=q&&j?"\\b"+o+"\\b":ba(o),Bb.jumpList.cachedCursor=b.getCursor(),b.setCursor(p.start),e(o,!0,!1)}}},processEx:function(b,c,d){function e(a){Bb.exCommandHistoryController.pushInput(a),Bb.exCommandHistoryController.reset(),Pb.processCommand(b,a)}function f(c,d,e){var f,g,h=a.keyName(c);("Esc"==h||"Ctrl-C"==h||"Ctrl-["==h||"Backspace"==h&&""==d)&&(Bb.exCommandHistoryController.pushInput(d),Bb.exCommandHistoryController.reset(),a.e_stop(c),E(b),e(),b.focus()),"Up"==h||"Down"==h?(a.e_stop(c),f="Up"==h,g=c.target?c.target.selectionEnd:0,d=Bb.exCommandHistoryController.nextMatch(d,f)||"",e(d),g&&c.target&&(c.target.selectionEnd=c.target.selectionStart=Math.min(g,c.target.value.length))):"Ctrl-U"==h?(a.e_stop(c),e("")):"Left"!=h&&"Right"!=h&&"Ctrl"!=h&&"Alt"!=h&&"Shift"!=h&&Bb.exCommandHistoryController.reset()}"keyToEx"==d.type?Pb.processCommand(b,d.exArgs.input):c.visualMode?Qa(b,{onClose:e,prefix:":",value:"'<,'>",onKeyDown:f,selectValueOnOpen:!1}):Qa(b,{onClose:e,prefix:":",onKeyDown:f})},evalInput:function(a,b){var c,e,f,g=b.inputState,h=g.motion,i=g.motionArgs||{},j=g.operator,k=g.operatorArgs||{},l=g.registerName,m=b.sel,n=V(b.visualMode?N(a,m.head):a.getCursor("head")),o=V(b.visualMode?N(a,m.anchor):a.getCursor("anchor")),p=V(n),q=V(o);if(j&&this.recordLastEdit(b,g),f=void 0!==g.repeatOverride?g.repeatOverride:g.getRepeat(),f>0&&i.explicitRepeat?i.repeatIsExplicit=!0:(i.noRepeat||!i.explicitRepeat&&0===f)&&(f=1,i.repeatIsExplicit=!1),g.selectedCharacter&&(i.selectedCharacter=k.selectedCharacter=g.selectedCharacter),i.repeat=f,E(a),h){var r=Fb[h](a,n,i,b);if(b.lastMotion=Fb[h],!r)return;if(i.toJumplist){var s=Bb.jumpList,t=s.cachedCursor;t?(ra(a,t,r),delete s.cachedCursor):ra(a,n,r)}r instanceof Array?(e=r[0],c=r[1]):c=r,c||(c=V(n)),b.visualMode?(b.visualBlock&&c.ch===1/0||(c=N(a,c,b.visualBlock)),e&&(e=N(a,e,!0)),e=e||q,m.anchor=e,m.head=c,ja(a),ya(a,b,"<",X(e,c)?e:c),ya(a,b,">",X(e,c)?c:e)):j||(c=N(a,c),a.setCursor(c.line,c.ch))}if(j){if(k.lastSel){e=q;var u=k.lastSel,v=Math.abs(u.head.line-u.anchor.line),w=Math.abs(u.head.ch-u.anchor.ch);c=u.visualLine?d(q.line+v,q.ch):u.visualBlock?d(q.line+v,q.ch+w):u.head.line==u.anchor.line?d(q.line,q.ch+w):d(q.line+v,q.ch),b.visualMode=!0,b.visualLine=u.visualLine,b.visualBlock=u.visualBlock,m=b.sel={anchor:e,head:c},ja(a)}else b.visualMode&&(k.lastSel={anchor:V(m.anchor),head:V(m.head),visualBlock:b.visualBlock,visualLine:b.visualLine});var x,y,z,A,B;if(b.visualMode){if(x=Y(m.head,m.anchor),y=Z(m.head,m.anchor),z=b.visualLine||k.linewise,A=b.visualBlock?"block":z?"line":"char",B=ka(a,{anchor:x,head:y},A),z){var C=B.ranges;if("block"==A)for(var D=0;Dk&&f.line==k?this.moveToEol(a,b,c,e):(c.toFirstChar&&(g=pa(a.getLine(i)),e.lastHPos=g),e.lastHSPos=a.charCoords(d(i,g),"div").left,d(i,g))},moveByDisplayLines:function(a,b,c,e){var f=b;switch(e.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:e.lastHSPos=a.charCoords(f,"div").left}var g=c.repeat,h=a.findPosV(f,c.forward?g:-g,"line",e.lastHSPos);if(h.hitSide)if(c.forward)var i=a.charCoords(h,"div"),j={top:i.top+8,left:e.lastHSPos},h=a.coordsChar(j,"div");else{var k=a.charCoords(d(a.firstLine(),0),"div");k.left=e.lastHSPos,h=a.coordsChar(k,"div")}return e.lastHPos=h.ch,h},moveByPage:function(a,b,c){var d=b,e=c.repeat;return a.findPosV(d,c.forward?e:-e,"page")},moveByParagraph:function(a,b,c){var d=c.forward?1:-1;return Aa(a,b,c.repeat,d)},moveByScroll:function(a,b,c,d){var e=a.getScrollInfo(),f=null,g=c.repeat;g||(g=e.clientHeight/(2*a.defaultTextHeight()));var h=a.charCoords(b,"local");c.repeat=g;var f=Fb.moveByDisplayLines(a,b,c,d);if(!f)return null;var i=a.charCoords(f,"local");return a.scrollTo(null,e.top+i.top-h.top),f},moveByWords:function(a,b,c){return va(a,b,c.repeat,!!c.forward,!!c.wordEnd,!!c.bigWord)},moveTillCharacter:function(a,b,c){var d=c.repeat,e=wa(a,d,c.forward,c.selectedCharacter),f=c.forward?-1:1;return sa(f,c),e?(e.ch+=f,e):null},moveToCharacter:function(a,b,c){var d=c.repeat;return sa(0,c),wa(a,d,c.forward,c.selectedCharacter)||b},moveToSymbol:function(a,b,c){var d=c.repeat;return ta(a,d,c.forward,c.selectedCharacter)||b},moveToColumn:function(a,b,c,d){var e=c.repeat;return d.lastHPos=e-1,d.lastHSPos=a.charCoords(b,"div").left,xa(a,e)},moveToEol:function(a,b,c,e){var f=b;e.lastHPos=1/0;var g=d(f.line+c.repeat-1,1/0),h=a.clipPos(g);return h.ch--,e.lastHSPos=a.charCoords(h,"div").left,g},moveToFirstNonWhiteSpaceCharacter:function(a,b){var c=b;return d(c.line,pa(a.getLine(c.line)))},moveToMatchedSymbol:function(a,b){for(var c,e=b,f=e.line,g=e.ch,h=a.getLine(f);gb.lastLine()&&c.linewise&&!o?b.replaceRange("",n,k):b.replaceRange("",j,k),c.linewise&&(o||(b.setCursor(n),a.commands.newlineAndIndent(b)),j.ch=Number.MAX_VALUE),f=j}Bb.registerController.pushText(c.registerName,"change",g,c.linewise,e.length>1),Hb.enterInsertMode(b,{head:f},b.state.vim)},delete:function(a,b,c){var e,f,g=a.state.vim;if(g.visualBlock){f=a.getSelection();var h=K("",c.length);a.replaceSelections(h),e=c[0].anchor}else{var i=c[0].anchor,j=c[0].head;b.linewise&&j.line!=a.firstLine()&&i.line==a.lastLine()&&i.line==j.line-1&&(i.line==a.firstLine()?i.ch=0:i=d(i.line-1,_(a,i.line-1))),f=a.getRange(i,j),a.replaceRange("",i,j),e=i,b.linewise&&(e=Fb.moveToFirstNonWhiteSpaceCharacter(a,i))}Bb.registerController.pushText(b.registerName,"delete",f,b.linewise,g.visualBlock);var k=g.insertMode;return N(a,e,k)},indent:function(a,b,c){var d=a.state.vim,e=c[0].anchor.line,f=d.visualBlock?c[c.length-1].anchor.line:c[0].head.line,g=d.visualMode?b.repeat:1;b.linewise&&f--;for(var h=e;h<=f;h++)for(var i=0;ij.top?(i.line+=(h-j.top)/e,i.line=Math.ceil(i.line),a.setCursor(i),j=a.charCoords(i,"local"),a.scrollTo(null,j.top)):a.scrollTo(null,h);else{var k=h+a.getScrollInfo().clientHeight;k=g.anchor.line?P(g.head,0,1):d(g.anchor.line,0);else if("inplace"==f&&e.visualMode)return;b.setOption("disableInput",!1),c&&c.replace?(b.toggleOverwrite(!0),b.setOption("keyMap","vim-replace"),a.signal(b,"vim-mode-change",{mode:"replace"})):(b.toggleOverwrite(!1),b.setOption("keyMap","vim-insert"),a.signal(b,"vim-mode-change",{mode:"insert"})),Bb.macroModeState.isPlaying||(b.on("change",gb),a.on(b.getInputField(),"keydown",lb)),e.visualMode&&ma(b),ea(b,h,i)}},toggleVisualMode:function(b,c,e){var f,g=c.repeat,h=b.getCursor();e.visualMode?e.visualLine^c.linewise||e.visualBlock^c.blockwise?(e.visualLine=!!c.linewise,e.visualBlock=!!c.blockwise,a.signal(b,"vim-mode-change",{mode:"visual",subMode:e.visualLine?"linewise":e.visualBlock?"blockwise":""}),ja(b)):ma(b):(e.visualMode=!0,e.visualLine=!!c.linewise,e.visualBlock=!!c.blockwise,f=N(b,d(h.line,h.ch+g-1),!0),e.sel={anchor:h,head:f},a.signal(b,"vim-mode-change",{mode:"visual",subMode:e.visualLine?"linewise":e.visualBlock?"blockwise":""}),ja(b),ya(b,e,"<",Y(h,f)),ya(b,e,">",Z(h,f)))},reselectLastSelection:function(b,c,d){var e=d.lastSelection;if(d.visualMode&&ha(b,d),e){var f=e.anchorMark.find(),g=e.headMark.find();if(!f||!g)return;d.sel={anchor:f,head:g},d.visualMode=!0,d.visualLine=e.visualLine,d.visualBlock=e.visualBlock,ja(b),ya(b,d,"<",Y(f,g)),ya(b,d,">",Z(f,g)),a.signal(b,"vim-mode-change",{mode:"visual",subMode:d.visualLine?"linewise":d.visualBlock?"blockwise":""})}},joinLines:function(a,b,c){var e,f;if(c.visualMode){if(e=a.getCursor("anchor"),f=a.getCursor("head"),X(f,e)){var g=f;f=e,e=g}f.ch=_(a,f.line)-1}else{var h=Math.max(b.repeat,2);e=a.getCursor(),f=N(a,d(e.line+h-1,1/0))}for(var i=0,j=e.line;j1)var g=Array(b.repeat+1).join(g);var o=f.linewise,p=f.blockwise;if(o)c.visualMode?g=c.visualLine?g.slice(0,-1):"\n"+g.slice(0,g.length-1)+"\n":b.after?(g="\n"+g.slice(0,g.length-1),e.ch=_(a,e.line)):e.ch=0;else{if(p){g=g.split("\n");for(var q=0;qa.lastLine()&&a.replaceRange("\n",d(A,0));var B=_(a,A);Bk.length&&(f=k.length),g=d(i.line,f)}if("\n"==h)e.visualMode||b.replaceRange("",i,g),(a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent)(b);else{var l=b.getRange(i,g);if(l=l.replace(/[^\n]/g,h),e.visualBlock){var m=new Array(b.getOption("tabSize")+1).join(" ");l=b.getSelection(),l=l.replace(/\t/g,m).replace(/[^\n]/g,h).split("\n"),b.replaceSelections(l)}else b.replaceRange(l,i,g);e.visualMode?(i=X(j[0].anchor,j[0].head)?j[0].anchor:j[0].head,b.setCursor(i),ma(b,!1)):b.setCursor(P(g,0,-1))}},incrementNumberToken:function(a,b){for(var c,e,f,g,h=a.getCursor(),i=a.getLine(h.line),j=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(c=j.exec(i))&&(e=c.index,f=e+c[0].length,!(h.ch=1)return!0}else a.nextCh===a.reverseSymb&&a.depth--;return!1}},section:{init:function(a){a.curMoveThrough=!0,a.symb=(a.forward?"]":"[")===a.symb?"{":"}"},isComplete:function(a){return 0===a.index&&a.nextCh===a.symb}},comment:{isComplete:function(a){var b="*"===a.lastCh&&"/"===a.nextCh;return a.lastCh=a.nextCh,b}},method:{init:function(a){a.symb="m"===a.symb?"{":"}",a.reverseSymb="{"===a.symb?"}":"{"},isComplete:function(a){return a.nextCh===a.symb}},preprocess:{init:function(a){a.index=0},isComplete:function(a){if("#"===a.nextCh){var b=a.lineText.match(/#(\w+)/)[1];if("endif"===b){if(a.forward&&0===a.depth)return!0;a.depth++}else if("if"===b){if(!a.forward&&0===a.depth)return!0;a.depth--}if("else"===b&&0===a.depth)return!0}return!1}}};x("pcre",!0,"boolean"),Da.prototype={getQuery:function(){return Bb.query},setQuery:function(a){Bb.query=a},getOverlay:function(){return this.searchOverlay},setOverlay:function(a){this.searchOverlay=a},isReversed:function(){return Bb.isReversed},setReversed:function(a){Bb.isReversed=a},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(a){this.annotate=a}};var Kb={"\\n":"\n","\\r":"\r","\\t":"\t"},Lb={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"},Mb="(Javascript regexp)",Nb=function(){this.buildCommandMap_()};Nb.prototype={processCommand:function(a,b,c){var d=this;a.operation((function(){a.curOp.isVimOp=!0,d._processCommand(a,b,c)}))},_processCommand:function(b,c,d){var e=b.state.vim,f=Bb.registerController.getRegister(":"),g=f.toString();e.visualMode&&ma(b);var h=new a.StringStream(c);f.setText(c);var i=d||{};i.input=c;try{this.parseInput_(b,h,i)}catch(a){throw Oa(b,a),a}var j,k;if(i.commandName){if(j=this.matchCommand_(i.commandName)){if(k=j.name,j.excludeFromCommandHistory&&f.setText(g),this.parseCommandArgs_(h,i,j),"exToKey"==j.type){for(var l=0;l0;b--){var c=a.substring(0,b);if(this.commandMap_[c]){var d=this.commandMap_[c];if(0===d.name.indexOf(a))return d}}return null},buildCommandMap_:function(){this.commandMap_={};for(var a=0;a
";if(c){var f;c=c.join("");for(var g=0;g"}}else for(var f in d){var i=d[f].toString();i.length&&(e+='"'+f+" "+i+"
")}Oa(a,e)},sort:function(b,c){function e(){if(c.argString){var b=new a.StringStream(c.argString);if(b.eat("!")&&(h=!0),b.eol())return;if(!b.eatSpace())return"Invalid arguments";var d=b.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!d&&!b.eol())return"Invalid arguments";if(d[1]){i=d[1].indexOf("i")!=-1,j=d[1].indexOf("u")!=-1;var e=d[1].indexOf("d")!=-1||d[1].indexOf("n")!=-1&&1,f=d[1].indexOf("x")!=-1&&1,g=d[1].indexOf("o")!=-1&&1;if(e+f+g>1)return"Invalid arguments";k=e&&"decimal"||f&&"hex"||g&&"octal"}d[2]&&(l=new RegExp(d[2].substr(1,d[2].length-2),i?"i":""))}}function f(a,b){if(h){var c;c=a,a=b,b=c}i&&(a=a.toLowerCase(),b=b.toLowerCase());var d=k&&s.exec(a),e=k&&s.exec(b);return d?(d=parseInt((d[1]+d[2]).toLowerCase(),t),e=parseInt((e[1]+e[2]).toLowerCase(),t),d-e):a")}if(!d)return void Oa(a,k);var n=0,o=function(){if(n=k)return void Oa(b,"Invalid argument: "+c.argString.substring(f));for(var l=0;l<=k-j;l++){var m=String.fromCharCode(j+l);delete d.marks[m]}}else delete d.marks[g]}}},Pb=new Nb;return a.keyMap.vim={attach:h,detach:g,call:m},x("insertModeEscKeysTimeout",200,"number"),a.keyMap["vim-insert"]={fallthrough:["default"],attach:h,detach:g,call:m},a.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:h,detach:g,call:m},C(),Db};a.Vim=e()})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/dialog/dialog"),require("../addon/edit/matchbrackets.js")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/dialog/dialog","../addon/edit/matchbrackets"],a):a(CodeMirror)})((function(a){"use strict";var b=[{keys:"",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"",type:"keyToKey",toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0}},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:'"',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],c=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],d=a.Pos,e=function(){function e(b){b.setOption("disableInput",!0),b.setOption("showCursorWhenSelecting",!1),a.signal(b,"vim-mode-change",{mode:"normal"}),b.on("cursorActivity",jb),C(b),a.on(b.getInputField(),"paste",o(b))}function f(b){b.setOption("disableInput",!1),b.off("cursorActivity",jb),a.off(b.getInputField(),"paste",o(b)),b.state.vim=null}function g(b,c){this==a.keyMap.vim&&(a.rmClass(b.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==b.getOption("inputStyle")&&null!=document.body.style.caretColor&&(l(b),b.getInputField().style.caretColor="")),c&&c.attach==h||f(b)}function h(b,c){this==a.keyMap.vim&&(a.addClass(b.getWrapperElement(),"cm-fat-cursor"),"contenteditable"==b.getOption("inputStyle")&&null!=document.body.style.caretColor&&(k(b),b.getInputField().style.caretColor="transparent")),c&&c.attach==h||e(b)}function i(a){for(var b=a.listSelections(),c=[],e=0;e")}function o(a){var b=a.state.vim;return b.onPasteFn||(b.onPasteFn=function(){b.insertMode||(a.setCursor(Q(a.getCursor(),0,1)),Jb.enterInsertMode(a,{},b))}),b.onPasteFn}function p(a,b){for(var c=[],d=a;d=a.firstLine()&&b<=a.lastLine()}function r(a){return/^[a-z]$/.test(a)}function s(a){return"()[]{}".indexOf(a)!=-1}function t(a){return sb.test(a)}function u(a){return/^[A-Z]$/.test(a)}function v(a){return/^\s*$/.test(a)}function w(a){return".?!".indexOf(a)!=-1}function x(a,b){for(var c=0;c"==b.slice(-11)){var c=b.length-11,d=a.slice(0,c),e=b.slice(0,c);return d==e&&a.length>c?"full":0==e.indexOf(d)&&"partial"}return a==b?"full":0==b.indexOf(a)&&"partial"}function U(a){var b=/^.*(<[^>]+>)$/.exec(a),c=b?b[1]:a.slice(-1);if(c.length>1)switch(c){case"":c="\n";break;case"":c=" ";break;default:c=""}return c}function V(a,b,c){return function(){for(var d=0;d2&&(b=Z.apply(void 0,Array.prototype.slice.call(arguments,1))),Y(a,b)?a:b}function $(a,b){return arguments.length>2&&(b=$.apply(void 0,Array.prototype.slice.call(arguments,1))),Y(a,b)?b:a}function _(a,b,c){var d=Y(a,b),e=Y(b,c);return d&&e}function aa(a,b){return a.getLine(b).length}function ba(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function ca(a){return a.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function da(a,b,c){var e=aa(a,b),f=new Array(c-e+1).join(" ");a.setCursor(d(b,e)),a.replaceRange(f,a.getCursor())}function ea(a,b){var c=[],e=a.listSelections(),f=W(a.clipPos(b)),g=!X(b,f),h=a.getCursor("head"),i=ga(e,h),j=X(e[i].head,e[i].anchor),k=e.length-1,l=k-i>i?k:0,m=e[l].anchor,n=Math.min(m.line,f.line),o=Math.max(m.line,f.line),p=m.ch,q=f.ch,r=e[l].head.ch-p,s=q-p;r>0&&s<=0?(p++,g||q--):r<0&&s>=0?(p--,j||q++):r<0&&s==-1&&(p--,q++);for(var t=n;t<=o;t++){var u={anchor:new d(t,p),head:new d(t,q)};c.push(u)}return a.setSelections(c),b.ch=q,m.ch=p,m}function fa(a,b,c){for(var d=[],e=0;ej&&(f.line=j),f.ch=aa(a,f.line)}return{ranges:[{anchor:g,head:f}],primary:0}}if("block"==c){for(var k=Math.min(g.line,f.line),l=Math.min(g.ch,f.ch),m=Math.max(g.line,f.line),n=Math.max(g.ch,f.ch)+1,o=m-k+1,p=f.line==k?0:o-1,q=[],r=0;r0&&f&&v(f);f=e.pop())c.line--,c.ch=0;f?(c.line--,c.ch=aa(a,c.line)):c.ch=0}}function pa(a,b,c){b.ch=0,c.ch=0,c.line++}function qa(a){if(!a)return 0;var b=a.search(/\S/);return b==-1?a.length:b}function ra(a,b,c,e,f){for(var g=ma(a),h=a.getLine(g.line),i=g.ch,j=f?tb[0]:ub[0];!j(h.charAt(i));)if(i++,i>=h.length)return null;e?j=ub[0]:(j=tb[0],j(h.charAt(i))||(j=tb[1]));for(var k=i,l=i;j(h.charAt(k))&&k=0;)l--;if(l++,b){for(var m=k;/\s/.test(h.charAt(k))&&k0;)l--;l||(l=n)}}return{start:d(g.line,l),end:d(g.line,k)}}function sa(a,b,c){X(b,c)||Db.jumpList.add(a,b,c)}function ta(a,b){Db.lastCharacterSearch.increment=a,Db.lastCharacterSearch.forward=b.forward,Db.lastCharacterSearch.selectedCharacter=b.selectedCharacter}function ua(a,b,c,e){var f=W(a.getCursor()),g=c?1:-1,h=c?a.lineCount():-1,i=f.ch,j=f.line,k=a.getLine(j),l={lineText:k,nextCh:k.charAt(i),lastCh:null,index:i,symb:e,reverseSymb:(c?{")":"(","}":"{"}:{"(":")","{":"}"})[e],forward:c,depth:0,curMoveThrough:!1},m=Kb[e];if(!m)return f;var n=Lb[m].init,o=Lb[m].isComplete;for(n&&n(l);j!==h&&b;){if(l.index+=g,l.nextCh=l.lineText.charAt(l.index),!l.nextCh){if(j+=g,l.lineText=a.getLine(j)||"",g>0)l.index=0;else{var p=l.lineText.length;l.index=p>0?p-1:0}l.nextCh=l.lineText.charAt(l.index)}o(l)&&(f.line=j,f.ch=l.index,b--)}return l.nextCh||l.curMoveThrough?d(j,l.index):f}function va(a,b,c,d,e){var f=b.line,g=b.ch,h=a.getLine(f),i=c?1:-1,j=d?ub:tb;if(e&&""==h){if(f+=i,h=a.getLine(f),!q(a,f))return null;g=c?0:h.length}for(;;){if(e&&""==h)return{from:0,to:0,line:f};for(var k=i>0?h.length:-1,l=k,m=k;g!=k;){for(var n=!1,o=0;o0?0:h.length}}function wa(a,b,c,e,f,g){var h=W(b),i=[];(e&&!f||!e&&f)&&c++;for(var j=!(e&&f),k=0;k0;)h(n,e)&&c--,n+=e;return new d(n,0)}var o=a.state.vim;if(o.visualLine&&h(k,1,!0)){var p=o.sel.anchor;h(p.line,-1,!0)&&(f&&p.line==k||(k+=1))}var q=g(k);for(n=k;n<=m&&c;n++)h(n,1,!0)&&(f&&g(n)==q||c--);for(j=new d(n,0),n>m&&!q?q=!0:f=!1,n=k;n>l&&(f&&g(n)!=q&&n!=k||!h(n,-1,!0));n--);return i=new d(n,0),{start:i,end:j}}function Ca(a,b,c,e){function f(a,b){if(b.pos+b.dir<0||b.pos+b.dir>=b.line.length){if(b.ln+=b.dir,!q(a,b.ln))return b.line=null,b.ln=null,void(b.pos=null);b.line=a.getLine(b.ln),b.pos=b.dir>0?0:b.line.length-1}else b.pos+=b.dir}function g(a,b,c,d){var e=a.getLine(b),g=""===e,h={line:e,ln:b,pos:c,dir:d},i={ln:h.ln,pos:h.pos},j=""===h.line;for(f(a,h);null!==h.line;){if(i.ln=h.ln,i.pos=h.pos,""===h.line&&!j)return{ln:h.ln,pos:h.pos};if(g&&""!==h.line&&!v(h.line[h.pos]))return{ln:h.ln,pos:h.pos};!w(h.line[h.pos])||g||h.pos!==h.line.length-1&&!v(h.line[h.pos+1])||(g=!0),f(a,h)}var e=a.getLine(i.ln);i.pos=0;for(var k=e.length-1;k>=0;--k)if(!v(e[k])){i.pos=k;break}return i}function h(a,b,c,d){var e=a.getLine(b),g={line:e,ln:b,pos:c,dir:d},h={ln:g.ln,pos:null},i=""===g.line;for(f(a,g);null!==g.line;){if(""===g.line&&!i)return null!==h.pos?h:{ln:g.ln,pos:g.pos};if(w(g.line[g.pos])&&null!==h.pos&&(g.ln!==h.ln||g.pos+1!==h.pos))return h;""===g.line||v(g.line[g.pos])||(i=!1,h={ln:g.ln,pos:g.pos}),f(a,g)}var e=a.getLine(h.ln);h.pos=0;for(var j=0;j0;)i=e<0?h(a,i.ln,i.pos,e):g(a,i.ln,i.pos,e),c--;return d(i.ln,i.pos)}function Da(a,b,c,e){var f,g,h=b,i={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[c],j={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[c],k=a.getLine(h.line).charAt(h.ch),l=k===j?1:0;if(f=a.scanForBracket(d(h.line,h.ch+l),-1,void 0,{bracketRegex:i}),g=a.scanForBracket(d(h.line,h.ch+l),1,void 0,{bracketRegex:i}),!f||!g)return{start:h,end:h};if(f=f.pos,g=g.pos,f.line==g.line&&f.ch>g.ch||f.line>g.line){var m=f;f=g,g=m}return e?g.ch+=1:f.ch+=1,{start:f,end:g}}function Ea(a,b,c,e){var f,g,h,i,j=W(b),k=a.getLine(j.line),l=k.split(""),m=l.indexOf(c);if(j.ch-1&&!f;h--)l[h]==c&&(f=h+1);else f=j.ch+1;if(f&&!g)for(h=f,i=l.length;h'+b+"",{bottom:!0,duration:5e3}):alert(b)}function Ra(a,b){var c=''+(a||"")+'';return b&&(c+=' '+b+""),c}function Sa(a,b){var c=(b.prefix||"")+" "+(b.desc||""),d=Ra(b.prefix,b.desc);Ha(a,d,c,b.onClose,b)}function Ta(a,b){if(a instanceof RegExp&&b instanceof RegExp){for(var c=["global","multiline","ignoreCase","source"],d=0;d=b&&a<=c:a==b}function $a(a){var b=a.getScrollInfo(),c=6,d=10,e=a.coordsChar({left:0,top:c+b.top},"local"),f=b.clientHeight-d+b.top,g=a.coordsChar({left:0,top:f},"local");return{top:e.line,bottom:g.line}}function _a(a,b,c){if("'"==c){var d=a.doc.history.done,e=d[d.length-2];return e&&e.ranges&&e.ranges[0].head}if("."==c){if(0==a.doc.history.lastModTime)return;var f=a.doc.history.done.filter((function(a){if(void 0!==a.changes)return a}));f.reverse();var g=f[0].changes[0].to;return g}var h=b.marks[c];return h&&h.find()}function ab(b,c,d,e,f,g,h,i,j){function k(){b.operation((function(){for(;!p;)l(),m();n()}))}function l(){var a=b.getRange(g.from(),g.to()),c=a.replace(h,i);g.replace(c)}function m(){for(;g.findNext()&&Za(g.from(),e,f);)if(d||!q||g.from().line!=q.line)return b.scrollIntoView(g.from(),30),b.setSelection(g.from(),g.to()),q=g.from(),void(p=!1);p=!0}function n(a){if(a&&a(),b.focus(),q){b.setCursor(q);var c=b.state.vim;c.exMode=!1,c.lastHPos=c.lastHSPos=q.ch}j&&j()}function o(c,d,e){a.e_stop(c);var f=a.keyName(c);switch(f){case"Y":l(),m();break;case"N":m();break;case"A":var g=j;j=void 0,b.operation(k),j=g;break;case"L":l();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":n(e)}return p&&n(e),!0}b.state.vim.exMode=!0;var p=!1,q=g.from();return m(),p?void Qa(b,"No matches for "+h.source):c?void Sa(b,{prefix:"replace with "+i+" (y/n/a/q/l)",onKeyDown:o}):(k(),void(j&&j()))}function bb(b){var c=b.state.vim,d=Db.macroModeState,e=Db.registerController.getRegister("."),f=d.isPlaying,g=d.lastInsertModeChanges,h=[];if(!f){for(var i=g.inVisualBlock&&c.lastSelection?c.lastSelection.visualBlock.height:1,j=g.changes,h=[],k=0;k1&&(ob(b,c,c.insertModeRepeat-1,!0),c.lastEditInputState.repeatOverride=c.insertModeRepeat),delete c.insertModeRepeat,c.insertMode=!1,b.setCursor(b.getCursor().line,b.getCursor().ch-1),b.setOption("keyMap","vim"),b.setOption("disableInput",!0),b.toggleOverwrite(!1),e.setText(g.changes.join("")),a.signal(b,"vim-mode-change",{mode:"normal"}),d.isRecording&&gb(d)}function cb(a){b.unshift(a)}function db(a,b,c,d,e){var f={keys:a,type:b};f[b]=c,f[b+"Args"]=d;for(var g in e)f[g]=e[g];cb(f)}function eb(b,c,d,e){var f=Db.registerController.getRegister(e);if(":"==e)return f.keyBuffer[0]&&Rb.processCommand(b,f.keyBuffer[0]),void(d.isPlaying=!1);var g=f.keyBuffer,h=0;d.isPlaying=!0,d.replaySearchQueries=f.searchQueries.slice(0);for(var i=0;i|<\w+>|./.exec(l),k=j[0],l=l.substring(j.index+k.length),a.Vim.handleKey(b,k,"macro"),c.insertMode){var m=f.insertModeChanges[h++].changes;Db.macroModeState.lastInsertModeChanges.changes=m,pb(b,m,1),bb(b)}d.isPlaying=!1}function fb(a,b){if(!a.isPlaying){var c=a.latestRegister,d=Db.registerController.getRegister(c);d&&d.pushText(b)}}function gb(a){if(!a.isPlaying){var b=a.latestRegister,c=Db.registerController.getRegister(b);c&&c.pushInsertModeChanges&&c.pushInsertModeChanges(a.lastInsertModeChanges)}}function hb(a,b){if(!a.isPlaying){var c=a.latestRegister,d=Db.registerController.getRegister(c);d&&d.pushSearchQuery&&d.pushSearchQuery(b)}}function ib(a,b){var c=Db.macroModeState,d=c.lastInsertModeChanges;if(!c.isPlaying)for(;b;){if(d.expectCursorActivityForChange=!0,"+input"==b.origin||"paste"==b.origin||void 0===b.origin){var e=b.text.join("\n");d.maybeReset&&(d.changes=[],d.maybeReset=!1),a.state.overwrite&&!/\n/.test(e)?d.changes.push([e]):d.changes.push(e)}b=b.next}}function jb(a){var b=a.state.vim;if(b.insertMode){var c=Db.macroModeState;if(c.isPlaying)return;var d=c.lastInsertModeChanges;d.expectCursorActivityForChange?d.expectCursorActivityForChange=!1:d.maybeReset=!0}else a.curOp.isVimOp||lb(a,b);b.visualMode&&kb(a)}function kb(a){var b=a.state.vim,c=O(a,W(b.sel.head)),d=Q(c,0,1);b.fakeCursor&&b.fakeCursor.clear(),b.fakeCursor=a.markText(c,d,{className:"cm-animate-fat-cursor"})}function lb(b,c){var d=b.getCursor("anchor"),e=b.getCursor("head");if(c.visualMode&&!b.somethingSelected()?na(b,!1):c.visualMode||c.insertMode||!b.somethingSelected()||(c.visualMode=!0,c.visualLine=!1,a.signal(b,"vim-mode-change",{mode:"visual"})),c.visualMode){var f=Y(e,d)?0:-1,g=Y(e,d)?-1:0;e=Q(e,0,f),d=Q(d,0,g),c.sel={anchor:d,head:e},za(b,c,"<",Z(e,d)),za(b,c,">",$(e,d))}else c.insertMode||(c.lastHPos=b.getCursor().ch)}function mb(a){this.keyName=a}function nb(b){function c(){return e.maybeReset&&(e.changes=[],e.maybeReset=!1),e.changes.push(new mb(f)),!0}var d=Db.macroModeState,e=d.lastInsertModeChanges,f=a.keyName(b);f&&(f.indexOf("Delete")==-1&&f.indexOf("Backspace")==-1||a.lookupKey(f,"vim-insert",c))}function ob(a,b,c,d){function e(){h?Gb.processAction(a,b,b.lastEditActionCommand):Gb.evalInput(a,b)}function f(c){if(g.lastInsertModeChanges.changes.length>0){c=b.lastEditActionCommand?c:1;var d=g.lastInsertModeChanges;pb(a,d.changes,c)}}var g=Db.macroModeState;g.isPlaying=!0;var h=!!b.lastEditActionCommand,i=b.inputState;if(b.inputState=b.lastEditInputState,h&&b.lastEditActionCommand.interlaceInsertRepeat)for(var j=0;j"]),zb=[].concat(vb,wb,xb,["-",'"',".",":","/"]),Ab={};y("filetype",void 0,"string",["ft"],(function(a,b){if(void 0!==b){if(void 0===a){var c=b.getOption("mode");return"null"==c?"":c}var c=""==a?"null":a;b.setOption("mode",c)}}));var Bb=function(){function a(a,b,h){function i(b){var e=++d%c,f=g[e];f&&f.clear(),g[e]=a.setBookmark(b)}var j=d%c,k=g[j];if(k){var l=k.find();l&&!X(l,b)&&i(b)}else i(b);i(h),e=d,f=d-c+1,f<0&&(f=0)}function b(a,b){d+=b,d>e?d=e:d0?1:-1,k=a.getCursor();do if(d+=j,h=g[(c+d)%c],h&&(i=h.find())&&!X(k,i))break;while(df)}return h}var c=100,d=-1,e=0,f=0,g=new Array(c);return{cachedCursor:void 0,add:a,move:b}},Cb=function(a){return a?{changes:a.changes,expectCursorActivityForChange:a.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};B.prototype={exitMacroRecordMode:function(){var a=Db.macroModeState;a.onRecordingDone&&a.onRecordingDone(),a.onRecordingDone=void 0,a.isRecording=!1},enterMacroRecordMode:function(a,b){var c=Db.registerController.getRegister(b);c&&(c.clear(),this.latestRegister=b,a.openDialog&&(this.onRecordingDone=a.openDialog("(recording)["+b+"]",null,{bottom:!0})),this.isRecording=!0)}};var Db,Eb,Fb={buildKeyMap:function(){},getRegisterController:function(){return Db.registerController},resetVimGlobalState_:D,getVimGlobalState_:function(){return Db},maybeInitVimState_:C,suppressErrorLogging:!1,InsertModeKey:mb,map:function(a,b,c){Rb.map(a,b,c)},unmap:function(a,b){Rb.unmap(a,b)},setOption:z,getOption:A,defineOption:y,defineEx:function(a,b,c){if(b){if(0!==a.indexOf(b))throw new Error('(Vim.defineEx) "'+b+'" is not a prefix of "'+a+'", command not registered')}else b=a;Qb[a]=c,Rb.commandMap_[b]={name:a,shortName:b,type:"api"}},handleKey:function(a,b,c){var d=this.findKey(a,b,c);if("function"==typeof d)return d()},findKey:function(c,d,e){function f(){var a=Db.macroModeState;if(a.isRecording){if("q"==d)return a.exitMacroRecordMode(),F(c),!0;"mapping"!=e&&fb(a,d)}}function g(){if(""==d)return F(c),l.visualMode?na(c):l.insertMode&&bb(c),!0}function h(b){for(var e;b;)e=/<\w+-.+?>|<\w+>|./.exec(b),d=e[0],b=b.substring(e.index+d.length),a.Vim.handleKey(c,d,"mapping")}function i(){if(g())return!0;for(var a=l.inputState.keyBuffer=l.inputState.keyBuffer+d,e=1==d.length,f=Gb.matchCommand(a,b,l.inputState,"insert");a.length>1&&"full"!=f.type;){var a=l.inputState.keyBuffer=a.slice(1),h=Gb.matchCommand(a,b,l.inputState,"insert");"none"!=h.type&&(f=h)}if("none"==f.type)return F(c),!1;if("partial"==f.type)return Eb&&window.clearTimeout(Eb),Eb=window.setTimeout((function(){l.insertMode&&l.inputState.keyBuffer&&F(c)}),A("insertModeEscKeysTimeout")),!e;if(Eb&&window.clearTimeout(Eb),e){for(var i=c.listSelections(),j=0;j0||this.motionRepeat.length>0)&&(a=1,this.prefixRepeat.length>0&&(a*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(a*=parseInt(this.motionRepeat.join(""),10))),a},G.prototype={setText:function(a,b,c){this.keyBuffer=[a||""],this.linewise=!!b,this.blockwise=!!c},pushText:function(a,b){b&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(a)},pushInsertModeChanges:function(a){this.insertModeChanges.push(Cb(a))},pushSearchQuery:function(a){this.searchQueries.push(a)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},I.prototype={pushText:function(a,b,c,d,e){d&&"\n"!==c.charAt(c.length-1)&&(c+="\n");var f=this.isValidRegister(a)?this.getRegister(a):null;if(!f){switch(b){case"yank":this.registers[0]=new G(c,d,e);break;case"delete":case"change":c.indexOf("\n")==-1?this.registers["-"]=new G(c,d):(this.shiftNumericRegisters_(),this.registers[1]=new G(c,d))}return void this.unnamedRegister.setText(c,d,e)}var g=u(a);g?f.pushText(c,d):f.setText(c,d,e),this.unnamedRegister.setText(f.toString(),d)},getRegister:function(a){return this.isValidRegister(a)?(a=a.toLowerCase(),this.registers[a]||(this.registers[a]=new G),this.registers[a]):this.unnamedRegister},isValidRegister:function(a){return a&&x(a,zb)},shiftNumericRegisters_:function(){for(var a=9;a>=2;a--)this.registers[a]=this.getRegister(""+(a-1))}},J.prototype={nextMatch:function(a,b){var c=this.historyBuffer,d=b?-1:1;null===this.initialPrefix&&(this.initialPrefix=a);for(var e=this.iterator+d;b?e>=0:e=c.length?(this.iterator=c.length,this.initialPrefix):e<0?a:void 0},pushInput:function(a){var b=this.historyBuffer.indexOf(a);b>-1&&this.historyBuffer.splice(b,1),a.length&&this.historyBuffer.push(a)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var Gb={matchCommand:function(a,b,c,d){var e=S(a,b,d,c);if(!e.full&&!e.partial)return{type:"none"};if(!e.full&&e.partial)return{type:"partial"};for(var f,g=0;g"==f.keys.slice(-11)){var i=U(a);if(!i)return{type:"none"};c.selectedCharacter=i}return{type:"full",command:f}},processCommand:function(a,b,c){switch(b.inputState.repeatOverride=c.repeatOverride,c.type){case"motion":this.processMotion(a,b,c);break;case"operator":this.processOperator(a,b,c);break;case"operatorMotion":this.processOperatorMotion(a,b,c);break;case"action":this.processAction(a,b,c);break;case"search":this.processSearch(a,b,c);break;case"ex":case"keyToEx":this.processEx(a,b,c)}},processMotion:function(a,b,c){b.inputState.motion=c.motion,b.inputState.motionArgs=P(c.motionArgs),this.evalInput(a,b)},processOperator:function(a,b,c){var d=b.inputState;if(d.operator){if(d.operator==c.operator)return d.motion="expandToLine",d.motionArgs={linewise:!0},void this.evalInput(a,b);F(a)}d.operator=c.operator,d.operatorArgs=P(c.operatorArgs),b.visualMode&&this.evalInput(a,b)},processOperatorMotion:function(a,b,c){var d=b.visualMode,e=P(c.operatorMotionArgs);e&&d&&e.visualLine&&(b.visualLine=!0),this.processOperator(a,b,c),d||this.processMotion(a,b,c)},processAction:function(a,b,c){var d=b.inputState,e=d.getRepeat(),f=!!e,g=P(c.actionArgs)||{};d.selectedCharacter&&(g.selectedCharacter=d.selectedCharacter),c.operator&&this.processOperator(a,b,c),c.motion&&this.processMotion(a,b,c),(c.motion||c.operator)&&this.evalInput(a,b),g.repeat=e||1,g.repeatIsExplicit=f,g.registerName=d.registerName,F(a),b.lastMotion=null,c.isEdit&&this.recordLastEdit(b,d,c),Jb[c.action](a,g,b)},processSearch:function(b,c,d){function e(a,e,f){Db.searchHistoryController.pushInput(a),Db.searchHistoryController.reset();try{Ua(b,a,e,f)}catch(c){return Qa(b,"Invalid regex: "+a),void F(b)}Gb.processMotion(b,c,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:d.searchArgs.toJumplist}})}function f(a){b.scrollTo(m.left,m.top),e(a,!0,!0);var c=Db.macroModeState;c.isRecording&&hb(c,a)}function g(c,d,e){var f,g,h=a.keyName(c);"Up"==h||"Down"==h?(f="Up"==h,g=c.target?c.target.selectionEnd:0,d=Db.searchHistoryController.nextMatch(d,f)||"",e(d),g&&c.target&&(c.target.selectionEnd=c.target.selectionStart=Math.min(g,c.target.value.length))):"Left"!=h&&"Right"!=h&&"Ctrl"!=h&&"Alt"!=h&&"Shift"!=h&&Db.searchHistoryController.reset();var j;try{j=Ua(b,d,!0,!0)}catch(a){}j?b.scrollIntoView(Xa(b,!i,j),30):(Ya(b),b.scrollTo(m.left,m.top))}function h(c,d,e){var f=a.keyName(c);"Esc"==f||"Ctrl-C"==f||"Ctrl-["==f||"Backspace"==f&&""==d?(Db.searchHistoryController.pushInput(d),Db.searchHistoryController.reset(),Ua(b,l),Ya(b),b.scrollTo(m.left,m.top),a.e_stop(c),F(b),e(),b.focus()):"Up"==f||"Down"==f?a.e_stop(c):"Ctrl-U"==f&&(a.e_stop(c),e(""))}if(b.getSearchCursor){var i=d.searchArgs.forward,j=d.searchArgs.wholeWordOnly;Ga(b).setReversed(!i);var k=i?"/":"?",l=Ga(b).getQuery(),m=b.getScrollInfo();switch(d.searchArgs.querySrc){case"prompt":var n=Db.macroModeState;if(n.isPlaying){var o=n.replaySearchQueries.shift();e(o,!0,!1)}else Sa(b,{onClose:f,prefix:k,desc:Ob,onKeyUp:g,onKeyDown:h});break;case"wordUnderCursor":var p=ra(b,!1,!0,!1,!0),q=!0;if(p||(p=ra(b,!1,!0,!1,!1),q=!1),!p)return;var o=b.getLine(p.start.line).substring(p.start.ch,p.end.ch);o=q&&j?"\\b"+o+"\\b":ca(o),Db.jumpList.cachedCursor=b.getCursor(),b.setCursor(p.start),e(o,!0,!1)}}},processEx:function(b,c,d){function e(a){Db.exCommandHistoryController.pushInput(a),Db.exCommandHistoryController.reset(),Rb.processCommand(b,a)}function f(c,d,e){var f,g,h=a.keyName(c);("Esc"==h||"Ctrl-C"==h||"Ctrl-["==h||"Backspace"==h&&""==d)&&(Db.exCommandHistoryController.pushInput(d),Db.exCommandHistoryController.reset(),a.e_stop(c),F(b),e(),b.focus()),"Up"==h||"Down"==h?(a.e_stop(c),f="Up"==h,g=c.target?c.target.selectionEnd:0,d=Db.exCommandHistoryController.nextMatch(d,f)||"",e(d),g&&c.target&&(c.target.selectionEnd=c.target.selectionStart=Math.min(g,c.target.value.length))):"Ctrl-U"==h?(a.e_stop(c),e("")):"Left"!=h&&"Right"!=h&&"Ctrl"!=h&&"Alt"!=h&&"Shift"!=h&&Db.exCommandHistoryController.reset()}"keyToEx"==d.type?Rb.processCommand(b,d.exArgs.input):c.visualMode?Sa(b,{onClose:e,prefix:":",value:"'<,'>",onKeyDown:f,selectValueOnOpen:!1}):Sa(b,{onClose:e,prefix:":",onKeyDown:f})},evalInput:function(a,b){var c,e,f,g=b.inputState,h=g.motion,i=g.motionArgs||{},j=g.operator,k=g.operatorArgs||{},l=g.registerName,m=b.sel,n=W(b.visualMode?O(a,m.head):a.getCursor("head")),o=W(b.visualMode?O(a,m.anchor):a.getCursor("anchor")),p=W(n),q=W(o);if(j&&this.recordLastEdit(b,g),f=void 0!==g.repeatOverride?g.repeatOverride:g.getRepeat(),f>0&&i.explicitRepeat?i.repeatIsExplicit=!0:(i.noRepeat||!i.explicitRepeat&&0===f)&&(f=1,i.repeatIsExplicit=!1),g.selectedCharacter&&(i.selectedCharacter=k.selectedCharacter=g.selectedCharacter),i.repeat=f,F(a),h){var r=Hb[h](a,n,i,b);if(b.lastMotion=Hb[h],!r)return;if(i.toJumplist){var s=Db.jumpList,t=s.cachedCursor;t?(sa(a,t,r),delete s.cachedCursor):sa(a,n,r)}r instanceof Array?(e=r[0],c=r[1]):c=r,c||(c=W(n)),b.visualMode?(b.visualBlock&&c.ch===1/0||(c=O(a,c,b.visualBlock)),e&&(e=O(a,e,!0)),e=e||q,m.anchor=e,m.head=c,ka(a),za(a,b,"<",Y(e,c)?e:c),za(a,b,">",Y(e,c)?c:e)):j||(c=O(a,c),a.setCursor(c.line,c.ch))}if(j){if(k.lastSel){e=q;var u=k.lastSel,v=Math.abs(u.head.line-u.anchor.line),w=Math.abs(u.head.ch-u.anchor.ch);c=u.visualLine?d(q.line+v,q.ch):u.visualBlock?d(q.line+v,q.ch+w):u.head.line==u.anchor.line?d(q.line,q.ch+w):d(q.line+v,q.ch),b.visualMode=!0,b.visualLine=u.visualLine,b.visualBlock=u.visualBlock,m=b.sel={anchor:e,head:c},ka(a)}else b.visualMode&&(k.lastSel={anchor:W(m.anchor),head:W(m.head),visualBlock:b.visualBlock,visualLine:b.visualLine});var x,y,z,A,B;if(b.visualMode){if(x=Z(m.head,m.anchor),y=$(m.head,m.anchor),z=b.visualLine||k.linewise,A=b.visualBlock?"block":z?"line":"char",B=la(a,{anchor:x,head:y},A),z){var C=B.ranges;if("block"==A)for(var D=0;Dk&&f.line==k?this.moveToEol(a,b,c,e):(c.toFirstChar&&(g=qa(a.getLine(i)),e.lastHPos=g),e.lastHSPos=a.charCoords(d(i,g),"div").left,d(i,g))},moveByDisplayLines:function(a,b,c,e){var f=b;switch(e.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:e.lastHSPos=a.charCoords(f,"div").left}var g=c.repeat,h=a.findPosV(f,c.forward?g:-g,"line",e.lastHSPos);if(h.hitSide)if(c.forward)var i=a.charCoords(h,"div"),j={top:i.top+8,left:e.lastHSPos},h=a.coordsChar(j,"div");else{var k=a.charCoords(d(a.firstLine(),0),"div");k.left=e.lastHSPos,h=a.coordsChar(k,"div")}return e.lastHPos=h.ch,h},moveByPage:function(a,b,c){var d=b,e=c.repeat;return a.findPosV(d,c.forward?e:-e,"page")},moveByParagraph:function(a,b,c){var d=c.forward?1:-1;return Ba(a,b,c.repeat,d)},moveBySentence:function(a,b,c){var d=c.forward?1:-1;return Ca(a,b,c.repeat,d)},moveByScroll:function(a,b,c,d){var e=a.getScrollInfo(),f=null,g=c.repeat;g||(g=e.clientHeight/(2*a.defaultTextHeight()));var h=a.charCoords(b,"local");c.repeat=g;var f=Hb.moveByDisplayLines(a,b,c,d);if(!f)return null;var i=a.charCoords(f,"local");return a.scrollTo(null,e.top+i.top-h.top),f},moveByWords:function(a,b,c){return wa(a,b,c.repeat,!!c.forward,!!c.wordEnd,!!c.bigWord)},moveTillCharacter:function(a,b,c){var d=c.repeat,e=xa(a,d,c.forward,c.selectedCharacter),f=c.forward?-1:1;return ta(f,c),e?(e.ch+=f,e):null},moveToCharacter:function(a,b,c){var d=c.repeat;return ta(0,c),xa(a,d,c.forward,c.selectedCharacter)||b},moveToSymbol:function(a,b,c){var d=c.repeat;return ua(a,d,c.forward,c.selectedCharacter)||b},moveToColumn:function(a,b,c,d){var e=c.repeat;return d.lastHPos=e-1,d.lastHSPos=a.charCoords(b,"div").left,ya(a,e)},moveToEol:function(a,b,c,e){var f=b;e.lastHPos=1/0;var g=d(f.line+c.repeat-1,1/0),h=a.clipPos(g);return h.ch--,e.lastHSPos=a.charCoords(h,"div").left,g},moveToFirstNonWhiteSpaceCharacter:function(a,b){var c=b;return d(c.line,qa(a.getLine(c.line)))},moveToMatchedSymbol:function(a,b){for(var c,e=b,f=e.line,g=e.ch,h=a.getLine(f);gb.lastLine()&&c.linewise&&!o?b.replaceRange("",n,k):b.replaceRange("",j,k),c.linewise&&(o||(b.setCursor(n),a.commands.newlineAndIndent(b)),j.ch=Number.MAX_VALUE),f=j}Db.registerController.pushText(c.registerName,"change",g,c.linewise,e.length>1),Jb.enterInsertMode(b,{head:f},b.state.vim)},delete:function(a,b,c){var e,f,g=a.state.vim;if(g.visualBlock){f=a.getSelection();var h=L("",c.length);a.replaceSelections(h),e=c[0].anchor}else{var i=c[0].anchor,j=c[0].head;b.linewise&&j.line!=a.firstLine()&&i.line==a.lastLine()&&i.line==j.line-1&&(i.line==a.firstLine()?i.ch=0:i=d(i.line-1,aa(a,i.line-1))),f=a.getRange(i,j),a.replaceRange("",i,j),e=i,b.linewise&&(e=Hb.moveToFirstNonWhiteSpaceCharacter(a,i))}Db.registerController.pushText(b.registerName,"delete",f,b.linewise,g.visualBlock);var k=g.insertMode;return O(a,e,k)},indent:function(a,b,c){var d=a.state.vim,e=c[0].anchor.line,f=d.visualBlock?c[c.length-1].anchor.line:c[0].head.line,g=d.visualMode?b.repeat:1;b.linewise&&f--;for(var h=e;h<=f;h++)for(var i=0;ij.top?(i.line+=(h-j.top)/e,i.line=Math.ceil(i.line),a.setCursor(i),j=a.charCoords(i,"local"),a.scrollTo(null,j.top)):a.scrollTo(null,h);else{var k=h+a.getScrollInfo().clientHeight;k=g.anchor.line?Q(g.head,0,1):d(g.anchor.line,0);else if("inplace"==f&&e.visualMode)return;b.setOption("disableInput",!1),c&&c.replace?(b.toggleOverwrite(!0),b.setOption("keyMap","vim-replace"),a.signal(b,"vim-mode-change",{mode:"replace"})):(b.toggleOverwrite(!1),b.setOption("keyMap","vim-insert"),a.signal(b,"vim-mode-change",{mode:"insert"})),Db.macroModeState.isPlaying||(b.on("change",ib),a.on(b.getInputField(),"keydown",nb)),e.visualMode&&na(b),fa(b,h,i)}},toggleVisualMode:function(b,c,e){var f,g=c.repeat,h=b.getCursor();e.visualMode?e.visualLine^c.linewise||e.visualBlock^c.blockwise?(e.visualLine=!!c.linewise,e.visualBlock=!!c.blockwise,a.signal(b,"vim-mode-change",{mode:"visual",subMode:e.visualLine?"linewise":e.visualBlock?"blockwise":""}),ka(b)):na(b):(e.visualMode=!0,e.visualLine=!!c.linewise,e.visualBlock=!!c.blockwise,f=O(b,d(h.line,h.ch+g-1),!0),e.sel={anchor:h,head:f},a.signal(b,"vim-mode-change",{mode:"visual",subMode:e.visualLine?"linewise":e.visualBlock?"blockwise":""}),ka(b),za(b,e,"<",Z(h,f)),za(b,e,">",$(h,f)))},reselectLastSelection:function(b,c,d){var e=d.lastSelection;if(d.visualMode&&ia(b,d),e){var f=e.anchorMark.find(),g=e.headMark.find();if(!f||!g)return;d.sel={anchor:f,head:g},d.visualMode=!0,d.visualLine=e.visualLine,d.visualBlock=e.visualBlock,ka(b),za(b,d,"<",Z(f,g)),za(b,d,">",$(f,g)),a.signal(b,"vim-mode-change",{mode:"visual",subMode:d.visualLine?"linewise":d.visualBlock?"blockwise":""})}},joinLines:function(a,b,c){var e,f;if(c.visualMode){if(e=a.getCursor("anchor"),f=a.getCursor("head"),Y(f,e)){var g=f;f=e,e=g}f.ch=aa(a,f.line)-1}else{var h=Math.max(b.repeat,2);e=a.getCursor(),f=O(a,d(e.line+h-1,1/0))}for(var i=0,j=e.line;j1)var g=Array(b.repeat+1).join(g);var o=f.linewise,p=f.blockwise;if(o)c.visualMode?g=c.visualLine?g.slice(0,-1):"\n"+g.slice(0,g.length-1)+"\n":b.after?(g="\n"+g.slice(0,g.length-1),e.ch=aa(a,e.line)):e.ch=0;else{if(p){g=g.split("\n");for(var q=0;qa.lastLine()&&a.replaceRange("\n",d(A,0));var B=aa(a,A);Bk.length&&(f=k.length),g=d(i.line,f)}if("\n"==h)e.visualMode||b.replaceRange("",i,g),(a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent)(b);else{var l=b.getRange(i,g);if(l=l.replace(/[^\n]/g,h),e.visualBlock){var m=new Array(b.getOption("tabSize")+1).join(" ");l=b.getSelection(),l=l.replace(/\t/g,m).replace(/[^\n]/g,h).split("\n"),b.replaceSelections(l)}else b.replaceRange(l,i,g);e.visualMode?(i=Y(j[0].anchor,j[0].head)?j[0].anchor:j[0].head,b.setCursor(i),na(b,!1)):b.setCursor(Q(g,0,-1))}},incrementNumberToken:function(a,b){for(var c,e,f,g,h=a.getCursor(),i=a.getLine(h.line),j=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(c=j.exec(i))&&(e=c.index,f=e+c[0].length,!(h.ch=1)return!0}else a.nextCh===a.reverseSymb&&a.depth--;return!1}},section:{init:function(a){a.curMoveThrough=!0,a.symb=(a.forward?"]":"[")===a.symb?"{":"}"},isComplete:function(a){return 0===a.index&&a.nextCh===a.symb}},comment:{isComplete:function(a){var b="*"===a.lastCh&&"/"===a.nextCh;return a.lastCh=a.nextCh,b}},method:{init:function(a){a.symb="m"===a.symb?"{":"}",a.reverseSymb="{"===a.symb?"}":"{"},isComplete:function(a){return a.nextCh===a.symb}},preprocess:{init:function(a){a.index=0},isComplete:function(a){if("#"===a.nextCh){var b=a.lineText.match(/#(\w+)/)[1];if("endif"===b){if(a.forward&&0===a.depth)return!0;a.depth++}else if("if"===b){if(!a.forward&&0===a.depth)return!0;a.depth--}if("else"===b&&0===a.depth)return!0}return!1}}};y("pcre",!0,"boolean"),Fa.prototype={getQuery:function(){return Db.query},setQuery:function(a){Db.query=a},getOverlay:function(){return this.searchOverlay},setOverlay:function(a){this.searchOverlay=a},isReversed:function(){return Db.isReversed},setReversed:function(a){Db.isReversed=a},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(a){this.annotate=a}};var Mb={"\\n":"\n","\\r":"\r","\\t":"\t"},Nb={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"},Ob="(Javascript regexp)",Pb=function(){this.buildCommandMap_()};Pb.prototype={processCommand:function(a,b,c){var d=this;a.operation((function(){a.curOp.isVimOp=!0,d._processCommand(a,b,c)}))},_processCommand:function(b,c,d){var e=b.state.vim,f=Db.registerController.getRegister(":"),g=f.toString();e.visualMode&&na(b);var h=new a.StringStream(c);f.setText(c);var i=d||{};i.input=c;try{this.parseInput_(b,h,i)}catch(a){throw Qa(b,a),a}var j,k;if(i.commandName){if(j=this.matchCommand_(i.commandName)){if(k=j.name,j.excludeFromCommandHistory&&f.setText(g),this.parseCommandArgs_(h,i,j),"exToKey"==j.type){for(var l=0;l0;b--){var c=a.substring(0,b);if(this.commandMap_[c]){var d=this.commandMap_[c];if(0===d.name.indexOf(a))return d}}return null},buildCommandMap_:function(){this.commandMap_={};for(var a=0;a
";if(c){var f;c=c.join("");for(var g=0;g"}}else for(var f in d){var i=d[f].toString();i.length&&(e+='"'+f+" "+i+"
")}Qa(a,e)},sort:function(b,c){function e(){if(c.argString){var b=new a.StringStream(c.argString);if(b.eat("!")&&(h=!0),b.eol())return;if(!b.eatSpace())return"Invalid arguments";var d=b.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!d&&!b.eol())return"Invalid arguments";if(d[1]){i=d[1].indexOf("i")!=-1,j=d[1].indexOf("u")!=-1;var e=d[1].indexOf("d")!=-1||d[1].indexOf("n")!=-1&&1,f=d[1].indexOf("x")!=-1&&1,g=d[1].indexOf("o")!=-1&&1;if(e+f+g>1)return"Invalid arguments";k=e&&"decimal"||f&&"hex"||g&&"octal"}d[2]&&(l=new RegExp(d[2].substr(1,d[2].length-2),i?"i":""))}}function f(a,b){if(h){var c;c=a,a=b,b=c}i&&(a=a.toLowerCase(),b=b.toLowerCase());var d=k&&s.exec(a),e=k&&s.exec(b);return d?(d=parseInt((d[1]+d[2]).toLowerCase(),t),e=parseInt((e[1]+e[2]).toLowerCase(),t),d-e):a")}if(!d)return void Qa(a,k);var n=0,o=function(){if(n=k)return void Qa(b,"Invalid argument: "+c.argString.substring(f));for(var l=0;l<=k-j;l++){var m=String.fromCharCode(j+l);delete d.marks[m]}}else delete d.marks[g]}}},Rb=new Pb;return a.keyMap.vim={attach:h,detach:g,call:m},y("insertModeEscKeysTimeout",200,"number"),a.keyMap["vim-insert"]={fallthrough:["default"],attach:h,detach:g,call:m},a.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:h,detach:g,call:m},D(),Fb};a.Vim=e()})); \ No newline at end of file diff --git a/media/editors/codemirror/lib/addons.js b/media/editors/codemirror/lib/addons.js index a1c737eb02825..8965b567fb7f1 100644 --- a/media/editors/codemirror/lib/addons.js +++ b/media/editors/codemirror/lib/addons.js @@ -1293,12 +1293,14 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { CodeMirror.registerHelper("fold", "xml", function(cm, start) { var iter = new Iter(cm, start.line, 0); for (;;) { - var openTag = toNextTag(iter), end; - if (!openTag || !(end = toTagEnd(iter)) || iter.line != start.line) return; + var openTag = toNextTag(iter) + if (!openTag || iter.line != start.line) return + var end = toTagEnd(iter) + if (!end) return if (!openTag[1] && end != "selfClose") { var startPos = Pos(iter.line, iter.ch); var endPos = findMatchingClose(iter, openTag[2]); - return endPos && {from: startPos, to: endPos.from}; + return endPos && cmp(endPos.from, startPos) > 0 ? {from: startPos, to: endPos.from} : null } } }); @@ -1454,7 +1456,15 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { if (found == stream.pos) { if (!other.parseDelimiters) stream.match(other.open); state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); + + // Get the outer indent, making sure to handle CodeMirror.Pass + var outerIndent = 0; + if (outer.indent) { + var possibleOuterIndent = outer.indent(state.outer, ""); + if (possibleOuterIndent !== CodeMirror.Pass) outerIndent = possibleOuterIndent; + } + + state.inner = CodeMirror.startState(other.mode, outerIndent); return other.delimStyle && (other.delimStyle + " " + other.delimStyle + "-open"); } else if (found != -1 && found < cutOff) { cutOff = found; @@ -1992,7 +2002,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { var state = cm.state.matchHighlighter; cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style)); if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) { - var searchFor = hasBoundary ? new RegExp("\\b" + query.replace(/[\\\[+*?(){|^$]/g, "\\$&") + "\\b") : query; + var searchFor = hasBoundary ? new RegExp("\\b" + query.replace(/[\\\[.+*?(){|^$]/g, "\\$&") + "\\b") : query; state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, false, {className: "CodeMirror-selection-highlight-scrollbar"}); } diff --git a/media/editors/codemirror/lib/addons.min.js b/media/editors/codemirror/lib/addons.min.js index ce94bd717b7cd..b166ac85e52e5 100644 --- a/media/editors/codemirror/lib/addons.min.js +++ b/media/editors/codemirror/lib/addons.min.js @@ -1,2 +1,2 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a){var b=a.getWrapperElement();a.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:b.style.width,height:b.style.height},b.style.width="",b.style.height="auto",b.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",a.refresh()}function c(a){var b=a.getWrapperElement();b.className=b.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var c=a.state.fullScreenRestore;b.style.width=c.width,b.style.height=c.height,window.scrollTo(c.scrollLeft,c.scrollTop),a.refresh()}a.defineOption("fullScreen",!1,(function(d,e,f){f==a.Init&&(f=!1),!f!=!e&&(e?b(d):c(d))}))})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){function b(a,b,c,d){this.cm=a,this.node=b,this.options=c,this.height=d,this.cleared=!1}function c(a){var b=a.getWrapperElement(),c=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,d=parseInt(c.height),e=a.state.panels={setHeight:b.style.height,heightLeft:d,panels:0,wrapper:document.createElement("div")};b.parentNode.insertBefore(e.wrapper,b);var f=a.hasFocus();e.wrapper.appendChild(b),f&&a.focus(),a._setSize=a.setSize,null!=d&&(a.setSize=function(b,c){if(null==c)return this._setSize(b,c);if(e.setHeight=c,"number"!=typeof c){var f=/^(\d+\.?\d*)px$/.exec(c);f?c=Number(f[1]):(e.wrapper.style.height=c,c=e.wrapper.offsetHeight,e.wrapper.style.height="")}a._setSize(b,e.heightLeft+=c-d),d=c})}function d(a){var b=a.state.panels;a.state.panels=null;var c=a.getWrapperElement();b.wrapper.parentNode.replaceChild(c,b.wrapper),c.style.height=b.setHeight,a.setSize=a._setSize,a.setSize()}function e(a,b){for(var c=b.nextSibling;c;c=c.nextSibling)if(c==a.getWrapperElement())return!0;return!1}a.defineExtension("addPanel",(function(a,d){d=d||{},this.state.panels||c(this);var f=this.state.panels,g=f.wrapper,h=this.getWrapperElement();d.after instanceof b&&!d.after.cleared?g.insertBefore(a,d.before.node.nextSibling):d.before instanceof b&&!d.before.cleared?g.insertBefore(a,d.before.node):d.replace instanceof b&&!d.replace.cleared?(g.insertBefore(a,d.replace.node),d.replace.clear()):"bottom"==d.position?g.appendChild(a):"before-bottom"==d.position?g.insertBefore(a,h.nextSibling):"after-top"==d.position?g.insertBefore(a,h):g.insertBefore(a,g.firstChild);var i=d&&d.height||a.offsetHeight;return this._setSize(null,f.heightLeft-=i),f.panels++,d.stable&&e(this,a)&&this.scrollTo(null,this.getScrollInfo().top+i),new b(this,a,d,i)})),b.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var a=this.cm.state.panels;this.cm._setSize(null,a.heightLeft+=this.height),this.options.stable&&e(this.cm,this.node)&&this.cm.scrollTo(null,this.cm.getScrollInfo().top-this.height),a.wrapper.removeChild(this.node),0==--a.panels&&d(this.cm)}},b.prototype.changed=function(a){var b=null==a?this.node.offsetHeight:a,c=this.cm.state.panels;this.cm._setSize(null,c.heightLeft-=b-this.height),this.height=b}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){function b(a,b){return"pairs"==b&&"string"==typeof a?a:"object"==typeof a&&null!=a[b]?a[b]:m[b]}function c(a){for(var b=0;b=0;h--){var j=g[h].head;c.replaceRange("",n(j.line,j.ch-1),n(j.line,j.ch+1),"+delete")}}function g(c){var d=e(c),f=d&&b(d,"explode");if(!f||c.getOption("disableInput"))return a.Pass;for(var g=c.listSelections(),h=0;h0;return{anchor:new n(b.anchor.line,b.anchor.ch+(c?-1:1)),head:new n(b.head.line,b.head.ch+(c?1:-1))}}function i(c,d){var f=e(c);if(!f||c.getOption("disableInput"))return a.Pass;var g=b(f,"pairs"),i=g.indexOf(d);if(i==-1)return a.Pass;for(var k,m=b(f,"triples"),o=g.charAt(i+1)==d,p=c.listSelections(),q=i%2==0,r=0;r1&&m.indexOf(d)>=0&&c.getRange(n(u.line,u.ch-2),u)==d+d){if(u.ch>2&&/\bstring/.test(c.getTokenTypeAt(n(u.line,u.ch-2))))return a.Pass;s="addFour"}else if(o){var w=0==u.ch?" ":c.getRange(n(u.line,u.ch-1),u);if(a.isWordChar(v)||w==d||a.isWordChar(w))return a.Pass;s="both"}else{if(!q||c.getLine(u.line).length!=u.ch&&!j(v,g)&&!/\s/.test(v))return a.Pass;s="both"}else s=o&&l(c,u)?"both":m.indexOf(d)>=0&&c.getRange(u,n(u.line,u.ch+3))==d+d+d?"skipThree":"skip";if(k){if(k!=s)return a.Pass}else k=s}var x=i%2?g.charAt(i-1):d,y=i%2?d:g.charAt(i+1);c.operation((function(){if("skip"==k)c.execCommand("goCharRight");else if("skipThree"==k)for(var a=0;a<3;a++)c.execCommand("goCharRight");else if("surround"==k){for(var b=c.getSelections(),a=0;a-1&&c%2==1}function k(a,b){var c=a.getRange(n(b.line,b.ch-1),n(b.line,b.ch+1));return 2==c.length?c:null}function l(a,b){var c=a.getTokenAt(n(b.line,b.ch+1));return/\bstring/.test(c.type)&&c.start==b.ch&&(0==b.ch||!/\bstring/.test(a.getTokenTypeAt(b)))}var m={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},n=a.Pos;a.defineOption("autoCloseBrackets",!1,(function(d,e,f){f&&f!=a.Init&&(d.removeKeyMap(o),d.state.closeBrackets=null),e&&(c(b(e,"pairs")),d.state.closeBrackets=e,d.addKeyMap(o))}));var o={Backspace:f,Enter:g};c(m.pairs+"`")})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],a):a(CodeMirror)})((function(a){function b(b){if(b.getOption("disableInput"))return a.Pass;for(var c=b.listSelections(),d=[],i=b.getOption("autoCloseTags"),j=0;jk.ch&&(r=r.slice(0,r.length-l.end+k.ch));var s=r.toLowerCase();if(!r||"string"==l.type&&(l.end!=k.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||1==l.string.length)||"tag"==l.type&&"closeTag"==n.type||l.string.indexOf("/")==l.string.length-1||p&&e(p,s)>-1||f(b,r,k,n,!0))return a.Pass;var t=q&&e(q,s)>-1;d[j]={indent:t,text:">"+(t?"\n\n":"")+"",newPos:t?a.Pos(k.line+1,0):a.Pos(k.line,k.ch+1)}}for(var u="object"==typeof i&&i.dontIndentOnAutoClose,j=c.length-1;j>=0;j--){var v=d[j];b.replaceRange(v.text,c[j].head,c[j].anchor,"+insert");var w=b.listSelections().slice(0);w[j]={head:v.newPos,anchor:v.newPos},b.setSelections(w),!u&&v.indent&&(b.indentLine(v.newPos.line,null,!0),b.indentLine(v.newPos.line+1,null,!0))}}function c(b,c){for(var d=b.listSelections(),e=[],g=c?"/":""!=b.getLine(k.line).charAt(l.end)&&(o+=">"),e[j]=o}if(b.replaceSelections(e),d=b.listSelections(),!i)for(var j=0;j'"]=function(a){return b(a)}),c.addKeyMap(g)}}));var g=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],h=["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"];a.commands.closeTag=function(a){return c(a)}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){function b(a,b,d){var e=a.getLineHandle(b.line),f=b.ch-1,i=d&&d.afterCursor;null==i&&(i=/(^| )cm-fat-cursor($| )/.test(a.getWrapperElement().className));var j=!i&&f>=0&&h[e.text.charAt(f)]||h[e.text.charAt(++f)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(d&&d.strict&&k>0!=(f==b.ch))return null;var l=a.getTokenTypeAt(g(b.line,f+1)),m=c(a,g(b.line,f+(k>0?1:0)),k,l||null,d);return null==m?null:{from:g(b.line,f),to:m&&m.pos,match:m&&m.ch==j.charAt(0),forward:k>0}}function c(a,b,c,d,e){for(var f=e&&e.maxScanLineLength||1e4,i=e&&e.maxScanLines||1e3,j=[],k=e&&e.bracketRegex?e.bracketRegex:/[(){}[\]]/,l=c>0?Math.min(b.line+i,a.lastLine()+1):Math.max(a.firstLine()-1,b.line-i),m=b.line;m!=l;m+=c){var n=a.getLine(m);if(n){var o=c>0?0:n.length-1,p=c>0?n.length:-1;if(!(n.length>f))for(m==b.line&&(o=b.ch-(c<0?1:0));o!=p;o+=c){var q=n.charAt(o);if(k.test(q)&&(void 0===d||a.getTokenTypeAt(g(m,o+1))==d)){var r=h[q];if(">"==r.charAt(1)==c>0)j.push(q);else{if(!j.length)return{pos:g(m,o),ch:q};j.pop()}}}}}return m-c!=(c>0?a.lastLine():a.firstLine())&&null}function d(a,c,d){for(var e=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};a.defineOption("matchBrackets",!1,(function(b,c,d){d&&d!=a.Init&&(b.off("cursorActivity",e),b.state.matchBrackets&&b.state.matchBrackets.currentlyHighlighted&&(b.state.matchBrackets.currentlyHighlighted(),b.state.matchBrackets.currentlyHighlighted=null)),c&&(b.state.matchBrackets="object"==typeof c?c:{},b.on("cursorActivity",e))})),a.defineExtension("matchBrackets",(function(){d(this,!0)})),a.defineExtension("findMatchingBracket",(function(a,c,d){return(d||"boolean"==typeof c)&&(d?(d.strict=c,c=d):c=c?{strict:!0}:null),b(this,a,c)})),a.defineExtension("scanForBracket",(function(a,b,d,e){return c(this,a,b,d,e)}))})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],a):a(CodeMirror)})((function(a){"use strict";function b(a){a.state.tagHit&&a.state.tagHit.clear(),a.state.tagOther&&a.state.tagOther.clear(),a.state.tagHit=a.state.tagOther=null}function c(c){c.state.failedTagMatch=!1,c.operation((function(){if(b(c),!c.somethingSelected()){var d=c.getCursor(),e=c.getViewport();e.from=Math.min(e.from,d.line),e.to=Math.max(d.line+1,e.to);var f=a.findMatchingTag(c,d,e);if(f){if(c.state.matchBothTags){var g="open"==f.at?f.open:f.close;g&&(c.state.tagHit=c.markText(g.from,g.to,{className:"CodeMirror-matchingtag"}))}var h="close"==f.at?f.open:f.close;h?c.state.tagOther=c.markText(h.from,h.to,{className:"CodeMirror-matchingtag"}):c.state.failedTagMatch=!0}}}))}function d(a){a.state.failedTagMatch&&c(a)}a.defineOption("matchTags",!1,(function(e,f,g){g&&g!=a.Init&&(e.off("cursorActivity",c),e.off("viewportChange",d),b(e)),f&&(e.state.matchBothTags="object"==typeof f&&f.bothTags,e.on("cursorActivity",c),e.on("viewportChange",d),c(e))})),a.commands.toMatchingTag=function(b){var c=a.findMatchingTag(b,b.getCursor());if(c){var d="close"==c.at?c.open:c.close;d&&b.extendSelection(d.to,d.from)}}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";a.registerHelper("fold","brace",(function(b,c){function d(d){for(var h=c.ch,i=0;;){var j=h<=0?-1:g.lastIndexOf(d,h-1);if(j!=-1){if(1==i&&jb.lastLine())return null;var d=b.getTokenAt(a.Pos(c,1));if(/\S/.test(d.string)||(d=b.getTokenAt(a.Pos(c,d.end+1))),"keyword"!=d.type||"import"!=d.string)return null;for(var e=c,f=Math.min(b.lastLine(),c+10);e<=f;++e){var g=b.getLine(e),h=g.indexOf(";");if(h!=-1)return{startCh:d.end,end:a.Pos(e,h)}}}var e,f=c.line,g=d(f);if(!g||d(f-1)||(e=d(f-2))&&e.end.line==f-1)return null;for(var h=g.end;;){var i=d(h.line+1);if(null==i)break;h=i.end}return{from:b.clipPos(a.Pos(f,g.startCh+1)),to:h}})),a.registerHelper("fold","include",(function(b,c){function d(c){if(cb.lastLine())return null;var d=b.getTokenAt(a.Pos(c,1));return/\S/.test(d.string)||(d=b.getTokenAt(a.Pos(c,d.end+1))),"meta"==d.type&&"#include"==d.string.slice(0,8)?d.start+8:void 0}var e=c.line,f=d(e);if(null==f||null!=d(e-1))return null;for(var g=e;;){var h=d(g+1);if(null==h)break;++g}return{from:a.Pos(e,f+1),to:b.clipPos(a.Pos(g))}}))})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(b,e,f,g){function h(a){var c=i(b,e);if(!c||c.to.line-c.from.lineb.firstLine();)e=a.Pos(e.line-1,0),k=h(!1);if(k&&!k.cleared&&"unfold"!==g){var l=c(b,f);a.on(l,"mousedown",(function(b){m.clear(),a.e_preventDefault(b)}));var m=b.markText(k.from,k.to,{replacedWith:l,clearOnEnter:d(b,f,"clearOnEnter"),__isFold:!0});m.on("clear",(function(c,d){a.signal(b,"unfold",b,c,d)})),a.signal(b,"fold",b,k.from,k.to)}}function c(a,b){var c=d(a,b,"widget");if("string"==typeof c){var e=document.createTextNode(c);c=document.createElement("span"),c.appendChild(e),c.className="CodeMirror-foldmarker"}else c&&(c=c.cloneNode(!0));return c}function d(a,b,c){if(b&&void 0!==b[c])return b[c];var d=a.options.foldOptions;return d&&void 0!==d[c]?d[c]:e[c]}a.newFoldFunction=function(a,c){return function(d,e){b(d,e,{rangeFinder:a,widget:c})}},a.defineExtension("foldCode",(function(a,c,d){b(this,a,c,d)})),a.defineExtension("isFolded",(function(a){for(var b=this.findMarksAt(a),c=0;c=h&&(c=e(f.indicatorOpen))}a.setGutterMarker(b,f.gutter,c),++g}))}function g(a){var b=a.getViewport(),c=a.state.foldGutter;c&&(a.operation((function(){f(a,b.from,b.to)})),c.from=b.from,c.to=b.to)}function h(a,b,c){var e=a.state.foldGutter;if(e){var f=e.options;if(c==f.gutter){var g=d(a,b);g?g.clear():a.foldCode(l(b,0),f.rangeFinder)}}}function i(a){var b=a.state.foldGutter;if(b){var c=b.options;b.from=b.to=0,clearTimeout(b.changeUpdate),b.changeUpdate=setTimeout((function(){g(a)}),c.foldOnChangeTimeSpan||600)}}function j(a){var b=a.state.foldGutter;if(b){var c=b.options;clearTimeout(b.changeUpdate),b.changeUpdate=setTimeout((function(){var c=a.getViewport();b.from==b.to||c.from-b.to>20||b.from-c.to>20?g(a):a.operation((function(){c.fromb.to&&(f(a,b.to,c.to),b.to=c.to)}))}),c.updateViewportTimeSpan||400)}}function k(a,b){var c=a.state.foldGutter;if(c){var d=b.line;d>=c.from&&d=a.max))return a.ch=0,a.text=a.cm.getLine(++a.line),!0}function f(a){if(!(a.line<=a.min))return a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0}function g(a){for(;;){var b=a.text.indexOf(">",a.ch);if(b==-1){if(e(a))continue;return}{if(d(a,b+1)){var c=a.text.lastIndexOf("/",b),f=c>-1&&!/\S/.test(a.text.slice(c+1,b));return a.ch=b+1,f?"selfClose":"regular"}a.ch=b+1}}}function h(a){for(;;){var b=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(b==-1){if(f(a))continue;return}if(d(a,b+1)){p.lastIndex=b,a.ch=b;var c=p.exec(a.text);if(c&&c.index==b)return c}else a.ch=b}}function i(a){for(;;){p.lastIndex=a.ch;var b=p.exec(a.text);if(!b){if(e(a))continue;return}{if(d(a,b.index+1))return a.ch=b.index+b[0].length,b;a.ch=b.index+1}}}function j(a){for(;;){var b=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(b==-1){if(f(a))continue;return}{if(d(a,b+1)){var c=a.text.lastIndexOf("/",b),e=c>-1&&!/\S/.test(a.text.slice(c+1,b));return a.ch=b+1,e?"selfClose":"regular"}a.ch=b}}}function k(a,b){for(var c=[];;){var d,e=i(a),f=a.line,h=a.ch-(e?e[0].length:0);if(!e||!(d=g(a)))return;if("selfClose"!=d)if(e[1]){for(var j=c.length-1;j>=0;--j)if(c[j]==e[2]){c.length=j;break}if(j<0&&(!b||b==e[2]))return{tag:e[2],from:m(f,h),to:m(a.line,a.ch)}}else c.push(e[2])}}function l(a,b){for(var c=[];;){var d=j(a);if(!d)return;if("selfClose"!=d){var e=a.line,f=a.ch,g=h(a);if(!g)return;if(g[1])c.push(g[2]);else{for(var i=c.length-1;i>=0;--i)if(c[i]==g[2]){c.length=i;break}if(i<0&&(!b||b==g[2]))return{tag:g[2],from:m(a.line,a.ch),to:m(e,f)}}}else h(a)}}var m=a.Pos,n="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",o=n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",p=new RegExp("<(/?)(["+n+"]["+o+"]*)","g");a.registerHelper("fold","xml",(function(a,b){for(var d=new c(a,b.line,0);;){var e,f=i(d);if(!f||!(e=g(d))||d.line!=b.line)return;if(!f[1]&&"selfClose"!=e){var h=m(d.line,d.ch),j=k(d,f[2]);return j&&{from:h,to:j.from}}}})),a.findMatchingTag=function(a,d,e){var f=new c(a,d.line,d.ch,e);if(f.text.indexOf(">")!=-1||f.text.indexOf("<")!=-1){var i=g(f),j=i&&m(f.line,f.ch),n=i&&h(f);if(i&&n&&!(b(f,d)>0)){var o={from:m(f.line,f.ch),to:j,tag:n[2]};return"selfClose"==i?{open:o,close:null,at:"open"}:n[1]?{open:l(f,n[2]),close:o,at:"close"}:(f=new c(a,j.line,j.ch,e),{open:o,close:k(f,n[2]),at:"open"})}}},a.findEnclosingTag=function(a,b,d,e){for(var f=new c(a,b.line,b.ch,d);;){var g=l(f,e);if(!g)break;var h=new c(a,b.line,b.ch,d),i=k(h,g.tag);if(i)return{open:g,close:i}}},a.scanForClosingTag=function(a,b,d,e){var f=new c(a,b.line,b.ch,e?{from:0,to:e}:null);return k(f,d)}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],(function(b){a(b,"amd")})):a(CodeMirror,"plain")})((function(a,b){function c(a,b){var c=b;return function(){0==--c&&a()}}function d(b,d){var e=a.modes[b].dependencies;if(!e)return d();for(var f=[],g=0;g-1?e+b.length:e}var f=b.exec(c?a.slice(c):a);return f?f.index+c+(d?f[0].length:0):-1}var d=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:a.startState(b),innerActive:null,inner:null}},copyState:function(c){return{outer:a.copyState(b,c.outer),innerActive:c.innerActive,inner:c.innerActive&&a.copyState(c.innerActive.mode,c.inner)}},token:function(e,f){if(f.innerActive){var g=f.innerActive,h=e.string;if(!g.close&&e.sol())return f.innerActive=f.inner=null,this.token(e,f);var i=g.close?c(h,g.close,e.pos,g.parseDelimiters):-1;if(i==e.pos&&!g.parseDelimiters)return e.match(g.close),f.innerActive=f.inner=null,g.delimStyle&&g.delimStyle+" "+g.delimStyle+"-close";i>-1&&(e.string=h.slice(0,i));var j=g.mode.token(e,f.inner);return i>-1&&(e.string=h),i==e.pos&&g.parseDelimiters&&(f.innerActive=f.inner=null),g.innerStyle&&(j=j?j+" "+g.innerStyle:g.innerStyle),j}for(var k=1/0,h=e.string,l=0;lh)return c.charCoords(a,"local")[b?"top":"bottom"];var d=c.heightAtLine(j,"local");return d+(b?0:j.height)}a!==!1&&this.computeScale();var c=this.cm,d=this.hScale,e=document.createDocumentFragment(),f=this.annotations,g=c.getOption("lineWrapping"),h=g&&1.5*c.defaultTextHeight(),i=null,j=null,k=c.lastLine();if(c.display.barWidth)for(var l,m=0;mk)){for(var o=l||b(n.from,!0)*d,p=b(n.to,!1)*d;mk)&&(l=b(f[m+1].from,!0)*d,!(l>p+.9));)n=f[++m],p=b(n.to,!1)*d;if(p!=o){var q=Math.max(p-o,3),r=e.appendChild(document.createElement("div"));r.style.cssText="position: absolute; right: 0px; width: "+Math.max(c.display.barWidth-1,2)+"px; top: "+(o+this.buttonHeight)+"px; height: "+q+"px",r.className=this.options.className,n.id&&r.setAttribute("annotation-id",n.id)}}}this.div.textContent="",this.div.appendChild(e)},b.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(b,c,d){function e(b){var c=a.wheelEventPixels(b)["horizontal"==f.orientation?"x":"y"],d=f.pos;f.moveTo(f.pos+c),f.pos!=d&&a.e_preventDefault(b)}this.orientation=c,this.scroll=d,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=b+"-"+c,this.inner=this.node.appendChild(document.createElement("div"));var f=this;a.on(this.inner,"mousedown",(function(b){function c(){a.off(document,"mousemove",d),a.off(document,"mouseup",c)}function d(a){return 1!=a.which?c():void f.moveTo(h+(a[e]-g)*(f.total/f.size))}if(1==b.which){a.e_preventDefault(b);var e="horizontal"==f.orientation?"pageX":"pageY",g=b[e],h=f.pos;a.on(document,"mousemove",d),a.on(document,"mouseup",c)}})),a.on(this.node,"click",(function(b){a.e_preventDefault(b);var c,d=f.inner.getBoundingClientRect();c="horizontal"==f.orientation?b.clientXd.right?1:0:b.clientYd.bottom?1:0,f.moveTo(f.pos+c*f.screen)})),a.on(this.node,"mousewheel",e),a.on(this.node,"DOMMouseScroll",e)}function c(a,c,d){this.addClass=a,this.horiz=new b(a,"horizontal",d),c(this.horiz.node),this.vert=new b(a,"vertical",d),c(this.vert.node),this.width=null}b.prototype.setPos=function(a,b){return a<0&&(a=0),a>this.total-this.screen&&(a=this.total-this.screen), -!(!b&&a==this.pos)&&(this.pos=a,this.inner.style["horizontal"==this.orientation?"left":"top"]=a*(this.size/this.total)+"px",!0)},b.prototype.moveTo=function(a){this.setPos(a)&&this.scroll(a,this.orientation)};var d=10;b.prototype.update=function(a,b,c){var e=this.screen!=b||this.total!=a||this.size!=c;e&&(this.screen=b,this.total=a,this.size=c);var f=this.screen*(this.size/this.total);fa.clientWidth+1,e=a.scrollHeight>a.clientHeight+1;return this.vert.node.style.display=e?"block":"none",this.horiz.node.style.display=d?"block":"none",e&&(this.vert.update(a.scrollHeight,a.clientHeight,a.viewHeight-(d?c:0)),this.vert.node.style.bottom=d?c+"px":"0"),d&&(this.horiz.update(a.scrollWidth,a.clientWidth,a.viewWidth-(e?c:0)-a.barLeft),this.horiz.node.style.right=e?c+"px":"0",this.horiz.node.style.left=a.barLeft+"px"),{right:e?c:0,bottom:d?c:0}},c.prototype.setScrollTop=function(a){this.vert.setPos(a)},c.prototype.setScrollLeft=function(a){this.horiz.setPos(a)},c.prototype.clear=function(){var a=this.horiz.node.parentNode;a.removeChild(this.horiz.node),a.removeChild(this.vert.node)},a.scrollbarModel.simple=function(a,b){return new c("CodeMirror-simplescroll",a,b)},a.scrollbarModel.overlay=function(a,b){return new c("CodeMirror-overlayscroll",a,b)}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b,c,d){this.cm=a,this.options=d;var e={listenForChanges:!1};for(var f in d)e[f]=d[f];e.className||(e.className="CodeMirror-search-match"),this.annotation=a.annotateScrollbar(e),this.query=b,this.caseFold=c,this.gap={from:a.firstLine(),to:a.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var g=this;a.on("change",this.changeHandler=function(a,b){g.onChange(b)})}function c(a,b,c){return a<=b?a:Math.max(b,a+c)}a.defineExtension("showMatchesOnScrollbar",(function(a,c,d){return"string"==typeof d&&(d={className:d}),d||(d={}),new b(this,a,c,d)}));var d=1e3;b.prototype.findMatches=function(){if(this.gap){for(var b=0;b=this.gap.to)break;c.to.line>=this.gap.from&&this.matches.splice(b--,1)}for(var e=this.cm.getSearchCursor(this.query,a.Pos(this.gap.from,0),this.caseFold),f=this.options&&this.options.maxMatches||d;e.findNext();){var c={from:e.from(),to:e.to()};if(c.from.line>=this.gap.to)break;if(this.matches.splice(b++,0,c),this.matches.length>f)break}this.gap=null}},b.prototype.onChange=function(b){var d=b.from.line,e=a.changeEnd(b).line,f=e-b.to.line;if(this.gap?(this.gap.from=Math.min(c(this.gap.from,d,f),b.from.line),this.gap.to=Math.max(c(this.gap.to,d,f),b.from.line)):this.gap={from:b.from.line,to:e+1},f)for(var g=0;g=b.options.minChars&&f(a,m,!1,b.options.style)}}))}function i(a,b,c){var d=a.getRange(b,c);if(null!==d.match(/^\w+$/)){if(b.ch>0){var e={line:b.line,ch:b.ch-1},f=a.getRange(e,b);if(null===f.match(/\W/))return!1}if(c.chj);k++){var l=a.getLine(i++);g=null==g?l:g+"\n"+l}h=2*h,b.lastIndex=f.ch;var m=b.exec(g);if(m){var n=g.slice(0,m.index).split("\n"),o=m[0].split("\n"),q=f.line+n.length-1,r=n[n.length-1].length;return{from:p(q,r),to:p(q+o.length-1,1==o.length?r+o[0].length:o[o.length-1].length),match:m}}}}function g(a,b){for(var c,d=0;;){b.lastIndex=d;var e=b.exec(a);if(!e)return c;if(c=e,d=c.index+(c[0].length||1),d==a.length)return c}}function h(a,b,d){b=c(b,"g");for(var e=d.line,f=d.ch,h=a.firstLine();e>=h;e--,f=-1){var i=a.getLine(e);f>-1&&(i=i.slice(0,f));var j=g(i,b);if(j)return{from:p(e,j.index),to:p(e,j.index+j[0].length),match:j}}}function i(a,b,d){b=c(b,"gm");for(var e,f=1,h=d.line,i=a.firstLine();h>=i;){for(var j=0;j>1,h=d(a.slice(0,g)).length;if(h==c)return g;h>c?f=g:e=g+1}}function k(a,b,c,d){if(!b.length)return null;var e=d?n:o,f=e(b).split(/\r|\n\r?/);a:for(var g=c.line,h=c.ch,i=a.lastLine()+1-f.length;g<=i;g++,h=0){var k=a.getLine(g).slice(h),l=e(k);if(1==f.length){var m=l.indexOf(f[0]);if(m==-1)continue a;var c=j(k,l,m,e)+h;return{from:p(g,j(k,l,m,e)+h),to:p(g,j(k,l,m+f[0].length,e)+h)}}var q=l.length-f[0].length;if(l.slice(q)==f[0]){for(var r=1;r=i;g--,h=-1){var k=a.getLine(g);h>-1&&(k=k.slice(0,h));var l=e(k);if(1==f.length){var m=l.lastIndexOf(f[0]);if(m==-1)continue a;return{from:p(g,j(k,l,m,e)),to:p(g,j(k,l,m+f[0].length,e))}}var q=f[f.length-1];if(l.slice(0,q.length)==q){for(var r=1,c=g-f.length+1;r0);)d.push({anchor:e.from(),head:e.to()});d.length&&this.setSelections(d,0)}))})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a){for(var b=0;b-1&&b.substring(e+1,b.length);if(f)return a.findModeByExtension(f)},a.findModeByName=function(b){b=b.toLowerCase();for(var c=0;c=0;h--){var j=g[h].head;c.replaceRange("",n(j.line,j.ch-1),n(j.line,j.ch+1),"+delete")}}function g(c){var d=e(c),f=d&&b(d,"explode");if(!f||c.getOption("disableInput"))return a.Pass;for(var g=c.listSelections(),h=0;h0;return{anchor:new n(b.anchor.line,b.anchor.ch+(c?-1:1)),head:new n(b.head.line,b.head.ch+(c?1:-1))}}function i(c,d){var f=e(c);if(!f||c.getOption("disableInput"))return a.Pass;var g=b(f,"pairs"),i=g.indexOf(d);if(i==-1)return a.Pass;for(var k,m=b(f,"triples"),o=g.charAt(i+1)==d,p=c.listSelections(),q=i%2==0,r=0;r1&&m.indexOf(d)>=0&&c.getRange(n(u.line,u.ch-2),u)==d+d){if(u.ch>2&&/\bstring/.test(c.getTokenTypeAt(n(u.line,u.ch-2))))return a.Pass;s="addFour"}else if(o){var w=0==u.ch?" ":c.getRange(n(u.line,u.ch-1),u);if(a.isWordChar(v)||w==d||a.isWordChar(w))return a.Pass;s="both"}else{if(!q||c.getLine(u.line).length!=u.ch&&!j(v,g)&&!/\s/.test(v))return a.Pass;s="both"}else s=o&&l(c,u)?"both":m.indexOf(d)>=0&&c.getRange(u,n(u.line,u.ch+3))==d+d+d?"skipThree":"skip";if(k){if(k!=s)return a.Pass}else k=s}var x=i%2?g.charAt(i-1):d,y=i%2?d:g.charAt(i+1);c.operation((function(){if("skip"==k)c.execCommand("goCharRight");else if("skipThree"==k)for(var a=0;a<3;a++)c.execCommand("goCharRight");else if("surround"==k){for(var b=c.getSelections(),a=0;a-1&&c%2==1}function k(a,b){var c=a.getRange(n(b.line,b.ch-1),n(b.line,b.ch+1));return 2==c.length?c:null}function l(a,b){var c=a.getTokenAt(n(b.line,b.ch+1));return/\bstring/.test(c.type)&&c.start==b.ch&&(0==b.ch||!/\bstring/.test(a.getTokenTypeAt(b)))}var m={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},n=a.Pos;a.defineOption("autoCloseBrackets",!1,(function(d,e,f){f&&f!=a.Init&&(d.removeKeyMap(o),d.state.closeBrackets=null),e&&(c(b(e,"pairs")),d.state.closeBrackets=e,d.addKeyMap(o))}));var o={Backspace:f,Enter:g};c(m.pairs+"`")})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],a):a(CodeMirror)})((function(a){function b(b){if(b.getOption("disableInput"))return a.Pass;for(var c=b.listSelections(),d=[],i=b.getOption("autoCloseTags"),j=0;jk.ch&&(r=r.slice(0,r.length-l.end+k.ch));var s=r.toLowerCase();if(!r||"string"==l.type&&(l.end!=k.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||1==l.string.length)||"tag"==l.type&&"closeTag"==n.type||l.string.indexOf("/")==l.string.length-1||p&&e(p,s)>-1||f(b,r,k,n,!0))return a.Pass;var t=q&&e(q,s)>-1;d[j]={indent:t,text:">"+(t?"\n\n":"")+"",newPos:t?a.Pos(k.line+1,0):a.Pos(k.line,k.ch+1)}}for(var u="object"==typeof i&&i.dontIndentOnAutoClose,j=c.length-1;j>=0;j--){var v=d[j];b.replaceRange(v.text,c[j].head,c[j].anchor,"+insert");var w=b.listSelections().slice(0);w[j]={head:v.newPos,anchor:v.newPos},b.setSelections(w),!u&&v.indent&&(b.indentLine(v.newPos.line,null,!0),b.indentLine(v.newPos.line+1,null,!0))}}function c(b,c){for(var d=b.listSelections(),e=[],g=c?"/":""!=b.getLine(k.line).charAt(l.end)&&(o+=">"),e[j]=o}if(b.replaceSelections(e),d=b.listSelections(),!i)for(var j=0;j'"]=function(a){return b(a)}),c.addKeyMap(g)}}));var g=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],h=["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"];a.commands.closeTag=function(a){return c(a)}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){function b(a,b,d){var e=a.getLineHandle(b.line),f=b.ch-1,i=d&&d.afterCursor;null==i&&(i=/(^| )cm-fat-cursor($| )/.test(a.getWrapperElement().className));var j=!i&&f>=0&&h[e.text.charAt(f)]||h[e.text.charAt(++f)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(d&&d.strict&&k>0!=(f==b.ch))return null;var l=a.getTokenTypeAt(g(b.line,f+1)),m=c(a,g(b.line,f+(k>0?1:0)),k,l||null,d);return null==m?null:{from:g(b.line,f),to:m&&m.pos,match:m&&m.ch==j.charAt(0),forward:k>0}}function c(a,b,c,d,e){for(var f=e&&e.maxScanLineLength||1e4,i=e&&e.maxScanLines||1e3,j=[],k=e&&e.bracketRegex?e.bracketRegex:/[(){}[\]]/,l=c>0?Math.min(b.line+i,a.lastLine()+1):Math.max(a.firstLine()-1,b.line-i),m=b.line;m!=l;m+=c){var n=a.getLine(m);if(n){var o=c>0?0:n.length-1,p=c>0?n.length:-1;if(!(n.length>f))for(m==b.line&&(o=b.ch-(c<0?1:0));o!=p;o+=c){var q=n.charAt(o);if(k.test(q)&&(void 0===d||a.getTokenTypeAt(g(m,o+1))==d)){var r=h[q];if(">"==r.charAt(1)==c>0)j.push(q);else{if(!j.length)return{pos:g(m,o),ch:q};j.pop()}}}}}return m-c!=(c>0?a.lastLine():a.firstLine())&&null}function d(a,c,d){for(var e=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};a.defineOption("matchBrackets",!1,(function(b,c,d){d&&d!=a.Init&&(b.off("cursorActivity",e),b.state.matchBrackets&&b.state.matchBrackets.currentlyHighlighted&&(b.state.matchBrackets.currentlyHighlighted(),b.state.matchBrackets.currentlyHighlighted=null)),c&&(b.state.matchBrackets="object"==typeof c?c:{},b.on("cursorActivity",e))})),a.defineExtension("matchBrackets",(function(){d(this,!0)})),a.defineExtension("findMatchingBracket",(function(a,c,d){return(d||"boolean"==typeof c)&&(d?(d.strict=c,c=d):c=c?{strict:!0}:null),b(this,a,c)})),a.defineExtension("scanForBracket",(function(a,b,d,e){return c(this,a,b,d,e)}))})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],a):a(CodeMirror)})((function(a){"use strict";function b(a){a.state.tagHit&&a.state.tagHit.clear(),a.state.tagOther&&a.state.tagOther.clear(),a.state.tagHit=a.state.tagOther=null}function c(c){c.state.failedTagMatch=!1,c.operation((function(){if(b(c),!c.somethingSelected()){var d=c.getCursor(),e=c.getViewport();e.from=Math.min(e.from,d.line),e.to=Math.max(d.line+1,e.to);var f=a.findMatchingTag(c,d,e);if(f){if(c.state.matchBothTags){var g="open"==f.at?f.open:f.close;g&&(c.state.tagHit=c.markText(g.from,g.to,{className:"CodeMirror-matchingtag"}))}var h="close"==f.at?f.open:f.close;h?c.state.tagOther=c.markText(h.from,h.to,{className:"CodeMirror-matchingtag"}):c.state.failedTagMatch=!0}}}))}function d(a){a.state.failedTagMatch&&c(a)}a.defineOption("matchTags",!1,(function(e,f,g){g&&g!=a.Init&&(e.off("cursorActivity",c),e.off("viewportChange",d),b(e)),f&&(e.state.matchBothTags="object"==typeof f&&f.bothTags,e.on("cursorActivity",c),e.on("viewportChange",d),c(e))})),a.commands.toMatchingTag=function(b){var c=a.findMatchingTag(b,b.getCursor());if(c){var d="close"==c.at?c.open:c.close;d&&b.extendSelection(d.to,d.from)}}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";a.registerHelper("fold","brace",(function(b,c){function d(d){for(var h=c.ch,i=0;;){var j=h<=0?-1:g.lastIndexOf(d,h-1);if(j!=-1){if(1==i&&jb.lastLine())return null;var d=b.getTokenAt(a.Pos(c,1));if(/\S/.test(d.string)||(d=b.getTokenAt(a.Pos(c,d.end+1))),"keyword"!=d.type||"import"!=d.string)return null;for(var e=c,f=Math.min(b.lastLine(),c+10);e<=f;++e){var g=b.getLine(e),h=g.indexOf(";");if(h!=-1)return{startCh:d.end,end:a.Pos(e,h)}}}var e,f=c.line,g=d(f);if(!g||d(f-1)||(e=d(f-2))&&e.end.line==f-1)return null;for(var h=g.end;;){var i=d(h.line+1);if(null==i)break;h=i.end}return{from:b.clipPos(a.Pos(f,g.startCh+1)),to:h}})),a.registerHelper("fold","include",(function(b,c){function d(c){if(cb.lastLine())return null;var d=b.getTokenAt(a.Pos(c,1));return/\S/.test(d.string)||(d=b.getTokenAt(a.Pos(c,d.end+1))),"meta"==d.type&&"#include"==d.string.slice(0,8)?d.start+8:void 0}var e=c.line,f=d(e);if(null==f||null!=d(e-1))return null;for(var g=e;;){var h=d(g+1);if(null==h)break;++g}return{from:a.Pos(e,f+1),to:b.clipPos(a.Pos(g))}}))})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(b,e,f,g){function h(a){var c=i(b,e);if(!c||c.to.line-c.from.lineb.firstLine();)e=a.Pos(e.line-1,0),k=h(!1);if(k&&!k.cleared&&"unfold"!==g){var l=c(b,f);a.on(l,"mousedown",(function(b){m.clear(),a.e_preventDefault(b)}));var m=b.markText(k.from,k.to,{replacedWith:l,clearOnEnter:d(b,f,"clearOnEnter"),__isFold:!0});m.on("clear",(function(c,d){a.signal(b,"unfold",b,c,d)})),a.signal(b,"fold",b,k.from,k.to)}}function c(a,b){var c=d(a,b,"widget");if("string"==typeof c){var e=document.createTextNode(c);c=document.createElement("span"),c.appendChild(e),c.className="CodeMirror-foldmarker"}else c&&(c=c.cloneNode(!0));return c}function d(a,b,c){if(b&&void 0!==b[c])return b[c];var d=a.options.foldOptions;return d&&void 0!==d[c]?d[c]:e[c]}a.newFoldFunction=function(a,c){return function(d,e){b(d,e,{rangeFinder:a,widget:c})}},a.defineExtension("foldCode",(function(a,c,d){b(this,a,c,d)})),a.defineExtension("isFolded",(function(a){for(var b=this.findMarksAt(a),c=0;c=h&&(c=e(f.indicatorOpen))}a.setGutterMarker(b,f.gutter,c),++g}))}function g(a){var b=a.getViewport(),c=a.state.foldGutter;c&&(a.operation((function(){f(a,b.from,b.to)})),c.from=b.from,c.to=b.to)}function h(a,b,c){var e=a.state.foldGutter;if(e){var f=e.options;if(c==f.gutter){var g=d(a,b);g?g.clear():a.foldCode(l(b,0),f.rangeFinder)}}}function i(a){var b=a.state.foldGutter;if(b){var c=b.options;b.from=b.to=0,clearTimeout(b.changeUpdate),b.changeUpdate=setTimeout((function(){g(a)}),c.foldOnChangeTimeSpan||600)}}function j(a){var b=a.state.foldGutter;if(b){var c=b.options;clearTimeout(b.changeUpdate),b.changeUpdate=setTimeout((function(){var c=a.getViewport();b.from==b.to||c.from-b.to>20||b.from-c.to>20?g(a):a.operation((function(){c.fromb.to&&(f(a,b.to,c.to),b.to=c.to)}))}),c.updateViewportTimeSpan||400)}}function k(a,b){var c=a.state.foldGutter;if(c){var d=b.line;d>=c.from&&d=a.max))return a.ch=0,a.text=a.cm.getLine(++a.line),!0}function f(a){if(!(a.line<=a.min))return a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0}function g(a){for(;;){var b=a.text.indexOf(">",a.ch);if(b==-1){if(e(a))continue;return}{if(d(a,b+1)){var c=a.text.lastIndexOf("/",b),f=c>-1&&!/\S/.test(a.text.slice(c+1,b));return a.ch=b+1,f?"selfClose":"regular"}a.ch=b+1}}}function h(a){for(;;){var b=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(b==-1){if(f(a))continue;return}if(d(a,b+1)){p.lastIndex=b,a.ch=b;var c=p.exec(a.text);if(c&&c.index==b)return c}else a.ch=b}}function i(a){for(;;){p.lastIndex=a.ch;var b=p.exec(a.text);if(!b){if(e(a))continue;return}{if(d(a,b.index+1))return a.ch=b.index+b[0].length,b;a.ch=b.index+1}}}function j(a){for(;;){var b=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(b==-1){if(f(a))continue;return}{if(d(a,b+1)){var c=a.text.lastIndexOf("/",b),e=c>-1&&!/\S/.test(a.text.slice(c+1,b));return a.ch=b+1,e?"selfClose":"regular"}a.ch=b}}}function k(a,b){for(var c=[];;){var d,e=i(a),f=a.line,h=a.ch-(e?e[0].length:0);if(!e||!(d=g(a)))return;if("selfClose"!=d)if(e[1]){for(var j=c.length-1;j>=0;--j)if(c[j]==e[2]){c.length=j;break}if(j<0&&(!b||b==e[2]))return{tag:e[2],from:m(f,h),to:m(a.line,a.ch)}}else c.push(e[2])}}function l(a,b){for(var c=[];;){var d=j(a);if(!d)return;if("selfClose"!=d){var e=a.line,f=a.ch,g=h(a);if(!g)return;if(g[1])c.push(g[2]);else{for(var i=c.length-1;i>=0;--i)if(c[i]==g[2]){c.length=i;break}if(i<0&&(!b||b==g[2]))return{tag:g[2],from:m(a.line,a.ch),to:m(e,f)}}}else h(a)}}var m=a.Pos,n="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",o=n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",p=new RegExp("<(/?)(["+n+"]["+o+"]*)","g");a.registerHelper("fold","xml",(function(a,d){for(var e=new c(a,d.line,0);;){var f=i(e);if(!f||e.line!=d.line)return;var h=g(e);if(!h)return;if(!f[1]&&"selfClose"!=h){var j=m(e.line,e.ch),l=k(e,f[2]);return l&&b(l.from,j)>0?{from:j,to:l.from}:null}}})),a.findMatchingTag=function(a,d,e){var f=new c(a,d.line,d.ch,e);if(f.text.indexOf(">")!=-1||f.text.indexOf("<")!=-1){var i=g(f),j=i&&m(f.line,f.ch),n=i&&h(f);if(i&&n&&!(b(f,d)>0)){var o={from:m(f.line,f.ch),to:j,tag:n[2]};return"selfClose"==i?{open:o,close:null,at:"open"}:n[1]?{open:l(f,n[2]),close:o,at:"close"}:(f=new c(a,j.line,j.ch,e),{open:o,close:k(f,n[2]),at:"open"})}}},a.findEnclosingTag=function(a,b,d,e){for(var f=new c(a,b.line,b.ch,d);;){var g=l(f,e);if(!g)break;var h=new c(a,b.line,b.ch,d),i=k(h,g.tag);if(i)return{open:g,close:i}}},a.scanForClosingTag=function(a,b,d,e){var f=new c(a,b.line,b.ch,e?{from:0,to:e}:null);return k(f,d)}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],(function(b){a(b,"amd")})):a(CodeMirror,"plain")})((function(a,b){function c(a,b){var c=b;return function(){0==--c&&a()}}function d(b,d){var e=a.modes[b].dependencies;if(!e)return d();for(var f=[],g=0;g-1?e+b.length:e}var f=b.exec(c?a.slice(c):a);return f?f.index+c+(d?f[0].length:0):-1}var d=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:a.startState(b),innerActive:null,inner:null}},copyState:function(c){return{outer:a.copyState(b,c.outer),innerActive:c.innerActive,inner:c.innerActive&&a.copyState(c.innerActive.mode,c.inner)}},token:function(e,f){if(f.innerActive){var g=f.innerActive,h=e.string;if(!g.close&&e.sol())return f.innerActive=f.inner=null,this.token(e,f);var i=g.close?c(h,g.close,e.pos,g.parseDelimiters):-1;if(i==e.pos&&!g.parseDelimiters)return e.match(g.close),f.innerActive=f.inner=null,g.delimStyle&&g.delimStyle+" "+g.delimStyle+"-close";i>-1&&(e.string=h.slice(0,i));var j=g.mode.token(e,f.inner);return i>-1&&(e.string=h),i==e.pos&&g.parseDelimiters&&(f.innerActive=f.inner=null),g.innerStyle&&(j=j?j+" "+g.innerStyle:g.innerStyle),j}for(var k=1/0,h=e.string,l=0;lh)return c.charCoords(a,"local")[b?"top":"bottom"];var d=c.heightAtLine(j,"local");return d+(b?0:j.height)}a!==!1&&this.computeScale();var c=this.cm,d=this.hScale,e=document.createDocumentFragment(),f=this.annotations,g=c.getOption("lineWrapping"),h=g&&1.5*c.defaultTextHeight(),i=null,j=null,k=c.lastLine();if(c.display.barWidth)for(var l,m=0;mk)){for(var o=l||b(n.from,!0)*d,p=b(n.to,!1)*d;mk)&&(l=b(f[m+1].from,!0)*d,!(l>p+.9));)n=f[++m],p=b(n.to,!1)*d;if(p!=o){var q=Math.max(p-o,3),r=e.appendChild(document.createElement("div"));r.style.cssText="position: absolute; right: 0px; width: "+Math.max(c.display.barWidth-1,2)+"px; top: "+(o+this.buttonHeight)+"px; height: "+q+"px",r.className=this.options.className,n.id&&r.setAttribute("annotation-id",n.id)}}}this.div.textContent="",this.div.appendChild(e)},b.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(b,c,d){function e(b){var c=a.wheelEventPixels(b)["horizontal"==f.orientation?"x":"y"],d=f.pos;f.moveTo(f.pos+c),f.pos!=d&&a.e_preventDefault(b)}this.orientation=c,this.scroll=d,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=b+"-"+c,this.inner=this.node.appendChild(document.createElement("div"));var f=this;a.on(this.inner,"mousedown",(function(b){function c(){a.off(document,"mousemove",d),a.off(document,"mouseup",c)}function d(a){return 1!=a.which?c():void f.moveTo(h+(a[e]-g)*(f.total/f.size))}if(1==b.which){a.e_preventDefault(b);var e="horizontal"==f.orientation?"pageX":"pageY",g=b[e],h=f.pos;a.on(document,"mousemove",d),a.on(document,"mouseup",c)}})),a.on(this.node,"click",(function(b){a.e_preventDefault(b);var c,d=f.inner.getBoundingClientRect();c="horizontal"==f.orientation?b.clientXd.right?1:0:b.clientYd.bottom?1:0,f.moveTo(f.pos+c*f.screen)})),a.on(this.node,"mousewheel",e),a.on(this.node,"DOMMouseScroll",e)}function c(a,c,d){this.addClass=a,this.horiz=new b(a,"horizontal",d),c(this.horiz.node),this.vert=new b(a,"vertical",d),c(this.vert.node),this.width=null; +}b.prototype.setPos=function(a,b){return a<0&&(a=0),a>this.total-this.screen&&(a=this.total-this.screen),!(!b&&a==this.pos)&&(this.pos=a,this.inner.style["horizontal"==this.orientation?"left":"top"]=a*(this.size/this.total)+"px",!0)},b.prototype.moveTo=function(a){this.setPos(a)&&this.scroll(a,this.orientation)};var d=10;b.prototype.update=function(a,b,c){var e=this.screen!=b||this.total!=a||this.size!=c;e&&(this.screen=b,this.total=a,this.size=c);var f=this.screen*(this.size/this.total);fa.clientWidth+1,e=a.scrollHeight>a.clientHeight+1;return this.vert.node.style.display=e?"block":"none",this.horiz.node.style.display=d?"block":"none",e&&(this.vert.update(a.scrollHeight,a.clientHeight,a.viewHeight-(d?c:0)),this.vert.node.style.bottom=d?c+"px":"0"),d&&(this.horiz.update(a.scrollWidth,a.clientWidth,a.viewWidth-(e?c:0)-a.barLeft),this.horiz.node.style.right=e?c+"px":"0",this.horiz.node.style.left=a.barLeft+"px"),{right:e?c:0,bottom:d?c:0}},c.prototype.setScrollTop=function(a){this.vert.setPos(a)},c.prototype.setScrollLeft=function(a){this.horiz.setPos(a)},c.prototype.clear=function(){var a=this.horiz.node.parentNode;a.removeChild(this.horiz.node),a.removeChild(this.vert.node)},a.scrollbarModel.simple=function(a,b){return new c("CodeMirror-simplescroll",a,b)},a.scrollbarModel.overlay=function(a,b){return new c("CodeMirror-overlayscroll",a,b)}})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b,c,d){this.cm=a,this.options=d;var e={listenForChanges:!1};for(var f in d)e[f]=d[f];e.className||(e.className="CodeMirror-search-match"),this.annotation=a.annotateScrollbar(e),this.query=b,this.caseFold=c,this.gap={from:a.firstLine(),to:a.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var g=this;a.on("change",this.changeHandler=function(a,b){g.onChange(b)})}function c(a,b,c){return a<=b?a:Math.max(b,a+c)}a.defineExtension("showMatchesOnScrollbar",(function(a,c,d){return"string"==typeof d&&(d={className:d}),d||(d={}),new b(this,a,c,d)}));var d=1e3;b.prototype.findMatches=function(){if(this.gap){for(var b=0;b=this.gap.to)break;c.to.line>=this.gap.from&&this.matches.splice(b--,1)}for(var e=this.cm.getSearchCursor(this.query,a.Pos(this.gap.from,0),this.caseFold),f=this.options&&this.options.maxMatches||d;e.findNext();){var c={from:e.from(),to:e.to()};if(c.from.line>=this.gap.to)break;if(this.matches.splice(b++,0,c),this.matches.length>f)break}this.gap=null}},b.prototype.onChange=function(b){var d=b.from.line,e=a.changeEnd(b).line,f=e-b.to.line;if(this.gap?(this.gap.from=Math.min(c(this.gap.from,d,f),b.from.line),this.gap.to=Math.max(c(this.gap.to,d,f),b.from.line)):this.gap={from:b.from.line,to:e+1},f)for(var g=0;g=b.options.minChars&&f(a,m,!1,b.options.style)}}))}function i(a,b,c){var d=a.getRange(b,c);if(null!==d.match(/^\w+$/)){if(b.ch>0){var e={line:b.line,ch:b.ch-1},f=a.getRange(e,b);if(null===f.match(/\W/))return!1}if(c.chj);k++){var l=a.getLine(i++);g=null==g?l:g+"\n"+l}h=2*h,b.lastIndex=f.ch;var m=b.exec(g);if(m){var n=g.slice(0,m.index).split("\n"),o=m[0].split("\n"),q=f.line+n.length-1,r=n[n.length-1].length;return{from:p(q,r),to:p(q+o.length-1,1==o.length?r+o[0].length:o[o.length-1].length),match:m}}}}function g(a,b){for(var c,d=0;;){b.lastIndex=d;var e=b.exec(a);if(!e)return c;if(c=e,d=c.index+(c[0].length||1),d==a.length)return c}}function h(a,b,d){b=c(b,"g");for(var e=d.line,f=d.ch,h=a.firstLine();e>=h;e--,f=-1){var i=a.getLine(e);f>-1&&(i=i.slice(0,f));var j=g(i,b);if(j)return{from:p(e,j.index),to:p(e,j.index+j[0].length),match:j}}}function i(a,b,d){b=c(b,"gm");for(var e,f=1,h=d.line,i=a.firstLine();h>=i;){for(var j=0;j>1,h=d(a.slice(0,g)).length;if(h==c)return g;h>c?f=g:e=g+1}}function k(a,b,c,d){if(!b.length)return null;var e=d?n:o,f=e(b).split(/\r|\n\r?/);a:for(var g=c.line,h=c.ch,i=a.lastLine()+1-f.length;g<=i;g++,h=0){var k=a.getLine(g).slice(h),l=e(k);if(1==f.length){var m=l.indexOf(f[0]);if(m==-1)continue a;var c=j(k,l,m,e)+h;return{from:p(g,j(k,l,m,e)+h),to:p(g,j(k,l,m+f[0].length,e)+h)}}var q=l.length-f[0].length;if(l.slice(q)==f[0]){for(var r=1;r=i;g--,h=-1){var k=a.getLine(g);h>-1&&(k=k.slice(0,h));var l=e(k);if(1==f.length){var m=l.lastIndexOf(f[0]);if(m==-1)continue a;return{from:p(g,j(k,l,m,e)),to:p(g,j(k,l,m+f[0].length,e))}}var q=f[f.length-1];if(l.slice(0,q.length)==q){for(var r=1,c=g-f.length+1;r0);)d.push({anchor:e.from(),head:e.to()});d.length&&this.setSelections(d,0)}))})),(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a){for(var b=0;b-1&&b.substring(e+1,b.length);if(f)return a.findModeByExtension(f)},a.findModeByName=function(b){b=b.toLowerCase();for(var c=0;c time - doc.cm.options.historyEventDelay) || + ((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) || change.origin.charAt(0) == "*")) && (cur = lastChangeEvent(hist, hist.lastOp == opId))) { // Merge this change into the last event @@ -5410,7 +5410,7 @@ function makeChangeSingleDocInEditor(cm, change, spans) { function replaceRange(doc, code, from, to, origin) { if (!to) { to = from; } if (cmp(to, from) < 0) { var assign; - (assign = [to, from], from = assign[0], to = assign[1], assign); } + (assign = [to, from], from = assign[0], to = assign[1]); } if (typeof code == "string") { code = doc.splitLines(code); } makeChange(doc, {from: from, to: to, text: code, origin: origin}); } @@ -5506,10 +5506,10 @@ function LeafChunk(lines) { } LeafChunk.prototype = { - chunkSize: function chunkSize() { return this.lines.length }, + chunkSize: function() { return this.lines.length }, // Remove the n lines at offset 'at'. - removeInner: function removeInner(at, n) { + removeInner: function(at, n) { var this$1 = this; for (var i = at, e = at + n; i < e; ++i) { @@ -5522,13 +5522,13 @@ LeafChunk.prototype = { }, // Helper used to collapse a small branch into a single leaf. - collapse: function collapse(lines) { + collapse: function(lines) { lines.push.apply(lines, this.lines); }, // Insert the given array of lines at offset 'at', count them as // having the given height. - insertInner: function insertInner(at, lines, height) { + insertInner: function(at, lines, height) { var this$1 = this; this.height += height; @@ -5537,7 +5537,7 @@ LeafChunk.prototype = { }, // Used to iterate over a part of the tree. - iterN: function iterN(at, n, op) { + iterN: function(at, n, op) { var this$1 = this; for (var e = at + n; at < e; ++at) @@ -5561,9 +5561,9 @@ function BranchChunk(children) { } BranchChunk.prototype = { - chunkSize: function chunkSize() { return this.size }, + chunkSize: function() { return this.size }, - removeInner: function removeInner(at, n) { + removeInner: function(at, n) { var this$1 = this; this.size -= n; @@ -5589,13 +5589,13 @@ BranchChunk.prototype = { } }, - collapse: function collapse(lines) { + collapse: function(lines) { var this$1 = this; for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); } }, - insertInner: function insertInner(at, lines, height) { + insertInner: function(at, lines, height) { var this$1 = this; this.size += lines.length; @@ -5624,7 +5624,7 @@ BranchChunk.prototype = { }, // When a node has grown, check whether it should be split. - maybeSpill: function maybeSpill() { + maybeSpill: function() { if (this.children.length <= 10) { return } var me = this; do { @@ -5646,7 +5646,7 @@ BranchChunk.prototype = { me.parent.maybeSpill(); }, - iterN: function iterN(at, n, op) { + iterN: function(at, n, op) { var this$1 = this; for (var i = 0; i < this.children.length; ++i) { @@ -7324,8 +7324,8 @@ function leftButtonStartDrag(cm, event, pos, behavior) { var dragEnd = operation(cm, function (e) { if (webkit) { display.scroller.draggable = false; } cm.state.draggingText = false; - off(document, "mouseup", dragEnd); - off(document, "mousemove", mouseMove); + off(display.wrapper.ownerDocument, "mouseup", dragEnd); + off(display.wrapper.ownerDocument, "mousemove", mouseMove); off(display.scroller, "dragstart", dragStart); off(display.scroller, "drop", dragEnd); if (!moved) { @@ -7334,7 +7334,7 @@ function leftButtonStartDrag(cm, event, pos, behavior) { { extendSelection(cm.doc, pos, null, null, behavior.extend); } // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) if (webkit || ie && ie_version == 9) - { setTimeout(function () {document.body.focus(); display.input.focus();}, 20); } + { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); } else { display.input.focus(); } } @@ -7349,8 +7349,8 @@ function leftButtonStartDrag(cm, event, pos, behavior) { dragEnd.copy = !behavior.moveOnDrag; // IE's approach to draggable if (display.scroller.dragDrop) { display.scroller.dragDrop(); } - on(document, "mouseup", dragEnd); - on(document, "mousemove", mouseMove); + on(display.wrapper.ownerDocument, "mouseup", dragEnd); + on(display.wrapper.ownerDocument, "mousemove", mouseMove); on(display.scroller, "dragstart", dragStart); on(display.scroller, "drop", dragEnd); @@ -7482,8 +7482,8 @@ function leftButtonSelect(cm, event, start, behavior) { counter = Infinity; e_preventDefault(e); display.input.focus(); - off(document, "mousemove", move); - off(document, "mouseup", up); + off(display.wrapper.ownerDocument, "mousemove", move); + off(display.wrapper.ownerDocument, "mouseup", up); doc.history.lastSelOrigin = null; } @@ -7493,8 +7493,8 @@ function leftButtonSelect(cm, event, start, behavior) { }); var up = operation(cm, done); cm.state.selectingText = up; - on(document, "mousemove", move); - on(document, "mouseup", up); + on(display.wrapper.ownerDocument, "mousemove", move); + on(display.wrapper.ownerDocument, "mouseup", up); } // Used when mouse-selecting to adjust the anchor to the proper side @@ -9017,7 +9017,7 @@ ContentEditableInput.prototype.setUneditable = function (node) { }; ContentEditableInput.prototype.onKeyPress = function (e) { - if (e.charCode == 0) { return } + if (e.charCode == 0 || this.composing) { return } e.preventDefault(); if (!this.cm.isReadOnly()) { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); } @@ -9199,13 +9199,10 @@ TextareaInput.prototype.init = function (display) { var this$1 = this; var input = this, cm = this.cm; + this.createField(display); + var te = this.textarea; - // Wraps and hides input textarea - var div = this.wrapper = hiddenTextarea(); - // The semihidden textarea that is focused when the editor is - // focused, and receives input. - var te = this.textarea = div.firstChild; - display.wrapper.insertBefore(div, display.wrapper.firstChild); + display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild); // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) if (ios) { te.style.width = "0px"; } @@ -9272,6 +9269,14 @@ TextareaInput.prototype.init = function (display) { }); }; +TextareaInput.prototype.createField = function (_display) { + // Wraps and hides input textarea + this.wrapper = hiddenTextarea(); + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + this.textarea = this.wrapper.firstChild; +}; + TextareaInput.prototype.prepareSelection = function () { // Redraw the selection and/or cursor var cm = this.cm, display = cm.display, doc = cm.doc; @@ -9665,7 +9670,7 @@ CodeMirror$1.fromTextArea = fromTextArea; addLegacyProps(CodeMirror$1); -CodeMirror$1.version = "5.35.0"; +CodeMirror$1.version = "5.37.0"; return CodeMirror$1; diff --git a/media/editors/codemirror/lib/codemirror.min.js b/media/editors/codemirror/lib/codemirror.min.js index 8ca46e27bd9bb..a82889408a380 100644 --- a/media/editors/codemirror/lib/codemirror.min.js +++ b/media/editors/codemirror/lib/codemirror.min.js @@ -1,6 +1,6 @@ !(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.CodeMirror=b()})(this,(function(){"use strict";function a(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function b(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function c(a,c){return b(a).appendChild(c)}function d(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}}function m(a,b){for(var c=0;c=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function o(a){for(;Wg.length<=a;)Wg.push(p(Wg)+" ");return Wg[a]}function p(a){return a[a.length-1]}function q(a,b){for(var c=[],d=0;d"€"&&(a.toUpperCase()!=a.toLowerCase()||Xg.test(a))}function v(a,b){return b?!!(b.source.indexOf("\\w")>-1&&u(a))||b.test(a):u(a)}function w(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function x(a){return a.charCodeAt(0)>=768&&Yg.test(a)}function y(a,b,c){for(;(c<0?b>0:bc?-1:1;;){if(b==c)return b;var e=(b+c)/2,f=d<0?Math.ceil(e):Math.floor(e);if(f==b)return a(f)?b:c;a(f)?c=f:b=f+d}}function A(a,b,c){var f=this;this.input=c,f.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=e("div",null,"CodeMirror-code"),f.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=d("div",null,"CodeMirror-cursors"),f.measure=d("div",null,"CodeMirror-measure"),f.lineMeasure=d("div",null,"CodeMirror-measure"),f.lineSpace=e("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var g=e("div",[f.lineSpace],"CodeMirror-lines");f.mover=d("div",[g],null,"position: relative"),f.sizer=d("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=d("div",null,null,"position: absolute; height: "+Rg+"px; width: 1px;"),f.gutters=d("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=d("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=d("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),tg&&ug<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),vg||pg&&Eg||(f.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(f.wrapper):a(f.wrapper)),f.viewFrom=f.viewTo=b.first,f.reportedViewFrom=f.reportedViewTo=b.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,c.init(f)}function B(a,b){if(b-=a.first,b<0||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(b=a.first&&bc?J(c,B(a,c).text.length):R(b,B(a,b.line).text.length)}function R(a,b){var c=a.ch;return null==c||c>b?J(a.line,b):c<0?J(a.line,0):a}function S(a,b){for(var c=[],d=0;d=b:f.to>b);(d||(d=[])).push(new V(g,f.from,i?null:f.to))}}return d}function $(a,b,c){var d;if(a)for(var e=0;e=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from0&&h)for(var v=0;v0)){var k=[i,1],l=K(j.from,h.from),n=K(j.to,h.to);(l<0||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(n>0||!g.inclusiveRight&&!n)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-3}}return e}function ca(a){var b=a.markedSpans;if(b){for(var c=0;c=0&&l<=0||k<=0&&l>=0)&&(k<=0&&(i.marker.inclusiveRight&&e.inclusiveLeft?K(j.to,c)>=0:K(j.to,c)>0)||k>=0&&(i.marker.inclusiveRight&&e.inclusiveLeft?K(j.from,d)<=0:K(j.from,d)<0)))return!0}}}function la(a){for(var b;b=ia(a);)a=b.find(-1,!0).line;return a}function ma(a){for(var b;b=ja(a);)a=b.find(1,!0).line;return a}function na(a){for(var b,c;b=ja(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function oa(a,b){var c=B(a,b),d=la(c);return c==d?b:F(d)}function pa(a,b){if(b>a.lastLine())return b;var c,d=B(a,b);if(!qa(a,d))return b;for(;c=ja(d);)d=c.find(1,!0).line;return F(d)+1}function qa(a,b){var c=$g&&b.markedSpans;if(c)for(var d=void 0,e=0;eb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)}))}function va(a,b,c,d){if(!a)return d(b,c,"ltr",0);for(var e=!1,f=0;fb||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr",f),e=!0)}e||d(b,c,"ltr")}function wa(a,b,c){var d;_g=null;for(var e=0;eb)return e;f.to==b&&(f.from!=f.to&&"before"==c?d=e:_g=e),f.from==b&&(f.from!=f.to&&"before"!=c?d=e:_g=e)}return null!=d?d:_g}function xa(a,b){var c=a.order;return null==c&&(c=a.order=ah(a.text,b)),c}function ya(a,b){return a._handlers&&a._handlers[b]||bh}function za(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=a._handlers,e=d&&d[b];if(e){var f=m(e,c);f>-1&&(d[b]=e.slice(0,f).concat(e.slice(f+1)))}}}function Aa(a,b){var c=ya(a,b);if(c.length)for(var d=Array.prototype.slice.call(arguments,2),e=0;e0}function Ea(a){a.prototype.on=function(a,b){ch(this,a,b)},a.prototype.off=function(a,b){za(this,a,b)}}function Fa(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Ga(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Ha(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function Ia(a){Fa(a),Ga(a)}function Ja(a){return a.target||a.srcElement}function Ka(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),Fg&&a.ctrlKey&&1==b&&(b=3),b}function La(a){if(null==Pg){var b=d("span","​");c(a,d("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Pg=b.offsetWidth<=1&&b.offsetHeight>2&&!(tg&&ug<8))}var e=Pg?d("span","​"):d("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return e.setAttribute("cm-text",""),e}function Ma(a){if(null!=Qg)return Qg;var d=c(a,document.createTextNode("AخA")),e=Jg(d,0,1).getBoundingClientRect(),f=Jg(d,1,2).getBoundingClientRect();return b(a),!(!e||e.left==e.right)&&(Qg=f.right-e.right<3)}function Na(a){if(null!=hh)return hh;var b=c(a,d("span","x")),e=b.getBoundingClientRect(),f=Jg(b,0,1).getBoundingClientRect();return hh=Math.abs(e.left-f.left)>1}function Oa(a,b){arguments.length>2&&(b.dependencies=Array.prototype.slice.call(arguments,2)),ih[a]=b}function Pa(a,b){jh[a]=b}function Qa(a){if("string"==typeof a&&jh.hasOwnProperty(a))a=jh[a];else if(a&&"string"==typeof a.name&&jh.hasOwnProperty(a.name)){var b=jh[a.name];"string"==typeof b&&(b={name:b}),a=t(b,a),a.name=b.name}else{if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return Qa("application/xml");if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+json$/.test(a))return Qa("application/json")}return"string"==typeof a?{name:a}:a||{name:"null"}}function Ra(a,b){b=Qa(b);var c=ih[b.name];if(!c)return Ra(a,"text/plain");var d=c(a,b);if(kh.hasOwnProperty(b.name)){var e=kh[b.name];for(var f in e)e.hasOwnProperty(f)&&(d.hasOwnProperty(f)&&(d["_"+f]=d[f]),d[f]=e[f])}if(d.name=b.name,b.helperType&&(d.helperType=b.helperType),b.modeProps)for(var g in b.modeProps)d[g]=b.modeProps[g];return d}function Sa(a,b){var c=kh.hasOwnProperty(a)?kh[a]:kh[a]={};k(b,c)}function Ta(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function Ua(a,b){for(var c;a.innerMode&&(c=a.innerMode(b),c&&c.mode!=a);)b=c.state,a=c.mode;return c||{mode:a,state:b}}function Va(a,b,c){return!a.startState||a.startState(b,c)}function Wa(a,b,c,d){var e=[a.state.modeGen],f={};cb(a,b.text,a.doc.mode,c,(function(a,b){return e.push(a,b)}),f,d);for(var g=c.state,h=function(d){c.baseTokens=e;var h=a.state.overlays[d],i=1,j=0;c.state=!0,cb(a,b.text,h.mode,c,(function(a,b){for(var c=i;ja&&e.splice(i,1,a,e[i+1],d),i+=2,j=Math.min(a,d)}if(b)if(h.opaque)e.splice(c,i-c,a,"overlay "+b),i=c+2;else for(;ca.options.maxHighlightLength&&Ta(a.doc.mode,d.state),f=Wa(a,b,d);e&&(d.state=e),b.stateAfter=d.save(!e),b.styles=f.styles,f.classes?b.styleClasses=f.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.highlightFrontier&&(a.doc.modeFrontier=Math.max(a.doc.modeFrontier,++a.doc.highlightFrontier))}return b.styles}function Ya(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return new nh(d,!0,b);var f=db(a,b,c),g=f>d.first&&B(d,f-1).stateAfter,h=g?nh.fromSaved(d,g,f):new nh(d,Va(d.mode),f);return d.iter(f,b,(function(c){Za(a,c.text,h);var d=h.line;c.stateAfter=d==b-1||d%5==0||d>=e.viewFrom&&db.start)return f}throw new Error("Mode "+a.name+" failed to advance stream.")}function ab(a,b,c,d){var e,f=a.doc,g=f.mode;b=Q(f,b);var h,i=B(f,b.line),j=Ya(a,b.line,c),k=new lh(i.text,a.options.tabSize,j);for(d&&(h=[]);(d||k.posa.options.maxHighlightLength?(h=!1,g&&Za(a,b,d,l.pos),l.pos=b.length,i=null):i=bb(_a(c,l,d.state,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;jg;--h){if(h<=f.first)return f.first;var i=B(f,h-1),j=i.stateAfter;if(j&&(!c||h+(j instanceof mh?j.lookAhead:0)<=f.modeFrontier))return h;var k=l(i.text,null,a.options.tabSize);(null==e||d>k)&&(e=h-1,d=k)}return e}function eb(a,b){if(a.modeFrontier=Math.min(a.modeFrontier,b),!(a.highlightFrontierc;d--){var e=B(a,d).stateAfter;if(e&&(!(e instanceof mh)||d+e.lookAhead1&&!/ /.test(a))return a;for(var c=b,d="",e=0;ej&&l.from<=j));m++);if(l.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,l.to-j),e,f,null,h,i),f=null,d=d.slice(l.to-j),j=l.to}}}function nb(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e),!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id)),e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e)),a.pos+=b,a.trailingSpace=!1}function ob(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m,n=e.length,o=0,p=1,q="",r=0;;){if(r==o){i=j=k=l=h="",m=null,r=1/0;for(var s=[],t=void 0,u=0;uo||w.collapsed&&v.to==o&&v.from==o)?(null!=v.to&&v.to!=o&&r>v.to&&(r=v.to,j=""),w.className&&(i+=" "+w.className),w.css&&(h=(h?h+";":"")+w.css),w.startStyle&&v.from==o&&(k+=" "+w.startStyle),w.endStyle&&v.to==r&&(t||(t=[])).push(w.endStyle,v.to),w.title&&!l&&(l=w.title),w.collapsed&&(!m||ga(m.marker,w)<0)&&(m=v)):v.from>o&&r>v.from&&(r=v.from)}if(t)for(var x=0;x=n)break;for(var z=Math.min(n,r);;){if(q){var A=o+q.length;if(!m){var B=A>z?q.slice(0,z-o):q;b.addToken(b,B,g?g+i:i,k,o+B.length==r?j:"",l,h)}if(A>=z){q=q.slice(z-o),o=z;break}o=A,k=""}q=e.slice(f,f=c[p++]),g=hb(c[p++],b.cm.options)}}else for(var C=1;C2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Rb(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;dc)return{map:a.measure.maps[e],cache:a.measure.caches[e],before:!0}}function Sb(a,b){b=la(b);var d=F(b),e=a.display.externalMeasured=new pb(a.doc,b,d);e.lineN=d;var f=e.built=ib(a,e);return e.text=f.pre,c(a.display.lineMeasure,f.pre),e}function Tb(a,b,c,d){return Wb(a,Vb(a,b),c,d)}function Ub(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bb)&&(f=i-h,e=f-1,b>=i&&(g="right")),null!=e){if(d=a[j+2],h==i&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;j&&a[j-2]==a[j-3]&&a[j-1].insertLeft;)d=a[(j-=3)+2],g="left";if("right"==c&&e==i-h)for(;j=0&&(c=a[e]).left==c.right;e--);return c}function Zb(a,b,c,d){var e,f=Xb(b.map,c,d),g=f.node,h=f.start,i=f.end,j=f.collapse; if(3==g.nodeType){for(var k=0;k<4;k++){for(;h&&x(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+i0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(tg&&ug<9&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+tc(a.display),top:m.top,bottom:m.bottom}:vh}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,r=0;r=d.text.length?(j=d.text.length,k="before"):j<=0&&(j=0,k="after"),!i)return g("before"==k?j-1:j,"before"==k);var l=wa(i,j,k),m=_g,n=h(j,l,"before"==k);return null!=m&&(n.other=h(j,m,"before"!=k)),n}function jc(a,b){var c=0;b=Q(a.doc,b),a.options.lineWrapping||(c=tc(a.display)*b.ch);var d=B(a.doc,b.line),e=sa(d)+Kb(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function kc(a,b,c,d,e){var f=J(a,b,c);return f.xRel=e,d&&(f.outside=!0),f}function lc(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,c<0)return kc(d.first,0,null,!0,-1);var e=G(d,c),f=d.first+d.size-1;if(e>f)return kc(d.first+d.size-1,B(d,f).text.length,null,!0,1);b<0&&(b=0);for(var g=B(d,e);;){var h=pc(a,g,e,b,c),i=ja(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=F(g=j.to.line)}}function mc(a,b,c,d){d-=ec(b);var e=b.text.length,f=z((function(b){return Wb(a,c,b-1).bottom<=d}),e,0);return e=z((function(b){return Wb(a,c,b).top>d}),f,e),{begin:f,end:e}}function nc(a,b,c,d){c||(c=Vb(a,b));var e=fc(a,b,Wb(a,c,d),"line").top;return mc(a,b,c,e)}function oc(a,b,c,d){return!(a.bottom<=c)&&(a.top>c||(d?a.left:a.right)>b)}function pc(a,b,c,d,e){e-=sa(b);var f=Vb(a,b),g=ec(b),h=0,i=b.text.length,j=!0,k=xa(b,a.doc.direction);if(k){var l=(a.options.lineWrapping?rc:qc)(a,b,c,f,k,d,e);j=1!=l.level,h=j?l.from:l.to-1,i=j?l.to:l.from-1}var m,n,o=null,p=null,q=z((function(b){var c=Wb(a,f,b);return c.top+=g,c.bottom+=g,!!oc(c,d,e,!1)&&(c.top<=e&&c.left<=d&&(o=b,p=c),!0)}),h,i),r=!1;if(p){var s=d-p.left=u.bottom}return q=y(b.text,q,1),kc(c,q,n,r,d-m)}function qc(a,b,c,d,e,f,g){var h=z((function(h){var i=e[h],j=1!=i.level;return oc(ic(a,J(c,j?i.to:i.from,j?"before":"after"),"line",b,d),f,g,!0)}),0,e.length-1),i=e[h];if(h>0){var j=1!=i.level,k=ic(a,J(c,j?i.from:i.to,j?"after":"before"),"line",b,d);oc(k,f,g,!0)&&k.top>g&&(i=e[h-1])}return i}function rc(a,b,c,d,e,f,g){var h=mc(a,b,d,g),i=h.begin,j=h.end;/\s/.test(b.text.charAt(j-1))&&j--;for(var k=null,l=null,m=0;m=j||n.to<=i)){var o=1!=n.level,p=Wb(a,d,o?Math.min(j,n.to)-1:Math.max(i,n.from)).right,q=pq)&&(k=n,l=q)}}return k||(k=e[e.length-1]),k.fromj&&(k={from:k.from,to:j,level:k.level}),k}function sc(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==qh){qh=d("pre");for(var e=0;e<49;++e)qh.appendChild(document.createTextNode("x")),qh.appendChild(d("br"));qh.appendChild(document.createTextNode("x"))}c(a.measure,qh);var f=qh.offsetHeight/50;return f>3&&(a.cachedTextHeight=f),b(a.measure),f||1}function tc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=d("span","xxxxxxxxxx"),e=d("pre",[b]);c(a.measure,e);var f=b.getBoundingClientRect(),g=(f.right-f.left)/10;return g>2&&(a.cachedCharWidth=g),g||10}function uc(a){for(var b=a.display,c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:vc(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function vc(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function wc(a){var b=sc(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/tc(a.display)-3);return function(e){if(qa(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g=a.display.viewTo)return null;if(b-=a.display.viewFrom,b<0)return null;for(var c=a.display.view,d=0;d=a.display.viewTo||h.to().line0?b.blinker=setInterval((function(){return b.cursorDiv.style.visibility=(c=!c)?"":"hidden"}),a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Gc(a){a.state.focused||(a.display.input.focus(),Ic(a))}function Hc(a){a.state.delayingBlurEvent=!0,setTimeout((function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,Jc(a))}),100)}function Ic(a,b){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(Aa(a,"focus",a,b),a.state.focused=!0,h(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),vg&&setTimeout((function(){return a.display.input.reset(!0)}),20)),a.display.input.receivedFocus()),Fc(a))}function Jc(a,b){a.state.delayingBlurEvent||(a.state.focused&&(Aa(a,"blur",a,b),a.state.focused=!1,Mg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout((function(){a.state.focused||(a.display.shift=!1)}),150))}function Kc(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;d.005||i<-.005)&&(E(e.line,f),Lc(e.line),e.rest))for(var j=0;j=g&&(f=G(b,sa(B(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function Nc(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=vc(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),null!=f&&!Bg){var g=d("div","​",null,"position: absolute;\n top: "+(b.top-c.viewOffset-Kb(a.display))+"px;\n height: "+(b.bottom-b.top+Nb(a)+c.barHeight)+"px;\n left: "+b.left+"px; width: "+Math.max(2,b.right-b.left)+"px;");a.display.lineSpace.appendChild(g),g.scrollIntoView(f),a.display.lineSpace.removeChild(g)}}}function Qc(a,b,c,d){null==d&&(d=0);var e;a.options.lineWrapping||b!=c||(b=b.ch?J(b.line,"before"==b.sticky?b.ch-1:b.ch,"after"):b,c="before"==b.sticky?J(b.line,b.ch+1,"before"):b);for(var f=0;f<5;f++){var g=!1,h=ic(a,b),i=c&&c!=b?ic(a,c):h;e={left:Math.min(h.left,i.left),top:Math.min(h.top,i.top)-d,right:Math.max(h.left,i.left),bottom:Math.max(h.bottom,i.bottom)+d};var j=Sc(a,e),k=a.doc.scrollTop,l=a.doc.scrollLeft;if(null!=j.scrollTop&&(Zc(a,j.scrollTop),Math.abs(a.doc.scrollTop-k)>1&&(g=!0)),null!=j.scrollLeft&&(_c(a,j.scrollLeft),Math.abs(a.doc.scrollLeft-l)>1&&(g=!0)),!g)break}return e}function Rc(a,b){var c=Sc(a,b);null!=c.scrollTop&&Zc(a,c.scrollTop),null!=c.scrollLeft&&_c(a,c.scrollLeft)}function Sc(a,b){var c=a.display,d=sc(a.display);b.top<0&&(b.top=0);var e=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:c.scroller.scrollTop,f=Pb(a),g={};b.bottom-b.top>f&&(b.bottom=b.top+f);var h=a.doc.height+Lb(c),i=b.toph-d;if(b.tope+f){var k=Math.min(b.top,(j?h:b.bottom)-f);k!=e&&(g.scrollTop=k)}var l=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:c.scroller.scrollLeft,m=Ob(a)-(a.options.fixedGutter?c.gutters.offsetWidth:0),n=b.right-b.left>m;return n&&(b.right=b.left+m),b.left<10?g.scrollLeft=0:b.leftm+l-3&&(g.scrollLeft=b.right+(n?0:10)-m),g}function Tc(a,b){null!=b&&(Xc(a),a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+b)}function Uc(a){Xc(a);var b=a.getCursor();a.curOp.scrollToPos={from:b,to:b,margin:a.options.cursorScrollMargin}}function Vc(a,b,c){null==b&&null==c||Xc(a),null!=b&&(a.curOp.scrollLeft=b),null!=c&&(a.curOp.scrollTop=c)}function Wc(a,b){Xc(a),a.curOp.scrollToPos=b}function Xc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=jc(a,b.from),d=jc(a,b.to);Yc(a,c,d,b.margin)}}function Yc(a,b,c,d){var e=Sc(a,{left:Math.min(b.left,c.left),top:Math.min(b.top,c.top)-d,right:Math.max(b.right,c.right),bottom:Math.max(b.bottom,c.bottom)+d});Vc(a,e.scrollLeft,e.scrollTop)}function Zc(a,b){Math.abs(a.doc.scrollTop-b)<2||(pg||Dd(a,{top:b}),$c(a,b,!0),pg&&Dd(a),wd(a,100))}function $c(a,b,c){b=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,b),(a.display.scroller.scrollTop!=b||c)&&(a.doc.scrollTop=b,a.display.scrollbars.setScrollTop(b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b))}function _c(a,b,c,d){b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)&&!d||(a.doc.scrollLeft=b,Nc(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function ad(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Lb(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Nb(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function bd(a,b){b||(b=ad(a));var c=a.display.barWidth,d=a.display.barHeight;cd(a,b);for(var e=0;e<4&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&Kc(a),cd(a,ad(a)),c=a.display.barWidth,d=a.display.barHeight}function cd(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px",c.heightForcer.style.borderBottom=d.bottom+"px solid transparent",d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="",d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function dd(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&Mg(a.display.wrapper,a.display.scrollbars.addClass)),a.display.scrollbars=new yh[a.options.scrollbarStyle](function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller),ch(b,"mousedown",(function(){a.state.focused&&setTimeout((function(){return a.display.input.focus()}),0)})),b.setAttribute("cm-not-content","true")},function(b,c){"horizontal"==c?_c(a,b):Zc(a,b)},a),a.display.scrollbars.addClass&&h(a.display.wrapper,a.display.scrollbars.addClass)}function ed(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++zh},rb(a.curOp)}function fd(a){var b=a.curOp;tb(b,(function(a){for(var b=0;b=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new Ah(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function id(a){a.updatedDisplay=a.mustUpdate&&Bd(a.cm,a.update)}function jd(a){var b=a.cm,c=b.display;a.updatedDisplay&&Kc(b),a.barMeasure=ad(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=Tb(b,c.maxLine,c.maxLine.text.length).left+3,b.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+a.adjustWidthTo+Nb(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Ob(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection())}function kd(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeftb)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)$g&&oa(a.doc,b)e.viewFrom?sd(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)sd(a);else if(b<=e.viewFrom){var f=td(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):sd(a)}else if(c>=e.viewTo){var g=td(a,b,b,-1);g?(e.view=e.view.slice(0,g.index),e.viewTo=g.lineN):sd(a)}else{var h=td(a,b,b,-1),i=td(a,c,c+d,1);h&&i?(e.view=e.view.slice(0,h.index).concat(qb(a,h.lineN,i.lineN)).concat(e.view.slice(i.index)),e.viewTo+=d):sd(a)}var j=e.externalMeasured;j&&(c=e.lineN&&b=d.viewTo)){var f=d.view[zc(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);m(g,c)==-1&&g.push(c)}}}function sd(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function td(a,b,c,d){var e,f=zc(a,b),g=a.display.view;if(!$g||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=a.display.viewFrom,i=0;i0){if(f==g.length-1)return null;e=h+g[f].size-b,f++}else e=h-b;b+=e,c+=e}for(;oa(a.doc,c)!=c;){if(f==(d<0?0:g.length-1))return null;c+=d*g[f-(d<0?1:0)].size,f+=d}return{index:f,lineN:c}}function ud(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=qb(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=qb(a,b,d.viewFrom).concat(d.view):d.viewFromc&&(d.view=d.view.slice(0,zc(a,c)))),d.viewTo=c}function vd(a){for(var b=a.display.view,c=0,d=0;d=a.display.viewTo)){var c=+new Date+a.options.workTime,d=Ya(a,b.highlightFrontier),e=[];b.iter(d.line,Math.min(b.first+b.size,a.display.viewTo+500),(function(f){if(d.line>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength?Ta(b.mode,d.state):null,i=Wa(a,f,d,!0);h&&(d.state=h),f.styles=i.styles;var j=f.styleClasses,k=i.classes;k?f.styleClasses=k:j&&(f.styleClasses=null);for(var l=!g||g.length!=f.styles.length||j!=k&&(!j||!k||j.bgClass!=k.bgClass||j.textClass!=k.textClass),m=0;!l&&mc)return wd(a,a.options.workDelay),!0})),b.highlightFrontier=d.line,b.modeFrontier=Math.max(b.modeFrontier,d.line),e.length&&md(a,(function(){for(var b=0;b=d.viewFrom&&c.visible.to<=d.viewTo&&(null==d.updateLineNumbers||d.updateLineNumbers>=d.viewTo)&&d.renderedView==d.view&&0==vd(a))return!1;Oc(a)&&(sd(a),c.dims=uc(a));var f=e.first+e.size,g=Math.max(c.visible.from-a.options.viewportMargin,e.first),h=Math.min(f,c.visible.to+a.options.viewportMargin);d.viewFromh&&d.viewTo-h<20&&(h=Math.min(f,d.viewTo)),$g&&(g=oa(a.doc,g),h=pa(a.doc,h));var i=g!=d.viewFrom||h!=d.viewTo||d.lastWrapHeight!=c.wrapperHeight||d.lastWrapWidth!=c.wrapperWidth;ud(a,g,h),d.viewOffset=sa(B(a.doc,d.viewFrom)),a.display.mover.style.top=d.viewOffset+"px";var j=vd(a);if(!i&&0==j&&!c.force&&d.renderedView==d.view&&(null==d.updateLineNumbers||d.updateLineNumbers>=d.viewTo))return!1;var k=zd(a);return j>4&&(d.lineDiv.style.display="none"),Ed(a,d.updateLineNumbers,c.dims),j>4&&(d.lineDiv.style.display=""),d.renderedView=d.view,Ad(k),b(d.cursorDiv),b(d.selectionDiv),d.gutters.style.height=d.sizer.style.minHeight=0,i&&(d.lastWrapHeight=c.wrapperHeight,d.lastWrapWidth=c.wrapperWidth,wd(a,400)),d.updateLineNumbers=null,!0}function Cd(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Ob(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Lb(a.display)-Pb(a),c.top)}),b.visible=Mc(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&Bd(a,b);d=!1){Kc(a);var e=ad(a);Ac(a),bd(a,e),Gd(a,e),b.force=!1}b.signal(a,"update",a),a.display.viewFrom==a.display.reportedViewFrom&&a.display.viewTo==a.display.reportedViewTo||(b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function Dd(a,b){var c=new Ah(a,b);if(Bd(a,c)){Kc(a),Cd(a,c);var d=ad(a);Ac(a),bd(a,d),Gd(a,d),c.finish()}}function Ed(a,c,d){function e(b){var c=b.nextSibling;return vg&&Fg&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b),c}for(var f=a.display,g=a.options.lineNumbers,h=f.lineDiv,i=h.firstChild,j=f.view,k=f.viewFrom,l=0;l-1&&(o=!1),wb(a,n,k,d)),o&&(b(n.lineNumber),n.lineNumber.appendChild(document.createTextNode(I(a.options,k)))),i=n.node.nextSibling}else{var p=Eb(a,n,k,d);h.insertBefore(p,i)}k+=n.size}for(;i;)i=e(i)}function Fd(a){var b=a.display.gutters.offsetWidth;a.display.sizer.style.marginLeft=b+"px"}function Gd(a,b){a.display.sizer.style.minHeight=b.docHeight+"px",a.display.heightForcer.style.top=b.docHeight+"px",a.display.gutters.style.height=b.docHeight+a.display.barHeight+Nb(a)+"px"}function Hd(a){var c=a.display.gutters,e=a.options.gutters;b(c);for(var f=0;f-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function Jd(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;return null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail),null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta),{x:b,y:c}}function Kd(a){var b=Jd(a);return b.x*=Ch,b.y*=Ch,b}function Ld(a,b){var c=Jd(b),d=c.x,e=c.y,f=a.display,g=f.scroller,h=g.scrollWidth>g.clientWidth,i=g.scrollHeight>g.clientHeight;if(d&&h||e&&i){if(e&&Fg&&vg)a:for(var j=b.target,k=f.view;j!=g;j=j.parentNode)for(var l=0;l=0){var g=O(f.from(),e.from()),h=N(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;d<=b&&--b,a.splice(--d,2,new Eh(i?h:g,i?g:h))}}return new Dh(a,b)}function Nd(a,b){return new Dh([new Eh(a,b||a)],0)}function Od(a){return a.text?J(a.from.line+a.text.length-1,p(a.text).length+(1==a.text.length?a.from.ch:0)):a.to}function Pd(a,b){if(K(a,b.from)<0)return a;if(K(a,b.to)<=0)return Od(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=Od(b).ch-b.to.ch),J(c,d)}function Qd(a,b){for(var c=[],d=0;d1&&a.remove(h.line+1,o-1),a.insert(h.line+1,s)}ub(a,"change",a,b)}function Xd(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g1&&!a.done[a.done.length-2].ranges?(a.done.pop(),p(a.done)):void 0}function de(a,b,c,d){var e=a.history;e.undone.length=0;var f,g,h=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>h-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=ce(e,e.lastOp==d)))g=p(f.changes),0==K(b.from,b.to)&&0==K(b.from,g.to)?g.to=Od(b):f.changes.push(ae(a,b));else{var i=p(e.done);for(i&&i.ranges||ge(a.sel,e.done),f={changes:[ae(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=h,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,g||Aa(a,"historyAdded")}function ee(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function fe(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastSelOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||ee(a,f,p(e.done),b))?e.done[e.done.length-1]=b:ge(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&be(e.undone)}function ge(a,b){var c=p(b);c&&c.ranges&&c.equals(a)||b.push(a)}function he(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),(function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f}))}function ie(a){if(!a)return null;for(var b,c=0;c-1&&(p(h)[l]=j[l],delete j[l])}}}return d}function me(a,b,c,d){if(d){var e=a.anchor;if(c){var f=K(b,e)<0;f!=K(c,e)<0?(e=b,b=c):f!=K(b,c)<0&&(b=c)}return new Eh(e,b)}return new Eh(c||b,b)}function ne(a,b,c,d,e){null==e&&(e=a.cm&&(a.cm.display.shift||a.extend)),te(a,new Dh([me(a.sel.primary(),b,c,e)],0),d)}function oe(a,b,c){for(var d=[],e=a.cm&&(a.cm.display.shift||a.extend),f=0;f=b.ch:h.to>b.ch))){if(e&&(Aa(i,"beforeCursorEnter"),i.explicitlyCleared)){if(f.markedSpans){--g;continue}break}if(!i.atomic)continue;if(c){var j=i.find(d<0?1:-1),k=void 0;if((d<0?i.inclusiveRight:i.inclusiveLeft)&&(j=Ae(a,j,-d,j&&j.line==b.line?f:null)),j&&j.line==b.line&&(k=K(j,c))&&(d<0?k<0:k>0))return ye(a,j,b,d,e)}var l=i.find(d<0?-1:1);return(d<0?i.inclusiveLeft:i.inclusiveRight)&&(l=Ae(a,l,d,l.line==b.line?f:null)),l?ye(a,l,b,d,e):null}}return b}function ze(a,b,c,d,e){var f=d||1,g=ye(a,b,c,f,e)||!e&&ye(a,b,c,f,!0)||ye(a,b,c,-f,e)||!e&&ye(a,b,c,-f,!0);return g?g:(a.cantEdit=!0,J(a.first,0))}function Ae(a,b,c,d){return c<0&&0==b.ch?b.line>a.first?Q(a,J(b.line-1)):null:c>0&&b.ch==(d||B(a,b.line)).text.length?b.line=0;--e)Ee(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text,origin:b.origin});else Ee(a,b)}}function Ee(a,b){if(1!=b.text.length||""!=b.text[0]||0!=K(b.from,b.to)){var c=Qd(a,b);de(a,b,c,a.cm?a.cm.curOp.id:NaN),He(a,b,c,_(a,b));var d=[];Xd(a,(function(a,c){c||m(d,a.history)!=-1||(Me(a.history,b),d.push(a.history)),He(a,b,null,_(a,b))}))}}function Fe(a,b,c){var d=a.cm&&a.cm.state.suppressEdits;if(!d||c){for(var e,f=a.history,g=a.sel,h="undo"==b?f.done:f.undone,i="undo"==b?f.undone:f.done,j=0;j=0;--o){var q=n(o);if(q)return q.v}}}}function Ge(a,b){if(0!=b&&(a.first+=b,a.sel=new Dh(q(a.sel.ranges,(function(a){return new Eh(J(a.anchor.line+b,a.anchor.ch),J(a.head.line+b,a.head.ch))})),a.sel.primIndex),a.cm)){qd(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;da.lastLine())){if(b.from.linef&&(b={from:b.from,to:J(f,B(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=C(a,b.from,b.to),c||(c=Qd(a,b)),a.cm?Ie(a.cm,b,d):Wd(a,b,d),ue(a,c,Tg)}}function Ie(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,i=f.line;a.options.lineWrapping||(i=F(la(B(d,f.line))),d.iter(i,g.line+1,(function(a){if(a==e.maxLine)return h=!0,!0}))),d.sel.contains(b.from,b.to)>-1&&Ca(a),Wd(d,b,c,wc(a)),a.options.lineWrapping||(d.iter(i,f.line+b.text.length,(function(a){var b=ta(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)})),h&&(a.curOp.updateMaxLine=!0)),eb(d,f.line),wd(a,400);var j=b.text.length-(g.line-f.line)-1;b.full?qd(a):f.line!=g.line||1!=b.text.length||Vd(a.doc,b)?qd(a,f.line,g.line+1,j):rd(a,f.line,"text");var k=Da(a,"changes"),l=Da(a,"change");if(l||k){var m={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin};l&&ub(a,"change",a,m),k&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(m)}a.display.selForContextMenu=null}function Je(a,b,c,d,e){if(d||(d=c),K(d,c)<0){var f;f=[d,c],c=f[0],d=f[1],f}"string"==typeof b&&(b=a.splitLines(b)),De(a,{from:c,to:d,text:b,origin:e})}function Ke(a,b,c,d){c0||0==h&&g.clearWhenEmpty!==!1)return g;if(g.replacedWith&&(g.collapsed=!0,g.widgetNode=e("span",[g.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||g.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(g.widgetNode.insertLeft=!0)),g.collapsed){if(ka(a,b.line,b,c,g)||b.line!=c.line&&ka(a,c.line,b,c,g))throw new Error("Inserting collapsed marker partially overlapping an existing one");U()}g.addToHistory&&de(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var i,j=b.line,l=a.cm;if(a.iter(j,c.line+1,(function(a){l&&g.collapsed&&!l.options.lineWrapping&&la(a)==l.display.maxLine&&(i=!0),g.collapsed&&j!=b.line&&E(a,0),Y(a,new V(g,j==b.line?b.ch:null,j==c.line?c.ch:null)),++j})),g.collapsed&&a.iter(b.line,c.line+1,(function(b){qa(a,b)&&E(b,0)})),g.clearOnEnter&&ch(g,"beforeCursorEnter",(function(){return g.clear()})),g.readOnly&&(T(),(a.history.done.length||a.history.undone.length)&&a.clearHistory()),g.collapsed&&(g.id=++Gh,g.atomic=!0),l){if(i&&(l.curOp.updateMaxLine=!0),g.collapsed)qd(l,b.line,c.line+1);else if(g.className||g.title||g.startStyle||g.endStyle||g.css)for(var m=b.line;m<=c.line;m++)rd(l,m,"text");g.atomic&&we(l.doc),ub(l,"markerAdded",l,g)}return g}function Te(a,b,c,d,e){d=k(d),d.shared=!1;var f=[Se(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Xd(a,(function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Se(a,Q(a,b),Q(a,c),d,e));for(var i=0;i-1)return b.state.draggingText(a),void setTimeout((function(){return b.display.input.focus()}),20);try{var j=a.dataTransfer.getData("Text");if(j){var k;if(b.state.draggingText&&!b.state.draggingText.copy&&(k=b.listSelections()),ue(b.doc,Nd(c,c)),k)for(var l=0;l=0;b--)Je(a.doc,"",d[b].from,d[b].to,"+delete");Uc(a)}))}function mf(a,b,c){var d=y(a.text,b+c,c);return d<0||d>a.text.length?null:d}function nf(a,b,c){var d=mf(a,b.ch,c);return null==d?null:new J(b.line,d,c<0?"after":"before")}function of(a,b,c,d,e){if(a){var f=xa(c,b.doc.direction);if(f){var g,h=e<0?p(f):f[0],i=e<0==(1==h.level),j=i?"after":"before";if(h.level>0||"rtl"==b.doc.direction){var k=Vb(b,c);g=e<0?c.text.length-1:0;var l=Wb(b,k,g).top;g=z((function(a){return Wb(b,k,a).top==l}),e<0==(1==h.level)?h.from:h.to-1,g),"before"==j&&(g=mf(c,g,1))}else g=e<0?h.to:h.from;return new J(d,g,j)}}return new J(d,e<0?c.text.length:0,e<0?"before":"after")}function pf(a,b,c,d){var e=xa(b,a.doc.direction);if(!e)return nf(b,c,d);c.ch>=b.text.length?(c.ch=b.text.length,c.sticky="before"):c.ch<=0&&(c.ch=0,c.sticky="after");var f=wa(e,c.ch,c.sticky),g=e[f];if("ltr"==a.doc.direction&&g.level%2==0&&(d>0?g.to>c.ch:g.from=g.from&&m>=k.begin)){var n=l?"before":"after";return new J(c.line,m,n)}}var o=function(a,b,d){for(var f=function(a,b){return b?new J(c.line,i(a,1),"before"):new J(c.line,a,"after")};a>=0&&a0==(1!=g.level),j=h?d.begin:i(d.end,-1);if(g.from<=j&&j0?k.end:i(k.begin,-1);return null==q||d>0&&q==b.text.length||!(p=o(d>0?0:e.length-1,d,j(q)))?null:p}function qf(a,b){var c=B(a.doc,b),d=la(c);return d!=c&&(b=F(d)),of(!0,a,d,b,1)}function rf(a,b){var c=B(a.doc,b),d=ma(c);return d!=c&&(b=F(d)),of(!0,a,c,b,-1)}function sf(a,b){var c=qf(a,b.line),d=B(a.doc,c.line),e=xa(d,a.doc.direction);if(!e||0==e[0].level){var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;return J(c.line,g?0:f,c.sticky)}return c}function tf(a,b,c){if("string"==typeof b&&(b=Sh[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Sg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function uf(a,b,c){for(var d=0;d-1&&(K((e=h.ranges[e]).from(),b)<0||b.xRel>0)&&(K(e.to(),b)>0||b.xRel<0)?If(a,d,b,f):Kf(a,d,b,f)}function If(a,b,c,d){var e=a.display,f=!1,g=nd(a,(function(b){vg&&(e.scroller.draggable=!1),a.state.draggingText=!1,za(document,"mouseup",g),za(document,"mousemove",h),za(e.scroller,"dragstart",i),za(e.scroller,"drop",g),f||(Fa(b),d.addNew||ne(a.doc,c,null,null,d.extend),vg||tg&&9==ug?setTimeout((function(){document.body.focus(),e.input.focus()}),20):e.input.focus())})),h=function(a){f=f||Math.abs(b.clientX-a.clientX)+Math.abs(b.clientY-a.clientY)>=10},i=function(){return f=!0};vg&&(e.scroller.draggable=!0),a.state.draggingText=g,g.copy=!d.moveOnDrag,e.scroller.dragDrop&&e.scroller.dragDrop(),ch(document,"mouseup",g),ch(document,"mousemove",h),ch(e.scroller,"dragstart",i),ch(e.scroller,"drop",g),Hc(a),setTimeout((function(){return e.input.focus()}),20)}function Jf(a,b,c){if("char"==c)return new Eh(b,b);if("word"==c)return a.findWordAt(b);if("line"==c)return new Eh(J(b.line,0),Q(a.doc,J(b.line+1,0)));var d=c(a,b);return new Eh(d.from,d.to)}function Kf(a,b,c,d){function e(b){if(0!=K(r,b))if(r=b,"rectangle"==d.unit){for(var e=[],f=a.options.tabSize,g=l(B(j,c.line).text,c.ch,f),h=l(B(j,b.line).text,b.ch,f),i=Math.min(g,h),p=Math.max(g,h),q=Math.min(c.line,b.line),s=Math.min(a.lastLine(),Math.max(c.line,b.line));q<=s;q++){var t=B(j,q).text,u=n(t,i,f);i==p?e.push(new Eh(J(q,u),J(q,u))):t.length>u&&e.push(new Eh(J(q,u),J(q,n(t,p,f))))}e.length||e.push(new Eh(c,c)),te(j,Md(o.ranges.slice(0,m).concat(e),m),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var v,w=k,x=Jf(a,b,d.unit),y=w.anchor;K(x.anchor,y)>0?(v=x.head,y=O(w.from(),x.anchor)):(v=x.anchor,y=N(w.to(),x.head));var z=o.ranges.slice(0);z[m]=Lf(a,new Eh(Q(j,y),v)),te(j,Md(z,m),Ug)}}function f(b){var c=++t,h=yc(a,b,!0,"rectangle"==d.unit);if(h)if(0!=K(h,r)){a.curOp.focus=g(),e(h);var k=Mc(i,j);(h.line>=k.to||h.lines.bottom?20:0;l&&setTimeout(nd(a,(function(){t==c&&(i.scroller.scrollTop+=l,f(b))})),50)}}function h(b){a.state.selectingText=!1,t=1/0,Fa(b),i.input.focus(),za(document,"mousemove",u),za(document,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;Fa(b);var k,m,o=j.sel,p=o.ranges;if(d.addNew&&!d.extend?(m=j.sel.contains(c),k=m>-1?p[m]:new Eh(c,c)):(k=j.sel.primary(),m=j.sel.primIndex),"rectangle"==d.unit)d.addNew||(k=new Eh(c,c)),c=yc(a,b,!0,!0),m=-1;else{var q=Jf(a,c,d.unit);k=d.extend?me(k,q.anchor,q.head,d.extend):q}d.addNew?m==-1?(m=p.length,te(j,Md(p.concat([k]),m),{scroll:!1,origin:"*mouse"})):p.length>1&&p[m].empty()&&"char"==d.unit&&!d.extend?(te(j,Md(p.slice(0,m).concat(p.slice(m+1)),0),{scroll:!1,origin:"*mouse"}),o=j.sel):pe(j,m,k,Ug):(m=0,te(j,new Dh([k],0),Ug),o=j.sel);var r=c,s=i.wrapper.getBoundingClientRect(),t=0,u=nd(a,(function(a){Ka(a)?f(a):h(a)})),v=nd(a,h);a.state.selectingText=v,ch(document,"mousemove",u),ch(document,"mouseup",v)}function Lf(a,b){var c=b.anchor,d=b.head,e=B(a.doc,c.line);if(0==K(c,d)&&c.sticky==d.sticky)return b;var f=xa(e);if(!f)return b;var g=wa(f,c.ch,c.sticky),h=f[g];if(h.from!=c.ch&&h.to!=c.ch)return b;var i=g+(h.from==c.ch==(1!=h.level)?0:1);if(0==i||i==f.length)return b;var j;if(d.line!=c.line)j=(d.line-c.line)*("ltr"==a.doc.direction?1:-1)>0;else{var k=wa(f,d.ch,d.sticky),l=k-g||(d.ch-c.ch)*(1==h.level?-1:1);j=k==i-1||k==i?l<0:l>0}var m=f[i+(j?-1:0)],n=j==(1==m.level),o=n?m.from:m.to,p=n?"after":"before";return c.ch==o&&c.sticky==p?b:new Eh(new J(c.line,o,p),d)}function Mf(a,b,c,d){var e,f;if(b.touches)e=b.touches[0].clientX,f=b.touches[0].clientY;else try{e=b.clientX,f=b.clientY}catch(a){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Fa(b);var g=a.display,h=g.lineDiv.getBoundingClientRect();if(f>h.bottom||!Da(a,c))return Ha(b);f-=h.top-g.viewOffset;for(var i=0;i=e){var k=G(a.doc,f),l=a.options.gutters[i];return Aa(a,c,a,k,l,b),Ha(b)}}}function Nf(a,b){return Mf(a,b,"gutterClick",!0)}function Of(a,b){Jb(a.display,b)||Pf(a,b)||Ba(a,b,"contextmenu")||a.display.input.onContextMenu(b)}function Pf(a,b){return!!Da(a,"gutterContextMenu")&&Mf(a,b,"gutterContextMenu",!1)}function Qf(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),bc(a)}function Rf(a){function b(b,d,e,f){a.defaults[b]=d,e&&(c[b]=f?function(a,b,c){c!=Zh&&e(a,b,c)}:e)}var c=a.optionHandlers;a.defineOption=b,a.Init=Zh,b("value","",(function(a,b){return a.setValue(b)}),!0),b("mode",null,(function(a,b){a.doc.modeOption=b,Td(a)}),!0),b("indentUnit",2,Td,!0),b("indentWithTabs",!1),b("smartIndent",!0),b("tabSize",4,(function(a){Ud(a),bc(a),qd(a)}),!0),b("lineSeparator",null,(function(a,b){if(a.doc.lineSep=b,b){var c=[],d=a.doc.first;a.doc.iter((function(a){for(var e=0;;){var f=a.text.indexOf(b,e);if(f==-1)break;e=f+b.length,c.push(J(d,f))}d++}));for(var e=c.length-1;e>=0;e--)Je(a.doc,b,c[e],J(c[e].line,c[e].ch+b.length))}})),b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,(function(a,b,c){a.state.specialChars=new RegExp(b.source+(b.test("\t")?"":"|\t"),"g"),c!=Zh&&a.refresh()})),b("specialCharPlaceholder",jb,(function(a){return a.refresh()}),!0),b("electricChars",!0),b("inputStyle",Eg?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),b("spellcheck",!1,(function(a,b){return a.getInputField().spellcheck=b}),!0),b("rtlMoveVisually",!Hg),b("wholeLineUpdateBefore",!0),b("theme","default",(function(a){Qf(a),Sf(a)}),!0),b("keyMap","default",(function(a,b,c){var d=kf(b),e=c!=Zh&&kf(c);e&&e.detach&&e.detach(a,d),d.attach&&d.attach(a,e||null)})),b("extraKeys",null),b("configureMouse",null),b("lineWrapping",!1,Uf,!0),b("gutters",[],(function(a){Id(a.options),Sf(a)}),!0),b("fixedGutter",!0,(function(a,b){a.display.gutters.style.left=b?vc(a.display)+"px":"0",a.refresh()}),!0),b("coverGutterNextToScrollbar",!1,(function(a){return bd(a)}),!0),b("scrollbarStyle","native",(function(a){dd(a),bd(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)}),!0),b("lineNumbers",!1,(function(a){Id(a.options),Sf(a)}),!0),b("firstLineNumber",1,Sf,!0),b("lineNumberFormatter",(function(a){return a}),Sf,!0),b("showCursorWhenSelecting",!1,Ac,!0),b("resetSelectionOnContextMenu",!0),b("lineWiseCopyCut",!0),b("pasteLinesPerSelection",!0),b("readOnly",!1,(function(a,b){"nocursor"==b&&(Jc(a),a.display.input.blur()),a.display.input.readOnlyChanged(b)})),b("disableInput",!1,(function(a,b){b||a.display.input.reset()}),!0),b("dragDrop",!0,Tf),b("allowDropFileTypes",null),b("cursorBlinkRate",530),b("cursorScrollMargin",0),b("cursorHeight",1,Ac,!0),b("singleCursorHeightPerLine",!0,Ac,!0),b("workTime",100),b("workDelay",100),b("flattenSpans",!0,Ud,!0),b("addModeClass",!1,Ud,!0),b("pollInterval",100),b("undoDepth",200,(function(a,b){return a.doc.history.undoDepth=b})),b("historyEventDelay",1250), -b("viewportMargin",10,(function(a){return a.refresh()}),!0),b("maxHighlightLength",1e4,Ud,!0),b("moveInputWithCursor",!0,(function(a,b){b||a.display.input.resetPosition()})),b("tabindex",null,(function(a,b){return a.display.input.getField().tabIndex=b||""})),b("autofocus",null),b("direction","ltr",(function(a,b){return a.doc.setDirection(b)}),!0)}function Sf(a){Hd(a),qd(a),Nc(a)}function Tf(a,b,c){var d=c&&c!=Zh;if(!b!=!d){var e=a.display.dragFunctions,f=b?ch:za;f(a.display.scroller,"dragstart",e.start),f(a.display.scroller,"dragenter",e.enter),f(a.display.scroller,"dragover",e.over),f(a.display.scroller,"dragleave",e.leave),f(a.display.scroller,"drop",e.drop)}}function Uf(a){a.options.lineWrapping?(h(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Mg(a.display.wrapper,"CodeMirror-wrap"),ua(a)),xc(a),qd(a),bc(a),setTimeout((function(){return bd(a)}),100)}function Vf(a,b){var c=this;if(!(this instanceof Vf))return new Vf(a,b);this.options=b=b?k(b):{},k($h,b,!1),Id(b);var d=b.value;"string"==typeof d&&(d=new Kh(d,b.mode,null,b.lineSeparator,b.direction)),this.doc=d;var e=new Vf.inputStyles[b.inputStyle](this),f=this.display=new A(a,d,e);f.wrapper.CodeMirror=this,Hd(this),Qf(this),b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),dd(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 Og,keySeq:null,specialChars:null},b.autofocus&&!Eg&&f.input.focus(),tg&&ug<11&&setTimeout((function(){return c.display.input.reset(!0)}),20),Wf(this),af(),ed(this),this.curOp.forceUpdate=!0,Yd(this,d),b.autofocus&&!Eg||this.hasFocus()?setTimeout(j(Ic,this),20):Jc(this);for(var g in _h)_h.hasOwnProperty(g)&&_h[g](c,b[g],Zh);Oc(this),b.finishInit&&b.finishInit(this);for(var h=0;h400}var e=a.display;ch(e.scroller,"mousedown",nd(a,Ef)),tg&&ug<11?ch(e.scroller,"dblclick",nd(a,(function(b){if(!Ba(a,b)){var c=yc(a,b);if(c&&!Nf(a,b)&&!Jb(a.display,b)){Fa(b);var d=a.findWordAt(c);ne(a.doc,d.anchor,d.head)}}}))):ch(e.scroller,"dblclick",(function(b){return Ba(a,b)||Fa(b)})),Lg||ch(e.scroller,"contextmenu",(function(b){return Of(a,b)}));var f,g={end:0};ch(e.scroller,"touchstart",(function(b){if(!Ba(a,b)&&!c(b)&&!Nf(a,b)){e.input.ensurePolled(),clearTimeout(f);var d=+new Date;e.activeTouch={start:d,moved:!1,prev:d-g.end<=300?g:null},1==b.touches.length&&(e.activeTouch.left=b.touches[0].pageX,e.activeTouch.top=b.touches[0].pageY)}})),ch(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ch(e.scroller,"touchend",(function(c){var f=e.activeTouch;if(f&&!Jb(e,c)&&null!=f.left&&!f.moved&&new Date-f.start<300){var g,h=a.coordsChar(e.activeTouch,"page");g=!f.prev||d(f,f.prev)?new Eh(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new Eh(J(h.line,0),Q(a.doc,J(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),Fa(c)}b()})),ch(e.scroller,"touchcancel",b),ch(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Zc(a,e.scroller.scrollTop),_c(a,e.scroller.scrollLeft,!0),Aa(a,"scroll",a))})),ch(e.scroller,"mousewheel",(function(b){return Ld(a,b)})),ch(e.scroller,"DOMMouseScroll",(function(b){return Ld(a,b)})),ch(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(b){Ba(a,b)||Ia(b)},over:function(b){Ba(a,b)||(Ze(a,b),Ia(b))},start:function(b){return Ye(a,b)},drop:nd(a,Xe),leave:function(b){Ba(a,b)||$e(a)}};var h=e.input.getField();ch(h,"keyup",(function(b){return Bf.call(a,b)})),ch(h,"keydown",nd(a,zf)),ch(h,"keypress",nd(a,Cf)),ch(h,"focus",(function(b){return Ic(a,b)})),ch(h,"blur",(function(b){return Jc(a,b)}))}function Xf(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Ya(a,b).state:c="prev");var g=a.options.tabSize,h=B(f,b),i=l(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=f.mode.indent(e,h.text.slice(k.length),h.text),j==Sg||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?l(B(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var m="",n=0;if(a.options.indentWithTabs)for(var p=Math.floor(j/g);p;--p)n+=g,m+="\t";if(n1)if(bi&&bi.text.join("\n")==b){if(d.ranges.length%bi.text.length==0){i=[];for(var j=0;j=0;l--){var m=d.ranges[l],n=m.from(),o=m.to();m.empty()&&(c&&c>0?n=J(n.line,n.ch-c):a.state.overwrite&&!g?o=J(o.line,Math.min(B(f,o.line).text.length,o.ch+p(h).length)):bi&&bi.lineWise&&bi.text.join("\n")==b&&(n=o=J(n.line,0))),k=a.curOp.updateInput;var r={from:n,to:o,text:i?i[l%i.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};De(a.doc,r),ub(a,"inputRead",a,r)}b&&!g&&_f(a,b),Uc(a),a.curOp.updateInput=k,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function $f(a,b){var c=a.clipboardData&&a.clipboardData.getData("Text");if(c)return a.preventDefault(),b.isReadOnly()||b.options.disableInput||md(b,(function(){return Zf(b,c,0,null,"paste")})),!0}function _f(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;d>=0;d--){var e=c.ranges[d];if(!(e.head.ch>100||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars){for(var h=0;h-1){g=Xf(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(B(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Xf(a,e.head.line,"smart"));g&&ub(a,"electricInput",a,e.head.line)}}}function ag(a){for(var b=[],c=[],d=0;d=a.first+a.size)&&(b=new J(d,b.ch,b.sticky),j=B(a,d))}function g(d){var g;if(g=e?pf(a.cm,j,b,c):nf(j,b,c),null==g){if(d||!f())return!1;b=of(e,a.cm,j,b.line,c)}else b=g;return!0}var h=b,i=c,j=B(a,b.line);if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var k=null,l="group"==d,m=a.cm&&a.cm.getHelper(b,"wordChars"),n=!0;!(c<0)||g(!n);n=!1){var o=j.text.charAt(b.ch)||"\n",p=v(o,m)?"w":l&&"\n"==o?"n":!l||/\s/.test(o)?null:"p";if(!l||n||p||(p="s"),k&&k!=p){c<0&&(c=1,g(),b.sticky="after");break}if(p&&(k=p),c>0&&!g(!n))break}var q=ze(a,b,h,i,!0);return L(h,q)&&(q.hitSide=!0),q}function eg(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),i=Math.max(h-.5*sc(a.display),3);e=(c>0?b.bottom:b.top)+c*i}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(var j;j=lc(a,g,e),j.outside;){if(c<0?e<=0:e>=f.height){j.hitSide=!0;break}e+=5*c}return j}function fg(a,b){var c=Ub(a,b.line);if(!c||c.hidden)return null;var d=B(a.doc,b.line),e=Rb(c,d,b.line),f=xa(d,a.doc.direction),g="left";if(f){var h=wa(f,b.ch);g=h%2?"right":"left"}var i=Xb(e.map,b.ch,g);return i.offset="right"==i.collapse?i.end:i.start,i}function gg(a){for(var b=a;b;b=b.parentNode)if(/CodeMirror-gutter-wrapper/.test(b.className))return!0;return!1}function hg(a,b){return b&&(a.bad=!0),a}function ig(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(){k&&(j+=l,k=!1)}function h(a){a&&(g(),j+=a)}function i(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return void h(c||b.textContent.replace(/\u200b/g,""));var j,m=b.getAttribute("cm-marker");if(m){var n=a.findMarks(J(d,0),J(e+1,0),f(+m));return void(n.length&&(j=n[0].find(0))&&h(C(a.doc,j.from,j.to).join(l)))}if("false"==b.getAttribute("contenteditable"))return;var o=/^(pre|div|p)$/i.test(b.nodeName);o&&g();for(var p=0;p=15&&(yg=!1,vg=!0);var Jg,Kg=Fg&&(wg||yg&&(null==Ig||Ig<12.11)),Lg=pg||tg&&ug>=9,Mg=function(b,c){var d=b.className,e=a(c).exec(d);if(e){var f=d.slice(e.index+e[0].length);b.className=d.slice(0,e.index)+(f?e[1]+f:"")}};Jg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(a){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Ng=function(a){a.select()};Cg?Ng=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:tg&&(Ng=function(a){try{a.select()}catch(a){}});var Og=function(){this.id=null};Og.prototype.set=function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)};var Pg,Qg,Rg=30,Sg={toString:function(){return"CodeMirror.Pass"}},Tg={scroll:!1},Ug={origin:"*mouse"},Vg={origin:"+move"},Wg=[""],Xg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Yg=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Zg=!1,$g=!1,_g=null,ah=(function(){function a(a){return a<=247?c.charAt(a):1424<=a&&a<=1524?"R":1536<=a&&a<=1785?d.charAt(a-1536):1774<=a&&a<=2220?"r":8192<=a&&a<=8203?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/;return function(c,d){var j="ltr"==d?"L":"R";if(0==c.length||"ltr"==d&&!e.test(c))return!1;for(var k=c.length,l=[],m=0;m=this.string.length},lh.prototype.sol=function(){return this.pos==this.lineStart},lh.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},lh.prototype.next=function(){if(this.posb},lh.prototype.eatSpace=function(){for(var a=this,b=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++a.pos;return this.pos>b},lh.prototype.skipToEnd=function(){this.pos=this.string.length},lh.prototype.skipTo=function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},lh.prototype.backUp=function(a){this.pos-=a},lh.prototype.column=function(){return this.lastColumnPos0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);if(e(f)==e(a))return b!==!1&&(this.pos+=a.length),!0},lh.prototype.current=function(){return this.string.slice(this.start,this.pos)},lh.prototype.hideFirstChars=function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}},lh.prototype.lookAhead=function(a){var b=this.lineOracle;return b&&b.lookAhead(a)},lh.prototype.baseToken=function(){var a=this.lineOracle;return a&&a.baseToken(this.pos)};var mh=function(a,b){this.state=a,this.lookAhead=b},nh=function(a,b,c,d){this.state=b,this.doc=a,this.line=c,this.maxLookAhead=d||0,this.baseTokens=null,this.baseTokenPos=1};nh.prototype.lookAhead=function(a){var b=this.doc.getLine(this.line+a);return null!=b&&a>this.maxLookAhead&&(this.maxLookAhead=a),b},nh.prototype.baseToken=function(a){var b=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=a;)b.baseTokenPos+=2;var c=this.baseTokens[this.baseTokenPos+1];return{type:c&&c.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-a}},nh.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},nh.fromSaved=function(a,b,c){return b instanceof mh?new nh(a,Ta(a.mode,b.state),c,b.lookAhead):new nh(a,Ta(a.mode,b),c)},nh.prototype.save=function(a){var b=a!==!1?Ta(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mh(b,this.maxLookAhead):b};var oh=function(a,b,c){this.start=a.start,this.end=a.pos,this.string=a.current(),this.type=b||null,this.state=c},ph=function(a,b,c){this.text=a,da(this,b),this.height=c?c(this):1};ph.prototype.lineNo=function(){return F(this)},Ea(ph);var qh,rh={},sh={},th=null,uh=null,vh={left:0,right:0,top:0,bottom:0},wh=function(a,b,c){this.cm=c;var e=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(e),a(f),ch(e,"scroll",(function(){e.clientHeight&&b(e.scrollTop,"vertical")})),ch(f,"scroll",(function(){f.clientWidth&&b(f.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,tg&&ug<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};wh.prototype.update=function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0";var e=a.viewHeight-(b?d:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+e)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(b){this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px";var f=a.viewWidth-a.barLeft-(c?d:0);this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+f)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&a.clientHeight>0&&(0==d&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:c?d:0,bottom:b?d:0}},wh.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},wh.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},wh.prototype.zeroWidthHack=function(){var a=Fg&&!Ag?"12px":"18px";this.horiz.style.height=this.vert.style.width=a,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Og,this.disableVert=new Og},wh.prototype.enableZeroWidthBar=function(a,b,c){function d(){var e=a.getBoundingClientRect(),f="vert"==c?document.elementFromPoint(e.right-1,(e.top+e.bottom)/2):document.elementFromPoint((e.right+e.left)/2,e.bottom-1);f!=a?a.style.pointerEvents="none":b.set(1e3,d)}a.style.pointerEvents="auto",b.set(1e3,d)},wh.prototype.clear=function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)};var xh=function(){};xh.prototype.update=function(){return{bottom:0,right:0}},xh.prototype.setScrollLeft=function(){},xh.prototype.setScrollTop=function(){},xh.prototype.clear=function(){};var yh={native:wh,null:xh},zh=0,Ah=function(a,b,c){var d=a.display;this.viewport=b,this.visible=Mc(d,a.doc,b),this.editorIsHidden=!d.wrapper.offsetWidth,this.wrapperHeight=d.wrapper.clientHeight,this.wrapperWidth=d.wrapper.clientWidth,this.oldDisplayWidth=Ob(a),this.force=c,this.dims=uc(a),this.events=[]};Ah.prototype.signal=function(a,b){Da(a,b)&&this.events.push(arguments)},Ah.prototype.finish=function(){for(var a=this,b=0;b=0&&K(a,e.to())<=0)return d}return-1};var Eh=function(a,b){this.anchor=a,this.head=b};Eh.prototype.from=function(){return O(this.anchor,this.head)},Eh.prototype.to=function(){return N(this.anchor,this.head)},Eh.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Oe.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=this,d=a,e=a+b;d1||!(this.children[0]instanceof Oe))){var i=[];this.collapse(i),this.children=[new Oe(i)],this.children[0].parent=this}},collapse:function(a){for(var b=this,c=0;c50){for(var h=f.lines.length%25+25,i=h;i10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=this,e=0;eb.display.maxLineLength&&(b.display.maxLine=k,b.display.maxLineLength=l,b.display.maxLineChanged=!0)}null!=e&&b&&this.collapsed&&qd(b,e,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,b&&we(b.doc)),b&&ub(b,"markerCleared",b,this,e,f),c&&fd(b),this.parent&&this.parent.clear()}},Hh.prototype.find=function(a,b){var c=this;null==a&&"bookmark"==this.type&&(a=1);for(var d,e,f=0;f=0;j--)De(d,e[j]);i?se(this,i):this.cm&&Uc(this.cm)})),undo:pd((function(){Fe(this,"undo")})),redo:pd((function(){Fe(this,"redo")})),undoSelection:pd((function(){Fe(this,"undo",!0)})),redoSelection:pd((function(){Fe(this,"redo",!0)})),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=Q(this,a),b=Q(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,(function(f){var g=f.markedSpans;if(g)for(var h=0;h=i.to||null==i.from&&e!=a.line||null!=i.from&&e==b.line&&i.from>=b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e})),d},getAllMarks:function(){var a=[];return this.iter((function(b){var c=b.markedSpans;if(c)for(var d=0;da?(b=a,!0):(a-=f,void++c)})),Q(this,J(c,b))},indexFromPos:function(a){a=Q(this,a);var b=a.ch;if(a.lineb&&(b=a.from),null!=a.to&&a.to0)e=new J(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),J(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=B(a.doc,e.line-1).text;g&&(e=new J(e.line,1),a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),J(e.line-1,g.length-1),e,"+transpose"))}c.push(new Eh(e,e))}a.setSelections(c)}))},newlineAndIndent:function(a){return md(a,(function(){for(var b=a.listSelections(),c=b.length-1;c>=0;c--)a.replaceRange(a.doc.lineSeparator(),b[c].anchor,b[c].head,"+input");b=a.listSelections();for(var d=0;da&&0==K(b,this.pos)&&c==this.button};var Xh,Yh,Zh={toString:function(){return"CodeMirror.Init"}},$h={},_h={};Vf.defaults=$h,Vf.optionHandlers=_h;var ai=[];Vf.defineInitHook=function(a){return ai.push(a)};var bi=null,ci=function(a){var b=a.optionHandlers,c=a.helpers={};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,c){var d=this.options,e=d[a];d[a]==c&&"mode"!=a||(d[a]=c,b.hasOwnProperty(a)&&nd(this,b[a])(this,c,e),Aa(this,"optionChange",this,a))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](kf(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cd&&(Xf(b,f.head.line,a,!0),d=f.head.line,e==b.doc.sel.primIndex&&Uc(b));else{var g=f.from(),h=f.to(),i=Math.max(d,g.line);d=Math.min(b.lastLine(),h.line-(h.ch?0:1))+1;for(var j=i;j0&&pe(b.doc,e,new Eh(g,k[e].to()),Tg)}}})),getTokenAt:function(a,b){return ab(this,a,b)},getLineTokens:function(a,b){return ab(this,J(a),b,!0)},getTokenTypeAt:function(a){a=Q(this.doc,a);var b,c=Xa(this,B(this.doc,a.line)),d=0,e=(c.length-1)/2,f=a.ch;if(0==f)b=c[2];else for(;;){var g=d+e>>1;if((g?c[2*g-1]:0)>=f)e=g;else{if(!(c[2*g+1]f&&(a=f,e=!0),d=B(this.doc,a)}else d=a;return fc(this,d,{top:0,left:0},b||"page",c||e).top+(e?this.doc.height-sa(d):0)},defaultTextHeight:function(){return sc(this.display)},defaultCharWidth:function(){return tc(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=ic(this,Q(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Rc(this,{left:h,top:g,right:h+b.offsetWidth,bottom:g+b.offsetHeight})},triggerOnKeyDown:od(zf),triggerOnKeyPress:od(Cf),triggerOnKeyUp:Bf,triggerOnMouseDown:od(Ef),execCommand:function(a){if(Sh.hasOwnProperty(a))return Sh[a].call(null,this)},triggerElectric:od((function(a){_f(this,a)})),findPosH:function(a,b,c,d){var e=this,f=1;b<0&&(f=-1,b=-b);for(var g=Q(this.doc,a),h=0;h0&&h(c.charAt(d-1));)--d;for(;e.5)&&xc(this),Aa(this,"refresh",this)})),swapDoc:od((function(a){var b=this.doc;return b.cm=null,Yd(this,a),bc(this),this.display.input.reset(),Vc(this,a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,ub(this,"swapDoc",this,b),b})),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ea(a),a.registerHelper=function(b,d,e){c.hasOwnProperty(b)||(c[b]=a[b]={_global:[]}),c[b][d]=e},a.registerGlobalHelper=function(b,d,e,f){a.registerHelper(b,d,f),c[b]._global.push({pred:e,val:f})}},di=function(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Og,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};di.prototype.init=function(a){function b(a){if(!Ba(e,a)){if(e.somethingSelected())Yf({lineWise:!1,text:e.getSelections()}),"cut"==a.type&&e.replaceSelection("",null,"cut");else{if(!e.options.lineWiseCopyCut)return;var b=ag(e);Yf({lineWise:!0,text:b.text}),"cut"==a.type&&e.operation((function(){e.setSelections(b.ranges,0,Tg),e.replaceSelection("",null,"cut")}))}if(a.clipboardData){a.clipboardData.clearData();var c=bi.text.join("\n");if(a.clipboardData.setData("Text",c),a.clipboardData.getData("Text")==c)return void a.preventDefault()}var g=cg(),h=g.firstChild;e.display.lineSpace.insertBefore(g,e.display.lineSpace.firstChild),h.value=bi.text.join("\n");var i=document.activeElement;Ng(h),setTimeout((function(){e.display.lineSpace.removeChild(g),i.focus(),i==f&&d.showPrimarySelection()}),50)}}var c=this,d=this,e=d.cm,f=d.div=a.lineDiv;bg(f,e.options.spellcheck),ch(f,"paste",(function(a){Ba(e,a)||$f(a,e)||ug<=11&&setTimeout(nd(e,(function(){return c.updateFromDOM()})),20)})),ch(f,"compositionstart",(function(a){c.composing={data:a.data,done:!1}})),ch(f,"compositionupdate",(function(a){c.composing||(c.composing={data:a.data,done:!1})})),ch(f,"compositionend",(function(a){c.composing&&(a.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)})),ch(f,"touchstart",(function(){return d.forceCompositionEnd()})),ch(f,"input",(function(){c.composing||c.readFromDOMSoon()})),ch(f,"copy",b),ch(f,"cut",b)},di.prototype.prepareSelection=function(){var a=Bc(this.cm,!1);return a.focus=this.cm.state.focused,a},di.prototype.showSelection=function(a,b){a&&this.cm.display.view.length&&((a.focus||b)&&this.showPrimarySelection(),this.showMultipleSelections(a))},di.prototype.showPrimarySelection=function(){var a=window.getSelection(),b=this.cm,c=b.doc.sel.primary(),d=c.from(),e=c.to();if(b.display.viewTo==b.display.viewFrom||d.line>=b.display.viewTo||e.line=b.display.viewFrom&&fg(b,d)||{node:h[0].measure.map[2],offset:0},j=e.linea.firstLine()&&(d=J(d.line-1,B(a.doc,d.line-1).length)),e.ch==B(a.doc,e.line).text.length&&e.lineb.viewTo-1)return!1;var f,g,h;d.line==b.viewFrom||0==(f=zc(a,d.line))?(g=F(b.view[0].line),h=b.view[0].node):(g=F(b.view[f].line),h=b.view[f-1].node.nextSibling);var i,j,k=zc(a,e.line);if(k==b.view.length-1?(i=b.viewTo-1,j=b.lineDiv.lastChild):(i=F(b.view[k+1].line)-1,j=b.view[k+1].node.previousSibling),!h)return!1;for(var l=a.doc.splitLines(ig(a,h,j,g,i)),m=C(a.doc,J(g,0),J(i,B(a.doc,i).text.length));l.length>1&&m.length>1;)if(p(l)==p(m))l.pop(),m.pop(),i--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,q=l[0],r=m[0],s=Math.min(q.length,r.length);nd.ch&&t.charCodeAt(t.length-o-1)==u.charCodeAt(u.length-o-1);)n--,o++;l[l.length-1]=t.slice(0,t.length-o).replace(/^\u200b+/,""),l[0]=l[0].slice(n).replace(/\u200b+$/,"");var w=J(g,n),x=J(i,m.length?p(m).length-o:0);return l.length>1||l[0]||K(w,x)?(Je(a.doc,l,w,x,"+input"),!0):void 0},di.prototype.ensurePolled=function(){this.forceCompositionEnd()},di.prototype.reset=function(){this.forceCompositionEnd()},di.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},di.prototype.readFromDOMSoon=function(){var a=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(a.readDOMTimeout=null, -a.composing){if(!a.composing.done)return;a.composing=null}a.updateFromDOM()}),80))},di.prototype.updateFromDOM=function(){var a=this;!this.cm.isReadOnly()&&this.pollContent()||md(this.cm,(function(){return qd(a.cm)}))},di.prototype.setUneditable=function(a){a.contentEditable="false"},di.prototype.onKeyPress=function(a){0!=a.charCode&&(a.preventDefault(),this.cm.isReadOnly()||nd(this.cm,Zf)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0))},di.prototype.readOnlyChanged=function(a){this.div.contentEditable=String("nocursor"!=a)},di.prototype.onContextMenu=function(){},di.prototype.resetPosition=function(){},di.prototype.needsContentAttribute=!0;var ei=function(a){this.cm=a,this.prevInput="",this.pollingFast=!1,this.polling=new Og,this.hasSelection=!1,this.composing=null};ei.prototype.init=function(a){function b(a){if(!Ba(e,a)){if(e.somethingSelected())Yf({lineWise:!1,text:e.getSelections()});else{if(!e.options.lineWiseCopyCut)return;var b=ag(e);Yf({lineWise:!0,text:b.text}),"cut"==a.type?e.setSelections(b.ranges,null,Tg):(d.prevInput="",g.value=b.text.join("\n"),Ng(g))}"cut"==a.type&&(e.state.cutIncoming=!0)}}var c=this,d=this,e=this.cm,f=this.wrapper=cg(),g=this.textarea=f.firstChild;a.wrapper.insertBefore(f,a.wrapper.firstChild),Cg&&(g.style.width="0px"),ch(g,"input",(function(){tg&&ug>=9&&c.hasSelection&&(c.hasSelection=null),d.poll()})),ch(g,"paste",(function(a){Ba(e,a)||$f(a,e)||(e.state.pasteIncoming=!0,d.fastPoll())})),ch(g,"cut",b),ch(g,"copy",b),ch(a.scroller,"paste",(function(b){Jb(a,b)||Ba(e,b)||(e.state.pasteIncoming=!0,d.focus())})),ch(a.lineSpace,"selectstart",(function(b){Jb(a,b)||Fa(b)})),ch(g,"compositionstart",(function(){var a=e.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:a,range:e.markText(a,e.getCursor("to"),{className:"CodeMirror-composing"})}})),ch(g,"compositionend",(function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)}))},ei.prototype.prepareSelection=function(){var a=this.cm,b=a.display,c=a.doc,d=Bc(a);if(a.options.moveInputWithCursor){var e=ic(a,c.sel.primary().head,"div"),f=b.wrapper.getBoundingClientRect(),g=b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,e.top+g.top-f.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,e.left+g.left-f.left))}return d},ei.prototype.showSelection=function(a){var b=this.cm,d=b.display;c(d.cursorDiv,a.cursors),c(d.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},ei.prototype.reset=function(a){if(!this.contextMenuPending&&!this.composing){var b=this.cm;if(b.somethingSelected()){this.prevInput="";var c=b.getSelection();this.textarea.value=c,b.state.focused&&Ng(this.textarea),tg&&ug>=9&&(this.hasSelection=c)}else a||(this.prevInput=this.textarea.value="",tg&&ug>=9&&(this.hasSelection=null))}},ei.prototype.getField=function(){return this.textarea},ei.prototype.supportsTouch=function(){return!1},ei.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Eg||g()!=this.textarea))try{this.textarea.focus()}catch(a){}},ei.prototype.blur=function(){this.textarea.blur()},ei.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ei.prototype.receivedFocus=function(){this.slowPoll()},ei.prototype.slowPoll=function(){var a=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){a.poll(),a.cm.state.focused&&a.slowPoll()}))},ei.prototype.fastPoll=function(){function a(){var d=c.poll();d||b?(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0,c.polling.set(20,a)},ei.prototype.poll=function(){var a=this,b=this.cm,c=this.textarea,d=this.prevInput;if(this.contextMenuPending||!b.state.focused||fh(c)&&!d&&!this.composing||b.isReadOnly()||b.options.disableInput||b.state.keySeq)return!1;var e=c.value;if(e==d&&!b.somethingSelected())return!1;if(tg&&ug>=9&&this.hasSelection===e||Fg&&/[\uf700-\uf7ff]/.test(e))return b.display.input.reset(),!1;if(b.doc.sel==b.display.selForContextMenu){var f=e.charCodeAt(0);if(8203!=f||d||(d="​"),8666==f)return this.reset(),this.cm.execCommand("undo")}for(var g=0,h=Math.min(d.length,e.length);g1e3||e.indexOf("\n")>-1?c.value=a.prevInput="":a.prevInput=e,a.composing&&(a.composing.range.clear(),a.composing.range=b.markText(a.composing.start,b.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ei.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ei.prototype.onKeyPress=function(){tg&&ug>=9&&(this.hasSelection=null),this.fastPoll()},ei.prototype.onContextMenu=function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b="​"+(a?g.value:"");g.value="⇚",g.value=b,d.prevInput=a?"":"​",g.selectionStart=1,g.selectionEnd=b.length,f.selForContextMenu=e.doc.sel}}function c(){if(d.contextMenuPending=!1,d.wrapper.style.cssText=l,g.style.cssText=k,tg&&ug<9&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!tg||tg&&ug<9)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&"​"==d.prevInput?nd(e,Be)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):(f.selForContextMenu=null,f.input.reset())};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=yc(e,a),i=f.scroller.scrollTop;if(h&&!yg){var j=e.options.resetSelectionOnContextMenu;j&&e.doc.sel.contains(h)==-1&&nd(e,te)(e.doc,Nd(h),Tg);var k=g.style.cssText,l=d.wrapper.style.cssText;d.wrapper.style.cssText="position: absolute";var m=d.wrapper.getBoundingClientRect();g.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(a.clientY-m.top-5)+"px; left: "+(a.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(tg?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var n;if(vg&&(n=window.scrollY),f.input.focus(),vg&&window.scrollTo(null,n),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),tg&&ug>=9&&b(),Lg){Ia(a);var o=function(){za(window,"mouseup",o),setTimeout(c,20)};ch(window,"mouseup",o)}else setTimeout(c,50)}},ei.prototype.readOnlyChanged=function(a){a||this.reset(),this.textarea.disabled="nocursor"==a},ei.prototype.setUneditable=function(){},ei.prototype.needsContentAttribute=!1,Rf(Vf),ci(Vf);var fi="iter insert remove copy getEditor constructor".split(" ");for(var gi in Kh.prototype)Kh.prototype.hasOwnProperty(gi)&&m(fi,gi)<0&&(Vf.prototype[gi]=(function(a){return function(){return a.apply(this.doc,arguments)}})(Kh.prototype[gi]));return Ea(Kh),Vf.inputStyles={textarea:ei,contenteditable:di},Vf.defineMode=function(a){Vf.defaults.mode||"null"==a||(Vf.defaults.mode=a),Oa.apply(this,arguments)},Vf.defineMIME=Pa,Vf.defineMode("null",(function(){return{token:function(a){return a.skipToEnd()}}})),Vf.defineMIME("text/plain","null"),Vf.defineExtension=function(a,b){Vf.prototype[a]=b},Vf.defineDocExtension=function(a,b){Kh.prototype[a]=b},Vf.fromTextArea=lg,mg(Vf),Vf.version="5.35.0",Vf})); \ No newline at end of file +wd(a,100),a.state.modeGen++,a.curOp&&qd(a)}function Vd(a,b){return 0==b.from.ch&&0==b.to.ch&&""==p(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function Wd(a,b,c,d){function e(a){return c?c[a]:null}function f(a,c,e){fb(a,c,e,d),ub(a,"change",a,b)}function g(a,b){for(var c=[],f=a;f1&&a.remove(h.line+1,o-1),a.insert(h.line+1,s)}ub(a,"change",a,b)}function Xd(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g1&&!a.done[a.done.length-2].ranges?(a.done.pop(),p(a.done)):void 0}function de(a,b,c,d){var e=a.history;e.undone.length=0;var f,g,h=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&e.lastModTime>h-(a.cm?a.cm.options.historyEventDelay:500)||"*"==b.origin.charAt(0)))&&(f=ce(e,e.lastOp==d)))g=p(f.changes),0==K(b.from,b.to)&&0==K(b.from,g.to)?g.to=Od(b):f.changes.push(ae(a,b));else{var i=p(e.done);for(i&&i.ranges||ge(a.sel,e.done),f={changes:[ae(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=h,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,g||Aa(a,"historyAdded")}function ee(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function fe(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastSelOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||ee(a,f,p(e.done),b))?e.done[e.done.length-1]=b:ge(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&be(e.undone)}function ge(a,b){var c=p(b);c&&c.ranges&&c.equals(a)||b.push(a)}function he(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),(function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f}))}function ie(a){if(!a)return null;for(var b,c=0;c-1&&(p(h)[l]=j[l],delete j[l])}}}return d}function me(a,b,c,d){if(d){var e=a.anchor;if(c){var f=K(b,e)<0;f!=K(c,e)<0?(e=b,b=c):f!=K(b,c)<0&&(b=c)}return new Eh(e,b)}return new Eh(c||b,b)}function ne(a,b,c,d,e){null==e&&(e=a.cm&&(a.cm.display.shift||a.extend)),te(a,new Dh([me(a.sel.primary(),b,c,e)],0),d)}function oe(a,b,c){for(var d=[],e=a.cm&&(a.cm.display.shift||a.extend),f=0;f=b.ch:h.to>b.ch))){if(e&&(Aa(i,"beforeCursorEnter"),i.explicitlyCleared)){if(f.markedSpans){--g;continue}break}if(!i.atomic)continue;if(c){var j=i.find(d<0?1:-1),k=void 0;if((d<0?i.inclusiveRight:i.inclusiveLeft)&&(j=Ae(a,j,-d,j&&j.line==b.line?f:null)),j&&j.line==b.line&&(k=K(j,c))&&(d<0?k<0:k>0))return ye(a,j,b,d,e)}var l=i.find(d<0?-1:1);return(d<0?i.inclusiveLeft:i.inclusiveRight)&&(l=Ae(a,l,d,l.line==b.line?f:null)),l?ye(a,l,b,d,e):null}}return b}function ze(a,b,c,d,e){var f=d||1,g=ye(a,b,c,f,e)||!e&&ye(a,b,c,f,!0)||ye(a,b,c,-f,e)||!e&&ye(a,b,c,-f,!0);return g?g:(a.cantEdit=!0,J(a.first,0))}function Ae(a,b,c,d){return c<0&&0==b.ch?b.line>a.first?Q(a,J(b.line-1)):null:c>0&&b.ch==(d||B(a,b.line)).text.length?b.line=0;--e)Ee(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text,origin:b.origin});else Ee(a,b)}}function Ee(a,b){if(1!=b.text.length||""!=b.text[0]||0!=K(b.from,b.to)){var c=Qd(a,b);de(a,b,c,a.cm?a.cm.curOp.id:NaN),He(a,b,c,_(a,b));var d=[];Xd(a,(function(a,c){c||m(d,a.history)!=-1||(Me(a.history,b),d.push(a.history)),He(a,b,null,_(a,b))}))}}function Fe(a,b,c){var d=a.cm&&a.cm.state.suppressEdits;if(!d||c){for(var e,f=a.history,g=a.sel,h="undo"==b?f.done:f.undone,i="undo"==b?f.undone:f.done,j=0;j=0;--o){var q=n(o);if(q)return q.v}}}}function Ge(a,b){if(0!=b&&(a.first+=b,a.sel=new Dh(q(a.sel.ranges,(function(a){return new Eh(J(a.anchor.line+b,a.anchor.ch),J(a.head.line+b,a.head.ch))})),a.sel.primIndex),a.cm)){qd(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;da.lastLine())){if(b.from.linef&&(b={from:b.from,to:J(f,B(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=C(a,b.from,b.to),c||(c=Qd(a,b)),a.cm?Ie(a.cm,b,d):Wd(a,b,d),ue(a,c,Tg)}}function Ie(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,i=f.line;a.options.lineWrapping||(i=F(la(B(d,f.line))),d.iter(i,g.line+1,(function(a){if(a==e.maxLine)return h=!0,!0}))),d.sel.contains(b.from,b.to)>-1&&Ca(a),Wd(d,b,c,wc(a)),a.options.lineWrapping||(d.iter(i,f.line+b.text.length,(function(a){var b=ta(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)})),h&&(a.curOp.updateMaxLine=!0)),eb(d,f.line),wd(a,400);var j=b.text.length-(g.line-f.line)-1;b.full?qd(a):f.line!=g.line||1!=b.text.length||Vd(a.doc,b)?qd(a,f.line,g.line+1,j):rd(a,f.line,"text");var k=Da(a,"changes"),l=Da(a,"change");if(l||k){var m={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin};l&&ub(a,"change",a,m),k&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(m)}a.display.selForContextMenu=null}function Je(a,b,c,d,e){if(d||(d=c),K(d,c)<0){var f;f=[d,c],c=f[0],d=f[1]}"string"==typeof b&&(b=a.splitLines(b)),De(a,{from:c,to:d,text:b,origin:e})}function Ke(a,b,c,d){c0||0==h&&g.clearWhenEmpty!==!1)return g;if(g.replacedWith&&(g.collapsed=!0,g.widgetNode=e("span",[g.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||g.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(g.widgetNode.insertLeft=!0)),g.collapsed){if(ka(a,b.line,b,c,g)||b.line!=c.line&&ka(a,c.line,b,c,g))throw new Error("Inserting collapsed marker partially overlapping an existing one");U()}g.addToHistory&&de(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var i,j=b.line,l=a.cm;if(a.iter(j,c.line+1,(function(a){l&&g.collapsed&&!l.options.lineWrapping&&la(a)==l.display.maxLine&&(i=!0),g.collapsed&&j!=b.line&&E(a,0),Y(a,new V(g,j==b.line?b.ch:null,j==c.line?c.ch:null)),++j})),g.collapsed&&a.iter(b.line,c.line+1,(function(b){qa(a,b)&&E(b,0)})),g.clearOnEnter&&ch(g,"beforeCursorEnter",(function(){return g.clear()})),g.readOnly&&(T(),(a.history.done.length||a.history.undone.length)&&a.clearHistory()),g.collapsed&&(g.id=++Gh,g.atomic=!0),l){if(i&&(l.curOp.updateMaxLine=!0),g.collapsed)qd(l,b.line,c.line+1);else if(g.className||g.title||g.startStyle||g.endStyle||g.css)for(var m=b.line;m<=c.line;m++)rd(l,m,"text");g.atomic&&we(l.doc),ub(l,"markerAdded",l,g)}return g}function Te(a,b,c,d,e){d=k(d),d.shared=!1;var f=[Se(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Xd(a,(function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Se(a,Q(a,b),Q(a,c),d,e));for(var i=0;i-1)return b.state.draggingText(a),void setTimeout((function(){return b.display.input.focus()}),20);try{var j=a.dataTransfer.getData("Text");if(j){var k;if(b.state.draggingText&&!b.state.draggingText.copy&&(k=b.listSelections()),ue(b.doc,Nd(c,c)),k)for(var l=0;l=0;b--)Je(a.doc,"",d[b].from,d[b].to,"+delete");Uc(a)}))}function mf(a,b,c){var d=y(a.text,b+c,c);return d<0||d>a.text.length?null:d}function nf(a,b,c){var d=mf(a,b.ch,c);return null==d?null:new J(b.line,d,c<0?"after":"before")}function of(a,b,c,d,e){if(a){var f=xa(c,b.doc.direction);if(f){var g,h=e<0?p(f):f[0],i=e<0==(1==h.level),j=i?"after":"before";if(h.level>0||"rtl"==b.doc.direction){var k=Vb(b,c);g=e<0?c.text.length-1:0;var l=Wb(b,k,g).top;g=z((function(a){return Wb(b,k,a).top==l}),e<0==(1==h.level)?h.from:h.to-1,g),"before"==j&&(g=mf(c,g,1))}else g=e<0?h.to:h.from;return new J(d,g,j)}}return new J(d,e<0?c.text.length:0,e<0?"before":"after")}function pf(a,b,c,d){var e=xa(b,a.doc.direction);if(!e)return nf(b,c,d);c.ch>=b.text.length?(c.ch=b.text.length,c.sticky="before"):c.ch<=0&&(c.ch=0,c.sticky="after");var f=wa(e,c.ch,c.sticky),g=e[f];if("ltr"==a.doc.direction&&g.level%2==0&&(d>0?g.to>c.ch:g.from=g.from&&m>=k.begin)){var n=l?"before":"after";return new J(c.line,m,n)}}var o=function(a,b,d){for(var f=function(a,b){return b?new J(c.line,i(a,1),"before"):new J(c.line,a,"after")};a>=0&&a0==(1!=g.level),j=h?d.begin:i(d.end,-1);if(g.from<=j&&j0?k.end:i(k.begin,-1);return null==q||d>0&&q==b.text.length||!(p=o(d>0?0:e.length-1,d,j(q)))?null:p}function qf(a,b){var c=B(a.doc,b),d=la(c);return d!=c&&(b=F(d)),of(!0,a,d,b,1)}function rf(a,b){var c=B(a.doc,b),d=ma(c);return d!=c&&(b=F(d)),of(!0,a,c,b,-1)}function sf(a,b){var c=qf(a,b.line),d=B(a.doc,c.line),e=xa(d,a.doc.direction);if(!e||0==e[0].level){var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;return J(c.line,g?0:f,c.sticky)}return c}function tf(a,b,c){if("string"==typeof b&&(b=Sh[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Sg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function uf(a,b,c){for(var d=0;d-1&&(K((e=h.ranges[e]).from(),b)<0||b.xRel>0)&&(K(e.to(),b)>0||b.xRel<0)?If(a,d,b,f):Kf(a,d,b,f)}function If(a,b,c,d){var e=a.display,f=!1,g=nd(a,(function(b){vg&&(e.scroller.draggable=!1),a.state.draggingText=!1,za(e.wrapper.ownerDocument,"mouseup",g),za(e.wrapper.ownerDocument,"mousemove",h),za(e.scroller,"dragstart",i),za(e.scroller,"drop",g),f||(Fa(b),d.addNew||ne(a.doc,c,null,null,d.extend),vg||tg&&9==ug?setTimeout((function(){e.wrapper.ownerDocument.body.focus(),e.input.focus()}),20):e.input.focus())})),h=function(a){f=f||Math.abs(b.clientX-a.clientX)+Math.abs(b.clientY-a.clientY)>=10},i=function(){return f=!0};vg&&(e.scroller.draggable=!0),a.state.draggingText=g,g.copy=!d.moveOnDrag,e.scroller.dragDrop&&e.scroller.dragDrop(),ch(e.wrapper.ownerDocument,"mouseup",g),ch(e.wrapper.ownerDocument,"mousemove",h),ch(e.scroller,"dragstart",i),ch(e.scroller,"drop",g),Hc(a),setTimeout((function(){return e.input.focus()}),20)}function Jf(a,b,c){if("char"==c)return new Eh(b,b);if("word"==c)return a.findWordAt(b);if("line"==c)return new Eh(J(b.line,0),Q(a.doc,J(b.line+1,0)));var d=c(a,b);return new Eh(d.from,d.to)}function Kf(a,b,c,d){function e(b){if(0!=K(r,b))if(r=b,"rectangle"==d.unit){for(var e=[],f=a.options.tabSize,g=l(B(j,c.line).text,c.ch,f),h=l(B(j,b.line).text,b.ch,f),i=Math.min(g,h),p=Math.max(g,h),q=Math.min(c.line,b.line),s=Math.min(a.lastLine(),Math.max(c.line,b.line));q<=s;q++){var t=B(j,q).text,u=n(t,i,f);i==p?e.push(new Eh(J(q,u),J(q,u))):t.length>u&&e.push(new Eh(J(q,u),J(q,n(t,p,f))))}e.length||e.push(new Eh(c,c)),te(j,Md(o.ranges.slice(0,m).concat(e),m),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var v,w=k,x=Jf(a,b,d.unit),y=w.anchor;K(x.anchor,y)>0?(v=x.head,y=O(w.from(),x.anchor)):(v=x.anchor,y=N(w.to(),x.head));var z=o.ranges.slice(0);z[m]=Lf(a,new Eh(Q(j,y),v)),te(j,Md(z,m),Ug)}}function f(b){var c=++t,h=yc(a,b,!0,"rectangle"==d.unit);if(h)if(0!=K(h,r)){a.curOp.focus=g(),e(h);var k=Mc(i,j);(h.line>=k.to||h.lines.bottom?20:0;l&&setTimeout(nd(a,(function(){t==c&&(i.scroller.scrollTop+=l,f(b))})),50)}}function h(b){a.state.selectingText=!1,t=1/0,Fa(b),i.input.focus(),za(i.wrapper.ownerDocument,"mousemove",u),za(i.wrapper.ownerDocument,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;Fa(b);var k,m,o=j.sel,p=o.ranges;if(d.addNew&&!d.extend?(m=j.sel.contains(c),k=m>-1?p[m]:new Eh(c,c)):(k=j.sel.primary(),m=j.sel.primIndex),"rectangle"==d.unit)d.addNew||(k=new Eh(c,c)),c=yc(a,b,!0,!0),m=-1;else{var q=Jf(a,c,d.unit);k=d.extend?me(k,q.anchor,q.head,d.extend):q}d.addNew?m==-1?(m=p.length,te(j,Md(p.concat([k]),m),{scroll:!1,origin:"*mouse"})):p.length>1&&p[m].empty()&&"char"==d.unit&&!d.extend?(te(j,Md(p.slice(0,m).concat(p.slice(m+1)),0),{scroll:!1,origin:"*mouse"}),o=j.sel):pe(j,m,k,Ug):(m=0,te(j,new Dh([k],0),Ug),o=j.sel);var r=c,s=i.wrapper.getBoundingClientRect(),t=0,u=nd(a,(function(a){Ka(a)?f(a):h(a)})),v=nd(a,h);a.state.selectingText=v,ch(i.wrapper.ownerDocument,"mousemove",u),ch(i.wrapper.ownerDocument,"mouseup",v)}function Lf(a,b){var c=b.anchor,d=b.head,e=B(a.doc,c.line);if(0==K(c,d)&&c.sticky==d.sticky)return b;var f=xa(e);if(!f)return b;var g=wa(f,c.ch,c.sticky),h=f[g];if(h.from!=c.ch&&h.to!=c.ch)return b;var i=g+(h.from==c.ch==(1!=h.level)?0:1);if(0==i||i==f.length)return b;var j;if(d.line!=c.line)j=(d.line-c.line)*("ltr"==a.doc.direction?1:-1)>0;else{var k=wa(f,d.ch,d.sticky),l=k-g||(d.ch-c.ch)*(1==h.level?-1:1);j=k==i-1||k==i?l<0:l>0}var m=f[i+(j?-1:0)],n=j==(1==m.level),o=n?m.from:m.to,p=n?"after":"before";return c.ch==o&&c.sticky==p?b:new Eh(new J(c.line,o,p),d)}function Mf(a,b,c,d){var e,f;if(b.touches)e=b.touches[0].clientX,f=b.touches[0].clientY;else try{e=b.clientX,f=b.clientY}catch(a){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Fa(b);var g=a.display,h=g.lineDiv.getBoundingClientRect();if(f>h.bottom||!Da(a,c))return Ha(b);f-=h.top-g.viewOffset;for(var i=0;i=e){var k=G(a.doc,f),l=a.options.gutters[i];return Aa(a,c,a,k,l,b),Ha(b)}}}function Nf(a,b){return Mf(a,b,"gutterClick",!0)}function Of(a,b){Jb(a.display,b)||Pf(a,b)||Ba(a,b,"contextmenu")||a.display.input.onContextMenu(b)}function Pf(a,b){return!!Da(a,"gutterContextMenu")&&Mf(a,b,"gutterContextMenu",!1)}function Qf(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),bc(a)}function Rf(a){function b(b,d,e,f){a.defaults[b]=d,e&&(c[b]=f?function(a,b,c){c!=Zh&&e(a,b,c)}:e)}var c=a.optionHandlers;a.defineOption=b,a.Init=Zh,b("value","",(function(a,b){return a.setValue(b)}),!0),b("mode",null,(function(a,b){a.doc.modeOption=b,Td(a)}),!0),b("indentUnit",2,Td,!0),b("indentWithTabs",!1),b("smartIndent",!0),b("tabSize",4,(function(a){Ud(a),bc(a),qd(a)}),!0),b("lineSeparator",null,(function(a,b){if(a.doc.lineSep=b,b){var c=[],d=a.doc.first;a.doc.iter((function(a){for(var e=0;;){var f=a.text.indexOf(b,e);if(f==-1)break;e=f+b.length,c.push(J(d,f))}d++}));for(var e=c.length-1;e>=0;e--)Je(a.doc,b,c[e],J(c[e].line,c[e].ch+b.length))}})),b("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,(function(a,b,c){a.state.specialChars=new RegExp(b.source+(b.test("\t")?"":"|\t"),"g"),c!=Zh&&a.refresh()})),b("specialCharPlaceholder",jb,(function(a){return a.refresh()}),!0),b("electricChars",!0),b("inputStyle",Eg?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),b("spellcheck",!1,(function(a,b){return a.getInputField().spellcheck=b}),!0),b("rtlMoveVisually",!Hg),b("wholeLineUpdateBefore",!0),b("theme","default",(function(a){Qf(a),Sf(a)}),!0),b("keyMap","default",(function(a,b,c){var d=kf(b),e=c!=Zh&&kf(c);e&&e.detach&&e.detach(a,d),d.attach&&d.attach(a,e||null)})),b("extraKeys",null),b("configureMouse",null),b("lineWrapping",!1,Uf,!0),b("gutters",[],(function(a){Id(a.options),Sf(a)}),!0),b("fixedGutter",!0,(function(a,b){a.display.gutters.style.left=b?vc(a.display)+"px":"0",a.refresh()}),!0),b("coverGutterNextToScrollbar",!1,(function(a){return bd(a)}),!0),b("scrollbarStyle","native",(function(a){dd(a),bd(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)}),!0),b("lineNumbers",!1,(function(a){Id(a.options),Sf(a)}),!0),b("firstLineNumber",1,Sf,!0),b("lineNumberFormatter",(function(a){return a}),Sf,!0),b("showCursorWhenSelecting",!1,Ac,!0),b("resetSelectionOnContextMenu",!0),b("lineWiseCopyCut",!0),b("pasteLinesPerSelection",!0),b("readOnly",!1,(function(a,b){"nocursor"==b&&(Jc(a),a.display.input.blur()),a.display.input.readOnlyChanged(b)})),b("disableInput",!1,(function(a,b){b||a.display.input.reset()}),!0),b("dragDrop",!0,Tf),b("allowDropFileTypes",null),b("cursorBlinkRate",530),b("cursorScrollMargin",0),b("cursorHeight",1,Ac,!0),b("singleCursorHeightPerLine",!0,Ac,!0),b("workTime",100),b("workDelay",100),b("flattenSpans",!0,Ud,!0), +b("addModeClass",!1,Ud,!0),b("pollInterval",100),b("undoDepth",200,(function(a,b){return a.doc.history.undoDepth=b})),b("historyEventDelay",1250),b("viewportMargin",10,(function(a){return a.refresh()}),!0),b("maxHighlightLength",1e4,Ud,!0),b("moveInputWithCursor",!0,(function(a,b){b||a.display.input.resetPosition()})),b("tabindex",null,(function(a,b){return a.display.input.getField().tabIndex=b||""})),b("autofocus",null),b("direction","ltr",(function(a,b){return a.doc.setDirection(b)}),!0)}function Sf(a){Hd(a),qd(a),Nc(a)}function Tf(a,b,c){var d=c&&c!=Zh;if(!b!=!d){var e=a.display.dragFunctions,f=b?ch:za;f(a.display.scroller,"dragstart",e.start),f(a.display.scroller,"dragenter",e.enter),f(a.display.scroller,"dragover",e.over),f(a.display.scroller,"dragleave",e.leave),f(a.display.scroller,"drop",e.drop)}}function Uf(a){a.options.lineWrapping?(h(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Mg(a.display.wrapper,"CodeMirror-wrap"),ua(a)),xc(a),qd(a),bc(a),setTimeout((function(){return bd(a)}),100)}function Vf(a,b){var c=this;if(!(this instanceof Vf))return new Vf(a,b);this.options=b=b?k(b):{},k($h,b,!1),Id(b);var d=b.value;"string"==typeof d&&(d=new Kh(d,b.mode,null,b.lineSeparator,b.direction)),this.doc=d;var e=new Vf.inputStyles[b.inputStyle](this),f=this.display=new A(a,d,e);f.wrapper.CodeMirror=this,Hd(this),Qf(this),b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),dd(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 Og,keySeq:null,specialChars:null},b.autofocus&&!Eg&&f.input.focus(),tg&&ug<11&&setTimeout((function(){return c.display.input.reset(!0)}),20),Wf(this),af(),ed(this),this.curOp.forceUpdate=!0,Yd(this,d),b.autofocus&&!Eg||this.hasFocus()?setTimeout(j(Ic,this),20):Jc(this);for(var g in _h)_h.hasOwnProperty(g)&&_h[g](c,b[g],Zh);Oc(this),b.finishInit&&b.finishInit(this);for(var h=0;h400}var e=a.display;ch(e.scroller,"mousedown",nd(a,Ef)),tg&&ug<11?ch(e.scroller,"dblclick",nd(a,(function(b){if(!Ba(a,b)){var c=yc(a,b);if(c&&!Nf(a,b)&&!Jb(a.display,b)){Fa(b);var d=a.findWordAt(c);ne(a.doc,d.anchor,d.head)}}}))):ch(e.scroller,"dblclick",(function(b){return Ba(a,b)||Fa(b)})),Lg||ch(e.scroller,"contextmenu",(function(b){return Of(a,b)}));var f,g={end:0};ch(e.scroller,"touchstart",(function(b){if(!Ba(a,b)&&!c(b)&&!Nf(a,b)){e.input.ensurePolled(),clearTimeout(f);var d=+new Date;e.activeTouch={start:d,moved:!1,prev:d-g.end<=300?g:null},1==b.touches.length&&(e.activeTouch.left=b.touches[0].pageX,e.activeTouch.top=b.touches[0].pageY)}})),ch(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ch(e.scroller,"touchend",(function(c){var f=e.activeTouch;if(f&&!Jb(e,c)&&null!=f.left&&!f.moved&&new Date-f.start<300){var g,h=a.coordsChar(e.activeTouch,"page");g=!f.prev||d(f,f.prev)?new Eh(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new Eh(J(h.line,0),Q(a.doc,J(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),Fa(c)}b()})),ch(e.scroller,"touchcancel",b),ch(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(Zc(a,e.scroller.scrollTop),_c(a,e.scroller.scrollLeft,!0),Aa(a,"scroll",a))})),ch(e.scroller,"mousewheel",(function(b){return Ld(a,b)})),ch(e.scroller,"DOMMouseScroll",(function(b){return Ld(a,b)})),ch(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(b){Ba(a,b)||Ia(b)},over:function(b){Ba(a,b)||(Ze(a,b),Ia(b))},start:function(b){return Ye(a,b)},drop:nd(a,Xe),leave:function(b){Ba(a,b)||$e(a)}};var h=e.input.getField();ch(h,"keyup",(function(b){return Bf.call(a,b)})),ch(h,"keydown",nd(a,zf)),ch(h,"keypress",nd(a,Cf)),ch(h,"focus",(function(b){return Ic(a,b)})),ch(h,"blur",(function(b){return Jc(a,b)}))}function Xf(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Ya(a,b).state:c="prev");var g=a.options.tabSize,h=B(f,b),i=l(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=f.mode.indent(e,h.text.slice(k.length),h.text),j==Sg||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?l(B(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var m="",n=0;if(a.options.indentWithTabs)for(var p=Math.floor(j/g);p;--p)n+=g,m+="\t";if(n1)if(bi&&bi.text.join("\n")==b){if(d.ranges.length%bi.text.length==0){i=[];for(var j=0;j=0;l--){var m=d.ranges[l],n=m.from(),o=m.to();m.empty()&&(c&&c>0?n=J(n.line,n.ch-c):a.state.overwrite&&!g?o=J(o.line,Math.min(B(f,o.line).text.length,o.ch+p(h).length)):bi&&bi.lineWise&&bi.text.join("\n")==b&&(n=o=J(n.line,0))),k=a.curOp.updateInput;var r={from:n,to:o,text:i?i[l%i.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};De(a.doc,r),ub(a,"inputRead",a,r)}b&&!g&&_f(a,b),Uc(a),a.curOp.updateInput=k,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function $f(a,b){var c=a.clipboardData&&a.clipboardData.getData("Text");if(c)return a.preventDefault(),b.isReadOnly()||b.options.disableInput||md(b,(function(){return Zf(b,c,0,null,"paste")})),!0}function _f(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;d>=0;d--){var e=c.ranges[d];if(!(e.head.ch>100||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars){for(var h=0;h-1){g=Xf(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(B(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Xf(a,e.head.line,"smart"));g&&ub(a,"electricInput",a,e.head.line)}}}function ag(a){for(var b=[],c=[],d=0;d=a.first+a.size)&&(b=new J(d,b.ch,b.sticky),j=B(a,d))}function g(d){var g;if(g=e?pf(a.cm,j,b,c):nf(j,b,c),null==g){if(d||!f())return!1;b=of(e,a.cm,j,b.line,c)}else b=g;return!0}var h=b,i=c,j=B(a,b.line);if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var k=null,l="group"==d,m=a.cm&&a.cm.getHelper(b,"wordChars"),n=!0;!(c<0)||g(!n);n=!1){var o=j.text.charAt(b.ch)||"\n",p=v(o,m)?"w":l&&"\n"==o?"n":!l||/\s/.test(o)?null:"p";if(!l||n||p||(p="s"),k&&k!=p){c<0&&(c=1,g(),b.sticky="after");break}if(p&&(k=p),c>0&&!g(!n))break}var q=ze(a,b,h,i,!0);return L(h,q)&&(q.hitSide=!0),q}function eg(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),i=Math.max(h-.5*sc(a.display),3);e=(c>0?b.bottom:b.top)+c*i}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(var j;j=lc(a,g,e),j.outside;){if(c<0?e<=0:e>=f.height){j.hitSide=!0;break}e+=5*c}return j}function fg(a,b){var c=Ub(a,b.line);if(!c||c.hidden)return null;var d=B(a.doc,b.line),e=Rb(c,d,b.line),f=xa(d,a.doc.direction),g="left";if(f){var h=wa(f,b.ch);g=h%2?"right":"left"}var i=Xb(e.map,b.ch,g);return i.offset="right"==i.collapse?i.end:i.start,i}function gg(a){for(var b=a;b;b=b.parentNode)if(/CodeMirror-gutter-wrapper/.test(b.className))return!0;return!1}function hg(a,b){return b&&(a.bad=!0),a}function ig(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(){k&&(j+=l,k=!1)}function h(a){a&&(g(),j+=a)}function i(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return void h(c||b.textContent.replace(/\u200b/g,""));var j,m=b.getAttribute("cm-marker");if(m){var n=a.findMarks(J(d,0),J(e+1,0),f(+m));return void(n.length&&(j=n[0].find(0))&&h(C(a.doc,j.from,j.to).join(l)))}if("false"==b.getAttribute("contenteditable"))return;var o=/^(pre|div|p)$/i.test(b.nodeName);o&&g();for(var p=0;p=15&&(yg=!1,vg=!0);var Jg,Kg=Fg&&(wg||yg&&(null==Ig||Ig<12.11)),Lg=pg||tg&&ug>=9,Mg=function(b,c){var d=b.className,e=a(c).exec(d);if(e){var f=d.slice(e.index+e[0].length);b.className=d.slice(0,e.index)+(f?e[1]+f:"")}};Jg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(a){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Ng=function(a){a.select()};Cg?Ng=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:tg&&(Ng=function(a){try{a.select()}catch(a){}});var Og=function(){this.id=null};Og.prototype.set=function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)};var Pg,Qg,Rg=30,Sg={toString:function(){return"CodeMirror.Pass"}},Tg={scroll:!1},Ug={origin:"*mouse"},Vg={origin:"+move"},Wg=[""],Xg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Yg=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Zg=!1,$g=!1,_g=null,ah=(function(){function a(a){return a<=247?c.charAt(a):1424<=a&&a<=1524?"R":1536<=a&&a<=1785?d.charAt(a-1536):1774<=a&&a<=2220?"r":8192<=a&&a<=8203?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/;return function(c,d){var j="ltr"==d?"L":"R";if(0==c.length||"ltr"==d&&!e.test(c))return!1;for(var k=c.length,l=[],m=0;m=this.string.length},lh.prototype.sol=function(){return this.pos==this.lineStart},lh.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},lh.prototype.next=function(){if(this.posb},lh.prototype.eatSpace=function(){for(var a=this,b=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++a.pos;return this.pos>b},lh.prototype.skipToEnd=function(){this.pos=this.string.length},lh.prototype.skipTo=function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},lh.prototype.backUp=function(a){this.pos-=a},lh.prototype.column=function(){return this.lastColumnPos0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);if(e(f)==e(a))return b!==!1&&(this.pos+=a.length),!0},lh.prototype.current=function(){return this.string.slice(this.start,this.pos)},lh.prototype.hideFirstChars=function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}},lh.prototype.lookAhead=function(a){var b=this.lineOracle;return b&&b.lookAhead(a)},lh.prototype.baseToken=function(){var a=this.lineOracle;return a&&a.baseToken(this.pos)};var mh=function(a,b){this.state=a,this.lookAhead=b},nh=function(a,b,c,d){this.state=b,this.doc=a,this.line=c,this.maxLookAhead=d||0,this.baseTokens=null,this.baseTokenPos=1};nh.prototype.lookAhead=function(a){var b=this.doc.getLine(this.line+a);return null!=b&&a>this.maxLookAhead&&(this.maxLookAhead=a),b},nh.prototype.baseToken=function(a){var b=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=a;)b.baseTokenPos+=2;var c=this.baseTokens[this.baseTokenPos+1];return{type:c&&c.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-a}},nh.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},nh.fromSaved=function(a,b,c){return b instanceof mh?new nh(a,Ta(a.mode,b.state),c,b.lookAhead):new nh(a,Ta(a.mode,b),c)},nh.prototype.save=function(a){var b=a!==!1?Ta(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mh(b,this.maxLookAhead):b};var oh=function(a,b,c){this.start=a.start,this.end=a.pos,this.string=a.current(),this.type=b||null,this.state=c},ph=function(a,b,c){this.text=a,da(this,b),this.height=c?c(this):1};ph.prototype.lineNo=function(){return F(this)},Ea(ph);var qh,rh={},sh={},th=null,uh=null,vh={left:0,right:0,top:0,bottom:0},wh=function(a,b,c){this.cm=c;var e=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(e),a(f),ch(e,"scroll",(function(){e.clientHeight&&b(e.scrollTop,"vertical")})),ch(f,"scroll",(function(){f.clientWidth&&b(f.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,tg&&ug<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};wh.prototype.update=function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0";var e=a.viewHeight-(b?d:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+e)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(b){this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px";var f=a.viewWidth-a.barLeft-(c?d:0);this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+f)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&a.clientHeight>0&&(0==d&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:c?d:0,bottom:b?d:0}},wh.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},wh.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},wh.prototype.zeroWidthHack=function(){var a=Fg&&!Ag?"12px":"18px";this.horiz.style.height=this.vert.style.width=a,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Og,this.disableVert=new Og},wh.prototype.enableZeroWidthBar=function(a,b,c){function d(){var e=a.getBoundingClientRect(),f="vert"==c?document.elementFromPoint(e.right-1,(e.top+e.bottom)/2):document.elementFromPoint((e.right+e.left)/2,e.bottom-1);f!=a?a.style.pointerEvents="none":b.set(1e3,d)}a.style.pointerEvents="auto",b.set(1e3,d)},wh.prototype.clear=function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)};var xh=function(){};xh.prototype.update=function(){return{bottom:0,right:0}},xh.prototype.setScrollLeft=function(){},xh.prototype.setScrollTop=function(){},xh.prototype.clear=function(){};var yh={native:wh,null:xh},zh=0,Ah=function(a,b,c){var d=a.display;this.viewport=b,this.visible=Mc(d,a.doc,b),this.editorIsHidden=!d.wrapper.offsetWidth,this.wrapperHeight=d.wrapper.clientHeight,this.wrapperWidth=d.wrapper.clientWidth,this.oldDisplayWidth=Ob(a),this.force=c,this.dims=uc(a),this.events=[]};Ah.prototype.signal=function(a,b){Da(a,b)&&this.events.push(arguments)},Ah.prototype.finish=function(){for(var a=this,b=0;b=0&&K(a,e.to())<=0)return d}return-1};var Eh=function(a,b){this.anchor=a,this.head=b};Eh.prototype.from=function(){return O(this.anchor,this.head)},Eh.prototype.to=function(){return N(this.anchor,this.head)},Eh.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Oe.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=this,d=a,e=a+b;d1||!(this.children[0]instanceof Oe))){var i=[];this.collapse(i),this.children=[new Oe(i)],this.children[0].parent=this}},collapse:function(a){for(var b=this,c=0;c50){for(var h=f.lines.length%25+25,i=h;i10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=this,e=0;eb.display.maxLineLength&&(b.display.maxLine=k,b.display.maxLineLength=l,b.display.maxLineChanged=!0)}null!=e&&b&&this.collapsed&&qd(b,e,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,b&&we(b.doc)),b&&ub(b,"markerCleared",b,this,e,f),c&&fd(b),this.parent&&this.parent.clear()}},Hh.prototype.find=function(a,b){var c=this;null==a&&"bookmark"==this.type&&(a=1);for(var d,e,f=0;f=0;j--)De(d,e[j]);i?se(this,i):this.cm&&Uc(this.cm)})),undo:pd((function(){Fe(this,"undo")})),redo:pd((function(){Fe(this,"redo")})),undoSelection:pd((function(){Fe(this,"undo",!0)})),redoSelection:pd((function(){Fe(this,"redo",!0)})),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=Q(this,a),b=Q(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,(function(f){var g=f.markedSpans;if(g)for(var h=0;h=i.to||null==i.from&&e!=a.line||null!=i.from&&e==b.line&&i.from>=b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e})),d},getAllMarks:function(){var a=[];return this.iter((function(b){var c=b.markedSpans;if(c)for(var d=0;da?(b=a,!0):(a-=f,void++c)})),Q(this,J(c,b))},indexFromPos:function(a){a=Q(this,a);var b=a.ch;if(a.lineb&&(b=a.from),null!=a.to&&a.to0)e=new J(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),J(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=B(a.doc,e.line-1).text;g&&(e=new J(e.line,1),a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),J(e.line-1,g.length-1),e,"+transpose"))}c.push(new Eh(e,e))}a.setSelections(c)}))},newlineAndIndent:function(a){return md(a,(function(){for(var b=a.listSelections(),c=b.length-1;c>=0;c--)a.replaceRange(a.doc.lineSeparator(),b[c].anchor,b[c].head,"+input");b=a.listSelections();for(var d=0;da&&0==K(b,this.pos)&&c==this.button};var Xh,Yh,Zh={toString:function(){return"CodeMirror.Init"}},$h={},_h={};Vf.defaults=$h,Vf.optionHandlers=_h;var ai=[];Vf.defineInitHook=function(a){return ai.push(a)};var bi=null,ci=function(a){var b=a.optionHandlers,c=a.helpers={};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,c){var d=this.options,e=d[a];d[a]==c&&"mode"!=a||(d[a]=c,b.hasOwnProperty(a)&&nd(this,b[a])(this,c,e),Aa(this,"optionChange",this,a))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](kf(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cd&&(Xf(b,f.head.line,a,!0),d=f.head.line,e==b.doc.sel.primIndex&&Uc(b));else{var g=f.from(),h=f.to(),i=Math.max(d,g.line);d=Math.min(b.lastLine(),h.line-(h.ch?0:1))+1;for(var j=i;j0&&pe(b.doc,e,new Eh(g,k[e].to()),Tg)}}})),getTokenAt:function(a,b){return ab(this,a,b)},getLineTokens:function(a,b){return ab(this,J(a),b,!0)},getTokenTypeAt:function(a){a=Q(this.doc,a);var b,c=Xa(this,B(this.doc,a.line)),d=0,e=(c.length-1)/2,f=a.ch;if(0==f)b=c[2];else for(;;){var g=d+e>>1;if((g?c[2*g-1]:0)>=f)e=g;else{if(!(c[2*g+1]f&&(a=f,e=!0),d=B(this.doc,a)}else d=a;return fc(this,d,{top:0,left:0},b||"page",c||e).top+(e?this.doc.height-sa(d):0)},defaultTextHeight:function(){return sc(this.display)},defaultCharWidth:function(){return tc(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=ic(this,Q(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Rc(this,{left:h,top:g,right:h+b.offsetWidth,bottom:g+b.offsetHeight})},triggerOnKeyDown:od(zf),triggerOnKeyPress:od(Cf),triggerOnKeyUp:Bf,triggerOnMouseDown:od(Ef),execCommand:function(a){if(Sh.hasOwnProperty(a))return Sh[a].call(null,this)},triggerElectric:od((function(a){_f(this,a)})),findPosH:function(a,b,c,d){var e=this,f=1;b<0&&(f=-1,b=-b);for(var g=Q(this.doc,a),h=0;h0&&h(c.charAt(d-1));)--d;for(;e.5)&&xc(this),Aa(this,"refresh",this)})),swapDoc:od((function(a){var b=this.doc;return b.cm=null,Yd(this,a),bc(this),this.display.input.reset(),Vc(this,a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,ub(this,"swapDoc",this,b),b})),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ea(a),a.registerHelper=function(b,d,e){c.hasOwnProperty(b)||(c[b]=a[b]={_global:[]}),c[b][d]=e},a.registerGlobalHelper=function(b,d,e,f){a.registerHelper(b,d,f),c[b]._global.push({pred:e,val:f})}},di=function(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Og,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};di.prototype.init=function(a){function b(a){if(!Ba(e,a)){if(e.somethingSelected())Yf({lineWise:!1,text:e.getSelections()}),"cut"==a.type&&e.replaceSelection("",null,"cut");else{if(!e.options.lineWiseCopyCut)return;var b=ag(e);Yf({lineWise:!0,text:b.text}),"cut"==a.type&&e.operation((function(){e.setSelections(b.ranges,0,Tg),e.replaceSelection("",null,"cut")}))}if(a.clipboardData){a.clipboardData.clearData();var c=bi.text.join("\n");if(a.clipboardData.setData("Text",c),a.clipboardData.getData("Text")==c)return void a.preventDefault()}var g=cg(),h=g.firstChild;e.display.lineSpace.insertBefore(g,e.display.lineSpace.firstChild),h.value=bi.text.join("\n");var i=document.activeElement;Ng(h),setTimeout((function(){e.display.lineSpace.removeChild(g),i.focus(),i==f&&d.showPrimarySelection()}),50)}}var c=this,d=this,e=d.cm,f=d.div=a.lineDiv;bg(f,e.options.spellcheck),ch(f,"paste",(function(a){Ba(e,a)||$f(a,e)||ug<=11&&setTimeout(nd(e,(function(){return c.updateFromDOM()})),20)})),ch(f,"compositionstart",(function(a){c.composing={data:a.data,done:!1}})),ch(f,"compositionupdate",(function(a){c.composing||(c.composing={data:a.data,done:!1})})),ch(f,"compositionend",(function(a){c.composing&&(a.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)})),ch(f,"touchstart",(function(){return d.forceCompositionEnd()})),ch(f,"input",(function(){c.composing||c.readFromDOMSoon()})),ch(f,"copy",b),ch(f,"cut",b)},di.prototype.prepareSelection=function(){var a=Bc(this.cm,!1);return a.focus=this.cm.state.focused,a},di.prototype.showSelection=function(a,b){a&&this.cm.display.view.length&&((a.focus||b)&&this.showPrimarySelection(),this.showMultipleSelections(a))},di.prototype.showPrimarySelection=function(){var a=window.getSelection(),b=this.cm,c=b.doc.sel.primary(),d=c.from(),e=c.to();if(b.display.viewTo==b.display.viewFrom||d.line>=b.display.viewTo||e.line=b.display.viewFrom&&fg(b,d)||{node:h[0].measure.map[2],offset:0},j=e.linea.firstLine()&&(d=J(d.line-1,B(a.doc,d.line-1).length)),e.ch==B(a.doc,e.line).text.length&&e.lineb.viewTo-1)return!1;var f,g,h;d.line==b.viewFrom||0==(f=zc(a,d.line))?(g=F(b.view[0].line),h=b.view[0].node):(g=F(b.view[f].line),h=b.view[f-1].node.nextSibling);var i,j,k=zc(a,e.line);if(k==b.view.length-1?(i=b.viewTo-1,j=b.lineDiv.lastChild):(i=F(b.view[k+1].line)-1,j=b.view[k+1].node.previousSibling),!h)return!1;for(var l=a.doc.splitLines(ig(a,h,j,g,i)),m=C(a.doc,J(g,0),J(i,B(a.doc,i).text.length));l.length>1&&m.length>1;)if(p(l)==p(m))l.pop(),m.pop(),i--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,q=l[0],r=m[0],s=Math.min(q.length,r.length);nd.ch&&t.charCodeAt(t.length-o-1)==u.charCodeAt(u.length-o-1);)n--,o++;l[l.length-1]=t.slice(0,t.length-o).replace(/^\u200b+/,""),l[0]=l[0].slice(n).replace(/\u200b+$/,"");var w=J(g,n),x=J(i,m.length?p(m).length-o:0);return l.length>1||l[0]||K(w,x)?(Je(a.doc,l,w,x,"+input"),!0):void 0},di.prototype.ensurePolled=function(){this.forceCompositionEnd()},di.prototype.reset=function(){this.forceCompositionEnd()},di.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},di.prototype.readFromDOMSoon=function(){ +var a=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(a.readDOMTimeout=null,a.composing){if(!a.composing.done)return;a.composing=null}a.updateFromDOM()}),80))},di.prototype.updateFromDOM=function(){var a=this;!this.cm.isReadOnly()&&this.pollContent()||md(this.cm,(function(){return qd(a.cm)}))},di.prototype.setUneditable=function(a){a.contentEditable="false"},di.prototype.onKeyPress=function(a){0==a.charCode||this.composing||(a.preventDefault(),this.cm.isReadOnly()||nd(this.cm,Zf)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0))},di.prototype.readOnlyChanged=function(a){this.div.contentEditable=String("nocursor"!=a)},di.prototype.onContextMenu=function(){},di.prototype.resetPosition=function(){},di.prototype.needsContentAttribute=!0;var ei=function(a){this.cm=a,this.prevInput="",this.pollingFast=!1,this.polling=new Og,this.hasSelection=!1,this.composing=null};ei.prototype.init=function(a){function b(a){if(!Ba(e,a)){if(e.somethingSelected())Yf({lineWise:!1,text:e.getSelections()});else{if(!e.options.lineWiseCopyCut)return;var b=ag(e);Yf({lineWise:!0,text:b.text}),"cut"==a.type?e.setSelections(b.ranges,null,Tg):(d.prevInput="",f.value=b.text.join("\n"),Ng(f))}"cut"==a.type&&(e.state.cutIncoming=!0)}}var c=this,d=this,e=this.cm;this.createField(a);var f=this.textarea;a.wrapper.insertBefore(this.wrapper,a.wrapper.firstChild),Cg&&(f.style.width="0px"),ch(f,"input",(function(){tg&&ug>=9&&c.hasSelection&&(c.hasSelection=null),d.poll()})),ch(f,"paste",(function(a){Ba(e,a)||$f(a,e)||(e.state.pasteIncoming=!0,d.fastPoll())})),ch(f,"cut",b),ch(f,"copy",b),ch(a.scroller,"paste",(function(b){Jb(a,b)||Ba(e,b)||(e.state.pasteIncoming=!0,d.focus())})),ch(a.lineSpace,"selectstart",(function(b){Jb(a,b)||Fa(b)})),ch(f,"compositionstart",(function(){var a=e.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:a,range:e.markText(a,e.getCursor("to"),{className:"CodeMirror-composing"})}})),ch(f,"compositionend",(function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)}))},ei.prototype.createField=function(a){this.wrapper=cg(),this.textarea=this.wrapper.firstChild},ei.prototype.prepareSelection=function(){var a=this.cm,b=a.display,c=a.doc,d=Bc(a);if(a.options.moveInputWithCursor){var e=ic(a,c.sel.primary().head,"div"),f=b.wrapper.getBoundingClientRect(),g=b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,e.top+g.top-f.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,e.left+g.left-f.left))}return d},ei.prototype.showSelection=function(a){var b=this.cm,d=b.display;c(d.cursorDiv,a.cursors),c(d.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},ei.prototype.reset=function(a){if(!this.contextMenuPending&&!this.composing){var b=this.cm;if(b.somethingSelected()){this.prevInput="";var c=b.getSelection();this.textarea.value=c,b.state.focused&&Ng(this.textarea),tg&&ug>=9&&(this.hasSelection=c)}else a||(this.prevInput=this.textarea.value="",tg&&ug>=9&&(this.hasSelection=null))}},ei.prototype.getField=function(){return this.textarea},ei.prototype.supportsTouch=function(){return!1},ei.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Eg||g()!=this.textarea))try{this.textarea.focus()}catch(a){}},ei.prototype.blur=function(){this.textarea.blur()},ei.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ei.prototype.receivedFocus=function(){this.slowPoll()},ei.prototype.slowPoll=function(){var a=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){a.poll(),a.cm.state.focused&&a.slowPoll()}))},ei.prototype.fastPoll=function(){function a(){var d=c.poll();d||b?(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0,c.polling.set(20,a)},ei.prototype.poll=function(){var a=this,b=this.cm,c=this.textarea,d=this.prevInput;if(this.contextMenuPending||!b.state.focused||fh(c)&&!d&&!this.composing||b.isReadOnly()||b.options.disableInput||b.state.keySeq)return!1;var e=c.value;if(e==d&&!b.somethingSelected())return!1;if(tg&&ug>=9&&this.hasSelection===e||Fg&&/[\uf700-\uf7ff]/.test(e))return b.display.input.reset(),!1;if(b.doc.sel==b.display.selForContextMenu){var f=e.charCodeAt(0);if(8203!=f||d||(d="​"),8666==f)return this.reset(),this.cm.execCommand("undo")}for(var g=0,h=Math.min(d.length,e.length);g1e3||e.indexOf("\n")>-1?c.value=a.prevInput="":a.prevInput=e,a.composing&&(a.composing.range.clear(),a.composing.range=b.markText(a.composing.start,b.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ei.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ei.prototype.onKeyPress=function(){tg&&ug>=9&&(this.hasSelection=null),this.fastPoll()},ei.prototype.onContextMenu=function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b="​"+(a?g.value:"");g.value="⇚",g.value=b,d.prevInput=a?"":"​",g.selectionStart=1,g.selectionEnd=b.length,f.selForContextMenu=e.doc.sel}}function c(){if(d.contextMenuPending=!1,d.wrapper.style.cssText=l,g.style.cssText=k,tg&&ug<9&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!tg||tg&&ug<9)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&"​"==d.prevInput?nd(e,Be)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):(f.selForContextMenu=null,f.input.reset())};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=yc(e,a),i=f.scroller.scrollTop;if(h&&!yg){var j=e.options.resetSelectionOnContextMenu;j&&e.doc.sel.contains(h)==-1&&nd(e,te)(e.doc,Nd(h),Tg);var k=g.style.cssText,l=d.wrapper.style.cssText;d.wrapper.style.cssText="position: absolute";var m=d.wrapper.getBoundingClientRect();g.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(a.clientY-m.top-5)+"px; left: "+(a.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(tg?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var n;if(vg&&(n=window.scrollY),f.input.focus(),vg&&window.scrollTo(null,n),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),tg&&ug>=9&&b(),Lg){Ia(a);var o=function(){za(window,"mouseup",o),setTimeout(c,20)};ch(window,"mouseup",o)}else setTimeout(c,50)}},ei.prototype.readOnlyChanged=function(a){a||this.reset(),this.textarea.disabled="nocursor"==a},ei.prototype.setUneditable=function(){},ei.prototype.needsContentAttribute=!1,Rf(Vf),ci(Vf);var fi="iter insert remove copy getEditor constructor".split(" ");for(var gi in Kh.prototype)Kh.prototype.hasOwnProperty(gi)&&m(fi,gi)<0&&(Vf.prototype[gi]=(function(a){return function(){return a.apply(this.doc,arguments)}})(Kh.prototype[gi]));return Ea(Kh),Vf.inputStyles={textarea:ei,contenteditable:di},Vf.defineMode=function(a){Vf.defaults.mode||"null"==a||(Vf.defaults.mode=a),Oa.apply(this,arguments)},Vf.defineMIME=Pa,Vf.defineMode("null",(function(){return{token:function(a){return a.skipToEnd()}}})),Vf.defineMIME("text/plain","null"),Vf.defineExtension=function(a,b){Vf.prototype[a]=b},Vf.defineDocExtension=function(a,b){Kh.prototype[a]=b},Vf.fromTextArea=lg,mg(Vf),Vf.version="5.37.0",Vf})); \ No newline at end of file diff --git a/media/editors/codemirror/mode/clike/clike.js b/media/editors/codemirror/mode/clike/clike.js index da7a6bf5b6697..d5c8bf5d4c609 100644 --- a/media/editors/codemirror/mode/clike/clike.js +++ b/media/editors/codemirror/mode/clike/clike.js @@ -624,6 +624,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { defKeywords: words("class val var object interface fun"), atoms: words("true false null this"), hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + }, '"': function(stream, state) { state.tokenize = tokenKotlinString(stream.match('""')); return state.tokenize(stream, state); diff --git a/media/editors/codemirror/mode/clike/clike.min.js b/media/editors/codemirror/mode/clike/clike.min.js index 8e36f66eeac94..f9ce2d86b1772 100644 --- a/media/editors/codemirror/mode/clike/clike.min.js +++ b/media/editors/codemirror/mode/clike/clike.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.info=d,this.align=e,this.prev=f}function c(a,c,d,e){var f=a.indented;return a.context&&"statement"==a.context.type&&"statement"!=d&&(f=a.context.indented),a.context=new b(f,c,d,e,null,a.context)}function d(a){var b=a.context.type;return")"!=b&&"]"!=b&&"}"!=b||(a.indented=a.context.indented),a.context=a.context.prev}function e(a,b,c){return"variable"==b.prevToken||"type"==b.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(a.string.slice(0,c))||(!(!b.typeAtEndOfLine||a.column()!=a.indentation())||void 0))}function f(a){for(;;){if(!a||"top"==a.type)return!0;if("}"==a.type&&"namespace"!=a.prev.info)return!1;a=a.prev}}function g(a){for(var b={},c=a.split(" "),d=0;d!?|\/]/,H=i.isIdentifierChar||/[\w\$_\xa1-\uffff]/;return{startState:function(a){return{tokenize:null,context:new b((a||0)-p,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(a,b){var g=b.context;if(a.sol()&&(null==g.align&&(g.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return m(a,b),null;n=o=null;var h=(b.tokenize||j)(a,b);if("comment"==h||"meta"==h)return h;if(null==g.align&&(g.align=!0),";"==n||":"==n||","==n&&a.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==b.context.type;)d(b);else if("{"==n)c(b,a.column(),"}");else if("["==n)c(b,a.column(),"]");else if("("==n)c(b,a.column(),")");else if("}"==n){for(;"statement"==g.type;)g=d(b);for("}"==g.type&&(g=d(b));"statement"==g.type;)g=d(b)}else n==g.type?d(b):A&&(("}"==g.type||"top"==g.type)&&";"!=n||"statement"==g.type&&"newstatement"==n)&&c(b,a.column(),"statement",a.current());if("variable"==h&&("def"==b.prevToken||i.typeFirstDefinitions&&e(a,b,a.start)&&f(b.context)&&a.match(/^\s*\(/,!1))&&(h="def"),y.token){var k=y.token(a,b,h);void 0!==k&&(h=k)}return"def"==h&&i.styleDefs===!1&&(h="variable"),b.startOfLine=!1,b.prevToken=o?"def":h||n,m(a,b),h},indent:function(b,c){if(b.tokenize!=j&&null!=b.tokenize||b.typeAtEndOfLine)return a.Pass;var d=b.context,e=c&&c.charAt(0);if("statement"==d.type&&"}"==e&&(d=d.prev),i.dontIndentStatements)for(;"statement"==d.type&&i.dontIndentStatements.test(d.info);)d=d.prev;if(y.indent){var f=y.indent(b,d,c);if("number"==typeof f)return f}var g=e==d.type,h=d.prev&&"switch"==d.prev.info;if(i.allmanIndentation&&/[{(]/.test(e)){for(;"top"!=d.type&&"}"!=d.type;)d=d.prev;return d.indented}return"statement"==d.type?d.indented+("{"==e?0:q):!d.align||r&&")"==d.type?")"!=d.type||g?d.indented+(g?0:p)+(g||!h||/^(?:case|default)\b/.test(c)?0:p):d.indented+q:d.column+(g?0:1)},electricInput:B?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}}));var u="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",v="int long char short double float unsigned signed void size_t ptrdiff_t";p(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:g(u),types:g(v+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:g("case do else for if switch while struct"),defKeywords:g("struct"),typeFirstDefinitions:!0,atoms:g("NULL true false"),hooks:{"#":i,"*":j},modeProps:{fold:["brace","include"]}}),p(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:g(u+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:g(v+" bool wchar_t"),blockKeywords:g("catch class do else finally for if struct switch try while"),defKeywords:g("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:g("true false NULL"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,hooks:{"#":i,"*":j,u:l,U:l,L:l,R:l,0:k,1:k,2:k,3:k,4:k,5:k,6:k,7:k,8:k,9:k,token:function(a,b,c){if("variable"==c&&"("==a.peek()&&(";"==b.prevToken||null==b.prevToken||"}"==b.prevToken)&&m(a.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),p("text/x-java",{name:"clike",keywords:g("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:g("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:g("catch class do else finally for if switch try while"),defKeywords:g("class interface enum @interface"),typeFirstDefinitions:!0,atoms:g("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(a){return!a.match("interface",!1)&&(a.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),p("text/x-csharp",{name:"clike",keywords:g("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:g("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:g("catch class do else finally for foreach if struct switch try while"),defKeywords:g("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:g("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=n,n(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),p("text/x-scala",{name:"clike",keywords:g("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:g("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:g("catch class enum do else finally for forSome if match switch try while"),defKeywords:g("class enum def object package trait type val var"),atoms:g("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return!!a.match('""')&&(b.tokenize=q,b.tokenize(a,b))},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(a,c){var d=c.context;return!("}"!=d.type||!d.align||!a.eat(">"))&&(c.context=new b(d.indented,d.column,d.type,d.info,null,d.prev),"operator")},"/":function(a,b){return!!a.eat("*")&&(b.tokenize=r(1),b.tokenize(a,b))}},modeProps:{closeBrackets:{triples:'"'}}}),p("text/x-kotlin",{name:"clike",keywords:g("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:g("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:g("catch class do else finally for if where try while enum"),defKeywords:g("class val var object interface fun"),atoms:g("true false null this"),hooks:{'"':function(a,b){return b.tokenize=s(a.match('""')),b.tokenize(a,b)}},modeProps:{closeBrackets:{triples:'"'}}}),p(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:g("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:g("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:g("for while do if else struct"),builtin:g("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:g("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":i},modeProps:{fold:["brace","include"]}}),p("text/x-nesc",{name:"clike",keywords:g(u+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:g(v),blockKeywords:g("case do else for if switch while struct"),atoms:g("null true false"),hooks:{"#":i},modeProps:{fold:["brace","include"]}}),p("text/x-objectivec",{name:"clike",keywords:g(u+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:g(v),atoms:g("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(a){return a.eatWhile(/[\w\$]/),"keyword"},"#":i,indent:function(a,b,c){if("statement"==b.type&&/^@\w/.test(c))return b.indented}},modeProps:{fold:"brace"}}),p("text/x-squirrel",{name:"clike",keywords:g("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:g(v),blockKeywords:g("case catch class else for foreach if switch try while"),defKeywords:g("function local class"),typeFirstDefinitions:!0,atoms:g("true false null"),hooks:{"#":i},modeProps:{fold:["brace","include"]}});var w=null;p("text/x-ceylon",{name:"clike",keywords:g("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(a){var b=a.charAt(0);return b===b.toUpperCase()&&b!==b.toLowerCase()},blockKeywords:g("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:g("class dynamic function interface module object package value"),builtin:g("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:g("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return b.tokenize=t(a.match('""')?"triple":"single"),b.tokenize(a,b)},"`":function(a,b){return!(!w||!a.match("`"))&&(b.tokenize=w,w=null,b.tokenize(a,b))},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(a,b,c){if(("variable"==c||"type"==c)&&"."==b.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.info=d,this.align=e,this.prev=f}function c(a,c,d,e){var f=a.indented;return a.context&&"statement"==a.context.type&&"statement"!=d&&(f=a.context.indented),a.context=new b(f,c,d,e,null,a.context)}function d(a){var b=a.context.type;return")"!=b&&"]"!=b&&"}"!=b||(a.indented=a.context.indented),a.context=a.context.prev}function e(a,b,c){return"variable"==b.prevToken||"type"==b.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(a.string.slice(0,c))||(!(!b.typeAtEndOfLine||a.column()!=a.indentation())||void 0))}function f(a){for(;;){if(!a||"top"==a.type)return!0;if("}"==a.type&&"namespace"!=a.prev.info)return!1;a=a.prev}}function g(a){for(var b={},c=a.split(" "),d=0;d!?|\/]/,H=i.isIdentifierChar||/[\w\$_\xa1-\uffff]/;return{startState:function(a){return{tokenize:null,context:new b((a||0)-p,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(a,b){var g=b.context;if(a.sol()&&(null==g.align&&(g.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return m(a,b),null;n=o=null;var h=(b.tokenize||j)(a,b);if("comment"==h||"meta"==h)return h;if(null==g.align&&(g.align=!0),";"==n||":"==n||","==n&&a.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==b.context.type;)d(b);else if("{"==n)c(b,a.column(),"}");else if("["==n)c(b,a.column(),"]");else if("("==n)c(b,a.column(),")");else if("}"==n){for(;"statement"==g.type;)g=d(b);for("}"==g.type&&(g=d(b));"statement"==g.type;)g=d(b)}else n==g.type?d(b):A&&(("}"==g.type||"top"==g.type)&&";"!=n||"statement"==g.type&&"newstatement"==n)&&c(b,a.column(),"statement",a.current());if("variable"==h&&("def"==b.prevToken||i.typeFirstDefinitions&&e(a,b,a.start)&&f(b.context)&&a.match(/^\s*\(/,!1))&&(h="def"),y.token){var k=y.token(a,b,h);void 0!==k&&(h=k)}return"def"==h&&i.styleDefs===!1&&(h="variable"),b.startOfLine=!1,b.prevToken=o?"def":h||n,m(a,b),h},indent:function(b,c){if(b.tokenize!=j&&null!=b.tokenize||b.typeAtEndOfLine)return a.Pass;var d=b.context,e=c&&c.charAt(0);if("statement"==d.type&&"}"==e&&(d=d.prev),i.dontIndentStatements)for(;"statement"==d.type&&i.dontIndentStatements.test(d.info);)d=d.prev;if(y.indent){var f=y.indent(b,d,c);if("number"==typeof f)return f}var g=e==d.type,h=d.prev&&"switch"==d.prev.info;if(i.allmanIndentation&&/[{(]/.test(e)){for(;"top"!=d.type&&"}"!=d.type;)d=d.prev;return d.indented}return"statement"==d.type?d.indented+("{"==e?0:q):!d.align||r&&")"==d.type?")"!=d.type||g?d.indented+(g?0:p)+(g||!h||/^(?:case|default)\b/.test(c)?0:p):d.indented+q:d.column+(g?0:1)},electricInput:B?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}}));var u="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",v="int long char short double float unsigned signed void size_t ptrdiff_t";p(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:g(u),types:g(v+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:g("case do else for if switch while struct"),defKeywords:g("struct"),typeFirstDefinitions:!0,atoms:g("NULL true false"),hooks:{"#":i,"*":j},modeProps:{fold:["brace","include"]}}),p(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:g(u+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:g(v+" bool wchar_t"),blockKeywords:g("catch class do else finally for if struct switch try while"),defKeywords:g("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:g("true false NULL"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,hooks:{"#":i,"*":j,u:l,U:l,L:l,R:l,0:k,1:k,2:k,3:k,4:k,5:k,6:k,7:k,8:k,9:k,token:function(a,b,c){if("variable"==c&&"("==a.peek()&&(";"==b.prevToken||null==b.prevToken||"}"==b.prevToken)&&m(a.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),p("text/x-java",{name:"clike",keywords:g("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:g("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:g("catch class do else finally for if switch try while"),defKeywords:g("class interface enum @interface"),typeFirstDefinitions:!0,atoms:g("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(a){return!a.match("interface",!1)&&(a.eatWhile(/[\w\$_]/),"meta")}},modeProps:{fold:["brace","import"]}}),p("text/x-csharp",{name:"clike",keywords:g("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:g("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:g("catch class do else finally for foreach if struct switch try while"),defKeywords:g("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:g("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=n,n(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),p("text/x-scala",{name:"clike",keywords:g("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:g("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:g("catch class enum do else finally for forSome if match switch try while"),defKeywords:g("class enum def object package trait type val var"),atoms:g("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return!!a.match('""')&&(b.tokenize=q,b.tokenize(a,b))},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(a,c){var d=c.context;return!("}"!=d.type||!d.align||!a.eat(">"))&&(c.context=new b(d.indented,d.column,d.type,d.info,null,d.prev),"operator")},"/":function(a,b){return!!a.eat("*")&&(b.tokenize=r(1),b.tokenize(a,b))}},modeProps:{closeBrackets:{triples:'"'}}}),p("text/x-kotlin",{name:"clike",keywords:g("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:g("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:g("catch class do else finally for if where try while enum"),defKeywords:g("class val var object interface fun"),atoms:g("true false null this"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return b.tokenize=s(a.match('""')),b.tokenize(a,b)}},modeProps:{closeBrackets:{triples:'"'}}}),p(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:g("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:g("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:g("for while do if else struct"),builtin:g("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:g("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":i},modeProps:{fold:["brace","include"]}}),p("text/x-nesc",{name:"clike",keywords:g(u+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:g(v),blockKeywords:g("case do else for if switch while struct"),atoms:g("null true false"),hooks:{"#":i},modeProps:{fold:["brace","include"]}}),p("text/x-objectivec",{name:"clike",keywords:g(u+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:g(v),atoms:g("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(a){return a.eatWhile(/[\w\$]/),"keyword"},"#":i,indent:function(a,b,c){if("statement"==b.type&&/^@\w/.test(c))return b.indented}},modeProps:{fold:"brace"}}),p("text/x-squirrel",{name:"clike",keywords:g("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:g(v),blockKeywords:g("case catch class else for foreach if switch try while"),defKeywords:g("function local class"),typeFirstDefinitions:!0,atoms:g("true false null"),hooks:{"#":i},modeProps:{fold:["brace","include"]}});var w=null;p("text/x-ceylon",{name:"clike",keywords:g("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(a){var b=a.charAt(0);return b===b.toUpperCase()&&b!==b.toLowerCase()},blockKeywords:g("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:g("class dynamic function interface module object package value"),builtin:g("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:g("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return b.tokenize=t(a.match('""')?"triple":"single"),b.tokenize(a,b)},"`":function(a,b){return!(!w||!a.match("`"))&&(b.tokenize=w,w=null,b.tokenize(a,b))},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(a,b,c){if(("variable"==c||"type"==c)&&"."==b.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})); \ No newline at end of file diff --git a/media/editors/codemirror/mode/javascript/javascript.js b/media/editors/codemirror/mode/javascript/javascript.js index 52da9e23532a4..c4a709c624972 100644 --- a/media/editors/codemirror/mode/javascript/javascript.js +++ b/media/editors/codemirror/mode/javascript/javascript.js @@ -126,7 +126,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { var kw = keywords[word] return ret(kw.type, kw.style, word) } - if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\(\w]/, false)) + if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false)) return ret("async", "keyword", word) } return ret("variable", "variable", word) @@ -356,6 +356,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { } else if (isTS && value == "namespace") { cx.marked = "keyword" return cont(pushlex("form"), expression, block, poplex) + } else if (isTS && value == "abstract") { + cx.marked = "keyword" + return cont(statement) } else { return cont(pushlex("stat"), maybelabel); } @@ -560,19 +563,19 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { } } function typeexpr(type, value) { + if (value == "keyof" || value == "typeof") { + cx.marked = "keyword" + return cont(value == "keyof" ? typeexpr : expressionNoComma) + } if (type == "variable" || value == "void") { - if (value == "keyof") { - cx.marked = "keyword" - return cont(typeexpr) - } else { - cx.marked = "type" - return cont(afterType) - } + cx.marked = "type" + return cont(afterType) } if (type == "string" || type == "number" || type == "atom") return cont(afterType); if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType) if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType) if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType) + if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr) } function maybeReturnType(type) { if (type == "=>") return cont(typeexpr) @@ -589,9 +592,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { return cont(expression, maybetype, expect("]"), typeprop) } } - function typearg(type) { - if (type == "variable") return cont(typearg) - else if (type == ":") return cont(typeexpr) + function typearg(type, value) { + if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg) + if (type == ":") return cont(typeexpr) + return pass(typeexpr) } function afterType(type, value) { if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) diff --git a/media/editors/codemirror/mode/javascript/javascript.min.js b/media/editors/codemirror/mode/javascript/javascript.min.js index fca8ff5744947..2c7636b9649c8 100644 --- a/media/editors/codemirror/mode/javascript/javascript.min.js +++ b/media/editors/codemirror/mode/javascript/javascript.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";a.defineMode("javascript",(function(b,c){function d(a){for(var b,c=!1,d=!1;null!=(b=a.next());){if(!c){if("/"==b&&!d)return;"["==b?d=!0:d&&"]"==b&&(d=!1)}c=!c&&"\\"==b}}function e(a,b,c){return Ga=a,Ha=c,b}function f(a,b){var c=a.next();if('"'==c||"'"==c)return b.tokenize=g(c),b.tokenize(a,b);if("."==c&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return e("number","number");if("."==c&&a.match(".."))return e("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(c))return e(c);if("="==c&&a.eat(">"))return e("=>","operator");if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),e("number","number");if("0"==c&&a.eat(/o/i))return a.eatWhile(/[0-7]/i),e("number","number");if("0"==c&&a.eat(/b/i))return a.eatWhile(/[01]/i),e("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),e("number","number");if("/"==c)return a.eat("*")?(b.tokenize=h,h(a,b)):a.eat("/")?(a.skipToEnd(),e("comment","comment")):Fa(a,b,1)?(d(a),a.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),e("regexp","string-2")):(a.eat("="),e("operator","operator",a.current()));if("`"==c)return b.tokenize=i,i(a,b);if("#"==c)return a.skipToEnd(),e("error","error");if(Pa.test(c))return">"==c&&b.lexical&&">"==b.lexical.type||(a.eat("=")?"!"!=c&&"="!=c||a.eat("="):/[<>*+\-]/.test(c)&&(a.eat(c),">"==c&&a.eat(c))),e("operator","operator",a.current());if(Na.test(c)){a.eatWhile(Na);var f=a.current();if("."!=b.lastType){if(Oa.propertyIsEnumerable(f)){var j=Oa[f];return e(j.type,j.style,f)}if("async"==f&&a.match(/^(\s|\/\*.*?\*\/)*[\(\w]/,!1))return e("async","keyword",f)}return e("variable","variable",f)}}function g(a){return function(b,c){var d,g=!1;if(Ka&&"@"==b.peek()&&b.match(Qa))return c.tokenize=f,e("jsonld-keyword","meta");for(;null!=(d=b.next())&&(d!=a||g);)g=!g&&"\\"==d;return g||(c.tokenize=f),e("string","string")}}function h(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=f;break}d="*"==c}return e("comment","comment")}function i(a,b){for(var c,d=!1;null!=(c=a.next());){if(!d&&("`"==c||"$"==c&&a.eat("{"))){b.tokenize=f;break}d=!d&&"\\"==c}return e("quasi","string-2",a.current())}function j(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var c=a.string.indexOf("=>",a.start);if(!(c<0)){if(Ma){var d=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(a.string.slice(a.start,c));d&&(c=d.index)}for(var e=0,f=!1,g=c-1;g>=0;--g){var h=a.string.charAt(g),i=Ra.indexOf(h);if(i>=0&&i<3){if(!e){++g;break}if(0==--e){"("==h&&(f=!0);break}}else if(i>=3&&i<6)++e;else if(Na.test(h))f=!0;else{if(/["'\/]/.test(h))return;if(f&&!e){++g;break}}}f&&!e&&(b.fatArrowAt=g)}}function k(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function l(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0;for(var d=a.context;d;d=d.prev)for(var c=d.vars;c;c=c.next)if(c.name==b)return!0}function m(a,b,c,d,e){var f=a.cc;for(Ta.state=a,Ta.stream=e,Ta.marked=null,Ta.cc=f,Ta.style=b,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var g=f.length?f.pop():La?x:w;if(g(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return Ta.marked?Ta.marked:"variable"==c&&l(a,d)?"variable-2":b}}}function n(){for(var a=arguments.length-1;a>=0;a--)Ta.cc.push(arguments[a])}function o(){return n.apply(null,arguments),!0}function p(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}var d=Ta.state;if(Ta.marked="def",d.context){if(b(d.localVars))return;d.localVars={name:a,next:d.localVars}}else{if(b(d.globalVars))return;c.globalVars&&(d.globalVars={name:a,next:d.globalVars})}}function q(a){return"public"==a||"private"==a||"protected"==a||"abstract"==a||"readonly"==a}function r(){Ta.state.context={prev:Ta.state.context,vars:Ta.state.localVars},Ta.state.localVars=Ua}function s(){Ta.state.localVars=Ta.state.context.vars,Ta.state.context=Ta.state.context.prev}function t(a,b){var c=function(){var c=Ta.state,d=c.indented;if("stat"==c.lexical.type)d=c.lexical.indented;else for(var e=c.lexical;e&&")"==e.type&&e.align;e=e.prev)d=e.indented;c.lexical=new k(d,Ta.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function u(){var a=Ta.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function v(a){function b(c){return c==a?o():";"==a?n():o(b)}return b}function w(a,b){return"var"==a?o(t("vardef",b.length),ca,v(";"),u):"keyword a"==a?o(t("form"),z,w,u):"keyword b"==a?o(t("form"),w,u):"keyword d"==a?Ta.stream.match(/^\s*$/,!1)?o():o(t("stat"),B,v(";"),u):"debugger"==a?o(v(";")):"{"==a?o(t("}"),S,u):";"==a?o():"if"==a?("else"==Ta.state.lexical.info&&Ta.state.cc[Ta.state.cc.length-1]==u&&Ta.state.cc.pop()(),o(t("form"),z,w,u,ha)):"function"==a?o(na):"for"==a?o(t("form"),ia,w,u):"class"==a||Ma&&"interface"==b?(Ta.marked="keyword",o(t("form"),qa,u)):"variable"==a?Ma&&"declare"==b?(Ta.marked="keyword",o(w)):Ma&&("module"==b||"enum"==b||"type"==b)&&Ta.stream.match(/^\s*\w/,!1)?(Ta.marked="keyword","enum"==b?o(Ca):"type"==b?o(W,v("operator"),W,v(";")):o(t("form"),da,v("{"),t("}"),S,u,u)):Ma&&"namespace"==b?(Ta.marked="keyword",o(t("form"),x,S,u)):o(t("stat"),L):"switch"==a?o(t("form"),z,v("{"),t("}","switch"),S,u,u):"case"==a?o(x,v(":")):"default"==a?o(v(":")):"catch"==a?o(t("form"),r,v("("),oa,v(")"),w,u,s):"export"==a?o(t("stat"),ua,u):"import"==a?o(t("stat"),wa,u):"async"==a?o(w):"@"==b?o(x,w):n(t("stat"),x,v(";"),u)}function x(a,b){return A(a,b,!1)}function y(a,b){return A(a,b,!0)}function z(a){return"("!=a?n():o(t(")"),x,v(")"),u)}function A(a,b,c){if(Ta.state.fatArrowAt==Ta.stream.start){var d=c?H:G;if("("==a)return o(r,t(")"),Q(oa,")"),u,v("=>"),d,s);if("variable"==a)return n(r,da,v("=>"),d,s)}var e=c?D:C;return Sa.hasOwnProperty(a)?o(e):"function"==a?o(na,e):"class"==a||Ma&&"interface"==b?(Ta.marked="keyword",o(t("form"),pa,u)):"keyword c"==a||"async"==a?o(c?y:x):"("==a?o(t(")"),B,v(")"),u,e):"operator"==a||"spread"==a?o(c?y:x):"["==a?o(t("]"),Ba,u,e):"{"==a?R(N,"}",null,e):"quasi"==a?n(E,e):"new"==a?o(I(c)):"import"==a?o(x):o()}function B(a){return a.match(/[;\}\)\],]/)?n():n(x)}function C(a,b){return","==a?o(x):D(a,b,!1)}function D(a,b,c){var d=0==c?C:D,e=0==c?x:y;return"=>"==a?o(r,c?H:G,s):"operator"==a?/\+\+|--/.test(b)||Ma&&"!"==b?o(d):Ma&&"<"==b&&Ta.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?o(t(">"),Q(W,">"),u,d):"?"==b?o(x,v(":"),e):o(e):"quasi"==a?n(E,d):";"!=a?"("==a?R(y,")","call",d):"."==a?o(M,d):"["==a?o(t("]"),B,v("]"),u,d):Ma&&"as"==b?(Ta.marked="keyword",o(W,d)):"regexp"==a?(Ta.state.lastType=Ta.marked="operator",Ta.stream.backUp(Ta.stream.pos-Ta.stream.start-1),o(e)):void 0:void 0}function E(a,b){return"quasi"!=a?n():"${"!=b.slice(b.length-2)?o(E):o(x,F)}function F(a){if("}"==a)return Ta.marked="string-2",Ta.state.tokenize=i,o(E)}function G(a){return j(Ta.stream,Ta.state),n("{"==a?w:x)}function H(a){return j(Ta.stream,Ta.state),n("{"==a?w:y)}function I(a){return function(b){return"."==b?o(a?K:J):"variable"==b&&Ma?o(_,a?D:C):n(a?y:x)}}function J(a,b){if("target"==b)return Ta.marked="keyword",o(C)}function K(a,b){if("target"==b)return Ta.marked="keyword",o(D)}function L(a){return":"==a?o(u,w):n(C,v(";"),u)}function M(a){if("variable"==a)return Ta.marked="property",o()}function N(a,b){if("async"==a)return Ta.marked="property",o(N);if("variable"==a||"keyword"==Ta.style){if(Ta.marked="property","get"==b||"set"==b)return o(O);var c;return Ma&&Ta.state.fatArrowAt==Ta.stream.start&&(c=Ta.stream.match(/^\s*:\s*/,!1))&&(Ta.state.fatArrowAt=Ta.stream.pos+c[0].length),o(P)}return"number"==a||"string"==a?(Ta.marked=Ka?"property":Ta.style+" property",o(P)):"jsonld-keyword"==a?o(P):Ma&&q(b)?(Ta.marked="keyword",o(N)):"["==a?o(x,T,v("]"),P):"spread"==a?o(y,P):"*"==b?(Ta.marked="keyword",o(N)):":"==a?n(P):void 0}function O(a){return"variable"!=a?n(P):(Ta.marked="property",o(na))}function P(a){return":"==a?o(y):"("==a?n(na):void 0}function Q(a,b,c){function d(e,f){if(c?c.indexOf(e)>-1:","==e){var g=Ta.state.lexical;return"call"==g.info&&(g.pos=(g.pos||0)+1),o((function(c,d){return c==b||d==b?n():n(a)}),d)}return e==b||f==b?o():o(v(b))}return function(c,e){return c==b||e==b?o():n(a,d)}}function R(a,b,c){for(var d=3;d"==a)return o(W)}function Y(a,b){return"variable"==a||"keyword"==Ta.style?(Ta.marked="property",o(Y)):"?"==b?o(Y):":"==a?o(W):"["==a?o(x,T,v("]"),Y):void 0}function Z(a){return"variable"==a?o(Z):":"==a?o(W):void 0}function $(a,b){return"<"==b?o(t(">"),Q(W,">"),u,$):"|"==b||"."==a||"&"==b?o(W):"["==a?o(v("]"),$):"extends"==b||"implements"==b?(Ta.marked="keyword",o(W)):void 0}function _(a,b){if("<"==b)return o(t(">"),Q(W,">"),u,$)}function aa(){return n(W,ba)}function ba(a,b){if("="==b)return o(W)}function ca(a,b){return"enum"==b?(Ta.marked="keyword",o(Ca)):n(da,T,fa,ga)}function da(a,b){return Ma&&q(b)?(Ta.marked="keyword",o(da)):"variable"==a?(p(b),o()):"spread"==a?o(da):"["==a?R(da,"]"):"{"==a?R(ea,"}"):void 0}function ea(a,b){return"variable"!=a||Ta.stream.match(/^\s*:/,!1)?("variable"==a&&(Ta.marked="property"),"spread"==a?o(da):"}"==a?n():o(v(":"),da,fa)):(p(b),o(fa))}function fa(a,b){if("="==b)return o(y)}function ga(a){if(","==a)return o(ca)}function ha(a,b){if("keyword b"==a&&"else"==b)return o(t("form","else"),w,u)}function ia(a,b){return"await"==b?o(ia):"("==a?o(t(")"),ja,v(")"),u):void 0}function ja(a){return"var"==a?o(ca,v(";"),la):";"==a?o(la):"variable"==a?o(ka):n(x,v(";"),la)}function ka(a,b){return"in"==b||"of"==b?(Ta.marked="keyword",o(x)):o(C,la)}function la(a,b){return";"==a?o(ma):"in"==b||"of"==b?(Ta.marked="keyword",o(x)):n(x,v(";"),ma)}function ma(a){")"!=a&&o(x)}function na(a,b){return"*"==b?(Ta.marked="keyword",o(na)):"variable"==a?(p(b),o(na)):"("==a?o(r,t(")"),Q(oa,")"),u,U,w,s):Ma&&"<"==b?o(t(">"),Q(aa,">"),u,na):void 0}function oa(a,b){return"@"==b&&o(x,oa),"spread"==a?o(oa):Ma&&q(b)?(Ta.marked="keyword",o(oa)):n(da,T,fa)}function pa(a,b){return"variable"==a?qa(a,b):ra(a,b)}function qa(a,b){if("variable"==a)return p(b),o(ra)}function ra(a,b){return"<"==b?o(t(">"),Q(aa,">"),u,ra):"extends"==b||"implements"==b||Ma&&","==a?("implements"==b&&(Ta.marked="keyword"),o(Ma?W:x,ra)):"{"==a?o(t("}"),sa,u):void 0}function sa(a,b){return"async"==a||"variable"==a&&("static"==b||"get"==b||"set"==b||Ma&&q(b))&&Ta.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Ta.marked="keyword",o(sa)):"variable"==a||"keyword"==Ta.style?(Ta.marked="property",o(Ma?ta:na,sa)):"["==a?o(x,T,v("]"),Ma?ta:na,sa):"*"==b?(Ta.marked="keyword",o(sa)):";"==a?o(sa):"}"==a?o():"@"==b?o(x,sa):void 0}function ta(a,b){return"?"==b?o(ta):":"==a?o(W,fa):"="==b?o(y):n(na)}function ua(a,b){return"*"==b?(Ta.marked="keyword",o(Aa,v(";"))):"default"==b?(Ta.marked="keyword",o(x,v(";"))):"{"==a?o(Q(va,"}"),Aa,v(";")):n(w)}function va(a,b){return"as"==b?(Ta.marked="keyword",o(v("variable"))):"variable"==a?n(y,va):void 0}function wa(a){return"string"==a?o():"("==a?n(x):n(xa,ya,Aa)}function xa(a,b){return"{"==a?R(xa,"}"):("variable"==a&&p(b),"*"==b&&(Ta.marked="keyword"),o(za))}function ya(a){if(","==a)return o(xa,ya)}function za(a,b){if("as"==b)return Ta.marked="keyword",o(xa)}function Aa(a,b){if("from"==b)return Ta.marked="keyword",o(x)}function Ba(a){return"]"==a?o():n(Q(y,"]"))}function Ca(){return n(t("form"),da,v("{"),t("}"),Q(Da,"}"),u,u)}function Da(){return n(da,fa)}function Ea(a,b){return"operator"==a.lastType||","==a.lastType||Pa.test(b.charAt(0))||/[,.]/.test(b.charAt(0))}function Fa(a,b,c){return b.tokenize==f&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(b.lastType)||"quasi"==b.lastType&&/\{\s*$/.test(a.string.slice(0,a.pos-(c||0)))}var Ga,Ha,Ia=b.indentUnit,Ja=c.statementIndent,Ka=c.jsonld,La=c.json||Ka,Ma=c.typescript,Na=c.wordCharacters||/[\w$\xa1-\uffff]/,Oa=(function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("keyword d"),f=a("operator"),g={type:"atom",style:"atom"};return{if:a("if"),while:b,with:b,else:c,do:c,try:c,finally:c,return:e,break:e,continue:e,new:a("new"),delete:d,void:d,throw:d,debugger:a("debugger"),var:a("var"),const:a("var"),let:a("var"),function:a("function"),catch:a("catch"),for:a("for"),switch:a("switch"),case:a("case"),default:a("default"),in:f,typeof:f,instanceof:f,true:g,false:g,null:g,undefined:g,NaN:g,Infinity:g,this:a("this"),class:a("class"),super:a("atom"),yield:d,export:a("export"),import:a("import"),extends:d,await:d}})(),Pa=/[+\-*&%=<>!?|~^@]/,Qa=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ra="([{}])",Sa={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ta={state:null,column:null,marked:null,cc:null},Ua={name:"this",next:{name:"arguments"}};return u.lex=!0,{startState:function(a){var b={tokenize:f,lastType:"sof",cc:[],lexical:new k((a||0)-Ia,0,"block",!1),localVars:c.localVars,context:c.localVars&&{vars:c.localVars},indented:a||0};return c.globalVars&&"object"==typeof c.globalVars&&(b.globalVars=c.globalVars),b},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),j(a,b)),b.tokenize!=h&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==Ga?c:(b.lastType="operator"!=Ga||"++"!=Ha&&"--"!=Ha?Ga:"incdec",m(b,c,Ga,Ha,a))},indent:function(b,d){if(b.tokenize==h)return a.Pass;if(b.tokenize!=f)return 0;var e,g=d&&d.charAt(0),i=b.lexical;if(!/^\s*else\b/.test(d))for(var j=b.cc.length-1;j>=0;--j){var k=b.cc[j];if(k==u)i=i.prev;else if(k!=ha)break}for(;("stat"==i.type||"form"==i.type)&&("}"==g||(e=b.cc[b.cc.length-1])&&(e==C||e==D)&&!/^[,\.=+\-*:?[\(]/.test(d));)i=i.prev;Ja&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var l=i.type,m=g==l;return"vardef"==l?i.indented+("operator"==b.lastType||","==b.lastType?i.info+1:0):"form"==l&&"{"==g?i.indented:"form"==l?i.indented+Ia:"stat"==l?i.indented+(Ea(b,d)?Ja||Ia:0):"switch"!=i.info||m||0==c.doubleIndentSwitch?i.align?i.column+(m?0:1):i.indented+(m?0:Ia):i.indented+(/^(?:case|default)\b/.test(d)?Ia:2*Ia)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:La?null:"/*",blockCommentEnd:La?null:"*/",blockCommentContinue:La?null:" * ",lineComment:La?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:La?"json":"javascript",jsonldMode:Ka,jsonMode:La,expressionAllowed:Fa,skipExpression:function(a){var b=a.cc[a.cc.length-1];b!=x&&b!=y||a.cc.pop()}}})),a.registerHelper("wordChars","javascript",/[\w$]/),a.defineMIME("text/javascript","javascript"),a.defineMIME("text/ecmascript","javascript"),a.defineMIME("application/javascript","javascript"),a.defineMIME("application/x-javascript","javascript"),a.defineMIME("application/ecmascript","javascript"),a.defineMIME("application/json",{name:"javascript",json:!0}),a.defineMIME("application/x-json",{name:"javascript",json:!0}),a.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),a.defineMIME("text/typescript",{name:"javascript",typescript:!0}),a.defineMIME("application/typescript",{name:"javascript",typescript:!0})})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";a.defineMode("javascript",(function(b,c){function d(a){for(var b,c=!1,d=!1;null!=(b=a.next());){if(!c){if("/"==b&&!d)return;"["==b?d=!0:d&&"]"==b&&(d=!1)}c=!c&&"\\"==b}}function e(a,b,c){return Ga=a,Ha=c,b}function f(a,b){var c=a.next();if('"'==c||"'"==c)return b.tokenize=g(c),b.tokenize(a,b);if("."==c&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return e("number","number");if("."==c&&a.match(".."))return e("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(c))return e(c);if("="==c&&a.eat(">"))return e("=>","operator");if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),e("number","number");if("0"==c&&a.eat(/o/i))return a.eatWhile(/[0-7]/i),e("number","number");if("0"==c&&a.eat(/b/i))return a.eatWhile(/[01]/i),e("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),e("number","number");if("/"==c)return a.eat("*")?(b.tokenize=h,h(a,b)):a.eat("/")?(a.skipToEnd(),e("comment","comment")):Fa(a,b,1)?(d(a),a.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),e("regexp","string-2")):(a.eat("="),e("operator","operator",a.current()));if("`"==c)return b.tokenize=i,i(a,b);if("#"==c)return a.skipToEnd(),e("error","error");if(Pa.test(c))return">"==c&&b.lexical&&">"==b.lexical.type||(a.eat("=")?"!"!=c&&"="!=c||a.eat("="):/[<>*+\-]/.test(c)&&(a.eat(c),">"==c&&a.eat(c))),e("operator","operator",a.current());if(Na.test(c)){a.eatWhile(Na);var f=a.current();if("."!=b.lastType){if(Oa.propertyIsEnumerable(f)){var j=Oa[f];return e(j.type,j.style,f)}if("async"==f&&a.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return e("async","keyword",f)}return e("variable","variable",f)}}function g(a){return function(b,c){var d,g=!1;if(Ka&&"@"==b.peek()&&b.match(Qa))return c.tokenize=f,e("jsonld-keyword","meta");for(;null!=(d=b.next())&&(d!=a||g);)g=!g&&"\\"==d;return g||(c.tokenize=f),e("string","string")}}function h(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=f;break}d="*"==c}return e("comment","comment")}function i(a,b){for(var c,d=!1;null!=(c=a.next());){if(!d&&("`"==c||"$"==c&&a.eat("{"))){b.tokenize=f;break}d=!d&&"\\"==c}return e("quasi","string-2",a.current())}function j(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var c=a.string.indexOf("=>",a.start);if(!(c<0)){if(Ma){var d=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(a.string.slice(a.start,c));d&&(c=d.index)}for(var e=0,f=!1,g=c-1;g>=0;--g){var h=a.string.charAt(g),i=Ra.indexOf(h);if(i>=0&&i<3){if(!e){++g;break}if(0==--e){"("==h&&(f=!0);break}}else if(i>=3&&i<6)++e;else if(Na.test(h))f=!0;else{if(/["'\/]/.test(h))return;if(f&&!e){++g;break}}}f&&!e&&(b.fatArrowAt=g)}}function k(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function l(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0;for(var d=a.context;d;d=d.prev)for(var c=d.vars;c;c=c.next)if(c.name==b)return!0}function m(a,b,c,d,e){var f=a.cc;for(Ta.state=a,Ta.stream=e,Ta.marked=null,Ta.cc=f,Ta.style=b,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var g=f.length?f.pop():La?x:w;if(g(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return Ta.marked?Ta.marked:"variable"==c&&l(a,d)?"variable-2":b}}}function n(){for(var a=arguments.length-1;a>=0;a--)Ta.cc.push(arguments[a])}function o(){return n.apply(null,arguments),!0}function p(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}var d=Ta.state;if(Ta.marked="def",d.context){if(b(d.localVars))return;d.localVars={name:a,next:d.localVars}}else{if(b(d.globalVars))return;c.globalVars&&(d.globalVars={name:a,next:d.globalVars})}}function q(a){return"public"==a||"private"==a||"protected"==a||"abstract"==a||"readonly"==a}function r(){Ta.state.context={prev:Ta.state.context,vars:Ta.state.localVars},Ta.state.localVars=Ua}function s(){Ta.state.localVars=Ta.state.context.vars,Ta.state.context=Ta.state.context.prev}function t(a,b){var c=function(){var c=Ta.state,d=c.indented;if("stat"==c.lexical.type)d=c.lexical.indented;else for(var e=c.lexical;e&&")"==e.type&&e.align;e=e.prev)d=e.indented;c.lexical=new k(d,Ta.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function u(){var a=Ta.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function v(a){function b(c){return c==a?o():";"==a?n():o(b)}return b}function w(a,b){return"var"==a?o(t("vardef",b.length),ca,v(";"),u):"keyword a"==a?o(t("form"),z,w,u):"keyword b"==a?o(t("form"),w,u):"keyword d"==a?Ta.stream.match(/^\s*$/,!1)?o():o(t("stat"),B,v(";"),u):"debugger"==a?o(v(";")):"{"==a?o(t("}"),S,u):";"==a?o():"if"==a?("else"==Ta.state.lexical.info&&Ta.state.cc[Ta.state.cc.length-1]==u&&Ta.state.cc.pop()(),o(t("form"),z,w,u,ha)):"function"==a?o(na):"for"==a?o(t("form"),ia,w,u):"class"==a||Ma&&"interface"==b?(Ta.marked="keyword",o(t("form"),qa,u)):"variable"==a?Ma&&"declare"==b?(Ta.marked="keyword",o(w)):Ma&&("module"==b||"enum"==b||"type"==b)&&Ta.stream.match(/^\s*\w/,!1)?(Ta.marked="keyword","enum"==b?o(Ca):"type"==b?o(W,v("operator"),W,v(";")):o(t("form"),da,v("{"),t("}"),S,u,u)):Ma&&"namespace"==b?(Ta.marked="keyword",o(t("form"),x,S,u)):Ma&&"abstract"==b?(Ta.marked="keyword",o(w)):o(t("stat"),L):"switch"==a?o(t("form"),z,v("{"),t("}","switch"),S,u,u):"case"==a?o(x,v(":")):"default"==a?o(v(":")):"catch"==a?o(t("form"),r,v("("),oa,v(")"),w,u,s):"export"==a?o(t("stat"),ua,u):"import"==a?o(t("stat"),wa,u):"async"==a?o(w):"@"==b?o(x,w):n(t("stat"),x,v(";"),u)}function x(a,b){return A(a,b,!1)}function y(a,b){return A(a,b,!0)}function z(a){return"("!=a?n():o(t(")"),x,v(")"),u)}function A(a,b,c){if(Ta.state.fatArrowAt==Ta.stream.start){var d=c?H:G;if("("==a)return o(r,t(")"),Q(oa,")"),u,v("=>"),d,s);if("variable"==a)return n(r,da,v("=>"),d,s)}var e=c?D:C;return Sa.hasOwnProperty(a)?o(e):"function"==a?o(na,e):"class"==a||Ma&&"interface"==b?(Ta.marked="keyword",o(t("form"),pa,u)):"keyword c"==a||"async"==a?o(c?y:x):"("==a?o(t(")"),B,v(")"),u,e):"operator"==a||"spread"==a?o(c?y:x):"["==a?o(t("]"),Ba,u,e):"{"==a?R(N,"}",null,e):"quasi"==a?n(E,e):"new"==a?o(I(c)):"import"==a?o(x):o()}function B(a){return a.match(/[;\}\)\],]/)?n():n(x)}function C(a,b){return","==a?o(x):D(a,b,!1)}function D(a,b,c){var d=0==c?C:D,e=0==c?x:y;return"=>"==a?o(r,c?H:G,s):"operator"==a?/\+\+|--/.test(b)||Ma&&"!"==b?o(d):Ma&&"<"==b&&Ta.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?o(t(">"),Q(W,">"),u,d):"?"==b?o(x,v(":"),e):o(e):"quasi"==a?n(E,d):";"!=a?"("==a?R(y,")","call",d):"."==a?o(M,d):"["==a?o(t("]"),B,v("]"),u,d):Ma&&"as"==b?(Ta.marked="keyword",o(W,d)):"regexp"==a?(Ta.state.lastType=Ta.marked="operator",Ta.stream.backUp(Ta.stream.pos-Ta.stream.start-1),o(e)):void 0:void 0}function E(a,b){return"quasi"!=a?n():"${"!=b.slice(b.length-2)?o(E):o(x,F)}function F(a){if("}"==a)return Ta.marked="string-2",Ta.state.tokenize=i,o(E)}function G(a){return j(Ta.stream,Ta.state),n("{"==a?w:x)}function H(a){return j(Ta.stream,Ta.state),n("{"==a?w:y)}function I(a){return function(b){return"."==b?o(a?K:J):"variable"==b&&Ma?o(_,a?D:C):n(a?y:x)}}function J(a,b){if("target"==b)return Ta.marked="keyword",o(C)}function K(a,b){if("target"==b)return Ta.marked="keyword",o(D)}function L(a){return":"==a?o(u,w):n(C,v(";"),u)}function M(a){if("variable"==a)return Ta.marked="property",o()}function N(a,b){if("async"==a)return Ta.marked="property",o(N);if("variable"==a||"keyword"==Ta.style){if(Ta.marked="property","get"==b||"set"==b)return o(O);var c;return Ma&&Ta.state.fatArrowAt==Ta.stream.start&&(c=Ta.stream.match(/^\s*:\s*/,!1))&&(Ta.state.fatArrowAt=Ta.stream.pos+c[0].length),o(P)}return"number"==a||"string"==a?(Ta.marked=Ka?"property":Ta.style+" property",o(P)):"jsonld-keyword"==a?o(P):Ma&&q(b)?(Ta.marked="keyword",o(N)):"["==a?o(x,T,v("]"),P):"spread"==a?o(y,P):"*"==b?(Ta.marked="keyword",o(N)):":"==a?n(P):void 0}function O(a){return"variable"!=a?n(P):(Ta.marked="property",o(na))}function P(a){return":"==a?o(y):"("==a?n(na):void 0}function Q(a,b,c){function d(e,f){if(c?c.indexOf(e)>-1:","==e){var g=Ta.state.lexical;return"call"==g.info&&(g.pos=(g.pos||0)+1),o((function(c,d){return c==b||d==b?n():n(a)}),d)}return e==b||f==b?o():o(v(b))}return function(c,e){return c==b||e==b?o():n(a,d)}}function R(a,b,c){for(var d=3;d"),W):void 0}function X(a){if("=>"==a)return o(W)}function Y(a,b){return"variable"==a||"keyword"==Ta.style?(Ta.marked="property",o(Y)):"?"==b?o(Y):":"==a?o(W):"["==a?o(x,T,v("]"),Y):void 0}function Z(a,b){return"variable"==a&&Ta.stream.match(/^\s*[?:]/,!1)||"?"==b?o(Z):":"==a?o(W):n(W)}function $(a,b){return"<"==b?o(t(">"),Q(W,">"),u,$):"|"==b||"."==a||"&"==b?o(W):"["==a?o(v("]"),$):"extends"==b||"implements"==b?(Ta.marked="keyword",o(W)):void 0}function _(a,b){if("<"==b)return o(t(">"),Q(W,">"),u,$)}function aa(){return n(W,ba)}function ba(a,b){if("="==b)return o(W)}function ca(a,b){return"enum"==b?(Ta.marked="keyword",o(Ca)):n(da,T,fa,ga)}function da(a,b){return Ma&&q(b)?(Ta.marked="keyword",o(da)):"variable"==a?(p(b),o()):"spread"==a?o(da):"["==a?R(da,"]"):"{"==a?R(ea,"}"):void 0}function ea(a,b){return"variable"!=a||Ta.stream.match(/^\s*:/,!1)?("variable"==a&&(Ta.marked="property"),"spread"==a?o(da):"}"==a?n():o(v(":"),da,fa)):(p(b),o(fa))}function fa(a,b){if("="==b)return o(y)}function ga(a){if(","==a)return o(ca)}function ha(a,b){if("keyword b"==a&&"else"==b)return o(t("form","else"),w,u)}function ia(a,b){return"await"==b?o(ia):"("==a?o(t(")"),ja,v(")"),u):void 0}function ja(a){return"var"==a?o(ca,v(";"),la):";"==a?o(la):"variable"==a?o(ka):n(x,v(";"),la)}function ka(a,b){return"in"==b||"of"==b?(Ta.marked="keyword",o(x)):o(C,la)}function la(a,b){return";"==a?o(ma):"in"==b||"of"==b?(Ta.marked="keyword",o(x)):n(x,v(";"),ma)}function ma(a){")"!=a&&o(x)}function na(a,b){return"*"==b?(Ta.marked="keyword",o(na)):"variable"==a?(p(b),o(na)):"("==a?o(r,t(")"),Q(oa,")"),u,U,w,s):Ma&&"<"==b?o(t(">"),Q(aa,">"),u,na):void 0}function oa(a,b){return"@"==b&&o(x,oa),"spread"==a?o(oa):Ma&&q(b)?(Ta.marked="keyword",o(oa)):n(da,T,fa)}function pa(a,b){return"variable"==a?qa(a,b):ra(a,b)}function qa(a,b){if("variable"==a)return p(b),o(ra)}function ra(a,b){return"<"==b?o(t(">"),Q(aa,">"),u,ra):"extends"==b||"implements"==b||Ma&&","==a?("implements"==b&&(Ta.marked="keyword"),o(Ma?W:x,ra)):"{"==a?o(t("}"),sa,u):void 0}function sa(a,b){return"async"==a||"variable"==a&&("static"==b||"get"==b||"set"==b||Ma&&q(b))&&Ta.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Ta.marked="keyword",o(sa)):"variable"==a||"keyword"==Ta.style?(Ta.marked="property",o(Ma?ta:na,sa)):"["==a?o(x,T,v("]"),Ma?ta:na,sa):"*"==b?(Ta.marked="keyword",o(sa)):";"==a?o(sa):"}"==a?o():"@"==b?o(x,sa):void 0}function ta(a,b){return"?"==b?o(ta):":"==a?o(W,fa):"="==b?o(y):n(na)}function ua(a,b){return"*"==b?(Ta.marked="keyword",o(Aa,v(";"))):"default"==b?(Ta.marked="keyword",o(x,v(";"))):"{"==a?o(Q(va,"}"),Aa,v(";")):n(w)}function va(a,b){return"as"==b?(Ta.marked="keyword",o(v("variable"))):"variable"==a?n(y,va):void 0}function wa(a){return"string"==a?o():"("==a?n(x):n(xa,ya,Aa)}function xa(a,b){return"{"==a?R(xa,"}"):("variable"==a&&p(b),"*"==b&&(Ta.marked="keyword"),o(za))}function ya(a){if(","==a)return o(xa,ya)}function za(a,b){if("as"==b)return Ta.marked="keyword",o(xa)}function Aa(a,b){if("from"==b)return Ta.marked="keyword",o(x)}function Ba(a){return"]"==a?o():n(Q(y,"]"))}function Ca(){return n(t("form"),da,v("{"),t("}"),Q(Da,"}"),u,u)}function Da(){return n(da,fa)}function Ea(a,b){return"operator"==a.lastType||","==a.lastType||Pa.test(b.charAt(0))||/[,.]/.test(b.charAt(0))}function Fa(a,b,c){return b.tokenize==f&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(b.lastType)||"quasi"==b.lastType&&/\{\s*$/.test(a.string.slice(0,a.pos-(c||0)))}var Ga,Ha,Ia=b.indentUnit,Ja=c.statementIndent,Ka=c.jsonld,La=c.json||Ka,Ma=c.typescript,Na=c.wordCharacters||/[\w$\xa1-\uffff]/,Oa=(function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("keyword d"),f=a("operator"),g={type:"atom",style:"atom"};return{if:a("if"),while:b,with:b,else:c,do:c,try:c,finally:c,return:e,break:e,continue:e,new:a("new"),delete:d,void:d,throw:d,debugger:a("debugger"),var:a("var"),const:a("var"),let:a("var"),function:a("function"),catch:a("catch"),for:a("for"),switch:a("switch"),case:a("case"),default:a("default"),in:f,typeof:f,instanceof:f,true:g,false:g,null:g,undefined:g,NaN:g,Infinity:g,this:a("this"),class:a("class"),super:a("atom"),yield:d,export:a("export"),import:a("import"),extends:d,await:d}})(),Pa=/[+\-*&%=<>!?|~^@]/,Qa=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ra="([{}])",Sa={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ta={state:null,column:null,marked:null,cc:null},Ua={name:"this",next:{name:"arguments"}};return u.lex=!0,{startState:function(a){var b={tokenize:f,lastType:"sof",cc:[],lexical:new k((a||0)-Ia,0,"block",!1),localVars:c.localVars,context:c.localVars&&{vars:c.localVars},indented:a||0};return c.globalVars&&"object"==typeof c.globalVars&&(b.globalVars=c.globalVars),b},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),j(a,b)),b.tokenize!=h&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==Ga?c:(b.lastType="operator"!=Ga||"++"!=Ha&&"--"!=Ha?Ga:"incdec",m(b,c,Ga,Ha,a))},indent:function(b,d){if(b.tokenize==h)return a.Pass;if(b.tokenize!=f)return 0;var e,g=d&&d.charAt(0),i=b.lexical;if(!/^\s*else\b/.test(d))for(var j=b.cc.length-1;j>=0;--j){var k=b.cc[j];if(k==u)i=i.prev;else if(k!=ha)break}for(;("stat"==i.type||"form"==i.type)&&("}"==g||(e=b.cc[b.cc.length-1])&&(e==C||e==D)&&!/^[,\.=+\-*:?[\(]/.test(d));)i=i.prev;Ja&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var l=i.type,m=g==l;return"vardef"==l?i.indented+("operator"==b.lastType||","==b.lastType?i.info+1:0):"form"==l&&"{"==g?i.indented:"form"==l?i.indented+Ia:"stat"==l?i.indented+(Ea(b,d)?Ja||Ia:0):"switch"!=i.info||m||0==c.doubleIndentSwitch?i.align?i.column+(m?0:1):i.indented+(m?0:Ia):i.indented+(/^(?:case|default)\b/.test(d)?Ia:2*Ia)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:La?null:"/*",blockCommentEnd:La?null:"*/",blockCommentContinue:La?null:" * ",lineComment:La?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:La?"json":"javascript",jsonldMode:Ka,jsonMode:La,expressionAllowed:Fa,skipExpression:function(a){var b=a.cc[a.cc.length-1];b!=x&&b!=y||a.cc.pop()}}})),a.registerHelper("wordChars","javascript",/[\w$]/),a.defineMIME("text/javascript","javascript"),a.defineMIME("text/ecmascript","javascript"),a.defineMIME("application/javascript","javascript"),a.defineMIME("application/x-javascript","javascript"),a.defineMIME("application/ecmascript","javascript"),a.defineMIME("application/json",{name:"javascript",json:!0}),a.defineMIME("application/x-json",{name:"javascript",json:!0}),a.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),a.defineMIME("text/typescript",{name:"javascript",typescript:!0}),a.defineMIME("application/typescript",{name:"javascript",typescript:!0})})); \ No newline at end of file diff --git a/media/editors/codemirror/mode/markdown/markdown.js b/media/editors/codemirror/mode/markdown/markdown.js index 24e24680262d7..72dfd5b8cd5c3 100644 --- a/media/editors/codemirror/mode/markdown/markdown.js +++ b/media/editors/codemirror/mode/markdown/markdown.js @@ -90,7 +90,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/ , textRE = /^[^#!\[\]*_\\<>` "'(~:]+/ , fencedCodeRE = /^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/ - , linkDefRE = /^\s*\[[^\]]+?\]:\s*\S+(\s*\S*\s*)?$/ // naive link-definition + , linkDefRE = /^\s*\[[^\]]+?\]:.*$/ // naive link-definition , punctuation = /[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/ , expandedTab = " " // CommonMark specifies tab as 4 spaces @@ -534,7 +534,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return type + tokenTypes.linkEmail; } - if (modeCfg.xml && ch === '<' && stream.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i, false)) { + if (modeCfg.xml && ch === '<' && stream.match(/^(!--|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*>)/i, false)) { var end = stream.string.indexOf(">", stream.pos); if (end != -1) { var atts = stream.string.substring(stream.start, end); diff --git a/media/editors/codemirror/mode/markdown/markdown.min.js b/media/editors/codemirror/mode/markdown/markdown.min.js index 13d049f43dd8e..de01baa48ddb7 100644 --- a/media/editors/codemirror/mode/markdown/markdown.min.js +++ b/media/editors/codemirror/mode/markdown/markdown.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],a):a(CodeMirror)})((function(a){"use strict";a.defineMode("markdown",(function(b,c){function d(c){if(a.findModeByName){var d=a.findModeByName(c);d&&(c=d.mime||d.mimes[0])}var e=a.getMode(b,c);return"null"==e.name?null:e}function e(a,b,c){return b.f=b.inline=c,c(a,b)}function f(a,b,c){return b.f=b.block=c,c(a,b)}function g(a){return!a||!/\S/.test(a.string)}function h(a){return a.linkTitle=!1,a.linkHref=!1,a.linkText=!1,a.em=!1,a.strong=!1,a.strikethrough=!1,a.quote=0,a.indentedCode=!1,a.f==j&&(a.f=n,a.block=i),a.trailingSpace=0,a.trailingSpaceNewLine=!1,a.prevLine=a.thisLine,a.thisLine={stream:null},null}function i(b,f){var h=b.column()===f.indentation,i=g(f.prevLine.stream),j=f.indentedCode,m=f.prevLine.hr,n=f.list!==!1,o=(f.listStack[f.listStack.length-1]||0)+3;f.indentedCode=!1;var p=f.indentation;if(null===f.indentationDiff&&(f.indentationDiff=f.indentation,n)){for(f.em=!1,f.strong=!1,f.code=!1,f.strikethrough=!1,f.list=null;p=4&&(j||f.prevLine.fencedCodeEnd||f.prevLine.header||i))return b.skipToEnd(),f.indentedCode=!0,w.code;if(b.eatSpace())return null;if(h&&f.indentation<=o&&(t=b.match(B))&&t[1].length<=6)return f.quote=0,f.header=t[1].length,f.thisLine.header=!0,c.highlightFormatting&&(f.formatting="header"),f.f=f.inline,l(f);if(f.indentation<=o&&b.eat(">"))return f.quote=h?1:f.quote+1,c.highlightFormatting&&(f.formatting="quote"),b.eatSpace(),l(f);if(!s&&!f.setext&&h&&f.indentation<=o&&(t=b.match(z))){var u=t[1]?"ol":"ul";return f.indentation=p+b.current().length,f.list=!0,f.quote=0,f.listStack.push(f.indentation),c.taskLists&&b.match(A,!1)&&(f.taskList=!0),f.f=f.inline,c.highlightFormatting&&(f.formatting=["list","list-"+u]),l(f)}return h&&f.indentation<=o&&(t=b.match(E,!0))?(f.quote=0,f.fencedEndRE=new RegExp(t[1]+"+ *$"),f.localMode=c.fencedCodeBlockHighlighting&&d(t[2]),f.localMode&&(f.localState=a.startState(f.localMode)),f.f=f.block=k,c.highlightFormatting&&(f.formatting="code-block"),f.code=-1,l(f)):f.setext||!(q&&n||f.quote||f.list!==!1||f.code||s||F.test(b.string))&&(t=b.lookAhead(1))&&(t=t.match(C))?(f.setext?(f.header=f.setext,f.setext=0,b.skipToEnd(),c.highlightFormatting&&(f.formatting="header")):(f.header="="==t[0].charAt(0)?1:2,f.setext=f.header),f.thisLine.header=!0,f.f=f.inline,l(f)):s?(b.skipToEnd(),f.hr=!0,f.thisLine.hr=!0,w.hr):"["===b.peek()?e(b,f,r):e(b,f,f.inline)}function j(b,c){var d=u.token(b,c.htmlState);if(!v){var e=a.innerMode(u,c.htmlState);("xml"==e.mode.name&&null===e.state.tagStart&&!e.state.context&&e.state.tokenize.isInText||c.md_inside&&b.current().indexOf(">")>-1)&&(c.f=n,c.block=i,c.htmlState=null)}return d}function k(a,b){var d=b.listStack[b.listStack.length-1]||0,e=b.indentation=a.quote?b.push(w.formatting+"-"+a.formatting[d]+"-"+a.quote):b.push("error"))}if(a.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(a.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(a.linkHref?b.push(w.linkHref,"url"):(a.strong&&b.push(w.strong),a.em&&b.push(w.em),a.strikethrough&&b.push(w.strikethrough),a.emoji&&b.push(w.emoji),a.linkText&&b.push(w.linkText),a.code&&b.push(w.code),a.image&&b.push(w.image),a.imageAltText&&b.push(w.imageAltText,"link"),a.imageMarker&&b.push(w.imageMarker)),a.header&&b.push(w.header,w.header+"-"+a.header),a.quote&&(b.push(w.quote),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=a.quote?b.push(w.quote+"-"+a.quote):b.push(w.quote+"-"+c.maxBlockquoteDepth)),a.list!==!1){var e=(a.listStack.length-1)%3;e?1===e?b.push(w.list2):b.push(w.list3):b.push(w.list1)}return a.trailingSpaceNewLine?b.push("trailing-space-new-line"):a.trailingSpace&&b.push("trailing-space-"+(a.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function m(a,b){if(a.match(D,!0))return l(b)}function n(b,d){var e=d.text(b,d);if("undefined"!=typeof e)return e;if(d.list)return d.list=null,l(d);if(d.taskList){var g=" "===b.match(A,!0)[1];return g?d.taskOpen=!0:d.taskClosed=!0,c.highlightFormatting&&(d.formatting="task"),d.taskList=!1,l(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&b.match(/^#+$/,!0))return c.highlightFormatting&&(d.formatting="header"),l(d);var h=b.next();if(d.linkTitle){d.linkTitle=!1;var i=h;"("===h&&(i=")"),i=(i+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var k="^\\s*(?:[^"+i+"\\\\]+|\\\\\\\\|\\\\.)"+i;if(b.match(new RegExp(k),!0))return w.linkHref}if("`"===h){var m=d.formatting;c.highlightFormatting&&(d.formatting="code"),b.eatWhile("`");var q=b.current().length;if(0!=d.code||d.quote&&1!=q){if(q==d.code){var r=l(d);return d.code=0,r}return d.formatting=m,l(d)}return d.code=q,l(d)}if(d.code)return l(d);if("\\"===h&&(b.next(),c.highlightFormatting)){var s=l(d),t=w.formatting+"-escape";return s?s+" "+t:t}if("!"===h&&b.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,c.highlightFormatting&&(d.formatting="image"),l(d);if("["===h&&d.imageMarker&&b.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,c.highlightFormatting&&(d.formatting="image"),l(d);if("]"===h&&d.imageAltText){c.highlightFormatting&&(d.formatting="image");var s=l(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=p,s}if("["===h&&!d.image)return d.linkText=!0,c.highlightFormatting&&(d.formatting="link"),l(d);if("]"===h&&d.linkText){c.highlightFormatting&&(d.formatting="link");var s=l(d);return d.linkText=!1,d.inline=d.f=b.match(/\(.*?\)| ?\[.*?\]/,!1)?p:n,s}if("<"===h&&b.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link");var s=l(d);return s?s+=" ":s="",s+w.linkInline}if("<"===h&&b.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link");var s=l(d);return s?s+=" ":s="",s+w.linkEmail}if(c.xml&&"<"===h&&b.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i,!1)){var v=b.string.indexOf(">",b.pos);if(v!=-1){var x=b.string.substring(b.start,v);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(d.md_inside=!0)}return b.backUp(1),d.htmlState=a.startState(u),f(b,d,j)}if(c.xml&&"<"===h&&b.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if("*"===h||"_"===h){for(var y=1,z=1==b.pos?" ":b.string.charAt(b.pos-2);y<3&&b.eat(h);)y++;var B=b.peek()||" ",C=!/\s/.test(B)&&(!G.test(B)||/\s/.test(z)||G.test(z)),D=!/\s/.test(z)&&(!G.test(z)||/\s/.test(B)||G.test(B)),E=null,F=null;if(y%2&&(d.em||!C||"*"!==h&&D&&!G.test(z)?d.em!=h||!D||"*"!==h&&C&&!G.test(B)||(E=!1):E=!0),y>1&&(d.strong||!C||"*"!==h&&D&&!G.test(z)?d.strong!=h||!D||"*"!==h&&C&&!G.test(B)||(F=!1):F=!0),null!=F||null!=E){c.highlightFormatting&&(d.formatting=null==E?"strong":null==F?"em":"strong em"),E===!0&&(d.em=h),F===!0&&(d.strong=h);var r=l(d);return E===!1&&(d.em=!1),F===!1&&(d.strong=!1),r}}else if(" "===h&&(b.eat("*")||b.eat("_"))){if(" "===b.peek())return l(d);b.backUp(1)}if(c.strikethrough)if("~"===h&&b.eatWhile(h)){if(d.strikethrough){c.highlightFormatting&&(d.formatting="strikethrough");var r=l(d);return d.strikethrough=!1,r}if(b.match(/^[^\s]/,!1))return d.strikethrough=!0,c.highlightFormatting&&(d.formatting="strikethrough"),l(d)}else if(" "===h&&b.match(/^~~/,!0)){if(" "===b.peek())return l(d);b.backUp(2)}if(c.emoji&&":"===h&&b.match(/^[a-z_\d+-]+:/)){d.emoji=!0,c.highlightFormatting&&(d.formatting="emoji");var H=l(d);return d.emoji=!1,H}return" "===h&&(b.match(/ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),l(d)}function o(a,b){var d=a.next();if(">"===d){b.f=b.inline=n,c.highlightFormatting&&(b.formatting="link");var e=l(b);return e?e+=" ":e="",e+w.linkInline}return a.match(/^[^>]+/,!0),w.linkInline}function p(a,b){if(a.eatSpace())return null;var d=a.next();return"("===d||"["===d?(b.f=b.inline=q("("===d?")":"]"),c.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,l(b)):"error"}function q(a){return function(b,d){var e=b.next();if(e===a){d.f=d.inline=n,c.highlightFormatting&&(d.formatting="link-string");var f=l(d);return d.linkHref=!1,f}return b.match(I[a]),d.linkHref=!0,l(d)}}function r(a,b){return a.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=s,a.next(),c.highlightFormatting&&(b.formatting="link"),b.linkText=!0,l(b)):e(a,b,n)}function s(a,b){if(a.match(/^\]:/,!0)){b.f=b.inline=t,c.highlightFormatting&&(b.formatting="link");var d=l(b);return b.linkText=!1,d}return a.match(/^([^\]\\]|\\.)+/,!0),w.linkText}function t(a,b){return a.eatSpace()?null:(a.match(/^[^\s]+/,!0),void 0===a.peek()?b.linkTitle=!0:a.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=n,w.linkHref+" url")}var u=a.getMode(b,"text/html"),v="null"==u.name;void 0===c.highlightFormatting&&(c.highlightFormatting=!1),void 0===c.maxBlockquoteDepth&&(c.maxBlockquoteDepth=0),void 0===c.taskLists&&(c.taskLists=!1),void 0===c.strikethrough&&(c.strikethrough=!1),void 0===c.emoji&&(c.emoji=!1),void 0===c.fencedCodeBlockHighlighting&&(c.fencedCodeBlockHighlighting=!0),void 0===c.xml&&(c.xml=!0),void 0===c.tokenTypeOverrides&&(c.tokenTypeOverrides={});var w={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var x in w)w.hasOwnProperty(x)&&c.tokenTypeOverrides[x]&&(w[x]=c.tokenTypeOverrides[x]);var y=/^([*\-_])(?:\s*\1){2,}\s*$/,z=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,A=/^\[(x| )\](?=\s)/i,B=c.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,C=/^ *(?:\={1,}|-{1,})\s*$/,D=/^[^#!\[\]*_\\<>` "'(~:]+/,E=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,F=/^\s*\[[^\]]+?\]:\s*\S+(\s*\S*\s*)?$/,G=/[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/,H=" ",I={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/},J={startState:function(){return{f:i,prevLine:{stream:null},thisLine:{stream:null},block:i,htmlState:null,indentation:0,inline:n,text:m,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(b){return{f:b.f,prevLine:b.prevLine,thisLine:b.thisLine,block:b.block,htmlState:b.htmlState&&a.copyState(u,b.htmlState),indentation:b.indentation,localMode:b.localMode,localState:b.localMode?a.copyState(b.localMode,b.localState):null,inline:b.inline,text:b.text,formatting:!1,linkText:b.linkText,linkTitle:b.linkTitle,linkHref:b.linkHref,code:b.code,em:b.em,strong:b.strong,strikethrough:b.strikethrough,emoji:b.emoji,header:b.header,setext:b.setext,hr:b.hr,taskList:b.taskList,list:b.list,listStack:b.listStack.slice(0),quote:b.quote,indentedCode:b.indentedCode,trailingSpace:b.trailingSpace,trailingSpaceNewLine:b.trailingSpaceNewLine,md_inside:b.md_inside,fencedEndRE:b.fencedEndRE}},token:function(a,b){if(b.formatting=!1,a!=b.thisLine.stream){if(b.header=0,b.hr=!1,a.match(/^\s*$/,!0))return h(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:a},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=j)){var c=a.match(/^\s*/,!0)[0].replace(/\t/g,H).length;if(b.indentation=c,b.indentationDiff=null,c>0)return null}}return b.f(a,b)},innerMode:function(a){return a.block==j?{state:a.htmlState,mode:u}:a.localState?{state:a.localState,mode:a.localMode}:{state:a,mode:J}},indent:function(b,c,d){return b.block==j&&u.indent?u.indent(b.htmlState,c,d):b.localState&&b.localMode.indent?b.localMode.indent(b.localState,c,d):a.Pass},blankLine:h,getType:l,closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return J}),"xml"),a.defineMIME("text/markdown","markdown"),a.defineMIME("text/x-markdown","markdown")})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],a):a(CodeMirror)})((function(a){"use strict";a.defineMode("markdown",(function(b,c){function d(c){if(a.findModeByName){var d=a.findModeByName(c);d&&(c=d.mime||d.mimes[0])}var e=a.getMode(b,c);return"null"==e.name?null:e}function e(a,b,c){return b.f=b.inline=c,c(a,b)}function f(a,b,c){return b.f=b.block=c,c(a,b)}function g(a){return!a||!/\S/.test(a.string)}function h(a){return a.linkTitle=!1,a.linkHref=!1,a.linkText=!1,a.em=!1,a.strong=!1,a.strikethrough=!1,a.quote=0,a.indentedCode=!1,a.f==j&&(a.f=n,a.block=i),a.trailingSpace=0,a.trailingSpaceNewLine=!1,a.prevLine=a.thisLine,a.thisLine={stream:null},null}function i(b,f){var h=b.column()===f.indentation,i=g(f.prevLine.stream),j=f.indentedCode,m=f.prevLine.hr,n=f.list!==!1,o=(f.listStack[f.listStack.length-1]||0)+3;f.indentedCode=!1;var p=f.indentation;if(null===f.indentationDiff&&(f.indentationDiff=f.indentation,n)){for(f.em=!1,f.strong=!1,f.code=!1,f.strikethrough=!1,f.list=null;p=4&&(j||f.prevLine.fencedCodeEnd||f.prevLine.header||i))return b.skipToEnd(),f.indentedCode=!0,w.code;if(b.eatSpace())return null;if(h&&f.indentation<=o&&(t=b.match(B))&&t[1].length<=6)return f.quote=0,f.header=t[1].length,f.thisLine.header=!0,c.highlightFormatting&&(f.formatting="header"),f.f=f.inline,l(f);if(f.indentation<=o&&b.eat(">"))return f.quote=h?1:f.quote+1,c.highlightFormatting&&(f.formatting="quote"),b.eatSpace(),l(f);if(!s&&!f.setext&&h&&f.indentation<=o&&(t=b.match(z))){var u=t[1]?"ol":"ul";return f.indentation=p+b.current().length,f.list=!0,f.quote=0,f.listStack.push(f.indentation),c.taskLists&&b.match(A,!1)&&(f.taskList=!0),f.f=f.inline,c.highlightFormatting&&(f.formatting=["list","list-"+u]),l(f)}return h&&f.indentation<=o&&(t=b.match(E,!0))?(f.quote=0,f.fencedEndRE=new RegExp(t[1]+"+ *$"),f.localMode=c.fencedCodeBlockHighlighting&&d(t[2]),f.localMode&&(f.localState=a.startState(f.localMode)),f.f=f.block=k,c.highlightFormatting&&(f.formatting="code-block"),f.code=-1,l(f)):f.setext||!(q&&n||f.quote||f.list!==!1||f.code||s||F.test(b.string))&&(t=b.lookAhead(1))&&(t=t.match(C))?(f.setext?(f.header=f.setext,f.setext=0,b.skipToEnd(),c.highlightFormatting&&(f.formatting="header")):(f.header="="==t[0].charAt(0)?1:2,f.setext=f.header),f.thisLine.header=!0,f.f=f.inline,l(f)):s?(b.skipToEnd(),f.hr=!0,f.thisLine.hr=!0,w.hr):"["===b.peek()?e(b,f,r):e(b,f,f.inline)}function j(b,c){var d=u.token(b,c.htmlState);if(!v){var e=a.innerMode(u,c.htmlState);("xml"==e.mode.name&&null===e.state.tagStart&&!e.state.context&&e.state.tokenize.isInText||c.md_inside&&b.current().indexOf(">")>-1)&&(c.f=n,c.block=i,c.htmlState=null)}return d}function k(a,b){var d=b.listStack[b.listStack.length-1]||0,e=b.indentation=a.quote?b.push(w.formatting+"-"+a.formatting[d]+"-"+a.quote):b.push("error"))}if(a.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(a.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(a.linkHref?b.push(w.linkHref,"url"):(a.strong&&b.push(w.strong),a.em&&b.push(w.em),a.strikethrough&&b.push(w.strikethrough),a.emoji&&b.push(w.emoji),a.linkText&&b.push(w.linkText),a.code&&b.push(w.code),a.image&&b.push(w.image),a.imageAltText&&b.push(w.imageAltText,"link"),a.imageMarker&&b.push(w.imageMarker)),a.header&&b.push(w.header,w.header+"-"+a.header),a.quote&&(b.push(w.quote),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=a.quote?b.push(w.quote+"-"+a.quote):b.push(w.quote+"-"+c.maxBlockquoteDepth)),a.list!==!1){var e=(a.listStack.length-1)%3;e?1===e?b.push(w.list2):b.push(w.list3):b.push(w.list1)}return a.trailingSpaceNewLine?b.push("trailing-space-new-line"):a.trailingSpace&&b.push("trailing-space-"+(a.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function m(a,b){if(a.match(D,!0))return l(b)}function n(b,d){var e=d.text(b,d);if("undefined"!=typeof e)return e;if(d.list)return d.list=null,l(d);if(d.taskList){var g=" "===b.match(A,!0)[1];return g?d.taskOpen=!0:d.taskClosed=!0,c.highlightFormatting&&(d.formatting="task"),d.taskList=!1,l(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&b.match(/^#+$/,!0))return c.highlightFormatting&&(d.formatting="header"),l(d);var h=b.next();if(d.linkTitle){d.linkTitle=!1;var i=h;"("===h&&(i=")"),i=(i+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var k="^\\s*(?:[^"+i+"\\\\]+|\\\\\\\\|\\\\.)"+i;if(b.match(new RegExp(k),!0))return w.linkHref}if("`"===h){var m=d.formatting;c.highlightFormatting&&(d.formatting="code"),b.eatWhile("`");var q=b.current().length;if(0!=d.code||d.quote&&1!=q){if(q==d.code){var r=l(d);return d.code=0,r}return d.formatting=m,l(d)}return d.code=q,l(d)}if(d.code)return l(d);if("\\"===h&&(b.next(),c.highlightFormatting)){var s=l(d),t=w.formatting+"-escape";return s?s+" "+t:t}if("!"===h&&b.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,c.highlightFormatting&&(d.formatting="image"),l(d);if("["===h&&d.imageMarker&&b.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,c.highlightFormatting&&(d.formatting="image"),l(d);if("]"===h&&d.imageAltText){c.highlightFormatting&&(d.formatting="image");var s=l(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=p,s}if("["===h&&!d.image)return d.linkText=!0,c.highlightFormatting&&(d.formatting="link"),l(d);if("]"===h&&d.linkText){c.highlightFormatting&&(d.formatting="link");var s=l(d);return d.linkText=!1,d.inline=d.f=b.match(/\(.*?\)| ?\[.*?\]/,!1)?p:n,s}if("<"===h&&b.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link");var s=l(d);return s?s+=" ":s="",s+w.linkInline}if("<"===h&&b.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link");var s=l(d);return s?s+=" ":s="",s+w.linkEmail}if(c.xml&&"<"===h&&b.match(/^(!--|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*>)/i,!1)){var v=b.string.indexOf(">",b.pos);if(v!=-1){var x=b.string.substring(b.start,v);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(x)&&(d.md_inside=!0)}return b.backUp(1),d.htmlState=a.startState(u),f(b,d,j)}if(c.xml&&"<"===h&&b.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if("*"===h||"_"===h){for(var y=1,z=1==b.pos?" ":b.string.charAt(b.pos-2);y<3&&b.eat(h);)y++;var B=b.peek()||" ",C=!/\s/.test(B)&&(!G.test(B)||/\s/.test(z)||G.test(z)),D=!/\s/.test(z)&&(!G.test(z)||/\s/.test(B)||G.test(B)),E=null,F=null;if(y%2&&(d.em||!C||"*"!==h&&D&&!G.test(z)?d.em!=h||!D||"*"!==h&&C&&!G.test(B)||(E=!1):E=!0),y>1&&(d.strong||!C||"*"!==h&&D&&!G.test(z)?d.strong!=h||!D||"*"!==h&&C&&!G.test(B)||(F=!1):F=!0),null!=F||null!=E){c.highlightFormatting&&(d.formatting=null==E?"strong":null==F?"em":"strong em"),E===!0&&(d.em=h),F===!0&&(d.strong=h);var r=l(d);return E===!1&&(d.em=!1),F===!1&&(d.strong=!1),r}}else if(" "===h&&(b.eat("*")||b.eat("_"))){if(" "===b.peek())return l(d);b.backUp(1)}if(c.strikethrough)if("~"===h&&b.eatWhile(h)){if(d.strikethrough){c.highlightFormatting&&(d.formatting="strikethrough");var r=l(d);return d.strikethrough=!1,r}if(b.match(/^[^\s]/,!1))return d.strikethrough=!0,c.highlightFormatting&&(d.formatting="strikethrough"),l(d)}else if(" "===h&&b.match(/^~~/,!0)){if(" "===b.peek())return l(d);b.backUp(2)}if(c.emoji&&":"===h&&b.match(/^[a-z_\d+-]+:/)){d.emoji=!0,c.highlightFormatting&&(d.formatting="emoji");var H=l(d);return d.emoji=!1,H}return" "===h&&(b.match(/ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),l(d)}function o(a,b){var d=a.next();if(">"===d){b.f=b.inline=n,c.highlightFormatting&&(b.formatting="link");var e=l(b);return e?e+=" ":e="",e+w.linkInline}return a.match(/^[^>]+/,!0),w.linkInline}function p(a,b){if(a.eatSpace())return null;var d=a.next();return"("===d||"["===d?(b.f=b.inline=q("("===d?")":"]"),c.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,l(b)):"error"}function q(a){return function(b,d){var e=b.next();if(e===a){d.f=d.inline=n,c.highlightFormatting&&(d.formatting="link-string");var f=l(d);return d.linkHref=!1,f}return b.match(I[a]),d.linkHref=!0,l(d)}}function r(a,b){return a.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=s,a.next(),c.highlightFormatting&&(b.formatting="link"),b.linkText=!0,l(b)):e(a,b,n)}function s(a,b){if(a.match(/^\]:/,!0)){b.f=b.inline=t,c.highlightFormatting&&(b.formatting="link");var d=l(b);return b.linkText=!1,d}return a.match(/^([^\]\\]|\\.)+/,!0),w.linkText}function t(a,b){return a.eatSpace()?null:(a.match(/^[^\s]+/,!0),void 0===a.peek()?b.linkTitle=!0:a.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=n,w.linkHref+" url")}var u=a.getMode(b,"text/html"),v="null"==u.name;void 0===c.highlightFormatting&&(c.highlightFormatting=!1),void 0===c.maxBlockquoteDepth&&(c.maxBlockquoteDepth=0),void 0===c.taskLists&&(c.taskLists=!1),void 0===c.strikethrough&&(c.strikethrough=!1),void 0===c.emoji&&(c.emoji=!1),void 0===c.fencedCodeBlockHighlighting&&(c.fencedCodeBlockHighlighting=!0),void 0===c.xml&&(c.xml=!0),void 0===c.tokenTypeOverrides&&(c.tokenTypeOverrides={});var w={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var x in w)w.hasOwnProperty(x)&&c.tokenTypeOverrides[x]&&(w[x]=c.tokenTypeOverrides[x]);var y=/^([*\-_])(?:\s*\1){2,}\s*$/,z=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,A=/^\[(x| )\](?=\s)/i,B=c.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,C=/^ *(?:\={1,}|-{1,})\s*$/,D=/^[^#!\[\]*_\\<>` "'(~:]+/,E=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,F=/^\s*\[[^\]]+?\]:.*$/,G=/[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/,H=" ",I={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/},J={startState:function(){return{f:i,prevLine:{stream:null},thisLine:{stream:null},block:i,htmlState:null,indentation:0,inline:n,text:m,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(b){return{f:b.f,prevLine:b.prevLine,thisLine:b.thisLine,block:b.block,htmlState:b.htmlState&&a.copyState(u,b.htmlState),indentation:b.indentation,localMode:b.localMode,localState:b.localMode?a.copyState(b.localMode,b.localState):null,inline:b.inline,text:b.text,formatting:!1,linkText:b.linkText,linkTitle:b.linkTitle,linkHref:b.linkHref,code:b.code,em:b.em,strong:b.strong,strikethrough:b.strikethrough,emoji:b.emoji,header:b.header,setext:b.setext,hr:b.hr,taskList:b.taskList,list:b.list,listStack:b.listStack.slice(0),quote:b.quote,indentedCode:b.indentedCode,trailingSpace:b.trailingSpace,trailingSpaceNewLine:b.trailingSpaceNewLine,md_inside:b.md_inside,fencedEndRE:b.fencedEndRE}},token:function(a,b){if(b.formatting=!1,a!=b.thisLine.stream){if(b.header=0,b.hr=!1,a.match(/^\s*$/,!0))return h(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:a},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=j)){var c=a.match(/^\s*/,!0)[0].replace(/\t/g,H).length;if(b.indentation=c,b.indentationDiff=null,c>0)return null}}return b.f(a,b)},innerMode:function(a){return a.block==j?{state:a.htmlState,mode:u}:a.localState?{state:a.localState,mode:a.localMode}:{state:a,mode:J}},indent:function(b,c,d){return b.block==j&&u.indent?u.indent(b.htmlState,c,d):b.localState&&b.localMode.indent?b.localMode.indent(b.localState,c,d):a.Pass},blankLine:h,getType:l,closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return J}),"xml"),a.defineMIME("text/markdown","markdown"),a.defineMIME("text/x-markdown","markdown")})); \ No newline at end of file diff --git a/media/editors/codemirror/mode/python/python.js b/media/editors/codemirror/mode/python/python.js index 4de1e75d5402c..a13a8509213ea 100644 --- a/media/editors/codemirror/mode/python/python.js +++ b/media/editors/codemirror/mode/python/python.js @@ -62,7 +62,7 @@ var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/; myKeywords = myKeywords.concat(["nonlocal", "False", "True", "None", "async", "await"]); myBuiltins = myBuiltins.concat(["ascii", "bytes", "exec", "print"]); - var stringPrefixes = new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))", "i"); + var stringPrefixes = new RegExp("^(([rbuf]|(br)|(fr))?('{3}|\"{3}|['\"]))", "i"); } else { var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/; myKeywords = myKeywords.concat(["exec", "print"]); @@ -142,8 +142,14 @@ // Handle Strings if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); + var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1; + if (!isFmtString) { + state.tokenize = tokenStringFactory(stream.current()); + return state.tokenize(stream, state); + } else { + state.tokenize = formatStringFactory(stream.current(), state.tokenize); + return state.tokenize(stream, state); + } } for (var i = 0; i < operators.length; i++) @@ -174,6 +180,77 @@ return ERRORCLASS; } + function formatStringFactory(delimiter, tokenOuter) { + while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) + delimiter = delimiter.substr(1); + + var singleline = delimiter.length == 1; + var OUTCLASS = "string"; + + function tokenFString(stream, state) { + // inside f-str Expression + if (stream.match(delimiter)) { + // expression ends pre-maturally, but very common in editing + // Could show error to remind users to close brace here + state.tokenize = tokenString + return OUTCLASS; + } else if (stream.match('{')) { + // starting brace, if not eaten below + return "punctuation"; + } else if (stream.match('}')) { + // return to regular inside string state + state.tokenize = tokenString + return "punctuation"; + } else { + // use tokenBaseInner to parse the expression + return tokenBaseInner(stream, state); + } + } + + function tokenString(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"\{\}\\]/); + if (stream.eat("\\")) { + stream.next(); + if (singleline && stream.eol()) + return OUTCLASS; + } else if (stream.match(delimiter)) { + state.tokenize = tokenOuter; + return OUTCLASS; + } else if (stream.match('{{')) { + // ignore {{ in f-str + return OUTCLASS; + } else if (stream.match('{', false)) { + // switch to nested mode + state.tokenize = tokenFString + if (stream.current()) { + return OUTCLASS; + } else { + // need to return something, so eat the starting { + stream.next(); + return "punctuation"; + } + } else if (stream.match('}}')) { + return OUTCLASS; + } else if (stream.match('}')) { + // single } in f-string is an error + return ERRORCLASS; + } else { + stream.eat(/['"]/); + } + } + if (singleline) { + if (parserConf.singleLineStringErrors) + return ERRORCLASS; + else + state.tokenize = tokenOuter; + } + return OUTCLASS; + } + tokenString.isString = true; + return tokenString; + } + function tokenStringFactory(delimiter) { while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) delimiter = delimiter.substr(1); @@ -254,14 +331,16 @@ if (current == ":" && !state.lambda && top(state).type == "py") pushPyScope(state); - var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1; - if (delimiter_index != -1) - pushBracketScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); + if (current.length == 1 && !/string|comment/.test(style)) { + var delimiter_index = "[({".indexOf(current); + if (delimiter_index != -1) + pushBracketScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); - delimiter_index = "])}".indexOf(current); - if (delimiter_index != -1) { - if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent - else return ERRORCLASS; + delimiter_index = "])}".indexOf(current); + if (delimiter_index != -1) { + if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent + else return ERRORCLASS; + } } if (state.dedent > 0 && stream.eol() && top(state).type == "py") { if (state.scopes.length > 1) state.scopes.pop(); diff --git a/media/editors/codemirror/mode/python/python.min.js b/media/editors/codemirror/mode/python/python.min.js index b2a9cf6054975..75c93c0669c2f 100644 --- a/media/editors/codemirror/mode/python/python.min.js +++ b/media/editors/codemirror/mode/python/python.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";function b(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function c(a){return a.scopes[a.scopes.length-1]}var d=b(["and","or","not","is"]),e=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],f=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];a.registerHelper("hintWords","python",e.concat(f)),a.defineMode("python",(function(g,h){function i(a,b){var d=a.sol()&&"\\"!=b.lastToken;if(d&&(b.indent=a.indentation()),d&&"py"==c(b).type){var e=c(b).offset;if(a.eatSpace()){var f=a.indentation();return f>e?l(b):f0&&n(a,b)&&(g+=" "+p),g}return j(a,b)}function j(a,b){if(a.eatSpace())return null;if(a.match(/^#.*/))return"comment";if(a.match(/^[0-9\.]/,!1)){var c=!1;if(a.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(c=!0),a.match(/^[\d_]+\.\d*/)&&(c=!0),a.match(/^\.\d+/)&&(c=!0),c)return a.eat(/J/i),"number";var e=!1;if(a.match(/^0x[0-9a-f_]+/i)&&(e=!0),a.match(/^0b[01_]+/i)&&(e=!0),a.match(/^0o[0-7_]+/i)&&(e=!0),a.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(a.eat(/J/i),e=!0),a.match(/^0(?![\dx])/i)&&(e=!0),e)return a.eat(/L/i),"number"}if(a.match(y))return b.tokenize=k(a.current()),b.tokenize(a,b);for(var f=0;f=0;)a=a.substr(1);var c=1==a.length,d="string";return b.isString=!0,b}function l(a){for(;"py"!=c(a).type;)a.scopes.pop();a.scopes.push({offset:c(a).offset+g.indentUnit,type:"py",align:null})}function m(a,b,c){var d=a.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:a.column()+1;b.scopes.push({offset:b.indent+t,type:c,align:d})}function n(a,b){for(var d=a.indentation();b.scopes.length>1&&c(b).offset>d;){if("py"!=c(b).type)return!0;b.scopes.pop()}return c(b).offset!=d}function o(a,b){a.sol()&&(b.beginningOfLine=!0);var d=b.tokenize(a,b),e=a.current();if(b.beginningOfLine&&"@"==e)return a.match(x,!1)?"meta":w?"operator":p;/\S/.test(e)&&(b.beginningOfLine=!1),"variable"!=d&&"builtin"!=d||"meta"!=b.lastToken||(d="meta"),"pass"!=e&&"return"!=e||(b.dedent+=1),"lambda"==e&&(b.lambda=!0),":"!=e||b.lambda||"py"!=c(b).type||l(b);var f=1==e.length?"[({".indexOf(e):-1;if(f!=-1&&m(a,b,"])}".slice(f,f+1)),f="])}".indexOf(e),f!=-1){if(c(b).type!=e)return p;b.indent=b.scopes.pop().offset-t}return b.dedent>0&&a.eol()&&"py"==c(b).type&&(b.scopes.length>1&&b.scopes.pop(),b.dedent-=1),d}for(var p="error",q=h.delimiters||h.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,r=[h.singleOperators,h.doubleOperators,h.doubleDelimiters,h.tripleDelimiters,h.operators||/^([-+*\/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/],s=0;se?m(b):f0&&o(a,b)&&(g+=" "+q),g}return j(a,b)}function j(a,b){if(a.eatSpace())return null;if(a.match(/^#.*/))return"comment";if(a.match(/^[0-9\.]/,!1)){var c=!1;if(a.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(c=!0),a.match(/^[\d_]+\.\d*/)&&(c=!0),a.match(/^\.\d+/)&&(c=!0),c)return a.eat(/J/i),"number";var e=!1;if(a.match(/^0x[0-9a-f_]+/i)&&(e=!0),a.match(/^0b[01_]+/i)&&(e=!0),a.match(/^0o[0-7_]+/i)&&(e=!0),a.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(a.eat(/J/i),e=!0),a.match(/^0(?![\dx])/i)&&(e=!0),e)return a.eat(/L/i),"number"}if(a.match(z)){var f=a.current().toLowerCase().indexOf("f")!==-1;return f?(b.tokenize=k(a.current(),b.tokenize),b.tokenize(a,b)):(b.tokenize=l(a.current()),b.tokenize(a,b))}for(var g=0;g=0;)a=a.substr(1);var e=1==a.length,f="string";return d.isString=!0,d}function l(a){function b(b,e){for(;!b.eol();)if(b.eatWhile(/[^'"\\]/),b.eat("\\")){if(b.next(),c&&b.eol())return d}else{if(b.match(a))return e.tokenize=i,d;b.eat(/['"]/)}if(c){if(h.singleLineStringErrors)return q;e.tokenize=i}return d}for(;"rubf".indexOf(a.charAt(0).toLowerCase())>=0;)a=a.substr(1);var c=1==a.length,d="string";return b.isString=!0,b}function m(a){for(;"py"!=c(a).type;)a.scopes.pop();a.scopes.push({offset:c(a).offset+g.indentUnit,type:"py",align:null})}function n(a,b,c){var d=a.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:a.column()+1;b.scopes.push({offset:b.indent+u,type:c,align:d})}function o(a,b){for(var d=a.indentation();b.scopes.length>1&&c(b).offset>d;){if("py"!=c(b).type)return!0;b.scopes.pop()}return c(b).offset!=d}function p(a,b){a.sol()&&(b.beginningOfLine=!0);var d=b.tokenize(a,b),e=a.current();if(b.beginningOfLine&&"@"==e)return a.match(y,!1)?"meta":x?"operator":q;if(/\S/.test(e)&&(b.beginningOfLine=!1),"variable"!=d&&"builtin"!=d||"meta"!=b.lastToken||(d="meta"),"pass"!=e&&"return"!=e||(b.dedent+=1),"lambda"==e&&(b.lambda=!0),":"!=e||b.lambda||"py"!=c(b).type||m(b),1==e.length&&!/string|comment/.test(d)){var f="[({".indexOf(e);if(f!=-1&&n(a,b,"])}".slice(f,f+1)),f="])}".indexOf(e),f!=-1){if(c(b).type!=e)return q;b.indent=b.scopes.pop().offset-u}}return b.dedent>0&&a.eol()&&"py"==c(b).type&&(b.scopes.length>1&&b.scopes.pop(),b.dedent-=1),d}for(var q="error",r=h.delimiters||h.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,s=[h.singleOperators,h.doubleOperators,h.doubleDelimiters,h.tripleDelimiters,h.operators||/^([-+*\/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/],t=0;t!=]/, + atoms: set("is not null like and or in left right between inner outer join all any some cross unpivot pivot exists"), + operatorChars: /^[*+\-%<>!=^\&|\/]/, + brackets: /^[\{}\(\)]/, + punctuation: /^[;.,:/]/, backslashStringEscapes: false, dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"), hooks: { diff --git a/media/editors/codemirror/mode/sql/sql.min.js b/media/editors/codemirror/mode/sql/sql.min.js index 3887f2a8cf30d..f6d2c11eca4e5 100644 --- a/media/editors/codemirror/mode/sql/sql.min.js +++ b/media/editors/codemirror/mode/sql/sql.min.js @@ -1,2 +1,2 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";a.defineMode("sql",(function(b,c){function d(a,b){var c=a.next();if(o[c]){var d=o[c](a,b);if(d!==!1)return d}if(n.hexNumber&&("0"==c&&a.match(/^[xX][0-9a-fA-F]+/)||("x"==c||"X"==c)&&a.match(/^'[0-9a-fA-F]+'/)))return"number";if(n.binaryNumber&&(("b"==c||"B"==c)&&a.match(/^'[01]+'/)||"0"==c&&a.match(/^b[01]+/)))return"number";if(c.charCodeAt(0)>47&&c.charCodeAt(0)<58)return a.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),n.decimallessFloat&&a.match(/^\.(?!\.)/),"number";if("?"==c&&(a.eatSpace()||a.eol()||a.eat(";")))return"variable-3";if("'"==c||'"'==c&&n.doubleQuote)return b.tokenize=e(c),b.tokenize(a,b);if((n.nCharCast&&("n"==c||"N"==c)||n.charsetCast&&"_"==c&&a.match(/[a-z][a-z0-9]*/i))&&("'"==a.peek()||'"'==a.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(c))return null;if(n.commentSlashSlash&&"/"==c&&a.eat("/"))return a.skipToEnd(),"comment";if(n.commentHash&&"#"==c||"-"==c&&a.eat("-")&&(!n.commentSpaceRequired||a.eat(" ")))return a.skipToEnd(),"comment";if("/"==c&&a.eat("*"))return b.tokenize=f(1),b.tokenize(a,b);if("."!=c){if(m.test(c))return a.eatWhile(m),null;if("{"==c&&(a.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||a.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";a.eatWhile(/^[_\w\d]/);var g=a.current().toLowerCase();return p.hasOwnProperty(g)&&(a.match(/^( )+'[^']*'/)||a.match(/^( )+"[^"]*"/))?"number":j.hasOwnProperty(g)?"atom":k.hasOwnProperty(g)?"builtin":l.hasOwnProperty(g)?"keyword":i.hasOwnProperty(g)?"string-2":null}return n.zerolessFloat&&a.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":a.match(/^\.+/)?null:n.ODBCdotTable&&a.match(/^[\w\d_]+/)?"variable-2":void 0}function e(a){return function(b,c){for(var e,f=!1;null!=(e=b.next());){if(e==a&&!f){c.tokenize=d;break}f=q&&!f&&"\\"==e}return"string"}}function f(a){return function(b,c){var e=b.match(/^.*?(\/\*|\*\/)/);return e?"/*"==e[1]?c.tokenize=f(a+1):a>1?c.tokenize=f(a-1):c.tokenize=d:b.skipToEnd(),"comment"}}function g(a,b,c){b.context={prev:b.context,indent:a.indentation(),col:a.column(),type:c}}function h(a){a.indent=a.context.indent,a.context=a.context.prev}var i=c.client||{},j=c.atoms||{false:!0,true:!0,null:!0},k=c.builtin||{},l=c.keywords||{},m=c.operatorChars||/^[*+\-%<>!=&|~^]/,n=c.support||{},o=c.hooks||{},p=c.dateSQL||{date:!0,time:!0,timestamp:!0},q=c.backslashStringEscapes!==!1;return{startState:function(){return{tokenize:d,context:null}},token:function(a,b){if(a.sol()&&b.context&&null==b.context.align&&(b.context.align=!1),b.tokenize==d&&a.eatSpace())return null;var c=b.tokenize(a,b);if("comment"==c)return c;b.context&&null==b.context.align&&(b.context.align=!0);var e=a.current();return"("==e?g(a,b,")"):"["==e?g(a,b,"]"):b.context&&b.context.type==e&&h(b),c},indent:function(c,d){var e=c.context;if(!e)return a.Pass;var f=d.charAt(0)==e.type;return e.align?e.col+(f?0:1):e.indent+(f?0:b.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:n.commentSlashSlash?"//":n.commentHash?"#":"--"}})),(function(){function b(a){for(var b;null!=(b=a.next());)if("`"==b&&!a.eat("`"))return"variable-2";return a.backUp(a.current().length-1),a.eatWhile(/\w/)?"variable-2":null}function c(a){for(var b;null!=(b=a.next());)if('"'==b&&!a.eat('"'))return"variable-2";return a.backUp(a.current().length-1),a.eatWhile(/\w/)?"variable-2":null}function d(a){return a.eat("@")&&(a.match(/^session\./),a.match(/^local\./),a.match(/^global\./)),a.eat("'")?(a.match(/^.*'/),"variable-2"):a.eat('"')?(a.match(/^.*"/),"variable-2"):a.eat("`")?(a.match(/^.*`/),"variable-2"):a.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function e(a){return a.eat("N")?"atom":a.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function f(a){for(var b={},c=a.split(" "),d=0;d!=]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable doubleQuote binaryNumber hexNumber")}),a.defineMIME("text/x-mssql",{name:"sql",client:f("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:f(g+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec"),builtin:f("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,backslashStringEscapes:!1,dateSQL:f("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":d}}),a.defineMIME("text/x-mysql",{name:"sql",client:f("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:f(g+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:f("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":d,"`":b,"\\":e}}),a.defineMIME("text/x-mariadb",{name:"sql",client:f("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:f(g+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:f("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":d,"`":b,"\\":e}}),a.defineMIME("text/x-sqlite",{name:"sql",client:f("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:f(g+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:f("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:f("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|\/~]/,dateSQL:f("date time timestamp datetime"),support:f("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":d,":":d,"?":d,$:d,'"':c,"`":b}}),a.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:f("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:f("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:f("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:f("commentSlashSlash decimallessFloat"),hooks:{}}),a.defineMIME("text/x-plsql",{name:"sql",client:f("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:f("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:f("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:f("date time timestamp"),support:f("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),a.defineMIME("text/x-hive",{name:"sql",keywords:f("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:f("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:f("date timestamp"),support:f("ODBCdotTable doubleQuote binaryNumber hexNumber")}),a.defineMIME("text/x-pgsql",{name:"sql",client:f("source"),keywords:f(g+"a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lc_collate lc_ctype lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict restricted result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat attach path depends detach zone"),builtin:f("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),a.defineMIME("text/x-gql",{name:"sql",keywords:f("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:f("false true"),builtin:f("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),a.defineMIME("text/x-gpsql",{name:"sql",client:f("source"),keywords:f("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:f("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"), -atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),a.defineMIME("text/x-sparksql",{name:"sql",keywords:f("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:f("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),atoms:f("false true null"),operatorChars:/^[*+\-%<>!=~&|^]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable doubleQuote zerolessFloat")}),a.defineMIME("text/x-esper",{name:"sql",client:f("source"),keywords:f("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:f("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:f("time"),support:f("decimallessFloat zerolessFloat binaryNumber hexNumber")})})()})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";a.defineMode("sql",(function(b,c){function d(a,b){var c=a.next();if(o[c]){var d=o[c](a,b);if(d!==!1)return d}if(n.hexNumber&&("0"==c&&a.match(/^[xX][0-9a-fA-F]+/)||("x"==c||"X"==c)&&a.match(/^'[0-9a-fA-F]+'/)))return"number";if(n.binaryNumber&&(("b"==c||"B"==c)&&a.match(/^'[01]+'/)||"0"==c&&a.match(/^b[01]+/)))return"number";if(c.charCodeAt(0)>47&&c.charCodeAt(0)<58)return a.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),n.decimallessFloat&&a.match(/^\.(?!\.)/),"number";if("?"==c&&(a.eatSpace()||a.eol()||a.eat(";")))return"variable-3";if("'"==c||'"'==c&&n.doubleQuote)return b.tokenize=e(c),b.tokenize(a,b);if((n.nCharCast&&("n"==c||"N"==c)||n.charsetCast&&"_"==c&&a.match(/[a-z][a-z0-9]*/i))&&("'"==a.peek()||'"'==a.peek()))return"keyword";if(n.commentSlashSlash&&"/"==c&&a.eat("/"))return a.skipToEnd(),"comment";if(n.commentHash&&"#"==c||"-"==c&&a.eat("-")&&(!n.commentSpaceRequired||a.eat(" ")))return a.skipToEnd(),"comment";if("/"==c&&a.eat("*"))return b.tokenize=f(1),b.tokenize(a,b);if("."!=c){if(m.test(c))return a.eatWhile(m),"operator";if(r.test(c))return a.eatWhile(r),"bracket";if(s.test(c))return a.eatWhile(s),"punctuation";if("{"==c&&(a.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||a.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";a.eatWhile(/^[_\w\d]/);var g=a.current().toLowerCase();return p.hasOwnProperty(g)&&(a.match(/^( )+'[^']*'/)||a.match(/^( )+"[^"]*"/))?"number":j.hasOwnProperty(g)?"atom":k.hasOwnProperty(g)?"builtin":l.hasOwnProperty(g)?"keyword":i.hasOwnProperty(g)?"string-2":null}return n.zerolessFloat&&a.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":a.match(/^\.+/)?null:n.ODBCdotTable&&a.match(/^[\w\d_]+/)?"variable-2":void 0}function e(a){return function(b,c){for(var e,f=!1;null!=(e=b.next());){if(e==a&&!f){c.tokenize=d;break}f=q&&!f&&"\\"==e}return"string"}}function f(a){return function(b,c){var e=b.match(/^.*?(\/\*|\*\/)/);return e?"/*"==e[1]?c.tokenize=f(a+1):a>1?c.tokenize=f(a-1):c.tokenize=d:b.skipToEnd(),"comment"}}function g(a,b,c){b.context={prev:b.context,indent:a.indentation(),col:a.column(),type:c}}function h(a){a.indent=a.context.indent,a.context=a.context.prev}var i=c.client||{},j=c.atoms||{false:!0,true:!0,null:!0},k=c.builtin||{},l=c.keywords||{},m=c.operatorChars||/^[*+\-%<>!=&|~^]/,n=c.support||{},o=c.hooks||{},p=c.dateSQL||{date:!0,time:!0,timestamp:!0},q=c.backslashStringEscapes!==!1,r=c.brackets||/^[\{}\(\)\[\]]/,s=c.punctuation||/^[;.,:]/;return{startState:function(){return{tokenize:d,context:null}},token:function(a,b){if(a.sol()&&b.context&&null==b.context.align&&(b.context.align=!1),b.tokenize==d&&a.eatSpace())return null;var c=b.tokenize(a,b);if("comment"==c)return c;b.context&&null==b.context.align&&(b.context.align=!0);var e=a.current();return"("==e?g(a,b,")"):"["==e?g(a,b,"]"):b.context&&b.context.type==e&&h(b),c},indent:function(c,d){var e=c.context;if(!e)return a.Pass;var f=d.charAt(0)==e.type;return e.align?e.col+(f?0:1):e.indent+(f?0:b.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:n.commentSlashSlash?"//":n.commentHash?"#":"--",closeBrackets:"()[]{}''\"\"``"}})),(function(){function b(a){for(var b;null!=(b=a.next());)if("`"==b&&!a.eat("`"))return"variable-2";return a.backUp(a.current().length-1),a.eatWhile(/\w/)?"variable-2":null}function c(a){for(var b;null!=(b=a.next());)if('"'==b&&!a.eat('"'))return"variable-2";return a.backUp(a.current().length-1),a.eatWhile(/\w/)?"variable-2":null}function d(a){return a.eat("@")&&(a.match(/^session\./),a.match(/^local\./),a.match(/^global\./)),a.eat("'")?(a.match(/^.*'/),"variable-2"):a.eat('"')?(a.match(/^.*"/),"variable-2"):a.eat("`")?(a.match(/^.*`/),"variable-2"):a.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function e(a){return a.eat("N")?"atom":a.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function f(a){for(var b={},c=a.split(" "),d=0;d!=]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable doubleQuote binaryNumber hexNumber")}),a.defineMIME("text/x-mssql",{name:"sql",client:f("$partition binary_checksum checksum connectionproperty context_info current_request_id error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big xact_state object_id"),keywords:f(g+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec go if use index holdlock nolock nowait paglock readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot tablock tablockx updlock with"),builtin:f("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:f("is not null like and or in left right between inner outer join all any some cross unpivot pivot exists"),operatorChars:/^[*+\-%<>!=^\&|\/]/,brackets:/^[\{}\(\)]/,punctuation:/^[;.,:\/]/,backslashStringEscapes:!1,dateSQL:f("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":d}}),a.defineMIME("text/x-mysql",{name:"sql",client:f("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:f(g+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:f("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":d,"`":b,"\\":e}}),a.defineMIME("text/x-mariadb",{name:"sql",client:f("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:f(g+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:f("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":d,"`":b,"\\":e}}),a.defineMIME("text/x-sqlite",{name:"sql",client:f("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:f(g+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:f("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:f("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|\/~]/,dateSQL:f("date time timestamp datetime"),support:f("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":d,":":d,"?":d,$:d,'"':c,"`":b}}),a.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:f("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:f("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:f("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:f("commentSlashSlash decimallessFloat"),hooks:{}}),a.defineMIME("text/x-plsql",{name:"sql",client:f("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:f("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:f("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:f("date time timestamp"),support:f("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),a.defineMIME("text/x-hive",{name:"sql",keywords:f("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:f("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:f("date timestamp"),support:f("ODBCdotTable doubleQuote binaryNumber hexNumber")}),a.defineMIME("text/x-pgsql",{name:"sql",client:f("source"),keywords:f(g+"a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lc_collate lc_ctype lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict restricted result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat attach path depends detach zone"),builtin:f("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),a.defineMIME("text/x-gql",{name:"sql",keywords:f("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:f("false true"),builtin:f("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),a.defineMIME("text/x-gpsql",{name:"sql",client:f("source"),keywords:f("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"), +builtin:f("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),a.defineMIME("text/x-sparksql",{name:"sql",keywords:f("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:f("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),atoms:f("false true null"),operatorChars:/^[*+\-%<>!=~&|^]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable doubleQuote zerolessFloat")}),a.defineMIME("text/x-esper",{name:"sql",client:f("source"),keywords:f("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:f("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:f("time"),support:f("decimallessFloat zerolessFloat binaryNumber hexNumber")})})()})); \ No newline at end of file diff --git a/media/editors/codemirror/mode/velocity/velocity.js b/media/editors/codemirror/mode/velocity/velocity.js index 12ee221249c8e..2525fda5ca121 100644 --- a/media/editors/codemirror/mode/velocity/velocity.js +++ b/media/editors/codemirror/mode/velocity/velocity.js @@ -82,7 +82,7 @@ CodeMirror.defineMode("velocity", function() { } // variable? else if (ch == "$") { - stream.eatWhile(/[\w\d\$_\.{}]/); + stream.eatWhile(/[\w\d\$_\.{}-]/); // is it one of the specials? if (specials && specials.propertyIsEnumerable(stream.current())) { return "keyword"; diff --git a/media/editors/codemirror/mode/velocity/velocity.min.js b/media/editors/codemirror/mode/velocity/velocity.min.js index 2f24fe0cd3d54..57004aaf4d781 100644 --- a/media/editors/codemirror/mode/velocity/velocity.min.js +++ b/media/editors/codemirror/mode/velocity/velocity.min.js @@ -1 +1 @@ -!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";a.defineMode("velocity",(function(){function a(a){for(var b={},c=a.split(" "),d=0;dm.length&&"."==a.string.charAt(a.pos-m.length-1)&&c.lastTokenWasBuiltin?"builtin":(c.lastTokenWasBuiltin=!1,null)}return c.lastTokenWasBuiltin=!1,c.inString?(c.inString=!1,"string"):c.inParams?b(a,c,d(l)):void 0}function d(a){return function(b,d){for(var e,f=!1,g=!1;null!=(e=b.next());){if(e==a&&!f){g=!0;break}if('"'==a&&"$"==b.peek()&&!f){d.inString=!0,g=!0;break}f=!f&&"\\"==e}return g&&(d.tokenize=c),"string"}}function e(a,b){for(var d,e=!1;d=a.next();){if("#"==d&&e){b.tokenize=c;break}e="*"==d}return"comment"}function f(a,b){for(var d,e=0;d=a.next();){if("#"==d&&2==e){b.tokenize=c;break}"]"==d?e++:" "!=d&&(e=0)}return"meta"}var g=a("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"),h=a("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"),i=a("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"),j=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:c,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)},blockCommentStart:"#*",blockCommentEnd:"*#",lineComment:"##",fold:"velocity"}})),a.defineMIME("text/velocity","velocity")})); \ No newline at end of file +!(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";a.defineMode("velocity",(function(){function a(a){for(var b={},c=a.split(" "),d=0;dm.length&&"."==a.string.charAt(a.pos-m.length-1)&&c.lastTokenWasBuiltin?"builtin":(c.lastTokenWasBuiltin=!1,null)}return c.lastTokenWasBuiltin=!1,c.inString?(c.inString=!1,"string"):c.inParams?b(a,c,d(l)):void 0}function d(a){return function(b,d){for(var e,f=!1,g=!1;null!=(e=b.next());){if(e==a&&!f){g=!0;break}if('"'==a&&"$"==b.peek()&&!f){d.inString=!0,g=!0;break}f=!f&&"\\"==e}return g&&(d.tokenize=c),"string"}}function e(a,b){for(var d,e=!1;d=a.next();){if("#"==d&&e){b.tokenize=c;break}e="*"==d}return"comment"}function f(a,b){for(var d,e=0;d=a.next();){if("#"==d&&2==e){b.tokenize=c;break}"]"==d?e++:" "!=d&&(e=0)}return"meta"}var g=a("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"),h=a("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"),i=a("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"),j=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:c,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)},blockCommentStart:"#*",blockCommentEnd:"*#",lineComment:"##",fold:"velocity"}})),a.defineMIME("text/velocity","velocity")})); \ No newline at end of file diff --git a/media/editors/codemirror/theme/gruvbox-dark.css b/media/editors/codemirror/theme/gruvbox-dark.css new file mode 100644 index 0000000000000..01ca7bb72490c --- /dev/null +++ b/media/editors/codemirror/theme/gruvbox-dark.css @@ -0,0 +1,34 @@ +/* + + Name: gruvbox-dark + Author: kRkk (https://github.com/krkk) + + Original gruvbox color scheme by Pavel Pertsev (https://github.com/morhetz/gruvbox) + +*/ + +.cm-s-gruvbox-dark.CodeMirror, .cm-s-gruvbox-dark .CodeMirror-gutters { background-color: #282828; color: #bdae93; } +.cm-s-gruvbox-dark .CodeMirror-gutters {background: #282828; border-right: 0px;} +.cm-s-gruvbox-dark .CodeMirror-linenumber {color: #7c6f64;} +.cm-s-gruvbox-dark .CodeMirror-cursor { border-left: 1px solid #ebdbb2; } +.cm-s-gruvbox-dark div.CodeMirror-selected { background: #928374; } +.cm-s-gruvbox-dark span.cm-meta { color: #808000; } + +.cm-s-gruvbox-dark span.cm-comment { color: #928374; } +.cm-s-gruvbox-dark span.cm-number, span.cm-atom { color: #d3869b; } +.cm-s-gruvbox-dark span.cm-keyword { color: #f84934; } + +.cm-s-gruvbox-dark span.cm-variable { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-variable-2 { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-variable-3, .cm-s-gruvbox-dark span.cm-type { color: black; } +.cm-s-gruvbox-dark span.cm-operator { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-def { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-string { color: #b8bb26; } +.cm-s-gruvbox-dark span.cm-string-2 { color: #8ec07c; } +.cm-s-gruvbox-dark span.cm-qualifier { color: #555; } +.cm-s-gruvbox-dark span.cm-attribute { color: #8ec07c; } + +.cm-s-gruvbox-dark .CodeMirror-activeline-background { background: #3c3836; } +.cm-s-gruvbox-dark .CodeMirror-matchingbracket { background: #928374; color:#282828 !important; } + +.cm-s-gruvbox-dark span.cm-builtin { color: #fe8019; } diff --git a/media/editors/codemirror/theme/idea.css b/media/editors/codemirror/theme/idea.css new file mode 100644 index 0000000000000..28c5c40dea44c --- /dev/null +++ b/media/editors/codemirror/theme/idea.css @@ -0,0 +1,31 @@ +/** + Name: IDEA default theme + From IntelliJ IDEA by JetBrains + */ + +.cm-s-idea span.cm-meta { color: #808000; } +.cm-s-idea span.cm-number { color: #0000FF; } +.cm-s-idea span.cm-keyword { line-height: 1em; font-weight: bold; color: #000080; } +.cm-s-idea span.cm-atom { font-weight: bold; color: #000080; } +.cm-s-idea span.cm-def { color: #000000; } +.cm-s-idea span.cm-variable { color: black; } +.cm-s-idea span.cm-variable-2 { color: black; } +.cm-s-idea span.cm-variable-3, .cm-s-idea span.cm-type { color: black; } +.cm-s-idea span.cm-property { color: black; } +.cm-s-idea span.cm-operator { color: black; } +.cm-s-idea span.cm-comment { color: #808080; } +.cm-s-idea span.cm-string { color: #008000; } +.cm-s-idea span.cm-string-2 { color: #008000; } +.cm-s-idea span.cm-qualifier { color: #555; } +.cm-s-idea span.cm-error { color: #FF0000; } +.cm-s-idea span.cm-attribute { color: #0000FF; } +.cm-s-idea span.cm-tag { color: #000080; } +.cm-s-idea span.cm-link { color: #0000FF; } +.cm-s-idea .CodeMirror-activeline-background { background: #FFFAE3; } + +.cm-s-idea span.cm-builtin { color: #30a; } +.cm-s-idea span.cm-bracket { color: #cc7; } +.cm-s-idea { font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;} + + +.cm-s-idea .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } diff --git a/media/editors/codemirror/theme/lucario.css b/media/editors/codemirror/theme/lucario.css new file mode 100644 index 0000000000000..17a1551032f9f --- /dev/null +++ b/media/editors/codemirror/theme/lucario.css @@ -0,0 +1,37 @@ +/* + Name: lucario + Author: Raphael Amorim + + Original Lucario color scheme (https://github.com/raphamorim/lucario) +*/ + +.cm-s-lucario.CodeMirror, .cm-s-lucario .CodeMirror-gutters { + background-color: #2b3e50 !important; + color: #f8f8f2 !important; + border: none; +} +.cm-s-lucario .CodeMirror-gutters { color: #2b3e50; } +.cm-s-lucario .CodeMirror-cursor { border-left: solid thin #E6C845; } +.cm-s-lucario .CodeMirror-linenumber { color: #f8f8f2; } +.cm-s-lucario .CodeMirror-selected { background: #243443; } +.cm-s-lucario .CodeMirror-line::selection, .cm-s-lucario .CodeMirror-line > span::selection, .cm-s-lucario .CodeMirror-line > span > span::selection { background: #243443; } +.cm-s-lucario .CodeMirror-line::-moz-selection, .cm-s-lucario .CodeMirror-line > span::-moz-selection, .cm-s-lucario .CodeMirror-line > span > span::-moz-selection { background: #243443; } +.cm-s-lucario span.cm-comment { color: #5c98cd; } +.cm-s-lucario span.cm-string, .cm-s-lucario span.cm-string-2 { color: #E6DB74; } +.cm-s-lucario span.cm-number { color: #ca94ff; } +.cm-s-lucario span.cm-variable { color: #f8f8f2; } +.cm-s-lucario span.cm-variable-2 { color: #f8f8f2; } +.cm-s-lucario span.cm-def { color: #72C05D; } +.cm-s-lucario span.cm-operator { color: #66D9EF; } +.cm-s-lucario span.cm-keyword { color: #ff6541; } +.cm-s-lucario span.cm-atom { color: #bd93f9; } +.cm-s-lucario span.cm-meta { color: #f8f8f2; } +.cm-s-lucario span.cm-tag { color: #ff6541; } +.cm-s-lucario span.cm-attribute { color: #66D9EF; } +.cm-s-lucario span.cm-qualifier { color: #72C05D; } +.cm-s-lucario span.cm-property { color: #f8f8f2; } +.cm-s-lucario span.cm-builtin { color: #72C05D; } +.cm-s-lucario span.cm-variable-3, .cm-s-lucario span.cm-type { color: #ffb86c; } + +.cm-s-lucario .CodeMirror-activeline-background { background: #243443; } +.cm-s-lucario .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/media/editors/codemirror/theme/ssms.css b/media/editors/codemirror/theme/ssms.css new file mode 100644 index 0000000000000..9494c14c20f0a --- /dev/null +++ b/media/editors/codemirror/theme/ssms.css @@ -0,0 +1,16 @@ +.cm-s-ssms span.cm-keyword { color: blue; } +.cm-s-ssms span.cm-comment { color: darkgreen; } +.cm-s-ssms span.cm-string { color: red; } +.cm-s-ssms span.cm-def { color: black; } +.cm-s-ssms span.cm-variable { color: black; } +.cm-s-ssms span.cm-variable-2 { color: black; } +.cm-s-ssms span.cm-atom { color: darkgray; } +.cm-s-ssms .CodeMirror-linenumber { color: teal; } +.cm-s-ssms .CodeMirror-activeline-background { background: #ffffff; } +.cm-s-ssms span.cm-string-2 { color: #FF00FF; } +.cm-s-ssms span.cm-operator, +.cm-s-ssms span.cm-bracket, +.cm-s-ssms span.cm-punctuation { color: darkgray; } +.cm-s-ssms .CodeMirror-gutters { border-right: 3px solid #ffee62; background-color: #ffffff; } +.cm-s-ssms div.CodeMirror-selected { background: #ADD6FF; } + diff --git a/plugins/editors/codemirror/codemirror.xml b/plugins/editors/codemirror/codemirror.xml index 5c48b8168bedb..8b8de9a44cd52 100644 --- a/plugins/editors/codemirror/codemirror.xml +++ b/plugins/editors/codemirror/codemirror.xml @@ -1,7 +1,7 @@ plg_editors_codemirror - 5.35.0 + 5.37.0 28 March 2011 Marijn Haverbeke marijnh@gmail.com From f24c7d4429e38f44039484539c85cd056ed171c0 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Sat, 5 May 2018 23:17:05 +0300 Subject: [PATCH 09/36] Use title from menu item (#20267) --- components/com_search/views/search/view.html.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/components/com_search/views/search/view.html.php b/components/com_search/views/search/view.html.php index 19b443dfa61e2..649017a13d753 100644 --- a/components/com_search/views/search/view.html.php +++ b/components/com_search/views/search/view.html.php @@ -43,18 +43,7 @@ public function display($tpl = null) $searchWord = $state->get('keyword'); $params = $app->getParams(); - $menus = $app->getMenu(); - $menu = $menus->getActive(); - - // Because the application sets a default page title, we need to get it right from the menu item itself - if (is_object($menu)) - { - if (!$menu->params->get('page_title')) - { - $params->set('page_title', JText::_('COM_SEARCH_SEARCH')); - } - } - else + if (!$app->getMenu()->getActive()) { $params->set('page_title', JText::_('COM_SEARCH_SEARCH')); } From 65297f82395afb758261957eff43c1961e08e9c6 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 5 May 2018 22:17:43 +0200 Subject: [PATCH 10/36] Change the defaults for new installs to disable com_mailto in articles (#20266) * change the defaults for new installs to disable com_mailto in articles * change more defaults to 0 thanks @quy --- installation/sql/mysql/joomla.sql | 2 +- installation/sql/mysql/sample_learn.sql | 2 +- installation/sql/postgresql/joomla.sql | 2 +- installation/sql/postgresql/sample_learn.sql | 2 +- installation/sql/sqlazure/joomla.sql | 2 +- installation/sql/sqlazure/sample_learn.sql | 2 +- tests/unit/stubs/database/jos_extensions.csv | 2 +- tests/unit/stubs/database/jos_menu.csv | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 72dddaa5bb888..3732890f4dfa4 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -507,7 +507,7 @@ INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `elem (18, 0, 'com_plugins', 'component', 'com_plugins', '', 1, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (19, 0, 'com_search', 'component', 'com_search', '', 1, 1, 1, 0, '', '{"enabled":"0","search_phrases":"1","search_areas":"1","show_date":"1","opensearch_name":"","opensearch_description":""}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (20, 0, 'com_templates', 'component', 'com_templates', '', 1, 1, 1, 1, '', '{"template_positions_display":"0","upload_limit":"10","image_formats":"gif,bmp,jpg,jpeg,png","source_formats":"txt,less,ini,xml,js,php,css,scss,sass","font_formats":"woff,ttf,otf","compressed_formats":"zip"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), -(22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"1","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (24, 0, 'com_redirect', 'component', 'com_redirect', '', 1, 1, 0, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"1","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '0000-00-00 00:00:00', 0, 0), diff --git a/installation/sql/mysql/sample_learn.sql b/installation/sql/mysql/sample_learn.sql index ccdc502812a2b..87a400ae01514 100644 --- a/installation/sql/mysql/sample_learn.sql +++ b/installation/sql/mysql/sample_learn.sql @@ -490,7 +490,7 @@ INSERT INTO `#__menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link (448, 'mainmenu', 'Site Administrator', 'site-administrator', '', 'site-administrator', 'administrator', 'url', 1, 1, 1, 0, 0, '0000-00-00 00:00:00', 1, 1, '', 0, '{"menu-anchor_title":"","menu-anchor_css":"","menu_image":""}', 251, 252, 0, '*', 0), (449, 'usermenu', 'Submit an Article', 'submit-an-article', '', 'submit-an-article', 'index.php?option=com_content&view=form&layout=edit', 'component', 1, 1, 1, 22, 0, '0000-00-00 00:00:00', 0, 3, '', 0, '{"menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":0,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 253, 254, 0, '*', 0), (452, 'aboutjoomla', 'Featured Contacts', 'featured-contacts', '', 'using-joomla/extensions/components/contact-component/featured-contacts', 'index.php?option=com_contact&view=featured&id=16', 'component', 1, 270, 5, 8, 0, '0000-00-00 00:00:00', 0, 1, '', 0, '{"maxLevel":"-1","show_empty_categories":"","show_description":"","show_description_image":"","show_cat_num_articles":"","display_num":"","show_headings":"","filter_field":"","show_pagination":"","show_noauth":"","presentation_style":"sliders","show_name":"","show_position":"","show_email":"","show_street_address":"","show_suburb":"","show_state":"","show_postcode":"","show_country":"","show_telephone":"","show_mobile":"","show_fax":"","show_webpage":"","show_misc":"","show_image":"","allow_vcard":"","show_articles":"","show_links":"1","linka_name":"","linkb_name":"","linkc_name":"","linkd_name":"","linke_name":"","show_email_form":"","show_email_copy":"","banned_email":"","banned_subject":"","banned_text":"","validate_session":"","custom_reply":"","redirect":"","show_feed_link":"","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":1,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 79, 80, 0, '*', 0), -(453, 'aboutjoomla', 'Parameters', 'parameters', '', 'using-joomla/parameters', 'index.php?option=com_content&view=article&id=32', 'component', 1, 280, 2, 22, 0, '0000-00-00 00:00:00', 0, 1, '', 0, '{"show_noauth":"1","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"1","link_parent_category":"1","show_author":"1","link_author":"1","show_create_date":"1","show_modify_date":"1","show_publish_date":"1","show_item_navigation":"1","show_icons":"1","show_print_icon":"1","show_email_icon":"1","show_hits":"1","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":0,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}', 204, 205, 0, '*', 0), +(453, 'aboutjoomla', 'Parameters', 'parameters', '', 'using-joomla/parameters', 'index.php?option=com_content&view=article&id=32', 'component', 1, 280, 2, 22, 0, '0000-00-00 00:00:00', 0, 1, '', 0, '{"show_noauth":"1","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"1","link_parent_category":"1","show_author":"1","link_author":"1","show_create_date":"1","show_modify_date":"1","show_publish_date":"1","show_item_navigation":"1","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":0,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}', 204, 205, 0, '*', 0), (455, 'mainmenu', 'Example Pages', 'example-pages', '', 'example-pages', 'index.php?Itemid=', 'alias', 1, 1, 1, 0, 0, '0000-00-00 00:00:00', 0, 1, '', 0, '{"aliasoptions":"268","menu-anchor_title":"","menu-anchor_css":"","menu_image":""}', 255, 256, 0, '*', 0), (459, 'aboutjoomla', 'Article Category', 'article-category', '', 'using-joomla/extensions/modules/content-modules/article-category', 'index.php?option=com_content&view=article&id=4', 'component', 1, 411, 5, 22, 0, '0000-00-00 00:00:00', 0, 1, '', 0, '{"show_noauth":"","show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_hits":"","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":1,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}', 133, 134, 0, '*', 0), (462, 'fruitshop', 'Add a recipe', 'add-a-recipe', '', 'add-a-recipe', 'index.php?option=com_content&view=form&layout=edit', 'component', 1, 1, 1, 22, 0, '0000-00-00 00:00:00', 0, 4, '', 4, '{"enable_category":"0","catid":"14","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 257, 258, 0, '*', 0), diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index d5686a2e6f61c..039be5f5edcb2 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -521,7 +521,7 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem (18, 0, 'com_plugins', 'component', 'com_plugins', '', 1, 1, 1, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), (19, 0, 'com_search', 'component', 'com_search', '', 1, 1, 1, 0, '', '{"enabled":"0","search_phrases":"1","search_areas":"1","show_date":"1","opensearch_name":"","opensearch_description":""}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (20, 0, 'com_templates', 'component', 'com_templates', '', 1, 1, 1, 1, '', '{"template_positions_display":"0","upload_limit":"10","image_formats":"gif,bmp,jpg,jpeg,png","source_formats":"txt,less,ini,xml,js,php,css,scss,sass","font_formats":"woff,ttf,otf","compressed_formats":"zip"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), -(22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"1","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (24, 0, 'com_redirect', 'component', 'com_redirect', '', 1, 1, 0, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), (25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"1","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '1970-01-01 00:00:00', 0, 0), diff --git a/installation/sql/postgresql/sample_learn.sql b/installation/sql/postgresql/sample_learn.sql index 483348846f7b0..6e213f0e6aa99 100644 --- a/installation/sql/postgresql/sample_learn.sql +++ b/installation/sql/postgresql/sample_learn.sql @@ -498,7 +498,7 @@ INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link (448, 'mainmenu', 'Site Administrator', 'site-administrator', '', 'site-administrator', 'administrator', 'url', 1, 1, 1, 0, 0, '1970-01-01 00:00:00', 1, 1, '', 0, '{"menu-anchor_title":"","menu-anchor_css":"","menu_image":""}', 251, 252, 0, '*', 0), (449, 'usermenu', 'Submit an Article', 'submit-an-article', '', 'submit-an-article', 'index.php?option=com_content&view=form&layout=edit', 'component', 1, 1, 1, 22, 0, '1970-01-01 00:00:00', 0, 3, '', 0, '{"menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":0,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 253, 254, 0, '*', 0), (452, 'aboutjoomla', 'Featured Contacts', 'featured-contacts', '', 'using-joomla/extensions/components/contact-component/featured-contacts', 'index.php?option=com_contact&view=featured&id=16', 'component', 1, 270, 5, 8, 0, '1970-01-01 00:00:00', 0, 1, '', 0, '{"maxLevel":"-1","show_empty_categories":"","show_description":"","show_description_image":"","show_cat_num_articles":"","display_num":"","show_headings":"","filter_field":"","show_pagination":"","show_noauth":"","presentation_style":"sliders","show_name":"","show_position":"","show_email":"","show_street_address":"","show_suburb":"","show_state":"","show_postcode":"","show_country":"","show_telephone":"","show_mobile":"","show_fax":"","show_webpage":"","show_misc":"","show_image":"","allow_vcard":"","show_articles":"","show_links":"1","linka_name":"","linkb_name":"","linkc_name":"","linkd_name":"","linke_name":"","show_email_form":"","show_email_copy":"","banned_email":"","banned_subject":"","banned_text":"","validate_session":"","custom_reply":"","redirect":"","show_feed_link":"","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":1,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 79, 80, 0, '*', 0), -(453, 'aboutjoomla', 'Parameters', 'parameters', '', 'using-joomla/parameters', 'index.php?option=com_content&view=article&id=32', 'component', 1, 280, 2, 22, 0, '1970-01-01 00:00:00', 0, 1, '', 0, '{"show_noauth":"1","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"1","link_parent_category":"1","show_author":"1","link_author":"1","show_create_date":"1","show_modify_date":"1","show_publish_date":"1","show_item_navigation":"1","show_icons":"1","show_print_icon":"1","show_email_icon":"1","show_hits":"1","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":0,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}', 204, 205, 0, '*', 0), +(453, 'aboutjoomla', 'Parameters', 'parameters', '', 'using-joomla/parameters', 'index.php?option=com_content&view=article&id=32', 'component', 1, 280, 2, 22, 0, '1970-01-01 00:00:00', 0, 1, '', 0, '{"show_noauth":"1","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"1","link_parent_category":"1","show_author":"1","link_author":"1","show_create_date":"1","show_modify_date":"1","show_publish_date":"1","show_item_navigation":"1","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":0,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}', 204, 205, 0, '*', 0), (455, 'mainmenu', 'Example Pages', 'example-pages', '', 'example-pages', 'index.php?Itemid=', 'alias', 1, 1, 1, 0, 0, '1970-01-01 00:00:00', 0, 1, '', 0, '{"aliasoptions":"268","menu-anchor_title":"","menu-anchor_css":"","menu_image":""}', 255, 256, 0, '*', 0), (459, 'aboutjoomla', 'Article Category', 'article-category', '', 'using-joomla/extensions/modules/content-modules/article-category', 'index.php?option=com_content&view=article&id=4', 'component', 1, 411, 5, 22, 0, '1970-01-01 00:00:00', 0, 1, '', 0, '{"show_noauth":"","show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_hits":"","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":1,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}', 133, 134, 0, '*', 0), (462, 'fruitshop', 'Add a recipe', 'add-a-recipe', '', 'add-a-recipe', 'index.php?option=com_content&view=form&layout=edit', 'component', 1, 1, 1, 22, 0, '1970-01-01 00:00:00', 0, 4, '', 4, '{"enable_category":"0","catid":"14","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 257, 258, 0, '*', 0), diff --git a/installation/sql/sqlazure/joomla.sql b/installation/sql/sqlazure/joomla.sql index 49e643241b005..3481e0aefac89 100644 --- a/installation/sql/sqlazure/joomla.sql +++ b/installation/sql/sqlazure/joomla.sql @@ -736,7 +736,7 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem (18, 0, 'com_plugins', 'component', 'com_plugins', '', 1, 1, 1, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0), (19, 0, 'com_search', 'component', 'com_search', '', 1, 1, 1, 0, '', '{"enabled":"0","search_phrases":"1","search_areas":"1","show_date":"1","opensearch_name":"","opensearch_description":""}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (20, 0, 'com_templates', 'component', 'com_templates', '', 1, 1, 1, 1, '', '{"template_positions_display":"0","upload_limit":"10","image_formats":"gif,bmp,jpg,jpeg,png","source_formats":"txt,less,ini,xml,js,php,css,scss,sass","font_formats":"woff,ttf,otf","compressed_formats":"zip"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), -(22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"1","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), +(22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (24, 0, 'com_redirect', 'component', 'com_redirect', '', 1, 1, 0, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0), (25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"1","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '1900-01-01 00:00:00', 0, 0), diff --git a/installation/sql/sqlazure/sample_learn.sql b/installation/sql/sqlazure/sample_learn.sql index c0a03d32322e8..8de6b8b26a3b3 100644 --- a/installation/sql/sqlazure/sample_learn.sql +++ b/installation/sql/sqlazure/sample_learn.sql @@ -512,7 +512,7 @@ INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link (448, 'mainmenu', 'Site Administrator', 'site-administrator', '', 'site-administrator', 'administrator', 'url', 1, 1, 1, 0, 0, '1900-01-01 00:00:00', 1, 1, '', 0, '{"menu-anchor_title":"","menu-anchor_css":"","menu_image":""}', 251, 252, 0, '*', 0), (449, 'usermenu', 'Submit an Article', 'submit-an-article', '', 'submit-an-article', 'index.php?option=com_content&view=form&layout=edit', 'component', 1, 1, 1, 22, 0, '1900-01-01 00:00:00', 0, 3, '', 0, '{"menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":0,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 253, 254, 0, '*', 0), (452, 'aboutjoomla', 'Featured Contacts', 'featured-contacts', '', 'using-joomla/extensions/components/contact-component/featured-contacts', 'index.php?option=com_contact&view=featured&id=16', 'component', 1, 270, 5, 8, 0, '1900-01-01 00:00:00', 0, 1, '', 0, '{"maxLevel":"-1","show_empty_categories":"","show_description":"","show_description_image":"","show_cat_num_articles":"","display_num":"","show_headings":"","filter_field":"","show_pagination":"","show_noauth":"","presentation_style":"sliders","show_name":"","show_position":"","show_email":"","show_street_address":"","show_suburb":"","show_state":"","show_postcode":"","show_country":"","show_telephone":"","show_mobile":"","show_fax":"","show_webpage":"","show_misc":"","show_image":"","allow_vcard":"","show_articles":"","show_links":"1","linka_name":"","linkb_name":"","linkc_name":"","linkd_name":"","linke_name":"","show_email_form":"","show_email_copy":"","banned_email":"","banned_subject":"","banned_text":"","validate_session":"","custom_reply":"","redirect":"","show_feed_link":"","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":1,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 79, 80, 0, '*', 0), -(453, 'aboutjoomla', 'Parameters', 'parameters', '', 'using-joomla/parameters', 'index.php?option=com_content&view=article&id=32', 'component', 1, 280, 2, 22, 0, '1900-01-01 00:00:00', 0, 1, '', 0, '{"show_noauth":"1","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"1","link_parent_category":"1","show_author":"1","link_author":"1","show_create_date":"1","show_modify_date":"1","show_publish_date":"1","show_item_navigation":"1","show_icons":"1","show_print_icon":"1","show_email_icon":"1","show_hits":"1","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":0,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}', 204, 205, 0, '*', 0), +(453, 'aboutjoomla', 'Parameters', 'parameters', '', 'using-joomla/parameters', 'index.php?option=com_content&view=article&id=32', 'component', 1, 280, 2, 22, 0, '1900-01-01 00:00:00', 0, 1, '', 0, '{"show_noauth":"1","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"1","link_parent_category":"1","show_author":"1","link_author":"1","show_create_date":"1","show_modify_date":"1","show_publish_date":"1","show_item_navigation":"1","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":0,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}', 204, 205, 0, '*', 0), (455, 'mainmenu', 'Example Pages', 'example-pages', '', 'example-pages', 'index.php?Itemid=', 'alias', 1, 1, 1, 0, 0, '1900-01-01 00:00:00', 0, 1, '', 0, '{"aliasoptions":"268","menu-anchor_title":"","menu-anchor_css":"","menu_image":""}', 255, 256, 0, '*', 0), (459, 'aboutjoomla', 'Article Category', 'article-category', '', 'using-joomla/extensions/modules/content-modules/article-category', 'index.php?option=com_content&view=article&id=4', 'component', 1, 411, 5, 22, 0, '1900-01-01 00:00:00', 0, 1, '', 0, '{"show_noauth":"","show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_hits":"","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":1,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}', 133, 134, 0, '*', 0), (462, 'fruitshop', 'Add a recipe', 'add-a-recipe', '', 'add-a-recipe', 'index.php?option=com_content&view=form&layout=edit', 'component', 1, 1, 1, 22, 0, '1900-01-01 00:00:00', 0, 4, '', 4, '{"enable_category":"0","catid":"14","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}', 257, 258, 0, '*', 0), diff --git a/tests/unit/stubs/database/jos_extensions.csv b/tests/unit/stubs/database/jos_extensions.csv index 92b61cd82f65f..dfec183461433 100644 --- a/tests/unit/stubs/database/jos_extensions.csv +++ b/tests/unit/stubs/database/jos_extensions.csv @@ -20,7 +20,7 @@ '19','com_search','component','com_search',,'1','1','1','0','{"name":"com_search","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\n\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_SEARCH_XML_DESCRIPTION","group":""}','{"enabled":"0","show_date":"1"}',,,'0','0000-00-00 00:00:00','0','0' '20','com_templates','component','com_templates',,'1','1','1','1','{"name":"com_templates","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_TEMPLATES_XML_DESCRIPTION","group":""}','{}',,,'0','0000-00-00 00:00:00','0','0' '21','com_weblinks','component','com_weblinks',,'1','1','1','0','{"name":"com_weblinks","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\n\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_WEBLINKS_XML_DESCRIPTION","group":""}','{"show_comp_description":"1","comp_description":"","show_link_hits":"1","show_link_description":"1","show_other_cats":"0","show_headings":"0","show_numbers":"0","show_report":"1","count_clicks":"1","target":"0","link_icons":""}',,,'0','0000-00-00 00:00:00','0','0' -'22','com_content','component','com_content',,'1','1','0','1','{"name":"com_content","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_CONTENT_XML_DESCRIPTION","group":""}','{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"1","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}',,,'0','0000-00-00 00:00:00','0','0' +'22','com_content','component','com_content',,'1','1','0','1','{"name":"com_content","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_CONTENT_XML_DESCRIPTION","group":""}','{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}',,,'0','0000-00-00 00:00:00','0','0' '23','com_config','component','com_config',,'1','1','0','1','{"name":"com_config","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_CONFIG_XML_DESCRIPTION","group":""}','{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}',,,'0','0000-00-00 00:00:00','0','0' '24','com_redirect','component','com_redirect',,'1','1','0','1','{"name":"com_redirect","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_REDIRECT_XML_DESCRIPTION","group":""}','{}',,,'0','0000-00-00 00:00:00','0','0' '25','com_users','component','com_users',,'1','1','0','1','{"name":"com_users","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_USERS_XML_DESCRIPTION","group":""}','{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"1","useractivation":"1","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":""}',,,'0','0000-00-00 00:00:00','0','0' diff --git a/tests/unit/stubs/database/jos_menu.csv b/tests/unit/stubs/database/jos_menu.csv index 4b65a743318b7..89c58b148c21d 100644 --- a/tests/unit/stubs/database/jos_menu.csv +++ b/tests/unit/stubs/database/jos_menu.csv @@ -127,7 +127,7 @@ '449','usermenu','Submit an Article','submit-an-article',,'submit-an-article','index.php?option=com_content&view=form&layout=edit','component','1','1','1','22','0','0000-00-00 00:00:00','0','3',,'0','{"menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":0,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}','267','268','0','*','0' '450','usermenu','Submit a Web Link','submit-a-web-link',,'submit-a-web-link','index.php?option=com_weblinks&view=form&layout=edit','component','1','1','1','21','0','0000-00-00 00:00:00','0','3',,'0','{"menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":0,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}','269','270','0','*','0' '452','aboutjoomla','Featured Contacts','featured-contacts',,'using-joomla/extensions/components/contact-component/featured-contacts','index.php?option=com_contact&view=featured&id=16','component','1','270','5','8','0','0000-00-00 00:00:00','0','1',,'0','{"maxLevel":"-1","show_empty_categories":"","show_description":"","show_description_image":"","show_cat_num_articles":"","display_num":"","show_headings":"","filter_field":"","show_pagination":"","show_noauth":"","presentation_style":"sliders","show_name":"","show_position":"","show_email":"","show_street_address":"","show_suburb":"","show_state":"","show_postcode":"","show_country":"","show_telephone":"","show_mobile":"","show_fax":"","show_webpage":"","show_misc":"","show_image":"","allow_vcard":"","show_articles":"","show_links":"1","linka_name":"","linkb_name":"","linkc_name":"","linkd_name":"","linke_name":"","show_email_form":"","show_email_copy":"","banned_email":"","banned_subject":"","banned_text":"","validate_session":"","custom_reply":"","redirect":"","show_feed_link":"","feed_summary":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":1,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}','81','82','0','*','0' -'453','aboutjoomla','Parameters','parameters',,'using-joomla/parameters','index.php?option=com_content&view=article&id=32','component','1','280','2','22','0','0000-00-00 00:00:00','0','1',,'0','{"show_noauth":"1","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"1","link_parent_category":"1","show_author":"1","link_author":"1","show_create_date":"1","show_modify_date":"1","show_publish_date":"1","show_item_navigation":"1","show_icons":"1","show_print_icon":"1","show_email_icon":"1","show_hits":"1","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":0,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}','216','217','0','*','0' +'453','aboutjoomla','Parameters','parameters',,'using-joomla/parameters','index.php?option=com_content&view=article&id=32','component','1','280','2','22','0','0000-00-00 00:00:00','0','1',,'0','{"show_noauth":"1","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"1","link_parent_category":"1","show_author":"1","link_author":"1","show_create_date":"1","show_modify_date":"1","show_publish_date":"1","show_item_navigation":"1","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":0,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}','216','217','0','*','0' '455','mainmenu','Example Pages','example-pages',,'example-pages','index.php?Itemid=','alias','1','1','1','0','0','0000-00-00 00:00:00','0','1',,'0','{"aliasoptions":"268","menu-anchor_title":"","menu-anchor_css":"","menu_image":""}','271','272','0','*','0' '459','aboutjoomla','Article Category','article-category',,'using-joomla/extensions/modules/content-modules/article-category','index.php?option=com_content&view=article&id=4','component','1','411','5','22','0','0000-00-00 00:00:00','0','1',,'0','{"show_noauth":"","show_title":"","link_titles":"","show_intro":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_hits":"","robots":"","rights":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","show_page_heading":1,"page_title":"","page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","secure":0}','143','144','0','*','0' '462','fruitshop','Add a recipe','add-a-recipe',,'add-a-recipe','index.php?option=com_content&view=form&layout=edit','component','1','1','1','22','0','0000-00-00 00:00:00','0','4',,'4','{"enable_category":"0","catid":"14","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":1,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}','273','274','0','*','0' From 29a2bd3e63b91cf2225a438f4fccbaef4e94246b Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 5 May 2018 22:18:24 +0200 Subject: [PATCH 11/36] Don't enable sending the PW on new installs (#20247) * disable plaun pw sending per default on new installs * make sure we have to set a PW when we dont send the plain pw via mail * chagne the default in the xml to thanks @quy * update the sample data thanks @quy * make sure the mail to user does not include the PW too * Revert "make sure the mail to user does not include the PW too" This reverts commit 9095819a9d4e6f8828b0556e5d0284e754f3b9c6. * address comments by @bakual thanks --- administrator/components/com_users/models/user.php | 2 +- installation/sql/mysql/joomla.sql | 2 +- installation/sql/mysql/sample_learn.sql | 2 +- installation/sql/mysql/sample_testing.sql | 2 +- installation/sql/postgresql/joomla.sql | 2 +- installation/sql/postgresql/sample_learn.sql | 2 +- installation/sql/postgresql/sample_testing.sql | 2 +- installation/sql/sqlazure/joomla.sql | 2 +- installation/sql/sqlazure/sample_learn.sql | 2 +- installation/sql/sqlazure/sample_testing.sql | 2 +- tests/unit/stubs/database/jos_extensions.csv | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/administrator/components/com_users/models/user.php b/administrator/components/com_users/models/user.php index 458efaaa3fd71..6d74f773cfd7a 100644 --- a/administrator/components/com_users/models/user.php +++ b/administrator/components/com_users/models/user.php @@ -128,9 +128,9 @@ public function getForm($data = array(), $loadData = true) return false; } - // Passwords fields are required when mail to user is set to No in joomla user plugin $userId = $form->getValue('id'); + // Passwords fields are required when mail to user is set to No in the joomla user plugin if ($userId === 0 && $pluginParams->get('mail_to_user', '1') === '0') { $form->setFieldAttribute('password', 'required', 'true'); diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 3732890f4dfa4..764e32d3af954 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -510,7 +510,7 @@ INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `elem (22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (24, 0, 'com_redirect', 'component', 'com_redirect', '', 1, 1, 0, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), -(25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"1","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"0","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (27, 0, 'com_finder', 'component', 'com_finder', '', 1, 1, 0, 0, '', '{"enabled":"0","show_description":"1","description_length":255,"allow_empty_query":"0","show_url":"1","show_autosuggest":"1","show_suggested_query":"1","show_explained_query":"1","show_advanced":"1","show_advanced_tips":"1","expand_advanced":"0","show_date_filters":"0","sort_order":"relevance","sort_direction":"desc","highlight_terms":"1","opensearch_name":"","opensearch_description":"","batch_size":"50","memory_table_limit":30000,"title_multiplier":"1.7","text_multiplier":"0.7","meta_multiplier":"1.2","path_multiplier":"2.0","misc_multiplier":"0.3","stem":"1","stemmer":"snowball","enable_logging":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (28, 0, 'com_joomlaupdate', 'component', 'com_joomlaupdate', '', 1, 1, 0, 1, '', '{"updatesource":"default","customurl":""}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (29, 0, 'com_tags', 'component', 'com_tags', '', 1, 1, 1, 1, '', '{"tag_layout":"_:default","save_history":"1","history_limit":5,"show_tag_title":"0","tag_list_show_tag_image":"0","tag_list_show_tag_description":"0","tag_list_image":"","tag_list_orderby":"title","tag_list_orderby_direction":"ASC","show_headings":"0","tag_list_show_date":"0","tag_list_show_item_image":"0","tag_list_show_item_description":"0","tag_list_item_maximum_characters":0,"return_any_or_all":"1","include_children":"0","maximum":200,"tag_list_language_filter":"all","tags_layout":"_:default","all_tags_orderby":"title","all_tags_orderby_direction":"ASC","all_tags_show_tag_image":"0","all_tags_show_tag_descripion":"0","all_tags_tag_maximum_characters":20,"all_tags_show_tag_hits":"0","filter_field":"1","show_pagination_limit":"1","show_pagination":"2","show_pagination_results":"1","tag_field_ajax_mode":"1","show_feed_link":"1"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), diff --git a/installation/sql/mysql/sample_learn.sql b/installation/sql/mysql/sample_learn.sql index 87a400ae01514..6d9653261f65b 100644 --- a/installation/sql/mysql/sample_learn.sql +++ b/installation/sql/mysql/sample_learn.sql @@ -825,6 +825,6 @@ INSERT INTO `#__viewlevels` (`id`, `title`, `ordering`, `rules`) VALUES (5, 'Guest', 1, '[13]'), (6, 'Super Users', 5, '[8]'); -UPDATE `#__extensions` SET `params`='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"1","useractivation":"2","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; +UPDATE `#__extensions` SET `params`='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"0","useractivation":"2","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; SET FOREIGN_KEY_CHECKS=1; diff --git a/installation/sql/mysql/sample_testing.sql b/installation/sql/mysql/sample_testing.sql index 967fd9893aa31..108873dbe436f 100644 --- a/installation/sql/mysql/sample_testing.sql +++ b/installation/sql/mysql/sample_testing.sql @@ -865,6 +865,6 @@ INSERT INTO `#__ucm_content` (`core_content_id`, `core_type_alias`, `core_title` (1, 'com_content.article', 'Joomla! Testing', 'joomla', '

Thanks for helping us to test Joomla!

We''re getting ready for the release of Joomla and we appreciate you helping us find and fix problems as we work.

If you haven''t done testing before here are some tips.

  • Don''t delete the installation folder when you finish installing! While we''re working we turn that security feature off to make it easier to test.
  • Go to global configuration and set Error Reporting to Development (that''s on the server tab) and enable both debugging and language debugging (those are on the system tab). Don''t worry when you see ** around words --that means Joomla translation is doing its job.

How to test

  • First, do the things you normally do and see if you spot any problems.
  • Look at all of the front end views and record any problems
  • Look at all the back end views and report any problems
  • See more ideas below

What to look for

  • Any error messages that say things like Fatal Error or Strict or similar things that indicate that something is not working correctly.
  • Untranslated strings. You will know these because they look like this: ?STRING_HERE?
  • Problems of rendering--items not aligned correctly, missing or wrong images, pages that just don''t look right.
  • Unexpected behavior--anything that is working differently than it did in 2.5.

Report problems

If you find a problem please report it to the CMS Issue Tracker. You will need to register for a github.com account if you don''t have one.

More Testing Ideas

  • Pick one module or view and test all of the parameters.
  • Install an extension and see if anything breaks (report to the developer unless you are positive it is a core bug).
  • Turn on caching with different options
  • Try different session options
  • Install a language and test all the layouts.
  • Try different environments (like different servers which may have different version of PHP) or try you have IIS with MySQLi or SqlSrv. With millions of users Joomla needs to be ready for unusual environments.
  • Try with SEF URLS on or off and also with Apache rewrite on or off (if you are on Apache).
  • Try different combinations of browsers (Chrome, IE, FireFox, Opera to start) and operating systems (Mac, Windows, Linux).
  • Yes grammar and spelling errors are bugs too -- just keep in mind that we use British spelling.
  • Visit the Feature Tracker and test a new feature.

Testing changes

You can also help Joomla by testing bug fixes and new features. A useful tool is the patchtester component which helps to simplify and automate the process. Report your feedback on the CMS Issue Tracker. If you enjoy helping Joomla this way, you may want to join the Joomla Bug Squad.

', 1, '', 0, 1, '{"show_title":"","link_titles":"","show_tags":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","urls_position":"","alternative_readmore":"","article_layout":""}', 1, '{"robots":"","author":"","rights":"","xreference":""}', 716, '', '2011-01-01 00:00:01', 0, '2013-10-15 14:57:20', '*', '2011-01-01 00:00:01', '0000-00-00 00:00:00', 24, 180, '{"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}', '{"urla":false,"urlatext":"","targeta":"","urlb":false,"urlbtext":"","targetb":"","urlc":false,"urlctext":"","targetc":""}', 59, 3, 2, '', '', 19, '', 1), (3, 'com_content.article', 'Similar Tags', 'similar-tags', '

The similar tags modules shows a list of items which have the same or a similar set of tags.

{loadmodule tags_similar,Similar Tags}

', 1, '', 0, 1, '{"show_title":"","link_titles":"","show_tags":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","urls_position":"","alternative_readmore":"","article_layout":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}', 0, '{"robots":"","author":"","rights":"","xreference":""}', 371, '', '2013-10-31 00:14:17', 371, '2013-10-31 00:39:09', '*', '2013-10-31 00:14:17', '0000-00-00 00:00:00', 71, 179, '{"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}', '{"urla":false,"urlatext":"","targeta":"","urlb":false,"urlbtext":"","targetb":"","urlc":false,"urlctext":"","targetc":""}', 3, 4, 0, '', '', 64, '', 1); -UPDATE `#__extensions` SET `params`='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"1","useractivation":"1","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; +UPDATE `#__extensions` SET `params`='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"0","useractivation":"1","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; SET FOREIGN_KEY_CHECKS=1; diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 039be5f5edcb2..42f10d6b6d255 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -524,7 +524,7 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem (22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (24, 0, 'com_redirect', 'component', 'com_redirect', '', 1, 1, 0, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), -(25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"1","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"0","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (27, 0, 'com_finder', 'component', 'com_finder', '', 1, 1, 0, 0, '', '{"enabled":"0","show_description":"1","description_length":255,"allow_empty_query":"0","show_url":"1","show_autosuggest":"1","show_suggested_query":"1","show_explained_query":"1","show_advanced":"1","show_advanced_tips":"1","expand_advanced":"0","show_date_filters":"0","sort_order":"relevance","sort_direction":"desc","highlight_terms":"1","opensearch_name":"","opensearch_description":"","batch_size":"50","memory_table_limit":30000,"title_multiplier":"1.7","text_multiplier":"0.7","meta_multiplier":"1.2","path_multiplier":"2.0","misc_multiplier":"0.3","stem":"1","stemmer":"snowball","enable_logging":"0"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (28, 0, 'com_joomlaupdate', 'component', 'com_joomlaupdate', '', 1, 1, 0, 1, '', '{"updatesource":"default","customurl":""}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (29, 0, 'com_tags', 'component', 'com_tags', '', 1, 1, 1, 1, '', '{"tag_layout":"_:default","save_history":"1","history_limit":5,"show_tag_title":"0","tag_list_show_tag_image":"0","tag_list_show_tag_description":"0","tag_list_image":"","tag_list_orderby":"title","tag_list_orderby_direction":"ASC","show_headings":"0","tag_list_show_date":"0","tag_list_show_item_image":"0","tag_list_show_item_description":"0","tag_list_item_maximum_characters":0,"return_any_or_all":"1","include_children":"0","maximum":200,"tag_list_language_filter":"all","tags_layout":"_:default","all_tags_orderby":"title","all_tags_orderby_direction":"ASC","all_tags_show_tag_image":"0","all_tags_show_tag_descripion":"0","all_tags_tag_maximum_characters":20,"all_tags_show_tag_hits":"0","filter_field":"1","show_pagination_limit":"1","show_pagination":"2","show_pagination_results":"1","tag_field_ajax_mode":"1","show_feed_link":"1"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), diff --git a/installation/sql/postgresql/sample_learn.sql b/installation/sql/postgresql/sample_learn.sql index 6e213f0e6aa99..4e600e3afa561 100644 --- a/installation/sql/postgresql/sample_learn.sql +++ b/installation/sql/postgresql/sample_learn.sql @@ -847,4 +847,4 @@ INSERT INTO "#__viewlevels" ("id", "title", "ordering", "rules") VALUES SELECT setval('#__viewlevels_id_seq', max(id)) FROM "#__viewlevels"; -UPDATE "#__extensions" SET "params"='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"1","useractivation":"2","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; +UPDATE "#__extensions" SET "params"='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"0","useractivation":"2","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; diff --git a/installation/sql/postgresql/sample_testing.sql b/installation/sql/postgresql/sample_testing.sql index 10b76245657a0..9e5f1e03443b4 100644 --- a/installation/sql/postgresql/sample_testing.sql +++ b/installation/sql/postgresql/sample_testing.sql @@ -889,4 +889,4 @@ INSERT INTO "#__ucm_content" ("core_content_id", "core_type_alias", "core_title" SELECT setval('#__ucm_content_core_content_id_seq', max(core_content_id)) FROM "#__ucm_content"; -UPDATE "#__extensions" SET "params"='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"1","useractivation":"1","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; +UPDATE "#__extensions" SET "params"='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"0","useractivation":"1","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; diff --git a/installation/sql/sqlazure/joomla.sql b/installation/sql/sqlazure/joomla.sql index 3481e0aefac89..0bc5b3c0db071 100644 --- a/installation/sql/sqlazure/joomla.sql +++ b/installation/sql/sqlazure/joomla.sql @@ -739,7 +739,7 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem (22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (24, 0, 'com_redirect', 'component', 'com_redirect', '', 1, 1, 0, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0), -(25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"1","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '1900-01-01 00:00:00', 0, 0), +(25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"0","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (27, 0, 'com_finder', 'component', 'com_finder', '', 1, 1, 0, 0, '', '{"enabled":"0","show_description":"1","description_length":255,"allow_empty_query":"0","show_url":"1","show_autosuggest":"1","show_suggested_query":"1","show_explained_query":"1","show_advanced":"1","show_advanced_tips":"1","expand_advanced":"0","show_date_filters":"0","sort_order":"relevance","sort_direction":"desc","highlight_terms":"1","opensearch_name":"","opensearch_description":"","batch_size":"50","memory_table_limit":30000,"title_multiplier":"1.7","text_multiplier":"0.7","meta_multiplier":"1.2","path_multiplier":"2.0","misc_multiplier":"0.3","stem":"1","stemmer":"snowball","enable_logging":"0"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (28, 0, 'com_joomlaupdate', 'component', 'com_joomlaupdate', '', 1, 1, 0, 1, '', '{"updatesource":"default","customurl":""}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (29, 0, 'com_tags', 'component', 'com_tags', '', 1, 1, 1, 1, '', '{"tag_layout":"_:default","save_history":"1","history_limit":5,"show_tag_title":"0","tag_list_show_tag_image":"0","tag_list_show_tag_description":"0","tag_list_image":"","tag_list_orderby":"title","tag_list_orderby_direction":"ASC","show_headings":"0","tag_list_show_date":"0","tag_list_show_item_image":"0","tag_list_show_item_description":"0","tag_list_item_maximum_characters":0,"return_any_or_all":"1","include_children":"0","maximum":200,"tag_list_language_filter":"all","tags_layout":"_:default","all_tags_orderby":"title","all_tags_orderby_direction":"ASC","all_tags_show_tag_image":"0","all_tags_show_tag_descripion":"0","all_tags_tag_maximum_characters":20,"all_tags_show_tag_hits":"0","filter_field":"1","show_pagination_limit":"1","show_pagination":"2","show_pagination_results":"1","tag_field_ajax_mode":"1","show_feed_link":"1"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), diff --git a/installation/sql/sqlazure/sample_learn.sql b/installation/sql/sqlazure/sample_learn.sql index 8de6b8b26a3b3..0cef0e24cbea0 100644 --- a/installation/sql/sqlazure/sample_learn.sql +++ b/installation/sql/sqlazure/sample_learn.sql @@ -873,4 +873,4 @@ INSERT INTO "#__viewlevels" ("id", "title", "ordering", "rules") VALUES SET IDENTITY_INSERT "#__viewlevels" OFF; -UPDATE "#__extensions" SET "params"='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"1","useractivation":"2","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; +UPDATE "#__extensions" SET "params"='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"0","useractivation":"2","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; diff --git a/installation/sql/sqlazure/sample_testing.sql b/installation/sql/sqlazure/sample_testing.sql index cc13c6f0f76fe..0c294984a988c 100644 --- a/installation/sql/sqlazure/sample_testing.sql +++ b/installation/sql/sqlazure/sample_testing.sql @@ -916,4 +916,4 @@ INSERT INTO "#__ucm_content" ("core_content_id", "core_type_alias", "core_title" SET IDENTITY_INSERT "#__ucm_content" OFF; -UPDATE "#__extensions" SET "params"='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"1","useractivation":"1","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; +UPDATE "#__extensions" SET "params"='{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"0","useractivation":"1","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":"","save_history":"1","history_limit":5}' WHERE extension_id=25; diff --git a/tests/unit/stubs/database/jos_extensions.csv b/tests/unit/stubs/database/jos_extensions.csv index dfec183461433..716024b2fbb4d 100644 --- a/tests/unit/stubs/database/jos_extensions.csv +++ b/tests/unit/stubs/database/jos_extensions.csv @@ -23,7 +23,7 @@ '22','com_content','component','com_content',,'1','1','0','1','{"name":"com_content","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_CONTENT_XML_DESCRIPTION","group":""}','{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}',,,'0','0000-00-00 00:00:00','0','0' '23','com_config','component','com_config',,'1','1','0','1','{"name":"com_config","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_CONFIG_XML_DESCRIPTION","group":""}','{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}',,,'0','0000-00-00 00:00:00','0','0' '24','com_redirect','component','com_redirect',,'1','1','0','1','{"name":"com_redirect","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_REDIRECT_XML_DESCRIPTION","group":""}','{}',,,'0','0000-00-00 00:00:00','0','0' -'25','com_users','component','com_users',,'1','1','0','1','{"name":"com_users","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_USERS_XML_DESCRIPTION","group":""}','{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"1","useractivation":"1","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":""}',,,'0','0000-00-00 00:00:00','0','0' +'25','com_users','component','com_users',,'1','1','0','1','{"name":"com_users","type":"component","creationDate":"April 2006","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_USERS_XML_DESCRIPTION","group":""}','{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"13","sendpassword":"0","useractivation":"1","mail_to_admin":"0","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","mailSubjectPrefix":"","mailBodySuffix":""}',,,'0','0000-00-00 00:00:00','0','0' '27','com_finder','component','com_finder',,'1','1','0','0','{"name":"com_finder","type":"component","creationDate":"August 2011","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_FINDER_XML_DESCRIPTION","group":""}','{"show_description":"1","description_length":255,"allow_empty_query":"0","show_url":"1","show_advanced":"1","expand_advanced":"0","show_date_filters":"0","highlight_terms":"1","opensearch_name":"","opensearch_description":"","batch_size":"50","memory_table_limit":30000,"title_multiplier":"1.7","text_multiplier":"0.7","meta_multiplier":"1.2","path_multiplier":"2.0","misc_multiplier":"0.3","stemmer":"snowball"}',,,'0','0000-00-00 00:00:00','0','0' '28','com_joomlaupdate','component','com_joomlaupdate',,'1','1','0','1','{"name":"com_joomlaupdate","type":"component","creationDate":"February 2012","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.\\t","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.0.0","description":"COM_JOOMLAUPDATE_XML_DESCRIPTION","group":""}','{}',,,'0','0000-00-00 00:00:00','0','0' '29','com_tags','component','com_tags',,'1','1','1','1','{"name":"com_tags","type":"component","creationDate":"December 2013","author":"Joomla! Project","copyright":"(C) 2005 - 2018 Open Source Matters. All rights reserved.","authorEmail":"admin@joomla.org","authorUrl":"www.joomla.org","version":"3.1.0","description":"COM_TAGS_XML_DESCRIPTION","group":""}','{"show_tag_title":"0","tag_list_show_tag_image":"0","tag_list_show_tag_description":"0","tag_list_image":"","tag_list_orderby":"title","tag_list_orderby_direction":"ASC","show_headings":"0","tag_list_show_date":"0","tag_list_show_item_image":"0","tag_list_show_item_description":"0","tag_list_item_maximum_characters":0,"return_any_or_all":"1","include_children":"0","maximum":200,"tag_list_language_filter":"all","tags_layout":"_:default","all_tags_orderby":"title","all_tags_orderby_direction":"ASC","all_tags_show_tag_image":"0","all_tags_show_tag_descripion":"0","all_tags_tag_maximum_characters":20,"all_tags_show_tag_hits":"0","filter_field":"1","show_pagination_limit":"1","show_pagination":"2","show_pagination_results":"1","tag_field_ajax_mode":"1","show_feed_link":"1"}',,,'0','0000-00-00 00:00:00','0','0' From 0042b1a9e3d7b4acd6d0495fc21f1724213e9e48 Mon Sep 17 00:00:00 2001 From: Igor Berdichevskiy Date: Sat, 5 May 2018 23:19:44 +0300 Subject: [PATCH 12/36] Optimization and fix of multilingual associations and add layouts to com_content links (#20229) * Revert #19681 * Revert #19683 * Remove addition query and check after #19314 * Add layout to com_content links * Add layout to com_content article associations * Add layout to category associations * add advanced where clause param * add advanced where clause for com_content article associations * drone code formatting fix * drone code formatting fix * drone code formatting fix * Line exceeds 150 characters * PHPCS rules * Remove parenthesis * Change queryKey * Fix typo * Improve description --- .../com_categories/helpers/association.php | 9 +- .../com_content/helpers/association.php | 102 +++++++++--------- components/com_content/helpers/route.php | 34 +++--- libraries/src/Language/Associations.php | 17 ++- 4 files changed, 86 insertions(+), 76 deletions(-) diff --git a/administrator/components/com_categories/helpers/association.php b/administrator/components/com_categories/helpers/association.php index 67196ee95aa25..66ac7413e7eff 100644 --- a/administrator/components/com_categories/helpers/association.php +++ b/administrator/components/com_categories/helpers/association.php @@ -25,12 +25,13 @@ abstract class CategoryHelperAssociation * * @param integer $id Id of the item * @param string $extension Name of the component + * @param string $layout Category layout * * @return array Array of associations for the component categories * * @since 3.0 */ - public static function getCategoryAssociations($id = 0, $extension = 'com_content') + public static function getCategoryAssociations($id = 0, $extension = 'com_content', $layout = null) { $return = array(); @@ -46,11 +47,13 @@ public static function getCategoryAssociations($id = 0, $extension = 'com_conten { if (class_exists($helperClassname) && is_callable(array($helperClassname, 'getCategoryRoute'))) { - $return[$tag] = $helperClassname::getCategoryRoute($item, $tag); + $return[$tag] = $helperClassname::getCategoryRoute($item, $tag, $layout); } else { - $return[$tag] = 'index.php?option=' . $extension . '&view=category&id=' . $item; + $viewLayout = $layout ? '&layout=' . $layout : ''; + + $return[$tag] = 'index.php?option=' . $extension . '&view=category&id=' . $item . $viewLayout; } } } diff --git a/components/com_content/helpers/association.php b/components/com_content/helpers/association.php index f823bacea2f1c..e6df33f272b7c 100644 --- a/components/com_content/helpers/association.php +++ b/components/com_content/helpers/association.php @@ -20,81 +20,75 @@ */ abstract class ContentHelperAssociation extends CategoryHelperAssociation { - /** - * Cached array of the content item id. - * - * @var array - * @since __DEPLOY_VERSION__ - */ - protected static $filters = array(); - /** * Method to get the associations for a given item * - * @param integer $id Id of the item - * @param string $view Name of the view + * @param integer $id Id of the item + * @param string $view Name of the view + * @param string $layout View layout * * @return array Array of associations for the item * * @since 3.0 */ - public static function getAssociations($id = 0, $view = null) + public static function getAssociations($id = 0, $view = null, $layout = null) { - $jinput = JFactory::getApplication()->input; - $view = $view === null ? $jinput->get('view') : $view; - $id = empty($id) ? $jinput->getInt('id') : $id; - $user = JFactory::getUser(); - $groups = implode(',', $user->getAuthorisedViewLevels()); + $jinput = JFactory::getApplication()->input; + $view = $view === null ? $jinput->get('view') : $view; + $component = $jinput->getCmd('option'); + $id = empty($id) ? $jinput->getInt('id') : $id; + + if ($layout === null && $jinput->get('view') == $view && $component == 'com_content') + { + $layout = $jinput->get('layout', '', 'string'); + } if ($view === 'article') { if ($id) { - if (!isset(static::$filters[$id])) + $user = JFactory::getUser(); + $groups = implode(',', $user->getAuthorisedViewLevels()); + $db = JFactory::getDbo(); + $advClause = array(); + + // Filter by user groups + $advClause[] = 'c2.access IN (' . $groups . ')'; + + // Filter by current language + $advClause[] = 'c2.language != ' . $db->quote(JFactory::getLanguage()->getTag()); + + if (!$user->authorise('core.edit.state', 'com_content') && !$user->authorise('core.edit', 'com_content')) + { + // Filter by start and end dates. + $nullDate = $db->quote($db->getNullDate()); + $date = JFactory::getDate(); + + $nowDate = $db->quote($date->toSql()); + + $advClause[] = '(c2.publish_up = ' . $nullDate . ' OR c2.publish_up <= ' . $nowDate . ')'; + $advClause[] = '(c2.publish_down = ' . $nullDate . ' OR c2.publish_down >= ' . $nowDate . ')'; + + // Filter by published + $advClause[] = 'c2.state = 1'; + } + + $associations = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $id, 'id', 'alias', 'catid', $advClause); + + $return = array(); + + foreach ($associations as $tag => $item) { - $associations = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $id); - - $return = array(); - - foreach ($associations as $tag => $item) - { - if ($item->language != JFactory::getLanguage()->getTag()) - { - $arrId = explode(':', $item->id); - $assocId = $arrId[0]; - - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select($db->qn('state')) - ->from($db->qn('#__content')) - ->where($db->qn('id') . ' = ' . (int) $assocId) - ->where($db->qn('access') . ' IN (' . $groups . ')'); - $db->setQuery($query); - - $result = (int) $db->loadResult(); - - if ($result > 0) - { - $return[$tag] = ContentHelperRoute::getArticleRoute($item->id, (int) $item->catid, $item->language); - } - } - - static::$filters[$id] = $return; - } - - if (count($associations) === 0) - { - static::$filters[$id] = array(); - } + $return[$tag] = ContentHelperRoute::getArticleRoute($item->id, (int) $item->catid, $item->language, $layout); } - return static::$filters[$id]; + return $return; } } if ($view === 'category' || $view === 'categories') { - return self::getCategoryAssociations($id, 'com_content'); + return self::getCategoryAssociations($id, 'com_content', $layout); } return array(); @@ -105,7 +99,7 @@ public static function getAssociations($id = 0, $view = null) * * @param integer $id Id of the article * - * @return array An array containing the association URL and the related language object + * @return array An array containing the association URL and the related language object * * @since 3.7.0 */ diff --git a/components/com_content/helpers/route.php b/components/com_content/helpers/route.php index 822d59dc54634..2a12b2c0fdc43 100644 --- a/components/com_content/helpers/route.php +++ b/components/com_content/helpers/route.php @@ -22,12 +22,13 @@ abstract class ContentHelperRoute * @param integer $id The route of the content item. * @param integer $catid The category ID. * @param integer $language The language code. + * @param string $layout The layout value. * * @return string The article route. * * @since 1.5 */ - public static function getArticleRoute($id, $catid = 0, $language = 0) + public static function getArticleRoute($id, $catid = 0, $language = 0, $layout = null) { // Create the link $link = 'index.php?option=com_content&view=article&id=' . $id; @@ -42,6 +43,11 @@ public static function getArticleRoute($id, $catid = 0, $language = 0) $link .= '&lang=' . $language; } + if ($layout) + { + $link .= '&layout=' . $layout; + } + return $link; } @@ -50,12 +56,13 @@ public static function getArticleRoute($id, $catid = 0, $language = 0) * * @param integer $catid The category ID. * @param integer $language The language code. + * @param string $layout The layout value. * * @return string The article route. * * @since 1.5 */ - public static function getCategoryRoute($catid, $language = 0) + public static function getCategoryRoute($catid, $language = 0, $layout = null) { if ($catid instanceof JCategoryNode) { @@ -68,24 +75,19 @@ public static function getCategoryRoute($catid, $language = 0) if ($id < 1) { - $link = ''; + return ''; } - else - { - $link = 'index.php?option=com_content&view=category&id=' . $id; - if ($language && $language !== '*' && JLanguageMultilang::isEnabled()) - { - $link .= '&lang=' . $language; - } + $link = 'index.php?option=com_content&view=category&id=' . $id; - $jinput = JFactory::getApplication()->input; - $layout = $jinput->get('layout'); + if ($language && $language !== '*' && JLanguageMultilang::isEnabled()) + { + $link .= '&lang=' . $language; + } - if ($layout !== '') - { - $link .= '&layout=' . $layout; - } + if ($layout) + { + $link .= '&layout=' . $layout; } return $link; diff --git a/libraries/src/Language/Associations.php b/libraries/src/Language/Associations.php index 1aacc695dfb78..50e06657873df 100644 --- a/libraries/src/Language/Associations.php +++ b/libraries/src/Language/Associations.php @@ -29,20 +29,22 @@ class Associations * @param string $pk The name of the primary key in the given $table. * @param string $aliasField If the table has an alias field set it here. Null to not use it * @param string $catField If the table has a catid field set it here. Null to not use it + * @param array $advClause Additional advanced 'where' clause; use c as parent column key, c2 as associations column key * - * @return array The associated items + * @return array The associated items * * @since 3.1 * * @throws \Exception */ - public static function getAssociations($extension, $tablename, $context, $id, $pk = 'id', $aliasField = 'alias', $catField = 'catid') + public static function getAssociations($extension, $tablename, $context, $id, $pk = 'id', $aliasField = 'alias', $catField = 'catid', + $advClause = array()) { // To avoid doing duplicate database queries. static $multilanguageAssociations = array(); // Multilanguage association array key. If the key is already in the array we don't need to run the query again, just return it. - $queryKey = implode('|', func_get_args()); + $queryKey = md5(serialize(array_merge(array($extension, $tablename, $context, $id), $advClause))); if (!isset($multilanguageAssociations[$queryKey])) { @@ -97,6 +99,15 @@ public static function getAssociations($extension, $tablename, $context, $id, $p $query->where('c.extension = ' . $db->quote($extension)); } + // Advanced where clause + if (!empty($advClause)) + { + foreach ($advClause as $clause) + { + $query->where($clause); + } + } + $db->setQuery($query); try From adb7651f39239e9d47f6d37e39a07f0cc0762324 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sun, 6 May 2018 10:28:38 -0500 Subject: [PATCH 13/36] Add checksum generation to the build script --- build/build.php | 89 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 80 insertions(+), 9 deletions(-) diff --git a/build/build.php b/build/build.php index 82ce332d76bd4..6512457cdd2a7 100644 --- a/build/build.php +++ b/build/build.php @@ -188,6 +188,18 @@ function usage($command) 'images', ); +/* + * This array will contain the checksums for all files which are created by this script. + * This is an associative array with the following structure: + * array( + * 'filename' => array( + * 'type1' => 'hash', + * 'type2' => 'hash', + * ), + * ) + */ +$checksums = array(); + // For the packages, replace spaces in stability (RC) with underscores $packageStability = str_replace(' ', '_', Version::DEV_STATUS); @@ -272,19 +284,25 @@ function usage($command) // Create the diff archive packages using the file name list. if (!$excludeBzip2) { - system('tar --create --bzip2 --no-recursion --directory ' . $time . ' --file packages' . $version . '/Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.tar.bz2 --files-from diffconvert/' . $version . '.' . $num . '> /dev/null'); + $packageName = 'Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.tar.bz2'; + system('tar --create --bzip2 --no-recursion --directory ' . $time . ' --file packages' . $version . '/' . $packageName . ' --files-from diffconvert/' . $version . '.' . $num . '> /dev/null'); + $checksums[$packageName] = array(); } if (!$excludeGzip) { - system('tar --create --gzip --no-recursion --directory ' . $time . ' --file packages' . $version . '/Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.tar.gz --files-from diffconvert/' . $version . '.' . $num . '> /dev/null'); + $packageName = 'Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.tar.gz'; + system('tar --create --gzip --no-recursion --directory ' . $time . ' --file packages' . $version . '/' . $packageName . ' --files-from diffconvert/' . $version . '.' . $num . '> /dev/null'); + $checksums[$packageName] = array(); } if (!$excludeZip) { + $packageName = 'Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.zip'; chdir($time); - system('zip ../packages' . $version . '/Joomla_' . $version . '.' . $fromName . '_to_' . $fullVersion . '-' . $packageStability . '-Patch_Package.zip -@ < ../diffconvert/' . $version . '.' . $num . '> /dev/null'); + system('zip ../packages' . $version . '/' . $packageName . ' -@ < ../diffconvert/' . $version . '.' . $num . '> /dev/null'); chdir('..'); + $checksums[$packageName] = array(); } } @@ -307,17 +325,23 @@ function usage($command) // Create full archive packages. if (!$excludeBzip2) { - system('tar --create --bzip2 --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.tar.bz2 * > /dev/null'); + $packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.tar.bz2'; + system('tar --create --bzip2 --file ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null'); + $checksums[$packageName] = array(); } if (!$excludeGzip) { - system('tar --create --gzip --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.tar.gz * > /dev/null'); + $packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.tar.gz'; + system('tar --create --gzip --file ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null'); + $checksums[$packageName] = array(); } if (!$excludeZip) { - system('zip -r ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.zip * > /dev/null'); + $packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Full_Package.zip'; + system('zip -r ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null'); + $checksums[$packageName] = array(); } // Create full update file without the default logs directory, installation folder, or sample images. @@ -335,17 +359,64 @@ function usage($command) if (!$excludeBzip2) { - system('tar --create --bzip2 --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.tar.bz2 * > /dev/null'); + $packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.tar.bz2'; + system('tar --create --bzip2 --file ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null'); + $checksums[$packageName] = array(); } if (!$excludeGzip) { - system('tar --create --gzip --file ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.tar.gz * > /dev/null'); + $packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.tar.gz'; + system('tar --create --gzip --file ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null'); + $checksums[$packageName] = array(); } if (!$excludeZip) { - system('zip -r ../packages_full' . $fullVersion . '/Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.zip * > /dev/null'); + $packageName = 'Joomla_' . $fullVersion . '-' . $packageStability . '-Update_Package.zip'; + system('zip -r ../packages_full' . $fullVersion . '/' . $packageName . ' * > /dev/null'); + $checksums[$packageName] = array(); +} + +chdir('..'); + +foreach (array_keys($checksums) as $packageName) +{ + echo "Generating checksums for $packageName\n"; + + foreach (array('md5', 'sha1') as $hash) + { + if (file_exists('packages' . $version . '/' . $packageName)) + { + $checksums[$packageName][$hash] = hash_file($hash, 'packages' . $version . '/' . $packageName); + } + elseif (file_exists('packages_full' . $fullVersion . '/' . $packageName)) + { + $checksums[$packageName][$hash] = hash_file($hash, 'packages_full' . $fullVersion . '/' . $packageName); + } + else + { + echo "Package $packageName not found in build directories\n"; + } + } +} + +echo "Generating checksums.txt file\n"; + +$checksumsContent = ''; + +foreach ($checksums as $packageName => $packageHashes) +{ + $checksumsContent .= "Filename: $packageName\n"; + + foreach ($packageHashes as $hashType => $hash) + { + $checksumsContent .= "$hashType: $hash\n"; + } + + $checksumsContent .= "\n"; } +file_put_contents('checksums.txt', $checksumsContent); + echo "Build of version $fullVersion complete!\n"; From d86351c2cd8ba5df37167eee23f54cea97f017d5 Mon Sep 17 00:00:00 2001 From: Quy Date: Wed, 9 May 2018 17:50:15 -0700 Subject: [PATCH 14/36] Hide Enabled/Disabled users column headers and be a11y compliant (#20279) --- .../components/com_users/views/groups/tmpl/default.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/administrator/components/com_users/views/groups/tmpl/default.php b/administrator/components/com_users/views/groups/tmpl/default.php index 09f7d64fe20b5..b7c83ccec09e9 100644 --- a/administrator/components/com_users/views/groups/tmpl/default.php +++ b/administrator/components/com_users/views/groups/tmpl/default.php @@ -68,12 +68,14 @@ - - + - - + From 8d9c2301be09665277cda9287a506a9bb2ef5c7a Mon Sep 17 00:00:00 2001 From: Elijah Madden Date: Thu, 10 May 2018 09:51:32 +0900 Subject: [PATCH 15/36] Code mirror autofocus issue (#20270) * Pass the autofocus param to the plugin. While we're at it, pretty up this function a little. * Get autofocus from $params, not $this->params. Also, make sure we only autofocus one CodeMirror per page. * We won't be needing these things anymore. * Keep the unused strings. --- .../en-GB/en-GB.plg_editors_codemirror.ini | 1 + libraries/src/Form/Field/EditorField.php | 20 +++++++++++++++---- plugins/editors/codemirror/codemirror.php | 9 ++++++++- plugins/editors/codemirror/codemirror.xml | 13 ------------ 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini b/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini index 37b69e57b2071..fa71ce7874b0c 100644 --- a/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini +++ b/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini @@ -11,6 +11,7 @@ PLG_CODEMIRROR_FIELD_AUTOCLOSEBRACKET_DESC="Automatic bracket completion." PLG_CODEMIRROR_FIELD_AUTOCLOSEBRACKET_LABEL="Bracket Completion" PLG_CODEMIRROR_FIELD_AUTOCLOSETAGS_DESC="Automatic tag completion." PLG_CODEMIRROR_FIELD_AUTOCLOSETAGS_LABEL="Tag Completion" +; The following two strings are deprecated and will be removed in J4 PLG_CODEMIRROR_FIELD_AUTOFOCUS_DESC="Auto focus." PLG_CODEMIRROR_FIELD_AUTOFOCUS_LABEL="Auto Focus" PLG_CODEMIRROR_FIELD_CODEFOLDING_DESC="Allow blocks of code to be folded." diff --git a/libraries/src/Form/Field/EditorField.php b/libraries/src/Form/Field/EditorField.php index 2def265d7493b..762e77a82be74 100644 --- a/libraries/src/Form/Field/EditorField.php +++ b/libraries/src/Form/Field/EditorField.php @@ -246,12 +246,24 @@ protected function getInput() { // Get an editor object. $editor = $this->getEditor(); - $readonly = $this->readonly || $this->disabled; + $params = array( + 'autofocus' => $this->autofocus, + 'readonly' => $this->readonly || $this->disabled, + 'syntax' => (string) $this->element['syntax'], + ); return $editor->display( - $this->name, htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8'), $this->width, $this->height, $this->columns, $this->rows, - $this->buttons ? (is_array($this->buttons) ? array_merge($this->buttons, $this->hide) : $this->hide) : false, $this->id, $this->asset, - $this->form->getValue($this->authorField), array('syntax' => (string) $this->element['syntax'], 'readonly' => $readonly) + $this->name, + htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8'), + $this->width, + $this->height, + $this->columns, + $this->rows, + $this->buttons ? (is_array($this->buttons) ? array_merge($this->buttons, $this->hide) : $this->hide) : false, + $this->id, + $this->asset, + $this->form->getValue($this->authorField), + $params ); } diff --git a/plugins/editors/codemirror/codemirror.php b/plugins/editors/codemirror/codemirror.php index 3f71e6b25b0a3..2cb2226b50590 100644 --- a/plugins/editors/codemirror/codemirror.php +++ b/plugins/editors/codemirror/codemirror.php @@ -179,6 +179,9 @@ public function onGetInsertMethod() public function onDisplay( $name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null, $params = array()) { + // True if a CodeMirror already has autofocus. Prevent multiple autofocuses. + static $autofocused; + $id = empty($id) ? $name : $id; // Must pass the field id to the buttons in this editor. @@ -198,7 +201,11 @@ public function onDisplay( } // Should we focus on the editor on load? - $options->autofocus = (boolean) $this->params->get('autoFocus', true); + if (!$autofocused) + { + $options->autofocus = isset($params['autofocus']) ? (bool) $params['autofocus'] : false; + $autofocused = $options->autofocus; + } // Until there's a fix for the overflow problem, always wrap lines. $options->lineWrapping = true; diff --git a/plugins/editors/codemirror/codemirror.xml b/plugins/editors/codemirror/codemirror.xml index 8b8de9a44cd52..ae7865f3d5921 100644 --- a/plugins/editors/codemirror/codemirror.xml +++ b/plugins/editors/codemirror/codemirror.xml @@ -155,19 +155,6 @@ - - - - - Date: Thu, 10 May 2018 02:54:15 +0200 Subject: [PATCH 16/36] Add a deprecated flag in database query for a few union/unionAll/unionDistinct (#20219) --- libraries/joomla/database/query.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/libraries/joomla/database/query.php b/libraries/joomla/database/query.php index 8b526ce029ea2..097e505a9f098 100644 --- a/libraries/joomla/database/query.php +++ b/libraries/joomla/database/query.php @@ -147,12 +147,14 @@ abstract class JDatabaseQuery /** * @var JDatabaseQueryElement The union element. * @since 12.1 + * @deprecated 4.0 Will be transformed and moved to $merge variable. */ protected $union = null; /** * @var JDatabaseQueryElement The unionAll element. * @since 13.1 + * @deprecated 4.0 Will be transformed and moved to $merge variable. */ protected $unionAll = null; @@ -1497,8 +1499,11 @@ public function __clone() * Usage (the $query base query MUST be a select query): * $query->union('SELECT name FROM #__foo') * $query->union('SELECT name FROM #__foo', true) - * $query->union(array('SELECT name FROM #__foo','SELECT name FROM #__bar')) * $query->union($query2)->union($query3) + * + * The $query attribute as an array is deprecated and will not be supported in 4.0. + * + * $query->union(array('SELECT name FROM #__foo','SELECT name FROM #__bar')) * $query->union(array($query2, $query3)) * * @param mixed $query The JDatabaseQuery object or string to union. @@ -1525,6 +1530,11 @@ public function union($query, $distinct = false, $glue = '') $name = 'UNION ()'; } + if (is_array($query)) + { + JLog::add('Query attribute as an array is deprecated.', JLog::WARNING, 'deprecated'); + } + // Get the JDatabaseQueryElement if it does not exist if (is_null($this->union)) { @@ -1553,6 +1563,7 @@ public function union($query, $distinct = false, $glue = '') * @see union * * @since 12.1 + * @deprecated 4.0 Use union() instead. */ public function unionDistinct($query, $glue = '') { @@ -1776,6 +1787,9 @@ public function dateAdd($date, $interval, $datePart) * * Usage: * $query->union('SELECT name FROM #__foo') + * + * The $query attribute as an array is deprecated and will not be supported in 4.0. + * * $query->union(array('SELECT name FROM #__foo','SELECT name FROM #__bar')) * * @param mixed $query The JDatabaseQuery object or string to union. @@ -1793,6 +1807,11 @@ public function unionAll($query, $distinct = false, $glue = '') $glue = ')' . PHP_EOL . 'UNION ALL ('; $name = 'UNION ALL ()'; + if (is_array($query)) + { + JLog::add('Query attribute as an array is deprecated.', JLog::WARNING, 'deprecated'); + } + // Get the JDatabaseQueryElement if it does not exist if (is_null($this->unionAll)) { From b7cdd78ecc3210cef37fb819f4964e9d63d67208 Mon Sep 17 00:00:00 2001 From: Quy Date: Wed, 9 May 2018 17:54:26 -0700 Subject: [PATCH 17/36] Add showon attribute (#20156) --- administrator/components/com_media/config.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/administrator/components/com_media/config.xml b/administrator/components/com_media/config.xml index 294fe96f9f790..5e0ade0601fe4 100644 --- a/administrator/components/com_media/config.xml +++ b/administrator/components/com_media/config.xml @@ -67,6 +67,7 @@ description="COM_MEDIA_FIELD_CHECK_MIME_DESC" class="btn-group btn-group-yesno" default="1" + showon="restrict_uploads:1" > @@ -79,6 +80,7 @@ description="COM_MEDIA_FIELD_LEGAL_IMAGE_EXTENSIONS_DESC" size="50" default="bmp,gif,jpg,png" + showon="restrict_uploads:1" /> + showon="restrict_uploads:1" + />
Date: Wed, 9 May 2018 17:54:45 -0700 Subject: [PATCH 18/36] [com_contact] Display 0 value with custom field (#20124) * Display 0 value * Display 0 value --- components/com_contact/layouts/field/render.php | 2 +- components/com_contact/layouts/fields/render.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/com_contact/layouts/field/render.php b/components/com_contact/layouts/field/render.php index f309c6dc65df5..65baec530acfd 100644 --- a/components/com_contact/layouts/field/render.php +++ b/components/com_contact/layouts/field/render.php @@ -28,7 +28,7 @@ return; } -if (!$value) +if (!strlen($value)) { return; } diff --git a/components/com_contact/layouts/fields/render.php b/components/com_contact/layouts/fields/render.php index 841dc357c72cc..20255030b3016 100644 --- a/components/com_contact/layouts/fields/render.php +++ b/components/com_contact/layouts/fields/render.php @@ -62,7 +62,7 @@ foreach ($fields as $field) { // If the value is empty do nothing - if (empty($field->value) && !$isMail) + if (!strlen($field->value) && !$isMail) { continue; } From 49dce1535af5f52f6df72967793deb324b9983d5 Mon Sep 17 00:00:00 2001 From: Helios Ciancio Date: Thu, 10 May 2018 02:56:05 +0200 Subject: [PATCH 19/36] fix custom fields with tab format (#20023) --- .../views/contact/tmpl/default_user_custom_fields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/com_contact/views/contact/tmpl/default_user_custom_fields.php b/components/com_contact/views/contact/tmpl/default_user_custom_fields.php index f259ecb652249..eb7b4aa003fcc 100644 --- a/components/com_contact/views/contact/tmpl/default_user_custom_fields.php +++ b/components/com_contact/views/contact/tmpl/default_user_custom_fields.php @@ -35,7 +35,7 @@ - + ' . ($groupTitle ?: JText::_('COM_CONTACT_USER_FIELDS')) . ''; ?> From 581a23cb9f48e6645ff6b4c70d9fe09c6256e559 Mon Sep 17 00:00:00 2001 From: Elijah Madden Date: Thu, 10 May 2018 09:59:30 +0900 Subject: [PATCH 20/36] Show a sample editor on the CodeMirror plugin config page. (#17042) * Show a sample editor on the CodeMirror plugin config page. * Call it a 'Preview' * Reordered attributes as per the Joomla coding standards for xml --- .../en-GB/en-GB.plg_editors_codemirror.ini | 2 + plugins/editors/codemirror/codemirror.xml | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini b/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini index fa71ce7874b0c..cc18d89ec1219 100644 --- a/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini +++ b/administrator/language/en-GB/en-GB.plg_editors_codemirror.ini @@ -43,6 +43,8 @@ PLG_CODEMIRROR_FIELD_MATCHBRACKETS_DESC="Highlight matching brackets." PLG_CODEMIRROR_FIELD_MATCHBRACKETS_LABEL="Match Brackets" PLG_CODEMIRROR_FIELD_MATCHTAGS_DESC="Highlight matching tags." PLG_CODEMIRROR_FIELD_MATCHTAGS_LABEL="Match Tags" +PLG_CODEMIRROR_FIELD_PREVIEW_DESC="An example of what your CodeMirror editor fields will look like with the current settings (save to update)." +PLG_CODEMIRROR_FIELD_PREVIEW_LABEL="Preview" PLG_CODEMIRROR_FIELD_SELECTIONMATCHES_DESC="Highlight instances of the selected word throughout the document." PLG_CODEMIRROR_FIELD_SELECTIONMATCHES_LABEL="Highlight Selection Matches" PLG_CODEMIRROR_FIELD_THEME_DESC="Sets the colours for the editor." diff --git a/plugins/editors/codemirror/codemirror.xml b/plugins/editors/codemirror/codemirror.xml index ae7865f3d5921..9012124b1725c 100644 --- a/plugins/editors/codemirror/codemirror.xml +++ b/plugins/editors/codemirror/codemirror.xml @@ -308,6 +308,54 @@ + + + + + jQuery(function ($) { + $('.hello').html('Hello World'); + }); + + + + +
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam a ornare lectus, quis semper urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus interdum metus id elit rutrum sollicitudin. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam in fermentum risus, id facilisis nulla. Phasellus gravida erat sed ullamcorper accumsan. Donec blandit sem eget sem congue, a varius sapien semper.

+

Integer euismod tempor convallis. Nullam porttitor et ex ac fringilla. Quisque facilisis est ac erat condimentum malesuada. Aenean commodo quam odio, tincidunt ultricies mauris suscipit et.

+ +
    +
  • Vivamus ultrices ligula a odio lacinia pellentesque.
  • +
  • Curabitur iaculis arcu pharetra, mollis turpis id, commodo erat.
  • +
  • Etiam consequat enim quis faucibus interdum.
  • +
  • Morbi in ipsum pulvinar, eleifend lorem sit amet, euismod magna.
  • +
  • Donec consectetur lacus vitae eros euismod porta.
  • +
+
+]]> +
+
+
From 7ee41b1d323a5cc6595cf9ce93e3c78a583ff12b Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 12 May 2018 19:23:31 +0200 Subject: [PATCH 21/36] hiddenFieldsets & configFieldsets needs to be defined (#16856) * hiddenFieldsets & configFieldsets needs to be defined * use getter --- layouts/joomla/edit/params.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/layouts/joomla/edit/params.php b/layouts/joomla/edit/params.php index 041c01e29c059..d93b0864de0fc 100644 --- a/layouts/joomla/edit/params.php +++ b/layouts/joomla/edit/params.php @@ -23,17 +23,11 @@ $extraFields = $displayData->get('extra_fields') ?: array(); $tabName = $displayData->get('tab_name') ?: 'myTab'; -if (!empty($displayData->hiddenFieldsets)) -{ - // These are required to preserve data on save when fields are not displayed. - $hiddenFieldsets = $displayData->hiddenFieldsets ?: array(); -} +// These are required to preserve data on save when fields are not displayed. +$hiddenFieldsets = $displayData->get('hiddenFieldsets') ?: array(); -if (!empty($displayData->configFieldsets)) -{ - // These are required to configure showing and hiding fields in the editor. - $configFieldsets = $displayData->configFieldsets ?: array(); -} +// These are required to configure showing and hiding fields in the editor. +$configFieldsets = $displayData->get('configFieldsets') ?: array(); // Handle the hidden fieldsets when show_options is set false if (!$displayData->get('show_options', 1)) From f8e73449a03d952865a3fbb9da96b6aa1d44c9ff Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Sat, 12 May 2018 19:34:35 +0100 Subject: [PATCH 22/36] Fix subform repeat counter. (#19693) * Fix subform repeat counter. As normal rows should be zero indexed. When length === count === 0, first row should be 0. Note: PHP creates existing rows with zero index - so if min=1, you currently get row 0 on form load then row 2, 3 etc. as you add them. * Update unit tests * Additional test fixes. * Fix typo in comment. * Reminify subform-repeatable.js --- .../js/subform-repeatable-uncompressed.js | 9 ++++---- media/system/js/subform-repeatable.js | 3 +-- tests/javascript/subform-repeatable/spec.js | 22 +++++++++---------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/media/system/js/subform-repeatable-uncompressed.js b/media/system/js/subform-repeatable-uncompressed.js index 1db67997ba525..fb7d5dd0d8bfa 100644 --- a/media/system/js/subform-repeatable-uncompressed.js +++ b/media/system/js/subform-repeatable-uncompressed.js @@ -8,7 +8,7 @@ $.subformRepeatable = function(container, options){ this.$container = $(container); - // check if alredy exist + // check if already exist if(this.$container.data("subformRepeatable")){ return self; } @@ -144,14 +144,13 @@ // fix names ind id`s for field that in $row $.subformRepeatable.prototype.fixUniqueAttributes = function($row, count){ - this.lastRowNum++; var group = $row.attr('data-group'),// current group name basename = $row.attr('data-base-name'), // group base name, without count count = count || 0, - countnew = Math.max(this.lastRowNum, count + 1), - groupnew = basename + countnew; // new group name + countnew = Math.max(this.lastRowNum, count), + groupnew = basename + countnew; // new group name - this.lastRowNum = countnew; + this.lastRowNum = countnew + 1; $row.attr('data-group', groupnew); // Fix inputs that have a "name" attribute diff --git a/media/system/js/subform-repeatable.js b/media/system/js/subform-repeatable.js index 3890ea678c921..09bb5adc3f366 100644 --- a/media/system/js/subform-repeatable.js +++ b/media/system/js/subform-repeatable.js @@ -1,2 +1 @@ -!(function(e){"use strict";e.subformRepeatable=function(t,a){if(this.$container=e(t),this.$container.data("subformRepeatable"))return o;this.$container.data("subformRepeatable",o),this.options=e.extend({},e.subformRepeatable.defaults,a),this.template="",this.prepareTemplate(),this.$containerRows=this.options.rowsContainer?this.$container.find(this.options.rowsContainer):this.$container,this.lastRowNum=this.$containerRows.find(this.options.repeatableElement).length;var o=this;this.$container.on("click",this.options.btAdd,(function(t){t.preventDefault();var a=e(this).parents(o.options.repeatableElement);a.length||(a=null),o.addRow(a)})),this.$container.on("click",this.options.btRemove,(function(t){t.preventDefault();var a=e(this).parents(o.options.repeatableElement);o.removeRow(a)})),this.options.btMove&&this.$containerRows.sortable({items:this.options.repeatableElement,handle:this.options.btMove,tolerance:"pointer"}),this.$container.trigger("subform-ready")},e.subformRepeatable.prototype.prepareTemplate=function(){if(this.options.rowTemplateSelector){var t=this.$container.find(this.options.rowTemplateSelector)[0]||{};this.template=e.trim(t.text||t.textContent)}else{var a=this.$container.find(this.options.repeatableElement).get(0),o=e(a).clone();try{this.clearScripts(o)}catch(e){window.console&&console.log(e)}this.template=o.prop("outerHTML")}},e.subformRepeatable.prototype.addRow=function(t){var a=this.$containerRows.find(this.options.repeatableElement).length;if(a>=this.options.maximum)return null;var o=e.parseHTML(this.template);t?e(t).after(o):this.$containerRows.append(o);var r=e(o);r.attr("data-new","true"),this.fixUniqueAttributes(r,a);try{this.fixScripts(r)}catch(e){window.console&&console.log(e)}return this.$container.trigger("subform-row-add",r),r},e.subformRepeatable.prototype.removeRow=function(e){this.$containerRows.find(this.options.repeatableElement).length<=this.options.minimum||(this.$container.trigger("subform-row-remove",e),e.remove())},e.subformRepeatable.prototype.fixUniqueAttributes=function(t,a){this.lastRowNum++;var o=t.attr("data-group"),r=t.attr("data-base-name"),i=(a=a||0,Math.max(this.lastRowNum,a+1)),n=r+i;this.lastRowNum=i,t.attr("data-group",n);for(var s=t.find("[name]"),l={},p=0,f=s.length;p=this.options.maximum)return null;var a=w.parseHTML(this.template);e?w(e).after(a):this.$containerRows.append(a);var o=w(a);o.attr("data-new","true"),this.fixUniqueAttributes(o,t);try{this.fixScripts(o)}catch(e){window.console&&console.log(e)}return this.$container.trigger("subform-row-add",o),o},w.subformRepeatable.prototype.removeRow=function(e){this.$containerRows.find(this.options.repeatableElement).length<=this.options.minimum||(this.$container.trigger("subform-row-remove",e),e.remove())},w.subformRepeatable.prototype.fixUniqueAttributes=function(e,t){var a=e.attr("data-group"),o=e.attr("data-base-name"),r=(t=t||0,Math.max(this.lastRowNum,t)),i=o+r;this.lastRowNum=r+1,e.attr("data-group",i);for(var n=e.find("[name]"),s={},l=0,p=n.length;l Date: Sun, 13 May 2018 23:34:24 +0200 Subject: [PATCH 23/36] Fixing so that editors-xtd plugins works with com_ajax (#17939) * Fixing so that editors-xtd plugins works with com_ajax * Code formatting fix --- libraries/src/Plugin/PluginHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Plugin/PluginHelper.php b/libraries/src/Plugin/PluginHelper.php index 5059bcb7a5d31..48d4709ef5c83 100644 --- a/libraries/src/Plugin/PluginHelper.php +++ b/libraries/src/Plugin/PluginHelper.php @@ -257,7 +257,7 @@ protected static function import($plugin, $autocreate = true, \JEventDispatcher if ($autocreate) { - $className = 'Plg' . $plugin->type . $plugin->name; + $className = 'Plg' . str_replace('-', '', $plugin->type) . $plugin->name; if (class_exists($className)) { From 7f839e3746496cdcea3b217a3f229ce0d29c9c7e Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Wed, 16 May 2018 00:03:00 +0300 Subject: [PATCH 24/36] [Plugins] Add filters to manifest files. (#20410) --- plugins/authentication/gmail/gmail.xml | 3 +++ plugins/authentication/ldap/ldap.xml | 3 +++ plugins/content/emailcloak/emailcloak.xml | 1 + plugins/content/joomla/joomla.xml | 2 ++ plugins/content/pagebreak/pagebreak.xml | 5 ++++- plugins/content/pagenavigation/pagenavigation.xml | 3 +++ plugins/search/categories/categories.xml | 3 +++ plugins/search/contacts/contacts.xml | 3 +++ plugins/search/content/content.xml | 3 +++ plugins/search/newsfeeds/newsfeeds.xml | 3 +++ plugins/search/tags/tags.php | 2 +- plugins/search/tags/tags.xml | 2 ++ plugins/twofactorauth/totp/totp.xml | 1 + plugins/twofactorauth/yubikey/yubikey.xml | 1 + plugins/user/contactcreator/contactcreator.xml | 2 ++ 15 files changed, 35 insertions(+), 2 deletions(-) diff --git a/plugins/authentication/gmail/gmail.xml b/plugins/authentication/gmail/gmail.xml index 8fc5dbf49908e..46e78ad486090 100644 --- a/plugins/authentication/gmail/gmail.xml +++ b/plugins/authentication/gmail/gmail.xml @@ -25,6 +25,7 @@ label="PLG_GMAIL_FIELD_APPLYSUFFIX_LABEL" description="PLG_GMAIL_FIELD_APPLYSUFFIX_DESC" default="0" + filter="integer" > @@ -46,6 +47,7 @@ label="PLG_GMAIL_FIELD_VERIFYPEER_LABEL" description="PLG_GMAIL_FIELD_VERIFYPEER_DESC" default="1" + filter="integer" class="btn-group btn-group-yesno" > @@ -66,6 +68,7 @@ label="PLG_GMAIL_FIELD_BACKEND_LOGIN_LABEL" description="PLG_GMAIL_FIELD_BACKEND_LOGIN_DESC" default="0" + filter="integer" class="btn-group btn-group-yesno" > diff --git a/plugins/authentication/ldap/ldap.xml b/plugins/authentication/ldap/ldap.xml index facf4ed22aae8..32be857af52bb 100644 --- a/plugins/authentication/ldap/ldap.xml +++ b/plugins/authentication/ldap/ldap.xml @@ -47,6 +47,7 @@ label="PLG_LDAP_FIELD_V3_LABEL" description="PLG_LDAP_FIELD_V3_DESC" default="0" + filter="integer" class="btn-group btn-group-yesno" > @@ -59,6 +60,7 @@ label="PLG_LDAP_FIELD_NEGOCIATE_LABEL" description="PLG_LDAP_FIELD_NEGOCIATE_DESC" default="0" + filter="integer" class="btn-group btn-group-yesno" > @@ -71,6 +73,7 @@ label="PLG_LDAP_FIELD_REFERRALS_LABEL" description="PLG_LDAP_FIELD_REFERRALS_DESC" default="0" + filter="integer" class="btn-group btn-group-yesno" > diff --git a/plugins/content/emailcloak/emailcloak.xml b/plugins/content/emailcloak/emailcloak.xml index ac0ae63e27229..0e58e1dc3384d 100644 --- a/plugins/content/emailcloak/emailcloak.xml +++ b/plugins/content/emailcloak/emailcloak.xml @@ -25,6 +25,7 @@ label="PLG_CONTENT_EMAILCLOAK_MODE_LABEL" description="PLG_CONTENT_EMAILCLOAK_MODE_DESC" default="1" + filter="integer" > diff --git a/plugins/content/joomla/joomla.xml b/plugins/content/joomla/joomla.xml index f77f91a58a391..4e1ff78cca7a6 100644 --- a/plugins/content/joomla/joomla.xml +++ b/plugins/content/joomla/joomla.xml @@ -26,6 +26,7 @@ description="PLG_CONTENT_JOOMLA_FIELD_CHECK_CATEGORIES_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -38,6 +39,7 @@ description="PLG_CONTENT_JOOMLA_FIELD_EMAIL_NEW_FE_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > diff --git a/plugins/content/pagebreak/pagebreak.xml b/plugins/content/pagebreak/pagebreak.xml index 3361bb843584d..30a235e84e44b 100644 --- a/plugins/content/pagebreak/pagebreak.xml +++ b/plugins/content/pagebreak/pagebreak.xml @@ -27,6 +27,7 @@ description="PLG_CONTENT_PAGEBREAK_SITE_TITLE_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -39,6 +40,7 @@ description="PLG_CONTENT_PAGEBREAK_SITE_ARTICLEINDEX_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -49,7 +51,6 @@ type="text" label="PLG_CONTENT_PAGEBREAK_SITE_ARTICLEINDEXTEXT" description="PLG_CONTENT_PAGEBREAK_SITE_ARTICLEINDEXTEXT_DESC" - default="" showon="article_index:1" /> @@ -60,6 +61,7 @@ description="PLG_CONTENT_PAGEBREAK_TOC_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -72,6 +74,7 @@ description="PLG_CONTENT_PAGEBREAK_SHOW_ALL_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > diff --git a/plugins/content/pagenavigation/pagenavigation.xml b/plugins/content/pagenavigation/pagenavigation.xml index d550286c9e718..73e916368021a 100644 --- a/plugins/content/pagenavigation/pagenavigation.xml +++ b/plugins/content/pagenavigation/pagenavigation.xml @@ -27,6 +27,7 @@ label="PLG_PAGENAVIGATION_FIELD_POSITION_LABEL" description="PLG_PAGENAVIGATION_FIELD_POSITION_DESC" default="1" + filter="integer" > @@ -38,6 +39,7 @@ label="PLG_PAGENAVIGATION_FIELD_RELATIVE_LABEL" description="PLG_PAGENAVIGATION_FIELD_RELATIVE_DESC" default="1" + filter="integer" > @@ -49,6 +51,7 @@ label="PLG_PAGENAVIGATION_FIELD_DISPLAY_LABEL" description="PLG_PAGENAVIGATION_FIELD_DISPLAY_DESC" default="0" + filter="integer" > diff --git a/plugins/search/categories/categories.xml b/plugins/search/categories/categories.xml index 338cdc1b1bc63..a9b401932a0f8 100644 --- a/plugins/search/categories/categories.xml +++ b/plugins/search/categories/categories.xml @@ -26,6 +26,7 @@ label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL" description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC" default="50" + filter="integer" size="5" /> @@ -36,6 +37,7 @@ description="JFIELD_PLG_SEARCH_ALL_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > @@ -48,6 +50,7 @@ description="JFIELD_PLG_SEARCH_ARCHIVED_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > diff --git a/plugins/search/contacts/contacts.xml b/plugins/search/contacts/contacts.xml index 227c976dae759..a8d032885e73a 100644 --- a/plugins/search/contacts/contacts.xml +++ b/plugins/search/contacts/contacts.xml @@ -25,6 +25,7 @@ label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL" description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC" default="50" + filter="integer" size="5" /> @@ -35,6 +36,7 @@ description="JFIELD_PLG_SEARCH_ALL_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > @@ -47,6 +49,7 @@ description="JFIELD_PLG_SEARCH_ARCHIVED_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > diff --git a/plugins/search/content/content.xml b/plugins/search/content/content.xml index e952e2ac90c04..7c47015d60054 100644 --- a/plugins/search/content/content.xml +++ b/plugins/search/content/content.xml @@ -25,6 +25,7 @@ label="PLG_SEARCH_CONTENT_FIELD_SEARCHLIMIT_LABEL" description="PLG_SEARCH_CONTENT_FIELD_SEARCHLIMIT_DESC" default="50" + filter="integer" size="5" /> @@ -35,6 +36,7 @@ description="PLG_SEARCH_CONTENT_FIELD_CONTENT_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -47,6 +49,7 @@ description="PLG_SEARCH_CONTENT_FIELD_ARCHIVED_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > diff --git a/plugins/search/newsfeeds/newsfeeds.xml b/plugins/search/newsfeeds/newsfeeds.xml index f9f1400df16ad..5d14be6cafb20 100644 --- a/plugins/search/newsfeeds/newsfeeds.xml +++ b/plugins/search/newsfeeds/newsfeeds.xml @@ -25,6 +25,7 @@ label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL" description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC" default="50" + filter="integer" size="5" /> @@ -35,6 +36,7 @@ description="JFIELD_PLG_SEARCH_ALL_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > @@ -47,6 +49,7 @@ description="JFIELD_PLG_SEARCH_ARCHIVED_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > diff --git a/plugins/search/tags/tags.php b/plugins/search/tags/tags.php index 9fbf94be90b75..8faaf696ad71f 100644 --- a/plugins/search/tags/tags.php +++ b/plugins/search/tags/tags.php @@ -161,7 +161,7 @@ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = nu } } - if (!$this->params->get('show_tagged_items')) + if (!$this->params->get('show_tagged_items', 0)) { return $rows; } diff --git a/plugins/search/tags/tags.xml b/plugins/search/tags/tags.xml index 72bb6c0819e16..34aa699d84df3 100644 --- a/plugins/search/tags/tags.xml +++ b/plugins/search/tags/tags.xml @@ -25,6 +25,7 @@ label="JFIELD_PLG_SEARCH_SEARCHLIMIT_LABEL" description="JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC" default="50" + filter="integer" size="5" /> @@ -35,6 +36,7 @@ description="PLG_SEARCH_TAGS_FIELD_SHOW_TAGGED_ITEMS_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > diff --git a/plugins/twofactorauth/totp/totp.xml b/plugins/twofactorauth/totp/totp.xml index 96d5f36b38620..ce69e3baf22bb 100644 --- a/plugins/twofactorauth/totp/totp.xml +++ b/plugins/twofactorauth/totp/totp.xml @@ -27,6 +27,7 @@ label="PLG_TWOFACTORAUTH_TOTP_SECTION_LABEL" description="PLG_TWOFACTORAUTH_TOTP_SECTION_DESC" default="3" + filter="integer" class="btn-group" > diff --git a/plugins/twofactorauth/yubikey/yubikey.xml b/plugins/twofactorauth/yubikey/yubikey.xml index df9cd82acc5fb..9779e85b32b75 100644 --- a/plugins/twofactorauth/yubikey/yubikey.xml +++ b/plugins/twofactorauth/yubikey/yubikey.xml @@ -26,6 +26,7 @@ label="PLG_TWOFACTORAUTH_YUBIKEY_SECTION_LABEL" description="PLG_TWOFACTORAUTH_YUBIKEY_SECTION_DESC" default="3" + filter="integer" class="btn-group" > diff --git a/plugins/user/contactcreator/contactcreator.xml b/plugins/user/contactcreator/contactcreator.xml index b06a1e9ff9885..1b88124545cb5 100644 --- a/plugins/user/contactcreator/contactcreator.xml +++ b/plugins/user/contactcreator/contactcreator.xml @@ -33,6 +33,7 @@ label="JCATEGORY" description="PLG_CONTACTCREATOR_FIELD_CATEGORY_DESC" extension="com_contact" + filter="integer" /> From fe621e53f47366d431f678d1fa346cffbe51d862 Mon Sep 17 00:00:00 2001 From: infograf768 Date: Tue, 15 May 2018 22:56:56 +0000 Subject: [PATCH 25/36] URL Menu Item Type link should be required. (#20392) --- administrator/components/com_menus/views/item/tmpl/edit.php | 1 + 1 file changed, 1 insertion(+) diff --git a/administrator/components/com_menus/views/item/tmpl/edit.php b/administrator/components/com_menus/views/item/tmpl/edit.php index 789b0d38e9879..604de3a312f73 100644 --- a/administrator/components/com_menus/views/item/tmpl/edit.php +++ b/administrator/components/com_menus/views/item/tmpl/edit.php @@ -164,6 +164,7 @@ if ($this->item->type == 'url') { $this->form->setFieldAttribute('link', 'readonly', 'false'); + $this->form->setFieldAttribute('link', 'required', 'true'); } echo $this->form->renderField('link'); From 8028bc7ca1a768ce234fe3924c23caf5d702797b Mon Sep 17 00:00:00 2001 From: Elijah Madden Date: Wed, 16 May 2018 07:57:23 +0900 Subject: [PATCH 26/36] Fix up the protostar template.js (#20224) Don't use unnecessary closure, just use jQuery ready function. Use javsacript strict mode use event delegation where possible Make tooltips and button groups work properly with repeatable subforms --- templates/protostar/js/template.js | 96 ++++++++++++++++++------------ 1 file changed, 59 insertions(+), 37 deletions(-) diff --git a/templates/protostar/js/template.js b/templates/protostar/js/template.js index 8968a6b72e894..464acc894a57e 100644 --- a/templates/protostar/js/template.js +++ b/templates/protostar/js/template.js @@ -6,47 +6,69 @@ * @since 3.2 */ -(function($) -{ - $(document).ready(function() - { - $('*[rel=tooltip]').tooltip(); +jQuery(function($) { + "use strict"; - // Turn radios into btn-group - $('.radio.btn-group label').addClass('btn'); + $(document) + .on('click', ".btn-group label:not(.active)", function() { + var $label = $(this); + var $input = $('#' + $label.attr('for')); - $(".btn-group label:not(.active)").click(function() - { - var label = $(this); - var input = $('#' + label.attr('for')); - - if (!input.prop('checked')) { - label.closest('.btn-group').find("label").removeClass('active btn-success btn-danger btn-primary'); - if (input.val() == '') { - label.addClass('active btn-primary'); - } else if (input.val() == 0) { - label.addClass('active btn-danger'); - } else { - label.addClass('active btn-success'); - } - input.prop('checked', true); - input.trigger('change'); + if ($input.prop('checked')) { + return; } - }); - $(".btn-group input[checked=checked]").each(function() - { - if ($(this).val() == '') { - $("label[for=" + $(this).attr('id') + "]").addClass('active btn-primary'); - } else if ($(this).val() == 0) { - $("label[for=" + $(this).attr('id') + "]").addClass('active btn-danger'); - } else { - $("label[for=" + $(this).attr('id') + "]").addClass('active btn-success'); + + $label.closest('.btn-group').find("label").removeClass('active btn-success btn-danger btn-primary'); + + var btnClass = 'primary'; + + + if ($input.val() != '') + { + var reversed = $label.closest('.btn-group').hasClass('btn-group-reversed'); + btnClass = ($input.val() == 0 ? !reversed : reversed) ? 'danger' : 'success'; } - }); - - $('#back-top').on('click', function(e) { + + $label.addClass('active btn-' + btnClass); + $input.prop('checked', true).trigger('change'); + }) + .on('click', '#back-top', function (e) { e.preventDefault(); $("html, body").animate({scrollTop: 0}, 1000); + }) + .on('subform-row-add', initButtonGroup) + .on('subform-row-add', initTooltip); + + initButtonGroup(); + initTooltip(); + + // Called once on domready, again when a subform row is added + function initTooltip(event, container) + { + $(container || document).find('*[rel=tooltip]').tooltip(); + } + + // Called once on domready, again when a subform row is added + function initButtonGroup(event, container) + { + var $container = $(container || document); + + // Turn radios into btn-group + $container.find('.radio.btn-group label').addClass('btn'); + + $container.find(".btn-group input:checked").each(function() + { + var $input = $(this); + var $label = $('label[for=' + $input.attr('id') + ']'); + var btnClass = 'primary'; + + if ($input.val() != '') + { + var reversed = $input.parent().hasClass('btn-group-reversed'); + btnClass = ($input.val() == 0 ? !reversed : reversed) ? 'danger' : 'success'; + } + + $label.addClass('active btn-' + btnClass); }); - }) -})(jQuery); \ No newline at end of file + } +}); From ff7addcb8a7eb1622182614a4b001af7cfa9b1d3 Mon Sep 17 00:00:00 2001 From: Dmitry Sakharuk Date: Wed, 16 May 2018 01:59:59 +0300 Subject: [PATCH 27/36] Bootstrap alert compatible (#18909) * Bootstrap alert compatible Alert compatibility with new Bootstrap versions. * Strict comparison * Bootstrap alert compatible minified file Alert compatibility with new Bootstrap versions. --- media/system/js/core-uncompressed.js | 5 +++-- media/system/js/core.js | 17 +---------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/media/system/js/core-uncompressed.js b/media/system/js/core-uncompressed.js index 1ce038a081ecf..55b90d270b044 100644 --- a/media/system/js/core-uncompressed.js +++ b/media/system/js/core-uncompressed.js @@ -322,8 +322,9 @@ Joomla.editors.instances = Joomla.editors.instances || { messagesBox = document.createElement( 'div' ); // Message class - alertClass = (type == 'notice') ? 'alert-info' : 'alert-' + type; - alertClass = (type == 'message') ? 'alert-success' : alertClass; + alertClass = (type === 'notice') ? 'alert-info' : 'alert-' + type; + alertClass = (type === 'message') ? 'alert-success' : alertClass; + alertClass = (type === 'error') ? 'alert-error alert-danger' : alertClass; messagesBox.className = 'alert ' + alertClass; diff --git a/media/system/js/core.js b/media/system/js/core.js index 7bbab0352719a..ba21634af2194 100644 --- a/media/system/js/core.js +++ b/media/system/js/core.js @@ -1,16 +1 @@ -Joomla=window.Joomla||{};Joomla.editors=Joomla.editors||{};Joomla.editors.instances=Joomla.editors.instances||{}; -(function(c,g){c.submitform=function(a,b,e){b||(b=g.getElementById("adminForm"));a&&(b.task.value=a);b.noValidate=!e;e?b.hasAttribute("novalidate")&&b.removeAttribute("novalidate"):b.setAttribute("novalidate","");a=g.createElement("input");a.style.display="none";a.type="submit";b.appendChild(a).click();b.removeChild(a)};c.submitbutton=function(a){c.submitform(a)};c.JText={strings:{},_:function(a,b){var e=c.getOptions("joomla.jtext");e&&(this.load(e),c.loadOptions({"joomla.jtext":null}));b=void 0=== -b?"":b;a=a.toUpperCase();return void 0!==this.strings[a]?this.strings[a]:b},load:function(a){for(var b in a)a.hasOwnProperty(b)&&(this.strings[b.toUpperCase()]=a[b]);return this}};c.optionsStorage=c.optionsStorage||null;c.getOptions=function(a,b){c.optionsStorage||c.loadOptions();return void 0!==c.optionsStorage[a]?c.optionsStorage[a]:b};c.loadOptions=function(a){if(!a){for(var b=g.querySelectorAll(".joomla-script-options.new"),e,d,h=0,f=0,m=b.length;f"+a.responseJSON.message+""]:a.statusText?[c.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",a.status)+" "+a.statusText+""]:[c.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",a.status)];return e};c.isChecked=function(a,b){"undefined"===typeof b&&(b=g.getElementById("adminForm"));b.boxchecked.value=a?parseInt(b.boxchecked.value)+1:parseInt(b.boxchecked.value)-1;if(b.elements["checkall-toggle"]){var e= -!0,d;var c=0;for(d=b.elements.length;c";d=e==d;var h;for(h=0;h"+k[2]+""}}a+="";f?f.innerHTML=a:g.writeln(a)};window.changeDynaList=function(a,b,e,d,c){a=g.adminForm[a];d=e==d;for(var f,h,k,l;a.firstChild;)a.removeChild(a.firstChild);f=0;for(h in b)if(b.hasOwnProperty(h)&&(k=b[h],k[0]==e)){l=new Option;l.value=k[1];l.text= -k[2];if(d&&c==l.value||!d&&0===f)l.selected=!0;a.options[f++]=l}a.length=f};window.radioGetCheckedValue=function(a){if(!a)return"";var b=a.length,e;if(void 0===b)return a.checked?a.value:"";for(e=0;e=0;s--)(l=t.createElement("div")).innerHTML=r[s],i.appendChild(l);c.appendChild(i)}},e.removeMessages=function(){for(var e=t.getElementById("system-message-container");e.firstChild;)e.removeChild(e.firstChild);e.style.display="none",e.offsetHeight,e.style.display=""},e.ajaxErrorsMessages=function(t,o,n){var r={};if("parsererror"===o){for(var i=t.responseText.trim(),a=[],s=i.length-1;s>=0;s--)a.unshift(["&#",i[s].charCodeAt(),";"].join(""));i=a.join(""),r.error=[e.JText._("JLIB_JS_AJAX_ERROR_PARSE").replace("%s",i)]}else"nocontent"===o?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_NO_CONTENT")]:"timeout"===o?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_TIMEOUT")]:"abort"===o?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_CONNECTION_ABORT")]:t.responseJSON&&t.responseJSON.message?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)+" "+t.responseJSON.message+""]:t.statusText?r.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)+" "+t.statusText+""]:r.error=[e.JText._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)];return r},e.isChecked=function(e,o){if(void 0===o&&(o=t.getElementById("adminForm")),o.boxchecked.value=e?parseInt(o.boxchecked.value)+1:parseInt(o.boxchecked.value)-1,o.elements["checkall-toggle"]){var n,r,i,a=!0;for(n=0,i=o.elements.length;n",u=n==r,m=0;for(l in o)o.hasOwnProperty(l)&&(d=o[l])[0]==n&&(s="",(u&&i==d[1]||!u&&0===m)&&(s='selected="selected"'),c+='",m++);c+="",a?a.innerHTML=c:t.writeln(c)},window.changeDynaList=function(e,o,n,r,i){for(var a,s,l,d,c=t.adminForm[e],u=n==r;c.firstChild;)c.removeChild(c.firstChild);for(s in a=0,o)o.hasOwnProperty(s)&&(l=o[s])[0]==n&&((d=new Option).value=l[1],d.text=l[2],(u&&i==d.value||!u&&0===a)&&(d.selected=!0),c.options[a++]=d);c.length=a},window.radioGetCheckedValue=function(e){if(!e)return"";var t,o=e.length;if(void 0===o)return e.checked?e.value:"";for(t=0;t-1?n.options[r].value:null},window.listItemTask=function(t,o){return e.listItemTask(t,o)},e.listItemTask=function(e,o){var n,r=t.adminForm,i=0,a=r[e];if(!a)return!1;for(;n=r["cb"+i];)n.checked=!1,i++;return a.checked=!0,r.boxchecked.value=1,window.submitform(o),!1},window.submitbutton=function(t){e.submitbutton(t)},window.submitform=function(t){e.submitform(t)},window.saveorder=function(e,t){window.checkAll_button(e,t)},window.checkAll_button=function(o,n){var r,i;for(n=n||"saveorder",r=0;r<=o;r++){if(!(i=t.adminForm["cb"+r]))return void alert("You cannot change the order of items, as an item in the list is `Checked Out`");i.checked=!0}e.submitform(n)},e.loadingLayer=function(o,n){if(o=o||"show",n=n||t.body,"load"===o){var r=(e.getOptions("system.paths")||{}).root||"",i=t.createElement("div");i.id="loading-logo",i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="100%",i.style.height="100%",i.style.opacity="0.8",i.style.filter="alpha(opacity=80)",i.style.overflow="hidden",i.style["z-index"]="10000",i.style.display="none",i.style["background-color"]="#fff",i.style["background-image"]='url("'+r+'/media/jui/images/ajax-loader.gif")',i.style["background-position"]="center",i.style["background-repeat"]="no-repeat",i.style["background-attachment"]="fixed",n.appendChild(i)}else t.getElementById("loading-logo")||e.loadingLayer("load",n),t.getElementById("loading-logo").style.display="show"==o?"block":"none";return t.getElementById("loading-logo")},e.extend=function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e},e.request=function(t){(t=e.extend({url:"",method:"GET",data:null,perform:!0},t)).method=t.data?"POST":t.method.toUpperCase();try{var o=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP.3.0");if(o.open(t.method,t.url,!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("X-Ajax-Engine","Joomla!"),"POST"===t.method){var n=e.getOptions("csrf.token","");n&&o.setRequestHeader("X-CSRF-Token",n),t.headers&&t.headers["Content-Type"]||o.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}if(t.headers)for(var r in t.headers)t.headers.hasOwnProperty(r)&&o.setRequestHeader(r,t.headers[r]);if(o.onreadystatechange=function(){4===o.readyState&&(200===o.status?t.onSuccess&&t.onSuccess.call(window,o.responseText,o):t.onError&&t.onError.call(window,o))},t.perform){if(t.onBefore&&!1===t.onBefore.call(window,o))return o;o.send(t.data)}}catch(e){return window.console&&console.log(e),!1}return o}}(Joomla,document); \ No newline at end of file From b9501077085e5ea0c650c31ebb9ec9360a91360e Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Thu, 17 May 2018 14:46:53 -0500 Subject: [PATCH 28/36] Add PHP 7.3 polyfill (#20441) --- .gitignore | 2 + composer.json | 1 + composer.lock | 59 +- libraries/vendor/composer/ClassLoader.php | 4 +- .../vendor/composer/autoload_classmap.php | 29 - libraries/vendor/composer/autoload_files.php | 1 + libraries/vendor/composer/autoload_psr4.php | 1 + libraries/vendor/composer/autoload_static.php | 35 +- libraries/vendor/composer/installed.json | 1335 +++++++++-------- .../vendor/symfony/polyfill-php73/LICENSE | 19 + .../symfony/polyfill-php73/bootstrap.php | 16 + 11 files changed, 801 insertions(+), 701 deletions(-) create mode 100644 libraries/vendor/symfony/polyfill-php73/LICENSE create mode 100644 libraries/vendor/symfony/polyfill-php73/bootstrap.php diff --git a/.gitignore b/.gitignore index 90be3a9720be0..2ce18fd0cee68 100644 --- a/.gitignore +++ b/.gitignore @@ -150,6 +150,8 @@ Desktop.ini /libraries/vendor/symfony/polyfill-php55/README.md /libraries/vendor/symfony/polyfill-php56/composer.json /libraries/vendor/symfony/polyfill-php56/README.md +/libraries/vendor/symfony/polyfill-php73/composer.json +/libraries/vendor/symfony/polyfill-php73/README.md /libraries/vendor/symfony/polyfill-util/composer.json /libraries/vendor/symfony/polyfill-util/README.md /libraries/vendor/symfony/polyfill-util/TestListener.php diff --git a/composer.json b/composer.json index 503caf354f01b..f0b559dfc2278 100644 --- a/composer.json +++ b/composer.json @@ -40,6 +40,7 @@ "phpmailer/phpmailer": "^5.2.20", "symfony/polyfill-php55": "~1.2", "symfony/polyfill-php56": "~1.0", + "symfony/polyfill-php73": "~1.8", "symfony/yaml": "2.*", "simplepie/simplepie": "1.3.1" }, diff --git a/composer.lock b/composer.lock index ac93d84690a64..46f6d9dff572f 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7df3275195712f2be8cdf526269d16a1", + "content-hash": "b9e71c95d44dc23403e9461ebafa348b", "packages": [ { "name": "ircmaxell/password-compat", @@ -1294,6 +1294,61 @@ ], "time": "2017-10-11T12:05:26+00:00" }, + { + "name": "symfony/polyfill-php73", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "9841f6fc047725a8286ea986018355bbc9200383" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9841f6fc047725a8286ea986018355bbc9200383", + "reference": "9841f6fc047725a8286ea986018355bbc9200383", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-04-26T06:22:38+00:00" + }, { "name": "symfony/polyfill-util", "version": "v1.6.0", diff --git a/libraries/vendor/composer/ClassLoader.php b/libraries/vendor/composer/ClassLoader.php index 2c72175e7723a..dc02dfb114fb6 100644 --- a/libraries/vendor/composer/ClassLoader.php +++ b/libraries/vendor/composer/ClassLoader.php @@ -379,9 +379,9 @@ private function findFileWithExtension($class, $ext) $subPath = substr($subPath, 0, $lastPos); $search = $subPath.'\\'; if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { - $length = $this->prefixLengthsPsr4[$first][$search]; - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + if (file_exists($file = $dir . $pathEnd)) { return $file; } } diff --git a/libraries/vendor/composer/autoload_classmap.php b/libraries/vendor/composer/autoload_classmap.php index c00b678d60467..f6b5443aa5966 100644 --- a/libraries/vendor/composer/autoload_classmap.php +++ b/libraries/vendor/composer/autoload_classmap.php @@ -35,11 +35,6 @@ 'Joomla\\Data\\DataObject' => $vendorDir . '/joomla/data/src/DataObject.php', 'Joomla\\Data\\DataSet' => $vendorDir . '/joomla/data/src/DataSet.php', 'Joomla\\Data\\DumpableInterface' => $vendorDir . '/joomla/data/src/DumpableInterface.php', - 'Joomla\\Data\\Tests\\DataObjectTest' => $vendorDir . '/joomla/data/Tests/DataObjectTest.php', - 'Joomla\\Data\\Tests\\DataSetTest' => $vendorDir . '/joomla/data/Tests/DataSetTest.php', - 'Joomla\\Data\\Tests\\JDataBuran' => $vendorDir . '/joomla/data/Tests/Stubs/buran.php', - 'Joomla\\Data\\Tests\\JDataCapitaliser' => $vendorDir . '/joomla/data/Tests/Stubs/capitaliser.php', - 'Joomla\\Data\\Tests\\JDataVostok' => $vendorDir . '/joomla/data/Tests/Stubs/vostok.php', 'Joomla\\Event\\AbstractEvent' => $vendorDir . '/joomla/event/src/AbstractEvent.php', 'Joomla\\Event\\DelegatingDispatcher' => $vendorDir . '/joomla/event/src/DelegatingDispatcher.php', 'Joomla\\Event\\Dispatcher' => $vendorDir . '/joomla/event/src/Dispatcher.php', @@ -51,17 +46,6 @@ 'Joomla\\Event\\EventInterface' => $vendorDir . '/joomla/event/src/EventInterface.php', 'Joomla\\Event\\ListenersPriorityQueue' => $vendorDir . '/joomla/event/src/ListenersPriorityQueue.php', 'Joomla\\Event\\Priority' => $vendorDir . '/joomla/event/src/Priority.php', - 'Joomla\\Event\\Tests\\AbstractEventTest' => $vendorDir . '/joomla/event/Tests/AbstractEventTest.php', - 'Joomla\\Event\\Tests\\DelegatingDispatcherTest' => $vendorDir . '/joomla/event/Tests/DelegatingDispatcherTest.php', - 'Joomla\\Event\\Tests\\DispatcherTest' => $vendorDir . '/joomla/event/Tests/DispatcherTest.php', - 'Joomla\\Event\\Tests\\EventImmutableTest' => $vendorDir . '/joomla/event/Tests/EventImmutableTest.php', - 'Joomla\\Event\\Tests\\EventTest' => $vendorDir . '/joomla/event/Tests/EventTest.php', - 'Joomla\\Event\\Tests\\ListenersPriorityQueueTest' => $vendorDir . '/joomla/event/Tests/ListenersPriorityQueueTest.php', - 'Joomla\\Event\\Tests\\Stubs\\EmptyListener' => $vendorDir . '/joomla/event/Tests/Stubs/EmptyListener.php', - 'Joomla\\Event\\Tests\\Stubs\\FirstListener' => $vendorDir . '/joomla/event/Tests/Stubs/FirstListener.php', - 'Joomla\\Event\\Tests\\Stubs\\SecondListener' => $vendorDir . '/joomla/event/Tests/Stubs/SecondListener.php', - 'Joomla\\Event\\Tests\\Stubs\\SomethingListener' => $vendorDir . '/joomla/event/Tests/Stubs/SomethingListener.php', - 'Joomla\\Event\\Tests\\Stubs\\ThirdListener' => $vendorDir . '/joomla/event/Tests/Stubs/ThirdListener.php', 'Joomla\\Filesystem\\Buffer' => $vendorDir . '/joomla/filesystem/src/Buffer.php', 'Joomla\\Filesystem\\Clients\\FtpClient' => $vendorDir . '/joomla/filesystem/src/Clients/FtpClient.php', 'Joomla\\Filesystem\\Exception\\FilesystemException' => $vendorDir . '/joomla/filesystem/src/Exception/FilesystemException.php', @@ -111,22 +95,11 @@ 'Joomla\\Session\\Storage\\None' => $vendorDir . '/joomla/session/Joomla/Session/Storage/None.php', 'Joomla\\Session\\Storage\\Wincache' => $vendorDir . '/joomla/session/Joomla/Session/Storage/Wincache.php', 'Joomla\\Session\\Storage\\Xcache' => $vendorDir . '/joomla/session/Joomla/Session/Storage/Xcache.php', - 'Joomla\\Session\\Tests\\Handler\\ApcuHandlerTest' => $vendorDir . '/joomla/session/tests/Handler/ApcuHandlerTest.php', - 'Joomla\\Session\\Tests\\Handler\\DatabaseHandlerTest' => $vendorDir . '/joomla/session/tests/Handler/DatabaseHandlerTest.php', - 'Joomla\\Session\\Tests\\Handler\\FilesystemHandlerTest' => $vendorDir . '/joomla/session/tests/Handler/FilesystemHandlerTest.php', - 'Joomla\\Session\\Tests\\Handler\\MemcachedHandlerTest' => $vendorDir . '/joomla/session/tests/Handler/MemcachedHandlerTest.php', - 'Joomla\\Session\\Tests\\Handler\\NativeStorageTest' => $vendorDir . '/joomla/session/tests/Storage/NativeStorageTest.php', - 'Joomla\\Session\\Tests\\Handler\\RedisHandlerTest' => $vendorDir . '/joomla/session/tests/Handler/RedisHandlerTest.php', - 'Joomla\\Session\\Tests\\Handler\\WincacheHandlerTest' => $vendorDir . '/joomla/session/tests/Handler/WincacheHandlerTest.php', - 'Joomla\\Session\\Tests\\SessionTest' => $vendorDir . '/joomla/session/tests/SessionTest.php', 'Joomla\\String\\Inflector' => $vendorDir . '/joomla/string/src/Inflector.php', 'Joomla\\String\\Normalise' => $vendorDir . '/joomla/string/src/Normalise.php', 'Joomla\\String\\String' => $vendorDir . '/joomla/string/src/String.php', 'Joomla\\String\\StringHelper' => $vendorDir . '/joomla/string/src/StringHelper.php', 'Joomla\\Uri\\AbstractUri' => $vendorDir . '/joomla/uri/src/AbstractUri.php', - 'Joomla\\Uri\\Tests\\UriHelperTest' => $vendorDir . '/joomla/uri/Tests/UriHelperTest.php', - 'Joomla\\Uri\\Tests\\UriImmuteableTest' => $vendorDir . '/joomla/uri/Tests/UriImmutableTest.php', - 'Joomla\\Uri\\Tests\\UriTest' => $vendorDir . '/joomla/uri/Tests/UriTest.php', 'Joomla\\Uri\\Uri' => $vendorDir . '/joomla/uri/src/Uri.php', 'Joomla\\Uri\\UriHelper' => $vendorDir . '/joomla/uri/src/UriHelper.php', 'Joomla\\Uri\\UriImmutable' => $vendorDir . '/joomla/uri/src/UriImmutable.php', @@ -145,8 +118,6 @@ 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', - 'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'SMTP' => $vendorDir . '/phpmailer/phpmailer/class.smtp.php', 'SimplePie' => $vendorDir . '/simplepie/simplepie/library/SimplePie.php', 'SimplePie_Author' => $vendorDir . '/simplepie/simplepie/library/SimplePie/Author.php', diff --git a/libraries/vendor/composer/autoload_files.php b/libraries/vendor/composer/autoload_files.php index 2702ae9181742..711d3b54a61ae 100644 --- a/libraries/vendor/composer/autoload_files.php +++ b/libraries/vendor/composer/autoload_files.php @@ -26,4 +26,5 @@ 'edc6464955a37aa4d5fbf39d40fb6ee7' => $vendorDir . '/symfony/polyfill-php55/bootstrap.php', 'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php', '3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', ); diff --git a/libraries/vendor/composer/autoload_psr4.php b/libraries/vendor/composer/autoload_psr4.php index 012682e2bf817..de3e6f5bd5e1e 100644 --- a/libraries/vendor/composer/autoload_psr4.php +++ b/libraries/vendor/composer/autoload_psr4.php @@ -7,6 +7,7 @@ return array( 'Symfony\\Polyfill\\Util\\' => array($vendorDir . '/symfony/polyfill-util'), + 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), 'Symfony\\Polyfill\\Php56\\' => array($vendorDir . '/symfony/polyfill-php56'), 'Symfony\\Polyfill\\Php55\\' => array($vendorDir . '/symfony/polyfill-php55'), 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), diff --git a/libraries/vendor/composer/autoload_static.php b/libraries/vendor/composer/autoload_static.php index 84a7666a66bdd..0b20391e6ab76 100644 --- a/libraries/vendor/composer/autoload_static.php +++ b/libraries/vendor/composer/autoload_static.php @@ -27,12 +27,14 @@ class ComposerStaticInit205c915b9c7d3e718e7c95793ee67ffe 'edc6464955a37aa4d5fbf39d40fb6ee7' => __DIR__ . '/..' . '/symfony/polyfill-php55/bootstrap.php', 'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php', '3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', ); public static $prefixLengthsPsr4 = array ( 'S' => array ( 'Symfony\\Polyfill\\Util\\' => 22, + 'Symfony\\Polyfill\\Php73\\' => 23, 'Symfony\\Polyfill\\Php56\\' => 23, 'Symfony\\Polyfill\\Php55\\' => 23, 'Symfony\\Component\\Yaml\\' => 23, @@ -69,6 +71,10 @@ class ComposerStaticInit205c915b9c7d3e718e7c95793ee67ffe array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-util', ), + 'Symfony\\Polyfill\\Php73\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', + ), 'Symfony\\Polyfill\\Php56\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php56', @@ -206,11 +212,6 @@ class ComposerStaticInit205c915b9c7d3e718e7c95793ee67ffe 'Joomla\\Data\\DataObject' => __DIR__ . '/..' . '/joomla/data/src/DataObject.php', 'Joomla\\Data\\DataSet' => __DIR__ . '/..' . '/joomla/data/src/DataSet.php', 'Joomla\\Data\\DumpableInterface' => __DIR__ . '/..' . '/joomla/data/src/DumpableInterface.php', - 'Joomla\\Data\\Tests\\DataObjectTest' => __DIR__ . '/..' . '/joomla/data/Tests/DataObjectTest.php', - 'Joomla\\Data\\Tests\\DataSetTest' => __DIR__ . '/..' . '/joomla/data/Tests/DataSetTest.php', - 'Joomla\\Data\\Tests\\JDataBuran' => __DIR__ . '/..' . '/joomla/data/Tests/Stubs/buran.php', - 'Joomla\\Data\\Tests\\JDataCapitaliser' => __DIR__ . '/..' . '/joomla/data/Tests/Stubs/capitaliser.php', - 'Joomla\\Data\\Tests\\JDataVostok' => __DIR__ . '/..' . '/joomla/data/Tests/Stubs/vostok.php', 'Joomla\\Event\\AbstractEvent' => __DIR__ . '/..' . '/joomla/event/src/AbstractEvent.php', 'Joomla\\Event\\DelegatingDispatcher' => __DIR__ . '/..' . '/joomla/event/src/DelegatingDispatcher.php', 'Joomla\\Event\\Dispatcher' => __DIR__ . '/..' . '/joomla/event/src/Dispatcher.php', @@ -222,17 +223,6 @@ class ComposerStaticInit205c915b9c7d3e718e7c95793ee67ffe 'Joomla\\Event\\EventInterface' => __DIR__ . '/..' . '/joomla/event/src/EventInterface.php', 'Joomla\\Event\\ListenersPriorityQueue' => __DIR__ . '/..' . '/joomla/event/src/ListenersPriorityQueue.php', 'Joomla\\Event\\Priority' => __DIR__ . '/..' . '/joomla/event/src/Priority.php', - 'Joomla\\Event\\Tests\\AbstractEventTest' => __DIR__ . '/..' . '/joomla/event/Tests/AbstractEventTest.php', - 'Joomla\\Event\\Tests\\DelegatingDispatcherTest' => __DIR__ . '/..' . '/joomla/event/Tests/DelegatingDispatcherTest.php', - 'Joomla\\Event\\Tests\\DispatcherTest' => __DIR__ . '/..' . '/joomla/event/Tests/DispatcherTest.php', - 'Joomla\\Event\\Tests\\EventImmutableTest' => __DIR__ . '/..' . '/joomla/event/Tests/EventImmutableTest.php', - 'Joomla\\Event\\Tests\\EventTest' => __DIR__ . '/..' . '/joomla/event/Tests/EventTest.php', - 'Joomla\\Event\\Tests\\ListenersPriorityQueueTest' => __DIR__ . '/..' . '/joomla/event/Tests/ListenersPriorityQueueTest.php', - 'Joomla\\Event\\Tests\\Stubs\\EmptyListener' => __DIR__ . '/..' . '/joomla/event/Tests/Stubs/EmptyListener.php', - 'Joomla\\Event\\Tests\\Stubs\\FirstListener' => __DIR__ . '/..' . '/joomla/event/Tests/Stubs/FirstListener.php', - 'Joomla\\Event\\Tests\\Stubs\\SecondListener' => __DIR__ . '/..' . '/joomla/event/Tests/Stubs/SecondListener.php', - 'Joomla\\Event\\Tests\\Stubs\\SomethingListener' => __DIR__ . '/..' . '/joomla/event/Tests/Stubs/SomethingListener.php', - 'Joomla\\Event\\Tests\\Stubs\\ThirdListener' => __DIR__ . '/..' . '/joomla/event/Tests/Stubs/ThirdListener.php', 'Joomla\\Filesystem\\Buffer' => __DIR__ . '/..' . '/joomla/filesystem/src/Buffer.php', 'Joomla\\Filesystem\\Clients\\FtpClient' => __DIR__ . '/..' . '/joomla/filesystem/src/Clients/FtpClient.php', 'Joomla\\Filesystem\\Exception\\FilesystemException' => __DIR__ . '/..' . '/joomla/filesystem/src/Exception/FilesystemException.php', @@ -282,22 +272,11 @@ class ComposerStaticInit205c915b9c7d3e718e7c95793ee67ffe 'Joomla\\Session\\Storage\\None' => __DIR__ . '/..' . '/joomla/session/Joomla/Session/Storage/None.php', 'Joomla\\Session\\Storage\\Wincache' => __DIR__ . '/..' . '/joomla/session/Joomla/Session/Storage/Wincache.php', 'Joomla\\Session\\Storage\\Xcache' => __DIR__ . '/..' . '/joomla/session/Joomla/Session/Storage/Xcache.php', - 'Joomla\\Session\\Tests\\Handler\\ApcuHandlerTest' => __DIR__ . '/..' . '/joomla/session/tests/Handler/ApcuHandlerTest.php', - 'Joomla\\Session\\Tests\\Handler\\DatabaseHandlerTest' => __DIR__ . '/..' . '/joomla/session/tests/Handler/DatabaseHandlerTest.php', - 'Joomla\\Session\\Tests\\Handler\\FilesystemHandlerTest' => __DIR__ . '/..' . '/joomla/session/tests/Handler/FilesystemHandlerTest.php', - 'Joomla\\Session\\Tests\\Handler\\MemcachedHandlerTest' => __DIR__ . '/..' . '/joomla/session/tests/Handler/MemcachedHandlerTest.php', - 'Joomla\\Session\\Tests\\Handler\\NativeStorageTest' => __DIR__ . '/..' . '/joomla/session/tests/Storage/NativeStorageTest.php', - 'Joomla\\Session\\Tests\\Handler\\RedisHandlerTest' => __DIR__ . '/..' . '/joomla/session/tests/Handler/RedisHandlerTest.php', - 'Joomla\\Session\\Tests\\Handler\\WincacheHandlerTest' => __DIR__ . '/..' . '/joomla/session/tests/Handler/WincacheHandlerTest.php', - 'Joomla\\Session\\Tests\\SessionTest' => __DIR__ . '/..' . '/joomla/session/tests/SessionTest.php', 'Joomla\\String\\Inflector' => __DIR__ . '/..' . '/joomla/string/src/Inflector.php', 'Joomla\\String\\Normalise' => __DIR__ . '/..' . '/joomla/string/src/Normalise.php', 'Joomla\\String\\String' => __DIR__ . '/..' . '/joomla/string/src/String.php', 'Joomla\\String\\StringHelper' => __DIR__ . '/..' . '/joomla/string/src/StringHelper.php', 'Joomla\\Uri\\AbstractUri' => __DIR__ . '/..' . '/joomla/uri/src/AbstractUri.php', - 'Joomla\\Uri\\Tests\\UriHelperTest' => __DIR__ . '/..' . '/joomla/uri/Tests/UriHelperTest.php', - 'Joomla\\Uri\\Tests\\UriImmuteableTest' => __DIR__ . '/..' . '/joomla/uri/Tests/UriImmutableTest.php', - 'Joomla\\Uri\\Tests\\UriTest' => __DIR__ . '/..' . '/joomla/uri/Tests/UriTest.php', 'Joomla\\Uri\\Uri' => __DIR__ . '/..' . '/joomla/uri/src/Uri.php', 'Joomla\\Uri\\UriHelper' => __DIR__ . '/..' . '/joomla/uri/src/UriHelper.php', 'Joomla\\Uri\\UriImmutable' => __DIR__ . '/..' . '/joomla/uri/src/UriImmutable.php', @@ -316,8 +295,6 @@ class ComposerStaticInit205c915b9c7d3e718e7c95793ee67ffe 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', - 'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', - 'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'SMTP' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.smtp.php', 'SimplePie' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie.php', 'SimplePie_Author' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/Author.php', diff --git a/libraries/vendor/composer/installed.json b/libraries/vendor/composer/installed.json index 401f84f789f53..041086adbfe02 100644 --- a/libraries/vendor/composer/installed.json +++ b/libraries/vendor/composer/installed.json @@ -1,68 +1,82 @@ [ { - "name": "joomla/uri", - "version": "1.1.1", - "version_normalized": "1.1.1.0", + "name": "ircmaxell/password-compat", + "version": "v1.0.4", + "version_normalized": "1.0.4.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/uri.git", - "reference": "980e532e4235bb8f1ada15b28822abbeb171da3f" + "url": "https://github.com/ircmaxell/password_compat.git", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/uri/zipball/980e532e4235bb8f1ada15b28822abbeb171da3f", - "reference": "980e532e4235bb8f1ada15b28822abbeb171da3f", + "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", "shasum": "" }, - "require": { - "php": ">=5.3.10" + "require-dev": { + "phpunit/phpunit": "4.*" }, - "time": "2014-02-09T02:57:17+00:00", - "type": "joomla-package", + "time": "2014-11-20T16:49:30+00:00", + "type": "library", "installation-source": "dist", "autoload": { - "psr-4": { - "Joomla\\Uri\\": "src/", - "Joomla\\Uri\\Tests\\": "Tests/" - } + "files": [ + "lib/password.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0+" + "MIT" ], - "description": "Joomla Uri Package", - "homepage": "https://github.com/joomla-framework/uri", + "authors": [ + { + "name": "Anthony Ferrara", + "email": "ircmaxell@php.net", + "homepage": "http://blog.ircmaxell.com" + } + ], + "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", + "homepage": "https://github.com/ircmaxell/password_compat", "keywords": [ - "framework", - "joomla", - "uri" + "hashing", + "password" ] }, { - "name": "joomla/input", - "version": "1.2.0", - "version_normalized": "1.2.0.0", + "name": "joomla/application", + "version": "1.8.1", + "version_normalized": "1.8.1.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/input.git", - "reference": "b6098276043e2d627221fe54d3c91232e6679d0f" + "url": "https://github.com/joomla-framework/application.git", + "reference": "4abf6ba23fc4454c6d9b2efd6290db0ffe6f424e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/input/zipball/b6098276043e2d627221fe54d3c91232e6679d0f", - "reference": "b6098276043e2d627221fe54d3c91232e6679d0f", + "url": "https://api.github.com/repos/joomla-framework/application/zipball/4abf6ba23fc4454c6d9b2efd6290db0ffe6f424e", + "reference": "4abf6ba23fc4454c6d9b2efd6290db0ffe6f424e", "shasum": "" }, "require": { - "joomla/filter": "~1.0", - "php": ">=5.3.10" + "joomla/input": "~1.2|~2.0", + "joomla/registry": "^1.4.5|~2.0", + "php": "^5.3.10|~7.0", + "psr/log": "~1.0" }, "require-dev": { - "joomla/test": "~1.0", - "phpunit/phpunit": "4.*", + "joomla/event": "~1.2|~2.0", + "joomla/session": "^1.2.1|~2.0", + "joomla/test": "~1.1", + "joomla/uri": "~1.1", + "phpunit/phpunit": "~4.8|>=5.0 <5.4", "squizlabs/php_codesniffer": "1.*" }, - "time": "2014-10-12T18:01:36+00:00", + "suggest": { + "joomla/session": "To use AbstractWebApplication with session support, install joomla/session", + "joomla/uri": "To use AbstractWebApplication, install joomla/uri" + }, + "time": "2017-07-14T12:54:12+00:00", "type": "joomla-package", "extra": { "branch-alias": { @@ -72,64 +86,73 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Joomla\\Input\\": "src/", - "Joomla\\Input\\Tests\\": "Tests/" + "Joomla\\Application\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "description": "Joomla Input Package", - "homepage": "https://github.com/joomla-framework/input", + "description": "Joomla Application Package", + "homepage": "https://github.com/joomla-framework/application", "keywords": [ + "application", "framework", - "input", "joomla" ] }, { - "name": "ircmaxell/password-compat", - "version": "v1.0.4", - "version_normalized": "1.0.4.0", + "name": "joomla/archive", + "version": "1.1.5", + "version_normalized": "1.1.5.0", "source": { "type": "git", - "url": "https://github.com/ircmaxell/password_compat.git", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" + "url": "https://github.com/joomla-framework/archive.git", + "reference": "2b5d645804c6af7c363716ba1956929f8b9665d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", + "url": "https://api.github.com/repos/joomla-framework/archive/zipball/2b5d645804c6af7c363716ba1956929f8b9665d3", + "reference": "2b5d645804c6af7c363716ba1956929f8b9665d3", "shasum": "" }, + "require": { + "joomla/filesystem": "~1.3|~2.0", + "php": "^5.3.10|~7.0" + }, "require-dev": { - "phpunit/phpunit": "4.*" + "joomla/test": "~1.0", + "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0", + "squizlabs/php_codesniffer": "1.*" + }, + "suggest": { + "ext-bz2": "To extract bzip2 compressed packages", + "ext-zip": "To extract zip compressed packages", + "ext-zlib": "To extract gzip or zip compressed packages" + }, + "time": "2017-06-12T11:32:11+00:00", + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } }, - "time": "2014-11-20T16:49:30+00:00", - "type": "library", "installation-source": "dist", "autoload": { - "files": [ - "lib/password.php" - ] + "psr-4": { + "Joomla\\Archive\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthony Ferrara", - "email": "ircmaxell@php.net", - "homepage": "http://blog.ircmaxell.com" - } + "GPL-2.0+" ], - "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", - "homepage": "https://github.com/ircmaxell/password_compat", + "description": "Joomla Archive Package", + "homepage": "https://github.com/joomla-framework/archive", "keywords": [ - "hashing", - "password" + "archive", + "framework", + "joomla" ] }, { @@ -172,47 +195,105 @@ ] }, { - "name": "leafo/lessphp", - "version": "v0.5.0", - "version_normalized": "0.5.0.0", + "name": "joomla/data", + "version": "1.2.0", + "version_normalized": "1.2.0.0", "source": { "type": "git", - "url": "https://github.com/leafo/lessphp.git", - "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283" + "url": "https://github.com/joomla-framework/data.git", + "reference": "57ee292ba23307a6a6059e69b7b19ca5b624ab80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/leafo/lessphp/zipball/0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", - "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", + "url": "https://api.github.com/repos/joomla-framework/data/zipball/57ee292ba23307a6a6059e69b7b19ca5b624ab80", + "reference": "57ee292ba23307a6a6059e69b7b19ca5b624ab80", "shasum": "" }, - "time": "2014-11-24T18:39:20+00:00", - "type": "library", + "require": { + "joomla/compat": "~1.0", + "joomla/registry": "~1.0", + "php": ">=5.3.10|>=7.0" + }, + "require-dev": { + "joomla/test": "~1.0", + "phpunit/phpunit": "~4.8|~5.0", + "squizlabs/php_codesniffer": "1.*" + }, + "time": "2016-04-02T22:20:43+00:00", + "type": "joomla-package", "extra": { "branch-alias": { - "dev-master": "0.4.x-dev" + "dev-master": "1.x-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "lessc.inc.php" - ] + "psr-4": { + "Joomla\\Data\\": "src/", + "Joomla\\Data\\Tests\\": "Tests/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT", - "GPL-3.0" + "GPL-2.0+" ], - "authors": [ - { - "name": "Leaf Corcoran", - "email": "leafot@gmail.com", - "homepage": "http://leafo.net" + "description": "Joomla Data Package", + "homepage": "https://github.com/joomla-framework/data", + "keywords": [ + "data", + "framework", + "joomla" + ] + }, + { + "name": "joomla/di", + "version": "1.4.0", + "version_normalized": "1.4.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/di.git", + "reference": "756c6eb4554b9007f69da66cf488a05308251ed8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/di/zipball/756c6eb4554b9007f69da66cf488a05308251ed8", + "reference": "756c6eb4554b9007f69da66cf488a05308251ed8", + "shasum": "" + }, + "require": { + "php": "^5.3.10|~7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0", + "squizlabs/php_codesniffer": "1.*" + }, + "time": "2017-11-12T15:35:19+00:00", + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Joomla\\DI\\": "src/" } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" ], - "description": "lessphp is a compiler for LESS written in PHP.", - "homepage": "http://leafo.net/lessphp/" + "description": "Joomla DI Package", + "homepage": "https://github.com/joomla-framework/di", + "keywords": [ + "container", + "dependency injection", + "di", + "framework", + "ioc", + "joomla" + ] }, { "name": "joomla/event", @@ -263,87 +344,32 @@ ] }, { - "name": "simplepie/simplepie", + "name": "joomla/filesystem", "version": "1.3.1", "version_normalized": "1.3.1.0", "source": { "type": "git", - "url": "https://github.com/simplepie/simplepie.git", - "reference": "ce53709778bc1e2e4deda1651b66e5081398d5cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/simplepie/simplepie/zipball/ce53709778bc1e2e4deda1651b66e5081398d5cc", - "reference": "ce53709778bc1e2e4deda1651b66e5081398d5cc", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "time": "2012-10-30T17:54:03+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "SimplePie": "library" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ryan Parman", - "homepage": "http://ryanparman.com/", - "role": "Creator, alumnus developer" - }, - { - "name": "Geoffrey Sneddon", - "homepage": "http://gsnedders.com/", - "role": "Alumnus developer" - }, - { - "name": "Ryan McCue", - "email": "me@ryanmccue.info", - "homepage": "http://ryanmccue.info/", - "role": "Developer" - } - ], - "description": "A simple Atom/RSS parsing library for PHP", - "homepage": "http://simplepie.org/", - "keywords": [ - "atom", - "feeds", - "rss" - ] - }, - { - "name": "joomla/data", - "version": "1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/joomla-framework/data.git", - "reference": "57ee292ba23307a6a6059e69b7b19ca5b624ab80" + "url": "https://github.com/joomla-framework/filesystem.git", + "reference": "6e2840a82a3958cf8f23ae869e2292d812cfa5d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/data/zipball/57ee292ba23307a6a6059e69b7b19ca5b624ab80", - "reference": "57ee292ba23307a6a6059e69b7b19ca5b624ab80", + "url": "https://api.github.com/repos/joomla-framework/filesystem/zipball/6e2840a82a3958cf8f23ae869e2292d812cfa5d3", + "reference": "6e2840a82a3958cf8f23ae869e2292d812cfa5d3", "shasum": "" }, "require": { - "joomla/compat": "~1.0", - "joomla/registry": "~1.0", - "php": ">=5.3.10|>=7.0" + "php": "^5.3.10|~7.0" }, "require-dev": { - "joomla/test": "~1.0", + "paragonie/random_compat": "~1.0|~2.0", "phpunit/phpunit": "~4.8|~5.0", "squizlabs/php_codesniffer": "1.*" }, - "time": "2016-04-02T22:20:43+00:00", + "suggest": { + "paragonie/random_compat": "Required to use Joomla\\Filesystem\\Path::isOwner()" + }, + "time": "2016-12-10T17:45:15+00:00", "type": "joomla-package", "extra": { "branch-alias": { @@ -353,53 +379,49 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Joomla\\Data\\": "src/", - "Joomla\\Data\\Tests\\": "Tests/" + "Joomla\\Filesystem\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "description": "Joomla Data Package", - "homepage": "https://github.com/joomla-framework/data", + "description": "Joomla Filesystem Package", + "homepage": "https://github.com/joomla/joomla-framework-filesystem", "keywords": [ - "data", + "filesystem", "framework", "joomla" ] }, { - "name": "joomla/registry", - "version": "1.5.2", - "version_normalized": "1.5.2.0", + "name": "joomla/filter", + "version": "1.3.3", + "version_normalized": "1.3.3.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/registry.git", - "reference": "bd3592c6f0554a72811df52aeaea98c7815f6e5a" + "url": "https://github.com/joomla-framework/filter.git", + "reference": "1ee770b83790c02d0fbcef77ad0647153e1faf74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/registry/zipball/bd3592c6f0554a72811df52aeaea98c7815f6e5a", - "reference": "bd3592c6f0554a72811df52aeaea98c7815f6e5a", + "url": "https://api.github.com/repos/joomla-framework/filter/zipball/1ee770b83790c02d0fbcef77ad0647153e1faf74", + "reference": "1ee770b83790c02d0fbcef77ad0647153e1faf74", "shasum": "" }, "require": { - "joomla/compat": "~1.0", - "joomla/utilities": "~1.0", - "php": ">=5.3.10|>=7.0", - "symfony/polyfill-php55": "~1.0" + "joomla/string": "~1.3|~2.0", + "php": "^5.3.10|~7.0" }, "require-dev": { - "joomla/test": "~1.0", - "phpunit/phpunit": "~4.8|~5.0", - "squizlabs/php_codesniffer": "1.*", - "symfony/yaml": "~2.0|~3.0" + "joomla/language": "~1.3", + "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0", + "squizlabs/php_codesniffer": "1.*" }, "suggest": { - "symfony/yaml": "Install symfony/yaml if you require YAML support." + "joomla/language": "Required only if you want to use `OutputFilter::stringURLSafe`." }, - "time": "2016-05-14T20:42:05+00:00", + "time": "2017-07-04T15:07:30+00:00", "type": "joomla-package", "extra": { "branch-alias": { @@ -409,97 +431,96 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Joomla\\Registry\\": "src/" + "Joomla\\Filter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "description": "Joomla Registry Package", - "homepage": "https://github.com/joomla-framework/registry", + "description": "Joomla Filter Package", + "homepage": "https://github.com/joomla-framework/filter", "keywords": [ + "filter", "framework", - "joomla", - "registry" + "joomla" ] }, { - "name": "psr/log", - "version": "1.0.2", - "version_normalized": "1.0.2.0", + "name": "joomla/image", + "version": "1.4.0", + "version_normalized": "1.4.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "url": "https://github.com/joomla-framework/image.git", + "reference": "d5a76037add34f95e970e9d8c8a449feeb781286" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/joomla-framework/image/zipball/d5a76037add34f95e970e9d8c8a449feeb781286", + "reference": "d5a76037add34f95e970e9d8c8a449feeb781286", "shasum": "" }, "require": { - "php": ">=5.3.0" + "ext-gd": "*", + "php": "^5.3.10|~7.0", + "psr/log": "~1.0" }, - "time": "2016-10-10T12:19:37+00:00", - "type": "library", + "require-dev": { + "joomla/test": "~1.0", + "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0", + "squizlabs/php_codesniffer": "1.*" + }, + "time": "2017-06-28T14:14:15+00:00", + "type": "joomla-package", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Joomla\\Image\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } + "GPL-2.0+" ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Joomla Image Package", + "homepage": "https://github.com/joomla-framework/image", "keywords": [ - "log", - "psr", - "psr-3" + "framework", + "image", + "joomla" ] }, { - "name": "joomla/string", - "version": "1.4.1", - "version_normalized": "1.4.1.0", + "name": "joomla/input", + "version": "1.2.0", + "version_normalized": "1.2.0.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/string.git", - "reference": "66363d317e6c020f30a70265c129281c77c43ca0" + "url": "https://github.com/joomla-framework/input.git", + "reference": "b6098276043e2d627221fe54d3c91232e6679d0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/string/zipball/66363d317e6c020f30a70265c129281c77c43ca0", - "reference": "66363d317e6c020f30a70265c129281c77c43ca0", + "url": "https://api.github.com/repos/joomla-framework/input/zipball/b6098276043e2d627221fe54d3c91232e6679d0f", + "reference": "b6098276043e2d627221fe54d3c91232e6679d0f", "shasum": "" }, "require": { - "php": "^5.3.10|~7.0" + "joomla/filter": "~1.0", + "php": ">=5.3.10" }, "require-dev": { "joomla/test": "~1.0", - "phpunit/phpunit": "~4.8|~5.0", + "phpunit/phpunit": "4.*", "squizlabs/php_codesniffer": "1.*" }, - "suggest": { - "ext-mbstring": "For improved processing" - }, - "time": "2016-12-10T18:13:42+00:00", + "time": "2014-10-12T18:01:36+00:00", "type": "joomla-package", "extra": { "branch-alias": { @@ -509,62 +530,51 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Joomla\\String\\": "src/" - }, - "files": [ - "src/phputf8/utf8.php", - "src/phputf8/ord.php", - "src/phputf8/str_ireplace.php", - "src/phputf8/str_pad.php", - "src/phputf8/str_split.php", - "src/phputf8/strcasecmp.php", - "src/phputf8/strcspn.php", - "src/phputf8/stristr.php", - "src/phputf8/strrev.php", - "src/phputf8/strspn.php", - "src/phputf8/trim.php", - "src/phputf8/ucfirst.php", - "src/phputf8/ucwords.php", - "src/phputf8/utils/ascii.php", - "src/phputf8/utils/validation.php" - ] + "Joomla\\Input\\": "src/", + "Joomla\\Input\\Tests\\": "Tests/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "description": "Joomla String Package", - "homepage": "https://github.com/joomla-framework/string", + "description": "Joomla Input Package", + "homepage": "https://github.com/joomla-framework/input", "keywords": [ "framework", - "joomla", - "string" + "input", + "joomla" ] }, { - "name": "joomla/utilities", - "version": "1.4.1", - "version_normalized": "1.4.1.0", + "name": "joomla/ldap", + "version": "1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/utilities.git", - "reference": "8913ca02aad7b929e0d52d78fd5a6961070bdbc6" + "url": "https://github.com/joomla-framework/ldap.git", + "reference": "4dce2db6a3d6d2b8c7847651ad011bb3ed7ba978" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/utilities/zipball/8913ca02aad7b929e0d52d78fd5a6961070bdbc6", - "reference": "8913ca02aad7b929e0d52d78fd5a6961070bdbc6", + "url": "https://api.github.com/repos/joomla-framework/ldap/zipball/4dce2db6a3d6d2b8c7847651ad011bb3ed7ba978", + "reference": "4dce2db6a3d6d2b8c7847651ad011bb3ed7ba978", "shasum": "" }, "require": { - "joomla/string": "~1.3", + "ext-ldap": "*", "php": "^5.3.10|~7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.0", - "squizlabs/php_codesniffer": "1.*" + "joomla/registry": "^1.4.5|~2.0", + "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0", + "squizlabs/php_codesniffer": "1.*", + "symfony/polyfill-php56": "~1.0" }, - "time": "2016-12-10T17:09:33+00:00", + "suggest": { + "symfony/polyfill-php56": "If using PHP 5.5 or earlier to use ldap_escape() function" + }, + "time": "2017-10-21T15:41:55+00:00", "type": "joomla-package", "extra": { "branch-alias": { @@ -574,150 +584,155 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Joomla\\Utilities\\": "src/" + "Joomla\\Ldap\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "description": "Joomla Utilities Package", - "homepage": "https://github.com/joomla-framework/utilities", + "description": "Joomla LDAP Package", + "homepage": "https://github.com/joomla-framework/ldap", "keywords": [ "framework", "joomla", - "utilities" + "ldap" ] }, { - "name": "joomla/session", - "version": "1.3.3", - "version_normalized": "1.3.3.0", - "target-dir": "Joomla/Session", + "name": "joomla/registry", + "version": "1.5.2", + "version_normalized": "1.5.2.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/session.git", - "reference": "1fb5df818998305fa5d4eaf18e530a388e69edc0" + "url": "https://github.com/joomla-framework/registry.git", + "reference": "bd3592c6f0554a72811df52aeaea98c7815f6e5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/session/zipball/1fb5df818998305fa5d4eaf18e530a388e69edc0", - "reference": "1fb5df818998305fa5d4eaf18e530a388e69edc0", + "url": "https://api.github.com/repos/joomla-framework/registry/zipball/bd3592c6f0554a72811df52aeaea98c7815f6e5a", + "reference": "bd3592c6f0554a72811df52aeaea98c7815f6e5a", "shasum": "" }, "require": { - "joomla/event": "~1.1", - "joomla/filter": "~1.0", - "paragonie/random_compat": "~1.0|~2.0", - "php": "^5.3.10|~7.0" + "joomla/compat": "~1.0", + "joomla/utilities": "~1.0", + "php": ">=5.3.10|>=7.0", + "symfony/polyfill-php55": "~1.0" }, "require-dev": { - "joomla/database": "~1.0", "joomla/test": "~1.0", - "phpunit/dbunit": "~1.3", "phpunit/phpunit": "~4.8|~5.0", - "squizlabs/php_codesniffer": "1.*" + "squizlabs/php_codesniffer": "1.*", + "symfony/yaml": "~2.0|~3.0" }, "suggest": { - "joomla/database": "Install joomla/database if you want to use Database session storage." + "symfony/yaml": "Install symfony/yaml if you require YAML support." }, - "time": "2016-12-21T21:08:20+00:00", + "time": "2016-05-14T20:42:05+00:00", "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, "installation-source": "dist", "autoload": { - "psr-0": { - "Joomla\\Session": "" + "psr-4": { + "Joomla\\Registry\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "description": "Joomla Session Package", - "homepage": "https://github.com/joomla-framework/session", + "description": "Joomla Registry Package", + "homepage": "https://github.com/joomla-framework/registry", "keywords": [ "framework", "joomla", - "session" + "registry" ] }, { - "name": "paragonie/random_compat", - "version": "v1.4.2", - "version_normalized": "1.4.2.0", + "name": "joomla/session", + "version": "1.3.3", + "version_normalized": "1.3.3.0", + "target-dir": "Joomla/Session", "source": { "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "965cdeb01fdcab7653253aa81d40441d261f1e66" + "url": "https://github.com/joomla-framework/session.git", + "reference": "1fb5df818998305fa5d4eaf18e530a388e69edc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/965cdeb01fdcab7653253aa81d40441d261f1e66", - "reference": "965cdeb01fdcab7653253aa81d40441d261f1e66", + "url": "https://api.github.com/repos/joomla-framework/session/zipball/1fb5df818998305fa5d4eaf18e530a388e69edc0", + "reference": "1fb5df818998305fa5d4eaf18e530a388e69edc0", "shasum": "" }, "require": { - "php": ">=5.2.0" + "joomla/event": "~1.1", + "joomla/filter": "~1.0", + "paragonie/random_compat": "~1.0|~2.0", + "php": "^5.3.10|~7.0" }, "require-dev": { - "phpunit/phpunit": "4.*|5.*" + "joomla/database": "~1.0", + "joomla/test": "~1.0", + "phpunit/dbunit": "~1.3", + "phpunit/phpunit": "~4.8|~5.0", + "squizlabs/php_codesniffer": "1.*" }, "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + "joomla/database": "Install joomla/database if you want to use Database session storage." }, - "time": "2017-03-13T16:22:52+00:00", - "type": "library", + "time": "2016-12-21T21:08:20+00:00", + "type": "joomla-package", "installation-source": "dist", "autoload": { - "files": [ - "lib/random.php" - ] + "psr-0": { + "Joomla\\Session": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } + "GPL-2.0+" ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "description": "Joomla Session Package", + "homepage": "https://github.com/joomla-framework/session", "keywords": [ - "csprng", - "pseudorandom", - "random" + "framework", + "joomla", + "session" ] }, { - "name": "joomla/filesystem", - "version": "1.3.1", - "version_normalized": "1.3.1.0", + "name": "joomla/string", + "version": "1.4.1", + "version_normalized": "1.4.1.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/filesystem.git", - "reference": "6e2840a82a3958cf8f23ae869e2292d812cfa5d3" + "url": "https://github.com/joomla-framework/string.git", + "reference": "66363d317e6c020f30a70265c129281c77c43ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/filesystem/zipball/6e2840a82a3958cf8f23ae869e2292d812cfa5d3", - "reference": "6e2840a82a3958cf8f23ae869e2292d812cfa5d3", + "url": "https://api.github.com/repos/joomla-framework/string/zipball/66363d317e6c020f30a70265c129281c77c43ca0", + "reference": "66363d317e6c020f30a70265c129281c77c43ca0", "shasum": "" }, "require": { "php": "^5.3.10|~7.0" }, "require-dev": { - "paragonie/random_compat": "~1.0|~2.0", + "joomla/test": "~1.0", "phpunit/phpunit": "~4.8|~5.0", "squizlabs/php_codesniffer": "1.*" }, "suggest": { - "paragonie/random_compat": "Required to use Joomla\\Filesystem\\Path::isOwner()" + "ext-mbstring": "For improved processing" }, - "time": "2016-12-10T17:45:15+00:00", + "time": "2016-12-10T18:13:42+00:00", "type": "joomla-package", "extra": { "branch-alias": { @@ -727,101 +742,101 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Joomla\\Filesystem\\": "src/" - } + "Joomla\\String\\": "src/" + }, + "files": [ + "src/phputf8/utf8.php", + "src/phputf8/ord.php", + "src/phputf8/str_ireplace.php", + "src/phputf8/str_pad.php", + "src/phputf8/str_split.php", + "src/phputf8/strcasecmp.php", + "src/phputf8/strcspn.php", + "src/phputf8/stristr.php", + "src/phputf8/strrev.php", + "src/phputf8/strspn.php", + "src/phputf8/trim.php", + "src/phputf8/ucfirst.php", + "src/phputf8/ucwords.php", + "src/phputf8/utils/ascii.php", + "src/phputf8/utils/validation.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "description": "Joomla Filesystem Package", - "homepage": "https://github.com/joomla/joomla-framework-filesystem", + "description": "Joomla String Package", + "homepage": "https://github.com/joomla-framework/string", "keywords": [ - "filesystem", "framework", - "joomla" + "joomla", + "string" ] }, { - "name": "joomla/archive", - "version": "1.1.5", - "version_normalized": "1.1.5.0", + "name": "joomla/uri", + "version": "1.1.1", + "version_normalized": "1.1.1.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/archive.git", - "reference": "2b5d645804c6af7c363716ba1956929f8b9665d3" + "url": "https://github.com/joomla-framework/uri.git", + "reference": "980e532e4235bb8f1ada15b28822abbeb171da3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/archive/zipball/2b5d645804c6af7c363716ba1956929f8b9665d3", - "reference": "2b5d645804c6af7c363716ba1956929f8b9665d3", + "url": "https://api.github.com/repos/joomla-framework/uri/zipball/980e532e4235bb8f1ada15b28822abbeb171da3f", + "reference": "980e532e4235bb8f1ada15b28822abbeb171da3f", "shasum": "" }, "require": { - "joomla/filesystem": "~1.3|~2.0", - "php": "^5.3.10|~7.0" - }, - "require-dev": { - "joomla/test": "~1.0", - "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0", - "squizlabs/php_codesniffer": "1.*" - }, - "suggest": { - "ext-bz2": "To extract bzip2 compressed packages", - "ext-zip": "To extract zip compressed packages", - "ext-zlib": "To extract gzip or zip compressed packages" + "php": ">=5.3.10" }, - "time": "2017-06-12T11:32:11+00:00", + "time": "2014-02-09T02:57:17+00:00", "type": "joomla-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { - "Joomla\\Archive\\": "src/" + "Joomla\\Uri\\": "src/", + "Joomla\\Uri\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "description": "Joomla Archive Package", - "homepage": "https://github.com/joomla-framework/archive", + "description": "Joomla Uri Package", + "homepage": "https://github.com/joomla-framework/uri", "keywords": [ - "archive", "framework", - "joomla" + "joomla", + "uri" ] }, { - "name": "joomla/image", - "version": "1.4.0", - "version_normalized": "1.4.0.0", + "name": "joomla/utilities", + "version": "1.4.1", + "version_normalized": "1.4.1.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/image.git", - "reference": "d5a76037add34f95e970e9d8c8a449feeb781286" + "url": "https://github.com/joomla-framework/utilities.git", + "reference": "8913ca02aad7b929e0d52d78fd5a6961070bdbc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/image/zipball/d5a76037add34f95e970e9d8c8a449feeb781286", - "reference": "d5a76037add34f95e970e9d8c8a449feeb781286", + "url": "https://api.github.com/repos/joomla-framework/utilities/zipball/8913ca02aad7b929e0d52d78fd5a6961070bdbc6", + "reference": "8913ca02aad7b929e0d52d78fd5a6961070bdbc6", "shasum": "" }, "require": { - "ext-gd": "*", - "php": "^5.3.10|~7.0", - "psr/log": "~1.0" + "joomla/string": "~1.3", + "php": "^5.3.10|~7.0" }, "require-dev": { - "joomla/test": "~1.0", - "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0", + "phpunit/phpunit": "~4.8|~5.0", "squizlabs/php_codesniffer": "1.*" }, - "time": "2017-06-28T14:14:15+00:00", + "time": "2016-12-10T17:09:33+00:00", "type": "joomla-package", "extra": { "branch-alias": { @@ -831,265 +846,379 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Joomla\\Image\\": "src/" + "Joomla\\Utilities\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "description": "Joomla Image Package", - "homepage": "https://github.com/joomla-framework/image", + "description": "Joomla Utilities Package", + "homepage": "https://github.com/joomla-framework/utilities", "keywords": [ "framework", - "image", - "joomla" + "joomla", + "utilities" ] }, { - "name": "joomla/filter", - "version": "1.3.3", - "version_normalized": "1.3.3.0", + "name": "leafo/lessphp", + "version": "v0.5.0", + "version_normalized": "0.5.0.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/filter.git", - "reference": "1ee770b83790c02d0fbcef77ad0647153e1faf74" + "url": "https://github.com/leafo/lessphp.git", + "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/filter/zipball/1ee770b83790c02d0fbcef77ad0647153e1faf74", - "reference": "1ee770b83790c02d0fbcef77ad0647153e1faf74", + "url": "https://api.github.com/repos/leafo/lessphp/zipball/0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", + "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", "shasum": "" }, - "require": { - "joomla/string": "~1.3|~2.0", - "php": "^5.3.10|~7.0" - }, - "require-dev": { - "joomla/language": "~1.3", - "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0", - "squizlabs/php_codesniffer": "1.*" - }, - "suggest": { - "joomla/language": "Required only if you want to use `OutputFilter::stringURLSafe`." - }, - "time": "2017-07-04T15:07:30+00:00", - "type": "joomla-package", + "time": "2014-11-24T18:39:20+00:00", + "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "0.4.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Joomla\\Filter\\": "src/" + "classmap": [ + "lessc.inc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT", + "GPL-3.0" + ], + "authors": [ + { + "name": "Leaf Corcoran", + "email": "leafot@gmail.com", + "homepage": "http://leafo.net" } + ], + "description": "lessphp is a compiler for LESS written in PHP.", + "homepage": "http://leafo.net/lessphp/" + }, + { + "name": "paragonie/random_compat", + "version": "v1.4.2", + "version_normalized": "1.4.2.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "965cdeb01fdcab7653253aa81d40441d261f1e66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/965cdeb01fdcab7653253aa81d40441d261f1e66", + "reference": "965cdeb01fdcab7653253aa81d40441d261f1e66", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "time": "2017-03-13T16:22:52+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "lib/random.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0+" + "MIT" ], - "description": "Joomla Filter Package", - "homepage": "https://github.com/joomla-framework/filter", + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ - "filter", - "framework", - "joomla" + "csprng", + "pseudorandom", + "random" ] }, { - "name": "joomla/application", - "version": "1.8.1", - "version_normalized": "1.8.1.0", + "name": "paragonie/sodium_compat", + "version": "v1.3.1", + "version_normalized": "1.3.1.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/application.git", - "reference": "4abf6ba23fc4454c6d9b2efd6290db0ffe6f424e" + "url": "https://github.com/paragonie/sodium_compat.git", + "reference": "6b3a59ef127445564a00e261eb1e960b6292f494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/application/zipball/4abf6ba23fc4454c6d9b2efd6290db0ffe6f424e", - "reference": "4abf6ba23fc4454c6d9b2efd6290db0ffe6f424e", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/6b3a59ef127445564a00e261eb1e960b6292f494", + "reference": "6b3a59ef127445564a00e261eb1e960b6292f494", "shasum": "" }, "require": { - "joomla/input": "~1.2|~2.0", - "joomla/registry": "^1.4.5|~2.0", - "php": "^5.3.10|~7.0", - "psr/log": "~1.0" + "paragonie/random_compat": "^1|^2", + "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7" }, "require-dev": { - "joomla/event": "~1.2|~2.0", - "joomla/session": "^1.2.1|~2.0", - "joomla/test": "~1.1", - "joomla/uri": "~1.1", - "phpunit/phpunit": "~4.8|>=5.0 <5.4", - "squizlabs/php_codesniffer": "1.*" + "phpunit/phpunit": "^3|^4|^5" }, "suggest": { - "joomla/session": "To use AbstractWebApplication with session support, install joomla/session", - "joomla/uri": "To use AbstractWebApplication, install joomla/uri" - }, - "time": "2017-07-14T12:54:12+00:00", - "type": "joomla-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } + "ext-libsodium": "Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." }, + "time": "2017-09-29T21:27:52+00:00", + "type": "library", "installation-source": "dist", "autoload": { - "psr-4": { - "Joomla\\Application\\": "src/" - } + "files": [ + "autoload.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0+" + "ISC" ], - "description": "Joomla Application Package", - "homepage": "https://github.com/joomla-framework/application", + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com" + }, + { + "name": "Frank Denis", + "email": "jedisct1@pureftpd.org" + } + ], + "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", "keywords": [ - "application", - "framework", - "joomla" + "Authentication", + "BLAKE2b", + "ChaCha20", + "ChaCha20-Poly1305", + "Chapoly", + "Curve25519", + "Ed25519", + "EdDSA", + "Edwards-curve Digital Signature Algorithm", + "Elliptic Curve Diffie-Hellman", + "Poly1305", + "Pure-PHP cryptography", + "RFC 7748", + "RFC 8032", + "Salpoly", + "Salsa20", + "X25519", + "XChaCha20-Poly1305", + "XSalsa20-Poly1305", + "Xchacha20", + "Xsalsa20", + "aead", + "cryptography", + "ecdh", + "elliptic curve", + "elliptic curve cryptography", + "encryption", + "libsodium", + "php", + "public-key cryptography", + "secret-key cryptography", + "side-channel resistant" ] }, { - "name": "joomla/ldap", - "version": "1.3.0", - "version_normalized": "1.3.0.0", + "name": "phpmailer/phpmailer", + "version": "v5.2.26", + "version_normalized": "5.2.26.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/ldap.git", - "reference": "4dce2db6a3d6d2b8c7847651ad011bb3ed7ba978" + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "70362997bda4376378be7d92d81e2200550923f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/ldap/zipball/4dce2db6a3d6d2b8c7847651ad011bb3ed7ba978", - "reference": "4dce2db6a3d6d2b8c7847651ad011bb3ed7ba978", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/70362997bda4376378be7d92d81e2200550923f7", + "reference": "70362997bda4376378be7d92d81e2200550923f7", "shasum": "" }, "require": { - "ext-ldap": "*", - "php": "^5.3.10|~7.0" + "ext-ctype": "*", + "php": ">=5.0.0" }, "require-dev": { - "joomla/registry": "^1.4.5|~2.0", - "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0", - "squizlabs/php_codesniffer": "1.*", - "symfony/polyfill-php56": "~1.0" + "doctrine/annotations": "1.2.*", + "jms/serializer": "0.16.*", + "phpdocumentor/phpdocumentor": "2.*", + "phpunit/phpunit": "4.8.*", + "symfony/debug": "2.8.*", + "symfony/filesystem": "2.8.*", + "symfony/translation": "2.8.*", + "symfony/yaml": "2.8.*", + "zendframework/zend-cache": "2.5.1", + "zendframework/zend-config": "2.5.1", + "zendframework/zend-eventmanager": "2.5.1", + "zendframework/zend-filter": "2.5.1", + "zendframework/zend-i18n": "2.5.1", + "zendframework/zend-json": "2.5.1", + "zendframework/zend-math": "2.5.1", + "zendframework/zend-serializer": "2.5.*", + "zendframework/zend-servicemanager": "2.5.*", + "zendframework/zend-stdlib": "2.5.1" }, "suggest": { - "symfony/polyfill-php56": "If using PHP 5.5 or earlier to use ldap_escape() function" + "league/oauth2-google": "Needed for Google XOAUTH2 authentication" }, - "time": "2017-10-21T15:41:55+00:00", - "type": "joomla-package", + "time": "2017-11-04T09:26:05+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "class.phpmailer.php", + "class.phpmaileroauth.php", + "class.phpmaileroauthgoogle.php", + "class.smtp.php", + "class.pop3.php", + "extras/EasyPeasyICS.php", + "extras/ntlm_sasl_client.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "description": "PHPMailer is a full-featured email creation and transfer class for PHP" + }, + { + "name": "psr/log", + "version": "1.0.2", + "version_normalized": "1.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2016-10-10T12:19:37+00:00", + "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Joomla\\Ldap\\": "src/" + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0+" + "MIT" ], - "description": "Joomla LDAP Package", - "homepage": "https://github.com/joomla-framework/ldap", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "framework", - "joomla", - "ldap" + "log", + "psr", + "psr-3" ] }, { - "name": "paragonie/sodium_compat", - "version": "v1.3.1", + "name": "simplepie/simplepie", + "version": "1.3.1", "version_normalized": "1.3.1.0", "source": { "type": "git", - "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "6b3a59ef127445564a00e261eb1e960b6292f494" + "url": "https://github.com/simplepie/simplepie.git", + "reference": "ce53709778bc1e2e4deda1651b66e5081398d5cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/6b3a59ef127445564a00e261eb1e960b6292f494", - "reference": "6b3a59ef127445564a00e261eb1e960b6292f494", + "url": "https://api.github.com/repos/simplepie/simplepie/zipball/ce53709778bc1e2e4deda1651b66e5081398d5cc", + "reference": "ce53709778bc1e2e4deda1651b66e5081398d5cc", "shasum": "" }, "require": { - "paragonie/random_compat": "^1|^2", - "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7" - }, - "require-dev": { - "phpunit/phpunit": "^3|^4|^5" - }, - "suggest": { - "ext-libsodium": "Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." + "php": ">=5.2.0" }, - "time": "2017-09-29T21:27:52+00:00", + "time": "2012-10-30T17:54:03+00:00", "type": "library", "installation-source": "dist", "autoload": { - "files": [ - "autoload.php" - ] + "psr-0": { + "SimplePie": "library" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "ISC" + "BSD-3-Clause" ], "authors": [ { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com" + "name": "Ryan Parman", + "homepage": "http://ryanparman.com/", + "role": "Creator, alumnus developer" }, { - "name": "Frank Denis", - "email": "jedisct1@pureftpd.org" + "name": "Geoffrey Sneddon", + "homepage": "http://gsnedders.com/", + "role": "Alumnus developer" + }, + { + "name": "Ryan McCue", + "email": "me@ryanmccue.info", + "homepage": "http://ryanmccue.info/", + "role": "Developer" } ], - "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", + "description": "A simple Atom/RSS parsing library for PHP", + "homepage": "http://simplepie.org/", "keywords": [ - "Authentication", - "BLAKE2b", - "ChaCha20", - "ChaCha20-Poly1305", - "Chapoly", - "Curve25519", - "Ed25519", - "EdDSA", - "Edwards-curve Digital Signature Algorithm", - "Elliptic Curve Diffie-Hellman", - "Poly1305", - "Pure-PHP cryptography", - "RFC 7748", - "RFC 8032", - "Salpoly", - "Salsa20", - "X25519", - "XChaCha20-Poly1305", - "XSalsa20-Poly1305", - "Xchacha20", - "Xsalsa20", - "aead", - "cryptography", - "ecdh", - "elliptic curve", - "elliptic curve cryptography", - "encryption", - "libsodium", - "php", - "public-key cryptography", - "secret-key cryptography", - "side-channel resistant" + "atom", + "feeds", + "rss" ] }, { @@ -1151,22 +1280,23 @@ ] }, { - "name": "symfony/polyfill-util", + "name": "symfony/polyfill-php56", "version": "v1.6.0", "version_normalized": "1.6.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-util.git", - "reference": "6e719200c8e540e0c0effeb31f96bdb344b94176" + "url": "https://github.com/symfony/polyfill-php56.git", + "reference": "265fc96795492430762c29be291a371494ba3a5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/6e719200c8e540e0c0effeb31f96bdb344b94176", - "reference": "6e719200c8e540e0c0effeb31f96bdb344b94176", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/265fc96795492430762c29be291a371494ba3a5b", + "reference": "265fc96795492430762c29be291a371494ba3a5b", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "symfony/polyfill-util": "~1.0" }, "time": "2017-10-11T12:05:26+00:00", "type": "library", @@ -1178,8 +1308,11 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Symfony\\Polyfill\\Util\\": "" - } + "Symfony\\Polyfill\\Php56\\": "" + }, + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1195,45 +1328,44 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony utilities for portability of PHP codes", + "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ - "compat", "compatibility", "polyfill", + "portable", "shim" ] }, { - "name": "symfony/polyfill-php56", - "version": "v1.6.0", - "version_normalized": "1.6.0.0", + "name": "symfony/polyfill-php73", + "version": "v1.8.0", + "version_normalized": "1.8.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "265fc96795492430762c29be291a371494ba3a5b" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "9841f6fc047725a8286ea986018355bbc9200383" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/265fc96795492430762c29be291a371494ba3a5b", - "reference": "265fc96795492430762c29be291a371494ba3a5b", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9841f6fc047725a8286ea986018355bbc9200383", + "reference": "9841f6fc047725a8286ea986018355bbc9200383", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/polyfill-util": "~1.0" + "php": ">=5.3.3" }, - "time": "2017-10-11T12:05:26+00:00", + "time": "2018-04-26T06:22:38+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.8-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php56\\": "" + "Symfony\\Polyfill\\Php73\\": "" }, "files": [ "bootstrap.php" @@ -1253,7 +1385,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -1263,83 +1395,58 @@ ] }, { - "name": "phpmailer/phpmailer", - "version": "v5.2.26", - "version_normalized": "5.2.26.0", + "name": "symfony/polyfill-util", + "version": "v1.6.0", + "version_normalized": "1.6.0.0", "source": { "type": "git", - "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "70362997bda4376378be7d92d81e2200550923f7" + "url": "https://github.com/symfony/polyfill-util.git", + "reference": "6e719200c8e540e0c0effeb31f96bdb344b94176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/70362997bda4376378be7d92d81e2200550923f7", - "reference": "70362997bda4376378be7d92d81e2200550923f7", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/6e719200c8e540e0c0effeb31f96bdb344b94176", + "reference": "6e719200c8e540e0c0effeb31f96bdb344b94176", "shasum": "" }, "require": { - "ext-ctype": "*", - "php": ">=5.0.0" - }, - "require-dev": { - "doctrine/annotations": "1.2.*", - "jms/serializer": "0.16.*", - "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "4.8.*", - "symfony/debug": "2.8.*", - "symfony/filesystem": "2.8.*", - "symfony/translation": "2.8.*", - "symfony/yaml": "2.8.*", - "zendframework/zend-cache": "2.5.1", - "zendframework/zend-config": "2.5.1", - "zendframework/zend-eventmanager": "2.5.1", - "zendframework/zend-filter": "2.5.1", - "zendframework/zend-i18n": "2.5.1", - "zendframework/zend-json": "2.5.1", - "zendframework/zend-math": "2.5.1", - "zendframework/zend-serializer": "2.5.*", - "zendframework/zend-servicemanager": "2.5.*", - "zendframework/zend-stdlib": "2.5.1" - }, - "suggest": { - "league/oauth2-google": "Needed for Google XOAUTH2 authentication" + "php": ">=5.3.3" }, - "time": "2017-11-04T09:26:05+00:00", + "time": "2017-10-11T12:05:26+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, "installation-source": "dist", "autoload": { - "classmap": [ - "class.phpmailer.php", - "class.phpmaileroauth.php", - "class.phpmaileroauthgoogle.php", - "class.smtp.php", - "class.pop3.php", - "extras/EasyPeasyICS.php", - "extras/ntlm_sasl_client.php" - ] + "psr-4": { + "Symfony\\Polyfill\\Util\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-2.1" + "MIT" ], "authors": [ { - "name": "Jim Jagielski", - "email": "jimjag@gmail.com" - }, - { - "name": "Marcus Bointon", - "email": "phpmailer@synchromedia.co.uk" - }, - { - "name": "Andy Prevost", - "email": "codeworxtech@users.sourceforge.net" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Brent R. Matzelle" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "PHPMailer is a full-featured email creation and transfer class for PHP" + "description": "Symfony utilities for portability of PHP codes", + "homepage": "https://symfony.com", + "keywords": [ + "compat", + "compatibility", + "polyfill", + "shim" + ] }, { "name": "symfony/yaml", @@ -1391,55 +1498,5 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com" - }, - { - "name": "joomla/di", - "version": "1.4.0", - "version_normalized": "1.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/joomla-framework/di.git", - "reference": "756c6eb4554b9007f69da66cf488a05308251ed8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/di/zipball/756c6eb4554b9007f69da66cf488a05308251ed8", - "reference": "756c6eb4554b9007f69da66cf488a05308251ed8", - "shasum": "" - }, - "require": { - "php": "^5.3.10|~7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0", - "squizlabs/php_codesniffer": "1.*" - }, - "time": "2017-11-12T15:35:19+00:00", - "type": "joomla-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Joomla\\DI\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0+" - ], - "description": "Joomla DI Package", - "homepage": "https://github.com/joomla-framework/di", - "keywords": [ - "container", - "dependency injection", - "di", - "framework", - "ioc", - "joomla" - ] } ] diff --git a/libraries/vendor/symfony/polyfill-php73/LICENSE b/libraries/vendor/symfony/polyfill-php73/LICENSE new file mode 100644 index 0000000000000..ad399a798d6d2 --- /dev/null +++ b/libraries/vendor/symfony/polyfill-php73/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/libraries/vendor/symfony/polyfill-php73/bootstrap.php b/libraries/vendor/symfony/polyfill-php73/bootstrap.php new file mode 100644 index 0000000000000..304b2deef2b7e --- /dev/null +++ b/libraries/vendor/symfony/polyfill-php73/bootstrap.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (PHP_VERSION_ID < 70300) { + if (!function_exists('is_countable')) { + function is_countable($var) { return is_array($var) || $var instanceof Countable || $var instanceof ResourceBundle || $var instanceof SimpleXmlElement; } + } +} From e7cda7f4ec8ad94dbf560a2a7f21e1a03270bc17 Mon Sep 17 00:00:00 2001 From: Quy Date: Fri, 18 May 2018 04:12:32 -0700 Subject: [PATCH 29/36] [com_finder] Fix regression #19969 (#20411) --- components/com_finder/helpers/html/filter.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/com_finder/helpers/html/filter.php b/components/com_finder/helpers/html/filter.php index 402959561e073..74eba0960e3d1 100644 --- a/components/com_finder/helpers/html/filter.php +++ b/components/com_finder/helpers/html/filter.php @@ -187,10 +187,9 @@ public static function slider($options = array()) // Build a node. $html .= '
'; $html .= '
'; - $html .= '
'; From c8d5db4134beba1916211ebb4acd6edd549a8ef6 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Fri, 18 May 2018 13:14:14 +0200 Subject: [PATCH 30/36] [com_finder] - fix update inner join syntax for postgres (#19964) * [com_finder] - fix update inner join syntax for postgres * drone fix cs * quoteName vs qn * cs --- .../components/com_finder/helpers/indexer/indexer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/administrator/components/com_finder/helpers/indexer/indexer.php b/administrator/components/com_finder/helpers/indexer/indexer.php index d532d54cf9ae3..34af6698cf5a6 100644 --- a/administrator/components/com_finder/helpers/indexer/indexer.php +++ b/administrator/components/com_finder/helpers/indexer/indexer.php @@ -307,8 +307,10 @@ public function remove($linkId) // Update the link counts for the terms. $query->clear() ->update($db->quoteName('#__finder_terms', 't')) - ->join('INNER', $db->quoteName('#__finder_links_terms' . dechex($i), 'm') . ' ON m.term_id = t.term_id') - ->set('t.links = t.links - 1') + ->join('INNER', $db->quoteName('#__finder_links_terms' . dechex($i), 'm') . + ' ON ' . $db->quoteName('m.term_id') . ' = ' . $db->quoteName('t.term_id') + ) + ->set($db->quoteName('links') . ' = ' . $db->quoteName('links') . ' - 1') ->where($db->quoteName('m.link_id') . ' = ' . (int) $linkId); $db->setQuery($query)->execute(); From ad803a75b69c309f17096ca8342fa29e7b9cfa71 Mon Sep 17 00:00:00 2001 From: Xabi Spacebiker Date: Fri, 18 May 2018 13:14:43 +0200 Subject: [PATCH 31/36] Update tag.php (#19951) There is a bug in getItem, the function parameter is called $pk, but in code it is using $id, so whenever the parameter is passed it is not used in the function. --- components/com_tags/models/tag.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/com_tags/models/tag.php b/components/com_tags/models/tag.php index 80247d44bc000..147fb333fc7f3 100644 --- a/components/com_tags/models/tag.php +++ b/components/com_tags/models/tag.php @@ -258,15 +258,15 @@ public function getItem($pk = null) { $this->item = false; - if (empty($id)) + if (empty($pk)) { - $id = $this->getState('tag.id'); + $pk = $this->getState('tag.id'); } // Get a level row instance. $table = JTable::getInstance('Tag', 'TagsTable'); - $idsArray = explode(',', $id); + $idsArray = explode(',', $pk); // Attempt to load the rows into an array. foreach ($idsArray as $id) From c60da2b299f168179db00f9dc3de741ab3faee7b Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Thu, 17 May 2018 21:47:46 -0500 Subject: [PATCH 32/36] Change the Administrator group's filtering to use the default blacklist --- installation/sql/mysql/joomla.sql | 2 +- installation/sql/postgresql/joomla.sql | 2 +- installation/sql/sqlazure/joomla.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 764e32d3af954..ac40588568117 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -508,7 +508,7 @@ INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `elem (19, 0, 'com_search', 'component', 'com_search', '', 1, 1, 1, 0, '', '{"enabled":"0","search_phrases":"1","search_areas":"1","show_date":"1","opensearch_name":"","opensearch_description":""}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (20, 0, 'com_templates', 'component', 'com_templates', '', 1, 1, 1, 1, '', '{"template_positions_display":"0","upload_limit":"10","image_formats":"gif,bmp,jpg,jpeg,png","source_formats":"txt,less,ini,xml,js,php,css,scss,sass","font_formats":"woff,ttf,otf","compressed_formats":"zip"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), -(23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '0000-00-00 00:00:00', 0, 0), +(23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (24, 0, 'com_redirect', 'component', 'com_redirect', '', 1, 1, 0, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0), (25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"0","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '0000-00-00 00:00:00', 0, 0), (27, 0, 'com_finder', 'component', 'com_finder', '', 1, 1, 0, 0, '', '{"enabled":"0","show_description":"1","description_length":255,"allow_empty_query":"0","show_url":"1","show_autosuggest":"1","show_suggested_query":"1","show_explained_query":"1","show_advanced":"1","show_advanced_tips":"1","expand_advanced":"0","show_date_filters":"0","sort_order":"relevance","sort_direction":"desc","highlight_terms":"1","opensearch_name":"","opensearch_description":"","batch_size":"50","memory_table_limit":30000,"title_multiplier":"1.7","text_multiplier":"0.7","meta_multiplier":"1.2","path_multiplier":"2.0","misc_multiplier":"0.3","stem":"1","stemmer":"snowball","enable_logging":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0), diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 42f10d6b6d255..80d1e3e62846c 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -522,7 +522,7 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem (19, 0, 'com_search', 'component', 'com_search', '', 1, 1, 1, 0, '', '{"enabled":"0","search_phrases":"1","search_areas":"1","show_date":"1","opensearch_name":"","opensearch_description":""}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (20, 0, 'com_templates', 'component', 'com_templates', '', 1, 1, 1, 1, '', '{"template_positions_display":"0","upload_limit":"10","image_formats":"gif,bmp,jpg,jpeg,png","source_formats":"txt,less,ini,xml,js,php,css,scss,sass","font_formats":"woff,ttf,otf","compressed_formats":"zip"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), -(23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '1970-01-01 00:00:00', 0, 0), +(23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (24, 0, 'com_redirect', 'component', 'com_redirect', '', 1, 1, 0, 1, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0), (25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"0","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '1970-01-01 00:00:00', 0, 0), (27, 0, 'com_finder', 'component', 'com_finder', '', 1, 1, 0, 0, '', '{"enabled":"0","show_description":"1","description_length":255,"allow_empty_query":"0","show_url":"1","show_autosuggest":"1","show_suggested_query":"1","show_explained_query":"1","show_advanced":"1","show_advanced_tips":"1","expand_advanced":"0","show_date_filters":"0","sort_order":"relevance","sort_direction":"desc","highlight_terms":"1","opensearch_name":"","opensearch_description":"","batch_size":"50","memory_table_limit":30000,"title_multiplier":"1.7","text_multiplier":"0.7","meta_multiplier":"1.2","path_multiplier":"2.0","misc_multiplier":"0.3","stem":"1","stemmer":"snowball","enable_logging":"0"}', '', '', 0, '1970-01-01 00:00:00', 0, 0), diff --git a/installation/sql/sqlazure/joomla.sql b/installation/sql/sqlazure/joomla.sql index 0bc5b3c0db071..993ca5edcd133 100644 --- a/installation/sql/sqlazure/joomla.sql +++ b/installation/sql/sqlazure/joomla.sql @@ -737,7 +737,7 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem (19, 0, 'com_search', 'component', 'com_search', '', 1, 1, 1, 0, '', '{"enabled":"0","search_phrases":"1","search_areas":"1","show_date":"1","opensearch_name":"","opensearch_description":""}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (20, 0, 'com_templates', 'component', 'com_templates', '', 1, 1, 1, 1, '', '{"template_positions_display":"0","upload_limit":"10","image_formats":"gif,bmp,jpg,jpeg,png","source_formats":"txt,less,ini,xml,js,php,css,scss,sass","font_formats":"woff,ttf,otf","compressed_formats":"zip"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (22, 0, 'com_content', 'component', 'com_content', '', 1, 1, 0, 1, '', '{"article_layout":"_:default","show_title":"1","link_titles":"1","show_intro":"1","show_category":"1","link_category":"1","show_parent_category":"0","link_parent_category":"0","show_author":"1","link_author":"0","show_create_date":"0","show_modify_date":"0","show_publish_date":"1","show_item_navigation":"1","show_vote":"0","show_readmore":"1","show_readmore_title":"1","readmore_limit":"100","show_icons":"1","show_print_icon":"1","show_email_icon":"0","show_hits":"1","show_noauth":"0","show_publishing_options":"1","show_article_options":"1","save_history":"1","history_limit":10,"show_urls_images_frontend":"0","show_urls_images_backend":"1","targeta":0,"targetb":0,"targetc":0,"float_intro":"left","float_fulltext":"left","category_layout":"_:blog","show_category_title":"0","show_description":"0","show_description_image":"0","maxLevel":"1","show_empty_categories":"0","show_no_articles":"1","show_subcat_desc":"1","show_cat_num_articles":"0","show_base_description":"1","maxLevelcat":"-1","show_empty_categories_cat":"0","show_subcat_desc_cat":"1","show_cat_num_articles_cat":"1","num_leading_articles":"1","num_intro_articles":"4","num_columns":"2","num_links":"4","multi_column_order":"0","show_subcategory_content":"0","show_pagination_limit":"1","filter_field":"hide","show_headings":"1","list_show_date":"0","date_format":"","list_show_hits":"1","list_show_author":"1","orderby_pri":"order","orderby_sec":"rdate","order_date":"published","show_pagination":"2","show_pagination_results":"1","show_feed_link":"1","feed_summary":"0"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), -(23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"NONE","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '1900-01-01 00:00:00', 0, 0), +(23, 0, 'com_config', 'component', 'com_config', '', 1, 1, 0, 1, '', '{"filters":{"1":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"6":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"7":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"2":{"filter_type":"NH","filter_tags":"","filter_attributes":""},"3":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"4":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"5":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"10":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"12":{"filter_type":"BL","filter_tags":"","filter_attributes":""},"8":{"filter_type":"NONE","filter_tags":"","filter_attributes":""}}}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (24, 0, 'com_redirect', 'component', 'com_redirect', '', 1, 1, 0, 1, '', '', '', '', 0, '1900-01-01 00:00:00', 0, 0), (25, 0, 'com_users', 'component', 'com_users', '', 1, 1, 0, 1, '', '{"allowUserRegistration":"0","new_usertype":"2","guest_usergroup":"9","sendpassword":"0","useractivation":"2","mail_to_admin":"1","captcha":"","frontend_userparams":"1","site_language":"0","change_login_name":"0","reset_count":"10","reset_time":"1","minimum_length":"4","minimum_integers":"0","minimum_symbols":"0","minimum_uppercase":"0","save_history":"1","history_limit":5,"mailSubjectPrefix":"","mailBodySuffix":""}', '', '', 0, '1900-01-01 00:00:00', 0, 0), (27, 0, 'com_finder', 'component', 'com_finder', '', 1, 1, 0, 0, '', '{"enabled":"0","show_description":"1","description_length":255,"allow_empty_query":"0","show_url":"1","show_autosuggest":"1","show_suggested_query":"1","show_explained_query":"1","show_advanced":"1","show_advanced_tips":"1","expand_advanced":"0","show_date_filters":"0","sort_order":"relevance","sort_direction":"desc","highlight_terms":"1","opensearch_name":"","opensearch_description":"","batch_size":"50","memory_table_limit":30000,"title_multiplier":"1.7","text_multiplier":"0.7","meta_multiplier":"1.2","path_multiplier":"2.0","misc_multiplier":"0.3","stem":"1","stemmer":"snowball","enable_logging":"0"}', '', '', 0, '1900-01-01 00:00:00', 0, 0), From ef8fba968db22cdc1a954977ac708533148b1805 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Thu, 17 May 2018 21:48:20 -0500 Subject: [PATCH 33/36] Add postinstall message explaining revised default settings --- .../postinstall/updatedefaultsettings.php | 27 +++++++++++++++++++ .../sql/updates/mysql/3.8.8-2018-05-18.sql | 3 +++ .../updates/postgresql/3.8.8-2018-05-18.sql | 3 +++ .../sql/updates/sqlazure/3.8.8-2018-05-18.sql | 2 ++ .../language/en-GB/en-GB.com_cpanel.ini | 2 ++ 5 files changed, 37 insertions(+) create mode 100644 administrator/components/com_admin/postinstall/updatedefaultsettings.php create mode 100644 administrator/components/com_admin/sql/updates/mysql/3.8.8-2018-05-18.sql create mode 100644 administrator/components/com_admin/sql/updates/postgresql/3.8.8-2018-05-18.sql create mode 100644 administrator/components/com_admin/sql/updates/sqlazure/3.8.8-2018-05-18.sql diff --git a/administrator/components/com_admin/postinstall/updatedefaultsettings.php b/administrator/components/com_admin/postinstall/updatedefaultsettings.php new file mode 100644 index 0000000000000..d8fbd67d40901 --- /dev/null +++ b/administrator/components/com_admin/postinstall/updatedefaultsettings.php @@ -0,0 +1,27 @@ +Since Joomla! 3.5 a statistics plugin will submit anonymous data to the Joomla Project. This will only submit the Joomla version, PHP version, database engine and version, and server operating system.

This data is collected to ensure that future versions of Joomla can take advantage of the latest database and PHP features without affecting significant numbers of users. The need for this became clear when a minimum of PHP 5.3.10 was required when Joomla! 3.3 implemented the more secure Bcrypt passwords.

In the interest of full transparency and to help developers this data is publicly available. An API and graphs will show the Joomla version, PHP versions and database engines in use.

If you do not wish to provide the Joomla Project with this information you can disable the plugin called System - Joomla Statistics.

" COM_CPANEL_MSG_STATS_COLLECTION_TITLE="Stats Collection in Joomla" +COM_CPANEL_MSG_UPDATEDEFAULTSETTINGS_BODY="

As part of our security team's review, we have made some changes to the default settings in a new Joomla installation. As these changes are only applied to new installations, we strongly recommend that you review these changes and update your site.

The changed settings are:

  • Global Configuration > Text Filters: The default \"Administrator\" user group has changed from \"No Filtering\" to \"Default Blacklist\"
  • Users > Send Password: The option to send a user their password in plain text when an account is created is now disabled by default
  • Media Manager: Flash files (\"swf\" file extension and \"application/x-shockwave-flash\" MIME Type) are not allowed to be uploaded
  • Articles > Show Email: The option to show an email icon with articles is disabled by default

We have created a dedicated documentation page explaining these changes.

" +COM_CPANEL_MSG_UPDATEDEFAULTSETTINGS_TITLE="Updated site security recommendations" COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="

Community resources are available for new users.

" COM_CPANEL_WELCOME_BEGINNERS_TITLE="Welcome to Joomla!" COM_CPANEL_XML_DESCRIPTION="Control Panel component" From 1979fe9b6077a938622d54571d50b0f50f59cdc9 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Thu, 17 May 2018 22:09:56 -0500 Subject: [PATCH 34/36] Prepare 3.8.8 Release Candidate --- .../com_admin/postinstall/updatedefaultsettings.php | 2 +- administrator/language/en-GB/en-GB.xml | 2 +- administrator/language/en-GB/install.xml | 2 +- administrator/manifests/files/joomla.xml | 4 ++-- administrator/manifests/packages/pkg_en-GB.xml | 2 +- installation/language/en-GB/en-GB.xml | 2 +- language/en-GB/en-GB.xml | 2 +- language/en-GB/install.xml | 2 +- libraries/src/Version.php | 10 +++++----- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/administrator/components/com_admin/postinstall/updatedefaultsettings.php b/administrator/components/com_admin/postinstall/updatedefaultsettings.php index d8fbd67d40901..d111f4d50c799 100644 --- a/administrator/components/com_admin/postinstall/updatedefaultsettings.php +++ b/administrator/components/com_admin/postinstall/updatedefaultsettings.php @@ -19,7 +19,7 @@ * * @return boolean * - * @since __DEPLOY_VERSION__ + * @since 3.8.8 */ function admin_postinstall_updatedefaultsettings_condition() { diff --git a/administrator/language/en-GB/en-GB.xml b/administrator/language/en-GB/en-GB.xml index 1d8ca75326ebf..0275e7500d2a7 100644 --- a/administrator/language/en-GB/en-GB.xml +++ b/administrator/language/en-GB/en-GB.xml @@ -2,7 +2,7 @@ English (en-GB) 3.8.8 - April 2018 + May 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/language/en-GB/install.xml b/administrator/language/en-GB/install.xml index 126f7f989dbbb..7c8918eb5447c 100644 --- a/administrator/language/en-GB/install.xml +++ b/administrator/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 3.8.8 - April 2018 + May 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 4732a3d2b1c4d..aded2aaff33e7 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,8 +6,8 @@ www.joomla.org (C) 2005 - 2018 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.8.8-dev - April 2018 + 3.8.8-rc + May 2018 FILES_JOOMLA_XML_DESCRIPTION administrator/components/com_admin/script.php diff --git a/administrator/manifests/packages/pkg_en-GB.xml b/administrator/manifests/packages/pkg_en-GB.xml index e9ace5a0d62c2..8bbba178ecf75 100644 --- a/administrator/manifests/packages/pkg_en-GB.xml +++ b/administrator/manifests/packages/pkg_en-GB.xml @@ -3,7 +3,7 @@ English (en-GB) Language Pack en-GB 3.8.8.1 - April 2018 + May 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/installation/language/en-GB/en-GB.xml b/installation/language/en-GB/en-GB.xml index 9255abb402761..abe079adad026 100644 --- a/installation/language/en-GB/en-GB.xml +++ b/installation/language/en-GB/en-GB.xml @@ -4,7 +4,7 @@ client="installation"> English (United Kingdom) 3.8.8 - April 2018 + May 2018 Joomla! Project Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/language/en-GB/en-GB.xml b/language/en-GB/en-GB.xml index 73a8f36efebc3..b7b40dc1a054f 100644 --- a/language/en-GB/en-GB.xml +++ b/language/en-GB/en-GB.xml @@ -2,7 +2,7 @@ English (en-GB) 3.8.8 - April 2018 + May 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index 93a9455f520a9..b2a7fdb24aab8 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 3.8.8 - April 2018 + May 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/libraries/src/Version.php b/libraries/src/Version.php index dbf257d03d6fe..468196263f3f8 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -60,7 +60,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = 'dev'; + const EXTRA_VERSION = 'rc'; /** * Release version. @@ -78,7 +78,7 @@ final class Version * @since 3.5 * @deprecated 4.0 Use separated version constants instead */ - const DEV_LEVEL = '8-dev'; + const DEV_LEVEL = '8-rc'; /** * Development status. @@ -86,7 +86,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Development'; + const DEV_STATUS = 'Release Candidate'; /** * Build number. @@ -111,7 +111,7 @@ final class Version * @var string * @since 3.5 */ - const RELDATE = '18-April-2018'; + const RELDATE = '18-May-2018'; /** * Release time. @@ -119,7 +119,7 @@ final class Version * @var string * @since 3.5 */ - const RELTIME = '14:00'; + const RELTIME = '12:30'; /** * Release timezone. From 4077a744908fa4488ce260886204445f9446735a Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Fri, 18 May 2018 07:46:27 -0500 Subject: [PATCH 35/36] Reset for dev --- administrator/manifests/files/joomla.xml | 2 +- libraries/src/Version.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index aded2aaff33e7..2181807c027e2 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2005 - 2018 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.8.8-rc + 3.8.8-dev May 2018 FILES_JOOMLA_XML_DESCRIPTION diff --git a/libraries/src/Version.php b/libraries/src/Version.php index 468196263f3f8..5daf457ee58b9 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -60,7 +60,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = 'rc'; + const EXTRA_VERSION = 'dev'; /** * Release version. @@ -78,7 +78,7 @@ final class Version * @since 3.5 * @deprecated 4.0 Use separated version constants instead */ - const DEV_LEVEL = '8-rc'; + const DEV_LEVEL = '8-dev'; /** * Development status. @@ -86,7 +86,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Release Candidate'; + const DEV_STATUS = 'Development'; /** * Build number. From 4909ba1bab9a3d34d527d5748ec4793dabe87ae8 Mon Sep 17 00:00:00 2001 From: wilsonge Date: Sun, 16 Dec 2018 01:16:09 +0000 Subject: [PATCH 36/36] [CLEAR CACHE] Fix codestyle --- administrator/components/com_menus/tmpl/item/edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_menus/tmpl/item/edit.php b/administrator/components/com_menus/tmpl/item/edit.php index 4ec59a7284584..a026e8a0046ab 100644 --- a/administrator/components/com_menus/tmpl/item/edit.php +++ b/administrator/components/com_menus/tmpl/item/edit.php @@ -115,7 +115,7 @@ if ($this->item->type == 'url') { $this->form->setFieldAttribute('link', 'readonly', 'false'); - $this->form->setFieldAttribute('link', 'required', 'true'); + $this->form->setFieldAttribute('link', 'required', 'true'); } echo $this->form->renderField('link');