From 066baac3aa5771194f83899384f4bdd5e45b3ce6 Mon Sep 17 00:00:00 2001 From: orware Date: Wed, 12 Feb 2014 19:22:23 -0800 Subject: [PATCH 001/809] Bind Variable Fix Within PDO Driver This fix is to revert back to original behavior needed to allow bounded variables to be used within the PDO Driver (and specifically within the Oracle Driver that inherits from it). Without the fix above, what happens is the instance of JDatabaseQuery stored in $query ends up getting replaced with a simple string on line 701 and that eventually gets stored in the parent::setQuery() call on line 708. Later, when execute() is called, since the string is not an instance of JDatabaseQuery, the checks within execute that trigger the bounded variables to be set no longer function correctly and the variables end up being unbounded and results in a query error. With the simple corrections above, the $query instance remains intact with a separate $sql variable being used instead to hold the "stringified" version of the query with the database prefix replacements and that gets used to prepare the query within the database connection. This allows the parent::setQuery() call on line 708 to still store a reference to the JDatabaseQuery instance properly and for everything to work as expected for the bounded variables. -Omar --- libraries/joomla/database/driver/pdo.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/joomla/database/driver/pdo.php b/libraries/joomla/database/driver/pdo.php index aab088e0f5f92..e382f9a1b6de1 100644 --- a/libraries/joomla/database/driver/pdo.php +++ b/libraries/joomla/database/driver/pdo.php @@ -697,11 +697,14 @@ public function setQuery($query, $offset = null, $limit = null, $driverOptions = $query->setLimit($limit, $offset); } - $query = $this->replacePrefix((string) $query); + // Create a stringified version of the query (with prefixes replaced): + $sql = $this->replacePrefix((string) $query); - $this->prepared = $this->connection->prepare($query, $driverOptions); + // Use the stringified version in the prepare call: + $this->prepared = $this->connection->prepare($sql, $driverOptions); - // Store reference to the JDatabaseQuery instance: + // Store reference to the original JDatabaseQuery instance within the class. + // This is important since binding variables depends on it within execute(): parent::setQuery($query, $offset, $limit); return $this; From 741d643c1d71e73bea626cfba3542d63a2ccc684 Mon Sep 17 00:00:00 2001 From: Witchakorn Kamolpornwijit Date: Thu, 13 Mar 2014 16:48:52 -0400 Subject: [PATCH 002/809] Remove unnecessary reset() function call in JHtmlSelect::radiolist(). Internal array pointer has not been used in JHtmlSelect::radiolist(). Therefore, the reset() call should be removed. This PR also fixes HHVM compatibility. --- libraries/cms/html/select.php | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/cms/html/select.php b/libraries/cms/html/select.php index 088a9b20eb519..38bfc5fa055d2 100644 --- a/libraries/cms/html/select.php +++ b/libraries/cms/html/select.php @@ -733,7 +733,6 @@ public static function options($arr, $optKey = 'value', $optText = 'text', $sele public static function radiolist($data, $name, $attribs = null, $optKey = 'value', $optText = 'text', $selected = null, $idtag = false, $translate = false) { - reset($data); if (is_array($attribs)) { From 0226f186088e6254fb772fc26a66a9fba7472e3a Mon Sep 17 00:00:00 2001 From: Sophist Date: Sun, 27 Jul 2014 19:14:32 +0100 Subject: [PATCH 003/809] [bug][34004]Correct icon-ban-circle Also removing unnecessary ico-file-remove definition which is redefined a few lines below. --- media/jui/css/icomoon.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/media/jui/css/icomoon.css b/media/jui/css/icomoon.css index ea051b7713e23..f3efdb8a990d5 100644 --- a/media/jui/css/icomoon.css +++ b/media/jui/css/icomoon.css @@ -205,7 +205,6 @@ .icon-plus-2:before { content: "\5d"; } -.icon-ban-circle:before, .icon-minus-sign:before, .icon-minus-2:before { content: "\5e"; @@ -232,6 +231,7 @@ .icon-not-ok:before { content: "\4b"; } +.icon-ban-circle:before, .icon-minus-circle:before { content: "\e216"; } @@ -359,7 +359,6 @@ .icon-file-plus:before { content: "\29"; } -.icon-file-remove:before, .icon-file-minus:before { content: "\e017"; } From 25d59604538ce8c0e34ddd16b23d395f91da4a26 Mon Sep 17 00:00:00 2001 From: Sophist Date: Mon, 28 Jul 2014 07:38:47 +0100 Subject: [PATCH 004/809] Make same change to icomoon.less --- media/jui/less/icomoon.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/media/jui/less/icomoon.less b/media/jui/less/icomoon.less index efa25652f1bfe..23139b6afb642 100644 --- a/media/jui/less/icomoon.less +++ b/media/jui/less/icomoon.less @@ -213,7 +213,6 @@ .icon-plus-2:before { content: "\5d"; } -.icon-ban-circle:before, .icon-minus-sign:before, .icon-minus-2:before { content: "\5e"; @@ -240,6 +239,7 @@ .icon-not-ok:before { content: "\4b"; } +.icon-ban-circle:before, .icon-minus-circle:before { content: "\e216"; } @@ -368,7 +368,6 @@ .icon-file-plus:before { content: "\29"; } -.icon-file-remove:before, .icon-file-minus:before { content: "\e017"; } From 893391d4f56d99aa773aed1bbe94102b8cfe3240 Mon Sep 17 00:00:00 2001 From: Sophist Date: Mon, 28 Jul 2014 07:55:46 +0100 Subject: [PATCH 005/809] Manual changes equivalent to running LESS --- administrator/templates/hathor/css/template.css | 3 +-- administrator/templates/isis/css/template-rtl.css | 3 +-- administrator/templates/isis/css/template.css | 3 +-- media/jui/js/icomoon-lte-ie7.js | 3 +-- templates/protostar/css/template.css | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/administrator/templates/hathor/css/template.css b/administrator/templates/hathor/css/template.css index 6f94a2d87bf45..a83b965d3dad1 100644 --- a/administrator/templates/hathor/css/template.css +++ b/administrator/templates/hathor/css/template.css @@ -250,7 +250,6 @@ .icon-plus-2:before { content: "\5d"; } -.icon-ban-circle:before, .icon-minus-sign:before, .icon-minus-2:before { content: "\5e"; @@ -277,6 +276,7 @@ .icon-not-ok:before { content: "\4b"; } +.icon-ban-circle:before, .icon-minus-circle:before { content: "\e216"; } @@ -405,7 +405,6 @@ .icon-file-plus:before { content: "\29"; } -.icon-file-remove:before, .icon-file-minus:before { content: "\e017"; } diff --git a/administrator/templates/isis/css/template-rtl.css b/administrator/templates/isis/css/template-rtl.css index cfbbe1c2b3bb8..468da99dff458 100644 --- a/administrator/templates/isis/css/template-rtl.css +++ b/administrator/templates/isis/css/template-rtl.css @@ -6410,7 +6410,6 @@ div.modal.fade.in { .icon-plus-2:before { content: "\5d"; } -.icon-ban-circle:before, .icon-minus-sign:before, .icon-minus-2:before { content: "\5e"; @@ -6437,6 +6436,7 @@ div.modal.fade.in { .icon-not-ok:before { content: "\4b"; } +.icon-ban-circle:before, .icon-minus-circle:before { content: "\e216"; } @@ -6565,7 +6565,6 @@ div.modal.fade.in { .icon-file-plus:before { content: "\29"; } -.icon-file-remove:before, .icon-file-minus:before { content: "\e017"; } diff --git a/administrator/templates/isis/css/template.css b/administrator/templates/isis/css/template.css index 15a491016e2ad..a86d7f8ddeed4 100644 --- a/administrator/templates/isis/css/template.css +++ b/administrator/templates/isis/css/template.css @@ -6410,7 +6410,6 @@ div.modal.fade.in { .icon-plus-2:before { content: "\5d"; } -.icon-ban-circle:before, .icon-minus-sign:before, .icon-minus-2:before { content: "\5e"; @@ -6437,6 +6436,7 @@ div.modal.fade.in { .icon-not-ok:before { content: "\4b"; } +.icon-ban-circle:before, .icon-minus-circle:before { content: "\e216"; } @@ -6565,7 +6565,6 @@ div.modal.fade.in { .icon-file-plus:before { content: "\29"; } -.icon-file-remove:before, .icon-file-minus:before { content: "\e017"; } diff --git a/media/jui/js/icomoon-lte-ie7.js b/media/jui/js/icomoon-lte-ie7.js index 1797ca49c5855..42f7612810b6b 100644 --- a/media/jui/js/icomoon-lte-ie7.js +++ b/media/jui/js/icomoon-lte-ie7.js @@ -75,7 +75,6 @@ window.onload = function() { 'icon-brush' : ';', 'icon-save-new' : ']', 'icon-plus-2 ' : ']', - 'icon-ban-circle' : '^', 'icon-minus-sign' : '^', 'icon-minus-2' : '^', 'icon-delete' : 'I', @@ -90,6 +89,7 @@ window.onload = function() { 'icon-plus-circle' : '', 'icon-minus' : 'K', 'icon-not-ok' : 'K', + 'icon-ban-circle' : '', 'icon-minus-circle' : '', 'icon-unpublish' : 'J', 'icon-cancel' : 'J', @@ -143,7 +143,6 @@ window.onload = function() { 'icon-file-2' : '', 'icon-file-add' : ')', 'icon-file-plus' : ')', - 'icon-file-remove' : '', 'icon-file-minus' : '', 'icon-file-check' : '', 'icon-file-remove' : '', diff --git a/templates/protostar/css/template.css b/templates/protostar/css/template.css index 567c058fb5bad..11dac006af5ed 100644 --- a/templates/protostar/css/template.css +++ b/templates/protostar/css/template.css @@ -6410,7 +6410,6 @@ div.modal.fade.in { .icon-plus-2:before { content: "\5d"; } -.icon-ban-circle:before, .icon-minus-sign:before, .icon-minus-2:before { content: "\5e"; @@ -6437,6 +6436,7 @@ div.modal.fade.in { .icon-not-ok:before { content: "\4b"; } +.icon-ban-circle:before, .icon-minus-circle:before { content: "\e216"; } @@ -6565,7 +6565,6 @@ div.modal.fade.in { .icon-file-plus:before { content: "\29"; } -.icon-file-remove:before, .icon-file-minus:before { content: "\e017"; } From 41a5233df7e7002dbf86434497b97281339fd0ab Mon Sep 17 00:00:00 2001 From: paladox2015 Date: Fri, 1 Aug 2014 00:55:28 +0100 Subject: [PATCH 006/809] Update html5.js Updating to 3.7.2 --- media/jui/js/html5.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/media/jui/js/html5.js b/media/jui/js/html5.js index dcf351c867e1e..c2e7da61a0fa1 100644 --- a/media/jui/js/html5.js +++ b/media/jui/js/html5.js @@ -1,8 +1,4 @@ -/* - HTML5 Shiv v3.6.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +/** +* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */ -(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); -a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; -c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| -"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video",version:"3.6.2",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); -for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document); From cb298dedc08adcd5aacd5c9d15860f082163ece5 Mon Sep 17 00:00:00 2001 From: Nadeeshaan Gunasinghe Date: Fri, 1 Aug 2014 22:01:29 +0530 Subject: [PATCH 007/809] Removed select star and group by --- administrator/components/com_menus/models/menus.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/administrator/components/com_menus/models/menus.php b/administrator/components/com_menus/models/menus.php index 9cc304057fff1..a7a605294ca95 100644 --- a/administrator/components/com_menus/models/menus.php +++ b/administrator/components/com_menus/models/menus.php @@ -160,10 +160,8 @@ protected function getListQuery() $query = $db->getQuery(true); // Select all fields from the table. - $query->select($this->getState('list.select', 'a.*')) - ->from($db->quoteName('#__menu_types') . ' AS a') - - ->group('a.id, a.menutype, a.title, a.description'); + $query->select($this->getState('list.select', 'DISTINCT a.id, a.menutype, a.title, a.description')) + ->from($db->quoteName('#__menu_types') . ' AS a'); // Filter by search in title or menutype if ($search = trim($this->getState('filter.search'))) From 5f076c9fc3eb6271b37398596ee99fe2997004cd Mon Sep 17 00:00:00 2001 From: Nadeeshaan Gunasinghe Date: Sat, 2 Aug 2014 20:14:31 +0530 Subject: [PATCH 008/809] removed distinct and added where clause --- administrator/components/com_menus/models/menus.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/administrator/components/com_menus/models/menus.php b/administrator/components/com_menus/models/menus.php index a7a605294ca95..ebf851ea5f6b7 100644 --- a/administrator/components/com_menus/models/menus.php +++ b/administrator/components/com_menus/models/menus.php @@ -160,8 +160,9 @@ protected function getListQuery() $query = $db->getQuery(true); // Select all fields from the table. - $query->select($this->getState('list.select', 'DISTINCT a.id, a.menutype, a.title, a.description')) - ->from($db->quoteName('#__menu_types') . ' AS a'); + $query->select($this->getState('list.select', 'a.id, a.menutype, a.title, a.description')) + ->from($db->quoteName('#__menu_types') . ' AS a') + ->where('a.id > 0'); // Filter by search in title or menutype if ($search = trim($this->getState('filter.search'))) @@ -170,9 +171,6 @@ protected function getListQuery() $query->where('(' . 'a.title LIKE ' . $search . ' OR a.menutype LIKE ' . $search . ')'); } - // Add the list ordering clause. - $query->order($db->escape($this->getState('list.ordering', 'a.id')) . ' ' . $db->escape($this->getState('list.direction', 'ASC'))); - return $query; } From 0ad0616dd44257fbb79f0140949bdc9c75a8b6fe Mon Sep 17 00:00:00 2001 From: Nadeeshaan Gunasinghe Date: Tue, 5 Aug 2014 01:50:32 +0530 Subject: [PATCH 009/809] roll back order by clause --- administrator/components/com_menus/models/menus.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/administrator/components/com_menus/models/menus.php b/administrator/components/com_menus/models/menus.php index ebf851ea5f6b7..764c6f5cdfd22 100644 --- a/administrator/components/com_menus/models/menus.php +++ b/administrator/components/com_menus/models/menus.php @@ -171,6 +171,9 @@ protected function getListQuery() $query->where('(' . 'a.title LIKE ' . $search . ' OR a.menutype LIKE ' . $search . ')'); } + // Add the list ordering clause. + $query->order($db->escape($this->getState('list.ordering', 'a.id')) . ' ' . $db->escape($this->getState('list.direction', 'ASC'))); + return $query; } From d01c99bb10bdfce009663ecc820357ed9c2822a9 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 25 Sep 2014 15:03:01 -0700 Subject: [PATCH 010/809] In reference to issue # 4349 --- libraries/joomla/form/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/joomla/form/form.php b/libraries/joomla/form/form.php index 29e503a22c7e0..d01c50733c310 100644 --- a/libraries/joomla/form/form.php +++ b/libraries/joomla/form/form.php @@ -2116,7 +2116,7 @@ public static function getInstance($name, $data = null, $options = array(), $rep protected static function addNode(SimpleXMLElement $source, SimpleXMLElement $new) { // Add the new child node. - $node = $source->addChild($new->getName(), trim($new)); + $node = $source->addChild($new->getName(), htmlspecialchars(trim($new))); // Add the attributes of the child node. foreach ($new->attributes() as $name => $value) From e71f94175c0877ee8b8aa7df060e16c145448d52 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sun, 28 Sep 2014 15:43:51 +0200 Subject: [PATCH 011/809] Use correct string in the redirect plugin --- plugins/system/redirect/redirect.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/system/redirect/redirect.xml b/plugins/system/redirect/redirect.xml index 2fa13abb0f3fa..12cc006e09aaa 100644 --- a/plugins/system/redirect/redirect.xml +++ b/plugins/system/redirect/redirect.xml @@ -8,7 +8,7 @@ admin@joomla.org www.joomla.org 3.0.0 - PLG_REDIRECT_XML_DESCRIPTION + PLG_SYSTEM_REDIRECT_XML_DESCRIPTION redirect.php index.html From ea04085944997983f3f54c2ea2c73bb1df093065 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sun, 28 Sep 2014 15:45:43 +0200 Subject: [PATCH 012/809] fix the string --- administrator/language/en-GB/en-GB.plg_system_redirect.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.plg_system_redirect.ini b/administrator/language/en-GB/en-GB.plg_system_redirect.ini index 82b67ff6ecbe7..758c74fd589aa 100644 --- a/administrator/language/en-GB/en-GB.plg_system_redirect.ini +++ b/administrator/language/en-GB/en-GB.plg_system_redirect.ini @@ -3,7 +3,7 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -PLG_REDIRECT_XML_DESCRIPTION="The system redirect plugin enables the Joomla Redirect system to catch missing pages and redirect users." PLG_SYSTEM_REDIRECT="System - Redirect" PLG_SYSTEM_REDIRECT_FIELD_COLLECT_URLS_DESC="This option controls the collection of URLs. This is useful to avoid unnecessary load on the database." PLG_SYSTEM_REDIRECT_FIELD_COLLECT_URLS_LABEL="Collect URLs" +PLG_SYSTEM_REDIRECT_XML_DESCRIPTION="The system redirect plugin enables the Joomla Redirect system to catch missing pages and redirect users." From 0e61113016832b8552cb9983996254d60d50c08b Mon Sep 17 00:00:00 2001 From: Tino Brackebusch Date: Fri, 10 Oct 2014 22:45:53 +0200 Subject: [PATCH 013/809] JHtmlBootstrap::tooltip() delay The JHtmlBootstrap::tooltip() method allows for passing an array of configuration parameters. This configuration may contain a parameter for the show/hide-delay. The value of this parameter may be an integer or a string representing a Javascript object. However, the method doesn't consider the value to be anything else than a number. So, when passing in an array the delay will end up as integer `1` because its datatype is forced by explicit an cast. I extended the line where this parameter is evaluated to check for it being an array or a number. This fixes that issue and creates the script with the correct delay-value. For example: *before* applying the patch ``` 1. someview.php JHtml::_('bootstrap.tooltip', '.hasTooltip', array( 'delay' => array('show' => 500, 'hide' => 1000) ); 2. in JHtmlBootstrap.tooltip() . . . $opt['delay'] = isset($params['delay']) ? (int) $params['delay'] : null; . . . ``` will set `$opt['delay'] = 1;` *after* applying the patch ``` 1. someview.php JHtml::_('bootstrap.tooltip', '.hasTooltip', array( 'delay' => array('show' => 500, 'hide' => 1000) ); 2. in JHtmlBootstrap.tooltip() . . . $opt['delay'] = isset($params['delay']) ? (is_array($params['delay']) ? $params['delay'] : (int) $params['delay']) : null; . . . ``` will set `$opt['delay'] = array('show' => 500, 'hide' => 1000);` , which is wished behaviour. I reported this issue several months back at the [joomlacode tracker.](http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=33041) --- libraries/cms/html/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/cms/html/bootstrap.php b/libraries/cms/html/bootstrap.php index ecfd296410563..638376a02ad79 100644 --- a/libraries/cms/html/bootstrap.php +++ b/libraries/cms/html/bootstrap.php @@ -465,7 +465,7 @@ public static function tooltip($selector = '.hasTooltip', $params = array()) $opt['selector'] = isset($params['selector']) ? (string) $params['selector'] : null; $opt['title'] = isset($params['title']) ? (string) $params['title'] : null; $opt['trigger'] = isset($params['trigger']) ? (string) $params['trigger'] : null; - $opt['delay'] = isset($params['delay']) ? (int) $params['delay'] : null; + $opt['delay'] = isset($params['delay']) ? (is_array($params['delay']) ? $params['delay'] : (int) $params['delay']) : null; $opt['container'] = isset($params['container']) ? $params['container'] : 'body'; $opt['template'] = isset($params['template']) ? (string) $params['template'] : null; $onShow = isset($params['onShow']) ? (string) $params['onShow'] : null; From b36f4ec85398137b98159eda900b20fe9eb1aaa5 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Sun, 12 Oct 2014 16:56:27 +0200 Subject: [PATCH 014/809] Remove duplicate sniff --- build/phpcs/Joomla/ruleset.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/build/phpcs/Joomla/ruleset.xml b/build/phpcs/Joomla/ruleset.xml index 61208c1627970..74b5cf0623428 100644 --- a/build/phpcs/Joomla/ruleset.xml +++ b/build/phpcs/Joomla/ruleset.xml @@ -32,7 +32,6 @@ - administrator/components/* From e5aae4360d4a2990a4334b417fe4cf0e1686e69a Mon Sep 17 00:00:00 2001 From: Matias Aguirre Date: Sun, 12 Oct 2014 19:15:52 -0300 Subject: [PATCH 015/809] Fix undefined index for REQUEST_METHOD --- libraries/joomla/input/input.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/joomla/input/input.php b/libraries/joomla/input/input.php index ac065c066a738..16aba38442a67 100644 --- a/libraries/joomla/input/input.php +++ b/libraries/joomla/input/input.php @@ -300,7 +300,9 @@ public function __call($name, $arguments) */ public function getMethod() { - $method = strtoupper($_SERVER['REQUEST_METHOD']); + // Get method if exist + $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ''; + $method = strtoupper($method); return $method; } From f1b3b36b3f9558b5c3394a2ab1566ba3d31775cb Mon Sep 17 00:00:00 2001 From: thongredweb Date: Fri, 17 Oct 2014 14:19:30 +0700 Subject: [PATCH 016/809] [fix #4140] JModelLegacy::addIncludePath is supposed to support arrays --- libraries/legacy/model/legacy.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libraries/legacy/model/legacy.php b/libraries/legacy/model/legacy.php index 226fdafed4974..3ff4ff9220e54 100644 --- a/libraries/legacy/model/legacy.php +++ b/libraries/legacy/model/legacy.php @@ -103,14 +103,22 @@ public static function addIncludePath($path = '', $prefix = '') { jimport('joomla.filesystem.path'); - if (!in_array($path, $paths[$prefix])) + if (!is_array($path)) { - array_unshift($paths[$prefix], JPath::clean($path)); + $path = array($path); } - if (!in_array($path, $paths[''])) + foreach ($path as $includePath) { - array_unshift($paths[''], JPath::clean($path)); + if (!in_array($includePath, $paths[$prefix])) + { + array_unshift($paths[$prefix], JPath::clean($includePath)); + } + + if (!in_array($includePath, $paths[''])) + { + array_unshift($paths[''], JPath::clean($includePath)); + } } } From 6b890413734e21c83ab2e0c3b360a7063858f319 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Fri, 17 Oct 2014 12:31:27 +0200 Subject: [PATCH 017/809] Expect true if $_fileopen is false. see: http://issues.joomla.org/tracker/joomla-cms/2535 #### Steps to reproduce the issue 1. configure caching to be file based in configuration.php 2. use callback as handler 3. lock the id 4. remove the cache file 5. unlock the id now #### Expected result If the cache file has beem removed, the unlock should just return true. #### Actual result Get php undefined variable notice: Notice: Undefined variable: ret in web/libraries/joomla/cache/storage/file.php on line 333 #### System information (as much as possible) Linux, Joomla 3.2 latest. --- libraries/joomla/cache/storage/file.php | 35 ++++++++++++++----------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/libraries/joomla/cache/storage/file.php b/libraries/joomla/cache/storage/file.php index cf8c12ebaaab9..5d3c0cc705303 100644 --- a/libraries/joomla/cache/storage/file.php +++ b/libraries/joomla/cache/storage/file.php @@ -55,7 +55,6 @@ public function __construct($options = array()) public function get($id, $group, $checkTime = true) { $data = false; - $path = $this->_getFilePath($id, $group); if ($checkTime == false || ($checkTime == true && $this->_checkExpire($id, $group) === true)) @@ -90,14 +89,14 @@ public function getAll() { parent::getAll(); - $path = $this->_root; + $path = $this->_root; $folders = $this->_folders($path); - $data = array(); + $data = array(); foreach ($folders as $folder) { $files = $this->_filesInFolder($path . '/' . $folder); - $item = new JCacheStorageHelper($folder); + $item = new JCacheStorageHelper($folder); foreach ($files as $file) { @@ -124,8 +123,8 @@ public function getAll() public function store($id, $group, $data) { $written = false; - $path = $this->_getFilePath($id, $group); - $die = '#x#'; + $path = $this->_getFilePath($id, $group); + $die = '#x#'; // Prepend a die string $data = $die . $data; @@ -196,7 +195,7 @@ public function clean($group, $mode = null) switch ($mode) { - case 'notgroup': + case 'notgroup' : $folders = $this->_folders($this->_root); for ($i = 0, $n = count($folders); $i < $n; $i++) @@ -207,8 +206,8 @@ public function clean($group, $mode = null) } } break; - case 'group': - default: + case 'group' : + default : if (is_dir($this->_root . '/' . $folder)) { $return = $this->_deleteFolder($this->_root . '/' . $folder); @@ -277,7 +276,7 @@ public function lock($id, $group, $locktime) $returning->locklooped = false; $looptime = $locktime * 10; - $path = $this->_getFilePath($id, $group); + $path = $this->_getFilePath($id, $group); $_fileopen = @fopen($path, "r+b"); @@ -300,7 +299,7 @@ public function lock($id, $group, $locktime) { if ($lock_counter > $looptime) { - $returning->locked = false; + $returning->locked = false; $returning->locklooped = true; break; } @@ -337,6 +336,11 @@ public function unlock($id, $group = null) $ret = @flock($_fileopen, LOCK_UN); @fclose($_fileopen); } + else + { + // Expect true if $_fileopen is false. Ref: http://issues.joomla.org/tracker/joomla-cms/2535 + $ret = true; + } return $ret; } @@ -386,14 +390,14 @@ protected function _checkExpire($id, $group) protected function _getFilePath($id, $group) { $name = $this->_getCacheId($id, $group); - $dir = $this->_root . '/' . $group; + $dir = $this->_root . '/' . $group; // If the folder doesn't exist try to create it if (!is_dir($dir)) { // Make sure the index file is there $indexFile = $dir . '/index.html'; - @ mkdir($dir) && file_put_contents($indexFile, ''); + @mkdir($dir) && file_put_contents($indexFile, ''); } // Make sure the folder exists @@ -497,6 +501,7 @@ protected function _deleteFolder($path) else { JLog::add('JCacheStorageFile::_deleteFolder' . JText::sprintf('JLIB_FILESYSTEM_ERROR_FOLDER_DELETE', $path), JLog::WARNING, 'jerror'); + $ret = false; } @@ -581,7 +586,7 @@ protected function _filesInFolder($path, $filter = '.', $recurse = false, $fullp { if (($file != '.') && ($file != '..') && (!in_array($file, $exclude)) && (!$excludefilter || !preg_match($excludefilter, $file))) { - $dir = $path . '/' . $file; + $dir = $path . '/' . $file; $isDir = is_dir($dir); if ($isDir) @@ -673,7 +678,7 @@ protected function _folders($path, $filter = '.', $recurse = false, $fullpath = && (!in_array($file, $exclude)) && (empty($excludefilter_string) || !preg_match($excludefilter_string, $file))) { - $dir = $path . '/' . $file; + $dir = $path . '/' . $file; $isDir = is_dir($dir); if ($isDir) From 5b3d448d11f37880779252021496dad87048114d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Beck=20Jensen?= Date: Tue, 21 Oct 2014 15:20:35 +0200 Subject: [PATCH 018/809] Update JFormFieldRulesTest.php --- .../suites/libraries/joomla/form/fields/JFormFieldRulesTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/suites/libraries/joomla/form/fields/JFormFieldRulesTest.php b/tests/unit/suites/libraries/joomla/form/fields/JFormFieldRulesTest.php index 4e778b5db25b8..1c952569c7feb 100644 --- a/tests/unit/suites/libraries/joomla/form/fields/JFormFieldRulesTest.php +++ b/tests/unit/suites/libraries/joomla/form/fields/JFormFieldRulesTest.php @@ -19,7 +19,7 @@ class JFormFieldRulesTest extends TestCaseDatabase { /** - * Sets up dependancies for the test. + * Sets up dependencies for the test. * * @return void */ From 9d44712b60ae2f71160581950961d01bca463874 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 15 Nov 2014 00:24:49 +0100 Subject: [PATCH 019/809] more CS --- libraries/joomla/cache/storage/file.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/joomla/cache/storage/file.php b/libraries/joomla/cache/storage/file.php index 5d3c0cc705303..eb10e4952deb3 100644 --- a/libraries/joomla/cache/storage/file.php +++ b/libraries/joomla/cache/storage/file.php @@ -275,9 +275,8 @@ public function lock($id, $group, $locktime) $returning = new stdClass; $returning->locklooped = false; - $looptime = $locktime * 10; - $path = $this->_getFilePath($id, $group); - + $looptime = $locktime * 10; + $path = $this->_getFilePath($id, $group); $_fileopen = @fopen($path, "r+b"); if ($_fileopen) @@ -327,8 +326,7 @@ public function lock($id, $group, $locktime) */ public function unlock($id, $group = null) { - $path = $this->_getFilePath($id, $group); - + $path = $this->_getFilePath($id, $group); $_fileopen = @fopen($path, "r+b"); if ($_fileopen) From f22eae76bebdbee1852d77dba8eea1d7edd0e561 Mon Sep 17 00:00:00 2001 From: paladox2015 Date: Mon, 8 Dec 2014 15:54:44 +0000 Subject: [PATCH 020/809] Create html5-uncompressed.js --- media/jui/js/html5-uncompressed.js | 322 +++++++++++++++++++++++++++++ 1 file changed, 322 insertions(+) create mode 100644 media/jui/js/html5-uncompressed.js diff --git a/media/jui/js/html5-uncompressed.js b/media/jui/js/html5-uncompressed.js new file mode 100644 index 0000000000000..77dace490002a --- /dev/null +++ b/media/jui/js/html5-uncompressed.js @@ -0,0 +1,322 @@ +/** +* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +;(function(window, document) { +/*jshint evil:true */ + /** version */ + var version = '3.7.2'; + + /** Preset options */ + var options = window.html5 || {}; + + /** Used to skip problem elements */ + var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; + + /** Not all elements can be cloned in IE **/ + var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; + + /** Detect whether the browser supports default html5 styles */ + var supportsHtml5Styles; + + /** Name of the expando, to work with multiple documents or to re-shiv one document */ + var expando = '_html5shiv'; + + /** The id for the the documents expando */ + var expanID = 0; + + /** Cached data for each document */ + var expandoData = {}; + + /** Detect whether the browser supports unknown elements */ + var supportsUnknownElements; + + (function() { + try { + var a = document.createElement('a'); + a.innerHTML = ''; + //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles + supportsHtml5Styles = ('hidden' in a); + + supportsUnknownElements = a.childNodes.length == 1 || (function() { + // assign a false positive if unable to shiv + (document.createElement)('a'); + var frag = document.createDocumentFragment(); + return ( + typeof frag.cloneNode == 'undefined' || + typeof frag.createDocumentFragment == 'undefined' || + typeof frag.createElement == 'undefined' + ); + }()); + } catch(e) { + // assign a false positive if detection fails => unable to shiv + supportsHtml5Styles = true; + supportsUnknownElements = true; + } + + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a style sheet with the given CSS text and adds it to the document. + * @private + * @param {Document} ownerDocument The document. + * @param {String} cssText The CSS text. + * @returns {StyleSheet} The style element. + */ + function addStyleSheet(ownerDocument, cssText) { + var p = ownerDocument.createElement('p'), + parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; + + p.innerHTML = 'x'; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + /** + * Returns the value of `html5.elements` as an array. + * @private + * @returns {Array} An array of shived element node names. + */ + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + /** + * Extends the built-in list of html5 elements + * @memberOf html5 + * @param {String|Array} newElements whitespace separated list or array of new element names to shiv + * @param {Document} ownerDocument The context document. + */ + function addElements(newElements, ownerDocument) { + var elements = html5.elements; + if(typeof elements != 'string'){ + elements = elements.join(' '); + } + if(typeof newElements != 'string'){ + newElements = newElements.join(' '); + } + html5.elements = elements +' '+ newElements; + shivDocument(ownerDocument); + } + + /** + * Returns the data associated to the given document + * @private + * @param {Document} ownerDocument The document. + * @returns {Object} An object of data. + */ + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + /** + * returns a shived element for the given nodeName and document + * @memberOf html5 + * @param {String} nodeName name of the element + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived element. + */ + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + // Avoid adding some elements to fragments in IE < 9 because + // * Attributes like `name` or `type` cannot be set/changed once an element + // is inserted into a document/fragment + // * Link elements with `src` attributes that are inaccessible, as with + // a 403 response, will cause the tab/window to crash + // * Script elements appended to fragments will execute when their `src` + // or `text` property is set + return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; + } + + /** + * returns a shived DocumentFragment for the given document + * @memberOf html5 + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived DocumentFragment. + */ + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;i Date: Wed, 10 Dec 2014 16:17:24 +0100 Subject: [PATCH 021/809] Allow extensions of JLog to add handlers --- libraries/joomla/log/log.php | 40 ++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/libraries/joomla/log/log.php b/libraries/joomla/log/log.php index 4e2a95cc59e36..a28692ed56bd0 100644 --- a/libraries/joomla/log/log.php +++ b/libraries/joomla/log/log.php @@ -151,9 +151,33 @@ public static function add($entry, $priority = self::INFO, $category = '', $date self::$instance->addLogEntry($entry); } + /** + * Add a logger to the JLog instance. Loggers route log entries to the correct files/systems to be logged. + * + * @param array $options The object configuration array. + * @param integer $priorities Message priority + * @param array $categories Types of entry + * @param boolean $exclude If true, all categories will be logged except those in the $categories array + * + * @return void + * + * @since 11.1 + */ + public static function addLogger(array $options, $priorities = self::ALL, $categories = array(), $exclude = false) + { + // Automatically instantiate the singleton object if not already done. + if (empty(self::$instance)) + { + self::setInstance(new JLog); + } + + self::$instance->addLoggerInternal($options, $priorities, $categories, $exclude); + } + /** * Add a logger to the JLog instance. Loggers route log entries to the correct files/systems to be logged. - * + * This method allows you to extend JLog completely. + * * @param array $options The object configuration array. * @param integer $priorities Message priority * @param array $categories Types of entry @@ -163,14 +187,8 @@ public static function add($entry, $priority = self::INFO, $category = '', $date * * @since 11.1 */ - public static function addLogger(array $options, $priorities = self::ALL, $categories = array(), $exclude = false) + protected function addLoggerInternal(array $options, $priorities = self::ALL, $categories = array(), $exclude = false) { - // Automatically instantiate the singleton object if not already done. - if (empty(self::$instance)) - { - self::setInstance(new JLog); - } - // The default logger is the formatted text log file. if (empty($options['logger'])) { @@ -197,12 +215,12 @@ public static function addLogger(array $options, $priorities = self::ALL, $categ } // Register the configuration if it doesn't exist. - if (empty(self::$instance->configurations[$signature])) + if (empty($this->configurations[$signature])) { - self::$instance->configurations[$signature] = $options; + $this->configurations[$signature] = $options; } - self::$instance->lookup[$signature] = (object) array( + $this->lookup[$signature] = (object) array( 'priorities' => $priorities, 'categories' => array_map('strtolower', (array) $categories), 'exclude' => (bool) $exclude); From 432f1a0b126a7e8fc23c9d21d0b63ea9d9e2d574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98istein=20Notn=C3=A6s?= Date: Wed, 10 Dec 2014 16:43:31 +0100 Subject: [PATCH 022/809] Replaced indentation spaces with tabs. --- libraries/joomla/log/log.php | 46 ++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/libraries/joomla/log/log.php b/libraries/joomla/log/log.php index a28692ed56bd0..c393c38a3ecc3 100644 --- a/libraries/joomla/log/log.php +++ b/libraries/joomla/log/log.php @@ -151,33 +151,33 @@ public static function add($entry, $priority = self::INFO, $category = '', $date self::$instance->addLogEntry($entry); } - /** - * Add a logger to the JLog instance. Loggers route log entries to the correct files/systems to be logged. - * - * @param array $options The object configuration array. - * @param integer $priorities Message priority - * @param array $categories Types of entry - * @param boolean $exclude If true, all categories will be logged except those in the $categories array - * - * @return void - * - * @since 11.1 - */ - public static function addLogger(array $options, $priorities = self::ALL, $categories = array(), $exclude = false) - { - // Automatically instantiate the singleton object if not already done. - if (empty(self::$instance)) - { - self::setInstance(new JLog); - } - - self::$instance->addLoggerInternal($options, $priorities, $categories, $exclude); - } + /** + * Add a logger to the JLog instance. Loggers route log entries to the correct files/systems to be logged. + * + * @param array $options The object configuration array. + * @param integer $priorities Message priority + * @param array $categories Types of entry + * @param boolean $exclude If true, all categories will be logged except those in the $categories array + * + * @return void + * + * @since 11.1 + */ + public static function addLogger(array $options, $priorities = self::ALL, $categories = array(), $exclude = false) + { + // Automatically instantiate the singleton object if not already done. + if (empty(self::$instance)) + { + self::setInstance(new JLog); + } + + self::$instance->addLoggerInternal($options, $priorities, $categories, $exclude); + } /** * Add a logger to the JLog instance. Loggers route log entries to the correct files/systems to be logged. * This method allows you to extend JLog completely. - * + * * @param array $options The object configuration array. * @param integer $priorities Message priority * @param array $categories Types of entry From 4c9624143a8aae9ba4b579c5e0f695f3abc20871 Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Tue, 6 Jan 2015 23:08:47 +0100 Subject: [PATCH 023/809] removing a part of the code seems to be the fix --- libraries/cms/form/field/tag.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/libraries/cms/form/field/tag.php b/libraries/cms/form/field/tag.php index ec6e5003aadd8..f2e796707d875 100644 --- a/libraries/cms/form/field/tag.php +++ b/libraries/cms/form/field/tag.php @@ -118,15 +118,6 @@ protected function getOptions() ->from('#__tags AS a') ->join('LEFT', $db->qn('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt'); - // Ajax tag only loads assigned values - if (!$this->isNested() && !empty($this->value)) - { - // Only item assigned values - $values = (array) $this->value; - JArrayHelper::toInteger($values); - $query->where('a.id IN (' . implode(',', $values) . ')'); - } - // Filter language if (!empty($this->element['language'])) { From f900b604a790526f45453a96bdaf317f3a84e20a Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 24 Jan 2015 13:59:26 +0100 Subject: [PATCH 024/809] Update yubikey.php --- plugins/twofactorauth/yubikey/yubikey.php | 39 +++++++++++------------ 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/plugins/twofactorauth/yubikey/yubikey.php b/plugins/twofactorauth/yubikey/yubikey.php index cc9ba9744631b..6513cae6d47f1 100644 --- a/plugins/twofactorauth/yubikey/yubikey.php +++ b/plugins/twofactorauth/yubikey/yubikey.php @@ -63,8 +63,7 @@ public function __construct(&$subject, $config = array()) */ public function onUserTwofactorIdentify() { - $section = (int) $this->params->get('section', 3); - + $section = (int) $this->params->get('section', 3); $current_section = 0; try @@ -186,8 +185,7 @@ public function onUserTwofactorApplyConfiguration($method) { try { - $app = JFactory::getApplication(); - $app->enqueueMessage(JText::_('PLG_TWOFACTORAUTH_YUBIKEY_ERR_VALIDATIONFAILED'), 'error'); + JFactory::getApplication()->enqueueMessage(JText::_('PLG_TWOFACTORAUTH_YUBIKEY_ERR_VALIDATIONFAILED'), 'error'); } catch (Exception $exc) { @@ -203,8 +201,7 @@ public function onUserTwofactorApplyConfiguration($method) if (!$check) { - $app = JFactory::getApplication(); - $app->enqueueMessage(JText::_('PLG_TWOFACTORAUTH_YUBIKEY_ERR_VALIDATIONFAILED'), 'error'); + JFactory::getApplication()->enqueueMessage(JText::_('PLG_TWOFACTORAUTH_YUBIKEY_ERR_VALIDATIONFAILED'), 'error'); // Check failed. Do not change two factor authentication settings. return false; @@ -215,11 +212,11 @@ public function onUserTwofactorApplyConfiguration($method) // Check succeedeed; return an OTP configuration object $otpConfig = (object) array( - 'method' => $this->methodName, - 'config' => array( - 'yubikey' => $yubikey + 'method' => $this->methodName, + 'config' => array( + 'yubikey' => $yubikey ), - 'otep' => array() + 'otep' => array() ); return $otpConfig; @@ -261,7 +258,7 @@ public function onUserTwofactorAuthenticate($credentials, $options) // Check if the Yubikey starts with the configured Yubikey user string $yubikey_valid = $otpConfig->config['yubikey']; - $yubikey = substr($credentials['secretkey'], 0, -32); + $yubikey = substr($credentials['secretkey'], 0, -32); $check = $yubikey == $yubikey_valid; @@ -285,25 +282,26 @@ public function onUserTwofactorAuthenticate($credentials, $options) public function validateYubikeyOTP($otp) { $server_queue = array( - 'api.yubico.com', 'api2.yubico.com', 'api3.yubico.com', - 'api4.yubico.com', 'api5.yubico.com' + 'api.yubico.com', + 'api2.yubico.com', + 'api3.yubico.com', + 'api4.yubico.com', + 'api5.yubico.com', ); shuffle($server_queue); $gotResponse = false; - $check = false; - - $http = JHttpFactory::getHttp(); + $check = false; + $http = JHttpFactory::getHttp(); $token = JSession::getFormToken(); $nonce = md5($token . uniqid(rand())); while (!$gotResponse && !empty($server_queue)) { $server = array_shift($server_queue); - - $uri = new JUri('https://' . $server . '/wsapi/2.0/verify'); + $uri = new JUri('https://' . $server . '/wsapi/2.0/verify'); // I don't see where this ID is used? $uri->setVar('id', 1); @@ -350,12 +348,11 @@ public function validateYubikeyOTP($otp) // Parse response $lines = explode("\n", $response->body); - $data = array(); + $data = array(); foreach ($lines as $line) { - $line = trim($line); - + $line = trim($line); $parts = explode('=', $line, 2); if (count($parts) < 2) From 32904c0cc1635facdc49826535de6e96bbbaed6d Mon Sep 17 00:00:00 2001 From: David Beuving Date: Wed, 4 Feb 2015 09:20:23 -0800 Subject: [PATCH 025/809] Require menu items to have a valid title, using trim to ensure a space doesn't count --- administrator/language/en-GB/en-GB.com_menus.ini | 1 + libraries/legacy/table/menu.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/administrator/language/en-GB/en-GB.com_menus.ini b/administrator/language/en-GB/en-GB.com_menus.ini index 6a9d0117cc21f..6e17297e20217 100644 --- a/administrator/language/en-GB/en-GB.com_menus.ini +++ b/administrator/language/en-GB/en-GB.com_menus.ini @@ -18,6 +18,7 @@ COM_MENUS_ERROR_ALL_LANGUAGE_ASSOCIATED="A menu item set to All languages can't COM_MENUS_ERROR_ALREADY_HOME="Menu item already set to home." COM_MENUS_ERROR_MENUTYPE="Please change the Menu type. The terms 'menu' and 'main' are reserved for Backend usage." COM_MENUS_ERROR_ONE_HOME="Only one menu item can be a home link for each language." +COM_MENUS_WARNING_PROVIDE_VALID_TITLE="Please provide a valid, non-blank title." COM_MENUS_EXTENSION_PUBLISHED_DISABLED="Component disabled and menu item published." COM_MENUS_EXTENSION_PUBLISHED_ENABLED="Component enabled and menu item published." COM_MENUS_EXTENSION_UNPUBLISHED_DISABLED="Component disabled and menu item unpublished." diff --git a/libraries/legacy/table/menu.php b/libraries/legacy/table/menu.php index db14dae2e000f..b058a74e0f78a 100644 --- a/libraries/legacy/table/menu.php +++ b/libraries/legacy/table/menu.php @@ -90,6 +90,13 @@ public function bind($array, $ignore = '') */ public function check() { + //Make sure there is a valid title, a space doesn't count + if (trim($this->title) == '') + { + $this->setError(JText::_('COM_MENUS_WARNING_PROVIDE_VALID_TITLE')); + + return false; + } // Set correct component id to ensure proper 404 messages with separator items if ($this->type == "separator") { From 258a322f832e77a1397d653ada664fab2830bc7c Mon Sep 17 00:00:00 2001 From: David Beuving Date: Wed, 4 Feb 2015 09:24:46 -0800 Subject: [PATCH 026/809] Fixing indentation/code style --- libraries/legacy/table/menu.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/legacy/table/menu.php b/libraries/legacy/table/menu.php index b058a74e0f78a..d163cb43b6d50 100644 --- a/libraries/legacy/table/menu.php +++ b/libraries/legacy/table/menu.php @@ -90,13 +90,13 @@ public function bind($array, $ignore = '') */ public function check() { - //Make sure there is a valid title, a space doesn't count - if (trim($this->title) == '') - { - $this->setError(JText::_('COM_MENUS_WARNING_PROVIDE_VALID_TITLE')); + //Make sure there is a valid title, a space doesn't count + if (trim($this->title) == '') + { + $this->setError(JText::_('COM_MENUS_WARNING_PROVIDE_VALID_TITLE')); - return false; - } + return false; + } // Set correct component id to ensure proper 404 messages with separator items if ($this->type == "separator") { From c695002020a30d5c34310fc23b141cf72ec1ea84 Mon Sep 17 00:00:00 2001 From: David Beuving Date: Wed, 4 Feb 2015 09:56:09 -0800 Subject: [PATCH 027/809] Placing language string in alphabetical order --- administrator/language/en-GB/en-GB.com_menus.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_menus.ini b/administrator/language/en-GB/en-GB.com_menus.ini index 6e17297e20217..cc34af6d3cb01 100644 --- a/administrator/language/en-GB/en-GB.com_menus.ini +++ b/administrator/language/en-GB/en-GB.com_menus.ini @@ -18,7 +18,6 @@ COM_MENUS_ERROR_ALL_LANGUAGE_ASSOCIATED="A menu item set to All languages can't COM_MENUS_ERROR_ALREADY_HOME="Menu item already set to home." COM_MENUS_ERROR_MENUTYPE="Please change the Menu type. The terms 'menu' and 'main' are reserved for Backend usage." COM_MENUS_ERROR_ONE_HOME="Only one menu item can be a home link for each language." -COM_MENUS_WARNING_PROVIDE_VALID_TITLE="Please provide a valid, non-blank title." COM_MENUS_EXTENSION_PUBLISHED_DISABLED="Component disabled and menu item published." COM_MENUS_EXTENSION_PUBLISHED_ENABLED="Component enabled and menu item published." COM_MENUS_EXTENSION_UNPUBLISHED_DISABLED="Component disabled and menu item unpublished." @@ -181,5 +180,6 @@ COM_MENUS_VIEW_ITEMS_TITLE="Menu Manager: Menu Items" COM_MENUS_VIEW_MENUS_TITLE="Menu Manager: Menus" COM_MENUS_VIEW_NEW_ITEM_TITLE="Menu Manager: New Menu Item" COM_MENUS_VIEW_NEW_MENU_TITLE="Menu Manager: Add Menu" +COM_MENUS_WARNING_PROVIDE_VALID_TITLE="Please provide a valid, non-blank title." COM_MENUS_XML_DESCRIPTION="Component for creating menus." JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
Inherited means that the permissions from global configuration and parent group will be used.
Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
2. If you select a new setting, click Save to refresh the calculated settings." From c30668db0a9ddcb54dad4284a8724e29904afac9 Mon Sep 17 00:00:00 2001 From: David Beuving Date: Wed, 4 Feb 2015 10:59:28 -0800 Subject: [PATCH 028/809] Added space in comment so it is formated correctly --- libraries/legacy/table/menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/legacy/table/menu.php b/libraries/legacy/table/menu.php index d163cb43b6d50..e85586d5fbd5a 100644 --- a/libraries/legacy/table/menu.php +++ b/libraries/legacy/table/menu.php @@ -90,7 +90,7 @@ public function bind($array, $ignore = '') */ public function check() { - //Make sure there is a valid title, a space doesn't count + // Make sure there is a valid title, a space doesn't count if (trim($this->title) == '') { $this->setError(JText::_('COM_MENUS_WARNING_PROVIDE_VALID_TITLE')); From 2a4524655e2f7a93a5eadbbd317195dfc366abfb Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Tue, 10 Feb 2015 13:20:37 +0100 Subject: [PATCH 029/809] Removing unnecessary routing code for SEF mode --- libraries/cms/pathway/site.php | 12 +----------- modules/mod_menu/helper.php | 15 +++------------ 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/libraries/cms/pathway/site.php b/libraries/cms/pathway/site.php index 5f9738eb2de97..28f8ecf38e3fc 100644 --- a/libraries/cms/pathway/site.php +++ b/libraries/cms/pathway/site.php @@ -49,7 +49,6 @@ public function __construct($options = array()) { foreach ($item->tree as $menupath) { - $url = ''; $link = $menu->getItem($menupath); switch ($link->type) @@ -77,16 +76,7 @@ public function __construct($options = array()) break; default: - $router = $app::getRouter(); - - if ($router->getMode() == JROUTER_MODE_SEF) - { - $url = 'index.php?Itemid=' . $link->id; - } - else - { - $url .= $link->link . '&Itemid=' . $link->id; - } + $url = $link->link . '&Itemid=' . $link->id; break; } diff --git a/modules/mod_menu/helper.php b/modules/mod_menu/helper.php index 361cf7b7cb86b..ac595b4eb1487 100644 --- a/modules/mod_menu/helper.php +++ b/modules/mod_menu/helper.php @@ -102,20 +102,11 @@ public static function getList(&$params) break; default: - $router = $app::getRouter(); + $item->flink = 'index.php?Itemid=' . $item->id; - if ($router->getMode() == JROUTER_MODE_SEF) + if (isset($item->query['format']) && $app->get('sef_suffix')) { - $item->flink = 'index.php?Itemid=' . $item->id; - - if (isset($item->query['format']) && $app->get('sef_suffix')) - { - $item->flink .= '&format=' . $item->query['format']; - } - } - else - { - $item->flink .= '&Itemid=' . $item->id; + $item->flink .= '&format=' . $item->query['format']; } break; } From 7555c670722f047b542644c3a58bbd86b40642b6 Mon Sep 17 00:00:00 2001 From: Gunjan Patel Date: Fri, 13 Feb 2015 18:56:10 +0530 Subject: [PATCH 030/809] [fix] Bug in setting startOffset to tabs - using localStorage all the time --- libraries/cms/html/tabs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/cms/html/tabs.php b/libraries/cms/html/tabs.php index a10af352036d2..b7e53b1c401c0 100644 --- a/libraries/cms/html/tabs.php +++ b/libraries/cms/html/tabs.php @@ -84,7 +84,7 @@ protected static function loadBehavior($group, $params = array()) $opt['onActive'] = (isset($params['onActive'])) ? '\\' . $params['onActive'] : null; $opt['onBackground'] = (isset($params['onBackground'])) ? '\\' . $params['onBackground'] : null; $opt['display'] = (isset($params['startOffset'])) ? (int) $params['startOffset'] : null; - $opt['useStorage'] = (isset($params['useCookie']) && $params['useCookie']) ? 'true' : 'false'; + $opt['useStorage'] = (isset($params['useCookie']) && $params['useCookie']) ? true : false; $opt['titleSelector'] = "dt.tabs"; $opt['descriptionSelector'] = "dd.tabs"; From 9bfa796e0fa7687914ad20c7043ea0e1af53931f Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 19:48:39 -0700 Subject: [PATCH 031/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. --- administrator/language/en-GB/en-GB.com_contact.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_contact.ini b/administrator/language/en-GB/en-GB.com_contact.ini index 1c39b9812f73f..a74b96aab8d8a 100644 --- a/administrator/language/en-GB/en-GB.com_contact.ini +++ b/administrator/language/en-GB/en-GB.com_contact.ini @@ -152,7 +152,7 @@ COM_CONTACT_FIELD_LINKD_NAME_LABEL="Link D Label" COM_CONTACT_FIELD_LINKE_DESC="Enter a URL for Link E." COM_CONTACT_FIELD_LINKE_LABEL="Link E URL" COM_CONTACT_FIELD_LINKE_NAME_LABEL="Link E Label" -COM_CONTACT_FIELD_LINKED_USER_DESC="Linked Joomla! user." +COM_CONTACT_FIELD_LINKED_USER_DESC="Linked Joomla User." COM_CONTACT_FIELD_LINKED_USER_LABEL="Linked User" COM_CONTACT_FIELD_MODIFIED_DESC="The date and time that the contact was last modified." COM_CONTACT_FIELD_NAME_DESC="Contact name." From 7ca353fd9bffd526262029bc0dd987bf0d386d3f Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 20:04:36 -0700 Subject: [PATCH 032/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. Trademark indicia added to references to the Joomla! Extensions Directory. --- .../language/en-GB/en-GB.com_installer.ini | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_installer.ini b/administrator/language/en-GB/en-GB.com_installer.ini index 5fc6994626e3e..b04adb7233d26 100644 --- a/administrator/language/en-GB/en-GB.com_installer.ini +++ b/administrator/language/en-GB/en-GB.com_installer.ini @@ -5,7 +5,7 @@ COM_INSTALLER="Installation Manager" COM_INSTALLER_AUTHOR_INFORMATION="Author Information" -COM_INSTALLER_CACHETIMEOUT_DESC="For how many hours should Joomla! cache extension update information." +COM_INSTALLER_CACHETIMEOUT_DESC="For how many hours should Joomla cache extension update information." COM_INSTALLER_CACHETIMEOUT_LABEL="Updates Caching (in hours)" COM_INSTALLER_CONFIGURATION="Installer configuration" COM_INSTALLER_ENABLED_UPDATES_1=", 1 disabled site was enabled." @@ -50,7 +50,7 @@ COM_INSTALLER_INSTALL_FROM_DIRECTORY="Install from Directory" COM_INSTALLER_INSTALL_FROM_URL="Install from URL" COM_INSTALLER_INSTALL_FROM_WEB="Install from Web" COM_INSTALLER_INSTALL_FROM_WEB_ADD_TAB="Add "Install from Web" tab" -COM_INSTALLER_INSTALL_FROM_WEB_INFO="Joomla! Extensions Directory (JED) now available with Install from Web on this page." +COM_INSTALLER_INSTALL_FROM_WEB_INFO="Joomla! Extensions Directory™ (JED) now available with Install from Web on this page." COM_INSTALLER_INSTALL_FROM_WEB_TOS="By clicking "_QQ_"Add Install from Web tab"_QQ_" below, you agree to the JED Terms of Service and all applicable third party license terms." COM_INSTALLER_INSTALL_SUCCESS="Installing %s was successful." COM_INSTALLER_INSTALL_URL="Install URL" @@ -84,9 +84,9 @@ COM_INSTALLER_MSG_DATABASE_SCHEMA_VERSION="Database schema version (in #__schema COM_INSTALLER_MSG_DATABASE_SKIPPED="%s database changes did not alter table structure and were skipped." COM_INSTALLER_MSG_DATABASE_UPDATE_VERSION="Update version (in #__extensions): %s." COM_INSTALLER_MSG_DATABASE_UPDATEVERSION_ERROR="Database update version (%s) does not match CMS version (%s)." -COM_INSTALLER_MSG_DESCFTP="For installing or uninstalling Extensions, Joomla! will most likely need your FTP account details. Please enter them in the form fields below." +COM_INSTALLER_MSG_DESCFTP="For installing or uninstalling Extensions, Joomla will most likely need your FTP account details. Please enter them in the form fields below." COM_INSTALLER_MSG_DESCFTPTITLE="FTP Login Details" -COM_INSTALLER_MSG_DISCOVER_DESCRIPTION="This screen allows you to discover extensions that have not gone through the normal installation process.
For example, some extensions are too large in file size to upload using the web interface due to limitations of the web hosting environment. Using this feature you can upload extension files directly to your web server using some other means such as FTP or SFTP and place those extension files into the appropriate directory.
You can then use the discover feature to find the newly uploaded extension and activate it in your Joomla! installation.
Using the discover operation you can also discover and install multiple extensions at the same time." +COM_INSTALLER_MSG_DISCOVER_DESCRIPTION="This screen allows you to discover extensions that have not gone through the normal installation process.
For example, some extensions are too large in file size to upload using the web interface due to limitations of the web hosting environment. Using this feature you can upload extension files directly to your web server using some other means such as FTP or SFTP and place those extension files into the appropriate directory.
You can then use the discover feature to find the newly uploaded extension and activate it in your Joomla installation.
Using the discover operation you can also discover and install multiple extensions at the same time." COM_INSTALLER_MSG_DISCOVER_FAILEDTOPURGEEXTENSIONS="Failed to purge extensions" COM_INSTALLER_MSG_DISCOVER_INSTALLFAILED="Discover install failed." COM_INSTALLER_MSG_DISCOVER_INSTALLSUCCESSFUL="Discover install successful." @@ -105,7 +105,7 @@ COM_INSTALLER_MSG_INSTALL_WARNINSTALLUPLOADERROR="There was an error uploading t COM_INSTALLER_MSG_INSTALL_WARNINSTALLZLIB="The installer can't continue until Zlib is installed." COM_INSTALLER_MSG_LANGUAGES_CANT_FIND_REMOTE_MANIFEST="The installer can't get the URL to the XML manifest file of the %s language." COM_INSTALLER_MSG_LANGUAGES_CANT_FIND_REMOTE_PACKAGE="The installer can't get the URL to the remote %s language." -COM_INSTALLER_MSG_LANGUAGES_NOLANGUAGES="There are no available languages to install at the moment. Please click on the "Find languages" button to check for updates on the Joomla Languages server. You will need an internet connection for this to work." +COM_INSTALLER_MSG_LANGUAGES_NOLANGUAGES="There are no available languages to install at the moment. Please click on the "Find languages" button to check for updates on the Joomla! Languages server. You will need an internet connection for this to work." COM_INSTALLER_MSG_LANGUAGES_TRY_LATER="Try again later or contact the language team coordinator" COM_INSTALLER_MSG_MANAGE_NOEXTENSION="There are no extensions installed matching your query." COM_INSTALLER_MSG_MANAGE_NOUPDATESITE="There are no update sites matching your query." @@ -121,10 +121,10 @@ COM_INSTALLER_MSG_WARNINGFURTHERINFO="Further information on warnings" COM_INSTALLER_MSG_WARNINGFURTHERINFODESC="For more information on warnings, see the Joomla! Documentation Site." COM_INSTALLER_MSG_WARNINGS_FILEUPLOADISDISABLEDDESC="File uploads are required to upload extensions into the installer." COM_INSTALLER_MSG_WARNINGS_FILEUPLOADSDISABLED="File uploads disabled." -COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSET="The Joomla! temporary directory is not set." -COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSETDESC="The Joomla! temporary directory is where Joomla! copies an extension, extracts the extension and the files are copied into the correct directories. If this configuration is not set in configuration.php ($tmp_path) then you won't be able to upload extensions. Create a directory to enable Joomla! to write to the directory to fix the issue." -COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLE="Joomla temporary directory not writable or does not exist." -COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLEDESC="The Joomla temporary directory is not writeable by the Joomla! instance, or may not exist, which may cause issues when attempting to upload extensions to Joomla! If you are having issues uploading extensions, make sure the directory defined in your configuration.php exists or check the '%s' and set it to be writeable and see if this fixes the issue." +COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSET="The Joomla temporary directory is not set." +COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSETDESC="The Joomla temporary directory is where Joomla copies an extension, extracts the extension and the files are copied into the correct directories. If this configuration is not set in configuration.php ($tmp_path) then you won't be able to upload extensions. Create a directory to enable Joomla! to write to the directory to fix the issue." +COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLE="The Joomla temporary directory is not writable or does not exist." +COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLEDESC="The Joomla temporary directory is not writeable by the Joomla instance, or may not exist, which may cause issues when attempting to upload extensions to Joomla. If you are having issues uploading extensions, make sure the directory defined in your configuration.php exists or check the '%s' and set it to be writeable and see if this fixes the issue." COM_INSTALLER_MSG_WARNINGS_LOWMEMORYDESC="Low PHP memory limit." COM_INSTALLER_MSG_WARNINGS_LOWMEMORYWARN="Your PHP memory limit is set below 8MB which may cause some issues when installing large extensions. Please set your memory limit to at least 16MB." COM_INSTALLER_MSG_WARNINGS_MEDMEMORYDESC="Potentially low PHP memory limit." @@ -132,9 +132,9 @@ COM_INSTALLER_MSG_WARNINGS_MEDMEMORYWARN="Your PHP memory limit is set below 16M COM_INSTALLER_MSG_WARNINGS_NONE="No warnings detected." COM_INSTALLER_MSG_WARNINGS_NOTCOMPLETE="

Warning: Update Not Complete!

The update is only partially complete. Please do the second update to complete the process.

" COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSET="The PHP temporary directory is not set." -COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSETDESC="The PHP temporary directory is the directory that PHP uses to store an uploaded file before Joomla! can access this file. Whilst the directory not being set isn't always a problem, if you are having issues with manifest files not being detected or uploaded files not being detected, setting this in your php.ini file might fix the issue." +COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTSETDESC="The PHP temporary directory is the directory that PHP uses to store an uploaded file before Joomla can access this file. Whilst the directory not being set isn't always a problem, if you are having issues with manifest files not being detected or uploaded files not being detected, setting this in your php.ini file might fix the issue." COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLE="The PHP temporary directory is not writeable." -COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLEDESC="The PHP temporary directory is not writeable by the Joomla! instance, which may cause issues when attempting to upload extensions to Joomla! If you are having issues uploading extensions, check the '%s' and set it to be writeable and see if this fixes the issue." +COM_INSTALLER_MSG_WARNINGS_PHPUPLOADNOTWRITEABLEDESC="The PHP temporary directory is not writeable by the Joomla! instance, which may cause issues when attempting to upload extensions to Joomla. If you are having issues uploading extensions, check the '%s' and set it to be writeable and see if this fixes the issue." COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZE="Small PHP maximum POST size." COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZEDESC="The maximum POST size sets the most amount of data that can be sent via POST to the server. This includes form submissions for articles, media (images, videos) and extensions. This value is less than 8MB which may impact on uploading large extensions. This is set in the php.ini under post_max_size." COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZE="Maximum PHP file upload size is too small: This is set in php.ini in both upload_max_filesize and post_max_size settings of your PHP settings (located in php.ini and/or .htaccess file)." @@ -156,11 +156,11 @@ COM_INSTALLER_PACKAGE_DOWNLOAD_FAILED="Package download failed: %s" COM_INSTALLER_PACKAGE_FILE="Package File" COM_INSTALLER_PREFERENCES_DESCRIPTION="Fine tune how extensions installation and updates work." COM_INSTALLER_PREFERENCES_LABEL="Preferences" -COM_INSTALLER_SHOW_JED_INFORMATION_DESC="Show or hide the information at the top of the installer page about the Joomla! Extensions Directory." +COM_INSTALLER_SHOW_JED_INFORMATION_DESC="Show or hide the information at the top of the installer page about the Joomla! Extensions Directory™." COM_INSTALLER_SHOW_JED_INFORMATION_HIDE_MESSAGE="Hide message" COM_INSTALLER_SHOW_JED_INFORMATION_LABEL="Joomla! Extensions Directory" COM_INSTALLER_SHOW_JED_INFORMATION_SHOW_MESSAGE="Show message" -COM_INSTALLER_SHOW_JED_INFORMATION_TOOLTIP="Opens Installer Options for setting to hide this Joomla! Extensions Directory message." +COM_INSTALLER_SHOW_JED_INFORMATION_TOOLTIP="Opens Installer Options for setting to hide this Joomla! Extensions Directory™ message." COM_INSTALLER_SUBMENU_DATABASE="Database" COM_INSTALLER_SUBMENU_DISCOVER="Discover" COM_INSTALLER_SUBMENU_INSTALL="Install" From 0360f8883ed3cb382d9ea8f0e14ee98e49e613cc Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 20:09:11 -0700 Subject: [PATCH 033/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. --- .../language/en-GB/en-GB.com_config.ini | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_config.ini b/administrator/language/en-GB/en-GB.com_config.ini index 7f185990eff2f..7bac1ccdd46a1 100644 --- a/administrator/language/en-GB/en-GB.com_config.ini +++ b/administrator/language/en-GB/en-GB.com_config.ini @@ -50,7 +50,7 @@ COM_CONFIG_FIELD_DATABASE_TYPE_DESC="The type of database in use entered during COM_CONFIG_FIELD_DATABASE_TYPE_LABEL="Database Type" COM_CONFIG_FIELD_DATABASE_USERNAME_DESC="The username for access to your database entered during the installation process. Do not edit this field unless absolutely necessary (eg the transfer of the database to a new hosting provider)." COM_CONFIG_FIELD_DATABASE_USERNAME_LABEL="Database Username" -COM_CONFIG_FIELD_DEBUG_LANG_DESC="Select whether the debugging indicators (**...**) or (??...??) for the Joomla! Language files will be displayed. Debug Language will work without Debug System being activated, but you will not get the additional detailed references that will help you correct any errors." +COM_CONFIG_FIELD_DEBUG_LANG_DESC="Select whether the debugging indicators (**...**) or (??...??) for the Joomla Language files will be displayed. Debug Language will work without Debug System being activated, but you will not get the additional detailed references that will help you correct any errors." COM_CONFIG_FIELD_DEBUG_LANG_LABEL="Debug Language" COM_CONFIG_FIELD_DEBUG_SYSTEM_DESC="If enabled, diagnostic information, language translation and SQL errors (if present) will be displayed. The information will be displayed at the foot of every page you view within the Joomla Backend and Frontend. It is not advisable to leave the debug mode activated when running a live website." COM_CONFIG_FIELD_DEBUG_SYSTEM_LABEL="Debug System" @@ -80,7 +80,7 @@ COM_CONFIG_FRONTEDITING_MENUSANDMODULES_ADMIN_TOO="Modules & Menus (admin too)" COM_CONFIG_FRONTEDITING_MODULES="Modules" COM_CONFIG_FIELD_FORCE_SSL_DESC="Force site access to always occur under SSL (https) for selected areas. You will not be able to access selected areas under non-ssl. Note, you must have SSL enabled on your server to utilise this option." COM_CONFIG_FIELD_FORCE_SSL_LABEL="Force SSL" -COM_CONFIG_FIELD_FTP_ENABLE_DESC="Enable the built in FTP (File Transfer Protocol) functionality which is needed in some server environments to be used instead of the normal upload functionality of Joomla!" +COM_CONFIG_FIELD_FTP_ENABLE_DESC="Enable the built in FTP (File Transfer Protocol) functionality which is needed in some server environments to be used instead of the normal upload functionality of Joomla." COM_CONFIG_FIELD_FTP_ENABLE_LABEL="Enable FTP" COM_CONFIG_FIELD_FTP_HOST_DESC="Enter the name of the host of your FTP server." COM_CONFIG_FIELD_FTP_HOST_LABEL="FTP Host" @@ -148,13 +148,13 @@ COM_CONFIG_FIELD_METAKEYS_DESC="Enter the keywords and phrases that best describ COM_CONFIG_FIELD_METAKEYS_LABEL="Site Meta Keywords" COM_CONFIG_FIELD_METALANGUAGE_DESC="Places the selected language in the metadata for the site." COM_CONFIG_FIELD_METALANGUAGE_LABEL="Site Meta Language" -COM_CONFIG_FIELD_METAVERSION_LABEL="Show Joomla! Version" -COM_CONFIG_FIELD_METAVERSION_DESC="Show the Joomla! version number in the generator meta tag." +COM_CONFIG_FIELD_METAVERSION_LABEL="Show Joomla Version" +COM_CONFIG_FIELD_METAVERSION_DESC="Show the Joomla version number in the generator meta tag." COM_CONFIG_FIELD_OFFLINE_IMAGE_DESC="An optional image to be displayed on the default offline page. Make sure the image is less than 400px wide." COM_CONFIG_FIELD_OFFLINE_IMAGE_LABEL="Offline Image" COM_CONFIG_FIELD_OFFLINE_MESSAGE_DESC="The custom offline message will be used if the 'Offline Message' field is set to 'Use Custom Message'." COM_CONFIG_FIELD_OFFLINE_MESSAGE_LABEL="Custom Message" -COM_CONFIG_FIELD_PROXY_ENABLE_DESC="Enable Joomla to use a proxy which is needed in some server environments in order to fetch URLs like in the Joomla! Update component." +COM_CONFIG_FIELD_PROXY_ENABLE_DESC="Enable Joomla to use a proxy which is needed in some server environments in order to fetch URLs like in the Joomla Update component." COM_CONFIG_FIELD_PROXY_ENABLE_LABEL="Enable Proxy" COM_CONFIG_FIELD_PROXY_HOST_DESC="Enter the name of the host of your Proxy server." COM_CONFIG_FIELD_PROXY_HOST_LABEL="Proxy Host" @@ -164,7 +164,7 @@ COM_CONFIG_FIELD_PROXY_PORT_DESC="Enter the port that Proxy should be accessed b COM_CONFIG_FIELD_PROXY_PORT_LABEL="Proxy Port" COM_CONFIG_FIELD_PROXY_USERNAME_DESC="The username used to access the Proxy server." COM_CONFIG_FIELD_PROXY_USERNAME_LABEL="Proxy Username" -COM_CONFIG_FIELD_SECRET_DESC="This is an auto-generated, unique alphanumeric code for every Joomla! installation. It is used for security functions." +COM_CONFIG_FIELD_SECRET_DESC="This is an auto-generated, unique alphanumeric code for every Joomla installation. It is used for security functions." COM_CONFIG_FIELD_SECRET_LABEL="Secret" COM_CONFIG_FIELD_SEF_REWRITE_DESC="Select to use a server's rewrite engine to catch URLs that meet specific conditions and rewrite them as directed. Available for IIS 7 and Apache.
Apache users only!
Rename htaccess.txt to .htaccess before activating.
IIS 7 users only!
Rename web.config.txt to web.config and install IIS URL Rewrite Module before activating.
" COM_CONFIG_FIELD_SEF_REWRITE_LABEL="Use URL Rewriting" @@ -174,7 +174,7 @@ COM_CONFIG_FIELD_SEF_URL_DESC="Select whether or not the URLs are optimised for COM_CONFIG_FIELD_SEF_URL_LABEL="Search Engine Friendly URLs" COM_CONFIG_FIELD_SERVER_TIMEZONE_DESC="Choose a city in the list to configure the date and time for display." COM_CONFIG_FIELD_SERVER_TIMEZONE_LABEL="Server Time Zone" -COM_CONFIG_FIELD_SESSION_HANDLER_DESC="The mechanism by which Joomla! identifies a User once they are connected to the website using non-persistent cookies." +COM_CONFIG_FIELD_SESSION_HANDLER_DESC="The mechanism by which Joomla identifies a User once they are connected to the website using non-persistent cookies." COM_CONFIG_FIELD_SESSION_HANDLER_LABEL="Session Handler" COM_CONFIG_FIELD_SESSION_TIME_DESC="Auto log out a User after they have been inactive for the entered number of minutes. Do not set too high." COM_CONFIG_FIELD_SESSION_TIME_LABEL="Session Lifetime" @@ -213,7 +213,7 @@ COM_CONFIG_FIELD_VALUE_SSL="SSL" COM_CONFIG_FIELD_VALUE_SYSTEM_DEFAULT="System Default" COM_CONFIG_FIELD_VALUE_TLS="TLS" COM_CONFIG_FTP_DETAILS="FTP Login Details" -COM_CONFIG_FTP_DETAILS_TIP="For updating your configuration.php file, Joomla! will most likely need your FTP account details. Please enter them in the form fields below." +COM_CONFIG_FTP_DETAILS_TIP="For updating your configuration.php file, Joomla will most likely need your FTP account details. Please enter them in the form fields below." COM_CONFIG_FTP_SETTINGS="FTP Settings" COM_CONFIG_GLOBAL_CONFIGURATION="Global Configuration" COM_CONFIG_HELPREFRESH_SUCCESS="The Help Sites list has been refreshed." From d9c0ff54d939f51eec5ba66810339126ae35f45f Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 20:12:43 -0700 Subject: [PATCH 034/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. --- administrator/language/en-GB/en-GB.com_installer.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_installer.ini b/administrator/language/en-GB/en-GB.com_installer.ini index b04adb7233d26..12f980b933480 100644 --- a/administrator/language/en-GB/en-GB.com_installer.ini +++ b/administrator/language/en-GB/en-GB.com_installer.ini @@ -122,7 +122,7 @@ COM_INSTALLER_MSG_WARNINGFURTHERINFODESC="For more information on warnings, see COM_INSTALLER_MSG_WARNINGS_FILEUPLOADISDISABLEDDESC="File uploads are required to upload extensions into the installer." COM_INSTALLER_MSG_WARNINGS_FILEUPLOADSDISABLED="File uploads disabled." COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSET="The Joomla temporary directory is not set." -COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSETDESC="The Joomla temporary directory is where Joomla copies an extension, extracts the extension and the files are copied into the correct directories. If this configuration is not set in configuration.php ($tmp_path) then you won't be able to upload extensions. Create a directory to enable Joomla! to write to the directory to fix the issue." +COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTSETDESC="The Joomla temporary directory is where Joomla copies an extension, extracts the extension and the files are copied into the correct directories. If this configuration is not set in configuration.php ($tmp_path) then you won't be able to upload extensions. Create a directory to enable Joomla to write to the directory to fix the issue." COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLE="The Joomla temporary directory is not writable or does not exist." COM_INSTALLER_MSG_WARNINGS_JOOMLATMPNOTWRITEABLEDESC="The Joomla temporary directory is not writeable by the Joomla instance, or may not exist, which may cause issues when attempting to upload extensions to Joomla. If you are having issues uploading extensions, make sure the directory defined in your configuration.php exists or check the '%s' and set it to be writeable and see if this fixes the issue." COM_INSTALLER_MSG_WARNINGS_LOWMEMORYDESC="Low PHP memory limit." From 22cb1e5b9160339196c02f00b430e8f4613606c6 Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 20:14:13 -0700 Subject: [PATCH 035/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. --- administrator/language/en-GB/en-GB.com_joomlaupdate.sys.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_joomlaupdate.sys.ini b/administrator/language/en-GB/en-GB.com_joomlaupdate.sys.ini index d0d992eaa25dc..fc0820108eacd 100644 --- a/administrator/language/en-GB/en-GB.com_joomlaupdate.sys.ini +++ b/administrator/language/en-GB/en-GB.com_joomlaupdate.sys.ini @@ -4,4 +4,4 @@ ; Note : All ini files need to be saved as UTF-8 COM_JOOMLAUPDATE="Joomla! Update" -COM_JOOMLAUPDATE_XML_DESCRIPTION="One-click update to the latest Joomla! release." \ No newline at end of file +COM_JOOMLAUPDATE_XML_DESCRIPTION="One-click update to the latest Joomla release." From e77dd23c4fb5178e4b8149b1dd7136db77bca260 Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 20:19:19 -0700 Subject: [PATCH 036/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. --- .../language/en-GB/en-GB.com_joomlaupdate.ini | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_joomlaupdate.ini b/administrator/language/en-GB/en-GB.com_joomlaupdate.ini index a73060a6e94a8..d75a1d9e17f8e 100644 --- a/administrator/language/en-GB/en-GB.com_joomlaupdate.ini +++ b/administrator/language/en-GB/en-GB.com_joomlaupdate.ini @@ -5,12 +5,12 @@ COM_JOOMLAUPDATE_CONFIG_CUSTOMURL_DESC="This is a custom XML update source URL, used only when the "Update Source" option is set to "Custom URL"." COM_JOOMLAUPDATE_CONFIG_CUSTOMURL_LABEL="Custom URL" -COM_JOOMLAUPDATE_CONFIG_SOURCES_DESC="Configure where Joomla! gets its update information from." +COM_JOOMLAUPDATE_CONFIG_SOURCES_DESC="Configure where Joomla gets its update information from." COM_JOOMLAUPDATE_CONFIG_SOURCES_LABEL="Update Source" COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_CUSTOM="Custom URL" COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_CUSTOM_ERROR="The custom URL field is empty." COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DEFAULT="Default" -COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DESC="The update channel Joomla! will use to find out if there is an update available." +COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DESC="The update channel Joomla will use to find out if there is an update available." COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_LABEL="Update Channel" COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT="Joomla! Next" COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_TESTING="Testing" @@ -24,7 +24,7 @@ COM_JOOMLAUPDATE_UPDATE_LOG_FINALISE="Finalising installation." COM_JOOMLAUPDATE_UPDATE_LOG_START="Update started by user %2$s (%1$s). Old version is %3$s." COM_JOOMLAUPDATE_UPDATE_LOG_INSTALL="Starting installation of new version." COM_JOOMLAUPDATE_UPDATE_LOG_URL="Downloading update file from %s." -COM_JOOMLAUPDATE_VIEW_COMPLETE_HEADING="Joomla! Version Update Status" +COM_JOOMLAUPDATE_VIEW_COMPLETE_HEADING="Joomla Version Update Status" COM_JOOMLAUPDATE_VIEW_COMPLETE_MESSAGE="Your site has been successfully updated. Your Joomla version is now %s." COM_JOOMLAUPDATE_VIEW_DEFAULT_DOWNLOAD_IN_PROGRESS="Downloading update file. Please wait ..." COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_DIRECTORY="FTP directory" @@ -33,26 +33,26 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_PASSWORD="FTP password" COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_PORT="FTP port" COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_USERNAME="FTP username" COM_JOOMLAUPDATE_VIEW_DEFAULT_INFOURL="Additional Information" -COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLED="Installed Joomla! version" +COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLED="Installed Joomla version" COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLUPDATE="Install the Update" -COM_JOOMLAUPDATE_VIEW_DEFAULT_LATEST="Latest Joomla! version" +COM_JOOMLAUPDATE_VIEW_DEFAULT_LATEST="Latest Joomla version" COM_JOOMLAUPDATE_VIEW_DEFAULT_METHOD_DIRECT="Write files directly" COM_JOOMLAUPDATE_VIEW_DEFAULT_METHOD_FTP="Write files using FTP" COM_JOOMLAUPDATE_VIEW_DEFAULT_METHOD="Installation method" COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATES="No updates available." -COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATESNOTICE="You already have the latest Joomla! version, %s." +COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATESNOTICE="You already have the latest Joomla version, %s." COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE="Update package URL" -COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATEFOUND="A Joomla! update was found." -COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATE_NOTICE="Before you update Joomla!, ensure that the installed extensions are available for the new Joomla! version." +COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATEFOUND="A Joomla update was found." +COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATE_NOTICE="Before you update Joomla, ensure that the installed extensions are available for the new Joomla version." COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_CUSTOM="You are on the "%s" update channel. This is not an official Joomla! update channel." COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_DEFAULT="You are on the "%s" update channel. Through this channel you'll receive notifications for all updates of the current Joomla! release (3.x)" COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_NEXT="You are on the "%s" update channel. Through this channel you'll receive notifications for all updates of the current Joomla! release (3.x) and you will also be notified when the future major release (4.x) will be available. Before upgrading to 4.x you'll need to assess its compatibility with your environment." -COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_TESTING="You are on the "%s" update channel. This channel is designed for testing new releases and fixes in Joomla!
It is only intended for JBS (Joomla! Bug Squad) members and others within the Joomla! community who are testing. Do not use this setting on a production site." +COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_TESTING="You are on the "%s" update channel. This channel is designed for testing new releases and fixes in Joomla.
It is only intended for JBS (Joomla! Bug Squad™) members and others within the Joomla community who are testing. Do not use this setting on a production site." COM_JOOMLAUPDATE_VIEW_PROGRESS="Update progress" COM_JOOMLAUPDATE_VIEW_UPDATE_BYTESEXTRACTED="Bytes extracted" COM_JOOMLAUPDATE_VIEW_UPDATE_BYTESREAD="Bytes read" COM_JOOMLAUPDATE_VIEW_UPDATE_DOWNLOADFAILED="Download of update package failed." COM_JOOMLAUPDATE_VIEW_UPDATE_FILESEXTRACTED="Files extracted" -COM_JOOMLAUPDATE_VIEW_UPDATE_INPROGRESS="Updating your Joomla! files. Please wait ..." +COM_JOOMLAUPDATE_VIEW_UPDATE_INPROGRESS="Updating your Joomla files. Please wait ..." COM_JOOMLAUPDATE_VIEW_UPDATE_PERCENT="Percent complete" -COM_JOOMLAUPDATE_XML_DESCRIPTION="Updates Joomla! to the latest version with one click." +COM_JOOMLAUPDATE_XML_DESCRIPTION="Updates Joomla to the latest version with one click." From d8860090eae00853f4b4a7e09df8f9f30a1ca7e5 Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 20:21:43 -0700 Subject: [PATCH 037/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. --- administrator/language/en-GB/en-GB.com_languages.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_languages.ini b/administrator/language/en-GB/en-GB.com_languages.ini index b6040a750d913..4f576a7bd3142 100644 --- a/administrator/language/en-GB/en-GB.com_languages.ini +++ b/administrator/language/en-GB/en-GB.com_languages.ini @@ -43,7 +43,7 @@ COM_LANGUAGES_FIELD_TITLE_DESC="The name of the language as it will appear in th COM_LANGUAGES_FIELD_TITLE_NATIVE_DESC="Title in native language." COM_LANGUAGES_FIELD_TITLE_NATIVE_LABEL="Title Native" COM_LANGUAGES_FILTER_CLIENT_LABEL="Filter Location:" -COM_LANGUAGES_FTP_DESC="For setting Languages as default, Joomla! will most likely need your FTP account details. Please enter them in the form fields below." +COM_LANGUAGES_FTP_DESC="For setting Languages as default, Joomla will most likely need your FTP account details. Please enter them in the form fields below." COM_LANGUAGES_FTP_TITLE="FTP Login Details" COM_LANGUAGES_HEADING_AUTHOR_EMAIL="Author Email" COM_LANGUAGES_HEADING_DEFAULT="Default" @@ -64,7 +64,7 @@ COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED_INCLUDING_ALL="Published Default H COM_LANGUAGES_MULTILANGSTATUS_LANGSWITCHER_PUBLISHED="Published Language Switcher Modules." COM_LANGUAGES_MULTILANGSTATUS_LANGSWITCHER_UNPUBLISHED="This site is set as a multilingual site, at least one Language Switcher module set to language "All" has to be published. Disregard this message if you do not use a language switcher module but direct links." COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER="Language Filter Plugin" -COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER_DISABLED="This site is set as a multilingual site. The Languagefilter plugin is not enabled although one or more Language Switcher modules OR/AND one or more specific Content language Default Home pages are published." +COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER_DISABLED="This site is set as a multilingual site. The Language Filter plugin is not enabled although one or more Language Switcher modules OR/AND one or more specific Content language Default Home pages are published." COM_LANGUAGES_MULTILANGSTATUS_NONE="This site is not set as a multilingual site." COM_LANGUAGES_MULTILANGSTATUS_SITE_LANG_PUBLISHED="Published Site Languages" COM_LANGUAGES_MULTILANGSTATUS_USELESS_HOMES="This site is not set as a multilingual site.
Note: at least one Default Home page is assigned to a Content Language. This will not break a monolingual site but is useless." From 0d74c5b98f85f1b332cdc95a4e7fd187dca79756 Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 20:22:48 -0700 Subject: [PATCH 038/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. --- administrator/language/en-GB/en-GB.com_media.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_media.ini b/administrator/language/en-GB/en-GB.com_media.ini index 1e90eeff95e88..a23c5b84bb403 100644 --- a/administrator/language/en-GB/en-GB.com_media.ini +++ b/administrator/language/en-GB/en-GB.com_media.ini @@ -18,7 +18,7 @@ COM_MEDIA_CREATE_NEW_FOLDER="Create New Folder" COM_MEDIA_CURRENT_PROGRESS="Current progress" COM_MEDIA_DELETE_COMPLETE="Delete Complete: %s" COM_MEDIA_DESCFTPTITLE="FTP Login Details" -COM_MEDIA_DESCFTP="To upload, change and delete media files, Joomla! will most likely need your FTP account details. Please enter them in the form fields below." +COM_MEDIA_DESCFTP="To upload, change and delete media files, Joomla will most likely need your FTP account details. Please enter them in the form fields below." COM_MEDIA_DETAIL_VIEW="Detail View" COM_MEDIA_DIRECTORY="Directory" COM_MEDIA_DIRECTORY_UP="Directory Up" From 34e8e254b65ce97ab137a96b9aef86dfad31f50f Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 20:24:55 -0700 Subject: [PATCH 039/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. --- administrator/language/en-GB/en-GB.com_templates.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_templates.ini b/administrator/language/en-GB/en-GB.com_templates.ini index b32361f575c43..9591641e509f1 100644 --- a/administrator/language/en-GB/en-GB.com_templates.ini +++ b/administrator/language/en-GB/en-GB.com_templates.ini @@ -134,7 +134,7 @@ COM_TEMPLATES_FOLDER_ERROR="Not able to create folder." COM_TEMPLATES_FOLDER_EXISTS="Folder with the same name already exists." COM_TEMPLATES_FOLDER_NAME="Folder Name" COM_TEMPLATES_FOLDER_NOT_EXISTS="The folder does not exist." -COM_TEMPLATES_FTP_DESC="For updating the template source files, Joomla! will most likely need your FTP account details. Please enter them in the form fields below." +COM_TEMPLATES_FTP_DESC="For updating the template source files, Joomla will most likely need your FTP account details. Please enter them in the form fields below." COM_TEMPLATES_FTP_TITLE="FTP Login Details" COM_TEMPLATES_GRID_UNSET_LANGUAGE="Unset %s Default" COM_TEMPLATES_HOME_BUTTON="Documentation" From 369cbdaf0b5c5c93a3bd35d89ede5be94152f7ff Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 20:25:55 -0700 Subject: [PATCH 040/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. --- administrator/language/en-GB/en-GB.com_plugins.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_plugins.ini b/administrator/language/en-GB/en-GB.com_plugins.ini index 67b309a480d4b..6554b2f7f00b5 100644 --- a/administrator/language/en-GB/en-GB.com_plugins.ini +++ b/administrator/language/en-GB/en-GB.com_plugins.ini @@ -34,7 +34,7 @@ COM_PLUGINS_PLUGIN="Plugin" COM_PLUGINS_PLUGINS="Plugins" COM_PLUGINS_SAVE_SUCCESS="Plugin successfully saved." COM_PLUGINS_SEARCH_IN_TITLE="Search in plugin title." -COM_PLUGINS_XML_DESCRIPTION="This component manages Joomla! plugins." +COM_PLUGINS_XML_DESCRIPTION="This component manages Joomla plugins." COM_PLUGINS_XML_ERR="Plugins XML data not available." JLIB_HTML_PUBLISH_ITEM="Enable plugin" JLIB_HTML_UNPUBLISH_ITEM="Disable plugin" From d0370d03b866febcdabe99059e65a9d7e1738b21 Mon Sep 17 00:00:00 2001 From: Duke3D Date: Sat, 14 Feb 2015 20:27:12 -0700 Subject: [PATCH 041/809] Changes to comply with language style guide. References to Joomla in mid-sentence should not include the exclamation point. Usability / accessibility outweighs any trademark benefit. --- administrator/language/en-GB/en-GB.com_plugins.sys.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_plugins.sys.ini b/administrator/language/en-GB/en-GB.com_plugins.sys.ini index db0536bc13961..f05d7e222a1f8 100644 --- a/administrator/language/en-GB/en-GB.com_plugins.sys.ini +++ b/administrator/language/en-GB/en-GB.com_plugins.sys.ini @@ -4,4 +4,4 @@ ; Note : All ini files need to be saved as UTF-8 COM_PLUGINS="Plugins Manager" -COM_PLUGINS_XML_DESCRIPTION="This component manages Joomla! plugins." +COM_PLUGINS_XML_DESCRIPTION="This component manages Joomla plugins." From 8cb7522c81780f758fa51c236da7fc7c032dafce Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 17 Feb 2015 13:01:22 +0000 Subject: [PATCH 042/809] Add missing semi-colons --- media/system/js/core-uncompressed.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/media/system/js/core-uncompressed.js b/media/system/js/core-uncompressed.js index 3a699bd1eba0d..fac3d2e630d74 100644 --- a/media/system/js/core-uncompressed.js +++ b/media/system/js/core-uncompressed.js @@ -37,7 +37,7 @@ Joomla.submitform = function(task, form) { */ Joomla.submitbutton = function(pressbutton) { Joomla.submitform(pressbutton); -} +}; /** * Custom behavior for JavaScript I18N in Joomla! 1.6 @@ -113,7 +113,7 @@ Joomla.checkAll = function(checkbox, stub) { return true; } return false; -} +}; /** * Render messages send via JSON @@ -156,7 +156,7 @@ Joomla.renderMessages = function(messages) { var messageWrapper = document.createElement('p'); messageWrapper.innerHTML = typeMessages[i]; messagesBox.appendChild(messageWrapper); - }; + } messageContainer.appendChild(messagesBox); } @@ -179,7 +179,7 @@ Joomla.removeMessages = function() { messageContainer.style.display='none'; messageContainer.offsetHeight; messageContainer.style.display=''; -} +}; /** * USED IN: administrator/components/com_cache/views/cache/tmpl/default.php @@ -217,7 +217,7 @@ Joomla.isChecked = function(isitchecked, form) { if (form.elements['checkall-toggle']) { form.elements['checkall-toggle'].checked = c; } -} +}; /** * USED IN: libraries/joomla/html/toolbar/button/help.php @@ -244,7 +244,7 @@ Joomla.tableOrdering = function(order, dir, task, form) { form.filter_order.value = order; form.filter_order_Dir.value = dir; Joomla.submitform(task, form); -} +}; /** * USED IN: administrator/components/com_modules/views/module/tmpl/default.php From e5eb73aebf44c2bf161faaf1020fca0caf3b8ae7 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 17 Feb 2015 14:29:12 +0000 Subject: [PATCH 043/809] Add another missing semicolon --- media/system/js/core-uncompressed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/system/js/core-uncompressed.js b/media/system/js/core-uncompressed.js index fac3d2e630d74..7a746ae548ee2 100644 --- a/media/system/js/core-uncompressed.js +++ b/media/system/js/core-uncompressed.js @@ -231,7 +231,7 @@ Joomla.popupWindow = function(mypage, myname, w, h, scroll) { + ',scrollbars=' + scroll + ',resizable' win = window.open(mypage, myname, winprops) win.window.focus(); -} +}; /** * USED IN: libraries/joomla/html/html/grid.php From 7ff313ba423daaac13ec0eb33c4ff4ca6f40ae2f Mon Sep 17 00:00:00 2001 From: Panagiotis Mitsis Date: Sun, 22 Feb 2015 06:33:30 +0100 Subject: [PATCH 044/809] Fix for PR #6131 Final Fix for PR #6131 from @n9iels and issue #6126 --- .../components/com_templates/models/template.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/administrator/components/com_templates/models/template.php b/administrator/components/com_templates/models/template.php index 36f9339aeec4e..51913559c314b 100644 --- a/administrator/components/com_templates/models/template.php +++ b/administrator/components/com_templates/models/template.php @@ -504,15 +504,7 @@ public function save($data) } $return = JFile::write($filePath, $data['source']); - - // Try to make the template file unwritable. - if (JPath::isOwner($filePath) && !JPath::setPermissions($filePath, '0444')) - { - $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_FILE_NOT_UNWRITABLE'), 'error'); - - return false; - } - elseif (!$return) + if (!$return) { $app->enqueueMessage(JText::sprintf('COM_TEMPLATES_ERROR_FAILED_TO_SAVE_FILENAME', $fileName), 'error'); From 3cdf39c4eafc9383182879ad6ef7ee1420bc9693 Mon Sep 17 00:00:00 2001 From: Elijah Madden Date: Mon, 23 Feb 2015 15:09:40 +0900 Subject: [PATCH 045/809] CodeMirror 5.0 --- .../codemirror/addon/comment/comment.min.js | 1 + .../addon/comment/continuecomment.min.js | 1 + .../codemirror/addon/dialog/dialog.min.css | 1 + .../codemirror/addon/dialog/dialog.min.js | 1 + .../addon/display/fullscreen.min.css | 1 + .../addon/display/fullscreen.min.js | 1 + .../codemirror/addon/display/panel.min.js | 1 + .../addon/display/placeholder.min.js | 1 + .../codemirror/addon/display/rulers.min.js | 1 + .../codemirror/addon/edit/closebrackets.js | 10 +- .../addon/edit/closebrackets.min.js | 1 + .../editors/codemirror/addon/edit/closetag.js | 2 +- .../codemirror/addon/edit/closetag.min.js | 1 + .../codemirror/addon/edit/continuelist.min.js | 1 + .../codemirror/addon/edit/matchbrackets.js | 2 +- .../addon/edit/matchbrackets.min.js | 1 + .../codemirror/addon/edit/matchtags.min.js | 1 + .../addon/edit/trailingspace.min.js | 1 + .../codemirror/addon/fold/brace-fold.min.js | 1 + .../codemirror/addon/fold/comment-fold.min.js | 1 + .../codemirror/addon/fold/foldcode.min.js | 1 + .../codemirror/addon/fold/foldgutter.js | 16 +- .../codemirror/addon/fold/foldgutter.min.css | 1 + .../codemirror/addon/fold/foldgutter.min.js | 1 + .../codemirror/addon/fold/indent-fold.min.js | 1 + .../addon/fold/markdown-fold.min.js | 1 + .../codemirror/addon/fold/xml-fold.min.js | 1 + .../codemirror/addon/hint/anyword-hint.min.js | 1 + .../codemirror/addon/hint/css-hint.min.js | 1 + .../codemirror/addon/hint/html-hint.min.js | 1 + .../addon/hint/javascript-hint.min.js | 1 + .../codemirror/addon/hint/show-hint.js | 23 +- .../codemirror/addon/hint/show-hint.min.css | 1 + .../codemirror/addon/hint/show-hint.min.js | 1 + .../editors/codemirror/addon/hint/sql-hint.js | 145 +- .../codemirror/addon/hint/sql-hint.min.js | 1 + .../codemirror/addon/hint/xml-hint.min.js | 1 + .../addon/lint/coffeescript-lint.min.js | 1 + .../codemirror/addon/lint/css-lint.min.js | 1 + .../addon/lint/javascript-lint.min.js | 1 + .../codemirror/addon/lint/json-lint.min.js | 1 + media/editors/codemirror/addon/lint/lint.js | 3 +- .../codemirror/addon/lint/lint.min.css | 1 + .../editors/codemirror/addon/lint/lint.min.js | 1 + .../codemirror/addon/lint/yaml-lint.min.js | 1 + media/editors/codemirror/addon/merge/merge.js | 334 +- .../codemirror/addon/merge/merge.min.css | 1 + .../codemirror/addon/merge/merge.min.js | 1 + .../codemirror/addon/mode/loadmode.min.js | 1 + .../codemirror/addon/mode/multiplex.min.js | 1 + .../addon/mode/multiplex_test.min.js | 1 + .../codemirror/addon/mode/overlay.min.js | 1 + .../codemirror/addon/mode/simple.min.js | 1 + .../codemirror/addon/runmode/colorize.min.js | 1 + .../addon/runmode/runmode-standalone.min.js | 1 + .../codemirror/addon/runmode/runmode.min.js | 1 + .../addon/runmode/runmode.node.min.js | 1 + .../addon/scroll/annotatescrollbar.js | 48 +- .../addon/scroll/annotatescrollbar.min.js | 1 + .../addon/scroll/scrollpastend.min.js | 1 + .../addon/scroll/simplescrollbars.min.css | 1 + .../addon/scroll/simplescrollbars.min.js | 1 + .../addon/search/match-highlighter.min.js | 1 + .../addon/search/matchesonscrollbar.js | 13 +- .../addon/search/matchesonscrollbar.min.css | 1 + .../addon/search/matchesonscrollbar.min.js | 1 + .../codemirror/addon/search/search.min.js | 1 + .../addon/search/searchcursor.min.js | 1 + .../addon/selection/active-line.min.js | 1 + .../addon/selection/mark-selection.min.js | 1 + .../addon/selection/selection-pointer.js | 3 + .../addon/selection/selection-pointer.min.js | 1 + media/editors/codemirror/addon/tern/tern.js | 35 +- .../codemirror/addon/tern/tern.min.css | 1 + .../editors/codemirror/addon/tern/tern.min.js | 1 + .../codemirror/addon/tern/worker.min.js | 1 + .../codemirror/addon/wrap/hardwrap.min.js | 1 + media/editors/codemirror/keymap/emacs.min.js | 1 + .../editors/codemirror/keymap/sublime.min.js | 1 + media/editors/codemirror/keymap/vim.js | 53 +- media/editors/codemirror/keymap/vim.min.js | 3 + .../codemirror/lib/addons-uncompressed.js | 6549 ------------- media/editors/codemirror/lib/addons.js | 6599 ++++++++++++- media/editors/codemirror/lib/addons.min.js | 3 + .../lib/codemirror-uncompressed.css | 406 - .../codemirror/lib/codemirror-uncompressed.js | 8045 --------------- media/editors/codemirror/lib/codemirror.css | 418 +- media/editors/codemirror/lib/codemirror.js | 8646 ++++++++++++++++- .../editors/codemirror/lib/codemirror.min.css | 1 + .../editors/codemirror/lib/codemirror.min.js | 5 + media/editors/codemirror/mode/apl/apl.min.js | 1 + .../codemirror/mode/asterisk/asterisk.min.js | 1 + media/editors/codemirror/mode/clike/clike.js | 6 +- .../codemirror/mode/clike/clike.min.js | 1 + .../codemirror/mode/clojure/clojure.min.js | 1 + .../codemirror/mode/cobol/cobol.min.js | 1 + .../mode/coffeescript/coffeescript.min.js | 1 + .../mode/commonlisp/commonlisp.min.js | 1 + media/editors/codemirror/mode/css/css.js | 159 +- media/editors/codemirror/mode/css/css.min.js | 1 + .../codemirror/mode/css/less_test.min.js | 1 + .../codemirror/mode/css/scss_test.min.js | 1 + media/editors/codemirror/mode/css/test.js | 62 +- media/editors/codemirror/mode/css/test.min.js | 1 + .../editors/codemirror/mode/cypher/cypher.js | 2 +- .../codemirror/mode/cypher/cypher.min.js | 1 + media/editors/codemirror/mode/d/d.min.js | 1 + .../editors/codemirror/mode/dart/dart.min.js | 1 + .../editors/codemirror/mode/diff/diff.min.js | 1 + .../codemirror/mode/django/django.min.js | 1 + .../mode/dockerfile/dockerfile.min.js | 1 + media/editors/codemirror/mode/dtd/dtd.min.js | 1 + .../codemirror/mode/dylan/dylan.min.js | 1 + .../editors/codemirror/mode/ebnf/ebnf.min.js | 1 + media/editors/codemirror/mode/ecl/ecl.min.js | 1 + .../codemirror/mode/eiffel/eiffel.min.js | 1 + .../codemirror/mode/erlang/erlang.min.js | 1 + media/editors/codemirror/mode/forth/forth.js | 180 + .../codemirror/mode/forth/forth.min.js | 1 + .../codemirror/mode/fortran/fortran.min.js | 1 + media/editors/codemirror/mode/gas/gas.min.js | 1 + media/editors/codemirror/mode/gfm/gfm.min.js | 1 + media/editors/codemirror/mode/gfm/test.min.js | 1 + .../codemirror/mode/gherkin/gherkin.min.js | 1 + media/editors/codemirror/mode/go/go.js | 1 + media/editors/codemirror/mode/go/go.min.js | 1 + .../codemirror/mode/groovy/groovy.min.js | 1 + .../editors/codemirror/mode/haml/haml.min.js | 1 + .../editors/codemirror/mode/haml/test.min.js | 1 + .../codemirror/mode/haskell/haskell.min.js | 1 + .../editors/codemirror/mode/haxe/haxe.min.js | 1 + .../mode/htmlembedded/htmlembedded.min.js | 1 + .../mode/htmlmixed/htmlmixed.min.js | 1 + .../editors/codemirror/mode/http/http.min.js | 1 + media/editors/codemirror/mode/idl/idl.js | 2 +- media/editors/codemirror/mode/idl/idl.min.js | 1 + .../editors/codemirror/mode/jade/jade.min.js | 1 + .../codemirror/mode/javascript/javascript.js | 2 +- .../mode/javascript/javascript.min.js | 1 + .../codemirror/mode/javascript/test.min.js | 1 + .../codemirror/mode/jinja2/jinja2.min.js | 1 + .../codemirror/mode/julia/julia.min.js | 1 + .../codemirror/mode/kotlin/kotlin.min.js | 1 + .../mode/livescript/livescript.min.js | 1 + media/editors/codemirror/mode/lua/lua.min.js | 1 + .../codemirror/mode/markdown/markdown.min.js | 1 + .../codemirror/mode/markdown/test.min.js | 1 + media/editors/codemirror/mode/meta.js | 1 + media/editors/codemirror/mode/meta.min.js | 1 + .../editors/codemirror/mode/mirc/mirc.min.js | 1 + .../codemirror/mode/mllike/mllike.min.js | 1 + .../codemirror/mode/modelica/modelica.min.js | 1 + .../codemirror/mode/nginx/nginx.min.js | 1 + .../codemirror/mode/ntriples/ntriples.min.js | 1 + .../codemirror/mode/octave/octave.min.js | 1 + .../codemirror/mode/pascal/pascal.min.js | 1 + .../codemirror/mode/pegjs/pegjs.min.js | 1 + .../editors/codemirror/mode/perl/perl.min.js | 1 + media/editors/codemirror/mode/php/php.min.js | 1 + media/editors/codemirror/mode/php/test.min.js | 1 + media/editors/codemirror/mode/pig/pig.min.js | 1 + .../mode/properties/properties.min.js | 1 + .../codemirror/mode/puppet/puppet.min.js | 1 + .../codemirror/mode/python/python.min.js | 1 + media/editors/codemirror/mode/q/q.min.js | 1 + media/editors/codemirror/mode/r/r.min.js | 1 + media/editors/codemirror/mode/rpm/rpm.min.js | 1 + media/editors/codemirror/mode/rst/rst.min.js | 1 + .../editors/codemirror/mode/ruby/ruby.min.js | 1 + .../editors/codemirror/mode/ruby/test.min.js | 1 + .../editors/codemirror/mode/rust/rust.min.js | 1 + .../editors/codemirror/mode/sass/sass.min.js | 1 + .../codemirror/mode/scheme/scheme.min.js | 1 + .../codemirror/mode/shell/shell.min.js | 1 + .../editors/codemirror/mode/shell/test.min.js | 1 + .../codemirror/mode/sieve/sieve.min.js | 1 + .../editors/codemirror/mode/slim/slim.min.js | 1 + .../editors/codemirror/mode/slim/test.min.js | 1 + .../mode/smalltalk/smalltalk.min.js | 1 + .../codemirror/mode/smarty/smarty.min.js | 1 + .../mode/smartymixed/smartymixed.min.js | 1 + .../editors/codemirror/mode/solr/solr.min.js | 1 + media/editors/codemirror/mode/soy/soy.min.js | 1 + .../codemirror/mode/sparql/sparql.min.js | 1 + .../mode/spreadsheet/spreadsheet.min.js | 1 + media/editors/codemirror/mode/sql/sql.js | 2 +- media/editors/codemirror/mode/sql/sql.min.js | 1 + .../editors/codemirror/mode/stex/stex.min.js | 1 + .../editors/codemirror/mode/stex/test.min.js | 1 + .../editors/codemirror/mode/stylus/stylus.js | 444 + .../codemirror/mode/stylus/stylus.min.js | 1 + media/editors/codemirror/mode/tcl/tcl.min.js | 1 + .../codemirror/mode/textile/test.min.js | 1 + .../codemirror/mode/textile/textile.min.js | 1 + .../mode/tiddlywiki/tiddlywiki.min.css | 1 + .../mode/tiddlywiki/tiddlywiki.min.js | 1 + .../editors/codemirror/mode/tiki/tiki.min.css | 1 + .../editors/codemirror/mode/tiki/tiki.min.js | 1 + .../editors/codemirror/mode/toml/toml.min.js | 1 + .../codemirror/mode/tornado/tornado.min.js | 1 + .../codemirror/mode/turtle/turtle.min.js | 1 + media/editors/codemirror/mode/vb/vb.min.js | 1 + .../codemirror/mode/vbscript/vbscript.min.js | 1 + .../codemirror/mode/velocity/velocity.min.js | 1 + .../codemirror/mode/verilog/test.min.js | 1 + .../codemirror/mode/verilog/verilog.js | 211 +- .../codemirror/mode/verilog/verilog.min.js | 1 + media/editors/codemirror/mode/xml/test.min.js | 1 + media/editors/codemirror/mode/xml/xml.min.js | 1 + .../codemirror/mode/xquery/test.min.js | 1 + .../codemirror/mode/xquery/xquery.min.js | 1 + .../editors/codemirror/mode/yaml/yaml.min.js | 1 + media/editors/codemirror/mode/z80/z80.min.js | 1 + media/editors/codemirror/theme/3024-day.css | 2 + media/editors/codemirror/theme/3024-night.css | 2 + media/editors/codemirror/theme/ambiance.css | 10 +- .../editors/codemirror/theme/base16-dark.css | 2 + .../editors/codemirror/theme/base16-light.css | 2 + media/editors/codemirror/theme/blackboard.css | 2 + media/editors/codemirror/theme/cobalt.css | 2 + media/editors/codemirror/theme/colorforth.css | 33 + .../editors/codemirror/theme/erlang-dark.css | 2 + .../editors/codemirror/theme/lesser-dark.css | 2 + media/editors/codemirror/theme/mbo.css | 2 + media/editors/codemirror/theme/mdn-like.css | 2 + media/editors/codemirror/theme/midnight.css | 2 + media/editors/codemirror/theme/monokai.css | 2 + media/editors/codemirror/theme/night.css | 2 + .../editors/codemirror/theme/paraiso-dark.css | 2 + .../codemirror/theme/paraiso-light.css | 2 + .../codemirror/theme/pastel-on-dark.css | 3 + media/editors/codemirror/theme/rubyblue.css | 2 + media/editors/codemirror/theme/solarized.css | 12 +- media/editors/codemirror/theme/the-matrix.css | 2 + .../theme/tomorrow-night-eighties.css | 2 + media/editors/codemirror/theme/twilight.css | 2 + .../editors/codemirror/theme/vibrant-ink.css | 2 + media/editors/codemirror/theme/xq-dark.css | 2 + plugins/editors/codemirror/codemirror.php | 12 +- plugins/editors/codemirror/codemirror.xml | 2 +- 240 files changed, 17404 insertions(+), 15322 deletions(-) create mode 100644 media/editors/codemirror/addon/comment/comment.min.js create mode 100644 media/editors/codemirror/addon/comment/continuecomment.min.js create mode 100644 media/editors/codemirror/addon/dialog/dialog.min.css create mode 100644 media/editors/codemirror/addon/dialog/dialog.min.js create mode 100644 media/editors/codemirror/addon/display/fullscreen.min.css create mode 100644 media/editors/codemirror/addon/display/fullscreen.min.js create mode 100644 media/editors/codemirror/addon/display/panel.min.js create mode 100644 media/editors/codemirror/addon/display/placeholder.min.js create mode 100644 media/editors/codemirror/addon/display/rulers.min.js create mode 100644 media/editors/codemirror/addon/edit/closebrackets.min.js create mode 100644 media/editors/codemirror/addon/edit/closetag.min.js create mode 100644 media/editors/codemirror/addon/edit/continuelist.min.js create mode 100644 media/editors/codemirror/addon/edit/matchbrackets.min.js create mode 100644 media/editors/codemirror/addon/edit/matchtags.min.js create mode 100644 media/editors/codemirror/addon/edit/trailingspace.min.js create mode 100644 media/editors/codemirror/addon/fold/brace-fold.min.js create mode 100644 media/editors/codemirror/addon/fold/comment-fold.min.js create mode 100644 media/editors/codemirror/addon/fold/foldcode.min.js create mode 100644 media/editors/codemirror/addon/fold/foldgutter.min.css create mode 100644 media/editors/codemirror/addon/fold/foldgutter.min.js create mode 100644 media/editors/codemirror/addon/fold/indent-fold.min.js create mode 100644 media/editors/codemirror/addon/fold/markdown-fold.min.js create mode 100644 media/editors/codemirror/addon/fold/xml-fold.min.js create mode 100644 media/editors/codemirror/addon/hint/anyword-hint.min.js create mode 100644 media/editors/codemirror/addon/hint/css-hint.min.js create mode 100644 media/editors/codemirror/addon/hint/html-hint.min.js create mode 100644 media/editors/codemirror/addon/hint/javascript-hint.min.js create mode 100644 media/editors/codemirror/addon/hint/show-hint.min.css create mode 100644 media/editors/codemirror/addon/hint/show-hint.min.js create mode 100644 media/editors/codemirror/addon/hint/sql-hint.min.js create mode 100644 media/editors/codemirror/addon/hint/xml-hint.min.js create mode 100644 media/editors/codemirror/addon/lint/coffeescript-lint.min.js create mode 100644 media/editors/codemirror/addon/lint/css-lint.min.js create mode 100644 media/editors/codemirror/addon/lint/javascript-lint.min.js create mode 100644 media/editors/codemirror/addon/lint/json-lint.min.js create mode 100644 media/editors/codemirror/addon/lint/lint.min.css create mode 100644 media/editors/codemirror/addon/lint/lint.min.js create mode 100644 media/editors/codemirror/addon/lint/yaml-lint.min.js create mode 100644 media/editors/codemirror/addon/merge/merge.min.css create mode 100644 media/editors/codemirror/addon/merge/merge.min.js create mode 100644 media/editors/codemirror/addon/mode/loadmode.min.js create mode 100644 media/editors/codemirror/addon/mode/multiplex.min.js create mode 100644 media/editors/codemirror/addon/mode/multiplex_test.min.js create mode 100644 media/editors/codemirror/addon/mode/overlay.min.js create mode 100644 media/editors/codemirror/addon/mode/simple.min.js create mode 100644 media/editors/codemirror/addon/runmode/colorize.min.js create mode 100644 media/editors/codemirror/addon/runmode/runmode-standalone.min.js create mode 100644 media/editors/codemirror/addon/runmode/runmode.min.js create mode 100644 media/editors/codemirror/addon/runmode/runmode.node.min.js create mode 100644 media/editors/codemirror/addon/scroll/annotatescrollbar.min.js create mode 100644 media/editors/codemirror/addon/scroll/scrollpastend.min.js create mode 100644 media/editors/codemirror/addon/scroll/simplescrollbars.min.css create mode 100644 media/editors/codemirror/addon/scroll/simplescrollbars.min.js create mode 100644 media/editors/codemirror/addon/search/match-highlighter.min.js create mode 100644 media/editors/codemirror/addon/search/matchesonscrollbar.min.css create mode 100644 media/editors/codemirror/addon/search/matchesonscrollbar.min.js create mode 100644 media/editors/codemirror/addon/search/search.min.js create mode 100644 media/editors/codemirror/addon/search/searchcursor.min.js create mode 100644 media/editors/codemirror/addon/selection/active-line.min.js create mode 100644 media/editors/codemirror/addon/selection/mark-selection.min.js create mode 100644 media/editors/codemirror/addon/selection/selection-pointer.min.js create mode 100644 media/editors/codemirror/addon/tern/tern.min.css create mode 100644 media/editors/codemirror/addon/tern/tern.min.js create mode 100644 media/editors/codemirror/addon/tern/worker.min.js create mode 100644 media/editors/codemirror/addon/wrap/hardwrap.min.js create mode 100644 media/editors/codemirror/keymap/emacs.min.js create mode 100644 media/editors/codemirror/keymap/sublime.min.js create mode 100644 media/editors/codemirror/keymap/vim.min.js delete mode 100644 media/editors/codemirror/lib/addons-uncompressed.js create mode 100644 media/editors/codemirror/lib/addons.min.js delete mode 100644 media/editors/codemirror/lib/codemirror-uncompressed.css delete mode 100644 media/editors/codemirror/lib/codemirror-uncompressed.js create mode 100644 media/editors/codemirror/lib/codemirror.min.css create mode 100644 media/editors/codemirror/lib/codemirror.min.js create mode 100644 media/editors/codemirror/mode/apl/apl.min.js create mode 100644 media/editors/codemirror/mode/asterisk/asterisk.min.js create mode 100644 media/editors/codemirror/mode/clike/clike.min.js create mode 100644 media/editors/codemirror/mode/clojure/clojure.min.js create mode 100644 media/editors/codemirror/mode/cobol/cobol.min.js create mode 100644 media/editors/codemirror/mode/coffeescript/coffeescript.min.js create mode 100644 media/editors/codemirror/mode/commonlisp/commonlisp.min.js create mode 100644 media/editors/codemirror/mode/css/css.min.js create mode 100644 media/editors/codemirror/mode/css/less_test.min.js create mode 100644 media/editors/codemirror/mode/css/scss_test.min.js create mode 100644 media/editors/codemirror/mode/css/test.min.js create mode 100644 media/editors/codemirror/mode/cypher/cypher.min.js create mode 100644 media/editors/codemirror/mode/d/d.min.js create mode 100644 media/editors/codemirror/mode/dart/dart.min.js create mode 100644 media/editors/codemirror/mode/diff/diff.min.js create mode 100644 media/editors/codemirror/mode/django/django.min.js create mode 100644 media/editors/codemirror/mode/dockerfile/dockerfile.min.js create mode 100644 media/editors/codemirror/mode/dtd/dtd.min.js create mode 100644 media/editors/codemirror/mode/dylan/dylan.min.js create mode 100644 media/editors/codemirror/mode/ebnf/ebnf.min.js create mode 100644 media/editors/codemirror/mode/ecl/ecl.min.js create mode 100644 media/editors/codemirror/mode/eiffel/eiffel.min.js create mode 100644 media/editors/codemirror/mode/erlang/erlang.min.js create mode 100644 media/editors/codemirror/mode/forth/forth.js create mode 100644 media/editors/codemirror/mode/forth/forth.min.js create mode 100644 media/editors/codemirror/mode/fortran/fortran.min.js create mode 100644 media/editors/codemirror/mode/gas/gas.min.js create mode 100644 media/editors/codemirror/mode/gfm/gfm.min.js create mode 100644 media/editors/codemirror/mode/gfm/test.min.js create mode 100644 media/editors/codemirror/mode/gherkin/gherkin.min.js create mode 100644 media/editors/codemirror/mode/go/go.min.js create mode 100644 media/editors/codemirror/mode/groovy/groovy.min.js create mode 100644 media/editors/codemirror/mode/haml/haml.min.js create mode 100644 media/editors/codemirror/mode/haml/test.min.js create mode 100644 media/editors/codemirror/mode/haskell/haskell.min.js create mode 100644 media/editors/codemirror/mode/haxe/haxe.min.js create mode 100644 media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js create mode 100644 media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js create mode 100644 media/editors/codemirror/mode/http/http.min.js create mode 100644 media/editors/codemirror/mode/idl/idl.min.js create mode 100644 media/editors/codemirror/mode/jade/jade.min.js create mode 100644 media/editors/codemirror/mode/javascript/javascript.min.js create mode 100644 media/editors/codemirror/mode/javascript/test.min.js create mode 100644 media/editors/codemirror/mode/jinja2/jinja2.min.js create mode 100644 media/editors/codemirror/mode/julia/julia.min.js create mode 100644 media/editors/codemirror/mode/kotlin/kotlin.min.js create mode 100644 media/editors/codemirror/mode/livescript/livescript.min.js create mode 100644 media/editors/codemirror/mode/lua/lua.min.js create mode 100644 media/editors/codemirror/mode/markdown/markdown.min.js create mode 100644 media/editors/codemirror/mode/markdown/test.min.js create mode 100644 media/editors/codemirror/mode/meta.min.js create mode 100644 media/editors/codemirror/mode/mirc/mirc.min.js create mode 100644 media/editors/codemirror/mode/mllike/mllike.min.js create mode 100644 media/editors/codemirror/mode/modelica/modelica.min.js create mode 100644 media/editors/codemirror/mode/nginx/nginx.min.js create mode 100644 media/editors/codemirror/mode/ntriples/ntriples.min.js create mode 100644 media/editors/codemirror/mode/octave/octave.min.js create mode 100644 media/editors/codemirror/mode/pascal/pascal.min.js create mode 100644 media/editors/codemirror/mode/pegjs/pegjs.min.js create mode 100644 media/editors/codemirror/mode/perl/perl.min.js create mode 100644 media/editors/codemirror/mode/php/php.min.js create mode 100644 media/editors/codemirror/mode/php/test.min.js create mode 100644 media/editors/codemirror/mode/pig/pig.min.js create mode 100644 media/editors/codemirror/mode/properties/properties.min.js create mode 100644 media/editors/codemirror/mode/puppet/puppet.min.js create mode 100644 media/editors/codemirror/mode/python/python.min.js create mode 100644 media/editors/codemirror/mode/q/q.min.js create mode 100644 media/editors/codemirror/mode/r/r.min.js create mode 100644 media/editors/codemirror/mode/rpm/rpm.min.js create mode 100644 media/editors/codemirror/mode/rst/rst.min.js create mode 100644 media/editors/codemirror/mode/ruby/ruby.min.js create mode 100644 media/editors/codemirror/mode/ruby/test.min.js create mode 100644 media/editors/codemirror/mode/rust/rust.min.js create mode 100644 media/editors/codemirror/mode/sass/sass.min.js create mode 100644 media/editors/codemirror/mode/scheme/scheme.min.js create mode 100644 media/editors/codemirror/mode/shell/shell.min.js create mode 100644 media/editors/codemirror/mode/shell/test.min.js create mode 100644 media/editors/codemirror/mode/sieve/sieve.min.js create mode 100644 media/editors/codemirror/mode/slim/slim.min.js create mode 100644 media/editors/codemirror/mode/slim/test.min.js create mode 100644 media/editors/codemirror/mode/smalltalk/smalltalk.min.js create mode 100644 media/editors/codemirror/mode/smarty/smarty.min.js create mode 100644 media/editors/codemirror/mode/smartymixed/smartymixed.min.js create mode 100644 media/editors/codemirror/mode/solr/solr.min.js create mode 100644 media/editors/codemirror/mode/soy/soy.min.js create mode 100644 media/editors/codemirror/mode/sparql/sparql.min.js create mode 100644 media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js create mode 100644 media/editors/codemirror/mode/sql/sql.min.js create mode 100644 media/editors/codemirror/mode/stex/stex.min.js create mode 100644 media/editors/codemirror/mode/stex/test.min.js create mode 100644 media/editors/codemirror/mode/stylus/stylus.js create mode 100644 media/editors/codemirror/mode/stylus/stylus.min.js create mode 100644 media/editors/codemirror/mode/tcl/tcl.min.js create mode 100644 media/editors/codemirror/mode/textile/test.min.js create mode 100644 media/editors/codemirror/mode/textile/textile.min.js create mode 100644 media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.css create mode 100644 media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.js create mode 100644 media/editors/codemirror/mode/tiki/tiki.min.css create mode 100644 media/editors/codemirror/mode/tiki/tiki.min.js create mode 100644 media/editors/codemirror/mode/toml/toml.min.js create mode 100644 media/editors/codemirror/mode/tornado/tornado.min.js create mode 100644 media/editors/codemirror/mode/turtle/turtle.min.js create mode 100644 media/editors/codemirror/mode/vb/vb.min.js create mode 100644 media/editors/codemirror/mode/vbscript/vbscript.min.js create mode 100644 media/editors/codemirror/mode/velocity/velocity.min.js create mode 100644 media/editors/codemirror/mode/verilog/test.min.js create mode 100644 media/editors/codemirror/mode/verilog/verilog.min.js create mode 100644 media/editors/codemirror/mode/xml/test.min.js create mode 100644 media/editors/codemirror/mode/xml/xml.min.js create mode 100644 media/editors/codemirror/mode/xquery/test.min.js create mode 100644 media/editors/codemirror/mode/xquery/xquery.min.js create mode 100644 media/editors/codemirror/mode/yaml/yaml.min.js create mode 100644 media/editors/codemirror/mode/z80/z80.min.js create mode 100644 media/editors/codemirror/theme/colorforth.css diff --git a/media/editors/codemirror/addon/comment/comment.min.js b/media/editors/codemirror/addon/comment/comment.min.js new file mode 100644 index 0000000000000..b7cf9a5c97ee1 --- /dev/null +++ b/media/editors/codemirror/addon/comment/comment.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(e){var n=e.search(i);return-1==n?0:n}var t={},i=/[^\s\u00a0]/,l=e.Pos;e.commands.toggleComment=function(e){for(var n=1/0,t=e.listSelections(),i=null,o=t.length-1;o>=0;o--){var r=t[o].from(),a=t[o].to();r.line>=n||(a.line>=n&&(a=l(n,0)),n=r.line,null==i?e.uncomment(r,a)?i="un":(e.lineComment(r,a),i="line"):"un"==i?e.uncomment(r,a):e.lineComment(r,a))}},e.defineExtension("lineComment",function(e,o,r){r||(r=t);var a=this,m=a.getModeAt(e),c=r.lineComment||m.lineComment;if(!c)return void((r.blockCommentStart||m.blockCommentStart)&&(r.fullLines=!0,a.blockComment(e,o,r)));var f=a.getLine(e.line);if(null!=f){var g=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,a.lastLine()+1),s=null==r.padding?" ":r.padding,d=r.commentBlankLines||e.line==o.line;a.operation(function(){if(r.indent)for(var t=f.slice(0,n(f)),o=e.line;g>o;++o){var m=a.getLine(o),u=t.length;(d||i.test(m))&&(m.slice(0,u)!=t&&(u=n(m)),a.replaceRange(t+c+s,l(o,0),l(o,u)))}else for(var o=e.line;g>o;++o)(d||i.test(a.getLine(o)))&&a.replaceRange(c+s,l(o,0))})}}),e.defineExtension("blockComment",function(e,n,o){o||(o=t);var r=this,a=r.getModeAt(e),m=o.blockCommentStart||a.blockCommentStart,c=o.blockCommentEnd||a.blockCommentEnd;if(!m||!c)return void((o.lineComment||a.lineComment)&&0!=o.fullLines&&r.lineComment(e,n,o));var f=Math.min(n.line,r.lastLine());f!=e.line&&0==n.ch&&i.test(r.getLine(f))&&--f;var g=null==o.padding?" ":o.padding;e.line>f||r.operation(function(){if(0!=o.fullLines){var t=i.test(r.getLine(f));r.replaceRange(g+c,l(f)),r.replaceRange(m+g,l(e.line,0));var s=o.blockCommentLead||a.blockCommentLead;if(null!=s)for(var d=e.line+1;f>=d;++d)(d!=f||t)&&r.replaceRange(s+g,l(d,0))}else r.replaceRange(c,n),r.replaceRange(m,e)})}),e.defineExtension("uncomment",function(e,n,o){o||(o=t);var r,a=this,m=a.getModeAt(e),c=Math.min(0!=n.ch||n.line==e.line?n.line:n.line-1,a.lastLine()),f=Math.min(e.line,c),g=o.lineComment||m.lineComment,s=[],d=null==o.padding?" ":o.padding;e:if(g){for(var u=f;c>=u;++u){var h=a.getLine(u),v=h.indexOf(g);if(v>-1&&!/comment/.test(a.getTokenTypeAt(l(u,v+1)))&&(v=-1),-1==v&&(u!=c||u==f)&&i.test(h))break e;if(v>-1&&i.test(h.slice(0,v)))break e;s.push(h)}if(a.operation(function(){for(var e=f;c>=e;++e){var n=s[e-f],t=n.indexOf(g),i=t+g.length;0>t||(n.slice(i,i+d.length)==d&&(i+=d.length),r=!0,a.replaceRange("",l(e,t),l(e,i)))}}),r)return!0}var p=o.blockCommentStart||m.blockCommentStart,C=o.blockCommentEnd||m.blockCommentEnd;if(!p||!C)return!1;var b=o.blockCommentLead||m.blockCommentLead,k=a.getLine(f),L=c==f?k:a.getLine(c),x=k.indexOf(p),R=L.lastIndexOf(C);if(-1==R&&f!=c&&(L=a.getLine(--c),R=L.lastIndexOf(C)),-1==x||-1==R||!/comment/.test(a.getTokenTypeAt(l(f,x+1)))||!/comment/.test(a.getTokenTypeAt(l(c,R+1))))return!1;var O=k.lastIndexOf(p,e.ch),M=-1==O?-1:k.slice(0,e.ch).indexOf(C,O+p.length);if(-1!=O&&-1!=M&&M+C.length!=e.ch)return!1;M=L.indexOf(C,n.ch);var E=L.slice(n.ch).lastIndexOf(p,M-n.ch);return O=-1==M||-1==E?-1:n.ch+E,-1!=M&&-1!=O&&O!=n.ch?!1:(a.operation(function(){a.replaceRange("",l(c,R-(d&&L.slice(R-d.length,R)==d?d.length:0)),l(c,R+C.length));var e=x+p.length;if(d&&k.slice(e,e+d.length)==d&&(e+=d.length),a.replaceRange("",l(f,x),l(f,e)),b)for(var n=f+1;c>=n;++n){var t=a.getLine(n),o=t.indexOf(b);if(-1!=o&&!i.test(t.slice(0,o))){var r=o+b.length;d&&t.slice(r,r+d.length)==d&&(r+=d.length),a.replaceRange("",l(n,o),l(n,r))}}}),!0)})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/comment/continuecomment.min.js b/media/editors/codemirror/addon/comment/continuecomment.min.js new file mode 100644 index 0000000000000..78c656690d314 --- /dev/null +++ b/media/editors/codemirror/addon/comment/continuecomment.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(n){if(n.getOption("disableInput"))return e.Pass;for(var o,i=n.listSelections(),r=[],l=0;l=u);else if(0==s.string.indexOf(o.blockCommentStart)){if(f=d.slice(0,s.start),!/^\s*$/.test(f)){f="";for(var C=0;Cs.start&&/^\s*$/.test(d.slice(0,a))&&(f=d.slice(0,a));null!=f&&(f+=o.blockCommentContinue)}if(null==f&&o.lineComment&&t(n)){var g=n.getLine(m.line),a=g.indexOf(o.lineComment);a>-1&&(f=g.slice(0,a),/\S/.test(f)?f=null:f+=o.lineComment+g.slice(a+o.lineComment.length).match(/^\s*/)[0])}if(null==f)return e.Pass;r[l]="\n"+f}n.operation(function(){for(var e=i.length-1;e>=0;e--)n.replaceRange(r[e],i[e].from(),i[e].to(),"+insert")})}function t(e){var n=e.getOption("continueComments");return n&&"object"==typeof n?n.continueLineComment!==!1:!0}for(var o=["clike","css","javascript"],i=0;i=s&&u()},200)}),e.on(p,"focus",function(){++s})}}),e.defineExtension("openNotification",function(t,i){function r(){c||(c=!0,clearTimeout(u),l.parentNode.removeChild(l))}n(this,r);var u,l=o(this,t,i&&i.bottom),c=!1,f=i&&"undefined"!=typeof i.duration?i.duration:5e3;return e.on(l,"click",function(o){e.e_preventDefault(o),r()}),f&&(u=setTimeout(r,f)),r})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/display/fullscreen.min.css b/media/editors/codemirror/addon/display/fullscreen.min.css new file mode 100644 index 0000000000000..a414b022062ec --- /dev/null +++ b/media/editors/codemirror/addon/display/fullscreen.min.css @@ -0,0 +1 @@ +.CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9} \ No newline at end of file diff --git a/media/editors/codemirror/addon/display/fullscreen.min.js b/media/editors/codemirror/addon/display/fullscreen.min.js new file mode 100644 index 0000000000000..647a060480f9e --- /dev/null +++ b/media/editors/codemirror/addon/display/fullscreen.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function o(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var o=e.state.fullScreenRestore;t.style.width=o.width,t.style.height=o.height,window.scrollTo(o.scrollLeft,o.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,l,i){i==e.Init&&(i=!1),!i!=!l&&(l?t(r):o(r))})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/display/panel.min.js b/media/editors/codemirror/addon/display/panel.min.js new file mode 100644 index 0000000000000..83e2a84751d67 --- /dev/null +++ b/media/editors/codemirror/addon/display/panel.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i,r){this.cm=e,this.node=t,this.options=i,this.height=r,this.cleared=!1}function i(e){var t=e.getWrapperElement(),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r=parseInt(i.height),s=e.state.panels={setHeight:t.style.height,heightLeft:r,panels:0,wrapper:document.createElement("div")};t.parentNode.insertBefore(s.wrapper,t);var n=e.hasFocus();s.wrapper.appendChild(t),n&&e.focus(),e._setSize=e.setSize,null!=r&&(e.setSize=function(t,i){if(null==i)return this._setSize(t,i);if(s.setHeight=i,"number"!=typeof i){var n=/^(\d+\.?\d*)px$/.exec(i);n?i=Number(n[1]):(s.wrapper.style.height=i,i=s.wrapper.offsetHeight,s.wrapper.style.height="")}e._setSize(t,s.heightLeft+=i-r),r=i})}function r(e){var t=e.state.panels;e.state.panels=null;var i=e.getWrapperElement();t.wrapper.parentNode.replaceChild(i,t.wrapper),i.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}e.defineExtension("addPanel",function(e,r){this.state.panels||i(this);var s=this.state.panels;r&&"bottom"==r.position?s.wrapper.appendChild(e):s.wrapper.insertBefore(e,s.wrapper.firstChild);var n=r&&r.height||e.offsetHeight;return this._setSize(null,s.heightLeft-=n),s.panels++,new t(this,e,r,n)}),t.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var e=this.cm.state.panels;this.cm._setSize(null,e.heightLeft+=this.height),e.wrapper.removeChild(this.node),0==--e.panels&&r(this.cm)}},t.prototype.changed=function(e){var t=null==e?this.node.offsetHeight:e,i=this.cm.state.panels;this.cm._setSize(null,i.height+=t-this.height),this.height=t}}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/display/placeholder.min.js b/media/editors/codemirror/addon/display/placeholder.min.js new file mode 100644 index 0000000000000..8bd912c9a0447 --- /dev/null +++ b/media/editors/codemirror/addon/display/placeholder.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function o(e){r(e);var o=e.state.placeholder=document.createElement("pre");o.style.cssText="height: 0; overflow: visible",o.className="CodeMirror-placeholder",o.appendChild(document.createTextNode(e.getOption("placeholder"))),e.display.lineSpace.insertBefore(o,e.display.lineSpace.firstChild)}function t(e){n(e)&&o(e)}function l(e){var t=e.getWrapperElement(),l=n(e);t.className=t.className.replace(" CodeMirror-empty","")+(l?" CodeMirror-empty":""),l?o(e):r(e)}function n(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(o,n,a){var i=a&&a!=e.Init;if(n&&!i)o.on("blur",t),o.on("change",l),l(o);else if(!n&&i){o.off("blur",t),o.off("change",l),r(o);var c=o.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}n&&!o.hasFocus()&&t(o)})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/display/rulers.min.js b/media/editors/codemirror/addon/display/rulers.min.js new file mode 100644 index 0000000000000..9b419cbce8f1f --- /dev/null +++ b/media/editors/codemirror/addon/display/rulers.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function r(e){for(var r=e.display.lineSpace.childNodes.length-1;r>=0;r--){var o=e.display.lineSpace.childNodes[r];/(^|\s)CodeMirror-ruler($|\s)/.test(o.className)&&o.parentNode.removeChild(o)}}function o(r){for(var o=r.getOption("rulers"),t=r.defaultCharWidth(),l=r.charCoords(e.Pos(r.firstLine(),0),"div").left,i=r.display.scroller.offsetHeight+30,s=0;s 1 && + } else if (left == right && cur.ch > 1 && triples.indexOf(left) >= 0 && cm.getRange(Pos(cur.line, cur.ch - 2), cur) == left + left && (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != left)) { curType = "addFour"; diff --git a/media/editors/codemirror/addon/edit/closebrackets.min.js b/media/editors/codemirror/addon/edit/closebrackets.min.js new file mode 100644 index 0000000000000..e90d29b85460c --- /dev/null +++ b/media/editors/codemirror/addon/edit/closebrackets.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(e,n){var t=e.getRange(c(n.line,n.ch-1),c(n.line,n.ch+1));return 2==t.length?t:null}function t(n,t,r){var i=n.getLine(t.line),o=n.getTokenAt(t);if(/\bstring2?\b/.test(o.type))return!1;var a=new e.StringStream(i.slice(0,t.ch)+r+i.slice(t.ch),4);for(a.pos=a.start=o.start;;){var l=n.getMode().token(a,o.state);if(a.pos>=t.ch+1)return/\bstring2?\b/.test(l);a.start=a.pos}}function r(r,i){for(var o={name:"autoCloseBrackets",Backspace:function(t){if(t.getOption("disableInput"))return e.Pass;for(var i=t.listSelections(),o=0;o=0;o--){var l=i[o].head;t.replaceRange("",c(l.line,l.ch-1),c(l.line,l.ch+1))}}},a="",l=0;l1&&i.indexOf(n)>=0&&o.getRange(c(p.line,p.ch-2),p)==n+n&&(p.ch<=2||o.getRange(c(p.line,p.ch-3),c(p.line,p.ch-2))!=n))d="addFour";else if('"'==n||"'"==n){if(e.isWordChar(f)||!t(o,p,n))return e.Pass;d="both"}else{if(!(o.getLine(p.line).length==p.ch||a.indexOf(f)>=0||s.test(f)))return e.Pass;d="both"}else d="surround";if(l){if(l!=d)return e.Pass}else l=d}o.operation(function(){if("skip"==l)o.execCommand("goCharRight");else if("skipThree"==l)for(var e=0;3>e;e++)o.execCommand("goCharRight");else if("surround"==l){for(var t=o.getSelections(),e=0;ec.ch&&(v=v.slice(0,v.length-d.end+c.ch));var b=v.toLowerCase();if(!v||"string"==d.type&&(d.end!=c.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&"closeTag"==g.type||d.string.indexOf("/")==d.string.length-1||h&&r(h,b)>-1||a(t,v,c,g,!0))return e.Pass;var y=p&&r(p,b)>-1;o[l]={indent:y,text:">"+(y?"\n\n":"")+"",newPos:y?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=n.length-1;l>=0;l--){var x=o[l];t.replaceRange(x.text,n[l].head,n[l].anchor,"+insert");var P=t.listSelections().slice(0);P[l]={head:x.newPos,anchor:x.newPos},t.setSelections(P),x.indent&&(t.indentLine(x.newPos.line,null,!0),t.indentLine(x.newPos.line+1,null,!0))}}function n(t,n){for(var o=t.listSelections(),r=[],i=n?"/":"";else{if("htmlmixed"!=t.getMode().name||"css"!=d.mode.name)return e.Pass;r[s]=i+"style>"}else{if(!f.context||!f.context.tagName||a(t,f.context.tagName,l,f))return e.Pass;r[s]=i+f.context.tagName+">"}}t.replaceSelections(r),o=t.listSelections();for(var s=0;sn;++n)if(e[n]==t)return n;return-1}function a(t,n,o,r,a){if(!e.scanForClosingTag)return!1;var i=Math.min(t.lastLine()+1,o.line+500),s=e.scanForClosingTag(t,o,null,i);if(!s||s.tag!=n)return!1;for(var l=r.context,c=a?1:0;l&&l.tagName==n;l=l.prev)++c;o=s.to;for(var d=1;c>d;d++){var f=e.scanForClosingTag(t,o,null,i);if(!f||f.tag!=n)return!1;o=f.to}return!0}e.defineOption("autoCloseTags",!1,function(n,r,a){if(a!=e.Init&&a&&n.removeKeyMap("autoCloseTags"),r){var i={name:"autoCloseTags"};("object"!=typeof r||r.whenClosing)&&(i["'/'"]=function(e){return o(e)}),("object"!=typeof r||r.whenOpening)&&(i["'>'"]=function(e){return t(e)}),n.addKeyMap(i)}});var i=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],s=["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"];e.commands.closeTag=function(e){return n(e)}}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/edit/continuelist.min.js b/media/editors/codemirror/addon/edit/continuelist.min.js new file mode 100644 index 0000000000000..c64320e8849be --- /dev/null +++ b/media/editors/codemirror/addon/edit/continuelist.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var n=/^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\s*)/,t=/^(\s*)(>[> ]*|[*+-]|(\d+)\.)(\s*)$/,i=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return e.Pass;for(var r=o.listSelections(),d=[],l=0;l")>=0?s[2]:parseInt(s[3],10)+1+".";d[l]="\n"+m+h+p}}o.replaceSelections(d)}}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/edit/matchbrackets.js b/media/editors/codemirror/addon/edit/matchbrackets.js index fa1ae030a5442..70e1ae18c7481 100644 --- a/media/editors/codemirror/addon/edit/matchbrackets.js +++ b/media/editors/codemirror/addon/edit/matchbrackets.js @@ -81,7 +81,7 @@ if (marks.length) { // Kludge to work around the IE bug from issue #1193, where text // input stops going to the textare whever this fires. - if (ie_lt8 && cm.state.focused) cm.display.input.focus(); + if (ie_lt8 && cm.state.focused) cm.focus(); var clear = function() { cm.operation(function() { diff --git a/media/editors/codemirror/addon/edit/matchbrackets.min.js b/media/editors/codemirror/addon/edit/matchbrackets.min.js new file mode 100644 index 0000000000000..0ed4a5a2b3270 --- /dev/null +++ b/media/editors/codemirror/addon/edit/matchbrackets.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i,r){var o=e.getLineHandle(t.line),f=t.ch-1,l=f>=0&&c[o.text.charAt(f)]||c[o.text.charAt(++f)];if(!l)return null;var u=">"==l.charAt(1)?1:-1;if(i&&u>0!=(f==t.ch))return null;var h=e.getTokenTypeAt(a(t.line,f+1)),s=n(e,a(t.line,f+(u>0?1:0)),u,h||null,r);return null==s?null:{from:a(t.line,f),to:s&&s.pos,match:s&&s.ch==l.charAt(0),forward:u>0}}function n(e,t,n,i,r){for(var o=r&&r.maxScanLineLength||1e4,f=r&&r.maxScanLines||1e3,l=[],u=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,h=n>0?Math.min(t.line+f,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-f),s=t.line;s!=h;s+=n){var m=e.getLine(s);if(m){var d=n>0?0:m.length-1,g=n>0?m.length:-1;if(!(m.length>o))for(s==t.line&&(d=t.ch-(0>n?1:0));d!=g;d+=n){var p=m.charAt(d);if(u.test(p)&&(void 0===i||e.getTokenTypeAt(a(s,d+1))==i)){var v=c[p];if(">"==v.charAt(1)==n>0)l.push(p);else{if(!l.length)return{pos:a(s,d),ch:p};l.pop()}}}}}return s-n==(n>0?e.lastLine():e.firstLine())?!1:null}function i(e,n,i){for(var r=e.state.matchBrackets.maxHighlightLineLength||1e3,c=[],f=e.listSelections(),l=0;l",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;e.defineOption("matchBrackets",!1,function(t,n,i){i&&i!=e.Init&&t.off("cursorActivity",r),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",r))}),e.defineExtension("matchBrackets",function(){i(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,i){return t(this,e,n,i)}),e.defineExtension("scanForBracket",function(e,t,i,r){return n(this,e,t,i,r)})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/edit/matchtags.min.js b/media/editors/codemirror/addon/edit/matchtags.min.js new file mode 100644 index 0000000000000..ad512db777d94 --- /dev/null +++ b/media/editors/codemirror/addon/edit/matchtags.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],t):t(CodeMirror)}(function(t){"use strict";function e(t){t.state.tagHit&&t.state.tagHit.clear(),t.state.tagOther&&t.state.tagOther.clear(),t.state.tagHit=t.state.tagOther=null}function a(a){a.state.failedTagMatch=!1,a.operation(function(){if(e(a),!a.somethingSelected()){var o=a.getCursor(),i=a.getViewport();i.from=Math.min(i.from,o.line),i.to=Math.max(o.line+1,i.to);var r=t.findMatchingTag(a,o,i);if(r){if(a.state.matchBothTags){var n="open"==r.at?r.open:r.close;n&&(a.state.tagHit=a.markText(n.from,n.to,{className:"CodeMirror-matchingtag"}))}var c="close"==r.at?r.open:r.close;c?a.state.tagOther=a.markText(c.from,c.to,{className:"CodeMirror-matchingtag"}):a.state.failedTagMatch=!0}}})}function o(t){t.state.failedTagMatch&&a(t)}t.defineOption("matchTags",!1,function(i,r,n){n&&n!=t.Init&&(i.off("cursorActivity",a),i.off("viewportChange",o),e(i)),r&&(i.state.matchBothTags="object"==typeof r&&r.bothTags,i.on("cursorActivity",a),i.on("viewportChange",o),a(i))}),t.commands.toMatchingTag=function(e){var a=t.findMatchingTag(e,e.getCursor());if(a){var o="close"==a.at?a.open:a.close;o&&e.extendSelection(o.to,o.from)}}}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/edit/trailingspace.min.js b/media/editors/codemirror/addon/edit/trailingspace.min.js new file mode 100644 index 0000000000000..ce38681657396 --- /dev/null +++ b/media/editors/codemirror/addon/edit/trailingspace.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineOption("showTrailingSpace",!1,function(i,n,o){o==e.Init&&(o=!1),o&&!n?i.removeOverlay("trailingspace"):!o&&n&&i.addOverlay({token:function(e){for(var i=e.string.length,n=i;n&&/\s/.test(e.string.charAt(n-1));--n);return n>e.pos?(e.pos=n,null):(e.pos=i,"trailingspace")},name:"trailingspace"})})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/fold/brace-fold.min.js b/media/editors/codemirror/addon/fold/brace-fold.min.js new file mode 100644 index 0000000000000..31806c36af22d --- /dev/null +++ b/media/editors/codemirror/addon/fold/brace-fold.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(r,n){function t(t){for(var i=n.ch,s=0;;){var u=0>=i?-1:f.lastIndexOf(t,i-1);if(-1!=u){if(1==s&&u=v;++v)for(var p=r.getLine(v),m=v==l?i:0;;){var P=p.indexOf(s,m),k=p.indexOf(u,m);if(0>P&&(P=p.length),0>k&&(k=p.length),m=Math.min(P,k),m==p.length)break;if(r.getTokenTypeAt(e.Pos(v,m+1))==o)if(m==P)++c;else if(!--c){a=v,d=m;break e}++m}if(null!=a&&(l!=a||d!=i))return{from:e.Pos(l,i),to:e.Pos(a,d)}}}),e.registerHelper("fold","import",function(r,n){function t(n){if(nr.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));if(/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"keyword"!=t.type||"import"!=t.string)return null;for(var i=n,o=Math.min(r.lastLine(),n+10);o>=i;++i){var l=r.getLine(i),f=l.indexOf(";");if(-1!=f)return{startCh:t.end,end:e.Pos(i,f)}}}var i,n=n.line,o=t(n);if(!o||t(n-1)||(i=t(n-2))&&i.end.line==n-1)return null;for(var l=o.end;;){var f=t(l.line+1);if(null==f)break;l=f.end}return{from:r.clipPos(e.Pos(n,o.startCh+1)),to:l}}),e.registerHelper("fold","include",function(r,n){function t(n){if(nr.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));return/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"meta"==t.type&&"#include"==t.string.slice(0,8)?t.start+8:void 0}var n=n.line,i=t(n);if(null==i||null!=t(n-1))return null;for(var o=n;;){var l=t(o+1);if(null==l)break;++o}return{from:e.Pos(n,i+1),to:r.clipPos(e.Pos(o))}})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/fold/comment-fold.min.js b/media/editors/codemirror/addon/fold/comment-fold.min.js new file mode 100644 index 0000000000000..3d68f5b4b8eb8 --- /dev/null +++ b/media/editors/codemirror/addon/fold/comment-fold.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerGlobalHelper("fold","comment",function(e){return e.blockCommentStart&&e.blockCommentEnd},function(t,n){var o=t.getModeAt(n),r=o.blockCommentStart,i=o.blockCommentEnd;if(r&&i){for(var f,l=n.line,c=t.getLine(l),m=n.ch,a=0;;){var d=0>=m?-1:c.lastIndexOf(r,m-1);if(-1!=d){if(1==a&&d=h;++h)for(var k=t.getLine(h),v=h==l?f:0;;){var p=k.indexOf(r,v),C=k.indexOf(i,v);if(0>p&&(p=k.length),0>C&&(C=k.length),v=Math.min(p,C),v==k.length)break;if(v==p)++s;else if(!--s){u=h,b=v;break e}++v}if(null!=u&&(l!=u||b!=f))return{from:e.Pos(l,f),to:e.Pos(u,b)}}})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/fold/foldcode.min.js b/media/editors/codemirror/addon/fold/foldcode.min.js new file mode 100644 index 0000000000000..78f7915842a2b --- /dev/null +++ b/media/editors/codemirror/addon/fold/foldcode.min.js @@ -0,0 +1 @@ +!function(n){"object"==typeof exports&&"object"==typeof module?n(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)}(function(n){"use strict";function o(o,i,t,f){function l(n){var e=d(o,i);if(!e||e.to.line-e.from.lineo.firstLine();)i=n.Pos(i.line-1,0),a=l(!1);if(a&&!a.cleared&&"unfold"!==f){var c=e(o,t);n.on(c,"mousedown",function(o){s.clear(),n.e_preventDefault(o)});var s=o.markText(a.from,a.to,{replacedWith:c,clearOnEnter:!0,__isFold:!0});s.on("clear",function(e,r){n.signal(o,"unfold",o,e,r)}),n.signal(o,"fold",o,a.from,a.to)}}function e(n,o){var e=r(n,o,"widget");if("string"==typeof e){var i=document.createTextNode(e);e=document.createElement("span"),e.appendChild(i),e.className="CodeMirror-foldmarker"}return e}function r(n,o,e){if(o&&void 0!==o[e])return o[e];var r=n.options.foldOptions;return r&&void 0!==r[e]?r[e]:i[e]}n.newFoldFunction=function(n,e){return function(r,i){o(r,i,{rangeFinder:n,widget:e})}},n.defineExtension("foldCode",function(n,e,r){o(this,n,e,r)}),n.defineExtension("isFolded",function(n){for(var o=this.findMarksAt(n),e=0;e=e;e++)o.foldCode(n.Pos(e,0),null,"fold")})},n.commands.unfoldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();r>=e;e++)o.foldCode(n.Pos(e,0),null,"unfold")})},n.registerHelper("fold","combine",function(){var n=Array.prototype.slice.call(arguments,0);return function(o,e){for(var r=0;r= state.from && line < state.to) updateFoldInfo(cm, line, line + 1); } diff --git a/media/editors/codemirror/addon/fold/foldgutter.min.css b/media/editors/codemirror/addon/fold/foldgutter.min.css new file mode 100644 index 0000000000000..167cf482e8d53 --- /dev/null +++ b/media/editors/codemirror/addon/fold/foldgutter.min.css @@ -0,0 +1 @@ +.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"} \ No newline at end of file diff --git a/media/editors/codemirror/addon/fold/foldgutter.min.js b/media/editors/codemirror/addon/fold/foldgutter.min.js new file mode 100644 index 0000000000000..3bf890dde6a0d --- /dev/null +++ b/media/editors/codemirror/addon/fold/foldgutter.min.js @@ -0,0 +1 @@ +!function(o){"object"==typeof exports&&"object"==typeof module?o(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],o):o(CodeMirror)}(function(o){"use strict";function t(o){this.options=o,this.from=this.to=0}function e(o){return o===!0&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o}function r(o,t){for(var e=o.findMarksAt(c(t)),r=0;r=d&&(e=n(i.indicatorOpen))}o.setGutterMarker(t,i.gutter,e),++f})}function f(o){var t=o.getViewport(),e=o.state.foldGutter;e&&(o.operation(function(){i(o,t.from,t.to)}),e.from=t.from,e.to=t.to)}function d(o,t,e){var r=o.state.foldGutter;if(r){var n=r.options;e==n.gutter&&o.foldCode(c(t,0),n.rangeFinder)}}function a(o){var t=o.state.foldGutter;if(t){var e=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){f(o)},e.foldOnChangeTimeSpan||600)}}function u(o){var t=o.state.foldGutter;if(t){var e=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var e=o.getViewport();t.from==t.to||e.from-t.to>20||t.from-e.to>20?f(o):o.operation(function(){e.fromt.to&&(i(o,t.to,e.to),t.to=e.to)})},e.updateViewportTimeSpan||400)}}function l(o,t){var e=o.state.foldGutter;if(e){var r=t.line;r>=e.from&&r=u;++u){var d=t.getLine(u),s=r(d);if(s>f)l=u;else if(/\S/.test(d))break}return l?{from:e.Pos(n.line,o.length),to:e.Pos(l,t.getLine(l).length)}:void 0}})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/fold/markdown-fold.min.js b/media/editors/codemirror/addon/fold/markdown-fold.min.js new file mode 100644 index 0000000000000..e15ba764509d1 --- /dev/null +++ b/media/editors/codemirror/addon/fold/markdown-fold.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","markdown",function(n,t){function r(t){var r=n.getTokenTypeAt(e.Pos(t,0));return r&&/\bheader\b/.test(r)}function i(e,n,t){var i=n&&n.match(/^#+/);return i&&r(e)?i[0].length:(i=t&&t.match(/^[=\-]+\s*$/),i&&r(e+1)?"="==t[0]?1:2:o)}var o=100,f=n.getLine(t.line),l=n.getLine(t.line+1),c=i(t.line,f,l);if(c===o)return void 0;for(var u=n.lastLine(),d=t.line,a=n.getLine(d+2);u>d&&!(i(d+1,l,a)<=c);)++d,l=a,a=n.getLine(d+2);return{from:e.Pos(t.line,f.length),to:e.Pos(d,n.getLine(d).length)}})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/fold/xml-fold.min.js b/media/editors/codemirror/addon/fold/xml-fold.min.js new file mode 100644 index 0000000000000..0f2794a4c23e4 --- /dev/null +++ b/media/editors/codemirror/addon/fold/xml-fold.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(e,n){return e.line-n.line||e.ch-n.ch}function t(e,n,t,i){this.line=n,this.ch=t,this.cm=e,this.text=e.getLine(n),this.min=i?i.from:e.firstLine(),this.max=i?i.to-1:e.lastLine()}function i(e,n){var t=e.cm.getTokenTypeAt(h(e.line,n));return t&&/\btag\b/.test(t)}function r(e){return e.line>=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function f(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function o(e){for(;;){var n=e.text.indexOf(">",e.ch);if(-1==n){if(r(e))continue;return}{if(i(e,n+1)){var t=e.text.lastIndexOf("/",n),f=t>-1&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,f?"selfClose":"regular"}e.ch=n+1}}}function u(e){for(;;){var n=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==n){if(f(e))continue;return}if(i(e,n+1)){g.lastIndex=n,e.ch=n;var t=g.exec(e.text);if(t&&t.index==n)return t}else e.ch=n}}function c(e){for(;;){g.lastIndex=e.ch;var n=g.exec(e.text);if(!n){if(r(e))continue;return}{if(i(e,n.index+1))return e.ch=n.index+n[0].length,n;e.ch=n.index+1}}}function l(e){for(;;){var n=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==n){if(f(e))continue;return}{if(i(e,n+1)){var t=e.text.lastIndexOf("/",n),r=t>-1&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,r?"selfClose":"regular"}e.ch=n}}}function a(e,n){for(var t=[];;){var i,r=c(e),f=e.line,u=e.ch-(r?r[0].length:0);if(!r||!(i=o(e)))return;if("selfClose"!=i)if(r[1]){for(var l=t.length-1;l>=0;--l)if(t[l]==r[2]){t.length=l;break}if(0>l&&(!n||n==r[2]))return{tag:r[2],from:h(f,u),to:h(e.line,e.ch)}}else t.push(r[2])}}function s(e,n){for(var t=[];;){var i=l(e);if(!i)return;if("selfClose"!=i){var r=e.line,f=e.ch,o=u(e);if(!o)return;if(o[1])t.push(o[2]);else{for(var c=t.length-1;c>=0;--c)if(t[c]==o[2]){t.length=c;break}if(0>c&&(!n||n==o[2]))return{tag:o[2],from:h(e.line,e.ch),to:h(r,f)}}}else u(e)}}var h=e.Pos,x="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",v=x+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+x+"]["+v+"]*)","g");e.registerHelper("fold","xml",function(e,n){for(var i=new t(e,n.line,0);;){var r,f=c(i);if(!f||i.line!=n.line||!(r=o(i)))return;if(!f[1]&&"selfClose"!=r){var n=h(i.line,i.ch),u=a(i,f[2]);return u&&{from:n,to:u.from}}}}),e.findMatchingTag=function(e,i,r){var f=new t(e,i.line,i.ch,r);if(-1!=f.text.indexOf(">")||-1!=f.text.indexOf("<")){var c=o(f),l=c&&h(f.line,f.ch),x=c&&u(f);if(c&&x&&!(n(f,i)>0)){var v={from:h(f.line,f.ch),to:l,tag:x[2]};return"selfClose"==c?{open:v,close:null,at:"open"}:x[1]?{open:s(f,x[2]),close:v,at:"close"}:(f=new t(e,l.line,l.ch,r),{open:v,close:a(f,x[2]),at:"open"})}}},e.findEnclosingTag=function(e,n,i){for(var r=new t(e,n.line,n.ch,i);;){var f=s(r);if(!f)break;var o=new t(e,n.line,n.ch,i),u=a(o,f.tag);if(u)return{open:f,close:u}}},e.scanForClosingTag=function(e,n,i,r){var f=new t(e,n.line,n.ch,r?{from:0,to:r}:null);return a(f,i)}}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/hint/anyword-hint.min.js b/media/editors/codemirror/addon/hint/anyword-hint.min.js new file mode 100644 index 0000000000000..c9167e6cd31e8 --- /dev/null +++ b/media/editors/codemirror/addon/hint/anyword-hint.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var r=/[\w$]+/,o=500;e.registerHelper("hint","anyword",function(t,i){for(var n=i&&i.word||r,f=i&&i.range||o,a=t.getCursor(),c=t.getLine(a.line),s=a.ch,l=s;l&&n.test(c.charAt(l-1));)--l;for(var d=l!=s&&c.slice(l,s),u=[],p={},g=new RegExp(n.source,"g"),h=-1;1>=h;h+=2)for(var m=a.line,y=Math.min(Math.max(m+h*f,t.firstLine()),t.lastLine())+h;m!=y;m+=h)for(var b,v=t.getLine(m);b=g.exec(v);)(m!=a.line||b[0]!==d)&&(d&&0!=b[0].lastIndexOf(d,0)||Object.prototype.hasOwnProperty.call(p,b[0])||(p[b[0]]=!0,u.push(b[0])));return{list:u,from:e.Pos(a.line,l),to:e.Pos(a.line,s)}})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/hint/css-hint.min.js b/media/editors/codemirror/addon/hint/css-hint.min.js new file mode 100644 index 0000000000000..fe0fc03ff9044 --- /dev/null +++ b/media/editors/codemirror/addon/hint/css-hint.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],e):e(CodeMirror)}(function(e){"use strict";var r={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};e.registerHelper("hint","css",function(t){function o(e){for(var r in e)c&&0!=r.lastIndexOf(c,0)||l.push(r)}var s=t.getCursor(),i=t.getTokenAt(s),n=e.innerMode(t.getMode(),i.state);if("css"==n.mode.name){var a=i.start,d=s.ch,c=i.string.slice(0,d-a);/[^\w$_-]/.test(c)&&(c="",a=d=s.ch);var f=e.resolveMode("text/css"),l=[],p=n.state.state;return"pseudo"==p||"variable-3"==i.type?o(r):"block"==p||"maybeprop"==p?o(f.propertyKeywords):"prop"==p||"parens"==p||"at"==p||"params"==p?(o(f.valueKeywords),o(f.colorKeywords)):("media"==p||"media_parens"==p)&&(o(f.mediaTypes),o(f.mediaFeatures)),l.length?{list:l,from:e.Pos(s.line,a),to:e.Pos(s.line,d)}:void 0}})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/hint/html-hint.min.js b/media/editors/codemirror/addon/hint/html-hint.min.js new file mode 100644 index 0000000000000..dc4f8e6da289a --- /dev/null +++ b/media/editors/codemirror/addon/hint/html-hint.min.js @@ -0,0 +1 @@ +!function(l){"object"==typeof exports&&"object"==typeof module?l(require("../../lib/codemirror"),require("./xml-hint")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./xml-hint"],l):l(CodeMirror)}(function(l){"use strict";function t(l){for(var t in c)c.hasOwnProperty(t)&&(l.attrs[t]=c[t])}function e(t,e){var a={schemaInfo:d};if(e)for(var n in e)a[n]=e[n];return l.hint.xml(t,a)}var a="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),n=["_blank","_self","_top","_parent"],r=["ascii","utf-8","utf-16","latin1","latin1"],o=["get","post","put","delete"],s=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],u=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],i={attrs:{}},d={a:{attrs:{href:null,ping:null,type:null,media:u,target:n,hreflang:a}},abbr:i,acronym:i,address:i,applet:i,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:u,hreflang:a,type:null,shape:["default","rect","circle","poly"]}},article:i,aside:i,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:i,base:{attrs:{href:null,target:n}},basefont:i,bdi:i,bdo:i,big:i,blockquote:{attrs:{cite:null}},body:i,br:i,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:s,formmethod:o,formnovalidate:["","novalidate"],formtarget:n,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:i,center:i,cite:i,code:i,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:i,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:i,dir:i,div:i,dl:i,dt:i,em:i,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:i,figure:i,font:i,footer:i,form:{attrs:{action:null,name:null,"accept-charset":r,autocomplete:["on","off"],enctype:s,method:o,novalidate:["","novalidate"],target:n}},frame:i,frameset:i,h1:i,h2:i,h3:i,h4:i,h5:i,h6:i,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:i,hgroup:i,hr:i,html:{attrs:{manifest:null},children:["head","body"]},i:i,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:s,formmethod:o,formnovalidate:["","novalidate"],formtarget:n,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:i,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{"for":null,form:null}},legend:i,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:a,media:u,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:i,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:r,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:i,noframes:i,noscript:i,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{"for":null,form:null,name:null}},p:i,param:{attrs:{name:null,value:null}},pre:i,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:i,rt:i,ruby:i,s:i,samp:i,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:r}},section:i,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:i,source:{attrs:{src:null,type:null,media:null}},span:i,strike:i,strong:i,style:{attrs:{type:["text/css"],media:u,scoped:null}},sub:i,summary:i,sup:i,table:i,tbody:i,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:i,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:i,time:{attrs:{datetime:null}},title:i,tr:i,track:{attrs:{src:null,label:null,"default":null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:a}},tt:i,u:i,ul:i,"var":i,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:i},c={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],"class":null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};t(i);for(var m in d)d.hasOwnProperty(m)&&d[m]!=i&&t(d[m]);l.htmlSchema=d,l.registerHelper("hint","html",e)}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/hint/javascript-hint.min.js b/media/editors/codemirror/addon/hint/javascript-hint.min.js new file mode 100644 index 0000000000000..23e6243bc6dcb --- /dev/null +++ b/media/editors/codemirror/addon/hint/javascript-hint.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){function e(t,e){for(var r=0,n=t.length;n>r;++r)e(t[r])}function r(t,e){if(!Array.prototype.indexOf){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1}return-1!=t.indexOf(e)}function n(e,r,n,i){var o=e.getCursor(),s=n(e,o);if(!/\b(?:string|comment)\b/.test(s.type)){s.state=t.innerMode(e.getMode(),s.state).state,/^[\w$_]*$/.test(s.string)?s.end>o.ch&&(s.end=o.ch,s.string=s.string.slice(0,o.ch-s.start)):s={start:o.ch,end:o.ch,string:"",state:s.state,type:"."==s.string?"property":null};for(var f=s;"property"==f.type;){if(f=n(e,l(o.line,f.start)),"."!=f.string)return;if(f=n(e,l(o.line,f.start)),!c)var c=[];c.push(f)}return{list:a(s,c,r,i),from:l(o.line,s.start),to:l(o.line,s.end)}}}function i(t,e){return n(t,u,function(t,e){return t.getTokenAt(e)},e)}function o(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}function s(t,e){return n(t,d,o,e)}function a(t,n,i,o){function s(t){0!=t.lastIndexOf(u,0)||r(l,t)||l.push(t)}function a(t){"string"==typeof t?e(f,s):t instanceof Array?e(c,s):t instanceof Function&&e(p,s);for(var r in t)s(r)}var l=[],u=t.string,d=o&&o.globalScope||window;if(n&&n.length){var g,h=n.pop();for(h.type&&0===h.type.indexOf("variable")?(o&&o.additionalContext&&(g=o.additionalContext[h.string]),o&&o.useGlobalScope===!1||(g=g||d[h.string])):"string"==h.type?g="":"atom"==h.type?g=1:"function"==h.type&&(null==d.jQuery||"$"!=h.string&&"jQuery"!=h.string||"function"!=typeof d.jQuery?null!=d._&&"_"==h.string&&"function"==typeof d._&&(g=d._()):g=d.jQuery());null!=g&&n.length;)g=g[n.pop().string];null!=g&&a(g)}else{for(var y=t.state.localVars;y;y=y.next)s(y.name);for(var y=t.state.globalVars;y;y=y.next)s(y.name);o&&o.useGlobalScope===!1||a(d),e(i,s)}return l}var l=t.Pos;t.registerHelper("hint","javascript",i),t.registerHelper("hint","coffeescript",s);var f="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),c="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),p="prototype apply call bind".split(" "),u="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),d="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 fda5ffaa164bb..f5446194288f9 100644 --- a/media/editors/codemirror/addon/hint/show-hint.js +++ b/media/editors/codemirror/addon/hint/show-hint.js @@ -24,6 +24,18 @@ return cm.showHint(newOpts); }; + var asyncRunID = 0; + function retrieveHints(getter, cm, options, then) { + if (getter.async) { + var id = ++asyncRunID; + getter(cm, function(hints) { + if (asyncRunID == id) then(hints); + }, options); + } else { + then(getter(cm, options)); + } + } + CodeMirror.defineExtension("showHint", function(options) { // We want a single cursor position. if (this.listSelections().length > 1 || this.somethingSelected()) return; @@ -34,10 +46,7 @@ if (!getHints) return; CodeMirror.signal(this, "startCompletion", this); - if (getHints.async) - getHints(this, function(hints) { completion.showHints(hints); }, completion.options); - else - return completion.showHints(getHints(this, completion.options)); + return retrieveHints(getHints, this, completion.options, function(hints) { completion.showHints(hints); }); }); function Completion(cm, options) { @@ -102,11 +111,7 @@ function update() { if (finished) return; CodeMirror.signal(data, "update"); - var getHints = completion.options.hint; - if (getHints.async) - getHints(completion.cm, finishUpdate, completion.options); - else - finishUpdate(getHints(completion.cm, completion.options)); + retrieveHints(completion.options.hint, completion.cm, completion.options, finishUpdate); } function finishUpdate(data_) { data = data_; diff --git a/media/editors/codemirror/addon/hint/show-hint.min.css b/media/editors/codemirror/addon/hint/show-hint.min.css new file mode 100644 index 0000000000000..c8c87f060dffb --- /dev/null +++ b/media/editors/codemirror/addon/hint/show-hint.min.css @@ -0,0 +1 @@ +.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:white;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;max-width:19em;overflow:hidden;white-space:pre;color:black;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:white} \ No newline at end of file diff --git a/media/editors/codemirror/addon/hint/show-hint.min.js b/media/editors/codemirror/addon/hint/show-hint.min.js new file mode 100644 index 0000000000000..e8fc4c6fa8665 --- /dev/null +++ b/media/editors/codemirror/addon/hint/show-hint.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e,i,n){if(t.async){var o=++h;t(e,function(t){h==o&&n(t)},i)}else n(t(e,i))}function i(t,e){this.cm=t,this.options=this.buildOptions(e),this.widget=this.onClose=null}function n(t){return"string"==typeof t?t:t.text}function o(t,e){function i(t,i){var o;o="string"!=typeof i?function(t){return i(t,e)}:n.hasOwnProperty(i)?n[i]:i,s[t]=o}var n={Up:function(){e.moveFocus(-1)},Down:function(){e.moveFocus(1)},PageUp:function(){e.moveFocus(-e.menuSize()+1,!0)},PageDown:function(){e.moveFocus(e.menuSize()-1,!0)},Home:function(){e.setFocus(0)},End:function(){e.setFocus(e.length-1)},Enter:e.pick,Tab:e.pick,Esc:e.close},o=t.options.customKeys,s=o?{}:n;if(o)for(var c in o)o.hasOwnProperty(c)&&i(c,o[c]);var l=t.options.extraKeys;if(l)for(var c in l)l.hasOwnProperty(c)&&i(c,l[c]);return s}function s(t,e){for(;e&&e!=t;){if("LI"===e.nodeName.toUpperCase()&&e.parentNode==t)return e;e=e.parentNode}}function c(e,i){this.completion=e,this.data=i;var c=this,h=e.cm,a=this.hints=document.createElement("ul");a.className="CodeMirror-hints",this.selectedHint=i.selectedHint||0;for(var f=i.list,u=0;u0){var k=b.bottom-b.top,A=g.top-(g.bottom-b.top);if(A-k>0)a.style.top=(w=g.top-k)+"px",y=!1;else if(k>H){a.style.height=H-5+"px",a.style.top=(w=g.bottom-b.top)+"px";var T=h.getCursor();i.from.ch!=T.ch&&(g=h.cursorCoords(T),a.style.left=(v=g.left)+"px",b=a.getBoundingClientRect())}}var N=b.right-C;if(N>0&&(b.right-b.left>C&&(a.style.width=C-5+"px",N-=b.right-b.left-C),a.style.left=(v=g.left-N)+"px"),h.addKeyMap(this.keyMap=o(e,{moveFocus:function(t,e){c.changeActive(c.selectedHint+t,e)},setFocus:function(t){c.changeActive(t)},menuSize:function(){return c.screenAmount()},length:f.length,close:function(){e.close()},pick:function(){c.pick()},data:i})),e.options.closeOnUnfocus){var O;h.on("blur",this.onBlur=function(){O=setTimeout(function(){e.close()},100)}),h.on("focus",this.onFocus=function(){clearTimeout(O)})}var S=h.getScrollInfo();return h.on("scroll",this.onScroll=function(){var t=h.getScrollInfo(),i=h.getWrapperElement().getBoundingClientRect(),n=w+S.top-t.top,o=n-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return y||(o+=a.offsetHeight),o<=i.top||o>=i.bottom?e.close():(a.style.top=n+"px",void(a.style.left=v+S.left-t.left+"px"))}),t.on(a,"dblclick",function(t){var e=s(a,t.target||t.srcElement);e&&null!=e.hintId&&(c.changeActive(e.hintId),c.pick())}),t.on(a,"click",function(t){var i=s(a,t.target||t.srcElement);i&&null!=i.hintId&&(c.changeActive(i.hintId),e.options.completeOnSingleClick&&c.pick())}),t.on(a,"mousedown",function(){setTimeout(function(){h.focus()},20)}),t.signal(i,"select",f[0],a.firstChild),!0}var l="CodeMirror-hint",r="CodeMirror-hint-active";t.showHint=function(t,e,i){if(!e)return t.showHint(i);i&&i.async&&(e.async=!0);var n={hint:e};if(i)for(var o in i)n[o]=i[o];return t.showHint(n)};var h=0;t.defineExtension("showHint",function(n){if(!(this.listSelections().length>1||this.somethingSelected())){this.state.completionActive&&this.state.completionActive.close();var o=this.state.completionActive=new i(this,n),s=o.options.hint;if(s)return t.signal(this,"startCompletion",this),e(s,this,o.options,function(t){o.showHints(t)})}}),i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.widget&&this.widget.close(),this.onClose&&this.onClose(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(e,i){var o=e.list[i];o.hint?o.hint(this.cm,e,o):this.cm.replaceRange(n(o),o.from||e.from,o.to||e.to,"complete"),t.signal(e,"pick",o),this.close()},showHints:function(t){return t&&t.list.length&&this.active()?void(this.options.completeSingle&&1==t.list.length?this.pick(t,0):this.showWidget(t)):this.close()},showWidget:function(i){function n(){h||(h=!0,f.close(),f.cm.off("cursorActivity",r),i&&t.signal(i,"close"))}function o(){h||(t.signal(i,"update"),e(f.options.hint,f.cm,f.options,s))}function s(t){if(i=t,!h){if(!i||!i.list.length)return n();f.widget&&f.widget.close(),f.widget=new c(f,i)}}function l(){a&&(g(a),a=0)}function r(){l();var t=f.cm.getCursor(),e=f.cm.getLine(t.line);t.line!=d.line||e.length-t.ch!=p-d.ch||t.ch=this.data.list.length?e=i?this.data.list.length-1:0:0>e&&(e=i?0:this.data.list.length-1),this.selectedHint!=e){var n=this.hints.childNodes[this.selectedHint];n.className=n.className.replace(" "+r,""),n=this.hints.childNodes[this.selectedHint=e],n.className+=" "+r,n.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+3),t.signal(this.data,"select",this.data.list[this.selectedHint],n)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},t.registerHelper("hint","auto",function(e,i){var n,o=e.getHelpers(e.getCursor(),"hint");if(o.length)for(var s=0;s,]/,closeOnUnfocus:!0,completeOnSingleClick:!1,container:null,customKeys:null,extraKeys:null};t.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 92c889e139f21..5b0cc7696f2a1 100644 --- a/media/editors/codemirror/addon/hint/sql-hint.js +++ b/media/editors/codemirror/addon/hint/sql-hint.js @@ -26,9 +26,26 @@ return CodeMirror.resolveMode(mode).keywords; } + function getText(item) { + return typeof item == "string" ? item : item.text; + } + + function getItem(list, item) { + if (!list.slice) return list[item]; + for (var i = list.length - 1; i >= 0; i--) if (getText(list[i]) == item) + return list[i]; + } + + function shallowClone(object) { + var result = {}; + for (var key in object) if (object.hasOwnProperty(key)) + result[key] = object[key]; + return result; + } + function match(string, word) { var len = string.length; - var sub = word.substr(0, len); + var sub = getText(word).substr(0, len); return string.toUpperCase() === sub.toUpperCase(); } @@ -44,53 +61,81 @@ } } + function cleanName(name) { + // Get rid name from backticks(`) and preceding dot(.) + if (name.charAt(0) == ".") { + name = name.substr(1); + } + return name.replace(/`/g, ""); + } + + function insertBackticks(name) { + var nameParts = getText(name).split("."); + for (var i = 0; i < nameParts.length; i++) + nameParts[i] = "`" + nameParts[i] + "`"; + var escaped = nameParts.join("."); + if (typeof name == "string") return escaped; + name = shallowClone(name); + name.text = escaped; + return name; + } + function nameCompletion(cur, token, result, editor) { - var useBacktick = (token.string.charAt(0) == "`"); - var string = token.string.substr(1); - var prevToken = editor.getTokenAt(Pos(cur.line, token.start)); - if (token.string.charAt(0) == "." || prevToken.string == "."){ - //Suggest colunm names - if (prevToken.string == ".") { - var prevToken = editor.getTokenAt(Pos(cur.line, token.start - 1)); - } - var table = prevToken.string; - //Check if backtick is used in table name. If yes, use it for columns too. - var useBacktickTable = false; - if (table.match(/`/g)) { - useBacktickTable = true; - table = table.replace(/`/g, ""); - } - //Check if table is available. If not, find table by Alias - if (!tables.hasOwnProperty(table)) - table = findTableByAlias(table, editor); - var columns = tables[table]; - if (!columns) return; - - if (useBacktick) { - addMatches(result, string, columns, function(w) {return "`" + w + "`";}); - } - else if(useBacktickTable) { - addMatches(result, string, columns, function(w) {return ".`" + w + "`";}); - } - else { - addMatches(result, string, columns, function(w) {return "." + w;}); + // Try to complete table, colunm names and return start position of completion + var useBacktick = false; + var nameParts = []; + var start = token.start; + var cont = true; + while (cont) { + cont = (token.string.charAt(0) == "."); + useBacktick = useBacktick || (token.string.charAt(0) == "`"); + + start = token.start; + nameParts.unshift(cleanName(token.string)); + + token = editor.getTokenAt(Pos(cur.line, token.start)); + if (token.string == ".") { + cont = true; + token = editor.getTokenAt(Pos(cur.line, token.start)); } } - else { - //Suggest table names or colums in defaultTable - while (token.start && string.charAt(0) == ".") { - token = editor.getTokenAt(Pos(cur.line, token.start - 1)); - string = token.string + string; - } - if (useBacktick) { - addMatches(result, string, tables, function(w) {return "`" + w + "`";}); - addMatches(result, string, defaultTable, function(w) {return "`" + w + "`";}); - } - else { - addMatches(result, string, tables, function(w) {return w;}); - addMatches(result, string, defaultTable, function(w) {return w;}); - } + + // Try to complete table names + var string = nameParts.join("."); + addMatches(result, string, tables, function(w) { + return useBacktick ? insertBackticks(w) : w; + }); + + // Try to complete columns from defaultTable + addMatches(result, string, defaultTable, function(w) { + return useBacktick ? insertBackticks(w) : w; + }); + + // Try to complete columns + string = nameParts.pop(); + var table = nameParts.join("."); + + // Check if table is available. If not, find table by Alias + if (!getItem(tables, table)) + table = findTableByAlias(table, editor); + + var columns = getItem(tables, table); + if (columns && Array.isArray(tables) && columns.columns) + columns = columns.columns; + + if (columns) { + addMatches(result, string, columns, function(w) { + if (typeof w == "string") { + w = table + "." + w; + } else { + w = shallowClone(w); + w.text = table + "." + w.text; + } + return useBacktick ? insertBackticks(w) : w; + }); } + + return start; } function eachWord(lineText, f) { @@ -150,12 +195,10 @@ var lineText = query[i]; eachWord(lineText, function(word) { var wordUpperCase = word.toUpperCase(); - if (wordUpperCase === aliasUpperCase && tables.hasOwnProperty(previousWord)) { - table = previousWord; - } - if (wordUpperCase !== CONS.ALIAS_KEYWORD) { + if (wordUpperCase === aliasUpperCase && getItem(tables, previousWord)) + table = previousWord; + if (wordUpperCase !== CONS.ALIAS_KEYWORD) previousWord = word; - } }); if (table) break; } @@ -165,7 +208,7 @@ CodeMirror.registerHelper("hint", "sql", function(editor, options) { tables = (options && options.tables) || {}; var defaultTableName = options && options.defaultTable; - defaultTable = (defaultTableName && tables[defaultTableName] || []); + defaultTable = (defaultTableName && getItem(tables, defaultTableName)) || []; keywords = keywords || getKeywords(editor); var cur = editor.getCursor(); @@ -185,7 +228,7 @@ search = ""; } if (search.charAt(0) == "." || search.charAt(0) == "`") { - nameCompletion(cur, token, result, editor); + start = nameCompletion(cur, token, result, editor); } else { addMatches(result, search, tables, function(w) {return w;}); addMatches(result, search, defaultTable, function(w) {return w;}); diff --git a/media/editors/codemirror/addon/hint/sql-hint.min.js b/media/editors/codemirror/addon/hint/sql-hint.min.js new file mode 100644 index 0000000000000..a8e075dd002be --- /dev/null +++ b/media/editors/codemirror/addon/hint/sql-hint.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../../mode/sql/sql")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/sql/sql"],t):t(CodeMirror)}(function(t){"use strict";function r(r){var n=r.doc.modeOption;return"sql"===n&&(n="text/x-sql"),t.resolveMode(n).keywords}function n(t){return"string"==typeof t?t:t.text}function e(t,r){if(!t.slice)return t[r];for(var e=t.length-1;e>=0;e--)if(n(t[e])==r)return t[e]}function o(t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}function i(t,r){var e=t.length,o=n(r).substr(0,e);return t.toUpperCase()===o.toUpperCase()}function s(t,r,n,e){for(var o in n)n.hasOwnProperty(o)&&(Array.isArray(n)&&(o=n[o]),i(r,o)&&t.push(e(o)))}function a(t){return"."==t.charAt(0)&&(t=t.substr(1)),t.replace(/`/g,"")}function u(t){for(var r=n(t).split("."),e=0;ed&&x>=v){f={start:p(d),end:p(x)};break}d=x}for(var b=n.getRange(f.start,f.end,!1),m=0;mc.ch&&(p.end=c.ch,p.string=p.string.slice(0,c.ch-p.start)),p.string.match(/^[.`\w@]\w*$/)?(u=p.string,i=p.start,a=p.end):(i=a=c.ch,u=""),"."==u.charAt(0)||"`"==u.charAt(0)?i=f(c,p,l,t):(s(l,u,h,function(t){return t}),s(l,u,d,function(t){return t}),s(l,u,v,function(t){return t.toUpperCase()})),{list:l,from:y(c.line,i),to:y(c.line,a)}})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/hint/xml-hint.min.js b/media/editors/codemirror/addon/hint/xml-hint.min.js new file mode 100644 index 0000000000000..bee0be1856325 --- /dev/null +++ b/media/editors/codemirror/addon/hint/xml-hint.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,s){var n=s&&s.schemaInfo,a=s&&s.quoteChar||'"';if(n){var i=e.getCursor(),o=e.getTokenAt(i);o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start));var l=t.innerMode(e.getMode(),o.state);if("xml"==l.mode.name){var f,g,c=[],h=!1,p=/\btag\b/.test(o.type)&&!/>$/.test(o.string),u=p&&/^\w/.test(o.string);if(u){var d=e.getLine(i.line).slice(Math.max(0,o.start-2),o.start),m=/<\/$/.test(d)?"close":/<$/.test(d)?"open":null;m&&(g=o.start-("close"==m?2:1))}else p&&"<"==o.string?m="open":p&&"")}else{var y=n[l.state.tagName],w=y&&y.attrs,I=n["!attrs"];if(!w&&!I)return;if(w){if(I){var P={};for(var A in I)I.hasOwnProperty(A)&&(P[A]=I[A]);for(var A in w)w.hasOwnProperty(A)&&(P[A]=w[A]);w=P}}else w=I;if("string"==o.type||"="==o.string){var M,d=e.getRange(r(i.line,Math.max(0,i.ch-60)),r(i.line,"string"==o.type?o.start:o.end)),N=d.match(/([^\s\u00a0=<>\"\']+)=$/);if(!N||!w.hasOwnProperty(N[1])||!(M=w[N[1]]))return;if("function"==typeof M&&(M=M.call(this,e)),"string"==o.type){f=o.string;var $=0;/['"]/.test(o.string.charAt(0))&&(a=o.string.charAt(0),f=o.string.slice(1),$++);var C=o.string.length;/['"]/.test(o.string.charAt(C-1))&&(a=o.string.charAt(C-1),f=o.string.substr($,C-2)),h=!0}for(var O=0;O0){var d=o.character;s.forEach(function(e){d>e&&(d-=1)}),o.character=d}}var u=o.character-1,l=u+1;o.evidence&&(c=o.evidence.substring(u).search(/.\b/),c>-1&&(l+=c)),o.description=o.reason,o.start=o.character,o.end=l,o=n(o),o&&i.push({message:o.description,severity:o.severity,from:e.Pos(o.line-1,u),to:e.Pos(o.line-1,l)})}}}var a=["Dangerous comment"],c=[["Expected '{'","Statement body should be inside '{ }' braces."]],s=["Missing semicolon","Extra comma","Missing property name","Unmatched "," and instead saw"," is not defined","Unclosed string","Stopping, unable to continue"];e.registerHelper("lint","javascript",r)}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/lint/json-lint.min.js b/media/editors/codemirror/addon/lint/json-lint.min.js new file mode 100644 index 0000000000000..a7ccc3ce8dd75 --- /dev/null +++ b/media/editors/codemirror/addon/lint/json-lint.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("lint","json",function(o){var r=[];jsonlint.parseError=function(o,t){var n=t.loc;r.push({from:e.Pos(n.first_line-1,n.first_column),to:e.Pos(n.last_line-1,n.last_column),message:o})};try{jsonlint.parse(o)}catch(t){}return r})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/lint/lint.js b/media/editors/codemirror/addon/lint/lint.js index 66f187e22eac8..18eb709016689 100644 --- a/media/editors/codemirror/addon/lint/lint.js +++ b/media/editors/codemirror/addon/lint/lint.js @@ -46,6 +46,7 @@ } var poll = setInterval(function() { if (tooltip) for (var n = node;; n = n.parentNode) { + if (n && n.nodeType == 11) n = n.host; if (n == document.body) return; if (!n) { hide(); break; } } @@ -119,7 +120,7 @@ function startLinting(cm) { var state = cm.state.lint, options = state.options; var passOptions = options.options || options; // Support deprecated passing of `options` property in options - if (options.async) + if (options.async || options.getAnnotations.async) options.getAnnotations(cm.getValue(), updateLinting, passOptions, cm); else updateLinting(cm, options.getAnnotations(cm.getValue(), passOptions, cm)); diff --git a/media/editors/codemirror/addon/lint/lint.min.css b/media/editors/codemirror/addon/lint/lint.min.css new file mode 100644 index 0000000000000..d807285416d5b --- /dev/null +++ b/media/editors/codemirror/addon/lint/lint.min.css @@ -0,0 +1 @@ +.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:infobackground;border:1px solid black;border-radius:4px 4px 4px 4px;color:infotext;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark-error,.CodeMirror-lint-mark-warning{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-error{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")}.CodeMirror-lint-mark-warning{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=")}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=")}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=")}.CodeMirror-lint-marker-multiple{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%} \ No newline at end of file diff --git a/media/editors/codemirror/addon/lint/lint.min.js b/media/editors/codemirror/addon/lint/lint.min.js new file mode 100644 index 0000000000000..4291d87272733 --- /dev/null +++ b/media/editors/codemirror/addon/lint/lint.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,n){function o(e){return r.parentNode?(r.style.top=Math.max(0,e.clientY-r.offsetHeight-5)+"px",void(r.style.left=e.clientX+5+"px")):t.off(document,"mousemove",o)}var r=document.createElement("div");return r.className="CodeMirror-lint-tooltip",r.appendChild(n.cloneNode(!0)),document.body.appendChild(r),t.on(document,"mousemove",o),o(e),null!=r.style.opacity&&(r.style.opacity=1),r}function n(t){t.parentNode&&t.parentNode.removeChild(t)}function o(t){t.parentNode&&(null==t.style.opacity&&n(t),t.style.opacity=0,setTimeout(function(){n(t)},600))}function r(n,r,i){function a(){t.off(i,"mouseout",a),s&&(o(s),s=null)}var s=e(n,r),u=setInterval(function(){if(s)for(var t=i;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){a();break}}return s?void 0:clearInterval(u)},400);t.on(i,"mouseout",a)}function i(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){g(t,e)}}function a(e,n){if(n instanceof Function)return{getAnnotations:n};if(n&&n!==!0||(n={}),n.getAnnotations||(n.getAnnotations=e.getHelper(t.Pos(0,0),"lint")),!n.getAnnotations)throw new Error("Required option 'getAnnotations' missing (lint addon)");return n}function s(t){var e=t.state.lint;e.hasGutter&&t.clearGutter(h);for(var n=0;n1,n.options.tooltips))}}o.onUpdateLinting&&o.onUpdateLinting(e,r,t)}function p(t){var e=t.state.lint;clearTimeout(e.timeout),e.timeout=setTimeout(function(){d(t)},e.options.delay||500)}function v(t,e){var n=e.target||e.srcElement;r(e,f(t),n)}function g(t,e){var n=e.target||e.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className))for(var o=n.getBoundingClientRect(),r=(o.left+o.right)/2,i=(o.top+o.bottom)/2,a=t.findMarksAt(t.coordsChar({left:r,top:i},"client")),s=0;s= vpEdit.from && - topOrig <= vpOrig.to && botOrig >= vpOrig.from) - drawConnectorsForChunk(dv, topOrig, botOrig, topEdit, botEdit, sTopOrig, sTopEdit, w); - if (align && (topEdit <= vpEdit.to || topOrig <= vpOrig.to)) { - var above = (botEdit < vpEdit.from && botOrig < vpOrig.from); - alignChunks(dv, topOrig, botOrig, topEdit, botEdit, above && extraSpaceAbove); + for (var i = 0; i < dv.chunks.length; i++) { + var ch = dv.chunks[i]; + if (ch.editFrom <= vpEdit.to && ch.editTo >= vpEdit.from && + ch.origFrom <= vpOrig.to && ch.origTo >= vpOrig.from) + drawConnectorsForChunk(dv, ch, sTopOrig, sTopEdit, w); + } + } + + function getMatchingOrigLine(editLine, chunks) { + var editStart = 0, origStart = 0; + for (var i = 0; i < chunks.length; i++) { + var chunk = chunks[i]; + if (chunk.editTo > editLine && chunk.editFrom <= editLine) return null; + if (chunk.editFrom > editLine) break; + editStart = chunk.editTo; + origStart = chunk.origTo; + } + return origStart + (editLine - editStart); + } + + function findAlignedLines(dv, other) { + var linesToAlign = []; + for (var i = 0; i < dv.chunks.length; i++) { + var chunk = dv.chunks[i]; + linesToAlign.push([chunk.origTo, chunk.editTo, other ? getMatchingOrigLine(chunk.editTo, other.chunks) : null]); + } + if (other) { + for (var i = 0; i < other.chunks.length; i++) { + var chunk = other.chunks[i]; + for (var j = 0; j < linesToAlign.length; j++) { + var align = linesToAlign[j]; + if (align[1] == chunk.editTo) { + j = -1; + break; + } else if (align[1] > chunk.editTo) { + break; + } + } + if (j > -1) + linesToAlign.splice(j - 1, 0, [getMatchingOrigLine(chunk.editTo, dv.chunks), chunk.editTo, chunk.origTo]); } + } + return linesToAlign; + } + + function alignChunks(dv, force) { + if (!dv.dealigned && !force) return; + if (!dv.orig.curOp) return dv.orig.operation(function() { + alignChunks(dv, force); }); - if (align) { - if (extraSpaceAbove.edit) - dv.aligners.push(padBelow(dv.edit, 0, extraSpaceAbove.edit)); - if (extraSpaceAbove.orig) - dv.aligners.push(padBelow(dv.orig, 0, extraSpaceAbove.orig)); - dv.edit.scrollTo(null, oldScrollEdit); - dv.orig.scrollTo(null, oldScrollOrig); + + dv.dealigned = false; + var other = dv.mv.left == dv ? dv.mv.right : dv.mv.left; + if (other) { + ensureDiff(other); + other.dealigned = false; } + var linesToAlign = findAlignedLines(dv, other); + + // Clear old aligners + var aligners = dv.mv.aligners; + for (var i = 0; i < aligners.length; i++) + aligners[i].clear(); + aligners.length = 0; + + var cm = [dv.orig, dv.edit], scroll = []; + if (other) cm.push(other.orig); + for (var i = 0; i < cm.length; i++) + scroll.push(cm[i].getScrollInfo().top); + + for (var ln = 0; ln < linesToAlign.length; ln++) + alignLines(cm, linesToAlign[ln], aligners); + + for (var i = 0; i < cm.length; i++) + cm[i].scrollTo(null, scroll[i]); } - function drawConnectorsForChunk(dv, topOrig, botOrig, topEdit, botEdit, sTopOrig, sTopEdit, w) { + function alignLines(cm, lines, aligners) { + var maxOffset = 0, offset = []; + for (var i = 0; i < cm.length; i++) if (lines[i] != null) { + var off = cm[i].heightAtLine(lines[i], "local"); + offset[i] = off; + maxOffset = Math.max(maxOffset, off); + } + for (var i = 0; i < cm.length; i++) if (lines[i] != null) { + var diff = maxOffset - offset[i]; + if (diff > 1) + aligners.push(padAbove(cm[i], lines[i], diff)); + } + } + + function padAbove(cm, line, size) { + var above = true; + if (line > cm.lastLine()) { + line--; + above = false; + } + var elt = document.createElement("div"); + elt.className = "CodeMirror-merge-spacer"; + elt.style.height = size + "px"; elt.style.minWidth = "1px"; + return cm.addLineWidget(line, elt, {height: size, above: above}); + } + + function drawConnectorsForChunk(dv, chunk, sTopOrig, sTopEdit, w) { var flip = dv.type == "left"; - var top = dv.orig.heightAtLine(topOrig, "local") - sTopOrig; + var top = dv.orig.heightAtLine(chunk.origFrom, "local") - sTopOrig; if (dv.svg) { var topLpx = top; - var topRpx = dv.edit.heightAtLine(topEdit, "local") - sTopEdit; + var topRpx = dv.edit.heightAtLine(chunk.editFrom, "local") - sTopEdit; if (flip) { var tmp = topLpx; topLpx = topRpx; topRpx = tmp; } - var botLpx = dv.orig.heightAtLine(botOrig, "local") - sTopOrig; - var botRpx = dv.edit.heightAtLine(botEdit, "local") - sTopEdit; + var botLpx = dv.orig.heightAtLine(chunk.origTo, "local") - sTopOrig; + var botRpx = dv.edit.heightAtLine(chunk.editTo, "local") - sTopEdit; if (flip) { var tmp = botLpx; botLpx = botRpx; botRpx = tmp; } var curveTop = " C " + w/2 + " " + topRpx + " " + w/2 + " " + topLpx + " " + (w + 2) + " " + topLpx; var curveBot = " C " + w/2 + " " + botLpx + " " + w/2 + " " + botRpx + " -1 " + botRpx; @@ -321,48 +407,26 @@ "CodeMirror-merge-copy")); var editOriginals = dv.mv.options.allowEditingOriginals; copy.title = editOriginals ? "Push to left" : "Revert chunk"; - copy.chunk = {topEdit: topEdit, botEdit: botEdit, topOrig: topOrig, botOrig: botOrig}; + copy.chunk = chunk; copy.style.top = top + "px"; if (editOriginals) { - var topReverse = dv.orig.heightAtLine(topEdit, "local") - sTopEdit; + var topReverse = dv.orig.heightAtLine(chunk.editFrom, "local") - sTopEdit; var copyReverse = dv.copyButtons.appendChild(elt("div", dv.type == "right" ? "\u21dd" : "\u21dc", "CodeMirror-merge-copy-reverse")); copyReverse.title = "Push to right"; - copyReverse.chunk = {topEdit: topOrig, botEdit: botOrig, topOrig: topEdit, botOrig: botEdit}; + copyReverse.chunk = {editFrom: chunk.origFrom, editTo: chunk.origTo, + origFrom: chunk.editFrom, origTo: chunk.editTo}; copyReverse.style.top = topReverse + "px"; dv.type == "right" ? copyReverse.style.left = "2px" : copyReverse.style.right = "2px"; } } } - function alignChunks(dv, topOrig, botOrig, topEdit, botEdit, aboveViewport) { - var topOrigPx = dv.orig.heightAtLine(topOrig, "local"); - var botOrigPx = dv.orig.heightAtLine(botOrig, "local"); - var topEditPx = dv.edit.heightAtLine(topEdit, "local"); - var botEditPx = dv.edit.heightAtLine(botEdit, "local"); - var origH = botOrigPx -topOrigPx, editH = botEditPx - topEditPx; - var diff = editH - origH; - if (diff > 1) { - if (aboveViewport) aboveViewport.orig += diff; - else dv.aligners.push(padBelow(dv.orig, botOrig - 1, diff)); - } else if (diff < -1) { - if (aboveViewport) aboveViewport.edit -= diff; - else dv.aligners.push(padBelow(dv.edit, botEdit - 1, -diff)); - } - return 0; - } - - function padBelow(cm, line, size) { - var elt = document.createElement("div"); - elt.style.height = size + "px"; elt.style.minWidth = "1px"; - return cm.addLineWidget(line, elt, {height: size}); - } - function copyChunk(dv, to, from, chunk) { if (dv.diffOutOfDate) return; - to.replaceRange(from.getRange(Pos(chunk.topOrig, 0), Pos(chunk.botOrig, 0)), - Pos(chunk.topEdit, 0), Pos(chunk.botEdit, 0)); + to.replaceRange(from.getRange(Pos(chunk.origFrom, 0), Pos(chunk.origTo, 0)), + Pos(chunk.editFrom, 0), Pos(chunk.editTo, 0)); } // Merge view, containing 0, 1, or 2 diff views. @@ -372,16 +436,11 @@ this.options = options; var origLeft = options.origLeft, origRight = options.origRight == null ? options.orig : options.origRight; - if (origLeft && origRight) { - if (options.connect == "align") - throw new Error("connect: \"align\" is not supported for three-way merge views"); - if (options.collapseIdentical) - throw new Error("collapseIdentical option is not supported for three-way merge views"); - } var hasLeft = origLeft != null, hasRight = origRight != null; var panes = 1 + (hasLeft ? 1 : 0) + (hasRight ? 1 : 0); var wrap = [], left = this.left = null, right = this.right = null; + var self = this; if (hasLeft) { left = this.left = new DiffView(this, "left"); @@ -410,8 +469,17 @@ if (left) left.init(leftPane, origLeft, options); if (right) right.init(rightPane, origRight, options); - if (options.collapseIdentical) - collapseIdenticalStretches(left || right, options.collapseIdentical); + if (options.collapseIdentical) { + updating = true; + this.editor().operation(function() { + collapseIdenticalStretches(self, options.collapseIdentical); + }); + updating = false; + } + if (options.connect == "align") { + this.aligners = []; + alignChunks(this.left || this.right, true); + } var onResize = function() { if (left) makeConnections(left); @@ -463,10 +531,10 @@ if (this.left) this.left.setShowDifferences(val); }, rightChunks: function() { - return this.right && getChunks(this.right); + if (this.right) { ensureDiff(this.right); return this.right.chunks; } }, leftChunks: function() { - return this.left && getChunks(this.left); + if (this.left) { ensureDiff(this.left); return this.left.chunks; } } }; @@ -494,7 +562,8 @@ return diff; } - function iterateChunks(diff, f) { + function getChunks(diff) { + var chunks = []; var startEdit = 0, startOrig = 0; var edit = Pos(0, 0), orig = Pos(0, 0); for (var i = 0; i < diff.length; ++i) { @@ -506,7 +575,8 @@ var endOff = endOfLineClean(diff, i) ? 1 : 0; var cleanToEdit = edit.line + endOff, cleanToOrig = orig.line + endOff; if (cleanToEdit > cleanFromEdit) { - if (i) f(startOrig, cleanFromOrig, startEdit, cleanFromEdit); + if (i) chunks.push({origFrom: startOrig, origTo: cleanFromOrig, + editFrom: startEdit, editTo: cleanFromEdit}); startEdit = cleanToEdit; startOrig = cleanToOrig; } } else { @@ -514,17 +584,9 @@ } } if (startEdit <= edit.line || startOrig <= orig.line) - f(startOrig, orig.line + 1, startEdit, edit.line + 1); - } - - function getChunks(dv) { - ensureDiff(dv); - var collect = []; - iterateChunks(dv.diff, function(topOrig, botOrig, topEdit, botEdit) { - collect.push({origFrom: topOrig, origTo: botOrig, - editFrom: topEdit, editTo: botEdit}); - }); - return collect; + chunks.push({origFrom: startOrig, origTo: orig.line + 1, + editFrom: startEdit, editTo: edit.line + 1}); + return chunks; } function endOfLineClean(diff, i) { @@ -545,18 +607,19 @@ return last.charCodeAt(last.length - 1) == 10; } - function chunkBoundariesAround(diff, n, nInEdit) { + function chunkBoundariesAround(chunks, n, nInEdit) { var beforeE, afterE, beforeO, afterO; - iterateChunks(diff, function(fromOrig, toOrig, fromEdit, toEdit) { - var fromLocal = nInEdit ? fromEdit : fromOrig; - var toLocal = nInEdit ? toEdit : toOrig; + for (var i = 0; i < chunks.length; i++) { + var chunk = chunks[i]; + var fromLocal = nInEdit ? chunk.editFrom : chunk.origFrom; + var toLocal = nInEdit ? chunk.editTo : chunk.origTo; if (afterE == null) { - if (fromLocal > n) { afterE = fromEdit; afterO = fromOrig; } - else if (toLocal > n) { afterE = toEdit; afterO = toOrig; } + if (fromLocal > n) { afterE = chunk.editFrom; afterO = chunk.origFrom; } + else if (toLocal > n) { afterE = chunk.editTo; afterO = chunk.origTo; } } - if (toLocal <= n) { beforeE = toEdit; beforeO = toOrig; } - else if (fromLocal <= n) { beforeE = fromEdit; beforeO = fromOrig; } - }); + if (toLocal <= n) { beforeE = chunk.editTo; beforeO = chunk.origTo; } + else if (fromLocal <= n) { beforeE = chunk.editFrom; beforeO = chunk.origFrom; } + } return {edit: {before: beforeE, after: afterE}, orig: {before: beforeO, after: afterO}}; } @@ -579,25 +642,50 @@ return {mark: mark, clear: clear}; } - function collapseStretch(dv, origStart, editStart, size) { - var mOrig = collapseSingle(dv.orig, origStart, origStart + size); - var mEdit = collapseSingle(dv.edit, editStart, editStart + size); - mOrig.mark.on("clear", function() { mEdit.clear(); }); - mEdit.mark.on("clear", function() { mOrig.clear(); }); + function collapseStretch(size, editors) { + var marks = []; + function clear() { + for (var i = 0; i < marks.length; i++) marks[i].clear(); + } + for (var i = 0; i < editors.length; i++) { + var editor = editors[i]; + var mark = collapseSingle(editor.cm, editor.line, editor.line + size); + marks.push(mark); + mark.mark.on("clear", clear); + } + return marks[0].mark; + } + + function unclearNearChunks(dv, margin, off, clear) { + for (var i = 0; i < dv.chunks.length; i++) { + var chunk = dv.chunks[i]; + for (var l = chunk.editFrom - margin; l < chunk.editTo + margin; l++) { + var pos = l + off; + if (pos >= 0 && pos < clear.length) clear[pos] = false; + } + } } - function collapseIdenticalStretches(dv, margin) { + function collapseIdenticalStretches(mv, margin) { if (typeof margin != "number") margin = 2; - var lastOrig = dv.orig.firstLine(), lastEdit = dv.edit.firstLine(); - iterateChunks(dv.diff, function(topOrig, botOrig, _topEdit, botEdit) { - var identicalSize = topOrig - margin - lastOrig; - if (identicalSize > margin) - collapseStretch(dv, lastOrig, lastEdit, identicalSize); - lastOrig = botOrig + margin; lastEdit = botEdit + margin; - }); - var bottomSize = dv.orig.lastLine() + 1 - lastOrig; - if (bottomSize > margin) - collapseStretch(dv, lastOrig, lastEdit, bottomSize); + var clear = [], edit = mv.editor(), off = edit.firstLine(); + for (var l = off, e = edit.lastLine(); l <= e; l++) clear.push(true); + if (mv.left) unclearNearChunks(mv.left, margin, off, clear); + if (mv.right) unclearNearChunks(mv.right, margin, off, clear); + + for (var i = 0; i < clear.length; i++) { + if (clear[i]) { + var line = i + off; + for (var size = 1; i < clear.length - 1 && clear[i + 1]; i++, size++) {} + if (size > margin) { + var editors = [{line: line, cm: edit}]; + if (mv.left) editors.push({line: getMatchingOrigLine(line, mv.left.chunks), cm: mv.left.orig}); + if (mv.right) editors.push({line: getMatchingOrigLine(line, mv.right.chunks), cm: mv.right.orig}); + var mark = collapseStretch(size, editors); + if (mv.options.onCollapse) mv.options.onCollapse(mv, line, size, mark); + } + } + } } // General utilities diff --git a/media/editors/codemirror/addon/merge/merge.min.css b/media/editors/codemirror/addon/merge/merge.min.css new file mode 100644 index 0000000000000..78619f7d4548a --- /dev/null +++ b/media/editors/codemirror/addon/merge/merge.min.css @@ -0,0 +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-copybuttons-left,.CodeMirror-merge-copybuttons-right{position:absolute;left:0;top:0;right:0;bottom:0;line-height:1}.CodeMirror-merge-copy{position:absolute;cursor:pointer;color:#44c}.CodeMirror-merge-copy-reverse{position:absolute;cursor:pointer;color:#44c}.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy{left:2px}.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy{right:2px}.CodeMirror-merge-r-inserted,.CodeMirror-merge-l-inserted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);background-position:bottom left;background-repeat:repeat-x}.CodeMirror-merge-r-deleted,.CodeMirror-merge-l-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 new file mode 100644 index 0000000000000..f971d27c5543b --- /dev/null +++ b/media/editors/codemirror/addon/merge/merge.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("diff_match_patch")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],e):e(CodeMirror,diff_match_patch)}(function(e,t){"use strict";function r(e,t){this.mv=e,this.type=t,this.classes="left"==t?{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 i(t){t.diffOutOfDate&&(t.diff=y(t.orig.getValue(),t.edit.getValue()),t.chunks=w(t.diff),t.diffOutOfDate=!1,e.signal(t.edit,"updateDiff",t.diff))}function o(e){function t(t){U=!0,h=!1,"full"==t&&(e.svg&&N(e.svg),e.copyButtons&&N(e.copyButtons),s(e.edit,a.marked,e.classes),s(e.orig,c.marked,e.classes),a.from=a.to=c.from=c.to=0),i(e),e.showDifferences&&(f(e.edit,e.diff,a,DIFF_INSERT,e.classes),f(e.orig,e.diff,c,DIFF_DELETE,e.classes)),d(e),"align"==e.mv.options.connect&&m(e),U=!1}function r(t){U||(e.dealigned=!0,o(t))}function o(e){U||h||(clearTimeout(l),e===!0&&(h=!0),l=setTimeout(t,e===!0?20:250))}function n(t,i){e.diffOutOfDate||(e.diffOutOfDate=!0,a.from=a.to=c.from=c.to=0),r(i.text.length-1!=i.to.line-i.from.line)}var l,a={from:0,to:0,marked:[]},c={from:0,to:0,marked:[]},h=!1;return e.edit.on("change",n),e.orig.on("change",n),e.edit.on("markerAdded",r),e.edit.on("markerCleared",r),e.orig.on("markerAdded",r),e.orig.on("markerCleared",r),e.edit.on("viewportChange",function(){o(!1)}),e.orig.on("viewportChange",function(){o(!1)}),t(),t}function n(e){e.edit.on("scroll",function(){l(e,DIFF_INSERT)&&d(e)}),e.orig.on("scroll",function(){l(e,DIFF_DELETE)&&d(e)})}function l(e,t){if(e.diffOutOfDate)return!1;if(!e.lockScroll)return!0;var r,i,o=+new Date;if(t==DIFF_INSERT?(r=e.edit,i=e.orig):(r=e.orig,i=e.edit),r.state.scrollSetBy==e&&(r.state.scrollSetAt||0)+50>o)return!1;var n=r.getScrollInfo();if("align"==e.mv.options.connect)v=n.top;else{var l,c,s=.5*n.clientHeight,f=n.top+s,h=r.lineAtHeight(f,"local"),d=L(e.chunks,h,t==DIFF_INSERT),u=a(r,t==DIFF_INSERT?d.edit:d.orig),g=a(i,t==DIFF_INSERT?d.orig:d.edit),m=(f-u.top)/(u.bot-u.top),v=g.top-s+m*(g.bot-g.top);if(v>n.top&&(c=n.top/s)<1)v=v*c+n.top*(1-c);else if((l=n.height-n.clientHeight-n.top)l&&(c=l/s)<1&&(v=v*c+(p.height-p.clientHeight-l)*(1-c))}}return i.scrollTo(n.left,v),i.state.scrollSetAt=o,i.state.scrollSetBy=e,!0}function a(e,t){var r=t.after;return null==r&&(r=e.lastLine()+1),{top:e.heightAtLine(t.before||0,"local"),bot:e.heightAtLine(r,"local")}}function c(e,t,r){e.lockScroll=t,t&&0!=r&&l(e,DIFF_INSERT)&&d(e),e.lockButton.innerHTML=t?"⇛⇚":"⇛  ⇚"}function s(t,r,i){for(var o=0;o20||r.from-n.to>20?(s(e,r.marked,o),h(e,t,i,r.marked,n.from,n.to,o),r.from=n.from,r.to=n.to):(n.fromr.to&&(h(e,t,i,r.marked,r.to,n.to,o),r.to=n.to))})}function h(e,t,r,i,o,n,l){function a(t,r){for(var a=Math.max(o,t),c=Math.min(n,r),s=a;c>s;++s){var f=e.addLineClass(s,"background",l.chunk);s==t&&e.addLineClass(f,"background",l.start),s==r-1&&e.addLineClass(f,"background",l.end),i.push(f)}t==r&&a==r&&c==r&&i.push(a?e.addLineClass(a-1,"background",l.end):e.addLineClass(a,"background",l.start))}for(var c=H(0,0),s=H(o,0),f=e.clipPos(H(n-1)),h=r==DIFF_DELETE?l.del:l.insert,d=0,u=0;up&&(u&&a(d,p),d=k)}else if(m==r){var C=x(c,v,!0),T=R(s,c),F=B(f,C);V(T,F)||i.push(e.markText(T,F,{className:h})),c=C}}d<=c.line&&a(d,c.line+1)}function d(e){if(e.showDifferences){if(e.svg){N(e.svg);var t=e.gap.offsetWidth;_(e.svg,"width",t,"height",e.gap.offsetHeight)}e.copyButtons&&N(e.copyButtons);for(var r=e.edit.getViewport(),i=e.orig.getViewport(),o=e.edit.getScrollInfo().top,n=e.orig.getScrollInfo().top,l=0;l=r.from&&a.origFrom<=i.to&&a.origTo>=i.from&&k(e,a,n,o,t)}}}function u(e,t){for(var r=0,i=0,o=0;oe&&n.editFrom<=e)return null;if(n.editFrom>e)break;r=n.editTo,i=n.origTo}return i+(e-r)}function g(e,t){for(var r=[],i=0;io.editTo)break}n>-1&&r.splice(n-1,0,[u(o.editTo,e.chunks),o.editTo,o.origTo])}return r}function m(e,t){if(e.dealigned||t){if(!e.orig.curOp)return e.orig.operation(function(){m(e,t)});e.dealigned=!1;var r=e.mv.left==e?e.mv.right:e.mv.left;r&&(i(r),r.dealigned=!1);for(var o=g(e,r),n=e.mv.aligners,l=0;l1&&r.push(p(e[n],t[n],a))}}function p(e,t,r){var i=!0;t>e.lastLine()&&(t--,i=!1);var o=document.createElement("div");return o.className="CodeMirror-merge-spacer",o.style.height=r+"px",o.style.minWidth="1px",e.addLineWidget(t,o,{height:r,above:i})}function k(e,t,r,i,o){var n="left"==e.type,l=e.orig.heightAtLine(t.origFrom,"local")-r;if(e.svg){var a=l,c=e.edit.heightAtLine(t.editFrom,"local")-i;if(n){var s=a;a=c,c=s}var f=e.orig.heightAtLine(t.origTo,"local")-r,h=e.edit.heightAtLine(t.editTo,"local")-i;if(n){var s=f;f=h,h=s}var d=" C "+o/2+" "+c+" "+o/2+" "+a+" "+(o+2)+" "+a,u=" C "+o/2+" "+f+" "+o/2+" "+h+" -1 "+h;_(e.svg.appendChild(document.createElementNS(P,"path")),"d","M -1 "+c+d+" L "+(o+2)+" "+f+u+" z","class",e.classes.connect)}if(e.copyButtons){var g=e.copyButtons.appendChild(O("div","left"==e.type?"⇝":"⇜","CodeMirror-merge-copy")),m=e.mv.options.allowEditingOriginals;if(g.title=m?"Push to left":"Revert chunk",g.chunk=t,g.style.top=l+"px",m){var v=e.orig.heightAtLine(t.editFrom,"local")-i,p=e.copyButtons.appendChild(O("div","right"==e.type?"⇝":"⇜","CodeMirror-merge-copy-reverse"));p.title="Push to right",p.chunk={editFrom:t.origFrom,editTo:t.origTo,origFrom:t.editFrom,origTo:t.editTo},p.style.top=v+"px","right"==e.type?p.style.left="2px":p.style.right="2px"}}}function C(e,t,r,i){e.diffOutOfDate||t.replaceRange(r.getRange(H(i.origFrom,0),H(i.origTo,0)),H(i.editFrom,0),H(i.editTo,0))}function T(t){var r=t.lockButton=O("div",null,"CodeMirror-merge-scrolllock");r.title="Toggle locked scrolling";var i=O("div",[r],"CodeMirror-merge-scrolllock-wrap");e.on(r,"click",function(){c(t,!t.lockScroll)});var o=[i];if(t.mv.options.revertButtons!==!1&&(t.copyButtons=O("div",null,"CodeMirror-merge-copybuttons-"+t.type),e.on(t.copyButtons,"click",function(e){var r=e.target||e.srcElement;if(r.chunk)return"CodeMirror-merge-copy-reverse"==r.className?void C(t,t.orig,t.edit,r.chunk):void C(t,t.edit,t.orig,r.chunk)}),o.unshift(t.copyButtons)),"align"!=t.mv.options.connect){var n=document.createElementNS&&document.createElementNS(P,"svg");n&&!n.createSVGRect&&(n=null),t.svg=n,n&&o.push(n)}return t.gap=O("div",o,"CodeMirror-merge-gap")}function F(e){return"string"==typeof e?e:e.getValue()}function y(e,t){var r=z.diff_main(e,t);z.diff_cleanupSemantic(r);for(var i=0;if&&(l&&t.push({origFrom:i,origTo:h,editFrom:r,editTo:f}),r=u,i=g)}else x(c==DIFF_INSERT?o:n,a[1])}return(r<=o.line||i<=n.line)&&t.push({origFrom:i,origTo:n.line+1,editFrom:r,editTo:o.line+1}),t}function M(e,t){if(t==e.length-1)return!0;var r=e[t+1][1];return 1==r.length||10!=r.charCodeAt(0)?!1:t==e.length-2?!0:(r=e[t+2][1],r.length>1&&10==r.charCodeAt(0))}function D(e,t){if(0==t)return!0;var r=e[t-1][1];return 10!=r.charCodeAt(r.length-1)?!1:1==t?!0:(r=e[t-2][1],10==r.charCodeAt(r.length-1))}function L(e,t,r){for(var i,o,n,l,a=0;at?(o=c.editFrom,l=c.origFrom):f>t&&(o=c.editTo,l=c.origTo)),t>=f?(i=c.editTo,n=c.origTo):t>=s&&(i=c.editFrom,n=c.origFrom)}return{edit:{before:i,after:o},orig:{before:n,after:l}}}function I(e,t,r){function i(){n.clear(),e.removeLineClass(t,"wrap","CodeMirror-merge-collapsed-line")}e.addLineClass(t,"wrap","CodeMirror-merge-collapsed-line");var o=document.createElement("span");o.className="CodeMirror-merge-collapsed-widget",o.title="Identical text collapsed. Click to expand.";var n=e.markText(H(t,0),H(r-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:o,clearOnEnter:!0});return o.addEventListener("click",i),{mark:n,clear:i}}function b(e,t){function r(){for(var e=0;e=0&&a=n;n++)r.push(!0);e.left&&E(e.left,t,o,r),e.right&&E(e.right,t,o,r);for(var a=0;at){var f=[{line:c,cm:i}];e.left&&f.push({line:u(c,e.left.chunks),cm:e.left.orig}),e.right&&f.push({line:u(c,e.right.chunks),cm:e.right.orig});var h=b(s,f);e.options.onCollapse&&e.options.onCollapse(e,c,s,h)}}}function O(e,t,r,i){var o=document.createElement(e);if(r&&(o.className=r),i&&(o.style.cssText=i),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var n=0;n0;--t)e.removeChild(e.firstChild)}function _(e){for(var t=1;t0?e:t}function V(e,t){return e.line==t.line&&e.ch==t.ch}var H=e.Pos,P="http://www.w3.org/2000/svg";r.prototype={constructor:r,init:function(t,r,i){this.edit=this.mv.edit,this.orig=e(t,A({value:r,readOnly:!this.mv.options.allowEditingOriginals},A(i))),this.diff=y(F(r),F(i.value)),this.chunks=w(this.diff),this.diffOutOfDate=this.dealigned=!1,this.showDifferences=i.showDifferences!==!1,this.forceUpdate=o(this),c(this,!0,!1),n(this)},setShowDifferences:function(e){e=e!==!1,e!=this.showDifferences&&(this.showDifferences=e,this.forceUpdate("full"))}};var U=!1,W=e.MergeView=function(t,i){if(!(this instanceof W))return new W(t,i);this.options=i;var o=i.origLeft,n=null==i.origRight?i.orig:i.origRight,l=null!=o,a=null!=n,c=1+(l?1:0)+(a?1:0),s=[],f=this.left=null,h=this.right=null,u=this;if(l){f=this.left=new r(this,"left");var g=O("div",null,"CodeMirror-merge-pane");s.push(g),s.push(T(f))}var v=O("div",null,"CodeMirror-merge-pane");if(s.push(v),a){h=this.right=new r(this,"right"),s.push(T(h));var p=O("div",null,"CodeMirror-merge-pane");s.push(p)}(a?p:v).className+=" CodeMirror-merge-pane-rightmost",s.push(O("div",null,null,"height: 0; clear: both;"));var k=this.wrap=t.appendChild(O("div",s,"CodeMirror-merge CodeMirror-merge-"+c+"pane"));this.edit=e(v,A(i)),f&&f.init(g,o,i),h&&h.init(p,n,i),i.collapseIdentical&&(U=!0,this.editor().operation(function(){S(u,i.collapseIdentical)}),U=!1),"align"==i.connect&&(this.aligners=[],m(this.left||this.right,!0));var C=function(){f&&d(f),h&&d(h)};e.on(window,"resize",C);var F=setInterval(function(){for(var t=k.parentNode;t&&t!=document.body;t=t.parentNode);t||(clearInterval(F),e.off(window,"resize",C))},5e3)};W.prototype={constuctor:W,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(e){this.right&&this.right.setShowDifferences(e),this.left&&this.left.setShowDifferences(e)},rightChunks:function(){return this.right?(i(this.right),this.right.chunks):void 0},leftChunks:function(){return this.left?(i(this.left),this.left.chunks):void 0}};var z=new t}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/mode/loadmode.min.js b/media/editors/codemirror/addon/mode/loadmode.min.js new file mode 100644 index 0000000000000..6403f3b22bf14 --- /dev/null +++ b/media/editors/codemirror/addon/mode/loadmode.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],function(r){e(r,"amd")}):e(CodeMirror,"plain")}(function(e,r){function o(e,r){var o=r;return function(){0==--o&&e()}}function n(r,n){var t=e.modes[r].dependencies;if(!t)return n();for(var i=[],d=0;d-1&&(o.string=l.slice(0,a));var s=u.mode.token(o,c.inner);return a>-1&&(o.string=l),u.innerStyle&&(s=s?s+" "+u.innerStyle:u.innerStyle),s}for(var v=1/0,l=o.string,d=0;i>d;++d){var f=r[d],a=t(l,f.open,o.pos);if(a==o.pos)return o.match(f.open),c.innerActive=f,c.inner=e.startState(f.mode,n.indent?n.indent(c.outer,""):0),f.delimStyle;-1!=a&&v>a&&(v=a)}1/0!=v&&(o.string=l.slice(0,v));var A=n.token(o,c.outer);return 1/0!=v&&(o.string=l),A},indent:function(t,r){var i=t.innerActive?t.innerActive.mode:n;return i.indent?i.indent(t.innerActive?t.inner:t.outer,r):e.Pass},blankLine:function(t){var o=t.innerActive?t.innerActive.mode:n;if(o.blankLine&&o.blankLine(t.innerActive?t.inner:t.outer),t.innerActive)"\n"===t.innerActive.close&&(t.innerActive=t.inner=null);else for(var c=0;i>c;++c){var u=r[c];"\n"===u.open&&(t.innerActive=u,t.inner=e.startState(u.mode,o.indent?o.indent(t.outer,""):0))}},electricChars:n.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:n}}}}}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/mode/multiplex_test.min.js b/media/editors/codemirror/addon/mode/multiplex_test.min.js new file mode 100644 index 0000000000000..861e007fce52c --- /dev/null +++ b/media/editors/codemirror/addon/mode/multiplex_test.min.js @@ -0,0 +1 @@ +!function(){function e(e){test.mode(e,r,Array.prototype.slice.call(arguments,1),"multiplexing")}CodeMirror.defineMode("markdown_with_stex",function(){var e=CodeMirror.getMode({},"stex"),r=CodeMirror.getMode({},"markdown"),o={open:"$",close:"$",mode:e,delimStyle:"delim",innerStyle:"inner"};return CodeMirror.multiplexingMode(r,o)});var r=CodeMirror.getMode({},"markdown_with_stex");e("stexInsideMarkdown","[strong **Equation:**] [delim $][inner&tag \\pi][delim $]")}(); \ No newline at end of file diff --git a/media/editors/codemirror/addon/mode/overlay.min.js b/media/editors/codemirror/addon/mode/overlay.min.js new file mode 100644 index 0000000000000..b05485f3339dd --- /dev/null +++ b/media/editors/codemirror/addon/mode/overlay.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.overlayMode=function(o,r,a){return{startState:function(){return{base:e.startState(o),overlay:e.startState(r),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(a){return{base:e.copyState(o,a.base),overlay:e.copyState(r,a.overlay),basePos:a.basePos,baseCur:null,overlayPos:a.overlayPos,overlayCur:null}},token:function(e,n){return(e!=n.streamSeen||Math.min(n.basePos,n.overlayPos)2){a.pending=[];for(var f=2;f-1)return e.Pass;var i=a.indent.length-1,l=t[a.state];e:for(;;){for(var d=0;di?0:a.indent[i]}}e.defineSimpleMode=function(t,n){e.defineMode(t,function(t){return e.simpleMode(t,n)})},e.simpleMode=function(n,a){t(a,"start");var i={},l=a.meta||{},s=!1;for(var c in a)if(c!=l&&a.hasOwnProperty(c))for(var u=i[c]=[],f=a[c],p=0;p=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||null},next:function(){return this.posr},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var r=this.string.indexOf(t,this.pos);return r>-1?(this.pos=r,!0):void 0},backUp:function(t){this.pos-=t},column:function(){return this.start-this.lineStart},indentation:function(){return 0},match:function(t,r,e){if("string"!=typeof t){var n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&r!==!1&&(this.pos+=n[0].length),n)}var i=function(t){return e?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);return i(o)==i(t)?(r!==!1&&(this.pos+=t.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,r){this.lineStart+=t;try{return r()}finally{this.lineStart-=t}}},CodeMirror.StringStream=r,CodeMirror.startState=function(t,r,e){return t.startState?t.startState(r,e):!0};var e=CodeMirror.modes={},n=CodeMirror.mimeModes={};CodeMirror.defineMode=function(t,r){arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),e[t]=r},CodeMirror.defineMIME=function(t,r){n[t]=r},CodeMirror.resolveMode=function(t){return"string"==typeof t&&n.hasOwnProperty(t)?t=n[t]:t&&"string"==typeof t.name&&n.hasOwnProperty(t.name)&&(t=n[t.name]),"string"==typeof t?{name:t}:t||{name:"null"}},CodeMirror.getMode=function(t,r){r=CodeMirror.resolveMode(r);var n=e[r.name];if(!n)throw new Error("Unknown mode: "+r);return n(t,r)},CodeMirror.registerHelper=CodeMirror.registerGlobalHelper=Math.min,CodeMirror.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}}),CodeMirror.defineMIME("text/plain","null"),CodeMirror.runMode=function(r,e,n,i){var o=CodeMirror.getMode({indentUnit:2},e);if(1==n.nodeType){var s=i&&i.tabSize||4,a=n,h=0;a.innerHTML="",n=function(t,r){if("\n"==t)return a.appendChild(document.createElement("br")),void(h=0);for(var e="",n=0;;){var i=t.indexOf(" ",n);if(-1==i){e+=t.slice(n),h+=t.length-n;break}h+=i-n,e+=t.slice(n,i);var o=s-h%s;h+=o;for(var u=0;o>u;++u)e+=" ";n=i+1}if(r){var d=a.appendChild(document.createElement("span"));d.className="cm-"+r.replace(/ +/g," cm-"),d.appendChild(document.createTextNode(e))}else a.appendChild(document.createTextNode(e))}}for(var u=t(r),d=i&&i.state||CodeMirror.startState(o),c=0,l=u.length;l>c;++c){c&&n("\n");var p=new CodeMirror.StringStream(u[c]);for(!p.string&&o.blankLine&&o.blankLine(d);!p.eol();){var f=o.token(p,d);n(p.current(),f,c,p.start,d),p.start=p.pos}}}}(); \ No newline at end of file diff --git a/media/editors/codemirror/addon/runmode/runmode.min.js b/media/editors/codemirror/addon/runmode/runmode.min.js new file mode 100644 index 0000000000000..3cd02811e4108 --- /dev/null +++ b/media/editors/codemirror/addon/runmode/runmode.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.runMode=function(t,n,r,o){var a=e.getMode(e.defaults,n),d=/MSIE \d/.test(navigator.userAgent),i=d&&(null==document.documentMode||document.documentMode<9);if(1==r.nodeType){var c=o&&o.tabSize||e.defaults.tabSize,l=r,u=0;l.innerHTML="",r=function(e,t){if("\n"==e)return l.appendChild(document.createTextNode(i?"\r":e)),void(u=0);for(var n="",r=0;;){var o=e.indexOf(" ",r);if(-1==o){n+=e.slice(r),u+=e.length-r;break}u+=o-r,n+=e.slice(r,o);var a=c-u%c;u+=a;for(var d=0;a>d;++d)n+=" ";r=o+1}if(t){var f=l.appendChild(document.createElement("span"));f.className="cm-"+t.replace(/ +/g," cm-"),f.appendChild(document.createTextNode(n))}else l.appendChild(document.createTextNode(n))}}for(var f=e.splitLines(t),s=o&&o.state||e.startState(a),m=0,p=f.length;p>m;++m){m&&r("\n");var v=new e.StringStream(f[m]);for(!v.string&&a.blankLine&&a.blankLine(s);!v.eol();){var b=a.token(v,s);r(v.current(),b,m,v.start,s),v.start=v.pos}}}}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/runmode/runmode.node.min.js b/media/editors/codemirror/addon/runmode/runmode.node.min.js new file mode 100644 index 0000000000000..35e4eb95c6472 --- /dev/null +++ b/media/editors/codemirror/addon/runmode/runmode.node.min.js @@ -0,0 +1 @@ +function splitLines(t){return t.split(/\r?\n|\r/)}function StringStream(t){this.pos=this.start=0,this.string=t,this.lineStart=0}StringStream.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||null},next:function(){return this.pose},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var e=this.string.indexOf(t,this.pos);return e>-1?(this.pos=e,!0):void 0},backUp:function(t){this.pos-=t},column:function(){return this.start-this.lineStart},indentation:function(){return 0},match:function(t,e,r){if("string"!=typeof t){var n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&e!==!1&&(this.pos+=n[0].length),n)}var s=function(t){return r?t.toLowerCase():t},i=this.string.substr(this.pos,t.length);return s(i)==s(t)?(e!==!1&&(this.pos+=t.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}}},exports.StringStream=StringStream,exports.startState=function(t,e,r){return t.startState?t.startState(e,r):!0};var modes=exports.modes={},mimeModes=exports.mimeModes={};exports.defineMode=function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),modes[t]=e},exports.defineMIME=function(t,e){mimeModes[t]=e},exports.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}}),exports.defineMIME("text/plain","null"),exports.resolveMode=function(t){return"string"==typeof t&&mimeModes.hasOwnProperty(t)?t=mimeModes[t]:t&&"string"==typeof t.name&&mimeModes.hasOwnProperty(t.name)&&(t=mimeModes[t.name]),"string"==typeof t?{name:t}:t||{name:"null"}},exports.getMode=function(t,e){e=exports.resolveMode(e);var r=modes[e.name];if(!r)throw new Error("Unknown mode: "+e);return r(t,e)},exports.registerHelper=exports.registerGlobalHelper=Math.min,exports.runMode=function(t,e,r,n){for(var s=exports.getMode({indentUnit:2},e),i=splitLines(t),o=n&&n.state||exports.startState(s),a=0,h=i.length;h>a;++a){a&&r("\n");var p=new exports.StringStream(i[a]);for(!p.string&&s.blankLine&&s.blankLine(o);!p.eol();){var u=s.token(p,o);r(p.current(),u,a,p.start,o),p.start=p.pos}}},require.cache[require.resolve("../../lib/codemirror")]=require.cache[require.resolve("./runmode.node")]; \ No newline at end of file diff --git a/media/editors/codemirror/addon/scroll/annotatescrollbar.js b/media/editors/codemirror/addon/scroll/annotatescrollbar.js index 6dfff1a6a4cdd..54aeacf271884 100644 --- a/media/editors/codemirror/addon/scroll/annotatescrollbar.js +++ b/media/editors/codemirror/addon/scroll/annotatescrollbar.js @@ -11,27 +11,46 @@ })(function(CodeMirror) { "use strict"; - CodeMirror.defineExtension("annotateScrollbar", function(className) { - return new Annotation(this, className); + CodeMirror.defineExtension("annotateScrollbar", function(options) { + if (typeof options == "string") options = {className: options}; + return new Annotation(this, options); }); - function Annotation(cm, className) { + CodeMirror.defineOption("scrollButtonHeight", 0); + + function Annotation(cm, options) { this.cm = cm; - this.className = className; + this.options = options; + this.buttonHeight = options.scrollButtonHeight || cm.getOption("scrollButtonHeight"); this.annotations = []; + this.doRedraw = this.doUpdate = null; this.div = cm.getWrapperElement().appendChild(document.createElement("div")); this.div.style.cssText = "position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none"; this.computeScale(); + function scheduleRedraw(delay) { + clearTimeout(self.doRedraw); + self.doRedraw = setTimeout(function() { self.redraw(); }, delay); + } + var self = this; - cm.on("refresh", this.resizeHandler = function(){ - if (self.computeScale()) self.redraw(); + cm.on("refresh", this.resizeHandler = function() { + clearTimeout(self.doUpdate); + self.doUpdate = setTimeout(function() { + if (self.computeScale()) scheduleRedraw(20); + }, 100); }); + cm.on("markerAdded", this.resizeHandler); + cm.on("markerCleared", this.resizeHandler); + if (options.listenForChanges !== false) + cm.on("change", this.changeHandler = function() { + scheduleRedraw(250); + }); } Annotation.prototype.computeScale = function() { var cm = this.cm; - var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight) / + var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight - this.buttonHeight * 2) / cm.heightAtLine(cm.lastLine() + 1, "local"); if (hScale != this.hScale) { this.hScale = hScale; @@ -44,12 +63,12 @@ this.redraw(); }; - Annotation.prototype.redraw = function() { + Annotation.prototype.redraw = function(compute) { + if (compute !== false) this.computeScale(); var cm = this.cm, hScale = this.hScale; - if (!cm.display.barWidth) return; var frag = document.createDocumentFragment(), anns = this.annotations; - for (var i = 0, nextTop; i < anns.length; i++) { + if (cm.display.barWidth) for (var i = 0, nextTop; i < anns.length; i++) { var ann = anns[i]; var top = nextTop || cm.charCoords(ann.from, "local").top * hScale; var bottom = cm.charCoords(ann.to, "local").bottom * hScale; @@ -59,11 +78,13 @@ ann = anns[++i]; bottom = cm.charCoords(ann.to, "local").bottom * hScale; } + if (bottom == top) continue; var height = Math.max(bottom - top, 3); var elt = frag.appendChild(document.createElement("div")); - elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: " + top + "px; height: " + height + "px"; - elt.className = this.className; + elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: " + + (top + this.buttonHeight) + "px; height: " + height + "px"; + elt.className = this.options.className; } this.div.textContent = ""; this.div.appendChild(frag); @@ -71,6 +92,9 @@ Annotation.prototype.clear = function() { this.cm.off("refresh", this.resizeHandler); + this.cm.off("markerAdded", this.resizeHandler); + this.cm.off("markerCleared", this.resizeHandler); + if (this.changeHandler) this.cm.off("change", this.changeHandler); this.div.parentNode.removeChild(this.div); }; }); diff --git a/media/editors/codemirror/addon/scroll/annotatescrollbar.min.js b/media/editors/codemirror/addon/scroll/annotatescrollbar.min.js new file mode 100644 index 0000000000000..a4e96185a4f66 --- /dev/null +++ b/media/editors/codemirror/addon/scroll/annotatescrollbar.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){function i(t){clearTimeout(o.doRedraw),o.doRedraw=setTimeout(function(){o.redraw()},t)}this.cm=t,this.options=e,this.buttonHeight=e.scrollButtonHeight||t.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=t.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var o=this;t.on("refresh",this.resizeHandler=function(){clearTimeout(o.doUpdate),o.doUpdate=setTimeout(function(){o.computeScale()&&i(20)},100)}),t.on("markerAdded",this.resizeHandler),t.on("markerCleared",this.resizeHandler),e.listenForChanges!==!1&&t.on("change",this.changeHandler=function(){i(250)})}t.defineExtension("annotateScrollbar",function(t){return"string"==typeof t&&(t={className:t}),new e(this,t)}),t.defineOption("scrollButtonHeight",0),e.prototype.computeScale=function(){var t=this.cm,e=(t.getWrapperElement().clientHeight-t.display.barHeight-2*this.buttonHeight)/t.heightAtLine(t.lastLine()+1,"local");return e!=this.hScale?(this.hScale=e,!0):void 0},e.prototype.update=function(t){this.annotations=t,this.redraw()},e.prototype.redraw=function(t){t!==!1&&this.computeScale();var e=this.cm,i=this.hScale,o=document.createDocumentFragment(),n=this.annotations;if(e.display.barWidth)for(var r,a=0;ad+.9));)s=n[++a],d=e.charCoords(s.to,"local").bottom*i;if(d!=h){var c=Math.max(d-h,3),l=o.appendChild(document.createElement("div"));l.style.cssText="position: absolute; right: 0px; width: "+Math.max(e.display.barWidth-1,2)+"px; top: "+(h+this.buttonHeight)+"px; height: "+c+"px",l.className=this.options.className}}this.div.textContent="",this.div.appendChild(o)},e.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)}}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/scroll/scrollpastend.min.js b/media/editors/codemirror/addon/scroll/scrollpastend.min.js new file mode 100644 index 0000000000000..3b1a9760f86c1 --- /dev/null +++ b/media/editors/codemirror/addon/scroll/scrollpastend.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(n,i){e.changeEnd(i).line==n.lastLine()&&t(n)}function t(e){var n="";if(e.lineCount()>1){var t=e.display.scroller.clientHeight-30,i=e.getLineHandle(e.lastLine()).height;n=t-i+"px"}e.state.scrollPastEndPadding!=n&&(e.state.scrollPastEndPadding=n,e.display.lineSpace.parentNode.style.paddingBottom=n,e.setSize())}e.defineOption("scrollPastEnd",!1,function(i,o,d){d&&d!=e.Init&&(i.off("change",n),i.off("refresh",t),i.display.lineSpace.parentNode.style.paddingBottom="",i.state.scrollPastEndPadding=null),o&&(i.on("change",n),i.on("refresh",t),t(i))})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/scroll/simplescrollbars.min.css b/media/editors/codemirror/addon/scroll/simplescrollbars.min.css new file mode 100644 index 0000000000000..b4b5245bc9950 --- /dev/null +++ b/media/editors/codemirror/addon/scroll/simplescrollbars.min.css @@ -0,0 +1 @@ +.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler,.CodeMirror-overlayscroll .CodeMirror-gutter-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%} \ No newline at end of file diff --git a/media/editors/codemirror/addon/scroll/simplescrollbars.min.js b/media/editors/codemirror/addon/scroll/simplescrollbars.min.js new file mode 100644 index 0000000000000..06887f01dda38 --- /dev/null +++ b/media/editors/codemirror/addon/scroll/simplescrollbars.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,o,i){function n(e){var o=t.wheelEventPixels(e)["horizontal"==s.orientation?"x":"y"],i=s.pos;s.moveTo(s.pos+o),s.pos!=i&&t.e_preventDefault(e)}this.orientation=o,this.scroll=i,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=e+"-"+o,this.inner=this.node.appendChild(document.createElement("div"));var s=this;t.on(this.inner,"mousedown",function(e){function o(){t.off(document,"mousemove",i),t.off(document,"mouseup",o)}function i(t){return 1!=t.which?o():void s.moveTo(h+(t[n]-r)*(s.total/s.size))}if(1==e.which){t.e_preventDefault(e);var n="horizontal"==s.orientation?"pageX":"pageY",r=e[n],h=s.pos;t.on(document,"mousemove",i),t.on(document,"mouseup",o)}}),t.on(this.node,"click",function(e){t.e_preventDefault(e);var o,i=s.inner.getBoundingClientRect();o="horizontal"==s.orientation?e.clientXi.right?1:0:e.clientYi.bottom?1:0,s.moveTo(s.pos+o*s.screen)}),t.on(this.node,"mousewheel",n),t.on(this.node,"DOMMouseScroll",n)}function o(t,o,i){this.addClass=t,this.horiz=new e(t,"horizontal",i),o(this.horiz.node),this.vert=new e(t,"vertical",i),o(this.vert.node),this.width=null}e.prototype.moveTo=function(t,e){0>t&&(t=0),t>this.total-this.screen&&(t=this.total-this.screen),t!=this.pos&&(this.pos=t,this.inner.style["horizontal"==this.orientation?"left":"top"]=t*(this.size/this.total)+"px",e!==!1&&this.scroll(t,this.orientation))},e.prototype.update=function(t,e,o){this.screen=e,this.total=t,this.size=o,this.inner.style["horizontal"==this.orientation?"width":"height"]=this.screen*(this.size/this.total)+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},o.prototype.update=function(t){if(null==this.width){var e=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;e&&(this.width=parseInt(e.height))}var o=this.width||0,i=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1;return this.vert.node.style.display=n?"block":"none",this.horiz.node.style.display=i?"block":"none",n&&(this.vert.update(t.scrollHeight,t.clientHeight,t.viewHeight-(i?o:0)),this.vert.node.style.display="block",this.vert.node.style.bottom=i?o+"px":"0"),i&&(this.horiz.update(t.scrollWidth,t.clientWidth,t.viewWidth-(n?o:0)-t.barLeft),this.horiz.node.style.right=n?o+"px":"0",this.horiz.node.style.left=t.barLeft+"px"),{right:n?o:0,bottom:i?o:0}},o.prototype.setScrollTop=function(t){this.vert.moveTo(t,!1)},o.prototype.setScrollLeft=function(t){this.horiz.moveTo(t,!1)},o.prototype.clear=function(){var t=this.horiz.node.parentNode;t.removeChild(this.horiz.node),t.removeChild(this.vert.node)},t.scrollbarModel.simple=function(t,e){return new o("CodeMirror-simplescroll",t,e)},t.scrollbarModel.overlay=function(t,e){return new o("CodeMirror-overlayscroll",t,e)}}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/search/match-highlighter.min.js b/media/editors/codemirror/addon/search/match-highlighter.min.js new file mode 100644 index 0000000000000..d7cab7820ff18 --- /dev/null +++ b/media/editors/codemirror/addon/search/match-highlighter.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t){"object"==typeof t&&(this.minChars=t.minChars,this.style=t.style,this.showToken=t.showToken,this.delay=t.delay,this.wordsOnly=t.wordsOnly),null==this.style&&(this.style=s),null==this.minChars&&(this.minChars=h),null==this.delay&&(this.delay=a),null==this.wordsOnly&&(this.wordsOnly=c),this.overlay=this.timeout=null}function i(t){var e=t.state.matchHighlighter;clearTimeout(e.timeout),e.timeout=setTimeout(function(){r(t)},e.delay)}function r(t){t.operation(function(){var e=t.state.matchHighlighter;if(e.overlay&&(t.removeOverlay(e.overlay),e.overlay=null),!t.somethingSelected()&&e.showToken){for(var i=e.showToken===!0?/[\w$]/:e.showToken,r=t.getCursor(),o=t.getLine(r.line),h=r.ch,s=h;h&&i.test(o.charAt(h-1));)--h;for(;sh&&t.addOverlay(e.overlay=l(o.slice(h,s),i,e.style)))}var a=t.getCursor("from"),c=t.getCursor("to");if(a.line==c.line&&(!e.wordsOnly||n(t,a,c))){var u=t.getRange(a,c).replace(/^\s+|\s+$/g,"");u.length>=e.minChars&&t.addOverlay(e.overlay=l(u,!1,e.style))}})}function n(t,e,i){var r=t.getRange(e,i);if(null!==r.match(/^\w+$/)){if(e.ch>0){var n={line:e.line,ch:e.ch-1},o=t.getRange(n,e);if(null===o.match(/\W/))return!1}if(i.ch=t?t:Math.max(e,t+i)}t.defineExtension("showMatchesOnScrollbar",function(t,i,o){return"string"==typeof o&&(o={className:o}),o||(o={}),new e(this,t,i,o)});var o=1e3;e.prototype.findMatches=function(){if(this.gap){for(var e=0;e=this.gap.to)break;i.to.line>=this.gap.from&&this.matches.splice(e--,1)}for(var a=this.cm.getSearchCursor(this.query,t.Pos(this.gap.from,0),this.caseFold);a.findNext();){var i={from:a.from(),to:a.to()};if(i.from.line>=this.gap.to)break;if(this.matches.splice(e++,0,i),this.matches.length>o)break}this.gap=null}},e.prototype.onChange=function(e){var o=e.from.line,a=t.changeEnd(e).line,r=a-e.to.line;if(this.gap?(this.gap.from=Math.min(i(this.gap.from,o,r),e.from.line),this.gap.to=Math.max(i(this.gap.to,o,r),e.from.line)):this.gap={from:e.from.line,to:a+1},r)for(var n=0;n-1)return c=n(h,f,c),{from:i(o.line,c),to:i(o.line,c+s.length)}}else{var h=e.getLine(o.line).slice(o.ch),f=l(h),c=f.indexOf(t);if(c>-1)return c=n(h,f,c)+o.ch,{from:i(o.line,c),to:i(o.line,c+s.length)}}}:function(){};else{var f=s.split("\n");this.matches=function(t,n){var r=h.length-1;if(t){if(n.line-(h.length-1)=1;--c,--s)if(h[c]!=l(e.getLine(s)))return;var u=e.getLine(s),g=u.length-f[0].length;if(l(u.slice(g))!=h[0])return;return{from:i(s,g),to:o}}if(!(n.line+(h.length-1)>e.lastLine())){var u=e.getLine(n.line),g=u.length-f[0].length;if(l(u.slice(g))==h[0]){for(var a=i(n.line,g),s=n.line+1,c=1;r>c;++c,++s)if(h[c]!=l(e.getLine(s)))return;if(l(e.getLine(s).slice(0,f[r].length))==h[r])return{from:a,to:i(s,f[r].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var i=Math.min(n,e.length);;){var r=e.slice(0,i).toLowerCase().length;if(n>r)++i;else{if(!(r>n))return i;--i}}}var i=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=i(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=i(r.line-1,this.doc.getLine(r.line-1).length)}else{var o=this.doc.lineCount();if(r.line==o-1)return t(o);r=i(r.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t){if(this.atOccurrence){var n=e.splitLines(t);this.doc.replaceRange(n,this.pos.from,this.pos.to),this.pos.to=i(this.pos.from.line+n.length-1,n[n.length-1].length+(1==n.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,i){return new t(this.doc,e,n,i)}),e.defineDocExtension("getSearchCursor",function(e,n,i){return new t(this,e,n,i)}),e.defineExtension("selectMatches",function(t,n){for(var i,r=[],o=this.getSearchCursor(t,this.getCursor("from"),n);(i=o.findNext())&&!(e.cmpPos(o.to(),this.getCursor("to"))>0);)r.push({anchor:o.from(),head:o.to()});r.length&&this.setSelections(r,0)})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/selection/active-line.min.js b/media/editors/codemirror/addon/selection/active-line.min.js new file mode 100644 index 0000000000000..ed402346b1e65 --- /dev/null +++ b/media/editors/codemirror/addon/selection/active-line.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t=n.line,m=u?n:c(d,0),S=e.markText(s,m,{className:i});if(null==o?r.push(S):r.splice(o++,0,S),u)break;l=d}}function r(e){for(var t=e.state.markedSelection,n=0;n1)return i(e);var t=e.getCursor("start"),n=e.getCursor("end"),l=e.state.markedSelection;if(!l.length)return o(e,t,n);var c=l[0].find(),s=l[l.length-1].find();if(!c||!s||n.line-t.line=0||a(n,c.from)<=0)return i(e);for(;a(t,c.from)>0;)l.shift().clear(),c=l[0].find();for(a(t,c.from)<0&&(c.to.line-t.line0&&(n.line-s.from.line=t.mouseX&&l.top<=t.mouseY&&l.bottom>=t.mouseY&&(n=!0)}var s=n?t.value:"";e.display.lineDiv.style.cursor!=s&&(e.display.lineDiv.style.cursor=s)}}e.defineOption("selectionPointer",!1,function(i,l){var s=i.state.selectionPointer;s&&(e.off(i.getWrapperElement(),"mousemove",s.mousemove),e.off(i.getWrapperElement(),"mouseout",s.mouseout),e.off(window,"scroll",s.windowScroll),i.off("cursorActivity",n),i.off("scroll",n),i.state.selectionPointer=null,i.display.lineDiv.style.cursor=""),l&&(s=i.state.selectionPointer={value:"string"==typeof l?l:"default",mousemove:function(e){t(i,e)},mouseout:function(e){o(i,e)},windowScroll:function(){n(i)},rects:null,mouseX:null,mouseY:null,willUpdate:!1},e.on(i.getWrapperElement(),"mousemove",s.mousemove),e.on(i.getWrapperElement(),"mouseout",s.mouseout),e.on(window,"scroll",s.windowScroll),i.on("cursorActivity",n),i.on("scroll",n))})}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/tern/tern.js b/media/editors/codemirror/addon/tern/tern.js index 86729e2d3f7eb..b049549d35c6d 100644 --- a/media/editors/codemirror/addon/tern/tern.js +++ b/media/editors/codemirror/addon/tern/tern.js @@ -130,6 +130,13 @@ data = self.options.responseFilter(doc, query, request, error, data); c(error, data); }); + }, + + destroy: function () { + if (this.worker) { + this.worker.terminate(); + this.worker = null; + } } }; @@ -252,7 +259,9 @@ tip.appendChild(document.createTextNode(" — " + data.doc)); if (data.url) { tip.appendChild(document.createTextNode(" ")); - tip.appendChild(elt("a", null, "[docs]")).href = data.url; + var child = tip.appendChild(elt("a", null, "[docs]")); + child.href = data.url; + child.target = "_blank"; } } tempTooltip(cm, tip); @@ -582,15 +591,33 @@ // Tooltips function tempTooltip(cm, content) { + if (cm.state.ternTooltip) remove(cm.state.ternTooltip); var where = cm.cursorCoords(); - var tip = makeTooltip(where.right + 1, where.bottom, content); + var tip = cm.state.ternTooltip = makeTooltip(where.right + 1, where.bottom, content); + function maybeClear() { + old = true; + if (!mouseOnTip) clear(); + } function clear() { + cm.state.ternTooltip = null; if (!tip.parentNode) return; cm.off("cursorActivity", clear); + cm.off('blur', clear); + cm.off('scroll', clear); fadeOut(tip); } - setTimeout(clear, 1700); + var mouseOnTip = false, old = false; + CodeMirror.on(tip, "mousemove", function() { mouseOnTip = true; }); + CodeMirror.on(tip, "mouseout", function(e) { + if (!CodeMirror.contains(tip, e.relatedTarget || e.toElement)) { + if (old) clear(); + else mouseOnTip = false; + } + }); + setTimeout(maybeClear, 1700); cm.on("cursorActivity", clear); + cm.on('blur', clear); + cm.on('scroll', clear); } function makeTooltip(x, y, content) { @@ -631,7 +658,7 @@ // Worker wrapper function WorkerServer(ts) { - var worker = new Worker(ts.options.workerScript); + var worker = ts.worker = new Worker(ts.options.workerScript); worker.postMessage({type: "init", defs: ts.options.defs, plugins: ts.options.plugins, diff --git a/media/editors/codemirror/addon/tern/tern.min.css b/media/editors/codemirror/addon/tern/tern.min.css new file mode 100644 index 0000000000000..68de4f51cbbbd --- /dev/null +++ b/media/editors/codemirror/addon/tern/tern.min.css @@ -0,0 +1 @@ +.CodeMirror-Tern-completion{padding-left:22px;position:relative}.CodeMirror-Tern-completion:before{position:absolute;left:2px;bottom:2px;border-radius:50%;font-size:12px;font-weight:bold;height:15px;width:15px;line-height:16px;text-align:center;color:white;-moz-box-sizing:border-box;box-sizing:border-box}.CodeMirror-Tern-completion-unknown:before{content:"?";background:#4bb}.CodeMirror-Tern-completion-object:before{content:"O";background:#77c}.CodeMirror-Tern-completion-fn:before{content:"F";background:#7c7}.CodeMirror-Tern-completion-array:before{content:"A";background:#c66}.CodeMirror-Tern-completion-number:before{content:"1";background:#999}.CodeMirror-Tern-completion-string:before{content:"S";background:#999}.CodeMirror-Tern-completion-bool:before{content:"B";background:#999}.CodeMirror-Tern-completion-guess{color:#999}.CodeMirror-Tern-tooltip{border:1px solid silver;border-radius:3px;color:#444;padding:2px 5px;font-size:90%;font-family:monospace;background-color:white;white-space:pre-wrap;max-width:40em;position:absolute;z-index:10;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);transition:opacity 1s;-moz-transition:opacity 1s;-webkit-transition:opacity 1s;-o-transition:opacity 1s;-ms-transition:opacity 1s}.CodeMirror-Tern-hint-doc{max-width:25em;margin-top:-3px}.CodeMirror-Tern-fname{color:black}.CodeMirror-Tern-farg{color:#70a}.CodeMirror-Tern-farg-current{text-decoration:underline}.CodeMirror-Tern-type{color:#07c}.CodeMirror-Tern-fhint-guess{opacity:.7} \ No newline at end of file diff --git a/media/editors/codemirror/addon/tern/tern.min.js b/media/editors/codemirror/addon/tern/tern.min.js new file mode 100644 index 0000000000000..335c4060d63cd --- /dev/null +++ b/media/editors/codemirror/addon/tern/tern.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){var o=e.docs[t];o?n(F(e,o)):e.options.getFile?e.options.getFile(t,n):n(null)}function n(e,t,n){for(var o in e.docs){var r=e.docs[o];if(r.doc==t)return r}if(!n)for(var i=0;;++i)if(o="[doc"+(i||"")+"]",!e.docs[o]){n=o;break}return e.addDoc(n,t)}function o(t,o){return"string"==typeof o?t.docs[o]:(o instanceof e&&(o=o.getDoc()),o instanceof e.Doc?n(t,o):void 0)}function r(e,t,o){var r=n(e,t),s=e.cachedArgHints;s&&s.doc==t&&R(s.start,o.to)<=0&&(e.cachedArgHints=null);var a=r.changed;null==a&&(r.changed=a={from:o.from.line,to:o.from.line});var c=o.from.line+(o.text.length-1);o.from.line=a.to&&(a.to=c+1),a.from>o.from.line&&(a.from=o.from.line),t.lineCount()>L&&o.to-a.from>100&&setTimeout(function(){r.changed&&r.changed.to-r.changed.from>100&&i(e,r)},200)}function i(e,t){e.server.request({files:[{type:"full",name:t.name,text:F(e,t)}]},function(e){e?window.console.error(e):t.changed=null})}function s(t,n,o){t.request(n,{type:"completions",types:!0,docs:!0,urls:!0},function(r,i){if(r)return H(t,n,r);var s=[],c="",l=i.start,u=i.end;'["'==n.getRange(M(l.line,l.ch-2),l)&&'"]'!=n.getRange(u,M(u.line,u.ch+2))&&(c='"]');for(var f=0;f=d;--l){for(var h=n.getLine(l),g=0,m=0;;){var v=h.indexOf(" ",m);if(-1==v)break;g+=c-(v+g)%c-1,m=v+1}if(s=i.column-g,"("==h.charAt(s)){p=!0;break}}if(p){var y=M(l,s),C=t.cachedArgHints;return C&&C.doc==n.getDoc()&&0==R(y,C.start)?u(t,n,a):void t.request(n,{type:"type",preferFunction:!0,end:y},function(e,o){!e&&o.type&&/^fn\(/.test(o.type)&&(t.cachedArgHints={start:m,type:f(o.type),name:o.exprName||o.name||"fn",guess:o.guess,doc:n.getDoc()},u(t,n,a))})}}}}}function u(e,t,n){S(e);for(var o=e.cachedArgHints,r=o.type,i=w("span",o.guess?j+"fhint-guess":null,w("span",j+"fname",o.name),"("),s=0;s ":")")),r.rettype&&i.appendChild(w("span",j+"type",r.rettype));var c=t.cursorCoords(null,"page");e.activeArgHints=A(c.right+1,c.bottom,i)}function f(e){function t(t){for(var n=0,r=o;;){var i=e.charAt(o);if(t.test(i)&&!n)return e.slice(r,o);/[{\[\(]/.test(i)?++n:/[}\]\)]/.test(i)&&--n,++o}}var n=[],o=3;if(")"!=e.charAt(o))for(;;){var r=e.slice(o).match(/^([^, \(\[\{]+): /);if(r&&(o+=r[0].length,r=r[1]),n.push({name:r,type:t(/[\),]/)}),")"==e.charAt(o))break;o+=2}var i=e.slice(o).match(/^\) -> (.*)$/);return{args:n,rettype:i&&i[1]}}function d(e,t){function o(o){var r={type:"definition",variable:o||null},i=n(e,t.getDoc());e.server.request(x(e,i,r),function(n,o){if(n)return H(e,t,n);if(!o.file&&o.url)return void window.open(o.url);if(o.file){var r,s=e.docs[o.file];if(s&&(r=g(s.doc,o)))return e.jumpStack.push({file:i.name,start:t.getCursor("from"),end:t.getCursor("to")}),void h(e,i,s,r.start,r.end)}H(e,t,"Could not find a definition.")})}m(t)?o():T(t,"Jump to variable",function(e){e&&o(e)})}function p(e,t){var o=e.jumpStack.pop(),r=o&&e.docs[o.file];r&&h(e,n(e,t.getDoc()),r,o.start,o.end)}function h(e,t,n,o,r){n.doc.setSelection(o,r),t!=n&&e.options.switchToDoc&&(S(e),e.options.switchToDoc(n.name,n.doc))}function g(e,t){for(var n=t.context.slice(0,t.contextOffset).split("\n"),o=t.start.line-(n.length-1),r=M(o,(1==n.length?t.start.ch:e.getLine(o).length)-n[0].length),i=e.getLine(o).slice(r.ch),s=o+1;sf&&(a=u,l=f)}if(!a)return null;if(1==n.length?a.ch+=n[0].length:a=M(a.line+(n.length-1),n[n.length-1].length),t.start.line==t.end.line)var d=M(a.line,a.ch+(t.end.ch-t.start.ch));else var d=M(a.line+(t.end.line-t.start.line),t.end.ch);return{start:a,end:d}}function m(e){var t=e.getCursor("end"),n=e.getTokenAt(t);return n.start=0&&R(s,c.end)<=0&&(s=i.length-1))}t.setSelections(i,s)})}function C(e,t){for(var n=Object.create(null),o=0;oL&&s!==!1&&t.changed.to-t.changed.from<100&&t.changed.from<=a.line&&t.changed.to>n.end.line){r.push(b(t,a,n.end)),n.file="#0";var i=r[0].offsetLines;null!=n.start&&(n.start=M(n.start.line- -i,n.start.ch)),n.end=M(n.end.line-i,n.end.ch)}else r.push({type:"full",name:t.name,text:F(e,t)}),n.file=t.name,t.changed=null;else n.file=t.name;for(var c in e.docs){var l=e.docs[c];l.changed&&l!=t&&(r.push({type:"full",name:l.name,text:F(e,l)}),l.changed=null)}return{query:n,files:r}}function b(t,n,o){for(var r,i=t.doc,s=null,a=null,c=4,l=n.line-1,u=Math.max(0,l-50);l>=u;--l){var f=i.getLine(l),d=f.search(/\bfunction\b/);if(!(0>d)){var p=e.countColumn(f,null,c);null!=s&&p>=s||(s=p,a=l)}}null==a&&(a=u);var h=Math.min(i.lastLine(),o.line+20);if(null==s||s==e.countColumn(i.getLine(n.line),null,c))r=h;else for(r=o.line+1;h>r;++r){var p=e.countColumn(i.getLine(r),null,c);if(s>=p)break}var g=M(a,0);return{type:"part",name:t.name,offsetLines:g.line,text:i.getRange(g,M(r,0))}}function w(e,t){var n=document.createElement(e);t&&(n.className=t);for(var o=2;o",n):n(prompt(t,""))}function k(t,n){function o(){c=!0,a||r()}function r(){t.state.ternTooltip=null,s.parentNode&&(t.off("cursorActivity",r),t.off("blur",r),t.off("scroll",r),N(s))}t.state.ternTooltip&&D(t.state.ternTooltip);var i=t.cursorCoords(),s=t.state.ternTooltip=A(i.right+1,i.bottom,n),a=!1,c=!1;e.on(s,"mousemove",function(){a=!0}),e.on(s,"mouseout",function(t){e.contains(s,t.relatedTarget||t.toElement)||(c?r():a=!1)}),setTimeout(o,1700),t.on("cursorActivity",r),t.on("blur",r),t.on("scroll",r)}function A(e,t,n){var o=w("div",j+"tooltip",n);return o.style.left=e+"px",o.style.top=t+"px",document.body.appendChild(o),o}function D(e){var t=e&&e.parentNode;t&&t.removeChild(e)}function N(e){e.style.opacity="0",setTimeout(function(){D(e)},1100)}function H(e,t,n){e.options.showError?e.options.showError(t,n):k(t,String(n))}function S(e){e.activeArgHints&&(D(e.activeArgHints),e.activeArgHints=null)}function F(e,t){var n=t.doc.getValue();return e.options.fileFilter&&(n=e.options.fileFilter(n,t.name,t.doc)),n}function q(e){function n(e,t){t&&(e.id=++r,i[r]=t),o.postMessage(e)}var o=e.worker=new Worker(e.options.workerScript);o.postMessage({type:"init",defs:e.options.defs,plugins:e.options.plugins,scripts:e.options.workerDeps});var r=0,i={};o.onmessage=function(o){var r=o.data;"getFile"==r.type?t(e,r.name,function(e,t){n({type:"getFile",err:String(e),text:t,id:r.id})}):"debug"==r.type?window.console.log(r.message):r.id&&i[r.id]&&(i[r.id](r.err,r.body),delete i[r.id])},o.onerror=function(e){for(var t in i)i[t](e);i={}},this.addFile=function(e,t){n({type:"add",name:e,text:t})},this.delFile=function(e){n({type:"del",name:e})},this.request=function(e,t){n({type:"req",body:e},t)}}e.TernServer=function(e){var n=this;this.options=e||{};var o=this.options.plugins||(this.options.plugins={});o.doc_comment||(o.doc_comment=!0),this.server=this.options.useWorker?new q(this):new tern.Server({getFile:function(e,o){return t(n,e,o)},async:!0,defs:this.options.defs||[],plugins:o}),this.docs=Object.create(null),this.trackChange=function(e,t){r(n,e,t)},this.cachedArgHints=null,this.activeArgHints=null,this.jumpStack=[],this.getHint=function(e,t){return s(n,e,t)},this.getHint.async=!0},e.TernServer.prototype={addDoc:function(t,n){var o={doc:n,name:t,changed:null};return this.server.addFile(t,F(this,o)),e.on(n,"change",this.trackChange),this.docs[t]=o},delDoc:function(t){var n=o(this,t);n&&(e.off(n.doc,"change",this.trackChange),delete this.docs[n.name],this.server.delFile(n.name))},hideDoc:function(e){S(this);var t=o(this,e);t&&t.changed&&i(this,t)},complete:function(e){e.showHint({hint:this.getHint})},showType:function(e,t,n){c(this,e,t,"type",n)},showDocs:function(e,t,n){c(this,e,t,"documentation",n)},updateArgHints:function(e){l(this,e)},jumpToDef:function(e){d(this,e)},jumpBack:function(e){p(this,e)},rename:function(e){v(this,e)},selectName:function(e){y(this,e)},request:function(e,t,o,r){var i=this,s=n(this,e.getDoc()),a=x(this,s,t,r);this.server.request(a,function(e,n){!e&&i.options.responseFilter&&(n=i.options.responseFilter(s,t,a,e,n)),o(e,n)})},destroy:function(){this.worker&&(this.worker.terminate(),this.worker=null)}};var M=e.Pos,j="CodeMirror-Tern-",L=250,O=0,R=e.cmpPos}); \ No newline at end of file diff --git a/media/editors/codemirror/addon/tern/worker.min.js b/media/editors/codemirror/addon/tern/worker.min.js new file mode 100644 index 0000000000000..9c6543cd3f8a5 --- /dev/null +++ b/media/editors/codemirror/addon/tern/worker.min.js @@ -0,0 +1 @@ +function getFile(e,r){postMessage({type:"getFile",name:e,id:++nextId}),pending[nextId]=r}function startServer(e,r,t){t&&importScripts.apply(null,t),server=new tern.Server({getFile:getFile,async:!0,defs:e,plugins:r})}var server;this.onmessage=function(e){var r=e.data;switch(r.type){case"init":return startServer(r.defs,r.plugins,r.scripts);case"add":return server.addFile(r.name,r.text);case"del":return server.delFile(r.name);case"req":return server.request(r.body,function(e,t){postMessage({id:r.id,body:t,err:e&&String(e)})});case"getFile":var t=pending[r.id];return delete pending[r.id],t(r.err,r.text);default:throw new Error("Unknown message type: "+r.type)}};var nextId=0,pending={},console={log:function(e){postMessage({type:"debug",message:e})}}; \ No newline at end of file diff --git a/media/editors/codemirror/addon/wrap/hardwrap.min.js b/media/editors/codemirror/addon/wrap/hardwrap.min.js new file mode 100644 index 0000000000000..97d8e3932c4e4 --- /dev/null +++ b/media/editors/codemirror/addon/wrap/hardwrap.min.js @@ -0,0 +1 @@ +!function(r){"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)}(function(r){"use strict";function t(r,t,e){for(var n=e.paragraphStart||r.getHelper(t,"paragraphStart"),o=t.line,a=r.firstLine();o>a;--o){var i=r.getLine(o);if(n&&n.test(i))break;if(!/\S/.test(i)){++o;break}}for(var f=e.paragraphEnd||r.getHelper(t,"paragraphEnd"),l=t.line+1,s=r.lastLine();s>=l;++l){var i=r.getLine(l);if(f&&f.test(i)){++l;break}if(!/\S/.test(i))break}return{from:o,to:l}}function e(r,t,e,n){for(var o=t;o>0&&!e.test(r.slice(o-1,o+1));--o);0==o&&(o=t);var a=o;if(n)for(;" "==r.charAt(a-1);)--a;return{from:a,to:o}}function n(t,n,a,i){n=t.clipPos(n),a=t.clipPos(a);var f=i.column||80,l=i.wrapOn||/\s\S|-[^\.\d]/,s=i.killTrailingSpace!==!1,h=[],c="",g=n.line,p=t.getRange(n,a,!1);if(!p.length)return null;for(var u=p[0].match(/^[ \t]*/)[0],m=0;mf&&u==x&&e(c,f,l,s);S&&S.from==d&&S.to==d+b?(c=u+v,++g):h.push({text:[b?" ":""],from:o(g,d),to:o(g+1,x.length)})}for(;c.length>f;){var E=e(c,f,l,s);h.push({text:["",u],from:o(g,E.from),to:o(g,E.to)}),c=u+c.slice(E.to),++g}}return h.length&&t.operation(function(){for(var r=0;r=0;i--){var f,l=e[i];if(l.empty()){var s=t(r,l.head,{});f={from:o(s.from,0),to:o(s.to-1)}}else f={from:l.from(),to:l.to()};f.to.line>=a||(a=f.from.line,n(r,f.from,f.to,{}))}})},r.defineExtension("wrapRange",function(r,t,e){return n(this,r,t,e||{})}),r.defineExtension("wrapParagraphsInRange",function(r,e,a){a=a||{};for(var i=this,f=[],l=r.line;l<=e.line;){var s=t(i,o(l,0),a);f.push(s),l=s.to}var h=!1;return f.length&&i.operation(function(){for(var r=f.length-1;r>=0;--r)h=h||n(i,o(f[r].from,0),o(f[r].to-1),a)}),h})}); \ No newline at end of file diff --git a/media/editors/codemirror/keymap/emacs.min.js b/media/editors/codemirror/keymap/emacs.min.js new file mode 100644 index 0000000000000..f1d293ad39ebf --- /dev/null +++ b/media/editors/codemirror/keymap/emacs.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){return t.line==e.line&&t.ch==e.ch}function n(t){M.push(t),M.length>50&&M.shift()}function r(t){return M.length?void(M[M.length-1]+=t):n(t)}function o(t){return M[M.length-(t?Math.min(t,1):1)]||""}function i(){return M.length>1&&M.pop(),o()}function l(t,o,i,l,c){null==c&&(c=t.getRange(o,i)),l&&B&&B.cm==t&&e(o,B.pos)&&t.isClean(B.gen)?r(c):n(c),t.replaceRange("",o,i,"+delete"),B=l?{cm:t,pos:o,gen:t.changeGeneration()}:null}function c(t,e,n){return t.findPosH(e,n,"char",!0)}function a(t,e,n){return t.findPosH(e,n,"word",!0)}function u(t,e,n){return t.findPosV(e,n,"line",t.doc.sel.goalColumn)}function f(t,e,n){return t.findPosV(e,n,"page",t.doc.sel.goalColumn)}function s(t,e,n){for(var r=e.line,o=t.getLine(r),i=/\S/.test(0>n?o.slice(0,e.ch):o.slice(e.ch)),l=t.firstLine(),c=t.lastLine();;){if(r+=n,l>r||r>c)return t.clipPos(H(r-n,0>n?0:null));o=t.getLine(r);var a=/\S/.test(o);if(a)i=!0;else if(i)return H(r,0)}}function C(t,e,n){for(var r=e.line,o=e.ch,i=t.getLine(e.line),l=!1;;){var c=i.charAt(o+(0>n?-1:0));if(c){if(l&&/[!?.]/.test(c))return H(r,o+(n>0?1:0));l||(l=/\w/.test(c)),o+=n}else{if(r==(0>n?t.firstLine():t.lastLine()))return H(r,o);if(i=t.getLine(r+n),!/\S/.test(i))return H(r,o);r+=n,o=0>n?i.length:0}}}function g(t,n,r){var o;if(t.findMatchingBracket&&(o=t.findMatchingBracket(n,!0))&&o.match&&(o.forward?1:-1)==r)return r>0?H(o.to.line,o.to.ch+1):o.to;for(var i=!0;;i=!1){var l=t.getTokenAt(n),c=H(n.line,0>r?l.start:l.end);if(!(i&&r>0&&l.end==n.ch)&&/\w/.test(l.string))return c;var a=t.findPosH(c,r,"char");if(e(c,a))return n;n=a}}function d(t,e){var n=t.state.emacsPrefix;return n?(x(t),"-"==n?-1:Number(n)):e?null:1}function p(t){var e="string"==typeof t?function(e){e.execCommand(t)}:t;return function(t){var n=d(t);e(t);for(var r=1;n>r;++r)e(t)}}function h(t,n,r,o){var i=d(t);0>i&&(o=-o,i=-i);for(var l=0;i>l;++l){var c=r(t,n,o);if(e(c,n))break;n=c}return n}function v(t,e){var n=function(n){n.extendSelection(h(n,n.getCursor(),t,e))};return n.motion=!0,n}function A(t,e,n){for(var r,o=t.listSelections(),i=o.length;i--;)r=o[i].head,l(t,r,h(t,r,e,n),!0)}function m(t){if(t.somethingSelected()){for(var e,n=t.listSelections(),r=n.length;r--;)e=n[r],l(t,e.anchor,e.head);return!0}}function S(t,e){return t.state.emacsPrefix?void("-"!=e&&(t.state.emacsPrefix+=e)):(t.state.emacsPrefix=e,t.on("keyHandled",P),void t.on("inputRead",L))}function P(t,e){t.state.emacsPrefixMap||G.hasOwnProperty(e)||x(t)}function x(t){t.state.emacsPrefix=null,t.off("keyHandled",P),t.off("inputRead",L)}function L(t,e){var n=d(t);if(n>1&&"+input"==e.origin){for(var r=e.text.join("\n"),o="",i=1;n>i;++i)o+=r;t.replaceSelection(o)}}function R(t){t.state.emacsPrefixMap=!0,t.addKeyMap(T),t.on("keyHandled",y),t.on("inputRead",y)}function y(t,e){("string"!=typeof e||!/^\d$/.test(e)&&"Ctrl-U"!=e)&&(t.removeKeyMap(T),t.state.emacsPrefixMap=!1,t.off("keyHandled",y),t.off("inputRead",y))}function w(t){t.setCursor(t.getCursor()),t.setExtending(!t.getExtending()),t.on("change",function(){t.setExtending(!1)})}function b(t){t.setExtending(!1),t.setCursor(t.getCursor())}function k(t,e,n){t.openDialog?t.openDialog(e+': ',n,{bottom:!0}):n(prompt(e,""))}function U(t,e){var n=t.getCursor(),r=t.findPosH(n,1,"word");t.replaceRange(e(t.getRange(n,r)),n,r),t.setCursor(r)}function X(t){for(var e=t.getCursor(),n=e.line,r=e.ch,o=[];n>=t.firstLine();){for(var i=t.getLine(n),l=null==r?i.length:r;l>0;){var r=i.charAt(--l);if(")"==r)o.push("(");else if("]"==r)o.push("[");else if("}"==r)o.push("{");else if(/[\(\{\[]/.test(r)&&(!o.length||o.pop()!=r))return t.extendSelection(H(n,l))}--n,r=null}}function D(t){t.execCommand("clearSearch"),b(t)}function E(t){T[t]=function(e){S(e,t)},K["Ctrl-"+t]=function(e){S(e,t)},G["Ctrl-"+t]=!0}for(var H=t.Pos,M=[],B=null,G={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0},K=t.keyMap.emacs=t.normalizeKeyMap({"Ctrl-W":function(t){l(t,t.getCursor("start"),t.getCursor("end"))},"Ctrl-K":p(function(t){var e=t.getCursor(),n=t.clipPos(H(e.line)),r=t.getRange(e,n);/\S/.test(r)||(r+="\n",n=H(e.line+1,0)),l(t,e,n,!0,r)}),"Alt-W":function(t){n(t.getSelection()),b(t)},"Ctrl-Y":function(t){var e=t.getCursor();t.replaceRange(o(d(t)),e,e,"paste"),t.setSelection(e,t.getCursor())},"Alt-Y":function(t){t.replaceSelection(i(),"around","paste")},"Ctrl-Space":w,"Ctrl-Shift-2":w,"Ctrl-F":v(c,1),"Ctrl-B":v(c,-1),Right:v(c,1),Left:v(c,-1),"Ctrl-D":function(t){A(t,c,1)},Delete:function(t){m(t)||A(t,c,1)},"Ctrl-H":function(t){A(t,c,-1)},Backspace:function(t){m(t)||A(t,c,-1)},"Alt-F":v(a,1),"Alt-B":v(a,-1),"Alt-D":function(t){A(t,a,1)},"Alt-Backspace":function(t){A(t,a,-1)},"Ctrl-N":v(u,1),"Ctrl-P":v(u,-1),Down:v(u,1),Up:v(u,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":v(f,-1),"Ctrl-V":v(f,1),PageUp:v(f,-1),PageDown:v(f,1),"Ctrl-Up":v(s,-1),"Ctrl-Down":v(s,1),"Alt-A":v(C,-1),"Alt-E":v(C,1),"Alt-K":function(t){A(t,C,1)},"Ctrl-Alt-K":function(t){A(t,g,1)},"Ctrl-Alt-Backspace":function(t){A(t,g,-1)},"Ctrl-Alt-F":v(g,1),"Ctrl-Alt-B":v(g,-1),"Shift-Ctrl-Alt-2":function(t){var e=t.getCursor();t.setSelection(h(t,e,g,1),e)},"Ctrl-Alt-T":function(t){var e=g(t,t.getCursor(),-1),n=g(t,e,1),r=g(t,n,1),o=g(t,r,-1);t.replaceRange(t.getRange(o,r)+t.getRange(n,o)+t.getRange(e,n),e,r)},"Ctrl-Alt-U":p(X),"Alt-Space":function(t){for(var e=t.getCursor(),n=e.ch,r=e.ch,o=t.getLine(e.line);n&&/\s/.test(o.charAt(n-1));)--n;for(;r0?t.setCursor(e-1):void k(t,"Goto line",function(e){var n;e&&!isNaN(n=Number(e))&&n==n|0&&n>0&&t.setCursor(n-1)})},"Ctrl-X Tab":function(t){t.indentSelection(d(t,!0)||t.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(t){t.setSelection(t.getCursor("head"),t.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(t){l(t,t.getCursor(),C(t,t.getCursor(),1),!0)},"Ctrl-X H":"selectAll","Ctrl-Q Tab":p("insertTab"),"Ctrl-U":R}),T={"Ctrl-G":x},N=0;10>N;++N)E(String(N));E("-")}); \ No newline at end of file diff --git a/media/editors/codemirror/keymap/sublime.min.js b/media/editors/codemirror/keymap/sublime.min.js new file mode 100644 index 0000000000000..e9a48d80a778e --- /dev/null +++ b/media/editors/codemirror/keymap/sublime.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,o){if(0>o&&0==n.ch)return t.clipPos(h(n.line-1));var r=t.getLine(n.line);if(o>0&&n.ch>=r.length)return t.clipPos(h(n.line+1,0));for(var i,l="start",a=n.ch,s=0>o?0:r.length,c=0;a!=s;a+=o,c++){var f=r.charAt(0>o?a-1:a),u="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==u&&f.toUpperCase()==f&&(u="W"),"start"==l)"o"!=u&&(l="in",i=u);else if("in"==l&&i!=u){if("w"==i&&"W"==u&&0>o&&a--,"W"==i&&"w"==u&&o>0){i="w";continue}break}}return h(n.line,a)}function n(e,n){e.extendSelectionsBy(function(o){return e.display.shift||e.doc.extend||o.empty()?t(e.doc,o.head,n):0>n?o.from():o.to()})}function o(e,t){e.operation(function(){for(var n=e.listSelections().length,o=[],r=-1,i=0;n>i;i++){var l=e.listSelections()[i].head;if(!(l.line<=r)){var a=h(l.line+(t?0:1),0);e.replaceRange("\n",a,null,"+insertLine"),e.indentLine(a.line,null,!0),o.push({head:a,anchor:a}),r=l.line+1}}e.setSelections(o)})}function r(t,n){for(var o=n.ch,r=o,i=t.getLine(n.line);o&&e.isWordChar(i.charAt(o-1));)--o;for(;re?-1:e==t?0:1}),e.replaceRange(f,s,c),n&&o.push({anchor:s,head:c})}n&&e.setSelections(o,0)})}function a(t,n){t.operation(function(){for(var o=t.listSelections(),i=[],l=[],a=0;a=0;a--){var s=o[i[a]];if(!(c&&e.cmpPos(s.head,c)>0)){var f=r(t,s.head);c=f.from,t.replaceRange(n(f.word),f.from,f.to)}}})}function s(t){var n=t.getCursor("from"),o=t.getCursor("to");if(0==e.cmpPos(n,o)){var i=r(t,n);if(!i.word)return;n=i.from,o=i.to}return{from:n,to:o,query:t.getRange(n,o),word:i}}function c(e,t){var n=s(e);if(n){var o=n.query,r=e.getSearchCursor(o,t?n.to:n.from);(t?r.findNext():r.findPrevious())?e.setSelection(r.from(),r.to()):(r=e.getSearchCursor(o,t?h(e.firstLine(),0):e.clipPos(h(e.lastLine()))),(t?r.findNext():r.findPrevious())?e.setSelection(r.from(),r.to()):n.word&&e.setSelection(n.from,n.to))}}var f=e.keyMap.sublime={fallthrough:"default"},u=e.commands,h=e.Pos,d=e.keyMap["default"]==e.keyMap.macDefault,p=d?"Cmd-":"Ctrl-";u[f["Alt-Left"]="goSubwordLeft"]=function(e){n(e,-1)},u[f["Alt-Right"]="goSubwordRight"]=function(e){n(e,1)},u[f[p+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},u[f[p+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},u[f["Shift-"+p+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],o=0;or.line&&l==i.line&&0==i.ch||n.push({anchor:l==r.line?r:h(l,0),head:l==i.line?i:h(l)});e.setSelections(n,0)},f["Shift-Tab"]="indentLess",u[f.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},u[f[p+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],o=0;oo?n.push(a,s):n.length&&(n[n.length-1]=s),o=s}e.operation(function(){for(var t=0;te.lastLine()?e.replaceRange("\n"+l,h(e.lastLine()),null,"+swapLine"):e.replaceRange(l+"\n",h(i,0),null,"+swapLine")}e.setSelections(r),e.scrollIntoView()})},u[f[g+"Down"]="swapLineDown"]=function(e){for(var t=e.listSelections(),n=[],o=e.lastLine()+1,r=t.length-1;r>=0;r--){var i=t[r],l=i.to().line+1,a=i.from().line;0!=i.to().ch||i.empty()||l--,o>l?n.push(l,a):n.length&&(n[n.length-1]=a),o=a}e.operation(function(){for(var t=n.length-2;t>=0;t-=2){var o=n[t],r=n[t+1],i=e.getLine(o);o==e.lastLine()?e.replaceRange("",h(o-1),h(o),"+swapLine"):e.replaceRange("",h(o,0),h(o+1,0),"+swapLine"),e.replaceRange(i+"\n",h(r,0),null,"+swapLine")}e.scrollIntoView()})},f[p+"/"]="toggleComment",u[f[p+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],o=0;on;n++){var o=e.listSelections()[n];o.empty()?e.replaceRange(e.getLine(o.head.line)+"\n",h(o.head.line,0)):e.replaceRange(e.getRange(o.from(),o.to()),o.from())}e.scrollIntoView()})},f[p+"T"]="transposeChars",u[f.F9="sortLines"]=function(e){l(e,!0)},u[f[p+"F9"]="sortLinesInsensitive"]=function(e){l(e,!1)},u[f.F2="nextBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),o=n.find();if(o)return t.push(n),e.setSelection(o.from,o.to)}},u[f["Shift-F2"]="prevBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},u[f[p+"F2"]="toggleBookmark"]=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),o=0;o=0;n--)e.replaceRange("",t[n].anchor,h(t[n].to().line),"+delete");e.scrollIntoView()})},u[f[v+p+"U"]="upcaseAtCursor"]=function(e){a(e,function(e){return e.toUpperCase()})},u[f[v+p+"L"]="downcaseAtCursor"]=function(e){a(e,function(e){return e.toLowerCase()})},u[f[v+p+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},u[f[v+p+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},u[f[v+p+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var o=t.getCursor(),r=n;if(e.cmpPos(o,r)>0){var i=r;r=o,o=i}t.state.sublimeKilled=t.getRange(o,r),t.replaceRange("",o,r)}},u[f[v+p+"X"]="swapWithSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},u[f[v+p+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},f[v+p+"G"]="clearBookmarks",u[f[v+p+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},u[f["Shift-Alt-Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;ne.firstLine()&&e.addSelection(h(o.head.line-1,o.head.ch))}})},u[f["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n",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:"xi",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",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:"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:"moveToEol",motionArgs:{inclusive:!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:"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:"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"}],r=e.Pos,n=function(){function n(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",Xt),x(t),e.on(t.getInputField(),"paste",c(t))}function o(t){t.setOption("disableInput",!1),t.off("cursorActivity",Xt),e.off(t.getInputField(),"paste",c(t)),t.state.vim=null}function i(t,r){this==e.keyMap.vim&&e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),r&&r.attach==a||o(t,!1)}function a(t,r){this==e.keyMap.vim&&e.addClass(t.getWrapperElement(),"cm-fat-cursor"),r&&r.attach==a||n(t)}function s(t,r){if(!r)return void 0;var n=l(t);if(!n)return!1;var o=e.Vim.findKey(r,n);return"function"==typeof o&&e.signal(r,"vim-keypress",n),o}function l(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split("-");/-$/.test(e)&&t.splice(-2,2,"-");var r=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==r.length)return!1;for(var n=!1,o=0;o"):!1}function c(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(P(e.getCursor(),0,1)),Ar.enterInsertMode(e,{},t))}),t.onPasteFn}function u(e,t){for(var r=[],n=e;e+t>n;n++)r.push(String.fromCharCode(n));return r}function h(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function p(e){return/^[a-z]$/.test(e)}function d(e){return-1!="()[]{}".indexOf(e)}function f(e){return lr.test(e)}function m(e){return/^[A-Z]$/.test(e)}function g(e){return/^\s*$/.test(e)}function v(e,t){for(var r=0;rn;n++)r.push(e);return r}function B(e,t){Sr[e]=t}function I(e,t){Ar[e]=t}function O(e,t,n){var o=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),i=q(e,o)-1;i=n?i+1:i;var a=Math.min(Math.max(0,t.ch),i);return r(o,a)}function K(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function P(e,t,n){return"object"==typeof t&&(n=t.ch,t=t.line),r(e.line+t,e.ch+n)}function N(e,t){return{line:t.line-e.line,ch:t.line-e.line}}function j(e,t,r,n){for(var o,i=[],a=[],s=0;s"==t.slice(-11)){var r=t.length-11,n=e.slice(0,r),o=t.slice(0,r);return n==o&&e.length>r?"full":0==o.indexOf(n)?"partial":!1}return e==t?"full":0==t.indexOf(e)?"partial":!1}function F(e){var t=/^.*(<[\w\-]+>)$/.exec(e),r=t?t[1]:e.slice(-1);if(r.length>1)switch(r){case"":r="\n";break;case"":r=" "}return r}function D(e,t,r){return function(){for(var n=0;r>n;n++)t(e)}}function W(e){return r(e.line,e.ch)}function V(e,t){return e.ch==t.ch&&e.line==t.line}function _(e,t){return e.line2&&(t=J.apply(void 0,Array.prototype.slice.call(arguments,1))),_(e,t)?e:t}function U(e,t){return arguments.length>2&&(t=U.apply(void 0,Array.prototype.slice.call(arguments,1))),_(e,t)?t:e}function $(e,t,r){var n=_(e,t),o=_(t,r);return n&&o}function q(e,t){return e.getLine(t).length}function Q(e){return e.split("").reverse().join("")}function z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Z(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function G(e,t,n){var o=q(e,t),i=new Array(n-o+1).join(" ");e.setCursor(r(t,o)),e.replaceRange(i,e.getCursor())}function Y(e,t){var n=[],o=e.listSelections(),i=W(e.clipPos(t)),a=!V(t,i),s=e.getCursor("head"),l=et(o,s),c=V(o[l].head,o[l].anchor),u=o.length-1,h=u-l>l?u:0,p=o[h].anchor,d=Math.min(p.line,i.line),f=Math.max(p.line,i.line),m=p.ch,g=i.ch,v=o[h].head.ch-m,y=g-m;v>0&&0>=y?(m++,a||g--):0>v&&y>=0?(m--,c||g++):0>v&&-1==y&&(m--,g++);for(var k=d;f>=k;k++){var C={anchor:new r(k,m),head:new r(k,g)};n.push(C)}return l=i.line==f?n.length-1:0,e.setSelections(n),t.ch=g,p.ch=m,p}function X(e,t,r){for(var n=[],o=0;r>o;o++){var i=P(t,o,0);n.push({anchor:i,head:i})}e.setSelections(n,0)}function et(e,t,r){for(var n=0;nc&&(i.line=c),i.ch=q(e,i.line)}return{ranges:[{anchor:a,head:i}],primary:0}}if("block"==n){for(var u=Math.min(a.line,i.line),h=Math.min(a.ch,i.ch),p=Math.max(a.line,i.line),d=Math.max(a.ch,i.ch)+1,f=p-u+1,m=i.line==u?0:f-1,g=[],v=0;f>v;v++)g.push({anchor:r(u+v,h),head:r(u+v,d)});return{ranges:g,primary:m}}}function at(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=J(t,e.getCursor("anchor"))),t}function st(t,r){var n=t.state.vim;r!==!1&&t.setCursor(O(t,n.sel.head)),rt(t,n),n.visualMode=!1,n.visualLine=!1,n.visualBlock=!1,e.signal(t,"vim-mode-change",{mode:"normal"}),n.fakeCursor&&n.fakeCursor.clear()}function lt(e,t,r){var n=e.getRange(t,r);if(/\n\s*$/.test(n)){var o=n.split("\n");o.pop();for(var i,i=o.pop();o.length>0&&i&&g(i);i=o.pop())r.line--,r.ch=0;i?(r.line--,r.ch=q(e,r.line)):r.ch=0}}function ct(e,t,r){t.ch=0,r.ch=0,r.line++}function ut(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function ht(e,t,n,o,i){var a,s=at(e),l=e.getLine(s.line),c=s.ch,u=l.substring(c);if(a=u.search(i?/\w/:/\S/),-1==a)return null;c+=a,u=l.substring(c);var h,p=l.substring(0,c);h=o?/^\S+/:/\w/.test(l.charAt(c))?/^\w+/:/^[^\w\s]+/;var d=h.exec(u),f=c,m=c+d[0].length,g=Q(p),v=h.exec(g);if(v&&(f-=v[0].length),t){var y=l.substring(m),k=y.match(/^\s*/)[0].length;if(k>0)m+=k;else{var C=g.length-f,w=g.substring(C),x=w.match(/^\s*/)[0].length;f-=x}}return{start:r(s.line,f),end:r(s.line,m)}}function pt(e,t,r){V(t,r)||kr.jumpList.add(e,t,r)}function dt(e,t){kr.lastChararacterSearch.increment=e,kr.lastChararacterSearch.forward=t.forward,kr.lastChararacterSearch.selectedCharacter=t.selectedCharacter}function ft(e,t,n,o){var i=W(e.getCursor()),a=n?1:-1,s=n?e.lineCount():-1,l=i.ch,c=i.line,u=e.getLine(c),h={lineText:u,nextCh:u.charAt(l),lastCh:null,index:l,symb:o,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[o],forward:n,depth:0,curMoveThrough:!1},p=br[o];if(!p)return i;var d=Lr[p].init,f=Lr[p].isComplete;for(d&&d(h);c!==s&&t;){if(h.index+=a,h.nextCh=h.lineText.charAt(h.index),!h.nextCh){if(c+=a,h.lineText=e.getLine(c)||"",a>0)h.index=0;else{var m=h.lineText.length;h.index=m>0?m-1:0}h.nextCh=h.lineText.charAt(h.index)}f(h)&&(i.line=c,i.ch=h.index,t--)}return h.nextCh||h.curMoveThrough?r(c,h.index):i}function mt(e,t,r,n,o){var i=t.line,a=t.ch,s=e.getLine(i),l=r?1:-1,c=n?ur:cr;if(o&&""==s){if(i+=l,s=e.getLine(i),!h(e,i))return null;a=r?0:s.length}for(;;){if(o&&""==s)return{from:0,to:0,line:i};for(var u=l>0?s.length:-1,p=u,d=u;a!=u;){for(var f=!1,m=0;m0?0:s.length}throw new Error("The impossible happened.")}function gt(e,t,n,o,i,a){var s=W(t),l=[];(o&&!i||!o&&i)&&n++;for(var c=!(o&&i),u=0;n>u;u++){var h=mt(e,t,o,a,c);if(!h){var p=q(e,e.lastLine());l.push(o?{line:e.lastLine(),from:p,to:p}:{line:0,from:0,to:0});break}l.push(h),t=r(h.line,o?h.to-1:h.from)}var d=l.length!=n,f=l[0],m=l.pop();return o&&!i?(d||f.from==s.ch&&f.line==s.line||(m=l.pop()),r(m.line,m.from)):o&&i?r(m.line,m.to-1):!o&&i?(d||f.to==s.ch&&f.line==s.line||(m=l.pop()),r(m.line,m.to)):r(m.line,m.from)}function vt(e,t,n,o){for(var i,a=e.getCursor(),s=a.ch,l=0;t>l;l++){var c=e.getLine(a.line);if(i=Ct(s,c,o,n,!0),-1==i)return null;s=i}return r(e.getCursor().line,i)}function yt(e,t){var n=e.getCursor().line;return O(e,r(n,t-1))}function kt(e,t,r,n){v(r,fr)&&(t.marks[r]&&t.marks[r].clear(),t.marks[r]=e.setBookmark(n))}function Ct(e,t,r,n,o){var i;return n?(i=t.indexOf(r,e+1),-1==i||o||(i-=1)):(i=t.lastIndexOf(r,e-1),-1==i||o||(i+=1)),i}function wt(e,t,n,o,i){function a(t){return!e.getLine(t)}function s(e,t,r){return r?a(e)!=a(e+t):!a(e)&&a(e+t)}var l,c,u=t.line,h=e.firstLine(),p=e.lastLine(),d=u;if(o){for(;d>=h&&p>=d&&n>0;)s(d,o)&&n--,d+=o;return new r(d,0)}var f=e.state.vim;if(f.visualLine&&s(u,1,!0)){var m=f.sel.anchor;s(m.line,-1,!0)&&(i&&m.line==u||(u+=1))}var g=a(u);for(d=u;p>=d&&n;d++)s(d,1,!0)&&(i&&a(d)==g||n--);for(c=new r(d,0),d>p&&!g?g=!0:i=!1,d=u;d>h&&(i&&a(d)!=g&&d!=u||!s(d,-1,!0));d--);return l=new r(d,0),{start:l,end:c}}function xt(e,t,n,o){var i,a,s=t,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],c={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],u=e.getLine(s.line).charAt(s.ch),h=u===c?1:0;if(i=e.scanForBracket(r(s.line,s.ch+h),-1,null,{bracketRegex:l}),a=e.scanForBracket(r(s.line,s.ch+h),1,null,{bracketRegex:l}),!i||!a)return{start:s,end:s};if(i=i.pos,a=a.pos,i.line==a.line&&i.ch>a.ch||i.line>a.line){var p=i;i=a,a=p}return o?a.ch+=1:i.ch+=1,{start:i,end:a}}function Mt(e,t,n,o){var i,a,s,l,c=W(t),u=e.getLine(c.line),h=u.split(""),p=h.indexOf(n);if(c.ch-1&&!i;s--)h[s]==n&&(i=s+1);else i=c.ch+1;if(i&&!a)for(s=i,l=h.length;l>s&&!a;s++)h[s]==n&&(a=s);return i&&a?(o&&(--i,++a),{start:r(c.line,i),end:r(c.line,a)}):{start:c,end:c}}function St(){}function At(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new St)}function bt(e,t,r,n,o){e.openDialog?e.openDialog(t,n,{bottom:!0,value:o.value,onKeyDown:o.onKeyDown,onKeyUp:o.onKeyUp}):n(prompt(r,""))}function Lt(e){var t=Tt(e)||[];if(!t.length)return[];var r=[];if(0===t[0]){for(var n=0;n'+t+"",{bottom:!0,duration:5e3}):alert(t)}function Kt(e,t){var r="";return e&&(r+=''+e+""),r+=' ',t&&(r+='',r+=t,r+=""),r}function Pt(e,t){var r=(t.prefix||"")+" "+(t.desc||""),n=Kt(t.prefix,t.desc);bt(e,n,r,t.onClose,t)}function Nt(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var r=["global","multiline","ignoreCase","source"],n=0;ns;s++){var l=a.find(t);if(0==s&&l&&V(a.from(),i)&&(l=a.find(t)),!l&&(a=e.getSearchCursor(n,t?r(e.lastLine()):r(e.firstLine(),0)),!a.find(t)))return}return a.from()})}function Wt(e){var t=At(e);e.removeOverlay(At(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Vt(e,t,r){return"number"!=typeof e&&(e=e.line),t instanceof Array?v(e,t):r?e>=t&&r>=e:e==t}function _t(e){var t=e.getScrollInfo(),r=6,n=10,o=e.coordsChar({left:0,top:r+t.top},"local"),i=t.clientHeight-n+t.top,a=e.coordsChar({left:0,top:i},"local");return{top:o.line,bottom:a.line}}function Jt(t,r,n,o,i,a,s,l,c){function u(){t.operation(function(){for(;!m;)h(),p();d()})}function h(){var e=t.getRange(a.from(),a.to()),r=e.replace(s,l);a.replace(r)}function p(){for(var e;e=a.findNext()&&Vt(a.from(),o,i);)if(n||!g||a.from().line!=g.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),g=a.from(),void(m=!1);m=!0}function d(e){if(e&&e(),t.focus(),g){t.setCursor(g);var r=t.state.vim;r.exMode=!1,r.lastHPos=r.lastHSPos=g.ch}c&&c()}function f(r,n,o){e.e_stop(r);var i=e.keyName(r);switch(i){case"Y":h(),p();break;case"N":p();break;case"A":var a=c;c=void 0,t.operation(u),c=a;break;case"L":h();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":d(o)}return m&&d(o),!0}t.state.vim.exMode=!0;var m=!1,g=a.from();return p(),m?void Ot(t,"No matches for "+s.source):r?void Pt(t,{prefix:"replace with "+l+" (y/n/a/q/l)",onKeyDown:f}):(u(),void(c&&c()))}function Ut(t){var r=t.state.vim,n=kr.macroModeState,o=kr.registerController.getRegister("."),i=n.isPlaying,a=n.lastInsertModeChanges,s=[];if(!i){for(var l=a.inVisualBlock?r.lastSelection.visualBlock.height:1,c=a.changes,s=[],u=0;u1&&(or(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),o.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),n.isRecording&&Zt(n)}function $t(e){t.push(e)}function qt(e,t,r,n,o){var i={keys:e,type:t};i[t]=r,i[t+"Args"]=n;for(var a in o)i[a]=o[a];$t(i)}function Qt(t,r,n,o){var i=kr.registerController.getRegister(o),a=i.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var l=0;l|<\w+>|./.exec(h),u=c[0],h=h.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"),r.insertMode){var p=i.insertModeChanges[s++].changes;kr.macroModeState.lastInsertModeChanges.changes=p,ir(t,p,1),Ut(t)}n.isPlaying=!1}function zt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=kr.registerController.getRegister(r);n&&n.pushText(t)}}function Zt(e){if(!e.isPlaying){var t=e.latestRegister,r=kr.registerController.getRegister(t);r&&r.pushInsertModeChanges(e.lastInsertModeChanges)}}function Gt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=kr.registerController.getRegister(r);n&&n.pushSearchQuery(t)}}function Yt(e,t){var r=kr.macroModeState,n=r.lastInsertModeChanges;if(!r.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var o=t.text.join("\n");n.changes.push(o)}t=t.next}}function Xt(e){var t=e.state.vim;if(t.insertMode){var r=kr.macroModeState;if(r.isPlaying)return;var n=r.lastInsertModeChanges;n.expectCursorActivityForChange?n.expectCursorActivityForChange=!1:n.changes=[]}else e.curOp.isVimOp||tr(e,t);t.visualMode&&er(e)}function er(e){var t=e.state.vim,r=W(t.sel.head),n=P(r,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(r,n,{className:"cm-animate-fat-cursor"})}function tr(t,r){var n=t.getCursor("anchor"),o=t.getCursor("head");if(r.visualMode&&V(o,n)&&q(t,o.line)>o.ch?st(t,!1):r.visualMode||r.insertMode||!t.somethingSelected()||(r.visualMode=!0,r.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"})),r.visualMode){var i=_(o,n)?0:-1,a=_(o,n)?-1:0; +o=P(o,0,i),n=P(n,0,a),r.sel={anchor:n,head:o},kt(t,r,"<",J(o,n)),kt(t,r,">",U(o,n))}else r.insertMode||(r.lastHPos=t.getCursor().ch)}function rr(e){this.keyName=e}function nr(t){function r(){return o.changes.push(new rr(i)),!0}var n=kr.macroModeState,o=n.lastInsertModeChanges,i=e.keyName(t);i&&(-1!=i.indexOf("Delete")||-1!=i.indexOf("Backspace"))&&e.lookupKey(i,"vim-insert",r)}function or(e,t,r,n){function o(){s?xr.processAction(e,t,t.lastEditActionCommand):xr.evalInput(e,t)}function i(r){if(a.lastInsertModeChanges.changes.length>0){r=t.lastEditActionCommand?r:1;var n=a.lastInsertModeChanges;ir(e,n.changes,r)}}var a=kr.macroModeState;a.isPlaying=!0;var s=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;r>c;c++)o(),i(1);else n||o(),i(r);t.inputState=l,t.insertMode&&!n&&Ut(e),a.isPlaying=!1}function ir(t,r,n){function o(r){return"string"==typeof r?e.commands[r](t):r(t),!0}var i=t.getCursor("head"),a=kr.macroModeState.lastInsertModeChanges.inVisualBlock;if(a){var s=t.state.vim,l=s.lastSelection,c=N(l.anchor,l.head);X(t,i,c.line+1),n=t.listSelections().length,t.setCursor(i)}for(var u=0;n>u;u++){a&&t.setCursor(P(i,u,0));for(var h=0;h"]),mr=[].concat(hr,pr,dr,["-",'"',".",":","/"]),gr={},vr=function(){function e(e,t,s){function l(t){var o=++n%r,i=a[o];i&&i.clear(),a[o]=e.setBookmark(t)}var c=n%r,u=a[c];if(u){var h=u.find();h&&!V(h,t)&&l(t)}else l(t);l(s),o=n,i=n-r+1,0>i&&(i=0)}function t(e,t){n+=t,n>o?n=o:i>n&&(n=i);var s=a[(r+n)%r];if(s&&!s.find()){var l,c=t>0?1:-1,u=e.getCursor();do if(n+=c,s=a[(r+n)%r],s&&(l=s.find())&&!V(u,l))break;while(o>n&&n>i)}return s}var r=100,n=-1,o=0,i=0,a=new Array(r);return{cachedCursor:void 0,add:e,move:t}},yr=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var e=kr.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var r=kr.registerController.getRegister(t);r&&(r.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var kr,Cr,wr={buildKeyMap:function(){},getRegisterController:function(){return kr.registerController},resetVimGlobalState_:M,getVimGlobalState_:function(){return kr},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:rr,map:function(e,t,r){Ir.map(e,t,r)},setOption:k,getOption:C,defineOption:y,defineEx:function(e,t,r){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered');Br[e]=r,Ir.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,r){var n=this.findKey(e,t,r);return"function"==typeof n?n():void 0},findKey:function(r,n,o){function i(){var e=kr.macroModeState;if(e.isRecording){if("q"==n)return e.exitMacroRecordMode(),A(r),!0;"mapping"!=o&&zt(e,n)}}function a(){return""==n?(A(r),h.visualMode?st(r):h.insertMode&&Ut(r),!0):void 0}function s(t){for(var o;t;)o=/<\w+-.+?>|<\w+>|./.exec(t),n=o[0],t=t.substring(o.index+n.length),e.Vim.handleKey(r,n,"mapping")}function l(){if(a())return!0;for(var e=h.inputState.keyBuffer=h.inputState.keyBuffer+n,o=1==n.length,i=xr.matchCommand(e,t,h.inputState,"insert");e.length>1&&"full"!=i.type;){var e=h.inputState.keyBuffer=e.slice(1),s=xr.matchCommand(e,t,h.inputState,"insert");"none"!=s.type&&(i=s)}if("none"==i.type)return A(r),!1;if("partial"==i.type)return Cr&&window.clearTimeout(Cr),Cr=window.setTimeout(function(){h.insertMode&&h.inputState.keyBuffer&&A(r)},C("insertModeEscKeysTimeout")),!o;if(Cr&&window.clearTimeout(Cr),o){var l=r.getCursor();r.replaceRange("",P(l,0,-(e.length-1)),l,"+input")}return A(r),i.command}function c(){if(i()||a())return!0;var e=h.inputState.keyBuffer=h.inputState.keyBuffer+n;if(/^[1-9]\d*$/.test(e))return!0;var o=/^(\d*)(.*)$/.exec(e);if(!o)return A(r),!1;var s=h.visualMode?"visual":"normal",l=xr.matchCommand(o[2]||o[1],t,h.inputState,s);if("none"==l.type)return A(r),!1;if("partial"==l.type)return!0;h.inputState.keyBuffer="";var o=/^(\d*)(.*)$/.exec(e);return o[1]&&"0"!=o[1]&&h.inputState.pushRepeatDigit(o[1]),l.command}var u,h=x(r);return u=h.insertMode?l():c(),u===!1?void 0:u===!0?function(){}:function(){return r.operation(function(){r.curOp.isVimOp=!0;try{"keyToKey"==u.type?s(u.toKeys):xr.processCommand(r,h,u)}catch(t){throw r.state.vim=void 0,x(r),e.Vim.suppressErrorLogging||console.log(t),t}return!0})}},handleEx:function(e,t){Ir.processCommand(e,t)},defineMotion:R,defineAction:I,defineOperator:B,mapCommand:qt,_mapCommand:$t,exitVisualMode:st,exitInsertMode:Ut};S.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},S.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},b.prototype={setText:function(e,t,r){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!r},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(yr(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},L.prototype={pushText:function(e,t,r,n,o){n&&"\n"==r.charAt(0)&&(r=r.slice(1)+"\n"),n&&"\n"!==r.charAt(r.length-1)&&(r+="\n");var i=this.isValidRegister(e)?this.getRegister(e):null;if(!i){switch(t){case"yank":this.registers[0]=new b(r,n,o);break;case"delete":case"change":-1==r.indexOf("\n")?this.registers["-"]=new b(r,n):(this.shiftNumericRegisters_(),this.registers[1]=new b(r,n))}return void this.unnamedRegister.setText(r,n,o)}var a=m(e);a?i.pushText(r,n):i.setText(r,n,o),this.unnamedRegister.setText(i.toString(),n)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new b),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&v(e,mr)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},T.prototype={nextMatch:function(e,t){var r=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+n;t?o>=0:o=r.length?(this.iterator=r.length,this.initialPrefix):0>o?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var xr={matchCommand:function(e,t,r,n){var o=j(e,t,n,r);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var i,a=0;a"==i.keys.slice(-11)&&(r.selectedCharacter=F(e)),{type:"full",command:i}},processCommand:function(e,t,r){switch(t.inputState.repeatOverride=r.repeatOverride,r.type){case"motion":this.processMotion(e,t,r);break;case"operator":this.processOperator(e,t,r);break;case"operatorMotion":this.processOperatorMotion(e,t,r);break;case"action":this.processAction(e,t,r);break;case"search":this.processSearch(e,t,r),A(e);break;case"ex":case"keyToEx":this.processEx(e,t,r),A(e)}},processMotion:function(e,t,r){t.inputState.motion=r.motion,t.inputState.motionArgs=K(r.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,r){var n=t.inputState;if(n.operator){if(n.operator==r.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);A(e)}n.operator=r.operator,n.operatorArgs=K(r.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,r){var n=t.visualMode,o=K(r.operatorMotionArgs);o&&n&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,r),n||this.processMotion(e,t,r)},processAction:function(e,t,r){var n=t.inputState,o=n.getRepeat(),i=!!o,a=K(r.actionArgs)||{};n.selectedCharacter&&(a.selectedCharacter=n.selectedCharacter),r.operator&&this.processOperator(e,t,r),r.motion&&this.processMotion(e,t,r),(r.motion||r.operator)&&this.evalInput(e,t),a.repeat=o||1,a.repeatIsExplicit=i,a.registerName=n.registerName,A(e),t.lastMotion=null,r.isEdit&&this.recordLastEdit(t,n,r),Ar[r.action](e,a,t)},processSearch:function(t,r,n){function o(e,o,i){kr.searchHistoryController.pushInput(e),kr.searchHistoryController.reset();try{jt(t,e,o,i)}catch(a){return void Ot(t,"Invalid regex: "+e)}xr.processMotion(t,r,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}function i(e){t.scrollTo(p.left,p.top),o(e,!0,!0);var r=kr.macroModeState;r.isRecording&&Gt(r,e)}function a(r,n,o){var i,a=e.keyName(r);"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=kr.searchHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kr.searchHistoryController.reset();var s;try{s=jt(t,n,!0,!0)}catch(r){}s?t.scrollIntoView(Dt(t,!l,s),30):(Wt(t),t.scrollTo(p.left,p.top))}function s(r,n,o){var i=e.keyName(r);("Esc"==i||"Ctrl-C"==i||"Ctrl-["==i)&&(kr.searchHistoryController.pushInput(n),kr.searchHistoryController.reset(),jt(t,h),Wt(t),t.scrollTo(p.left,p.top),e.e_stop(r),o(),t.focus())}if(t.getSearchCursor){var l=n.searchArgs.forward,c=n.searchArgs.wholeWordOnly;At(t).setReversed(!l);var u=l?"/":"?",h=At(t).getQuery(),p=t.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var d=kr.macroModeState;if(d.isPlaying){var f=d.replaySearchQueries.shift();o(f,!0,!1)}else Pt(t,{onClose:i,prefix:u,desc:Tr,onKeyUp:a,onKeyDown:s});break;case"wordUnderCursor":var m=ht(t,!1,!0,!1,!0),g=!0;if(m||(m=ht(t,!1,!0,!1,!1),g=!1),!m)return;var f=t.getLine(m.start.line).substring(m.start.ch,m.end.ch);f=g&&c?"\\b"+f+"\\b":Z(f),kr.jumpList.cachedCursor=t.getCursor(),t.setCursor(m.start),o(f,!0,!1)}}},processEx:function(t,r,n){function o(e){kr.exCommandHistoryController.pushInput(e),kr.exCommandHistoryController.reset(),Ir.processCommand(t,e)}function i(r,n,o){var i,a=e.keyName(r);("Esc"==a||"Ctrl-C"==a||"Ctrl-["==a)&&(kr.exCommandHistoryController.pushInput(n),kr.exCommandHistoryController.reset(),e.e_stop(r),o(),t.focus()),"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=kr.exCommandHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kr.exCommandHistoryController.reset()}"keyToEx"==n.type?Ir.processCommand(t,n.exArgs.input):r.visualMode?Pt(t,{onClose:o,prefix:":",value:"'<,'>",onKeyDown:i}):Pt(t,{onClose:o,prefix:":",onKeyDown:i})},evalInput:function(e,t){var n,o,i,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},h=a.registerName,p=t.sel,d=W(t.visualMode?p.head:e.getCursor("head")),f=W(t.visualMode?p.anchor:e.getCursor("anchor")),m=W(d),g=W(f);if(c&&this.recordLastEdit(t,a),i=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat(),i>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===i)&&(i=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=i,A(e),s){var v=Mr[s](e,d,l,t);if(t.lastMotion=Mr[s],!v)return;if(l.toJumplist){var y=kr.jumpList,k=y.cachedCursor;k?(pt(e,k,v),delete y.cachedCursor):pt(e,d,v)}v instanceof Array?(o=v[0],n=v[1]):n=v,n||(n=W(d)),t.visualMode?(t.visualBlock&&1/0===n.ch||(n=O(e,n,t.visualBlock)),o&&(o=O(e,o,!0)),o=o||g,p.anchor=o,p.head=n,ot(e),kt(e,t,"<",_(o,n)?o:n),kt(e,t,">",_(o,n)?n:o)):c||(n=O(e,n),e.setCursor(n.line,n.ch))}if(c){if(u.lastSel){o=g;var C=u.lastSel,w=Math.abs(C.head.line-C.anchor.line),x=Math.abs(C.head.ch-C.anchor.ch);n=C.visualLine?r(g.line+w,g.ch):C.visualBlock?r(g.line+w,g.ch+x):C.head.line==C.anchor.line?r(g.line,g.ch+x):r(g.line+w,g.ch),t.visualMode=!0,t.visualLine=C.visualLine,t.visualBlock=C.visualBlock,p=t.sel={anchor:o,head:n},ot(e)}else t.visualMode&&(u.lastSel={anchor:W(p.anchor),head:W(p.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var M,S,b,L,T;if(t.visualMode){if(M=J(p.head,p.anchor),S=U(p.head,p.anchor),b=t.visualLine||u.linewise,L=t.visualBlock?"block":b?"line":"char",T=it(e,{anchor:M,head:S},L),b){var R=T.ranges;if("block"==L)for(var E=0;El&&i.line==c||l>u&&i.line==u?void 0:(n.toFirstChar&&(a=ut(e.getLine(l)),o.lastHPos=a),o.lastHSPos=e.charCoords(r(l,a),"div").left,r(l,a))},moveByDisplayLines:function(e,t,n,o){var i=t;switch(o.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:o.lastHSPos=e.charCoords(i,"div").left}var a=n.repeat,s=e.findPosV(i,n.forward?a:-a,"line",o.lastHSPos);if(s.hitSide)if(n.forward)var l=e.charCoords(s,"div"),c={top:l.top+8,left:o.lastHSPos},s=e.coordsChar(c,"div");else{var u=e.charCoords(r(e.firstLine(),0),"div");u.left=o.lastHSPos,s=e.coordsChar(u,"div")}return o.lastHPos=s.ch,s},moveByPage:function(e,t,r){var n=t,o=r.repeat;return e.findPosV(n,r.forward?o:-o,"page")},moveByParagraph:function(e,t,r){var n=r.forward?1:-1;return wt(e,t,r.repeat,n)},moveByScroll:function(e,t,r,n){var o=e.getScrollInfo(),i=null,a=r.repeat;a||(a=o.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");r.repeat=a;var i=Mr.moveByDisplayLines(e,t,r,n);if(!i)return null;var l=e.charCoords(i,"local");return e.scrollTo(null,o.top+l.top-s.top),i},moveByWords:function(e,t,r){return gt(e,t,r.repeat,!!r.forward,!!r.wordEnd,!!r.bigWord)},moveTillCharacter:function(e,t,r){var n=r.repeat,o=vt(e,n,r.forward,r.selectedCharacter),i=r.forward?-1:1;return dt(i,r),o?(o.ch+=i,o):null},moveToCharacter:function(e,t,r){var n=r.repeat;return dt(0,r),vt(e,n,r.forward,r.selectedCharacter)||t},moveToSymbol:function(e,t,r){var n=r.repeat;return ft(e,n,r.forward,r.selectedCharacter)||t},moveToColumn:function(e,t,r,n){var o=r.repeat;return n.lastHPos=o-1,n.lastHSPos=e.charCoords(t,"div").left,yt(e,o)},moveToEol:function(e,t,n,o){var i=t;o.lastHPos=1/0;var a=r(i.line+n.repeat-1,1/0),s=e.clipPos(a);return s.ch--,o.lastHSPos=e.charCoords(s,"div").left,a},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return r(n.line,ut(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n,o=t,i=o.line,a=o.ch,s=e.getLine(i);do if(n=s.charAt(a++),n&&d(n)){var l=e.getTokenTypeAt(r(i,a));if("string"!==l&&"comment"!==l)break}while(n);if(n){var c=e.findMatchingBracket(r(i,a));return c.to}return o},moveToStartOfLine:function(e,t){return r(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var o=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(o=n.repeat-e.getOption("firstLineNumber")),r(o,ut(e.getLine(o)))},textObjectManipulation:function(e,t,r,n){var o={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},i={"'":!0,'"':!0},a=r.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!r.textObjectInner;if(o[a])s=xt(e,t,a,l);else if(i[a])s=Mt(e,t,a,l);else if("W"===a)s=ht(e,l,!0,!0);else if("w"===a)s=ht(e,l,!0,!1);else{if("p"!==a)return null;if(s=wt(e,t,r.repeat,0,l),r.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var c=n.inputState.operatorArgs;c&&(c.linewise=!0),s.end.line--}}return e.state.vim.visualMode?nt(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,r){var n=kr.lastChararacterSearch,o=r.repeat,i=r.forward===n.forward,a=(n.increment?1:0)*(i?-1:1);e.moveH(-a,"char"),r.inclusive=i?!0:!1;var s=vt(e,o,i,n.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}},Sr={change:function(t,r,n){var o,i,a=t.state.vim;if(kr.macroModeState.lastInsertModeChanges.inVisualBlock=a.visualBlock,a.visualMode){i=t.getSelection();var s=E("",n.length);t.replaceSelections(s),o=J(n[0].head,n[0].anchor)}else{var l=n[0].anchor,c=n[0].head;if(i=t.getRange(l,c),!g(i)){var u=/\s+$/.exec(i);u&&(c=P(c,0,-u[0].length),i=i.slice(0,-u[0].length))}var h=c.line-1==t.lastLine();t.replaceRange("",l,c),r.linewise&&!h&&(e.commands.newlineAndIndent(t),l.ch=null),o=l}kr.registerController.pushText(r.registerName,"change",i,r.linewise,n.length>1),Ar.enterInsertMode(t,{head:o},t.state.vim)},"delete":function(e,t,n){var o,i,a=e.state.vim;if(a.visualBlock){i=e.getSelection();var s=E("",n.length);e.replaceSelections(s),o=n[0].anchor}else{var l=n[0].anchor,c=n[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=r(l.line-1,q(e,l.line-1))),i=e.getRange(l,c),e.replaceRange("",l,c),o=l,t.linewise&&(o=Mr.moveToFirstNonWhiteSpaceCharacter(e,l))}return kr.registerController.pushText(t.registerName,"delete",i,t.linewise,a.visualBlock),O(e,o)},indent:function(e,t,r){var n=e.state.vim,o=r[0].anchor.line,i=n.visualBlock?r[r.length-1].anchor.line:r[0].head.line,a=n.visualMode?t.repeat:1;t.linewise&&i--;for(var s=o;i>=s;s++)for(var l=0;a>l;l++)e.indentLine(s,t.indentRight);return Mr.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},changeCase:function(e,t,r,n,o){for(var i=e.getSelections(),a=[],s=t.toLower,l=0;lc.top?(l.line+=(s-c.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u=a.anchor.line?P(a.head,0,1):r(a.anchor.line,0);else if("inplace"==i&&o.visualMode)return;t.setOption("keyMap","vim-insert"),t.setOption("disableInput",!1),n&&n.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})),kr.macroModeState.isPlaying||(t.on("change",Yt),e.on(t.getInputField(),"keydown",nr)),o.visualMode&&st(t),X(t,s,l)}},toggleVisualMode:function(t,n,o){var i,a=n.repeat,s=t.getCursor();o.visualMode?o.visualLine^n.linewise||o.visualBlock^n.blockwise?(o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t)):st(t):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,i=O(t,r(s.line,s.ch+a-1),!0),o.sel={anchor:s,head:i},e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t),kt(t,o,"<",J(s,i)),kt(t,o,">",U(s,i)))},reselectLastSelection:function(t,r,n){var o=n.lastSelection;if(n.visualMode&&rt(t,n),o){var i=o.anchorMark.find(),a=o.headMark.find();if(!i||!a)return;n.sel={anchor:i,head:a},n.visualMode=!0,n.visualLine=o.visualLine,n.visualBlock=o.visualBlock,ot(t),kt(t,n,"<",J(i,a)),kt(t,n,">",U(i,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var o,i;if(n.visualMode){if(o=e.getCursor("anchor"),i=e.getCursor("head"),_(i,o)){var a=i;i=o,o=a}i.ch=q(e,i.line)-1}else{var s=Math.max(t.repeat,2);o=e.getCursor(),i=O(e,r(o.line+s-1,1/0))}for(var l=0,c=o.line;cr)return"";if(e.getOption("indentWithTabs")){var n=Math.floor(r/s);return Array(n+1).join(" ")}return Array(r+1).join(" ")});a+=p?"\n":""}if(t.repeat>1)var a=Array(t.repeat+1).join(a);var f=i.linewise,m=i.blockwise;if(f)n.visualMode?a=n.visualLine?a.slice(0,-1):"\n"+a.slice(0,a.length-1)+"\n":t.after?(a="\n"+a.slice(0,a.length-1),o.ch=q(e,o.line)):o.ch=0;else{if(m){a=a.split("\n");for(var g=0;ge.lastLine()&&e.replaceRange("\n",r(b,0));var L=q(e,b);Lu.length&&(i=u.length),a=r(l.line,i)}if("\n"==s)o.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var h=t.getRange(l,a);if(h=h.replace(/[^\n]/g,s),o.visualBlock){var p=new Array(t.getOption("tabSize")+1).join(" ");h=t.getSelection(),h=h.replace(/\t/g,p).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(h)}else t.replaceRange(h,l,a);o.visualMode?(l=_(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),st(t,!1)):t.setCursor(P(a,0,-1))}},incrementNumberToken:function(e,t){for(var n,o,i,a,s,l=e.getCursor(),c=e.getLine(l.line),u=/-?\d+/g;null!==(n=u.exec(c))&&(s=n[0],o=n.index,i=o+s.length,!(l.ch=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb?!0:!1}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};y("pcre",!0,"boolean"),St.prototype={getQuery:function(){return kr.query},setQuery:function(e){kr.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return kr.isReversed},setReversed:function(e){kr.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Tr="(Javascript regexp)",Rr=[{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:"set"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],Er=function(){this.buildCommandMap_()};Er.prototype={processCommand:function(t,r,n){var o=t.state.vim,i=kr.registerController.getRegister(":"),a=i.toString();o.visualMode&&st(t);var s=new e.StringStream(r);i.setText(r);var l=n||{};l.input=r;try{this.parseInput_(t,s,l)}catch(c){throw Ot(t,c),c}var u,h;if(l.commandName){if(u=this.matchCommand_(l.commandName)){if(h=u.name,u.excludeFromCommandHistory&&i.setText(a),this.parseCommandArgs_(s,l,u),"exToKey"==u.type){for(var p=0;p0;t--){var r=e.substring(0,t);if(this.commandMap_[r]){var n=this.commandMap_[r];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={}; +for(var e=0;e
";if(r){var i;r=r.join("");for(var a=0;a"}}else for(var i in n){var l=n[i].toString();l.length&&(o+='"'+i+" "+l+"
")}Ot(e,o)},sort:function(t,n){function o(){if(n.argString){var t=new e.StringStream(n.argString);if(t.eat("!")&&(a=!0),t.eol())return;if(!t.eatSpace())return"Invalid arguments";var r=t.match(/[a-z]+/);if(r){r=r[0],s=-1!=r.indexOf("i"),l=-1!=r.indexOf("u");var o=-1!=r.indexOf("d")&&1,i=-1!=r.indexOf("x")&&1,u=-1!=r.indexOf("o")&&1;if(o+i+u>1)return"Invalid arguments";c=o&&"decimal"||i&&"hex"||u&&"octal"}t.eatSpace()&&t.match(/\/.*\//)}}function i(e,t){if(a){var r;r=e,e=t,t=r}s&&(e=e.toLowerCase(),t=t.toLowerCase());var n=c&&g.exec(e),o=c&&g.exec(t);return n?(n=parseInt((n[1]+n[2]).toLowerCase(),v),o=parseInt((o[1]+o[2]).toLowerCase(),v),n-o):t>e?-1:1}var a,s,l,c,u=o();if(u)return void Ot(t,u+": "+n.argString);var h=n.line||t.firstLine(),p=n.lineEnd||n.line||t.lastLine();if(h!=p){var d=r(h,0),f=r(p,q(t,p)),m=t.getRange(d,f).split("\n"),g="decimal"==c?/(-?)([\d]+)/:"hex"==c?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==c?/([0-7]+)/:null,v="decimal"==c?10:"hex"==c?16:"octal"==c?8:null,y=[],k=[];if(c)for(var C=0;C=p;p++){var d=c.test(e.getLine(p));d&&(u.push(p+1),h+=e.getLine(p)+"
")}if(!n)return void Ot(e,h);var f=0,m=function(){if(f=u)return void Ot(t,"Invalid argument: "+r.argString.substring(i));for(var h=0;u-c>=h;h++){var d=String.fromCharCode(c+h);delete n.marks[d]}}else delete n.marks[a]}}},Ir=new Er;return e.keyMap.vim={attach:a,detach:i,call:s},y("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(t){var r=e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent;r(t)},fallthrough:["default"],attach:a,detach:i,call:s},e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:a,detach:i,call:s},M(),wr};e.Vim=n()}); \ No newline at end of file diff --git a/media/editors/codemirror/lib/addons-uncompressed.js b/media/editors/codemirror/lib/addons-uncompressed.js deleted file mode 100644 index d0874e1fb1561..0000000000000 --- a/media/editors/codemirror/lib/addons-uncompressed.js +++ /dev/null @@ -1,6549 +0,0 @@ -/** - * addon/display/fullscreen.js - * addon/display/panel.js - * addon/edit/closebrackets.js - * addon/edit/closetag.js - * addon/edit/matchbrackets.js - * addon/edit/matchtags.js - * addon/fold/brace-fold.js - * addon/fold/foldcode.js - * addon/fold/foldgutter.js - * addon/fold/xml-fold.js - * addon/mode/loadmode.js - * addon/mode/multiplex.js - * addon/scroll/simplescrollbars.js - * addon/selection/active-line.js - * keymap/vim.js -**/ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("fullScreen", false, function(cm, val, old) { - if (old == CodeMirror.Init) old = false; - if (!old == !val) return; - if (val) setFullscreen(cm); - else setNormal(cm); - }); - - function setFullscreen(cm) { - var wrap = cm.getWrapperElement(); - cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, - width: wrap.style.width, height: wrap.style.height}; - wrap.style.width = ""; - wrap.style.height = "auto"; - wrap.className += " CodeMirror-fullscreen"; - document.documentElement.style.overflow = "hidden"; - cm.refresh(); - } - - function setNormal(cm) { - var wrap = cm.getWrapperElement(); - wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, ""); - document.documentElement.style.overflow = ""; - var info = cm.state.fullScreenRestore; - wrap.style.width = info.width; wrap.style.height = info.height; - window.scrollTo(info.scrollLeft, info.scrollTop); - cm.refresh(); - } -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - CodeMirror.defineExtension("addPanel", function(node, options) { - if (!this.state.panels) initPanels(this); - - var info = this.state.panels; - if (options && options.position == "bottom") - info.wrapper.appendChild(node); - else - info.wrapper.insertBefore(node, info.wrapper.firstChild); - var height = (options && options.height) || node.offsetHeight; - this._setSize(null, info.heightLeft -= height); - info.panels++; - return new Panel(this, node, options, height); - }); - - function Panel(cm, node, options, height) { - this.cm = cm; - this.node = node; - this.options = options; - this.height = height; - this.cleared = false; - } - - Panel.prototype.clear = function() { - if (this.cleared) return; - this.cleared = true; - var info = this.cm.state.panels; - this.cm._setSize(null, info.heightLeft += this.height); - info.wrapper.removeChild(this.node); - if (--info.panels == 0) removePanels(this.cm); - }; - - Panel.prototype.changed = function(height) { - var newHeight = height == null ? this.node.offsetHeight : height; - var info = this.cm.state.panels; - this.cm._setSize(null, info.height += (newHeight - this.height)); - this.height = newHeight; - }; - - function initPanels(cm) { - var wrap = cm.getWrapperElement(); - var style = window.getComputedStyle ? window.getComputedStyle(wrap) : wrap.currentStyle; - var height = parseInt(style.height); - var info = cm.state.panels = { - setHeight: wrap.style.height, - heightLeft: height, - panels: 0, - wrapper: document.createElement("div") - }; - wrap.parentNode.insertBefore(info.wrapper, wrap); - var hasFocus = cm.hasFocus(); - info.wrapper.appendChild(wrap); - if (hasFocus) cm.focus(); - - cm._setSize = cm.setSize; - if (height != null) cm.setSize = function(width, newHeight) { - if (newHeight == null) return this._setSize(width, newHeight); - info.setHeight = newHeight; - if (typeof newHeight != "number") { - var px = /^(\d+\.?\d*)px$/.exec(newHeight); - if (px) { - newHeight = Number(px[1]); - } else { - info.wrapper.style.height = newHeight; - newHeight = info.wrapper.offsetHeight; - info.wrapper.style.height = ""; - } - } - cm._setSize(width, info.heightLeft += (newHeight - height)); - height = newHeight; - }; - } - - function removePanels(cm) { - var info = cm.state.panels; - cm.state.panels = null; - - var wrap = cm.getWrapperElement(); - info.wrapper.parentNode.replaceChild(wrap, info.wrapper); - wrap.style.height = info.setHeight; - cm.setSize = cm._setSize; - cm.setSize(); - } -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - var DEFAULT_BRACKETS = "()[]{}''\"\""; - var DEFAULT_EXPLODE_ON_ENTER = "[]{}"; - var SPACE_CHAR_REGEX = /\s/; - - var Pos = CodeMirror.Pos; - - CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) { - if (old != CodeMirror.Init && old) - cm.removeKeyMap("autoCloseBrackets"); - if (!val) return; - var pairs = DEFAULT_BRACKETS, explode = DEFAULT_EXPLODE_ON_ENTER; - if (typeof val == "string") pairs = val; - else if (typeof val == "object") { - if (val.pairs != null) pairs = val.pairs; - if (val.explode != null) explode = val.explode; - } - var map = buildKeymap(pairs); - if (explode) map.Enter = buildExplodeHandler(explode); - cm.addKeyMap(map); - }); - - function charsAround(cm, pos) { - var str = cm.getRange(Pos(pos.line, pos.ch - 1), - Pos(pos.line, pos.ch + 1)); - return str.length == 2 ? str : null; - } - - // Project the token type that will exists after the given char is - // typed, and use it to determine whether it would cause the start - // of a string token. - function enteringString(cm, pos, ch) { - var line = cm.getLine(pos.line); - var token = cm.getTokenAt(pos); - if (/\bstring2?\b/.test(token.type)) return false; - var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4); - stream.pos = stream.start = token.start; - for (;;) { - var type1 = cm.getMode().token(stream, token.state); - if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1); - stream.start = stream.pos; - } - } - - function buildKeymap(pairs) { - var map = { - name : "autoCloseBrackets", - Backspace: function(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var around = charsAround(cm, ranges[i].head); - if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; - } - for (var i = ranges.length - 1; i >= 0; i--) { - var cur = ranges[i].head; - cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); - } - } - }; - var closingBrackets = ""; - for (var i = 0; i < pairs.length; i += 2) (function(left, right) { - closingBrackets += right; - map["'" + left + "'"] = function(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(), type, next; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i], cur = range.head, curType; - var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); - if (!range.empty()) { - curType = "surround"; - } else if (left == right && next == right) { - if (cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == left + left + left) - curType = "skipThree"; - else - curType = "skip"; - } else if (left == right && cur.ch > 1 && - cm.getRange(Pos(cur.line, cur.ch - 2), cur) == left + left && - (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != left)) { - curType = "addFour"; - } else if (left == '"' || left == "'") { - if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, left)) curType = "both"; - else return CodeMirror.Pass; - } else if (cm.getLine(cur.line).length == cur.ch || closingBrackets.indexOf(next) >= 0 || SPACE_CHAR_REGEX.test(next)) { - curType = "both"; - } else { - return CodeMirror.Pass; - } - if (!type) type = curType; - else if (type != curType) return CodeMirror.Pass; - } - - cm.operation(function() { - if (type == "skip") { - cm.execCommand("goCharRight"); - } else if (type == "skipThree") { - for (var i = 0; i < 3; i++) - cm.execCommand("goCharRight"); - } else if (type == "surround") { - var sels = cm.getSelections(); - for (var i = 0; i < sels.length; i++) - sels[i] = left + sels[i] + right; - cm.replaceSelections(sels, "around"); - } else if (type == "both") { - cm.replaceSelection(left + right, null); - cm.execCommand("goCharLeft"); - } else if (type == "addFour") { - cm.replaceSelection(left + left + left + left, "before"); - cm.execCommand("goCharRight"); - } - }); - }; - if (left != right) map["'" + right + "'"] = function(cm) { - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty() || - cm.getRange(range.head, Pos(range.head.line, range.head.ch + 1)) != right) - return CodeMirror.Pass; - } - cm.execCommand("goCharRight"); - }; - })(pairs.charAt(i), pairs.charAt(i + 1)); - return map; - } - - function buildExplodeHandler(pairs) { - return function(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var around = charsAround(cm, ranges[i].head); - if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; - } - cm.operation(function() { - cm.replaceSelection("\n\n", null); - cm.execCommand("goCharLeft"); - ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var line = ranges[i].head.line; - cm.indentLine(line, null, true); - cm.indentLine(line + 1, null, true); - } - }); - }; - } -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Tag-closer extension for CodeMirror. - * - * This extension adds an "autoCloseTags" option that can be set to - * either true to get the default behavior, or an object to further - * configure its behavior. - * - * These are supported options: - * - * `whenClosing` (default true) - * Whether to autoclose when the '/' of a closing tag is typed. - * `whenOpening` (default true) - * Whether to autoclose the tag when the final '>' of an opening - * tag is typed. - * `dontCloseTags` (default is empty tags for HTML, none for XML) - * An array of tag names that should not be autoclosed. - * `indentTags` (default is block tags for HTML, none for XML) - * An array of tag names that should, when opened, cause a - * blank line to be added inside the tag, and the blank line and - * closing line to be indented. - * - * See demos/closetag.html for a usage example. - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../fold/xml-fold")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../fold/xml-fold"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) { - if (old != CodeMirror.Init && old) - cm.removeKeyMap("autoCloseTags"); - if (!val) return; - var map = {name: "autoCloseTags"}; - if (typeof val != "object" || val.whenClosing) - map["'/'"] = function(cm) { return autoCloseSlash(cm); }; - if (typeof val != "object" || val.whenOpening) - map["'>'"] = function(cm) { return autoCloseGT(cm); }; - cm.addKeyMap(map); - }); - - var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", - "source", "track", "wbr"]; - var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4", - "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"]; - - function autoCloseGT(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(), replacements = []; - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) return CodeMirror.Pass; - var pos = ranges[i].head, tok = cm.getTokenAt(pos); - var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; - if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass; - - var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html"; - var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose); - var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent); - - var tagName = state.tagName; - if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch); - var lowerTagName = tagName.toLowerCase(); - // Don't process the '>' at the end of an end-tag or self-closing tag - if (!tagName || - tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) || - tok.type == "tag" && state.type == "closeTag" || - tok.string.indexOf("/") == (tok.string.length - 1) || // match something like - dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 || - closingTagExists(cm, tagName, pos, state, true)) - return CodeMirror.Pass; - - var indent = indentTags && indexOf(indentTags, lowerTagName) > -1; - replacements[i] = {indent: indent, - text: ">" + (indent ? "\n\n" : "") + "", - newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)}; - } - - for (var i = ranges.length - 1; i >= 0; i--) { - var info = replacements[i]; - cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert"); - var sel = cm.listSelections().slice(0); - sel[i] = {head: info.newPos, anchor: info.newPos}; - cm.setSelections(sel); - if (info.indent) { - cm.indentLine(info.newPos.line, null, true); - cm.indentLine(info.newPos.line + 1, null, true); - } - } - } - - function autoCloseCurrent(cm, typingSlash) { - var ranges = cm.listSelections(), replacements = []; - var head = typingSlash ? "/" : ""; - else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css") - replacements[i] = head + "style>"; - else - return CodeMirror.Pass; - } else { - if (!state.context || !state.context.tagName || - closingTagExists(cm, state.context.tagName, pos, state)) - return CodeMirror.Pass; - replacements[i] = head + state.context.tagName + ">"; - } - } - cm.replaceSelections(replacements); - ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) - if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line) - cm.indentLine(ranges[i].head.line); - } - - function autoCloseSlash(cm) { - if (cm.getOption("disableInput")) return CodeMirror.Pass; - autoCloseCurrent(cm, true); - } - - CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); }; - - function indexOf(collection, elt) { - if (collection.indexOf) return collection.indexOf(elt); - for (var i = 0, e = collection.length; i < e; ++i) - if (collection[i] == elt) return i; - return -1; - } - - // If xml-fold is loaded, we use its functionality to try and verify - // whether a given tag is actually unclosed. - function closingTagExists(cm, tagName, pos, state, newTag) { - if (!CodeMirror.scanForClosingTag) return false; - var end = Math.min(cm.lastLine() + 1, pos.line + 500); - var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end); - if (!nextClose || nextClose.tag != tagName) return false; - var cx = state.context; - // If the immediate wrapping context contains onCx instances of - // the same tag, a closing tag only exists if there are at least - // that many closing tags of that type following. - for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx; - pos = nextClose.to; - for (var i = 1; i < onCx; i++) { - var next = CodeMirror.scanForClosingTag(cm, pos, null, end); - if (!next || next.tag != tagName) return false; - pos = next.to; - } - return true; - } -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - var ie_lt8 = /MSIE \d/.test(navigator.userAgent) && - (document.documentMode == null || document.documentMode < 8); - - var Pos = CodeMirror.Pos; - - var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; - - function findMatchingBracket(cm, where, strict, config) { - var line = cm.getLineHandle(where.line), pos = where.ch - 1; - var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; - if (!match) return null; - var dir = match.charAt(1) == ">" ? 1 : -1; - if (strict && (dir > 0) != (pos == where.ch)) return null; - var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); - - var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config); - if (found == null) return null; - return {from: Pos(where.line, pos), to: found && found.pos, - match: found && found.ch == match.charAt(0), forward: dir > 0}; - } - - // bracketRegex is used to specify which type of bracket to scan - // should be a regexp, e.g. /[[\]]/ - // - // Note: If "where" is on an open bracket, then this bracket is ignored. - // - // Returns false when no bracket was found, null when it reached - // maxScanLines and gave up - function scanForBracket(cm, where, dir, style, config) { - var maxScanLen = (config && config.maxScanLineLength) || 10000; - var maxScanLines = (config && config.maxScanLines) || 1000; - - var stack = []; - var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/; - var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) - : Math.max(cm.firstLine() - 1, where.line - maxScanLines); - for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) { - var line = cm.getLine(lineNo); - if (!line) continue; - var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1; - if (line.length > maxScanLen) continue; - if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); - for (; pos != end; pos += dir) { - var ch = line.charAt(pos); - if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) { - var match = matching[ch]; - if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch); - else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch}; - else stack.pop(); - } - } - } - return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null; - } - - function matchBrackets(cm, autoclear, config) { - // Disable brace matching in long lines, since it'll cause hugely slow updates - var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000; - var marks = [], ranges = cm.listSelections(); - for (var i = 0; i < ranges.length; i++) { - var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config); - if (match && cm.getLine(match.from.line).length <= maxHighlightLen) { - var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; - marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style})); - if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) - marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style})); - } - } - - if (marks.length) { - // Kludge to work around the IE bug from issue #1193, where text - // input stops going to the textare whever this fires. - if (ie_lt8 && cm.state.focused) cm.display.input.focus(); - - var clear = function() { - cm.operation(function() { - for (var i = 0; i < marks.length; i++) marks[i].clear(); - }); - }; - if (autoclear) setTimeout(clear, 800); - else return clear; - } - } - - var currentlyHighlighted = null; - function doMatchBrackets(cm) { - cm.operation(function() { - if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} - currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); - }); - } - - CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) - cm.off("cursorActivity", doMatchBrackets); - if (val) { - cm.state.matchBrackets = typeof val == "object" ? val : {}; - cm.on("cursorActivity", doMatchBrackets); - } - }); - - CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);}); - CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){ - return findMatchingBracket(this, pos, strict, config); - }); - CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){ - return scanForBracket(this, pos, dir, style, config); - }); -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../fold/xml-fold")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../fold/xml-fold"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("matchTags", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.off("cursorActivity", doMatchTags); - cm.off("viewportChange", maybeUpdateMatch); - clear(cm); - } - if (val) { - cm.state.matchBothTags = typeof val == "object" && val.bothTags; - cm.on("cursorActivity", doMatchTags); - cm.on("viewportChange", maybeUpdateMatch); - doMatchTags(cm); - } - }); - - function clear(cm) { - if (cm.state.tagHit) cm.state.tagHit.clear(); - if (cm.state.tagOther) cm.state.tagOther.clear(); - cm.state.tagHit = cm.state.tagOther = null; - } - - function doMatchTags(cm) { - cm.state.failedTagMatch = false; - cm.operation(function() { - clear(cm); - if (cm.somethingSelected()) return; - var cur = cm.getCursor(), range = cm.getViewport(); - range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to); - var match = CodeMirror.findMatchingTag(cm, cur, range); - if (!match) return; - if (cm.state.matchBothTags) { - var hit = match.at == "open" ? match.open : match.close; - if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"}); - } - var other = match.at == "close" ? match.open : match.close; - if (other) - cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"}); - else - cm.state.failedTagMatch = true; - }); - } - - function maybeUpdateMatch(cm) { - if (cm.state.failedTagMatch) doMatchTags(cm); - } - - CodeMirror.commands.toMatchingTag = function(cm) { - var found = CodeMirror.findMatchingTag(cm, cm.getCursor()); - if (found) { - var other = found.at == "close" ? found.open : found.close; - if (other) cm.extendSelection(other.to, other.from); - } - }; -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.registerHelper("fold", "brace", function(cm, start) { - var line = start.line, lineText = cm.getLine(line); - var startCh, tokenType; - - function findOpening(openCh) { - for (var at = start.ch, pass = 0;;) { - var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1); - if (found == -1) { - if (pass == 1) break; - pass = 1; - at = lineText.length; - continue; - } - if (pass == 1 && found < start.ch) break; - tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)); - if (!/^(comment|string)/.test(tokenType)) return found + 1; - at = found - 1; - } - } - - var startToken = "{", endToken = "}", startCh = findOpening("{"); - if (startCh == null) { - startToken = "[", endToken = "]"; - startCh = findOpening("["); - } - - if (startCh == null) return; - var count = 1, lastLine = cm.lastLine(), end, endCh; - outer: for (var i = line; i <= lastLine; ++i) { - var text = cm.getLine(i), pos = i == line ? startCh : 0; - for (;;) { - var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); - if (nextOpen < 0) nextOpen = text.length; - if (nextClose < 0) nextClose = text.length; - pos = Math.min(nextOpen, nextClose); - if (pos == text.length) break; - if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) { - if (pos == nextOpen) ++count; - else if (!--count) { end = i; endCh = pos; break outer; } - } - ++pos; - } - } - if (end == null || line == end && endCh == startCh) return; - return {from: CodeMirror.Pos(line, startCh), - to: CodeMirror.Pos(end, endCh)}; -}); - -CodeMirror.registerHelper("fold", "import", function(cm, start) { - function hasImport(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); - if (start.type != "keyword" || start.string != "import") return null; - // Now find closing semicolon, return its position - for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) { - var text = cm.getLine(i), semi = text.indexOf(";"); - if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)}; - } - } - - var start = start.line, has = hasImport(start), prev; - if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1)) - return null; - for (var end = has.end;;) { - var next = hasImport(end.line + 1); - if (next == null) break; - end = next.end; - } - return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end}; -}); - -CodeMirror.registerHelper("fold", "include", function(cm, start) { - function hasInclude(line) { - if (line < cm.firstLine() || line > cm.lastLine()) return null; - var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); - if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); - if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8; - } - - var start = start.line, has = hasInclude(start); - if (has == null || hasInclude(start - 1) != null) return null; - for (var end = start;;) { - var next = hasInclude(end + 1); - if (next == null) break; - ++end; - } - return {from: CodeMirror.Pos(start, has + 1), - to: cm.clipPos(CodeMirror.Pos(end))}; -}); - -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function doFold(cm, pos, options, force) { - if (options && options.call) { - var finder = options; - options = null; - } else { - var finder = getOption(cm, options, "rangeFinder"); - } - if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); - var minSize = getOption(cm, options, "minFoldSize"); - - function getRange(allowFolded) { - var range = finder(cm, pos); - if (!range || range.to.line - range.from.line < minSize) return null; - var marks = cm.findMarksAt(range.from); - for (var i = 0; i < marks.length; ++i) { - if (marks[i].__isFold && force !== "fold") { - if (!allowFolded) return null; - range.cleared = true; - marks[i].clear(); - } - } - return range; - } - - var range = getRange(true); - if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) { - pos = CodeMirror.Pos(pos.line - 1, 0); - range = getRange(false); - } - if (!range || range.cleared || force === "unfold") return; - - var myWidget = makeWidget(cm, options); - CodeMirror.on(myWidget, "mousedown", function(e) { - myRange.clear(); - CodeMirror.e_preventDefault(e); - }); - var myRange = cm.markText(range.from, range.to, { - replacedWith: myWidget, - clearOnEnter: true, - __isFold: true - }); - myRange.on("clear", function(from, to) { - CodeMirror.signal(cm, "unfold", cm, from, to); - }); - CodeMirror.signal(cm, "fold", cm, range.from, range.to); - } - - function makeWidget(cm, options) { - var widget = getOption(cm, options, "widget"); - if (typeof widget == "string") { - var text = document.createTextNode(widget); - widget = document.createElement("span"); - widget.appendChild(text); - widget.className = "CodeMirror-foldmarker"; - } - return widget; - } - - // Clumsy backwards-compatible interface - CodeMirror.newFoldFunction = function(rangeFinder, widget) { - return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); }; - }; - - // New-style interface - CodeMirror.defineExtension("foldCode", function(pos, options, force) { - doFold(this, pos, options, force); - }); - - CodeMirror.defineExtension("isFolded", function(pos) { - var marks = this.findMarksAt(pos); - for (var i = 0; i < marks.length; ++i) - if (marks[i].__isFold) return true; - }); - - CodeMirror.commands.toggleFold = function(cm) { - cm.foldCode(cm.getCursor()); - }; - CodeMirror.commands.fold = function(cm) { - cm.foldCode(cm.getCursor(), null, "fold"); - }; - CodeMirror.commands.unfold = function(cm) { - cm.foldCode(cm.getCursor(), null, "unfold"); - }; - CodeMirror.commands.foldAll = function(cm) { - cm.operation(function() { - for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) - cm.foldCode(CodeMirror.Pos(i, 0), null, "fold"); - }); - }; - CodeMirror.commands.unfoldAll = function(cm) { - cm.operation(function() { - for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) - cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold"); - }); - }; - - CodeMirror.registerHelper("fold", "combine", function() { - var funcs = Array.prototype.slice.call(arguments, 0); - return function(cm, start) { - for (var i = 0; i < funcs.length; ++i) { - var found = funcs[i](cm, start); - if (found) return found; - } - }; - }); - - CodeMirror.registerHelper("fold", "auto", function(cm, start) { - var helpers = cm.getHelpers(start, "fold"); - for (var i = 0; i < helpers.length; i++) { - var cur = helpers[i](cm, start); - if (cur) return cur; - } - }); - - var defaultOptions = { - rangeFinder: CodeMirror.fold.auto, - widget: "\u2194", - minFoldSize: 0, - scanUp: false - }; - - CodeMirror.defineOption("foldOptions", null); - - function getOption(cm, options, name) { - if (options && options[name] !== undefined) - return options[name]; - var editorOptions = cm.options.foldOptions; - if (editorOptions && editorOptions[name] !== undefined) - return editorOptions[name]; - return defaultOptions[name]; - } - - CodeMirror.defineExtension("foldOption", function(options, name) { - return getOption(this, options, name); - }); -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("./foldcode")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "./foldcode"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - CodeMirror.defineOption("foldGutter", false, function(cm, val, old) { - if (old && old != CodeMirror.Init) { - cm.clearGutter(cm.state.foldGutter.options.gutter); - cm.state.foldGutter = null; - cm.off("gutterClick", onGutterClick); - cm.off("change", onChange); - cm.off("viewportChange", onViewportChange); - cm.off("fold", onFold); - cm.off("unfold", onFold); - cm.off("swapDoc", updateInViewport); - } - if (val) { - cm.state.foldGutter = new State(parseOptions(val)); - updateInViewport(cm); - cm.on("gutterClick", onGutterClick); - cm.on("change", onChange); - cm.on("viewportChange", onViewportChange); - cm.on("fold", onFold); - cm.on("unfold", onFold); - cm.on("swapDoc", updateInViewport); - } - }); - - var Pos = CodeMirror.Pos; - - function State(options) { - this.options = options; - this.from = this.to = 0; - } - - function parseOptions(opts) { - if (opts === true) opts = {}; - if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter"; - if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open"; - if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded"; - return opts; - } - - function isFolded(cm, line) { - var marks = cm.findMarksAt(Pos(line)); - for (var i = 0; i < marks.length; ++i) - if (marks[i].__isFold && marks[i].find().from.line == line) return true; - } - - function marker(spec) { - if (typeof spec == "string") { - var elt = document.createElement("div"); - elt.className = spec + " CodeMirror-guttermarker-subtle"; - return elt; - } else { - return spec.cloneNode(true); - } - } - - function updateFoldInfo(cm, from, to) { - var opts = cm.state.foldGutter.options, cur = from; - var minSize = cm.foldOption(opts, "minFoldSize"); - var func = cm.foldOption(opts, "rangeFinder"); - cm.eachLine(from, to, function(line) { - var mark = null; - if (isFolded(cm, cur)) { - mark = marker(opts.indicatorFolded); - } else { - var pos = Pos(cur, 0); - var range = func && func(cm, pos); - if (range && range.to.line - range.from.line >= minSize) - mark = marker(opts.indicatorOpen); - } - cm.setGutterMarker(line, opts.gutter, mark); - ++cur; - }); - } - - function updateInViewport(cm) { - var vp = cm.getViewport(), state = cm.state.foldGutter; - if (!state) return; - cm.operation(function() { - updateFoldInfo(cm, vp.from, vp.to); - }); - state.from = vp.from; state.to = vp.to; - } - - function onGutterClick(cm, line, gutter) { - var opts = cm.state.foldGutter.options; - if (gutter != opts.gutter) return; - cm.foldCode(Pos(line, 0), opts.rangeFinder); - } - - function onChange(cm) { - var state = cm.state.foldGutter, opts = cm.state.foldGutter.options; - state.from = state.to = 0; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600); - } - - function onViewportChange(cm) { - var state = cm.state.foldGutter, opts = cm.state.foldGutter.options; - clearTimeout(state.changeUpdate); - state.changeUpdate = setTimeout(function() { - var vp = cm.getViewport(); - if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { - updateInViewport(cm); - } else { - cm.operation(function() { - if (vp.from < state.from) { - updateFoldInfo(cm, vp.from, state.from); - state.from = vp.from; - } - if (vp.to > state.to) { - updateFoldInfo(cm, state.to, vp.to); - state.to = vp.to; - } - }); - } - }, opts.updateViewportTimeSpan || 400); - } - - function onFold(cm, from) { - var state = cm.state.foldGutter, line = from.line; - if (line >= state.from && line < state.to) - updateFoldInfo(cm, line, line + 1); - } -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - var Pos = CodeMirror.Pos; - function cmp(a, b) { return a.line - b.line || a.ch - b.ch; } - - var nameStartChar = "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"; - var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g"); - - function Iter(cm, line, ch, range) { - this.line = line; this.ch = ch; - this.cm = cm; this.text = cm.getLine(line); - this.min = range ? range.from : cm.firstLine(); - this.max = range ? range.to - 1 : cm.lastLine(); - } - - function tagAt(iter, ch) { - var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch)); - return type && /\btag\b/.test(type); - } - - function nextLine(iter) { - if (iter.line >= iter.max) return; - iter.ch = 0; - iter.text = iter.cm.getLine(++iter.line); - return true; - } - function prevLine(iter) { - if (iter.line <= iter.min) return; - iter.text = iter.cm.getLine(--iter.line); - iter.ch = iter.text.length; - return true; - } - - function toTagEnd(iter) { - for (;;) { - var gt = iter.text.indexOf(">", iter.ch); - if (gt == -1) { if (nextLine(iter)) continue; else return; } - if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; } - var lastSlash = iter.text.lastIndexOf("/", gt); - var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt)); - iter.ch = gt + 1; - return selfClose ? "selfClose" : "regular"; - } - } - function toTagStart(iter) { - for (;;) { - var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1; - if (lt == -1) { if (prevLine(iter)) continue; else return; } - if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; } - xmlTagStart.lastIndex = lt; - iter.ch = lt; - var match = xmlTagStart.exec(iter.text); - if (match && match.index == lt) return match; - } - } - - function toNextTag(iter) { - for (;;) { - xmlTagStart.lastIndex = iter.ch; - var found = xmlTagStart.exec(iter.text); - if (!found) { if (nextLine(iter)) continue; else return; } - if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; } - iter.ch = found.index + found[0].length; - return found; - } - } - function toPrevTag(iter) { - for (;;) { - var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1; - if (gt == -1) { if (prevLine(iter)) continue; else return; } - if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; } - var lastSlash = iter.text.lastIndexOf("/", gt); - var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt)); - iter.ch = gt + 1; - return selfClose ? "selfClose" : "regular"; - } - } - - function findMatchingClose(iter, tag) { - var stack = []; - for (;;) { - var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0); - if (!next || !(end = toTagEnd(iter))) return; - if (end == "selfClose") continue; - if (next[1]) { // closing tag - for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) { - stack.length = i; - break; - } - if (i < 0 && (!tag || tag == next[2])) return { - tag: next[2], - from: Pos(startLine, startCh), - to: Pos(iter.line, iter.ch) - }; - } else { // opening tag - stack.push(next[2]); - } - } - } - function findMatchingOpen(iter, tag) { - var stack = []; - for (;;) { - var prev = toPrevTag(iter); - if (!prev) return; - if (prev == "selfClose") { toTagStart(iter); continue; } - var endLine = iter.line, endCh = iter.ch; - var start = toTagStart(iter); - if (!start) return; - if (start[1]) { // closing tag - stack.push(start[2]); - } else { // opening tag - for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) { - stack.length = i; - break; - } - if (i < 0 && (!tag || tag == start[2])) return { - tag: start[2], - from: Pos(iter.line, iter.ch), - to: Pos(endLine, endCh) - }; - } - } - } - - CodeMirror.registerHelper("fold", "xml", function(cm, start) { - var iter = new Iter(cm, start.line, 0); - for (;;) { - var openTag = toNextTag(iter), end; - if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return; - if (!openTag[1] && end != "selfClose") { - var start = Pos(iter.line, iter.ch); - var close = findMatchingClose(iter, openTag[2]); - return close && {from: start, to: close.from}; - } - } - }); - CodeMirror.findMatchingTag = function(cm, pos, range) { - var iter = new Iter(cm, pos.line, pos.ch, range); - if (iter.text.indexOf(">") == -1 && iter.text.indexOf("<") == -1) return; - var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch); - var start = end && toTagStart(iter); - if (!end || !start || cmp(iter, pos) > 0) return; - var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]}; - if (end == "selfClose") return {open: here, close: null, at: "open"}; - - if (start[1]) { // closing tag - return {open: findMatchingOpen(iter, start[2]), close: here, at: "close"}; - } else { // opening tag - iter = new Iter(cm, to.line, to.ch, range); - return {open: here, close: findMatchingClose(iter, start[2]), at: "open"}; - } - }; - - CodeMirror.findEnclosingTag = function(cm, pos, range) { - var iter = new Iter(cm, pos.line, pos.ch, range); - for (;;) { - var open = findMatchingOpen(iter); - if (!open) break; - var forward = new Iter(cm, pos.line, pos.ch, range); - var close = findMatchingClose(forward, open.tag); - if (close) return {open: open, close: close}; - } - }; - - // Used by addon/edit/closetag.js - CodeMirror.scanForClosingTag = function(cm, pos, name, end) { - var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null); - return findMatchingClose(iter, name); - }; -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), "cjs"); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], function(CM) { mod(CM, "amd"); }); - else // Plain browser env - mod(CodeMirror, "plain"); -})(function(CodeMirror, env) { - if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; - - var loading = {}; - function splitCallback(cont, n) { - var countDown = n; - return function() { if (--countDown == 0) cont(); }; - } - function ensureDeps(mode, cont) { - var deps = CodeMirror.modes[mode].dependencies; - if (!deps) return cont(); - var missing = []; - for (var i = 0; i < deps.length; ++i) { - if (!CodeMirror.modes.hasOwnProperty(deps[i])) - missing.push(deps[i]); - } - if (!missing.length) return cont(); - var split = splitCallback(cont, missing.length); - for (var i = 0; i < missing.length; ++i) - CodeMirror.requireMode(missing[i], split); - } - - CodeMirror.requireMode = function(mode, cont) { - if (typeof mode != "string") mode = mode.name; - if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); - if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); - - var file = CodeMirror.modeURL.replace(/%N/g, mode); - if (env == "plain") { - var script = document.createElement("script"); - script.src = file; - var others = document.getElementsByTagName("script")[0]; - var list = loading[mode] = [cont]; - CodeMirror.on(script, "load", function() { - ensureDeps(mode, function() { - for (var i = 0; i < list.length; ++i) list[i](); - }); - }); - others.parentNode.insertBefore(script, others); - } else if (env == "cjs") { - require(file); - cont(); - } else if (env == "amd") { - requirejs([file], cont); - } - }; - - CodeMirror.autoLoadMode = function(instance, mode) { - if (!CodeMirror.modes.hasOwnProperty(mode)) - CodeMirror.requireMode(mode, function() { - instance.setOption("mode", instance.getOption("mode")); - }); - }; -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.multiplexingMode = function(outer /*, others */) { - // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects - var others = Array.prototype.slice.call(arguments, 1); - var n_others = others.length; - - function indexOf(string, pattern, from) { - if (typeof pattern == "string") return string.indexOf(pattern, from); - var m = pattern.exec(from ? string.slice(from) : string); - return m ? m.index + from : -1; - } - - return { - startState: function() { - return { - outer: CodeMirror.startState(outer), - innerActive: null, - inner: null - }; - }, - - copyState: function(state) { - return { - outer: CodeMirror.copyState(outer, state.outer), - innerActive: state.innerActive, - inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner) - }; - }, - - token: function(stream, state) { - if (!state.innerActive) { - var cutOff = Infinity, oldContent = stream.string; - for (var i = 0; i < n_others; ++i) { - var other = others[i]; - var found = indexOf(oldContent, other.open, stream.pos); - if (found == stream.pos) { - stream.match(other.open); - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); - return other.delimStyle; - } else if (found != -1 && found < cutOff) { - cutOff = found; - } - } - if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff); - var outerToken = outer.token(stream, state.outer); - if (cutOff != Infinity) stream.string = oldContent; - return outerToken; - } else { - var curInner = state.innerActive, oldContent = stream.string; - if (!curInner.close && stream.sol()) { - state.innerActive = state.inner = null; - return this.token(stream, state); - } - var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos) : -1; - if (found == stream.pos) { - stream.match(curInner.close); - state.innerActive = state.inner = null; - return curInner.delimStyle; - } - if (found > -1) stream.string = oldContent.slice(0, found); - var innerToken = curInner.mode.token(stream, state.inner); - if (found > -1) stream.string = oldContent; - - if (curInner.innerStyle) { - if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle; - else innerToken = curInner.innerStyle; - } - - return innerToken; - } - }, - - indent: function(state, textAfter) { - var mode = state.innerActive ? state.innerActive.mode : outer; - if (!mode.indent) return CodeMirror.Pass; - return mode.indent(state.innerActive ? state.inner : state.outer, textAfter); - }, - - blankLine: function(state) { - var mode = state.innerActive ? state.innerActive.mode : outer; - if (mode.blankLine) { - mode.blankLine(state.innerActive ? state.inner : state.outer); - } - if (!state.innerActive) { - for (var i = 0; i < n_others; ++i) { - var other = others[i]; - if (other.open === "\n") { - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0); - } - } - } else if (state.innerActive.close === "\n") { - state.innerActive = state.inner = null; - } - }, - - electricChars: outer.electricChars, - - innerMode: function(state) { - return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer}; - } - }; -}; - -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - - function Bar(cls, orientation, scroll) { - this.orientation = orientation; - this.scroll = scroll; - this.screen = this.total = this.size = 1; - this.pos = 0; - - this.node = document.createElement("div"); - this.node.className = cls + "-" + orientation; - this.inner = this.node.appendChild(document.createElement("div")); - - var self = this; - CodeMirror.on(this.inner, "mousedown", function(e) { - if (e.which != 1) return; - CodeMirror.e_preventDefault(e); - var axis = self.orientation == "horizontal" ? "pageX" : "pageY"; - var start = e[axis], startpos = self.pos; - function done() { - CodeMirror.off(document, "mousemove", move); - CodeMirror.off(document, "mouseup", done); - } - function move(e) { - if (e.which != 1) return done(); - self.moveTo(startpos + (e[axis] - start) * (self.total / self.size)); - } - CodeMirror.on(document, "mousemove", move); - CodeMirror.on(document, "mouseup", done); - }); - - CodeMirror.on(this.node, "click", function(e) { - CodeMirror.e_preventDefault(e); - var innerBox = self.inner.getBoundingClientRect(), where; - if (self.orientation == "horizontal") - where = e.clientX < innerBox.left ? -1 : e.clientX > innerBox.right ? 1 : 0; - else - where = e.clientY < innerBox.top ? -1 : e.clientY > innerBox.bottom ? 1 : 0; - self.moveTo(self.pos + where * self.screen); - }); - - function onWheel(e) { - var moved = CodeMirror.wheelEventPixels(e)[self.orientation == "horizontal" ? "x" : "y"]; - var oldPos = self.pos; - self.moveTo(self.pos + moved); - if (self.pos != oldPos) CodeMirror.e_preventDefault(e); - } - CodeMirror.on(this.node, "mousewheel", onWheel); - CodeMirror.on(this.node, "DOMMouseScroll", onWheel); - } - - Bar.prototype.moveTo = function(pos, update) { - if (pos < 0) pos = 0; - if (pos > this.total - this.screen) pos = this.total - this.screen; - if (pos == this.pos) return; - this.pos = pos; - this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = - (pos * (this.size / this.total)) + "px"; - if (update !== false) this.scroll(pos, this.orientation); - }; - - Bar.prototype.update = function(scrollSize, clientSize, barSize) { - this.screen = clientSize; - this.total = scrollSize; - this.size = barSize; - - // FIXME clip to min size? - this.inner.style[this.orientation == "horizontal" ? "width" : "height"] = - this.screen * (this.size / this.total) + "px"; - this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = - this.pos * (this.size / this.total) + "px"; - }; - - function SimpleScrollbars(cls, place, scroll) { - this.addClass = cls; - this.horiz = new Bar(cls, "horizontal", scroll); - place(this.horiz.node); - this.vert = new Bar(cls, "vertical", scroll); - place(this.vert.node); - this.width = null; - } - - SimpleScrollbars.prototype.update = function(measure) { - if (this.width == null) { - var style = window.getComputedStyle ? window.getComputedStyle(this.horiz.node) : this.horiz.node.currentStyle; - if (style) this.width = parseInt(style.height); - } - var width = this.width || 0; - - var needsH = measure.scrollWidth > measure.clientWidth + 1; - var needsV = measure.scrollHeight > measure.clientHeight + 1; - this.vert.node.style.display = needsV ? "block" : "none"; - this.horiz.node.style.display = needsH ? "block" : "none"; - - if (needsV) { - this.vert.update(measure.scrollHeight, measure.clientHeight, - measure.viewHeight - (needsH ? width : 0)); - this.vert.node.style.display = "block"; - this.vert.node.style.bottom = needsH ? width + "px" : "0"; - } - if (needsH) { - this.horiz.update(measure.scrollWidth, measure.clientWidth, - measure.viewWidth - (needsV ? width : 0) - measure.barLeft); - this.horiz.node.style.right = needsV ? width + "px" : "0"; - this.horiz.node.style.left = measure.barLeft + "px"; - } - - return {right: needsV ? width : 0, bottom: needsH ? width : 0}; - }; - - SimpleScrollbars.prototype.setScrollTop = function(pos) { - this.vert.moveTo(pos, false); - }; - - SimpleScrollbars.prototype.setScrollLeft = function(pos) { - this.horiz.moveTo(pos, false); - }; - - SimpleScrollbars.prototype.clear = function() { - var parent = this.horiz.node.parentNode; - parent.removeChild(this.horiz.node); - parent.removeChild(this.vert.node); - }; - - CodeMirror.scrollbarModel.simple = function(place, scroll) { - return new SimpleScrollbars("CodeMirror-simplescroll", place, scroll); - }; - CodeMirror.scrollbarModel.overlay = function(place, scroll) { - return new SimpleScrollbars("CodeMirror-overlayscroll", place, scroll); - }; -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// Because sometimes you need to style the cursor's line. -// -// Adds an option 'styleActiveLine' which, when enabled, gives the -// active line's wrapping
the CSS class "CodeMirror-activeline", -// and gives its background
the class "CodeMirror-activeline-background". - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - "use strict"; - var WRAP_CLASS = "CodeMirror-activeline"; - var BACK_CLASS = "CodeMirror-activeline-background"; - - CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { - var prev = old && old != CodeMirror.Init; - if (val && !prev) { - cm.state.activeLines = []; - updateActiveLines(cm, cm.listSelections()); - cm.on("beforeSelectionChange", selectionChange); - } else if (!val && prev) { - cm.off("beforeSelectionChange", selectionChange); - clearActiveLines(cm); - delete cm.state.activeLines; - } - }); - - function clearActiveLines(cm) { - for (var i = 0; i < cm.state.activeLines.length; i++) { - cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS); - cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS); - } - } - - function sameArray(a, b) { - if (a.length != b.length) return false; - for (var i = 0; i < a.length; i++) - if (a[i] != b[i]) return false; - return true; - } - - function updateActiveLines(cm, ranges) { - var active = []; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty()) continue; - var line = cm.getLineHandleVisualStart(range.head.line); - if (active[active.length - 1] != line) active.push(line); - } - if (sameArray(cm.state.activeLines, active)) return; - cm.operation(function() { - clearActiveLines(cm); - for (var i = 0; i < active.length; i++) { - cm.addLineClass(active[i], "wrap", WRAP_CLASS); - cm.addLineClass(active[i], "background", BACK_CLASS); - } - cm.state.activeLines = active; - }); - } - - function selectionChange(cm, sel) { - updateActiveLines(cm, sel.ranges); - } -}); -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Supported keybindings: - * - * Motion: - * h, j, k, l - * gj, gk - * e, E, w, W, b, B, ge, gE - * f, F, t, T - * $, ^, 0, -, +, _ - * gg, G - * % - * ', ` - * - * Operator: - * d, y, c - * dd, yy, cc - * g~, g~g~ - * >, <, >>, << - * - * Operator-Motion: - * x, X, D, Y, C, ~ - * - * Action: - * a, i, s, A, I, S, o, O - * zz, z., z, zt, zb, z- - * J - * u, Ctrl-r - * m - * r - * - * Modes: - * ESC - leave insert mode, visual mode, and clear input state. - * Ctrl-[, Ctrl-c - same as ESC. - * - * Registers: unnamed, -, a-z, A-Z, 0-9 - * (Does not respect the special case for number registers when delete - * operator is made with these commands: %, (, ), , /, ?, n, N, {, } ) - * TODO: Implement the remaining registers. - * Marks: a-z, A-Z, and 0-9 - * TODO: Implement the remaining special marks. They have more complex - * behavior. - * - * Events: - * 'vim-mode-change' - raised on the editor anytime the current mode changes, - * Event object: {mode: "visual", subMode: "linewise"} - * - * Code structure: - * 1. Default keymap - * 2. Variable declarations and short basic helpers - * 3. Instance (External API) implementation - * 4. Internal state tracking objects (input state, counter) implementation - * and instanstiation - * 5. Key handler (the main command dispatcher) implementation - * 6. Motion, operator, and action implementations - * 7. Helper functions for the key handler, motions, operators, and actions - * 8. Set up Vim to work as a keymap for CodeMirror. - */ - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/dialog/dialog"), require("../addon/edit/matchbrackets.js")); - else if (typeof define == "function" && define.amd) // AMD - define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/dialog/dialog", "../addon/edit/matchbrackets"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { - 'use strict'; - - var defaultKeymap = [ - // Key to key mapping. This goes first to make it possible to override - // existing mappings. - { 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: 'xi', context: 'visual'}, - { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' }, - { keys: 'S', type: 'keyToKey', toKeys: 'dcc', 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' }, - // Motions - { keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'M', type: 'motion', motion: 'moveToMiddleLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'L', type: 'motion', motion: 'moveToBottomLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'h', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: false }}, - { keys: 'l', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: true }}, - { keys: 'j', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, linewise: true }}, - { keys: 'k', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, linewise: true }}, - { keys: 'gj', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: true }}, - { keys: 'gk', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: false }}, - { keys: 'w', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false }}, - { keys: 'W', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false, bigWord: true }}, - { keys: 'e', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, inclusive: true }}, - { keys: 'E', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, bigWord: true, inclusive: true }}, - { keys: 'b', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }}, - { keys: 'B', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false, bigWord: true }}, - { keys: 'ge', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, inclusive: true }}, - { 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: 'moveByPage', motionArgs: { forward: true }}, - { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false }}, - { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true }}, - { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true }}, - { keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }}, - { keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }}, - { keys: '0', type: 'motion', motion: 'moveToStartOfLine' }, - { keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true }}, - { keys: '-', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, toFirstChar:true }}, - { keys: '_', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true, repeatOffset:-1 }}, - { keys: '$', type: 'motion', motion: 'moveToEol', motionArgs: { inclusive: true }}, - { keys: '%', type: 'motion', motion: 'moveToMatchedSymbol', motionArgs: { inclusive: true, toJumplist: true }}, - { keys: 'f', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: true , inclusive: true }}, - { keys: 'F', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: false }}, - { keys: 't', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: true, inclusive: true }}, - { keys: 'T', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: false }}, - { keys: ';', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: true }}, - { keys: ',', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: false }}, - { keys: '\'', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true, linewise: true}}, - { keys: '`', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true}}, - { keys: ']`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } }, - { keys: '[`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } }, - { keys: ']\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } }, - { keys: '[\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } }, - // the next two aren't motions but must come before more general motion declarations - { keys: ']p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true, matchIndent: true}}, - { keys: '[p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true, matchIndent: true}}, - { keys: ']', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: true, toJumplist: true}}, - { keys: '[', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: false, toJumplist: true}}, - { keys: '|', type: 'motion', motion: 'moveToColumn'}, - { keys: 'o', type: 'motion', motion: 'moveToOtherHighlightedEnd', context:'visual'}, - { keys: 'O', type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: {sameLine: true}, context:'visual'}, - // Operators - { 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: true }}, - { keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false }}, - { keys: 'g~', type: 'operator', operator: 'changeCase' }, - { keys: 'gu', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, isEdit: true }, - { keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, isEdit: true }, - { keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true }}, - { keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true }}, - // Operator-Motion dual commands - { keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false }}, - { keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true }}, - { keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'}, - { keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'}, - { keys: '', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' }, - // Actions - { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }}, - { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }}, - { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true }}, - { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: false, linewise: true }}, - { keys: 'a', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'charAfter' }, context: 'normal' }, - { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' }, - { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' }, - { keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' }, - { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank'}, context: 'normal' }, - { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' }, - { keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' }, - { keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' }, - { keys: 'v', type: 'action', action: 'toggleVisualMode' }, - { keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true }}, - { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }}, - { keys: 'gv', type: 'action', action: 'reselectLastSelection' }, - { keys: 'J', type: 'action', action: 'joinLines', isEdit: true }, - { keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true }}, - { keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true }}, - { keys: 'r', type: 'action', action: 'replace', isEdit: true }, - { keys: '@', type: 'action', action: 'replayMacro' }, - { keys: 'q', type: 'action', action: 'enterMacroRecordMode' }, - // Handle Replace-mode as a special case of insert mode. - { keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }}, - { keys: 'u', type: 'action', action: 'undo', context: 'normal' }, - { keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, context: 'visual', isEdit: true }, - { keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, context: 'visual', isEdit: true }, - { 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: true, actionArgs: {increase: true, backtrack: false}}, - { keys: '', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: false, backtrack: false}}, - // Text object motions - { keys: 'a', type: 'motion', motion: 'textObjectManipulation' }, - { keys: 'i', type: 'motion', motion: 'textObjectManipulation', motionArgs: { textObjectInner: true }}, - // Search - { keys: '/', type: 'search', searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true }}, - { keys: '?', type: 'search', searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true }}, - { keys: '*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, - { keys: '#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, - { keys: 'g*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }}, - { keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }}, - // Ex command - { keys: ':', type: 'ex' } - ]; - - var Pos = CodeMirror.Pos; - - var Vim = function() { - function enterVimMode(cm) { - cm.setOption('disableInput', true); - cm.setOption('showCursorWhenSelecting', false); - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - cm.on('cursorActivity', onCursorActivity); - maybeInitVimState(cm); - CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm)); - } - - function leaveVimMode(cm) { - cm.setOption('disableInput', false); - cm.off('cursorActivity', onCursorActivity); - CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm)); - cm.state.vim = null; - } - - function detachVimMap(cm, next) { - if (this == CodeMirror.keyMap.vim) - CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor"); - - if (!next || next.attach != attachVimMap) - leaveVimMode(cm, false); - } - function attachVimMap(cm, prev) { - if (this == CodeMirror.keyMap.vim) - CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor"); - - if (!prev || prev.attach != attachVimMap) - enterVimMode(cm); - } - - // Deprecated, simply setting the keymap works again. - CodeMirror.defineOption('vimMode', false, function(cm, val, prev) { - if (val && cm.getOption("keyMap") != "vim") - cm.setOption("keyMap", "vim"); - else if (!val && prev != CodeMirror.Init && /^vim/.test(cm.getOption("keyMap"))) - cm.setOption("keyMap", "default"); - }); - - function cmKey(key, cm) { - if (!cm) { return undefined; } - var vimKey = cmKeyToVimKey(key); - if (!vimKey) { - return false; - } - var cmd = CodeMirror.Vim.findKey(cm, vimKey); - if (typeof cmd == 'function') { - CodeMirror.signal(cm, 'vim-keypress', vimKey); - } - return cmd; - } - - var modifiers = {'Shift': 'S', 'Ctrl': 'C', 'Alt': 'A', 'Cmd': 'D', 'Mod': 'A'}; - var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del'}; - function cmKeyToVimKey(key) { - if (key.charAt(0) == '\'') { - // Keypress character binding of format "'a'" - return key.charAt(1); - } - var pieces = key.split('-'); - if (/-$/.test(key)) { - // If the - key was typed, split will result in 2 extra empty strings - // in the array. Replace them with 1 '-'. - pieces.splice(-2, 2, '-'); - } - var lastPiece = pieces[pieces.length - 1]; - if (pieces.length == 1 && pieces[0].length == 1) { - // No-modifier bindings use literal character bindings above. Skip. - return false; - } else if (pieces.length == 2 && pieces[0] == 'Shift' && lastPiece.length == 1) { - // Ignore Shift+char bindings as they should be handled by literal character. - return false; - } - var hasCharacter = false; - for (var i = 0; i < pieces.length; i++) { - var piece = pieces[i]; - if (piece in modifiers) { pieces[i] = modifiers[piece]; } - else { hasCharacter = true; } - if (piece in specialKeys) { pieces[i] = specialKeys[piece]; } - } - if (!hasCharacter) { - // Vim does not support modifier only keys. - return false; - } - // TODO: Current bindings expect the character to be lower case, but - // it looks like vim key notation uses upper case. - if (isUpperCase(lastPiece)) { - pieces[pieces.length - 1] = lastPiece.toLowerCase(); - } - return '<' + pieces.join('-') + '>'; - } - - function getOnPasteFn(cm) { - var vim = cm.state.vim; - if (!vim.onPasteFn) { - vim.onPasteFn = function() { - if (!vim.insertMode) { - cm.setCursor(offsetCursor(cm.getCursor(), 0, 1)); - actions.enterInsertMode(cm, {}, vim); - } - }; - } - return vim.onPasteFn; - } - - var numberRegex = /[\d]/; - var wordRegexp = [(/\w/), (/[^\w\s]/)], bigWordRegexp = [(/\S/)]; - function makeKeyRange(start, size) { - var keys = []; - for (var i = start; i < start + size; i++) { - keys.push(String.fromCharCode(i)); - } - return keys; - } - var upperCaseAlphabet = makeKeyRange(65, 26); - var lowerCaseAlphabet = makeKeyRange(97, 26); - var numbers = makeKeyRange(48, 10); - var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']); - var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '/']); - - function isLine(cm, line) { - return line >= cm.firstLine() && line <= cm.lastLine(); - } - function isLowerCase(k) { - return (/^[a-z]$/).test(k); - } - function isMatchableSymbol(k) { - return '()[]{}'.indexOf(k) != -1; - } - function isNumber(k) { - return numberRegex.test(k); - } - function isUpperCase(k) { - return (/^[A-Z]$/).test(k); - } - function isWhiteSpaceString(k) { - return (/^\s*$/).test(k); - } - function inArray(val, arr) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] == val) { - return true; - } - } - return false; - } - - var options = {}; - function defineOption(name, defaultValue, type) { - if (defaultValue === undefined) { throw Error('defaultValue is required'); } - if (!type) { type = 'string'; } - options[name] = { - type: type, - defaultValue: defaultValue - }; - setOption(name, defaultValue); - } - - function setOption(name, value) { - var option = options[name]; - if (!option) { - throw Error('Unknown option: ' + name); - } - if (option.type == 'boolean') { - if (value && value !== true) { - throw Error('Invalid argument: ' + name + '=' + value); - } else if (value !== false) { - // Boolean options are set to true if value is not defined. - value = true; - } - } - option.value = option.type == 'boolean' ? !!value : value; - } - - function getOption(name) { - var option = options[name]; - if (!option) { - throw Error('Unknown option: ' + name); - } - return option.value; - } - - var createCircularJumpList = function() { - var size = 100; - var pointer = -1; - var head = 0; - var tail = 0; - var buffer = new Array(size); - function add(cm, oldCur, newCur) { - var current = pointer % size; - var curMark = buffer[current]; - function useNextSlot(cursor) { - var next = ++pointer % size; - var trashMark = buffer[next]; - if (trashMark) { - trashMark.clear(); - } - buffer[next] = cm.setBookmark(cursor); - } - if (curMark) { - var markPos = curMark.find(); - // avoid recording redundant cursor position - if (markPos && !cursorEqual(markPos, oldCur)) { - useNextSlot(oldCur); - } - } else { - useNextSlot(oldCur); - } - useNextSlot(newCur); - head = pointer; - tail = pointer - size + 1; - if (tail < 0) { - tail = 0; - } - } - function move(cm, offset) { - pointer += offset; - if (pointer > head) { - pointer = head; - } else if (pointer < tail) { - pointer = tail; - } - var mark = buffer[(size + pointer) % size]; - // skip marks that are temporarily removed from text buffer - if (mark && !mark.find()) { - var inc = offset > 0 ? 1 : -1; - var newCur; - var oldCur = cm.getCursor(); - do { - pointer += inc; - mark = buffer[(size + pointer) % size]; - // skip marks that are the same as current position - if (mark && - (newCur = mark.find()) && - !cursorEqual(oldCur, newCur)) { - break; - } - } while (pointer < head && pointer > tail); - } - return mark; - } - return { - cachedCursor: undefined, //used for # and * jumps - add: add, - move: move - }; - }; - - // Returns an object to track the changes associated insert mode. It - // clones the object that is passed in, or creates an empty object one if - // none is provided. - var createInsertModeChanges = function(c) { - if (c) { - // Copy construction - return { - changes: c.changes, - expectCursorActivityForChange: c.expectCursorActivityForChange - }; - } - return { - // Change list - changes: [], - // Set to true on change, false on cursorActivity. - expectCursorActivityForChange: false - }; - }; - - function MacroModeState() { - this.latestRegister = undefined; - this.isPlaying = false; - this.isRecording = false; - this.replaySearchQueries = []; - this.onRecordingDone = undefined; - this.lastInsertModeChanges = createInsertModeChanges(); - } - MacroModeState.prototype = { - exitMacroRecordMode: function() { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.onRecordingDone) { - macroModeState.onRecordingDone(); // close dialog - } - macroModeState.onRecordingDone = undefined; - macroModeState.isRecording = false; - }, - enterMacroRecordMode: function(cm, registerName) { - var register = - vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.clear(); - this.latestRegister = registerName; - if (cm.openDialog) { - this.onRecordingDone = cm.openDialog( - '(recording)['+registerName+']', null, {bottom:true}); - } - this.isRecording = true; - } - } - }; - - function maybeInitVimState(cm) { - if (!cm.state.vim) { - // Store instance state in the CodeMirror object. - cm.state.vim = { - inputState: new InputState(), - // Vim's input state that triggered the last edit, used to repeat - // motions and operators with '.'. - lastEditInputState: undefined, - // Vim's action command before the last edit, used to repeat actions - // with '.' and insert mode repeat. - lastEditActionCommand: undefined, - // When using jk for navigation, if you move from a longer line to a - // shorter line, the cursor may clip to the end of the shorter line. - // If j is pressed again and cursor goes to the next line, the - // cursor should go back to its horizontal position on the longer - // line if it can. This is to keep track of the horizontal position. - lastHPos: -1, - // Doing the same with screen-position for gj/gk - lastHSPos: -1, - // The last motion command run. Cleared if a non-motion command gets - // executed in between. - lastMotion: null, - marks: {}, - // Mark for rendering fake cursor for visual mode. - fakeCursor: null, - insertMode: false, - // Repeat count for changes made in insert mode, triggered by key - // sequences like 3,i. Only exists when insertMode is true. - insertModeRepeat: undefined, - visualMode: false, - // If we are in visual line mode. No effect if visualMode is false. - visualLine: false, - visualBlock: false, - lastSelection: null, - lastPastedText: null, - sel: { - } - }; - } - return cm.state.vim; - } - var vimGlobalState; - function resetVimGlobalState() { - vimGlobalState = { - // The current search query. - searchQuery: null, - // Whether we are searching backwards. - searchIsReversed: false, - // Replace part of the last substituted pattern - lastSubstituteReplacePart: undefined, - jumpList: createCircularJumpList(), - macroModeState: new MacroModeState, - // Recording latest f, t, F or T motion command. - lastChararacterSearch: {increment:0, forward:true, selectedCharacter:''}, - registerController: new RegisterController({}), - // search history buffer - searchHistoryController: new HistoryController({}), - // ex Command history buffer - exCommandHistoryController : new HistoryController({}) - }; - for (var optionName in options) { - var option = options[optionName]; - option.value = option.defaultValue; - } - } - - var lastInsertModeKeyTimer; - var vimApi= { - buildKeyMap: function() { - // TODO: Convert keymap into dictionary format for fast lookup. - }, - // Testing hook, though it might be useful to expose the register - // controller anyways. - getRegisterController: function() { - return vimGlobalState.registerController; - }, - // Testing hook. - resetVimGlobalState_: resetVimGlobalState, - - // Testing hook. - getVimGlobalState_: function() { - return vimGlobalState; - }, - - // Testing hook. - maybeInitVimState_: maybeInitVimState, - - suppressErrorLogging: false, - - InsertModeKey: InsertModeKey, - map: function(lhs, rhs, ctx) { - // Add user defined key bindings. - exCommandDispatcher.map(lhs, rhs, ctx); - }, - setOption: setOption, - getOption: getOption, - defineOption: defineOption, - defineEx: function(name, prefix, func){ - if (name.indexOf(prefix) !== 0) { - throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered'); - } - exCommands[name]=func; - exCommandDispatcher.commandMap_[prefix]={name:name, shortName:prefix, type:'api'}; - }, - handleKey: function (cm, key, origin) { - var command = this.findKey(cm, key, origin); - if (typeof command === 'function') { - return command(); - } - }, - /** - * This is the outermost function called by CodeMirror, after keys have - * been mapped to their Vim equivalents. - * - * Finds a command based on the key (and cached keys if there is a - * multi-key sequence). Returns `undefined` if no key is matched, a noop - * function if a partial match is found (multi-key), and a function to - * execute the bound command if a a key is matched. The function always - * returns true. - */ - findKey: function(cm, key, origin) { - var vim = maybeInitVimState(cm); - function handleMacroRecording() { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isRecording) { - if (key == 'q') { - macroModeState.exitMacroRecordMode(); - clearInputState(cm); - return true; - } - if (origin != 'mapping') { - logKey(macroModeState, key); - } - } - } - function handleEsc() { - if (key == '') { - // Clear input state and get back to normal mode. - clearInputState(cm); - if (vim.visualMode) { - exitVisualMode(cm); - } else if (vim.insertMode) { - exitInsertMode(cm); - } - return true; - } - } - function doKeyToKey(keys) { - // TODO: prevent infinite recursion. - var match; - while (keys) { - // Pull off one command key, which is either a single character - // or a special sequence wrapped in '<' and '>', e.g. ''. - match = (/<\w+-.+?>|<\w+>|./).exec(keys); - key = match[0]; - keys = keys.substring(match.index + key.length); - CodeMirror.Vim.handleKey(cm, key, 'mapping'); - } - } - - function handleKeyInsertMode() { - if (handleEsc()) { return true; } - var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; - var keysAreChars = key.length == 1; - var match = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); - // Need to check all key substrings in insert mode. - while (keys.length > 1 && match.type != 'full') { - var keys = vim.inputState.keyBuffer = keys.slice(1); - var thisMatch = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); - if (thisMatch.type != 'none') { match = thisMatch; } - } - if (match.type == 'none') { clearInputState(cm); return false; } - else if (match.type == 'partial') { - if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } - lastInsertModeKeyTimer = window.setTimeout( - function() { if (vim.insertMode && vim.inputState.keyBuffer) { clearInputState(cm); } }, - getOption('insertModeEscKeysTimeout')); - return !keysAreChars; - } - - if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } - if (keysAreChars) { - var here = cm.getCursor(); - cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input'); - } - clearInputState(cm); - return match.command; - } - - function handleKeyNonInsertMode() { - if (handleMacroRecording() || handleEsc()) { return true; }; - - var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; - if (/^[1-9]\d*$/.test(keys)) { return true; } - - var keysMatcher = /^(\d*)(.*)$/.exec(keys); - if (!keysMatcher) { clearInputState(cm); return false; } - var context = vim.visualMode ? 'visual' : - 'normal'; - var match = commandDispatcher.matchCommand(keysMatcher[2] || keysMatcher[1], defaultKeymap, vim.inputState, context); - if (match.type == 'none') { clearInputState(cm); return false; } - else if (match.type == 'partial') { return true; } - - vim.inputState.keyBuffer = ''; - var keysMatcher = /^(\d*)(.*)$/.exec(keys); - if (keysMatcher[1] && keysMatcher[1] != '0') { - vim.inputState.pushRepeatDigit(keysMatcher[1]); - } - return match.command; - } - - var command; - if (vim.insertMode) { command = handleKeyInsertMode(); } - else { command = handleKeyNonInsertMode(); } - if (command === false) { - return 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 - // don't want act on it just yet. - return function() {}; - } else { - return function() { - return cm.operation(function() { - cm.curOp.isVimOp = true; - try { - if (command.type == 'keyToKey') { - doKeyToKey(command.toKeys); - } else { - commandDispatcher.processCommand(cm, vim, command); - } - } catch (e) { - // clear VIM state in case it's in a bad state. - cm.state.vim = undefined; - maybeInitVimState(cm); - if (!CodeMirror.Vim.suppressErrorLogging) { - console['log'](e); - } - throw e; - } - return true; - }); - }; - } - }, - handleEx: function(cm, input) { - exCommandDispatcher.processCommand(cm, input); - } - }; - - // Represents the current input state. - function InputState() { - this.prefixRepeat = []; - this.motionRepeat = []; - - this.operator = null; - this.operatorArgs = null; - this.motion = null; - this.motionArgs = null; - this.keyBuffer = []; // For matching multi-key commands. - this.registerName = null; // Defaults to the unnamed register. - } - InputState.prototype.pushRepeatDigit = function(n) { - if (!this.operator) { - this.prefixRepeat = this.prefixRepeat.concat(n); - } else { - this.motionRepeat = this.motionRepeat.concat(n); - } - }; - InputState.prototype.getRepeat = function() { - var repeat = 0; - if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) { - repeat = 1; - if (this.prefixRepeat.length > 0) { - repeat *= parseInt(this.prefixRepeat.join(''), 10); - } - if (this.motionRepeat.length > 0) { - repeat *= parseInt(this.motionRepeat.join(''), 10); - } - } - return repeat; - }; - - function clearInputState(cm, reason) { - cm.state.vim.inputState = new InputState(); - CodeMirror.signal(cm, 'vim-command-done', reason); - } - - /* - * Register stores information about copy and paste registers. Besides - * text, a register must store whether it is linewise (i.e., when it is - * pasted, should it insert itself into a new line, or should the text be - * inserted at the cursor position.) - */ - function Register(text, linewise, blockwise) { - this.clear(); - this.keyBuffer = [text || '']; - this.insertModeChanges = []; - this.searchQueries = []; - this.linewise = !!linewise; - this.blockwise = !!blockwise; - } - Register.prototype = { - setText: function(text, linewise, blockwise) { - this.keyBuffer = [text || '']; - this.linewise = !!linewise; - this.blockwise = !!blockwise; - }, - pushText: function(text, linewise) { - // if this register has ever been set to linewise, use linewise. - if (linewise) { - if (!this.linewise) { - this.keyBuffer.push('\n'); - } - this.linewise = true; - } - this.keyBuffer.push(text); - }, - pushInsertModeChanges: function(changes) { - this.insertModeChanges.push(createInsertModeChanges(changes)); - }, - pushSearchQuery: function(query) { - this.searchQueries.push(query); - }, - clear: function() { - this.keyBuffer = []; - this.insertModeChanges = []; - this.searchQueries = []; - this.linewise = false; - }, - toString: function() { - return this.keyBuffer.join(''); - } - }; - - /* - * vim registers allow you to keep many independent copy and paste buffers. - * See http://usevim.com/2012/04/13/registers/ for an introduction. - * - * RegisterController keeps the state of all the registers. An initial - * state may be passed in. The unnamed register '"' will always be - * overridden. - */ - function RegisterController(registers) { - this.registers = registers; - this.unnamedRegister = registers['"'] = new Register(); - registers['.'] = new Register(); - registers[':'] = new Register(); - registers['/'] = new Register(); - } - RegisterController.prototype = { - pushText: function(registerName, operator, text, linewise, blockwise) { - if (linewise && text.charAt(0) == '\n') { - text = text.slice(1) + '\n'; - } - if (linewise && text.charAt(text.length - 1) !== '\n'){ - text += '\n'; - } - // Lowercase and uppercase registers refer to the same register. - // Uppercase just means append. - var register = this.isValidRegister(registerName) ? - this.getRegister(registerName) : null; - // if no register/an invalid register was specified, things go to the - // default registers - if (!register) { - switch (operator) { - case 'yank': - // The 0 register contains the text from the most recent yank. - this.registers['0'] = new Register(text, linewise, blockwise); - break; - case 'delete': - case 'change': - if (text.indexOf('\n') == -1) { - // Delete less than 1 line. Update the small delete register. - this.registers['-'] = new Register(text, linewise); - } else { - // Shift down the contents of the numbered registers and put the - // deleted text into register 1. - this.shiftNumericRegisters_(); - this.registers['1'] = new Register(text, linewise); - } - break; - } - // Make sure the unnamed register is set to what just happened - this.unnamedRegister.setText(text, linewise, blockwise); - return; - } - - // If we've gotten to this point, we've actually specified a register - var append = isUpperCase(registerName); - if (append) { - register.pushText(text, linewise); - } else { - register.setText(text, linewise, blockwise); - } - // The unnamed register always has the same value as the last used - // register. - this.unnamedRegister.setText(register.toString(), linewise); - }, - // Gets the register named @name. If one of @name doesn't already exist, - // create it. If @name is invalid, return the unnamedRegister. - getRegister: function(name) { - if (!this.isValidRegister(name)) { - return this.unnamedRegister; - } - name = name.toLowerCase(); - if (!this.registers[name]) { - this.registers[name] = new Register(); - } - return this.registers[name]; - }, - isValidRegister: function(name) { - return name && inArray(name, validRegisters); - }, - shiftNumericRegisters_: function() { - for (var i = 9; i >= 2; i--) { - this.registers[i] = this.getRegister('' + (i - 1)); - } - } - }; - function HistoryController() { - this.historyBuffer = []; - this.iterator; - this.initialPrefix = null; - } - HistoryController.prototype = { - // the input argument here acts a user entered prefix for a small time - // until we start autocompletion in which case it is the autocompleted. - nextMatch: function (input, up) { - var historyBuffer = this.historyBuffer; - var dir = up ? -1 : 1; - if (this.initialPrefix === null) this.initialPrefix = input; - for (var i = this.iterator + dir; up ? i >= 0 : i < historyBuffer.length; i+= dir) { - var element = historyBuffer[i]; - for (var j = 0; j <= element.length; j++) { - if (this.initialPrefix == element.substring(0, j)) { - this.iterator = i; - return element; - } - } - } - // should return the user input in case we reach the end of buffer. - if (i >= historyBuffer.length) { - this.iterator = historyBuffer.length; - return this.initialPrefix; - } - // return the last autocompleted query or exCommand as it is. - if (i < 0 ) return input; - }, - pushInput: function(input) { - var index = this.historyBuffer.indexOf(input); - if (index > -1) this.historyBuffer.splice(index, 1); - if (input.length) this.historyBuffer.push(input); - }, - reset: function() { - this.initialPrefix = null; - this.iterator = this.historyBuffer.length; - } - }; - var commandDispatcher = { - matchCommand: function(keys, keyMap, inputState, context) { - var matches = commandMatches(keys, keyMap, context, inputState); - if (!matches.full && !matches.partial) { - return {type: 'none'}; - } else if (!matches.full && matches.partial) { - return {type: 'partial'}; - } - - var bestMatch; - for (var i = 0; i < matches.full.length; i++) { - var match = matches.full[i]; - if (!bestMatch) { - bestMatch = match; - } - } - if (bestMatch.keys.slice(-11) == '') { - inputState.selectedCharacter = lastChar(keys); - } - return {type: 'full', command: bestMatch}; - }, - processCommand: function(cm, vim, command) { - vim.inputState.repeatOverride = command.repeatOverride; - switch (command.type) { - case 'motion': - this.processMotion(cm, vim, command); - break; - case 'operator': - this.processOperator(cm, vim, command); - break; - case 'operatorMotion': - this.processOperatorMotion(cm, vim, command); - break; - case 'action': - this.processAction(cm, vim, command); - break; - case 'search': - this.processSearch(cm, vim, command); - clearInputState(cm); - break; - case 'ex': - case 'keyToEx': - this.processEx(cm, vim, command); - clearInputState(cm); - break; - default: - break; - } - }, - processMotion: function(cm, vim, command) { - vim.inputState.motion = command.motion; - vim.inputState.motionArgs = copyArgs(command.motionArgs); - this.evalInput(cm, vim); - }, - processOperator: function(cm, vim, command) { - var inputState = vim.inputState; - if (inputState.operator) { - if (inputState.operator == command.operator) { - // Typing an operator twice like 'dd' makes the operator operate - // linewise - inputState.motion = 'expandToLine'; - inputState.motionArgs = { linewise: true }; - this.evalInput(cm, vim); - return; - } else { - // 2 different operators in a row doesn't make sense. - clearInputState(cm); - } - } - inputState.operator = command.operator; - inputState.operatorArgs = copyArgs(command.operatorArgs); - if (vim.visualMode) { - // Operating on a selection in visual mode. We don't need a motion. - this.evalInput(cm, vim); - } - }, - processOperatorMotion: function(cm, vim, command) { - var visualMode = vim.visualMode; - var operatorMotionArgs = copyArgs(command.operatorMotionArgs); - if (operatorMotionArgs) { - // Operator motions may have special behavior in visual mode. - if (visualMode && operatorMotionArgs.visualLine) { - vim.visualLine = true; - } - } - this.processOperator(cm, vim, command); - if (!visualMode) { - this.processMotion(cm, vim, command); - } - }, - processAction: function(cm, vim, command) { - var inputState = vim.inputState; - var repeat = inputState.getRepeat(); - var repeatIsExplicit = !!repeat; - var actionArgs = copyArgs(command.actionArgs) || {}; - if (inputState.selectedCharacter) { - actionArgs.selectedCharacter = inputState.selectedCharacter; - } - // Actions may or may not have motions and operators. Do these first. - if (command.operator) { - this.processOperator(cm, vim, command); - } - if (command.motion) { - this.processMotion(cm, vim, command); - } - if (command.motion || command.operator) { - this.evalInput(cm, vim); - } - actionArgs.repeat = repeat || 1; - actionArgs.repeatIsExplicit = repeatIsExplicit; - actionArgs.registerName = inputState.registerName; - clearInputState(cm); - vim.lastMotion = null; - if (command.isEdit) { - this.recordLastEdit(vim, inputState, command); - } - actions[command.action](cm, actionArgs, vim); - }, - processSearch: function(cm, vim, command) { - if (!cm.getSearchCursor) { - // Search depends on SearchCursor. - return; - } - var forward = command.searchArgs.forward; - var wholeWordOnly = command.searchArgs.wholeWordOnly; - getSearchState(cm).setReversed(!forward); - var promptPrefix = (forward) ? '/' : '?'; - var originalQuery = getSearchState(cm).getQuery(); - var originalScrollPos = cm.getScrollInfo(); - function handleQuery(query, ignoreCase, smartCase) { - vimGlobalState.searchHistoryController.pushInput(query); - vimGlobalState.searchHistoryController.reset(); - try { - updateSearchQuery(cm, query, ignoreCase, smartCase); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + query); - return; - } - commandDispatcher.processMotion(cm, vim, { - type: 'motion', - motion: 'findNext', - motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist } - }); - } - function onPromptClose(query) { - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - handleQuery(query, true /** ignoreCase */, true /** smartCase */); - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isRecording) { - logSearchQuery(macroModeState, query); - } - } - function onPromptKeyUp(e, query, close) { - var keyName = CodeMirror.keyName(e), up; - if (keyName == 'Up' || keyName == 'Down') { - up = keyName == 'Up' ? true : false; - query = vimGlobalState.searchHistoryController.nextMatch(query, up) || ''; - close(query); - } else { - if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') - vimGlobalState.searchHistoryController.reset(); - } - var parsedQuery; - try { - parsedQuery = updateSearchQuery(cm, query, - true /** ignoreCase */, true /** smartCase */); - } catch (e) { - // Swallow bad regexes for incremental search. - } - if (parsedQuery) { - cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30); - } else { - clearSearchHighlight(cm); - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - } - } - function onPromptKeyDown(e, query, close) { - var keyName = CodeMirror.keyName(e); - if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { - vimGlobalState.searchHistoryController.pushInput(query); - vimGlobalState.searchHistoryController.reset(); - updateSearchQuery(cm, originalQuery); - clearSearchHighlight(cm); - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - CodeMirror.e_stop(e); - close(); - cm.focus(); - } - } - switch (command.searchArgs.querySrc) { - case 'prompt': - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { - var query = macroModeState.replaySearchQueries.shift(); - handleQuery(query, true /** ignoreCase */, false /** smartCase */); - } else { - showPrompt(cm, { - onClose: onPromptClose, - prefix: promptPrefix, - desc: searchPromptDesc, - onKeyUp: onPromptKeyUp, - onKeyDown: onPromptKeyDown - }); - } - break; - case 'wordUnderCursor': - var word = expandWordUnderCursor(cm, false /** inclusive */, - true /** forward */, false /** bigWord */, - true /** noSymbol */); - var isKeyword = true; - if (!word) { - word = expandWordUnderCursor(cm, false /** inclusive */, - true /** forward */, false /** bigWord */, - false /** noSymbol */); - isKeyword = false; - } - if (!word) { - return; - } - var query = cm.getLine(word.start.line).substring(word.start.ch, - word.end.ch); - if (isKeyword && wholeWordOnly) { - query = '\\b' + query + '\\b'; - } else { - query = escapeRegex(query); - } - - // cachedCursor is used to save the old position of the cursor - // when * or # causes vim to seek for the nearest word and shift - // the cursor before entering the motion. - vimGlobalState.jumpList.cachedCursor = cm.getCursor(); - cm.setCursor(word.start); - - handleQuery(query, true /** ignoreCase */, false /** smartCase */); - break; - } - }, - processEx: function(cm, vim, command) { - function onPromptClose(input) { - // Give the prompt some time to close so that if processCommand shows - // an error, the elements don't overlap. - vimGlobalState.exCommandHistoryController.pushInput(input); - vimGlobalState.exCommandHistoryController.reset(); - exCommandDispatcher.processCommand(cm, input); - } - function onPromptKeyDown(e, input, close) { - var keyName = CodeMirror.keyName(e), up; - if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { - vimGlobalState.exCommandHistoryController.pushInput(input); - vimGlobalState.exCommandHistoryController.reset(); - CodeMirror.e_stop(e); - close(); - cm.focus(); - } - if (keyName == 'Up' || keyName == 'Down') { - up = keyName == 'Up' ? true : false; - input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || ''; - close(input); - } else { - if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') - vimGlobalState.exCommandHistoryController.reset(); - } - } - if (command.type == 'keyToEx') { - // Handle user defined Ex to Ex mappings - exCommandDispatcher.processCommand(cm, command.exArgs.input); - } else { - if (vim.visualMode) { - showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>', - onKeyDown: onPromptKeyDown}); - } else { - showPrompt(cm, { onClose: onPromptClose, prefix: ':', - onKeyDown: onPromptKeyDown}); - } - } - }, - evalInput: function(cm, vim) { - // If the motion comand is set, execute both the operator and motion. - // Otherwise return. - var inputState = vim.inputState; - var motion = inputState.motion; - var motionArgs = inputState.motionArgs || {}; - var operator = inputState.operator; - var operatorArgs = inputState.operatorArgs || {}; - var registerName = inputState.registerName; - var sel = vim.sel; - // TODO: Make sure cm and vim selections are identical outside visual mode. - var origHead = copyCursor(vim.visualMode ? sel.head: cm.getCursor('head')); - var origAnchor = copyCursor(vim.visualMode ? sel.anchor : cm.getCursor('anchor')); - var oldHead = copyCursor(origHead); - var oldAnchor = copyCursor(origAnchor); - var newHead, newAnchor; - var repeat; - if (operator) { - this.recordLastEdit(vim, inputState); - } - if (inputState.repeatOverride !== undefined) { - // If repeatOverride is specified, that takes precedence over the - // input state's repeat. Used by Ex mode and can be user defined. - repeat = inputState.repeatOverride; - } else { - repeat = inputState.getRepeat(); - } - if (repeat > 0 && motionArgs.explicitRepeat) { - motionArgs.repeatIsExplicit = true; - } else if (motionArgs.noRepeat || - (!motionArgs.explicitRepeat && repeat === 0)) { - repeat = 1; - motionArgs.repeatIsExplicit = false; - } - if (inputState.selectedCharacter) { - // If there is a character input, stick it in all of the arg arrays. - motionArgs.selectedCharacter = operatorArgs.selectedCharacter = - inputState.selectedCharacter; - } - motionArgs.repeat = repeat; - clearInputState(cm); - if (motion) { - var motionResult = motions[motion](cm, origHead, motionArgs, vim); - vim.lastMotion = motions[motion]; - if (!motionResult) { - return; - } - if (motionArgs.toJumplist) { - var jumpList = vimGlobalState.jumpList; - // if the current motion is # or *, use cachedCursor - var cachedCursor = jumpList.cachedCursor; - if (cachedCursor) { - recordJumpPosition(cm, cachedCursor, motionResult); - delete jumpList.cachedCursor; - } else { - recordJumpPosition(cm, origHead, motionResult); - } - } - if (motionResult instanceof Array) { - newAnchor = motionResult[0]; - newHead = motionResult[1]; - } else { - newHead = motionResult; - } - // TODO: Handle null returns from motion commands better. - if (!newHead) { - newHead = copyCursor(origHead); - } - if (vim.visualMode) { - if (!(vim.visualBlock && newHead.ch === Infinity)) { - newHead = clipCursorToContent(cm, newHead, vim.visualBlock); - } - if (newAnchor) { - newAnchor = clipCursorToContent(cm, newAnchor, true); - } - newAnchor = newAnchor || oldAnchor; - sel.anchor = newAnchor; - sel.head = newHead; - updateCmSelection(cm); - updateMark(cm, vim, '<', - cursorIsBefore(newAnchor, newHead) ? newAnchor - : newHead); - updateMark(cm, vim, '>', - cursorIsBefore(newAnchor, newHead) ? newHead - : newAnchor); - } else if (!operator) { - newHead = clipCursorToContent(cm, newHead); - cm.setCursor(newHead.line, newHead.ch); - } - } - if (operator) { - if (operatorArgs.lastSel) { - // Replaying a visual mode operation - newAnchor = oldAnchor; - var lastSel = operatorArgs.lastSel; - var lineOffset = Math.abs(lastSel.head.line - lastSel.anchor.line); - var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch); - if (lastSel.visualLine) { - // Linewise Visual mode: The same number of lines. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); - } else if (lastSel.visualBlock) { - // Blockwise Visual mode: The same number of lines and columns. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset); - } else if (lastSel.head.line == lastSel.anchor.line) { - // Normal Visual mode within one line: The same number of characters. - newHead = Pos(oldAnchor.line, oldAnchor.ch + chOffset); - } else { - // Normal Visual mode with several lines: The same number of lines, in the - // last line the same number of characters as in the last line the last time. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); - } - vim.visualMode = true; - vim.visualLine = lastSel.visualLine; - vim.visualBlock = lastSel.visualBlock; - sel = vim.sel = { - anchor: newAnchor, - head: newHead - }; - updateCmSelection(cm); - } else if (vim.visualMode) { - operatorArgs.lastSel = { - anchor: copyCursor(sel.anchor), - head: copyCursor(sel.head), - visualBlock: vim.visualBlock, - visualLine: vim.visualLine - }; - } - var curStart, curEnd, linewise, mode; - var cmSel; - if (vim.visualMode) { - // Init visual op - curStart = cursorMin(sel.head, sel.anchor); - curEnd = cursorMax(sel.head, sel.anchor); - linewise = vim.visualLine || operatorArgs.linewise; - mode = vim.visualBlock ? 'block' : - linewise ? 'line' : - 'char'; - cmSel = makeCmSelection(cm, { - anchor: curStart, - head: curEnd - }, mode); - if (linewise) { - var ranges = cmSel.ranges; - if (mode == 'block') { - // Linewise operators in visual block mode extend to end of line - for (var i = 0; i < ranges.length; i++) { - ranges[i].head.ch = lineLength(cm, ranges[i].head.line); - } - } else if (mode == 'line') { - ranges[0].head = Pos(ranges[0].head.line + 1, 0); - } - } - } else { - // Init motion op - curStart = copyCursor(newAnchor || oldAnchor); - curEnd = copyCursor(newHead || oldHead); - if (cursorIsBefore(curEnd, curStart)) { - var tmp = curStart; - curStart = curEnd; - curEnd = tmp; - } - linewise = motionArgs.linewise || operatorArgs.linewise; - if (linewise) { - // Expand selection to entire line. - expandSelectionToLine(cm, curStart, curEnd); - } else if (motionArgs.forward) { - // Clip to trailing newlines only if the motion goes forward. - clipToLine(cm, curStart, curEnd); - } - mode = 'char'; - var exclusive = !motionArgs.inclusive || linewise; - cmSel = makeCmSelection(cm, { - anchor: curStart, - head: curEnd - }, mode, exclusive); - } - cm.setSelections(cmSel.ranges, cmSel.primary); - vim.lastMotion = null; - operatorArgs.repeat = repeat; // For indent in visual mode. - operatorArgs.registerName = registerName; - // Keep track of linewise as it affects how paste and change behave. - operatorArgs.linewise = linewise; - var operatorMoveTo = operators[operator]( - cm, operatorArgs, cmSel.ranges, oldAnchor, newHead); - if (vim.visualMode) { - exitVisualMode(cm); - } - if (operatorMoveTo) { - cm.setCursor(operatorMoveTo); - } - } - }, - recordLastEdit: function(vim, inputState, actionCommand) { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { return; } - vim.lastEditInputState = inputState; - vim.lastEditActionCommand = actionCommand; - macroModeState.lastInsertModeChanges.changes = []; - macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false; - } - }; - - /** - * typedef {Object{line:number,ch:number}} Cursor An object containing the - * position of the cursor. - */ - // All of the functions below return Cursor objects. - var motions = { - moveToTopLine: function(cm, _head, motionArgs) { - var line = getUserVisibleLines(cm).top + motionArgs.repeat -1; - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - moveToMiddleLine: function(cm) { - var range = getUserVisibleLines(cm); - var line = Math.floor((range.top + range.bottom) * 0.5); - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - moveToBottomLine: function(cm, _head, motionArgs) { - var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1; - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - expandToLine: function(_cm, head, motionArgs) { - // Expands forward to end of line, and then to next line if repeat is - // >1. Does not handle backward motion! - var cur = head; - return Pos(cur.line + motionArgs.repeat - 1, Infinity); - }, - findNext: function(cm, _head, motionArgs) { - var state = getSearchState(cm); - var query = state.getQuery(); - if (!query) { - return; - } - var prev = !motionArgs.forward; - // If search is initiated with ? instead of /, negate direction. - prev = (state.isReversed()) ? !prev : prev; - highlightSearchMatches(cm, query); - return findNext(cm, prev/** prev */, query, motionArgs.repeat); - }, - goToMark: function(cm, _head, motionArgs, vim) { - var mark = vim.marks[motionArgs.selectedCharacter]; - if (mark) { - var pos = mark.find(); - return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos; - } - return null; - }, - moveToOtherHighlightedEnd: function(cm, _head, motionArgs, vim) { - if (vim.visualBlock && motionArgs.sameLine) { - var sel = vim.sel; - return [ - clipCursorToContent(cm, Pos(sel.anchor.line, sel.head.ch)), - clipCursorToContent(cm, Pos(sel.head.line, sel.anchor.ch)) - ]; - } else { - return ([vim.sel.head, vim.sel.anchor]); - } - }, - jumpToMark: function(cm, head, motionArgs, vim) { - var best = head; - for (var i = 0; i < motionArgs.repeat; i++) { - var cursor = best; - for (var key in vim.marks) { - if (!isLowerCase(key)) { - continue; - } - var mark = vim.marks[key].find(); - var isWrongDirection = (motionArgs.forward) ? - cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark); - - if (isWrongDirection) { - continue; - } - if (motionArgs.linewise && (mark.line == cursor.line)) { - continue; - } - - var equal = cursorEqual(cursor, best); - var between = (motionArgs.forward) ? - cursorIsBetween(cursor, mark, best) : - cursorIsBetween(best, mark, cursor); - - if (equal || between) { - best = mark; - } - } - } - - if (motionArgs.linewise) { - // Vim places the cursor on the first non-whitespace character of - // the line if there is one, else it places the cursor at the end - // of the line, regardless of whether a mark was found. - best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line))); - } - return best; - }, - moveByCharacters: function(_cm, head, motionArgs) { - var cur = head; - var repeat = motionArgs.repeat; - var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat; - return Pos(cur.line, ch); - }, - moveByLines: function(cm, head, motionArgs, vim) { - var cur = head; - var endCh = cur.ch; - // Depending what our last motion was, we may want to do different - // things. If our last motion was moving vertically, we want to - // preserve the HPos from our last horizontal move. If our last motion - // was going to the end of a line, moving vertically we should go to - // the end of the line, etc. - switch (vim.lastMotion) { - case this.moveByLines: - case this.moveByDisplayLines: - case this.moveByScroll: - case this.moveToColumn: - case this.moveToEol: - endCh = vim.lastHPos; - break; - default: - vim.lastHPos = endCh; - } - var repeat = motionArgs.repeat+(motionArgs.repeatOffset||0); - var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat; - var first = cm.firstLine(); - var last = cm.lastLine(); - // Vim cancels linewise motions that start on an edge and move beyond - // that edge. It does not cancel motions that do not start on an edge. - if ((line < first && cur.line == first) || - (line > last && cur.line == last)) { - return; - } - if (motionArgs.toFirstChar){ - endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line)); - vim.lastHPos = endCh; - } - vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left; - return Pos(line, endCh); - }, - moveByDisplayLines: function(cm, head, motionArgs, vim) { - var cur = head; - switch (vim.lastMotion) { - case this.moveByDisplayLines: - case this.moveByScroll: - case this.moveByLines: - case this.moveToColumn: - case this.moveToEol: - break; - default: - vim.lastHSPos = cm.charCoords(cur,'div').left; - } - var repeat = motionArgs.repeat; - var res=cm.findPosV(cur,(motionArgs.forward ? repeat : -repeat),'line',vim.lastHSPos); - if (res.hitSide) { - if (motionArgs.forward) { - var lastCharCoords = cm.charCoords(res, 'div'); - var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos }; - var res = cm.coordsChar(goalCoords, 'div'); - } else { - var resCoords = cm.charCoords(Pos(cm.firstLine(), 0), 'div'); - resCoords.left = vim.lastHSPos; - res = cm.coordsChar(resCoords, 'div'); - } - } - vim.lastHPos = res.ch; - return res; - }, - moveByPage: function(cm, head, motionArgs) { - // CodeMirror only exposes functions that move the cursor page down, so - // doing this bad hack to move the cursor and move it back. evalInput - // will move the cursor to where it should be in the end. - var curStart = head; - var repeat = motionArgs.repeat; - return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page'); - }, - moveByParagraph: function(cm, head, motionArgs) { - var dir = motionArgs.forward ? 1 : -1; - return findParagraph(cm, head, motionArgs.repeat, dir); - }, - moveByScroll: function(cm, head, motionArgs, vim) { - var scrollbox = cm.getScrollInfo(); - var curEnd = null; - var repeat = motionArgs.repeat; - if (!repeat) { - repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight()); - } - var orig = cm.charCoords(head, 'local'); - motionArgs.repeat = repeat; - var curEnd = motions.moveByDisplayLines(cm, head, motionArgs, vim); - if (!curEnd) { - return null; - } - var dest = cm.charCoords(curEnd, 'local'); - cm.scrollTo(null, scrollbox.top + dest.top - orig.top); - return curEnd; - }, - moveByWords: function(cm, head, motionArgs) { - return moveToWord(cm, head, motionArgs.repeat, !!motionArgs.forward, - !!motionArgs.wordEnd, !!motionArgs.bigWord); - }, - moveTillCharacter: function(cm, _head, motionArgs) { - var repeat = motionArgs.repeat; - var curEnd = moveToCharacter(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter); - var increment = motionArgs.forward ? -1 : 1; - recordLastCharacterSearch(increment, motionArgs); - if (!curEnd) return null; - curEnd.ch += increment; - return curEnd; - }, - moveToCharacter: function(cm, head, motionArgs) { - var repeat = motionArgs.repeat; - recordLastCharacterSearch(0, motionArgs); - return moveToCharacter(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter) || head; - }, - moveToSymbol: function(cm, head, motionArgs) { - var repeat = motionArgs.repeat; - return findSymbol(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter) || head; - }, - moveToColumn: function(cm, head, motionArgs, vim) { - var repeat = motionArgs.repeat; - // repeat is equivalent to which column we want to move to! - vim.lastHPos = repeat - 1; - vim.lastHSPos = cm.charCoords(head,'div').left; - return moveToColumn(cm, repeat); - }, - moveToEol: function(cm, head, motionArgs, vim) { - var cur = head; - vim.lastHPos = Infinity; - var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity); - var end=cm.clipPos(retval); - end.ch--; - vim.lastHSPos = cm.charCoords(end,'div').left; - return retval; - }, - moveToFirstNonWhiteSpaceCharacter: function(cm, head) { - // Go to the start of the line where the text begins, or the end for - // whitespace-only lines - var cursor = head; - return Pos(cursor.line, - findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line))); - }, - moveToMatchedSymbol: function(cm, head) { - var cursor = head; - var line = cursor.line; - var ch = cursor.ch; - var lineText = cm.getLine(line); - var symbol; - do { - symbol = lineText.charAt(ch++); - if (symbol && isMatchableSymbol(symbol)) { - var style = cm.getTokenTypeAt(Pos(line, ch)); - if (style !== "string" && style !== "comment") { - break; - } - } - } while (symbol); - if (symbol) { - var matched = cm.findMatchingBracket(Pos(line, ch)); - return matched.to; - } else { - return cursor; - } - }, - moveToStartOfLine: function(_cm, head) { - return Pos(head.line, 0); - }, - moveToLineOrEdgeOfDocument: function(cm, _head, motionArgs) { - var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine(); - if (motionArgs.repeatIsExplicit) { - lineNum = motionArgs.repeat - cm.getOption('firstLineNumber'); - } - return Pos(lineNum, - findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum))); - }, - textObjectManipulation: function(cm, head, motionArgs, vim) { - // TODO: lots of possible exceptions that can be thrown here. Try da( - // outside of a () block. - - // TODO: adding <> >< to this map doesn't work, presumably because - // they're operators - var mirroredPairs = {'(': ')', ')': '(', - '{': '}', '}': '{', - '[': ']', ']': '['}; - var selfPaired = {'\'': true, '"': true}; - - var character = motionArgs.selectedCharacter; - // 'b' refers to '()' block. - // 'B' refers to '{}' block. - if (character == 'b') { - character = '('; - } else if (character == 'B') { - character = '{'; - } - - // Inclusive is the difference between a and i - // TODO: Instead of using the additional text object map to perform text - // object operations, merge the map into the defaultKeyMap and use - // motionArgs to define behavior. Define separate entries for 'aw', - // 'iw', 'a[', 'i[', etc. - var inclusive = !motionArgs.textObjectInner; - - var tmp; - if (mirroredPairs[character]) { - tmp = selectCompanionObject(cm, head, character, inclusive); - } else if (selfPaired[character]) { - tmp = findBeginningAndEnd(cm, head, character, inclusive); - } else if (character === 'W') { - tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, - true /** bigWord */); - } else if (character === 'w') { - tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, - false /** bigWord */); - } else if (character === 'p') { - tmp = findParagraph(cm, head, motionArgs.repeat, 0, inclusive); - motionArgs.linewise = true; - if (vim.visualMode) { - if (!vim.visualLine) { vim.visualLine = true; } - } else { - var operatorArgs = vim.inputState.operatorArgs; - if (operatorArgs) { operatorArgs.linewise = true; } - tmp.end.line--; - } - } else { - // No text object defined for this, don't move. - return null; - } - - if (!cm.state.vim.visualMode) { - return [tmp.start, tmp.end]; - } else { - return expandSelection(cm, tmp.start, tmp.end); - } - }, - - repeatLastCharacterSearch: function(cm, head, motionArgs) { - var lastSearch = vimGlobalState.lastChararacterSearch; - var repeat = motionArgs.repeat; - var forward = motionArgs.forward === lastSearch.forward; - var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1); - cm.moveH(-increment, 'char'); - motionArgs.inclusive = forward ? true : false; - var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter); - if (!curEnd) { - cm.moveH(increment, 'char'); - return head; - } - curEnd.ch += increment; - return curEnd; - } - }; - - function fillArray(val, times) { - var arr = []; - for (var i = 0; i < times; i++) { - arr.push(val); - } - return arr; - } - /** - * An operator acts on a text selection. It receives the list of selections - * as input. The corresponding CodeMirror selection is guaranteed to - * match the input selection. - */ - var operators = { - change: function(cm, args, ranges) { - var finalHead, text; - var vim = cm.state.vim; - vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock = vim.visualBlock; - if (!vim.visualMode) { - var anchor = ranges[0].anchor, - head = ranges[0].head; - text = cm.getRange(anchor, head); - if (!isWhiteSpaceString(text)) { - // Exclude trailing whitespace if the range is not all whitespace. - var match = (/\s+$/).exec(text); - if (match) { - head = offsetCursor(head, 0, - match[0].length); - text = text.slice(0, - match[0].length); - } - } - var wasLastLine = head.line - 1 == cm.lastLine(); - cm.replaceRange('', anchor, head); - if (args.linewise && !wasLastLine) { - // Push the next line back down, if there is a next line. - CodeMirror.commands.newlineAndIndent(cm); - // null ch so setCursor moves to end of line. - anchor.ch = null; - } - finalHead = anchor; - } else { - text = cm.getSelection(); - var replacement = fillArray('', ranges.length); - cm.replaceSelections(replacement); - finalHead = cursorMin(ranges[0].head, ranges[0].anchor); - } - vimGlobalState.registerController.pushText( - args.registerName, 'change', text, - args.linewise, ranges.length > 1); - actions.enterInsertMode(cm, {head: finalHead}, cm.state.vim); - }, - // delete is a javascript keyword. - 'delete': function(cm, args, ranges) { - var finalHead, text; - var vim = cm.state.vim; - if (!vim.visualBlock) { - var anchor = ranges[0].anchor, - head = ranges[0].head; - if (args.linewise && - head.line != cm.firstLine() && - anchor.line == cm.lastLine() && - anchor.line == head.line - 1) { - // Special case for dd on last line (and first line). - if (anchor.line == cm.firstLine()) { - anchor.ch = 0; - } else { - anchor = Pos(anchor.line - 1, lineLength(cm, anchor.line - 1)); - } - } - text = cm.getRange(anchor, head); - cm.replaceRange('', anchor, head); - finalHead = anchor; - if (args.linewise) { - finalHead = motions.moveToFirstNonWhiteSpaceCharacter(cm, anchor); - } - } else { - text = cm.getSelection(); - var replacement = fillArray('', ranges.length); - cm.replaceSelections(replacement); - finalHead = ranges[0].anchor; - } - vimGlobalState.registerController.pushText( - args.registerName, 'delete', text, - args.linewise, vim.visualBlock); - return finalHead; - }, - indent: function(cm, args, ranges) { - var vim = cm.state.vim; - var startLine = ranges[0].anchor.line; - var endLine = vim.visualBlock ? - ranges[ranges.length - 1].anchor.line : - ranges[0].head.line; - // In visual mode, n> shifts the selection right n times, instead of - // shifting n lines right once. - var repeat = (vim.visualMode) ? args.repeat : 1; - if (args.linewise) { - // The only way to delete a newline is to delete until the start of - // the next line, so in linewise mode evalInput will include the next - // line. We don't want this in indent, so we go back a line. - endLine--; - } - for (var i = startLine; i <= endLine; i++) { - for (var j = 0; j < repeat; j++) { - cm.indentLine(i, args.indentRight); - } - } - return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor); - }, - changeCase: function(cm, args, ranges, oldAnchor, newHead) { - var selections = cm.getSelections(); - var swapped = []; - var toLower = args.toLower; - for (var j = 0; j < selections.length; j++) { - var toSwap = selections[j]; - var text = ''; - if (toLower === true) { - text = toSwap.toLowerCase(); - } else if (toLower === false) { - text = toSwap.toUpperCase(); - } else { - for (var i = 0; i < toSwap.length; i++) { - var character = toSwap.charAt(i); - text += isUpperCase(character) ? character.toLowerCase() : - character.toUpperCase(); - } - } - swapped.push(text); - } - cm.replaceSelections(swapped); - if (args.shouldMoveCursor){ - return newHead; - } else if (!cm.state.vim.visualMode && args.linewise && ranges[0].anchor.line + 1 == ranges[0].head.line) { - return motions.moveToFirstNonWhiteSpaceCharacter(cm, oldAnchor); - } else if (args.linewise){ - return oldAnchor; - } else { - return cursorMin(ranges[0].anchor, ranges[0].head); - } - }, - yank: function(cm, args, ranges, oldAnchor) { - var vim = cm.state.vim; - var text = cm.getSelection(); - var endPos = vim.visualMode - ? cursorMin(vim.sel.anchor, vim.sel.head, ranges[0].head, ranges[0].anchor) - : oldAnchor; - vimGlobalState.registerController.pushText( - args.registerName, 'yank', - text, args.linewise, vim.visualBlock); - return endPos; - } - }; - - var actions = { - jumpListWalk: function(cm, actionArgs, vim) { - if (vim.visualMode) { - return; - } - var repeat = actionArgs.repeat; - var forward = actionArgs.forward; - var jumpList = vimGlobalState.jumpList; - - var mark = jumpList.move(cm, forward ? repeat : -repeat); - var markPos = mark ? mark.find() : undefined; - markPos = markPos ? markPos : cm.getCursor(); - cm.setCursor(markPos); - }, - scroll: function(cm, actionArgs, vim) { - if (vim.visualMode) { - return; - } - var repeat = actionArgs.repeat || 1; - var lineHeight = cm.defaultTextHeight(); - var top = cm.getScrollInfo().top; - var delta = lineHeight * repeat; - var newPos = actionArgs.forward ? top + delta : top - delta; - var cursor = copyCursor(cm.getCursor()); - var cursorCoords = cm.charCoords(cursor, 'local'); - if (actionArgs.forward) { - if (newPos > cursorCoords.top) { - cursor.line += (newPos - cursorCoords.top) / lineHeight; - cursor.line = Math.ceil(cursor.line); - cm.setCursor(cursor); - cursorCoords = cm.charCoords(cursor, 'local'); - cm.scrollTo(null, cursorCoords.top); - } else { - // Cursor stays within bounds. Just reposition the scroll window. - cm.scrollTo(null, newPos); - } - } else { - var newBottom = newPos + cm.getScrollInfo().clientHeight; - if (newBottom < cursorCoords.bottom) { - cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight; - cursor.line = Math.floor(cursor.line); - cm.setCursor(cursor); - cursorCoords = cm.charCoords(cursor, 'local'); - cm.scrollTo( - null, cursorCoords.bottom - cm.getScrollInfo().clientHeight); - } else { - // Cursor stays within bounds. Just reposition the scroll window. - cm.scrollTo(null, newPos); - } - } - }, - scrollToCursor: function(cm, actionArgs) { - var lineNum = cm.getCursor().line; - var charCoords = cm.charCoords(Pos(lineNum, 0), 'local'); - var height = cm.getScrollInfo().clientHeight; - var y = charCoords.top; - var lineHeight = charCoords.bottom - y; - switch (actionArgs.position) { - case 'center': y = y - (height / 2) + lineHeight; - break; - case 'bottom': y = y - height + lineHeight*1.4; - break; - case 'top': y = y + lineHeight*0.4; - break; - } - cm.scrollTo(null, y); - }, - replayMacro: function(cm, actionArgs, vim) { - var registerName = actionArgs.selectedCharacter; - var repeat = actionArgs.repeat; - var macroModeState = vimGlobalState.macroModeState; - if (registerName == '@') { - registerName = macroModeState.latestRegister; - } - while(repeat--){ - executeMacroRegister(cm, vim, macroModeState, registerName); - } - }, - enterMacroRecordMode: function(cm, actionArgs) { - var macroModeState = vimGlobalState.macroModeState; - var registerName = actionArgs.selectedCharacter; - macroModeState.enterMacroRecordMode(cm, registerName); - }, - enterInsertMode: function(cm, actionArgs, vim) { - if (cm.getOption('readOnly')) { return; } - vim.insertMode = true; - vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1; - var insertAt = (actionArgs) ? actionArgs.insertAt : null; - var sel = vim.sel; - var head = actionArgs.head || cm.getCursor('head'); - var height = cm.listSelections().length; - if (insertAt == 'eol') { - head = Pos(head.line, lineLength(cm, head.line)); - } else if (insertAt == 'charAfter') { - head = offsetCursor(head, 0, 1); - } else if (insertAt == 'firstNonBlank') { - head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head); - } else if (insertAt == 'startOfSelectedArea') { - if (!vim.visualBlock) { - if (sel.head.line < sel.anchor.line) { - head = sel.head; - } else { - head = Pos(sel.anchor.line, 0); - } - } else { - head = Pos( - Math.min(sel.head.line, sel.anchor.line), - Math.min(sel.head.ch, sel.anchor.ch)); - height = Math.abs(sel.head.line - sel.anchor.line) + 1; - } - } else if (insertAt == 'endOfSelectedArea') { - if (!vim.visualBlock) { - if (sel.head.line >= sel.anchor.line) { - head = offsetCursor(sel.head, 0, 1); - } else { - head = Pos(sel.anchor.line, 0); - } - } else { - head = Pos( - Math.min(sel.head.line, sel.anchor.line), - Math.max(sel.head.ch + 1, sel.anchor.ch)); - height = Math.abs(sel.head.line - sel.anchor.line) + 1; - } - } else if (insertAt == 'inplace') { - if (vim.visualMode){ - return; - } - } - cm.setOption('keyMap', 'vim-insert'); - cm.setOption('disableInput', false); - if (actionArgs && actionArgs.replace) { - // Handle Replace-mode as a special case of insert mode. - cm.toggleOverwrite(true); - cm.setOption('keyMap', 'vim-replace'); - CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"}); - } else { - cm.setOption('keyMap', 'vim-insert'); - CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"}); - } - if (!vimGlobalState.macroModeState.isPlaying) { - // Only record if not replaying. - cm.on('change', onChange); - CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); - } - if (vim.visualMode) { - exitVisualMode(cm); - } - selectForInsert(cm, head, height); - }, - toggleVisualMode: function(cm, actionArgs, vim) { - var repeat = actionArgs.repeat; - var anchor = cm.getCursor(); - var head; - // TODO: The repeat should actually select number of characters/lines - // equal to the repeat times the size of the previous visual - // operation. - if (!vim.visualMode) { - // Entering visual mode - vim.visualMode = true; - vim.visualLine = !!actionArgs.linewise; - vim.visualBlock = !!actionArgs.blockwise; - head = clipCursorToContent( - cm, Pos(anchor.line, anchor.ch + repeat - 1), - true /** includeLineBreak */); - vim.sel = { - anchor: anchor, - head: head - }; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); - updateCmSelection(cm); - updateMark(cm, vim, '<', cursorMin(anchor, head)); - updateMark(cm, vim, '>', cursorMax(anchor, head)); - } else if (vim.visualLine ^ actionArgs.linewise || - vim.visualBlock ^ actionArgs.blockwise) { - // Toggling between modes - vim.visualLine = !!actionArgs.linewise; - vim.visualBlock = !!actionArgs.blockwise; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); - updateCmSelection(cm); - } else { - exitVisualMode(cm); - } - }, - reselectLastSelection: function(cm, _actionArgs, vim) { - var lastSelection = vim.lastSelection; - if (vim.visualMode) { - updateLastSelection(cm, vim); - } - if (lastSelection) { - var anchor = lastSelection.anchorMark.find(); - var head = lastSelection.headMark.find(); - if (!anchor || !head) { - // If the marks have been destroyed due to edits, do nothing. - return; - } - vim.sel = { - anchor: anchor, - head: head - }; - vim.visualMode = true; - vim.visualLine = lastSelection.visualLine; - vim.visualBlock = lastSelection.visualBlock; - updateCmSelection(cm); - updateMark(cm, vim, '<', cursorMin(anchor, head)); - updateMark(cm, vim, '>', cursorMax(anchor, head)); - CodeMirror.signal(cm, 'vim-mode-change', { - mode: 'visual', - subMode: vim.visualLine ? 'linewise' : - vim.visualBlock ? 'blockwise' : ''}); - } - }, - joinLines: function(cm, actionArgs, vim) { - var curStart, curEnd; - if (vim.visualMode) { - curStart = cm.getCursor('anchor'); - curEnd = cm.getCursor('head'); - curEnd.ch = lineLength(cm, curEnd.line) - 1; - } else { - // Repeat is the number of lines to join. Minimum 2 lines. - var repeat = Math.max(actionArgs.repeat, 2); - curStart = cm.getCursor(); - curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1, - Infinity)); - } - var finalCh = 0; - for (var i = curStart.line; i < curEnd.line; i++) { - finalCh = lineLength(cm, curStart.line); - var tmp = Pos(curStart.line + 1, - lineLength(cm, curStart.line + 1)); - var text = cm.getRange(curStart, tmp); - text = text.replace(/\n\s*/g, ' '); - cm.replaceRange(text, curStart, tmp); - } - var curFinalPos = Pos(curStart.line, finalCh); - cm.setCursor(curFinalPos); - if (vim.visualMode) { - exitVisualMode(cm); - } - }, - newLineAndEnterInsertMode: function(cm, actionArgs, vim) { - vim.insertMode = true; - var insertAt = copyCursor(cm.getCursor()); - if (insertAt.line === cm.firstLine() && !actionArgs.after) { - // Special case for inserting newline before start of document. - cm.replaceRange('\n', Pos(cm.firstLine(), 0)); - cm.setCursor(cm.firstLine(), 0); - } else { - insertAt.line = (actionArgs.after) ? insertAt.line : - insertAt.line - 1; - insertAt.ch = lineLength(cm, insertAt.line); - cm.setCursor(insertAt); - var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment || - CodeMirror.commands.newlineAndIndent; - newlineFn(cm); - } - this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim); - }, - paste: function(cm, actionArgs, vim) { - var cur = copyCursor(cm.getCursor()); - var register = vimGlobalState.registerController.getRegister( - actionArgs.registerName); - var text = register.toString(); - if (!text) { - return; - } - if (actionArgs.matchIndent) { - var tabSize = cm.getOption("tabSize"); - // length that considers tabs and tabSize - var whitespaceLength = function(str) { - var tabs = (str.split("\t").length - 1); - var spaces = (str.split(" ").length - 1); - return tabs * tabSize + spaces * 1; - }; - var currentLine = cm.getLine(cm.getCursor().line); - var indent = whitespaceLength(currentLine.match(/^\s*/)[0]); - // chomp last newline b/c don't want it to match /^\s*/gm - var chompedText = text.replace(/\n$/, ''); - var wasChomped = text !== chompedText; - var firstIndent = whitespaceLength(text.match(/^\s*/)[0]); - var text = chompedText.replace(/^\s*/gm, function(wspace) { - var newIndent = indent + (whitespaceLength(wspace) - firstIndent); - if (newIndent < 0) { - return ""; - } - else if (cm.getOption("indentWithTabs")) { - var quotient = Math.floor(newIndent / tabSize); - return Array(quotient + 1).join('\t'); - } - else { - return Array(newIndent + 1).join(' '); - } - }); - text += wasChomped ? "\n" : ""; - } - if (actionArgs.repeat > 1) { - var text = Array(actionArgs.repeat + 1).join(text); - } - var linewise = register.linewise; - var blockwise = register.blockwise; - if (linewise) { - if(vim.visualMode) { - text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n'; - } else if (actionArgs.after) { - // Move the newline at the end to the start instead, and paste just - // before the newline character of the line we are on right now. - text = '\n' + text.slice(0, text.length - 1); - cur.ch = lineLength(cm, cur.line); - } else { - cur.ch = 0; - } - } else { - if (blockwise) { - text = text.split('\n'); - for (var i = 0; i < text.length; i++) { - text[i] = (text[i] == '') ? ' ' : text[i]; - } - } - cur.ch += actionArgs.after ? 1 : 0; - } - var curPosFinal; - var idx; - if (vim.visualMode) { - // save the pasted text for reselection if the need arises - vim.lastPastedText = text; - var lastSelectionCurEnd; - var selectedArea = getSelectedAreaRange(cm, vim); - var selectionStart = selectedArea[0]; - var selectionEnd = selectedArea[1]; - var selectedText = cm.getSelection(); - var selections = cm.listSelections(); - var emptyStrings = new Array(selections.length).join('1').split('1'); - // save the curEnd marker before it get cleared due to cm.replaceRange. - if (vim.lastSelection) { - lastSelectionCurEnd = vim.lastSelection.headMark.find(); - } - // push the previously selected text to unnamed register - vimGlobalState.registerController.unnamedRegister.setText(selectedText); - if (blockwise) { - // first delete the selected text - cm.replaceSelections(emptyStrings); - // Set new selections as per the block length of the yanked text - selectionEnd = Pos(selectionStart.line + text.length-1, selectionStart.ch); - cm.setCursor(selectionStart); - selectBlock(cm, selectionEnd); - cm.replaceSelections(text); - curPosFinal = selectionStart; - } else if (vim.visualBlock) { - cm.replaceSelections(emptyStrings); - cm.setCursor(selectionStart); - cm.replaceRange(text, selectionStart, selectionStart); - curPosFinal = selectionStart; - } else { - cm.replaceRange(text, selectionStart, selectionEnd); - curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1); - } - // restore the the curEnd marker - if(lastSelectionCurEnd) { - vim.lastSelection.headMark = cm.setBookmark(lastSelectionCurEnd); - } - if (linewise) { - curPosFinal.ch=0; - } - } else { - if (blockwise) { - cm.setCursor(cur); - for (var i = 0; i < text.length; i++) { - var line = cur.line+i; - if (line > cm.lastLine()) { - cm.replaceRange('\n', Pos(line, 0)); - } - var lastCh = lineLength(cm, line); - if (lastCh < cur.ch) { - extendLineToColumn(cm, line, cur.ch); - } - } - cm.setCursor(cur); - selectBlock(cm, Pos(cur.line + text.length-1, cur.ch)); - cm.replaceSelections(text); - curPosFinal = cur; - } else { - cm.replaceRange(text, cur); - // Now fine tune the cursor to where we want it. - if (linewise && actionArgs.after) { - curPosFinal = Pos( - cur.line + 1, - findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1))); - } else if (linewise && !actionArgs.after) { - curPosFinal = Pos( - cur.line, - findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line))); - } else if (!linewise && actionArgs.after) { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length - 1); - } else { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length); - } - } - } - if (vim.visualMode) { - exitVisualMode(cm); - } - cm.setCursor(curPosFinal); - }, - undo: function(cm, actionArgs) { - cm.operation(function() { - repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)(); - cm.setCursor(cm.getCursor('anchor')); - }); - }, - redo: function(cm, actionArgs) { - repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)(); - }, - setRegister: function(_cm, actionArgs, vim) { - vim.inputState.registerName = actionArgs.selectedCharacter; - }, - setMark: function(cm, actionArgs, vim) { - var markName = actionArgs.selectedCharacter; - updateMark(cm, vim, markName, cm.getCursor()); - }, - replace: function(cm, actionArgs, vim) { - var replaceWith = actionArgs.selectedCharacter; - var curStart = cm.getCursor(); - var replaceTo; - var curEnd; - var selections = cm.listSelections(); - if (vim.visualMode) { - curStart = cm.getCursor('start'); - curEnd = cm.getCursor('end'); - } else { - var line = cm.getLine(curStart.line); - replaceTo = curStart.ch + actionArgs.repeat; - if (replaceTo > line.length) { - replaceTo=line.length; - } - curEnd = Pos(curStart.line, replaceTo); - } - if (replaceWith=='\n') { - if (!vim.visualMode) cm.replaceRange('', curStart, curEnd); - // special case, where vim help says to replace by just one line-break - (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm); - } else { - var replaceWithStr = cm.getRange(curStart, curEnd); - //replace all characters in range by selected, but keep linebreaks - replaceWithStr = replaceWithStr.replace(/[^\n]/g, replaceWith); - if (vim.visualBlock) { - // Tabs are split in visua block before replacing - var spaces = new Array(cm.getOption("tabSize")+1).join(' '); - replaceWithStr = cm.getSelection(); - replaceWithStr = replaceWithStr.replace(/\t/g, spaces).replace(/[^\n]/g, replaceWith).split('\n'); - cm.replaceSelections(replaceWithStr); - } else { - cm.replaceRange(replaceWithStr, curStart, curEnd); - } - if (vim.visualMode) { - curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ? - selections[0].anchor : selections[0].head; - cm.setCursor(curStart); - exitVisualMode(cm); - } else { - cm.setCursor(offsetCursor(curEnd, 0, -1)); - } - } - }, - incrementNumberToken: function(cm, actionArgs) { - var cur = cm.getCursor(); - var lineStr = cm.getLine(cur.line); - var re = /-?\d+/g; - var match; - var start; - var end; - var numberStr; - var token; - while ((match = re.exec(lineStr)) !== null) { - token = match[0]; - start = match.index; - end = start + token.length; - if (cur.ch < end)break; - } - if (!actionArgs.backtrack && (end <= cur.ch))return; - if (token) { - var increment = actionArgs.increase ? 1 : -1; - var number = parseInt(token) + (increment * actionArgs.repeat); - var from = Pos(cur.line, start); - var to = Pos(cur.line, end); - numberStr = number.toString(); - cm.replaceRange(numberStr, from, to); - } else { - return; - } - cm.setCursor(Pos(cur.line, start + numberStr.length - 1)); - }, - repeatLastEdit: function(cm, actionArgs, vim) { - var lastEditInputState = vim.lastEditInputState; - if (!lastEditInputState) { return; } - var repeat = actionArgs.repeat; - if (repeat && actionArgs.repeatIsExplicit) { - vim.lastEditInputState.repeatOverride = repeat; - } else { - repeat = vim.lastEditInputState.repeatOverride || repeat; - } - repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */); - }, - exitInsertMode: exitInsertMode - }; - - /* - * Below are miscellaneous utility functions used by vim.js - */ - - /** - * Clips cursor to ensure that line is within the buffer's range - * If includeLineBreak is true, then allow cur.ch == lineLength. - */ - function clipCursorToContent(cm, cur, includeLineBreak) { - var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() ); - var maxCh = lineLength(cm, line) - 1; - maxCh = (includeLineBreak) ? maxCh + 1 : maxCh; - var ch = Math.min(Math.max(0, cur.ch), maxCh); - return Pos(line, ch); - } - function copyArgs(args) { - var ret = {}; - for (var prop in args) { - if (args.hasOwnProperty(prop)) { - ret[prop] = args[prop]; - } - } - return ret; - } - function offsetCursor(cur, offsetLine, offsetCh) { - if (typeof offsetLine === 'object') { - offsetCh = offsetLine.ch; - offsetLine = offsetLine.line; - } - return Pos(cur.line + offsetLine, cur.ch + offsetCh); - } - function getOffset(anchor, head) { - return { - line: head.line - anchor.line, - ch: head.line - anchor.line - }; - } - function commandMatches(keys, keyMap, context, inputState) { - // Partial matches are not applied. They inform the key handler - // that the current key sequence is a subsequence of a valid key - // sequence, so that the key buffer is not cleared. - var match, partial = [], full = []; - for (var i = 0; i < keyMap.length; i++) { - var command = keyMap[i]; - if (context == 'insert' && command.context != 'insert' || - command.context && command.context != context || - inputState.operator && command.type == 'action' || - !(match = commandMatch(keys, command.keys))) { continue; } - if (match == 'partial') { partial.push(command); } - if (match == 'full') { full.push(command); } - } - return { - partial: partial.length && partial, - full: full.length && full - }; - } - function commandMatch(pressed, mapped) { - if (mapped.slice(-11) == '') { - // Last character matches anything. - var prefixLen = mapped.length - 11; - var pressedPrefix = pressed.slice(0, prefixLen); - var mappedPrefix = mapped.slice(0, prefixLen); - return pressedPrefix == mappedPrefix && pressed.length > prefixLen ? 'full' : - mappedPrefix.indexOf(pressedPrefix) == 0 ? 'partial' : false; - } else { - return pressed == mapped ? 'full' : - mapped.indexOf(pressed) == 0 ? 'partial' : false; - } - } - function lastChar(keys) { - var match = /^.*(<[\w\-]+>)$/.exec(keys); - var selectedCharacter = match ? match[1] : keys.slice(-1); - if (selectedCharacter.length > 1){ - switch(selectedCharacter){ - case '': - selectedCharacter='\n'; - break; - case '': - selectedCharacter=' '; - break; - default: - break; - } - } - return selectedCharacter; - } - function repeatFn(cm, fn, repeat) { - return function() { - for (var i = 0; i < repeat; i++) { - fn(cm); - } - }; - } - function copyCursor(cur) { - return Pos(cur.line, cur.ch); - } - function cursorEqual(cur1, cur2) { - return cur1.ch == cur2.ch && cur1.line == cur2.line; - } - function cursorIsBefore(cur1, cur2) { - if (cur1.line < cur2.line) { - return true; - } - if (cur1.line == cur2.line && cur1.ch < cur2.ch) { - return true; - } - return false; - } - function cursorMin(cur1, cur2) { - if (arguments.length > 2) { - cur2 = cursorMin.apply(undefined, Array.prototype.slice.call(arguments, 1)); - } - return cursorIsBefore(cur1, cur2) ? cur1 : cur2; - } - function cursorMax(cur1, cur2) { - if (arguments.length > 2) { - cur2 = cursorMax.apply(undefined, Array.prototype.slice.call(arguments, 1)); - } - return cursorIsBefore(cur1, cur2) ? cur2 : cur1; - } - function cursorIsBetween(cur1, cur2, cur3) { - // returns true if cur2 is between cur1 and cur3. - var cur1before2 = cursorIsBefore(cur1, cur2); - var cur2before3 = cursorIsBefore(cur2, cur3); - return cur1before2 && cur2before3; - } - function lineLength(cm, lineNum) { - return cm.getLine(lineNum).length; - } - function reverse(s){ - return s.split('').reverse().join(''); - } - function trim(s) { - if (s.trim) { - return s.trim(); - } - return s.replace(/^\s+|\s+$/g, ''); - } - function escapeRegex(s) { - return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1'); - } - function extendLineToColumn(cm, lineNum, column) { - var endCh = lineLength(cm, lineNum); - var spaces = new Array(column-endCh+1).join(' '); - cm.setCursor(Pos(lineNum, endCh)); - cm.replaceRange(spaces, cm.getCursor()); - } - // This functions selects a rectangular block - // of text with selectionEnd as any of its corner - // Height of block: - // Difference in selectionEnd.line and first/last selection.line - // Width of the block: - // Distance between selectionEnd.ch and any(first considered here) selection.ch - function selectBlock(cm, selectionEnd) { - var selections = [], ranges = cm.listSelections(); - var head = copyCursor(cm.clipPos(selectionEnd)); - var isClipped = !cursorEqual(selectionEnd, head); - var curHead = cm.getCursor('head'); - var primIndex = getIndex(ranges, curHead); - var wasClipped = cursorEqual(ranges[primIndex].head, ranges[primIndex].anchor); - var max = ranges.length - 1; - var index = max - primIndex > primIndex ? max : 0; - var base = ranges[index].anchor; - - var firstLine = Math.min(base.line, head.line); - var lastLine = Math.max(base.line, head.line); - var baseCh = base.ch, headCh = head.ch; - - var dir = ranges[index].head.ch - baseCh; - var newDir = headCh - baseCh; - if (dir > 0 && newDir <= 0) { - baseCh++; - if (!isClipped) { headCh--; } - } else if (dir < 0 && newDir >= 0) { - baseCh--; - if (!wasClipped) { headCh++; } - } else if (dir < 0 && newDir == -1) { - baseCh--; - headCh++; - } - for (var line = firstLine; line <= lastLine; line++) { - var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)}; - selections.push(range); - } - primIndex = head.line == lastLine ? selections.length - 1 : 0; - cm.setSelections(selections); - selectionEnd.ch = headCh; - base.ch = baseCh; - return base; - } - function selectForInsert(cm, head, height) { - var sel = []; - for (var i = 0; i < height; i++) { - var lineHead = offsetCursor(head, i, 0); - sel.push({anchor: lineHead, head: lineHead}); - } - cm.setSelections(sel, 0); - } - // getIndex returns the index of the cursor in the selections. - function getIndex(ranges, cursor, end) { - for (var i = 0; i < ranges.length; i++) { - var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor); - var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor); - if (atAnchor || atHead) { - return i; - } - } - return -1; - } - function getSelectedAreaRange(cm, vim) { - var lastSelection = vim.lastSelection; - var getCurrentSelectedAreaRange = function() { - var selections = cm.listSelections(); - var start = selections[0]; - var end = selections[selections.length-1]; - var selectionStart = cursorIsBefore(start.anchor, start.head) ? start.anchor : start.head; - var selectionEnd = cursorIsBefore(end.anchor, end.head) ? end.head : end.anchor; - return [selectionStart, selectionEnd]; - }; - var getLastSelectedAreaRange = function() { - var selectionStart = cm.getCursor(); - var selectionEnd = cm.getCursor(); - var block = lastSelection.visualBlock; - if (block) { - var width = block.width; - var height = block.height; - selectionEnd = Pos(selectionStart.line + height, selectionStart.ch + width); - var selections = []; - // selectBlock creates a 'proper' rectangular block. - // We do not want that in all cases, so we manually set selections. - for (var i = selectionStart.line; i < selectionEnd.line; i++) { - var anchor = Pos(i, selectionStart.ch); - var head = Pos(i, selectionEnd.ch); - var range = {anchor: anchor, head: head}; - selections.push(range); - } - cm.setSelections(selections); - } else { - var start = lastSelection.anchorMark.find(); - var end = lastSelection.headMark.find(); - var line = end.line - start.line; - var ch = end.ch - start.ch; - selectionEnd = {line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch}; - if (lastSelection.visualLine) { - selectionStart = Pos(selectionStart.line, 0); - selectionEnd = Pos(selectionEnd.line, lineLength(cm, selectionEnd.line)); - } - cm.setSelection(selectionStart, selectionEnd); - } - return [selectionStart, selectionEnd]; - }; - if (!vim.visualMode) { - // In case of replaying the action. - return getLastSelectedAreaRange(); - } else { - return getCurrentSelectedAreaRange(); - } - } - // Updates the previous selection with the current selection's values. This - // should only be called in visual mode. - function updateLastSelection(cm, vim) { - var anchor = vim.sel.anchor; - var head = vim.sel.head; - // To accommodate the effect of lastPastedText in the last selection - if (vim.lastPastedText) { - head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length); - vim.lastPastedText = null; - } - vim.lastSelection = {'anchorMark': cm.setBookmark(anchor), - 'headMark': cm.setBookmark(head), - 'anchor': copyCursor(anchor), - 'head': copyCursor(head), - 'visualMode': vim.visualMode, - 'visualLine': vim.visualLine, - 'visualBlock': vim.visualBlock}; - } - function expandSelection(cm, start, end) { - var sel = cm.state.vim.sel; - var head = sel.head; - var anchor = sel.anchor; - var tmp; - if (cursorIsBefore(end, start)) { - tmp = end; - end = start; - start = tmp; - } - if (cursorIsBefore(head, anchor)) { - head = cursorMin(start, head); - anchor = cursorMax(anchor, end); - } else { - anchor = cursorMin(start, anchor); - head = cursorMax(head, end); - head = offsetCursor(head, 0, -1); - if (head.ch == -1 && head.line != cm.firstLine()) { - head = Pos(head.line - 1, lineLength(cm, head.line - 1)); - } - } - return [anchor, head]; - } - /** - * Updates the CodeMirror selection to match the provided vim selection. - * If no arguments are given, it uses the current vim selection state. - */ - function updateCmSelection(cm, sel, mode) { - var vim = cm.state.vim; - sel = sel || vim.sel; - var mode = mode || - vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char'; - var cmSel = makeCmSelection(cm, sel, mode); - cm.setSelections(cmSel.ranges, cmSel.primary); - updateFakeCursor(cm); - } - function makeCmSelection(cm, sel, mode, exclusive) { - var head = copyCursor(sel.head); - var anchor = copyCursor(sel.anchor); - if (mode == 'char') { - var headOffset = !exclusive && !cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; - var anchorOffset = cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; - head = offsetCursor(sel.head, 0, headOffset); - anchor = offsetCursor(sel.anchor, 0, anchorOffset); - return { - ranges: [{anchor: anchor, head: head}], - primary: 0 - }; - } else if (mode == 'line') { - if (!cursorIsBefore(sel.head, sel.anchor)) { - anchor.ch = 0; - - var lastLine = cm.lastLine(); - if (head.line > lastLine) { - head.line = lastLine; - } - head.ch = lineLength(cm, head.line); - } else { - head.ch = 0; - anchor.ch = lineLength(cm, anchor.line); - } - return { - ranges: [{anchor: anchor, head: head}], - primary: 0 - }; - } else if (mode == 'block') { - var top = Math.min(anchor.line, head.line), - left = Math.min(anchor.ch, head.ch), - bottom = Math.max(anchor.line, head.line), - right = Math.max(anchor.ch, head.ch) + 1; - var height = bottom - top + 1; - var primary = head.line == top ? 0 : height - 1; - var ranges = []; - for (var i = 0; i < height; i++) { - ranges.push({ - anchor: Pos(top + i, left), - head: Pos(top + i, right) - }); - } - return { - ranges: ranges, - primary: primary - }; - } - } - function getHead(cm) { - var cur = cm.getCursor('head'); - if (cm.getSelection().length == 1) { - // Small corner case when only 1 character is selected. The "real" - // head is the left of head and anchor. - cur = cursorMin(cur, cm.getCursor('anchor')); - } - return cur; - } - - /** - * If moveHead is set to false, the CodeMirror selection will not be - * touched. The caller assumes the responsibility of putting the cursor - * in the right place. - */ - function exitVisualMode(cm, moveHead) { - var vim = cm.state.vim; - if (moveHead !== false) { - cm.setCursor(clipCursorToContent(cm, vim.sel.head)); - } - updateLastSelection(cm, vim); - vim.visualMode = false; - vim.visualLine = false; - vim.visualBlock = false; - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - if (vim.fakeCursor) { - vim.fakeCursor.clear(); - } - } - - // Remove any trailing newlines from the selection. For - // example, with the caret at the start of the last word on the line, - // 'dw' should word, but not the newline, while 'w' should advance the - // caret to the first character of the next line. - function clipToLine(cm, curStart, curEnd) { - var selection = cm.getRange(curStart, curEnd); - // Only clip if the selection ends with trailing newline + whitespace - if (/\n\s*$/.test(selection)) { - var lines = selection.split('\n'); - // We know this is all whitepsace. - lines.pop(); - - // Cases: - // 1. Last word is an empty line - do not clip the trailing '\n' - // 2. Last word is not an empty line - clip the trailing '\n' - var line; - // Find the line containing the last word, and clip all whitespace up - // to it. - for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) { - curEnd.line--; - curEnd.ch = 0; - } - // If the last word is not an empty line, clip an additional newline - if (line) { - curEnd.line--; - curEnd.ch = lineLength(cm, curEnd.line); - } else { - curEnd.ch = 0; - } - } - } - - // Expand the selection to line ends. - function expandSelectionToLine(_cm, curStart, curEnd) { - curStart.ch = 0; - curEnd.ch = 0; - curEnd.line++; - } - - function findFirstNonWhiteSpaceCharacter(text) { - if (!text) { - return 0; - } - var firstNonWS = text.search(/\S/); - return firstNonWS == -1 ? text.length : firstNonWS; - } - - function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) { - var cur = getHead(cm); - var line = cm.getLine(cur.line); - var idx = cur.ch; - - // Seek to first word or non-whitespace character, depending on if - // noSymbol is true. - var textAfterIdx = line.substring(idx); - var firstMatchedChar; - if (noSymbol) { - firstMatchedChar = textAfterIdx.search(/\w/); - } else { - firstMatchedChar = textAfterIdx.search(/\S/); - } - if (firstMatchedChar == -1) { - return null; - } - idx += firstMatchedChar; - textAfterIdx = line.substring(idx); - var textBeforeIdx = line.substring(0, idx); - - var matchRegex; - // Greedy matchers for the "word" we are trying to expand. - if (bigWord) { - matchRegex = /^\S+/; - } else { - if ((/\w/).test(line.charAt(idx))) { - matchRegex = /^\w+/; - } else { - matchRegex = /^[^\w\s]+/; - } - } - - var wordAfterRegex = matchRegex.exec(textAfterIdx); - var wordStart = idx; - var wordEnd = idx + wordAfterRegex[0].length; - // TODO: Find a better way to do this. It will be slow on very long lines. - var revTextBeforeIdx = reverse(textBeforeIdx); - var wordBeforeRegex = matchRegex.exec(revTextBeforeIdx); - if (wordBeforeRegex) { - wordStart -= wordBeforeRegex[0].length; - } - - if (inclusive) { - // If present, trim all whitespace after word. - // Otherwise, trim all whitespace before word. - var textAfterWordEnd = line.substring(wordEnd); - var whitespacesAfterWord = textAfterWordEnd.match(/^\s*/)[0].length; - if (whitespacesAfterWord > 0) { - wordEnd += whitespacesAfterWord; - } else { - var revTrim = revTextBeforeIdx.length - wordStart; - var textBeforeWordStart = revTextBeforeIdx.substring(revTrim); - var whitespacesBeforeWord = textBeforeWordStart.match(/^\s*/)[0].length; - wordStart -= whitespacesBeforeWord; - } - } - - return { start: Pos(cur.line, wordStart), - end: Pos(cur.line, wordEnd) }; - } - - function recordJumpPosition(cm, oldCur, newCur) { - if (!cursorEqual(oldCur, newCur)) { - vimGlobalState.jumpList.add(cm, oldCur, newCur); - } - } - - function recordLastCharacterSearch(increment, args) { - vimGlobalState.lastChararacterSearch.increment = increment; - vimGlobalState.lastChararacterSearch.forward = args.forward; - vimGlobalState.lastChararacterSearch.selectedCharacter = args.selectedCharacter; - } - - var symbolToMode = { - '(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket', - '[': 'section', ']': 'section', - '*': 'comment', '/': 'comment', - 'm': 'method', 'M': 'method', - '#': 'preprocess' - }; - var findSymbolModes = { - bracket: { - isComplete: function(state) { - if (state.nextCh === state.symb) { - state.depth++; - if (state.depth >= 1)return true; - } else if (state.nextCh === state.reverseSymb) { - state.depth--; - } - return false; - } - }, - section: { - init: function(state) { - state.curMoveThrough = true; - state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}'; - }, - isComplete: function(state) { - return state.index === 0 && state.nextCh === state.symb; - } - }, - comment: { - isComplete: function(state) { - var found = state.lastCh === '*' && state.nextCh === '/'; - state.lastCh = state.nextCh; - return found; - } - }, - // TODO: The original Vim implementation only operates on level 1 and 2. - // The current implementation doesn't check for code block level and - // therefore it operates on any levels. - method: { - init: function(state) { - state.symb = (state.symb === 'm' ? '{' : '}'); - state.reverseSymb = state.symb === '{' ? '}' : '{'; - }, - isComplete: function(state) { - if (state.nextCh === state.symb)return true; - return false; - } - }, - preprocess: { - init: function(state) { - state.index = 0; - }, - isComplete: function(state) { - if (state.nextCh === '#') { - var token = state.lineText.match(/#(\w+)/)[1]; - if (token === 'endif') { - if (state.forward && state.depth === 0) { - return true; - } - state.depth++; - } else if (token === 'if') { - if (!state.forward && state.depth === 0) { - return true; - } - state.depth--; - } - if (token === 'else' && state.depth === 0)return true; - } - return false; - } - } - }; - function findSymbol(cm, repeat, forward, symb) { - var cur = copyCursor(cm.getCursor()); - var increment = forward ? 1 : -1; - var endLine = forward ? cm.lineCount() : -1; - var curCh = cur.ch; - var line = cur.line; - var lineText = cm.getLine(line); - var state = { - lineText: lineText, - nextCh: lineText.charAt(curCh), - lastCh: null, - index: curCh, - symb: symb, - reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb], - forward: forward, - depth: 0, - curMoveThrough: false - }; - var mode = symbolToMode[symb]; - if (!mode)return cur; - var init = findSymbolModes[mode].init; - var isComplete = findSymbolModes[mode].isComplete; - if (init) { init(state); } - while (line !== endLine && repeat) { - state.index += increment; - state.nextCh = state.lineText.charAt(state.index); - if (!state.nextCh) { - line += increment; - state.lineText = cm.getLine(line) || ''; - if (increment > 0) { - state.index = 0; - } else { - var lineLen = state.lineText.length; - state.index = (lineLen > 0) ? (lineLen-1) : 0; - } - state.nextCh = state.lineText.charAt(state.index); - } - if (isComplete(state)) { - cur.line = line; - cur.ch = state.index; - repeat--; - } - } - if (state.nextCh || state.curMoveThrough) { - return Pos(line, state.index); - } - return cur; - } - - /* - * Returns the boundaries of the next word. If the cursor in the middle of - * the word, then returns the boundaries of the current word, starting at - * the cursor. If the cursor is at the start/end of a word, and we are going - * forward/backward, respectively, find the boundaries of the next word. - * - * @param {CodeMirror} cm CodeMirror object. - * @param {Cursor} cur The cursor position. - * @param {boolean} forward True to search forward. False to search - * backward. - * @param {boolean} bigWord True if punctuation count as part of the word. - * False if only [a-zA-Z0-9] characters count as part of the word. - * @param {boolean} emptyLineIsWord True if empty lines should be treated - * as words. - * @return {Object{from:number, to:number, line: number}} The boundaries of - * the word, or null if there are no more words. - */ - function findWord(cm, cur, forward, bigWord, emptyLineIsWord) { - var lineNum = cur.line; - var pos = cur.ch; - var line = cm.getLine(lineNum); - var dir = forward ? 1 : -1; - var regexps = bigWord ? bigWordRegexp : wordRegexp; - - if (emptyLineIsWord && line == '') { - lineNum += dir; - line = cm.getLine(lineNum); - if (!isLine(cm, lineNum)) { - return null; - } - pos = (forward) ? 0 : line.length; - } - - while (true) { - if (emptyLineIsWord && line == '') { - return { from: 0, to: 0, line: lineNum }; - } - var stop = (dir > 0) ? line.length : -1; - var wordStart = stop, wordEnd = stop; - // Find bounds of next word. - while (pos != stop) { - var foundWord = false; - for (var i = 0; i < regexps.length && !foundWord; ++i) { - if (regexps[i].test(line.charAt(pos))) { - wordStart = pos; - // Advance to end of word. - while (pos != stop && regexps[i].test(line.charAt(pos))) { - pos += dir; - } - wordEnd = pos; - foundWord = wordStart != wordEnd; - if (wordStart == cur.ch && lineNum == cur.line && - wordEnd == wordStart + dir) { - // We started at the end of a word. Find the next one. - continue; - } else { - return { - from: Math.min(wordStart, wordEnd + 1), - to: Math.max(wordStart, wordEnd), - line: lineNum }; - } - } - } - if (!foundWord) { - pos += dir; - } - } - // Advance to next/prev line. - lineNum += dir; - if (!isLine(cm, lineNum)) { - return null; - } - line = cm.getLine(lineNum); - pos = (dir > 0) ? 0 : line.length; - } - // Should never get here. - throw new Error('The impossible happened.'); - } - - /** - * @param {CodeMirror} cm CodeMirror object. - * @param {Pos} cur The position to start from. - * @param {int} repeat Number of words to move past. - * @param {boolean} forward True to search forward. False to search - * backward. - * @param {boolean} wordEnd True to move to end of word. False to move to - * beginning of word. - * @param {boolean} bigWord True if punctuation count as part of the word. - * False if only alphabet characters count as part of the word. - * @return {Cursor} The position the cursor should move to. - */ - function moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) { - var curStart = copyCursor(cur); - var words = []; - if (forward && !wordEnd || !forward && wordEnd) { - repeat++; - } - // For 'e', empty lines are not considered words, go figure. - var emptyLineIsWord = !(forward && wordEnd); - for (var i = 0; i < repeat; i++) { - var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord); - if (!word) { - var eodCh = lineLength(cm, cm.lastLine()); - words.push(forward - ? {line: cm.lastLine(), from: eodCh, to: eodCh} - : {line: 0, from: 0, to: 0}); - break; - } - words.push(word); - cur = Pos(word.line, forward ? (word.to - 1) : word.from); - } - var shortCircuit = words.length != repeat; - var firstWord = words[0]; - var lastWord = words.pop(); - if (forward && !wordEnd) { - // w - if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) { - // We did not start in the middle of a word. Discard the extra word at the end. - lastWord = words.pop(); - } - return Pos(lastWord.line, lastWord.from); - } else if (forward && wordEnd) { - return Pos(lastWord.line, lastWord.to - 1); - } else if (!forward && wordEnd) { - // ge - if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) { - // We did not start in the middle of a word. Discard the extra word at the end. - lastWord = words.pop(); - } - return Pos(lastWord.line, lastWord.to); - } else { - // b - return Pos(lastWord.line, lastWord.from); - } - } - - function moveToCharacter(cm, repeat, forward, character) { - var cur = cm.getCursor(); - var start = cur.ch; - var idx; - for (var i = 0; i < repeat; i ++) { - var line = cm.getLine(cur.line); - idx = charIdxInLine(start, line, character, forward, true); - if (idx == -1) { - return null; - } - start = idx; - } - return Pos(cm.getCursor().line, idx); - } - - function moveToColumn(cm, repeat) { - // repeat is always >= 1, so repeat - 1 always corresponds - // to the column we want to go to. - var line = cm.getCursor().line; - return clipCursorToContent(cm, Pos(line, repeat - 1)); - } - - function updateMark(cm, vim, markName, pos) { - if (!inArray(markName, validMarks)) { - return; - } - if (vim.marks[markName]) { - vim.marks[markName].clear(); - } - vim.marks[markName] = cm.setBookmark(pos); - } - - function charIdxInLine(start, line, character, forward, includeChar) { - // Search for char in line. - // motion_options: {forward, includeChar} - // If includeChar = true, include it too. - // If forward = true, search forward, else search backwards. - // If char is not found on this line, do nothing - var idx; - if (forward) { - idx = line.indexOf(character, start + 1); - if (idx != -1 && !includeChar) { - idx -= 1; - } - } else { - idx = line.lastIndexOf(character, start - 1); - if (idx != -1 && !includeChar) { - idx += 1; - } - } - return idx; - } - - function findParagraph(cm, head, repeat, dir, inclusive) { - var line = head.line; - var min = cm.firstLine(); - var max = cm.lastLine(); - var start, end, i = line; - function isEmpty(i) { return !cm.getLine(i); } - function isBoundary(i, dir, any) { - if (any) { return isEmpty(i) != isEmpty(i + dir); } - return !isEmpty(i) && isEmpty(i + dir); - } - if (dir) { - while (min <= i && i <= max && repeat > 0) { - if (isBoundary(i, dir)) { repeat--; } - i += dir; - } - return new Pos(i, 0); - } - - var vim = cm.state.vim; - if (vim.visualLine && isBoundary(line, 1, true)) { - var anchor = vim.sel.anchor; - if (isBoundary(anchor.line, -1, true)) { - if (!inclusive || anchor.line != line) { - line += 1; - } - } - } - var startState = isEmpty(line); - for (i = line; i <= max && repeat; i++) { - if (isBoundary(i, 1, true)) { - if (!inclusive || isEmpty(i) != startState) { - repeat--; - } - } - } - end = new Pos(i, 0); - // select boundary before paragraph for the last one - if (i > max && !startState) { startState = true; } - else { inclusive = false; } - for (i = line; i > min; i--) { - if (!inclusive || isEmpty(i) == startState || i == line) { - if (isBoundary(i, -1, true)) { break; } - } - } - start = new Pos(i, 0); - return { start: start, end: end }; - } - - // TODO: perhaps this finagling of start and end positions belonds - // in codmirror/replaceRange? - function selectCompanionObject(cm, head, symb, inclusive) { - var cur = head, start, end; - - var bracketRegexp = ({ - '(': /[()]/, ')': /[()]/, - '[': /[[\]]/, ']': /[[\]]/, - '{': /[{}]/, '}': /[{}]/})[symb]; - var openSym = ({ - '(': '(', ')': '(', - '[': '[', ']': '[', - '{': '{', '}': '{'})[symb]; - var curChar = cm.getLine(cur.line).charAt(cur.ch); - // Due to the behavior of scanForBracket, we need to add an offset if the - // 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}); - - if (!start || !end) { - return { start: cur, end: cur }; - } - - start = start.pos; - end = end.pos; - - if ((start.line == end.line && start.ch > end.ch) - || (start.line > end.line)) { - var tmp = start; - start = end; - end = tmp; - } - - if (inclusive) { - end.ch += 1; - } else { - start.ch += 1; - } - - return { start: start, end: end }; - } - - // Takes in a symbol and a cursor and tries to simulate text objects that - // have identical opening and closing symbols - // TODO support across multiple lines - function findBeginningAndEnd(cm, head, symb, inclusive) { - var cur = copyCursor(head); - var line = cm.getLine(cur.line); - var chars = line.split(''); - var start, end, i, len; - var firstIndex = chars.indexOf(symb); - - // the decision tree is to always look backwards for the beginning first, - // but if the cursor is in front of the first instance of the symb, - // then move the cursor forward - if (cur.ch < firstIndex) { - cur.ch = firstIndex; - // Why is this line even here??? - // cm.setCursor(cur.line, firstIndex+1); - } - // otherwise if the cursor is currently on the closing symbol - else if (firstIndex < cur.ch && chars[cur.ch] == symb) { - end = cur.ch; // assign end to the current cursor - --cur.ch; // make sure to look backwards - } - - // if we're currently on the symbol, we've got a start - if (chars[cur.ch] == symb && !end) { - start = cur.ch + 1; // assign start to ahead of the cursor - } else { - // go backwards to find the start - for (i = cur.ch; i > -1 && !start; i--) { - if (chars[i] == symb) { - start = i + 1; - } - } - } - - // look forwards for the end symbol - if (start && !end) { - for (i = start, len = chars.length; i < len && !end; i++) { - if (chars[i] == symb) { - end = i; - } - } - } - - // nothing found - if (!start || !end) { - return { start: cur, end: cur }; - } - - // include the symbols - if (inclusive) { - --start; ++end; - } - - return { - start: Pos(cur.line, start), - end: Pos(cur.line, end) - }; - } - - // Search functions - defineOption('pcre', true, 'boolean'); - function SearchState() {} - SearchState.prototype = { - getQuery: function() { - return vimGlobalState.query; - }, - setQuery: function(query) { - vimGlobalState.query = query; - }, - getOverlay: function() { - return this.searchOverlay; - }, - setOverlay: function(overlay) { - this.searchOverlay = overlay; - }, - isReversed: function() { - return vimGlobalState.isReversed; - }, - setReversed: function(reversed) { - vimGlobalState.isReversed = reversed; - }, - getScrollbarAnnotate: function() { - return this.annotate; - }, - setScrollbarAnnotate: function(annotate) { - this.annotate = annotate; - } - }; - function getSearchState(cm) { - var vim = cm.state.vim; - return vim.searchState_ || (vim.searchState_ = new SearchState()); - } - function dialog(cm, template, shortText, onClose, options) { - if (cm.openDialog) { - cm.openDialog(template, onClose, { bottom: true, value: options.value, - onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp }); - } - else { - onClose(prompt(shortText, '')); - } - } - function splitBySlash(argString) { - var slashes = findUnescapedSlashes(argString) || []; - if (!slashes.length) return []; - var tokens = []; - // in case of strings like foo/bar - if (slashes[0] !== 0) return; - for (var i = 0; i < slashes.length; i++) { - if (typeof slashes[i] == 'number') - tokens.push(argString.substring(slashes[i] + 1, slashes[i+1])); - } - return tokens; - } - - function findUnescapedSlashes(str) { - var escapeNextChar = false; - var slashes = []; - for (var i = 0; i < str.length; i++) { - var c = str.charAt(i); - if (!escapeNextChar && c == '/') { - slashes.push(i); - } - escapeNextChar = !escapeNextChar && (c == '\\'); - } - return slashes; - } - - // Translates a search string from ex (vim) syntax into javascript form. - function translateRegex(str) { - // When these match, add a '\' if unescaped or remove one if escaped. - var specials = '|(){'; - // Remove, but never add, a '\' for these. - var unescape = '}'; - var escapeNextChar = false; - var out = []; - for (var i = -1; i < str.length; i++) { - var c = str.charAt(i) || ''; - var n = str.charAt(i+1) || ''; - var specialComesNext = (n && specials.indexOf(n) != -1); - if (escapeNextChar) { - if (c !== '\\' || !specialComesNext) { - out.push(c); - } - escapeNextChar = false; - } else { - if (c === '\\') { - escapeNextChar = true; - // Treat the unescape list as special for removing, but not adding '\'. - if (n && unescape.indexOf(n) != -1) { - specialComesNext = true; - } - // Not passing this test means removing a '\'. - if (!specialComesNext || n === '\\') { - out.push(c); - } - } else { - out.push(c); - if (specialComesNext && n !== '\\') { - out.push('\\'); - } - } - } - } - return out.join(''); - } - - // Translates the replace part of a search and replace from ex (vim) syntax into - // javascript form. Similar to translateRegex, but additionally fixes back references - // (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'. - function translateRegexReplace(str) { - var escapeNextChar = false; - var out = []; - for (var i = -1; i < str.length; i++) { - var c = str.charAt(i) || ''; - var n = str.charAt(i+1) || ''; - if (escapeNextChar) { - // At any point in the loop, escapeNextChar is true if the previous - // character was a '\' and was not escaped. - out.push(c); - escapeNextChar = false; - } else { - if (c === '\\') { - escapeNextChar = true; - if ((isNumber(n) || n === '$')) { - out.push('$'); - } else if (n !== '/' && n !== '\\') { - out.push('\\'); - } - } else { - if (c === '$') { - out.push('$'); - } - out.push(c); - if (n === '/') { - out.push('\\'); - } - } - } - } - return out.join(''); - } - - // Unescape \ and / in the replace part, for PCRE mode. - function unescapeRegexReplace(str) { - var stream = new CodeMirror.StringStream(str); - var output = []; - while (!stream.eol()) { - // Search for \. - while (stream.peek() && stream.peek() != '\\') { - output.push(stream.next()); - } - if (stream.match('\\/', true)) { - // \/ => / - output.push('/'); - } else if (stream.match('\\\\', true)) { - // \\ => \ - output.push('\\'); - } else { - // Don't change anything - output.push(stream.next()); - } - } - return output.join(''); - } - - /** - * Extract the regular expression from the query and return a Regexp object. - * Returns null if the query is blank. - * If ignoreCase is passed in, the Regexp object will have the 'i' flag set. - * If smartCase is passed in, and the query contains upper case letters, - * then ignoreCase is overridden, and the 'i' flag will not be set. - * If the query contains the /i in the flag part of the regular expression, - * then both ignoreCase and smartCase are ignored, and 'i' will be passed - * through to the Regex object. - */ - function parseQuery(query, ignoreCase, smartCase) { - // First update the last search register - var lastSearchRegister = vimGlobalState.registerController.getRegister('/'); - lastSearchRegister.setText(query); - // Check if the query is already a regex. - if (query instanceof RegExp) { return query; } - // First try to extract regex + flags from the input. If no flags found, - // extract just the regex. IE does not accept flags directly defined in - // the regex string in the form /regex/flags - var slashes = findUnescapedSlashes(query); - var regexPart; - var forceIgnoreCase; - if (!slashes.length) { - // Query looks like 'regexp' - regexPart = query; - } else { - // Query looks like 'regexp/...' - regexPart = query.substring(0, slashes[0]); - var flagsPart = query.substring(slashes[0]); - forceIgnoreCase = (flagsPart.indexOf('i') != -1); - } - if (!regexPart) { - return null; - } - if (!getOption('pcre')) { - regexPart = translateRegex(regexPart); - } - if (smartCase) { - ignoreCase = (/^[^A-Z]*$/).test(regexPart); - } - var regexp = new RegExp(regexPart, - (ignoreCase || forceIgnoreCase) ? 'i' : undefined); - return regexp; - } - function showConfirm(cm, text) { - if (cm.openNotification) { - cm.openNotification('' + text + '', - {bottom: true, duration: 5000}); - } else { - alert(text); - } - } - function makePrompt(prefix, desc) { - var raw = ''; - if (prefix) { - raw += '' + prefix + ''; - } - raw += ' ' + - ''; - if (desc) { - raw += ''; - raw += desc; - raw += ''; - } - return raw; - } - var searchPromptDesc = '(Javascript regexp)'; - function showPrompt(cm, options) { - var shortText = (options.prefix || '') + ' ' + (options.desc || ''); - var prompt = makePrompt(options.prefix, options.desc); - dialog(cm, prompt, shortText, options.onClose, options); - } - function regexEqual(r1, r2) { - if (r1 instanceof RegExp && r2 instanceof RegExp) { - var props = ['global', 'multiline', 'ignoreCase', 'source']; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (r1[prop] !== r2[prop]) { - return false; - } - } - return true; - } - return false; - } - // Returns true if the query is valid. - function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) { - if (!rawQuery) { - return; - } - var state = getSearchState(cm); - var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase); - if (!query) { - return; - } - highlightSearchMatches(cm, query); - if (regexEqual(query, state.getQuery())) { - return query; - } - state.setQuery(query); - return query; - } - function searchOverlay(query) { - if (query.source.charAt(0) == '^') { - var matchSol = true; - } - return { - token: function(stream) { - if (matchSol && !stream.sol()) { - stream.skipToEnd(); - return; - } - var match = stream.match(query, false); - if (match) { - if (match[0].length == 0) { - // Matched empty string, skip to next. - stream.next(); - return 'searching'; - } - if (!stream.sol()) { - // Backtrack 1 to match \b - stream.backUp(1); - if (!query.exec(stream.next() + match[0])) { - stream.next(); - return null; - } - } - stream.match(query); - return 'searching'; - } - while (!stream.eol()) { - stream.next(); - if (stream.match(query, false)) break; - } - }, - query: query - }; - } - function highlightSearchMatches(cm, query) { - var searchState = getSearchState(cm); - var overlay = searchState.getOverlay(); - if (!overlay || query != overlay.query) { - if (overlay) { - cm.removeOverlay(overlay); - } - overlay = searchOverlay(query); - cm.addOverlay(overlay); - if (cm.showMatchesOnScrollbar) { - if (searchState.getScrollbarAnnotate()) { - searchState.getScrollbarAnnotate().clear(); - } - searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query)); - } - searchState.setOverlay(overlay); - } - } - function findNext(cm, prev, query, repeat) { - if (repeat === undefined) { repeat = 1; } - return cm.operation(function() { - var pos = cm.getCursor(); - var cursor = cm.getSearchCursor(query, pos); - for (var i = 0; i < repeat; i++) { - var found = cursor.find(prev); - if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); } - if (!found) { - // SearchCursor may have returned null because it hit EOF, wrap - // around and try again. - cursor = cm.getSearchCursor(query, - (prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) ); - if (!cursor.find(prev)) { - return; - } - } - } - return cursor.from(); - }); - } - function clearSearchHighlight(cm) { - var state = getSearchState(cm); - cm.removeOverlay(getSearchState(cm).getOverlay()); - state.setOverlay(null); - if (state.getScrollbarAnnotate()) { - state.getScrollbarAnnotate().clear(); - state.setScrollbarAnnotate(null); - } - } - /** - * Check if pos is in the specified range, INCLUSIVE. - * Range can be specified with 1 or 2 arguments. - * If the first range argument is an array, treat it as an array of line - * numbers. Match pos against any of the lines. - * If the first range argument is a number, - * if there is only 1 range argument, check if pos has the same line - * number - * if there are 2 range arguments, then check if pos is in between the two - * range arguments. - */ - function isInRange(pos, start, end) { - if (typeof pos != 'number') { - // Assume it is a cursor position. Get the line number. - pos = pos.line; - } - if (start instanceof Array) { - return inArray(pos, start); - } else { - if (end) { - return (pos >= start && pos <= end); - } else { - return pos == start; - } - } - } - function getUserVisibleLines(cm) { - var scrollInfo = cm.getScrollInfo(); - var occludeToleranceTop = 6; - var occludeToleranceBottom = 10; - var from = cm.coordsChar({left:0, top: occludeToleranceTop + scrollInfo.top}, 'local'); - var bottomY = scrollInfo.clientHeight - occludeToleranceBottom + scrollInfo.top; - var to = cm.coordsChar({left:0, top: bottomY}, 'local'); - return {top: from.line, bottom: to.line}; - } - - // Ex command handling - // Care must be taken when adding to the default Ex command map. For any - // pair of commands that have a shared prefix, at least one of their - // shortNames must not match the prefix of the other command. - var defaultExCommandMap = [ - { 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: 'set' }, - { name: 'sort', shortName: 'sor' }, - { name: 'substitute', shortName: 's', possiblyAsync: true }, - { name: 'nohlsearch', shortName: 'noh' }, - { name: 'delmarks', shortName: 'delm' }, - { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, - { name: 'global', shortName: 'g' } - ]; - var ExCommandDispatcher = function() { - this.buildCommandMap_(); - }; - ExCommandDispatcher.prototype = { - processCommand: function(cm, input, opt_params) { - var vim = cm.state.vim; - var commandHistoryRegister = vimGlobalState.registerController.getRegister(':'); - var previousCommand = commandHistoryRegister.toString(); - if (vim.visualMode) { - exitVisualMode(cm); - } - var inputStream = new CodeMirror.StringStream(input); - // update ": with the latest command whether valid or invalid - commandHistoryRegister.setText(input); - var params = opt_params || {}; - params.input = input; - try { - this.parseInput_(cm, inputStream, params); - } catch(e) { - showConfirm(cm, e); - throw e; - } - var command; - var commandName; - if (!params.commandName) { - // If only a line range is defined, move to the line. - if (params.line !== undefined) { - commandName = 'move'; - } - } else { - command = this.matchCommand_(params.commandName); - if (command) { - commandName = command.name; - if (command.excludeFromCommandHistory) { - commandHistoryRegister.setText(previousCommand); - } - this.parseCommandArgs_(inputStream, params, command); - if (command.type == 'exToKey') { - // Handle Ex to Key mapping. - for (var i = 0; i < command.toKeys.length; i++) { - CodeMirror.Vim.handleKey(cm, command.toKeys[i], 'mapping'); - } - return; - } else if (command.type == 'exToEx') { - // Handle Ex to Ex mapping. - this.processCommand(cm, command.toInput); - return; - } - } - } - if (!commandName) { - showConfirm(cm, 'Not an editor command ":' + input + '"'); - return; - } - try { - exCommands[commandName](cm, params); - // Possibly asynchronous commands (e.g. substitute, which might have a - // user confirmation), are responsible for calling the callback when - // done. All others have it taken care of for them here. - if ((!command || !command.possiblyAsync) && params.callback) { - params.callback(); - } - } catch(e) { - showConfirm(cm, e); - throw e; - } - }, - parseInput_: function(cm, inputStream, result) { - inputStream.eatWhile(':'); - // Parse range. - if (inputStream.eat('%')) { - result.line = cm.firstLine(); - result.lineEnd = cm.lastLine(); - } else { - result.line = this.parseLineSpec_(cm, inputStream); - if (result.line !== undefined && inputStream.eat(',')) { - result.lineEnd = this.parseLineSpec_(cm, inputStream); - } - } - - // Parse command name. - var commandMatch = inputStream.match(/^(\w+)/); - if (commandMatch) { - result.commandName = commandMatch[1]; - } else { - result.commandName = inputStream.match(/.*/)[0]; - } - - return result; - }, - parseLineSpec_: function(cm, inputStream) { - var numberMatch = inputStream.match(/^(\d+)/); - if (numberMatch) { - return parseInt(numberMatch[1], 10) - 1; - } - switch (inputStream.next()) { - case '.': - return cm.getCursor().line; - case '$': - return cm.lastLine(); - case '\'': - var mark = cm.state.vim.marks[inputStream.next()]; - if (mark && mark.find()) { - return mark.find().line; - } - throw new Error('Mark not set'); - default: - inputStream.backUp(1); - return undefined; - } - }, - parseCommandArgs_: function(inputStream, params, command) { - if (inputStream.eol()) { - return; - } - params.argString = inputStream.match(/.*/)[0]; - // Parse command-line arguments - var delim = command.argDelimiter || /\s+/; - var args = trim(params.argString).split(delim); - if (args.length && args[0]) { - params.args = args; - } - }, - matchCommand_: function(commandName) { - // Return the command in the command map that matches the shortest - // prefix of the passed in command name. The match is guaranteed to be - // unambiguous if the defaultExCommandMap's shortNames are set up - // correctly. (see @code{defaultExCommandMap}). - for (var i = commandName.length; i > 0; i--) { - var prefix = commandName.substring(0, i); - if (this.commandMap_[prefix]) { - var command = this.commandMap_[prefix]; - if (command.name.indexOf(commandName) === 0) { - return command; - } - } - } - return null; - }, - buildCommandMap_: function() { - this.commandMap_ = {}; - for (var i = 0; i < defaultExCommandMap.length; i++) { - var command = defaultExCommandMap[i]; - var key = command.shortName || command.name; - this.commandMap_[key] = command; - } - }, - map: function(lhs, rhs, ctx) { - if (lhs != ':' && lhs.charAt(0) == ':') { - if (ctx) { throw Error('Mode not supported for ex mappings'); } - var commandName = lhs.substring(1); - if (rhs != ':' && rhs.charAt(0) == ':') { - // Ex to Ex mapping - this.commandMap_[commandName] = { - name: commandName, - type: 'exToEx', - toInput: rhs.substring(1), - user: true - }; - } else { - // Ex to key mapping - this.commandMap_[commandName] = { - name: commandName, - type: 'exToKey', - toKeys: rhs, - user: true - }; - } - } else { - if (rhs != ':' && rhs.charAt(0) == ':') { - // Key to Ex mapping. - var mapping = { - keys: lhs, - type: 'keyToEx', - exArgs: { input: rhs.substring(1) }, - user: true}; - if (ctx) { mapping.context = ctx; } - defaultKeymap.unshift(mapping); - } else { - // Key to key mapping - var mapping = { - keys: lhs, - type: 'keyToKey', - toKeys: rhs, - user: true - }; - if (ctx) { mapping.context = ctx; } - defaultKeymap.unshift(mapping); - } - } - }, - unmap: function(lhs, ctx) { - if (lhs != ':' && lhs.charAt(0) == ':') { - // Ex to Ex or Ex to key mapping - if (ctx) { throw Error('Mode not supported for ex mappings'); } - var commandName = lhs.substring(1); - if (this.commandMap_[commandName] && this.commandMap_[commandName].user) { - delete this.commandMap_[commandName]; - return; - } - } else { - // Key to Ex or key to key mapping - var keys = lhs; - for (var i = 0; i < defaultKeymap.length; i++) { - if (keys == defaultKeymap[i].keys - && defaultKeymap[i].context === ctx - && defaultKeymap[i].user) { - defaultKeymap.splice(i, 1); - return; - } - } - } - throw Error('No such mapping.'); - } - }; - - var exCommands = { - map: function(cm, params, ctx) { - var mapArgs = params.args; - if (!mapArgs || mapArgs.length < 2) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); - } - return; - } - exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx); - }, - imap: function(cm, params) { this.map(cm, params, 'insert'); }, - nmap: function(cm, params) { this.map(cm, params, 'normal'); }, - vmap: function(cm, params) { this.map(cm, params, 'visual'); }, - unmap: function(cm, params, ctx) { - var mapArgs = params.args; - if (!mapArgs || mapArgs.length < 1) { - if (cm) { - showConfirm(cm, 'No such mapping: ' + params.input); - } - return; - } - exCommandDispatcher.unmap(mapArgs[0], ctx); - }, - move: function(cm, params) { - commandDispatcher.processCommand(cm, cm.state.vim, { - type: 'motion', - motion: 'moveToLineOrEdgeOfDocument', - motionArgs: { forward: false, explicitRepeat: true, - linewise: true }, - repeatOverride: params.line+1}); - }, - set: function(cm, params) { - var setArgs = params.args; - if (!setArgs || setArgs.length < 1) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); - } - return; - } - var expr = setArgs[0].split('='); - var optionName = expr[0]; - var value = expr[1]; - var forceGet = false; - - if (optionName.charAt(optionName.length - 1) == '?') { - // If post-fixed with ?, then the set is actually a get. - if (value) { throw Error('Trailing characters: ' + params.argString); } - optionName = optionName.substring(0, optionName.length - 1); - forceGet = true; - } - if (value === undefined && optionName.substring(0, 2) == 'no') { - // To set boolean options to false, the option name is prefixed with - // 'no'. - optionName = optionName.substring(2); - value = false; - } - var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean'; - if (optionIsBoolean && value == undefined) { - // Calling set with a boolean option sets it to true. - value = true; - } - if (!optionIsBoolean && !value || forceGet) { - var oldValue = getOption(optionName); - // If no value is provided, then we assume this is a get. - if (oldValue === true || oldValue === false) { - showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName); - } else { - showConfirm(cm, ' ' + optionName + '=' + oldValue); - } - } else { - setOption(optionName, value); - } - }, - registers: function(cm,params) { - var regArgs = params.args; - var registers = vimGlobalState.registerController.registers; - var regInfo = '----------Registers----------

'; - if (!regArgs) { - for (var registerName in registers) { - var text = registers[registerName].toString(); - if (text.length) { - regInfo += '"' + registerName + ' ' + text + '
'; - } - } - } else { - var registerName; - regArgs = regArgs.join(''); - for (var i = 0; i < regArgs.length; i++) { - registerName = regArgs.charAt(i); - if (!vimGlobalState.registerController.isValidRegister(registerName)) { - continue; - } - var register = registers[registerName] || new Register(); - regInfo += '"' + registerName + ' ' + register.toString() + '
'; - } - } - showConfirm(cm, regInfo); - }, - sort: function(cm, params) { - var reverse, ignoreCase, unique, number; - function parseArgs() { - if (params.argString) { - var args = new CodeMirror.StringStream(params.argString); - if (args.eat('!')) { reverse = true; } - if (args.eol()) { return; } - if (!args.eatSpace()) { return 'Invalid arguments'; } - var opts = args.match(/[a-z]+/); - if (opts) { - opts = opts[0]; - ignoreCase = opts.indexOf('i') != -1; - unique = opts.indexOf('u') != -1; - var decimal = opts.indexOf('d') != -1 && 1; - var hex = opts.indexOf('x') != -1 && 1; - var octal = opts.indexOf('o') != -1 && 1; - if (decimal + hex + octal > 1) { return 'Invalid arguments'; } - number = decimal && 'decimal' || hex && 'hex' || octal && 'octal'; - } - if (args.eatSpace() && args.match(/\/.*\//)) { 'patterns not supported'; } - } - } - var err = parseArgs(); - if (err) { - showConfirm(cm, err + ': ' + params.argString); - return; - } - var lineStart = params.line || cm.firstLine(); - var lineEnd = params.lineEnd || params.line || cm.lastLine(); - if (lineStart == lineEnd) { return; } - var curStart = Pos(lineStart, 0); - var curEnd = Pos(lineEnd, lineLength(cm, lineEnd)); - var text = cm.getRange(curStart, curEnd).split('\n'); - var numberRegex = (number == 'decimal') ? /(-?)([\d]+)/ : - (number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i : - (number == 'octal') ? /([0-7]+)/ : null; - var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null; - var numPart = [], textPart = []; - if (number) { - for (var i = 0; i < text.length; i++) { - if (numberRegex.exec(text[i])) { - numPart.push(text[i]); - } else { - textPart.push(text[i]); - } - } - } else { - textPart = text; - } - function compareFn(a, b) { - if (reverse) { var tmp; tmp = a; a = b; b = tmp; } - if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); } - var anum = number && numberRegex.exec(a); - var bnum = number && numberRegex.exec(b); - if (!anum) { return a < b ? -1 : 1; } - anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix); - bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix); - return anum - bnum; - } - numPart.sort(compareFn); - textPart.sort(compareFn); - text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart); - if (unique) { // Remove duplicate lines - var textOld = text; - var lastLine; - text = []; - for (var i = 0; i < textOld.length; i++) { - if (textOld[i] != lastLine) { - text.push(textOld[i]); - } - lastLine = textOld[i]; - } - } - cm.replaceRange(text.join('\n'), curStart, curEnd); - }, - global: function(cm, params) { - // a global command is of the form - // :[range]g/pattern/[cmd] - // argString holds the string /pattern/[cmd] - var argString = params.argString; - if (!argString) { - showConfirm(cm, 'Regular Expression missing from global'); - return; - } - // range is specified here - var lineStart = (params.line !== undefined) ? params.line : cm.firstLine(); - var lineEnd = params.lineEnd || params.line || cm.lastLine(); - // get the tokens from argString - var tokens = splitBySlash(argString); - var regexPart = argString, cmd; - if (tokens.length) { - regexPart = tokens[0]; - cmd = tokens.slice(1, tokens.length).join('/'); - } - if (regexPart) { - // If regex part is empty, then use the previous query. Otherwise - // use the regex part as the new query. - try { - updateSearchQuery(cm, regexPart, true /** ignoreCase */, - true /** smartCase */); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + regexPart); - return; - } - } - // now that we have the regexPart, search for regex matches in the - // specified range of lines - var query = getSearchState(cm).getQuery(); - var matchedLines = [], content = ''; - for (var i = lineStart; i <= lineEnd; i++) { - var matched = query.test(cm.getLine(i)); - if (matched) { - matchedLines.push(i+1); - content+= cm.getLine(i) + '
'; - } - } - // if there is no [cmd], just display the list of matched lines - if (!cmd) { - showConfirm(cm, content); - return; - } - var index = 0; - var nextCommand = function() { - if (index < matchedLines.length) { - var command = matchedLines[index] + cmd; - exCommandDispatcher.processCommand(cm, command, { - callback: nextCommand - }); - } - index++; - }; - nextCommand(); - }, - substitute: function(cm, params) { - if (!cm.getSearchCursor) { - throw new Error('Search feature not available. Requires searchcursor.js or ' + - 'any other getSearchCursor implementation.'); - } - var argString = params.argString; - var tokens = argString ? splitBySlash(argString) : []; - var regexPart, replacePart = '', trailing, flagsPart, count; - var confirm = false; // Whether to confirm each replace. - var global = false; // True to replace all instances on a line, false to replace only 1. - if (tokens.length) { - regexPart = tokens[0]; - replacePart = tokens[1]; - if (replacePart !== undefined) { - if (getOption('pcre')) { - replacePart = unescapeRegexReplace(replacePart); - } else { - replacePart = translateRegexReplace(replacePart); - } - vimGlobalState.lastSubstituteReplacePart = replacePart; - } - trailing = tokens[2] ? tokens[2].split(' ') : []; - } else { - // either the argString is empty or its of the form ' hello/world' - // actually splitBySlash returns a list of tokens - // only if the string starts with a '/' - if (argString && argString.length) { - showConfirm(cm, 'Substitutions should be of the form ' + - ':s/pattern/replace/'); - return; - } - } - // After the 3rd slash, we can have flags followed by a space followed - // by count. - if (trailing) { - flagsPart = trailing[0]; - count = parseInt(trailing[1]); - if (flagsPart) { - if (flagsPart.indexOf('c') != -1) { - confirm = true; - flagsPart.replace('c', ''); - } - if (flagsPart.indexOf('g') != -1) { - global = true; - flagsPart.replace('g', ''); - } - regexPart = regexPart + '/' + flagsPart; - } - } - if (regexPart) { - // If regex part is empty, then use the previous query. Otherwise use - // the regex part as the new query. - try { - updateSearchQuery(cm, regexPart, true /** ignoreCase */, - true /** smartCase */); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + regexPart); - return; - } - } - replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart; - if (replacePart === undefined) { - showConfirm(cm, 'No previous substitute regular expression'); - return; - } - var state = getSearchState(cm); - var query = state.getQuery(); - var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line; - var lineEnd = params.lineEnd || lineStart; - if (count) { - lineStart = lineEnd; - lineEnd = lineStart + count - 1; - } - var startPos = clipCursorToContent(cm, Pos(lineStart, 0)); - var cursor = cm.getSearchCursor(query, startPos); - doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback); - }, - redo: CodeMirror.commands.redo, - undo: CodeMirror.commands.undo, - write: function(cm) { - if (CodeMirror.commands.save) { - // If a save command is defined, call it. - CodeMirror.commands.save(cm); - } else { - // Saves to text area if no save command is defined. - cm.save(); - } - }, - nohlsearch: function(cm) { - clearSearchHighlight(cm); - }, - delmarks: function(cm, params) { - if (!params.argString || !trim(params.argString)) { - showConfirm(cm, 'Argument required'); - return; - } - - var state = cm.state.vim; - var stream = new CodeMirror.StringStream(trim(params.argString)); - while (!stream.eol()) { - stream.eatSpace(); - - // Record the streams position at the beginning of the loop for use - // in error messages. - var count = stream.pos; - - if (!stream.match(/[a-zA-Z]/, false)) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - var sym = stream.next(); - // Check if this symbol is part of a range - if (stream.match('-', true)) { - // This symbol is part of a range. - - // The range must terminate at an alphabetic character. - if (!stream.match(/[a-zA-Z]/, false)) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - var startMark = sym; - var finishMark = stream.next(); - // The range must terminate at an alphabetic character which - // shares the same case as the start of the range. - if (isLowerCase(startMark) && isLowerCase(finishMark) || - isUpperCase(startMark) && isUpperCase(finishMark)) { - var start = startMark.charCodeAt(0); - var finish = finishMark.charCodeAt(0); - if (start >= finish) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - // Because marks are always ASCII values, and we have - // determined that they are the same case, we can use - // their char codes to iterate through the defined range. - for (var j = 0; j <= finish - start; j++) { - var mark = String.fromCharCode(start + j); - delete state.marks[mark]; - } - } else { - showConfirm(cm, 'Invalid argument: ' + startMark + '-'); - return; - } - } else { - // This symbol is a valid mark, and is not part of a range. - delete state.marks[sym]; - } - } - } - }; - - var exCommandDispatcher = new ExCommandDispatcher(); - - /** - * @param {CodeMirror} cm CodeMirror instance we are in. - * @param {boolean} confirm Whether to confirm each replace. - * @param {Cursor} lineStart Line to start replacing from. - * @param {Cursor} lineEnd Line to stop replacing at. - * @param {RegExp} query Query for performing matches with. - * @param {string} replaceWith Text to replace matches with. May contain $1, - * $2, etc for replacing captured groups using Javascript replace. - * @param {function()} callback A callback for when the replace is done. - */ - function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, - replaceWith, callback) { - // Set up all the functions. - cm.state.vim.exMode = true; - var done = false; - var lastPos = searchCursor.from(); - function replaceAll() { - cm.operation(function() { - while (!done) { - replace(); - next(); - } - stop(); - }); - } - function replace() { - var text = cm.getRange(searchCursor.from(), searchCursor.to()); - var newText = text.replace(query, replaceWith); - searchCursor.replace(newText); - } - function next() { - var found; - // The below only loops to skip over multiple occurrences on the same - // line when 'global' is not true. - while(found = searchCursor.findNext() && - isInRange(searchCursor.from(), lineStart, lineEnd)) { - if (!global && lastPos && searchCursor.from().line == lastPos.line) { - continue; - } - cm.scrollIntoView(searchCursor.from(), 30); - cm.setSelection(searchCursor.from(), searchCursor.to()); - lastPos = searchCursor.from(); - done = false; - return; - } - done = true; - } - function stop(close) { - if (close) { close(); } - cm.focus(); - if (lastPos) { - cm.setCursor(lastPos); - var vim = cm.state.vim; - vim.exMode = false; - vim.lastHPos = vim.lastHSPos = lastPos.ch; - } - if (callback) { callback(); } - } - function onPromptKeyDown(e, _value, close) { - // Swallow all keys. - CodeMirror.e_stop(e); - var keyName = CodeMirror.keyName(e); - switch (keyName) { - case 'Y': - replace(); next(); break; - case 'N': - next(); break; - case 'A': - // replaceAll contains a call to close of its own. We don't want it - // to fire too early or multiple times. - var savedCallback = callback; - callback = undefined; - cm.operation(replaceAll); - callback = savedCallback; - break; - case 'L': - replace(); - // fall through and exit. - case 'Q': - case 'Esc': - case 'Ctrl-C': - case 'Ctrl-[': - stop(close); - break; - } - if (done) { stop(close); } - return true; - } - - // Actually do replace. - next(); - if (done) { - showConfirm(cm, 'No matches for ' + query.source); - return; - } - if (!confirm) { - replaceAll(); - if (callback) { callback(); }; - return; - } - showPrompt(cm, { - prefix: 'replace with ' + replaceWith + ' (y/n/a/q/l)', - onKeyDown: onPromptKeyDown - }); - } - - CodeMirror.keyMap.vim = { - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - function exitInsertMode(cm) { - var vim = cm.state.vim; - var macroModeState = vimGlobalState.macroModeState; - var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.'); - var isPlaying = macroModeState.isPlaying; - var lastChange = macroModeState.lastInsertModeChanges; - // In case of visual block, the insertModeChanges are not saved as a - // single word, so we convert them to a single word - // so as to update the ". register as expected in real vim. - var text = []; - if (!isPlaying) { - var selLength = lastChange.inVisualBlock ? vim.lastSelection.visualBlock.height : 1; - var changes = lastChange.changes; - var text = []; - var i = 0; - // In case of multiple selections in blockwise visual, - // the inserted text, for example: 'foo', is stored as - // 'f', 'f', InsertModeKey 'o', 'o', 'o', 'o'. (if you have a block with 2 lines). - // We push the contents of the changes array as per the following: - // 1. In case of InsertModeKey, just increment by 1. - // 2. In case of a character, jump by selLength (2 in the example). - while (i < changes.length) { - // This loop will convert 'ffoooo' to 'foo'. - text.push(changes[i]); - if (changes[i] instanceof InsertModeKey) { - i++; - } else { - i+= selLength; - } - } - lastChange.changes = text; - cm.off('change', onChange); - CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); - } - if (!isPlaying && vim.insertModeRepeat > 1) { - // Perform insert mode repeat for commands like 3,a and 3,o. - repeatLastEdit(cm, vim, vim.insertModeRepeat - 1, - true /** repeatForInsert */); - vim.lastEditInputState.repeatOverride = vim.insertModeRepeat; - } - delete vim.insertModeRepeat; - vim.insertMode = false; - cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1); - cm.setOption('keyMap', 'vim'); - cm.setOption('disableInput', true); - cm.toggleOverwrite(false); // exit replace mode if we were in it. - // update the ". register before exiting insert mode - insertModeChangeRegister.setText(lastChange.changes.join('')); - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - if (macroModeState.isRecording) { - logInsertModeChange(macroModeState); - } - } - - // The timeout in milliseconds for the two-character ESC keymap should be - // adjusted according to your typing speed to prevent false positives. - defineOption('insertModeEscKeysTimeout', 200, 'number'); - - CodeMirror.keyMap['vim-insert'] = { - // TODO: override navigation keys so that Esc will cancel automatic - // indentation from o, O, i_ - 'Ctrl-N': 'autocomplete', - 'Ctrl-P': 'autocomplete', - 'Enter': function(cm) { - var fn = CodeMirror.commands.newlineAndIndentContinueComment || - CodeMirror.commands.newlineAndIndent; - fn(cm); - }, - fallthrough: ['default'], - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - CodeMirror.keyMap['vim-replace'] = { - 'Backspace': 'goCharLeft', - fallthrough: ['vim-insert'], - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - function executeMacroRegister(cm, vim, macroModeState, registerName) { - var register = vimGlobalState.registerController.getRegister(registerName); - var keyBuffer = register.keyBuffer; - var imc = 0; - macroModeState.isPlaying = true; - macroModeState.replaySearchQueries = register.searchQueries.slice(0); - for (var i = 0; i < keyBuffer.length; i++) { - var text = keyBuffer[i]; - var match, key; - while (text) { - // Pull off one command key, which is either a single character - // or a special sequence wrapped in '<' and '>', e.g. ''. - match = (/<\w+-.+?>|<\w+>|./).exec(text); - key = match[0]; - text = text.substring(match.index + key.length); - CodeMirror.Vim.handleKey(cm, key, 'macro'); - if (vim.insertMode) { - var changes = register.insertModeChanges[imc++].changes; - vimGlobalState.macroModeState.lastInsertModeChanges.changes = - changes; - repeatInsertModeChanges(cm, changes, 1); - exitInsertMode(cm); - } - } - }; - macroModeState.isPlaying = false; - } - - function logKey(macroModeState, key) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.pushText(key); - } - } - - function logInsertModeChange(macroModeState) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.pushInsertModeChanges(macroModeState.lastInsertModeChanges); - } - } - - function logSearchQuery(macroModeState, query) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.pushSearchQuery(query); - } - } - - /** - * Listens for changes made in insert mode. - * Should only be active in insert mode. - */ - function onChange(_cm, changeObj) { - var macroModeState = vimGlobalState.macroModeState; - var lastChange = macroModeState.lastInsertModeChanges; - if (!macroModeState.isPlaying) { - while(changeObj) { - lastChange.expectCursorActivityForChange = true; - if (changeObj.origin == '+input' || changeObj.origin == 'paste' - || changeObj.origin === undefined /* only in testing */) { - var text = changeObj.text.join('\n'); - lastChange.changes.push(text); - } - // Change objects may be chained with next. - changeObj = changeObj.next; - } - } - } - - /** - * Listens for any kind of cursor activity on CodeMirror. - */ - function onCursorActivity(cm) { - var vim = cm.state.vim; - if (vim.insertMode) { - // Tracking cursor activity in insert mode (for macro support). - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { return; } - var lastChange = macroModeState.lastInsertModeChanges; - if (lastChange.expectCursorActivityForChange) { - lastChange.expectCursorActivityForChange = false; - } else { - // Cursor moved outside the context of an edit. Reset the change. - lastChange.changes = []; - } - } else if (!cm.curOp.isVimOp) { - handleExternalSelection(cm, vim); - } - if (vim.visualMode) { - updateFakeCursor(cm); - } - } - function updateFakeCursor(cm) { - var vim = cm.state.vim; - var from = copyCursor(vim.sel.head); - var to = offsetCursor(from, 0, 1); - if (vim.fakeCursor) { - vim.fakeCursor.clear(); - } - vim.fakeCursor = cm.markText(from, to, {className: 'cm-animate-fat-cursor'}); - } - function handleExternalSelection(cm, vim) { - var anchor = cm.getCursor('anchor'); - var head = cm.getCursor('head'); - // Enter or exit visual mode to match mouse selection. - if (vim.visualMode && cursorEqual(head, anchor) && lineLength(cm, head.line) > head.ch) { - exitVisualMode(cm, false); - } else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) { - vim.visualMode = true; - vim.visualLine = false; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual"}); - } - if (vim.visualMode) { - // Bind CodeMirror selection model to vim selection model. - // Mouse selections are considered visual characterwise. - var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0; - var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0; - head = offsetCursor(head, 0, headOffset); - anchor = offsetCursor(anchor, 0, anchorOffset); - vim.sel = { - anchor: anchor, - head: head - }; - updateMark(cm, vim, '<', cursorMin(head, anchor)); - updateMark(cm, vim, '>', cursorMax(head, anchor)); - } else if (!vim.insertMode) { - // Reset lastHPos if selection was modified by something outside of vim mode e.g. by mouse. - vim.lastHPos = cm.getCursor().ch; - } - } - - /** Wrapper for special keys pressed in insert mode */ - function InsertModeKey(keyName) { - this.keyName = keyName; - } - - /** - * Handles raw key down events from the text area. - * - Should only be active in insert mode. - * - For recording deletes in insert mode. - */ - function onKeyEventTargetKeyDown(e) { - var macroModeState = vimGlobalState.macroModeState; - var lastChange = macroModeState.lastInsertModeChanges; - var keyName = CodeMirror.keyName(e); - if (!keyName) { return; } - function onKeyFound() { - lastChange.changes.push(new InsertModeKey(keyName)); - return true; - } - if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) { - CodeMirror.lookupKey(keyName, 'vim-insert', onKeyFound); - } - } - - /** - * Repeats the last edit, which includes exactly 1 command and at most 1 - * insert. Operator and motion commands are read from lastEditInputState, - * while action commands are read from lastEditActionCommand. - * - * If repeatForInsert is true, then the function was called by - * exitInsertMode to repeat the insert mode changes the user just made. The - * corresponding enterInsertMode call was made with a count. - */ - function repeatLastEdit(cm, vim, repeat, repeatForInsert) { - var macroModeState = vimGlobalState.macroModeState; - macroModeState.isPlaying = true; - var isAction = !!vim.lastEditActionCommand; - var cachedInputState = vim.inputState; - function repeatCommand() { - if (isAction) { - commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand); - } else { - commandDispatcher.evalInput(cm, vim); - } - } - function repeatInsert(repeat) { - if (macroModeState.lastInsertModeChanges.changes.length > 0) { - // For some reason, repeat cw in desktop VIM does not repeat - // insert mode changes. Will conform to that behavior. - repeat = !vim.lastEditActionCommand ? 1 : repeat; - var changeObject = macroModeState.lastInsertModeChanges; - repeatInsertModeChanges(cm, changeObject.changes, repeat); - } - } - vim.inputState = vim.lastEditInputState; - if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) { - // o and O repeat have to be interlaced with insert repeats so that the - // insertions appear on separate lines instead of the last line. - for (var i = 0; i < repeat; i++) { - repeatCommand(); - repeatInsert(1); - } - } else { - if (!repeatForInsert) { - // Hack to get the cursor to end up at the right place. If I is - // repeated in insert mode repeat, cursor will be 1 insert - // change set left of where it should be. - repeatCommand(); - } - repeatInsert(repeat); - } - vim.inputState = cachedInputState; - if (vim.insertMode && !repeatForInsert) { - // Don't exit insert mode twice. If repeatForInsert is set, then we - // were called by an exitInsertMode call lower on the stack. - exitInsertMode(cm); - } - macroModeState.isPlaying = false; - }; - - function repeatInsertModeChanges(cm, changes, repeat) { - function keyHandler(binding) { - if (typeof binding == 'string') { - CodeMirror.commands[binding](cm); - } else { - binding(cm); - } - return true; - } - var head = cm.getCursor('head'); - var inVisualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock; - if (inVisualBlock) { - // Set up block selection again for repeating the changes. - var vim = cm.state.vim; - var lastSel = vim.lastSelection; - var offset = getOffset(lastSel.anchor, lastSel.head); - selectForInsert(cm, head, offset.line + 1); - repeat = cm.listSelections().length; - cm.setCursor(head); - } - for (var i = 0; i < repeat; i++) { - if (inVisualBlock) { - cm.setCursor(offsetCursor(head, i, 0)); - } - for (var j = 0; j < changes.length; j++) { - var change = changes[j]; - if (change instanceof InsertModeKey) { - CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler); - } else { - var cur = cm.getCursor(); - cm.replaceRange(change, cur, cur); - } - } - } - if (inVisualBlock) { - cm.setCursor(offsetCursor(head, 0, 1)); - } - } - - resetVimGlobalState(); - return vimApi; - }; - // Initialize Vim and make it available as an API. - CodeMirror.Vim = Vim(); -}); diff --git a/media/editors/codemirror/lib/addons.js b/media/editors/codemirror/lib/addons.js index 8071e546e9597..ac63cd9e6d06f 100644 --- a/media/editors/codemirror/lib/addons.js +++ b/media/editors/codemirror/lib/addons.js @@ -1 +1,6598 @@ -(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineOption("fullScreen",false,function(d,f,e){if(e==a.Init){e=false}if(!e==!f){return}if(f){b(d)}else{c(d)}});function b(d){var e=d.getWrapperElement();d.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:e.style.width,height:e.style.height};e.style.width="";e.style.height="auto";e.className+=" CodeMirror-fullscreen";document.documentElement.style.overflow="hidden";d.refresh()}function c(d){var e=d.getWrapperElement();e.className=e.className.replace(/\s*CodeMirror-fullscreen\b/,"");document.documentElement.style.overflow="";var f=d.state.fullScreenRestore;e.style.width=f.width;e.style.height=f.height;window.scrollTo(f.scrollLeft,f.scrollTop);d.refresh()}});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineExtension("addPanel",function(g,f){if(!this.state.panels){b(this)}var h=this.state.panels;if(f&&f.position=="bottom"){h.wrapper.appendChild(g)}else{h.wrapper.insertBefore(g,h.wrapper.firstChild)}var e=(f&&f.height)||g.offsetHeight;this._setSize(null,h.heightLeft-=e);h.panels++;return new d(this,g,f,e)});function d(f,h,g,e){this.cm=f;this.node=h;this.options=g;this.height=e;this.cleared=false}d.prototype.clear=function(){if(this.cleared){return}this.cleared=true;var e=this.cm.state.panels;this.cm._setSize(null,e.heightLeft+=this.height);e.wrapper.removeChild(this.node);if(--e.panels==0){c(this.cm)}};d.prototype.changed=function(e){var f=e==null?this.node.offsetHeight:e;var g=this.cm.state.panels;this.cm._setSize(null,g.height+=(f-this.height));this.height=f};function b(f){var h=f.getWrapperElement();var g=window.getComputedStyle?window.getComputedStyle(h):h.currentStyle;var e=parseInt(g.height);var i=f.state.panels={setHeight:h.style.height,heightLeft:e,panels:0,wrapper:document.createElement("div")};h.parentNode.insertBefore(i.wrapper,h);var j=f.hasFocus();i.wrapper.appendChild(h);if(j){f.focus()}f._setSize=f.setSize;if(e!=null){f.setSize=function(m,k){if(k==null){return this._setSize(m,k)}i.setHeight=k;if(typeof k!="number"){var l=/^(\d+\.?\d*)px$/.exec(k);if(l){k=Number(l[1])}else{i.wrapper.style.height=k;k=i.wrapper.offsetHeight;i.wrapper.style.height=""}}f._setSize(m,i.heightLeft+=(k-e));e=k}}}function c(e){var g=e.state.panels;e.state.panels=null;var f=e.getWrapperElement();g.wrapper.parentNode.replaceChild(f,g.wrapper);f.style.height=g.setHeight;e.setSize=e._setSize;e.setSize()}});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(c){var h="()[]{}''\"\"";var g="[]{}";var i=/\s/;var f=c.Pos;c.defineOption("autoCloseBrackets",false,function(j,o,k){if(k!=c.Init&&k){j.removeKeyMap("autoCloseBrackets")}if(!o){return}var m=h,l=g;if(typeof o=="string"){m=o}else{if(typeof o=="object"){if(o.pairs!=null){m=o.pairs}if(o.explode!=null){l=o.explode}}}var n=b(m);if(l){n.Enter=a(l)}j.addKeyMap(n)});function d(j,l){var k=j.getRange(f(l.line,l.ch-1),f(l.line,l.ch+1));return k.length==2?k:null}function e(j,p,n){var k=j.getLine(p.line);var m=j.getTokenAt(p);if(/\bstring2?\b/.test(m.type)){return false}var o=new c.StringStream(k.slice(0,p.ch)+n+k.slice(p.ch),4);o.pos=o.start=m.start;for(;;){var l=j.getMode().token(o,m.state);if(o.pos>=p.ch+1){return/\bstring2?\b/.test(l)}o.start=o.pos}}function b(l){var m={name:"autoCloseBrackets",Backspace:function(n){if(n.getOption("disableInput")){return c.Pass}var o=n.listSelections();for(var p=0;p=0;p--){var r=o[p].head;n.replaceRange("",f(r.line,r.ch-1),f(r.line,r.ch+1))}}};var k="";for(var j=0;j1&&p.getRange(f(w.line,w.ch-2),w)==o+o&&(w.ch<=2||p.getRange(f(w.line,w.ch-3),f(w.line,w.ch-2))!=o)){s="addFour"}else{if(o=='"'||o=="'"){if(!c.isWordChar(u)&&e(p,w,o)){s="both"}else{return c.Pass}}else{if(p.getLine(w.line).length==w.ch||k.indexOf(u)>=0||i.test(u)){s="both"}else{return c.Pass}}}}}if(!v){v=s}else{if(v!=s){return c.Pass}}}p.operation(function(){if(v=="skip"){p.execCommand("goCharRight")}else{if(v=="skipThree"){for(var y=0;y<3;y++){p.execCommand("goCharRight")}}else{if(v=="surround"){var x=p.getSelections();for(var y=0;y'"]=function(m){return a(m)}}i.addKeyMap(k)});var d=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];var c=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function a(x){if(x.getOption("disableInput")){return b.Pass}var k=x.listSelections(),r=[];for(var s=0;sw.ch){q=q.slice(0,q.length-y.end+w.ch)}var u=q.toLowerCase();if(!q||y.type=="string"&&(y.end!=w.ch||!/[\"\']/.test(y.string.charAt(y.string.length-1))||y.string.length==1)||y.type=="tag"&&j.type=="closeTag"||y.string.indexOf("/")==(y.string.length-1)||n&&g(n,u)>-1||f(x,q,w,j,true)){return b.Pass}var p=v&&g(v,u)>-1;r[s]={indent:p,text:">"+(p?"\n\n":"")+"",newPos:p?b.Pos(w.line+1,0):b.Pos(w.line,w.ch+1)}}for(var s=k.length-1;s>=0;s--){var o=r[s];x.replaceRange(o.text,k[s].head,k[s].anchor,"+insert");var m=x.listSelections().slice(0);m[s]={head:o.newPos,anchor:o.newPos};x.setSelections(m);if(o.indent){x.indentLine(o.newPos.line,null,true);x.indentLine(o.newPos.line+1,null,true)}}}function h(q,m){var k=q.listSelections(),l=[];var p=m?"/":""}else{if(q.getMode().name=="htmlmixed"&&s.mode.name=="css"){l[n]=p+"style>"}else{return b.Pass}}}else{if(!j.context||!j.context.tagName||f(q,j.context.tagName,o,j)){return b.Pass}l[n]=p+j.context.tagName+">"}}q.replaceSelections(l);k=q.listSelections();for(var n=0;n",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function f(q,m,p,k){var s=q.getLineHandle(m.line),o=m.ch-1;var n=(o>=0&&a[s.text.charAt(o)])||a[s.text.charAt(++o)];if(!n){return null}var l=n.charAt(1)==">"?1:-1;if(p&&(l>0)!=(o==m.ch)){return null}var j=q.getTokenTypeAt(i(m.line,o+1));var r=g(q,i(m.line,o+(l>0?1:0)),l,j||null,k);if(r==null){return null}return{from:i(m.line,o),to:r&&r.pos,match:r&&r.ch==n.charAt(0),forward:l>0}}function g(w,r,n,k,m){var l=(m&&m.maxScanLineLength)||10000;var t=(m&&m.maxScanLines)||1000;var v=[];var x=m&&m.bracketRegex?m.bracketRegex:/[(){}[\]]/;var q=n>0?Math.min(r.line+t,w.lastLine()+1):Math.max(w.firstLine()-1,r.line-t);for(var o=r.line;o!=q;o+=n){var y=w.getLine(o);if(!y){continue}var u=n>0?0:y.length-1,p=n>0?y.length:-1;if(y.length>l){continue}if(o==r.line){u=r.ch-(n<0?1:0)}for(;u!=p;u+=n){var j=y.charAt(u);if(x.test(j)&&(k===undefined||w.getTokenTypeAt(i(o,u+1))==k)){var s=a[j];if((s.charAt(1)==">")==(n>0)){v.push(j)}else{if(!v.length){return{pos:i(o,u),ch:j}}else{v.pop()}}}}}return o-n==(n>0?w.lastLine():w.firstLine())?false:null}function b(s,n,m){var k=s.state.matchBrackets.maxHighlightLineLength||1000;var r=[],l=s.listSelections();for(var o=0;ob.lastLine()){return null}var o=b.getTokenAt(a.Pos(k,1));if(!/\S/.test(o.string)){o=b.getTokenAt(a.Pos(k,o.end+1))}if(o.type!="keyword"||o.string!="import"){return null}for(var l=k,m=Math.min(b.lastLine(),k+10);l<=m;++l){var n=b.getLine(l),j=n.indexOf(";");if(j!=-1){return{startCh:o.end,end:a.Pos(l,j)}}}}var h=h.line,d=g(h),f;if(!d||g(h-1)||((f=g(h-2))&&f.end.line==h-1)){return null}for(var c=d.end;;){var e=g(c.line+1);if(e==null){break}c=e.end}return{from:b.clipPos(a.Pos(h,d.startCh+1)),to:c}});a.registerHelper("fold","include",function(b,g){function f(h){if(hb.lastLine()){return null}var i=b.getTokenAt(a.Pos(h,1));if(!/\S/.test(i.string)){i=b.getTokenAt(a.Pos(h,i.end+1))}if(i.type=="meta"&&i.string.slice(0,8)=="#include"){return i.start+8}}var g=g.line,d=f(g);if(d==null||f(g-1)!=null){return null}for(var c=g;;){var e=f(c+1);if(e==null){break}++c}return{from:a.Pos(g,d+1),to:b.clipPos(a.Pos(c))}})});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(b){function d(n,m,o,i){if(o&&o.call){var g=o;o=null}else{var g=c(n,o,"rangeFinder")}if(typeof m=="number"){m=b.Pos(m,0)}var h=c(n,o,"minFoldSize");function f(p){var q=g(n,m);if(!q||q.to.line-q.from.linen.firstLine()){m=b.Pos(m.line-1,0);k=f(false)}}if(!k||k.cleared||i==="unfold"){return}var l=e(n,o);b.on(l,"mousedown",function(p){j.clear();b.e_preventDefault(p)});var j=n.markText(k.from,k.to,{replacedWith:l,clearOnEnter:true,__isFold:true});j.on("clear",function(q,p){b.signal(n,"unfold",n,q,p)});b.signal(n,"fold",n,k.from,k.to)}function e(f,g){var h=c(f,g,"widget");if(typeof h=="string"){var i=document.createTextNode(h);h=document.createElement("span");h.appendChild(i);h.className="CodeMirror-foldmarker"}return h}b.newFoldFunction=function(g,f){return function(h,i){d(h,i,{rangeFinder:g,widget:f})}};b.defineExtension("foldCode",function(h,f,g){d(this,h,f,g)});b.defineExtension("isFolded",function(h){var g=this.findMarksAt(h);for(var f=0;f=p){w=f(o.indicatorOpen)}}m.setGutterMarker(t,o.gutter,w);++q})}function b(m){var n=m.getViewport(),o=m.state.foldGutter;if(!o){return}m.operation(function(){a(m,n.from,n.to)});o.from=n.from;o.to=n.to}function k(m,n,p){var o=m.state.foldGutter.options;if(p!=o.gutter){return}m.foldCode(h(n,0),o.rangeFinder)}function g(m){var o=m.state.foldGutter,n=m.state.foldGutter.options;o.from=o.to=0;clearTimeout(o.changeUpdate);o.changeUpdate=setTimeout(function(){b(m)},n.foldOnChangeTimeSpan||600)}function l(m){var o=m.state.foldGutter,n=m.state.foldGutter.options;clearTimeout(o.changeUpdate);o.changeUpdate=setTimeout(function(){var p=m.getViewport();if(o.from==o.to||p.from-o.to>20||o.from-p.to>20){b(m)}else{m.operation(function(){if(p.fromo.to){a(m,o.to,p.to);o.to=p.to}})}},n.updateViewportTimeSpan||400)}function e(m,p){var o=m.state.foldGutter,n=p.line;if(n>=o.from&&n=q.max){return}q.ch=0;q.text=q.cm.getLine(++q.line);return true}function n(q){if(q.line<=q.min){return}q.text=q.cm.getLine(--q.line);q.ch=q.text.length;return true}function g(s){for(;;){var r=s.text.indexOf(">",s.ch);if(r==-1){if(a(s)){continue}else{return}}if(!h(s,r+1)){s.ch=r+1;continue}var q=s.text.lastIndexOf("/",r);var t=q>-1&&!/\S/.test(s.text.slice(q+1,r));s.ch=r+1;return t?"selfClose":"regular"}}function k(r){for(;;){var q=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(q==-1){if(n(r)){continue}else{return}}if(!h(r,q+1)){r.ch=q;continue}d.lastIndex=q;r.ch=q;var s=d.exec(r.text);if(s&&s.index==q){return s}}}function p(q){for(;;){d.lastIndex=q.ch;var r=d.exec(q.text);if(!r){if(a(q)){continue}else{return}}if(!h(q,r.index+1)){q.ch=r.index+1;continue}q.ch=r.index+r[0].length;return r}}function e(s){for(;;){var r=s.ch?s.text.lastIndexOf(">",s.ch-1):-1;if(r==-1){if(n(s)){continue}else{return}}if(!h(s,r+1)){s.ch=r;continue}var q=s.text.lastIndexOf("/",r);var t=q>-1&&!/\S/.test(s.text.slice(q+1,r));s.ch=r+1;return t?"selfClose":"regular"}}function f(t,r){var q=[];for(;;){var v=p(t),s,x=t.line,w=t.ch-(v?v[0].length:0);if(!v||!(s=g(t))){return}if(s=="selfClose"){continue}if(v[1]){for(var u=q.length-1;u>=0;--u){if(q[u]==v[2]){q.length=u;break}}if(u<0&&(!r||r==v[2])){return{tag:v[2],from:m(x,w),to:m(t.line,t.ch)}}}else{q.push(v[2])}}}function c(s,r){var q=[];for(;;){var w=e(s);if(!w){return}if(w=="selfClose"){k(s);continue}var v=s.line,u=s.ch;var x=k(s);if(!x){return}if(x[1]){q.push(x[2])}else{for(var t=q.length-1;t>=0;--t){if(q[t]==x[2]){q.length=t;break}}if(t<0&&(!r||r==x[2])){return{tag:x[2],from:m(s.line,s.ch),to:m(v,u)}}}}}i.registerHelper("fold","xml",function(q,v){var s=new b(q,v.line,0);for(;;){var t=p(s),r;if(!t||s.line!=v.line||!(r=g(s))){return}if(!t[1]&&r!="selfClose"){var v=m(s.line,s.ch);var u=f(s,t[2]);return u&&{from:v,to:u.from}}}});i.findMatchingTag=function(q,x,t){var s=new b(q,x.line,x.ch,t);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1){return}var r=g(s),w=r&&m(s.line,s.ch);var v=r&&k(s);if(!r||!v||l(s,x)>0){return}var u={from:m(s.line,s.ch),to:w,tag:v[2]};if(r=="selfClose"){return{open:u,close:null,at:"open"}}if(v[1]){return{open:c(s,v[2]),close:u,at:"close"}}else{s=new b(q,w.line,w.ch,t);return{open:u,close:f(s,v[2]),at:"open"}}};i.findEnclosingTag=function(q,w,s){var r=new b(q,w.line,w.ch,s);for(;;){var u=c(r);if(!u){break}var t=new b(q,w.line,w.ch,s);var v=f(t,u.tag);if(v){return{open:u,close:v}}}};i.scanForClosingTag=function(q,u,t,s){var r=new b(q,u.line,u.ch,s?{from:0,to:s}:null);return f(r,t)}});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"),"cjs")}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],function(b){a(b,"amd")})}else{a(CodeMirror,"plain")}}})(function(a,c){if(!a.modeURL){a.modeURL="../mode/%N/%N.js"}var e={};function d(f,h){var g=h;return function(){if(--g==0){f()}}}function b(l,f){var k=a.modes[l].dependencies;if(!k){return f()}var j=[];for(var h=0;h-1){o.string=m.slice(0,p)}var n=k.mode.token(o,f.inner);if(p>-1){o.string=m}if(k.innerStyle){if(n){n=n+" "+k.innerStyle}else{n=k.innerStyle}}return n}},indent:function(g,f){var h=g.innerActive?g.innerActive.mode:c;if(!h.indent){return a.Pass}return h.indent(g.innerActive?g.inner:g.outer,f)},blankLine:function(h){var j=h.innerActive?h.innerActive.mode:c;if(j.blankLine){j.blankLine(h.innerActive?h.inner:h.outer)}if(!h.innerActive){for(var g=0;gi.right?1:0}else{j=k.clientYi.bottom?1:0}f.moveTo(f.pos+j*f.screen)});function h(k){var j=b.wheelEventPixels(k)[f.orientation=="horizontal"?"x":"y"];var i=f.pos;f.moveTo(f.pos+j);if(f.pos!=i){b.e_preventDefault(k)}}b.on(this.node,"mousewheel",h);b.on(this.node,"DOMMouseScroll",h)}a.prototype.moveTo=function(e,d){if(e<0){e=0}if(e>this.total-this.screen){e=this.total-this.screen}if(e==this.pos){return}this.pos=e;this.inner.style[this.orientation=="horizontal"?"left":"top"]=(e*(this.size/this.total))+"px";if(d!==false){this.scroll(e,this.orientation)}};a.prototype.update=function(d,e,f){this.screen=e;this.total=d;this.size=f;this.inner.style[this.orientation=="horizontal"?"width":"height"]=this.screen*(this.size/this.total)+"px";this.inner.style[this.orientation=="horizontal"?"left":"top"]=this.pos*(this.size/this.total)+"px"};function c(f,e,d){this.addClass=f;this.horiz=new a(f,"horizontal",d);e(this.horiz.node);this.vert=new a(f,"vertical",d);e(this.vert.node);this.width=null}c.prototype.update=function(g){if(this.width==null){var f=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;if(f){this.width=parseInt(f.height)}}var e=this.width||0;var h=g.scrollWidth>g.clientWidth+1;var d=g.scrollHeight>g.clientHeight+1;this.vert.node.style.display=d?"block":"none";this.horiz.node.style.display=h?"block":"none";if(d){this.vert.update(g.scrollHeight,g.clientHeight,g.viewHeight-(h?e:0));this.vert.node.style.display="block";this.vert.node.style.bottom=h?e+"px":"0"}if(h){this.horiz.update(g.scrollWidth,g.clientWidth,g.viewWidth-(d?e:0)-g.barLeft);this.horiz.node.style.right=d?e+"px":"0";this.horiz.node.style.left=g.barLeft+"px"}return{right:d?e:0,bottom:h?e:0}};c.prototype.setScrollTop=function(d){this.vert.moveTo(d,false)};c.prototype.setScrollLeft=function(d){this.horiz.moveTo(d,false)};c.prototype.clear=function(){var d=this.horiz.node.parentNode;d.removeChild(this.horiz.node);d.removeChild(this.vert.node)};b.scrollbarModel.simple=function(e,d){return new c("CodeMirror-simplescroll",e,d)};b.scrollbarModel.overlay=function(e,d){return new c("CodeMirror-overlayscroll",e,d)}});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(c){var g="CodeMirror-activeline";var f="CodeMirror-activeline-background";c.defineOption("styleActiveLine",false,function(h,k,i){var j=i&&i!=c.Init;if(k&&!j){h.state.activeLines=[];e(h,h.listSelections());h.on("beforeSelectionChange",b)}else{if(!k&&j){h.off("beforeSelectionChange",b);d(h);delete h.state.activeLines}}});function d(h){for(var j=0;j",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:"xi",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",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:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:true,toJumplist:true}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:true,toJumplist:true}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:true,toJumplist:true}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:false}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:true}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:true,linewise:true}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:false,linewise:true}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:true}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:false}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:true,wordEnd:false}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:true,wordEnd:false,bigWord:true}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:true,wordEnd:true,inclusive:true}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:true,wordEnd:true,bigWord:true,inclusive:true}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:false,wordEnd:false}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:false,wordEnd:false,bigWord:true}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:false,wordEnd:true,inclusive:true}},{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:"moveByPage",motionArgs:{forward:true}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:false}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:true,explicitRepeat:true}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:false,explicitRepeat:true}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:false,explicitRepeat:true,linewise:true,toJumplist:true}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:true,explicitRepeat:true,linewise:true,toJumplist:true}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:true,toFirstChar:true}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:false,toFirstChar:true}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:true,toFirstChar:true,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:true}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:true,toJumplist:true}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:true,inclusive:true}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:false}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:true,inclusive:true}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:false}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:true}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:false}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:true,linewise:true}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:true}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:true}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:false}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:true,linewise:true}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:false,linewise:true}},{keys:"]p",type:"action",action:"paste",isEdit:true,actionArgs:{after:true,isEdit:true,matchIndent:true}},{keys:"[p",type:"action",action:"paste",isEdit:true,actionArgs:{after:false,isEdit:true,matchIndent:true}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:true,toJumplist:true}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:false,toJumplist:true}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:true},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:true}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:false}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:true},isEdit:true},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:false},isEdit:true},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:true,toJumplist:true}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:false,toJumplist:true}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:true},operatorMotionArgs:{visualLine:false}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:false},operatorMotionArgs:{visualLine:true}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:true},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:true},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"moveToEol",motionArgs:{inclusive:true},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:true},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:true},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:true},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:true},operatorArgs:{shouldMoveCursor:true},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:false,wordEnd:false},context:"insert"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:true}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:false}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:true,linewise:true}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:false,linewise:true}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:true,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:true,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:true,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:true,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:true,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:true,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:true,interlaceInsertRepeat:true,actionArgs:{after:true},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:true,interlaceInsertRepeat:true,actionArgs:{after:false},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:true}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:true}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:true},{keys:"p",type:"action",action:"paste",isEdit:true,actionArgs:{after:true,isEdit:true}},{keys:"P",type:"action",action:"paste",isEdit:true,actionArgs:{after:false,isEdit:true}},{keys:"r",type:"action",action:"replace",isEdit:true},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:true,actionArgs:{replace:true}},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:true},context:"visual",isEdit:true},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:false},context:"visual",isEdit:true},{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:true,actionArgs:{increase:true,backtrack:false}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:true,actionArgs:{increase:false,backtrack:false}},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:true}},{keys:"/",type:"search",searchArgs:{forward:true,querySrc:"prompt",toJumplist:true}},{keys:"?",type:"search",searchArgs:{forward:false,querySrc:"prompt",toJumplist:true}},{keys:"*",type:"search",searchArgs:{forward:true,querySrc:"wordUnderCursor",wholeWordOnly:true,toJumplist:true}},{keys:"#",type:"search",searchArgs:{forward:false,querySrc:"wordUnderCursor",wholeWordOnly:true,toJumplist:true}},{keys:"g*",type:"search",searchArgs:{forward:true,querySrc:"wordUnderCursor",toJumplist:true}},{keys:"g#",type:"search",searchArgs:{forward:false,querySrc:"wordUnderCursor",toJumplist:true}},{keys:":",type:"ex"}];var c=b.Pos;var d=function(){function aU(by){by.setOption("disableInput",true);by.setOption("showCursorWhenSelecting",false);b.signal(by,"vim-mode-change",{mode:"normal"});by.on("cursorActivity",aa);G(by);b.on(by.getInputField(),"paste",U(by))}function aQ(by){by.setOption("disableInput",false);by.off("cursorActivity",aa);b.off(by.getInputField(),"paste",U(by));by.state.vim=null}function h(by,bz){if(this==b.keyMap.vim){b.rmClass(by.getWrapperElement(),"cm-fat-cursor")}if(!bz||bz.attach!=s){aQ(by,false)}}function s(by,bz){if(this==b.keyMap.vim){b.addClass(by.getWrapperElement(),"cm-fat-cursor")}if(!bz||bz.attach!=s){aU(by)}}b.defineOption("vimMode",false,function(by,bA,bz){if(bA&&by.getOption("keyMap")!="vim"){by.setOption("keyMap","vim")}else{if(!bA&&bz!=b.Init&&/^vim/.test(by.getOption("keyMap"))){by.setOption("keyMap","default")}}});function a2(bA,bz){if(!bz){return undefined}var by=L(bA);if(!by){return false}var bB=b.Vim.findKey(bz,by);if(typeof bB=="function"){b.signal(bz,"vim-keypress",by)}return bB}var az={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"};var aT={Enter:"CR",Backspace:"BS",Delete:"Del"};function L(bA){if(bA.charAt(0)=="'"){return bA.charAt(1)}var bD=bA.split("-");if(/-$/.test(bA)){bD.splice(-2,2,"-")}var by=bD[bD.length-1];if(bD.length==1&&bD[0].length==1){return false}else{if(bD.length==2&&bD[0]=="Shift"&&by.length==1){return false}}var bC=false;for(var bz=0;bz"}function U(by){var bz=by.state.vim;if(!bz.onPasteFn){bz.onPasteFn=function(){if(!bz.insertMode){by.setCursor(D(by.getCursor(),0,1));p.enterInsertMode(by,{},bz)}}}return bz.onPasteFn}var aY=/[\d]/;var aq=[(/\w/),(/[^\w\s]/)],bl=[(/\S/)];function ap(bB,bz){var bA=[];for(var by=bB;by"]);var l=[].concat(ah,am,V,["-",'"',".",":","/"]);function f(by,bz){return bz>=by.firstLine()&&bz<=by.lastLine()}function E(by){return(/^[a-z]$/).test(by)}function N(by){return"()[]{}".indexOf(by)!=-1}function ag(by){return aY.test(by)}function A(by){return(/^[A-Z]$/).test(by)}function T(by){return(/^\s*$/).test(by)}function J(bA,by){for(var bz=0;bzbB){bE=bB}else{if(bE0?1:-1;var bH;var bG=bF.getCursor();do{bE+=bI;bK=bz[(bC+bE)%bC];if(bK&&(bH=bK.find())&&!bv(bG,bH)){break}}while(bEbA)}return bK}return{cachedCursor:undefined,add:bD,move:by}};var i=function(by){if(by){return{changes:by.changes,expectCursorActivityForChange:by.expectCursorActivityForChange}}return{changes:[],expectCursorActivityForChange:false}};function ax(){this.latestRegister=undefined;this.isPlaying=false;this.isRecording=false;this.replaySearchQueries=[];this.onRecordingDone=undefined;this.lastInsertModeChanges=i()}ax.prototype={exitMacroRecordMode:function(){var by=q.macroModeState;if(by.onRecordingDone){by.onRecordingDone()}by.onRecordingDone=undefined;by.isRecording=false},enterMacroRecordMode:function(by,bA){var bz=q.registerController.getRegister(bA);if(bz){bz.clear();this.latestRegister=bA;if(by.openDialog){this.onRecordingDone=by.openDialog("(recording)["+bA+"]",null,{bottom:true})}this.isRecording=true}}};function G(by){if(!by.state.vim){by.state.vim={inputState:new aA(),lastEditInputState:undefined,lastEditActionCommand:undefined,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:false,insertModeRepeat:undefined,visualMode:false,visualLine:false,visualBlock:false,lastSelection:null,lastPastedText:null,sel:{}}}return by.state.vim}var q;function z(){q={searchQuery:null,searchIsReversed:false,lastSubstituteReplacePart:undefined,jumpList:ao(),macroModeState:new ax,lastChararacterSearch:{increment:0,forward:true,selectedCharacter:""},registerController:new ai({}),searchHistoryController:new a3({}),exCommandHistoryController:new a3({})};for(var by in at){var bz=at[by];bz.value=bz.defaultValue}}var bt;var aN={buildKeyMap:function(){},getRegisterController:function(){return q.registerController},resetVimGlobalState_:z,getVimGlobalState_:function(){return q},maybeInitVimState_:G,suppressErrorLogging:false,InsertModeKey:bi,map:function(bz,bA,by){m.map(bz,bA,by)},setOption:aH,getOption:o,defineOption:aJ,defineEx:function(by,bA,bz){if(by.indexOf(bA)!==0){throw new Error('(Vim.defineEx) "'+bA+'" is not a prefix of "'+by+'", command not registered')}a4[by]=bz;m.commandMap_[bA]={name:by,shortName:bA,type:"api"}},handleKey:function(by,bA,bz){var bB=this.findKey(by,bA,bz);if(typeof bB==="function"){return bB()}},findKey:function(bE,bF,bD){var bB=G(bE);function bG(){var bI=q.macroModeState;if(bI.isRecording){if(bF=="q"){bI.exitMacroRecordMode();j(bE);return true}if(bD!="mapping"){I(bI,bF)}}}function bH(){if(bF==""){j(bE);if(bB.visualMode){aR(bE)}else{if(bB.insertMode){v(bE)}}return true}}function by(bJ){var bI;while(bJ){bI=(/<\w+-.+?>|<\w+>|./).exec(bJ);bF=bI[0];bJ=bJ.substring(bI.index+bF.length);b.Vim.handleKey(bE,bF,"mapping")}}function bC(){if(bH()){return true}var bK=bB.inputState.keyBuffer=bB.inputState.keyBuffer+bF;var bL=bF.length==1;var bI=ba.matchCommand(bK,a,bB.inputState,"insert");while(bK.length>1&&bI.type!="full"){var bK=bB.inputState.keyBuffer=bK.slice(1);var bM=ba.matchCommand(bK,a,bB.inputState,"insert");if(bM.type!="none"){bI=bM}}if(bI.type=="none"){j(bE);return false}else{if(bI.type=="partial"){if(bt){window.clearTimeout(bt)}bt=window.setTimeout(function(){if(bB.insertMode&&bB.inputState.keyBuffer){j(bE)}},o("insertModeEscKeysTimeout"));return !bL}}if(bt){window.clearTimeout(bt)}if(bL){var bJ=bE.getCursor();bE.replaceRange("",D(bJ,0,-(bK.length-1)),bJ,"+input")}j(bE);return bI.command}function bA(){if(bG()||bH()){return true}var bK=bB.inputState.keyBuffer=bB.inputState.keyBuffer+bF;if(/^[1-9]\d*$/.test(bK)){return true}var bL=/^(\d*)(.*)$/.exec(bK);if(!bL){j(bE);return false}var bJ=bB.visualMode?"visual":"normal";var bI=ba.matchCommand(bL[2]||bL[1],a,bB.inputState,bJ);if(bI.type=="none"){j(bE);return false}else{if(bI.type=="partial"){return true}}bB.inputState.keyBuffer="";var bL=/^(\d*)(.*)$/.exec(bK);if(bL[1]&&bL[1]!="0"){bB.inputState.pushRepeatDigit(bL[1])}return bI.command}var bz;if(bB.insertMode){bz=bC()}else{bz=bA()}if(bz===false){return undefined}else{if(bz===true){return function(){}}else{return function(){return bE.operation(function(){bE.curOp.isVimOp=true;try{if(bz.type=="keyToKey"){by(bz.toKeys)}else{ba.processCommand(bE,bB,bz)}}catch(bI){bE.state.vim=undefined;G(bE);if(!b.Vim.suppressErrorLogging){console.log(bI)}throw bI}return true})}}}},handleEx:function(by,bz){m.processCommand(by,bz)}};function aA(){this.prefixRepeat=[];this.motionRepeat=[];this.operator=null;this.operatorArgs=null;this.motion=null;this.motionArgs=null;this.keyBuffer=[];this.registerName=null}aA.prototype.pushRepeatDigit=function(by){if(!this.operator){this.prefixRepeat=this.prefixRepeat.concat(by)}else{this.motionRepeat=this.motionRepeat.concat(by)}};aA.prototype.getRepeat=function(){var by=0;if(this.prefixRepeat.length>0||this.motionRepeat.length>0){by=1;if(this.prefixRepeat.length>0){by*=parseInt(this.prefixRepeat.join(""),10)}if(this.motionRepeat.length>0){by*=parseInt(this.motionRepeat.join(""),10)}}return by};function j(by,bz){by.state.vim.inputState=new aA();b.signal(by,"vim-command-done",bz)}function bn(bA,bz,by){this.clear();this.keyBuffer=[bA||""];this.insertModeChanges=[];this.searchQueries=[];this.linewise=!!bz;this.blockwise=!!by}bn.prototype={setText:function(bA,bz,by){this.keyBuffer=[bA||""];this.linewise=!!bz;this.blockwise=!!by},pushText:function(bz,by){if(by){if(!this.linewise){this.keyBuffer.push("\n")}this.linewise=true}this.keyBuffer.push(bz)},pushInsertModeChanges:function(by){this.insertModeChanges.push(i(by))},pushSearchQuery:function(by){this.searchQueries.push(by)},clear:function(){this.keyBuffer=[];this.insertModeChanges=[];this.searchQueries=[];this.linewise=false},toString:function(){return this.keyBuffer.join("")}};function ai(by){this.registers=by;this.unnamedRegister=by['"']=new bn();by["."]=new bn();by[":"]=new bn();by["/"]=new bn()}ai.prototype={pushText:function(bC,bz,bE,bD,bA){if(bD&&bE.charAt(0)=="\n"){bE=bE.slice(1)+"\n"}if(bD&&bE.charAt(bE.length-1)!=="\n"){bE+="\n"}var bB=this.isValidRegister(bC)?this.getRegister(bC):null;if(!bB){switch(bz){case"yank":this.registers["0"]=new bn(bE,bD,bA);break;case"delete":case"change":if(bE.indexOf("\n")==-1){this.registers["-"]=new bn(bE,bD)}else{this.shiftNumericRegisters_();this.registers["1"]=new bn(bE,bD)}break}this.unnamedRegister.setText(bE,bD,bA);return}var by=A(bC);if(by){bB.pushText(bE,bD)}else{bB.setText(bE,bD,bA)}this.unnamedRegister.setText(bB.toString(),bD)},getRegister:function(by){if(!this.isValidRegister(by)){return this.unnamedRegister}by=by.toLowerCase();if(!this.registers[by]){this.registers[by]=new bn()}return this.registers[by]},isValidRegister:function(by){return by&&J(by,l)},shiftNumericRegisters_:function(){for(var by=9;by>=2;by--){this.registers[by]=this.getRegister(""+(by-1))}}};function a3(){this.historyBuffer=[];this.iterator;this.initialPrefix=null}a3.prototype={nextMatch:function(bz,by){var bE=this.historyBuffer;var bB=by?-1:1;if(this.initialPrefix===null){this.initialPrefix=bz}for(var bD=this.iterator+bB;by?bD>=0:bD=bE.length){this.iterator=bE.length;return this.initialPrefix}if(bD<0){return bz}},pushInput:function(by){var bz=this.historyBuffer.indexOf(by);if(bz>-1){this.historyBuffer.splice(bz,1)}if(by.length){this.historyBuffer.push(by)}},reset:function(){this.initialPrefix=null;this.iterator=this.historyBuffer.length}};var ba={matchCommand:function(bD,bF,by,bB){var bE=bj(bD,bF,bB,by);if(!bE.full&&!bE.partial){return{type:"none"}}else{if(!bE.full&&bE.partial){return{type:"partial"}}}var bC;for(var bA=0;bA"){by.selectedCharacter=Q(bD)}return{type:"full",command:bC}},processCommand:function(by,bz,bA){bz.inputState.repeatOverride=bA.repeatOverride;switch(bA.type){case"motion":this.processMotion(by,bz,bA);break;case"operator":this.processOperator(by,bz,bA);break;case"operatorMotion":this.processOperatorMotion(by,bz,bA);break;case"action":this.processAction(by,bz,bA);break;case"search":this.processSearch(by,bz,bA);j(by);break;case"ex":case"keyToEx":this.processEx(by,bz,bA);j(by);break;default:break}},processMotion:function(by,bz,bA){bz.inputState.motion=bA.motion;bz.inputState.motionArgs=bh(bA.motionArgs);this.evalInput(by,bz)},processOperator:function(bz,bA,bB){var by=bA.inputState;if(by.operator){if(by.operator==bB.operator){by.motion="expandToLine";by.motionArgs={linewise:true};this.evalInput(bz,bA);return}else{j(bz)}}by.operator=bB.operator;by.operatorArgs=bh(bB.operatorArgs);if(bA.visualMode){this.evalInput(bz,bA)}},processOperatorMotion:function(by,bB,bC){var bA=bB.visualMode;var bz=bh(bC.operatorMotionArgs);if(bz){if(bA&&bz.visualLine){bB.visualLine=true}}this.processOperator(by,bB,bC);if(!bA){this.processMotion(by,bB,bC)}},processAction:function(bz,bB,bE){var by=bB.inputState;var bD=by.getRepeat();var bC=!!bD;var bA=bh(bE.actionArgs)||{};if(by.selectedCharacter){bA.selectedCharacter=by.selectedCharacter}if(bE.operator){this.processOperator(bz,bB,bE)}if(bE.motion){this.processMotion(bz,bB,bE)}if(bE.motion||bE.operator){this.evalInput(bz,bB)}bA.repeat=bD||1;bA.repeatIsExplicit=bC;bA.registerName=by.registerName;j(bz);bB.lastMotion=null;if(bE.isEdit){this.recordLastEdit(bB,by,bE)}p[bE.action](bz,bA,bB)},processSearch:function(bN,bG,bF){if(!bN.getSearchCursor){return}var bI=bF.searchArgs.forward;var bD=bF.searchArgs.wholeWordOnly;aG(bN).setReversed(!bI);var bJ=(bI)?"/":"?";var bL=aG(bN).getQuery();var bA=bN.getScrollInfo();function bE(bQ,bO,bP){q.searchHistoryController.pushInput(bQ);q.searchHistoryController.reset();try{bu(bN,bQ,bO,bP)}catch(bR){bk(bN,"Invalid regex: "+bQ);return}ba.processMotion(bN,bG,{type:"motion",motion:"findNext",motionArgs:{forward:true,toJumplist:bF.searchArgs.toJumplist}})}function bM(bO){bN.scrollTo(bA.left,bA.top);bE(bO,true,true);var bP=q.macroModeState;if(bP.isRecording){O(bP,bO)}}function bC(bS,bR,bT){var bQ=b.keyName(bS),bO;if(bQ=="Up"||bQ=="Down"){bO=bQ=="Up"?true:false;bR=q.searchHistoryController.nextMatch(bR,bO)||"";bT(bR)}else{if(bQ!="Left"&&bQ!="Right"&&bQ!="Ctrl"&&bQ!="Alt"&&bQ!="Shift"){q.searchHistoryController.reset()}}var bP;try{bP=bu(bN,bR,true,true)}catch(bS){}if(bP){bN.scrollIntoView(bw(bN,!bI,bP),30)}else{aK(bN);bN.scrollTo(bA.left,bA.top)}}function bz(bQ,bP,bR){var bO=b.keyName(bQ);if(bO=="Esc"||bO=="Ctrl-C"||bO=="Ctrl-["){q.searchHistoryController.pushInput(bP);q.searchHistoryController.reset();bu(bN,bL);aK(bN);bN.scrollTo(bA.left,bA.top);b.e_stop(bQ);bR();bN.focus()}}switch(bF.searchArgs.querySrc){case"prompt":var bH=q.macroModeState;if(bH.isPlaying){var bK=bH.replaySearchQueries.shift();bE(bK,true,false)}else{a0(bN,{onClose:bM,prefix:bJ,desc:P,onKeyUp:bC,onKeyDown:bz})}break;case"wordUnderCursor":var bB=aD(bN,false,true,false,true);var by=true;if(!bB){bB=aD(bN,false,true,false,false);by=false}if(!bB){return}var bK=bN.getLine(bB.start.line).substring(bB.start.ch,bB.end.ch);if(by&&bD){bK="\\b"+bK+"\\b"}else{bK=g(bK)}q.jumpList.cachedCursor=bN.getCursor();bN.setCursor(bB.start);bE(bK,true,false);break}},processEx:function(by,bz,bC){function bB(bD){q.exCommandHistoryController.pushInput(bD);q.exCommandHistoryController.reset();m.processCommand(by,bD)}function bA(bG,bE,bH){var bF=b.keyName(bG),bD;if(bF=="Esc"||bF=="Ctrl-C"||bF=="Ctrl-["){q.exCommandHistoryController.pushInput(bE);q.exCommandHistoryController.reset();b.e_stop(bG);bH();by.focus()}if(bF=="Up"||bF=="Down"){bD=bF=="Up"?true:false;bE=q.exCommandHistoryController.nextMatch(bE,bD)||"";bH(bE)}else{if(bF!="Left"&&bF!="Right"&&bF!="Ctrl"&&bF!="Alt"&&bF!="Shift"){q.exCommandHistoryController.reset()}}}if(bC.type=="keyToEx"){m.processCommand(by,bC.exArgs.input)}else{if(bz.visualMode){a0(by,{onClose:bB,prefix:":",value:"'<,'>",onKeyDown:bA})}else{a0(by,{onClose:bB,prefix:":",onKeyDown:bA})}}},evalInput:function(bG,bS){var bL=bS.inputState;var bP=bL.motion;var bM=bL.motionArgs||{};var bH=bL.operator;var b2=bL.operatorArgs||{};var bN=bL.registerName;var bT=bS.sel;var b3=C(bS.visualMode?bT.head:bG.getCursor("head"));var bE=C(bS.visualMode?bT.anchor:bG.getCursor("anchor"));var bB=C(b3);var bA=C(bE);var bR,bK;var bI;if(bH){this.recordLastEdit(bS,bL)}if(bL.repeatOverride!==undefined){bI=bL.repeatOverride}else{bI=bL.getRepeat()}if(bI>0&&bM.explicitRepeat){bM.repeatIsExplicit=true}else{if(bM.noRepeat||(!bM.explicitRepeat&&bI===0)){bI=1;bM.repeatIsExplicit=false}}if(bL.selectedCharacter){bM.selectedCharacter=b2.selectedCharacter=bL.selectedCharacter}bM.repeat=bI;j(bG);if(bP){var bQ=a1[bP](bG,b3,bM,bS);bS.lastMotion=a1[bP];if(!bQ){return}if(bM.toJumplist){var b1=q.jumpList;var bJ=b1.cachedCursor;if(bJ){be(bG,bJ,bQ);delete b1.cachedCursor}else{be(bG,b3,bQ)}}if(bQ instanceof Array){bK=bQ[0];bR=bQ[1]}else{bR=bQ}if(!bR){bR=C(b3)}if(bS.visualMode){if(!(bS.visualBlock&&bR.ch===Infinity)){bR=Z(bG,bR,bS.visualBlock)}if(bK){bK=Z(bG,bK,true)}bK=bK||bA;bT.anchor=bK;bT.head=bR;M(bG);aP(bG,bS,"<",aM(bK,bR)?bK:bR);aP(bG,bS,">",aM(bK,bR)?bR:bK)}else{if(!bH){bR=Z(bG,bR);bG.setCursor(bR.line,bR.ch)}}}if(bH){if(b2.lastSel){bK=bA;var by=b2.lastSel;var bY=Math.abs(by.head.line-by.anchor.line);var b0=Math.abs(by.head.ch-by.anchor.ch);if(by.visualLine){bR=c(bA.line+bY,bA.ch)}else{if(by.visualBlock){bR=c(bA.line+bY,bA.ch+b0)}else{if(by.head.line==by.anchor.line){bR=c(bA.line,bA.ch+b0)}else{bR=c(bA.line+bY,bA.ch)}}}bS.visualMode=true;bS.visualLine=by.visualLine;bS.visualBlock=by.visualBlock;bT=bS.sel={anchor:bK,head:bR};M(bG)}else{if(bS.visualMode){b2.lastSel={anchor:C(bT.anchor),head:C(bT.head),visualBlock:bS.visualBlock,visualLine:bS.visualLine}}}var bF,bU,bC,bO;var bD;if(bS.visualMode){bF=av(bT.head,bT.anchor);bU=a8(bT.head,bT.anchor);bC=bS.visualLine||b2.linewise;bO=bS.visualBlock?"block":bC?"line":"char";bD=bx(bG,{anchor:bF,head:bU},bO);if(bC){var bz=bD.ranges;if(bO=="block"){for(var bV=0;bVbF&&bG.line==bF)){return}if(bz.toFirstChar){bB=aZ(bE.getLine(bH));bA.lastHPos=bB}bA.lastHSPos=bE.charCoords(c(bH,bB),"div").left;return c(bH,bB)},moveByDisplayLines:function(bG,bF,bA,bB){var bH=bF;switch(bB.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:bB.lastHSPos=bG.charCoords(bH,"div").left}var by=bA.repeat;var bE=bG.findPosV(bH,(bA.forward?by:-by),"line",bB.lastHSPos);if(bE.hitSide){if(bA.forward){var bz=bG.charCoords(bE,"div");var bC={top:bz.top+8,left:bB.lastHSPos};var bE=bG.coordsChar(bC,"div")}else{var bD=bG.charCoords(c(bG.firstLine(),0),"div");bD.left=bB.lastHSPos;bE=bG.coordsChar(bD,"div")}}bB.lastHPos=bE.ch;return bE},moveByPage:function(bz,bB,bA){var by=bB;var bC=bA.repeat;return bz.findPosV(by,(bA.forward?bC:-bC),"page")},moveByParagraph:function(by,bB,bA){var bz=bA.forward?1:-1;return bm(by,bB,bA.repeat,bz)},moveByScroll:function(bE,bB,bz,bA){var bF=bE.getScrollInfo();var bG=null;var by=bz.repeat;if(!by){by=bF.clientHeight/(2*bE.defaultTextHeight())}var bD=bE.charCoords(bB,"local");bz.repeat=by;var bG=a1.moveByDisplayLines(bE,bB,bz,bA);if(!bG){return null}var bC=bE.charCoords(bG,"local");bE.scrollTo(null,bF.top+bC.top-bD.top);return bG},moveByWords:function(by,bA,bz){return aB(by,bA,bz.repeat,!!bz.forward,!!bz.wordEnd,!!bz.bigWord)},moveTillCharacter:function(bz,bA,bB){var bD=bB.repeat;var bC=bp(bz,bD,bB.forward,bB.selectedCharacter);var by=bB.forward?-1:1;aC(by,bB);if(!bC){return null}bC.ch+=by;return bC},moveToCharacter:function(by,bA,bz){var bB=bz.repeat;aC(0,bz);return bp(by,bB,bz.forward,bz.selectedCharacter)||bA},moveToSymbol:function(by,bA,bz){var bB=bz.repeat;return bq(by,bB,bz.forward,bz.selectedCharacter)||bA},moveToColumn:function(by,bB,bA,bz){var bC=bA.repeat;bz.lastHPos=bC-1;bz.lastHSPos=by.charCoords(bB,"div").left;return aj(by,bC)},moveToEol:function(by,bD,bC,bB){var bE=bD;bB.lastHPos=Infinity;var bA=c(bE.line+bC.repeat-1,Infinity);var bz=by.clipPos(bA);bz.ch--;bB.lastHSPos=by.charCoords(bz,"div").left;return bA},moveToFirstNonWhiteSpaceCharacter:function(by,bz){var bA=bz;return c(bA.line,aZ(by.getLine(bA.line)))},moveToMatchedSymbol:function(bE,bC){var bF=bC;var bG=bF.line;var by=bF.ch;var bD=bE.getLine(bG);var bB;do{bB=bD.charAt(by++);if(bB&&N(bB)){var bz=bE.getTokenTypeAt(c(bG,by));if(bz!=="string"&&bz!=="comment"){break}}}while(bB);if(bB){var bA=bE.findMatchingBracket(c(bG,by));return bA.to}else{return bF}},moveToStartOfLine:function(bz,by){return c(by.line,0)},moveToLineOrEdgeOfDocument:function(by,bz,bA){var bB=bA.forward?by.lastLine():by.firstLine();if(bA.repeatIsExplicit){bB=bA.repeat-by.getOption("firstLineNumber")}return c(bB,aZ(by.getLine(bB)))},textObjectManipulation:function(bG,bE,bA,bB){var by={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["};var bH={"'":true,'"':true};var bD=bA.selectedCharacter;if(bD=="b"){bD="("}else{if(bD=="B"){bD="{"}}var bF=!bA.textObjectInner;var bC;if(by[bD]){bC=n(bG,bE,bD,bF)}else{if(bH[bD]){bC=aO(bG,bE,bD,bF)}else{if(bD==="W"){bC=aD(bG,bF,true,true)}else{if(bD==="w"){bC=aD(bG,bF,true,false)}else{if(bD==="p"){bC=bm(bG,bE,bA.repeat,0,bF);bA.linewise=true;if(bB.visualMode){if(!bB.visualLine){bB.visualLine=true}}else{var bz=bB.inputState.operatorArgs;if(bz){bz.linewise=true}bC.end.line--}}else{return null}}}}}if(!bG.state.vim.visualMode){return[bC.start,bC.end]}else{return t(bG,bC.start,bC.end)}},repeatLastCharacterSearch:function(bA,bD,bC){var bz=q.lastChararacterSearch;var bF=bC.repeat;var bB=bC.forward===bz.forward;var by=(bz.increment?1:0)*(bB?-1:1);bA.moveH(-by,"char");bC.inclusive=bB?true:false;var bE=bp(bA,bF,bB,bz.selectedCharacter);if(!bE){bA.moveH(by,"char");return bD}bE.ch+=by;return bE}};function y(bB,bA){var by=[];for(var bz=0;bz1);p.enterInsertMode(bH,{head:bE},bH.state.vim)},"delete":function(bF,bD,by){var bC,bG;var bA=bF.state.vim;if(!bA.visualBlock){var bB=by[0].anchor,bE=by[0].head;if(bD.linewise&&bE.line!=bF.firstLine()&&bB.line==bF.lastLine()&&bB.line==bE.line-1){if(bB.line==bF.firstLine()){bB.ch=0}else{bB=c(bB.line-1,aV(bF,bB.line-1))}}bG=bF.getRange(bB,bE);bF.replaceRange("",bB,bE);bC=bB;if(bD.linewise){bC=a1.moveToFirstNonWhiteSpaceCharacter(bF,bB)}}else{bG=bF.getSelection();var bz=y("",by.length);bF.replaceSelections(bz);bC=by[0].anchor}q.registerController.pushText(bD.registerName,"delete",bG,bD.linewise,bA.visualBlock);return bC},indent:function(bF,bE,by){var bC=bF.state.vim;var bG=by[0].anchor.line;var bA=bC.visualBlock?by[by.length-1].anchor.line:by[0].head.line;var bz=(bC.visualMode)?bE.repeat:1;if(bE.linewise){bA--}for(var bD=bG;bD<=bA;bD++){for(var bB=0;bBbB.top){bI.line+=(bD-bB.top)/bF;bI.line=Math.ceil(bI.line);bG.setCursor(bI);bB=bG.charCoords(bI,"local");bG.scrollTo(null,bB.top)}else{bG.scrollTo(null,bD)}}else{var bz=bD+bG.getScrollInfo().clientHeight;if(bz=bE.anchor.line){bC=D(bE.head,0,1)}else{bC=c(bE.anchor.line,0)}}else{bC=c(Math.min(bE.head.line,bE.anchor.line),Math.max(bE.head.ch+1,bE.anchor.ch));by=Math.abs(bE.head.line-bE.anchor.line)+1}}else{if(bD=="inplace"){if(bB.visualMode){return}}}}}}}bz.setOption("keyMap","vim-insert");bz.setOption("disableInput",false);if(bA&&bA.replace){bz.toggleOverwrite(true);bz.setOption("keyMap","vim-replace");b.signal(bz,"vim-mode-change",{mode:"replace"})}else{bz.setOption("keyMap","vim-insert");b.signal(bz,"vim-mode-change",{mode:"insert"})}if(!q.macroModeState.isPlaying){bz.on("change",bg);b.on(bz.getInputField(),"keydown",W)}if(bB.visualMode){aR(bz)}aS(bz,bC,by)},toggleVisualMode:function(by,bz,bA){var bD=bz.repeat;var bB=by.getCursor();var bC;if(!bA.visualMode){bA.visualMode=true;bA.visualLine=!!bz.linewise;bA.visualBlock=!!bz.blockwise;bC=Z(by,c(bB.line,bB.ch+bD-1),true);bA.sel={anchor:bB,head:bC};b.signal(by,"vim-mode-change",{mode:"visual",subMode:bA.visualLine?"linewise":bA.visualBlock?"blockwise":""});M(by);aP(by,bA,"<",av(bB,bC));aP(by,bA,">",a8(bB,bC))}else{if(bA.visualLine^bz.linewise||bA.visualBlock^bz.blockwise){bA.visualLine=!!bz.linewise;bA.visualBlock=!!bz.blockwise;b.signal(by,"vim-mode-change",{mode:"visual",subMode:bA.visualLine?"linewise":bA.visualBlock?"blockwise":""});M(by)}else{aR(by)}}},reselectLastSelection:function(by,bD,bA){var bz=bA.lastSelection;if(bA.visualMode){bf(by,bA)}if(bz){var bB=bz.anchorMark.find();var bC=bz.headMark.find();if(!bB||!bC){return}bA.sel={anchor:bB,head:bC};bA.visualMode=true;bA.visualLine=bz.visualLine;bA.visualBlock=bz.visualBlock;M(by);aP(by,bA,"<",av(bB,bC));aP(by,bA,">",a8(bB,bC));b.signal(by,"vim-mode-change",{mode:"visual",subMode:bA.visualLine?"linewise":bA.visualBlock?"blockwise":""})}},joinLines:function(bF,bz,bB){var bE,bH;if(bB.visualMode){bE=bF.getCursor("anchor");bH=bF.getCursor("head");bH.ch=aV(bF,bH.line)-1}else{var by=Math.max(bz.repeat,2);bE=bF.getCursor();bH=Z(bF,c(bE.line+by-1,Infinity))}var bA=0;for(var bD=bE.line;bD1){var bP=Array(bL.repeat+1).join(bP)}var bI=bz.linewise;var bK=bz.blockwise;if(bI){if(bU.visualMode){bP=bU.visualLine?bP.slice(0,-1):"\n"+bP.slice(0,bP.length-1)+"\n"}else{if(bL.after){bP="\n"+bP.slice(0,bP.length-1);bF.ch=aV(bM,bF.line)}else{bF.ch=0}}}else{if(bK){bP=bP.split("\n");for(var bV=0;bVbM.lastLine()){bM.replaceRange("\n",c(bN,0))}var bX=aV(bM,bN);if(bXbI.length){bE=bI.length}bH=c(bF.line,bE)}if(bB=="\n"){if(!bC.visualMode){bG.replaceRange("",bF,bH)}(b.commands.newlineAndIndentContinueComment||b.commands.newlineAndIndent)(bG)}else{var by=bG.getRange(bF,bH);by=by.replace(/[^\n]/g,bB);if(bC.visualBlock){var bD=new Array(bG.getOption("tabSize")+1).join(" ");by=bG.getSelection();by=by.replace(/\t/g,bD).replace(/[^\n]/g,bB).split("\n");bG.replaceSelections(by)}else{bG.replaceRange(by,bF,bH)}if(bC.visualMode){bF=aM(bz[0].anchor,bz[0].head)?bz[0].anchor:bz[0].head;bG.setCursor(bF);aR(bG)}else{bG.setCursor(D(bH,0,-1))}}},incrementNumberToken:function(bI,bz){var bJ=bI.getCursor();var bE=bI.getLine(bJ.line);var bL=/-?\d+/g;var bD;var by;var bC;var bK;var bA;while((bD=bL.exec(bE))!==null){bA=bD[0];by=bD.index;bC=by+bA.length;if(bJ.ch"){var bz=by.length-11;var bC=bB.slice(0,bz);var bA=by.slice(0,bz);return bC==bA&&bB.length>bz?"full":bA.indexOf(bC)==0?"partial":false}else{return bB==by?"full":by.indexOf(bB)==0?"partial":false}}function Q(bA){var bz=/^.*(<[\w\-]+>)$/.exec(bA);var by=bz?bz[1]:bA.slice(-1);if(by.length>1){switch(by){case"":by="\n";break;case"":by=" ";break;default:break}}return by}function aw(by,bz,bA){return function(){for(var bB=0;bB2){by=av.apply(undefined,Array.prototype.slice.call(arguments,1))}return aM(bz,by)?bz:by}function a8(bz,by){if(arguments.length>2){by=a8.apply(undefined,Array.prototype.slice.call(arguments,1))}return aM(bz,by)?by:bz}function au(bB,bA,bz){var bC=aM(bB,bA);var by=aM(bA,bz);return bC&&by}function aV(by,bz){return by.getLine(bz).length}function k(by){return by.split("").reverse().join("")}function a7(by){if(by.trim){return by.trim()}return by.replace(/^\s+|\s+$/g,"")}function g(by){return by.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function aW(by,bC,bB){var bA=aV(by,bC);var bz=new Array(bB-bA+1).join(" ");by.setCursor(c(bC,bA));by.replaceRange(bz,by.getCursor())}function F(bG,bz){var bB=[],bA=bG.listSelections();var bC=C(bG.clipPos(bz));var bR=!bv(bz,bC);var bE=bG.getCursor("head");var bQ=u(bA,bE);var bH=bv(bA[bQ].head,bA[bQ].anchor);var bP=bA.length-1;var bF=bP-bQ>bQ?bP:0;var bD=bA[bF].anchor;var bM=Math.min(bD.line,bC.line);var by=Math.max(bD.line,bC.line);var bI=bD.ch,bJ=bC.ch;var bO=bA[bF].head.ch-bI;var bL=bJ-bI;if(bO>0&&bL<=0){bI++;if(!bR){bJ--}}else{if(bO<0&&bL>=0){bI--;if(!bH){bJ++}}else{if(bO<0&&bL==-1){bI--;bJ++}}}for(var bK=bM;bK<=by;bK++){var bN={anchor:new c(bK,bI),head:new c(bK,bJ)};bB.push(bN)}bQ=bC.line==by?bB.length-1:0;bG.setSelections(bB);bz.ch=bJ;bD.ch=bI;return bD}function aS(bz,bB,by){var bD=[];for(var bA=0;bAbL){bJ.line=bL}bJ.ch=aV(bM,bJ.line)}else{bJ.ch=0;bG.ch=aV(bM,bG.line)}return{ranges:[{anchor:bG,head:bJ}],primary:0}}else{if(bH=="block"){var bI=Math.min(bG.line,bJ.line),bE=Math.min(bG.ch,bJ.ch),by=Math.max(bG.line,bJ.line),bN=Math.max(bG.ch,bJ.ch)+1;var bO=by-bI+1;var bD=bJ.line==bI?0:bO-1;var bz=[];for(var bF=0;bF0&&bA&&T(bA);bA=bB.pop()){bD.line--;bD.ch=0}if(bA){bD.line--;bD.ch=aV(bz,bD.line)}else{bD.ch=0}}}function bc(bz,by,bA){by.ch=0;bA.ch=0;bA.line++}function aZ(bz){if(!bz){return 0}var by=bz.search(/\S/);return by==-1?bz.length:by}function aD(bH,bD,bR,bz,bS){var bB=e(bH);var bK=bH.getLine(bB.line);var bN=bB.ch;var bM=bK.substring(bN);var bO;if(bS){bO=bM.search(/\w/)}else{bO=bM.search(/\S/)}if(bO==-1){return null}bN+=bO;bM=bK.substring(bN);var bQ=bK.substring(0,bN);var bT;if(bz){bT=/^\S+/}else{if((/\w/).test(bK.charAt(bN))){bT=/^\w+/}else{bT=/^[^\w\s]+/}}var bE=bT.exec(bM);var bL=bN;var bA=bN+bE[0].length;var bC=k(bQ);var bI=bT.exec(bC);if(bI){bL-=bI[0].length}if(bD){var bJ=bK.substring(bA);var by=bJ.match(/^\s*/)[0].length;if(by>0){bA+=by}else{var bG=bC.length-bL;var bF=bC.substring(bG);var bP=bF.match(/^\s*/)[0].length;bL-=bP}}return{start:c(bB.line,bL),end:c(bB.line,bA)}}function be(by,bz,bA){if(!bv(bz,bA)){q.jumpList.add(by,bz,bA)}}function aC(by,bz){q.lastChararacterSearch.increment=by;q.lastChararacterSearch.forward=bz.forward;q.lastChararacterSearch.selectedCharacter=bz.selectedCharacter}var S={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"};var aX={bracket:{isComplete:function(by){if(by.nextCh===by.symb){by.depth++;if(by.depth>=1){return true}}else{if(by.nextCh===by.reverseSymb){by.depth--}}return false}},section:{init:function(by){by.curMoveThrough=true;by.symb=(by.forward?"]":"[")===by.symb?"{":"}"},isComplete:function(by){return by.index===0&&by.nextCh===by.symb}},comment:{isComplete:function(bz){var by=bz.lastCh==="*"&&bz.nextCh==="/";bz.lastCh=bz.nextCh;return by}},method:{init:function(by){by.symb=(by.symb==="m"?"{":"}");by.reverseSymb=by.symb==="{"?"}":"{"},isComplete:function(by){if(by.nextCh===by.symb){return true}return false}},preprocess:{init:function(by){by.index=0},isComplete:function(bz){if(bz.nextCh==="#"){var by=bz.lineText.match(/#(\w+)/)[1];if(by==="endif"){if(bz.forward&&bz.depth===0){return true}bz.depth++}else{if(by==="if"){if(!bz.forward&&bz.depth===0){return true}bz.depth--}}if(by==="else"&&bz.depth===0){return true}}return false}}};function bq(bH,bz,bC,bA){var bK=C(bH.getCursor());var bI=bC?1:-1;var bB=bC?bH.lineCount():-1;var bG=bK.ch;var bM=bK.line;var bF=bH.getLine(bM);var by={lineText:bF,nextCh:bF.charAt(bG),lastCh:null,index:bG,symb:bA,reverseSymb:(bC?{")":"(","}":"{"}:{"(":")","{":"}"})[bA],forward:bC,depth:0,curMoveThrough:false};var bD=S[bA];if(!bD){return bK}var bL=aX[bD].init;var bJ=aX[bD].isComplete;if(bL){bL(by)}while(bM!==bB&&bz){by.index+=bI;by.nextCh=by.lineText.charAt(by.index);if(!by.nextCh){bM+=bI;by.lineText=bH.getLine(bM)||"";if(bI>0){by.index=0}else{var bE=by.lineText.length;by.index=(bE>0)?(bE-1):0}by.nextCh=by.lineText.charAt(by.index)}if(bJ(by)){bK.line=bM;bK.ch=by.index;bz--}}if(by.nextCh||by.curMoveThrough){return c(bM,by.index)}return bK}function bs(bI,bJ,bB,bG,bH){var bC=bJ.line;var bF=bJ.ch;var bM=bI.getLine(bC);var bz=bB?1:-1;var bD=bG?bl:aq;if(bH&&bM==""){bC+=bz;bM=bI.getLine(bC);if(!f(bI,bC)){return null}bF=(bB)?0:bM.length}while(true){if(bH&&bM==""){return{from:0,to:0,line:bC}}var bE=(bz>0)?bM.length:-1;var bL=bE,bK=bE;while(bF!=bE){var by=false;for(var bA=0;bA0)?0:bM.length}throw new Error("The impossible happened.")}function aB(bI,bK,bz,bD,bM,bG){var bE=C(bK);var bF=[];if(bD&&!bM||!bD&&bM){bz++}var bH=!(bD&&bM);for(var bB=0;bB0){if(bI(bH,bA)){bz--}bH+=bA}return new c(bH,0)}var bD=bM.state.vim;if(bD.visualLine&&bI(bN,1,true)){var bF=bD.sel.anchor;if(bI(bF.line,-1,true)){if(!bL||bF.line!=bN){bN+=1}}}var bC=bG(bN);for(bH=bN;bH<=bK&&bz;bH++){if(bI(bH,1,true)){if(!bL||bG(bH)!=bC){bz--}}}bB=new c(bH,0);if(bH>bK&&!bC){bC=true}else{bL=false}for(bH=bN;bH>bE;bH--){if(!bL||bG(bH)==bC||bH==bN){if(bI(bH,-1,true)){break}}}by=new c(bH,0);return{start:by,end:bB}}function n(bI,bG,bA,bH){var bJ=bG,bz,bC;var bF=({"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/})[bA];var bB=({"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"})[bA];var by=bI.getLine(bJ.line).charAt(bJ.ch);var bD=by===bB?1:0;bz=bI.scanForBracket(c(bJ.line,bJ.ch+bD),-1,null,{bracketRegex:bF});bC=bI.scanForBracket(c(bJ.line,bJ.ch+bD),1,null,{bracketRegex:bF});if(!bz||!bC){return{start:bJ,end:bJ}}bz=bz.pos;bC=bC.pos;if((bz.line==bC.line&&bz.ch>bC.ch)||(bz.line>bC.line)){var bE=bz;bz=bC;bC=bE}if(bH){bC.ch+=1}else{bz.ch+=1}return{start:bz,end:bC}}function aO(bH,bF,bA,bG){var bI=C(bF);var bJ=bH.getLine(bI.line);var bE=bJ.split("");var bz,bB,bC,bD;var by=bE.indexOf(bA);if(bI.ch-1&&!bz;bC--){if(bE[bC]==bA){bz=bC+1}}}if(bz&&!bB){for(bC=bz,bD=bE.length;bC'+bz+"
",{bottom:true,duration:5000})}else{alert(bz)}}function aF(bz,bA){var by="";if(bz){by+=''+bz+""}by+=' ';if(bA){by+='';by+=bA;by+=""}return by}var P="(Javascript regexp)";function a0(bz,bA){var bB=(bA.prefix||"")+" "+(bA.desc||"");var by=aF(bA.prefix,bA.desc);ab(bz,by,bB,bA.onClose,bA)}function X(bz,by){if(bz instanceof RegExp&&by instanceof RegExp){var bB=["global","multiline","ignoreCase","source"];for(var bA=0;bA=bz&&bA<=by)}else{return bA==bz}}}function bb(by){var bB=by.getScrollInfo();var bA=6;var bE=10;var bD=by.coordsChar({left:0,top:bA+bB.top},"local");var bz=bB.clientHeight-bE+bB.top;var bC=by.coordsChar({left:0,top:bz},"local");return{top:bD.line,bottom:bC.line}}var B=[{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:"set"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:true},{name:"nohlsearch",shortName:"noh"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:true},{name:"global",shortName:"g"}];var Y=function(){this.buildCommandMap_()};Y.prototype={processCommand:function(bJ,bI,bz){var bD=bJ.state.vim;var bA=q.registerController.getRegister(":");var bG=bA.toString();if(bD.visualMode){aR(bJ)}var by=new b.StringStream(bI);bA.setText(bI);var bC=bz||{};bC.input=bI;try{this.parseInput_(bJ,by,bC)}catch(bH){bk(bJ,bH);throw bH}var bB;var bF;if(!bC.commandName){if(bC.line!==undefined){bF="move"}}else{bB=this.matchCommand_(bC.commandName);if(bB){bF=bB.name;if(bB.excludeFromCommandHistory){bA.setText(bG)}this.parseCommandArgs_(by,bC,bB);if(bB.type=="exToKey"){for(var bE=0;bE0;by--){var bA=bz.substring(0,by);if(this.commandMap_[bA]){var bB=this.commandMap_[bA];if(bB.name.indexOf(bz)===0){return bB}}}return null},buildCommandMap_:function(){this.commandMap_={};for(var bz=0;bz
";if(!bF){for(var by in bC){var bG=bC[by].toString();if(bG.length){bA+='"'+by+" "+bG+"
"}}}else{var by;bF=bF.join("");for(var bB=0;bB"}}bk(bD,bA)},sort:function(bH,bR){var bI,bB,bz,bA;function bC(){if(bR.argString){var bV=new b.StringStream(bR.argString);if(bV.eat("!")){bI=true}if(bV.eol()){return}if(!bV.eatSpace()){return"Invalid arguments"}var bX=bV.match(/[a-z]+/);if(bX){bX=bX[0];bB=bX.indexOf("i")!=-1;bz=bX.indexOf("u")!=-1;var bU=bX.indexOf("d")!=-1&&1;var bW=bX.indexOf("x")!=-1&&1;var bT=bX.indexOf("o")!=-1&&1;if(bU+bW+bT>1){return"Invalid arguments"}bA=bU&&"decimal"||bW&&"hex"||bT&&"octal"}if(bV.eatSpace()&&bV.match(/\/.*\//)){"patterns not supported"}}}var bD=bC();if(bD){bk(bH,bD+": "+bR.argString);return}var bM=bR.line||bH.firstLine();var bQ=bR.lineEnd||bR.line||bH.lastLine();if(bM==bQ){return}var bG=c(bM,0);var bO=c(bQ,aV(bH,bQ));var bL=bH.getRange(bG,bO).split("\n");var bE=(bA=="decimal")?/(-?)([\d]+)/:(bA=="hex")?/(-?)(?:0x)?([0-9a-f]+)/i:(bA=="octal")?/([0-7]+)/:null;var bF=(bA=="decimal")?10:(bA=="hex")?16:(bA=="octal")?8:null;var bJ=[],bN=[];if(bA){for(var bP=0;bP"}}if(!bB){bk(bL,bH);return}var bG=0;var bM=function(){if(bG=bH){bk(bI,"Invalid argument: "+bD.argString.substring(bG));return}for(var bE=0;bE<=bH-bz;bE++){var bC=String.fromCharCode(bz+bE);delete by.marks[bC]}}else{bk(bI,"Invalid argument: "+bB+"-");return}}else{delete by.marks[bA]}}}};var m=new Y();function a6(bM,bz,bB,bH,bF,bA,bJ,bD,bN){bM.state.vim.exMode=true;var bE=false;var bL=bA.from();function bI(){bM.operation(function(){while(!bE){bC();bG()}bK()})}function bC(){var bP=bM.getRange(bA.from(),bA.to());var bO=bP.replace(bJ,bD);bA.replace(bO)}function bG(){var bO;while(bO=bA.findNext()&&ae(bA.from(),bH,bF)){if(!bB&&bL&&bA.from().line==bL.line){continue}bM.scrollIntoView(bA.from(),30);bM.setSelection(bA.from(),bA.to());bL=bA.from();bE=false;return}bE=true}function bK(bP){if(bP){bP()}bM.focus();if(bL){bM.setCursor(bL);var bO=bM.state.vim;bO.exMode=false;bO.lastHPos=bO.lastHSPos=bL.ch}if(bN){bN()}}function by(bR,bO,bS){b.e_stop(bR);var bP=b.keyName(bR);switch(bP){case"Y":bC();bG();break;case"N":bG();break;case"A":var bQ=bN;bN=undefined;bM.operation(bI);bN=bQ;break;case"L":bC();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":bK(bS);break}if(bE){bK(bS)}return true}bG();if(bE){bk(bM,"No matches for "+bJ.source);return}if(!bz){bI();if(bN){bN()}return}a0(bM,{prefix:"replace with "+bD+" (y/n/a/q/l)",onKeyDown:by})}b.keyMap.vim={attach:s,detach:h,call:a2};function v(bG){var bz=bG.state.vim;var bB=q.macroModeState;var bE=q.registerController.getRegister(".");var by=bB.isPlaying;var bC=bB.lastInsertModeChanges;var bH=[];if(!by){var bD=bC.inVisualBlock?bz.lastSelection.visualBlock.height:1;var bF=bC.changes;var bH=[];var bA=0;while(bA1){x(bG,bz,bz.insertModeRepeat-1,true);bz.lastEditInputState.repeatOverride=bz.insertModeRepeat}delete bz.insertModeRepeat;bz.insertMode=false;bG.setCursor(bG.getCursor().line,bG.getCursor().ch-1);bG.setOption("keyMap","vim");bG.setOption("disableInput",true);bG.toggleOverwrite(false);bE.setText(bC.changes.join(""));b.signal(bG,"vim-mode-change",{mode:"normal"});if(bB.isRecording){an(bB)}}aJ("insertModeEscKeysTimeout",200,"number");b.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(by){var bz=b.commands.newlineAndIndentContinueComment||b.commands.newlineAndIndent;bz(by)},fallthrough:["default"],attach:s,detach:h,call:a2};b.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:s,detach:h,call:a2};function H(bG,bA,bB,by){var bI=q.registerController.getRegister(by);var bz=bI.keyBuffer;var bE=0;bB.isPlaying=true;bB.replaySearchQueries=bI.searchQueries.slice(0);for(var bC=0;bC|<\w+>|./).exec(bJ);bH=bD[0];bJ=bJ.substring(bD.index+bH.length);b.Vim.handleKey(bG,bH,"macro");if(bA.insertMode){var bF=bI.insertModeChanges[bE++].changes;q.macroModeState.lastInsertModeChanges.changes=bF;ar(bG,bF,1);v(bG)}}}bB.isPlaying=false}function I(bB,by){if(bB.isPlaying){return}var bA=bB.latestRegister;var bz=q.registerController.getRegister(bA);if(bz){bz.pushText(by)}}function an(bA){if(bA.isPlaying){return}var bz=bA.latestRegister;var by=q.registerController.getRegister(bz);if(by){by.pushInsertModeChanges(bA.lastInsertModeChanges)}}function O(bB,bA){if(bB.isPlaying){return}var bz=bB.latestRegister;var by=q.registerController.getRegister(bz);if(by){by.pushSearchQuery(bA)}}function bg(bz,by){var bB=q.macroModeState;var bA=bB.lastInsertModeChanges;if(!bB.isPlaying){while(by){bA.expectCursorActivityForChange=true;if(by.origin=="+input"||by.origin=="paste"||by.origin===undefined){var bC=by.text.join("\n");bA.changes.push(bC)}by=by.next}}}function aa(by){var bz=by.state.vim;if(bz.insertMode){var bB=q.macroModeState;if(bB.isPlaying){return}var bA=bB.lastInsertModeChanges;if(bA.expectCursorActivityForChange){bA.expectCursorActivityForChange=false}else{bA.changes=[]}}else{if(!by.curOp.isVimOp){r(by,bz)}}if(bz.visualMode){ac(by)}}function ac(by){var bz=by.state.vim;var bB=C(bz.sel.head);var bA=D(bB,0,1);if(bz.fakeCursor){bz.fakeCursor.clear()}bz.fakeCursor=by.markText(bB,bA,{className:"cm-animate-fat-cursor"})}function r(by,bz){var bA=by.getCursor("anchor");var bB=by.getCursor("head");if(bz.visualMode&&bv(bB,bA)&&aV(by,bB.line)>bB.ch){aR(by,false)}else{if(!bz.visualMode&&!bz.insertMode&&by.somethingSelected()){bz.visualMode=true;bz.visualLine=false;b.signal(by,"vim-mode-change",{mode:"visual"})}}if(bz.visualMode){var bC=!aM(bB,bA)?-1:0;var bD=aM(bB,bA)?-1:0;bB=D(bB,0,bC);bA=D(bA,0,bD);bz.sel={anchor:bA,head:bB};aP(by,bz,"<",av(bB,bA));aP(by,bz,">",a8(bB,bA))}else{if(!bz.insertMode){bz.lastHPos=by.getCursor().ch}}}function bi(by){this.keyName=by}function W(bC){var bB=q.macroModeState;var bA=bB.lastInsertModeChanges;var bz=b.keyName(bC);if(!bz){return}function by(){bA.changes.push(new bi(bz));return true}if(bz.indexOf("Delete")!=-1||bz.indexOf("Backspace")!=-1){b.lookupKey(bz,"vim-insert",by)}}function x(bG,bB,bz,by){var bD=q.macroModeState;bD.isPlaying=true;var bH=!!bB.lastEditActionCommand;var bE=bB.inputState;function bA(){if(bH){ba.processAction(bG,bB,bB.lastEditActionCommand)}else{ba.evalInput(bG,bB)}}function bF(bJ){if(bD.lastInsertModeChanges.changes.length>0){bJ=!bB.lastEditActionCommand?1:bJ;var bI=bD.lastInsertModeChanges;ar(bG,bI.changes,bJ)}}bB.inputState=bB.lastEditInputState;if(bH&&bB.lastEditActionCommand.interlaceInsertRepeat){for(var bC=0;bC= pos.ch + 1) return /\bstring2?\b/.test(type1); + stream.start = stream.pos; + } + } + + function buildKeymap(pairs, triples) { + var map = { + name : "autoCloseBrackets", + Backspace: function(cm) { + if (cm.getOption("disableInput")) return CodeMirror.Pass; + var ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) return CodeMirror.Pass; + var around = charsAround(cm, ranges[i].head); + if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; + } + for (var i = ranges.length - 1; i >= 0; i--) { + var cur = ranges[i].head; + cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); + } + } + }; + var closingBrackets = ""; + for (var i = 0; i < pairs.length; i += 2) (function(left, right) { + closingBrackets += right; + map["'" + left + "'"] = function(cm) { + if (cm.getOption("disableInput")) return CodeMirror.Pass; + var ranges = cm.listSelections(), type, next; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i], cur = range.head, curType; + var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); + if (!range.empty()) { + curType = "surround"; + } else if (left == right && next == right) { + if (cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == left + left + left) + curType = "skipThree"; + else + curType = "skip"; + } else if (left == right && cur.ch > 1 && triples.indexOf(left) >= 0 && + cm.getRange(Pos(cur.line, cur.ch - 2), cur) == left + left && + (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != left)) { + curType = "addFour"; + } else if (left == '"' || left == "'") { + if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, left)) curType = "both"; + else return CodeMirror.Pass; + } else if (cm.getLine(cur.line).length == cur.ch || closingBrackets.indexOf(next) >= 0 || SPACE_CHAR_REGEX.test(next)) { + curType = "both"; + } else { + return CodeMirror.Pass; + } + if (!type) type = curType; + else if (type != curType) return CodeMirror.Pass; + } + + cm.operation(function() { + if (type == "skip") { + cm.execCommand("goCharRight"); + } else if (type == "skipThree") { + for (var i = 0; i < 3; i++) + cm.execCommand("goCharRight"); + } else if (type == "surround") { + var sels = cm.getSelections(); + for (var i = 0; i < sels.length; i++) + sels[i] = left + sels[i] + right; + cm.replaceSelections(sels, "around"); + } else if (type == "both") { + cm.replaceSelection(left + right, null); + cm.execCommand("goCharLeft"); + } else if (type == "addFour") { + cm.replaceSelection(left + left + left + left, "before"); + cm.execCommand("goCharRight"); + } + }); + }; + if (left != right) map["'" + right + "'"] = function(cm) { + var ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (!range.empty() || + cm.getRange(range.head, Pos(range.head.line, range.head.ch + 1)) != right) + return CodeMirror.Pass; + } + cm.execCommand("goCharRight"); + }; + })(pairs.charAt(i), pairs.charAt(i + 1)); + return map; + } + + function buildExplodeHandler(pairs) { + return function(cm) { + if (cm.getOption("disableInput")) return CodeMirror.Pass; + var ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) return CodeMirror.Pass; + var around = charsAround(cm, ranges[i].head); + if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; + } + cm.operation(function() { + cm.replaceSelection("\n\n", null); + cm.execCommand("goCharLeft"); + ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var line = ranges[i].head.line; + cm.indentLine(line, null, true); + cm.indentLine(line + 1, null, true); + } + }); + }; + } +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/** + * Tag-closer extension for CodeMirror. + * + * This extension adds an "autoCloseTags" option that can be set to + * either true to get the default behavior, or an object to further + * configure its behavior. + * + * These are supported options: + * + * `whenClosing` (default true) + * Whether to autoclose when the '/' of a closing tag is typed. + * `whenOpening` (default true) + * Whether to autoclose the tag when the final '>' of an opening + * tag is typed. + * `dontCloseTags` (default is empty tags for HTML, none for XML) + * An array of tag names that should not be autoclosed. + * `indentTags` (default is block tags for HTML, none for XML) + * An array of tag names that should, when opened, cause a + * blank line to be added inside the tag, and the blank line and + * closing line to be indented. + * + * See demos/closetag.html for a usage example. + */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../fold/xml-fold")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../fold/xml-fold"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) { + if (old != CodeMirror.Init && old) + cm.removeKeyMap("autoCloseTags"); + if (!val) return; + var map = {name: "autoCloseTags"}; + if (typeof val != "object" || val.whenClosing) + map["'/'"] = function(cm) { return autoCloseSlash(cm); }; + if (typeof val != "object" || val.whenOpening) + map["'>'"] = function(cm) { return autoCloseGT(cm); }; + cm.addKeyMap(map); + }); + + var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", + "source", "track", "wbr"]; + var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4", + "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"]; + + function autoCloseGT(cm) { + if (cm.getOption("disableInput")) return CodeMirror.Pass; + var ranges = cm.listSelections(), replacements = []; + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) return CodeMirror.Pass; + var pos = ranges[i].head, tok = cm.getTokenAt(pos); + var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state; + if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass; + + var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html"; + var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose); + var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent); + + var tagName = state.tagName; + if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch); + var lowerTagName = tagName.toLowerCase(); + // Don't process the '>' at the end of an end-tag or self-closing tag + if (!tagName || + tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) || + tok.type == "tag" && state.type == "closeTag" || + tok.string.indexOf("/") == (tok.string.length - 1) || // match something like + dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 || + closingTagExists(cm, tagName, pos, state, true)) + return CodeMirror.Pass; + + var indent = indentTags && indexOf(indentTags, lowerTagName) > -1; + replacements[i] = {indent: indent, + text: ">" + (indent ? "\n\n" : "") + "", + newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)}; + } + + for (var i = ranges.length - 1; i >= 0; i--) { + var info = replacements[i]; + cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert"); + var sel = cm.listSelections().slice(0); + sel[i] = {head: info.newPos, anchor: info.newPos}; + cm.setSelections(sel); + if (info.indent) { + cm.indentLine(info.newPos.line, null, true); + cm.indentLine(info.newPos.line + 1, null, true); + } + } + } + + function autoCloseCurrent(cm, typingSlash) { + var ranges = cm.listSelections(), replacements = []; + var head = typingSlash ? "/" : ""; + else if (cm.getMode().name == "htmlmixed" && inner.mode.name == "css") + replacements[i] = head + "style>"; + else + return CodeMirror.Pass; + } else { + if (!state.context || !state.context.tagName || + closingTagExists(cm, state.context.tagName, pos, state)) + return CodeMirror.Pass; + replacements[i] = head + state.context.tagName + ">"; + } + } + cm.replaceSelections(replacements); + ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) + if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line) + cm.indentLine(ranges[i].head.line); + } + + function autoCloseSlash(cm) { + if (cm.getOption("disableInput")) return CodeMirror.Pass; + return autoCloseCurrent(cm, true); + } + + CodeMirror.commands.closeTag = function(cm) { return autoCloseCurrent(cm); }; + + function indexOf(collection, elt) { + if (collection.indexOf) return collection.indexOf(elt); + for (var i = 0, e = collection.length; i < e; ++i) + if (collection[i] == elt) return i; + return -1; + } + + // If xml-fold is loaded, we use its functionality to try and verify + // whether a given tag is actually unclosed. + function closingTagExists(cm, tagName, pos, state, newTag) { + if (!CodeMirror.scanForClosingTag) return false; + var end = Math.min(cm.lastLine() + 1, pos.line + 500); + var nextClose = CodeMirror.scanForClosingTag(cm, pos, null, end); + if (!nextClose || nextClose.tag != tagName) return false; + var cx = state.context; + // If the immediate wrapping context contains onCx instances of + // the same tag, a closing tag only exists if there are at least + // that many closing tags of that type following. + for (var onCx = newTag ? 1 : 0; cx && cx.tagName == tagName; cx = cx.prev) ++onCx; + pos = nextClose.to; + for (var i = 1; i < onCx; i++) { + var next = CodeMirror.scanForClosingTag(cm, pos, null, end); + if (!next || next.tag != tagName) return false; + pos = next.to; + } + return true; + } +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + var ie_lt8 = /MSIE \d/.test(navigator.userAgent) && + (document.documentMode == null || document.documentMode < 8); + + var Pos = CodeMirror.Pos; + + var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; + + function findMatchingBracket(cm, where, strict, config) { + var line = cm.getLineHandle(where.line), pos = where.ch - 1; + var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; + if (!match) return null; + var dir = match.charAt(1) == ">" ? 1 : -1; + if (strict && (dir > 0) != (pos == where.ch)) return null; + var style = cm.getTokenTypeAt(Pos(where.line, pos + 1)); + + var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config); + if (found == null) return null; + return {from: Pos(where.line, pos), to: found && found.pos, + match: found && found.ch == match.charAt(0), forward: dir > 0}; + } + + // bracketRegex is used to specify which type of bracket to scan + // should be a regexp, e.g. /[[\]]/ + // + // Note: If "where" is on an open bracket, then this bracket is ignored. + // + // Returns false when no bracket was found, null when it reached + // maxScanLines and gave up + function scanForBracket(cm, where, dir, style, config) { + var maxScanLen = (config && config.maxScanLineLength) || 10000; + var maxScanLines = (config && config.maxScanLines) || 1000; + + var stack = []; + var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/; + var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1) + : Math.max(cm.firstLine() - 1, where.line - maxScanLines); + for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) { + var line = cm.getLine(lineNo); + if (!line) continue; + var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1; + if (line.length > maxScanLen) continue; + if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0); + for (; pos != end; pos += dir) { + var ch = line.charAt(pos); + if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) { + var match = matching[ch]; + if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch); + else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch}; + else stack.pop(); + } + } + } + return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null; + } + + function matchBrackets(cm, autoclear, config) { + // Disable brace matching in long lines, since it'll cause hugely slow updates + var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000; + var marks = [], ranges = cm.listSelections(); + for (var i = 0; i < ranges.length; i++) { + var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config); + if (match && cm.getLine(match.from.line).length <= maxHighlightLen) { + var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; + marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style})); + if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen) + marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style})); + } + } + + if (marks.length) { + // Kludge to work around the IE bug from issue #1193, where text + // input stops going to the textare whever this fires. + if (ie_lt8 && cm.state.focused) cm.focus(); + + var clear = function() { + cm.operation(function() { + for (var i = 0; i < marks.length; i++) marks[i].clear(); + }); + }; + if (autoclear) setTimeout(clear, 800); + else return clear; + } + } + + var currentlyHighlighted = null; + function doMatchBrackets(cm) { + cm.operation(function() { + if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;} + currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets); + }); + } + + CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) { + if (old && old != CodeMirror.Init) + cm.off("cursorActivity", doMatchBrackets); + if (val) { + cm.state.matchBrackets = typeof val == "object" ? val : {}; + cm.on("cursorActivity", doMatchBrackets); + } + }); + + CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);}); + CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){ + return findMatchingBracket(this, pos, strict, config); + }); + CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){ + return scanForBracket(this, pos, dir, style, config); + }); +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../fold/xml-fold")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../fold/xml-fold"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineOption("matchTags", false, function(cm, val, old) { + if (old && old != CodeMirror.Init) { + cm.off("cursorActivity", doMatchTags); + cm.off("viewportChange", maybeUpdateMatch); + clear(cm); + } + if (val) { + cm.state.matchBothTags = typeof val == "object" && val.bothTags; + cm.on("cursorActivity", doMatchTags); + cm.on("viewportChange", maybeUpdateMatch); + doMatchTags(cm); + } + }); + + function clear(cm) { + if (cm.state.tagHit) cm.state.tagHit.clear(); + if (cm.state.tagOther) cm.state.tagOther.clear(); + cm.state.tagHit = cm.state.tagOther = null; + } + + function doMatchTags(cm) { + cm.state.failedTagMatch = false; + cm.operation(function() { + clear(cm); + if (cm.somethingSelected()) return; + var cur = cm.getCursor(), range = cm.getViewport(); + range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to); + var match = CodeMirror.findMatchingTag(cm, cur, range); + if (!match) return; + if (cm.state.matchBothTags) { + var hit = match.at == "open" ? match.open : match.close; + if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"}); + } + var other = match.at == "close" ? match.open : match.close; + if (other) + cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"}); + else + cm.state.failedTagMatch = true; + }); + } + + function maybeUpdateMatch(cm) { + if (cm.state.failedTagMatch) doMatchTags(cm); + } + + CodeMirror.commands.toMatchingTag = function(cm) { + var found = CodeMirror.findMatchingTag(cm, cm.getCursor()); + if (found) { + var other = found.at == "close" ? found.open : found.close; + if (other) cm.extendSelection(other.to, other.from); + } + }; +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.registerHelper("fold", "brace", function(cm, start) { + var line = start.line, lineText = cm.getLine(line); + var startCh, tokenType; + + function findOpening(openCh) { + for (var at = start.ch, pass = 0;;) { + var found = at <= 0 ? -1 : lineText.lastIndexOf(openCh, at - 1); + if (found == -1) { + if (pass == 1) break; + pass = 1; + at = lineText.length; + continue; + } + if (pass == 1 && found < start.ch) break; + tokenType = cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)); + if (!/^(comment|string)/.test(tokenType)) return found + 1; + at = found - 1; + } + } + + var startToken = "{", endToken = "}", startCh = findOpening("{"); + if (startCh == null) { + startToken = "[", endToken = "]"; + startCh = findOpening("["); + } + + if (startCh == null) return; + var count = 1, lastLine = cm.lastLine(), end, endCh; + outer: for (var i = line; i <= lastLine; ++i) { + var text = cm.getLine(i), pos = i == line ? startCh : 0; + for (;;) { + var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); + if (nextOpen < 0) nextOpen = text.length; + if (nextClose < 0) nextClose = text.length; + pos = Math.min(nextOpen, nextClose); + if (pos == text.length) break; + if (cm.getTokenTypeAt(CodeMirror.Pos(i, pos + 1)) == tokenType) { + if (pos == nextOpen) ++count; + else if (!--count) { end = i; endCh = pos; break outer; } + } + ++pos; + } + } + if (end == null || line == end && endCh == startCh) return; + return {from: CodeMirror.Pos(line, startCh), + to: CodeMirror.Pos(end, endCh)}; +}); + +CodeMirror.registerHelper("fold", "import", function(cm, start) { + function hasImport(line) { + if (line < cm.firstLine() || line > cm.lastLine()) return null; + var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); + if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); + if (start.type != "keyword" || start.string != "import") return null; + // Now find closing semicolon, return its position + for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) { + var text = cm.getLine(i), semi = text.indexOf(";"); + if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)}; + } + } + + var start = start.line, has = hasImport(start), prev; + if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1)) + return null; + for (var end = has.end;;) { + var next = hasImport(end.line + 1); + if (next == null) break; + end = next.end; + } + return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end}; +}); + +CodeMirror.registerHelper("fold", "include", function(cm, start) { + function hasInclude(line) { + if (line < cm.firstLine() || line > cm.lastLine()) return null; + var start = cm.getTokenAt(CodeMirror.Pos(line, 1)); + if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1)); + if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8; + } + + var start = start.line, has = hasInclude(start); + if (has == null || hasInclude(start - 1) != null) return null; + for (var end = start;;) { + var next = hasInclude(end + 1); + if (next == null) break; + ++end; + } + return {from: CodeMirror.Pos(start, has + 1), + to: cm.clipPos(CodeMirror.Pos(end))}; +}); + +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function doFold(cm, pos, options, force) { + if (options && options.call) { + var finder = options; + options = null; + } else { + var finder = getOption(cm, options, "rangeFinder"); + } + if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); + var minSize = getOption(cm, options, "minFoldSize"); + + function getRange(allowFolded) { + var range = finder(cm, pos); + if (!range || range.to.line - range.from.line < minSize) return null; + var marks = cm.findMarksAt(range.from); + for (var i = 0; i < marks.length; ++i) { + if (marks[i].__isFold && force !== "fold") { + if (!allowFolded) return null; + range.cleared = true; + marks[i].clear(); + } + } + return range; + } + + var range = getRange(true); + if (getOption(cm, options, "scanUp")) while (!range && pos.line > cm.firstLine()) { + pos = CodeMirror.Pos(pos.line - 1, 0); + range = getRange(false); + } + if (!range || range.cleared || force === "unfold") return; + + var myWidget = makeWidget(cm, options); + CodeMirror.on(myWidget, "mousedown", function(e) { + myRange.clear(); + CodeMirror.e_preventDefault(e); + }); + var myRange = cm.markText(range.from, range.to, { + replacedWith: myWidget, + clearOnEnter: true, + __isFold: true + }); + myRange.on("clear", function(from, to) { + CodeMirror.signal(cm, "unfold", cm, from, to); + }); + CodeMirror.signal(cm, "fold", cm, range.from, range.to); + } + + function makeWidget(cm, options) { + var widget = getOption(cm, options, "widget"); + if (typeof widget == "string") { + var text = document.createTextNode(widget); + widget = document.createElement("span"); + widget.appendChild(text); + widget.className = "CodeMirror-foldmarker"; + } + return widget; + } + + // Clumsy backwards-compatible interface + CodeMirror.newFoldFunction = function(rangeFinder, widget) { + return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); }; + }; + + // New-style interface + CodeMirror.defineExtension("foldCode", function(pos, options, force) { + doFold(this, pos, options, force); + }); + + CodeMirror.defineExtension("isFolded", function(pos) { + var marks = this.findMarksAt(pos); + for (var i = 0; i < marks.length; ++i) + if (marks[i].__isFold) return true; + }); + + CodeMirror.commands.toggleFold = function(cm) { + cm.foldCode(cm.getCursor()); + }; + CodeMirror.commands.fold = function(cm) { + cm.foldCode(cm.getCursor(), null, "fold"); + }; + CodeMirror.commands.unfold = function(cm) { + cm.foldCode(cm.getCursor(), null, "unfold"); + }; + CodeMirror.commands.foldAll = function(cm) { + cm.operation(function() { + for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) + cm.foldCode(CodeMirror.Pos(i, 0), null, "fold"); + }); + }; + CodeMirror.commands.unfoldAll = function(cm) { + cm.operation(function() { + for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++) + cm.foldCode(CodeMirror.Pos(i, 0), null, "unfold"); + }); + }; + + CodeMirror.registerHelper("fold", "combine", function() { + var funcs = Array.prototype.slice.call(arguments, 0); + return function(cm, start) { + for (var i = 0; i < funcs.length; ++i) { + var found = funcs[i](cm, start); + if (found) return found; + } + }; + }); + + CodeMirror.registerHelper("fold", "auto", function(cm, start) { + var helpers = cm.getHelpers(start, "fold"); + for (var i = 0; i < helpers.length; i++) { + var cur = helpers[i](cm, start); + if (cur) return cur; + } + }); + + var defaultOptions = { + rangeFinder: CodeMirror.fold.auto, + widget: "\u2194", + minFoldSize: 0, + scanUp: false + }; + + CodeMirror.defineOption("foldOptions", null); + + function getOption(cm, options, name) { + if (options && options[name] !== undefined) + return options[name]; + var editorOptions = cm.options.foldOptions; + if (editorOptions && editorOptions[name] !== undefined) + return editorOptions[name]; + return defaultOptions[name]; + } + + CodeMirror.defineExtension("foldOption", function(options, name) { + return getOption(this, options, name); + }); +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("./foldcode")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "./foldcode"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineOption("foldGutter", false, function(cm, val, old) { + if (old && old != CodeMirror.Init) { + cm.clearGutter(cm.state.foldGutter.options.gutter); + cm.state.foldGutter = null; + cm.off("gutterClick", onGutterClick); + cm.off("change", onChange); + cm.off("viewportChange", onViewportChange); + cm.off("fold", onFold); + cm.off("unfold", onFold); + cm.off("swapDoc", updateInViewport); + } + if (val) { + cm.state.foldGutter = new State(parseOptions(val)); + updateInViewport(cm); + cm.on("gutterClick", onGutterClick); + cm.on("change", onChange); + cm.on("viewportChange", onViewportChange); + cm.on("fold", onFold); + cm.on("unfold", onFold); + cm.on("swapDoc", updateInViewport); + } + }); + + var Pos = CodeMirror.Pos; + + function State(options) { + this.options = options; + this.from = this.to = 0; + } + + function parseOptions(opts) { + if (opts === true) opts = {}; + if (opts.gutter == null) opts.gutter = "CodeMirror-foldgutter"; + if (opts.indicatorOpen == null) opts.indicatorOpen = "CodeMirror-foldgutter-open"; + if (opts.indicatorFolded == null) opts.indicatorFolded = "CodeMirror-foldgutter-folded"; + return opts; + } + + function isFolded(cm, line) { + var marks = cm.findMarksAt(Pos(line)); + for (var i = 0; i < marks.length; ++i) + if (marks[i].__isFold && marks[i].find().from.line == line) return true; + } + + function marker(spec) { + if (typeof spec == "string") { + var elt = document.createElement("div"); + elt.className = spec + " CodeMirror-guttermarker-subtle"; + return elt; + } else { + return spec.cloneNode(true); + } + } + + function updateFoldInfo(cm, from, to) { + var opts = cm.state.foldGutter.options, cur = from; + var minSize = cm.foldOption(opts, "minFoldSize"); + var func = cm.foldOption(opts, "rangeFinder"); + cm.eachLine(from, to, function(line) { + var mark = null; + if (isFolded(cm, cur)) { + mark = marker(opts.indicatorFolded); + } else { + var pos = Pos(cur, 0); + var range = func && func(cm, pos); + if (range && range.to.line - range.from.line >= minSize) + mark = marker(opts.indicatorOpen); + } + cm.setGutterMarker(line, opts.gutter, mark); + ++cur; + }); + } + + function updateInViewport(cm) { + var vp = cm.getViewport(), state = cm.state.foldGutter; + if (!state) return; + cm.operation(function() { + updateFoldInfo(cm, vp.from, vp.to); + }); + state.from = vp.from; state.to = vp.to; + } + + function onGutterClick(cm, line, gutter) { + var state = cm.state.foldGutter; + if (!state) return; + var opts = state.options; + if (gutter != opts.gutter) return; + cm.foldCode(Pos(line, 0), opts.rangeFinder); + } + + function onChange(cm) { + var state = cm.state.foldGutter; + if (!state) return; + var opts = state.options; + state.from = state.to = 0; + clearTimeout(state.changeUpdate); + state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600); + } + + function onViewportChange(cm) { + var state = cm.state.foldGutter; + if (!state) return; + var opts = state.options; + clearTimeout(state.changeUpdate); + state.changeUpdate = setTimeout(function() { + var vp = cm.getViewport(); + if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { + updateInViewport(cm); + } else { + cm.operation(function() { + if (vp.from < state.from) { + updateFoldInfo(cm, vp.from, state.from); + state.from = vp.from; + } + if (vp.to > state.to) { + updateFoldInfo(cm, state.to, vp.to); + state.to = vp.to; + } + }); + } + }, opts.updateViewportTimeSpan || 400); + } + + function onFold(cm, from) { + var state = cm.state.foldGutter; + if (!state) return; + var line = from.line; + if (line >= state.from && line < state.to) + updateFoldInfo(cm, line, line + 1); + } +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var Pos = CodeMirror.Pos; + function cmp(a, b) { return a.line - b.line || a.ch - b.ch; } + + var nameStartChar = "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"; + var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; + var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g"); + + function Iter(cm, line, ch, range) { + this.line = line; this.ch = ch; + this.cm = cm; this.text = cm.getLine(line); + this.min = range ? range.from : cm.firstLine(); + this.max = range ? range.to - 1 : cm.lastLine(); + } + + function tagAt(iter, ch) { + var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch)); + return type && /\btag\b/.test(type); + } + + function nextLine(iter) { + if (iter.line >= iter.max) return; + iter.ch = 0; + iter.text = iter.cm.getLine(++iter.line); + return true; + } + function prevLine(iter) { + if (iter.line <= iter.min) return; + iter.text = iter.cm.getLine(--iter.line); + iter.ch = iter.text.length; + return true; + } + + function toTagEnd(iter) { + for (;;) { + var gt = iter.text.indexOf(">", iter.ch); + if (gt == -1) { if (nextLine(iter)) continue; else return; } + if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; } + var lastSlash = iter.text.lastIndexOf("/", gt); + var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt)); + iter.ch = gt + 1; + return selfClose ? "selfClose" : "regular"; + } + } + function toTagStart(iter) { + for (;;) { + var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1; + if (lt == -1) { if (prevLine(iter)) continue; else return; } + if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; } + xmlTagStart.lastIndex = lt; + iter.ch = lt; + var match = xmlTagStart.exec(iter.text); + if (match && match.index == lt) return match; + } + } + + function toNextTag(iter) { + for (;;) { + xmlTagStart.lastIndex = iter.ch; + var found = xmlTagStart.exec(iter.text); + if (!found) { if (nextLine(iter)) continue; else return; } + if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; } + iter.ch = found.index + found[0].length; + return found; + } + } + function toPrevTag(iter) { + for (;;) { + var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1; + if (gt == -1) { if (prevLine(iter)) continue; else return; } + if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; } + var lastSlash = iter.text.lastIndexOf("/", gt); + var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt)); + iter.ch = gt + 1; + return selfClose ? "selfClose" : "regular"; + } + } + + function findMatchingClose(iter, tag) { + var stack = []; + for (;;) { + var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0); + if (!next || !(end = toTagEnd(iter))) return; + if (end == "selfClose") continue; + if (next[1]) { // closing tag + for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) { + stack.length = i; + break; + } + if (i < 0 && (!tag || tag == next[2])) return { + tag: next[2], + from: Pos(startLine, startCh), + to: Pos(iter.line, iter.ch) + }; + } else { // opening tag + stack.push(next[2]); + } + } + } + function findMatchingOpen(iter, tag) { + var stack = []; + for (;;) { + var prev = toPrevTag(iter); + if (!prev) return; + if (prev == "selfClose") { toTagStart(iter); continue; } + var endLine = iter.line, endCh = iter.ch; + var start = toTagStart(iter); + if (!start) return; + if (start[1]) { // closing tag + stack.push(start[2]); + } else { // opening tag + for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) { + stack.length = i; + break; + } + if (i < 0 && (!tag || tag == start[2])) return { + tag: start[2], + from: Pos(iter.line, iter.ch), + to: Pos(endLine, endCh) + }; + } + } + } + + CodeMirror.registerHelper("fold", "xml", function(cm, start) { + var iter = new Iter(cm, start.line, 0); + for (;;) { + var openTag = toNextTag(iter), end; + if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return; + if (!openTag[1] && end != "selfClose") { + var start = Pos(iter.line, iter.ch); + var close = findMatchingClose(iter, openTag[2]); + return close && {from: start, to: close.from}; + } + } + }); + CodeMirror.findMatchingTag = function(cm, pos, range) { + var iter = new Iter(cm, pos.line, pos.ch, range); + if (iter.text.indexOf(">") == -1 && iter.text.indexOf("<") == -1) return; + var end = toTagEnd(iter), to = end && Pos(iter.line, iter.ch); + var start = end && toTagStart(iter); + if (!end || !start || cmp(iter, pos) > 0) return; + var here = {from: Pos(iter.line, iter.ch), to: to, tag: start[2]}; + if (end == "selfClose") return {open: here, close: null, at: "open"}; + + if (start[1]) { // closing tag + return {open: findMatchingOpen(iter, start[2]), close: here, at: "close"}; + } else { // opening tag + iter = new Iter(cm, to.line, to.ch, range); + return {open: here, close: findMatchingClose(iter, start[2]), at: "open"}; + } + }; + + CodeMirror.findEnclosingTag = function(cm, pos, range) { + var iter = new Iter(cm, pos.line, pos.ch, range); + for (;;) { + var open = findMatchingOpen(iter); + if (!open) break; + var forward = new Iter(cm, pos.line, pos.ch, range); + var close = findMatchingClose(forward, open.tag); + if (close) return {open: open, close: close}; + } + }; + + // Used by addon/edit/closetag.js + CodeMirror.scanForClosingTag = function(cm, pos, name, end) { + var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null); + return findMatchingClose(iter, name); + }; +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), "cjs"); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], function(CM) { mod(CM, "amd"); }); + else // Plain browser env + mod(CodeMirror, "plain"); +})(function(CodeMirror, env) { + if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; + + var loading = {}; + function splitCallback(cont, n) { + var countDown = n; + return function() { if (--countDown == 0) cont(); }; + } + function ensureDeps(mode, cont) { + var deps = CodeMirror.modes[mode].dependencies; + if (!deps) return cont(); + var missing = []; + for (var i = 0; i < deps.length; ++i) { + if (!CodeMirror.modes.hasOwnProperty(deps[i])) + missing.push(deps[i]); + } + if (!missing.length) return cont(); + var split = splitCallback(cont, missing.length); + for (var i = 0; i < missing.length; ++i) + CodeMirror.requireMode(missing[i], split); + } + + CodeMirror.requireMode = function(mode, cont) { + if (typeof mode != "string") mode = mode.name; + if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); + if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); + + var file = CodeMirror.modeURL.replace(/%N/g, mode); + if (env == "plain") { + var script = document.createElement("script"); + script.src = file; + var others = document.getElementsByTagName("script")[0]; + var list = loading[mode] = [cont]; + CodeMirror.on(script, "load", function() { + ensureDeps(mode, function() { + for (var i = 0; i < list.length; ++i) list[i](); + }); + }); + others.parentNode.insertBefore(script, others); + } else if (env == "cjs") { + require(file); + cont(); + } else if (env == "amd") { + requirejs([file], cont); + } + }; + + CodeMirror.autoLoadMode = function(instance, mode) { + if (!CodeMirror.modes.hasOwnProperty(mode)) + CodeMirror.requireMode(mode, function() { + instance.setOption("mode", instance.getOption("mode")); + }); + }; +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.multiplexingMode = function(outer /*, others */) { + // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects + var others = Array.prototype.slice.call(arguments, 1); + var n_others = others.length; + + function indexOf(string, pattern, from) { + if (typeof pattern == "string") return string.indexOf(pattern, from); + var m = pattern.exec(from ? string.slice(from) : string); + return m ? m.index + from : -1; + } + + return { + startState: function() { + return { + outer: CodeMirror.startState(outer), + innerActive: null, + inner: null + }; + }, + + copyState: function(state) { + return { + outer: CodeMirror.copyState(outer, state.outer), + innerActive: state.innerActive, + inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner) + }; + }, + + token: function(stream, state) { + if (!state.innerActive) { + var cutOff = Infinity, oldContent = stream.string; + for (var i = 0; i < n_others; ++i) { + var other = others[i]; + var found = indexOf(oldContent, other.open, stream.pos); + if (found == stream.pos) { + stream.match(other.open); + state.innerActive = other; + state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); + return other.delimStyle; + } else if (found != -1 && found < cutOff) { + cutOff = found; + } + } + if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff); + var outerToken = outer.token(stream, state.outer); + if (cutOff != Infinity) stream.string = oldContent; + return outerToken; + } else { + var curInner = state.innerActive, oldContent = stream.string; + if (!curInner.close && stream.sol()) { + state.innerActive = state.inner = null; + return this.token(stream, state); + } + var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos) : -1; + if (found == stream.pos) { + stream.match(curInner.close); + state.innerActive = state.inner = null; + return curInner.delimStyle; + } + if (found > -1) stream.string = oldContent.slice(0, found); + var innerToken = curInner.mode.token(stream, state.inner); + if (found > -1) stream.string = oldContent; + + if (curInner.innerStyle) { + if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle; + else innerToken = curInner.innerStyle; + } + + return innerToken; + } + }, + + indent: function(state, textAfter) { + var mode = state.innerActive ? state.innerActive.mode : outer; + if (!mode.indent) return CodeMirror.Pass; + return mode.indent(state.innerActive ? state.inner : state.outer, textAfter); + }, + + blankLine: function(state) { + var mode = state.innerActive ? state.innerActive.mode : outer; + if (mode.blankLine) { + mode.blankLine(state.innerActive ? state.inner : state.outer); + } + if (!state.innerActive) { + for (var i = 0; i < n_others; ++i) { + var other = others[i]; + if (other.open === "\n") { + state.innerActive = other; + state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0); + } + } + } else if (state.innerActive.close === "\n") { + state.innerActive = state.inner = null; + } + }, + + electricChars: outer.electricChars, + + innerMode: function(state) { + return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer}; + } + }; +}; + +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function Bar(cls, orientation, scroll) { + this.orientation = orientation; + this.scroll = scroll; + this.screen = this.total = this.size = 1; + this.pos = 0; + + this.node = document.createElement("div"); + this.node.className = cls + "-" + orientation; + this.inner = this.node.appendChild(document.createElement("div")); + + var self = this; + CodeMirror.on(this.inner, "mousedown", function(e) { + if (e.which != 1) return; + CodeMirror.e_preventDefault(e); + var axis = self.orientation == "horizontal" ? "pageX" : "pageY"; + var start = e[axis], startpos = self.pos; + function done() { + CodeMirror.off(document, "mousemove", move); + CodeMirror.off(document, "mouseup", done); + } + function move(e) { + if (e.which != 1) return done(); + self.moveTo(startpos + (e[axis] - start) * (self.total / self.size)); + } + CodeMirror.on(document, "mousemove", move); + CodeMirror.on(document, "mouseup", done); + }); + + CodeMirror.on(this.node, "click", function(e) { + CodeMirror.e_preventDefault(e); + var innerBox = self.inner.getBoundingClientRect(), where; + if (self.orientation == "horizontal") + where = e.clientX < innerBox.left ? -1 : e.clientX > innerBox.right ? 1 : 0; + else + where = e.clientY < innerBox.top ? -1 : e.clientY > innerBox.bottom ? 1 : 0; + self.moveTo(self.pos + where * self.screen); + }); + + function onWheel(e) { + var moved = CodeMirror.wheelEventPixels(e)[self.orientation == "horizontal" ? "x" : "y"]; + var oldPos = self.pos; + self.moveTo(self.pos + moved); + if (self.pos != oldPos) CodeMirror.e_preventDefault(e); + } + CodeMirror.on(this.node, "mousewheel", onWheel); + CodeMirror.on(this.node, "DOMMouseScroll", onWheel); + } + + Bar.prototype.moveTo = function(pos, update) { + if (pos < 0) pos = 0; + if (pos > this.total - this.screen) pos = this.total - this.screen; + if (pos == this.pos) return; + this.pos = pos; + this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = + (pos * (this.size / this.total)) + "px"; + if (update !== false) this.scroll(pos, this.orientation); + }; + + Bar.prototype.update = function(scrollSize, clientSize, barSize) { + this.screen = clientSize; + this.total = scrollSize; + this.size = barSize; + + // FIXME clip to min size? + this.inner.style[this.orientation == "horizontal" ? "width" : "height"] = + this.screen * (this.size / this.total) + "px"; + this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = + this.pos * (this.size / this.total) + "px"; + }; + + function SimpleScrollbars(cls, place, scroll) { + this.addClass = cls; + this.horiz = new Bar(cls, "horizontal", scroll); + place(this.horiz.node); + this.vert = new Bar(cls, "vertical", scroll); + place(this.vert.node); + this.width = null; + } + + SimpleScrollbars.prototype.update = function(measure) { + if (this.width == null) { + var style = window.getComputedStyle ? window.getComputedStyle(this.horiz.node) : this.horiz.node.currentStyle; + if (style) this.width = parseInt(style.height); + } + var width = this.width || 0; + + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + this.vert.node.style.display = needsV ? "block" : "none"; + this.horiz.node.style.display = needsH ? "block" : "none"; + + if (needsV) { + this.vert.update(measure.scrollHeight, measure.clientHeight, + measure.viewHeight - (needsH ? width : 0)); + this.vert.node.style.display = "block"; + this.vert.node.style.bottom = needsH ? width + "px" : "0"; + } + if (needsH) { + this.horiz.update(measure.scrollWidth, measure.clientWidth, + measure.viewWidth - (needsV ? width : 0) - measure.barLeft); + this.horiz.node.style.right = needsV ? width + "px" : "0"; + this.horiz.node.style.left = measure.barLeft + "px"; + } + + return {right: needsV ? width : 0, bottom: needsH ? width : 0}; + }; + + SimpleScrollbars.prototype.setScrollTop = function(pos) { + this.vert.moveTo(pos, false); + }; + + SimpleScrollbars.prototype.setScrollLeft = function(pos) { + this.horiz.moveTo(pos, false); + }; + + SimpleScrollbars.prototype.clear = function() { + var parent = this.horiz.node.parentNode; + parent.removeChild(this.horiz.node); + parent.removeChild(this.vert.node); + }; + + CodeMirror.scrollbarModel.simple = function(place, scroll) { + return new SimpleScrollbars("CodeMirror-simplescroll", place, scroll); + }; + CodeMirror.scrollbarModel.overlay = function(place, scroll) { + return new SimpleScrollbars("CodeMirror-overlayscroll", place, scroll); + }; +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Because sometimes you need to style the cursor's line. +// +// Adds an option 'styleActiveLine' which, when enabled, gives the +// active line's wrapping
the CSS class "CodeMirror-activeline", +// and gives its background
the class "CodeMirror-activeline-background". + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + var WRAP_CLASS = "CodeMirror-activeline"; + var BACK_CLASS = "CodeMirror-activeline-background"; + + CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { + var prev = old && old != CodeMirror.Init; + if (val && !prev) { + cm.state.activeLines = []; + updateActiveLines(cm, cm.listSelections()); + cm.on("beforeSelectionChange", selectionChange); + } else if (!val && prev) { + cm.off("beforeSelectionChange", selectionChange); + clearActiveLines(cm); + delete cm.state.activeLines; + } + }); + + function clearActiveLines(cm) { + for (var i = 0; i < cm.state.activeLines.length; i++) { + cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS); + cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS); + } + } + + function sameArray(a, b) { + if (a.length != b.length) return false; + for (var i = 0; i < a.length; i++) + if (a[i] != b[i]) return false; + return true; + } + + function updateActiveLines(cm, ranges) { + var active = []; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (!range.empty()) continue; + var line = cm.getLineHandleVisualStart(range.head.line); + if (active[active.length - 1] != line) active.push(line); + } + if (sameArray(cm.state.activeLines, active)) return; + cm.operation(function() { + clearActiveLines(cm); + for (var i = 0; i < active.length; i++) { + cm.addLineClass(active[i], "wrap", WRAP_CLASS); + cm.addLineClass(active[i], "background", BACK_CLASS); + } + cm.state.activeLines = active; + }); + } + + function selectionChange(cm, sel) { + updateActiveLines(cm, sel.ranges); + } +}); +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/** + * Supported keybindings: + * + * Motion: + * h, j, k, l + * gj, gk + * e, E, w, W, b, B, ge, gE + * f, F, t, T + * $, ^, 0, -, +, _ + * gg, G + * % + * ', ` + * + * Operator: + * d, y, c + * dd, yy, cc + * g~, g~g~ + * >, <, >>, << + * + * Operator-Motion: + * x, X, D, Y, C, ~ + * + * Action: + * a, i, s, A, I, S, o, O + * zz, z., z, zt, zb, z- + * J + * u, Ctrl-r + * m + * r + * + * Modes: + * ESC - leave insert mode, visual mode, and clear input state. + * Ctrl-[, Ctrl-c - same as ESC. + * + * Registers: unnamed, -, a-z, A-Z, 0-9 + * (Does not respect the special case for number registers when delete + * operator is made with these commands: %, (, ), , /, ?, n, N, {, } ) + * TODO: Implement the remaining registers. + * Marks: a-z, A-Z, and 0-9 + * TODO: Implement the remaining special marks. They have more complex + * behavior. + * + * Events: + * 'vim-mode-change' - raised on the editor anytime the current mode changes, + * Event object: {mode: "visual", subMode: "linewise"} + * + * Code structure: + * 1. Default keymap + * 2. Variable declarations and short basic helpers + * 3. Instance (External API) implementation + * 4. Internal state tracking objects (input state, counter) implementation + * and instanstiation + * 5. Key handler (the main command dispatcher) implementation + * 6. Motion, operator, and action implementations + * 7. Helper functions for the key handler, motions, operators, and actions + * 8. Set up Vim to work as a keymap for CodeMirror. + */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/dialog/dialog"), require("../addon/edit/matchbrackets.js")); + else if (typeof define == "function" && define.amd) // AMD + define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/dialog/dialog", "../addon/edit/matchbrackets"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + 'use strict'; + + var defaultKeymap = [ + // Key to key mapping. This goes first to make it possible to override + // existing mappings. + { 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: 'xi', context: 'visual'}, + { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' }, + { keys: 'S', type: 'keyToKey', toKeys: 'dcc', 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' }, + // Motions + { keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true }}, + { keys: 'M', type: 'motion', motion: 'moveToMiddleLine', motionArgs: { linewise: true, toJumplist: true }}, + { keys: 'L', type: 'motion', motion: 'moveToBottomLine', motionArgs: { linewise: true, toJumplist: true }}, + { keys: 'h', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: false }}, + { keys: 'l', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: true }}, + { keys: 'j', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, linewise: true }}, + { keys: 'k', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, linewise: true }}, + { keys: 'gj', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: true }}, + { keys: 'gk', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: false }}, + { keys: 'w', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false }}, + { keys: 'W', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false, bigWord: true }}, + { keys: 'e', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, inclusive: true }}, + { keys: 'E', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, bigWord: true, inclusive: true }}, + { keys: 'b', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }}, + { keys: 'B', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false, bigWord: true }}, + { keys: 'ge', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, inclusive: true }}, + { 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: 'moveByPage', motionArgs: { forward: true }}, + { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false }}, + { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true }}, + { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true }}, + { keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }}, + { keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }}, + { keys: '0', type: 'motion', motion: 'moveToStartOfLine' }, + { keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' }, + { keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true }}, + { keys: '-', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, toFirstChar:true }}, + { keys: '_', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true, repeatOffset:-1 }}, + { keys: '$', type: 'motion', motion: 'moveToEol', motionArgs: { inclusive: true }}, + { keys: '%', type: 'motion', motion: 'moveToMatchedSymbol', motionArgs: { inclusive: true, toJumplist: true }}, + { keys: 'f', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: true , inclusive: true }}, + { keys: 'F', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: false }}, + { keys: 't', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: true, inclusive: true }}, + { keys: 'T', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: false }}, + { keys: ';', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: true }}, + { keys: ',', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: false }}, + { keys: '\'', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true, linewise: true}}, + { keys: '`', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true}}, + { keys: ']`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } }, + { keys: '[`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } }, + { keys: ']\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } }, + { keys: '[\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } }, + // the next two aren't motions but must come before more general motion declarations + { keys: ']p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true, matchIndent: true}}, + { keys: '[p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true, matchIndent: true}}, + { keys: ']', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: true, toJumplist: true}}, + { keys: '[', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: false, toJumplist: true}}, + { keys: '|', type: 'motion', motion: 'moveToColumn'}, + { keys: 'o', type: 'motion', motion: 'moveToOtherHighlightedEnd', context:'visual'}, + { keys: 'O', type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: {sameLine: true}, context:'visual'}, + // Operators + { 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: true }}, + { keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false }}, + { keys: 'g~', type: 'operator', operator: 'changeCase' }, + { keys: 'gu', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, isEdit: true }, + { keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, isEdit: true }, + { keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true }}, + { keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true }}, + // Operator-Motion dual commands + { keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false }}, + { keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true }}, + { keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, + { keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual'}, + { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, + { keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual'}, + { keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, + { keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'}, + { keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'}, + { keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'}, + { keys: '', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' }, + // Actions + { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }}, + { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }}, + { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true }}, + { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: false, linewise: true }}, + { keys: 'a', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'charAfter' }, context: 'normal' }, + { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' }, + { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' }, + { keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' }, + { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank'}, context: 'normal' }, + { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' }, + { keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' }, + { keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' }, + { keys: 'v', type: 'action', action: 'toggleVisualMode' }, + { keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true }}, + { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }}, + { keys: 'gv', type: 'action', action: 'reselectLastSelection' }, + { keys: 'J', type: 'action', action: 'joinLines', isEdit: true }, + { keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true }}, + { keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true }}, + { keys: 'r', type: 'action', action: 'replace', isEdit: true }, + { keys: '@', type: 'action', action: 'replayMacro' }, + { keys: 'q', type: 'action', action: 'enterMacroRecordMode' }, + // Handle Replace-mode as a special case of insert mode. + { keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }}, + { keys: 'u', type: 'action', action: 'undo', context: 'normal' }, + { keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, context: 'visual', isEdit: true }, + { keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, context: 'visual', isEdit: true }, + { 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: true, actionArgs: {increase: true, backtrack: false}}, + { keys: '', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: false, backtrack: false}}, + // Text object motions + { keys: 'a', type: 'motion', motion: 'textObjectManipulation' }, + { keys: 'i', type: 'motion', motion: 'textObjectManipulation', motionArgs: { textObjectInner: true }}, + // Search + { keys: '/', type: 'search', searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true }}, + { keys: '?', type: 'search', searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true }}, + { keys: '*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, + { keys: '#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, + { keys: 'g*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }}, + { keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }}, + // Ex command + { keys: ':', type: 'ex' } + ]; + + var Pos = CodeMirror.Pos; + + var Vim = function() { + function enterVimMode(cm) { + cm.setOption('disableInput', true); + cm.setOption('showCursorWhenSelecting', false); + CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); + cm.on('cursorActivity', onCursorActivity); + maybeInitVimState(cm); + CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm)); + } + + function leaveVimMode(cm) { + cm.setOption('disableInput', false); + cm.off('cursorActivity', onCursorActivity); + CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm)); + cm.state.vim = null; + } + + function detachVimMap(cm, next) { + if (this == CodeMirror.keyMap.vim) + CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor"); + + if (!next || next.attach != attachVimMap) + leaveVimMode(cm, false); + } + function attachVimMap(cm, prev) { + if (this == CodeMirror.keyMap.vim) + CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor"); + + if (!prev || prev.attach != attachVimMap) + enterVimMode(cm); + } + + // Deprecated, simply setting the keymap works again. + CodeMirror.defineOption('vimMode', false, function(cm, val, prev) { + if (val && cm.getOption("keyMap") != "vim") + cm.setOption("keyMap", "vim"); + else if (!val && prev != CodeMirror.Init && /^vim/.test(cm.getOption("keyMap"))) + cm.setOption("keyMap", "default"); + }); + + function cmKey(key, cm) { + if (!cm) { return undefined; } + var vimKey = cmKeyToVimKey(key); + if (!vimKey) { + return false; + } + var cmd = CodeMirror.Vim.findKey(cm, vimKey); + if (typeof cmd == 'function') { + CodeMirror.signal(cm, 'vim-keypress', vimKey); + } + return cmd; + } + + var modifiers = {'Shift': 'S', 'Ctrl': 'C', 'Alt': 'A', 'Cmd': 'D', 'Mod': 'A'}; + var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del'}; + function cmKeyToVimKey(key) { + if (key.charAt(0) == '\'') { + // Keypress character binding of format "'a'" + return key.charAt(1); + } + var pieces = key.split('-'); + if (/-$/.test(key)) { + // If the - key was typed, split will result in 2 extra empty strings + // in the array. Replace them with 1 '-'. + pieces.splice(-2, 2, '-'); + } + var lastPiece = pieces[pieces.length - 1]; + if (pieces.length == 1 && pieces[0].length == 1) { + // No-modifier bindings use literal character bindings above. Skip. + return false; + } else if (pieces.length == 2 && pieces[0] == 'Shift' && lastPiece.length == 1) { + // Ignore Shift+char bindings as they should be handled by literal character. + return false; + } + var hasCharacter = false; + for (var i = 0; i < pieces.length; i++) { + var piece = pieces[i]; + if (piece in modifiers) { pieces[i] = modifiers[piece]; } + else { hasCharacter = true; } + if (piece in specialKeys) { pieces[i] = specialKeys[piece]; } + } + if (!hasCharacter) { + // Vim does not support modifier only keys. + return false; + } + // TODO: Current bindings expect the character to be lower case, but + // it looks like vim key notation uses upper case. + if (isUpperCase(lastPiece)) { + pieces[pieces.length - 1] = lastPiece.toLowerCase(); + } + return '<' + pieces.join('-') + '>'; + } + + function getOnPasteFn(cm) { + var vim = cm.state.vim; + if (!vim.onPasteFn) { + vim.onPasteFn = function() { + if (!vim.insertMode) { + cm.setCursor(offsetCursor(cm.getCursor(), 0, 1)); + actions.enterInsertMode(cm, {}, vim); + } + }; + } + return vim.onPasteFn; + } + + var numberRegex = /[\d]/; + var wordRegexp = [(/\w/), (/[^\w\s]/)], bigWordRegexp = [(/\S/)]; + function makeKeyRange(start, size) { + var keys = []; + for (var i = start; i < start + size; i++) { + keys.push(String.fromCharCode(i)); + } + return keys; + } + var upperCaseAlphabet = makeKeyRange(65, 26); + var lowerCaseAlphabet = makeKeyRange(97, 26); + var numbers = makeKeyRange(48, 10); + var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']); + var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '/']); + + function isLine(cm, line) { + return line >= cm.firstLine() && line <= cm.lastLine(); + } + function isLowerCase(k) { + return (/^[a-z]$/).test(k); + } + function isMatchableSymbol(k) { + return '()[]{}'.indexOf(k) != -1; + } + function isNumber(k) { + return numberRegex.test(k); + } + function isUpperCase(k) { + return (/^[A-Z]$/).test(k); + } + function isWhiteSpaceString(k) { + return (/^\s*$/).test(k); + } + function inArray(val, arr) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] == val) { + return true; + } + } + return false; + } + + var options = {}; + function defineOption(name, defaultValue, type) { + if (defaultValue === undefined) { throw Error('defaultValue is required'); } + if (!type) { type = 'string'; } + options[name] = { + type: type, + defaultValue: defaultValue + }; + setOption(name, defaultValue); + } + + function setOption(name, value) { + var option = options[name]; + if (!option) { + throw Error('Unknown option: ' + name); + } + if (option.type == 'boolean') { + if (value && value !== true) { + throw Error('Invalid argument: ' + name + '=' + value); + } else if (value !== false) { + // Boolean options are set to true if value is not defined. + value = true; + } + } + option.value = option.type == 'boolean' ? !!value : value; + } + + function getOption(name) { + var option = options[name]; + if (!option) { + throw Error('Unknown option: ' + name); + } + return option.value; + } + + var createCircularJumpList = function() { + var size = 100; + var pointer = -1; + var head = 0; + var tail = 0; + var buffer = new Array(size); + function add(cm, oldCur, newCur) { + var current = pointer % size; + var curMark = buffer[current]; + function useNextSlot(cursor) { + var next = ++pointer % size; + var trashMark = buffer[next]; + if (trashMark) { + trashMark.clear(); + } + buffer[next] = cm.setBookmark(cursor); + } + if (curMark) { + var markPos = curMark.find(); + // avoid recording redundant cursor position + if (markPos && !cursorEqual(markPos, oldCur)) { + useNextSlot(oldCur); + } + } else { + useNextSlot(oldCur); + } + useNextSlot(newCur); + head = pointer; + tail = pointer - size + 1; + if (tail < 0) { + tail = 0; + } + } + function move(cm, offset) { + pointer += offset; + if (pointer > head) { + pointer = head; + } else if (pointer < tail) { + pointer = tail; + } + var mark = buffer[(size + pointer) % size]; + // skip marks that are temporarily removed from text buffer + if (mark && !mark.find()) { + var inc = offset > 0 ? 1 : -1; + var newCur; + var oldCur = cm.getCursor(); + do { + pointer += inc; + mark = buffer[(size + pointer) % size]; + // skip marks that are the same as current position + if (mark && + (newCur = mark.find()) && + !cursorEqual(oldCur, newCur)) { + break; + } + } while (pointer < head && pointer > tail); + } + return mark; + } + return { + cachedCursor: undefined, //used for # and * jumps + add: add, + move: move + }; + }; + + // Returns an object to track the changes associated insert mode. It + // clones the object that is passed in, or creates an empty object one if + // none is provided. + var createInsertModeChanges = function(c) { + if (c) { + // Copy construction + return { + changes: c.changes, + expectCursorActivityForChange: c.expectCursorActivityForChange + }; + } + return { + // Change list + changes: [], + // Set to true on change, false on cursorActivity. + expectCursorActivityForChange: false + }; + }; + + function MacroModeState() { + this.latestRegister = undefined; + this.isPlaying = false; + this.isRecording = false; + this.replaySearchQueries = []; + this.onRecordingDone = undefined; + this.lastInsertModeChanges = createInsertModeChanges(); + } + MacroModeState.prototype = { + exitMacroRecordMode: function() { + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.onRecordingDone) { + macroModeState.onRecordingDone(); // close dialog + } + macroModeState.onRecordingDone = undefined; + macroModeState.isRecording = false; + }, + enterMacroRecordMode: function(cm, registerName) { + var register = + vimGlobalState.registerController.getRegister(registerName); + if (register) { + register.clear(); + this.latestRegister = registerName; + if (cm.openDialog) { + this.onRecordingDone = cm.openDialog( + '(recording)['+registerName+']', null, {bottom:true}); + } + this.isRecording = true; + } + } + }; + + function maybeInitVimState(cm) { + if (!cm.state.vim) { + // Store instance state in the CodeMirror object. + cm.state.vim = { + inputState: new InputState(), + // Vim's input state that triggered the last edit, used to repeat + // motions and operators with '.'. + lastEditInputState: undefined, + // Vim's action command before the last edit, used to repeat actions + // with '.' and insert mode repeat. + lastEditActionCommand: undefined, + // When using jk for navigation, if you move from a longer line to a + // shorter line, the cursor may clip to the end of the shorter line. + // If j is pressed again and cursor goes to the next line, the + // cursor should go back to its horizontal position on the longer + // line if it can. This is to keep track of the horizontal position. + lastHPos: -1, + // Doing the same with screen-position for gj/gk + lastHSPos: -1, + // The last motion command run. Cleared if a non-motion command gets + // executed in between. + lastMotion: null, + marks: {}, + // Mark for rendering fake cursor for visual mode. + fakeCursor: null, + insertMode: false, + // Repeat count for changes made in insert mode, triggered by key + // sequences like 3,i. Only exists when insertMode is true. + insertModeRepeat: undefined, + visualMode: false, + // If we are in visual line mode. No effect if visualMode is false. + visualLine: false, + visualBlock: false, + lastSelection: null, + lastPastedText: null, + sel: { + } + }; + } + return cm.state.vim; + } + var vimGlobalState; + function resetVimGlobalState() { + vimGlobalState = { + // The current search query. + searchQuery: null, + // Whether we are searching backwards. + searchIsReversed: false, + // Replace part of the last substituted pattern + lastSubstituteReplacePart: undefined, + jumpList: createCircularJumpList(), + macroModeState: new MacroModeState, + // Recording latest f, t, F or T motion command. + lastChararacterSearch: {increment:0, forward:true, selectedCharacter:''}, + registerController: new RegisterController({}), + // search history buffer + searchHistoryController: new HistoryController({}), + // ex Command history buffer + exCommandHistoryController : new HistoryController({}) + }; + for (var optionName in options) { + var option = options[optionName]; + option.value = option.defaultValue; + } + } + + var lastInsertModeKeyTimer; + var vimApi= { + buildKeyMap: function() { + // TODO: Convert keymap into dictionary format for fast lookup. + }, + // Testing hook, though it might be useful to expose the register + // controller anyways. + getRegisterController: function() { + return vimGlobalState.registerController; + }, + // Testing hook. + resetVimGlobalState_: resetVimGlobalState, + + // Testing hook. + getVimGlobalState_: function() { + return vimGlobalState; + }, + + // Testing hook. + maybeInitVimState_: maybeInitVimState, + + suppressErrorLogging: false, + + InsertModeKey: InsertModeKey, + map: function(lhs, rhs, ctx) { + // Add user defined key bindings. + exCommandDispatcher.map(lhs, rhs, ctx); + }, + setOption: setOption, + getOption: getOption, + defineOption: defineOption, + defineEx: function(name, prefix, func){ + if (name.indexOf(prefix) !== 0) { + throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered'); + } + exCommands[name]=func; + exCommandDispatcher.commandMap_[prefix]={name:name, shortName:prefix, type:'api'}; + }, + handleKey: function (cm, key, origin) { + var command = this.findKey(cm, key, origin); + if (typeof command === 'function') { + return command(); + } + }, + /** + * This is the outermost function called by CodeMirror, after keys have + * been mapped to their Vim equivalents. + * + * Finds a command based on the key (and cached keys if there is a + * multi-key sequence). Returns `undefined` if no key is matched, a noop + * function if a partial match is found (multi-key), and a function to + * execute the bound command if a a key is matched. The function always + * returns true. + */ + findKey: function(cm, key, origin) { + var vim = maybeInitVimState(cm); + function handleMacroRecording() { + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.isRecording) { + if (key == 'q') { + macroModeState.exitMacroRecordMode(); + clearInputState(cm); + return true; + } + if (origin != 'mapping') { + logKey(macroModeState, key); + } + } + } + function handleEsc() { + if (key == '') { + // Clear input state and get back to normal mode. + clearInputState(cm); + if (vim.visualMode) { + exitVisualMode(cm); + } else if (vim.insertMode) { + exitInsertMode(cm); + } + return true; + } + } + function doKeyToKey(keys) { + // TODO: prevent infinite recursion. + var match; + while (keys) { + // Pull off one command key, which is either a single character + // or a special sequence wrapped in '<' and '>', e.g. ''. + match = (/<\w+-.+?>|<\w+>|./).exec(keys); + key = match[0]; + keys = keys.substring(match.index + key.length); + CodeMirror.Vim.handleKey(cm, key, 'mapping'); + } + } + + function handleKeyInsertMode() { + if (handleEsc()) { return true; } + var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; + var keysAreChars = key.length == 1; + var match = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); + // Need to check all key substrings in insert mode. + while (keys.length > 1 && match.type != 'full') { + var keys = vim.inputState.keyBuffer = keys.slice(1); + var thisMatch = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); + if (thisMatch.type != 'none') { match = thisMatch; } + } + if (match.type == 'none') { clearInputState(cm); return false; } + else if (match.type == 'partial') { + if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } + lastInsertModeKeyTimer = window.setTimeout( + function() { if (vim.insertMode && vim.inputState.keyBuffer) { clearInputState(cm); } }, + getOption('insertModeEscKeysTimeout')); + return !keysAreChars; + } + + if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } + if (keysAreChars) { + var here = cm.getCursor(); + cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input'); + } + clearInputState(cm); + return match.command; + } + + function handleKeyNonInsertMode() { + if (handleMacroRecording() || handleEsc()) { return true; }; + + var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; + if (/^[1-9]\d*$/.test(keys)) { return true; } + + var keysMatcher = /^(\d*)(.*)$/.exec(keys); + if (!keysMatcher) { clearInputState(cm); return false; } + var context = vim.visualMode ? 'visual' : + 'normal'; + var match = commandDispatcher.matchCommand(keysMatcher[2] || keysMatcher[1], defaultKeymap, vim.inputState, context); + if (match.type == 'none') { clearInputState(cm); return false; } + else if (match.type == 'partial') { return true; } + + vim.inputState.keyBuffer = ''; + var keysMatcher = /^(\d*)(.*)$/.exec(keys); + if (keysMatcher[1] && keysMatcher[1] != '0') { + vim.inputState.pushRepeatDigit(keysMatcher[1]); + } + return match.command; + } + + var command; + if (vim.insertMode) { command = handleKeyInsertMode(); } + else { command = handleKeyNonInsertMode(); } + if (command === false) { + return 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 + // don't want act on it just yet. + return function() {}; + } else { + return function() { + return cm.operation(function() { + cm.curOp.isVimOp = true; + try { + if (command.type == 'keyToKey') { + doKeyToKey(command.toKeys); + } else { + commandDispatcher.processCommand(cm, vim, command); + } + } catch (e) { + // clear VIM state in case it's in a bad state. + cm.state.vim = undefined; + maybeInitVimState(cm); + if (!CodeMirror.Vim.suppressErrorLogging) { + console['log'](e); + } + throw e; + } + return true; + }); + }; + } + }, + handleEx: function(cm, input) { + exCommandDispatcher.processCommand(cm, input); + }, + + defineMotion: defineMotion, + defineAction: defineAction, + defineOperator: defineOperator, + mapCommand: mapCommand, + _mapCommand: _mapCommand, + + exitVisualMode: exitVisualMode, + exitInsertMode: exitInsertMode + }; + + // Represents the current input state. + function InputState() { + this.prefixRepeat = []; + this.motionRepeat = []; + + this.operator = null; + this.operatorArgs = null; + this.motion = null; + this.motionArgs = null; + this.keyBuffer = []; // For matching multi-key commands. + this.registerName = null; // Defaults to the unnamed register. + } + InputState.prototype.pushRepeatDigit = function(n) { + if (!this.operator) { + this.prefixRepeat = this.prefixRepeat.concat(n); + } else { + this.motionRepeat = this.motionRepeat.concat(n); + } + }; + InputState.prototype.getRepeat = function() { + var repeat = 0; + if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) { + repeat = 1; + if (this.prefixRepeat.length > 0) { + repeat *= parseInt(this.prefixRepeat.join(''), 10); + } + if (this.motionRepeat.length > 0) { + repeat *= parseInt(this.motionRepeat.join(''), 10); + } + } + return repeat; + }; + + function clearInputState(cm, reason) { + cm.state.vim.inputState = new InputState(); + CodeMirror.signal(cm, 'vim-command-done', reason); + } + + /* + * Register stores information about copy and paste registers. Besides + * text, a register must store whether it is linewise (i.e., when it is + * pasted, should it insert itself into a new line, or should the text be + * inserted at the cursor position.) + */ + function Register(text, linewise, blockwise) { + this.clear(); + this.keyBuffer = [text || '']; + this.insertModeChanges = []; + this.searchQueries = []; + this.linewise = !!linewise; + this.blockwise = !!blockwise; + } + Register.prototype = { + setText: function(text, linewise, blockwise) { + this.keyBuffer = [text || '']; + this.linewise = !!linewise; + this.blockwise = !!blockwise; + }, + pushText: function(text, linewise) { + // if this register has ever been set to linewise, use linewise. + if (linewise) { + if (!this.linewise) { + this.keyBuffer.push('\n'); + } + this.linewise = true; + } + this.keyBuffer.push(text); + }, + pushInsertModeChanges: function(changes) { + this.insertModeChanges.push(createInsertModeChanges(changes)); + }, + pushSearchQuery: function(query) { + this.searchQueries.push(query); + }, + clear: function() { + this.keyBuffer = []; + this.insertModeChanges = []; + this.searchQueries = []; + this.linewise = false; + }, + toString: function() { + return this.keyBuffer.join(''); + } + }; + + /* + * vim registers allow you to keep many independent copy and paste buffers. + * See http://usevim.com/2012/04/13/registers/ for an introduction. + * + * RegisterController keeps the state of all the registers. An initial + * state may be passed in. The unnamed register '"' will always be + * overridden. + */ + function RegisterController(registers) { + this.registers = registers; + this.unnamedRegister = registers['"'] = new Register(); + registers['.'] = new Register(); + registers[':'] = new Register(); + registers['/'] = new Register(); + } + RegisterController.prototype = { + pushText: function(registerName, operator, text, linewise, blockwise) { + if (linewise && text.charAt(0) == '\n') { + text = text.slice(1) + '\n'; + } + if (linewise && text.charAt(text.length - 1) !== '\n'){ + text += '\n'; + } + // Lowercase and uppercase registers refer to the same register. + // Uppercase just means append. + var register = this.isValidRegister(registerName) ? + this.getRegister(registerName) : null; + // if no register/an invalid register was specified, things go to the + // default registers + if (!register) { + switch (operator) { + case 'yank': + // The 0 register contains the text from the most recent yank. + this.registers['0'] = new Register(text, linewise, blockwise); + break; + case 'delete': + case 'change': + if (text.indexOf('\n') == -1) { + // Delete less than 1 line. Update the small delete register. + this.registers['-'] = new Register(text, linewise); + } else { + // Shift down the contents of the numbered registers and put the + // deleted text into register 1. + this.shiftNumericRegisters_(); + this.registers['1'] = new Register(text, linewise); + } + break; + } + // Make sure the unnamed register is set to what just happened + this.unnamedRegister.setText(text, linewise, blockwise); + return; + } + + // If we've gotten to this point, we've actually specified a register + var append = isUpperCase(registerName); + if (append) { + register.pushText(text, linewise); + } else { + register.setText(text, linewise, blockwise); + } + // The unnamed register always has the same value as the last used + // register. + this.unnamedRegister.setText(register.toString(), linewise); + }, + // Gets the register named @name. If one of @name doesn't already exist, + // create it. If @name is invalid, return the unnamedRegister. + getRegister: function(name) { + if (!this.isValidRegister(name)) { + return this.unnamedRegister; + } + name = name.toLowerCase(); + if (!this.registers[name]) { + this.registers[name] = new Register(); + } + return this.registers[name]; + }, + isValidRegister: function(name) { + return name && inArray(name, validRegisters); + }, + shiftNumericRegisters_: function() { + for (var i = 9; i >= 2; i--) { + this.registers[i] = this.getRegister('' + (i - 1)); + } + } + }; + function HistoryController() { + this.historyBuffer = []; + this.iterator; + this.initialPrefix = null; + } + HistoryController.prototype = { + // the input argument here acts a user entered prefix for a small time + // until we start autocompletion in which case it is the autocompleted. + nextMatch: function (input, up) { + var historyBuffer = this.historyBuffer; + var dir = up ? -1 : 1; + if (this.initialPrefix === null) this.initialPrefix = input; + for (var i = this.iterator + dir; up ? i >= 0 : i < historyBuffer.length; i+= dir) { + var element = historyBuffer[i]; + for (var j = 0; j <= element.length; j++) { + if (this.initialPrefix == element.substring(0, j)) { + this.iterator = i; + return element; + } + } + } + // should return the user input in case we reach the end of buffer. + if (i >= historyBuffer.length) { + this.iterator = historyBuffer.length; + return this.initialPrefix; + } + // return the last autocompleted query or exCommand as it is. + if (i < 0 ) return input; + }, + pushInput: function(input) { + var index = this.historyBuffer.indexOf(input); + if (index > -1) this.historyBuffer.splice(index, 1); + if (input.length) this.historyBuffer.push(input); + }, + reset: function() { + this.initialPrefix = null; + this.iterator = this.historyBuffer.length; + } + }; + var commandDispatcher = { + matchCommand: function(keys, keyMap, inputState, context) { + var matches = commandMatches(keys, keyMap, context, inputState); + if (!matches.full && !matches.partial) { + return {type: 'none'}; + } else if (!matches.full && matches.partial) { + return {type: 'partial'}; + } + + var bestMatch; + for (var i = 0; i < matches.full.length; i++) { + var match = matches.full[i]; + if (!bestMatch) { + bestMatch = match; + } + } + if (bestMatch.keys.slice(-11) == '') { + inputState.selectedCharacter = lastChar(keys); + } + return {type: 'full', command: bestMatch}; + }, + processCommand: function(cm, vim, command) { + vim.inputState.repeatOverride = command.repeatOverride; + switch (command.type) { + case 'motion': + this.processMotion(cm, vim, command); + break; + case 'operator': + this.processOperator(cm, vim, command); + break; + case 'operatorMotion': + this.processOperatorMotion(cm, vim, command); + break; + case 'action': + this.processAction(cm, vim, command); + break; + case 'search': + this.processSearch(cm, vim, command); + clearInputState(cm); + break; + case 'ex': + case 'keyToEx': + this.processEx(cm, vim, command); + clearInputState(cm); + break; + default: + break; + } + }, + processMotion: function(cm, vim, command) { + vim.inputState.motion = command.motion; + vim.inputState.motionArgs = copyArgs(command.motionArgs); + this.evalInput(cm, vim); + }, + processOperator: function(cm, vim, command) { + var inputState = vim.inputState; + if (inputState.operator) { + if (inputState.operator == command.operator) { + // Typing an operator twice like 'dd' makes the operator operate + // linewise + inputState.motion = 'expandToLine'; + inputState.motionArgs = { linewise: true }; + this.evalInput(cm, vim); + return; + } else { + // 2 different operators in a row doesn't make sense. + clearInputState(cm); + } + } + inputState.operator = command.operator; + inputState.operatorArgs = copyArgs(command.operatorArgs); + if (vim.visualMode) { + // Operating on a selection in visual mode. We don't need a motion. + this.evalInput(cm, vim); + } + }, + processOperatorMotion: function(cm, vim, command) { + var visualMode = vim.visualMode; + var operatorMotionArgs = copyArgs(command.operatorMotionArgs); + if (operatorMotionArgs) { + // Operator motions may have special behavior in visual mode. + if (visualMode && operatorMotionArgs.visualLine) { + vim.visualLine = true; + } + } + this.processOperator(cm, vim, command); + if (!visualMode) { + this.processMotion(cm, vim, command); + } + }, + processAction: function(cm, vim, command) { + var inputState = vim.inputState; + var repeat = inputState.getRepeat(); + var repeatIsExplicit = !!repeat; + var actionArgs = copyArgs(command.actionArgs) || {}; + if (inputState.selectedCharacter) { + actionArgs.selectedCharacter = inputState.selectedCharacter; + } + // Actions may or may not have motions and operators. Do these first. + if (command.operator) { + this.processOperator(cm, vim, command); + } + if (command.motion) { + this.processMotion(cm, vim, command); + } + if (command.motion || command.operator) { + this.evalInput(cm, vim); + } + actionArgs.repeat = repeat || 1; + actionArgs.repeatIsExplicit = repeatIsExplicit; + actionArgs.registerName = inputState.registerName; + clearInputState(cm); + vim.lastMotion = null; + if (command.isEdit) { + this.recordLastEdit(vim, inputState, command); + } + actions[command.action](cm, actionArgs, vim); + }, + processSearch: function(cm, vim, command) { + if (!cm.getSearchCursor) { + // Search depends on SearchCursor. + return; + } + var forward = command.searchArgs.forward; + var wholeWordOnly = command.searchArgs.wholeWordOnly; + getSearchState(cm).setReversed(!forward); + var promptPrefix = (forward) ? '/' : '?'; + var originalQuery = getSearchState(cm).getQuery(); + var originalScrollPos = cm.getScrollInfo(); + function handleQuery(query, ignoreCase, smartCase) { + vimGlobalState.searchHistoryController.pushInput(query); + vimGlobalState.searchHistoryController.reset(); + try { + updateSearchQuery(cm, query, ignoreCase, smartCase); + } catch (e) { + showConfirm(cm, 'Invalid regex: ' + query); + return; + } + commandDispatcher.processMotion(cm, vim, { + type: 'motion', + motion: 'findNext', + motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist } + }); + } + function onPromptClose(query) { + cm.scrollTo(originalScrollPos.left, originalScrollPos.top); + handleQuery(query, true /** ignoreCase */, true /** smartCase */); + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.isRecording) { + logSearchQuery(macroModeState, query); + } + } + function onPromptKeyUp(e, query, close) { + var keyName = CodeMirror.keyName(e), up; + if (keyName == 'Up' || keyName == 'Down') { + up = keyName == 'Up' ? true : false; + query = vimGlobalState.searchHistoryController.nextMatch(query, up) || ''; + close(query); + } else { + if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') + vimGlobalState.searchHistoryController.reset(); + } + var parsedQuery; + try { + parsedQuery = updateSearchQuery(cm, query, + true /** ignoreCase */, true /** smartCase */); + } catch (e) { + // Swallow bad regexes for incremental search. + } + if (parsedQuery) { + cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30); + } else { + clearSearchHighlight(cm); + cm.scrollTo(originalScrollPos.left, originalScrollPos.top); + } + } + function onPromptKeyDown(e, query, close) { + var keyName = CodeMirror.keyName(e); + if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { + vimGlobalState.searchHistoryController.pushInput(query); + vimGlobalState.searchHistoryController.reset(); + updateSearchQuery(cm, originalQuery); + clearSearchHighlight(cm); + cm.scrollTo(originalScrollPos.left, originalScrollPos.top); + CodeMirror.e_stop(e); + close(); + cm.focus(); + } + } + switch (command.searchArgs.querySrc) { + case 'prompt': + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.isPlaying) { + var query = macroModeState.replaySearchQueries.shift(); + handleQuery(query, true /** ignoreCase */, false /** smartCase */); + } else { + showPrompt(cm, { + onClose: onPromptClose, + prefix: promptPrefix, + desc: searchPromptDesc, + onKeyUp: onPromptKeyUp, + onKeyDown: onPromptKeyDown + }); + } + break; + case 'wordUnderCursor': + var word = expandWordUnderCursor(cm, false /** inclusive */, + true /** forward */, false /** bigWord */, + true /** noSymbol */); + var isKeyword = true; + if (!word) { + word = expandWordUnderCursor(cm, false /** inclusive */, + true /** forward */, false /** bigWord */, + false /** noSymbol */); + isKeyword = false; + } + if (!word) { + return; + } + var query = cm.getLine(word.start.line).substring(word.start.ch, + word.end.ch); + if (isKeyword && wholeWordOnly) { + query = '\\b' + query + '\\b'; + } else { + query = escapeRegex(query); + } + + // cachedCursor is used to save the old position of the cursor + // when * or # causes vim to seek for the nearest word and shift + // the cursor before entering the motion. + vimGlobalState.jumpList.cachedCursor = cm.getCursor(); + cm.setCursor(word.start); + + handleQuery(query, true /** ignoreCase */, false /** smartCase */); + break; + } + }, + processEx: function(cm, vim, command) { + function onPromptClose(input) { + // Give the prompt some time to close so that if processCommand shows + // an error, the elements don't overlap. + vimGlobalState.exCommandHistoryController.pushInput(input); + vimGlobalState.exCommandHistoryController.reset(); + exCommandDispatcher.processCommand(cm, input); + } + function onPromptKeyDown(e, input, close) { + var keyName = CodeMirror.keyName(e), up; + if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { + vimGlobalState.exCommandHistoryController.pushInput(input); + vimGlobalState.exCommandHistoryController.reset(); + CodeMirror.e_stop(e); + close(); + cm.focus(); + } + if (keyName == 'Up' || keyName == 'Down') { + up = keyName == 'Up' ? true : false; + input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || ''; + close(input); + } else { + if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') + vimGlobalState.exCommandHistoryController.reset(); + } + } + if (command.type == 'keyToEx') { + // Handle user defined Ex to Ex mappings + exCommandDispatcher.processCommand(cm, command.exArgs.input); + } else { + if (vim.visualMode) { + showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>', + onKeyDown: onPromptKeyDown}); + } else { + showPrompt(cm, { onClose: onPromptClose, prefix: ':', + onKeyDown: onPromptKeyDown}); + } + } + }, + evalInput: function(cm, vim) { + // If the motion comand is set, execute both the operator and motion. + // Otherwise return. + var inputState = vim.inputState; + var motion = inputState.motion; + var motionArgs = inputState.motionArgs || {}; + var operator = inputState.operator; + var operatorArgs = inputState.operatorArgs || {}; + var registerName = inputState.registerName; + var sel = vim.sel; + // TODO: Make sure cm and vim selections are identical outside visual mode. + var origHead = copyCursor(vim.visualMode ? sel.head: cm.getCursor('head')); + var origAnchor = copyCursor(vim.visualMode ? sel.anchor : cm.getCursor('anchor')); + var oldHead = copyCursor(origHead); + var oldAnchor = copyCursor(origAnchor); + var newHead, newAnchor; + var repeat; + if (operator) { + this.recordLastEdit(vim, inputState); + } + if (inputState.repeatOverride !== undefined) { + // If repeatOverride is specified, that takes precedence over the + // input state's repeat. Used by Ex mode and can be user defined. + repeat = inputState.repeatOverride; + } else { + repeat = inputState.getRepeat(); + } + if (repeat > 0 && motionArgs.explicitRepeat) { + motionArgs.repeatIsExplicit = true; + } else if (motionArgs.noRepeat || + (!motionArgs.explicitRepeat && repeat === 0)) { + repeat = 1; + motionArgs.repeatIsExplicit = false; + } + if (inputState.selectedCharacter) { + // If there is a character input, stick it in all of the arg arrays. + motionArgs.selectedCharacter = operatorArgs.selectedCharacter = + inputState.selectedCharacter; + } + motionArgs.repeat = repeat; + clearInputState(cm); + if (motion) { + var motionResult = motions[motion](cm, origHead, motionArgs, vim); + vim.lastMotion = motions[motion]; + if (!motionResult) { + return; + } + if (motionArgs.toJumplist) { + var jumpList = vimGlobalState.jumpList; + // if the current motion is # or *, use cachedCursor + var cachedCursor = jumpList.cachedCursor; + if (cachedCursor) { + recordJumpPosition(cm, cachedCursor, motionResult); + delete jumpList.cachedCursor; + } else { + recordJumpPosition(cm, origHead, motionResult); + } + } + if (motionResult instanceof Array) { + newAnchor = motionResult[0]; + newHead = motionResult[1]; + } else { + newHead = motionResult; + } + // TODO: Handle null returns from motion commands better. + if (!newHead) { + newHead = copyCursor(origHead); + } + if (vim.visualMode) { + if (!(vim.visualBlock && newHead.ch === Infinity)) { + newHead = clipCursorToContent(cm, newHead, vim.visualBlock); + } + if (newAnchor) { + newAnchor = clipCursorToContent(cm, newAnchor, true); + } + newAnchor = newAnchor || oldAnchor; + sel.anchor = newAnchor; + sel.head = newHead; + updateCmSelection(cm); + updateMark(cm, vim, '<', + cursorIsBefore(newAnchor, newHead) ? newAnchor + : newHead); + updateMark(cm, vim, '>', + cursorIsBefore(newAnchor, newHead) ? newHead + : newAnchor); + } else if (!operator) { + newHead = clipCursorToContent(cm, newHead); + cm.setCursor(newHead.line, newHead.ch); + } + } + if (operator) { + if (operatorArgs.lastSel) { + // Replaying a visual mode operation + newAnchor = oldAnchor; + var lastSel = operatorArgs.lastSel; + var lineOffset = Math.abs(lastSel.head.line - lastSel.anchor.line); + var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch); + if (lastSel.visualLine) { + // Linewise Visual mode: The same number of lines. + newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); + } else if (lastSel.visualBlock) { + // Blockwise Visual mode: The same number of lines and columns. + newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset); + } else if (lastSel.head.line == lastSel.anchor.line) { + // Normal Visual mode within one line: The same number of characters. + newHead = Pos(oldAnchor.line, oldAnchor.ch + chOffset); + } else { + // Normal Visual mode with several lines: The same number of lines, in the + // last line the same number of characters as in the last line the last time. + newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); + } + vim.visualMode = true; + vim.visualLine = lastSel.visualLine; + vim.visualBlock = lastSel.visualBlock; + sel = vim.sel = { + anchor: newAnchor, + head: newHead + }; + updateCmSelection(cm); + } else if (vim.visualMode) { + operatorArgs.lastSel = { + anchor: copyCursor(sel.anchor), + head: copyCursor(sel.head), + visualBlock: vim.visualBlock, + visualLine: vim.visualLine + }; + } + var curStart, curEnd, linewise, mode; + var cmSel; + if (vim.visualMode) { + // Init visual op + curStart = cursorMin(sel.head, sel.anchor); + curEnd = cursorMax(sel.head, sel.anchor); + linewise = vim.visualLine || operatorArgs.linewise; + mode = vim.visualBlock ? 'block' : + linewise ? 'line' : + 'char'; + cmSel = makeCmSelection(cm, { + anchor: curStart, + head: curEnd + }, mode); + if (linewise) { + var ranges = cmSel.ranges; + if (mode == 'block') { + // Linewise operators in visual block mode extend to end of line + for (var i = 0; i < ranges.length; i++) { + ranges[i].head.ch = lineLength(cm, ranges[i].head.line); + } + } else if (mode == 'line') { + ranges[0].head = Pos(ranges[0].head.line + 1, 0); + } + } + } else { + // Init motion op + curStart = copyCursor(newAnchor || oldAnchor); + curEnd = copyCursor(newHead || oldHead); + if (cursorIsBefore(curEnd, curStart)) { + var tmp = curStart; + curStart = curEnd; + curEnd = tmp; + } + linewise = motionArgs.linewise || operatorArgs.linewise; + if (linewise) { + // Expand selection to entire line. + expandSelectionToLine(cm, curStart, curEnd); + } else if (motionArgs.forward) { + // Clip to trailing newlines only if the motion goes forward. + clipToLine(cm, curStart, curEnd); + } + mode = 'char'; + var exclusive = !motionArgs.inclusive || linewise; + cmSel = makeCmSelection(cm, { + anchor: curStart, + head: curEnd + }, mode, exclusive); + } + cm.setSelections(cmSel.ranges, cmSel.primary); + vim.lastMotion = null; + operatorArgs.repeat = repeat; // For indent in visual mode. + operatorArgs.registerName = registerName; + // Keep track of linewise as it affects how paste and change behave. + operatorArgs.linewise = linewise; + var operatorMoveTo = operators[operator]( + cm, operatorArgs, cmSel.ranges, oldAnchor, newHead); + if (vim.visualMode) { + exitVisualMode(cm, operatorMoveTo != null); + } + if (operatorMoveTo) { + cm.setCursor(operatorMoveTo); + } + } + }, + recordLastEdit: function(vim, inputState, actionCommand) { + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.isPlaying) { return; } + vim.lastEditInputState = inputState; + vim.lastEditActionCommand = actionCommand; + macroModeState.lastInsertModeChanges.changes = []; + macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false; + } + }; + + /** + * typedef {Object{line:number,ch:number}} Cursor An object containing the + * position of the cursor. + */ + // All of the functions below return Cursor objects. + var motions = { + moveToTopLine: function(cm, _head, motionArgs) { + var line = getUserVisibleLines(cm).top + motionArgs.repeat -1; + return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); + }, + moveToMiddleLine: function(cm) { + var range = getUserVisibleLines(cm); + var line = Math.floor((range.top + range.bottom) * 0.5); + return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); + }, + moveToBottomLine: function(cm, _head, motionArgs) { + var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1; + return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); + }, + expandToLine: function(_cm, head, motionArgs) { + // Expands forward to end of line, and then to next line if repeat is + // >1. Does not handle backward motion! + var cur = head; + return Pos(cur.line + motionArgs.repeat - 1, Infinity); + }, + findNext: function(cm, _head, motionArgs) { + var state = getSearchState(cm); + var query = state.getQuery(); + if (!query) { + return; + } + var prev = !motionArgs.forward; + // If search is initiated with ? instead of /, negate direction. + prev = (state.isReversed()) ? !prev : prev; + highlightSearchMatches(cm, query); + return findNext(cm, prev/** prev */, query, motionArgs.repeat); + }, + goToMark: function(cm, _head, motionArgs, vim) { + var mark = vim.marks[motionArgs.selectedCharacter]; + if (mark) { + var pos = mark.find(); + return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos; + } + return null; + }, + moveToOtherHighlightedEnd: function(cm, _head, motionArgs, vim) { + if (vim.visualBlock && motionArgs.sameLine) { + var sel = vim.sel; + return [ + clipCursorToContent(cm, Pos(sel.anchor.line, sel.head.ch)), + clipCursorToContent(cm, Pos(sel.head.line, sel.anchor.ch)) + ]; + } else { + return ([vim.sel.head, vim.sel.anchor]); + } + }, + jumpToMark: function(cm, head, motionArgs, vim) { + var best = head; + for (var i = 0; i < motionArgs.repeat; i++) { + var cursor = best; + for (var key in vim.marks) { + if (!isLowerCase(key)) { + continue; + } + var mark = vim.marks[key].find(); + var isWrongDirection = (motionArgs.forward) ? + cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark); + + if (isWrongDirection) { + continue; + } + if (motionArgs.linewise && (mark.line == cursor.line)) { + continue; + } + + var equal = cursorEqual(cursor, best); + var between = (motionArgs.forward) ? + cursorIsBetween(cursor, mark, best) : + cursorIsBetween(best, mark, cursor); + + if (equal || between) { + best = mark; + } + } + } + + if (motionArgs.linewise) { + // Vim places the cursor on the first non-whitespace character of + // the line if there is one, else it places the cursor at the end + // of the line, regardless of whether a mark was found. + best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line))); + } + return best; + }, + moveByCharacters: function(_cm, head, motionArgs) { + var cur = head; + var repeat = motionArgs.repeat; + var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat; + return Pos(cur.line, ch); + }, + moveByLines: function(cm, head, motionArgs, vim) { + var cur = head; + var endCh = cur.ch; + // Depending what our last motion was, we may want to do different + // things. If our last motion was moving vertically, we want to + // preserve the HPos from our last horizontal move. If our last motion + // was going to the end of a line, moving vertically we should go to + // the end of the line, etc. + switch (vim.lastMotion) { + case this.moveByLines: + case this.moveByDisplayLines: + case this.moveByScroll: + case this.moveToColumn: + case this.moveToEol: + endCh = vim.lastHPos; + break; + default: + vim.lastHPos = endCh; + } + var repeat = motionArgs.repeat+(motionArgs.repeatOffset||0); + var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat; + var first = cm.firstLine(); + var last = cm.lastLine(); + // Vim cancels linewise motions that start on an edge and move beyond + // that edge. It does not cancel motions that do not start on an edge. + if ((line < first && cur.line == first) || + (line > last && cur.line == last)) { + return; + } + if (motionArgs.toFirstChar){ + endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line)); + vim.lastHPos = endCh; + } + vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left; + return Pos(line, endCh); + }, + moveByDisplayLines: function(cm, head, motionArgs, vim) { + var cur = head; + switch (vim.lastMotion) { + case this.moveByDisplayLines: + case this.moveByScroll: + case this.moveByLines: + case this.moveToColumn: + case this.moveToEol: + break; + default: + vim.lastHSPos = cm.charCoords(cur,'div').left; + } + var repeat = motionArgs.repeat; + var res=cm.findPosV(cur,(motionArgs.forward ? repeat : -repeat),'line',vim.lastHSPos); + if (res.hitSide) { + if (motionArgs.forward) { + var lastCharCoords = cm.charCoords(res, 'div'); + var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos }; + var res = cm.coordsChar(goalCoords, 'div'); + } else { + var resCoords = cm.charCoords(Pos(cm.firstLine(), 0), 'div'); + resCoords.left = vim.lastHSPos; + res = cm.coordsChar(resCoords, 'div'); + } + } + vim.lastHPos = res.ch; + return res; + }, + moveByPage: function(cm, head, motionArgs) { + // CodeMirror only exposes functions that move the cursor page down, so + // doing this bad hack to move the cursor and move it back. evalInput + // will move the cursor to where it should be in the end. + var curStart = head; + var repeat = motionArgs.repeat; + return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page'); + }, + moveByParagraph: function(cm, head, motionArgs) { + var dir = motionArgs.forward ? 1 : -1; + return findParagraph(cm, head, motionArgs.repeat, dir); + }, + moveByScroll: function(cm, head, motionArgs, vim) { + var scrollbox = cm.getScrollInfo(); + var curEnd = null; + var repeat = motionArgs.repeat; + if (!repeat) { + repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight()); + } + var orig = cm.charCoords(head, 'local'); + motionArgs.repeat = repeat; + var curEnd = motions.moveByDisplayLines(cm, head, motionArgs, vim); + if (!curEnd) { + return null; + } + var dest = cm.charCoords(curEnd, 'local'); + cm.scrollTo(null, scrollbox.top + dest.top - orig.top); + return curEnd; + }, + moveByWords: function(cm, head, motionArgs) { + return moveToWord(cm, head, motionArgs.repeat, !!motionArgs.forward, + !!motionArgs.wordEnd, !!motionArgs.bigWord); + }, + moveTillCharacter: function(cm, _head, motionArgs) { + var repeat = motionArgs.repeat; + var curEnd = moveToCharacter(cm, repeat, motionArgs.forward, + motionArgs.selectedCharacter); + var increment = motionArgs.forward ? -1 : 1; + recordLastCharacterSearch(increment, motionArgs); + if (!curEnd) return null; + curEnd.ch += increment; + return curEnd; + }, + moveToCharacter: function(cm, head, motionArgs) { + var repeat = motionArgs.repeat; + recordLastCharacterSearch(0, motionArgs); + return moveToCharacter(cm, repeat, motionArgs.forward, + motionArgs.selectedCharacter) || head; + }, + moveToSymbol: function(cm, head, motionArgs) { + var repeat = motionArgs.repeat; + return findSymbol(cm, repeat, motionArgs.forward, + motionArgs.selectedCharacter) || head; + }, + moveToColumn: function(cm, head, motionArgs, vim) { + var repeat = motionArgs.repeat; + // repeat is equivalent to which column we want to move to! + vim.lastHPos = repeat - 1; + vim.lastHSPos = cm.charCoords(head,'div').left; + return moveToColumn(cm, repeat); + }, + moveToEol: function(cm, head, motionArgs, vim) { + var cur = head; + vim.lastHPos = Infinity; + var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity); + var end=cm.clipPos(retval); + end.ch--; + vim.lastHSPos = cm.charCoords(end,'div').left; + return retval; + }, + moveToFirstNonWhiteSpaceCharacter: function(cm, head) { + // Go to the start of the line where the text begins, or the end for + // whitespace-only lines + var cursor = head; + return Pos(cursor.line, + findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line))); + }, + moveToMatchedSymbol: function(cm, head) { + var cursor = head; + var line = cursor.line; + var ch = cursor.ch; + var lineText = cm.getLine(line); + var symbol; + do { + symbol = lineText.charAt(ch++); + if (symbol && isMatchableSymbol(symbol)) { + var style = cm.getTokenTypeAt(Pos(line, ch)); + if (style !== "string" && style !== "comment") { + break; + } + } + } while (symbol); + if (symbol) { + var matched = cm.findMatchingBracket(Pos(line, ch)); + return matched.to; + } else { + return cursor; + } + }, + moveToStartOfLine: function(_cm, head) { + return Pos(head.line, 0); + }, + moveToLineOrEdgeOfDocument: function(cm, _head, motionArgs) { + var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine(); + if (motionArgs.repeatIsExplicit) { + lineNum = motionArgs.repeat - cm.getOption('firstLineNumber'); + } + return Pos(lineNum, + findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum))); + }, + textObjectManipulation: function(cm, head, motionArgs, vim) { + // TODO: lots of possible exceptions that can be thrown here. Try da( + // outside of a () block. + + // TODO: adding <> >< to this map doesn't work, presumably because + // they're operators + var mirroredPairs = {'(': ')', ')': '(', + '{': '}', '}': '{', + '[': ']', ']': '['}; + var selfPaired = {'\'': true, '"': true}; + + var character = motionArgs.selectedCharacter; + // 'b' refers to '()' block. + // 'B' refers to '{}' block. + if (character == 'b') { + character = '('; + } else if (character == 'B') { + character = '{'; + } + + // Inclusive is the difference between a and i + // TODO: Instead of using the additional text object map to perform text + // object operations, merge the map into the defaultKeyMap and use + // motionArgs to define behavior. Define separate entries for 'aw', + // 'iw', 'a[', 'i[', etc. + var inclusive = !motionArgs.textObjectInner; + + var tmp; + if (mirroredPairs[character]) { + tmp = selectCompanionObject(cm, head, character, inclusive); + } else if (selfPaired[character]) { + tmp = findBeginningAndEnd(cm, head, character, inclusive); + } else if (character === 'W') { + tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, + true /** bigWord */); + } else if (character === 'w') { + tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, + false /** bigWord */); + } else if (character === 'p') { + tmp = findParagraph(cm, head, motionArgs.repeat, 0, inclusive); + motionArgs.linewise = true; + if (vim.visualMode) { + if (!vim.visualLine) { vim.visualLine = true; } + } else { + var operatorArgs = vim.inputState.operatorArgs; + if (operatorArgs) { operatorArgs.linewise = true; } + tmp.end.line--; + } + } else { + // No text object defined for this, don't move. + return null; + } + + if (!cm.state.vim.visualMode) { + return [tmp.start, tmp.end]; + } else { + return expandSelection(cm, tmp.start, tmp.end); + } + }, + + repeatLastCharacterSearch: function(cm, head, motionArgs) { + var lastSearch = vimGlobalState.lastChararacterSearch; + var repeat = motionArgs.repeat; + var forward = motionArgs.forward === lastSearch.forward; + var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1); + cm.moveH(-increment, 'char'); + motionArgs.inclusive = forward ? true : false; + var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter); + if (!curEnd) { + cm.moveH(increment, 'char'); + return head; + } + curEnd.ch += increment; + return curEnd; + } + }; + + function defineMotion(name, fn) { + motions[name] = fn; + } + + function fillArray(val, times) { + var arr = []; + for (var i = 0; i < times; i++) { + arr.push(val); + } + return arr; + } + /** + * An operator acts on a text selection. It receives the list of selections + * as input. The corresponding CodeMirror selection is guaranteed to + * match the input selection. + */ + var operators = { + change: function(cm, args, ranges) { + var finalHead, text; + var vim = cm.state.vim; + vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock = vim.visualBlock; + if (!vim.visualMode) { + var anchor = ranges[0].anchor, + head = ranges[0].head; + text = cm.getRange(anchor, head); + if (!isWhiteSpaceString(text)) { + // Exclude trailing whitespace if the range is not all whitespace. + var match = (/\s+$/).exec(text); + if (match) { + head = offsetCursor(head, 0, - match[0].length); + text = text.slice(0, - match[0].length); + } + } + var wasLastLine = head.line - 1 == cm.lastLine(); + cm.replaceRange('', anchor, head); + if (args.linewise && !wasLastLine) { + // Push the next line back down, if there is a next line. + CodeMirror.commands.newlineAndIndent(cm); + // null ch so setCursor moves to end of line. + anchor.ch = null; + } + finalHead = anchor; + } else { + text = cm.getSelection(); + var replacement = fillArray('', ranges.length); + cm.replaceSelections(replacement); + finalHead = cursorMin(ranges[0].head, ranges[0].anchor); + } + vimGlobalState.registerController.pushText( + args.registerName, 'change', text, + args.linewise, ranges.length > 1); + actions.enterInsertMode(cm, {head: finalHead}, cm.state.vim); + }, + // delete is a javascript keyword. + 'delete': function(cm, args, ranges) { + var finalHead, text; + var vim = cm.state.vim; + if (!vim.visualBlock) { + var anchor = ranges[0].anchor, + head = ranges[0].head; + if (args.linewise && + head.line != cm.firstLine() && + anchor.line == cm.lastLine() && + anchor.line == head.line - 1) { + // Special case for dd on last line (and first line). + if (anchor.line == cm.firstLine()) { + anchor.ch = 0; + } else { + anchor = Pos(anchor.line - 1, lineLength(cm, anchor.line - 1)); + } + } + text = cm.getRange(anchor, head); + cm.replaceRange('', anchor, head); + finalHead = anchor; + if (args.linewise) { + finalHead = motions.moveToFirstNonWhiteSpaceCharacter(cm, anchor); + } + } else { + text = cm.getSelection(); + var replacement = fillArray('', ranges.length); + cm.replaceSelections(replacement); + finalHead = ranges[0].anchor; + } + vimGlobalState.registerController.pushText( + args.registerName, 'delete', text, + args.linewise, vim.visualBlock); + return clipCursorToContent(cm, finalHead); + }, + indent: function(cm, args, ranges) { + var vim = cm.state.vim; + var startLine = ranges[0].anchor.line; + var endLine = vim.visualBlock ? + ranges[ranges.length - 1].anchor.line : + ranges[0].head.line; + // In visual mode, n> shifts the selection right n times, instead of + // shifting n lines right once. + var repeat = (vim.visualMode) ? args.repeat : 1; + if (args.linewise) { + // The only way to delete a newline is to delete until the start of + // the next line, so in linewise mode evalInput will include the next + // line. We don't want this in indent, so we go back a line. + endLine--; + } + for (var i = startLine; i <= endLine; i++) { + for (var j = 0; j < repeat; j++) { + cm.indentLine(i, args.indentRight); + } + } + return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor); + }, + changeCase: function(cm, args, ranges, oldAnchor, newHead) { + var selections = cm.getSelections(); + var swapped = []; + var toLower = args.toLower; + for (var j = 0; j < selections.length; j++) { + var toSwap = selections[j]; + var text = ''; + if (toLower === true) { + text = toSwap.toLowerCase(); + } else if (toLower === false) { + text = toSwap.toUpperCase(); + } else { + for (var i = 0; i < toSwap.length; i++) { + var character = toSwap.charAt(i); + text += isUpperCase(character) ? character.toLowerCase() : + character.toUpperCase(); + } + } + swapped.push(text); + } + cm.replaceSelections(swapped); + if (args.shouldMoveCursor){ + return newHead; + } else if (!cm.state.vim.visualMode && args.linewise && ranges[0].anchor.line + 1 == ranges[0].head.line) { + return motions.moveToFirstNonWhiteSpaceCharacter(cm, oldAnchor); + } else if (args.linewise){ + return oldAnchor; + } else { + return cursorMin(ranges[0].anchor, ranges[0].head); + } + }, + yank: function(cm, args, ranges, oldAnchor) { + var vim = cm.state.vim; + var text = cm.getSelection(); + var endPos = vim.visualMode + ? cursorMin(vim.sel.anchor, vim.sel.head, ranges[0].head, ranges[0].anchor) + : oldAnchor; + vimGlobalState.registerController.pushText( + args.registerName, 'yank', + text, args.linewise, vim.visualBlock); + return endPos; + } + }; + + function defineOperator(name, fn) { + operators[name] = fn; + } + + var actions = { + jumpListWalk: function(cm, actionArgs, vim) { + if (vim.visualMode) { + return; + } + var repeat = actionArgs.repeat; + var forward = actionArgs.forward; + var jumpList = vimGlobalState.jumpList; + + var mark = jumpList.move(cm, forward ? repeat : -repeat); + var markPos = mark ? mark.find() : undefined; + markPos = markPos ? markPos : cm.getCursor(); + cm.setCursor(markPos); + }, + scroll: function(cm, actionArgs, vim) { + if (vim.visualMode) { + return; + } + var repeat = actionArgs.repeat || 1; + var lineHeight = cm.defaultTextHeight(); + var top = cm.getScrollInfo().top; + var delta = lineHeight * repeat; + var newPos = actionArgs.forward ? top + delta : top - delta; + var cursor = copyCursor(cm.getCursor()); + var cursorCoords = cm.charCoords(cursor, 'local'); + if (actionArgs.forward) { + if (newPos > cursorCoords.top) { + cursor.line += (newPos - cursorCoords.top) / lineHeight; + cursor.line = Math.ceil(cursor.line); + cm.setCursor(cursor); + cursorCoords = cm.charCoords(cursor, 'local'); + cm.scrollTo(null, cursorCoords.top); + } else { + // Cursor stays within bounds. Just reposition the scroll window. + cm.scrollTo(null, newPos); + } + } else { + var newBottom = newPos + cm.getScrollInfo().clientHeight; + if (newBottom < cursorCoords.bottom) { + cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight; + cursor.line = Math.floor(cursor.line); + cm.setCursor(cursor); + cursorCoords = cm.charCoords(cursor, 'local'); + cm.scrollTo( + null, cursorCoords.bottom - cm.getScrollInfo().clientHeight); + } else { + // Cursor stays within bounds. Just reposition the scroll window. + cm.scrollTo(null, newPos); + } + } + }, + scrollToCursor: function(cm, actionArgs) { + var lineNum = cm.getCursor().line; + var charCoords = cm.charCoords(Pos(lineNum, 0), 'local'); + var height = cm.getScrollInfo().clientHeight; + var y = charCoords.top; + var lineHeight = charCoords.bottom - y; + switch (actionArgs.position) { + case 'center': y = y - (height / 2) + lineHeight; + break; + case 'bottom': y = y - height + lineHeight*1.4; + break; + case 'top': y = y + lineHeight*0.4; + break; + } + cm.scrollTo(null, y); + }, + replayMacro: function(cm, actionArgs, vim) { + var registerName = actionArgs.selectedCharacter; + var repeat = actionArgs.repeat; + var macroModeState = vimGlobalState.macroModeState; + if (registerName == '@') { + registerName = macroModeState.latestRegister; + } + while(repeat--){ + executeMacroRegister(cm, vim, macroModeState, registerName); + } + }, + enterMacroRecordMode: function(cm, actionArgs) { + var macroModeState = vimGlobalState.macroModeState; + var registerName = actionArgs.selectedCharacter; + macroModeState.enterMacroRecordMode(cm, registerName); + }, + enterInsertMode: function(cm, actionArgs, vim) { + if (cm.getOption('readOnly')) { return; } + vim.insertMode = true; + vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1; + var insertAt = (actionArgs) ? actionArgs.insertAt : null; + var sel = vim.sel; + var head = actionArgs.head || cm.getCursor('head'); + var height = cm.listSelections().length; + if (insertAt == 'eol') { + head = Pos(head.line, lineLength(cm, head.line)); + } else if (insertAt == 'charAfter') { + head = offsetCursor(head, 0, 1); + } else if (insertAt == 'firstNonBlank') { + head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head); + } else if (insertAt == 'startOfSelectedArea') { + if (!vim.visualBlock) { + if (sel.head.line < sel.anchor.line) { + head = sel.head; + } else { + head = Pos(sel.anchor.line, 0); + } + } else { + head = Pos( + Math.min(sel.head.line, sel.anchor.line), + Math.min(sel.head.ch, sel.anchor.ch)); + height = Math.abs(sel.head.line - sel.anchor.line) + 1; + } + } else if (insertAt == 'endOfSelectedArea') { + if (!vim.visualBlock) { + if (sel.head.line >= sel.anchor.line) { + head = offsetCursor(sel.head, 0, 1); + } else { + head = Pos(sel.anchor.line, 0); + } + } else { + head = Pos( + Math.min(sel.head.line, sel.anchor.line), + Math.max(sel.head.ch + 1, sel.anchor.ch)); + height = Math.abs(sel.head.line - sel.anchor.line) + 1; + } + } else if (insertAt == 'inplace') { + if (vim.visualMode){ + return; + } + } + cm.setOption('keyMap', 'vim-insert'); + cm.setOption('disableInput', false); + if (actionArgs && actionArgs.replace) { + // Handle Replace-mode as a special case of insert mode. + cm.toggleOverwrite(true); + cm.setOption('keyMap', 'vim-replace'); + CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"}); + } else { + cm.setOption('keyMap', 'vim-insert'); + CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"}); + } + if (!vimGlobalState.macroModeState.isPlaying) { + // Only record if not replaying. + cm.on('change', onChange); + CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); + } + if (vim.visualMode) { + exitVisualMode(cm); + } + selectForInsert(cm, head, height); + }, + toggleVisualMode: function(cm, actionArgs, vim) { + var repeat = actionArgs.repeat; + var anchor = cm.getCursor(); + var head; + // TODO: The repeat should actually select number of characters/lines + // equal to the repeat times the size of the previous visual + // operation. + if (!vim.visualMode) { + // Entering visual mode + vim.visualMode = true; + vim.visualLine = !!actionArgs.linewise; + vim.visualBlock = !!actionArgs.blockwise; + head = clipCursorToContent( + cm, Pos(anchor.line, anchor.ch + repeat - 1), + true /** includeLineBreak */); + vim.sel = { + anchor: anchor, + head: head + }; + CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); + updateCmSelection(cm); + updateMark(cm, vim, '<', cursorMin(anchor, head)); + updateMark(cm, vim, '>', cursorMax(anchor, head)); + } else if (vim.visualLine ^ actionArgs.linewise || + vim.visualBlock ^ actionArgs.blockwise) { + // Toggling between modes + vim.visualLine = !!actionArgs.linewise; + vim.visualBlock = !!actionArgs.blockwise; + CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); + updateCmSelection(cm); + } else { + exitVisualMode(cm); + } + }, + reselectLastSelection: function(cm, _actionArgs, vim) { + var lastSelection = vim.lastSelection; + if (vim.visualMode) { + updateLastSelection(cm, vim); + } + if (lastSelection) { + var anchor = lastSelection.anchorMark.find(); + var head = lastSelection.headMark.find(); + if (!anchor || !head) { + // If the marks have been destroyed due to edits, do nothing. + return; + } + vim.sel = { + anchor: anchor, + head: head + }; + vim.visualMode = true; + vim.visualLine = lastSelection.visualLine; + vim.visualBlock = lastSelection.visualBlock; + updateCmSelection(cm); + updateMark(cm, vim, '<', cursorMin(anchor, head)); + updateMark(cm, vim, '>', cursorMax(anchor, head)); + CodeMirror.signal(cm, 'vim-mode-change', { + mode: 'visual', + subMode: vim.visualLine ? 'linewise' : + vim.visualBlock ? 'blockwise' : ''}); + } + }, + joinLines: function(cm, actionArgs, vim) { + var curStart, curEnd; + if (vim.visualMode) { + curStart = cm.getCursor('anchor'); + curEnd = cm.getCursor('head'); + if (cursorIsBefore(curEnd, curStart)) { + var tmp = curEnd; + curEnd = curStart; + curStart = tmp; + } + curEnd.ch = lineLength(cm, curEnd.line) - 1; + } else { + // Repeat is the number of lines to join. Minimum 2 lines. + var repeat = Math.max(actionArgs.repeat, 2); + curStart = cm.getCursor(); + curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1, + Infinity)); + } + var finalCh = 0; + for (var i = curStart.line; i < curEnd.line; i++) { + finalCh = lineLength(cm, curStart.line); + var tmp = Pos(curStart.line + 1, + lineLength(cm, curStart.line + 1)); + var text = cm.getRange(curStart, tmp); + text = text.replace(/\n\s*/g, ' '); + cm.replaceRange(text, curStart, tmp); + } + var curFinalPos = Pos(curStart.line, finalCh); + if (vim.visualMode) { + exitVisualMode(cm, false); + } + cm.setCursor(curFinalPos); + }, + newLineAndEnterInsertMode: function(cm, actionArgs, vim) { + vim.insertMode = true; + var insertAt = copyCursor(cm.getCursor()); + if (insertAt.line === cm.firstLine() && !actionArgs.after) { + // Special case for inserting newline before start of document. + cm.replaceRange('\n', Pos(cm.firstLine(), 0)); + cm.setCursor(cm.firstLine(), 0); + } else { + insertAt.line = (actionArgs.after) ? insertAt.line : + insertAt.line - 1; + insertAt.ch = lineLength(cm, insertAt.line); + cm.setCursor(insertAt); + var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment || + CodeMirror.commands.newlineAndIndent; + newlineFn(cm); + } + this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim); + }, + paste: function(cm, actionArgs, vim) { + var cur = copyCursor(cm.getCursor()); + var register = vimGlobalState.registerController.getRegister( + actionArgs.registerName); + var text = register.toString(); + if (!text) { + return; + } + if (actionArgs.matchIndent) { + var tabSize = cm.getOption("tabSize"); + // length that considers tabs and tabSize + var whitespaceLength = function(str) { + var tabs = (str.split("\t").length - 1); + var spaces = (str.split(" ").length - 1); + return tabs * tabSize + spaces * 1; + }; + var currentLine = cm.getLine(cm.getCursor().line); + var indent = whitespaceLength(currentLine.match(/^\s*/)[0]); + // chomp last newline b/c don't want it to match /^\s*/gm + var chompedText = text.replace(/\n$/, ''); + var wasChomped = text !== chompedText; + var firstIndent = whitespaceLength(text.match(/^\s*/)[0]); + var text = chompedText.replace(/^\s*/gm, function(wspace) { + var newIndent = indent + (whitespaceLength(wspace) - firstIndent); + if (newIndent < 0) { + return ""; + } + else if (cm.getOption("indentWithTabs")) { + var quotient = Math.floor(newIndent / tabSize); + return Array(quotient + 1).join('\t'); + } + else { + return Array(newIndent + 1).join(' '); + } + }); + text += wasChomped ? "\n" : ""; + } + if (actionArgs.repeat > 1) { + var text = Array(actionArgs.repeat + 1).join(text); + } + var linewise = register.linewise; + var blockwise = register.blockwise; + if (linewise) { + if(vim.visualMode) { + text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n'; + } else if (actionArgs.after) { + // Move the newline at the end to the start instead, and paste just + // before the newline character of the line we are on right now. + text = '\n' + text.slice(0, text.length - 1); + cur.ch = lineLength(cm, cur.line); + } else { + cur.ch = 0; + } + } else { + if (blockwise) { + text = text.split('\n'); + for (var i = 0; i < text.length; i++) { + text[i] = (text[i] == '') ? ' ' : text[i]; + } + } + cur.ch += actionArgs.after ? 1 : 0; + } + var curPosFinal; + var idx; + if (vim.visualMode) { + // save the pasted text for reselection if the need arises + vim.lastPastedText = text; + var lastSelectionCurEnd; + var selectedArea = getSelectedAreaRange(cm, vim); + var selectionStart = selectedArea[0]; + var selectionEnd = selectedArea[1]; + var selectedText = cm.getSelection(); + var selections = cm.listSelections(); + var emptyStrings = new Array(selections.length).join('1').split('1'); + // save the curEnd marker before it get cleared due to cm.replaceRange. + if (vim.lastSelection) { + lastSelectionCurEnd = vim.lastSelection.headMark.find(); + } + // push the previously selected text to unnamed register + vimGlobalState.registerController.unnamedRegister.setText(selectedText); + if (blockwise) { + // first delete the selected text + cm.replaceSelections(emptyStrings); + // Set new selections as per the block length of the yanked text + selectionEnd = Pos(selectionStart.line + text.length-1, selectionStart.ch); + cm.setCursor(selectionStart); + selectBlock(cm, selectionEnd); + cm.replaceSelections(text); + curPosFinal = selectionStart; + } else if (vim.visualBlock) { + cm.replaceSelections(emptyStrings); + cm.setCursor(selectionStart); + cm.replaceRange(text, selectionStart, selectionStart); + curPosFinal = selectionStart; + } else { + cm.replaceRange(text, selectionStart, selectionEnd); + curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1); + } + // restore the the curEnd marker + if(lastSelectionCurEnd) { + vim.lastSelection.headMark = cm.setBookmark(lastSelectionCurEnd); + } + if (linewise) { + curPosFinal.ch=0; + } + } else { + if (blockwise) { + cm.setCursor(cur); + for (var i = 0; i < text.length; i++) { + var line = cur.line+i; + if (line > cm.lastLine()) { + cm.replaceRange('\n', Pos(line, 0)); + } + var lastCh = lineLength(cm, line); + if (lastCh < cur.ch) { + extendLineToColumn(cm, line, cur.ch); + } + } + cm.setCursor(cur); + selectBlock(cm, Pos(cur.line + text.length-1, cur.ch)); + cm.replaceSelections(text); + curPosFinal = cur; + } else { + cm.replaceRange(text, cur); + // Now fine tune the cursor to where we want it. + if (linewise && actionArgs.after) { + curPosFinal = Pos( + cur.line + 1, + findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1))); + } else if (linewise && !actionArgs.after) { + curPosFinal = Pos( + cur.line, + findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line))); + } else if (!linewise && actionArgs.after) { + idx = cm.indexFromPos(cur); + curPosFinal = cm.posFromIndex(idx + text.length - 1); + } else { + idx = cm.indexFromPos(cur); + curPosFinal = cm.posFromIndex(idx + text.length); + } + } + } + if (vim.visualMode) { + exitVisualMode(cm, false); + } + cm.setCursor(curPosFinal); + }, + undo: function(cm, actionArgs) { + cm.operation(function() { + repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)(); + cm.setCursor(cm.getCursor('anchor')); + }); + }, + redo: function(cm, actionArgs) { + repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)(); + }, + setRegister: function(_cm, actionArgs, vim) { + vim.inputState.registerName = actionArgs.selectedCharacter; + }, + setMark: function(cm, actionArgs, vim) { + var markName = actionArgs.selectedCharacter; + updateMark(cm, vim, markName, cm.getCursor()); + }, + replace: function(cm, actionArgs, vim) { + var replaceWith = actionArgs.selectedCharacter; + var curStart = cm.getCursor(); + var replaceTo; + var curEnd; + var selections = cm.listSelections(); + if (vim.visualMode) { + curStart = cm.getCursor('start'); + curEnd = cm.getCursor('end'); + } else { + var line = cm.getLine(curStart.line); + replaceTo = curStart.ch + actionArgs.repeat; + if (replaceTo > line.length) { + replaceTo=line.length; + } + curEnd = Pos(curStart.line, replaceTo); + } + if (replaceWith=='\n') { + if (!vim.visualMode) cm.replaceRange('', curStart, curEnd); + // special case, where vim help says to replace by just one line-break + (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm); + } else { + var replaceWithStr = cm.getRange(curStart, curEnd); + //replace all characters in range by selected, but keep linebreaks + replaceWithStr = replaceWithStr.replace(/[^\n]/g, replaceWith); + if (vim.visualBlock) { + // Tabs are split in visua block before replacing + var spaces = new Array(cm.getOption("tabSize")+1).join(' '); + replaceWithStr = cm.getSelection(); + replaceWithStr = replaceWithStr.replace(/\t/g, spaces).replace(/[^\n]/g, replaceWith).split('\n'); + cm.replaceSelections(replaceWithStr); + } else { + cm.replaceRange(replaceWithStr, curStart, curEnd); + } + if (vim.visualMode) { + curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ? + selections[0].anchor : selections[0].head; + cm.setCursor(curStart); + exitVisualMode(cm, false); + } else { + cm.setCursor(offsetCursor(curEnd, 0, -1)); + } + } + }, + incrementNumberToken: function(cm, actionArgs) { + var cur = cm.getCursor(); + var lineStr = cm.getLine(cur.line); + var re = /-?\d+/g; + var match; + var start; + var end; + var numberStr; + var token; + while ((match = re.exec(lineStr)) !== null) { + token = match[0]; + start = match.index; + end = start + token.length; + if (cur.ch < end)break; + } + if (!actionArgs.backtrack && (end <= cur.ch))return; + if (token) { + var increment = actionArgs.increase ? 1 : -1; + var number = parseInt(token) + (increment * actionArgs.repeat); + var from = Pos(cur.line, start); + var to = Pos(cur.line, end); + numberStr = number.toString(); + cm.replaceRange(numberStr, from, to); + } else { + return; + } + cm.setCursor(Pos(cur.line, start + numberStr.length - 1)); + }, + repeatLastEdit: function(cm, actionArgs, vim) { + var lastEditInputState = vim.lastEditInputState; + if (!lastEditInputState) { return; } + var repeat = actionArgs.repeat; + if (repeat && actionArgs.repeatIsExplicit) { + vim.lastEditInputState.repeatOverride = repeat; + } else { + repeat = vim.lastEditInputState.repeatOverride || repeat; + } + repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */); + }, + exitInsertMode: exitInsertMode + }; + + function defineAction(name, fn) { + actions[name] = fn; + } + + /* + * Below are miscellaneous utility functions used by vim.js + */ + + /** + * Clips cursor to ensure that line is within the buffer's range + * If includeLineBreak is true, then allow cur.ch == lineLength. + */ + function clipCursorToContent(cm, cur, includeLineBreak) { + var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() ); + var maxCh = lineLength(cm, line) - 1; + maxCh = (includeLineBreak) ? maxCh + 1 : maxCh; + var ch = Math.min(Math.max(0, cur.ch), maxCh); + return Pos(line, ch); + } + function copyArgs(args) { + var ret = {}; + for (var prop in args) { + if (args.hasOwnProperty(prop)) { + ret[prop] = args[prop]; + } + } + return ret; + } + function offsetCursor(cur, offsetLine, offsetCh) { + if (typeof offsetLine === 'object') { + offsetCh = offsetLine.ch; + offsetLine = offsetLine.line; + } + return Pos(cur.line + offsetLine, cur.ch + offsetCh); + } + function getOffset(anchor, head) { + return { + line: head.line - anchor.line, + ch: head.line - anchor.line + }; + } + function commandMatches(keys, keyMap, context, inputState) { + // Partial matches are not applied. They inform the key handler + // that the current key sequence is a subsequence of a valid key + // sequence, so that the key buffer is not cleared. + var match, partial = [], full = []; + for (var i = 0; i < keyMap.length; i++) { + var command = keyMap[i]; + if (context == 'insert' && command.context != 'insert' || + command.context && command.context != context || + inputState.operator && command.type == 'action' || + !(match = commandMatch(keys, command.keys))) { continue; } + if (match == 'partial') { partial.push(command); } + if (match == 'full') { full.push(command); } + } + return { + partial: partial.length && partial, + full: full.length && full + }; + } + function commandMatch(pressed, mapped) { + if (mapped.slice(-11) == '') { + // Last character matches anything. + var prefixLen = mapped.length - 11; + var pressedPrefix = pressed.slice(0, prefixLen); + var mappedPrefix = mapped.slice(0, prefixLen); + return pressedPrefix == mappedPrefix && pressed.length > prefixLen ? 'full' : + mappedPrefix.indexOf(pressedPrefix) == 0 ? 'partial' : false; + } else { + return pressed == mapped ? 'full' : + mapped.indexOf(pressed) == 0 ? 'partial' : false; + } + } + function lastChar(keys) { + var match = /^.*(<[\w\-]+>)$/.exec(keys); + var selectedCharacter = match ? match[1] : keys.slice(-1); + if (selectedCharacter.length > 1){ + switch(selectedCharacter){ + case '': + selectedCharacter='\n'; + break; + case '': + selectedCharacter=' '; + break; + default: + break; + } + } + return selectedCharacter; + } + function repeatFn(cm, fn, repeat) { + return function() { + for (var i = 0; i < repeat; i++) { + fn(cm); + } + }; + } + function copyCursor(cur) { + return Pos(cur.line, cur.ch); + } + function cursorEqual(cur1, cur2) { + return cur1.ch == cur2.ch && cur1.line == cur2.line; + } + function cursorIsBefore(cur1, cur2) { + if (cur1.line < cur2.line) { + return true; + } + if (cur1.line == cur2.line && cur1.ch < cur2.ch) { + return true; + } + return false; + } + function cursorMin(cur1, cur2) { + if (arguments.length > 2) { + cur2 = cursorMin.apply(undefined, Array.prototype.slice.call(arguments, 1)); + } + return cursorIsBefore(cur1, cur2) ? cur1 : cur2; + } + function cursorMax(cur1, cur2) { + if (arguments.length > 2) { + cur2 = cursorMax.apply(undefined, Array.prototype.slice.call(arguments, 1)); + } + return cursorIsBefore(cur1, cur2) ? cur2 : cur1; + } + function cursorIsBetween(cur1, cur2, cur3) { + // returns true if cur2 is between cur1 and cur3. + var cur1before2 = cursorIsBefore(cur1, cur2); + var cur2before3 = cursorIsBefore(cur2, cur3); + return cur1before2 && cur2before3; + } + function lineLength(cm, lineNum) { + return cm.getLine(lineNum).length; + } + function reverse(s){ + return s.split('').reverse().join(''); + } + function trim(s) { + if (s.trim) { + return s.trim(); + } + return s.replace(/^\s+|\s+$/g, ''); + } + function escapeRegex(s) { + return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1'); + } + function extendLineToColumn(cm, lineNum, column) { + var endCh = lineLength(cm, lineNum); + var spaces = new Array(column-endCh+1).join(' '); + cm.setCursor(Pos(lineNum, endCh)); + cm.replaceRange(spaces, cm.getCursor()); + } + // This functions selects a rectangular block + // of text with selectionEnd as any of its corner + // Height of block: + // Difference in selectionEnd.line and first/last selection.line + // Width of the block: + // Distance between selectionEnd.ch and any(first considered here) selection.ch + function selectBlock(cm, selectionEnd) { + var selections = [], ranges = cm.listSelections(); + var head = copyCursor(cm.clipPos(selectionEnd)); + var isClipped = !cursorEqual(selectionEnd, head); + var curHead = cm.getCursor('head'); + var primIndex = getIndex(ranges, curHead); + var wasClipped = cursorEqual(ranges[primIndex].head, ranges[primIndex].anchor); + var max = ranges.length - 1; + var index = max - primIndex > primIndex ? max : 0; + var base = ranges[index].anchor; + + var firstLine = Math.min(base.line, head.line); + var lastLine = Math.max(base.line, head.line); + var baseCh = base.ch, headCh = head.ch; + + var dir = ranges[index].head.ch - baseCh; + var newDir = headCh - baseCh; + if (dir > 0 && newDir <= 0) { + baseCh++; + if (!isClipped) { headCh--; } + } else if (dir < 0 && newDir >= 0) { + baseCh--; + if (!wasClipped) { headCh++; } + } else if (dir < 0 && newDir == -1) { + baseCh--; + headCh++; + } + for (var line = firstLine; line <= lastLine; line++) { + var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)}; + selections.push(range); + } + primIndex = head.line == lastLine ? selections.length - 1 : 0; + cm.setSelections(selections); + selectionEnd.ch = headCh; + base.ch = baseCh; + return base; + } + function selectForInsert(cm, head, height) { + var sel = []; + for (var i = 0; i < height; i++) { + var lineHead = offsetCursor(head, i, 0); + sel.push({anchor: lineHead, head: lineHead}); + } + cm.setSelections(sel, 0); + } + // getIndex returns the index of the cursor in the selections. + function getIndex(ranges, cursor, end) { + for (var i = 0; i < ranges.length; i++) { + var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor); + var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor); + if (atAnchor || atHead) { + return i; + } + } + return -1; + } + function getSelectedAreaRange(cm, vim) { + var lastSelection = vim.lastSelection; + var getCurrentSelectedAreaRange = function() { + var selections = cm.listSelections(); + var start = selections[0]; + var end = selections[selections.length-1]; + var selectionStart = cursorIsBefore(start.anchor, start.head) ? start.anchor : start.head; + var selectionEnd = cursorIsBefore(end.anchor, end.head) ? end.head : end.anchor; + return [selectionStart, selectionEnd]; + }; + var getLastSelectedAreaRange = function() { + var selectionStart = cm.getCursor(); + var selectionEnd = cm.getCursor(); + var block = lastSelection.visualBlock; + if (block) { + var width = block.width; + var height = block.height; + selectionEnd = Pos(selectionStart.line + height, selectionStart.ch + width); + var selections = []; + // selectBlock creates a 'proper' rectangular block. + // We do not want that in all cases, so we manually set selections. + for (var i = selectionStart.line; i < selectionEnd.line; i++) { + var anchor = Pos(i, selectionStart.ch); + var head = Pos(i, selectionEnd.ch); + var range = {anchor: anchor, head: head}; + selections.push(range); + } + cm.setSelections(selections); + } else { + var start = lastSelection.anchorMark.find(); + var end = lastSelection.headMark.find(); + var line = end.line - start.line; + var ch = end.ch - start.ch; + selectionEnd = {line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch}; + if (lastSelection.visualLine) { + selectionStart = Pos(selectionStart.line, 0); + selectionEnd = Pos(selectionEnd.line, lineLength(cm, selectionEnd.line)); + } + cm.setSelection(selectionStart, selectionEnd); + } + return [selectionStart, selectionEnd]; + }; + if (!vim.visualMode) { + // In case of replaying the action. + return getLastSelectedAreaRange(); + } else { + return getCurrentSelectedAreaRange(); + } + } + // Updates the previous selection with the current selection's values. This + // should only be called in visual mode. + function updateLastSelection(cm, vim) { + var anchor = vim.sel.anchor; + var head = vim.sel.head; + // To accommodate the effect of lastPastedText in the last selection + if (vim.lastPastedText) { + head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length); + vim.lastPastedText = null; + } + vim.lastSelection = {'anchorMark': cm.setBookmark(anchor), + 'headMark': cm.setBookmark(head), + 'anchor': copyCursor(anchor), + 'head': copyCursor(head), + 'visualMode': vim.visualMode, + 'visualLine': vim.visualLine, + 'visualBlock': vim.visualBlock}; + } + function expandSelection(cm, start, end) { + var sel = cm.state.vim.sel; + var head = sel.head; + var anchor = sel.anchor; + var tmp; + if (cursorIsBefore(end, start)) { + tmp = end; + end = start; + start = tmp; + } + if (cursorIsBefore(head, anchor)) { + head = cursorMin(start, head); + anchor = cursorMax(anchor, end); + } else { + anchor = cursorMin(start, anchor); + head = cursorMax(head, end); + head = offsetCursor(head, 0, -1); + if (head.ch == -1 && head.line != cm.firstLine()) { + head = Pos(head.line - 1, lineLength(cm, head.line - 1)); + } + } + return [anchor, head]; + } + /** + * Updates the CodeMirror selection to match the provided vim selection. + * If no arguments are given, it uses the current vim selection state. + */ + function updateCmSelection(cm, sel, mode) { + var vim = cm.state.vim; + sel = sel || vim.sel; + var mode = mode || + vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char'; + var cmSel = makeCmSelection(cm, sel, mode); + cm.setSelections(cmSel.ranges, cmSel.primary); + updateFakeCursor(cm); + } + function makeCmSelection(cm, sel, mode, exclusive) { + var head = copyCursor(sel.head); + var anchor = copyCursor(sel.anchor); + if (mode == 'char') { + var headOffset = !exclusive && !cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; + var anchorOffset = cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; + head = offsetCursor(sel.head, 0, headOffset); + anchor = offsetCursor(sel.anchor, 0, anchorOffset); + return { + ranges: [{anchor: anchor, head: head}], + primary: 0 + }; + } else if (mode == 'line') { + if (!cursorIsBefore(sel.head, sel.anchor)) { + anchor.ch = 0; + + var lastLine = cm.lastLine(); + if (head.line > lastLine) { + head.line = lastLine; + } + head.ch = lineLength(cm, head.line); + } else { + head.ch = 0; + anchor.ch = lineLength(cm, anchor.line); + } + return { + ranges: [{anchor: anchor, head: head}], + primary: 0 + }; + } else if (mode == 'block') { + var top = Math.min(anchor.line, head.line), + left = Math.min(anchor.ch, head.ch), + bottom = Math.max(anchor.line, head.line), + right = Math.max(anchor.ch, head.ch) + 1; + var height = bottom - top + 1; + var primary = head.line == top ? 0 : height - 1; + var ranges = []; + for (var i = 0; i < height; i++) { + ranges.push({ + anchor: Pos(top + i, left), + head: Pos(top + i, right) + }); + } + return { + ranges: ranges, + primary: primary + }; + } + } + function getHead(cm) { + var cur = cm.getCursor('head'); + if (cm.getSelection().length == 1) { + // Small corner case when only 1 character is selected. The "real" + // head is the left of head and anchor. + cur = cursorMin(cur, cm.getCursor('anchor')); + } + return cur; + } + + /** + * If moveHead is set to false, the CodeMirror selection will not be + * touched. The caller assumes the responsibility of putting the cursor + * in the right place. + */ + function exitVisualMode(cm, moveHead) { + var vim = cm.state.vim; + if (moveHead !== false) { + cm.setCursor(clipCursorToContent(cm, vim.sel.head)); + } + updateLastSelection(cm, vim); + vim.visualMode = false; + vim.visualLine = false; + vim.visualBlock = false; + CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); + if (vim.fakeCursor) { + vim.fakeCursor.clear(); + } + } + + // Remove any trailing newlines from the selection. For + // example, with the caret at the start of the last word on the line, + // 'dw' should word, but not the newline, while 'w' should advance the + // caret to the first character of the next line. + function clipToLine(cm, curStart, curEnd) { + var selection = cm.getRange(curStart, curEnd); + // Only clip if the selection ends with trailing newline + whitespace + if (/\n\s*$/.test(selection)) { + var lines = selection.split('\n'); + // We know this is all whitepsace. + lines.pop(); + + // Cases: + // 1. Last word is an empty line - do not clip the trailing '\n' + // 2. Last word is not an empty line - clip the trailing '\n' + var line; + // Find the line containing the last word, and clip all whitespace up + // to it. + for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) { + curEnd.line--; + curEnd.ch = 0; + } + // If the last word is not an empty line, clip an additional newline + if (line) { + curEnd.line--; + curEnd.ch = lineLength(cm, curEnd.line); + } else { + curEnd.ch = 0; + } + } + } + + // Expand the selection to line ends. + function expandSelectionToLine(_cm, curStart, curEnd) { + curStart.ch = 0; + curEnd.ch = 0; + curEnd.line++; + } + + function findFirstNonWhiteSpaceCharacter(text) { + if (!text) { + return 0; + } + var firstNonWS = text.search(/\S/); + return firstNonWS == -1 ? text.length : firstNonWS; + } + + function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) { + var cur = getHead(cm); + var line = cm.getLine(cur.line); + var idx = cur.ch; + + // Seek to first word or non-whitespace character, depending on if + // noSymbol is true. + var textAfterIdx = line.substring(idx); + var firstMatchedChar; + if (noSymbol) { + firstMatchedChar = textAfterIdx.search(/\w/); + } else { + firstMatchedChar = textAfterIdx.search(/\S/); + } + if (firstMatchedChar == -1) { + return null; + } + idx += firstMatchedChar; + textAfterIdx = line.substring(idx); + var textBeforeIdx = line.substring(0, idx); + + var matchRegex; + // Greedy matchers for the "word" we are trying to expand. + if (bigWord) { + matchRegex = /^\S+/; + } else { + if ((/\w/).test(line.charAt(idx))) { + matchRegex = /^\w+/; + } else { + matchRegex = /^[^\w\s]+/; + } + } + + var wordAfterRegex = matchRegex.exec(textAfterIdx); + var wordStart = idx; + var wordEnd = idx + wordAfterRegex[0].length; + // TODO: Find a better way to do this. It will be slow on very long lines. + var revTextBeforeIdx = reverse(textBeforeIdx); + var wordBeforeRegex = matchRegex.exec(revTextBeforeIdx); + if (wordBeforeRegex) { + wordStart -= wordBeforeRegex[0].length; + } + + if (inclusive) { + // If present, trim all whitespace after word. + // Otherwise, trim all whitespace before word. + var textAfterWordEnd = line.substring(wordEnd); + var whitespacesAfterWord = textAfterWordEnd.match(/^\s*/)[0].length; + if (whitespacesAfterWord > 0) { + wordEnd += whitespacesAfterWord; + } else { + var revTrim = revTextBeforeIdx.length - wordStart; + var textBeforeWordStart = revTextBeforeIdx.substring(revTrim); + var whitespacesBeforeWord = textBeforeWordStart.match(/^\s*/)[0].length; + wordStart -= whitespacesBeforeWord; + } + } + + return { start: Pos(cur.line, wordStart), + end: Pos(cur.line, wordEnd) }; + } + + function recordJumpPosition(cm, oldCur, newCur) { + if (!cursorEqual(oldCur, newCur)) { + vimGlobalState.jumpList.add(cm, oldCur, newCur); + } + } + + function recordLastCharacterSearch(increment, args) { + vimGlobalState.lastChararacterSearch.increment = increment; + vimGlobalState.lastChararacterSearch.forward = args.forward; + vimGlobalState.lastChararacterSearch.selectedCharacter = args.selectedCharacter; + } + + var symbolToMode = { + '(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket', + '[': 'section', ']': 'section', + '*': 'comment', '/': 'comment', + 'm': 'method', 'M': 'method', + '#': 'preprocess' + }; + var findSymbolModes = { + bracket: { + isComplete: function(state) { + if (state.nextCh === state.symb) { + state.depth++; + if (state.depth >= 1)return true; + } else if (state.nextCh === state.reverseSymb) { + state.depth--; + } + return false; + } + }, + section: { + init: function(state) { + state.curMoveThrough = true; + state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}'; + }, + isComplete: function(state) { + return state.index === 0 && state.nextCh === state.symb; + } + }, + comment: { + isComplete: function(state) { + var found = state.lastCh === '*' && state.nextCh === '/'; + state.lastCh = state.nextCh; + return found; + } + }, + // TODO: The original Vim implementation only operates on level 1 and 2. + // The current implementation doesn't check for code block level and + // therefore it operates on any levels. + method: { + init: function(state) { + state.symb = (state.symb === 'm' ? '{' : '}'); + state.reverseSymb = state.symb === '{' ? '}' : '{'; + }, + isComplete: function(state) { + if (state.nextCh === state.symb)return true; + return false; + } + }, + preprocess: { + init: function(state) { + state.index = 0; + }, + isComplete: function(state) { + if (state.nextCh === '#') { + var token = state.lineText.match(/#(\w+)/)[1]; + if (token === 'endif') { + if (state.forward && state.depth === 0) { + return true; + } + state.depth++; + } else if (token === 'if') { + if (!state.forward && state.depth === 0) { + return true; + } + state.depth--; + } + if (token === 'else' && state.depth === 0)return true; + } + return false; + } + } + }; + function findSymbol(cm, repeat, forward, symb) { + var cur = copyCursor(cm.getCursor()); + var increment = forward ? 1 : -1; + var endLine = forward ? cm.lineCount() : -1; + var curCh = cur.ch; + var line = cur.line; + var lineText = cm.getLine(line); + var state = { + lineText: lineText, + nextCh: lineText.charAt(curCh), + lastCh: null, + index: curCh, + symb: symb, + reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb], + forward: forward, + depth: 0, + curMoveThrough: false + }; + var mode = symbolToMode[symb]; + if (!mode)return cur; + var init = findSymbolModes[mode].init; + var isComplete = findSymbolModes[mode].isComplete; + if (init) { init(state); } + while (line !== endLine && repeat) { + state.index += increment; + state.nextCh = state.lineText.charAt(state.index); + if (!state.nextCh) { + line += increment; + state.lineText = cm.getLine(line) || ''; + if (increment > 0) { + state.index = 0; + } else { + var lineLen = state.lineText.length; + state.index = (lineLen > 0) ? (lineLen-1) : 0; + } + state.nextCh = state.lineText.charAt(state.index); + } + if (isComplete(state)) { + cur.line = line; + cur.ch = state.index; + repeat--; + } + } + if (state.nextCh || state.curMoveThrough) { + return Pos(line, state.index); + } + return cur; + } + + /* + * Returns the boundaries of the next word. If the cursor in the middle of + * the word, then returns the boundaries of the current word, starting at + * the cursor. If the cursor is at the start/end of a word, and we are going + * forward/backward, respectively, find the boundaries of the next word. + * + * @param {CodeMirror} cm CodeMirror object. + * @param {Cursor} cur The cursor position. + * @param {boolean} forward True to search forward. False to search + * backward. + * @param {boolean} bigWord True if punctuation count as part of the word. + * False if only [a-zA-Z0-9] characters count as part of the word. + * @param {boolean} emptyLineIsWord True if empty lines should be treated + * as words. + * @return {Object{from:number, to:number, line: number}} The boundaries of + * the word, or null if there are no more words. + */ + function findWord(cm, cur, forward, bigWord, emptyLineIsWord) { + var lineNum = cur.line; + var pos = cur.ch; + var line = cm.getLine(lineNum); + var dir = forward ? 1 : -1; + var regexps = bigWord ? bigWordRegexp : wordRegexp; + + if (emptyLineIsWord && line == '') { + lineNum += dir; + line = cm.getLine(lineNum); + if (!isLine(cm, lineNum)) { + return null; + } + pos = (forward) ? 0 : line.length; + } + + while (true) { + if (emptyLineIsWord && line == '') { + return { from: 0, to: 0, line: lineNum }; + } + var stop = (dir > 0) ? line.length : -1; + var wordStart = stop, wordEnd = stop; + // Find bounds of next word. + while (pos != stop) { + var foundWord = false; + for (var i = 0; i < regexps.length && !foundWord; ++i) { + if (regexps[i].test(line.charAt(pos))) { + wordStart = pos; + // Advance to end of word. + while (pos != stop && regexps[i].test(line.charAt(pos))) { + pos += dir; + } + wordEnd = pos; + foundWord = wordStart != wordEnd; + if (wordStart == cur.ch && lineNum == cur.line && + wordEnd == wordStart + dir) { + // We started at the end of a word. Find the next one. + continue; + } else { + return { + from: Math.min(wordStart, wordEnd + 1), + to: Math.max(wordStart, wordEnd), + line: lineNum }; + } + } + } + if (!foundWord) { + pos += dir; + } + } + // Advance to next/prev line. + lineNum += dir; + if (!isLine(cm, lineNum)) { + return null; + } + line = cm.getLine(lineNum); + pos = (dir > 0) ? 0 : line.length; + } + // Should never get here. + throw new Error('The impossible happened.'); + } + + /** + * @param {CodeMirror} cm CodeMirror object. + * @param {Pos} cur The position to start from. + * @param {int} repeat Number of words to move past. + * @param {boolean} forward True to search forward. False to search + * backward. + * @param {boolean} wordEnd True to move to end of word. False to move to + * beginning of word. + * @param {boolean} bigWord True if punctuation count as part of the word. + * False if only alphabet characters count as part of the word. + * @return {Cursor} The position the cursor should move to. + */ + function moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) { + var curStart = copyCursor(cur); + var words = []; + if (forward && !wordEnd || !forward && wordEnd) { + repeat++; + } + // For 'e', empty lines are not considered words, go figure. + var emptyLineIsWord = !(forward && wordEnd); + for (var i = 0; i < repeat; i++) { + var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord); + if (!word) { + var eodCh = lineLength(cm, cm.lastLine()); + words.push(forward + ? {line: cm.lastLine(), from: eodCh, to: eodCh} + : {line: 0, from: 0, to: 0}); + break; + } + words.push(word); + cur = Pos(word.line, forward ? (word.to - 1) : word.from); + } + var shortCircuit = words.length != repeat; + var firstWord = words[0]; + var lastWord = words.pop(); + if (forward && !wordEnd) { + // w + if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) { + // We did not start in the middle of a word. Discard the extra word at the end. + lastWord = words.pop(); + } + return Pos(lastWord.line, lastWord.from); + } else if (forward && wordEnd) { + return Pos(lastWord.line, lastWord.to - 1); + } else if (!forward && wordEnd) { + // ge + if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) { + // We did not start in the middle of a word. Discard the extra word at the end. + lastWord = words.pop(); + } + return Pos(lastWord.line, lastWord.to); + } else { + // b + return Pos(lastWord.line, lastWord.from); + } + } + + function moveToCharacter(cm, repeat, forward, character) { + var cur = cm.getCursor(); + var start = cur.ch; + var idx; + for (var i = 0; i < repeat; i ++) { + var line = cm.getLine(cur.line); + idx = charIdxInLine(start, line, character, forward, true); + if (idx == -1) { + return null; + } + start = idx; + } + return Pos(cm.getCursor().line, idx); + } + + function moveToColumn(cm, repeat) { + // repeat is always >= 1, so repeat - 1 always corresponds + // to the column we want to go to. + var line = cm.getCursor().line; + return clipCursorToContent(cm, Pos(line, repeat - 1)); + } + + function updateMark(cm, vim, markName, pos) { + if (!inArray(markName, validMarks)) { + return; + } + if (vim.marks[markName]) { + vim.marks[markName].clear(); + } + vim.marks[markName] = cm.setBookmark(pos); + } + + function charIdxInLine(start, line, character, forward, includeChar) { + // Search for char in line. + // motion_options: {forward, includeChar} + // If includeChar = true, include it too. + // If forward = true, search forward, else search backwards. + // If char is not found on this line, do nothing + var idx; + if (forward) { + idx = line.indexOf(character, start + 1); + if (idx != -1 && !includeChar) { + idx -= 1; + } + } else { + idx = line.lastIndexOf(character, start - 1); + if (idx != -1 && !includeChar) { + idx += 1; + } + } + return idx; + } + + function findParagraph(cm, head, repeat, dir, inclusive) { + var line = head.line; + var min = cm.firstLine(); + var max = cm.lastLine(); + var start, end, i = line; + function isEmpty(i) { return !cm.getLine(i); } + function isBoundary(i, dir, any) { + if (any) { return isEmpty(i) != isEmpty(i + dir); } + return !isEmpty(i) && isEmpty(i + dir); + } + if (dir) { + while (min <= i && i <= max && repeat > 0) { + if (isBoundary(i, dir)) { repeat--; } + i += dir; + } + return new Pos(i, 0); + } + + var vim = cm.state.vim; + if (vim.visualLine && isBoundary(line, 1, true)) { + var anchor = vim.sel.anchor; + if (isBoundary(anchor.line, -1, true)) { + if (!inclusive || anchor.line != line) { + line += 1; + } + } + } + var startState = isEmpty(line); + for (i = line; i <= max && repeat; i++) { + if (isBoundary(i, 1, true)) { + if (!inclusive || isEmpty(i) != startState) { + repeat--; + } + } + } + end = new Pos(i, 0); + // select boundary before paragraph for the last one + if (i > max && !startState) { startState = true; } + else { inclusive = false; } + for (i = line; i > min; i--) { + if (!inclusive || isEmpty(i) == startState || i == line) { + if (isBoundary(i, -1, true)) { break; } + } + } + start = new Pos(i, 0); + return { start: start, end: end }; + } + + // TODO: perhaps this finagling of start and end positions belonds + // in codmirror/replaceRange? + function selectCompanionObject(cm, head, symb, inclusive) { + var cur = head, start, end; + + var bracketRegexp = ({ + '(': /[()]/, ')': /[()]/, + '[': /[[\]]/, ']': /[[\]]/, + '{': /[{}]/, '}': /[{}]/})[symb]; + var openSym = ({ + '(': '(', ')': '(', + '[': '[', ']': '[', + '{': '{', '}': '{'})[symb]; + var curChar = cm.getLine(cur.line).charAt(cur.ch); + // Due to the behavior of scanForBracket, we need to add an offset if the + // 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}); + + if (!start || !end) { + return { start: cur, end: cur }; + } + + start = start.pos; + end = end.pos; + + if ((start.line == end.line && start.ch > end.ch) + || (start.line > end.line)) { + var tmp = start; + start = end; + end = tmp; + } + + if (inclusive) { + end.ch += 1; + } else { + start.ch += 1; + } + + return { start: start, end: end }; + } + + // Takes in a symbol and a cursor and tries to simulate text objects that + // have identical opening and closing symbols + // TODO support across multiple lines + function findBeginningAndEnd(cm, head, symb, inclusive) { + var cur = copyCursor(head); + var line = cm.getLine(cur.line); + var chars = line.split(''); + var start, end, i, len; + var firstIndex = chars.indexOf(symb); + + // the decision tree is to always look backwards for the beginning first, + // but if the cursor is in front of the first instance of the symb, + // then move the cursor forward + if (cur.ch < firstIndex) { + cur.ch = firstIndex; + // Why is this line even here??? + // cm.setCursor(cur.line, firstIndex+1); + } + // otherwise if the cursor is currently on the closing symbol + else if (firstIndex < cur.ch && chars[cur.ch] == symb) { + end = cur.ch; // assign end to the current cursor + --cur.ch; // make sure to look backwards + } + + // if we're currently on the symbol, we've got a start + if (chars[cur.ch] == symb && !end) { + start = cur.ch + 1; // assign start to ahead of the cursor + } else { + // go backwards to find the start + for (i = cur.ch; i > -1 && !start; i--) { + if (chars[i] == symb) { + start = i + 1; + } + } + } + + // look forwards for the end symbol + if (start && !end) { + for (i = start, len = chars.length; i < len && !end; i++) { + if (chars[i] == symb) { + end = i; + } + } + } + + // nothing found + if (!start || !end) { + return { start: cur, end: cur }; + } + + // include the symbols + if (inclusive) { + --start; ++end; + } + + return { + start: Pos(cur.line, start), + end: Pos(cur.line, end) + }; + } + + // Search functions + defineOption('pcre', true, 'boolean'); + function SearchState() {} + SearchState.prototype = { + getQuery: function() { + return vimGlobalState.query; + }, + setQuery: function(query) { + vimGlobalState.query = query; + }, + getOverlay: function() { + return this.searchOverlay; + }, + setOverlay: function(overlay) { + this.searchOverlay = overlay; + }, + isReversed: function() { + return vimGlobalState.isReversed; + }, + setReversed: function(reversed) { + vimGlobalState.isReversed = reversed; + }, + getScrollbarAnnotate: function() { + return this.annotate; + }, + setScrollbarAnnotate: function(annotate) { + this.annotate = annotate; + } + }; + function getSearchState(cm) { + var vim = cm.state.vim; + return vim.searchState_ || (vim.searchState_ = new SearchState()); + } + function dialog(cm, template, shortText, onClose, options) { + if (cm.openDialog) { + cm.openDialog(template, onClose, { bottom: true, value: options.value, + onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp }); + } + else { + onClose(prompt(shortText, '')); + } + } + function splitBySlash(argString) { + var slashes = findUnescapedSlashes(argString) || []; + if (!slashes.length) return []; + var tokens = []; + // in case of strings like foo/bar + if (slashes[0] !== 0) return; + for (var i = 0; i < slashes.length; i++) { + if (typeof slashes[i] == 'number') + tokens.push(argString.substring(slashes[i] + 1, slashes[i+1])); + } + return tokens; + } + + function findUnescapedSlashes(str) { + var escapeNextChar = false; + var slashes = []; + for (var i = 0; i < str.length; i++) { + var c = str.charAt(i); + if (!escapeNextChar && c == '/') { + slashes.push(i); + } + escapeNextChar = !escapeNextChar && (c == '\\'); + } + return slashes; + } + + // Translates a search string from ex (vim) syntax into javascript form. + function translateRegex(str) { + // When these match, add a '\' if unescaped or remove one if escaped. + var specials = '|(){'; + // Remove, but never add, a '\' for these. + var unescape = '}'; + var escapeNextChar = false; + var out = []; + for (var i = -1; i < str.length; i++) { + var c = str.charAt(i) || ''; + var n = str.charAt(i+1) || ''; + var specialComesNext = (n && specials.indexOf(n) != -1); + if (escapeNextChar) { + if (c !== '\\' || !specialComesNext) { + out.push(c); + } + escapeNextChar = false; + } else { + if (c === '\\') { + escapeNextChar = true; + // Treat the unescape list as special for removing, but not adding '\'. + if (n && unescape.indexOf(n) != -1) { + specialComesNext = true; + } + // Not passing this test means removing a '\'. + if (!specialComesNext || n === '\\') { + out.push(c); + } + } else { + out.push(c); + if (specialComesNext && n !== '\\') { + out.push('\\'); + } + } + } + } + return out.join(''); + } + + // Translates the replace part of a search and replace from ex (vim) syntax into + // javascript form. Similar to translateRegex, but additionally fixes back references + // (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'. + function translateRegexReplace(str) { + var escapeNextChar = false; + var out = []; + for (var i = -1; i < str.length; i++) { + var c = str.charAt(i) || ''; + var n = str.charAt(i+1) || ''; + if (escapeNextChar) { + // At any point in the loop, escapeNextChar is true if the previous + // character was a '\' and was not escaped. + out.push(c); + escapeNextChar = false; + } else { + if (c === '\\') { + escapeNextChar = true; + if ((isNumber(n) || n === '$')) { + out.push('$'); + } else if (n !== '/' && n !== '\\') { + out.push('\\'); + } + } else { + if (c === '$') { + out.push('$'); + } + out.push(c); + if (n === '/') { + out.push('\\'); + } + } + } + } + return out.join(''); + } + + // Unescape \ and / in the replace part, for PCRE mode. + function unescapeRegexReplace(str) { + var stream = new CodeMirror.StringStream(str); + var output = []; + while (!stream.eol()) { + // Search for \. + while (stream.peek() && stream.peek() != '\\') { + output.push(stream.next()); + } + if (stream.match('\\/', true)) { + // \/ => / + output.push('/'); + } else if (stream.match('\\\\', true)) { + // \\ => \ + output.push('\\'); + } else { + // Don't change anything + output.push(stream.next()); + } + } + return output.join(''); + } + + /** + * Extract the regular expression from the query and return a Regexp object. + * Returns null if the query is blank. + * If ignoreCase is passed in, the Regexp object will have the 'i' flag set. + * If smartCase is passed in, and the query contains upper case letters, + * then ignoreCase is overridden, and the 'i' flag will not be set. + * If the query contains the /i in the flag part of the regular expression, + * then both ignoreCase and smartCase are ignored, and 'i' will be passed + * through to the Regex object. + */ + function parseQuery(query, ignoreCase, smartCase) { + // First update the last search register + var lastSearchRegister = vimGlobalState.registerController.getRegister('/'); + lastSearchRegister.setText(query); + // Check if the query is already a regex. + if (query instanceof RegExp) { return query; } + // First try to extract regex + flags from the input. If no flags found, + // extract just the regex. IE does not accept flags directly defined in + // the regex string in the form /regex/flags + var slashes = findUnescapedSlashes(query); + var regexPart; + var forceIgnoreCase; + if (!slashes.length) { + // Query looks like 'regexp' + regexPart = query; + } else { + // Query looks like 'regexp/...' + regexPart = query.substring(0, slashes[0]); + var flagsPart = query.substring(slashes[0]); + forceIgnoreCase = (flagsPart.indexOf('i') != -1); + } + if (!regexPart) { + return null; + } + if (!getOption('pcre')) { + regexPart = translateRegex(regexPart); + } + if (smartCase) { + ignoreCase = (/^[^A-Z]*$/).test(regexPart); + } + var regexp = new RegExp(regexPart, + (ignoreCase || forceIgnoreCase) ? 'i' : undefined); + return regexp; + } + function showConfirm(cm, text) { + if (cm.openNotification) { + cm.openNotification('' + text + '', + {bottom: true, duration: 5000}); + } else { + alert(text); + } + } + function makePrompt(prefix, desc) { + var raw = ''; + if (prefix) { + raw += '' + prefix + ''; + } + raw += ' ' + + ''; + if (desc) { + raw += ''; + raw += desc; + raw += ''; + } + return raw; + } + var searchPromptDesc = '(Javascript regexp)'; + function showPrompt(cm, options) { + var shortText = (options.prefix || '') + ' ' + (options.desc || ''); + var prompt = makePrompt(options.prefix, options.desc); + dialog(cm, prompt, shortText, options.onClose, options); + } + function regexEqual(r1, r2) { + if (r1 instanceof RegExp && r2 instanceof RegExp) { + var props = ['global', 'multiline', 'ignoreCase', 'source']; + for (var i = 0; i < props.length; i++) { + var prop = props[i]; + if (r1[prop] !== r2[prop]) { + return false; + } + } + return true; + } + return false; + } + // Returns true if the query is valid. + function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) { + if (!rawQuery) { + return; + } + var state = getSearchState(cm); + var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase); + if (!query) { + return; + } + highlightSearchMatches(cm, query); + if (regexEqual(query, state.getQuery())) { + return query; + } + state.setQuery(query); + return query; + } + function searchOverlay(query) { + if (query.source.charAt(0) == '^') { + var matchSol = true; + } + return { + token: function(stream) { + if (matchSol && !stream.sol()) { + stream.skipToEnd(); + return; + } + var match = stream.match(query, false); + if (match) { + if (match[0].length == 0) { + // Matched empty string, skip to next. + stream.next(); + return 'searching'; + } + if (!stream.sol()) { + // Backtrack 1 to match \b + stream.backUp(1); + if (!query.exec(stream.next() + match[0])) { + stream.next(); + return null; + } + } + stream.match(query); + return 'searching'; + } + while (!stream.eol()) { + stream.next(); + if (stream.match(query, false)) break; + } + }, + query: query + }; + } + function highlightSearchMatches(cm, query) { + var searchState = getSearchState(cm); + var overlay = searchState.getOverlay(); + if (!overlay || query != overlay.query) { + if (overlay) { + cm.removeOverlay(overlay); + } + overlay = searchOverlay(query); + cm.addOverlay(overlay); + if (cm.showMatchesOnScrollbar) { + if (searchState.getScrollbarAnnotate()) { + searchState.getScrollbarAnnotate().clear(); + } + searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query)); + } + searchState.setOverlay(overlay); + } + } + function findNext(cm, prev, query, repeat) { + if (repeat === undefined) { repeat = 1; } + return cm.operation(function() { + var pos = cm.getCursor(); + var cursor = cm.getSearchCursor(query, pos); + for (var i = 0; i < repeat; i++) { + var found = cursor.find(prev); + if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); } + if (!found) { + // SearchCursor may have returned null because it hit EOF, wrap + // around and try again. + cursor = cm.getSearchCursor(query, + (prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) ); + if (!cursor.find(prev)) { + return; + } + } + } + return cursor.from(); + }); + } + function clearSearchHighlight(cm) { + var state = getSearchState(cm); + cm.removeOverlay(getSearchState(cm).getOverlay()); + state.setOverlay(null); + if (state.getScrollbarAnnotate()) { + state.getScrollbarAnnotate().clear(); + state.setScrollbarAnnotate(null); + } + } + /** + * Check if pos is in the specified range, INCLUSIVE. + * Range can be specified with 1 or 2 arguments. + * If the first range argument is an array, treat it as an array of line + * numbers. Match pos against any of the lines. + * If the first range argument is a number, + * if there is only 1 range argument, check if pos has the same line + * number + * if there are 2 range arguments, then check if pos is in between the two + * range arguments. + */ + function isInRange(pos, start, end) { + if (typeof pos != 'number') { + // Assume it is a cursor position. Get the line number. + pos = pos.line; + } + if (start instanceof Array) { + return inArray(pos, start); + } else { + if (end) { + return (pos >= start && pos <= end); + } else { + return pos == start; + } + } + } + function getUserVisibleLines(cm) { + var scrollInfo = cm.getScrollInfo(); + var occludeToleranceTop = 6; + var occludeToleranceBottom = 10; + var from = cm.coordsChar({left:0, top: occludeToleranceTop + scrollInfo.top}, 'local'); + var bottomY = scrollInfo.clientHeight - occludeToleranceBottom + scrollInfo.top; + var to = cm.coordsChar({left:0, top: bottomY}, 'local'); + return {top: from.line, bottom: to.line}; + } + + // Ex command handling + // Care must be taken when adding to the default Ex command map. For any + // pair of commands that have a shared prefix, at least one of their + // shortNames must not match the prefix of the other command. + var defaultExCommandMap = [ + { 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: 'set' }, + { name: 'sort', shortName: 'sor' }, + { name: 'substitute', shortName: 's', possiblyAsync: true }, + { name: 'nohlsearch', shortName: 'noh' }, + { name: 'delmarks', shortName: 'delm' }, + { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, + { name: 'global', shortName: 'g' } + ]; + var ExCommandDispatcher = function() { + this.buildCommandMap_(); + }; + ExCommandDispatcher.prototype = { + processCommand: function(cm, input, opt_params) { + var vim = cm.state.vim; + var commandHistoryRegister = vimGlobalState.registerController.getRegister(':'); + var previousCommand = commandHistoryRegister.toString(); + if (vim.visualMode) { + exitVisualMode(cm); + } + var inputStream = new CodeMirror.StringStream(input); + // update ": with the latest command whether valid or invalid + commandHistoryRegister.setText(input); + var params = opt_params || {}; + params.input = input; + try { + this.parseInput_(cm, inputStream, params); + } catch(e) { + showConfirm(cm, e); + throw e; + } + var command; + var commandName; + if (!params.commandName) { + // If only a line range is defined, move to the line. + if (params.line !== undefined) { + commandName = 'move'; + } + } else { + command = this.matchCommand_(params.commandName); + if (command) { + commandName = command.name; + if (command.excludeFromCommandHistory) { + commandHistoryRegister.setText(previousCommand); + } + this.parseCommandArgs_(inputStream, params, command); + if (command.type == 'exToKey') { + // Handle Ex to Key mapping. + for (var i = 0; i < command.toKeys.length; i++) { + CodeMirror.Vim.handleKey(cm, command.toKeys[i], 'mapping'); + } + return; + } else if (command.type == 'exToEx') { + // Handle Ex to Ex mapping. + this.processCommand(cm, command.toInput); + return; + } + } + } + if (!commandName) { + showConfirm(cm, 'Not an editor command ":' + input + '"'); + return; + } + try { + exCommands[commandName](cm, params); + // Possibly asynchronous commands (e.g. substitute, which might have a + // user confirmation), are responsible for calling the callback when + // done. All others have it taken care of for them here. + if ((!command || !command.possiblyAsync) && params.callback) { + params.callback(); + } + } catch(e) { + showConfirm(cm, e); + throw e; + } + }, + parseInput_: function(cm, inputStream, result) { + inputStream.eatWhile(':'); + // Parse range. + if (inputStream.eat('%')) { + result.line = cm.firstLine(); + result.lineEnd = cm.lastLine(); + } else { + result.line = this.parseLineSpec_(cm, inputStream); + if (result.line !== undefined && inputStream.eat(',')) { + result.lineEnd = this.parseLineSpec_(cm, inputStream); + } + } + + // Parse command name. + var commandMatch = inputStream.match(/^(\w+)/); + if (commandMatch) { + result.commandName = commandMatch[1]; + } else { + result.commandName = inputStream.match(/.*/)[0]; + } + + return result; + }, + parseLineSpec_: function(cm, inputStream) { + var numberMatch = inputStream.match(/^(\d+)/); + if (numberMatch) { + return parseInt(numberMatch[1], 10) - 1; + } + switch (inputStream.next()) { + case '.': + return cm.getCursor().line; + case '$': + return cm.lastLine(); + case '\'': + var mark = cm.state.vim.marks[inputStream.next()]; + if (mark && mark.find()) { + return mark.find().line; + } + throw new Error('Mark not set'); + default: + inputStream.backUp(1); + return undefined; + } + }, + parseCommandArgs_: function(inputStream, params, command) { + if (inputStream.eol()) { + return; + } + params.argString = inputStream.match(/.*/)[0]; + // Parse command-line arguments + var delim = command.argDelimiter || /\s+/; + var args = trim(params.argString).split(delim); + if (args.length && args[0]) { + params.args = args; + } + }, + matchCommand_: function(commandName) { + // Return the command in the command map that matches the shortest + // prefix of the passed in command name. The match is guaranteed to be + // unambiguous if the defaultExCommandMap's shortNames are set up + // correctly. (see @code{defaultExCommandMap}). + for (var i = commandName.length; i > 0; i--) { + var prefix = commandName.substring(0, i); + if (this.commandMap_[prefix]) { + var command = this.commandMap_[prefix]; + if (command.name.indexOf(commandName) === 0) { + return command; + } + } + } + return null; + }, + buildCommandMap_: function() { + this.commandMap_ = {}; + for (var i = 0; i < defaultExCommandMap.length; i++) { + var command = defaultExCommandMap[i]; + var key = command.shortName || command.name; + this.commandMap_[key] = command; + } + }, + map: function(lhs, rhs, ctx) { + if (lhs != ':' && lhs.charAt(0) == ':') { + if (ctx) { throw Error('Mode not supported for ex mappings'); } + var commandName = lhs.substring(1); + if (rhs != ':' && rhs.charAt(0) == ':') { + // Ex to Ex mapping + this.commandMap_[commandName] = { + name: commandName, + type: 'exToEx', + toInput: rhs.substring(1), + user: true + }; + } else { + // Ex to key mapping + this.commandMap_[commandName] = { + name: commandName, + type: 'exToKey', + toKeys: rhs, + user: true + }; + } + } else { + if (rhs != ':' && rhs.charAt(0) == ':') { + // Key to Ex mapping. + var mapping = { + keys: lhs, + type: 'keyToEx', + exArgs: { input: rhs.substring(1) }, + user: true}; + if (ctx) { mapping.context = ctx; } + defaultKeymap.unshift(mapping); + } else { + // Key to key mapping + var mapping = { + keys: lhs, + type: 'keyToKey', + toKeys: rhs, + user: true + }; + if (ctx) { mapping.context = ctx; } + defaultKeymap.unshift(mapping); + } + } + }, + unmap: function(lhs, ctx) { + if (lhs != ':' && lhs.charAt(0) == ':') { + // Ex to Ex or Ex to key mapping + if (ctx) { throw Error('Mode not supported for ex mappings'); } + var commandName = lhs.substring(1); + if (this.commandMap_[commandName] && this.commandMap_[commandName].user) { + delete this.commandMap_[commandName]; + return; + } + } else { + // Key to Ex or key to key mapping + var keys = lhs; + for (var i = 0; i < defaultKeymap.length; i++) { + if (keys == defaultKeymap[i].keys + && defaultKeymap[i].context === ctx + && defaultKeymap[i].user) { + defaultKeymap.splice(i, 1); + return; + } + } + } + throw Error('No such mapping.'); + } + }; + + var exCommands = { + map: function(cm, params, ctx) { + var mapArgs = params.args; + if (!mapArgs || mapArgs.length < 2) { + if (cm) { + showConfirm(cm, 'Invalid mapping: ' + params.input); + } + return; + } + exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx); + }, + imap: function(cm, params) { this.map(cm, params, 'insert'); }, + nmap: function(cm, params) { this.map(cm, params, 'normal'); }, + vmap: function(cm, params) { this.map(cm, params, 'visual'); }, + unmap: function(cm, params, ctx) { + var mapArgs = params.args; + if (!mapArgs || mapArgs.length < 1) { + if (cm) { + showConfirm(cm, 'No such mapping: ' + params.input); + } + return; + } + exCommandDispatcher.unmap(mapArgs[0], ctx); + }, + move: function(cm, params) { + commandDispatcher.processCommand(cm, cm.state.vim, { + type: 'motion', + motion: 'moveToLineOrEdgeOfDocument', + motionArgs: { forward: false, explicitRepeat: true, + linewise: true }, + repeatOverride: params.line+1}); + }, + set: function(cm, params) { + var setArgs = params.args; + if (!setArgs || setArgs.length < 1) { + if (cm) { + showConfirm(cm, 'Invalid mapping: ' + params.input); + } + return; + } + var expr = setArgs[0].split('='); + var optionName = expr[0]; + var value = expr[1]; + var forceGet = false; + + if (optionName.charAt(optionName.length - 1) == '?') { + // If post-fixed with ?, then the set is actually a get. + if (value) { throw Error('Trailing characters: ' + params.argString); } + optionName = optionName.substring(0, optionName.length - 1); + forceGet = true; + } + if (value === undefined && optionName.substring(0, 2) == 'no') { + // To set boolean options to false, the option name is prefixed with + // 'no'. + optionName = optionName.substring(2); + value = false; + } + var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean'; + if (optionIsBoolean && value == undefined) { + // Calling set with a boolean option sets it to true. + value = true; + } + if (!optionIsBoolean && !value || forceGet) { + var oldValue = getOption(optionName); + // If no value is provided, then we assume this is a get. + if (oldValue === true || oldValue === false) { + showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName); + } else { + showConfirm(cm, ' ' + optionName + '=' + oldValue); + } + } else { + setOption(optionName, value); + } + }, + registers: function(cm,params) { + var regArgs = params.args; + var registers = vimGlobalState.registerController.registers; + var regInfo = '----------Registers----------

'; + if (!regArgs) { + for (var registerName in registers) { + var text = registers[registerName].toString(); + if (text.length) { + regInfo += '"' + registerName + ' ' + text + '
'; + } + } + } else { + var registerName; + regArgs = regArgs.join(''); + for (var i = 0; i < regArgs.length; i++) { + registerName = regArgs.charAt(i); + if (!vimGlobalState.registerController.isValidRegister(registerName)) { + continue; + } + var register = registers[registerName] || new Register(); + regInfo += '"' + registerName + ' ' + register.toString() + '
'; + } + } + showConfirm(cm, regInfo); + }, + sort: function(cm, params) { + var reverse, ignoreCase, unique, number; + function parseArgs() { + if (params.argString) { + var args = new CodeMirror.StringStream(params.argString); + if (args.eat('!')) { reverse = true; } + if (args.eol()) { return; } + if (!args.eatSpace()) { return 'Invalid arguments'; } + var opts = args.match(/[a-z]+/); + if (opts) { + opts = opts[0]; + ignoreCase = opts.indexOf('i') != -1; + unique = opts.indexOf('u') != -1; + var decimal = opts.indexOf('d') != -1 && 1; + var hex = opts.indexOf('x') != -1 && 1; + var octal = opts.indexOf('o') != -1 && 1; + if (decimal + hex + octal > 1) { return 'Invalid arguments'; } + number = decimal && 'decimal' || hex && 'hex' || octal && 'octal'; + } + if (args.eatSpace() && args.match(/\/.*\//)) { 'patterns not supported'; } + } + } + var err = parseArgs(); + if (err) { + showConfirm(cm, err + ': ' + params.argString); + return; + } + var lineStart = params.line || cm.firstLine(); + var lineEnd = params.lineEnd || params.line || cm.lastLine(); + if (lineStart == lineEnd) { return; } + var curStart = Pos(lineStart, 0); + var curEnd = Pos(lineEnd, lineLength(cm, lineEnd)); + var text = cm.getRange(curStart, curEnd).split('\n'); + var numberRegex = (number == 'decimal') ? /(-?)([\d]+)/ : + (number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i : + (number == 'octal') ? /([0-7]+)/ : null; + var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null; + var numPart = [], textPart = []; + if (number) { + for (var i = 0; i < text.length; i++) { + if (numberRegex.exec(text[i])) { + numPart.push(text[i]); + } else { + textPart.push(text[i]); + } + } + } else { + textPart = text; + } + function compareFn(a, b) { + if (reverse) { var tmp; tmp = a; a = b; b = tmp; } + if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); } + var anum = number && numberRegex.exec(a); + var bnum = number && numberRegex.exec(b); + if (!anum) { return a < b ? -1 : 1; } + anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix); + bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix); + return anum - bnum; + } + numPart.sort(compareFn); + textPart.sort(compareFn); + text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart); + if (unique) { // Remove duplicate lines + var textOld = text; + var lastLine; + text = []; + for (var i = 0; i < textOld.length; i++) { + if (textOld[i] != lastLine) { + text.push(textOld[i]); + } + lastLine = textOld[i]; + } + } + cm.replaceRange(text.join('\n'), curStart, curEnd); + }, + global: function(cm, params) { + // a global command is of the form + // :[range]g/pattern/[cmd] + // argString holds the string /pattern/[cmd] + var argString = params.argString; + if (!argString) { + showConfirm(cm, 'Regular Expression missing from global'); + return; + } + // range is specified here + var lineStart = (params.line !== undefined) ? params.line : cm.firstLine(); + var lineEnd = params.lineEnd || params.line || cm.lastLine(); + // get the tokens from argString + var tokens = splitBySlash(argString); + var regexPart = argString, cmd; + if (tokens.length) { + regexPart = tokens[0]; + cmd = tokens.slice(1, tokens.length).join('/'); + } + if (regexPart) { + // If regex part is empty, then use the previous query. Otherwise + // use the regex part as the new query. + try { + updateSearchQuery(cm, regexPart, true /** ignoreCase */, + true /** smartCase */); + } catch (e) { + showConfirm(cm, 'Invalid regex: ' + regexPart); + return; + } + } + // now that we have the regexPart, search for regex matches in the + // specified range of lines + var query = getSearchState(cm).getQuery(); + var matchedLines = [], content = ''; + for (var i = lineStart; i <= lineEnd; i++) { + var matched = query.test(cm.getLine(i)); + if (matched) { + matchedLines.push(i+1); + content+= cm.getLine(i) + '
'; + } + } + // if there is no [cmd], just display the list of matched lines + if (!cmd) { + showConfirm(cm, content); + return; + } + var index = 0; + var nextCommand = function() { + if (index < matchedLines.length) { + var command = matchedLines[index] + cmd; + exCommandDispatcher.processCommand(cm, command, { + callback: nextCommand + }); + } + index++; + }; + nextCommand(); + }, + substitute: function(cm, params) { + if (!cm.getSearchCursor) { + throw new Error('Search feature not available. Requires searchcursor.js or ' + + 'any other getSearchCursor implementation.'); + } + var argString = params.argString; + var tokens = argString ? splitBySlash(argString) : []; + var regexPart, replacePart = '', trailing, flagsPart, count; + var confirm = false; // Whether to confirm each replace. + var global = false; // True to replace all instances on a line, false to replace only 1. + if (tokens.length) { + regexPart = tokens[0]; + replacePart = tokens[1]; + if (replacePart !== undefined) { + if (getOption('pcre')) { + replacePart = unescapeRegexReplace(replacePart); + } else { + replacePart = translateRegexReplace(replacePart); + } + vimGlobalState.lastSubstituteReplacePart = replacePart; + } + trailing = tokens[2] ? tokens[2].split(' ') : []; + } else { + // either the argString is empty or its of the form ' hello/world' + // actually splitBySlash returns a list of tokens + // only if the string starts with a '/' + if (argString && argString.length) { + showConfirm(cm, 'Substitutions should be of the form ' + + ':s/pattern/replace/'); + return; + } + } + // After the 3rd slash, we can have flags followed by a space followed + // by count. + if (trailing) { + flagsPart = trailing[0]; + count = parseInt(trailing[1]); + if (flagsPart) { + if (flagsPart.indexOf('c') != -1) { + confirm = true; + flagsPart.replace('c', ''); + } + if (flagsPart.indexOf('g') != -1) { + global = true; + flagsPart.replace('g', ''); + } + regexPart = regexPart + '/' + flagsPart; + } + } + if (regexPart) { + // If regex part is empty, then use the previous query. Otherwise use + // the regex part as the new query. + try { + updateSearchQuery(cm, regexPart, true /** ignoreCase */, + true /** smartCase */); + } catch (e) { + showConfirm(cm, 'Invalid regex: ' + regexPart); + return; + } + } + replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart; + if (replacePart === undefined) { + showConfirm(cm, 'No previous substitute regular expression'); + return; + } + var state = getSearchState(cm); + var query = state.getQuery(); + var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line; + var lineEnd = params.lineEnd || lineStart; + if (count) { + lineStart = lineEnd; + lineEnd = lineStart + count - 1; + } + var startPos = clipCursorToContent(cm, Pos(lineStart, 0)); + var cursor = cm.getSearchCursor(query, startPos); + doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback); + }, + redo: CodeMirror.commands.redo, + undo: CodeMirror.commands.undo, + write: function(cm) { + if (CodeMirror.commands.save) { + // If a save command is defined, call it. + CodeMirror.commands.save(cm); + } else { + // Saves to text area if no save command is defined. + cm.save(); + } + }, + nohlsearch: function(cm) { + clearSearchHighlight(cm); + }, + delmarks: function(cm, params) { + if (!params.argString || !trim(params.argString)) { + showConfirm(cm, 'Argument required'); + return; + } + + var state = cm.state.vim; + var stream = new CodeMirror.StringStream(trim(params.argString)); + while (!stream.eol()) { + stream.eatSpace(); + + // Record the streams position at the beginning of the loop for use + // in error messages. + var count = stream.pos; + + if (!stream.match(/[a-zA-Z]/, false)) { + showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); + return; + } + + var sym = stream.next(); + // Check if this symbol is part of a range + if (stream.match('-', true)) { + // This symbol is part of a range. + + // The range must terminate at an alphabetic character. + if (!stream.match(/[a-zA-Z]/, false)) { + showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); + return; + } + + var startMark = sym; + var finishMark = stream.next(); + // The range must terminate at an alphabetic character which + // shares the same case as the start of the range. + if (isLowerCase(startMark) && isLowerCase(finishMark) || + isUpperCase(startMark) && isUpperCase(finishMark)) { + var start = startMark.charCodeAt(0); + var finish = finishMark.charCodeAt(0); + if (start >= finish) { + showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); + return; + } + + // Because marks are always ASCII values, and we have + // determined that they are the same case, we can use + // their char codes to iterate through the defined range. + for (var j = 0; j <= finish - start; j++) { + var mark = String.fromCharCode(start + j); + delete state.marks[mark]; + } + } else { + showConfirm(cm, 'Invalid argument: ' + startMark + '-'); + return; + } + } else { + // This symbol is a valid mark, and is not part of a range. + delete state.marks[sym]; + } + } + } + }; + + var exCommandDispatcher = new ExCommandDispatcher(); + + /** + * @param {CodeMirror} cm CodeMirror instance we are in. + * @param {boolean} confirm Whether to confirm each replace. + * @param {Cursor} lineStart Line to start replacing from. + * @param {Cursor} lineEnd Line to stop replacing at. + * @param {RegExp} query Query for performing matches with. + * @param {string} replaceWith Text to replace matches with. May contain $1, + * $2, etc for replacing captured groups using Javascript replace. + * @param {function()} callback A callback for when the replace is done. + */ + function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, + replaceWith, callback) { + // Set up all the functions. + cm.state.vim.exMode = true; + var done = false; + var lastPos = searchCursor.from(); + function replaceAll() { + cm.operation(function() { + while (!done) { + replace(); + next(); + } + stop(); + }); + } + function replace() { + var text = cm.getRange(searchCursor.from(), searchCursor.to()); + var newText = text.replace(query, replaceWith); + searchCursor.replace(newText); + } + function next() { + var found; + // The below only loops to skip over multiple occurrences on the same + // line when 'global' is not true. + while(found = searchCursor.findNext() && + isInRange(searchCursor.from(), lineStart, lineEnd)) { + if (!global && lastPos && searchCursor.from().line == lastPos.line) { + continue; + } + cm.scrollIntoView(searchCursor.from(), 30); + cm.setSelection(searchCursor.from(), searchCursor.to()); + lastPos = searchCursor.from(); + done = false; + return; + } + done = true; + } + function stop(close) { + if (close) { close(); } + cm.focus(); + if (lastPos) { + cm.setCursor(lastPos); + var vim = cm.state.vim; + vim.exMode = false; + vim.lastHPos = vim.lastHSPos = lastPos.ch; + } + if (callback) { callback(); } + } + function onPromptKeyDown(e, _value, close) { + // Swallow all keys. + CodeMirror.e_stop(e); + var keyName = CodeMirror.keyName(e); + switch (keyName) { + case 'Y': + replace(); next(); break; + case 'N': + next(); break; + case 'A': + // replaceAll contains a call to close of its own. We don't want it + // to fire too early or multiple times. + var savedCallback = callback; + callback = undefined; + cm.operation(replaceAll); + callback = savedCallback; + break; + case 'L': + replace(); + // fall through and exit. + case 'Q': + case 'Esc': + case 'Ctrl-C': + case 'Ctrl-[': + stop(close); + break; + } + if (done) { stop(close); } + return true; + } + + // Actually do replace. + next(); + if (done) { + showConfirm(cm, 'No matches for ' + query.source); + return; + } + if (!confirm) { + replaceAll(); + if (callback) { callback(); }; + return; + } + showPrompt(cm, { + prefix: 'replace with ' + replaceWith + ' (y/n/a/q/l)', + onKeyDown: onPromptKeyDown + }); + } + + CodeMirror.keyMap.vim = { + attach: attachVimMap, + detach: detachVimMap, + call: cmKey + }; + + function exitInsertMode(cm) { + var vim = cm.state.vim; + var macroModeState = vimGlobalState.macroModeState; + var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.'); + var isPlaying = macroModeState.isPlaying; + var lastChange = macroModeState.lastInsertModeChanges; + // In case of visual block, the insertModeChanges are not saved as a + // single word, so we convert them to a single word + // so as to update the ". register as expected in real vim. + var text = []; + if (!isPlaying) { + var selLength = lastChange.inVisualBlock ? vim.lastSelection.visualBlock.height : 1; + var changes = lastChange.changes; + var text = []; + var i = 0; + // In case of multiple selections in blockwise visual, + // the inserted text, for example: 'foo', is stored as + // 'f', 'f', InsertModeKey 'o', 'o', 'o', 'o'. (if you have a block with 2 lines). + // We push the contents of the changes array as per the following: + // 1. In case of InsertModeKey, just increment by 1. + // 2. In case of a character, jump by selLength (2 in the example). + while (i < changes.length) { + // This loop will convert 'ffoooo' to 'foo'. + text.push(changes[i]); + if (changes[i] instanceof InsertModeKey) { + i++; + } else { + i+= selLength; + } + } + lastChange.changes = text; + cm.off('change', onChange); + CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); + } + if (!isPlaying && vim.insertModeRepeat > 1) { + // Perform insert mode repeat for commands like 3,a and 3,o. + repeatLastEdit(cm, vim, vim.insertModeRepeat - 1, + true /** repeatForInsert */); + vim.lastEditInputState.repeatOverride = vim.insertModeRepeat; + } + delete vim.insertModeRepeat; + vim.insertMode = false; + cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1); + cm.setOption('keyMap', 'vim'); + cm.setOption('disableInput', true); + cm.toggleOverwrite(false); // exit replace mode if we were in it. + // update the ". register before exiting insert mode + insertModeChangeRegister.setText(lastChange.changes.join('')); + CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); + if (macroModeState.isRecording) { + logInsertModeChange(macroModeState); + } + } + + function _mapCommand(command) { + defaultKeymap.push(command); + } + + function mapCommand(keys, type, name, args, extra) { + var command = {keys: keys, type: type}; + command[type] = name; + command[type + "Args"] = args; + for (var key in extra) + command[key] = extra[key]; + _mapCommand(command); + } + + // The timeout in milliseconds for the two-character ESC keymap should be + // adjusted according to your typing speed to prevent false positives. + defineOption('insertModeEscKeysTimeout', 200, 'number'); + + CodeMirror.keyMap['vim-insert'] = { + // TODO: override navigation keys so that Esc will cancel automatic + // indentation from o, O, i_ + 'Ctrl-N': 'autocomplete', + 'Ctrl-P': 'autocomplete', + 'Enter': function(cm) { + var fn = CodeMirror.commands.newlineAndIndentContinueComment || + CodeMirror.commands.newlineAndIndent; + fn(cm); + }, + fallthrough: ['default'], + attach: attachVimMap, + detach: detachVimMap, + call: cmKey + }; + + CodeMirror.keyMap['vim-replace'] = { + 'Backspace': 'goCharLeft', + fallthrough: ['vim-insert'], + attach: attachVimMap, + detach: detachVimMap, + call: cmKey + }; + + function executeMacroRegister(cm, vim, macroModeState, registerName) { + var register = vimGlobalState.registerController.getRegister(registerName); + var keyBuffer = register.keyBuffer; + var imc = 0; + macroModeState.isPlaying = true; + macroModeState.replaySearchQueries = register.searchQueries.slice(0); + for (var i = 0; i < keyBuffer.length; i++) { + var text = keyBuffer[i]; + var match, key; + while (text) { + // Pull off one command key, which is either a single character + // or a special sequence wrapped in '<' and '>', e.g. ''. + match = (/<\w+-.+?>|<\w+>|./).exec(text); + key = match[0]; + text = text.substring(match.index + key.length); + CodeMirror.Vim.handleKey(cm, key, 'macro'); + if (vim.insertMode) { + var changes = register.insertModeChanges[imc++].changes; + vimGlobalState.macroModeState.lastInsertModeChanges.changes = + changes; + repeatInsertModeChanges(cm, changes, 1); + exitInsertMode(cm); + } + } + }; + macroModeState.isPlaying = false; + } + + function logKey(macroModeState, key) { + if (macroModeState.isPlaying) { return; } + var registerName = macroModeState.latestRegister; + var register = vimGlobalState.registerController.getRegister(registerName); + if (register) { + register.pushText(key); + } + } + + function logInsertModeChange(macroModeState) { + if (macroModeState.isPlaying) { return; } + var registerName = macroModeState.latestRegister; + var register = vimGlobalState.registerController.getRegister(registerName); + if (register) { + register.pushInsertModeChanges(macroModeState.lastInsertModeChanges); + } + } + + function logSearchQuery(macroModeState, query) { + if (macroModeState.isPlaying) { return; } + var registerName = macroModeState.latestRegister; + var register = vimGlobalState.registerController.getRegister(registerName); + if (register) { + register.pushSearchQuery(query); + } + } + + /** + * Listens for changes made in insert mode. + * Should only be active in insert mode. + */ + function onChange(_cm, changeObj) { + var macroModeState = vimGlobalState.macroModeState; + var lastChange = macroModeState.lastInsertModeChanges; + if (!macroModeState.isPlaying) { + while(changeObj) { + lastChange.expectCursorActivityForChange = true; + if (changeObj.origin == '+input' || changeObj.origin == 'paste' + || changeObj.origin === undefined /* only in testing */) { + var text = changeObj.text.join('\n'); + lastChange.changes.push(text); + } + // Change objects may be chained with next. + changeObj = changeObj.next; + } + } + } + + /** + * Listens for any kind of cursor activity on CodeMirror. + */ + function onCursorActivity(cm) { + var vim = cm.state.vim; + if (vim.insertMode) { + // Tracking cursor activity in insert mode (for macro support). + var macroModeState = vimGlobalState.macroModeState; + if (macroModeState.isPlaying) { return; } + var lastChange = macroModeState.lastInsertModeChanges; + if (lastChange.expectCursorActivityForChange) { + lastChange.expectCursorActivityForChange = false; + } else { + // Cursor moved outside the context of an edit. Reset the change. + lastChange.changes = []; + } + } else if (!cm.curOp.isVimOp) { + handleExternalSelection(cm, vim); + } + if (vim.visualMode) { + updateFakeCursor(cm); + } + } + function updateFakeCursor(cm) { + var vim = cm.state.vim; + var from = copyCursor(vim.sel.head); + var to = offsetCursor(from, 0, 1); + if (vim.fakeCursor) { + vim.fakeCursor.clear(); + } + vim.fakeCursor = cm.markText(from, to, {className: 'cm-animate-fat-cursor'}); + } + function handleExternalSelection(cm, vim) { + var anchor = cm.getCursor('anchor'); + var head = cm.getCursor('head'); + // Enter or exit visual mode to match mouse selection. + if (vim.visualMode && cursorEqual(head, anchor) && lineLength(cm, head.line) > head.ch) { + exitVisualMode(cm, false); + } else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) { + vim.visualMode = true; + vim.visualLine = false; + CodeMirror.signal(cm, "vim-mode-change", {mode: "visual"}); + } + if (vim.visualMode) { + // Bind CodeMirror selection model to vim selection model. + // Mouse selections are considered visual characterwise. + var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0; + var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0; + head = offsetCursor(head, 0, headOffset); + anchor = offsetCursor(anchor, 0, anchorOffset); + vim.sel = { + anchor: anchor, + head: head + }; + updateMark(cm, vim, '<', cursorMin(head, anchor)); + updateMark(cm, vim, '>', cursorMax(head, anchor)); + } else if (!vim.insertMode) { + // Reset lastHPos if selection was modified by something outside of vim mode e.g. by mouse. + vim.lastHPos = cm.getCursor().ch; + } + } + + /** Wrapper for special keys pressed in insert mode */ + function InsertModeKey(keyName) { + this.keyName = keyName; + } + + /** + * Handles raw key down events from the text area. + * - Should only be active in insert mode. + * - For recording deletes in insert mode. + */ + function onKeyEventTargetKeyDown(e) { + var macroModeState = vimGlobalState.macroModeState; + var lastChange = macroModeState.lastInsertModeChanges; + var keyName = CodeMirror.keyName(e); + if (!keyName) { return; } + function onKeyFound() { + lastChange.changes.push(new InsertModeKey(keyName)); + return true; + } + if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) { + CodeMirror.lookupKey(keyName, 'vim-insert', onKeyFound); + } + } + + /** + * Repeats the last edit, which includes exactly 1 command and at most 1 + * insert. Operator and motion commands are read from lastEditInputState, + * while action commands are read from lastEditActionCommand. + * + * If repeatForInsert is true, then the function was called by + * exitInsertMode to repeat the insert mode changes the user just made. The + * corresponding enterInsertMode call was made with a count. + */ + function repeatLastEdit(cm, vim, repeat, repeatForInsert) { + var macroModeState = vimGlobalState.macroModeState; + macroModeState.isPlaying = true; + var isAction = !!vim.lastEditActionCommand; + var cachedInputState = vim.inputState; + function repeatCommand() { + if (isAction) { + commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand); + } else { + commandDispatcher.evalInput(cm, vim); + } + } + function repeatInsert(repeat) { + if (macroModeState.lastInsertModeChanges.changes.length > 0) { + // For some reason, repeat cw in desktop VIM does not repeat + // insert mode changes. Will conform to that behavior. + repeat = !vim.lastEditActionCommand ? 1 : repeat; + var changeObject = macroModeState.lastInsertModeChanges; + repeatInsertModeChanges(cm, changeObject.changes, repeat); + } + } + vim.inputState = vim.lastEditInputState; + if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) { + // o and O repeat have to be interlaced with insert repeats so that the + // insertions appear on separate lines instead of the last line. + for (var i = 0; i < repeat; i++) { + repeatCommand(); + repeatInsert(1); + } + } else { + if (!repeatForInsert) { + // Hack to get the cursor to end up at the right place. If I is + // repeated in insert mode repeat, cursor will be 1 insert + // change set left of where it should be. + repeatCommand(); + } + repeatInsert(repeat); + } + vim.inputState = cachedInputState; + if (vim.insertMode && !repeatForInsert) { + // Don't exit insert mode twice. If repeatForInsert is set, then we + // were called by an exitInsertMode call lower on the stack. + exitInsertMode(cm); + } + macroModeState.isPlaying = false; + }; + + function repeatInsertModeChanges(cm, changes, repeat) { + function keyHandler(binding) { + if (typeof binding == 'string') { + CodeMirror.commands[binding](cm); + } else { + binding(cm); + } + return true; + } + var head = cm.getCursor('head'); + var inVisualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock; + if (inVisualBlock) { + // Set up block selection again for repeating the changes. + var vim = cm.state.vim; + var lastSel = vim.lastSelection; + var offset = getOffset(lastSel.anchor, lastSel.head); + selectForInsert(cm, head, offset.line + 1); + repeat = cm.listSelections().length; + cm.setCursor(head); + } + for (var i = 0; i < repeat; i++) { + if (inVisualBlock) { + cm.setCursor(offsetCursor(head, i, 0)); + } + for (var j = 0; j < changes.length; j++) { + var change = changes[j]; + if (change instanceof InsertModeKey) { + CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler); + } else { + var cur = cm.getCursor(); + cm.replaceRange(change, cur, cur); + } + } + } + if (inVisualBlock) { + cm.setCursor(offsetCursor(head, 0, 1)); + } + } + + resetVimGlobalState(); + return vimApi; + }; + // Initialize Vim and make it available as an API. + CodeMirror.Vim = Vim(); +}); diff --git a/media/editors/codemirror/lib/addons.min.js b/media/editors/codemirror/lib/addons.min.js new file mode 100644 index 0000000000000..362005d5a66d4 --- /dev/null +++ b/media/editors/codemirror/lib/addons.min.js @@ -0,0 +1,3 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function r(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var r=e.state.fullScreenRestore;t.style.width=r.width,t.style.height=r.height,window.scrollTo(r.scrollLeft,r.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(n,o,i){i==e.Init&&(i=!1),!i!=!o&&(o?t(n):r(n))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r,n){this.cm=e,this.node=t,this.options=r,this.height=n,this.cleared=!1}function r(e){var t=e.getWrapperElement(),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n=parseInt(r.height),o=e.state.panels={setHeight:t.style.height,heightLeft:n,panels:0,wrapper:document.createElement("div")};t.parentNode.insertBefore(o.wrapper,t);var i=e.hasFocus();o.wrapper.appendChild(t),i&&e.focus(),e._setSize=e.setSize,null!=n&&(e.setSize=function(t,r){if(null==r)return this._setSize(t,r);if(o.setHeight=r,"number"!=typeof r){var i=/^(\d+\.?\d*)px$/.exec(r);i?r=Number(i[1]):(o.wrapper.style.height=r,r=o.wrapper.offsetHeight,o.wrapper.style.height="")}e._setSize(t,o.heightLeft+=r-n),n=r})}function n(e){var t=e.state.panels;e.state.panels=null;var r=e.getWrapperElement();t.wrapper.parentNode.replaceChild(r,t.wrapper),r.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}e.defineExtension("addPanel",function(e,n){this.state.panels||r(this);var o=this.state.panels;n&&"bottom"==n.position?o.wrapper.appendChild(e):o.wrapper.insertBefore(e,o.wrapper.firstChild);var i=n&&n.height||e.offsetHeight;return this._setSize(null,o.heightLeft-=i),o.panels++,new t(this,e,n,i)}),t.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var e=this.cm.state.panels;this.cm._setSize(null,e.heightLeft+=this.height),e.wrapper.removeChild(this.node),0==--e.panels&&n(this.cm)}},t.prototype.changed=function(e){var t=null==e?this.node.offsetHeight:e,r=this.cm.state.panels;this.cm._setSize(null,r.height+=t-this.height),this.height=t}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){var r=e.getRange(c(t.line,t.ch-1),c(t.line,t.ch+1));return 2==r.length?r:null}function r(t,r,n){var o=t.getLine(r.line),i=t.getTokenAt(r);if(/\bstring2?\b/.test(i.type))return!1;var a=new e.StringStream(o.slice(0,r.ch)+n+o.slice(r.ch),4);for(a.pos=a.start=i.start;;){var s=t.getMode().token(a,i.state);if(a.pos>=r.ch+1)return/\bstring2?\b/.test(s);a.start=a.pos}}function n(n,o){for(var i={name:"autoCloseBrackets",Backspace:function(r){if(r.getOption("disableInput"))return e.Pass;for(var o=r.listSelections(),i=0;i=0;i--){var s=o[i].head;r.replaceRange("",c(s.line,s.ch-1),c(s.line,s.ch+1))}}},a="",s=0;s1&&o.indexOf(t)>=0&&i.getRange(c(m.line,m.ch-2),m)==t+t&&(m.ch<=2||i.getRange(c(m.line,m.ch-3),c(m.line,m.ch-2))!=t))d="addFour";else if('"'==t||"'"==t){if(e.isWordChar(u)||!r(i,m,t))return e.Pass;d="both"}else{if(!(i.getLine(m.line).length==m.ch||a.indexOf(u)>=0||l.test(u)))return e.Pass;d="both"}else d="surround";if(s){if(s!=d)return e.Pass}else s=d}i.operation(function(){if("skip"==s)i.execCommand("goCharRight");else if("skipThree"==s)for(var e=0;3>e;e++)i.execCommand("goCharRight");else if("surround"==s){for(var r=i.getSelections(),e=0;ec.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==h.type||u.string.indexOf("/")==u.string.length-1||m&&o(m,y)>-1||i(t,v,c,h,!0))return e.Pass;var C=g&&o(g,y)>-1;n[l]={indent:C,text:">"+(C?"\n\n":"")+"",newPos:C?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=r.length-1;l>=0;l--){var k=n[l];t.replaceRange(k.text,r[l].head,r[l].anchor,"+insert");var w=t.listSelections().slice(0);w[l]={head:k.newPos,anchor:k.newPos},t.setSelections(w),k.indent&&(t.indentLine(k.newPos.line,null,!0),t.indentLine(k.newPos.line+1,null,!0))}}function r(t,r){for(var n=t.listSelections(),o=[],a=r?"/":"";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;o[s]=a+"style>"}else{if(!f.context||!f.context.tagName||i(t,f.context.tagName,l,f))return e.Pass;o[s]=a+f.context.tagName+">"}}t.replaceSelections(o),n=t.listSelections();for(var s=0;sr;++r)if(e[r]==t)return r;return-1}function i(t,r,n,o,i){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,n.line+500),s=e.scanForClosingTag(t,n,null,a);if(!s||s.tag!=r)return!1;for(var l=o.context,c=i?1:0;l&&l.tagName==r;l=l.prev)++c;n=s.to;for(var u=1;c>u;u++){var f=e.scanForClosingTag(t,n,null,a);if(!f||f.tag!=r)return!1;n=f.to}return!0}e.defineOption("autoCloseTags",!1,function(r,o,i){if(i!=e.Init&&i&&r.removeKeyMap("autoCloseTags"),o){var a={name:"autoCloseTags"};("object"!=typeof o||o.whenClosing)&&(a["'/'"]=function(e){return n(e)}),("object"!=typeof o||o.whenOpening)&&(a["'>'"]=function(e){return t(e)}),r.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],s=["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"];e.commands.closeTag=function(e){return r(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n,o){var i=e.getLineHandle(t.line),l=t.ch-1,c=l>=0&&s[i.text.charAt(l)]||s[i.text.charAt(++l)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(n&&u>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(a(t.line,l+1)),h=r(e,a(t.line,l+(u>0?1:0)),u,f||null,o);return null==h?null:{from:a(t.line,l),to:h&&h.pos,match:h&&h.ch==c.charAt(0),forward:u>0}}function r(e,t,r,n,o){for(var i=o&&o.maxScanLineLength||1e4,l=o&&o.maxScanLines||1e3,c=[],u=o&&o.bracketRegex?o.bracketRegex:/[(){}[\]]/,f=r>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),h=t.line;h!=f;h+=r){var d=e.getLine(h);if(d){var p=r>0?0:d.length-1,m=r>0?d.length:-1;if(!(d.length>i))for(h==t.line&&(p=t.ch-(0>r?1:0));p!=m;p+=r){var g=d.charAt(p);if(u.test(g)&&(void 0===n||e.getTokenTypeAt(a(h,p+1))==n)){var v=s[g];if(">"==v.charAt(1)==r>0)c.push(g);else{if(!c.length)return{pos:a(h,p),ch:g};c.pop()}}}}}return h-r==(r>0?e.lastLine():e.firstLine())?!1:null}function n(e,r,n){for(var o=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),c=0;c",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,r,n){n&&n!=e.Init&&t.off("cursorActivity",o),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",o))}),e.defineExtension("matchBrackets",function(){n(this,!0)}),e.defineExtension("findMatchingBracket",function(e,r,n){return t(this,e,r,n)}),e.defineExtension("scanForBracket",function(e,t,n,o){return r(this,e,t,n,o)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function r(r){r.state.failedTagMatch=!1,r.operation(function(){if(t(r),!r.somethingSelected()){var n=r.getCursor(),o=r.getViewport();o.from=Math.min(o.from,n.line),o.to=Math.max(n.line+1,o.to);var i=e.findMatchingTag(r,n,o);if(i){if(r.state.matchBothTags){var a="open"==i.at?i.open:i.close;a&&(r.state.tagHit=r.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var s="close"==i.at?i.open:i.close;s?r.state.tagOther=r.markText(s.from,s.to,{className:"CodeMirror-matchingtag"}):r.state.failedTagMatch=!0}}})}function n(e){e.state.failedTagMatch&&r(e)}e.defineOption("matchTags",!1,function(o,i,a){a&&a!=e.Init&&(o.off("cursorActivity",r),o.off("viewportChange",n),t(o)),i&&(o.state.matchBothTags="object"==typeof i&&i.bothTags,o.on("cursorActivity",r),o.on("viewportChange",n),r(o))}),e.commands.toMatchingTag=function(t){var r=e.findMatchingTag(t,t.getCursor());if(r){var n="close"==r.at?r.open:r.close;n&&t.extendSelection(n.to,n.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(t,r){function n(n){for(var o=r.ch,l=0;;){var c=0>=o?-1:s.lastIndexOf(n,o-1);if(-1!=c){if(1==l&&c=p;++p)for(var m=t.getLine(p),g=p==a?o:0;;){var v=m.indexOf(l,g),y=m.indexOf(c,g);if(0>v&&(v=m.length),0>y&&(y=m.length),g=Math.min(v,y),g==m.length)break;if(t.getTokenTypeAt(e.Pos(p,g+1))==i)if(g==v)++h;else if(!--h){u=p,f=g;break e}++g}if(null!=u&&(a!=u||f!=o))return{from:e.Pos(a,o),to:e.Pos(u,f)}}}),e.registerHelper("fold","import",function(t,r){function n(r){if(rt.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));if(/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"keyword"!=n.type||"import"!=n.string)return null;for(var o=r,i=Math.min(t.lastLine(),r+10);i>=o;++o){var a=t.getLine(o),s=a.indexOf(";");if(-1!=s)return{startCh:n.end,end:e.Pos(o,s)}}}var o,r=r.line,i=n(r);if(!i||n(r-1)||(o=n(r-2))&&o.end.line==r-1)return null;for(var a=i.end;;){var s=n(a.line+1);if(null==s)break;a=s.end}return{from:t.clipPos(e.Pos(r,i.startCh+1)),to:a}}),e.registerHelper("fold","include",function(t,r){function n(r){if(rt.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));return/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"meta"==n.type&&"#include"==n.string.slice(0,8)?n.start+8:void 0}var r=r.line,o=n(r);if(null==o||null!=n(r-1))return null;for(var i=r;;){var a=n(i+1);if(null==a)break;++i}return{from:e.Pos(r,o+1),to:t.clipPos(e.Pos(i))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,o,i,a){function s(e){var r=l(t,o);if(!r||r.to.line-r.from.linet.firstLine();)o=e.Pos(o.line-1,0),u=s(!1);if(u&&!u.cleared&&"unfold"!==a){var f=r(t,i);e.on(f,"mousedown",function(t){h.clear(),e.e_preventDefault(t)});var h=t.markText(u.from,u.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});h.on("clear",function(r,n){e.signal(t,"unfold",t,r,n)}),e.signal(t,"fold",t,u.from,u.to)}}function r(e,t){var r=n(e,t,"widget");if("string"==typeof r){var o=document.createTextNode(r);r=document.createElement("span"),r.appendChild(o),r.className="CodeMirror-foldmarker"}return r}function n(e,t,r){if(t&&void 0!==t[r])return t[r];var n=e.options.foldOptions;return n&&void 0!==n[r]?n[r]:o[r]}e.newFoldFunction=function(e,r){return function(n,o){t(n,o,{rangeFinder:e,widget:r})}},e.defineExtension("foldCode",function(e,r,n){t(this,e,r,n)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),r=0;r=r;r++)t.foldCode(e.Pos(r,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var r=t.firstLine(),n=t.lastLine();n>=r;r++)t.foldCode(e.Pos(r,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,r){for(var n=0;n=s&&(r=o(i.indicatorOpen))}e.setGutterMarker(t,i.gutter,r),++a})}function a(e){var t=e.getViewport(),r=e.state.foldGutter;r&&(e.operation(function(){i(e,t.from,t.to)}),r.from=t.from,r.to=t.to)}function s(e,t,r){var n=e.state.foldGutter;if(n){var o=n.options;r==o.gutter&&e.foldCode(f(t,0),o.rangeFinder)}}function l(e){var t=e.state.foldGutter;if(t){var r=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},r.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var r=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var r=e.getViewport();t.from==t.to||r.from-t.to>20||t.from-r.to>20?a(e):e.operation(function(){r.fromt.to&&(i(e,t.to,r.to),t.to=r.to)})},r.updateViewportTimeSpan||400)}}function u(e,t){var r=e.state.foldGutter;if(r){var n=t.line;n>=r.from&&n=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function i(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(o(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}}function s(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(i(e))continue;return}if(n(e,t+1)){m.lastIndex=t,e.ch=t;var r=m.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function l(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(o(e))continue;return}{if(n(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(i(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),o=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var r=[];;){var n,o=l(e),i=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(n=a(e)))return;if("selfClose"!=n)if(o[1]){for(var c=r.length-1;c>=0;--c)if(r[c]==o[2]){r.length=c;break}if(0>c&&(!t||t==o[2]))return{tag:o[2],from:h(i,s),to:h(e.line,e.ch)}}else r.push(o[2])}}function f(e,t){for(var r=[];;){var n=c(e);if(!n)return;if("selfClose"!=n){var o=e.line,i=e.ch,a=s(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var l=r.length-1;l>=0;--l)if(r[l]==a[2]){r.length=l;break}if(0>l&&(!t||t==a[2]))return{tag:a[2],from:h(e.line,e.ch),to:h(o,i)}}}else s(e)}}var h=e.Pos,d="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",p=d+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+d+"]["+p+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var n=new r(e,t.line,0);;){var o,i=l(n);if(!i||n.line!=t.line||!(o=a(n)))return;if(!i[1]&&"selfClose"!=o){var t=h(n.line,n.ch),s=u(n,i[2]);return s&&{from:t,to:s.from}}}}),e.findMatchingTag=function(e,n,o){var i=new r(e,n.line,n.ch,o);if(-1!=i.text.indexOf(">")||-1!=i.text.indexOf("<")){var l=a(i),c=l&&h(i.line,i.ch),d=l&&s(i);if(l&&d&&!(t(i,n)>0)){var p={from:h(i.line,i.ch),to:c,tag:d[2]};return"selfClose"==l?{open:p,close:null,at:"open"}:d[1]?{open:f(i,d[2]),close:p,at:"close"}:(i=new r(e,c.line,c.ch,o),{open:p,close:u(i,d[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,n){for(var o=new r(e,t.line,t.ch,n);;){var i=f(o);if(!i)break;var a=new r(e,t.line,t.ch,n),s=u(a,i.tag);if(s)return{open:i,close:s}}},e.scanForClosingTag=function(e,t,n,o){var i=new r(e,t.line,t.ch,o?{from:0,to:o}:null);return u(i,n)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],function(t){e(t,"amd")}):e(CodeMirror,"plain")}(function(e,t){function r(e,t){var r=t;return function(){0==--r&&e()}}function n(t,n){var o=e.modes[t].dependencies;if(!o)return n();for(var i=[],a=0;a-1&&(i.string=l.slice(0,c));var u=s.mode.token(i,a.inner);return c>-1&&(i.string=l),s.innerStyle&&(u=u?u+" "+s.innerStyle:s.innerStyle),u}for(var f=1/0,l=i.string,h=0;o>h;++h){var d=n[h],c=r(l,d.open,i.pos);if(c==i.pos)return i.match(d.open),a.innerActive=d,a.inner=e.startState(d.mode,t.indent?t.indent(a.outer,""):0),d.delimStyle;-1!=c&&f>c&&(f=c)}1/0!=f&&(i.string=l.slice(0,f));var p=t.token(i,a.outer);return 1/0!=f&&(i.string=l),p},indent:function(r,n){var o=r.innerActive?r.innerActive.mode:t;return o.indent?o.indent(r.innerActive?r.inner:r.outer,n):e.Pass},blankLine:function(r){var i=r.innerActive?r.innerActive.mode:t;if(i.blankLine&&i.blankLine(r.innerActive?r.inner:r.outer),r.innerActive)"\n"===r.innerActive.close&&(r.innerActive=r.inner=null);else for(var a=0;o>a;++a){var s=n[a];"\n"===s.open&&(r.innerActive=s,r.inner=e.startState(s.mode,i.indent?i.indent(r.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,r,n){function o(t){var r=e.wheelEventPixels(t)["horizontal"==i.orientation?"x":"y"],n=i.pos;i.moveTo(i.pos+r),i.pos!=n&&e.e_preventDefault(t)}this.orientation=r,this.scroll=n,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=t+"-"+r,this.inner=this.node.appendChild(document.createElement("div"));var i=this;e.on(this.inner,"mousedown",function(t){function r(){e.off(document,"mousemove",n),e.off(document,"mouseup",r)}function n(e){return 1!=e.which?r():void i.moveTo(s+(e[o]-a)*(i.total/i.size))}if(1==t.which){e.e_preventDefault(t);var o="horizontal"==i.orientation?"pageX":"pageY",a=t[o],s=i.pos;e.on(document,"mousemove",n),e.on(document,"mouseup",r)}}),e.on(this.node,"click",function(t){e.e_preventDefault(t);var r,n=i.inner.getBoundingClientRect();r="horizontal"==i.orientation?t.clientXn.right?1:0:t.clientYn.bottom?1:0,i.moveTo(i.pos+r*i.screen)}),e.on(this.node,"mousewheel",o),e.on(this.node,"DOMMouseScroll",o)}function r(e,r,n){this.addClass=e,this.horiz=new t(e,"horizontal",n),r(this.horiz.node),this.vert=new t(e,"vertical",n),r(this.vert.node),this.width=null}t.prototype.moveTo=function(e,t){0>e&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),e!=this.pos&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",t!==!1&&this.scroll(e,this.orientation))},t.prototype.update=function(e,t,r){this.screen=t,this.total=e,this.size=r,this.inner.style["horizontal"==this.orientation?"width":"height"]=this.screen*(this.size/this.total)+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},r.prototype.update=function(e){if(null==this.width){var t=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;t&&(this.width=parseInt(t.height))}var r=this.width||0,n=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=o?"block":"none",this.horiz.node.style.display=n?"block":"none",o&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(n?r:0)),this.vert.node.style.display="block",this.vert.node.style.bottom=n?r+"px":"0"),n&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(o?r:0)-e.barLeft),this.horiz.node.style.right=o?r+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:o?r:0,bottom:n?r:0}},r.prototype.setScrollTop=function(e){this.vert.moveTo(e,!1)},r.prototype.setScrollLeft=function(e){this.horiz.moveTo(e,!1)},r.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new r("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new r("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t",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:"xi",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",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:"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:"moveToEol",motionArgs:{inclusive:!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:"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:"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"}],r=e.Pos,n=function(){function n(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",Zt),x(t),e.on(t.getInputField(),"paste",c(t)) +}function o(t){t.setOption("disableInput",!1),t.off("cursorActivity",Zt),e.off(t.getInputField(),"paste",c(t)),t.state.vim=null}function i(t,r){this==e.keyMap.vim&&e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),r&&r.attach==a||o(t,!1)}function a(t,r){this==e.keyMap.vim&&e.addClass(t.getWrapperElement(),"cm-fat-cursor"),r&&r.attach==a||n(t)}function s(t,r){if(!r)return void 0;var n=l(t);if(!n)return!1;var o=e.Vim.findKey(r,n);return"function"==typeof o&&e.signal(r,"vim-keypress",n),o}function l(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split("-");/-$/.test(e)&&t.splice(-2,2,"-");var r=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==r.length)return!1;for(var n=!1,o=0;o"):!1}function c(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(N(e.getCursor(),0,1)),br.enterInsertMode(e,{},t))}),t.onPasteFn}function u(e,t){for(var r=[],n=e;e+t>n;n++)r.push(String.fromCharCode(n));return r}function f(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function h(e){return/^[a-z]$/.test(e)}function d(e){return-1!="()[]{}".indexOf(e)}function p(e){return lr.test(e)}function m(e){return/^[A-Z]$/.test(e)}function g(e){return/^\s*$/.test(e)}function v(e,t){for(var r=0;rn;n++)r.push(e);return r}function E(e,t){Sr[e]=t}function I(e,t){br[e]=t}function B(e,t,n){var o=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),i=J(e,o)-1;i=n?i+1:i;var a=Math.min(Math.max(0,t.ch),i);return r(o,a)}function P(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function N(e,t,n){return"object"==typeof t&&(n=t.ch,t=t.line),r(e.line+t,e.ch+n)}function j(e,t){return{line:t.line-e.line,ch:t.line-e.line}}function F(e,t,r,n){for(var o,i=[],a=[],s=0;s"==t.slice(-11)){var r=t.length-11,n=e.slice(0,r),o=t.slice(0,r);return n==o&&e.length>r?"full":0==o.indexOf(n)?"partial":!1}return e==t?"full":0==t.indexOf(e)?"partial":!1}function H(e){var t=/^.*(<[\w\-]+>)$/.exec(e),r=t?t[1]:e.slice(-1);if(r.length>1)switch(r){case"":r="\n";break;case"":r=" "}return r}function D(e,t,r){return function(){for(var n=0;r>n;n++)t(e)}}function z(e){return r(e.line,e.ch)}function _(e,t){return e.ch==t.ch&&e.line==t.line}function W(e,t){return e.line2&&(t=q.apply(void 0,Array.prototype.slice.call(arguments,1))),W(e,t)?e:t}function V(e,t){return arguments.length>2&&(t=V.apply(void 0,Array.prototype.slice.call(arguments,1))),W(e,t)?t:e}function U(e,t,r){var n=W(e,t),o=W(t,r);return n&&o}function J(e,t){return e.getLine(t).length}function $(e){return e.split("").reverse().join("")}function Q(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function G(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Y(e,t,n){var o=J(e,t),i=new Array(n-o+1).join(" ");e.setCursor(r(t,o)),e.replaceRange(i,e.getCursor())}function X(e,t){var n=[],o=e.listSelections(),i=z(e.clipPos(t)),a=!_(t,i),s=e.getCursor("head"),l=et(o,s),c=_(o[l].head,o[l].anchor),u=o.length-1,f=u-l>l?u:0,h=o[f].anchor,d=Math.min(h.line,i.line),p=Math.max(h.line,i.line),m=h.ch,g=i.ch,v=o[f].head.ch-m,y=g-m;v>0&&0>=y?(m++,a||g--):0>v&&y>=0?(m--,c||g++):0>v&&-1==y&&(m--,g++);for(var C=d;p>=C;C++){var k={anchor:new r(C,m),head:new r(C,g)};n.push(k)}return l=i.line==p?n.length-1:0,e.setSelections(n),t.ch=g,h.ch=m,h}function Z(e,t,r){for(var n=[],o=0;r>o;o++){var i=N(t,o,0);n.push({anchor:i,head:i})}e.setSelections(n,0)}function et(e,t,r){for(var n=0;nc&&(i.line=c),i.ch=J(e,i.line)}return{ranges:[{anchor:a,head:i}],primary:0}}if("block"==n){for(var u=Math.min(a.line,i.line),f=Math.min(a.ch,i.ch),h=Math.max(a.line,i.line),d=Math.max(a.ch,i.ch)+1,p=h-u+1,m=i.line==u?0:p-1,g=[],v=0;p>v;v++)g.push({anchor:r(u+v,f),head:r(u+v,d)});return{ranges:g,primary:m}}}function at(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=q(t,e.getCursor("anchor"))),t}function st(t,r){var n=t.state.vim;r!==!1&&t.setCursor(B(t,n.sel.head)),rt(t,n),n.visualMode=!1,n.visualLine=!1,n.visualBlock=!1,e.signal(t,"vim-mode-change",{mode:"normal"}),n.fakeCursor&&n.fakeCursor.clear()}function lt(e,t,r){var n=e.getRange(t,r);if(/\n\s*$/.test(n)){var o=n.split("\n");o.pop();for(var i,i=o.pop();o.length>0&&i&&g(i);i=o.pop())r.line--,r.ch=0;i?(r.line--,r.ch=J(e,r.line)):r.ch=0}}function ct(e,t,r){t.ch=0,r.ch=0,r.line++}function ut(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function ft(e,t,n,o,i){var a,s=at(e),l=e.getLine(s.line),c=s.ch,u=l.substring(c);if(a=u.search(i?/\w/:/\S/),-1==a)return null;c+=a,u=l.substring(c);var f,h=l.substring(0,c);f=o?/^\S+/:/\w/.test(l.charAt(c))?/^\w+/:/^[^\w\s]+/;var d=f.exec(u),p=c,m=c+d[0].length,g=$(h),v=f.exec(g);if(v&&(p-=v[0].length),t){var y=l.substring(m),C=y.match(/^\s*/)[0].length;if(C>0)m+=C;else{var k=g.length-p,w=g.substring(k),x=w.match(/^\s*/)[0].length;p-=x}}return{start:r(s.line,p),end:r(s.line,m)}}function ht(e,t,r){_(t,r)||Cr.jumpList.add(e,t,r)}function dt(e,t){Cr.lastChararacterSearch.increment=e,Cr.lastChararacterSearch.forward=t.forward,Cr.lastChararacterSearch.selectedCharacter=t.selectedCharacter}function pt(e,t,n,o){var i=z(e.getCursor()),a=n?1:-1,s=n?e.lineCount():-1,l=i.ch,c=i.line,u=e.getLine(c),f={lineText:u,nextCh:u.charAt(l),lastCh:null,index:l,symb:o,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[o],forward:n,depth:0,curMoveThrough:!1},h=Ar[o];if(!h)return i;var d=Lr[h].init,p=Lr[h].isComplete;for(d&&d(f);c!==s&&t;){if(f.index+=a,f.nextCh=f.lineText.charAt(f.index),!f.nextCh){if(c+=a,f.lineText=e.getLine(c)||"",a>0)f.index=0;else{var m=f.lineText.length;f.index=m>0?m-1:0}f.nextCh=f.lineText.charAt(f.index)}p(f)&&(i.line=c,i.ch=f.index,t--)}return f.nextCh||f.curMoveThrough?r(c,f.index):i}function mt(e,t,r,n,o){var i=t.line,a=t.ch,s=e.getLine(i),l=r?1:-1,c=n?ur:cr;if(o&&""==s){if(i+=l,s=e.getLine(i),!f(e,i))return null;a=r?0:s.length}for(;;){if(o&&""==s)return{from:0,to:0,line:i};for(var u=l>0?s.length:-1,h=u,d=u;a!=u;){for(var p=!1,m=0;m0?0:s.length}throw new Error("The impossible happened.")}function gt(e,t,n,o,i,a){var s=z(t),l=[];(o&&!i||!o&&i)&&n++;for(var c=!(o&&i),u=0;n>u;u++){var f=mt(e,t,o,a,c);if(!f){var h=J(e,e.lastLine());l.push(o?{line:e.lastLine(),from:h,to:h}:{line:0,from:0,to:0});break}l.push(f),t=r(f.line,o?f.to-1:f.from)}var d=l.length!=n,p=l[0],m=l.pop();return o&&!i?(d||p.from==s.ch&&p.line==s.line||(m=l.pop()),r(m.line,m.from)):o&&i?r(m.line,m.to-1):!o&&i?(d||p.to==s.ch&&p.line==s.line||(m=l.pop()),r(m.line,m.to)):r(m.line,m.from)}function vt(e,t,n,o){for(var i,a=e.getCursor(),s=a.ch,l=0;t>l;l++){var c=e.getLine(a.line);if(i=kt(s,c,o,n,!0),-1==i)return null;s=i}return r(e.getCursor().line,i)}function yt(e,t){var n=e.getCursor().line;return B(e,r(n,t-1))}function Ct(e,t,r,n){v(r,pr)&&(t.marks[r]&&t.marks[r].clear(),t.marks[r]=e.setBookmark(n))}function kt(e,t,r,n,o){var i;return n?(i=t.indexOf(r,e+1),-1==i||o||(i-=1)):(i=t.lastIndexOf(r,e-1),-1==i||o||(i+=1)),i}function wt(e,t,n,o,i){function a(t){return!e.getLine(t)}function s(e,t,r){return r?a(e)!=a(e+t):!a(e)&&a(e+t)}var l,c,u=t.line,f=e.firstLine(),h=e.lastLine(),d=u;if(o){for(;d>=f&&h>=d&&n>0;)s(d,o)&&n--,d+=o;return new r(d,0)}var p=e.state.vim;if(p.visualLine&&s(u,1,!0)){var m=p.sel.anchor;s(m.line,-1,!0)&&(i&&m.line==u||(u+=1))}var g=a(u);for(d=u;h>=d&&n;d++)s(d,1,!0)&&(i&&a(d)==g||n--);for(c=new r(d,0),d>h&&!g?g=!0:i=!1,d=u;d>f&&(i&&a(d)!=g&&d!=u||!s(d,-1,!0));d--);return l=new r(d,0),{start:l,end:c}}function xt(e,t,n,o){var i,a,s=t,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],c={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],u=e.getLine(s.line).charAt(s.ch),f=u===c?1:0;if(i=e.scanForBracket(r(s.line,s.ch+f),-1,null,{bracketRegex:l}),a=e.scanForBracket(r(s.line,s.ch+f),1,null,{bracketRegex:l}),!i||!a)return{start:s,end:s};if(i=i.pos,a=a.pos,i.line==a.line&&i.ch>a.ch||i.line>a.line){var h=i;i=a,a=h}return o?a.ch+=1:i.ch+=1,{start:i,end:a}}function Mt(e,t,n,o){var i,a,s,l,c=z(t),u=e.getLine(c.line),f=u.split(""),h=f.indexOf(n);if(c.ch-1&&!i;s--)f[s]==n&&(i=s+1);else i=c.ch+1;if(i&&!a)for(s=i,l=f.length;l>s&&!a;s++)f[s]==n&&(a=s);return i&&a?(o&&(--i,++a),{start:r(c.line,i),end:r(c.line,a)}):{start:c,end:c}}function St(){}function bt(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new St)}function At(e,t,r,n,o){e.openDialog?e.openDialog(t,n,{bottom:!0,value:o.value,onKeyDown:o.onKeyDown,onKeyUp:o.onKeyUp}):n(prompt(r,""))}function Lt(e){var t=Tt(e)||[];if(!t.length)return[];var r=[];if(0===t[0]){for(var n=0;n'+t+"
",{bottom:!0,duration:5e3}):alert(t)}function Pt(e,t){var r="";return e&&(r+=''+e+""),r+=' ',t&&(r+='',r+=t,r+=""),r}function Nt(e,t){var r=(t.prefix||"")+" "+(t.desc||""),n=Pt(t.prefix,t.desc);At(e,n,r,t.onClose,t)}function jt(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var r=["global","multiline","ignoreCase","source"],n=0;ns;s++){var l=a.find(t);if(0==s&&l&&_(a.from(),i)&&(l=a.find(t)),!l&&(a=e.getSearchCursor(n,t?r(e.lastLine()):r(e.firstLine(),0)),!a.find(t)))return}return a.from()})}function zt(e){var t=bt(e);e.removeOverlay(bt(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function _t(e,t,r){return"number"!=typeof e&&(e=e.line),t instanceof Array?v(e,t):r?e>=t&&r>=e:e==t}function Wt(e){var t=e.getScrollInfo(),r=6,n=10,o=e.coordsChar({left:0,top:r+t.top},"local"),i=t.clientHeight-n+t.top,a=e.coordsChar({left:0,top:i},"local");return{top:o.line,bottom:a.line}}function qt(t,r,n,o,i,a,s,l,c){function u(){t.operation(function(){for(;!m;)f(),h();d()})}function f(){var e=t.getRange(a.from(),a.to()),r=e.replace(s,l);a.replace(r)}function h(){for(var e;e=a.findNext()&&_t(a.from(),o,i);)if(n||!g||a.from().line!=g.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),g=a.from(),void(m=!1);m=!0}function d(e){if(e&&e(),t.focus(),g){t.setCursor(g);var r=t.state.vim;r.exMode=!1,r.lastHPos=r.lastHSPos=g.ch}c&&c()}function p(r,n,o){e.e_stop(r);var i=e.keyName(r);switch(i){case"Y":f(),h();break;case"N":h();break;case"A":var a=c;c=void 0,t.operation(u),c=a;break;case"L":f();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":d(o)}return m&&d(o),!0}t.state.vim.exMode=!0;var m=!1,g=a.from();return h(),m?void Bt(t,"No matches for "+s.source):r?void Nt(t,{prefix:"replace with "+l+" (y/n/a/q/l)",onKeyDown:p}):(u(),void(c&&c()))}function Vt(t){var r=t.state.vim,n=Cr.macroModeState,o=Cr.registerController.getRegister("."),i=n.isPlaying,a=n.lastInsertModeChanges,s=[];if(!i){for(var l=a.inVisualBlock?r.lastSelection.visualBlock.height:1,c=a.changes,s=[],u=0;u1&&(or(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),o.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),n.isRecording&&Gt(n)}function Ut(e){t.push(e)}function Jt(e,t,r,n,o){var i={keys:e,type:t};i[t]=r,i[t+"Args"]=n;for(var a in o)i[a]=o[a];Ut(i)}function $t(t,r,n,o){var i=Cr.registerController.getRegister(o),a=i.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var l=0;l|<\w+>|./.exec(f),u=c[0],f=f.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"),r.insertMode){var h=i.insertModeChanges[s++].changes;Cr.macroModeState.lastInsertModeChanges.changes=h,ir(t,h,1),Vt(t)}n.isPlaying=!1}function Qt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=Cr.registerController.getRegister(r);n&&n.pushText(t)}}function Gt(e){if(!e.isPlaying){var t=e.latestRegister,r=Cr.registerController.getRegister(t);r&&r.pushInsertModeChanges(e.lastInsertModeChanges)}}function Yt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=Cr.registerController.getRegister(r);n&&n.pushSearchQuery(t)}}function Xt(e,t){var r=Cr.macroModeState,n=r.lastInsertModeChanges;if(!r.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var o=t.text.join("\n");n.changes.push(o)}t=t.next}}function Zt(e){var t=e.state.vim;if(t.insertMode){var r=Cr.macroModeState;if(r.isPlaying)return;var n=r.lastInsertModeChanges;n.expectCursorActivityForChange?n.expectCursorActivityForChange=!1:n.changes=[]}else e.curOp.isVimOp||tr(e,t);t.visualMode&&er(e)}function er(e){var t=e.state.vim,r=z(t.sel.head),n=N(r,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(r,n,{className:"cm-animate-fat-cursor"})}function tr(t,r){var n=t.getCursor("anchor"),o=t.getCursor("head");if(r.visualMode&&_(o,n)&&J(t,o.line)>o.ch?st(t,!1):r.visualMode||r.insertMode||!t.somethingSelected()||(r.visualMode=!0,r.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"})),r.visualMode){var i=W(o,n)?0:-1,a=W(o,n)?-1:0;o=N(o,0,i),n=N(n,0,a),r.sel={anchor:n,head:o},Ct(t,r,"<",q(o,n)),Ct(t,r,">",V(o,n))}else r.insertMode||(r.lastHPos=t.getCursor().ch)}function rr(e){this.keyName=e}function nr(t){function r(){return o.changes.push(new rr(i)),!0}var n=Cr.macroModeState,o=n.lastInsertModeChanges,i=e.keyName(t);i&&(-1!=i.indexOf("Delete")||-1!=i.indexOf("Backspace"))&&e.lookupKey(i,"vim-insert",r)}function or(e,t,r,n){function o(){s?xr.processAction(e,t,t.lastEditActionCommand):xr.evalInput(e,t)}function i(r){if(a.lastInsertModeChanges.changes.length>0){r=t.lastEditActionCommand?r:1;var n=a.lastInsertModeChanges;ir(e,n.changes,r)}}var a=Cr.macroModeState;a.isPlaying=!0;var s=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;r>c;c++)o(),i(1);else n||o(),i(r);t.inputState=l,t.insertMode&&!n&&Vt(e),a.isPlaying=!1}function ir(t,r,n){function o(r){return"string"==typeof r?e.commands[r](t):r(t),!0}var i=t.getCursor("head"),a=Cr.macroModeState.lastInsertModeChanges.inVisualBlock;if(a){var s=t.state.vim,l=s.lastSelection,c=j(l.anchor,l.head);Z(t,i,c.line+1),n=t.listSelections().length,t.setCursor(i)}for(var u=0;n>u;u++){a&&t.setCursor(N(i,u,0));for(var f=0;f"]),mr=[].concat(fr,hr,dr,["-",'"',".",":","/"]),gr={},vr=function(){function e(e,t,s){function l(t){var o=++n%r,i=a[o];i&&i.clear(),a[o]=e.setBookmark(t)}var c=n%r,u=a[c];if(u){var f=u.find();f&&!_(f,t)&&l(t)}else l(t);l(s),o=n,i=n-r+1,0>i&&(i=0)}function t(e,t){n+=t,n>o?n=o:i>n&&(n=i);var s=a[(r+n)%r];if(s&&!s.find()){var l,c=t>0?1:-1,u=e.getCursor();do if(n+=c,s=a[(r+n)%r],s&&(l=s.find())&&!_(u,l))break;while(o>n&&n>i)}return s}var r=100,n=-1,o=0,i=0,a=new Array(r);return{cachedCursor:void 0,add:e,move:t}},yr=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var e=Cr.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var r=Cr.registerController.getRegister(t);r&&(r.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var Cr,kr,wr={buildKeyMap:function(){},getRegisterController:function(){return Cr.registerController},resetVimGlobalState_:M,getVimGlobalState_:function(){return Cr},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:rr,map:function(e,t,r){Ir.map(e,t,r)},setOption:C,getOption:k,defineOption:y,defineEx:function(e,t,r){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered');Er[e]=r,Ir.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,r){var n=this.findKey(e,t,r);return"function"==typeof n?n():void 0},findKey:function(r,n,o){function i(){var e=Cr.macroModeState;if(e.isRecording){if("q"==n)return e.exitMacroRecordMode(),b(r),!0;"mapping"!=o&&Qt(e,n)}}function a(){return""==n?(b(r),f.visualMode?st(r):f.insertMode&&Vt(r),!0):void 0}function s(t){for(var o;t;)o=/<\w+-.+?>|<\w+>|./.exec(t),n=o[0],t=t.substring(o.index+n.length),e.Vim.handleKey(r,n,"mapping")}function l(){if(a())return!0;for(var e=f.inputState.keyBuffer=f.inputState.keyBuffer+n,o=1==n.length,i=xr.matchCommand(e,t,f.inputState,"insert");e.length>1&&"full"!=i.type;){var e=f.inputState.keyBuffer=e.slice(1),s=xr.matchCommand(e,t,f.inputState,"insert");"none"!=s.type&&(i=s)}if("none"==i.type)return b(r),!1;if("partial"==i.type)return kr&&window.clearTimeout(kr),kr=window.setTimeout(function(){f.insertMode&&f.inputState.keyBuffer&&b(r)},k("insertModeEscKeysTimeout")),!o;if(kr&&window.clearTimeout(kr),o){var l=r.getCursor();r.replaceRange("",N(l,0,-(e.length-1)),l,"+input")}return b(r),i.command}function c(){if(i()||a())return!0;var e=f.inputState.keyBuffer=f.inputState.keyBuffer+n;if(/^[1-9]\d*$/.test(e))return!0;var o=/^(\d*)(.*)$/.exec(e);if(!o)return b(r),!1;var s=f.visualMode?"visual":"normal",l=xr.matchCommand(o[2]||o[1],t,f.inputState,s);if("none"==l.type)return b(r),!1;if("partial"==l.type)return!0;f.inputState.keyBuffer="";var o=/^(\d*)(.*)$/.exec(e);return o[1]&&"0"!=o[1]&&f.inputState.pushRepeatDigit(o[1]),l.command}var u,f=x(r);return u=f.insertMode?l():c(),u===!1?void 0:u===!0?function(){}:function(){return r.operation(function(){r.curOp.isVimOp=!0;try{"keyToKey"==u.type?s(u.toKeys):xr.processCommand(r,f,u)}catch(t){throw r.state.vim=void 0,x(r),e.Vim.suppressErrorLogging||console.log(t),t}return!0})}},handleEx:function(e,t){Ir.processCommand(e,t)},defineMotion:O,defineAction:I,defineOperator:E,mapCommand:Jt,_mapCommand:Ut,exitVisualMode:st,exitInsertMode:Vt};S.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},S.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},A.prototype={setText:function(e,t,r){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!r},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(yr(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},L.prototype={pushText:function(e,t,r,n,o){n&&"\n"==r.charAt(0)&&(r=r.slice(1)+"\n"),n&&"\n"!==r.charAt(r.length-1)&&(r+="\n");var i=this.isValidRegister(e)?this.getRegister(e):null;if(!i){switch(t){case"yank":this.registers[0]=new A(r,n,o);break;case"delete":case"change":-1==r.indexOf("\n")?this.registers["-"]=new A(r,n):(this.shiftNumericRegisters_(),this.registers[1]=new A(r,n))}return void this.unnamedRegister.setText(r,n,o)}var a=m(e);a?i.pushText(r,n):i.setText(r,n,o),this.unnamedRegister.setText(i.toString(),n)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new A),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&v(e,mr)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},T.prototype={nextMatch:function(e,t){var r=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+n;t?o>=0:o=r.length?(this.iterator=r.length,this.initialPrefix):0>o?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var xr={matchCommand:function(e,t,r,n){var o=F(e,t,n,r);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var i,a=0;a"==i.keys.slice(-11)&&(r.selectedCharacter=H(e)),{type:"full",command:i}},processCommand:function(e,t,r){switch(t.inputState.repeatOverride=r.repeatOverride,r.type){case"motion":this.processMotion(e,t,r);break;case"operator":this.processOperator(e,t,r);break;case"operatorMotion":this.processOperatorMotion(e,t,r);break;case"action":this.processAction(e,t,r);break;case"search":this.processSearch(e,t,r),b(e);break;case"ex":case"keyToEx":this.processEx(e,t,r),b(e)}},processMotion:function(e,t,r){t.inputState.motion=r.motion,t.inputState.motionArgs=P(r.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,r){var n=t.inputState;if(n.operator){if(n.operator==r.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);b(e)}n.operator=r.operator,n.operatorArgs=P(r.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,r){var n=t.visualMode,o=P(r.operatorMotionArgs);o&&n&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,r),n||this.processMotion(e,t,r)},processAction:function(e,t,r){var n=t.inputState,o=n.getRepeat(),i=!!o,a=P(r.actionArgs)||{};n.selectedCharacter&&(a.selectedCharacter=n.selectedCharacter),r.operator&&this.processOperator(e,t,r),r.motion&&this.processMotion(e,t,r),(r.motion||r.operator)&&this.evalInput(e,t),a.repeat=o||1,a.repeatIsExplicit=i,a.registerName=n.registerName,b(e),t.lastMotion=null,r.isEdit&&this.recordLastEdit(t,n,r),br[r.action](e,a,t)},processSearch:function(t,r,n){function o(e,o,i){Cr.searchHistoryController.pushInput(e),Cr.searchHistoryController.reset();try{Ft(t,e,o,i)}catch(a){return void Bt(t,"Invalid regex: "+e)}xr.processMotion(t,r,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}function i(e){t.scrollTo(h.left,h.top),o(e,!0,!0);var r=Cr.macroModeState;r.isRecording&&Yt(r,e)}function a(r,n,o){var i,a=e.keyName(r);"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=Cr.searchHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&Cr.searchHistoryController.reset();var s;try{s=Ft(t,n,!0,!0)}catch(r){}s?t.scrollIntoView(Dt(t,!l,s),30):(zt(t),t.scrollTo(h.left,h.top))}function s(r,n,o){var i=e.keyName(r);("Esc"==i||"Ctrl-C"==i||"Ctrl-["==i)&&(Cr.searchHistoryController.pushInput(n),Cr.searchHistoryController.reset(),Ft(t,f),zt(t),t.scrollTo(h.left,h.top),e.e_stop(r),o(),t.focus())}if(t.getSearchCursor){var l=n.searchArgs.forward,c=n.searchArgs.wholeWordOnly;bt(t).setReversed(!l);var u=l?"/":"?",f=bt(t).getQuery(),h=t.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var d=Cr.macroModeState;if(d.isPlaying){var p=d.replaySearchQueries.shift();o(p,!0,!1)}else Nt(t,{onClose:i,prefix:u,desc:Tr,onKeyUp:a,onKeyDown:s});break;case"wordUnderCursor":var m=ft(t,!1,!0,!1,!0),g=!0;if(m||(m=ft(t,!1,!0,!1,!1),g=!1),!m)return;var p=t.getLine(m.start.line).substring(m.start.ch,m.end.ch);p=g&&c?"\\b"+p+"\\b":G(p),Cr.jumpList.cachedCursor=t.getCursor(),t.setCursor(m.start),o(p,!0,!1)}}},processEx:function(t,r,n){function o(e){Cr.exCommandHistoryController.pushInput(e),Cr.exCommandHistoryController.reset(),Ir.processCommand(t,e)}function i(r,n,o){var i,a=e.keyName(r);("Esc"==a||"Ctrl-C"==a||"Ctrl-["==a)&&(Cr.exCommandHistoryController.pushInput(n),Cr.exCommandHistoryController.reset(),e.e_stop(r),o(),t.focus()),"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=Cr.exCommandHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&Cr.exCommandHistoryController.reset()}"keyToEx"==n.type?Ir.processCommand(t,n.exArgs.input):r.visualMode?Nt(t,{onClose:o,prefix:":",value:"'<,'>",onKeyDown:i}):Nt(t,{onClose:o,prefix:":",onKeyDown:i})},evalInput:function(e,t){var n,o,i,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},f=a.registerName,h=t.sel,d=z(t.visualMode?h.head:e.getCursor("head")),p=z(t.visualMode?h.anchor:e.getCursor("anchor")),m=z(d),g=z(p);if(c&&this.recordLastEdit(t,a),i=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat(),i>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===i)&&(i=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=i,b(e),s){var v=Mr[s](e,d,l,t);if(t.lastMotion=Mr[s],!v)return;if(l.toJumplist){var y=Cr.jumpList,C=y.cachedCursor;C?(ht(e,C,v),delete y.cachedCursor):ht(e,d,v)}v instanceof Array?(o=v[0],n=v[1]):n=v,n||(n=z(d)),t.visualMode?(t.visualBlock&&1/0===n.ch||(n=B(e,n,t.visualBlock)),o&&(o=B(e,o,!0)),o=o||g,h.anchor=o,h.head=n,ot(e),Ct(e,t,"<",W(o,n)?o:n),Ct(e,t,">",W(o,n)?n:o)):c||(n=B(e,n),e.setCursor(n.line,n.ch)) +}if(c){if(u.lastSel){o=g;var k=u.lastSel,w=Math.abs(k.head.line-k.anchor.line),x=Math.abs(k.head.ch-k.anchor.ch);n=k.visualLine?r(g.line+w,g.ch):k.visualBlock?r(g.line+w,g.ch+x):k.head.line==k.anchor.line?r(g.line,g.ch+x):r(g.line+w,g.ch),t.visualMode=!0,t.visualLine=k.visualLine,t.visualBlock=k.visualBlock,h=t.sel={anchor:o,head:n},ot(e)}else t.visualMode&&(u.lastSel={anchor:z(h.anchor),head:z(h.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var M,S,A,L,T;if(t.visualMode){if(M=q(h.head,h.anchor),S=V(h.head,h.anchor),A=t.visualLine||u.linewise,L=t.visualBlock?"block":A?"line":"char",T=it(e,{anchor:M,head:S},L),A){var O=T.ranges;if("block"==L)for(var R=0;Rl&&i.line==c||l>u&&i.line==u?void 0:(n.toFirstChar&&(a=ut(e.getLine(l)),o.lastHPos=a),o.lastHSPos=e.charCoords(r(l,a),"div").left,r(l,a))},moveByDisplayLines:function(e,t,n,o){var i=t;switch(o.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:o.lastHSPos=e.charCoords(i,"div").left}var a=n.repeat,s=e.findPosV(i,n.forward?a:-a,"line",o.lastHSPos);if(s.hitSide)if(n.forward)var l=e.charCoords(s,"div"),c={top:l.top+8,left:o.lastHSPos},s=e.coordsChar(c,"div");else{var u=e.charCoords(r(e.firstLine(),0),"div");u.left=o.lastHSPos,s=e.coordsChar(u,"div")}return o.lastHPos=s.ch,s},moveByPage:function(e,t,r){var n=t,o=r.repeat;return e.findPosV(n,r.forward?o:-o,"page")},moveByParagraph:function(e,t,r){var n=r.forward?1:-1;return wt(e,t,r.repeat,n)},moveByScroll:function(e,t,r,n){var o=e.getScrollInfo(),i=null,a=r.repeat;a||(a=o.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");r.repeat=a;var i=Mr.moveByDisplayLines(e,t,r,n);if(!i)return null;var l=e.charCoords(i,"local");return e.scrollTo(null,o.top+l.top-s.top),i},moveByWords:function(e,t,r){return gt(e,t,r.repeat,!!r.forward,!!r.wordEnd,!!r.bigWord)},moveTillCharacter:function(e,t,r){var n=r.repeat,o=vt(e,n,r.forward,r.selectedCharacter),i=r.forward?-1:1;return dt(i,r),o?(o.ch+=i,o):null},moveToCharacter:function(e,t,r){var n=r.repeat;return dt(0,r),vt(e,n,r.forward,r.selectedCharacter)||t},moveToSymbol:function(e,t,r){var n=r.repeat;return pt(e,n,r.forward,r.selectedCharacter)||t},moveToColumn:function(e,t,r,n){var o=r.repeat;return n.lastHPos=o-1,n.lastHSPos=e.charCoords(t,"div").left,yt(e,o)},moveToEol:function(e,t,n,o){var i=t;o.lastHPos=1/0;var a=r(i.line+n.repeat-1,1/0),s=e.clipPos(a);return s.ch--,o.lastHSPos=e.charCoords(s,"div").left,a},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return r(n.line,ut(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n,o=t,i=o.line,a=o.ch,s=e.getLine(i);do if(n=s.charAt(a++),n&&d(n)){var l=e.getTokenTypeAt(r(i,a));if("string"!==l&&"comment"!==l)break}while(n);if(n){var c=e.findMatchingBracket(r(i,a));return c.to}return o},moveToStartOfLine:function(e,t){return r(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var o=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(o=n.repeat-e.getOption("firstLineNumber")),r(o,ut(e.getLine(o)))},textObjectManipulation:function(e,t,r,n){var o={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},i={"'":!0,'"':!0},a=r.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!r.textObjectInner;if(o[a])s=xt(e,t,a,l);else if(i[a])s=Mt(e,t,a,l);else if("W"===a)s=ft(e,l,!0,!0);else if("w"===a)s=ft(e,l,!0,!1);else{if("p"!==a)return null;if(s=wt(e,t,r.repeat,0,l),r.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var c=n.inputState.operatorArgs;c&&(c.linewise=!0),s.end.line--}}return e.state.vim.visualMode?nt(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,r){var n=Cr.lastChararacterSearch,o=r.repeat,i=r.forward===n.forward,a=(n.increment?1:0)*(i?-1:1);e.moveH(-a,"char"),r.inclusive=i?!0:!1;var s=vt(e,o,i,n.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}},Sr={change:function(t,r,n){var o,i,a=t.state.vim;if(Cr.macroModeState.lastInsertModeChanges.inVisualBlock=a.visualBlock,a.visualMode){i=t.getSelection();var s=R("",n.length);t.replaceSelections(s),o=q(n[0].head,n[0].anchor)}else{var l=n[0].anchor,c=n[0].head;if(i=t.getRange(l,c),!g(i)){var u=/\s+$/.exec(i);u&&(c=N(c,0,-u[0].length),i=i.slice(0,-u[0].length))}var f=c.line-1==t.lastLine();t.replaceRange("",l,c),r.linewise&&!f&&(e.commands.newlineAndIndent(t),l.ch=null),o=l}Cr.registerController.pushText(r.registerName,"change",i,r.linewise,n.length>1),br.enterInsertMode(t,{head:o},t.state.vim)},"delete":function(e,t,n){var o,i,a=e.state.vim;if(a.visualBlock){i=e.getSelection();var s=R("",n.length);e.replaceSelections(s),o=n[0].anchor}else{var l=n[0].anchor,c=n[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=r(l.line-1,J(e,l.line-1))),i=e.getRange(l,c),e.replaceRange("",l,c),o=l,t.linewise&&(o=Mr.moveToFirstNonWhiteSpaceCharacter(e,l))}return Cr.registerController.pushText(t.registerName,"delete",i,t.linewise,a.visualBlock),B(e,o)},indent:function(e,t,r){var n=e.state.vim,o=r[0].anchor.line,i=n.visualBlock?r[r.length-1].anchor.line:r[0].head.line,a=n.visualMode?t.repeat:1;t.linewise&&i--;for(var s=o;i>=s;s++)for(var l=0;a>l;l++)e.indentLine(s,t.indentRight);return Mr.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},changeCase:function(e,t,r,n,o){for(var i=e.getSelections(),a=[],s=t.toLower,l=0;lc.top?(l.line+=(s-c.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u=a.anchor.line?N(a.head,0,1):r(a.anchor.line,0);else if("inplace"==i&&o.visualMode)return;t.setOption("keyMap","vim-insert"),t.setOption("disableInput",!1),n&&n.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})),Cr.macroModeState.isPlaying||(t.on("change",Xt),e.on(t.getInputField(),"keydown",nr)),o.visualMode&&st(t),Z(t,s,l)}},toggleVisualMode:function(t,n,o){var i,a=n.repeat,s=t.getCursor();o.visualMode?o.visualLine^n.linewise||o.visualBlock^n.blockwise?(o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t)):st(t):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,i=B(t,r(s.line,s.ch+a-1),!0),o.sel={anchor:s,head:i},e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t),Ct(t,o,"<",q(s,i)),Ct(t,o,">",V(s,i)))},reselectLastSelection:function(t,r,n){var o=n.lastSelection;if(n.visualMode&&rt(t,n),o){var i=o.anchorMark.find(),a=o.headMark.find();if(!i||!a)return;n.sel={anchor:i,head:a},n.visualMode=!0,n.visualLine=o.visualLine,n.visualBlock=o.visualBlock,ot(t),Ct(t,n,"<",q(i,a)),Ct(t,n,">",V(i,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var o,i;if(n.visualMode){if(o=e.getCursor("anchor"),i=e.getCursor("head"),W(i,o)){var a=i;i=o,o=a}i.ch=J(e,i.line)-1}else{var s=Math.max(t.repeat,2);o=e.getCursor(),i=B(e,r(o.line+s-1,1/0))}for(var l=0,c=o.line;cr)return"";if(e.getOption("indentWithTabs")){var n=Math.floor(r/s);return Array(n+1).join(" ")}return Array(r+1).join(" ")});a+=h?"\n":""}if(t.repeat>1)var a=Array(t.repeat+1).join(a);var p=i.linewise,m=i.blockwise;if(p)n.visualMode?a=n.visualLine?a.slice(0,-1):"\n"+a.slice(0,a.length-1)+"\n":t.after?(a="\n"+a.slice(0,a.length-1),o.ch=J(e,o.line)):o.ch=0;else{if(m){a=a.split("\n");for(var g=0;ge.lastLine()&&e.replaceRange("\n",r(A,0));var L=J(e,A);Lu.length&&(i=u.length),a=r(l.line,i)}if("\n"==s)o.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var f=t.getRange(l,a);if(f=f.replace(/[^\n]/g,s),o.visualBlock){var h=new Array(t.getOption("tabSize")+1).join(" ");f=t.getSelection(),f=f.replace(/\t/g,h).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(f)}else t.replaceRange(f,l,a);o.visualMode?(l=W(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),st(t,!1)):t.setCursor(N(a,0,-1))}},incrementNumberToken:function(e,t){for(var n,o,i,a,s,l=e.getCursor(),c=e.getLine(l.line),u=/-?\d+/g;null!==(n=u.exec(c))&&(s=n[0],o=n.index,i=o+s.length,!(l.ch=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb?!0:!1}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};y("pcre",!0,"boolean"),St.prototype={getQuery:function(){return Cr.query},setQuery:function(e){Cr.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return Cr.isReversed},setReversed:function(e){Cr.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Tr="(Javascript regexp)",Or=[{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:"set"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],Rr=function(){this.buildCommandMap_()};Rr.prototype={processCommand:function(t,r,n){var o=t.state.vim,i=Cr.registerController.getRegister(":"),a=i.toString();o.visualMode&&st(t);var s=new e.StringStream(r);i.setText(r);var l=n||{};l.input=r;try{this.parseInput_(t,s,l)}catch(c){throw Bt(t,c),c}var u,f;if(l.commandName){if(u=this.matchCommand_(l.commandName)){if(f=u.name,u.excludeFromCommandHistory&&i.setText(a),this.parseCommandArgs_(s,l,u),"exToKey"==u.type){for(var h=0;h0;t--){var r=e.substring(0,t);if(this.commandMap_[r]){var n=this.commandMap_[r];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e
";if(r){var i;r=r.join("");for(var a=0;a"}}else for(var i in n){var l=n[i].toString();l.length&&(o+='"'+i+" "+l+"
")}Bt(e,o)},sort:function(t,n){function o(){if(n.argString){var t=new e.StringStream(n.argString);if(t.eat("!")&&(a=!0),t.eol())return;if(!t.eatSpace())return"Invalid arguments";var r=t.match(/[a-z]+/);if(r){r=r[0],s=-1!=r.indexOf("i"),l=-1!=r.indexOf("u");var o=-1!=r.indexOf("d")&&1,i=-1!=r.indexOf("x")&&1,u=-1!=r.indexOf("o")&&1;if(o+i+u>1)return"Invalid arguments";c=o&&"decimal"||i&&"hex"||u&&"octal"}t.eatSpace()&&t.match(/\/.*\//)}}function i(e,t){if(a){var r;r=e,e=t,t=r}s&&(e=e.toLowerCase(),t=t.toLowerCase());var n=c&&g.exec(e),o=c&&g.exec(t);return n?(n=parseInt((n[1]+n[2]).toLowerCase(),v),o=parseInt((o[1]+o[2]).toLowerCase(),v),n-o):t>e?-1:1}var a,s,l,c,u=o();if(u)return void Bt(t,u+": "+n.argString);var f=n.line||t.firstLine(),h=n.lineEnd||n.line||t.lastLine();if(f!=h){var d=r(f,0),p=r(h,J(t,h)),m=t.getRange(d,p).split("\n"),g="decimal"==c?/(-?)([\d]+)/:"hex"==c?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==c?/([0-7]+)/:null,v="decimal"==c?10:"hex"==c?16:"octal"==c?8:null,y=[],C=[];if(c)for(var k=0;k=h;h++){var d=c.test(e.getLine(h));d&&(u.push(h+1),f+=e.getLine(h)+"
")}if(!n)return void Bt(e,f);var p=0,m=function(){if(p=u)return void Bt(t,"Invalid argument: "+r.argString.substring(i));for(var f=0;u-c>=f;f++){var d=String.fromCharCode(c+f);delete n.marks[d]}}else delete n.marks[a]}}},Ir=new Rr;return e.keyMap.vim={attach:a,detach:i,call:s},y("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(t){var r=e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent;r(t)},fallthrough:["default"],attach:a,detach:i,call:s},e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:a,detach:i,call:s},M(),wr};e.Vim=n()}); \ No newline at end of file diff --git a/media/editors/codemirror/lib/codemirror-uncompressed.css b/media/editors/codemirror/lib/codemirror-uncompressed.css deleted file mode 100644 index cb4110a2daac2..0000000000000 --- a/media/editors/codemirror/lib/codemirror-uncompressed.css +++ /dev/null @@ -1,406 +0,0 @@ -/* BASICS */ - -.CodeMirror { - /* Set height, width, borders, and global font properties here */ - font-family: monospace; - height: 300px; -} - -/* PADDING */ - -.CodeMirror-lines { - padding: 4px 0; /* Vertical padding around content */ -} -.CodeMirror pre { - padding: 0 4px; /* Horizontal padding of content */ -} - -.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - background-color: white; /* The little square between H and V scrollbars */ -} - -/* GUTTER */ - -.CodeMirror-gutters { - border-right: 1px solid #ddd; - background-color: #f7f7f7; - white-space: nowrap; -} -.CodeMirror-linenumbers {} -.CodeMirror-linenumber { - padding: 0 3px 0 5px; - min-width: 20px; - text-align: right; - color: #999; - -moz-box-sizing: content-box; - box-sizing: content-box; -} - -.CodeMirror-guttermarker { color: black; } -.CodeMirror-guttermarker-subtle { color: #999; } - -/* CURSOR */ - -.CodeMirror div.CodeMirror-cursor { - border-left: 1px solid black; -} -/* Shown when moving in bi-directional text */ -.CodeMirror div.CodeMirror-secondarycursor { - border-left: 1px solid silver; -} -.CodeMirror.cm-fat-cursor div.CodeMirror-cursor { - width: auto; - border: 0; - background: #7e7; -} -.CodeMirror.cm-fat-cursor div.CodeMirror-cursors { - z-index: 1; -} - -.cm-animate-fat-cursor { - width: auto; - border: 0; - -webkit-animation: blink 1.06s steps(1) infinite; - -moz-animation: blink 1.06s steps(1) infinite; - animation: blink 1.06s steps(1) infinite; -} -@-moz-keyframes blink { - 0% { background: #7e7; } - 50% { background: none; } - 100% { background: #7e7; } -} -@-webkit-keyframes blink { - 0% { background: #7e7; } - 50% { background: none; } - 100% { background: #7e7; } -} -@keyframes blink { - 0% { background: #7e7; } - 50% { background: none; } - 100% { background: #7e7; } -} - -/* Can style cursor different in overwrite (non-insert) mode */ -div.CodeMirror-overwrite div.CodeMirror-cursor {} - -.cm-tab { display: inline-block; text-decoration: inherit; } - -.CodeMirror-ruler { - border-left: 1px solid #ccc; - position: absolute; -} - -/* DEFAULT THEME */ - -.cm-s-default .cm-keyword {color: #708;} -.cm-s-default .cm-atom {color: #219;} -.cm-s-default .cm-number {color: #164;} -.cm-s-default .cm-def {color: #00f;} -.cm-s-default .cm-variable, -.cm-s-default .cm-punctuation, -.cm-s-default .cm-property, -.cm-s-default .cm-operator {} -.cm-s-default .cm-variable-2 {color: #05a;} -.cm-s-default .cm-variable-3 {color: #085;} -.cm-s-default .cm-comment {color: #a50;} -.cm-s-default .cm-string {color: #a11;} -.cm-s-default .cm-string-2 {color: #f50;} -.cm-s-default .cm-meta {color: #555;} -.cm-s-default .cm-qualifier {color: #555;} -.cm-s-default .cm-builtin {color: #30a;} -.cm-s-default .cm-bracket {color: #997;} -.cm-s-default .cm-tag {color: #170;} -.cm-s-default .cm-attribute {color: #00c;} -.cm-s-default .cm-header {color: blue;} -.cm-s-default .cm-quote {color: #090;} -.cm-s-default .cm-hr {color: #999;} -.cm-s-default .cm-link {color: #00c;} - -.cm-negative {color: #d44;} -.cm-positive {color: #292;} -.cm-header, .cm-strong {font-weight: bold;} -.cm-em {font-style: italic;} -.cm-link {text-decoration: underline;} -.cm-strikethrough {text-decoration: line-through;} - -.cm-s-default .cm-error {color: #f00;} -.cm-invalidchar {color: #f00;} - -/* Default styles for common addons */ - -div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} -div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} -.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } -.CodeMirror-activeline-background {background: #e8f2ff;} - -/* STOP */ - -/* The rest of this file contains styles related to the mechanics of - the editor. You probably shouldn't touch them. */ - -.CodeMirror { - line-height: 1; - position: relative; - overflow: hidden; - background: white; - color: black; -} - -.CodeMirror-scroll { - overflow: scroll !important; /* Things will break if this is overridden */ - /* 30px is the magic margin used to hide the element's real scrollbars */ - /* See overflow: hidden in .CodeMirror */ - margin-bottom: -30px; margin-right: -30px; - padding-bottom: 30px; - height: 100%; - outline: none; /* Prevent dragging from highlighting the element */ - position: relative; - -moz-box-sizing: content-box; - box-sizing: content-box; -} -.CodeMirror-sizer { - position: relative; - border-right: 30px solid transparent; - -moz-box-sizing: content-box; - box-sizing: content-box; -} - -/* The fake, visible scrollbars. Used to force redraw during scrolling - before actuall scrolling happens, thus preventing shaking and - flickering artifacts. */ -.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { - position: absolute; - z-index: 6; - display: none; -} -.CodeMirror-vscrollbar { - right: 0; top: 0; - overflow-x: hidden; - overflow-y: scroll; -} -.CodeMirror-hscrollbar { - bottom: 0; left: 0; - overflow-y: hidden; - overflow-x: scroll; -} -.CodeMirror-scrollbar-filler { - right: 0; bottom: 0; -} -.CodeMirror-gutter-filler { - left: 0; bottom: 0; -} - -.CodeMirror-gutters { - position: absolute; left: 0; top: 0; - z-index: 3; -} -.CodeMirror-gutter { - white-space: normal; - height: 100%; - -moz-box-sizing: content-box; - box-sizing: content-box; - display: inline-block; - margin-bottom: -30px; - /* Hack to make IE7 behave */ - *zoom:1; - *display:inline; -} -.CodeMirror-gutter-wrapper { - position: absolute; - z-index: 4; - height: 100%; -} -.CodeMirror-gutter-elt { - position: absolute; - cursor: default; - z-index: 4; -} - -.CodeMirror-lines { - cursor: text; - min-height: 1px; /* prevents collapsing before first draw */ -} -.CodeMirror pre { - /* Reset some styles that the rest of the page might have set */ - -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; - border-width: 0; - background: transparent; - font-family: inherit; - font-size: inherit; - margin: 0; - white-space: pre; - word-wrap: normal; - line-height: inherit; - color: inherit; - z-index: 2; - position: relative; - overflow: visible; -} -.CodeMirror-wrap pre { - word-wrap: break-word; - white-space: pre-wrap; - word-break: normal; -} - -.CodeMirror-linebackground { - position: absolute; - left: 0; right: 0; top: 0; bottom: 0; - z-index: 0; -} - -.CodeMirror-linewidget { - position: relative; - z-index: 2; - overflow: auto; -} - -.CodeMirror-widget {} - -.CodeMirror-measure { - position: absolute; - width: 100%; - height: 0; - overflow: hidden; - visibility: hidden; -} -.CodeMirror-measure pre { position: static; } - -.CodeMirror div.CodeMirror-cursor { - position: absolute; - border-right: none; - width: 0; -} - -div.CodeMirror-cursors { - visibility: hidden; - position: relative; - z-index: 3; -} -.CodeMirror-focused div.CodeMirror-cursors { - visibility: visible; -} - -.CodeMirror-selected { background: #d9d9d9; } -.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } -.CodeMirror-crosshair { cursor: crosshair; } - -.cm-searching { - background: #ffa; - background: rgba(255, 255, 0, .4); -} - -/* IE7 hack to prevent it from returning funny offsetTops on the spans */ -.CodeMirror span { *vertical-align: text-bottom; } - -/* Used to force a border model for a node */ -.cm-force-border { padding-right: .1px; } - -@media print { - /* Hide the cursor when printing */ - .CodeMirror div.CodeMirror-cursors { - visibility: hidden; - } -} - -/* See issue #2901 */ -.cm-tab-wrap-hack:after { content: ''; } - -/* Help users use markselection to safely style text background */ -span.CodeMirror-selectedtext { background: none; } -/** - * addon/display/fullscreen.css - * addon/fold/foldgutter.css - * addon/scroll/simplescrollbars.css -**/ -.CodeMirror-fullscreen { - position: fixed; - top: 0; left: 0; right: 0; bottom: 0; - height: auto; - z-index: 9; -} -.CodeMirror-foldmarker { - color: blue; - text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; - font-family: arial; - line-height: .3; - cursor: pointer; -} -.CodeMirror-foldgutter { - width: .7em; -} -.CodeMirror-foldgutter-open, -.CodeMirror-foldgutter-folded { - cursor: pointer; -} -.CodeMirror-foldgutter-open:after { - content: "\25BE"; -} -.CodeMirror-foldgutter-folded:after { - content: "\25B8"; -} -.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { - position: absolute; - background: #ccc; - -moz-box-sizing: border-box; - box-sizing: border-box; - border: 1px solid #bbb; - border-radius: 2px; -} - -.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { - position: absolute; - z-index: 6; - background: #eee; -} - -.CodeMirror-simplescroll-horizontal { - bottom: 0; left: 0; - height: 8px; -} -.CodeMirror-simplescroll-horizontal div { - bottom: 0; - height: 100%; -} - -.CodeMirror-simplescroll-vertical { - right: 0; top: 0; - width: 8px; -} -.CodeMirror-simplescroll-vertical div { - right: 0; - width: 100%; -} - - -.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { - display: none; -} - -.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { - position: absolute; - background: #bcd; - border-radius: 3px; -} - -.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { - position: absolute; - z-index: 6; -} - -.CodeMirror-overlayscroll-horizontal { - bottom: 0; left: 0; - height: 6px; -} -.CodeMirror-overlayscroll-horizontal div { - bottom: 0; - height: 100%; -} - -.CodeMirror-overlayscroll-vertical { - right: 0; top: 0; - width: 6px; -} -.CodeMirror-overlayscroll-vertical div { - right: 0; - width: 100%; -} diff --git a/media/editors/codemirror/lib/codemirror-uncompressed.js b/media/editors/codemirror/lib/codemirror-uncompressed.js deleted file mode 100644 index 03a34dbbfb78b..0000000000000 --- a/media/editors/codemirror/lib/codemirror-uncompressed.js +++ /dev/null @@ -1,8045 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// This is CodeMirror (http://codemirror.net), a code editor -// implemented in JavaScript on top of the browser's DOM. -// -// You can find some technical background for some of the code below -// at http://marijnhaverbeke.nl/blog/#cm-internals . - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - module.exports = mod(); - else if (typeof define == "function" && define.amd) // AMD - return define([], mod); - else // Plain browser env - this.CodeMirror = mod(); -})(function() { - "use strict"; - - // BROWSER SNIFFING - - // Kludges for bugs and behavior differences that can't be feature - // detected are enabled based on userAgent etc sniffing. - - var gecko = /gecko\/\d/i.test(navigator.userAgent); - // ie_uptoN means Internet Explorer version N or lower - var ie_upto10 = /MSIE \d/.test(navigator.userAgent); - var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent); - var ie = ie_upto10 || ie_11up; - var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]); - var webkit = /WebKit\//.test(navigator.userAgent); - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); - var chrome = /Chrome\//.test(navigator.userAgent); - var presto = /Opera\//.test(navigator.userAgent); - var safari = /Apple Computer/.test(navigator.vendor); - var khtml = /KHTML\//.test(navigator.userAgent); - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent); - var phantom = /PhantomJS/.test(navigator.userAgent); - - var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); - // This is woefully incomplete. Suggestions for alternative methods welcome. - var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent); - var mac = ios || /Mac/.test(navigator.platform); - var windows = /win/i.test(navigator.platform); - - var presto_version = presto && navigator.userAgent.match(/Version\/(\d*\.\d*)/); - if (presto_version) presto_version = Number(presto_version[1]); - if (presto_version && presto_version >= 15) { presto = false; webkit = true; } - // Some browsers use the wrong event properties to signal cmd/ctrl on OS X - var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); - var captureRightClick = gecko || (ie && ie_version >= 9); - - // Optimize some code when these features are not used. - var sawReadOnlySpans = false, sawCollapsedSpans = false; - - // EDITOR CONSTRUCTOR - - // A CodeMirror instance represents an editor. This is the object - // that user code is usually dealing with. - - function CodeMirror(place, options) { - if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); - - this.options = options = options ? copyObj(options) : {}; - // Determine effective options based on given values and defaults. - copyObj(defaults, options, false); - setGuttersForLineNumbers(options); - - var doc = options.value; - if (typeof doc == "string") doc = new Doc(doc, options.mode); - this.doc = doc; - - var display = this.display = new Display(place, doc); - display.wrapper.CodeMirror = this; - updateGutters(this); - themeChanged(this); - if (options.lineWrapping) - this.display.wrapper.className += " CodeMirror-wrap"; - if (options.autofocus && !mobile) focusInput(this); - initScrollbars(this); - - this.state = { - keyMaps: [], // stores maps added by addKeyMap - overlays: [], // highlighting overlays, as added by addOverlay - modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info - overwrite: false, focused: false, - suppressEdits: false, // used to disable editing during key handlers when in readOnly mode - pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in readInput - draggingText: false, - highlight: new Delayed(), // stores highlight worker timeout - keySeq: null // Unfinished key sequence - }; - - // Override magic textarea content restore that IE sometimes does - // on our hidden textarea on reload - if (ie && ie_version < 11) setTimeout(bind(resetInput, this, true), 20); - - registerEventHandlers(this); - ensureGlobalHandlers(); - - startOperation(this); - this.curOp.forceUpdate = true; - attachDoc(this, doc); - - if ((options.autofocus && !mobile) || activeElt() == display.input) - setTimeout(bind(onFocus, this), 20); - else - onBlur(this); - - for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) - optionHandlers[opt](this, options[opt], Init); - maybeUpdateLineNumberWidth(this); - for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); - endOperation(this); - // Suppress optimizelegibility in Webkit, since it breaks text - // measuring on line wrapping boundaries. - if (webkit && options.lineWrapping && - getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") - display.lineDiv.style.textRendering = "auto"; - } - - // DISPLAY CONSTRUCTOR - - // The display handles the DOM integration, both for input reading - // and content drawing. It holds references to DOM nodes and - // display-related state. - - function Display(place, doc) { - var d = this; - - // The semihidden textarea that is focused when the editor is - // focused, and receives input. - var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none"); - // The textarea is kept positioned near the cursor to prevent the - // fact that it'll be scrolled into view on input from scrolling - // our fake cursor out of view. On webkit, when wrap=off, paste is - // very slow. So make the area wide instead. - if (webkit) input.style.width = "1000px"; - else input.setAttribute("wrap", "off"); - // If border: 0; -- iOS fails to open keyboard (issue #1287) - if (ios) input.style.border = "1px solid black"; - input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off"); input.setAttribute("spellcheck", "false"); - - // Wraps and hides input textarea - d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); - // Covers bottom-right square when both scrollbars are present. - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); - d.scrollbarFiller.setAttribute("not-content", "true"); - // Covers bottom of gutter when coverGutterNextToScrollbar is on - // and h scrollbar is present. - d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); - d.gutterFiller.setAttribute("not-content", "true"); - // Will contain the actual code, positioned to cover the viewport. - d.lineDiv = elt("div", null, "CodeMirror-code"); - // Elements are added to these to represent selection and cursors. - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); - d.cursorDiv = elt("div", null, "CodeMirror-cursors"); - // A visibility: hidden element used to find the size of things. - d.measure = elt("div", null, "CodeMirror-measure"); - // When lines outside of the viewport are measured, they are drawn in this. - d.lineMeasure = elt("div", null, "CodeMirror-measure"); - // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], - null, "position: relative; outline: none"); - // Moved around its parent to cover visible view. - d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); - // Set to the height of the document, allowing scrolling. - d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); - d.sizerWidth = null; - // Behavior of elts with overflow: auto and padding is - // inconsistent across browsers. This is used to ensure the - // scrollable area is big enough. - d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); - // Will contain the gutters, if any. - d.gutters = elt("div", null, "CodeMirror-gutters"); - d.lineGutter = null; - // Actual scrollable element. - d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); - d.scroller.setAttribute("tabIndex", "-1"); - // The element in which the editor lives. - d.wrapper = elt("div", [d.inputDiv, d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); - - // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) - if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } - // Needed to hide big blue blinking cursor on Mobile Safari - if (ios) input.style.width = "0px"; - if (!webkit) d.scroller.draggable = true; - // Needed to handle Tab key in KHTML - if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; } - - if (place) { - if (place.appendChild) place.appendChild(d.wrapper); - else place(d.wrapper); - } - - // Current rendered range (may be bigger than the view window). - d.viewFrom = d.viewTo = doc.first; - d.reportedViewFrom = d.reportedViewTo = doc.first; - // Information about the rendered lines. - d.view = []; - d.renderedView = null; - // Holds info about a single rendered line when it was rendered - // for measurement, while not in view. - d.externalMeasured = null; - // Empty space (in pixels) above the view - d.viewOffset = 0; - d.lastWrapHeight = d.lastWrapWidth = 0; - d.updateLineNumbers = null; - - d.nativeBarWidth = d.barHeight = d.barWidth = 0; - d.scrollbarsClipped = false; - - // Used to only resize the line number gutter when necessary (when - // the amount of lines crosses a boundary that makes its width change) - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; - // See readInput and resetInput - d.prevInput = ""; - // Set to true when a non-horizontal-scrolling line widget is - // added. As an optimization, line widget aligning is skipped when - // this is false. - d.alignWidgets = false; - // Flag that indicates whether we expect input to appear real soon - // now (after some event like 'keypress' or 'input') and are - // polling intensively. - d.pollingFast = false; - // Self-resetting timeout for the poller - d.poll = new Delayed(); - - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - - // Tracks when resetInput has punted to just putting a short - // string into the textarea instead of the full selection. - d.inaccurateSelection = false; - - // Tracks the maximum line length so that the horizontal scrollbar - // can be kept static when scrolling. - d.maxLine = null; - d.maxLineLength = 0; - d.maxLineChanged = false; - - // Used for measuring wheel scrolling granularity - d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; - - // True when shift is held down. - d.shift = false; - - // Used to track whether anything happened since the context menu - // was opened. - d.selForContextMenu = null; - } - - // STATE UPDATES - - // Used to get the editor into a consistent state again when options change. - - function loadMode(cm) { - cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption); - resetModeState(cm); - } - - function resetModeState(cm) { - cm.doc.iter(function(line) { - if (line.stateAfter) line.stateAfter = null; - if (line.styles) line.styles = null; - }); - cm.doc.frontier = cm.doc.first; - startWorker(cm, 100); - cm.state.modeGen++; - if (cm.curOp) regChange(cm); - } - - function wrappingChanged(cm) { - if (cm.options.lineWrapping) { - addClass(cm.display.wrapper, "CodeMirror-wrap"); - cm.display.sizer.style.minWidth = ""; - cm.display.sizerWidth = null; - } else { - rmClass(cm.display.wrapper, "CodeMirror-wrap"); - findMaxLine(cm); - } - estimateLineHeights(cm); - regChange(cm); - clearCaches(cm); - setTimeout(function(){updateScrollbars(cm);}, 100); - } - - // Returns a function that estimates the height of a line, to use as - // first approximation until the line becomes visible (and is thus - // properly measurable). - function estimateHeight(cm) { - var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; - var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); - return function(line) { - if (lineIsHidden(cm.doc, line)) return 0; - - var widgetsHeight = 0; - if (line.widgets) for (var i = 0; i < line.widgets.length; i++) { - if (line.widgets[i].height) widgetsHeight += line.widgets[i].height; - } - - if (wrapping) - return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; - else - return widgetsHeight + th; - }; - } - - function estimateLineHeights(cm) { - var doc = cm.doc, est = estimateHeight(cm); - doc.iter(function(line) { - var estHeight = est(line); - if (estHeight != line.height) updateLineHeight(line, estHeight); - }); - } - - function themeChanged(cm) { - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + - cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); - clearCaches(cm); - } - - function guttersChanged(cm) { - updateGutters(cm); - regChange(cm); - setTimeout(function(){alignHorizontally(cm);}, 20); - } - - // Rebuild the gutter elements, ensure the margin to the left of the - // code matches their width. - function updateGutters(cm) { - var gutters = cm.display.gutters, specs = cm.options.gutters; - removeChildren(gutters); - for (var i = 0; i < specs.length; ++i) { - var gutterClass = specs[i]; - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); - if (gutterClass == "CodeMirror-linenumbers") { - cm.display.lineGutter = gElt; - gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; - } - } - gutters.style.display = i ? "" : "none"; - updateGutterSpace(cm); - } - - function updateGutterSpace(cm) { - var width = cm.display.gutters.offsetWidth; - cm.display.sizer.style.marginLeft = width + "px"; - } - - // Compute the character length of a line, taking into account - // collapsed ranges (see markText) that might hide parts, and join - // other lines onto it. - function lineLength(line) { - if (line.height == 0) return 0; - var len = line.text.length, merged, cur = line; - while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(0, true); - cur = found.from.line; - len += found.from.ch - found.to.ch; - } - cur = line; - while (merged = collapsedSpanAtEnd(cur)) { - var found = merged.find(0, true); - len -= cur.text.length - found.from.ch; - cur = found.to.line; - len += cur.text.length - found.to.ch; - } - return len; - } - - // Find the longest line in the document. - function findMaxLine(cm) { - var d = cm.display, doc = cm.doc; - d.maxLine = getLine(doc, doc.first); - d.maxLineLength = lineLength(d.maxLine); - d.maxLineChanged = true; - doc.iter(function(line) { - var len = lineLength(line); - if (len > d.maxLineLength) { - d.maxLineLength = len; - d.maxLine = line; - } - }); - } - - // Make sure the gutters options contains the element - // "CodeMirror-linenumbers" when the lineNumbers option is true. - function setGuttersForLineNumbers(options) { - var found = indexOf(options.gutters, "CodeMirror-linenumbers"); - if (found == -1 && options.lineNumbers) { - options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); - } else if (found > -1 && !options.lineNumbers) { - options.gutters = options.gutters.slice(0); - options.gutters.splice(found, 1); - } - } - - // SCROLLBARS - - // Prepare DOM reads needed to update the scrollbars. Done in one - // shot to minimize update/measure roundtrips. - function measureForScrollbars(cm) { - var d = cm.display, gutterW = d.gutters.offsetWidth; - var docH = Math.round(cm.doc.height + paddingVert(cm.display)); - return { - clientHeight: d.scroller.clientHeight, - viewHeight: d.wrapper.clientHeight, - scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, - viewWidth: d.wrapper.clientWidth, - barLeft: cm.options.fixedGutter ? gutterW : 0, - docHeight: docH, - scrollHeight: docH + scrollGap(cm) + d.barHeight, - nativeBarWidth: d.nativeBarWidth, - gutterWidth: gutterW - }; - } - - function NativeScrollbars(place, scroll, cm) { - this.cm = cm; - var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); - var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); - place(vert); place(horiz); - - on(vert, "scroll", function() { - if (vert.clientHeight) scroll(vert.scrollTop, "vertical"); - }); - on(horiz, "scroll", function() { - if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal"); - }); - - this.checkedOverlay = false; - // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; - } - - NativeScrollbars.prototype = copyObj({ - update: function(measure) { - var needsH = measure.scrollWidth > measure.clientWidth + 1; - var needsV = measure.scrollHeight > measure.clientHeight + 1; - var sWidth = measure.nativeBarWidth; - - if (needsV) { - this.vert.style.display = "block"; - this.vert.style.bottom = needsH ? sWidth + "px" : "0"; - var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); - // A bug in IE8 can cause this value to be negative, so guard it. - this.vert.firstChild.style.height = - Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; - } else { - this.vert.style.display = ""; - this.vert.firstChild.style.height = "0"; - } - - if (needsH) { - this.horiz.style.display = "block"; - this.horiz.style.right = needsV ? sWidth + "px" : "0"; - this.horiz.style.left = measure.barLeft + "px"; - var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); - this.horiz.firstChild.style.width = - (measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; - } else { - this.horiz.style.display = ""; - this.horiz.firstChild.style.width = "0"; - } - - if (!this.checkedOverlay && measure.clientHeight > 0) { - if (sWidth == 0) this.overlayHack(); - this.checkedOverlay = true; - } - - return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}; - }, - setScrollLeft: function(pos) { - if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos; - }, - setScrollTop: function(pos) { - if (this.vert.scrollTop != pos) this.vert.scrollTop = pos; - }, - overlayHack: function() { - var w = mac && !mac_geMountainLion ? "12px" : "18px"; - this.horiz.style.minHeight = this.vert.style.minWidth = w; - var self = this; - var barMouseDown = function(e) { - if (e_target(e) != self.vert && e_target(e) != self.horiz) - operation(self.cm, onMouseDown)(e); - }; - on(this.vert, "mousedown", barMouseDown); - on(this.horiz, "mousedown", barMouseDown); - }, - clear: function() { - var parent = this.horiz.parentNode; - parent.removeChild(this.horiz); - parent.removeChild(this.vert); - } - }, NativeScrollbars.prototype); - - function NullScrollbars() {} - - NullScrollbars.prototype = copyObj({ - update: function() { return {bottom: 0, right: 0}; }, - setScrollLeft: function() {}, - setScrollTop: function() {}, - clear: function() {} - }, NullScrollbars.prototype); - - CodeMirror.scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; - - function initScrollbars(cm) { - if (cm.display.scrollbars) { - cm.display.scrollbars.clear(); - if (cm.display.scrollbars.addClass) - rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); - } - - cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) { - cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); - on(node, "mousedown", function() { - if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); - }); - node.setAttribute("not-content", "true"); - }, function(pos, axis) { - if (axis == "horizontal") setScrollLeft(cm, pos); - else setScrollTop(cm, pos); - }, cm); - if (cm.display.scrollbars.addClass) - addClass(cm.display.wrapper, cm.display.scrollbars.addClass); - } - - function updateScrollbars(cm, measure) { - if (!measure) measure = measureForScrollbars(cm); - var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; - updateScrollbarsInner(cm, measure); - for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { - if (startWidth != cm.display.barWidth && cm.options.lineWrapping) - updateHeightsInViewport(cm); - updateScrollbarsInner(cm, measureForScrollbars(cm)); - startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; - } - } - - // Re-synchronize the fake scrollbars with the actual size of the - // content. - function updateScrollbarsInner(cm, measure) { - var d = cm.display; - var sizes = d.scrollbars.update(measure); - - d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; - d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; - - if (sizes.right && sizes.bottom) { - d.scrollbarFiller.style.display = "block"; - d.scrollbarFiller.style.height = sizes.bottom + "px"; - d.scrollbarFiller.style.width = sizes.right + "px"; - } else d.scrollbarFiller.style.display = ""; - if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { - d.gutterFiller.style.display = "block"; - d.gutterFiller.style.height = sizes.bottom + "px"; - d.gutterFiller.style.width = measure.gutterWidth + "px"; - } else d.gutterFiller.style.display = ""; - } - - // Compute the lines that are visible in a given viewport (defaults - // the the current scroll position). viewport may contain top, - // height, and ensure (see op.scrollToPos) properties. - function visibleLines(display, doc, viewport) { - var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; - top = Math.floor(top - paddingTop(display)); - var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; - - var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); - // Ensure is a {from: {line, ch}, to: {line, ch}} object, and - // forces those lines into the viewport (if possible). - if (viewport && viewport.ensure) { - var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; - if (ensureFrom < from) { - from = ensureFrom; - to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); - } else if (Math.min(ensureTo, doc.lastLine()) >= to) { - from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); - to = ensureTo; - } - } - return {from: from, to: Math.max(to, from + 1)}; - } - - // LINE NUMBERS - - // Re-align line numbers and gutter marks to compensate for - // horizontal scrolling. - function alignHorizontally(cm) { - var display = cm.display, view = display.view; - if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; - var gutterW = display.gutters.offsetWidth, left = comp + "px"; - for (var i = 0; i < view.length; i++) if (!view[i].hidden) { - if (cm.options.fixedGutter && view[i].gutter) - view[i].gutter.style.left = left; - var align = view[i].alignable; - if (align) for (var j = 0; j < align.length; j++) - align[j].style.left = left; - } - if (cm.options.fixedGutter) - display.gutters.style.left = (comp + gutterW) + "px"; - } - - // Used to ensure that the line number gutter is still the right - // size for the current document size. Returns true when an update - // is needed. - function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) return false; - var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], - "CodeMirror-linenumber CodeMirror-gutter-elt")); - var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; - display.lineGutter.style.width = ""; - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding); - display.lineNumWidth = display.lineNumInnerWidth + padding; - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; - display.lineGutter.style.width = display.lineNumWidth + "px"; - updateGutterSpace(cm); - return true; - } - return false; - } - - function lineNumberFor(options, i) { - return String(options.lineNumberFormatter(i + options.firstLineNumber)); - } - - // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, - // but using getBoundingClientRect to get a sub-pixel-accurate - // result. - function compensateForHScroll(display) { - return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; - } - - // DISPLAY DRAWING - - function DisplayUpdate(cm, viewport, force) { - var display = cm.display; - - this.viewport = viewport; - // Store some values that we'll need later (but don't want to force a relayout for) - this.visible = visibleLines(display, cm.doc, viewport); - this.editorIsHidden = !display.wrapper.offsetWidth; - this.wrapperHeight = display.wrapper.clientHeight; - this.wrapperWidth = display.wrapper.clientWidth; - this.oldDisplayWidth = displayWidth(cm); - this.force = force; - this.dims = getDimensions(cm); - } - - function maybeClipScrollbars(cm) { - var display = cm.display; - if (!display.scrollbarsClipped && display.scroller.offsetWidth) { - display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; - display.heightForcer.style.height = scrollGap(cm) + "px"; - display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; - display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; - display.scrollbarsClipped = true; - } - } - - // Does the actual updating of the line display. Bails out - // (returning false) when there is nothing to be done and forced is - // false. - function updateDisplayIfNeeded(cm, update) { - var display = cm.display, doc = cm.doc; - - if (update.editorIsHidden) { - resetView(cm); - return false; - } - - // Bail out if the visible area is already rendered and nothing changed. - if (!update.force && - update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && - display.renderedView == display.view && countDirtyView(cm) == 0) - return false; - - if (maybeUpdateLineNumberWidth(cm)) { - resetView(cm); - update.dims = getDimensions(cm); - } - - // Compute a suitable new viewport (from & to) - var end = doc.first + doc.size; - var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); - var to = Math.min(end, update.visible.to + cm.options.viewportMargin); - if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom); - if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo); - if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from); - to = visualLineEndNo(cm.doc, to); - } - - var different = from != display.viewFrom || to != display.viewTo || - display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; - adjustView(cm, from, to); - - display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); - // Position the mover div to align with the current scroll position - cm.display.mover.style.top = display.viewOffset + "px"; - - var toUpdate = countDirtyView(cm); - if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) - return false; - - // For big changes, we hide the enclosing element during the - // update, since that speeds up the operations on most browsers. - var focused = activeElt(); - if (toUpdate > 4) display.lineDiv.style.display = "none"; - patchDisplay(cm, display.updateLineNumbers, update.dims); - if (toUpdate > 4) display.lineDiv.style.display = ""; - display.renderedView = display.view; - // There might have been a widget with a focused element that got - // hidden or updated, if so re-focus it. - if (focused && activeElt() != focused && focused.offsetHeight) focused.focus(); - - // Prevent selection and cursors from interfering with the scroll - // width and height. - removeChildren(display.cursorDiv); - removeChildren(display.selectionDiv); - display.gutters.style.height = 0; - - if (different) { - display.lastWrapHeight = update.wrapperHeight; - display.lastWrapWidth = update.wrapperWidth; - startWorker(cm, 400); - } - - display.updateLineNumbers = null; - - return true; - } - - function postUpdateDisplay(cm, update) { - var force = update.force, viewport = update.viewport; - for (var first = true;; first = false) { - if (first && cm.options.lineWrapping && update.oldDisplayWidth != displayWidth(cm)) { - force = true; - } else { - force = false; - // Clip forced viewport to actual scrollable area. - if (viewport && viewport.top != null) - viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; - // Updated line heights might result in the drawn area not - // actually covering the viewport. Keep looping until it does. - update.visible = visibleLines(cm.display, cm.doc, viewport); - if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) - break; - } - if (!updateDisplayIfNeeded(cm, update)) break; - updateHeightsInViewport(cm); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - setDocumentHeight(cm, barMeasure); - updateScrollbars(cm, barMeasure); - } - - signalLater(cm, "update", cm); - if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { - signalLater(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); - cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; - } - } - - function updateDisplaySimple(cm, viewport) { - var update = new DisplayUpdate(cm, viewport); - if (updateDisplayIfNeeded(cm, update)) { - updateHeightsInViewport(cm); - postUpdateDisplay(cm, update); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - setDocumentHeight(cm, barMeasure); - updateScrollbars(cm, barMeasure); - } - } - - function setDocumentHeight(cm, measure) { - cm.display.sizer.style.minHeight = measure.docHeight + "px"; - var total = measure.docHeight + cm.display.barHeight; - cm.display.heightForcer.style.top = total + "px"; - cm.display.gutters.style.height = Math.max(total + scrollGap(cm), measure.clientHeight) + "px"; - } - - // Read the actual heights of the rendered lines, and update their - // stored heights to match. - function updateHeightsInViewport(cm) { - var display = cm.display; - var prevBottom = display.lineDiv.offsetTop; - for (var i = 0; i < display.view.length; i++) { - var cur = display.view[i], height; - if (cur.hidden) continue; - if (ie && ie_version < 8) { - var bot = cur.node.offsetTop + cur.node.offsetHeight; - height = bot - prevBottom; - prevBottom = bot; - } else { - var box = cur.node.getBoundingClientRect(); - height = box.bottom - box.top; - } - var diff = cur.line.height - height; - if (height < 2) height = textHeight(display); - if (diff > .001 || diff < -.001) { - updateLineHeight(cur.line, height); - updateWidgetHeight(cur.line); - if (cur.rest) for (var j = 0; j < cur.rest.length; j++) - updateWidgetHeight(cur.rest[j]); - } - } - } - - // Read and store the height of line widgets associated with the - // given line. - function updateWidgetHeight(line) { - if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) - line.widgets[i].height = line.widgets[i].node.offsetHeight; - } - - // Do a bulk-read of the DOM positions and sizes needed to draw the - // view, so that we don't interleave reading and writing to the DOM. - function getDimensions(cm) { - var d = cm.display, left = {}, width = {}; - var gutterLeft = d.gutters.clientLeft; - for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { - left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; - width[cm.options.gutters[i]] = n.clientWidth; - } - return {fixedPos: compensateForHScroll(d), - gutterTotalWidth: d.gutters.offsetWidth, - gutterLeft: left, - gutterWidth: width, - wrapperWidth: d.wrapper.clientWidth}; - } - - // Sync the actual display DOM structure with display.view, removing - // nodes for lines that are no longer in view, and creating the ones - // that are not there yet, and updating the ones that are out of - // date. - function patchDisplay(cm, updateNumbersFrom, dims) { - var display = cm.display, lineNumbers = cm.options.lineNumbers; - var container = display.lineDiv, cur = container.firstChild; - - function rm(node) { - var next = node.nextSibling; - // Works around a throw-scroll bug in OS X Webkit - if (webkit && mac && cm.display.currentWheelTarget == node) - node.style.display = "none"; - else - node.parentNode.removeChild(node); - return next; - } - - var view = display.view, lineN = display.viewFrom; - // Loop over the elements in the view, syncing cur (the DOM nodes - // in display.lineDiv) with the view as we go. - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (lineView.hidden) { - } else if (!lineView.node) { // Not drawn yet - var node = buildLineElement(cm, lineView, lineN, dims); - container.insertBefore(node, cur); - } else { // Already drawn - while (cur != lineView.node) cur = rm(cur); - var updateNumber = lineNumbers && updateNumbersFrom != null && - updateNumbersFrom <= lineN && lineView.lineNumber; - if (lineView.changes) { - if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false; - updateLineForChanges(cm, lineView, lineN, dims); - } - if (updateNumber) { - removeChildren(lineView.lineNumber); - lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); - } - cur = lineView.node.nextSibling; - } - lineN += lineView.size; - } - while (cur) cur = rm(cur); - } - - // When an aspect of a line changes, a string is added to - // lineView.changes. This updates the relevant part of the line's - // DOM structure. - function updateLineForChanges(cm, lineView, lineN, dims) { - for (var j = 0; j < lineView.changes.length; j++) { - var type = lineView.changes[j]; - if (type == "text") updateLineText(cm, lineView); - else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims); - else if (type == "class") updateLineClasses(lineView); - else if (type == "widget") updateLineWidgets(lineView, dims); - } - lineView.changes = null; - } - - // Lines with gutter elements, widgets or a background class need to - // be wrapped, and have the extra elements added to the wrapper div - function ensureLineWrapped(lineView) { - if (lineView.node == lineView.text) { - lineView.node = elt("div", null, null, "position: relative"); - if (lineView.text.parentNode) - lineView.text.parentNode.replaceChild(lineView.node, lineView.text); - lineView.node.appendChild(lineView.text); - if (ie && ie_version < 8) lineView.node.style.zIndex = 2; - } - return lineView.node; - } - - function updateLineBackground(lineView) { - var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; - if (cls) cls += " CodeMirror-linebackground"; - if (lineView.background) { - if (cls) lineView.background.className = cls; - else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } - } else if (cls) { - var wrap = ensureLineWrapped(lineView); - lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); - } - } - - // Wrapper around buildLineContent which will reuse the structure - // in display.externalMeasured when possible. - function getLineContent(cm, lineView) { - var ext = cm.display.externalMeasured; - if (ext && ext.line == lineView.line) { - cm.display.externalMeasured = null; - lineView.measure = ext.measure; - return ext.built; - } - return buildLineContent(cm, lineView); - } - - // Redraw the line's text. Interacts with the background and text - // classes because the mode may output tokens that influence these - // classes. - function updateLineText(cm, lineView) { - var cls = lineView.text.className; - var built = getLineContent(cm, lineView); - if (lineView.text == lineView.node) lineView.node = built.pre; - lineView.text.parentNode.replaceChild(built.pre, lineView.text); - lineView.text = built.pre; - if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { - lineView.bgClass = built.bgClass; - lineView.textClass = built.textClass; - updateLineClasses(lineView); - } else if (cls) { - lineView.text.className = cls; - } - } - - function updateLineClasses(lineView) { - updateLineBackground(lineView); - if (lineView.line.wrapClass) - ensureLineWrapped(lineView).className = lineView.line.wrapClass; - else if (lineView.node != lineView.text) - lineView.node.className = ""; - var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; - lineView.text.className = textClass || ""; - } - - function updateLineGutter(cm, lineView, lineN, dims) { - if (lineView.gutter) { - lineView.node.removeChild(lineView.gutter); - lineView.gutter = null; - } - var markers = lineView.line.gutterMarkers; - if (cm.options.lineNumbers || markers) { - var wrap = ensureLineWrapped(lineView); - var gutterWrap = lineView.gutter = - wrap.insertBefore(elt("div", null, "CodeMirror-gutter-wrapper", "left: " + - (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + - "px; width: " + dims.gutterTotalWidth + "px"), - lineView.text); - if (lineView.line.gutterClass) - gutterWrap.className += " " + lineView.line.gutterClass; - if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) - lineView.lineNumber = gutterWrap.appendChild( - elt("div", lineNumberFor(cm.options, lineN), - "CodeMirror-linenumber CodeMirror-gutter-elt", - "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " - + cm.display.lineNumInnerWidth + "px")); - if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) { - var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; - if (found) - gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + - dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); - } - } - } - - function updateLineWidgets(lineView, dims) { - if (lineView.alignable) lineView.alignable = null; - for (var node = lineView.node.firstChild, next; node; node = next) { - var next = node.nextSibling; - if (node.className == "CodeMirror-linewidget") - lineView.node.removeChild(node); - } - insertLineWidgets(lineView, dims); - } - - // Build a line's DOM representation from scratch - function buildLineElement(cm, lineView, lineN, dims) { - var built = getLineContent(cm, lineView); - lineView.text = lineView.node = built.pre; - if (built.bgClass) lineView.bgClass = built.bgClass; - if (built.textClass) lineView.textClass = built.textClass; - - updateLineClasses(lineView); - updateLineGutter(cm, lineView, lineN, dims); - insertLineWidgets(lineView, dims); - return lineView.node; - } - - // A lineView may contain multiple logical lines (when merged by - // collapsed spans). The widgets for all of them need to be drawn. - function insertLineWidgets(lineView, dims) { - insertLineWidgetsFor(lineView.line, lineView, dims, true); - if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) - insertLineWidgetsFor(lineView.rest[i], lineView, dims, false); - } - - function insertLineWidgetsFor(line, lineView, dims, allowAbove) { - if (!line.widgets) return; - var wrap = ensureLineWrapped(lineView); - for (var i = 0, ws = line.widgets; i < ws.length; ++i) { - var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); - if (!widget.handleMouseEvents) node.setAttribute("cm-ignore-events", "true"); - positionLineWidget(widget, node, lineView, dims); - if (allowAbove && widget.above) - wrap.insertBefore(node, lineView.gutter || lineView.text); - else - wrap.appendChild(node); - signalLater(widget, "redraw"); - } - } - - function positionLineWidget(widget, node, lineView, dims) { - if (widget.noHScroll) { - (lineView.alignable || (lineView.alignable = [])).push(node); - var width = dims.wrapperWidth; - node.style.left = dims.fixedPos + "px"; - if (!widget.coverGutter) { - width -= dims.gutterTotalWidth; - node.style.paddingLeft = dims.gutterTotalWidth + "px"; - } - node.style.width = width + "px"; - } - if (widget.coverGutter) { - node.style.zIndex = 5; - node.style.position = "relative"; - if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px"; - } - } - - // POSITION OBJECT - - // A Pos instance represents a position within the text. - var Pos = CodeMirror.Pos = function(line, ch) { - if (!(this instanceof Pos)) return new Pos(line, ch); - this.line = line; this.ch = ch; - }; - - // Compare two positions, return 0 if they are the same, a negative - // number when a is less, and a positive number otherwise. - var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; }; - - function copyPos(x) {return Pos(x.line, x.ch);} - function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; } - function minPos(a, b) { return cmp(a, b) < 0 ? a : b; } - - // SELECTION / CURSOR - - // Selection objects are immutable. A new one is created every time - // the selection changes. A selection is one or more non-overlapping - // (and non-touching) ranges, sorted, and an integer that indicates - // which one is the primary selection (the one that's scrolled into - // view, that getCursor returns, etc). - function Selection(ranges, primIndex) { - this.ranges = ranges; - this.primIndex = primIndex; - } - - Selection.prototype = { - primary: function() { return this.ranges[this.primIndex]; }, - equals: function(other) { - if (other == this) return true; - if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false; - for (var i = 0; i < this.ranges.length; i++) { - var here = this.ranges[i], there = other.ranges[i]; - if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false; - } - return true; - }, - deepCopy: function() { - for (var out = [], i = 0; i < this.ranges.length; i++) - out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); - return new Selection(out, this.primIndex); - }, - somethingSelected: function() { - for (var i = 0; i < this.ranges.length; i++) - if (!this.ranges[i].empty()) return true; - return false; - }, - contains: function(pos, end) { - if (!end) end = pos; - for (var i = 0; i < this.ranges.length; i++) { - var range = this.ranges[i]; - if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) - return i; - } - return -1; - } - }; - - function Range(anchor, head) { - this.anchor = anchor; this.head = head; - } - - Range.prototype = { - from: function() { return minPos(this.anchor, this.head); }, - to: function() { return maxPos(this.anchor, this.head); }, - empty: function() { - return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; - } - }; - - // Take an unsorted, potentially overlapping set of ranges, and - // build a selection out of it. 'Consumes' ranges array (modifying - // it). - function normalizeSelection(ranges, primIndex) { - var prim = ranges[primIndex]; - ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); - primIndex = indexOf(ranges, prim); - for (var i = 1; i < ranges.length; i++) { - var cur = ranges[i], prev = ranges[i - 1]; - if (cmp(prev.to(), cur.from()) >= 0) { - var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); - var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; - if (i <= primIndex) --primIndex; - ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); - } - } - return new Selection(ranges, primIndex); - } - - function simpleSelection(anchor, head) { - return new Selection([new Range(anchor, head || anchor)], 0); - } - - // Most of the external API clips given positions to make sure they - // actually exist within the document. - function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} - function clipPos(doc, pos) { - if (pos.line < doc.first) return Pos(doc.first, 0); - var last = doc.first + doc.size - 1; - if (pos.line > last) return Pos(last, getLine(doc, last).text.length); - return clipToLen(pos, getLine(doc, pos.line).text.length); - } - function clipToLen(pos, linelen) { - var ch = pos.ch; - if (ch == null || ch > linelen) return Pos(pos.line, linelen); - else if (ch < 0) return Pos(pos.line, 0); - else return pos; - } - function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} - function clipPosArray(doc, array) { - for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); - return out; - } - - // SELECTION UPDATES - - // The 'scroll' parameter given to many of these indicated whether - // the new cursor position should be scrolled into view after - // modifying the selection. - - // If shift is held or the extend flag is set, extends a range to - // include a given position (and optionally a second position). - // Otherwise, simply returns the range between the given positions. - // Used for cursor motion and such. - function extendRange(doc, range, head, other) { - if (doc.cm && doc.cm.display.shift || doc.extend) { - var anchor = range.anchor; - if (other) { - var posBefore = cmp(head, anchor) < 0; - if (posBefore != (cmp(other, anchor) < 0)) { - anchor = head; - head = other; - } else if (posBefore != (cmp(head, other) < 0)) { - head = other; - } - } - return new Range(anchor, head); - } else { - return new Range(other || head, head); - } - } - - // Extend the primary selection range, discard the rest. - function extendSelection(doc, head, other, options) { - setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); - } - - // Extend all selections (pos is an array of selections with length - // equal the number of selections) - function extendSelections(doc, heads, options) { - for (var out = [], i = 0; i < doc.sel.ranges.length; i++) - out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); - var newSel = normalizeSelection(out, doc.sel.primIndex); - setSelection(doc, newSel, options); - } - - // Updates a single range in the selection. - function replaceOneSelection(doc, i, range, options) { - var ranges = doc.sel.ranges.slice(0); - ranges[i] = range; - setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); - } - - // Reset the selection to a single range. - function setSimpleSelection(doc, anchor, head, options) { - setSelection(doc, simpleSelection(anchor, head), options); - } - - // Give beforeSelectionChange handlers a change to influence a - // selection update. - function filterSelectionChange(doc, sel) { - var obj = { - ranges: sel.ranges, - update: function(ranges) { - this.ranges = []; - for (var i = 0; i < ranges.length; i++) - this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), - clipPos(doc, ranges[i].head)); - } - }; - signal(doc, "beforeSelectionChange", doc, obj); - if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); - if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); - else return sel; - } - - function setSelectionReplaceHistory(doc, sel, options) { - var done = doc.history.done, last = lst(done); - if (last && last.ranges) { - done[done.length - 1] = sel; - setSelectionNoUndo(doc, sel, options); - } else { - setSelection(doc, sel, options); - } - } - - // Set a new selection. - function setSelection(doc, sel, options) { - setSelectionNoUndo(doc, sel, options); - addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); - } - - function setSelectionNoUndo(doc, sel, options) { - if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) - sel = filterSelectionChange(doc, sel); - - var bias = options && options.bias || - (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); - setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - - if (!(options && options.scroll === false) && doc.cm) - ensureCursorVisible(doc.cm); - } - - function setSelectionInner(doc, sel) { - if (sel.equals(doc.sel)) return; - - doc.sel = sel; - - if (doc.cm) { - doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; - signalCursorActivity(doc.cm); - } - signalLater(doc, "cursorActivity", doc); - } - - // Verify that the selection does not partially select any atomic - // marked ranges. - function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll); - } - - // Return a selection that does not partially select any atomic - // ranges. - function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear); - var newHead = skipAtomic(doc, range.head, bias, mayClear); - if (out || newAnchor != range.anchor || newHead != range.head) { - if (!out) out = sel.ranges.slice(0, i); - out[i] = new Range(newAnchor, newHead); - } - } - return out ? normalizeSelection(out, sel.primIndex) : sel; - } - - // Ensure a given position is not inside an atomic range. - function skipAtomic(doc, pos, bias, mayClear) { - var flipped = false, curPos = pos; - var dir = bias || 1; - doc.cantEdit = false; - search: for (;;) { - var line = getLine(doc, curPos.line); - if (line.markedSpans) { - for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker; - if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && - (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter"); - if (m.explicitlyCleared) { - if (!line.markedSpans) break; - else {--i; continue;} - } - } - if (!m.atomic) continue; - var newPos = m.find(dir < 0 ? -1 : 1); - if (cmp(newPos, curPos) == 0) { - newPos.ch += dir; - if (newPos.ch < 0) { - if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); - else newPos = null; - } else if (newPos.ch > line.text.length) { - if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0); - else newPos = null; - } - if (!newPos) { - if (flipped) { - // Driven in a corner -- no valid cursor position found at all - // -- try again *with* clearing, if we didn't already - if (!mayClear) return skipAtomic(doc, pos, bias, true); - // Otherwise, turn off editing until further notice, and return the start of the doc - doc.cantEdit = true; - return Pos(doc.first, 0); - } - flipped = true; newPos = pos; dir = -dir; - } - } - curPos = newPos; - continue search; - } - } - } - return curPos; - } - } - - // SELECTION DRAWING - - // Redraw the selection and/or cursor - function drawSelection(cm) { - var display = cm.display, doc = cm.doc, result = {}; - var curFragment = result.cursors = document.createDocumentFragment(); - var selFragment = result.selection = document.createDocumentFragment(); - - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - var collapsed = range.empty(); - if (collapsed || cm.options.showCursorWhenSelecting) - drawSelectionCursor(cm, range, curFragment); - if (!collapsed) - drawSelectionRange(cm, range, selFragment); - } - - // Move the hidden textarea near the cursor to prevent scrolling artifacts - if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); - var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); - result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)); - result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)); - } - - return result; - } - - function showSelection(cm, drawn) { - removeChildrenAndAdd(cm.display.cursorDiv, drawn.cursors); - removeChildrenAndAdd(cm.display.selectionDiv, drawn.selection); - if (drawn.teTop != null) { - cm.display.inputDiv.style.top = drawn.teTop + "px"; - cm.display.inputDiv.style.left = drawn.teLeft + "px"; - } - } - - function updateSelection(cm) { - showSelection(cm, drawSelection(cm)); - } - - // Draws a cursor for the given range - function drawSelectionCursor(cm, range, output) { - var pos = cursorCoords(cm, range.head, "div", null, null, !cm.options.singleCursorHeightPerLine); - - var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); - cursor.style.left = pos.left + "px"; - cursor.style.top = pos.top + "px"; - cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - - if (pos.other) { - // Secondary cursor, shown when on a 'jump' in bi-directional text - var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); - otherCursor.style.display = ""; - otherCursor.style.left = pos.other.left + "px"; - otherCursor.style.top = pos.other.top + "px"; - otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; - } - } - - // Draws the given range as a highlighted selection - function drawSelectionRange(cm, range, output) { - var display = cm.display, doc = cm.doc; - var fragment = document.createDocumentFragment(); - var padding = paddingH(cm.display), leftSide = padding.left; - var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; - - function add(left, top, width, bottom) { - if (top < 0) top = 0; - top = Math.round(top); - bottom = Math.round(bottom); - fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + - "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) + - "px; height: " + (bottom - top) + "px")); - } - - function drawForLine(line, fromArg, toArg) { - var lineObj = getLine(doc, line); - var lineLen = lineObj.text.length; - var start, end; - function coords(ch, bias) { - return charCoords(cm, Pos(line, ch), "div", lineObj, bias); - } - - iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { - var leftPos = coords(from, "left"), rightPos, left, right; - if (from == to) { - rightPos = leftPos; - left = right = leftPos.left; - } else { - rightPos = coords(to - 1, "right"); - if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; } - left = leftPos.left; - right = rightPos.right; - } - if (fromArg == null && from == 0) left = leftSide; - if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part - add(left, leftPos.top, null, leftPos.bottom); - left = leftSide; - if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); - } - if (toArg == null && to == lineLen) right = rightSide; - if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) - start = leftPos; - if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) - end = rightPos; - if (left < leftSide + 1) left = leftSide; - add(left, rightPos.top, right - left, rightPos.bottom); - }); - return {start: start, end: end}; - } - - var sFrom = range.from(), sTo = range.to(); - if (sFrom.line == sTo.line) { - drawForLine(sFrom.line, sFrom.ch, sTo.ch); - } else { - var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); - var singleVLine = visualLine(fromLine) == visualLine(toLine); - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; - var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; - if (singleVLine) { - if (leftEnd.top < rightStart.top - 2) { - add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); - add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); - } else { - add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); - } - } - if (leftEnd.bottom < rightStart.top) - add(leftSide, leftEnd.bottom, null, rightStart.top); - } - - output.appendChild(fragment); - } - - // Cursor-blinking - function restartBlink(cm) { - if (!cm.state.focused) return; - var display = cm.display; - clearInterval(display.blinker); - var on = true; - display.cursorDiv.style.visibility = ""; - if (cm.options.cursorBlinkRate > 0) - display.blinker = setInterval(function() { - display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; - }, cm.options.cursorBlinkRate); - else if (cm.options.cursorBlinkRate < 0) - display.cursorDiv.style.visibility = "hidden"; - } - - // HIGHLIGHT WORKER - - function startWorker(cm, time) { - if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo) - cm.state.highlight.set(time, bind(highlightWorker, cm)); - } - - function highlightWorker(cm) { - var doc = cm.doc; - if (doc.frontier < doc.first) doc.frontier = doc.first; - if (doc.frontier >= cm.display.viewTo) return; - var end = +new Date + cm.options.workTime; - var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); - var changedLines = []; - - doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { - if (doc.frontier >= cm.display.viewFrom) { // Visible - var oldStyles = line.styles; - var highlighted = highlightLine(cm, line, state, true); - line.styles = highlighted.styles; - var oldCls = line.styleClasses, newCls = highlighted.classes; - if (newCls) line.styleClasses = newCls; - else if (oldCls) line.styleClasses = null; - var ischange = !oldStyles || oldStyles.length != line.styles.length || - oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); - for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; - if (ischange) changedLines.push(doc.frontier); - line.stateAfter = copyState(doc.mode, state); - } else { - processLine(cm, line.text, state); - line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null; - } - ++doc.frontier; - if (+new Date > end) { - startWorker(cm, cm.options.workDelay); - return true; - } - }); - if (changedLines.length) runInOp(cm, function() { - for (var i = 0; i < changedLines.length; i++) - regLineChange(cm, changedLines[i], "text"); - }); - } - - // Finds the line to start with when starting a parse. Tries to - // find a line with a stateAfter, so that it can start with a - // valid state. If that fails, it returns the line with the - // smallest indentation, which tends to need the least context to - // parse correctly. - function findStartLine(cm, n, precise) { - var minindent, minline, doc = cm.doc; - var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); - for (var search = n; search > lim; --search) { - if (search <= doc.first) return doc.first; - var line = getLine(doc, search - 1); - if (line.stateAfter && (!precise || search <= doc.frontier)) return search; - var indented = countColumn(line.text, null, cm.options.tabSize); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline; - } - - function getStateBefore(cm, n, precise) { - var doc = cm.doc, display = cm.display; - if (!doc.mode.startState) return true; - var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; - if (!state) state = startState(doc.mode); - else state = copyState(doc.mode, state); - doc.iter(pos, n, function(line) { - processLine(cm, line.text, state); - var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; - line.stateAfter = save ? copyState(doc.mode, state) : null; - ++pos; - }); - if (precise) doc.frontier = pos; - return state; - } - - // POSITION MEASUREMENT - - function paddingTop(display) {return display.lineSpace.offsetTop;} - function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;} - function paddingH(display) { - if (display.cachedPaddingH) return display.cachedPaddingH; - var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); - var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; - var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; - if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data; - return data; - } - - function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth; } - function displayWidth(cm) { - return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; - } - function displayHeight(cm) { - return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; - } - - // Ensure the lineView.wrapping.heights array is populated. This is - // an array of bottom offsets for the lines that make up a drawn - // line. When lineWrapping is on, there might be more than one - // height. - function ensureLineHeights(cm, lineView, rect) { - var wrapping = cm.options.lineWrapping; - var curWidth = wrapping && displayWidth(cm); - if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { - var heights = lineView.measure.heights = []; - if (wrapping) { - lineView.measure.width = curWidth; - var rects = lineView.text.firstChild.getClientRects(); - for (var i = 0; i < rects.length - 1; i++) { - var cur = rects[i], next = rects[i + 1]; - if (Math.abs(cur.bottom - next.bottom) > 2) - heights.push((cur.bottom + next.top) / 2 - rect.top); - } - } - heights.push(rect.bottom - rect.top); - } - } - - // Find a line map (mapping character offsets to text nodes) and a - // measurement cache for the given line number. (A line view might - // contain multiple lines when collapsed ranges are present.) - function mapFromLineView(lineView, line, lineN) { - if (lineView.line == line) - return {map: lineView.measure.map, cache: lineView.measure.cache}; - for (var i = 0; i < lineView.rest.length; i++) - if (lineView.rest[i] == line) - return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}; - for (var i = 0; i < lineView.rest.length; i++) - if (lineNo(lineView.rest[i]) > lineN) - return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}; - } - - // Render a line into the hidden node display.externalMeasured. Used - // when measurement is needed for a line that's not in the viewport. - function updateExternalMeasurement(cm, line) { - line = visualLine(line); - var lineN = lineNo(line); - var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); - view.lineN = lineN; - var built = view.built = buildLineContent(cm, view); - view.text = built.pre; - removeChildrenAndAdd(cm.display.lineMeasure, built.pre); - return view; - } - - // Get a {top, bottom, left, right} box (in line-local coordinates) - // for a given character. - function measureChar(cm, line, ch, bias) { - return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); - } - - // Find a line view that corresponds to the given line number. - function findViewForLine(cm, lineN) { - if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) - return cm.display.view[findViewIndex(cm, lineN)]; - var ext = cm.display.externalMeasured; - if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) - return ext; - } - - // Measurement can be split in two steps, the set-up work that - // applies to the whole line, and the measurement of the actual - // character. Functions like coordsChar, that need to do a lot of - // measurements in a row, can thus ensure that the set-up work is - // only done once. - function prepareMeasureForLine(cm, line) { - var lineN = lineNo(line); - var view = findViewForLine(cm, lineN); - if (view && !view.text) - view = null; - else if (view && view.changes) - updateLineForChanges(cm, view, lineN, getDimensions(cm)); - if (!view) - view = updateExternalMeasurement(cm, line); - - var info = mapFromLineView(view, line, lineN); - return { - line: line, view: view, rect: null, - map: info.map, cache: info.cache, before: info.before, - hasHeights: false - }; - } - - // Given a prepared measurement object, measures the position of an - // actual character (or fetches it from the cache). - function measureCharPrepared(cm, prepared, ch, bias, varHeight) { - if (prepared.before) ch = -1; - var key = ch + (bias || ""), found; - if (prepared.cache.hasOwnProperty(key)) { - found = prepared.cache[key]; - } else { - if (!prepared.rect) - prepared.rect = prepared.view.text.getBoundingClientRect(); - if (!prepared.hasHeights) { - ensureLineHeights(cm, prepared.view, prepared.rect); - prepared.hasHeights = true; - } - found = measureCharInner(cm, prepared, ch, bias); - if (!found.bogus) prepared.cache[key] = found; - } - return {left: found.left, right: found.right, - top: varHeight ? found.rtop : found.top, - bottom: varHeight ? found.rbottom : found.bottom}; - } - - var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; - - function measureCharInner(cm, prepared, ch, bias) { - var map = prepared.map; - - var node, start, end, collapse; - // First, search the line map for the text node corresponding to, - // or closest to, the target character. - for (var i = 0; i < map.length; i += 3) { - var mStart = map[i], mEnd = map[i + 1]; - if (ch < mStart) { - start = 0; end = 1; - collapse = "left"; - } else if (ch < mEnd) { - start = ch - mStart; - end = start + 1; - } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { - end = mEnd - mStart; - start = end - 1; - if (ch >= mEnd) collapse = "right"; - } - if (start != null) { - node = map[i + 2]; - if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) - collapse = bias; - if (bias == "left" && start == 0) - while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { - node = map[(i -= 3) + 2]; - collapse = "left"; - } - if (bias == "right" && start == mEnd - mStart) - while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { - node = map[(i += 3) + 2]; - collapse = "right"; - } - break; - } - } - - var rect; - if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. - for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned - while (start && isExtendingChar(prepared.line.text.charAt(mStart + start))) --start; - while (mStart + end < mEnd && isExtendingChar(prepared.line.text.charAt(mStart + end))) ++end; - if (ie && ie_version < 9 && start == 0 && end == mEnd - mStart) { - rect = node.parentNode.getBoundingClientRect(); - } else if (ie && cm.options.lineWrapping) { - var rects = range(node, start, end).getClientRects(); - if (rects.length) - rect = rects[bias == "right" ? rects.length - 1 : 0]; - else - rect = nullRect; - } else { - rect = range(node, start, end).getBoundingClientRect() || nullRect; - } - if (rect.left || rect.right || start == 0) break; - end = start; - start = start - 1; - collapse = "right"; - } - if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect); - } else { // If it is a widget, simply get the box for the whole widget. - if (start > 0) collapse = bias = "right"; - var rects; - if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) - rect = rects[bias == "right" ? rects.length - 1 : 0]; - else - rect = node.getBoundingClientRect(); - } - if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { - var rSpan = node.parentNode.getClientRects()[0]; - if (rSpan) - rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; - else - rect = nullRect; - } - - var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; - var mid = (rtop + rbot) / 2; - var heights = prepared.view.measure.heights; - for (var i = 0; i < heights.length - 1; i++) - if (mid < heights[i]) break; - var top = i ? heights[i - 1] : 0, bot = heights[i]; - var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, - right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, - top: top, bottom: bot}; - if (!rect.left && !rect.right) result.bogus = true; - if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } - - return result; - } - - // Work around problem with bounding client rects on ranges being - // returned incorrectly when zoomed on IE10 and below. - function maybeUpdateRectForZooming(measure, rect) { - if (!window.screen || screen.logicalXDPI == null || - screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) - return rect; - var scaleX = screen.logicalXDPI / screen.deviceXDPI; - var scaleY = screen.logicalYDPI / screen.deviceYDPI; - return {left: rect.left * scaleX, right: rect.right * scaleX, - top: rect.top * scaleY, bottom: rect.bottom * scaleY}; - } - - function clearLineMeasurementCacheFor(lineView) { - if (lineView.measure) { - lineView.measure.cache = {}; - lineView.measure.heights = null; - if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) - lineView.measure.caches[i] = {}; - } - } - - function clearLineMeasurementCache(cm) { - cm.display.externalMeasure = null; - removeChildren(cm.display.lineMeasure); - for (var i = 0; i < cm.display.view.length; i++) - clearLineMeasurementCacheFor(cm.display.view[i]); - } - - function clearCaches(cm) { - clearLineMeasurementCache(cm); - cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; - if (!cm.options.lineWrapping) cm.display.maxLineChanged = true; - cm.display.lineNumChars = null; - } - - function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; } - function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; } - - // Converts a {top, bottom, left, right} box from line-local - // coordinates into another coordinate system. Context may be one of - // "line", "div" (display.lineDiv), "local"/null (editor), "window", - // or "page". - function intoCoordSystem(cm, lineObj, rect, context) { - if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { - var size = widgetHeight(lineObj.widgets[i]); - rect.top += size; rect.bottom += size; - } - if (context == "line") return rect; - if (!context) context = "local"; - var yOff = heightAtLine(lineObj); - if (context == "local") yOff += paddingTop(cm.display); - else yOff -= cm.display.viewOffset; - if (context == "page" || context == "window") { - var lOff = cm.display.lineSpace.getBoundingClientRect(); - yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); - var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); - rect.left += xOff; rect.right += xOff; - } - rect.top += yOff; rect.bottom += yOff; - return rect; - } - - // Coverts a box from "div" coords to another coordinate system. - // Context may be "window", "page", "div", or "local"/null. - function fromCoordSystem(cm, coords, context) { - if (context == "div") return coords; - var left = coords.left, top = coords.top; - // First move into "page" coordinate system - if (context == "page") { - left -= pageScrollX(); - top -= pageScrollY(); - } else if (context == "local" || !context) { - var localBox = cm.display.sizer.getBoundingClientRect(); - left += localBox.left; - top += localBox.top; - } - - var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); - return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}; - } - - function charCoords(cm, pos, context, lineObj, bias) { - if (!lineObj) lineObj = getLine(cm.doc, pos.line); - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); - } - - // Returns a box for a given cursor position, which may have an - // 'other' property containing the position of the secondary cursor - // on a bidi boundary. - function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { - lineObj = lineObj || getLine(cm.doc, pos.line); - if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); - function get(ch, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); - if (right) m.left = m.right; else m.right = m.left; - return intoCoordSystem(cm, lineObj, m, context); - } - function getBidi(ch, partPos) { - var part = order[partPos], right = part.level % 2; - if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) { - part = order[--partPos]; - ch = bidiRight(part) - (part.level % 2 ? 0 : 1); - right = true; - } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) { - part = order[++partPos]; - ch = bidiLeft(part) - part.level % 2; - right = false; - } - if (right && ch == part.to && ch > part.from) return get(ch - 1); - return get(ch, right); - } - var order = getOrder(lineObj), ch = pos.ch; - if (!order) return get(ch); - var partPos = getBidiPartAt(order, ch); - var val = getBidi(ch, partPos); - if (bidiOther != null) val.other = getBidi(ch, bidiOther); - return val; - } - - // Used to cheaply estimate the coordinates for a position. Used for - // intermediate scroll updates. - function estimateCoords(cm, pos) { - var left = 0, pos = clipPos(cm.doc, pos); - if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; - var lineObj = getLine(cm.doc, pos.line); - var top = heightAtLine(lineObj) + paddingTop(cm.display); - return {left: left, right: left, top: top, bottom: top + lineObj.height}; - } - - // Positions returned by coordsChar contain some extra information. - // xRel is the relative x position of the input coordinates compared - // to the found position (so xRel > 0 means the coordinates are to - // the right of the character position, for example). When outside - // is true, that means the coordinates lie outside the line's - // vertical range. - function PosWithInfo(line, ch, outside, xRel) { - var pos = Pos(line, ch); - pos.xRel = xRel; - if (outside) pos.outside = true; - return pos; - } - - // Compute the character position closest to the given coordinates. - // Input must be lineSpace-local ("div" coordinate system). - function coordsChar(cm, x, y) { - var doc = cm.doc; - y += cm.display.viewOffset; - if (y < 0) return PosWithInfo(doc.first, 0, true, -1); - var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; - if (lineN > last) - return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1); - if (x < 0) x = 0; - - var lineObj = getLine(doc, lineN); - for (;;) { - var found = coordsCharInner(cm, lineObj, lineN, x, y); - var merged = collapsedSpanAtEnd(lineObj); - var mergedPos = merged && merged.find(0, true); - if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) - lineN = lineNo(lineObj = mergedPos.to.line); - else - return found; - } - } - - function coordsCharInner(cm, lineObj, lineNo, x, y) { - var innerOff = y - heightAtLine(lineObj); - var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth; - var preparedMeasure = prepareMeasureForLine(cm, lineObj); - - function getX(ch) { - var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure); - wrongLine = true; - if (innerOff > sp.bottom) return sp.left - adjust; - else if (innerOff < sp.top) return sp.left + adjust; - else wrongLine = false; - return sp.left; - } - - var bidi = getOrder(lineObj), dist = lineObj.text.length; - var from = lineLeft(lineObj), to = lineRight(lineObj); - var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine; - - if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1); - // Do a binary search between these bounds. - for (;;) { - if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { - var ch = x < fromX || x - fromX <= toX - x ? from : to; - var xDiff = x - (ch == from ? fromX : toX); - while (isExtendingChar(lineObj.text.charAt(ch))) ++ch; - var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside, - xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); - return pos; - } - var step = Math.ceil(dist / 2), middle = from + step; - if (bidi) { - middle = from; - for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); - } - var middleX = getX(middle); - if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;} - else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;} - } - } - - var measureText; - // Compute the default text height. - function textHeight(display) { - if (display.cachedTextHeight != null) return display.cachedTextHeight; - if (measureText == null) { - measureText = elt("pre"); - // Measure a bunch of lines, for browsers that compute - // fractional heights. - for (var i = 0; i < 49; ++i) { - measureText.appendChild(document.createTextNode("x")); - measureText.appendChild(elt("br")); - } - measureText.appendChild(document.createTextNode("x")); - } - removeChildrenAndAdd(display.measure, measureText); - var height = measureText.offsetHeight / 50; - if (height > 3) display.cachedTextHeight = height; - removeChildren(display.measure); - return height || 1; - } - - // Compute the default character width. - function charWidth(display) { - if (display.cachedCharWidth != null) return display.cachedCharWidth; - var anchor = elt("span", "xxxxxxxxxx"); - var pre = elt("pre", [anchor]); - removeChildrenAndAdd(display.measure, pre); - var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; - if (width > 2) display.cachedCharWidth = width; - return width || 10; - } - - // OPERATIONS - - // Operations are used to wrap a series of changes to the editor - // state in such a way that each change won't have to update the - // cursor and display (which would be awkward, slow, and - // error-prone). Instead, display updates are batched and then all - // combined and executed at once. - - var operationGroup = null; - - var nextOpId = 0; - // Start a new operation. - function startOperation(cm) { - cm.curOp = { - cm: cm, - viewChanged: false, // Flag that indicates that lines might need to be redrawn - startHeight: cm.doc.height, // Used to detect need to update scrollbar - forceUpdate: false, // Used to force a redraw - updateInput: null, // Whether to reset the input textarea - typing: false, // Whether this reset should be careful to leave existing text (for compositing) - changeObjs: null, // Accumulated changes, for firing change events - cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on - cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already - selectionChanged: false, // Whether the selection needs to be redrawn - updateMaxLine: false, // Set when the widest line needs to be determined anew - scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet - scrollToPos: null, // Used to scroll to a specific position - id: ++nextOpId // Unique ID - }; - if (operationGroup) { - operationGroup.ops.push(cm.curOp); - } else { - cm.curOp.ownsGroup = operationGroup = { - ops: [cm.curOp], - delayedCallbacks: [] - }; - } - } - - function fireCallbacksForOps(group) { - // Calls delayed callbacks and cursorActivity handlers until no - // new ones appear - var callbacks = group.delayedCallbacks, i = 0; - do { - for (; i < callbacks.length; i++) - callbacks[i](); - for (var j = 0; j < group.ops.length; j++) { - var op = group.ops[j]; - if (op.cursorActivityHandlers) - while (op.cursorActivityCalled < op.cursorActivityHandlers.length) - op.cursorActivityHandlers[op.cursorActivityCalled++](op.cm); - } - } while (i < callbacks.length); - } - - // Finish an operation, updating the display and signalling delayed events - function endOperation(cm) { - var op = cm.curOp, group = op.ownsGroup; - if (!group) return; - - try { fireCallbacksForOps(group); } - finally { - operationGroup = null; - for (var i = 0; i < group.ops.length; i++) - group.ops[i].cm.curOp = null; - endOperations(group); - } - } - - // The DOM updates done when an operation finishes are batched so - // that the minimum number of relayouts are required. - function endOperations(group) { - var ops = group.ops; - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_R1(ops[i]); - for (var i = 0; i < ops.length; i++) // Write DOM (maybe) - endOperation_W1(ops[i]); - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_R2(ops[i]); - for (var i = 0; i < ops.length; i++) // Write DOM (maybe) - endOperation_W2(ops[i]); - for (var i = 0; i < ops.length; i++) // Read DOM - endOperation_finish(ops[i]); - } - - function endOperation_R1(op) { - var cm = op.cm, display = cm.display; - maybeClipScrollbars(cm); - if (op.updateMaxLine) findMaxLine(cm); - - op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || - op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || - op.scrollToPos.to.line >= display.viewTo) || - display.maxLineChanged && cm.options.lineWrapping; - op.update = op.mustUpdate && - new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); - } - - function endOperation_W1(op) { - op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); - } - - function endOperation_R2(op) { - var cm = op.cm, display = cm.display; - if (op.updatedDisplay) updateHeightsInViewport(cm); - - op.barMeasure = measureForScrollbars(cm); - - // If the max line changed since it was last measured, measure it, - // and ensure the document's width matches it. - // updateDisplay_W2 will use these properties to do the actual resizing - if (display.maxLineChanged && !cm.options.lineWrapping) { - op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; - cm.display.sizerWidth = op.adjustWidthTo; - op.barMeasure.scrollWidth = - Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); - op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); - } - - if (op.updatedDisplay || op.selectionChanged) - op.newSelectionNodes = drawSelection(cm); - } - - function endOperation_W2(op) { - var cm = op.cm; - - if (op.adjustWidthTo != null) { - cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; - if (op.maxScrollLeft < cm.doc.scrollLeft) - setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); - cm.display.maxLineChanged = false; - } - - if (op.newSelectionNodes) - showSelection(cm, op.newSelectionNodes); - if (op.updatedDisplay) - setDocumentHeight(cm, op.barMeasure); - if (op.updatedDisplay || op.startHeight != cm.doc.height) - updateScrollbars(cm, op.barMeasure); - - if (op.selectionChanged) restartBlink(cm); - - if (cm.state.focused && op.updateInput) - resetInput(cm, op.typing); - } - - function endOperation_finish(op) { - var cm = op.cm, display = cm.display, doc = cm.doc; - - if (op.updatedDisplay) postUpdateDisplay(cm, op.update); - - // Abort mouse wheel delta measurement, when scrolling explicitly - if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) - display.wheelStartX = display.wheelStartY = null; - - // Propagate the scroll position to the actual DOM scroller - if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) { - doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); - display.scrollbars.setScrollTop(doc.scrollTop); - display.scroller.scrollTop = doc.scrollTop; - } - if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { - doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - displayWidth(cm), op.scrollLeft)); - display.scrollbars.setScrollLeft(doc.scrollLeft); - display.scroller.scrollLeft = doc.scrollLeft; - alignHorizontally(cm); - } - // If we need to scroll a specific position into view, do so. - if (op.scrollToPos) { - var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), - clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); - if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords); - } - - // Fire events for markers that are hidden/unidden by editing or - // undoing - var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; - if (hidden) for (var i = 0; i < hidden.length; ++i) - if (!hidden[i].lines.length) signal(hidden[i], "hide"); - if (unhidden) for (var i = 0; i < unhidden.length; ++i) - if (unhidden[i].lines.length) signal(unhidden[i], "unhide"); - - if (display.wrapper.offsetHeight) - doc.scrollTop = cm.display.scroller.scrollTop; - - // Fire change events, and delayed event handlers - if (op.changeObjs) - signal(cm, "changes", cm, op.changeObjs); - } - - // Run the given function in an operation - function runInOp(cm, f) { - if (cm.curOp) return f(); - startOperation(cm); - try { return f(); } - finally { endOperation(cm); } - } - // Wraps a function in an operation. Returns the wrapped function. - function operation(cm, f) { - return function() { - if (cm.curOp) return f.apply(cm, arguments); - startOperation(cm); - try { return f.apply(cm, arguments); } - finally { endOperation(cm); } - }; - } - // Used to add methods to editor and doc instances, wrapping them in - // operations. - function methodOp(f) { - return function() { - if (this.curOp) return f.apply(this, arguments); - startOperation(this); - try { return f.apply(this, arguments); } - finally { endOperation(this); } - }; - } - function docMethodOp(f) { - return function() { - var cm = this.cm; - if (!cm || cm.curOp) return f.apply(this, arguments); - startOperation(cm); - try { return f.apply(this, arguments); } - finally { endOperation(cm); } - }; - } - - // VIEW TRACKING - - // These objects are used to represent the visible (currently drawn) - // part of the document. A LineView may correspond to multiple - // logical lines, if those are connected by collapsed ranges. - function LineView(doc, line, lineN) { - // The starting line - this.line = line; - // Continuing lines, if any - this.rest = visualLineContinued(line); - // Number of logical lines in this visual line - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; - this.node = this.text = null; - this.hidden = lineIsHidden(doc, line); - } - - // Create a range of LineView objects for the given lines. - function buildViewArray(cm, from, to) { - var array = [], nextPos; - for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); - nextPos = pos + view.size; - array.push(view); - } - return array; - } - - // Updates the display.view data structure for a given change to the - // document. From and to are in pre-change coordinates. Lendiff is - // the amount of lines added or subtracted by the change. This is - // used for changes that span multiple lines, or change the way - // lines are divided into visual lines. regLineChange (below) - // registers single-line changes. - function regChange(cm, from, to, lendiff) { - if (from == null) from = cm.doc.first; - if (to == null) to = cm.doc.first + cm.doc.size; - if (!lendiff) lendiff = 0; - - var display = cm.display; - if (lendiff && to < display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers > from)) - display.updateLineNumbers = from; - - cm.curOp.viewChanged = true; - - if (from >= display.viewTo) { // Change after - if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) - resetView(cm); - } else if (to <= display.viewFrom) { // Change before - if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { - resetView(cm); - } else { - display.viewFrom += lendiff; - display.viewTo += lendiff; - } - } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap - resetView(cm); - } else if (from <= display.viewFrom) { // Top overlap - var cut = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cut) { - display.view = display.view.slice(cut.index); - display.viewFrom = cut.lineN; - display.viewTo += lendiff; - } else { - resetView(cm); - } - } else if (to >= display.viewTo) { // Bottom overlap - var cut = viewCuttingPoint(cm, from, from, -1); - if (cut) { - display.view = display.view.slice(0, cut.index); - display.viewTo = cut.lineN; - } else { - resetView(cm); - } - } else { // Gap in the middle - var cutTop = viewCuttingPoint(cm, from, from, -1); - var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cutTop && cutBot) { - display.view = display.view.slice(0, cutTop.index) - .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) - .concat(display.view.slice(cutBot.index)); - display.viewTo += lendiff; - } else { - resetView(cm); - } - } - - var ext = display.externalMeasured; - if (ext) { - if (to < ext.lineN) - ext.lineN += lendiff; - else if (from < ext.lineN + ext.size) - display.externalMeasured = null; - } - } - - // Register a change to a single line. Type must be one of "text", - // "gutter", "class", "widget" - function regLineChange(cm, line, type) { - cm.curOp.viewChanged = true; - var display = cm.display, ext = cm.display.externalMeasured; - if (ext && line >= ext.lineN && line < ext.lineN + ext.size) - display.externalMeasured = null; - - if (line < display.viewFrom || line >= display.viewTo) return; - var lineView = display.view[findViewIndex(cm, line)]; - if (lineView.node == null) return; - var arr = lineView.changes || (lineView.changes = []); - if (indexOf(arr, type) == -1) arr.push(type); - } - - // Clear the view. - function resetView(cm) { - cm.display.viewFrom = cm.display.viewTo = cm.doc.first; - cm.display.view = []; - cm.display.viewOffset = 0; - } - - // Find the view element corresponding to a given line. Return null - // when the line isn't visible. - function findViewIndex(cm, n) { - if (n >= cm.display.viewTo) return null; - n -= cm.display.viewFrom; - if (n < 0) return null; - var view = cm.display.view; - for (var i = 0; i < view.length; i++) { - n -= view[i].size; - if (n < 0) return i; - } - } - - function viewCuttingPoint(cm, oldN, newN, dir) { - var index = findViewIndex(cm, oldN), diff, view = cm.display.view; - if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) - return {index: index, lineN: newN}; - for (var i = 0, n = cm.display.viewFrom; i < index; i++) - n += view[i].size; - if (n != oldN) { - if (dir > 0) { - if (index == view.length - 1) return null; - diff = (n + view[index].size) - oldN; - index++; - } else { - diff = n - oldN; - } - oldN += diff; newN += diff; - } - while (visualLineNo(cm.doc, newN) != newN) { - if (index == (dir < 0 ? 0 : view.length - 1)) return null; - newN += dir * view[index - (dir < 0 ? 1 : 0)].size; - index += dir; - } - return {index: index, lineN: newN}; - } - - // Force the view to cover a given range, adding empty view element - // or clipping off existing ones as needed. - function adjustView(cm, from, to) { - var display = cm.display, view = display.view; - if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { - display.view = buildViewArray(cm, from, to); - display.viewFrom = from; - } else { - if (display.viewFrom > from) - display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); - else if (display.viewFrom < from) - display.view = display.view.slice(findViewIndex(cm, from)); - display.viewFrom = from; - if (display.viewTo < to) - display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); - else if (display.viewTo > to) - display.view = display.view.slice(0, findViewIndex(cm, to)); - } - display.viewTo = to; - } - - // Count the number of lines in the view whose DOM representation is - // out of date (or nonexistent). - function countDirtyView(cm) { - var view = cm.display.view, dirty = 0; - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty; - } - return dirty; - } - - // INPUT HANDLING - - // Poll for input changes, using the normal rate of polling. This - // runs as long as the editor is focused. - function slowPoll(cm) { - if (cm.display.pollingFast) return; - cm.display.poll.set(cm.options.pollInterval, function() { - readInput(cm); - if (cm.state.focused) slowPoll(cm); - }); - } - - // When an event has just come in that is likely to add or change - // something in the input textarea, we poll faster, to ensure that - // the change appears on the screen quickly. - function fastPoll(cm) { - var missed = false; - cm.display.pollingFast = true; - function p() { - var changed = readInput(cm); - if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);} - else {cm.display.pollingFast = false; slowPoll(cm);} - } - cm.display.poll.set(20, p); - } - - // This will be set to an array of strings when copying, so that, - // when pasting, we know what kind of selections the copied text - // was made out of. - var lastCopied = null; - - // Read input from the textarea, and update the document to match. - // When something is selected, it is present in the textarea, and - // selected (unless it is huge, in which case a placeholder is - // used). When nothing is selected, the cursor sits after previously - // seen text (can be empty), which is stored in prevInput (we must - // not reset the textarea when typing, because that breaks IME). - function readInput(cm) { - var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc; - // Since this is called a *lot*, try to bail out as cheaply as - // possible when it is clear that nothing happened. hasSelection - // will be the case when there is a lot of text in the textarea, - // in which case reading its value would be expensive. - if (!cm.state.focused || (hasSelection(input) && !prevInput) || isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq) - return false; - // See paste handler for more on the fakedLastChar kludge - if (cm.state.pasteIncoming && cm.state.fakedLastChar) { - input.value = input.value.substring(0, input.value.length - 1); - cm.state.fakedLastChar = false; - } - var text = input.value; - // If nothing changed, bail. - if (text == prevInput && !cm.somethingSelected()) return false; - // Work around nonsensical selection resetting in IE9/10, and - // inexplicable appearance of private area unicode characters on - // some key combos in Mac (#2689). - if (ie && ie_version >= 9 && cm.display.inputHasSelection === text || - mac && /[\uf700-\uf7ff]/.test(text)) { - resetInput(cm); - return false; - } - - var withOp = !cm.curOp; - if (withOp) startOperation(cm); - cm.display.shift = false; - - if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput) - prevInput = "\u200b"; - // Find the part of the input that is actually new - var same = 0, l = Math.min(prevInput.length, text.length); - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; - var inserted = text.slice(same), textLines = splitLines(inserted); - - // When pasing N lines into N selections, insert one line per selection - var multiPaste = null; - if (cm.state.pasteIncoming && doc.sel.ranges.length > 1) { - if (lastCopied && lastCopied.join("\n") == inserted) - multiPaste = doc.sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines); - else if (textLines.length == doc.sel.ranges.length) - multiPaste = map(textLines, function(l) { return [l]; }); - } - - // Normal behavior is to insert the new text into every selection - for (var i = doc.sel.ranges.length - 1; i >= 0; i--) { - var range = doc.sel.ranges[i]; - var from = range.from(), to = range.to(); - // Handle deletion - if (same < prevInput.length) - from = Pos(from.line, from.ch - (prevInput.length - same)); - // Handle overwrite - else if (cm.state.overwrite && range.empty() && !cm.state.pasteIncoming) - to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); - var updateInput = cm.curOp.updateInput; - var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, - origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"}; - makeChange(cm.doc, changeEvent); - signalLater(cm, "inputRead", cm, changeEvent); - // When an 'electric' character is inserted, immediately trigger a reindent - if (inserted && !cm.state.pasteIncoming && cm.options.electricChars && - cm.options.smartIndent && range.head.ch < 100 && - (!i || doc.sel.ranges[i - 1].head.line != range.head.line)) { - var mode = cm.getModeAt(range.head); - var end = changeEnd(changeEvent); - if (mode.electricChars) { - for (var j = 0; j < mode.electricChars.length; j++) - if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indentLine(cm, end.line, "smart"); - break; - } - } else if (mode.electricInput) { - if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch))) - indentLine(cm, end.line, "smart"); - } - } - } - ensureCursorVisible(cm); - cm.curOp.updateInput = updateInput; - cm.curOp.typing = true; - - // Don't leave long text in the textarea, since it makes further polling slow - if (text.length > 1000 || text.indexOf("\n") > -1) input.value = cm.display.prevInput = ""; - else cm.display.prevInput = text; - if (withOp) endOperation(cm); - cm.state.pasteIncoming = cm.state.cutIncoming = false; - return true; - } - - // Reset the input to correspond to the selection (or to be empty, - // when not typing and nothing is selected) - function resetInput(cm, typing) { - if (cm.display.contextMenuPending) return; - var minimal, selected, doc = cm.doc; - if (cm.somethingSelected()) { - cm.display.prevInput = ""; - var range = doc.sel.primary(); - minimal = hasCopyEvent && - (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000); - var content = minimal ? "-" : selected || cm.getSelection(); - cm.display.input.value = content; - if (cm.state.focused) selectInput(cm.display.input); - if (ie && ie_version >= 9) cm.display.inputHasSelection = content; - } else if (!typing) { - cm.display.prevInput = cm.display.input.value = ""; - if (ie && ie_version >= 9) cm.display.inputHasSelection = null; - } - cm.display.inaccurateSelection = minimal; - } - - function focusInput(cm) { - if (cm.options.readOnly != "nocursor" && (!mobile || activeElt() != cm.display.input)) - cm.display.input.focus(); - } - - function ensureFocus(cm) { - if (!cm.state.focused) { focusInput(cm); onFocus(cm); } - } - - function isReadOnly(cm) { - return cm.options.readOnly || cm.doc.cantEdit; - } - - // EVENT HANDLERS - - // Attach the necessary event handlers when initializing the editor - function registerEventHandlers(cm) { - var d = cm.display; - on(d.scroller, "mousedown", operation(cm, onMouseDown)); - // Older IE's will not fire a second mousedown for a double click - if (ie && ie_version < 11) - on(d.scroller, "dblclick", operation(cm, function(e) { - if (signalDOMEvent(cm, e)) return; - var pos = posFromMouse(cm, e); - if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; - e_preventDefault(e); - var word = cm.findWordAt(pos); - extendSelection(cm.doc, word.anchor, word.head); - })); - else - on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); }); - // Prevent normal selection in the editor (we handle our own) - on(d.lineSpace, "selectstart", function(e) { - if (!eventInWidget(d, e)) e_preventDefault(e); - }); - // Some browsers fire contextmenu *after* opening the menu, at - // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for these browsers. - if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); - - // Sync scrolling between fake scrollbars and real scrollable - // area, ensure viewport is updated when scrolling. - on(d.scroller, "scroll", function() { - if (d.scroller.clientHeight) { - setScrollTop(cm, d.scroller.scrollTop); - setScrollLeft(cm, d.scroller.scrollLeft, true); - signal(cm, "scroll", cm); - } - }); - - // Listen to wheel events in order to try and update the viewport on time. - on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); - on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); - - // Prevent wrapper from ever scrolling - on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - - on(d.input, "keyup", function(e) { onKeyUp.call(cm, e); }); - on(d.input, "input", function() { - if (ie && ie_version >= 9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null; - readInput(cm); - }); - on(d.input, "keydown", operation(cm, onKeyDown)); - on(d.input, "keypress", operation(cm, onKeyPress)); - on(d.input, "focus", bind(onFocus, cm)); - on(d.input, "blur", bind(onBlur, cm)); - - function drag_(e) { - if (!signalDOMEvent(cm, e)) e_stop(e); - } - if (cm.options.dragDrop) { - on(d.scroller, "dragstart", function(e){onDragStart(cm, e);}); - on(d.scroller, "dragenter", drag_); - on(d.scroller, "dragover", drag_); - on(d.scroller, "drop", operation(cm, onDrop)); - } - on(d.scroller, "paste", function(e) { - if (eventInWidget(d, e)) return; - cm.state.pasteIncoming = true; - focusInput(cm); - fastPoll(cm); - }); - on(d.input, "paste", function() { - // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206 - // Add a char to the end of textarea before paste occur so that - // selection doesn't span to the end of textarea. - if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) { - var start = d.input.selectionStart, end = d.input.selectionEnd; - d.input.value += "$"; - // The selection end needs to be set before the start, otherwise there - // can be an intermediate non-empty selection between the two, which - // can override the middle-click paste buffer on linux and cause the - // wrong thing to get pasted. - d.input.selectionEnd = end; - d.input.selectionStart = start; - cm.state.fakedLastChar = true; - } - cm.state.pasteIncoming = true; - fastPoll(cm); - }); - - function prepareCopyCut(e) { - if (cm.somethingSelected()) { - lastCopied = cm.getSelections(); - if (d.inaccurateSelection) { - d.prevInput = ""; - d.inaccurateSelection = false; - d.input.value = lastCopied.join("\n"); - selectInput(d.input); - } - } else { - var text = [], ranges = []; - for (var i = 0; i < cm.doc.sel.ranges.length; i++) { - var line = cm.doc.sel.ranges[i].head.line; - var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; - ranges.push(lineRange); - text.push(cm.getRange(lineRange.anchor, lineRange.head)); - } - if (e.type == "cut") { - cm.setSelections(ranges, null, sel_dontScroll); - } else { - d.prevInput = ""; - d.input.value = text.join("\n"); - selectInput(d.input); - } - lastCopied = text; - } - if (e.type == "cut") cm.state.cutIncoming = true; - } - on(d.input, "cut", prepareCopyCut); - on(d.input, "copy", prepareCopyCut); - - // Needed to handle Tab key in KHTML - if (khtml) on(d.sizer, "mouseup", function() { - if (activeElt() == d.input) d.input.blur(); - focusInput(cm); - }); - } - - // Called when the window resizes - function onResize(cm) { - var d = cm.display; - if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) - return; - // Might be a text scaling operation, clear size caches. - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - d.scrollbarsClipped = false; - cm.setSize(); - } - - // MOUSE EVENTS - - // Return true when the given mouse event happened in a widget - function eventInWidget(display, e) { - for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { - if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || - (n.parentNode == display.sizer && n != display.mover)) - return true; - } - } - - // Given a mouse event, find the corresponding position. If liberal - // is false, it checks whether a gutter or scrollbar was clicked, - // and returns null if it was. forRect is used by rectangular - // selections, and tries to estimate a character position even for - // coordinates beyond the right of the text. - function posFromMouse(cm, e, liberal, forRect) { - var display = cm.display; - if (!liberal && e_target(e).getAttribute("not-content") == "true") return null; - - var x, y, space = display.lineSpace.getBoundingClientRect(); - // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX - space.left; y = e.clientY - space.top; } - catch (e) { return null; } - var coords = coordsChar(cm, x, y), line; - if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { - var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; - coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); - } - return coords; - } - - // A mouse down can be a single click, double click, triple click, - // start of selection drag, start of text drag, new cursor - // (ctrl-click), rectangle drag (alt-drag), or xwin - // middle-click-paste. Or it might be a click on something we should - // not interfere with, such as a scrollbar or widget. - function onMouseDown(e) { - if (signalDOMEvent(this, e)) return; - var cm = this, display = cm.display; - display.shift = e.shiftKey; - - if (eventInWidget(display, e)) { - if (!webkit) { - // Briefly turn off draggability, to allow widgets to do - // normal dragging things. - display.scroller.draggable = false; - setTimeout(function(){display.scroller.draggable = true;}, 100); - } - return; - } - if (clickInGutter(cm, e)) return; - var start = posFromMouse(cm, e); - window.focus(); - - switch (e_button(e)) { - case 1: - if (start) - leftButtonDown(cm, e, start); - else if (e_target(e) == display.scroller) - e_preventDefault(e); - break; - case 2: - if (webkit) cm.state.lastMiddleDown = +new Date; - if (start) extendSelection(cm.doc, start); - setTimeout(bind(focusInput, cm), 20); - e_preventDefault(e); - break; - case 3: - if (captureRightClick) onContextMenu(cm, e); - break; - } - } - - var lastClick, lastDoubleClick; - function leftButtonDown(cm, e, start) { - setTimeout(bind(ensureFocus, cm), 0); - - var now = +new Date, type; - if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { - type = "triple"; - } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { - type = "double"; - lastDoubleClick = {time: now, pos: start}; - } else { - type = "single"; - lastClick = {time: now, pos: start}; - } - - var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained; - if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && - type == "single" && (contained = sel.contains(start)) > -1 && - !sel.ranges[contained].empty()) - leftButtonStartDrag(cm, e, start, modifier); - else - leftButtonSelect(cm, e, start, type, modifier); - } - - // Start a text drag. When it ends, see if any dragging actually - // happen, and treat as a click if it didn't. - function leftButtonStartDrag(cm, e, start, modifier) { - var display = cm.display; - var dragEnd = operation(cm, function(e2) { - if (webkit) display.scroller.draggable = false; - cm.state.draggingText = false; - off(document, "mouseup", dragEnd); - off(display.scroller, "drop", dragEnd); - if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { - e_preventDefault(e2); - if (!modifier) - extendSelection(cm.doc, start); - focusInput(cm); - // Work around unexplainable focus problem in IE9 (#2127) - if (ie && ie_version == 9) - setTimeout(function() {document.body.focus(); focusInput(cm);}, 20); - } - }); - // Let the drag handler handle this. - if (webkit) display.scroller.draggable = true; - cm.state.draggingText = dragEnd; - // IE's approach to draggable - if (display.scroller.dragDrop) display.scroller.dragDrop(); - on(document, "mouseup", dragEnd); - on(display.scroller, "drop", dragEnd); - } - - // Normal selection, as opposed to text dragging. - function leftButtonSelect(cm, e, start, type, addNew) { - var display = cm.display, doc = cm.doc; - e_preventDefault(e); - - var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; - if (addNew && !e.shiftKey) { - ourIndex = doc.sel.contains(start); - if (ourIndex > -1) - ourRange = ranges[ourIndex]; - else - ourRange = new Range(start, start); - } else { - ourRange = doc.sel.primary(); - } - - if (e.altKey) { - type = "rect"; - if (!addNew) ourRange = new Range(start, start); - start = posFromMouse(cm, e, true, true); - ourIndex = -1; - } else if (type == "double") { - var word = cm.findWordAt(start); - if (cm.display.shift || doc.extend) - ourRange = extendRange(doc, ourRange, word.anchor, word.head); - else - ourRange = word; - } else if (type == "triple") { - var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0))); - if (cm.display.shift || doc.extend) - ourRange = extendRange(doc, ourRange, line.anchor, line.head); - else - ourRange = line; - } else { - ourRange = extendRange(doc, ourRange, start); - } - - if (!addNew) { - ourIndex = 0; - setSelection(doc, new Selection([ourRange], 0), sel_mouse); - startSel = doc.sel; - } else if (ourIndex == -1) { - ourIndex = ranges.length; - setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), - {scroll: false, origin: "*mouse"}); - } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single") { - setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0)); - startSel = doc.sel; - } else { - replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); - } - - var lastPos = start; - function extendTo(pos) { - if (cmp(lastPos, pos) == 0) return; - lastPos = pos; - - if (type == "rect") { - var ranges = [], tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); - var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); - for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); - line <= end; line++) { - var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); - if (left == right) - ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); - else if (text.length > leftPos) - ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); - } - if (!ranges.length) ranges.push(new Range(start, start)); - setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), - {origin: "*mouse", scroll: false}); - cm.scrollIntoView(pos); - } else { - var oldRange = ourRange; - var anchor = oldRange.anchor, head = pos; - if (type != "single") { - if (type == "double") - var range = cm.findWordAt(pos); - else - var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); - if (cmp(range.anchor, anchor) > 0) { - head = range.head; - anchor = minPos(oldRange.from(), range.anchor); - } else { - head = range.anchor; - anchor = maxPos(oldRange.to(), range.head); - } - } - var ranges = startSel.ranges.slice(0); - ranges[ourIndex] = new Range(clipPos(doc, anchor), head); - setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse); - } - } - - var editorSize = display.wrapper.getBoundingClientRect(); - // Used to ensure timeout re-tries don't fire when another extend - // happened in the meantime (clearTimeout isn't reliable -- at - // least on Chrome, the timeouts still happen even when cleared, - // if the clear happens after their scheduled firing time). - var counter = 0; - - function extend(e) { - var curCount = ++counter; - var cur = posFromMouse(cm, e, true, type == "rect"); - if (!cur) return; - if (cmp(cur, lastPos) != 0) { - ensureFocus(cm); - extendTo(cur); - var visible = visibleLines(display, doc); - if (cur.line >= visible.to || cur.line < visible.from) - setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); - } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; - if (outside) setTimeout(operation(cm, function() { - if (counter != curCount) return; - display.scroller.scrollTop += outside; - extend(e); - }), 50); - } - } - - function done(e) { - counter = Infinity; - e_preventDefault(e); - focusInput(cm); - off(document, "mousemove", move); - off(document, "mouseup", up); - doc.history.lastSelOrigin = null; - } - - var move = operation(cm, function(e) { - if (!e_button(e)) done(e); - else extend(e); - }); - var up = operation(cm, done); - on(document, "mousemove", move); - on(document, "mouseup", up); - } - - // Determines whether an event happened in the gutter, and fires the - // handlers for the corresponding event. - function gutterEvent(cm, e, type, prevent, signalfn) { - try { var mX = e.clientX, mY = e.clientY; } - catch(e) { return false; } - if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false; - if (prevent) e_preventDefault(e); - - var display = cm.display; - var lineBox = display.lineDiv.getBoundingClientRect(); - - if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e); - mY -= lineBox.top - display.viewOffset; - - for (var i = 0; i < cm.options.gutters.length; ++i) { - var g = display.gutters.childNodes[i]; - if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.doc, mY); - var gutter = cm.options.gutters[i]; - signalfn(cm, type, cm, line, gutter, e); - return e_defaultPrevented(e); - } - } - } - - function clickInGutter(cm, e) { - return gutterEvent(cm, e, "gutterClick", true, signalLater); - } - - // Kludge to work around strange IE behavior where it'll sometimes - // re-fire a series of drag-related events right after the drop (#1551) - var lastDrop = 0; - - function onDrop(e) { - var cm = this; - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) - return; - e_preventDefault(e); - if (ie) lastDrop = +new Date; - var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; - if (!pos || isReadOnly(cm)) return; - // Might be a file drop, in which case we simply extract the text - // and insert it. - if (files && files.length && window.FileReader && window.File) { - var n = files.length, text = Array(n), read = 0; - var loadFile = function(file, i) { - var reader = new FileReader; - reader.onload = operation(cm, function() { - text[i] = reader.result; - if (++read == n) { - pos = clipPos(cm.doc, pos); - var change = {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}; - makeChange(cm.doc, change); - setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); - } - }); - reader.readAsText(file); - }; - for (var i = 0; i < n; ++i) loadFile(files[i], i); - } else { // Normal drop - // Don't do a replace if the drop happened inside of the selected text. - if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { - cm.state.draggingText(e); - // Ensure the editor is re-focused - setTimeout(bind(focusInput, cm), 20); - return; - } - try { - var text = e.dataTransfer.getData("Text"); - if (text) { - if (cm.state.draggingText && !(mac ? e.metaKey : e.ctrlKey)) - var selected = cm.listSelections(); - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); - if (selected) for (var i = 0; i < selected.length; ++i) - replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); - cm.replaceSelection(text, "around", "paste"); - focusInput(cm); - } - } - catch(e){} - } - } - - function onDragStart(cm, e) { - if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; - - e.dataTransfer.setData("Text", cm.getSelection()); - - // Use dummy image instead of default browsers image. - // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. - if (e.dataTransfer.setDragImage && !safari) { - var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); - img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (presto) { - img.width = img.height = 1; - cm.display.wrapper.appendChild(img); - // Force a relayout, or Opera won't use our image for some obscure reason - img._top = img.offsetTop; - } - e.dataTransfer.setDragImage(img, 0, 0); - if (presto) img.parentNode.removeChild(img); - } - } - - // SCROLL EVENTS - - // Sync the scrollable area and scrollbars, ensure the viewport - // covers the visible area. - function setScrollTop(cm, val) { - if (Math.abs(cm.doc.scrollTop - val) < 2) return; - cm.doc.scrollTop = val; - if (!gecko) updateDisplaySimple(cm, {top: val}); - if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; - cm.display.scrollbars.setScrollTop(val); - if (gecko) updateDisplaySimple(cm); - startWorker(cm, 100); - } - // Sync scroller and scrollbar, ensure the gutter elements are - // aligned. - function setScrollLeft(cm, val, isScroller) { - if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return; - val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); - cm.doc.scrollLeft = val; - alignHorizontally(cm); - if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; - cm.display.scrollbars.setScrollLeft(val); - } - - // Since the delta values reported on mouse wheel events are - // unstandardized between browsers and even browser versions, and - // generally horribly unpredictable, this code starts by measuring - // the scroll effect that the first few mouse wheel events have, - // and, from that, detects the way it can convert deltas to pixel - // offsets afterwards. - // - // The reason we want to know the amount a wheel event will scroll - // is that it gives us a chance to update the display before the - // actual scrolling happens, reducing flickering. - - var wheelSamples = 0, wheelPixelsPerUnit = null; - // Fill in a browser-detected starting value on browsers where we - // know one. These don't have to be accurate -- the result of them - // being wrong would just be a slight flicker on the first wheel - // scroll (if it is large enough). - if (ie) wheelPixelsPerUnit = -.53; - else if (gecko) wheelPixelsPerUnit = 15; - else if (chrome) wheelPixelsPerUnit = -.7; - else if (safari) wheelPixelsPerUnit = -1/3; - - var wheelEventDelta = function(e) { - var dx = e.wheelDeltaX, dy = e.wheelDeltaY; - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; - else if (dy == null) dy = e.wheelDelta; - return {x: dx, y: dy}; - }; - CodeMirror.wheelEventPixels = function(e) { - var delta = wheelEventDelta(e); - delta.x *= wheelPixelsPerUnit; - delta.y *= wheelPixelsPerUnit; - return delta; - }; - - function onScrollWheel(cm, e) { - var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; - - var display = cm.display, scroll = display.scroller; - // Quit if there's nothing to scroll here - if (!(dx && scroll.scrollWidth > scroll.clientWidth || - dy && scroll.scrollHeight > scroll.clientHeight)) return; - - // Webkit browsers on OS X abort momentum scrolls when the target - // of the scroll event is removed from the scrollable element. - // This hack (see related code in patchDisplay) makes sure the - // element is kept around. - if (dy && mac && webkit) { - outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { - for (var i = 0; i < view.length; i++) { - if (view[i].node == cur) { - cm.display.currentWheelTarget = cur; - break outer; - } - } - } - } - - // On some browsers, horizontal scrolling will cause redraws to - // happen before the gutter has been realigned, causing it to - // wriggle around in a most unseemly way. When we have an - // estimated pixels/delta value, we just handle horizontal - // scrolling entirely here. It'll be slightly off from native, but - // better than glitching out. - if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { - if (dy) - setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); - setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); - e_preventDefault(e); - display.wheelStartX = null; // Abort measurement, if in progress - return; - } - - // 'Project' the visible viewport to cover the area that is being - // scrolled into view (if we know enough to estimate it). - if (dy && wheelPixelsPerUnit != null) { - var pixels = dy * wheelPixelsPerUnit; - var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; - if (pixels < 0) top = Math.max(0, top + pixels - 50); - else bot = Math.min(cm.doc.height, bot + pixels + 50); - updateDisplaySimple(cm, {top: top, bottom: bot}); - } - - if (wheelSamples < 20) { - if (display.wheelStartX == null) { - display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; - display.wheelDX = dx; display.wheelDY = dy; - setTimeout(function() { - if (display.wheelStartX == null) return; - var movedX = scroll.scrollLeft - display.wheelStartX; - var movedY = scroll.scrollTop - display.wheelStartY; - var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || - (movedX && display.wheelDX && movedX / display.wheelDX); - display.wheelStartX = display.wheelStartY = null; - if (!sample) return; - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); - ++wheelSamples; - }, 200); - } else { - display.wheelDX += dx; display.wheelDY += dy; - } - } - } - - // KEY EVENTS - - // Run a handler that was bound to a key. - function doHandleBinding(cm, bound, dropShift) { - if (typeof bound == "string") { - bound = commands[bound]; - if (!bound) return false; - } - // Ensure previous input has been read, so that the handler sees a - // consistent view of the document - if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false; - var prevShift = cm.display.shift, done = false; - try { - if (isReadOnly(cm)) cm.state.suppressEdits = true; - if (dropShift) cm.display.shift = false; - done = bound(cm) != Pass; - } finally { - cm.display.shift = prevShift; - cm.state.suppressEdits = false; - } - return done; - } - - function lookupKeyForEditor(cm, name, handle) { - for (var i = 0; i < cm.state.keyMaps.length; i++) { - var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); - if (result) return result; - } - return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) - || lookupKey(name, cm.options.keyMap, handle, cm); - } - - var stopSeq = new Delayed; - function dispatchKey(cm, name, e, handle) { - var seq = cm.state.keySeq; - if (seq) { - if (isModifierKey(name)) return "handled"; - stopSeq.set(50, function() { - if (cm.state.keySeq == seq) { - cm.state.keySeq = null; - resetInput(cm); - } - }); - name = seq + " " + name; - } - var result = lookupKeyForEditor(cm, name, handle); - - if (result == "multi") - cm.state.keySeq = name; - if (result == "handled") - signalLater(cm, "keyHandled", cm, name, e); - - if (result == "handled" || result == "multi") { - e_preventDefault(e); - restartBlink(cm); - } - - if (seq && !result && /\'$/.test(name)) { - e_preventDefault(e); - return true; - } - return !!result; - } - - // Handle a key from the keydown event. - function handleKeyBinding(cm, e) { - var name = keyName(e, true); - if (!name) return false; - - if (e.shiftKey && !cm.state.keySeq) { - // First try to resolve full name (including 'Shift-'). Failing - // that, see if there is a cursor-motion command (starting with - // 'go') bound to the keyname without 'Shift-'. - return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);}) - || dispatchKey(cm, name, e, function(b) { - if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) - return doHandleBinding(cm, b); - }); - } else { - return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); }); - } - } - - // Handle a key from the keypress event - function handleCharBinding(cm, e, ch) { - return dispatchKey(cm, "'" + ch + "'", e, - function(b) { return doHandleBinding(cm, b, true); }); - } - - var lastStoppedKey = null; - function onKeyDown(e) { - var cm = this; - ensureFocus(cm); - if (signalDOMEvent(cm, e)) return; - // IE does strange things with escape. - if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; - var code = e.keyCode; - cm.display.shift = code == 16 || e.shiftKey; - var handled = handleKeyBinding(cm, e); - if (presto) { - lastStoppedKey = handled ? code : null; - // Opera has no cut event... we try to at least catch the key combo - if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) - cm.replaceSelection("", null, "cut"); - } - - // Turn mouse into crosshair when Alt is held on Mac. - if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) - showCrossHair(cm); - } - - function showCrossHair(cm) { - var lineDiv = cm.display.lineDiv; - addClass(lineDiv, "CodeMirror-crosshair"); - - function up(e) { - if (e.keyCode == 18 || !e.altKey) { - rmClass(lineDiv, "CodeMirror-crosshair"); - off(document, "keyup", up); - off(document, "mouseover", up); - } - } - on(document, "keyup", up); - on(document, "mouseover", up); - } - - function onKeyUp(e) { - if (e.keyCode == 16) this.doc.sel.shift = false; - signalDOMEvent(this, e); - } - - function onKeyPress(e) { - var cm = this; - if (signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return; - var keyCode = e.keyCode, charCode = e.charCode; - if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} - if (((presto && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return; - var ch = String.fromCharCode(charCode == null ? keyCode : charCode); - if (handleCharBinding(cm, e, ch)) return; - if (ie && ie_version >= 9) cm.display.inputHasSelection = null; - fastPoll(cm); - } - - // FOCUS/BLUR EVENTS - - function onFocus(cm) { - if (cm.options.readOnly == "nocursor") return; - if (!cm.state.focused) { - signal(cm, "focus", cm); - cm.state.focused = true; - addClass(cm.display.wrapper, "CodeMirror-focused"); - // The prevInput test prevents this from firing when a context - // menu is closed (since the resetInput would kill the - // select-all detection hack) - if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { - resetInput(cm); - if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730 - } - } - slowPoll(cm); - restartBlink(cm); - } - function onBlur(cm) { - if (cm.state.focused) { - signal(cm, "blur", cm); - cm.state.focused = false; - rmClass(cm.display.wrapper, "CodeMirror-focused"); - } - clearInterval(cm.display.blinker); - setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); - } - - // CONTEXT MENU HANDLING - - // To make the context menu work, we need to briefly unhide the - // textarea (making it as unobtrusive as possible) to let the - // right-click take effect on it. - function onContextMenu(cm, e) { - if (signalDOMEvent(cm, e, "contextmenu")) return; - var display = cm.display; - if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return; - - var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; - if (!pos || presto) return; // Opera is difficult. - - // Reset the current text selection only if the click is done outside of the selection - // and 'resetSelectionOnContextMenu' option is true. - var reset = cm.options.resetSelectionOnContextMenu; - if (reset && cm.doc.sel.contains(pos) == -1) - operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); - - var oldCSS = display.input.style.cssText; - display.inputDiv.style.position = "absolute"; - display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + - "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " + - (ie ? "rgba(255, 255, 255, .05)" : "transparent") + - "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) - focusInput(cm); - if (webkit) window.scrollTo(null, oldScrollY); - resetInput(cm); - // Adds "Select all" to context menu in FF - if (!cm.somethingSelected()) display.input.value = display.prevInput = " "; - display.contextMenuPending = true; - display.selForContextMenu = cm.doc.sel; - clearTimeout(display.detectingSelectAll); - - // Select-all will be greyed out if there's nothing to select, so - // this adds a zero-width space so that we can later check whether - // it got selected. - function prepareSelectAllHack() { - if (display.input.selectionStart != null) { - var selected = cm.somethingSelected(); - var extval = display.input.value = "\u200b" + (selected ? display.input.value : ""); - display.prevInput = selected ? "" : "\u200b"; - display.input.selectionStart = 1; display.input.selectionEnd = extval.length; - // Re-set this, in case some other handler touched the - // selection in the meantime. - display.selForContextMenu = cm.doc.sel; - } - } - function rehide() { - display.contextMenuPending = false; - display.inputDiv.style.position = "relative"; - display.input.style.cssText = oldCSS; - if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); - slowPoll(cm); - - // Try to detect the user choosing select-all - if (display.input.selectionStart != null) { - if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); - var i = 0, poll = function() { - if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0) - operation(cm, commands.selectAll)(cm); - else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); - else resetInput(cm); - }; - display.detectingSelectAll = setTimeout(poll, 200); - } - } - - if (ie && ie_version >= 9) prepareSelectAllHack(); - if (captureRightClick) { - e_stop(e); - var mouseup = function() { - off(window, "mouseup", mouseup); - setTimeout(rehide, 20); - }; - on(window, "mouseup", mouseup); - } else { - setTimeout(rehide, 50); - } - } - - function contextMenuInGutter(cm, e) { - if (!hasHandler(cm, "gutterContextMenu")) return false; - return gutterEvent(cm, e, "gutterContextMenu", false, signal); - } - - // UPDATING - - // Compute the position of the end of a change (its 'to' property - // refers to the pre-change end). - var changeEnd = CodeMirror.changeEnd = function(change) { - if (!change.text) return change.to; - return Pos(change.from.line + change.text.length - 1, - lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); - }; - - // Adjust a position to refer to the post-change position of the - // same text, or the end of the change if the change covers it. - function adjustForChange(pos, change) { - if (cmp(pos, change.from) < 0) return pos; - if (cmp(pos, change.to) <= 0) return changeEnd(change); - - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; - if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch; - return Pos(line, ch); - } - - function computeSelAfterChange(doc, change) { - var out = []; - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - out.push(new Range(adjustForChange(range.anchor, change), - adjustForChange(range.head, change))); - } - return normalizeSelection(out, doc.sel.primIndex); - } - - function offsetPos(pos, old, nw) { - if (pos.line == old.line) - return Pos(nw.line, pos.ch - old.ch + nw.ch); - else - return Pos(nw.line + (pos.line - old.line), pos.ch); - } - - // Used by replaceSelections to allow moving the selection to the - // start or around the replaced test. Hint may be "start" or "around". - function computeReplacedSel(doc, changes, hint) { - var out = []; - var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - var from = offsetPos(change.from, oldPrev, newPrev); - var to = offsetPos(changeEnd(change), oldPrev, newPrev); - oldPrev = change.to; - newPrev = to; - if (hint == "around") { - var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; - out[i] = new Range(inv ? to : from, inv ? from : to); - } else { - out[i] = new Range(from, from); - } - } - return new Selection(out, doc.sel.primIndex); - } - - // Allow "beforeChange" event handlers to influence a change - function filterChange(doc, change, update) { - var obj = { - canceled: false, - from: change.from, - to: change.to, - text: change.text, - origin: change.origin, - cancel: function() { this.canceled = true; } - }; - if (update) obj.update = function(from, to, text, origin) { - if (from) this.from = clipPos(doc, from); - if (to) this.to = clipPos(doc, to); - if (text) this.text = text; - if (origin !== undefined) this.origin = origin; - }; - signal(doc, "beforeChange", doc, obj); - if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj); - - if (obj.canceled) return null; - return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}; - } - - // Apply a change to a document, and add it to the document's - // history, and propagating it to all linked documents. - function makeChange(doc, change, ignoreReadOnly) { - if (doc.cm) { - if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); - if (doc.cm.state.suppressEdits) return; - } - - if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { - change = filterChange(doc, change, true); - if (!change) return; - } - - // Possibly split or suppress the update based on the presence - // of read-only spans in its range. - var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); - if (split) { - for (var i = split.length - 1; i >= 0; --i) - makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); - } else { - makeChangeInner(doc, change); - } - } - - function makeChangeInner(doc, change) { - if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return; - var selAfter = computeSelAfterChange(doc, change); - addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); - - makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); - var rebased = []; - - linkedDocs(doc, function(doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); - }); - } - - // Revert a change stored in a document's history. - function makeChangeFromHistory(doc, type, allowSelectionOnly) { - if (doc.cm && doc.cm.state.suppressEdits) return; - - var hist = doc.history, event, selAfter = doc.sel; - var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; - - // Verify that there is a useable event (so that ctrl-z won't - // needlessly clear selection events) - for (var i = 0; i < source.length; i++) { - event = source[i]; - if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) - break; - } - if (i == source.length) return; - hist.lastOrigin = hist.lastSelOrigin = null; - - for (;;) { - event = source.pop(); - if (event.ranges) { - pushSelectionToHistory(event, dest); - if (allowSelectionOnly && !event.equals(doc.sel)) { - setSelection(doc, event, {clearRedo: false}); - return; - } - selAfter = event; - } - else break; - } - - // Build up a reverse change object to add to the opposite history - // stack (redo when undoing, and vice versa). - var antiChanges = []; - pushSelectionToHistory(selAfter, dest); - dest.push({changes: antiChanges, generation: hist.generation}); - hist.generation = event.generation || ++hist.maxGeneration; - - var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); - - for (var i = event.changes.length - 1; i >= 0; --i) { - var change = event.changes[i]; - change.origin = type; - if (filter && !filterChange(doc, change, false)) { - source.length = 0; - return; - } - - antiChanges.push(historyChangeFromChange(doc, change)); - - var after = i ? computeSelAfterChange(doc, change) : lst(source); - makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); - var rebased = []; - - // Propagate to the linked documents - linkedDocs(doc, function(doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); - }); - } - } - - // Sub-views need their line numbers shifted when text is added - // above or below them in the parent document. - function shiftDoc(doc, distance) { - if (distance == 0) return; - doc.first += distance; - doc.sel = new Selection(map(doc.sel.ranges, function(range) { - return new Range(Pos(range.anchor.line + distance, range.anchor.ch), - Pos(range.head.line + distance, range.head.ch)); - }), doc.sel.primIndex); - if (doc.cm) { - regChange(doc.cm, doc.first, doc.first - distance, distance); - for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) - regLineChange(doc.cm, l, "gutter"); - } - } - - // More lower-level change function, handling only a single document - // (not linked ones). - function makeChangeSingleDoc(doc, change, selAfter, spans) { - if (doc.cm && !doc.cm.curOp) - return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); - - if (change.to.line < doc.first) { - shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); - return; - } - if (change.from.line > doc.lastLine()) return; - - // Clip the change to the size of this doc - if (change.from.line < doc.first) { - var shift = change.text.length - 1 - (doc.first - change.from.line); - shiftDoc(doc, shift); - change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), - text: [lst(change.text)], origin: change.origin}; - } - var last = doc.lastLine(); - if (change.to.line > last) { - change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), - text: [change.text[0]], origin: change.origin}; - } - - change.removed = getBetween(doc, change.from, change.to); - - if (!selAfter) selAfter = computeSelAfterChange(doc, change); - if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans); - else updateDoc(doc, change, spans); - setSelectionNoUndo(doc, selAfter, sel_dontScroll); - } - - // Handle the interaction of a change to a document with the editor - // that this document is part of. - function makeChangeSingleDocInEditor(cm, change, spans) { - var doc = cm.doc, display = cm.display, from = change.from, to = change.to; - - var recomputeMaxLength = false, checkWidthStart = from.line; - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); - doc.iter(checkWidthStart, to.line + 1, function(line) { - if (line == display.maxLine) { - recomputeMaxLength = true; - return true; - } - }); - } - - if (doc.sel.contains(change.from, change.to) > -1) - signalCursorActivity(cm); - - updateDoc(doc, change, spans, estimateHeight(cm)); - - if (!cm.options.lineWrapping) { - doc.iter(checkWidthStart, from.line + change.text.length, function(line) { - var len = lineLength(line); - if (len > display.maxLineLength) { - display.maxLine = line; - display.maxLineLength = len; - display.maxLineChanged = true; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) cm.curOp.updateMaxLine = true; - } - - // Adjust frontier, schedule worker - doc.frontier = Math.min(doc.frontier, from.line); - startWorker(cm, 400); - - var lendiff = change.text.length - (to.line - from.line) - 1; - // Remember that these lines changed, for updating the display - if (change.full) - regChange(cm); - else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) - regLineChange(cm, from.line, "text"); - else - regChange(cm, from.line, to.line + 1, lendiff); - - var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); - if (changeHandler || changesHandler) { - var obj = { - from: from, to: to, - text: change.text, - removed: change.removed, - origin: change.origin - }; - if (changeHandler) signalLater(cm, "change", cm, obj); - if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); - } - cm.display.selForContextMenu = null; - } - - function replaceRange(doc, code, from, to, origin) { - if (!to) to = from; - if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } - if (typeof code == "string") code = splitLines(code); - makeChange(doc, {from: from, to: to, text: code, origin: origin}); - } - - // SCROLLING THINGS INTO VIEW - - // If an editor sits on the top or bottom of the window, partially - // scrolled out of view, this ensures that the cursor is visible. - function maybeScrollWindow(cm, coords) { - if (signalDOMEvent(cm, "scrollCursorIntoView")) return; - - var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; - if (coords.top + box.top < 0) doScroll = true; - else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; - if (doScroll != null && !phantom) { - var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " + - (coords.top - display.viewOffset - paddingTop(cm.display)) + "px; height: " + - (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px; left: " + - coords.left + "px; width: 2px;"); - cm.display.lineSpace.appendChild(scrollNode); - scrollNode.scrollIntoView(doScroll); - cm.display.lineSpace.removeChild(scrollNode); - } - } - - // Scroll a given position into view (immediately), verifying that - // it actually became visible (as line heights are accurately - // measured, the position of something may 'drift' during drawing). - function scrollPosIntoView(cm, pos, end, margin) { - if (margin == null) margin = 0; - for (var limit = 0; limit < 5; limit++) { - var changed = false, coords = cursorCoords(cm, pos); - var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); - var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), - Math.min(coords.top, endCoords.top) - margin, - Math.max(coords.left, endCoords.left), - Math.max(coords.bottom, endCoords.bottom) + margin); - var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; - if (scrollPos.scrollTop != null) { - setScrollTop(cm, scrollPos.scrollTop); - if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true; - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true; - } - if (!changed) break; - } - return coords; - } - - // Scroll a given set of coordinates into view (immediately). - function scrollIntoView(cm, x1, y1, x2, y2) { - var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); - if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); - if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); - } - - // Calculate a new scroll position needed to scroll the given - // rectangle into view. Returns an object with scrollTop and - // scrollLeft properties. When these are undefined, the - // vertical/horizontal position does not need to be adjusted. - function calculateScrollPos(cm, x1, y1, x2, y2) { - var display = cm.display, snapMargin = textHeight(cm.display); - if (y1 < 0) y1 = 0; - var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; - var screen = displayHeight(cm), result = {}; - if (y2 - y1 > screen) y2 = y1 + screen; - var docBottom = cm.doc.height + paddingVert(display); - var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; - if (y1 < screentop) { - result.scrollTop = atTop ? 0 : y1; - } else if (y2 > screentop + screen) { - var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen); - if (newTop != screentop) result.scrollTop = newTop; - } - - var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; - var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); - var tooWide = x2 - x1 > screenw; - if (tooWide) x2 = x1 + screenw; - if (x1 < 10) - result.scrollLeft = 0; - else if (x1 < screenleft) - result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)); - else if (x2 > screenw + screenleft - 3) - result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw; - return result; - } - - // Store a relative adjustment to the scroll position in the current - // operation (to be applied when the operation finishes). - function addToScrollPos(cm, left, top) { - if (left != null || top != null) resolveScrollToPos(cm); - if (left != null) - cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left; - if (top != null) - cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; - } - - // Make sure that at the end of the operation the current cursor is - // shown. - function ensureCursorVisible(cm) { - resolveScrollToPos(cm); - var cur = cm.getCursor(), from = cur, to = cur; - if (!cm.options.lineWrapping) { - from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur; - to = Pos(cur.line, cur.ch + 1); - } - cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}; - } - - // When an operation has its scrollToPos property set, and another - // scroll action is applied before the end of the operation, this - // 'simulates' scrolling that position into view in a cheap way, so - // that the effect of intermediate scroll commands is not ignored. - function resolveScrollToPos(cm) { - var range = cm.curOp.scrollToPos; - if (range) { - cm.curOp.scrollToPos = null; - var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); - var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), - Math.min(from.top, to.top) - range.margin, - Math.max(from.right, to.right), - Math.max(from.bottom, to.bottom) + range.margin); - cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); - } - } - - // API UTILITIES - - // Indent the given line. The how parameter can be "smart", - // "add"/null, "subtract", or "prev". When aggressive is false - // (typically set to true for forced single-line indents), empty - // lines are not indented, and places where the mode returns Pass - // are left alone. - function indentLine(cm, n, how, aggressive) { - var doc = cm.doc, state; - if (how == null) how = "add"; - if (how == "smart") { - // Fall back to "prev" when the mode doesn't have an indentation - // method. - if (!doc.mode.indent) how = "prev"; - else state = getStateBefore(cm, n); - } - - var tabSize = cm.options.tabSize; - var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); - if (line.stateAfter) line.stateAfter = null; - var curSpaceString = line.text.match(/^\s*/)[0], indentation; - if (!aggressive && !/\S/.test(line.text)) { - indentation = 0; - how = "not"; - } else if (how == "smart") { - indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); - if (indentation == Pass || indentation > 150) { - if (!aggressive) return; - how = "prev"; - } - } - if (how == "prev") { - if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); - else indentation = 0; - } else if (how == "add") { - indentation = curSpace + cm.options.indentUnit; - } else if (how == "subtract") { - indentation = curSpace - cm.options.indentUnit; - } else if (typeof how == "number") { - indentation = curSpace + how; - } - indentation = Math.max(0, indentation); - - var indentString = "", pos = 0; - if (cm.options.indentWithTabs) - for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} - if (pos < indentation) indentString += spaceStr(indentation - pos); - - if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); - } else { - // Ensure that, if the cursor was in the whitespace at the start - // of the line, it is moved to the end of that space. - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - if (range.head.line == n && range.head.ch < curSpaceString.length) { - var pos = Pos(n, curSpaceString.length); - replaceOneSelection(doc, i, new Range(pos, pos)); - break; - } - } - } - line.stateAfter = null; - } - - // Utility for applying a change to a line by handle or number, - // returning the number and optionally registering the line as - // changed. - function changeLine(doc, handle, changeType, op) { - var no = handle, line = handle; - if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); - else no = lineNo(handle); - if (no == null) return null; - if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType); - return line; - } - - // Helper for deleting text near the selection(s), used to implement - // backspace, delete, and similar functionality. - function deleteNearSelection(cm, compute) { - var ranges = cm.doc.sel.ranges, kill = []; - // Build up a set of ranges to kill first, merging overlapping - // ranges. - for (var i = 0; i < ranges.length; i++) { - var toKill = compute(ranges[i]); - while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { - var replaced = kill.pop(); - if (cmp(replaced.from, toKill.from) < 0) { - toKill.from = replaced.from; - break; - } - } - kill.push(toKill); - } - // Next, remove those actual ranges. - runInOp(cm, function() { - for (var i = kill.length - 1; i >= 0; i--) - replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); - ensureCursorVisible(cm); - }); - } - - // Used for horizontal relative motion. Dir is -1 or 1 (left or - // right), unit can be "char", "column" (like char, but doesn't - // cross line boundaries), "word" (across next word), or "group" (to - // the start of next group of word or non-word-non-whitespace - // chars). The visually param controls whether, in right-to-left - // text, direction 1 means to move towards the next index in the - // string, or towards the character to the right of the current - // position. The resulting position will have a hitSide=true - // property if it reached the end of the document. - function findPosH(doc, pos, dir, unit, visually) { - var line = pos.line, ch = pos.ch, origDir = dir; - var lineObj = getLine(doc, line); - var possible = true; - function findNextLine() { - var l = line + dir; - if (l < doc.first || l >= doc.first + doc.size) return (possible = false); - line = l; - return lineObj = getLine(doc, l); - } - function moveOnce(boundToLine) { - var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); - if (next == null) { - if (!boundToLine && findNextLine()) { - if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); - else ch = dir < 0 ? lineObj.text.length : 0; - } else return (possible = false); - } else ch = next; - return true; - } - - if (unit == "char") moveOnce(); - else if (unit == "column") moveOnce(true); - else if (unit == "word" || unit == "group") { - var sawType = null, group = unit == "group"; - var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); - for (var first = true;; first = false) { - if (dir < 0 && !moveOnce(!first)) break; - var cur = lineObj.text.charAt(ch) || "\n"; - var type = isWordChar(cur, helper) ? "w" - : group && cur == "\n" ? "n" - : !group || /\s/.test(cur) ? null - : "p"; - if (group && !first && !type) type = "s"; - if (sawType && sawType != type) { - if (dir < 0) {dir = 1; moveOnce();} - break; - } - - if (type) sawType = type; - if (dir > 0 && !moveOnce(!first)) break; - } - } - var result = skipAtomic(doc, Pos(line, ch), origDir, true); - if (!possible) result.hitSide = true; - return result; - } - - // For relative vertical movement. Dir may be -1 or 1. Unit can be - // "page" or "line". The resulting position will have a hitSide=true - // property if it reached the end of the document. - function findPosV(cm, pos, dir, unit) { - var doc = cm.doc, x = pos.left, y; - if (unit == "page") { - var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); - y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); - } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3; - } - for (;;) { - var target = coordsChar(cm, x, y); - if (!target.outside) break; - if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } - y += dir * 5; - } - return target; - } - - // EDITOR METHODS - - // The publicly visible API. Note that methodOp(f) means - // 'wrap f in an operation, performed on its `this` parameter'. - - // This is not the complete set of editor methods. Most of the - // methods defined on the Doc type are also injected into - // CodeMirror.prototype, for backwards compatibility and - // convenience. - - CodeMirror.prototype = { - constructor: CodeMirror, - focus: function(){window.focus(); focusInput(this); fastPoll(this);}, - - setOption: function(option, value) { - var options = this.options, old = options[option]; - if (options[option] == value && option != "mode") return; - options[option] = value; - if (optionHandlers.hasOwnProperty(option)) - operation(this, optionHandlers[option])(this, value, old); - }, - - getOption: function(option) {return this.options[option];}, - getDoc: function() {return this.doc;}, - - addKeyMap: function(map, bottom) { - this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); - }, - removeKeyMap: function(map) { - var maps = this.state.keyMaps; - for (var i = 0; i < maps.length; ++i) - if (maps[i] == map || maps[i].name == map) { - maps.splice(i, 1); - return true; - } - }, - - addOverlay: methodOp(function(spec, options) { - var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); - if (mode.startState) throw new Error("Overlays may not be stateful."); - this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque}); - this.state.modeGen++; - regChange(this); - }), - removeOverlay: methodOp(function(spec) { - var overlays = this.state.overlays; - for (var i = 0; i < overlays.length; ++i) { - var cur = overlays[i].modeSpec; - if (cur == spec || typeof spec == "string" && cur.name == spec) { - overlays.splice(i, 1); - this.state.modeGen++; - regChange(this); - return; - } - } - }), - - indentLine: methodOp(function(n, dir, aggressive) { - if (typeof dir != "string" && typeof dir != "number") { - if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; - else dir = dir ? "add" : "subtract"; - } - if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); - }), - indentSelection: methodOp(function(how) { - var ranges = this.doc.sel.ranges, end = -1; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty()) { - var from = range.from(), to = range.to(); - var start = Math.max(end, from.line); - end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; - for (var j = start; j < end; ++j) - indentLine(this, j, how); - var newRanges = this.doc.sel.ranges; - if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) - replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); - } else if (range.head.line > end) { - indentLine(this, range.head.line, how, true); - end = range.head.line; - if (i == this.doc.sel.primIndex) ensureCursorVisible(this); - } - } - }), - - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function(pos, precise) { - return takeToken(this, pos, precise); - }, - - getLineTokens: function(line, precise) { - return takeToken(this, Pos(line), precise, true); - }, - - getTokenTypeAt: function(pos) { - pos = clipPos(this.doc, pos); - var styles = getLineStyles(this, getLine(this.doc, pos.line)); - var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; - var type; - if (ch == 0) type = styles[2]; - else for (;;) { - var mid = (before + after) >> 1; - if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid; - else if (styles[mid * 2 + 1] < ch) before = mid + 1; - else { type = styles[mid * 2 + 2]; break; } - } - var cut = type ? type.indexOf("cm-overlay ") : -1; - return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); - }, - - getModeAt: function(pos) { - var mode = this.doc.mode; - if (!mode.innerMode) return mode; - return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode; - }, - - getHelper: function(pos, type) { - return this.getHelpers(pos, type)[0]; - }, - - getHelpers: function(pos, type) { - var found = []; - if (!helpers.hasOwnProperty(type)) return helpers; - var help = helpers[type], mode = this.getModeAt(pos); - if (typeof mode[type] == "string") { - if (help[mode[type]]) found.push(help[mode[type]]); - } else if (mode[type]) { - for (var i = 0; i < mode[type].length; i++) { - var val = help[mode[type][i]]; - if (val) found.push(val); - } - } else if (mode.helperType && help[mode.helperType]) { - found.push(help[mode.helperType]); - } else if (help[mode.name]) { - found.push(help[mode.name]); - } - for (var i = 0; i < help._global.length; i++) { - var cur = help._global[i]; - if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) - found.push(cur.val); - } - return found; - }, - - getStateAfter: function(line, precise) { - var doc = this.doc; - line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); - return getStateBefore(this, line + 1, precise); - }, - - cursorCoords: function(start, mode) { - var pos, range = this.doc.sel.primary(); - if (start == null) pos = range.head; - else if (typeof start == "object") pos = clipPos(this.doc, start); - else pos = start ? range.from() : range.to(); - return cursorCoords(this, pos, mode || "page"); - }, - - charCoords: function(pos, mode) { - return charCoords(this, clipPos(this.doc, pos), mode || "page"); - }, - - coordsChar: function(coords, mode) { - coords = fromCoordSystem(this, coords, mode || "page"); - return coordsChar(this, coords.left, coords.top); - }, - - lineAtHeight: function(height, mode) { - height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; - return lineAtHeight(this.doc, height + this.display.viewOffset); - }, - heightAtLine: function(line, mode) { - var end = false, last = this.doc.first + this.doc.size - 1; - if (line < this.doc.first) line = this.doc.first; - else if (line > last) { line = last; end = true; } - var lineObj = getLine(this.doc, line); - return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + - (end ? this.doc.height - heightAtLine(lineObj) : 0); - }, - - defaultTextHeight: function() { return textHeight(this.display); }, - defaultCharWidth: function() { return charWidth(this.display); }, - - setGutterMarker: methodOp(function(line, gutterID, value) { - return changeLine(this.doc, line, "gutter", function(line) { - var markers = line.gutterMarkers || (line.gutterMarkers = {}); - markers[gutterID] = value; - if (!value && isEmpty(markers)) line.gutterMarkers = null; - return true; - }); - }), - - clearGutter: methodOp(function(gutterID) { - var cm = this, doc = cm.doc, i = doc.first; - doc.iter(function(line) { - if (line.gutterMarkers && line.gutterMarkers[gutterID]) { - line.gutterMarkers[gutterID] = null; - regLineChange(cm, i, "gutter"); - if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; - } - ++i; - }); - }), - - addLineWidget: methodOp(function(handle, node, options) { - return addLineWidget(this, handle, node, options); - }), - - removeLineWidget: function(widget) { widget.clear(); }, - - lineInfo: function(line) { - if (typeof line == "number") { - if (!isLine(this.doc, line)) return null; - var n = line; - line = getLine(this.doc, line); - if (!line) return null; - } else { - var n = lineNo(line); - if (n == null) return null; - } - return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, - textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, - widgets: line.widgets}; - }, - - getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};}, - - addWidget: function(pos, node, scroll, vert, horiz) { - var display = this.display; - pos = cursorCoords(this, clipPos(this.doc, pos)); - var top = pos.bottom, left = pos.left; - node.style.position = "absolute"; - node.setAttribute("cm-ignore-events", "true"); - display.sizer.appendChild(node); - if (vert == "over") { - top = pos.top; - } else if (vert == "above" || vert == "near") { - var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); - // Default to positioning above (if specified and possible); otherwise default to positioning below - if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) - top = pos.top - node.offsetHeight; - else if (pos.bottom + node.offsetHeight <= vspace) - top = pos.bottom; - if (left + node.offsetWidth > hspace) - left = hspace - node.offsetWidth; - } - node.style.top = top + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") left = 0; - else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; - node.style.left = left + "px"; - } - if (scroll) - scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); - }, - - triggerOnKeyDown: methodOp(onKeyDown), - triggerOnKeyPress: methodOp(onKeyPress), - triggerOnKeyUp: onKeyUp, - - execCommand: function(cmd) { - if (commands.hasOwnProperty(cmd)) - return commands[cmd](this); - }, - - findPosH: function(from, amount, unit, visually) { - var dir = 1; - if (amount < 0) { dir = -1; amount = -amount; } - for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { - cur = findPosH(this.doc, cur, dir, unit, visually); - if (cur.hitSide) break; - } - return cur; - }, - - moveH: methodOp(function(dir, unit) { - var cm = this; - cm.extendSelectionsBy(function(range) { - if (cm.display.shift || cm.doc.extend || range.empty()) - return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually); - else - return dir < 0 ? range.from() : range.to(); - }, sel_move); - }), - - deleteH: methodOp(function(dir, unit) { - var sel = this.doc.sel, doc = this.doc; - if (sel.somethingSelected()) - doc.replaceSelection("", null, "+delete"); - else - deleteNearSelection(this, function(range) { - var other = findPosH(doc, range.head, dir, unit, false); - return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}; - }); - }), - - findPosV: function(from, amount, unit, goalColumn) { - var dir = 1, x = goalColumn; - if (amount < 0) { dir = -1; amount = -amount; } - for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { - var coords = cursorCoords(this, cur, "div"); - if (x == null) x = coords.left; - else coords.left = x; - cur = findPosV(this, coords, dir, unit); - if (cur.hitSide) break; - } - return cur; - }, - - moveV: methodOp(function(dir, unit) { - var cm = this, doc = this.doc, goals = []; - var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected(); - doc.extendSelectionsBy(function(range) { - if (collapse) - return dir < 0 ? range.from() : range.to(); - var headPos = cursorCoords(cm, range.head, "div"); - if (range.goalColumn != null) headPos.left = range.goalColumn; - goals.push(headPos.left); - var pos = findPosV(cm, headPos, dir, unit); - if (unit == "page" && range == doc.sel.primary()) - addToScrollPos(cm, null, charCoords(cm, pos, "div").top - headPos.top); - return pos; - }, sel_move); - if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++) - doc.sel.ranges[i].goalColumn = goals[i]; - }), - - // Find the word at the given position (as returned by coordsChar). - findWordAt: function(pos) { - var doc = this.doc, line = getLine(doc, pos.line).text; - var start = pos.ch, end = pos.ch; - if (line) { - var helper = this.getHelper(pos, "wordChars"); - if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; - var startChar = line.charAt(start); - var check = isWordChar(startChar, helper) - ? function(ch) { return isWordChar(ch, helper); } - : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} - : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; - while (start > 0 && check(line.charAt(start - 1))) --start; - while (end < line.length && check(line.charAt(end))) ++end; - } - return new Range(Pos(pos.line, start), Pos(pos.line, end)); - }, - - toggleOverwrite: function(value) { - if (value != null && value == this.state.overwrite) return; - if (this.state.overwrite = !this.state.overwrite) - addClass(this.display.cursorDiv, "CodeMirror-overwrite"); - else - rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); - - signal(this, "overwriteToggle", this, this.state.overwrite); - }, - hasFocus: function() { return activeElt() == this.display.input; }, - - scrollTo: methodOp(function(x, y) { - if (x != null || y != null) resolveScrollToPos(this); - if (x != null) this.curOp.scrollLeft = x; - if (y != null) this.curOp.scrollTop = y; - }), - getScrollInfo: function() { - var scroller = this.display.scroller; - return {left: scroller.scrollLeft, top: scroller.scrollTop, - height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, - width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, - clientHeight: displayHeight(this), clientWidth: displayWidth(this)}; - }, - - scrollIntoView: methodOp(function(range, margin) { - if (range == null) { - range = {from: this.doc.sel.primary().head, to: null}; - if (margin == null) margin = this.options.cursorScrollMargin; - } else if (typeof range == "number") { - range = {from: Pos(range, 0), to: null}; - } else if (range.from == null) { - range = {from: range, to: null}; - } - if (!range.to) range.to = range.from; - range.margin = margin || 0; - - if (range.from.line != null) { - resolveScrollToPos(this); - this.curOp.scrollToPos = range; - } else { - var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left), - Math.min(range.from.top, range.to.top) - range.margin, - Math.max(range.from.right, range.to.right), - Math.max(range.from.bottom, range.to.bottom) + range.margin); - this.scrollTo(sPos.scrollLeft, sPos.scrollTop); - } - }), - - setSize: methodOp(function(width, height) { - var cm = this; - function interpret(val) { - return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; - } - if (width != null) cm.display.wrapper.style.width = interpret(width); - if (height != null) cm.display.wrapper.style.height = interpret(height); - if (cm.options.lineWrapping) clearLineMeasurementCache(this); - var lineNo = cm.display.viewFrom; - cm.doc.iter(lineNo, cm.display.viewTo, function(line) { - if (line.widgets) for (var i = 0; i < line.widgets.length; i++) - if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, "widget"); break; } - ++lineNo; - }); - cm.curOp.forceUpdate = true; - signal(cm, "refresh", this); - }), - - operation: function(f){return runInOp(this, f);}, - - refresh: methodOp(function() { - var oldHeight = this.display.cachedTextHeight; - regChange(this); - this.curOp.forceUpdate = true; - clearCaches(this); - this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop); - updateGutterSpace(this); - if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) - estimateLineHeights(this); - signal(this, "refresh", this); - }), - - swapDoc: methodOp(function(doc) { - var old = this.doc; - old.cm = null; - attachDoc(this, doc); - clearCaches(this); - resetInput(this); - this.scrollTo(doc.scrollLeft, doc.scrollTop); - this.curOp.forceScroll = true; - signalLater(this, "swapDoc", this, old); - return old; - }), - - getInputField: function(){return this.display.input;}, - getWrapperElement: function(){return this.display.wrapper;}, - getScrollerElement: function(){return this.display.scroller;}, - getGutterElement: function(){return this.display.gutters;} - }; - eventMixin(CodeMirror); - - // OPTION DEFAULTS - - // The default configuration options. - var defaults = CodeMirror.defaults = {}; - // Functions to run when options are changed. - var optionHandlers = CodeMirror.optionHandlers = {}; - - function option(name, deflt, handle, notOnInit) { - CodeMirror.defaults[name] = deflt; - if (handle) optionHandlers[name] = - notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; - } - - // Passed to option handlers when there is no old value. - var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; - - // These two are, on init, called from the constructor because they - // have to be initialized before the editor can start at all. - option("value", "", function(cm, val) { - cm.setValue(val); - }, true); - option("mode", null, function(cm, val) { - cm.doc.modeOption = val; - loadMode(cm); - }, true); - - option("indentUnit", 2, loadMode, true); - option("indentWithTabs", false); - option("smartIndent", true); - option("tabSize", 4, function(cm) { - resetModeState(cm); - clearCaches(cm); - regChange(cm); - }, true); - option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val) { - cm.options.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); - cm.refresh(); - }, true); - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true); - option("electricChars", true); - option("rtlMoveVisually", !windows); - option("wholeLineUpdateBefore", true); - - option("theme", "default", function(cm) { - themeChanged(cm); - guttersChanged(cm); - }, true); - option("keyMap", "default", function(cm, val, old) { - var next = getKeyMap(val); - var prev = old != CodeMirror.Init && getKeyMap(old); - if (prev && prev.detach) prev.detach(cm, next); - if (next.attach) next.attach(cm, prev || null); - }); - option("extraKeys", null); - - option("lineWrapping", false, wrappingChanged, true); - option("gutters", [], function(cm) { - setGuttersForLineNumbers(cm.options); - guttersChanged(cm); - }, true); - option("fixedGutter", true, function(cm, val) { - cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; - cm.refresh(); - }, true); - option("coverGutterNextToScrollbar", false, function(cm) {updateScrollbars(cm);}, true); - option("scrollbarStyle", "native", function(cm) { - initScrollbars(cm); - updateScrollbars(cm); - cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); - cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); - }, true); - option("lineNumbers", false, function(cm) { - setGuttersForLineNumbers(cm.options); - guttersChanged(cm); - }, true); - option("firstLineNumber", 1, guttersChanged, true); - option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); - option("showCursorWhenSelecting", false, updateSelection, true); - - option("resetSelectionOnContextMenu", true); - - option("readOnly", false, function(cm, val) { - if (val == "nocursor") { - onBlur(cm); - cm.display.input.blur(); - cm.display.disabled = true; - } else { - cm.display.disabled = false; - if (!val) resetInput(cm); - } - }); - option("disableInput", false, function(cm, val) {if (!val) resetInput(cm);}, true); - option("dragDrop", true); - - option("cursorBlinkRate", 530); - option("cursorScrollMargin", 0); - option("cursorHeight", 1, updateSelection, true); - option("singleCursorHeightPerLine", true, updateSelection, true); - option("workTime", 100); - option("workDelay", 100); - option("flattenSpans", true, resetModeState, true); - option("addModeClass", false, resetModeState, true); - option("pollInterval", 100); - option("undoDepth", 200, function(cm, val){cm.doc.history.undoDepth = val;}); - option("historyEventDelay", 1250); - option("viewportMargin", 10, function(cm){cm.refresh();}, true); - option("maxHighlightLength", 10000, resetModeState, true); - option("moveInputWithCursor", true, function(cm, val) { - if (!val) cm.display.inputDiv.style.top = cm.display.inputDiv.style.left = 0; - }); - - option("tabindex", null, function(cm, val) { - cm.display.input.tabIndex = val || ""; - }); - option("autofocus", null); - - // MODE DEFINITION AND QUERYING - - // Known modes, by name and by MIME - var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; - - // Extra arguments are stored as the mode's dependencies, which is - // used by (legacy) mechanisms like loadmode.js to automatically - // load a mode. (Preferred mechanism is the require/define calls.) - CodeMirror.defineMode = function(name, mode) { - if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; - if (arguments.length > 2) - mode.dependencies = Array.prototype.slice.call(arguments, 2); - modes[name] = mode; - }; - - CodeMirror.defineMIME = function(mime, spec) { - mimeModes[mime] = spec; - }; - - // Given a MIME type, a {name, ...options} config object, or a name - // string, return a mode config object. - CodeMirror.resolveMode = function(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - var found = mimeModes[spec.name]; - if (typeof found == "string") found = {name: found}; - spec = createObj(found, spec); - spec.name = found.name; - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { - return CodeMirror.resolveMode("application/xml"); - } - if (typeof spec == "string") return {name: spec}; - else return spec || {name: "null"}; - }; - - // Given a mode spec (anything that resolveMode accepts), find and - // initialize an actual mode object. - CodeMirror.getMode = function(options, spec) { - var spec = CodeMirror.resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) return CodeMirror.getMode(options, "text/plain"); - var modeObj = mfactory(options, spec); - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name]; - for (var prop in exts) { - if (!exts.hasOwnProperty(prop)) continue; - if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; - modeObj[prop] = exts[prop]; - } - } - modeObj.name = spec.name; - if (spec.helperType) modeObj.helperType = spec.helperType; - if (spec.modeProps) for (var prop in spec.modeProps) - modeObj[prop] = spec.modeProps[prop]; - - return modeObj; - }; - - // Minimal default mode. - CodeMirror.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; - }); - CodeMirror.defineMIME("text/plain", "null"); - - // This can be used to attach properties to mode objects from - // outside the actual mode definition. - var modeExtensions = CodeMirror.modeExtensions = {}; - CodeMirror.extendMode = function(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); - copyObj(properties, exts); - }; - - // EXTENSIONS - - CodeMirror.defineExtension = function(name, func) { - CodeMirror.prototype[name] = func; - }; - CodeMirror.defineDocExtension = function(name, func) { - Doc.prototype[name] = func; - }; - CodeMirror.defineOption = option; - - var initHooks = []; - CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; - - var helpers = CodeMirror.helpers = {}; - CodeMirror.registerHelper = function(type, name, value) { - if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []}; - helpers[type][name] = value; - }; - CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { - CodeMirror.registerHelper(type, name, value); - helpers[type]._global.push({pred: predicate, val: value}); - }; - - // MODE STATE HANDLING - - // Utility functions for working with state. Exported because nested - // modes need to do this for their inner modes. - - var copyState = CodeMirror.copyState = function(mode, state) { - if (state === true) return state; - if (mode.copyState) return mode.copyState(state); - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) val = val.concat([]); - nstate[n] = val; - } - return nstate; - }; - - var startState = CodeMirror.startState = function(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; - }; - - // Given a mode and a state (for that mode), find the inner mode and - // state at the position that the state refers to. - CodeMirror.innerMode = function(mode, state) { - while (mode.innerMode) { - var info = mode.innerMode(state); - if (!info || info.mode == mode) break; - state = info.state; - mode = info.mode; - } - return info || {mode: mode, state: state}; - }; - - // STANDARD COMMANDS - - // Commands are parameter-less actions that can be performed on an - // editor, mostly used for keybindings. - var commands = CodeMirror.commands = { - selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);}, - singleSelection: function(cm) { - cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); - }, - killLine: function(cm) { - deleteNearSelection(cm, function(range) { - if (range.empty()) { - var len = getLine(cm.doc, range.head.line).text.length; - if (range.head.ch == len && range.head.line < cm.lastLine()) - return {from: range.head, to: Pos(range.head.line + 1, 0)}; - else - return {from: range.head, to: Pos(range.head.line, len)}; - } else { - return {from: range.from(), to: range.to()}; - } - }); - }, - deleteLine: function(cm) { - deleteNearSelection(cm, function(range) { - return {from: Pos(range.from().line, 0), - to: clipPos(cm.doc, Pos(range.to().line + 1, 0))}; - }); - }, - delLineLeft: function(cm) { - deleteNearSelection(cm, function(range) { - return {from: Pos(range.from().line, 0), to: range.from()}; - }); - }, - delWrappedLineLeft: function(cm) { - deleteNearSelection(cm, function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var leftPos = cm.coordsChar({left: 0, top: top}, "div"); - return {from: leftPos, to: range.from()}; - }); - }, - delWrappedLineRight: function(cm) { - deleteNearSelection(cm, function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - return {from: range.from(), to: rightPos }; - }); - }, - undo: function(cm) {cm.undo();}, - redo: function(cm) {cm.redo();}, - undoSelection: function(cm) {cm.undoSelection();}, - redoSelection: function(cm) {cm.redoSelection();}, - goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, - goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, - goLineStart: function(cm) { - cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, - {origin: "+move", bias: 1}); - }, - goLineStartSmart: function(cm) { - cm.extendSelectionsBy(function(range) { - return lineStartSmart(cm, range.head); - }, {origin: "+move", bias: 1}); - }, - goLineEnd: function(cm) { - cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, - {origin: "+move", bias: -1}); - }, - goLineRight: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - }, sel_move); - }, - goLineLeft: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - return cm.coordsChar({left: 0, top: top}, "div"); - }, sel_move); - }, - goLineLeftSmart: function(cm) { - cm.extendSelectionsBy(function(range) { - var top = cm.charCoords(range.head, "div").top + 5; - var pos = cm.coordsChar({left: 0, top: top}, "div"); - if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head); - return pos; - }, sel_move); - }, - goLineUp: function(cm) {cm.moveV(-1, "line");}, - goLineDown: function(cm) {cm.moveV(1, "line");}, - goPageUp: function(cm) {cm.moveV(-1, "page");}, - goPageDown: function(cm) {cm.moveV(1, "page");}, - goCharLeft: function(cm) {cm.moveH(-1, "char");}, - goCharRight: function(cm) {cm.moveH(1, "char");}, - goColumnLeft: function(cm) {cm.moveH(-1, "column");}, - goColumnRight: function(cm) {cm.moveH(1, "column");}, - goWordLeft: function(cm) {cm.moveH(-1, "word");}, - goGroupRight: function(cm) {cm.moveH(1, "group");}, - goGroupLeft: function(cm) {cm.moveH(-1, "group");}, - goWordRight: function(cm) {cm.moveH(1, "word");}, - delCharBefore: function(cm) {cm.deleteH(-1, "char");}, - delCharAfter: function(cm) {cm.deleteH(1, "char");}, - delWordBefore: function(cm) {cm.deleteH(-1, "word");}, - delWordAfter: function(cm) {cm.deleteH(1, "word");}, - delGroupBefore: function(cm) {cm.deleteH(-1, "group");}, - delGroupAfter: function(cm) {cm.deleteH(1, "group");}, - indentAuto: function(cm) {cm.indentSelection("smart");}, - indentMore: function(cm) {cm.indentSelection("add");}, - indentLess: function(cm) {cm.indentSelection("subtract");}, - insertTab: function(cm) {cm.replaceSelection("\t");}, - insertSoftTab: function(cm) { - var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].from(); - var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); - spaces.push(new Array(tabSize - col % tabSize + 1).join(" ")); - } - cm.replaceSelections(spaces); - }, - defaultTab: function(cm) { - if (cm.somethingSelected()) cm.indentSelection("add"); - else cm.execCommand("insertTab"); - }, - transposeChars: function(cm) { - runInOp(cm, function() { - var ranges = cm.listSelections(), newSel = []; - for (var i = 0; i < ranges.length; i++) { - var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; - if (line) { - if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1); - if (cur.ch > 0) { - cur = new Pos(cur.line, cur.ch + 1); - cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), - Pos(cur.line, cur.ch - 2), cur, "+transpose"); - } else if (cur.line > cm.doc.first) { - var prev = getLine(cm.doc, cur.line - 1).text; - if (prev) - cm.replaceRange(line.charAt(0) + "\n" + prev.charAt(prev.length - 1), - Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose"); - } - } - newSel.push(new Range(cur, cur)); - } - cm.setSelections(newSel); - }); - }, - newlineAndIndent: function(cm) { - runInOp(cm, function() { - var len = cm.listSelections().length; - for (var i = 0; i < len; i++) { - var range = cm.listSelections()[i]; - cm.replaceRange("\n", range.anchor, range.head, "+input"); - cm.indentLine(range.from().line + 1, null, true); - ensureCursorVisible(cm); - } - }); - }, - toggleOverwrite: function(cm) {cm.toggleOverwrite();} - }; - - - // STANDARD KEYMAPS - - var keyMap = CodeMirror.keyMap = {}; - - keyMap.basic = { - "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", - "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", - "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", - "Tab": "defaultTab", "Shift-Tab": "indentAuto", - "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", - "Esc": "singleSelection" - }; - // Note that the save and find-related commands aren't defined by - // default. User code or addons can define them. Unknown commands - // are simply ignored. - keyMap.pcDefault = { - "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", - "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", - "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", - "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", - "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", - "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", - fallthrough: "basic" - }; - // Very basic readline/emacs-style bindings, which are standard on Mac. - keyMap.emacsy = { - "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", - "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", - "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", - "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" - }; - keyMap.macDefault = { - "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", - "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", - "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", - "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", - "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", - "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", - fallthrough: ["basic", "emacsy"] - }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; - - // KEYMAP DISPATCH - - function normalizeKeyName(name) { - var parts = name.split(/-(?!$)/), name = parts[parts.length - 1]; - var alt, ctrl, shift, cmd; - for (var i = 0; i < parts.length - 1; i++) { - var mod = parts[i]; - if (/^(cmd|meta|m)$/i.test(mod)) cmd = true; - else if (/^a(lt)?$/i.test(mod)) alt = true; - else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true; - else if (/^s(hift)$/i.test(mod)) shift = true; - else throw new Error("Unrecognized modifier name: " + mod); - } - if (alt) name = "Alt-" + name; - if (ctrl) name = "Ctrl-" + name; - if (cmd) name = "Cmd-" + name; - if (shift) name = "Shift-" + name; - return name; - } - - // This is a kludge to keep keymaps mostly working as raw objects - // (backwards compatibility) while at the same time support features - // like normalization and multi-stroke key bindings. It compiles a - // new normalized keymap, and then updates the old object to reflect - // this. - CodeMirror.normalizeKeyMap = function(keymap) { - var copy = {}; - for (var keyname in keymap) if (keymap.hasOwnProperty(keyname)) { - var value = keymap[keyname]; - if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) continue; - if (value == "...") { delete keymap[keyname]; continue; } - - var keys = map(keyname.split(" "), normalizeKeyName); - for (var i = 0; i < keys.length; i++) { - var val, name; - if (i == keys.length - 1) { - name = keyname; - val = value; - } else { - name = keys.slice(0, i + 1).join(" "); - val = "..."; - } - var prev = copy[name]; - if (!prev) copy[name] = val; - else if (prev != val) throw new Error("Inconsistent bindings for " + name); - } - delete keymap[keyname]; - } - for (var prop in copy) keymap[prop] = copy[prop]; - return keymap; - }; - - var lookupKey = CodeMirror.lookupKey = function(key, map, handle, context) { - map = getKeyMap(map); - var found = map.call ? map.call(key, context) : map[key]; - if (found === false) return "nothing"; - if (found === "...") return "multi"; - if (found != null && handle(found)) return "handled"; - - if (map.fallthrough) { - if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") - return lookupKey(key, map.fallthrough, handle, context); - for (var i = 0; i < map.fallthrough.length; i++) { - var result = lookupKey(key, map.fallthrough[i], handle, context); - if (result) return result; - } - } - }; - - // Modifier key presses don't count as 'real' key presses for the - // purpose of keymap fallthrough. - var isModifierKey = CodeMirror.isModifierKey = function(value) { - var name = typeof value == "string" ? value : keyNames[value.keyCode]; - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; - }; - - // Look up the name of a key as indicated by an event object. - var keyName = CodeMirror.keyName = function(event, noShift) { - if (presto && event.keyCode == 34 && event["char"]) return false; - var base = keyNames[event.keyCode], name = base; - if (name == null || event.altGraphKey) return false; - if (event.altKey && base != "Alt") name = "Alt-" + name; - if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") name = "Ctrl-" + name; - if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") name = "Cmd-" + name; - if (!noShift && event.shiftKey && base != "Shift") name = "Shift-" + name; - return name; - }; - - function getKeyMap(val) { - return typeof val == "string" ? keyMap[val] : val; - } - - // FROMTEXTAREA - - CodeMirror.fromTextArea = function(textarea, options) { - if (!options) options = {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabindex) - options.tabindex = textarea.tabindex; - if (!options.placeholder && textarea.placeholder) - options.placeholder = textarea.placeholder; - // Set autofocus to true if this textarea is focused, or if it has - // autofocus and no other element is focused. - if (options.autofocus == null) { - var hasFocus = activeElt(); - options.autofocus = hasFocus == textarea || - textarea.getAttribute("autofocus") != null && hasFocus == document.body; - } - - function save() {textarea.value = cm.getValue();} - if (textarea.form) { - on(textarea.form, "submit", save); - // Deplorable hack to make the submit method do the right thing. - if (!options.leaveSubmitMethodAlone) { - var form = textarea.form, realSubmit = form.submit; - try { - var wrappedSubmit = form.submit = function() { - save(); - form.submit = realSubmit; - form.submit(); - form.submit = wrappedSubmit; - }; - } catch(e) {} - } - } - - textarea.style.display = "none"; - var cm = CodeMirror(function(node) { - textarea.parentNode.insertBefore(node, textarea.nextSibling); - }, options); - cm.save = save; - cm.getTextArea = function() { return textarea; }; - cm.toTextArea = function() { - cm.toTextArea = isNaN; // Prevent this from being ran twice - save(); - textarea.parentNode.removeChild(cm.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - off(textarea.form, "submit", save); - if (typeof textarea.form.submit == "function") - textarea.form.submit = realSubmit; - } - }; - return cm; - }; - - // STRING STREAM - - // Fed to the mode parsers, provides helper functions to make - // parsers more succinct. - - var StringStream = CodeMirror.StringStream = function(string, tabSize) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; - }; - - StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == this.lineStart;}, - peek: function() {return this.string.charAt(this.pos) || undefined;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); - this.lastColumnPos = this.start; - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }, - indentation: function() { - return countColumn(this.string, null, this.tabSize) - - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); - }, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);}, - hideFirstChars: function(n, inner) { - this.lineStart += n; - try { return inner(); } - finally { this.lineStart -= n; } - } - }; - - // TEXTMARKERS - - // Created with markText and setBookmark methods. A TextMarker is a - // handle that can be used to clear or find a marked position in the - // document. Line objects hold arrays (markedSpans) containing - // {from, to, marker} object pointing to such marker objects, and - // indicating that such a marker is present on that line. Multiple - // lines may point to the same marker when it spans across lines. - // The spans will have null for their from/to properties when the - // marker continues beyond the start/end of the line. Markers have - // links back to the lines they currently touch. - - var TextMarker = CodeMirror.TextMarker = function(doc, type) { - this.lines = []; - this.type = type; - this.doc = doc; - }; - eventMixin(TextMarker); - - // Clear the marker. - TextMarker.prototype.clear = function() { - if (this.explicitlyCleared) return; - var cm = this.doc.cm, withOp = cm && !cm.curOp; - if (withOp) startOperation(cm); - if (hasHandler(this, "clear")) { - var found = this.find(); - if (found) signalLater(this, "clear", found.from, found.to); - } - var min = null, max = null; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (cm && !this.collapsed) regLineChange(cm, lineNo(line), "text"); - else if (cm) { - if (span.to != null) max = lineNo(line); - if (span.from != null) min = lineNo(line); - } - line.markedSpans = removeMarkedSpan(line.markedSpans, span); - if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) - updateLineHeight(line, textHeight(cm.display)); - } - if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) { - var visual = visualLine(this.lines[i]), len = lineLength(visual); - if (len > cm.display.maxLineLength) { - cm.display.maxLine = visual; - cm.display.maxLineLength = len; - cm.display.maxLineChanged = true; - } - } - - if (min != null && cm && this.collapsed) regChange(cm, min, max + 1); - this.lines.length = 0; - this.explicitlyCleared = true; - if (this.atomic && this.doc.cantEdit) { - this.doc.cantEdit = false; - if (cm) reCheckSelection(cm.doc); - } - if (cm) signalLater(cm, "markerCleared", cm, this); - if (withOp) endOperation(cm); - if (this.parent) this.parent.clear(); - }; - - // Find the position of the marker in the document. Returns a {from, - // to} object by default. Side can be passed to get a specific side - // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the - // Pos objects returned contain a line object, rather than a line - // number (used to prevent looking up the same line twice). - TextMarker.prototype.find = function(side, lineObj) { - if (side == null && this.type == "bookmark") side = 1; - var from, to; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (span.from != null) { - from = Pos(lineObj ? line : lineNo(line), span.from); - if (side == -1) return from; - } - if (span.to != null) { - to = Pos(lineObj ? line : lineNo(line), span.to); - if (side == 1) return to; - } - } - return from && {from: from, to: to}; - }; - - // Signals that the marker's widget changed, and surrounding layout - // should be recomputed. - TextMarker.prototype.changed = function() { - var pos = this.find(-1, true), widget = this, cm = this.doc.cm; - if (!pos || !cm) return; - runInOp(cm, function() { - var line = pos.line, lineN = lineNo(pos.line); - var view = findViewForLine(cm, lineN); - if (view) { - clearLineMeasurementCacheFor(view); - cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; - } - cm.curOp.updateMaxLine = true; - if (!lineIsHidden(widget.doc, line) && widget.height != null) { - var oldHeight = widget.height; - widget.height = null; - var dHeight = widgetHeight(widget) - oldHeight; - if (dHeight) - updateLineHeight(line, line.height + dHeight); - } - }); - }; - - TextMarker.prototype.attachLine = function(line) { - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) - (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); - } - this.lines.push(line); - }; - TextMarker.prototype.detachLine = function(line) { - this.lines.splice(indexOf(this.lines, line), 1); - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); - } - }; - - // Collapsed markers have unique ids, in order to be able to order - // them, which is needed for uniquely determining an outer marker - // when they overlap (they may nest, but not partially overlap). - var nextMarkerId = 0; - - // Create a marker, wire it up to the right lines, and - function markText(doc, from, to, options, type) { - // Shared markers (across linked documents) are handled separately - // (markTextShared will call out to this again, once per - // document). - if (options && options.shared) return markTextShared(doc, from, to, options, type); - // Ensure we are in an operation. - if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); - - var marker = new TextMarker(doc, type), diff = cmp(from, to); - if (options) copyObj(options, marker, false); - // Don't connect empty markers unless clearWhenEmpty is false - if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) - return marker; - if (marker.replacedWith) { - // Showing up as a widget implies collapsed (widget replaces text) - marker.collapsed = true; - marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget"); - if (!options.handleMouseEvents) marker.widgetNode.setAttribute("cm-ignore-events", "true"); - if (options.insertLeft) marker.widgetNode.insertLeft = true; - } - if (marker.collapsed) { - if (conflictingCollapsedRange(doc, from.line, from, to, marker) || - from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) - throw new Error("Inserting collapsed marker partially overlapping an existing one"); - sawCollapsedSpans = true; - } - - if (marker.addToHistory) - addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); - - var curLine = from.line, cm = doc.cm, updateMaxLine; - doc.iter(curLine, to.line + 1, function(line) { - if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) - updateMaxLine = true; - if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0); - addMarkedSpan(line, new MarkedSpan(marker, - curLine == from.line ? from.ch : null, - curLine == to.line ? to.ch : null)); - ++curLine; - }); - // lineIsHidden depends on the presence of the spans, so needs a second pass - if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) { - if (lineIsHidden(doc, line)) updateLineHeight(line, 0); - }); - - if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); }); - - if (marker.readOnly) { - sawReadOnlySpans = true; - if (doc.history.done.length || doc.history.undone.length) - doc.clearHistory(); - } - if (marker.collapsed) { - marker.id = ++nextMarkerId; - marker.atomic = true; - } - if (cm) { - // Sync editor state - if (updateMaxLine) cm.curOp.updateMaxLine = true; - if (marker.collapsed) - regChange(cm, from.line, to.line + 1); - else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) - for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text"); - if (marker.atomic) reCheckSelection(cm.doc); - signalLater(cm, "markerAdded", cm, marker); - } - return marker; - } - - // SHARED TEXTMARKERS - - // A shared marker spans multiple linked documents. It is - // implemented as a meta-marker-object controlling multiple normal - // markers. - var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) { - this.markers = markers; - this.primary = primary; - for (var i = 0; i < markers.length; ++i) - markers[i].parent = this; - }; - eventMixin(SharedTextMarker); - - SharedTextMarker.prototype.clear = function() { - if (this.explicitlyCleared) return; - this.explicitlyCleared = true; - for (var i = 0; i < this.markers.length; ++i) - this.markers[i].clear(); - signalLater(this, "clear"); - }; - SharedTextMarker.prototype.find = function(side, lineObj) { - return this.primary.find(side, lineObj); - }; - - function markTextShared(doc, from, to, options, type) { - options = copyObj(options); - options.shared = false; - var markers = [markText(doc, from, to, options, type)], primary = markers[0]; - var widget = options.widgetNode; - linkedDocs(doc, function(doc) { - if (widget) options.widgetNode = widget.cloneNode(true); - markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); - for (var i = 0; i < doc.linked.length; ++i) - if (doc.linked[i].isParent) return; - primary = lst(markers); - }); - return new SharedTextMarker(markers, primary); - } - - function findSharedMarkers(doc) { - return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), - function(m) { return m.parent; }); - } - - function copySharedMarkers(doc, markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], pos = marker.find(); - var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); - if (cmp(mFrom, mTo)) { - var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); - marker.markers.push(subMark); - subMark.parent = marker; - } - } - } - - function detachSharedMarkers(markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], linked = [marker.primary.doc];; - linkedDocs(marker.primary.doc, function(d) { linked.push(d); }); - for (var j = 0; j < marker.markers.length; j++) { - var subMarker = marker.markers[j]; - if (indexOf(linked, subMarker.doc) == -1) { - subMarker.parent = null; - marker.markers.splice(j--, 1); - } - } - } - } - - // TEXTMARKER SPANS - - function MarkedSpan(marker, from, to) { - this.marker = marker; - this.from = from; this.to = to; - } - - // Search an array of spans for a span matching the given marker. - function getMarkedSpanFor(spans, marker) { - if (spans) for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.marker == marker) return span; - } - } - // Remove a span from an array, returning undefined if no spans are - // left (we don't store arrays for lines without spans). - function removeMarkedSpan(spans, span) { - for (var r, i = 0; i < spans.length; ++i) - if (spans[i] != span) (r || (r = [])).push(spans[i]); - return r; - } - // Add a span to a line. - function addMarkedSpan(line, span) { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; - span.marker.attachLine(line); - } - - // Used for the algorithm that adjusts markers for a change in the - // document. These functions cut an array of spans at a given - // character position, returning an array of remaining chunks (or - // undefined if nothing remains). - function markedSpansBefore(old, startCh, isInsert) { - if (old) for (var i = 0, nw; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); - if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); - (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); - } - } - return nw; - } - function markedSpansAfter(old, endCh, isInsert) { - if (old) for (var i = 0, nw; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); - if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); - (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, - span.to == null ? null : span.to - endCh)); - } - } - return nw; - } - - // Given a change object, compute the new set of marker spans that - // cover the line in which the change took place. Removes spans - // entirely within the change, reconnects spans belonging to the - // same marker that appear on both sides of the change, and cuts off - // spans partially within the change. Returns an array of span - // arrays with one element for each line in (after) the change. - function stretchSpansOverChange(doc, change) { - if (change.full) return null; - var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; - var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; - if (!oldFirst && !oldLast) return null; - - var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; - // Get the spans that 'stick out' on both sides - var first = markedSpansBefore(oldFirst, startCh, isInsert); - var last = markedSpansAfter(oldLast, endCh, isInsert); - - // Next, merge those two ends - var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); - if (first) { - // Fix up .to properties of first - for (var i = 0; i < first.length; ++i) { - var span = first[i]; - if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker); - if (!found) span.to = startCh; - else if (sameLine) span.to = found.to == null ? null : found.to + offset; - } - } - } - if (last) { - // Fix up .from in last (or move them into first in case of sameLine) - for (var i = 0; i < last.length; ++i) { - var span = last[i]; - if (span.to != null) span.to += offset; - if (span.from == null) { - var found = getMarkedSpanFor(first, span.marker); - if (!found) { - span.from = offset; - if (sameLine) (first || (first = [])).push(span); - } - } else { - span.from += offset; - if (sameLine) (first || (first = [])).push(span); - } - } - } - // Make sure we didn't create any zero-length spans - if (first) first = clearEmptySpans(first); - if (last && last != first) last = clearEmptySpans(last); - - var newMarkers = [first]; - if (!sameLine) { - // Fill gap with whole-line-spans - var gap = change.text.length - 2, gapMarkers; - if (gap > 0 && first) - for (var i = 0; i < first.length; ++i) - if (first[i].to == null) - (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null)); - for (var i = 0; i < gap; ++i) - newMarkers.push(gapMarkers); - newMarkers.push(last); - } - return newMarkers; - } - - // Remove spans that are empty and don't have a clearWhenEmpty - // option of false. - function clearEmptySpans(spans) { - for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) - spans.splice(i--, 1); - } - if (!spans.length) return null; - return spans; - } - - // Used for un/re-doing changes from the history. Combines the - // result of computing the existing spans with the set of spans that - // existed in the history (so that deleting around a span and then - // undoing brings back the span). - function mergeOldSpans(doc, change) { - var old = getOldSpans(doc, change); - var stretched = stretchSpansOverChange(doc, change); - if (!old) return stretched; - if (!stretched) return old; - - for (var i = 0; i < old.length; ++i) { - var oldCur = old[i], stretchCur = stretched[i]; - if (oldCur && stretchCur) { - spans: for (var j = 0; j < stretchCur.length; ++j) { - var span = stretchCur[j]; - for (var k = 0; k < oldCur.length; ++k) - if (oldCur[k].marker == span.marker) continue spans; - oldCur.push(span); - } - } else if (stretchCur) { - old[i] = stretchCur; - } - } - return old; - } - - // Used to 'clip' out readOnly ranges when making a change. - function removeReadOnlyRanges(doc, from, to) { - var markers = null; - doc.iter(from.line, to.line + 1, function(line) { - if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { - var mark = line.markedSpans[i].marker; - if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) - (markers || (markers = [])).push(mark); - } - }); - if (!markers) return null; - var parts = [{from: from, to: to}]; - for (var i = 0; i < markers.length; ++i) { - var mk = markers[i], m = mk.find(0); - for (var j = 0; j < parts.length; ++j) { - var p = parts[j]; - if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue; - var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); - if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) - newParts.push({from: p.from, to: m.from}); - if (dto > 0 || !mk.inclusiveRight && !dto) - newParts.push({from: m.to, to: p.to}); - parts.splice.apply(parts, newParts); - j += newParts.length - 1; - } - } - return parts; - } - - // Connect or disconnect spans from a line. - function detachMarkedSpans(line) { - var spans = line.markedSpans; - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.detachLine(line); - line.markedSpans = null; - } - function attachMarkedSpans(line, spans) { - if (!spans) return; - for (var i = 0; i < spans.length; ++i) - spans[i].marker.attachLine(line); - line.markedSpans = spans; - } - - // Helpers used when computing which overlapping collapsed span - // counts as the larger one. - function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; } - function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; } - - // Returns a number indicating which of two overlapping collapsed - // spans is larger (and thus includes the other). Falls back to - // comparing ids when the spans cover exactly the same range. - function compareCollapsedMarkers(a, b) { - var lenDiff = a.lines.length - b.lines.length; - if (lenDiff != 0) return lenDiff; - var aPos = a.find(), bPos = b.find(); - var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); - if (fromCmp) return -fromCmp; - var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); - if (toCmp) return toCmp; - return b.id - a.id; - } - - // Find out whether a line ends or starts in a collapsed span. If - // so, return the marker for that span. - function collapsedSpanAtSide(line, start) { - var sps = sawCollapsedSpans && line.markedSpans, found; - if (sps) for (var sp, i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && - (!found || compareCollapsedMarkers(found, sp.marker) < 0)) - found = sp.marker; - } - return found; - } - function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); } - function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); } - - // Test whether there exists a collapsed span that partially - // overlaps (covers the start or end, but not both) of a new span. - // Such overlap is not allowed. - function conflictingCollapsedRange(doc, lineNo, from, to, marker) { - var line = getLine(doc, lineNo); - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) for (var i = 0; i < sps.length; ++i) { - var sp = sps[i]; - if (!sp.marker.collapsed) continue; - var found = sp.marker.find(0); - var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); - var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); - if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; - if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) || - fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight))) - return true; - } - } - - // A visual line is a line as drawn on the screen. Folding, for - // example, can cause multiple logical lines to appear on the same - // visual line. This finds the start of the visual line that the - // given line is part of (usually that is the line itself). - function visualLine(line) { - var merged; - while (merged = collapsedSpanAtStart(line)) - line = merged.find(-1, true).line; - return line; - } - - // Returns an array of logical lines that continue the visual line - // started by the argument, or undefined if there are no such lines. - function visualLineContinued(line) { - var merged, lines; - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - (lines || (lines = [])).push(line); - } - return lines; - } - - // Get the line number of the start of the visual line that the - // given line number is part of. - function visualLineNo(doc, lineN) { - var line = getLine(doc, lineN), vis = visualLine(line); - if (line == vis) return lineN; - return lineNo(vis); - } - // Get the line number of the start of the next visual line after - // the given line. - function visualLineEndNo(doc, lineN) { - if (lineN > doc.lastLine()) return lineN; - var line = getLine(doc, lineN), merged; - if (!lineIsHidden(doc, line)) return lineN; - while (merged = collapsedSpanAtEnd(line)) - line = merged.find(1, true).line; - return lineNo(line) + 1; - } - - // Compute whether a line is hidden. Lines count as hidden when they - // are part of a visual line that starts with another line, or when - // they are entirely covered by collapsed, non-widget span. - function lineIsHidden(doc, line) { - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) for (var sp, i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (!sp.marker.collapsed) continue; - if (sp.from == null) return true; - if (sp.marker.widgetNode) continue; - if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) - return true; - } - } - function lineIsHiddenInner(doc, line, span) { - if (span.to == null) { - var end = span.marker.find(1, true); - return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); - } - if (span.marker.inclusiveRight && span.to == line.text.length) - return true; - for (var sp, i = 0; i < line.markedSpans.length; ++i) { - sp = line.markedSpans[i]; - if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && - (sp.to == null || sp.to != span.from) && - (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && - lineIsHiddenInner(doc, line, sp)) return true; - } - } - - // LINE WIDGETS - - // Line widgets are block elements displayed above or below a line. - - var LineWidget = CodeMirror.LineWidget = function(cm, node, options) { - if (options) for (var opt in options) if (options.hasOwnProperty(opt)) - this[opt] = options[opt]; - this.cm = cm; - this.node = node; - }; - eventMixin(LineWidget); - - function adjustScrollWhenAboveVisible(cm, line, diff) { - if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) - addToScrollPos(cm, null, diff); - } - - LineWidget.prototype.clear = function() { - var cm = this.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); - if (no == null || !ws) return; - for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); - if (!ws.length) line.widgets = null; - var height = widgetHeight(this); - runInOp(cm, function() { - adjustScrollWhenAboveVisible(cm, line, -height); - regLineChange(cm, no, "widget"); - updateLineHeight(line, Math.max(0, line.height - height)); - }); - }; - LineWidget.prototype.changed = function() { - var oldH = this.height, cm = this.cm, line = this.line; - this.height = null; - var diff = widgetHeight(this) - oldH; - if (!diff) return; - runInOp(cm, function() { - cm.curOp.forceUpdate = true; - adjustScrollWhenAboveVisible(cm, line, diff); - updateLineHeight(line, line.height + diff); - }); - }; - - function widgetHeight(widget) { - if (widget.height != null) return widget.height; - if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;"; - if (widget.coverGutter) - parentStyle += "margin-left: -" + widget.cm.display.gutters.offsetWidth + "px;"; - if (widget.noHScroll) - parentStyle += "width: " + widget.cm.display.wrapper.clientWidth + "px;"; - removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, parentStyle)); - } - return widget.height = widget.node.offsetHeight; - } - - function addLineWidget(cm, handle, node, options) { - var widget = new LineWidget(cm, node, options); - if (widget.noHScroll) cm.display.alignWidgets = true; - changeLine(cm.doc, handle, "widget", function(line) { - var widgets = line.widgets || (line.widgets = []); - if (widget.insertAt == null) widgets.push(widget); - else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); - widget.line = line; - if (!lineIsHidden(cm.doc, line)) { - var aboveVisible = heightAtLine(line) < cm.doc.scrollTop; - updateLineHeight(line, line.height + widgetHeight(widget)); - if (aboveVisible) addToScrollPos(cm, null, widget.height); - cm.curOp.forceUpdate = true; - } - return true; - }); - return widget; - } - - // LINE DATA STRUCTURE - - // Line objects. These hold state related to a line, including - // highlighting info (the styles array). - var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) { - this.text = text; - attachMarkedSpans(this, markedSpans); - this.height = estimateHeight ? estimateHeight(this) : 1; - }; - eventMixin(Line); - Line.prototype.lineNo = function() { return lineNo(this); }; - - // Change the content (text, markers) of a line. Automatically - // invalidates cached information and tries to re-estimate the - // line's height. - function updateLine(line, text, markedSpans, estimateHeight) { - line.text = text; - if (line.stateAfter) line.stateAfter = null; - if (line.styles) line.styles = null; - if (line.order != null) line.order = null; - detachMarkedSpans(line); - attachMarkedSpans(line, markedSpans); - var estHeight = estimateHeight ? estimateHeight(line) : 1; - if (estHeight != line.height) updateLineHeight(line, estHeight); - } - - // Detach a line from the document tree and its markers. - function cleanUpLine(line) { - line.parent = null; - detachMarkedSpans(line); - } - - function extractLineClasses(type, output) { - if (type) for (;;) { - var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); - if (!lineClass) break; - type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); - var prop = lineClass[1] ? "bgClass" : "textClass"; - if (output[prop] == null) - output[prop] = lineClass[2]; - else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) - output[prop] += " " + lineClass[2]; - } - return type; - } - - function callBlankLine(mode, state) { - if (mode.blankLine) return mode.blankLine(state); - if (!mode.innerMode) return; - var inner = CodeMirror.innerMode(mode, state); - if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); - } - - function readToken(mode, stream, state, inner) { - for (var i = 0; i < 10; i++) { - if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode; - var style = mode.token(stream, state); - if (stream.pos > stream.start) return style; - } - throw new Error("Mode " + mode.name + " failed to advance stream."); - } - - // Utility for getTokenAt and getLineTokens - function takeToken(cm, pos, precise, asArray) { - function getObj(copy) { - return {start: stream.start, end: stream.pos, - string: stream.current(), - type: style || null, - state: copy ? copyState(doc.mode, state) : state}; - } - - var doc = cm.doc, mode = doc.mode, style; - pos = clipPos(doc, pos); - var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise); - var stream = new StringStream(line.text, cm.options.tabSize), tokens; - if (asArray) tokens = []; - while ((asArray || stream.pos < pos.ch) && !stream.eol()) { - stream.start = stream.pos; - style = readToken(mode, stream, state); - if (asArray) tokens.push(getObj(true)); - } - return asArray ? tokens : getObj(); - } - - // Run the given mode's parser over a line, calling f for each token. - function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { - var flattenSpans = mode.flattenSpans; - if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; - var curStart = 0, curStyle = null; - var stream = new StringStream(text, cm.options.tabSize), style; - var inner = cm.options.addModeClass && [null]; - if (text == "") extractLineClasses(callBlankLine(mode, state), lineClasses); - while (!stream.eol()) { - if (stream.pos > cm.options.maxHighlightLength) { - flattenSpans = false; - if (forceToEnd) processLine(cm, text, state, stream.pos); - stream.pos = text.length; - style = null; - } else { - style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses); - } - if (inner) { - var mName = inner[0].name; - if (mName) style = "m-" + (style ? mName + " " + style : mName); - } - if (!flattenSpans || curStyle != style) { - while (curStart < stream.start) { - curStart = Math.min(stream.start, curStart + 50000); - f(curStart, curStyle); - } - curStyle = style; - } - stream.start = stream.pos; - } - while (curStart < stream.pos) { - // Webkit seems to refuse to render text nodes longer than 57444 characters - var pos = Math.min(stream.pos, curStart + 50000); - f(pos, curStyle); - curStart = pos; - } - } - - // Compute a style array (an array starting with a mode generation - // -- for invalidation -- followed by pairs of end positions and - // style strings), which is used to highlight the tokens on the - // line. - function highlightLine(cm, line, state, forceToEnd) { - // A styles array always starts with a number identifying the - // mode/overlays that it is based on (for easy invalidation). - var st = [cm.state.modeGen], lineClasses = {}; - // Compute the base array of styles - runMode(cm, line.text, cm.doc.mode, state, function(end, style) { - st.push(end, style); - }, lineClasses, forceToEnd); - - // Run overlays, adjust style array. - for (var o = 0; o < cm.state.overlays.length; ++o) { - var overlay = cm.state.overlays[o], i = 1, at = 0; - runMode(cm, line.text, overlay.mode, true, function(end, style) { - var start = i; - // Ensure there's a token end at the current position, and that i points at it - while (at < end) { - var i_end = st[i]; - if (i_end > end) - st.splice(i, 1, end, st[i+1], i_end); - i += 2; - at = Math.min(end, i_end); - } - if (!style) return; - if (overlay.opaque) { - st.splice(start, i - start, end, "cm-overlay " + style); - i = start + 2; - } else { - for (; start < i; start += 2) { - var cur = st[start+1]; - st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style; - } - } - }, lineClasses); - } - - return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; - } - - function getLineStyles(cm, line, updateFrontier) { - if (!line.styles || line.styles[0] != cm.state.modeGen) { - var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); - line.styles = result.styles; - if (result.classes) line.styleClasses = result.classes; - else if (line.styleClasses) line.styleClasses = null; - if (updateFrontier === cm.doc.frontier) cm.doc.frontier++; - } - return line.styles; - } - - // Lightweight form of highlight -- proceed over this line and - // update state, but don't save a style array. Used for lines that - // aren't currently visible. - function processLine(cm, text, state, startAt) { - var mode = cm.doc.mode; - var stream = new StringStream(text, cm.options.tabSize); - stream.start = stream.pos = startAt || 0; - if (text == "") callBlankLine(mode, state); - while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) { - readToken(mode, stream, state); - stream.start = stream.pos; - } - } - - // Convert a style as returned by a mode (either null, or a string - // containing one or more styles) to a CSS style. This is cached, - // and also looks for line-wide styles. - var styleToClassCache = {}, styleToClassCacheWithMode = {}; - function interpretTokenStyle(style, options) { - if (!style || /^\s*$/.test(style)) return null; - var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; - return cache[style] || - (cache[style] = style.replace(/\S+/g, "cm-$&")); - } - - // Render the DOM representation of the text of a line. Also builds - // up a 'line map', which points at the DOM nodes that represent - // specific stretches of text, and is used by the measuring code. - // The returned object contains the DOM node, this map, and - // information about line-wide styles that were set by the mode. - function buildLineContent(cm, lineView) { - // The padding-right forces the element to have a 'border', which - // is needed on Webkit to be able to get line-level bounding - // rectangles for it (in measureChar). - var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); - var builder = {pre: elt("pre", [content]), content: content, col: 0, pos: 0, cm: cm}; - lineView.measure = {}; - - // Iterate over the logical lines that make up this visual line. - for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { - var line = i ? lineView.rest[i - 1] : lineView.line, order; - builder.pos = 0; - builder.addToken = buildToken; - // Optionally wire in some hacks into the token-rendering - // algorithm, to deal with browser quirks. - if ((ie || webkit) && cm.getOption("lineWrapping")) - builder.addToken = buildTokenSplitSpaces(builder.addToken); - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) - builder.addToken = buildTokenBadBidi(builder.addToken, order); - builder.map = []; - var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); - insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); - if (line.styleClasses) { - if (line.styleClasses.bgClass) - builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); - if (line.styleClasses.textClass) - builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); - } - - // Ensure at least a single node is present, for measuring. - if (builder.map.length == 0) - builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); - - // Store the map and a cache object for the current logical line - if (i == 0) { - lineView.measure.map = builder.map; - lineView.measure.cache = {}; - } else { - (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); - (lineView.measure.caches || (lineView.measure.caches = [])).push({}); - } - } - - // See issue #2901 - if (webkit && /\bcm-tab\b/.test(builder.content.lastChild.className)) - builder.content.className = "cm-tab-wrap-hack"; - - signal(cm, "renderLine", cm, lineView.line, builder.pre); - if (builder.pre.className) - builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); - - return builder; - } - - function defaultSpecialCharPlaceholder(ch) { - var token = elt("span", "\u2022", "cm-invalidchar"); - token.title = "\\u" + ch.charCodeAt(0).toString(16); - return token; - } - - // Build up the DOM representation for a single token, and add it to - // the line map. Takes care to render special characters separately. - function buildToken(builder, text, style, startStyle, endStyle, title, css) { - if (!text) return; - var special = builder.cm.options.specialChars, mustWrap = false; - if (!special.test(text)) { - builder.col += text.length; - var content = document.createTextNode(text); - builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie && ie_version < 9) mustWrap = true; - builder.pos += text.length; - } else { - var content = document.createDocumentFragment(), pos = 0; - while (true) { - special.lastIndex = pos; - var m = special.exec(text); - var skipped = m ? m.index - pos : text.length - pos; - if (skipped) { - var txt = document.createTextNode(text.slice(pos, pos + skipped)); - if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); - else content.appendChild(txt); - builder.map.push(builder.pos, builder.pos + skipped, txt); - builder.col += skipped; - builder.pos += skipped; - } - if (!m) break; - pos += skipped + 1; - if (m[0] == "\t") { - var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; - var txt = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); - builder.col += tabWidth; - } else { - var txt = builder.cm.options.specialCharPlaceholder(m[0]); - if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); - else content.appendChild(txt); - builder.col += 1; - } - builder.map.push(builder.pos, builder.pos + 1, txt); - builder.pos++; - } - } - if (style || startStyle || endStyle || mustWrap || css) { - var fullStyle = style || ""; - if (startStyle) fullStyle += startStyle; - if (endStyle) fullStyle += endStyle; - var token = elt("span", [content], fullStyle, css); - if (title) token.title = title; - return builder.content.appendChild(token); - } - builder.content.appendChild(content); - } - - function buildTokenSplitSpaces(inner) { - function split(old) { - var out = " "; - for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; - out += " "; - return out; - } - return function(builder, text, style, startStyle, endStyle, title) { - inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title); - }; - } - - // Work around nonsense dimensions being reported for stretches of - // right-to-left text. - function buildTokenBadBidi(inner, order) { - return function(builder, text, style, startStyle, endStyle, title) { - style = style ? style + " cm-force-border" : "cm-force-border"; - var start = builder.pos, end = start + text.length; - for (;;) { - // Find the part that overlaps with the start of this text - for (var i = 0; i < order.length; i++) { - var part = order[i]; - if (part.to > start && part.from <= start) break; - } - if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title); - inner(builder, text.slice(0, part.to - start), style, startStyle, null, title); - startStyle = null; - text = text.slice(part.to - start); - start = part.to; - } - }; - } - - function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.widgetNode; - if (widget) { - builder.map.push(builder.pos, builder.pos + size, widget); - builder.content.appendChild(widget); - } - builder.pos += size; - } - - // Outputs a number of spans to make up a line, taking highlighting - // and marked text into account. - function insertLineContent(line, builder, styles) { - var spans = line.markedSpans, allText = line.text, at = 0; - if (!spans) { - for (var i = 1; i < styles.length; i+=2) - builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); - return; - } - - var len = allText.length, pos = 0, i = 1, text = "", style, css; - var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; - for (;;) { - if (nextChange == pos) { // Update current marker set - spanStyle = spanEndStyle = spanStartStyle = title = css = ""; - collapsed = null; nextChange = Infinity; - var foundBookmarks = []; - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], m = sp.marker; - if (sp.from <= pos && (sp.to == null || sp.to > pos)) { - if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; } - if (m.className) spanStyle += " " + m.className; - if (m.css) css = m.css; - if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; - if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle; - if (m.title && !title) title = m.title; - if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) - collapsed = sp; - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from; - } - if (m.type == "bookmark" && sp.from == pos && m.widgetNode) foundBookmarks.push(m); - } - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, - collapsed.marker, collapsed.from == null); - if (collapsed.to == null) return; - } - if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) - buildCollapsedSpan(builder, 0, foundBookmarks[j]); - } - if (pos >= len) break; - - var upto = Math.min(len, nextChange); - while (true) { - if (text) { - var end = pos + text.length; - if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text; - builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, - spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); - } - if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} - pos = end; - spanStartStyle = ""; - } - text = allText.slice(at, at = styles[i++]); - style = interpretTokenStyle(styles[i++], builder.cm.options); - } - } - } - - // DOCUMENT DATA STRUCTURE - - // By default, updates that start and end at the beginning of a line - // are treated specially, in order to make the association of line - // widgets and marker elements with the text behave more intuitive. - function isWholeLineUpdate(doc, change) { - return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && - (!doc.cm || doc.cm.options.wholeLineUpdateBefore); - } - - // Perform a change on the document data structure. - function updateDoc(doc, change, markedSpans, estimateHeight) { - function spansFor(n) {return markedSpans ? markedSpans[n] : null;} - function update(line, text, spans) { - updateLine(line, text, spans, estimateHeight); - signalLater(line, "change", line, change); - } - function linesFor(start, end) { - for (var i = start, result = []; i < end; ++i) - result.push(new Line(text[i], spansFor(i), estimateHeight)); - return result; - } - - var from = change.from, to = change.to, text = change.text; - var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); - var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; - - // Adjust the line structure - if (change.full) { - doc.insert(0, linesFor(0, text.length)); - doc.remove(text.length, doc.size - text.length); - } else if (isWholeLineUpdate(doc, change)) { - // This is a whole-line replace. Treated specially to make - // sure line objects move the way they are supposed to. - var added = linesFor(0, text.length - 1); - update(lastLine, lastLine.text, lastSpans); - if (nlines) doc.remove(from.line, nlines); - if (added.length) doc.insert(from.line, added); - } else if (firstLine == lastLine) { - if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); - } else { - var added = linesFor(1, text.length - 1); - added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - doc.insert(from.line + 1, added); - } - } else if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); - doc.remove(from.line + 1, nlines); - } else { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); - var added = linesFor(1, text.length - 1); - if (nlines > 1) doc.remove(from.line + 1, nlines - 1); - doc.insert(from.line + 1, added); - } - - signalLater(doc, "change", doc, change); - } - - // The document is represented as a BTree consisting of leaves, with - // chunk of lines in them, and branches, with up to ten leaves or - // other branch nodes below them. The top node is always a branch - // node, and is the document object itself (meaning it has - // additional methods and properties). - // - // All nodes have parent links. The tree is used both to go from - // line numbers to line objects, and to go from objects to numbers. - // It also indexes by height, and is used to convert between height - // and line object, and to find the total height of the document. - // - // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html - - function LeafChunk(lines) { - this.lines = lines; - this.parent = null; - for (var i = 0, height = 0; i < lines.length; ++i) { - lines[i].parent = this; - height += lines[i].height; - } - this.height = height; - } - - LeafChunk.prototype = { - chunkSize: function() { return this.lines.length; }, - // Remove the n lines at offset 'at'. - removeInner: function(at, n) { - for (var i = at, e = at + n; i < e; ++i) { - var line = this.lines[i]; - this.height -= line.height; - cleanUpLine(line); - signalLater(line, "delete"); - } - this.lines.splice(at, n); - }, - // Helper used to collapse a small branch into a single leaf. - 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(at, lines, height) { - this.height += height; - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); - for (var i = 0; i < lines.length; ++i) lines[i].parent = this; - }, - // Used to iterate over a part of the tree. - iterN: function(at, n, op) { - for (var e = at + n; at < e; ++at) - if (op(this.lines[at])) return true; - } - }; - - function BranchChunk(children) { - this.children = children; - var size = 0, height = 0; - for (var i = 0; i < children.length; ++i) { - var ch = children[i]; - size += ch.chunkSize(); height += ch.height; - ch.parent = this; - } - this.size = size; - this.height = height; - this.parent = null; - } - - BranchChunk.prototype = { - chunkSize: function() { return this.size; }, - removeInner: function(at, n) { - this.size -= n; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var rm = Math.min(n, sz - at), oldHeight = child.height; - child.removeInner(at, rm); - this.height -= oldHeight - child.height; - if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } - if ((n -= rm) == 0) break; - at = 0; - } else at -= sz; - } - // If the result is smaller than 25 lines, ensure that it is a - // single leaf node. - if (this.size - n < 25 && - (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { - var lines = []; - this.collapse(lines); - this.children = [new LeafChunk(lines)]; - this.children[0].parent = this; - } - }, - collapse: function(lines) { - for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines); - }, - insertInner: function(at, lines, height) { - this.size += lines.length; - this.height += height; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at <= sz) { - child.insertInner(at, lines, height); - if (child.lines && child.lines.length > 50) { - while (child.lines.length > 50) { - var spilled = child.lines.splice(child.lines.length - 25, 25); - var newleaf = new LeafChunk(spilled); - child.height -= newleaf.height; - this.children.splice(i + 1, 0, newleaf); - newleaf.parent = this; - } - this.maybeSpill(); - } - break; - } - at -= sz; - } - }, - // When a node has grown, check whether it should be split. - maybeSpill: function() { - if (this.children.length <= 10) return; - var me = this; - do { - var spilled = me.children.splice(me.children.length - 5, 5); - var sibling = new BranchChunk(spilled); - if (!me.parent) { // Become the parent node - var copy = new BranchChunk(me.children); - copy.parent = me; - me.children = [copy, sibling]; - me = copy; - } else { - me.size -= sibling.size; - me.height -= sibling.height; - var myIndex = indexOf(me.parent.children, me); - me.parent.children.splice(myIndex + 1, 0, sibling); - } - sibling.parent = me.parent; - } while (me.children.length > 10); - me.parent.maybeSpill(); - }, - iterN: function(at, n, op) { - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var used = Math.min(n, sz - at); - if (child.iterN(at, used, op)) return true; - if ((n -= used) == 0) break; - at = 0; - } else at -= sz; - } - } - }; - - var nextDocId = 0; - var Doc = CodeMirror.Doc = function(text, mode, firstLine) { - if (!(this instanceof Doc)) return new Doc(text, mode, firstLine); - if (firstLine == null) firstLine = 0; - - BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); - this.first = firstLine; - this.scrollTop = this.scrollLeft = 0; - this.cantEdit = false; - this.cleanGeneration = 1; - this.frontier = firstLine; - var start = Pos(firstLine, 0); - this.sel = simpleSelection(start); - this.history = new History(null); - this.id = ++nextDocId; - this.modeOption = mode; - - if (typeof text == "string") text = splitLines(text); - updateDoc(this, {from: start, to: start, text: text}); - setSelection(this, simpleSelection(start), sel_dontScroll); - }; - - Doc.prototype = createObj(BranchChunk.prototype, { - constructor: Doc, - // Iterate over the document. Supports two forms -- with only one - // argument, it calls that for each line in the document. With - // three, it iterates over the range given by the first two (with - // the second being non-inclusive). - iter: function(from, to, op) { - if (op) this.iterN(from - this.first, to - from, op); - else this.iterN(this.first, this.first + this.size, from); - }, - - // Non-public interface for adding and removing lines. - insert: function(at, lines) { - var height = 0; - for (var i = 0; i < lines.length; ++i) height += lines[i].height; - this.insertInner(at - this.first, lines, height); - }, - remove: function(at, n) { this.removeInner(at - this.first, n); }, - - // From here, the methods are part of the public interface. Most - // are also available from CodeMirror (editor) instances. - - getValue: function(lineSep) { - var lines = getLines(this, this.first, this.first + this.size); - if (lineSep === false) return lines; - return lines.join(lineSep || "\n"); - }, - setValue: docMethodOp(function(code) { - var top = Pos(this.first, 0), last = this.first + this.size - 1; - makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), - text: splitLines(code), origin: "setValue", full: true}, true); - setSelection(this, simpleSelection(top)); - }), - replaceRange: function(code, from, to, origin) { - from = clipPos(this, from); - to = to ? clipPos(this, to) : from; - replaceRange(this, code, from, to, origin); - }, - getRange: function(from, to, lineSep) { - var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); - if (lineSep === false) return lines; - return lines.join(lineSep || "\n"); - }, - - getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, - - getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);}, - getLineNumber: function(line) {return lineNo(line);}, - - getLineHandleVisualStart: function(line) { - if (typeof line == "number") line = getLine(this, line); - return visualLine(line); - }, - - lineCount: function() {return this.size;}, - firstLine: function() {return this.first;}, - lastLine: function() {return this.first + this.size - 1;}, - - clipPos: function(pos) {return clipPos(this, pos);}, - - getCursor: function(start) { - var range = this.sel.primary(), pos; - if (start == null || start == "head") pos = range.head; - else if (start == "anchor") pos = range.anchor; - else if (start == "end" || start == "to" || start === false) pos = range.to(); - else pos = range.from(); - return pos; - }, - listSelections: function() { return this.sel.ranges; }, - somethingSelected: function() {return this.sel.somethingSelected();}, - - setCursor: docMethodOp(function(line, ch, options) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); - }), - setSelection: docMethodOp(function(anchor, head, options) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); - }), - extendSelection: docMethodOp(function(head, other, options) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); - }), - extendSelections: docMethodOp(function(heads, options) { - extendSelections(this, clipPosArray(this, heads, options)); - }), - extendSelectionsBy: docMethodOp(function(f, options) { - extendSelections(this, map(this.sel.ranges, f), options); - }), - setSelections: docMethodOp(function(ranges, primary, options) { - if (!ranges.length) return; - for (var i = 0, out = []; i < ranges.length; i++) - out[i] = new Range(clipPos(this, ranges[i].anchor), - clipPos(this, ranges[i].head)); - if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex); - setSelection(this, normalizeSelection(out, primary), options); - }), - addSelection: docMethodOp(function(anchor, head, options) { - var ranges = this.sel.ranges.slice(0); - ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); - setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); - }), - - getSelection: function(lineSep) { - var ranges = this.sel.ranges, lines; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - lines = lines ? lines.concat(sel) : sel; - } - if (lineSep === false) return lines; - else return lines.join(lineSep || "\n"); - }, - getSelections: function(lineSep) { - var parts = [], ranges = this.sel.ranges; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - if (lineSep !== false) sel = sel.join(lineSep || "\n"); - parts[i] = sel; - } - return parts; - }, - replaceSelection: function(code, collapse, origin) { - var dup = []; - for (var i = 0; i < this.sel.ranges.length; i++) - dup[i] = code; - this.replaceSelections(dup, collapse, origin || "+input"); - }, - replaceSelections: docMethodOp(function(code, collapse, origin) { - var changes = [], sel = this.sel; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - changes[i] = {from: range.from(), to: range.to(), text: splitLines(code[i]), origin: origin}; - } - var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); - for (var i = changes.length - 1; i >= 0; i--) - makeChange(this, changes[i]); - if (newSel) setSelectionReplaceHistory(this, newSel); - else if (this.cm) ensureCursorVisible(this.cm); - }), - undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), - redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), - undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), - redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), - - setExtending: function(val) {this.extend = val;}, - getExtending: function() {return this.extend;}, - - historySize: function() { - var hist = this.history, done = 0, undone = 0; - for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done; - for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone; - return {undo: done, redo: undone}; - }, - clearHistory: function() {this.history = new History(this.history.maxGeneration);}, - - markClean: function() { - this.cleanGeneration = this.changeGeneration(true); - }, - changeGeneration: function(forceSplit) { - if (forceSplit) - this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; - return this.history.generation; - }, - isClean: function (gen) { - return this.history.generation == (gen || this.cleanGeneration); - }, - - getHistory: function() { - return {done: copyHistoryArray(this.history.done), - undone: copyHistoryArray(this.history.undone)}; - }, - setHistory: function(histData) { - var hist = this.history = new History(this.history.maxGeneration); - hist.done = copyHistoryArray(histData.done.slice(0), null, true); - hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); - }, - - addLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass"; - if (!line[prop]) line[prop] = cls; - else if (classTest(cls).test(line[prop])) return false; - else line[prop] += " " + cls; - return true; - }); - }), - removeLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass"; - var cur = line[prop]; - if (!cur) return false; - else if (cls == null) line[prop] = null; - else { - var found = cur.match(classTest(cls)); - if (!found) return false; - var end = found.index + found[0].length; - line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; - } - return true; - }); - }), - - markText: function(from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); - }, - setBookmark: function(pos, options) { - var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), - insertLeft: options && options.insertLeft, - clearWhenEmpty: false, shared: options && options.shared}; - pos = clipPos(this, pos); - return markText(this, pos, pos, realOpts, "bookmark"); - }, - findMarksAt: function(pos) { - pos = clipPos(this, pos); - var markers = [], spans = getLine(this, pos.line).markedSpans; - if (spans) for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if ((span.from == null || span.from <= pos.ch) && - (span.to == null || span.to >= pos.ch)) - markers.push(span.marker.parent || span.marker); - } - return markers; - }, - findMarks: function(from, to, filter) { - from = clipPos(this, from); to = clipPos(this, to); - var found = [], lineNo = from.line; - this.iter(from.line, to.line + 1, function(line) { - var spans = line.markedSpans; - if (spans) for (var i = 0; i < spans.length; i++) { - var span = spans[i]; - if (!(lineNo == from.line && from.ch > span.to || - span.from == null && lineNo != from.line|| - lineNo == to.line && span.from > to.ch) && - (!filter || filter(span.marker))) - found.push(span.marker.parent || span.marker); - } - ++lineNo; - }); - return found; - }, - getAllMarks: function() { - var markers = []; - this.iter(function(line) { - var sps = line.markedSpans; - if (sps) for (var i = 0; i < sps.length; ++i) - if (sps[i].from != null) markers.push(sps[i].marker); - }); - return markers; - }, - - posFromIndex: function(off) { - var ch, lineNo = this.first; - this.iter(function(line) { - var sz = line.text.length + 1; - if (sz > off) { ch = off; return true; } - off -= sz; - ++lineNo; - }); - return clipPos(this, Pos(lineNo, ch)); - }, - indexFromPos: function (coords) { - coords = clipPos(this, coords); - var index = coords.ch; - if (coords.line < this.first || coords.ch < 0) return 0; - this.iter(this.first, coords.line, function (line) { - index += line.text.length + 1; - }); - return index; - }, - - copy: function(copyHistory) { - var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first); - doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; - doc.sel = this.sel; - doc.extend = false; - if (copyHistory) { - doc.history.undoDepth = this.history.undoDepth; - doc.setHistory(this.getHistory()); - } - return doc; - }, - - linkedDoc: function(options) { - if (!options) options = {}; - var from = this.first, to = this.first + this.size; - if (options.from != null && options.from > from) from = options.from; - if (options.to != null && options.to < to) to = options.to; - var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from); - if (options.sharedHist) copy.history = this.history; - (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); - copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; - copySharedMarkers(copy, findSharedMarkers(this)); - return copy; - }, - unlinkDoc: function(other) { - if (other instanceof CodeMirror) other = other.doc; - if (this.linked) for (var i = 0; i < this.linked.length; ++i) { - var link = this.linked[i]; - if (link.doc != other) continue; - this.linked.splice(i, 1); - other.unlinkDoc(this); - detachSharedMarkers(findSharedMarkers(this)); - break; - } - // If the histories were shared, split them again - if (other.history == this.history) { - var splitIds = [other.id]; - linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true); - other.history = new History(null); - other.history.done = copyHistoryArray(this.history.done, splitIds); - other.history.undone = copyHistoryArray(this.history.undone, splitIds); - } - }, - iterLinkedDocs: function(f) {linkedDocs(this, f);}, - - getMode: function() {return this.mode;}, - getEditor: function() {return this.cm;} - }); - - // Public alias. - Doc.prototype.eachLine = Doc.prototype.iter; - - // Set up methods on CodeMirror's prototype to redirect to the editor's document. - var dontDelegate = "iter insert remove copy getEditor".split(" "); - for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) - CodeMirror.prototype[prop] = (function(method) { - return function() {return method.apply(this.doc, arguments);}; - })(Doc.prototype[prop]); - - eventMixin(Doc); - - // Call f for all linked documents. - function linkedDocs(doc, f, sharedHistOnly) { - function propagate(doc, skip, sharedHist) { - if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { - var rel = doc.linked[i]; - if (rel.doc == skip) continue; - var shared = sharedHist && rel.sharedHist; - if (sharedHistOnly && !shared) continue; - f(rel.doc, shared); - propagate(rel.doc, doc, shared); - } - } - propagate(doc, null, true); - } - - // Attach a document to an editor. - function attachDoc(cm, doc) { - if (doc.cm) throw new Error("This document is already in use."); - cm.doc = doc; - doc.cm = cm; - estimateLineHeights(cm); - loadMode(cm); - if (!cm.options.lineWrapping) findMaxLine(cm); - cm.options.mode = doc.modeOption; - regChange(cm); - } - - // LINE UTILITIES - - // Find the line object corresponding to the given line number. - function getLine(doc, n) { - n -= doc.first; - if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); - for (var chunk = doc; !chunk.lines;) { - for (var i = 0;; ++i) { - var child = chunk.children[i], sz = child.chunkSize(); - if (n < sz) { chunk = child; break; } - n -= sz; - } - } - return chunk.lines[n]; - } - - // Get the part of a document between two positions, as an array of - // strings. - function getBetween(doc, start, end) { - var out = [], n = start.line; - doc.iter(start.line, end.line + 1, function(line) { - var text = line.text; - if (n == end.line) text = text.slice(0, end.ch); - if (n == start.line) text = text.slice(start.ch); - out.push(text); - ++n; - }); - return out; - } - // Get the lines between from and to, as array of strings. - function getLines(doc, from, to) { - var out = []; - doc.iter(from, to, function(line) { out.push(line.text); }); - return out; - } - - // Update the height of a line, propagating the height change - // upwards to parent nodes. - function updateLineHeight(line, height) { - var diff = height - line.height; - if (diff) for (var n = line; n; n = n.parent) n.height += diff; - } - - // Given a line object, find its line number by walking up through - // its parent links. - function lineNo(line) { - if (line.parent == null) return null; - var cur = line.parent, no = indexOf(cur.lines, line); - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i = 0;; ++i) { - if (chunk.children[i] == cur) break; - no += chunk.children[i].chunkSize(); - } - } - return no + cur.first; - } - - // Find the line at the given vertical position, using the height - // information in the document tree. - function lineAtHeight(chunk, h) { - var n = chunk.first; - outer: do { - for (var i = 0; i < chunk.children.length; ++i) { - var child = chunk.children[i], ch = child.height; - if (h < ch) { chunk = child; continue outer; } - h -= ch; - n += child.chunkSize(); - } - return n; - } while (!chunk.lines); - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i], lh = line.height; - if (h < lh) break; - h -= lh; - } - return n + i; - } - - - // Find the height above the given line. - function heightAtLine(lineObj) { - lineObj = visualLine(lineObj); - - var h = 0, chunk = lineObj.parent; - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i]; - if (line == lineObj) break; - else h += line.height; - } - for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { - for (var i = 0; i < p.children.length; ++i) { - var cur = p.children[i]; - if (cur == chunk) break; - else h += cur.height; - } - } - return h; - } - - // Get the bidi ordering for the given line (and cache it). Returns - // false for lines that are fully left-to-right, and an array of - // BidiSpan objects otherwise. - function getOrder(line) { - var order = line.order; - if (order == null) order = line.order = bidiOrdering(line.text); - return order; - } - - // HISTORY - - function History(startGen) { - // Arrays of change events and selections. Doing something adds an - // event to done and clears undo. Undoing moves events from done - // to undone, redoing moves them in the other direction. - this.done = []; this.undone = []; - this.undoDepth = Infinity; - // Used to track when changes can be merged into a single undo - // event - this.lastModTime = this.lastSelTime = 0; - this.lastOp = this.lastSelOp = null; - this.lastOrigin = this.lastSelOrigin = null; - // Used by the isClean() method - this.generation = this.maxGeneration = startGen || 1; - } - - // Create a history change event from an updateDoc-style change - // object. - function historyChangeFromChange(doc, change) { - var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; - attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); - linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true); - return histChange; - } - - // Pop all selection events off the end of a history array. Stop at - // a change event. - function clearSelectionEvents(array) { - while (array.length) { - var last = lst(array); - if (last.ranges) array.pop(); - else break; - } - } - - // Find the top change event in the history. Pop off selection - // events that are in the way. - function lastChangeEvent(hist, force) { - if (force) { - clearSelectionEvents(hist.done); - return lst(hist.done); - } else if (hist.done.length && !lst(hist.done).ranges) { - return lst(hist.done); - } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { - hist.done.pop(); - return lst(hist.done); - } - } - - // Register a change in the history. Merges changes that are within - // a single operation, ore are close together with an origin that - // allows merging (starting with "+") into a single event. - function addChangeToHistory(doc, change, selAfter, opId) { - var hist = doc.history; - hist.undone.length = 0; - var time = +new Date, cur; - - if ((hist.lastOp == opId || - hist.lastOrigin == change.origin && change.origin && - ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || - change.origin.charAt(0) == "*")) && - (cur = lastChangeEvent(hist, hist.lastOp == opId))) { - // Merge this change into the last event - var last = lst(cur.changes); - if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { - // Optimized case for simple insertion -- don't want to add - // new changesets for every character typed - last.to = changeEnd(change); - } else { - // Add new sub-event - cur.changes.push(historyChangeFromChange(doc, change)); - } - } else { - // Can not be merged, start a new event. - var before = lst(hist.done); - if (!before || !before.ranges) - pushSelectionToHistory(doc.sel, hist.done); - cur = {changes: [historyChangeFromChange(doc, change)], - generation: hist.generation}; - hist.done.push(cur); - while (hist.done.length > hist.undoDepth) { - hist.done.shift(); - if (!hist.done[0].ranges) hist.done.shift(); - } - } - hist.done.push(selAfter); - hist.generation = ++hist.maxGeneration; - hist.lastModTime = hist.lastSelTime = time; - hist.lastOp = hist.lastSelOp = opId; - hist.lastOrigin = hist.lastSelOrigin = change.origin; - - if (!last) signal(doc, "historyAdded"); - } - - function selectionEventCanBeMerged(doc, origin, prev, sel) { - var ch = origin.charAt(0); - return ch == "*" || - ch == "+" && - prev.ranges.length == sel.ranges.length && - prev.somethingSelected() == sel.somethingSelected() && - new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); - } - - // Called whenever the selection changes, sets the new selection as - // the pending selection in the history, and pushes the old pending - // selection into the 'done' array when it was significantly - // different (in number of selected ranges, emptiness, or time). - function addSelectionToHistory(doc, sel, opId, options) { - var hist = doc.history, origin = options && options.origin; - - // A new event is started when the previous origin does not match - // the current, or the origins don't allow matching. Origins - // starting with * are always merged, those starting with + are - // merged when similar and close together in time. - if (opId == hist.lastSelOp || - (origin && hist.lastSelOrigin == origin && - (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || - selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) - hist.done[hist.done.length - 1] = sel; - else - pushSelectionToHistory(sel, hist.done); - - hist.lastSelTime = +new Date; - hist.lastSelOrigin = origin; - hist.lastSelOp = opId; - if (options && options.clearRedo !== false) - clearSelectionEvents(hist.undone); - } - - function pushSelectionToHistory(sel, dest) { - var top = lst(dest); - if (!(top && top.ranges && top.equals(sel))) - dest.push(sel); - } - - // Used to store marked span information in the history. - function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], n = 0; - doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { - if (line.markedSpans) - (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; - ++n; - }); - } - - // When un/re-doing restores text containing marked spans, those - // that have been explicitly cleared should not be restored. - function removeClearedSpans(spans) { - if (!spans) return null; - for (var i = 0, out; i < spans.length; ++i) { - if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } - else if (out) out.push(spans[i]); - } - return !out ? spans : out.length ? out : null; - } - - // Retrieve and filter the old marked spans stored in a change event. - function getOldSpans(doc, change) { - var found = change["spans_" + doc.id]; - if (!found) return null; - for (var i = 0, nw = []; i < change.text.length; ++i) - nw.push(removeClearedSpans(found[i])); - return nw; - } - - // Used both to provide a JSON-safe object in .getHistory, and, when - // detaching a document, to split the history in two - function copyHistoryArray(events, newGroup, instantiateSel) { - for (var i = 0, copy = []; i < events.length; ++i) { - var event = events[i]; - if (event.ranges) { - copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); - continue; - } - var changes = event.changes, newChanges = []; - copy.push({changes: newChanges}); - for (var j = 0; j < changes.length; ++j) { - var change = changes[j], m; - newChanges.push({from: change.from, to: change.to, text: change.text}); - if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) { - if (indexOf(newGroup, Number(m[1])) > -1) { - lst(newChanges)[prop] = change[prop]; - delete change[prop]; - } - } - } - } - return copy; - } - - // Rebasing/resetting history to deal with externally-sourced changes - - function rebaseHistSelSingle(pos, from, to, diff) { - if (to < pos.line) { - pos.line += diff; - } else if (from < pos.line) { - pos.line = from; - pos.ch = 0; - } - } - - // Tries to rebase an array of history events given a change in the - // document. If the change touches the same lines as the event, the - // event, and everything 'behind' it, is discarded. If the change is - // before the event, the event's positions are updated. Uses a - // copy-on-write scheme for the positions, to avoid having to - // reallocate them all on every rebase, but also avoid problems with - // shared position objects being unsafely updated. - function rebaseHistArray(array, from, to, diff) { - for (var i = 0; i < array.length; ++i) { - var sub = array[i], ok = true; - if (sub.ranges) { - if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } - for (var j = 0; j < sub.ranges.length; j++) { - rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); - rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); - } - continue; - } - for (var j = 0; j < sub.changes.length; ++j) { - var cur = sub.changes[j]; - if (to < cur.from.line) { - cur.from = Pos(cur.from.line + diff, cur.from.ch); - cur.to = Pos(cur.to.line + diff, cur.to.ch); - } else if (from <= cur.to.line) { - ok = false; - break; - } - } - if (!ok) { - array.splice(0, i + 1); - i = 0; - } - } - } - - function rebaseHist(hist, change) { - var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; - rebaseHistArray(hist.done, from, to, diff); - rebaseHistArray(hist.undone, from, to, diff); - } - - // EVENT UTILITIES - - // Due to the fact that we still support jurassic IE versions, some - // compatibility wrappers are needed. - - var e_preventDefault = CodeMirror.e_preventDefault = function(e) { - if (e.preventDefault) e.preventDefault(); - else e.returnValue = false; - }; - var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) { - if (e.stopPropagation) e.stopPropagation(); - else e.cancelBubble = true; - }; - function e_defaultPrevented(e) { - return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; - } - var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);}; - - function e_target(e) {return e.target || e.srcElement;} - function e_button(e) { - var b = e.which; - if (b == null) { - if (e.button & 1) b = 1; - else if (e.button & 2) b = 3; - else if (e.button & 4) b = 2; - } - if (mac && e.ctrlKey && b == 1) b = 3; - return b; - } - - // EVENT HANDLING - - // Lightweight event framework. on/off also work on DOM nodes, - // registering native DOM handlers. - - var on = CodeMirror.on = function(emitter, type, f) { - if (emitter.addEventListener) - emitter.addEventListener(type, f, false); - else if (emitter.attachEvent) - emitter.attachEvent("on" + type, f); - else { - var map = emitter._handlers || (emitter._handlers = {}); - var arr = map[type] || (map[type] = []); - arr.push(f); - } - }; - - var off = CodeMirror.off = function(emitter, type, f) { - if (emitter.removeEventListener) - emitter.removeEventListener(type, f, false); - else if (emitter.detachEvent) - emitter.detachEvent("on" + type, f); - else { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - for (var i = 0; i < arr.length; ++i) - if (arr[i] == f) { arr.splice(i, 1); break; } - } - }; - - var signal = CodeMirror.signal = function(emitter, type /*, values...*/) { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - var args = Array.prototype.slice.call(arguments, 2); - for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); - }; - - var orphanDelayedCallbacks = null; - - // Often, we want to signal events at a point where we are in the - // middle of some work, but don't want the handler to start calling - // other methods on the editor, which might be in an inconsistent - // state or simply not expect any other events to happen. - // signalLater looks whether there are any handlers, and schedules - // them to be executed when the last operation ends, or, if no - // operation is active, when a timeout fires. - function signalLater(emitter, type /*, values...*/) { - var arr = emitter._handlers && emitter._handlers[type]; - if (!arr) return; - var args = Array.prototype.slice.call(arguments, 2), list; - if (operationGroup) { - list = operationGroup.delayedCallbacks; - } else if (orphanDelayedCallbacks) { - list = orphanDelayedCallbacks; - } else { - list = orphanDelayedCallbacks = []; - setTimeout(fireOrphanDelayed, 0); - } - function bnd(f) {return function(){f.apply(null, args);};}; - for (var i = 0; i < arr.length; ++i) - list.push(bnd(arr[i])); - } - - function fireOrphanDelayed() { - var delayed = orphanDelayedCallbacks; - orphanDelayedCallbacks = null; - for (var i = 0; i < delayed.length; ++i) delayed[i](); - } - - // The DOM events that CodeMirror handles can be overridden by - // registering a (non-DOM) handler on the editor for the event name, - // and preventDefault-ing the event in that handler. - function signalDOMEvent(cm, e, override) { - if (typeof e == "string") - e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; - signal(cm, override || e.type, cm, e); - return e_defaultPrevented(e) || e.codemirrorIgnore; - } - - function signalCursorActivity(cm) { - var arr = cm._handlers && cm._handlers.cursorActivity; - if (!arr) return; - var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); - for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1) - set.push(arr[i]); - } - - function hasHandler(emitter, type) { - var arr = emitter._handlers && emitter._handlers[type]; - return arr && arr.length > 0; - } - - // Add on and off methods to a constructor's prototype, to make - // registering events on such objects more convenient. - function eventMixin(ctor) { - ctor.prototype.on = function(type, f) {on(this, type, f);}; - ctor.prototype.off = function(type, f) {off(this, type, f);}; - } - - // MISC UTILITIES - - // Number of pixels added to scroller and sizer to hide scrollbar - var scrollerGap = 30; - - // Returned or thrown by various protocols to signal 'I'm not - // handling this'. - var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; - - // Reused option objects for setSelection & friends - var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; - - function Delayed() {this.id = null;} - Delayed.prototype.set = function(ms, f) { - clearTimeout(this.id); - this.id = setTimeout(f, ms); - }; - - // Counts the column offset in a string, taking tabs into account. - // Used mostly to find indentation. - var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) end = string.length; - } - for (var i = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf("\t", i); - if (nextTab < 0 || nextTab >= end) - return n + (end - i); - n += nextTab - i; - n += tabSize - (n % tabSize); - i = nextTab + 1; - } - }; - - // The inverse of countColumn -- find the offset that corresponds to - // a particular column. - function findColumn(string, goal, tabSize) { - for (var pos = 0, col = 0;;) { - var nextTab = string.indexOf("\t", pos); - if (nextTab == -1) nextTab = string.length; - var skipped = nextTab - pos; - if (nextTab == string.length || col + skipped >= goal) - return pos + Math.min(skipped, goal - col); - col += nextTab - pos; - col += tabSize - (col % tabSize); - pos = nextTab + 1; - if (col >= goal) return pos; - } - } - - var spaceStrs = [""]; - function spaceStr(n) { - while (spaceStrs.length <= n) - spaceStrs.push(lst(spaceStrs) + " "); - return spaceStrs[n]; - } - - function lst(arr) { return arr[arr.length-1]; } - - var selectInput = function(node) { node.select(); }; - if (ios) // Mobile Safari apparently has a bug where select() is broken. - selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; - else if (ie) // Suppress mysterious IE10 errors - selectInput = function(node) { try { node.select(); } catch(_e) {} }; - - function indexOf(array, elt) { - for (var i = 0; i < array.length; ++i) - if (array[i] == elt) return i; - return -1; - } - function map(array, f) { - var out = []; - for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); - return out; - } - - function createObj(base, props) { - var inst; - if (Object.create) { - inst = Object.create(base); - } else { - var ctor = function() {}; - ctor.prototype = base; - inst = new ctor(); - } - if (props) copyObj(props, inst); - return inst; - }; - - function copyObj(obj, target, overwrite) { - if (!target) target = {}; - for (var prop in obj) - if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) - target[prop] = obj[prop]; - return target; - } - - function bind(f) { - var args = Array.prototype.slice.call(arguments, 1); - return function(){return f.apply(null, args);}; - } - - var nonASCIISingleCaseWordChar = /[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - var isWordCharBasic = CodeMirror.isWordChar = function(ch) { - return /\w/.test(ch) || ch > "\x80" && - (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); - }; - function isWordChar(ch, helper) { - if (!helper) return isWordCharBasic(ch); - if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true; - return helper.test(ch); - } - - function isEmpty(obj) { - for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; - return true; - } - - // Extending unicode characters. A series of a non-extending char + - // any number of extending chars is treated as a single unit as far - // as editing and measuring is concerned. This is not fully correct, - // since some scripts/fonts/browsers also treat other configurations - // of code points as a group. - var extendingChars = /[\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]/; - function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); } - - // DOM UTILITIES - - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) e.className = className; - if (style) e.style.cssText = style; - if (typeof content == "string") e.appendChild(document.createTextNode(content)); - else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); - return e; - } - - var range; - if (document.createRange) range = function(node, start, end) { - var r = document.createRange(); - r.setEnd(node, end); - r.setStart(node, start); - return r; - }; - else range = function(node, start, end) { - var r = document.body.createTextRange(); - try { r.moveToElementText(node.parentNode); } - catch(e) { return r; } - r.collapse(true); - r.moveEnd("character", end); - r.moveStart("character", start); - return r; - }; - - function removeChildren(e) { - for (var count = e.childNodes.length; count > 0; --count) - e.removeChild(e.firstChild); - return e; - } - - function removeChildrenAndAdd(parent, e) { - return removeChildren(parent).appendChild(e); - } - - function contains(parent, child) { - if (parent.contains) - return parent.contains(child); - while (child = child.parentNode) - if (child == parent) return true; - } - - function activeElt() { return document.activeElement; } - // Older versions of IE throws unspecified error when touching - // document.activeElement in some cases (during loading, in iframe) - if (ie && ie_version < 11) activeElt = function() { - try { return document.activeElement; } - catch(e) { return document.body; } - }; - - function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); } - var rmClass = CodeMirror.rmClass = function(node, cls) { - var current = node.className; - var match = classTest(cls).exec(current); - if (match) { - var after = current.slice(match.index + match[0].length); - node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); - } - }; - var addClass = CodeMirror.addClass = function(node, cls) { - var current = node.className; - if (!classTest(cls).test(current)) node.className += (current ? " " : "") + cls; - }; - function joinClasses(a, b) { - var as = a.split(" "); - for (var i = 0; i < as.length; i++) - if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i]; - return b; - } - - // WINDOW-WIDE EVENTS - - // These must be handled carefully, because naively registering a - // handler for each editor will cause the editors to never be - // garbage collected. - - function forEachCodeMirror(f) { - if (!document.body.getElementsByClassName) return; - var byClass = document.body.getElementsByClassName("CodeMirror"); - for (var i = 0; i < byClass.length; i++) { - var cm = byClass[i].CodeMirror; - if (cm) f(cm); - } - } - - var globalsRegistered = false; - function ensureGlobalHandlers() { - if (globalsRegistered) return; - registerGlobalHandlers(); - globalsRegistered = true; - } - function registerGlobalHandlers() { - // When the window resizes, we need to refresh active editors. - var resizeTimer; - on(window, "resize", function() { - if (resizeTimer == null) resizeTimer = setTimeout(function() { - resizeTimer = null; - forEachCodeMirror(onResize); - }, 100); - }); - // When the window loses focus, we want to show the editor as blurred - on(window, "blur", function() { - forEachCodeMirror(onBlur); - }); - } - - // FEATURE DETECTION - - // Detect drag-and-drop - var dragAndDrop = function() { - // There is *some* kind of drag-and-drop support in IE6-8, but I - // couldn't get it to work yet. - if (ie && ie_version < 9) return false; - var div = elt('div'); - return "draggable" in div || "dragDrop" in div; - }(); - - var zwspSupported; - function zeroWidthElement(measure) { - if (zwspSupported == null) { - var test = elt("span", "\u200b"); - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); - if (measure.firstChild.offsetHeight != 0) - zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); - } - if (zwspSupported) return elt("span", "\u200b"); - else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); - } - - // Feature-detect IE's crummy client rect reporting for bidi text - var badBidiRects; - function hasBadBidiRects(measure) { - if (badBidiRects != null) return badBidiRects; - var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); - var r0 = range(txt, 0, 1).getBoundingClientRect(); - if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780) - var r1 = range(txt, 1, 2).getBoundingClientRect(); - return badBidiRects = (r1.right - r0.right < 3); - } - - // See if "".split is the broken IE version, if so, provide an - // alternative way to split lines. - var splitLines = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { - var pos = 0, result = [], l = string.length; - while (pos <= l) { - var nl = string.indexOf("\n", pos); - if (nl == -1) nl = string.length; - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); - var rt = line.indexOf("\r"); - if (rt != -1) { - result.push(line.slice(0, rt)); - pos += rt + 1; - } else { - result.push(line); - pos = nl + 1; - } - } - return result; - } : function(string){return string.split(/\r\n?|\n/);}; - - var hasSelection = window.getSelection ? function(te) { - try { return te.selectionStart != te.selectionEnd; } - catch(e) { return false; } - } : function(te) { - try {var range = te.ownerDocument.selection.createRange();} - catch(e) {} - if (!range || range.parentElement() != te) return false; - return range.compareEndPoints("StartToEnd", range) != 0; - }; - - var hasCopyEvent = (function() { - var e = elt("div"); - if ("oncopy" in e) return true; - e.setAttribute("oncopy", "return;"); - return typeof e.oncopy == "function"; - })(); - - var badZoomedRects = null; - function hasBadZoomedRects(measure) { - if (badZoomedRects != null) return badZoomedRects; - var node = removeChildrenAndAdd(measure, elt("span", "x")); - var normal = node.getBoundingClientRect(); - var fromRange = range(node, 0, 1).getBoundingClientRect(); - return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; - } - - // KEY NAMES - - var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", - 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", - 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 107: "=", 109: "-", 127: "Delete", - 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", - 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", - 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"}; - CodeMirror.keyNames = keyNames; - (function() { - // Number keys - for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i); - // Alphabetic keys - for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); - // Function keys - for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; - })(); - - // BIDI HELPERS - - function iterateBidiSections(order, from, to, f) { - if (!order) return f(from, to, "ltr"); - var found = false; - for (var i = 0; i < order.length; ++i) { - var part = order[i]; - if (part.from < to && part.to > from || from == to && part.to == from) { - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); - found = true; - } - } - if (!found) f(from, to, "ltr"); - } - - function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } - function bidiRight(part) { return part.level % 2 ? part.from : part.to; } - - function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } - function lineRight(line) { - var order = getOrder(line); - if (!order) return line.text.length; - return bidiRight(lst(order)); - } - - function lineStart(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLine(line); - if (visual != line) lineN = lineNo(visual); - var order = getOrder(visual); - var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); - return Pos(lineN, ch); - } - function lineEnd(cm, lineN) { - var merged, line = getLine(cm.doc, lineN); - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line; - lineN = null; - } - var order = getOrder(line); - var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); - return Pos(lineN == null ? lineNo(line) : lineN, ch); - } - function lineStartSmart(cm, pos) { - var start = lineStart(cm, pos.line); - var line = getLine(cm.doc, start.line); - var order = getOrder(line); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(0, line.text.search(/\S/)); - var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; - return Pos(start.line, inWS ? 0 : firstNonWS); - } - return start; - } - - function compareBidiLevel(order, a, b) { - var linedir = order[0].level; - if (a == linedir) return true; - if (b == linedir) return false; - return a < b; - } - var bidiOther; - function getBidiPartAt(order, pos) { - bidiOther = null; - for (var i = 0, found; i < order.length; ++i) { - var cur = order[i]; - if (cur.from < pos && cur.to > pos) return i; - if ((cur.from == pos || cur.to == pos)) { - if (found == null) { - found = i; - } else if (compareBidiLevel(order, cur.level, order[found].level)) { - if (cur.from != cur.to) bidiOther = found; - return i; - } else { - if (cur.from != cur.to) bidiOther = i; - return found; - } - } - } - return found; - } - - function moveInLine(line, pos, dir, byUnit) { - if (!byUnit) return pos + dir; - do pos += dir; - while (pos > 0 && isExtendingChar(line.text.charAt(pos))); - return pos; - } - - // This is needed in order to move 'visually' through bi-directional - // text -- i.e., pressing left should make the cursor go left, even - // when in RTL text. The tricky part is the 'jumps', where RTL and - // LTR text touch each other. This often requires the cursor offset - // to move more than one unit, in order to visually move one unit. - function moveVisually(line, start, dir, byUnit) { - var bidi = getOrder(line); - if (!bidi) return moveLogically(line, start, dir, byUnit); - var pos = getBidiPartAt(bidi, start), part = bidi[pos]; - var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit); - - for (;;) { - if (target > part.from && target < part.to) return target; - if (target == part.from || target == part.to) { - if (getBidiPartAt(bidi, target) == pos) return target; - part = bidi[pos += dir]; - return (dir > 0) == part.level % 2 ? part.to : part.from; - } else { - part = bidi[pos += dir]; - if (!part) return null; - if ((dir > 0) == part.level % 2) - target = moveInLine(line, part.to, -1, byUnit); - else - target = moveInLine(line, part.from, 1, byUnit); - } - } - } - - function moveLogically(line, start, dir, byUnit) { - var target = start + dir; - if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir; - return target < 0 || target > line.text.length ? null : target; - } - - // Bidirectional ordering algorithm - // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm - // that this (partially) implements. - - // One-char codes used for character types: - // L (L): Left-to-Right - // R (R): Right-to-Left - // r (AL): Right-to-Left Arabic - // 1 (EN): European Number - // + (ES): European Number Separator - // % (ET): European Number Terminator - // n (AN): Arabic Number - // , (CS): Common Number Separator - // m (NSM): Non-Spacing Mark - // b (BN): Boundary Neutral - // s (B): Paragraph Separator - // t (S): Segment Separator - // w (WS): Whitespace - // N (ON): Other Neutrals - - // Returns null if characters are ordered as they appear - // (left-to-right), or an array of sections ({from, to, level} - // objects) in the order in which they occur visually. - var bidiOrdering = (function() { - // Character types for codepoints 0 to 0xff - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; - // Character types for codepoints 0x600 to 0x6ff - var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm"; - function charType(code) { - if (code <= 0xf7) return lowTypes.charAt(code); - else if (0x590 <= code && code <= 0x5f4) return "R"; - else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600); - else if (0x6ee <= code && code <= 0x8ac) return "r"; - else if (0x2000 <= code && code <= 0x200b) return "w"; - else if (code == 0x200c) return "b"; - else return "L"; - } - - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; - // Browsers seem to always treat the boundaries of block elements as being L. - var outerType = "L"; - - function BidiSpan(level, from, to) { - this.level = level; - this.from = from; this.to = to; - } - - return function(str) { - if (!bidiRE.test(str)) return false; - var len = str.length, types = []; - for (var i = 0, type; i < len; ++i) - types.push(type = charType(str.charCodeAt(i))); - - // W1. Examine each non-spacing mark (NSM) in the level run, and - // change the type of the NSM to the type of the previous - // character. If the NSM is at the start of the level run, it will - // get the type of sor. - for (var i = 0, prev = outerType; i < len; ++i) { - var type = types[i]; - if (type == "m") types[i] = prev; - else prev = type; - } - - // W2. Search backwards from each instance of a European number - // until the first strong type (R, L, AL, or sor) is found. If an - // AL is found, change the type of the European number to Arabic - // number. - // W3. Change all ALs to R. - for (var i = 0, cur = outerType; i < len; ++i) { - var type = types[i]; - if (type == "1" && cur == "r") types[i] = "n"; - else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } - } - - // W4. A single European separator between two European numbers - // changes to a European number. A single common separator between - // two numbers of the same type changes to that type. - for (var i = 1, prev = types[0]; i < len - 1; ++i) { - var type = types[i]; - if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; - else if (type == "," && prev == types[i+1] && - (prev == "1" || prev == "n")) types[i] = prev; - prev = type; - } - - // W5. A sequence of European terminators adjacent to European - // numbers changes to all European numbers. - // W6. Otherwise, separators and terminators change to Other - // Neutral. - for (var i = 0; i < len; ++i) { - var type = types[i]; - if (type == ",") types[i] = "N"; - else if (type == "%") { - for (var end = i + 1; end < len && types[end] == "%"; ++end) {} - var replace = (i && types[i-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; - for (var j = i; j < end; ++j) types[j] = replace; - i = end - 1; - } - } - - // W7. Search backwards from each instance of a European number - // until the first strong type (R, L, or sor) is found. If an L is - // found, then change the type of the European number to L. - for (var i = 0, cur = outerType; i < len; ++i) { - var type = types[i]; - if (cur == "L" && type == "1") types[i] = "L"; - else if (isStrong.test(type)) cur = type; - } - - // N1. A sequence of neutrals takes the direction of the - // surrounding strong text if the text on both sides has the same - // direction. European and Arabic numbers act as if they were R in - // terms of their influence on neutrals. Start-of-level-run (sor) - // and end-of-level-run (eor) are used at level run boundaries. - // N2. Any remaining neutrals take the embedding direction. - for (var i = 0; i < len; ++i) { - if (isNeutral.test(types[i])) { - for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} - var before = (i ? types[i-1] : outerType) == "L"; - var after = (end < len ? types[end] : outerType) == "L"; - var replace = before || after ? "L" : "R"; - for (var j = i; j < end; ++j) types[j] = replace; - i = end - 1; - } - } - - // Here we depart from the documented algorithm, in order to avoid - // building up an actual levels array. Since there are only three - // levels (0, 1, 2) in an implementation that doesn't take - // explicit embedding into account, we can build up the order on - // the fly, without following the level-based algorithm. - var order = [], m; - for (var i = 0; i < len;) { - if (countsAsLeft.test(types[i])) { - var start = i; - for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} - order.push(new BidiSpan(0, start, i)); - } else { - var pos = i, at = order.length; - for (++i; i < len && types[i] != "L"; ++i) {} - for (var j = pos; j < i;) { - if (countsAsNum.test(types[j])) { - if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j)); - var nstart = j; - for (++j; j < i && countsAsNum.test(types[j]); ++j) {} - order.splice(at, 0, new BidiSpan(2, nstart, j)); - pos = j; - } else ++j; - } - if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i)); - } - } - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length; - order.unshift(new BidiSpan(0, 0, m[0].length)); - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length; - order.push(new BidiSpan(0, len - m[0].length, len)); - } - if (order[0].level != lst(order).level) - order.push(new BidiSpan(order[0].level, len, len)); - - return order; - }; - })(); - - // THE END - - CodeMirror.version = "4.12.0"; - - return CodeMirror; -}); diff --git a/media/editors/codemirror/lib/codemirror.css b/media/editors/codemirror/lib/codemirror.css index 1b8b844a0b9a6..bf4bb943826ff 100644 --- a/media/editors/codemirror/lib/codemirror.css +++ b/media/editors/codemirror/lib/codemirror.css @@ -1 +1,417 @@ -.CodeMirror{font-family:monospace;height:300px}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid black}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.CodeMirror.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}@-moz-keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}@-webkit-keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}@keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:white;color:black}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;display:inline-block;margin-bottom:-30px;*zoom:1;*display:inline}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;height:100%}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;border-right:0;width:0}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0}.CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler,.CodeMirror-overlayscroll .CodeMirror-gutter-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%} \ No newline at end of file +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 300px; + color: black; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; + white-space: nowrap; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +.CodeMirror-guttermarker { color: black; } +.CodeMirror-guttermarker-subtle { color: #999; } + +/* CURSOR */ + +.CodeMirror div.CodeMirror-cursor { + border-left: 1px solid black; +} +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.CodeMirror.cm-fat-cursor div.CodeMirror-cursor { + width: auto; + border: 0; + background: #7e7; +} +.CodeMirror.cm-fat-cursor div.CodeMirror-cursors { + z-index: 1; +} + +.cm-animate-fat-cursor { + width: auto; + border: 0; + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; +} +@-moz-keyframes blink { + 0% { background: #7e7; } + 50% { background: none; } + 100% { background: #7e7; } +} +@-webkit-keyframes blink { + 0% { background: #7e7; } + 50% { background: none; } + 100% { background: #7e7; } +} +@keyframes blink { + 0% { background: #7e7; } + 50% { background: none; } + 100% { background: #7e7; } +} + +/* Can style cursor different in overwrite (non-insert) mode */ +div.CodeMirror-overwrite div.CodeMirror-cursor {} + +.cm-tab { display: inline-block; text-decoration: inherit; } + +.CodeMirror-ruler { + border-left: 1px solid #ccc; + position: absolute; +} + +/* DEFAULT THEME */ + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator {} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3 {color: #085;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} +.cm-strikethrough {text-decoration: line-through;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +/* Default styles for common addons */ + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} +.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } +.CodeMirror-activeline-background {background: #e8f2ff;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + position: relative; + overflow: hidden; + background: white; +} + +.CodeMirror-scroll { + overflow: scroll !important; /* Things will break if this is overridden */ + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror */ + margin-bottom: -30px; margin-right: -30px; + padding-bottom: 30px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +.CodeMirror-sizer { + position: relative; + border-right: 30px solid transparent; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actuall scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + position: absolute; + z-index: 6; + display: none; +} +.CodeMirror-vscrollbar { + right: 0; top: 0; + overflow-x: hidden; + overflow-y: scroll; +} +.CodeMirror-hscrollbar { + bottom: 0; left: 0; + overflow-y: hidden; + overflow-x: scroll; +} +.CodeMirror-scrollbar-filler { + right: 0; bottom: 0; +} +.CodeMirror-gutter-filler { + left: 0; bottom: 0; +} + +.CodeMirror-gutters { + position: absolute; left: 0; top: 0; + z-index: 3; +} +.CodeMirror-gutter { + white-space: normal; + height: 100%; + -moz-box-sizing: content-box; + box-sizing: content-box; + display: inline-block; + margin-bottom: -30px; + /* Hack to make IE7 behave */ + *zoom:1; + *display:inline; +} +.CodeMirror-gutter-wrapper { + position: absolute; + z-index: 4; + height: 100%; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} +.CodeMirror-gutter-wrapper { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.CodeMirror-lines { + cursor: text; + min-height: 1px; /* prevents collapsing before first draw */ +} +.CodeMirror pre { + /* Reset some styles that the rest of the page might have set */ + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible; + -webkit-tap-highlight-color: transparent; +} +.CodeMirror-wrap pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} + +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + overflow: auto; +} + +.CodeMirror-widget {} + +.CodeMirror-code { + outline: none; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; + height: 0; + overflow: hidden; + visibility: hidden; +} +.CodeMirror-measure pre { position: static; } + +.CodeMirror div.CodeMirror-cursor { + position: absolute; + border-right: none; + width: 0; +} + +div.CodeMirror-cursors { + visibility: hidden; + position: relative; + z-index: 3; +} +.CodeMirror-focused div.CodeMirror-cursors { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } +.CodeMirror-crosshair { cursor: crosshair; } +.CodeMirror ::selection { background: #d7d4f0; } +.CodeMirror ::-moz-selection { background: #d7d4f0; } + +.cm-searching { + background: #ffa; + background: rgba(255, 255, 0, .4); +} + +/* IE7 hack to prevent it from returning funny offsetTops on the spans */ +.CodeMirror span { *vertical-align: text-bottom; } + +/* Used to force a border model for a node */ +.cm-force-border { padding-right: .1px; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursors { + visibility: hidden; + } +} + +/* See issue #2901 */ +.cm-tab-wrap-hack:after { content: ''; } + +/* Help users use markselection to safely style text background */ +span.CodeMirror-selectedtext { background: none; } +/** + * addon/display/fullscreen.css + * addon/fold/foldgutter.css + * addon/scroll/simplescrollbars.css +**/ +.CodeMirror-fullscreen { + position: fixed; + top: 0; left: 0; right: 0; bottom: 0; + height: auto; + z-index: 9; +} +.CodeMirror-foldmarker { + color: blue; + text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; + font-family: arial; + line-height: .3; + cursor: pointer; +} +.CodeMirror-foldgutter { + width: .7em; +} +.CodeMirror-foldgutter-open, +.CodeMirror-foldgutter-folded { + cursor: pointer; +} +.CodeMirror-foldgutter-open:after { + content: "\25BE"; +} +.CodeMirror-foldgutter-folded:after { + content: "\25B8"; +} +.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { + position: absolute; + background: #ccc; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: 1px solid #bbb; + border-radius: 2px; +} + +.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { + position: absolute; + z-index: 6; + background: #eee; +} + +.CodeMirror-simplescroll-horizontal { + bottom: 0; left: 0; + height: 8px; +} +.CodeMirror-simplescroll-horizontal div { + bottom: 0; + height: 100%; +} + +.CodeMirror-simplescroll-vertical { + right: 0; top: 0; + width: 8px; +} +.CodeMirror-simplescroll-vertical div { + right: 0; + width: 100%; +} + + +.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { + display: none; +} + +.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { + position: absolute; + background: #bcd; + border-radius: 3px; +} + +.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { + position: absolute; + z-index: 6; +} + +.CodeMirror-overlayscroll-horizontal { + bottom: 0; left: 0; + height: 6px; +} +.CodeMirror-overlayscroll-horizontal div { + bottom: 0; + height: 100%; +} + +.CodeMirror-overlayscroll-vertical { + right: 0; top: 0; + width: 6px; +} +.CodeMirror-overlayscroll-vertical div { + right: 0; + width: 100%; +} diff --git a/media/editors/codemirror/lib/codemirror.js b/media/editors/codemirror/lib/codemirror.js index d54fe16dd295d..98a45c60ba998 100644 --- a/media/editors/codemirror/lib/codemirror.js +++ b/media/editors/codemirror/lib/codemirror.js @@ -1 +1,8645 @@ -(function(a){if(typeof exports=="object"&&typeof module=="object"){module.exports=a()}else{if(typeof define=="function"&&define.amd){return define([],a)}else{this.CodeMirror=a()}}})(function(){var co=/gecko\/\d/i.test(navigator.userAgent);var eG=/MSIE \d/.test(navigator.userAgent);var bI=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);var dG=eG||bI;var k=dG&&(eG?document.documentMode||6:bI[1]);var cY=/WebKit\//.test(navigator.userAgent);var dJ=cY&&/Qt\/\d+\.\d+/.test(navigator.userAgent);var da=/Chrome\//.test(navigator.userAgent);var dY=/Opera\//.test(navigator.userAgent);var aA=/Apple Computer/.test(navigator.vendor);var a8=/KHTML\//.test(navigator.userAgent);var c5=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);var fr=/PhantomJS/.test(navigator.userAgent);var eX=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent);var ec=eX||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);var b6=eX||/Mac/.test(navigator.platform);var aM=/win/i.test(navigator.platform);var aV=dY&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);if(aV){aV=Number(aV[1])}if(aV&&aV>=15){dY=false;cY=true}var bP=b6&&(dJ||dY&&(aV==null||aV<12.11));var f0=co||(dG&&k>=9);var f3=false,a4=false;function I(f8,f9){if(!(this instanceof I)){return new I(f8,f9)}this.options=f9=f9?aK(f9):{};aK(eZ,f9,false);cd(f9);var gd=f9.value;if(typeof gd=="string"){gd=new ar(gd,f9.mode)}this.doc=gd;var gc=this.display=new eE(f8,gd);gc.wrapper.CodeMirror=this;d8(this);cM(this);if(f9.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}if(f9.autofocus&&!ec){ev(this)}aB(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,focused:false,suppressEdits:false,pasteIncoming:false,cutIncoming:false,draggingText:false,highlight:new f7(),keySeq:null};if(dG&&k<11){setTimeout(cv(fl,this,true),20)}fM(this);bg();cG(this);this.curOp.forceUpdate=true;d7(this,gd);if((f9.autofocus&&!ec)||dK()==gc.input){setTimeout(cv(cA,this),20)}else{aS(this)}for(var gb in bc){if(bc.hasOwnProperty(gb)){bc[gb](this,f9[gb],cb)}}d1(this);for(var ga=0;gaga.maxLineLength){ga.maxLineLength=gb;ga.maxLine=gc}})}function cd(f8){var f9=df(f8.gutters,"CodeMirror-linenumbers");if(f9==-1&&f8.lineNumbers){f8.gutters=f8.gutters.concat(["CodeMirror-linenumbers"])}else{if(f9>-1&&!f8.lineNumbers){f8.gutters=f8.gutters.slice(0);f8.gutters.splice(f9,1)}}}function dw(f8){var gb=f8.display,ga=gb.gutters.offsetWidth;var f9=Math.round(f8.doc.height+bH(f8.display));return{clientHeight:gb.scroller.clientHeight,viewHeight:gb.wrapper.clientHeight,scrollWidth:gb.scroller.scrollWidth,clientWidth:gb.scroller.clientWidth,viewWidth:gb.wrapper.clientWidth,barLeft:f8.options.fixedGutter?ga:0,docHeight:f9,scrollHeight:f9+cR(f8)+gb.barHeight,nativeBarWidth:gb.nativeBarWidth,gutterWidth:ga}}function dh(ga,f9,f8){this.cm=f8;var gb=this.vert=fT("div",[fT("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var gc=this.horiz=fT("div",[fT("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");ga(gb);ga(gc);bW(gb,"scroll",function(){if(gb.clientHeight){f9(gb.scrollTop,"vertical")}});bW(gc,"scroll",function(){if(gc.clientWidth){f9(gc.scrollLeft,"horizontal")}});this.checkedOverlay=false;if(dG&&k<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}}dh.prototype=aK({update:function(gb){var gc=gb.scrollWidth>gb.clientWidth+1;var ga=gb.scrollHeight>gb.clientHeight+1;var gd=gb.nativeBarWidth;if(ga){this.vert.style.display="block";this.vert.style.bottom=gc?gd+"px":"0";var f9=gb.viewHeight-(gc?gd:0);this.vert.firstChild.style.height=Math.max(0,gb.scrollHeight-gb.clientHeight+f9)+"px"}else{this.vert.style.display="";this.vert.firstChild.style.height="0"}if(gc){this.horiz.style.display="block";this.horiz.style.right=ga?gd+"px":"0";this.horiz.style.left=gb.barLeft+"px";var f8=gb.viewWidth-gb.barLeft-(ga?gd:0);this.horiz.firstChild.style.width=(gb.scrollWidth-gb.clientWidth+f8)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedOverlay&&gb.clientHeight>0){if(gd==0){this.overlayHack()}this.checkedOverlay=true}return{right:ga?gd:0,bottom:gc?gd:0}},setScrollLeft:function(f8){if(this.horiz.scrollLeft!=f8){this.horiz.scrollLeft=f8}},setScrollTop:function(f8){if(this.vert.scrollTop!=f8){this.vert.scrollTop=f8}},overlayHack:function(){var f8=b6&&!c5?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=f8;var f9=this;var ga=function(gb){if(M(gb)!=f9.vert&&M(gb)!=f9.horiz){c0(f9.cm,ep)(gb)}};bW(this.vert,"mousedown",ga);bW(this.horiz,"mousedown",ga)},clear:function(){var f8=this.horiz.parentNode;f8.removeChild(this.horiz);f8.removeChild(this.vert)}},dh.prototype);function e0(){}e0.prototype=aK({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},e0.prototype);I.scrollbarModel={"native":dh,"null":e0};function aB(f8){if(f8.display.scrollbars){f8.display.scrollbars.clear();if(f8.display.scrollbars.addClass){f(f8.display.wrapper,f8.display.scrollbars.addClass)}}f8.display.scrollbars=new I.scrollbarModel[f8.options.scrollbarStyle](function(f9){f8.display.wrapper.insertBefore(f9,f8.display.scrollbarFiller);bW(f9,"mousedown",function(){if(f8.state.focused){setTimeout(cv(ev,f8),0)}});f9.setAttribute("not-content","true")},function(ga,f9){if(f9=="horizontal"){bD(f8,ga)}else{O(f8,ga)}},f8);if(f8.display.scrollbars.addClass){fx(f8.display.wrapper,f8.display.scrollbars.addClass)}}function eU(ga,gc){if(!gc){gc=dw(ga)}var f9=ga.display.barWidth,f8=ga.display.barHeight;aR(ga,gc);for(var gb=0;gb<4&&f9!=ga.display.barWidth||f8!=ga.display.barHeight;gb++){if(f9!=ga.display.barWidth&&ga.options.lineWrapping){a6(ga)}aR(ga,dw(ga));f9=ga.display.barWidth;f8=ga.display.barHeight}}function aR(f8,f9){var gb=f8.display;var ga=gb.scrollbars.update(f9);gb.sizer.style.paddingRight=(gb.barWidth=ga.right)+"px";gb.sizer.style.paddingBottom=(gb.barHeight=ga.bottom)+"px";if(ga.right&&ga.bottom){gb.scrollbarFiller.style.display="block";gb.scrollbarFiller.style.height=ga.bottom+"px";gb.scrollbarFiller.style.width=ga.right+"px"}else{gb.scrollbarFiller.style.display=""}if(ga.bottom&&f8.options.coverGutterNextToScrollbar&&f8.options.fixedGutter){gb.gutterFiller.style.display="block";gb.gutterFiller.style.height=ga.bottom+"px";gb.gutterFiller.style.width=f9.gutterWidth+"px"}else{gb.gutterFiller.style.display=""}}function b5(gb,gf,ga){var gc=ga&&ga.top!=null?Math.max(0,ga.top):gb.scroller.scrollTop;gc=Math.floor(gc-e4(gb));var f8=ga&&ga.bottom!=null?ga.bottom:gc+gb.wrapper.clientHeight;var gd=bF(gf,gc),ge=bF(gf,f8);if(ga&&ga.ensure){var f9=ga.ensure.from.line,gg=ga.ensure.to.line;if(f9=ge){gd=bF(gf,bL(fb(gf,gg))-gb.wrapper.clientHeight);ge=gg}}}return{from:gd,to:Math.max(ge,gd+1)}}function eA(gg){var ge=gg.display,gf=ge.view;if(!ge.alignWidgets&&(!ge.gutters.firstChild||!gg.options.fixedGutter)){return}var gc=dT(ge)-ge.scroller.scrollLeft+gg.doc.scrollLeft;var f8=ge.gutters.offsetWidth,f9=gc+"px";for(var gb=0;gb=gc.viewFrom&&gb.visible.to<=gc.viewTo&&(gc.updateLineNumbers==null||gc.updateLineNumbers>=gc.viewTo)&&gc.renderedView==gc.view&&c9(gh)==0){return false}if(d1(gh)){es(gh);gb.dims=e9(gh)}var ga=gg.first+gg.size;var ge=Math.max(gb.visible.from-gh.options.viewportMargin,gg.first);var gf=Math.min(ga,gb.visible.to+gh.options.viewportMargin);if(gc.viewFromgf&&gc.viewTo-gf<20){gf=Math.min(ga,gc.viewTo)}if(a4){ge=aT(gh.doc,ge);gf=dZ(gh.doc,gf)}var f9=ge!=gc.viewFrom||gf!=gc.viewTo||gc.lastWrapHeight!=gb.wrapperHeight||gc.lastWrapWidth!=gb.wrapperWidth;cP(gh,ge,gf);gc.viewOffset=bL(fb(gh.doc,gc.viewFrom));gh.display.mover.style.top=gc.viewOffset+"px";var f8=c9(gh);if(!f9&&f8==0&&!gb.force&&gc.renderedView==gc.view&&(gc.updateLineNumbers==null||gc.updateLineNumbers>=gc.viewTo)){return false}var gd=dK();if(f8>4){gc.lineDiv.style.display="none"}cm(gh,gc.updateLineNumbers,gb.dims);if(f8>4){gc.lineDiv.style.display=""}gc.renderedView=gc.view;if(gd&&dK()!=gd&&gd.offsetHeight){gd.focus()}dX(gc.cursorDiv);dX(gc.selectionDiv);gc.gutters.style.height=0;if(f9){gc.lastWrapHeight=gb.wrapperHeight;gc.lastWrapWidth=gb.wrapperWidth;eb(gh,400)}gc.updateLineNumbers=null;return true}function cj(f9,gd){var gb=gd.force,f8=gd.viewport;for(var gc=true;;gc=false){if(gc&&f9.options.lineWrapping&&gd.oldDisplayWidth!=di(f9)){gb=true}else{gb=false;if(f8&&f8.top!=null){f8={top:Math.min(f9.doc.height+bH(f9.display)-cT(f9),f8.top)}}gd.visible=b5(f9.display,f9.doc,f8);if(gd.visible.from>=f9.display.viewFrom&&gd.visible.to<=f9.display.viewTo){break}}if(!C(f9,gd)){break}a6(f9);var ga=dw(f9);bB(f9);dv(f9,ga);eU(f9,ga)}ad(f9,"update",f9);if(f9.display.viewFrom!=f9.display.reportedViewFrom||f9.display.viewTo!=f9.display.reportedViewTo){ad(f9,"viewportChange",f9,f9.display.viewFrom,f9.display.viewTo);f9.display.reportedViewFrom=f9.display.viewFrom;f9.display.reportedViewTo=f9.display.viewTo}}function dP(f9,f8){var gb=new aG(f9,f8);if(C(f9,gb)){a6(f9);cj(f9,gb);var ga=dw(f9);bB(f9);dv(f9,ga);eU(f9,ga)}}function dv(f8,f9){f8.display.sizer.style.minHeight=f9.docHeight+"px";var ga=f9.docHeight+f8.display.barHeight;f8.display.heightForcer.style.top=ga+"px";f8.display.gutters.style.height=Math.max(ga+cR(f8),f9.clientHeight)+"px"}function a6(gf){var gd=gf.display;var f9=gd.lineDiv.offsetTop;for(var ga=0;ga0.001||ge<-0.001){fW(gg.line,gh);ca(gg.line);if(gg.rest){for(var f8=0;f8-1){gh=false}aa(gj,gc,gd,gi)}if(gh){dX(gc.lineNumber);gc.lineNumber.appendChild(document.createTextNode(eo(gj.options,gd)))}gk=gc.node.nextSibling}}gd+=gc.size}while(gk){gk=ge(gk)}}function aa(f8,ga,gc,gd){for(var f9=0;f9=0&&ce(gb,f9.to())<=0){return ga}}return -1}};function dU(f8,f9){this.anchor=f8;this.head=f9}dU.prototype={from:function(){return aq(this.anchor,this.head)},to:function(){return bw(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};function cw(f8,gf){var ga=f8[gf];f8.sort(function(gi,gh){return ce(gi.from(),gh.from())});gf=df(f8,ga);for(var gc=1;gc=0){var gd=aq(f9.from(),gg.from()),ge=bw(f9.to(),gg.to());var gb=f9.empty()?gg.from()==gg.head:f9.from()==f9.head;if(gc<=gf){--gf}f8.splice(--gc,2,new dU(gb?ge:gd,gb?gd:ge))}}return new fU(f8,gf)}function eO(f8,f9){return new fU([new dU(f8,f9||f8)],0)}function c3(f8,f9){return Math.max(f8.first,Math.min(f9,f8.first+f8.size-1))}function fG(f9,ga){if(ga.linef8){return X(f8,fb(f9,f8).text.length)}return fp(ga,fb(f9,ga.line).text.length)}function fp(ga,f9){var f8=ga.ch;if(f8==null||f8>f9){return X(ga.line,f9)}else{if(f8<0){return X(ga.line,0)}else{return ga}}}function b8(f9,f8){return f8>=f9.first&&f8=ga.ch:f8.to>ga.ch))){if(ge){aC(f9,"beforeCursorEnter");if(f9.explicitlyCleared){if(!gj.markedSpans){break}else{--gc;continue}}}if(!f9.atomic){continue}var gf=f9.find(gb<0?-1:1);if(ce(gf,ga)==0){gf.ch+=gb;if(gf.ch<0){if(gf.line>gh.first){gf=fG(gh,X(gf.line-1))}else{gf=null}}else{if(gf.ch>gj.text.length){if(gf.line3){gj(gD,gB.top,null,gB.bottom);gD=gb;if(gB.bottomgq.bottom||gC.bottom==gq.bottom&&gC.right>gq.right){gq=gC}if(gD0){ga.blinker=setInterval(function(){ga.cursorDiv.style.visibility=(f9=!f9)?"":"hidden"},f8.options.cursorBlinkRate)}else{if(f8.options.cursorBlinkRate<0){ga.cursorDiv.style.visibility="hidden"}}}function eb(f8,f9){if(f8.doc.mode.startState&&f8.doc.frontier=f8.display.viewTo){return}var ga=+new Date+f8.options.workTime;var gb=b2(gc.mode,dx(f8,gc.frontier));var f9=[];gc.iter(gc.frontier,Math.min(gc.first+gc.size,f8.display.viewTo+500),function(gd){if(gc.frontier>=f8.display.viewFrom){var gg=gd.styles;var gi=fw(f8,gd,gb,true);gd.styles=gi.styles;var gf=gd.styleClasses,gh=gi.classes;if(gh){gd.styleClasses=gh}else{if(gf){gd.styleClasses=null}}var gj=!gg||gg.length!=gd.styles.length||gf!=gh&&(!gf||!gh||gf.bgClass!=gh.bgClass||gf.textClass!=gh.textClass);for(var ge=0;!gj&&gega){eb(f8,f8.options.workDelay);return true}});if(f9.length){cK(f8,function(){for(var gd=0;gdga;--gh){if(gh<=gd.first){return gd.first}var gg=fb(gd,gh-1);if(gg.stateAfter&&(!gb||gh<=gd.frontier)){return gh}var gf=bS(gg.text,null,ge.options.tabSize);if(gc==null||f9>gf){gc=gh-1;f9=gf}}return gc}function dx(f8,ge,f9){var gc=f8.doc,gb=f8.display;if(!gc.mode.startState){return true}var gd=cy(f8,ge,f9),ga=gd>gc.first&&fb(gc,gd-1).stateAfter;if(!ga){ga=bZ(gc.mode)}else{ga=b2(gc.mode,ga)}gc.iter(gd,ge,function(gf){dt(f8,gf.text,ga);var gg=gd==ge-1||gd%5==0||gd>=gb.viewFrom&&gd2){gd.push((gg.bottom+f9.top)/2-ge.top)}}}gd.push(ge.bottom-ge.top)}}function ct(ga,f8,gb){if(ga.line==f8){return{map:ga.measure.map,cache:ga.measure.cache}}for(var f9=0;f9gb){return{map:ga.measure.maps[f9],cache:ga.measure.caches[f9],before:true}}}}function cZ(f8,ga){ga=y(ga);var gc=bM(ga);var f9=f8.display.externalMeasured=new bu(f8.doc,ga,gc);f9.lineN=gc;var gb=f9.built=eN(f8,f9);f9.text=gb.pre;bQ(f8.display.lineMeasure,gb.pre);return f9}function ed(f8,f9,gb,ga){return D(f8,a1(f8,f9),gb,ga)}function e7(f8,ga){if(ga>=f8.display.viewFrom&&ga=f9.lineN&&gagh){gb=gn-gr;gc=gb-1;if(gh>=gn){f8="right"}}}}if(gc!=null){gm=gt[go+2];if(gr==gn&&gd==(gm.insertLeft?"left":"right")){f8=gd}if(gd=="left"&&gc==0){while(go&>[go-2]==gt[go-3]&>[go-1].insertLeft){gm=gt[(go-=3)+2];f8="left"}}if(gd=="right"&&gc==gn-gr){while(go0){f8=gd="right"}var ga;if(gf.options.lineWrapping&&(ga=gm.getClientRects()).length>1){f9=ga[gd=="right"?ga.length-1:0]}else{f9=gm.getBoundingClientRect()}}if(dG&&k<9&&!gc&&(!f9||!f9.left&&!f9.right)){var ge=gm.parentNode.getClientRects()[0];if(ge){f9={left:ge.left,right:ge.left+dz(gf.display),top:ge.top,bottom:ge.bottom}}else{f9=ex}}var gk=f9.top-gp.rect.top,gi=f9.bottom-gp.rect.top;var gs=(gk+gi)/2;var gq=gp.view.measure.heights;for(var go=0;gogl.from){return gc(gn-1)}return gc(gn,gm)}var gd=a(ge),f8=gg.ch;if(!gd){return gc(f8)}var f9=aE(gd,f8);var gb=gi(f8,f9);if(eY!=null){gb.other=gi(f8,eY)}return gb}function dD(f8,gc){var gb=0,gc=fG(f8.doc,gc);if(!f8.options.lineWrapping){gb=dz(f8.display)*gc.ch}var f9=fb(f8.doc,gc.line);var ga=bL(f9)+e4(f8.display);return{left:gb,right:gb,top:ga,bottom:ga+f9.height}}function fS(f8,f9,ga,gc){var gb=X(f8,f9);gb.xRel=gc;if(ga){gb.outside=true}return gb}function fL(gf,gc,gb){var ge=gf.doc;gb+=gf.display.viewOffset;if(gb<0){return fS(ge.first,0,true,-1)}var ga=bF(ge,gb),gg=ge.first+ge.size-1;if(ga>gg){return fS(ge.first+ge.size-1,fb(ge,gg).text.length,true,1)}if(gc<0){gc=0}var f9=fb(ge,ga);for(;;){var gh=cX(gf,f9,ga,gc,gb);var gd=er(f9);var f8=gd&&gd.find(0,true);if(gd&&(gh.ch>f8.from.ch||gh.ch==f8.from.ch&&gh.xRel>0)){ga=bM(f9=f8.to.line)}else{return gh}}}function cX(gi,ga,gl,gk,gj){var gh=gj-bL(ga);var ge=false,gr=2*gi.display.wrapper.clientWidth;var go=a1(gi,ga);function gv(gx){var gy=dQ(gi,X(gl,gx),"line",ga,go);ge=true;if(gh>gy.bottom){return gy.left-gr}else{if(ghf9){return fS(gl,gb,gd,1)}for(;;){if(gn?gb==gs||gb==u(ga,gs,1):gb-gs<=1){var gm=gk1?1:0);return gg}var gf=Math.ceil(gq/2),gw=gs+gf;if(gn){gw=gs;for(var gt=0;gtgk){gb=gw;f9=gc;if(gd=ge){f9+=1000}gq=gf}else{gs=gw;gp=gc;f8=ge;gq-=gf}}}var aF;function aU(ga){if(ga.cachedTextHeight!=null){return ga.cachedTextHeight}if(aF==null){aF=fT("pre");for(var f9=0;f9<49;++f9){aF.appendChild(document.createTextNode("x"));aF.appendChild(fT("br"))}aF.appendChild(document.createTextNode("x"))}bQ(ga.measure,aF);var f8=aF.offsetHeight/50;if(f8>3){ga.cachedTextHeight=f8}dX(ga.measure);return f8||1}function dz(gc){if(gc.cachedCharWidth!=null){return gc.cachedCharWidth}var f8=fT("span","xxxxxxxxxx");var gb=fT("pre",[f8]);bQ(gc.measure,gb);var ga=f8.getBoundingClientRect(),f9=(ga.right-ga.left)/10;if(f9>2){gc.cachedCharWidth=f9}return f9||10}var bo=null;var d4=0;function cG(f8){f8.curOp={cm:f8,viewChanged:false,startHeight:f8.doc.height,forceUpdate:false,updateInput:null,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++d4};if(bo){bo.ops.push(f8.curOp)}else{f8.curOp.ownsGroup=bo={ops:[f8.curOp],delayedCallbacks:[]}}}function cS(gb){var ga=gb.delayedCallbacks,f9=0;do{for(;f9=f9.viewTo)||f9.maxLineChanged&&f8.options.lineWrapping;ga.update=ga.mustUpdate&&new aG(f8,ga.mustUpdate&&{top:ga.scrollTop,ensure:ga.scrollToPos},ga.forceUpdate)}function ap(f8){f8.updatedDisplay=f8.mustUpdate&&C(f8.cm,f8.update)}function b1(ga){var f8=ga.cm,f9=f8.display;if(ga.updatedDisplay){a6(f8)}ga.barMeasure=dw(f8);if(f9.maxLineChanged&&!f8.options.lineWrapping){ga.adjustWidthTo=ed(f8,f9.maxLine,f9.maxLine.text.length).left+3;f8.display.sizerWidth=ga.adjustWidthTo;ga.barMeasure.scrollWidth=Math.max(f9.scroller.clientWidth,f9.sizer.offsetLeft+ga.adjustWidthTo+cR(f8)+f8.display.barWidth);ga.maxScrollLeft=Math.max(0,f9.sizer.offsetLeft+ga.adjustWidthTo-di(f8))}if(ga.updatedDisplay||ga.selectionChanged){ga.newSelectionNodes=bk(f8)}}function ao(f9){var f8=f9.cm;if(f9.adjustWidthTo!=null){f8.display.sizer.style.minWidth=f9.adjustWidthTo+"px";if(f9.maxScrollLeftgd)){ga.updateLineNumbers=gd}gf.curOp.viewChanged=true;if(gd>=ga.viewTo){if(a4&&aT(gf.doc,gd)ga.viewFrom){es(gf)}else{ga.viewFrom+=gg;ga.viewTo+=gg}}else{if(gd<=ga.viewFrom&&ge>=ga.viewTo){es(gf)}else{if(gd<=ga.viewFrom){var gc=dc(gf,ge,ge+gg,1);if(gc){ga.view=ga.view.slice(gc.index);ga.viewFrom=gc.lineN;ga.viewTo+=gg}else{es(gf)}}else{if(ge>=ga.viewTo){var gc=dc(gf,gd,gd,-1);if(gc){ga.view=ga.view.slice(0,gc.index);ga.viewTo=gc.lineN}else{es(gf)}}else{var gb=dc(gf,gd,gd,-1);var f9=dc(gf,ge,ge+gg,1);if(gb&&f9){ga.view=ga.view.slice(0,gb.index).concat(eR(gf,gb.lineN,f9.lineN)).concat(ga.view.slice(f9.index));ga.viewTo+=gg}else{es(gf)}}}}}}var f8=ga.externalMeasured;if(f8){if(ge=gc.lineN&&ga=ge.viewTo){return}var gb=ge.view[dn(f9,ga)];if(gb.node==null){return}var f8=gb.changes||(gb.changes=[]);if(df(f8,gd)==-1){f8.push(gd)}}function es(f8){f8.display.viewFrom=f8.display.viewTo=f8.doc.first;f8.display.view=[];f8.display.viewOffset=0}function dn(f8,gb){if(gb>=f8.display.viewTo){return null}gb-=f8.display.viewFrom;if(gb<0){return null}var f9=f8.display.view;for(var ga=0;ga0){if(gd==ge.length-1){return null}gf=(f8+ge[gd].size)-ga;gd++}else{gf=f8-ga}ga+=gf;gc+=gf}while(aT(gg.doc,gc)!=gc){if(gd==(f9<0?0:ge.length-1)){return null}gc+=f9*ge[gd-(f9<0?1:0)].size;gd+=f9}return{index:gd,lineN:gc}}function cP(f8,gc,gb){var ga=f8.display,f9=ga.view;if(f9.length==0||gc>=ga.viewTo||gb<=ga.viewFrom){ga.view=eR(f8,gc,gb);ga.viewFrom=gc}else{if(ga.viewFrom>gc){ga.view=eR(f8,gc,ga.viewFrom).concat(ga.view)}else{if(ga.viewFromgb){ga.view=ga.view.slice(0,dn(f8,gb))}}}ga.viewTo=gb}function c9(f8){var f9=f8.display.view,gc=0;for(var gb=0;gb=9&&gc.display.inputHasSelection===gf||b6&&/[\uf700-\uf7ff]/.test(gf)){fl(gc);return false}var gn=!gc.curOp;if(gn){cG(gc)}gc.display.shift=false;if(gf.charCodeAt(0)==8203&&gr.sel==gc.display.selForContextMenu&&!gg){gg="\u200b"}var gm=0,gj=Math.min(gg.length,gf.length);while(gm1){if(bj&&bj.join("\n")==f9){gq=gr.sel.ranges.length%bj.length==0&&bR(bj,aX)}else{if(gh.length==gr.sel.ranges.length){gq=bR(gh,function(gs){return[gs]})}}}for(var go=gr.sel.ranges.length-1;go>=0;go--){var gi=gr.sel.ranges[go];var gk=gi.from(),f8=gi.to();if(gm-1){ac(gc,ga.line,"smart");break}}}else{if(ge.electricInput){if(ge.electricInput.test(fb(gr,ga.line).text.slice(0,ga.ch))){ac(gc,ga.line,"smart")}}}}}fD(gc);gc.curOp.updateInput=gb;gc.curOp.typing=true;if(gf.length>1000||gf.indexOf("\n")>-1){gd.value=gc.display.prevInput=""}else{gc.display.prevInput=gf}if(gn){al(gc)}gc.state.pasteIncoming=gc.state.cutIncoming=false;return true}function fl(f8,gc){if(f8.display.contextMenuPending){return}var f9,gb,ge=f8.doc;if(f8.somethingSelected()){f8.display.prevInput="";var ga=ge.sel.primary();f9=c8&&(ga.to().line-ga.from().line>100||(gb=f8.getSelection()).length>1000);var gd=f9?"-":gb||f8.getSelection();f8.display.input.value=gd;if(f8.state.focused){dH(f8.display.input)}if(dG&&k>=9){f8.display.inputHasSelection=gd}}else{if(!gc){f8.display.prevInput=f8.display.input.value="";if(dG&&k>=9){f8.display.inputHasSelection=null}}}f8.display.inaccurateSelection=f9}function ev(f8){if(f8.options.readOnly!="nocursor"&&(!ec||dK()!=f8.display.input)){f8.display.input.focus()}}function r(f8){if(!f8.state.focused){ev(f8);cA(f8)}}function ai(f8){return f8.options.readOnly||f8.doc.cantEdit}function fM(f8){var ga=f8.display;bW(ga.scroller,"mousedown",c0(f8,ep));if(dG&&k<11){bW(ga.scroller,"dblclick",c0(f8,function(gd){if(aO(f8,gd)){return}var ge=cn(f8,gd);if(!ge||l(f8,gd)||a7(f8.display,gd)){return}cE(gd);var gc=f8.findWordAt(ge);fQ(f8.doc,gc.anchor,gc.head)}))}else{bW(ga.scroller,"dblclick",function(gc){aO(f8,gc)||cE(gc)})}bW(ga.lineSpace,"selectstart",function(gc){if(!a7(ga,gc)){cE(gc)}});if(!f0){bW(ga.scroller,"contextmenu",function(gc){ax(f8,gc)})}bW(ga.scroller,"scroll",function(){if(ga.scroller.clientHeight){O(f8,ga.scroller.scrollTop);bD(f8,ga.scroller.scrollLeft,true);aC(f8,"scroll",f8)}});bW(ga.scroller,"mousewheel",function(gc){b(f8,gc)});bW(ga.scroller,"DOMMouseScroll",function(gc){b(f8,gc)});bW(ga.wrapper,"scroll",function(){ga.wrapper.scrollTop=ga.wrapper.scrollLeft=0});bW(ga.input,"keyup",function(gc){bf.call(f8,gc)});bW(ga.input,"input",function(){if(dG&&k>=9&&f8.display.inputHasSelection){f8.display.inputHasSelection=null}cg(f8)});bW(ga.input,"keydown",c0(f8,p));bW(ga.input,"keypress",c0(f8,cx));bW(ga.input,"focus",cv(cA,f8));bW(ga.input,"blur",cv(aS,f8));function f9(gc){if(!aO(f8,gc)){en(gc)}}if(f8.options.dragDrop){bW(ga.scroller,"dragstart",function(gc){R(f8,gc)});bW(ga.scroller,"dragenter",f9);bW(ga.scroller,"dragover",f9);bW(ga.scroller,"drop",c0(f8,bh))}bW(ga.scroller,"paste",function(gc){if(a7(ga,gc)){return}f8.state.pasteIncoming=true;ev(f8);B(f8)});bW(ga.input,"paste",function(){if(cY&&!f8.state.fakedLastChar&&!(new Date-f8.state.lastMiddleDown<200)){var gd=ga.input.selectionStart,gc=ga.input.selectionEnd;ga.input.value+="$";ga.input.selectionEnd=gc;ga.input.selectionStart=gd;f8.state.fakedLastChar=true}f8.state.pasteIncoming=true;B(f8)});function gb(gg){if(f8.somethingSelected()){bj=f8.getSelections();if(ga.inaccurateSelection){ga.prevInput="";ga.inaccurateSelection=false;ga.input.value=bj.join("\n");dH(ga.input)}}else{var gh=[],gd=[];for(var ge=0;gega-400&&ce(db.pos,gf)==0){gc="triple"}else{if(dk&&dk.time>ga-400&&ce(dk.pos,gf)==0){gc="double";db={time:ga,pos:gf}}else{gc="single";dk={time:ga,pos:gf}}}var gd=f9.doc.sel,f8=b6?ge.metaKey:ge.ctrlKey,gb;if(f9.options.dragDrop&&eH&&!ai(f9)&&gc=="single"&&(gb=gd.contains(gf))>-1&&!gd.ranges[gb].empty()){a0(f9,ge,gf,f8)}else{m(f9,ge,gf,gc,f8)}}function a0(ga,gc,gd,f9){var gb=ga.display;var f8=c0(ga,function(ge){if(cY){gb.scroller.draggable=false}ga.state.draggingText=false;d9(document,"mouseup",f8);d9(gb.scroller,"drop",f8);if(Math.abs(gc.clientX-ge.clientX)+Math.abs(gc.clientY-ge.clientY)<10){cE(ge);if(!f9){fQ(ga.doc,gd)}ev(ga);if(dG&&k==9){setTimeout(function(){document.body.focus();ev(ga)},20)}}});if(cY){gb.scroller.draggable=true}ga.state.draggingText=f8;if(gb.scroller.dragDrop){gb.scroller.dragDrop()}bW(document,"mouseup",f8);bW(gb.scroller,"drop",f8)}function m(gc,gq,gb,f9,ge){var gn=gc.display,gs=gc.doc;cE(gq);var ga,gr,gd=gs.sel,f8=gd.ranges;if(ge&&!gq.shiftKey){gr=gs.sel.contains(gb);if(gr>-1){ga=f8[gr]}else{ga=new dU(gb,gb)}}else{ga=gs.sel.primary()}if(gq.altKey){f9="rect";if(!ge){ga=new dU(gb,gb)}gb=cn(gc,gq,true,true);gr=-1}else{if(f9=="double"){var go=gc.findWordAt(gb);if(gc.display.shift||gs.extend){ga=fs(gs,ga,go.anchor,go.head)}else{ga=go}}else{if(f9=="triple"){var gh=new dU(X(gb.line,0),fG(gs,X(gb.line+1,0)));if(gc.display.shift||gs.extend){ga=fs(gs,ga,gh.anchor,gh.head)}else{ga=gh}}else{ga=fs(gs,ga,gb)}}}if(!ge){gr=0;bT(gs,new fU([ga],0),N);gd=gs.sel}else{if(gr==-1){gr=f8.length;bT(gs,cw(f8.concat([ga]),gr),{scroll:false,origin:"*mouse"})}else{if(f8.length>1&&f8[gr].empty()&&f9=="single"){bT(gs,cw(f8.slice(0,gr).concat(f8.slice(gr+1)),0));gd=gs.sel}else{e(gs,gr,ga,N)}}}var gm=gb;function gl(gD){if(ce(gm,gD)==0){return}gm=gD;if(f9=="rect"){var gu=[],gA=gc.options.tabSize;var gt=bS(fb(gs,gb.line).text,gb.ch,gA);var gG=bS(fb(gs,gD.line).text,gD.ch,gA);var gv=Math.min(gt,gG),gE=Math.max(gt,gG);for(var gH=Math.min(gb.line,gD.line),gx=Math.min(gc.lastLine(),Math.max(gb.line,gD.line));gH<=gx;gH++){var gF=fb(gs,gH).text,gw=em(gF,gv,gA);if(gv==gE){gu.push(new dU(X(gH,gw),X(gH,gw)))}else{if(gF.length>gw){gu.push(new dU(X(gH,gw),X(gH,em(gF,gE,gA))))}}}if(!gu.length){gu.push(new dU(gb,gb))}bT(gs,cw(gd.ranges.slice(0,gr).concat(gu),gr),{origin:"*mouse",scroll:false});gc.scrollIntoView(gD)}else{var gB=ga;var gy=gB.anchor,gC=gD;if(f9!="single"){if(f9=="double"){var gz=gc.findWordAt(gD)}else{var gz=new dU(X(gD.line,0),fG(gs,X(gD.line+1,0)))}if(ce(gz.anchor,gy)>0){gC=gz.head;gy=aq(gB.from(),gz.anchor)}else{gC=gz.anchor;gy=bw(gB.to(),gz.head)}}var gu=gd.ranges.slice(0);gu[gr]=new dU(fG(gs,gy),gC);bT(gs,cw(gu,gr),N)}}var gj=gn.wrapper.getBoundingClientRect();var gf=0;function gp(gv){var gt=++gf;var gx=cn(gc,gv,true,f9=="rect");if(!gx){return}if(ce(gx,gm)!=0){r(gc);gl(gx);var gw=b5(gn,gs);if(gx.line>=gw.to||gx.linegj.bottom?20:0;if(gu){setTimeout(c0(gc,function(){if(gf!=gt){return}gn.scroller.scrollTop+=gu;gp(gv)}),50)}}}function gi(gt){gf=Infinity;cE(gt);ev(gc);d9(document,"mousemove",gk);d9(document,"mouseup",gg);gs.history.lastSelOrigin=null}var gk=c0(gc,function(gt){if(!fK(gt)){gi(gt)}else{gp(gt)}});var gg=c0(gc,gi);bW(document,"mousemove",gk);bW(document,"mouseup",gg)}function f6(gj,gf,gh,gi,gb){try{var f9=gf.clientX,f8=gf.clientY}catch(gf){return false}if(f9>=Math.floor(gj.display.gutters.getBoundingClientRect().right)){return false}if(gi){cE(gf)}var gg=gj.display;var ge=gg.lineDiv.getBoundingClientRect();if(f8>ge.bottom||!fe(gj,gh)){return bK(gf)}f8-=ge.top-gg.viewOffset;for(var gc=0;gc=f9){var gk=bF(gj.doc,f8);var ga=gj.options.gutters[gc];gb(gj,gh,gj,gk,ga,gf);return bK(gf)}}}function l(f8,f9){return f6(f8,f9,"gutterClick",true,ad)}var af=0;function bh(ge){var gg=this;if(aO(gg,ge)||a7(gg.display,ge)){return}cE(ge);if(dG){af=+new Date}var gf=cn(gg,ge,true),f8=ge.dataTransfer.files;if(!gf||ai(gg)){return}if(f8&&f8.length&&window.FileReader&&window.File){var ga=f8.length,gh=Array(ga),f9=0;var gc=function(gk,gj){var gi=new FileReader;gi.onload=c0(gg,function(){gh[gj]=gi.result;if(++f9==ga){gf=fG(gg.doc,gf);var gl={from:gf,to:gf,text:aX(gh.join("\n")),origin:"paste"};bd(gg.doc,gl);e3(gg.doc,eO(gf,cV(gl)))}});gi.readAsText(gk)};for(var gd=0;gd-1){gg.state.draggingText(ge);setTimeout(cv(ev,gg),20);return}try{var gh=ge.dataTransfer.getData("Text");if(gh){if(gg.state.draggingText&&!(b6?ge.metaKey:ge.ctrlKey)){var gb=gg.listSelections()}el(gg.doc,eO(gf,gf));if(gb){for(var gd=0;gdgf.clientWidth||gj&&gf.scrollHeight>gf.clientHeight)){return}if(gj&&b6&&cY){outer:for(var gi=ga.target,ge=gc.view;gi!=gf;gi=gi.parentNode){for(var f9=0;f9=9){f8.display.inputHasSelection=null}B(f8)}function cA(f8){if(f8.options.readOnly=="nocursor"){return}if(!f8.state.focused){aC(f8,"focus",f8);f8.state.focused=true;fx(f8.display.wrapper,"CodeMirror-focused");if(!f8.curOp&&f8.display.selForContextMenu!=f8.doc.sel){fl(f8);if(cY){setTimeout(cv(fl,f8,true),0)}}}bl(f8);o(f8)}function aS(f8){if(f8.state.focused){aC(f8,"blur",f8);f8.state.focused=false;f(f8.display.wrapper,"CodeMirror-focused")}clearInterval(f8.display.blinker);setTimeout(function(){if(!f8.state.focused){f8.display.shift=false}},150)}function ax(gh,gc){if(aO(gh,gc,"contextmenu")){return}var ge=gh.display;if(a7(ge,gc)||de(gh,gc)){return}var gg=cn(gh,gc),f8=ge.scroller.scrollTop;if(!gg||dY){return}var gb=gh.options.resetSelectionOnContextMenu;if(gb&&gh.doc.sel.contains(gg)==-1){c0(gh,bT)(gh.doc,eO(gg),Z)}var gd=ge.input.style.cssText;ge.inputDiv.style.position="absolute";ge.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(gc.clientY-5)+"px; left: "+(gc.clientX-5)+"px; z-index: 1000; background: "+(dG?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(cY){var gi=window.scrollY}ev(gh);if(cY){window.scrollTo(null,gi)}fl(gh);if(!gh.somethingSelected()){ge.input.value=ge.prevInput=" "}ge.contextMenuPending=true;ge.selForContextMenu=gh.doc.sel;clearTimeout(ge.detectingSelectAll);function ga(){if(ge.input.selectionStart!=null){var gj=gh.somethingSelected();var gk=ge.input.value="\u200b"+(gj?ge.input.value:"");ge.prevInput=gj?"":"\u200b";ge.input.selectionStart=1;ge.input.selectionEnd=gk.length;ge.selForContextMenu=gh.doc.sel}}function gf(){ge.contextMenuPending=false;ge.inputDiv.style.position="relative";ge.input.style.cssText=gd;if(dG&&k<9){ge.scrollbars.setScrollTop(ge.scroller.scrollTop=f8)}bl(gh);if(ge.input.selectionStart!=null){if(!dG||(dG&&k<9)){ga()}var gj=0,gk=function(){if(ge.selForContextMenu==gh.doc.sel&&ge.input.selectionStart==0){c0(gh,ez.selectAll)(gh)}else{if(gj++<10){ge.detectingSelectAll=setTimeout(gk,500)}else{fl(gh)}}};ge.detectingSelectAll=setTimeout(gk,200)}}if(dG&&k>=9){ga()}if(f0){en(gc);var f9=function(){d9(window,"mouseup",f9);setTimeout(gf,20)};bW(window,"mouseup",f9)}else{setTimeout(gf,50)}}function de(f8,f9){if(!fe(f8,"gutterContextMenu")){return false}return f6(f8,f9,"gutterContextMenu",false,aC)}var cV=I.changeEnd=function(f8){if(!f8.text){return f8.to}return X(f8.from.line+f8.text.length-1,fE(f8.text).length+(f8.text.length==1?f8.from.ch:0))};function bY(gb,ga){if(ce(gb,ga.from)<0){return gb}if(ce(gb,ga.to)<=0){return cV(ga)}var f8=gb.line+ga.text.length-(ga.to.line-ga.from.line)-1,f9=gb.ch;if(gb.line==ga.to.line){f9+=cV(ga).ch-ga.to.ch}return X(f8,f9)}function fg(gb,gc){var f9=[];for(var ga=0;ga=0;--f8){L(gb,{from:f9[f8].from,to:f9[f8].to,text:f8?[""]:gc.text})}}else{L(gb,gc)}}function L(ga,gb){if(gb.text.length==1&&gb.text[0]==""&&ce(gb.from,gb.to)==0){return}var f9=fg(ga,gb);fJ(ga,gb,f9,ga.cm?ga.cm.curOp.id:NaN);ea(ga,gb,f9,eg(ga,gb));var f8=[];d3(ga,function(gd,gc){if(!gc&&df(f8,gd.history)==-1){dA(gd.history,gb);f8.push(gd.history)}ea(gd,gb,null,eg(gd,gb))})}function b7(gj,gh,gl){if(gj.cm&&gj.cm.state.suppressEdits){return}var gg=gj.history,ga,gc=gj.sel;var f8=gh=="undo"?gg.done:gg.undone,gk=gh=="undo"?gg.undone:gg.done;for(var gd=0;gd=0;--gd){var gi=ga.changes[gd];gi.origin=gh;if(gb&&!dN(gj,gi,false)){f8.length=0;return}gf.push(dr(gj,gi));var f9=gd?fg(gj,gi):fE(f8);ea(gj,gi,f9,d5(gj,gi));if(!gd&&gj.cm){gj.cm.scrollIntoView({from:gi.from,to:cV(gi)})}var ge=[];d3(gj,function(gn,gm){if(!gm&&df(ge,gn.history)==-1){dA(gn.history,gi);ge.push(gn.history)}ea(gn,gi,null,d5(gn,gi))})}}function fj(f9,gb){if(gb==0){return}f9.first+=gb;f9.sel=new fU(bR(f9.sel.ranges,function(gc){return new dU(X(gc.anchor.line+gb,gc.anchor.ch),X(gc.head.line+gb,gc.head.ch))}),f9.sel.primIndex);if(f9.cm){ag(f9.cm,f9.first,f9.first-gb,gb);for(var ga=f9.cm.display,f8=ga.viewFrom;f8gc.lastLine()){return}if(gd.from.linega){gd={from:gd.from,to:X(ga,fb(gc,ga).text.length),text:[gd.text[0]],origin:gd.origin}}gd.removed=fV(gc,gd.from,gd.to);if(!gb){gb=fg(gc,gd)}if(gc.cm){aH(gc.cm,gd,f9)}else{fv(gc,gd,f9)}el(gc,gb,Z)}function aH(gj,gf,gd){var gi=gj.doc,ge=gj.display,gg=gf.from,gh=gf.to;var f8=false,gc=gg.line;if(!gj.options.lineWrapping){gc=bM(y(fb(gi,gg.line)));gi.iter(gc,gh.line+1,function(gl){if(gl==ge.maxLine){f8=true;return true}})}if(gi.sel.contains(gf.from,gf.to)>-1){W(gj)}fv(gi,gf,gd,bb(gj));if(!gj.options.lineWrapping){gi.iter(gc,gg.line+gf.text.length,function(gm){var gl=ej(gm);if(gl>ge.maxLineLength){ge.maxLine=gm;ge.maxLineLength=gl;ge.maxLineChanged=true;f8=false}});if(f8){gj.curOp.updateMaxLine=true}}gi.frontier=Math.min(gi.frontier,gg.line);eb(gj,400);var gk=gf.text.length-(gh.line-gg.line)-1;if(gf.full){ag(gj)}else{if(gg.line==gh.line&&gf.text.length==1&&!dO(gj.doc,gf)){S(gj,gg.line,"text")}else{ag(gj,gg.line,gh.line+1,gk)}}var ga=fe(gj,"changes"),gb=fe(gj,"change");if(gb||ga){var f9={from:gg,to:gh,text:gf.text,removed:gf.removed,origin:gf.origin};if(gb){ad(gj,"change",gj,f9)}if(ga){(gj.curOp.changeObjs||(gj.curOp.changeObjs=[])).push(f9)}}gj.display.selForContextMenu=null}function aY(gb,ga,gd,gc,f8){if(!gc){gc=gd}if(ce(gc,gd)<0){var f9=gc;gc=gd;gd=f9}if(typeof ga=="string"){ga=aX(ga)}bd(gb,{from:gd,to:gc,text:ga,origin:f8})}function d2(f9,gc){if(aO(f9,"scrollCursorIntoView")){return}var gd=f9.display,ga=gd.sizer.getBoundingClientRect(),f8=null;if(gc.top+ga.top<0){f8=true}else{if(gc.bottom+ga.top>(window.innerHeight||document.documentElement.clientHeight)){f8=false}}if(f8!=null&&!fr){var gb=fT("div","\u200b",null,"position: absolute; top: "+(gc.top-gd.viewOffset-e4(f9.display))+"px; height: "+(gc.bottom-gc.top+cR(f9)+gd.barHeight)+"px; left: "+gc.left+"px; width: 2px;");f9.display.lineSpace.appendChild(gb);gb.scrollIntoView(f8);f9.display.lineSpace.removeChild(gb)}}function E(gi,gg,gc,gb){if(gb==null){gb=0}for(var gd=0;gd<5;gd++){var ge=false,gh=dQ(gi,gg);var f8=!gc||gc==gg?gh:dQ(gi,gc);var ga=H(gi,Math.min(gh.left,f8.left),Math.min(gh.top,f8.top)-gb,Math.max(gh.left,f8.left),Math.max(gh.bottom,f8.bottom)+gb);var gf=gi.doc.scrollTop,f9=gi.doc.scrollLeft;if(ga.scrollTop!=null){O(gi,ga.scrollTop);if(Math.abs(gi.doc.scrollTop-gf)>1){ge=true}}if(ga.scrollLeft!=null){bD(gi,ga.scrollLeft);if(Math.abs(gi.doc.scrollLeft-f9)>1){ge=true}}if(!ge){break}}return gh}function F(f8,ga,gc,f9,gb){var gd=H(f8,ga,gc,f9,gb);if(gd.scrollTop!=null){O(f8,gd.scrollTop)}if(gd.scrollLeft!=null){bD(f8,gd.scrollLeft)}}function H(gk,gb,gj,f9,gi){var gg=gk.display,ge=aU(gk.display);if(gj<0){gj=0}var gc=gk.curOp&&gk.curOp.scrollTop!=null?gk.curOp.scrollTop:gg.scroller.scrollTop;var gm=cT(gk),go={};if(gi-gj>gm){gi=gj+gm}var ga=gk.doc.height+bH(gg);var f8=gjga-ge;if(gjgc+gm){var gh=Math.min(gj,(gf?ga:gi)-gm);if(gh!=gc){go.scrollTop=gh}}}var gn=gk.curOp&&gk.curOp.scrollLeft!=null?gk.curOp.scrollLeft:gg.scroller.scrollLeft;var gl=di(gk)-(gk.options.fixedGutter?gg.gutters.offsetWidth:0);var gd=f9-gb>gl;if(gd){f9=gb+gl}if(gb<10){go.scrollLeft=0}else{if(gbgl+gn-3){go.scrollLeft=f9+(gd?0:10)-gl}}}return go}function cJ(f8,ga,f9){if(ga!=null||f9!=null){fz(f8)}if(ga!=null){f8.curOp.scrollLeft=(f8.curOp.scrollLeft==null?f8.doc.scrollLeft:f8.curOp.scrollLeft)+ga}if(f9!=null){f8.curOp.scrollTop=(f8.curOp.scrollTop==null?f8.doc.scrollTop:f8.curOp.scrollTop)+f9}}function fD(f8){fz(f8);var f9=f8.getCursor(),gb=f9,ga=f9;if(!f8.options.lineWrapping){gb=f9.ch?X(f9.line,f9.ch-1):f9;ga=X(f9.line,f9.ch+1)}f8.curOp.scrollToPos={from:gb,to:ga,margin:f8.options.cursorScrollMargin,isCursor:true}}function fz(f8){var ga=f8.curOp.scrollToPos;if(ga){f8.curOp.scrollToPos=null;var gc=dD(f8,ga.from),gb=dD(f8,ga.to);var f9=H(f8,Math.min(gc.left,gb.left),Math.min(gc.top,gb.top)-ga.margin,Math.max(gc.right,gb.right),Math.max(gc.bottom,gb.bottom)+ga.margin);f8.scrollTo(f9.scrollLeft,f9.scrollTop)}}function ac(gl,gb,gk,ga){var gj=gl.doc,f9;if(gk==null){gk="add"}if(gk=="smart"){if(!gj.mode.indent){gk="prev"}else{f9=dx(gl,gb)}}var gf=gl.options.tabSize;var gm=fb(gj,gb),ge=bS(gm.text,null,gf);if(gm.stateAfter){gm.stateAfter=null}var f8=gm.text.match(/^\s*/)[0],gh;if(!ga&&!/\S/.test(gm.text)){gh=0;gk="not"}else{if(gk=="smart"){gh=gj.mode.indent(f9,gm.text.slice(f8.length),gm.text);if(gh==b9||gh>150){if(!ga){return}gk="prev"}}}if(gk=="prev"){if(gb>gj.first){gh=bS(fb(gj,gb-1).text,null,gf)}else{gh=0}}else{if(gk=="add"){gh=ge+gl.options.indentUnit}else{if(gk=="subtract"){gh=ge-gl.options.indentUnit}else{if(typeof gk=="number"){gh=ge+gk}}}}gh=Math.max(0,gh);var gi="",gg=0;if(gl.options.indentWithTabs){for(var gc=Math.floor(gh/gf);gc;--gc){gg+=gf;gi+="\t"}}if(gg=0;gf--){aY(f8.doc,"",gc[gf].from,gc[gf].to,"+delete")}fD(f8)})}function bv(gq,gc,gk,gj,ge){var gh=gc.line,gi=gc.ch,gp=gk;var f9=fb(gq,gh);var gn=true;function go(){var gr=gh+gk;if(gr=gq.first+gq.size){return(gn=false)}gh=gr;return f9=fb(gq,gr)}function gm(gs){var gr=(ge?u:ah)(f9,gi,gk,true);if(gr==null){if(!gs&&go()){if(ge){gi=(gk<0?cQ:cD)(f9)}else{gi=gk<0?f9.text.length:0}}else{return(gn=false)}}else{gi=gr}return true}if(gj=="char"){gm()}else{if(gj=="column"){gm(true)}else{if(gj=="word"||gj=="group"){var gl=null,gf=gj=="group";var f8=gq.cm&&gq.cm.getHelper(gc,"wordChars");for(var gd=true;;gd=false){if(gk<0&&!gm(!gd)){break}var ga=f9.text.charAt(gi)||"\n";var gb=cz(ga,f8)?"w":gf&&ga=="\n"?"n":!gf||/\s/.test(ga)?null:"p";if(gf&&!gd&&!gb){gb="s"}if(gl&&gl!=gb){if(gk<0){gk=1;gm()}break}if(gb){gl=gb}if(gk>0&&!gm(!gd)){break}}}}}var gg=bU(gq,X(gh,gi),gp,true);if(!gn){gg.hitSide=true}return gg}function bp(gg,gb,f8,gf){var ge=gg.doc,gd=gb.left,gc;if(gf=="page"){var ga=Math.min(gg.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);gc=gb.top+f8*(ga-(f8<0?1.5:0.5)*aU(gg.display))}else{if(gf=="line"){gc=f8>0?gb.bottom+3:gb.top-3}}for(;;){var f9=fL(gg,gd,gc);if(!f9.outside){break}if(f8<0?gc<=0:gc>=ge.height){f9.hitSide=true;break}gc+=f8*5}return f9}I.prototype={constructor:I,focus:function(){window.focus();ev(this);B(this)},setOption:function(ga,gb){var f9=this.options,f8=f9[ga];if(f9[ga]==gb&&ga!="mode"){return}f9[ga]=gb;if(bc.hasOwnProperty(ga)){c0(this,bc[ga])(this,gb,f8)}},getOption:function(f8){return this.options[f8]},getDoc:function(){return this.doc},addKeyMap:function(f9,f8){this.state.keyMaps[f8?"push":"unshift"](fR(f9))},removeKeyMap:function(f9){var ga=this.state.keyMaps;for(var f8=0;f80){e(this.doc,gd,new dU(gf,ga[gd].to()),Z)}}else{if(ge.head.line>gb){ac(this,ge.head.line,gh,true);gb=ge.head.line;if(gd==this.doc.sel.primIndex){fD(this)}}}}}),getTokenAt:function(f9,f8){return cq(this,f9,f8)},getLineTokens:function(f9,f8){return cq(this,X(f9),f8,true)},getTokenTypeAt:function(gf){gf=fG(this.doc,gf);var gb=c4(this,fb(this.doc,gf.line));var gd=0,ge=(gb.length-1)/2,ga=gf.ch;var f9;if(ga==0){f9=gb[2]}else{for(;;){var f8=(gd+ge)>>1;if((f8?gb[f8*2-1]:0)>=ga){ge=f8}else{if(gb[f8*2+1]gb){f9=gb;f8=true}}var ga=fb(this.doc,f9);return eM(this,ga,{top:0,left:0},gc||"page").top+(f8?this.doc.height-bL(ga):0)},defaultTextHeight:function(){return aU(this.display)},defaultCharWidth:function(){return dz(this.display)},setGutterMarker:c6(function(f8,f9,ga){return eu(this.doc,f8,"gutter",function(gb){var gc=gb.gutterMarkers||(gb.gutterMarkers={});gc[f9]=ga;if(!ga&&eQ(gc)){gb.gutterMarkers=null}return true})}),clearGutter:c6(function(ga){var f8=this,gb=f8.doc,f9=gb.first;gb.iter(function(gc){if(gc.gutterMarkers&&gc.gutterMarkers[ga]){gc.gutterMarkers[ga]=null;S(f8,f9,"gutter");if(eQ(gc.gutterMarkers)){gc.gutterMarkers=null}}++f9})}),addLineWidget:c6(function(ga,f9,f8){return bG(this,ga,f9,f8)}),removeLineWidget:function(f8){f8.clear()},lineInfo:function(f8){if(typeof f8=="number"){if(!b8(this.doc,f8)){return null}var f9=f8;f8=fb(this.doc,f8);if(!f8){return null}}else{var f9=bM(f8);if(f9==null){return null}}return{line:f9,handle:f8,text:f8.text,gutterMarkers:f8.gutterMarkers,textClass:f8.textClass,bgClass:f8.bgClass,wrapClass:f8.wrapClass,widgets:f8.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(gd,ga,gf,gb,gh){var gc=this.display;gd=dQ(this,fG(this.doc,gd));var ge=gd.bottom,f9=gd.left;ga.style.position="absolute";ga.setAttribute("cm-ignore-events","true");gc.sizer.appendChild(ga);if(gb=="over"){ge=gd.top}else{if(gb=="above"||gb=="near"){var f8=Math.max(gc.wrapper.clientHeight,this.doc.height),gg=Math.max(gc.sizer.clientWidth,gc.lineSpace.clientWidth);if((gb=="above"||gd.bottom+ga.offsetHeight>f8)&&gd.top>ga.offsetHeight){ge=gd.top-ga.offsetHeight}else{if(gd.bottom+ga.offsetHeight<=f8){ge=gd.bottom}}if(f9+ga.offsetWidth>gg){f9=gg-ga.offsetWidth}}}ga.style.top=ge+"px";ga.style.left=ga.style.right="";if(gh=="right"){f9=gc.sizer.clientWidth-ga.offsetWidth;ga.style.right="0px"}else{if(gh=="left"){f9=0}else{if(gh=="middle"){f9=(gc.sizer.clientWidth-ga.offsetWidth)/2}}ga.style.left=f9+"px"}if(gf){F(this,f9,ge,f9+ga.offsetWidth,ge+ga.offsetHeight)}},triggerOnKeyDown:c6(p),triggerOnKeyPress:c6(cx),triggerOnKeyUp:bf,execCommand:function(f8){if(ez.hasOwnProperty(f8)){return ez[f8](this)}},findPosH:function(ge,gb,gc,f9){var f8=1;if(gb<0){f8=-1;gb=-gb}for(var ga=0,gd=fG(this.doc,ge);ga0&&f8(gb.charAt(ge-1))){--ge}while(ga0.5){Y(this)}aC(this,"refresh",this)}),swapDoc:c6(function(f9){var f8=this.doc;f8.cm=null;d7(this,f9);aj(this);fl(this);this.scrollTo(f9.scrollLeft,f9.scrollTop);this.curOp.forceScroll=true;ad(this,"swapDoc",this,f8);return f8}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};bx(I);var eZ=I.defaults={};var bc=I.optionHandlers={};function s(f8,gb,ga,f9){I.defaults[f8]=gb;if(ga){bc[f8]=f9?function(gc,ge,gd){if(gd!=cb){ga(gc,ge,gd)}}:ga}}var cb=I.Init={toString:function(){return"CodeMirror.Init"}};s("value","",function(f8,f9){f8.setValue(f9)},true);s("mode",null,function(f8,f9){f8.doc.modeOption=f9;bq(f8)},true);s("indentUnit",2,bq,true);s("indentWithTabs",false);s("smartIndent",true);s("tabSize",4,function(f8){eh(f8);aj(f8);ag(f8)},true);s("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(f8,f9){f8.options.specialChars=new RegExp(f9.source+(f9.test("\t")?"":"|\t"),"g");f8.refresh()},true);s("specialCharPlaceholder",e8,function(f8){f8.refresh()},true);s("electricChars",true);s("rtlMoveVisually",!aM);s("wholeLineUpdateBefore",true);s("theme","default",function(f8){cM(f8);ds(f8)},true);s("keyMap","default",function(f8,gc,f9){var ga=fR(gc);var gb=f9!=I.Init&&fR(f9);if(gb&&gb.detach){gb.detach(f8,ga)}if(ga.attach){ga.attach(f8,gb||null)}});s("extraKeys",null);s("lineWrapping",false,eC,true);s("gutters",[],function(f8){cd(f8.options);ds(f8)},true);s("fixedGutter",true,function(f8,f9){f8.display.gutters.style.left=f9?dT(f8.display)+"px":"0";f8.refresh()},true);s("coverGutterNextToScrollbar",false,function(f8){eU(f8)},true);s("scrollbarStyle","native",function(f8){aB(f8);eU(f8);f8.display.scrollbars.setScrollTop(f8.doc.scrollTop);f8.display.scrollbars.setScrollLeft(f8.doc.scrollLeft)},true);s("lineNumbers",false,function(f8){cd(f8.options);ds(f8)},true);s("firstLineNumber",1,ds,true);s("lineNumberFormatter",function(f8){return f8},ds,true);s("showCursorWhenSelecting",false,bB,true);s("resetSelectionOnContextMenu",true);s("readOnly",false,function(f8,f9){if(f9=="nocursor"){aS(f8);f8.display.input.blur();f8.display.disabled=true}else{f8.display.disabled=false;if(!f9){fl(f8)}}});s("disableInput",false,function(f8,f9){if(!f9){fl(f8)}},true);s("dragDrop",true);s("cursorBlinkRate",530);s("cursorScrollMargin",0);s("cursorHeight",1,bB,true);s("singleCursorHeightPerLine",true,bB,true);s("workTime",100);s("workDelay",100);s("flattenSpans",true,eh,true);s("addModeClass",false,eh,true);s("pollInterval",100);s("undoDepth",200,function(f8,f9){f8.doc.history.undoDepth=f9});s("historyEventDelay",1250);s("viewportMargin",10,function(f8){f8.refresh()},true);s("maxHighlightLength",10000,eh,true);s("moveInputWithCursor",true,function(f8,f9){if(!f9){f8.display.inputDiv.style.top=f8.display.inputDiv.style.left=0}});s("tabindex",null,function(f8,f9){f8.display.input.tabIndex=f9||""});s("autofocus",null);var dp=I.modes={},aP=I.mimeModes={};I.defineMode=function(f8,f9){if(!I.defaults.mode&&f8!="null"){I.defaults.mode=f8}if(arguments.length>2){f9.dependencies=Array.prototype.slice.call(arguments,2)}dp[f8]=f9};I.defineMIME=function(f9,f8){aP[f9]=f8};I.resolveMode=function(f8){if(typeof f8=="string"&&aP.hasOwnProperty(f8)){f8=aP[f8]}else{if(f8&&typeof f8.name=="string"&&aP.hasOwnProperty(f8.name)){var f9=aP[f8.name];if(typeof f9=="string"){f9={name:f9}}f8=ck(f9,f8);f8.name=f9.name}else{if(typeof f8=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(f8)){return I.resolveMode("application/xml")}}}if(typeof f8=="string"){return{name:f8}}else{return f8||{name:"null"}}};I.getMode=function(f9,f8){var f8=I.resolveMode(f8);var gb=dp[f8.name];if(!gb){return I.getMode(f9,"text/plain")}var gc=gb(f9,f8);if(dl.hasOwnProperty(f8.name)){var ga=dl[f8.name];for(var gd in ga){if(!ga.hasOwnProperty(gd)){continue}if(gc.hasOwnProperty(gd)){gc["_"+gd]=gc[gd]}gc[gd]=ga[gd]}}gc.name=f8.name;if(f8.helperType){gc.helperType=f8.helperType}if(f8.modeProps){for(var gd in f8.modeProps){gc[gd]=f8.modeProps[gd]}}return gc};I.defineMode("null",function(){return{token:function(f8){f8.skipToEnd()}}});I.defineMIME("text/plain","null");var dl=I.modeExtensions={};I.extendMode=function(ga,f9){var f8=dl.hasOwnProperty(ga)?dl[ga]:(dl[ga]={});aK(f9,f8)};I.defineExtension=function(f8,f9){I.prototype[f8]=f9};I.defineDocExtension=function(f8,f9){ar.prototype[f8]=f9};I.defineOption=s;var a5=[];I.defineInitHook=function(f8){a5.push(f8)};var fk=I.helpers={};I.registerHelper=function(f9,f8,ga){if(!fk.hasOwnProperty(f9)){fk[f9]=I[f9]={_global:[]}}fk[f9][f8]=ga};I.registerGlobalHelper=function(ga,f9,f8,gb){I.registerHelper(ga,f9,gb);fk[ga]._global.push({pred:f8,val:gb})};var b2=I.copyState=function(gb,f8){if(f8===true){return f8}if(gb.copyState){return gb.copyState(f8)}var ga={};for(var gc in f8){var f9=f8[gc];if(f9 instanceof Array){f9=f9.concat([])}ga[gc]=f9}return ga};var bZ=I.startState=function(ga,f9,f8){return ga.startState?ga.startState(f9,f8):true};I.innerMode=function(ga,f8){while(ga.innerMode){var f9=ga.innerMode(f8);if(!f9||f9.mode==ga){break}f8=f9.state;ga=f9.mode}return f9||{mode:ga,state:f8}};var ez=I.commands={selectAll:function(f8){f8.setSelection(X(f8.firstLine(),0),X(f8.lastLine()),Z)},singleSelection:function(f8){f8.setSelection(f8.getCursor("anchor"),f8.getCursor("head"),Z)},killLine:function(f8){eT(f8,function(ga){if(ga.empty()){var f9=fb(f8.doc,ga.head.line).text.length;if(ga.head.ch==f9&&ga.head.line0){ge=new X(ge.line,ge.ch+1);f8.replaceRange(f9.charAt(ge.ch-1)+f9.charAt(ge.ch-2),X(ge.line,ge.ch-2),ge,"+transpose")}else{if(ge.line>f8.doc.first){var gd=fb(f8.doc,ge.line-1).text;if(gd){f8.replaceRange(f9.charAt(0)+"\n"+gd.charAt(gd.length-1),X(ge.line-1,gd.length-1),X(ge.line,1),"+transpose")}}}}ga.push(new dU(ge,ge))}f8.setSelections(ga)})},newlineAndIndent:function(f8){cK(f8,function(){var f9=f8.listSelections().length;for(var gb=0;gb=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.posf9},eatSpace:function(){var f8=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>f8},skipToEnd:function(){this.pos=this.string.length},skipTo:function(f8){var f9=this.string.indexOf(f8,this.pos);if(f9>-1){this.pos=f9;return true}},backUp:function(f8){this.pos-=f8},column:function(){if(this.lastColumnPos0){return null}if(ga&&f9!==false){this.pos+=ga[0].length}return ga}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(f9,f8){this.lineStart+=f9;try{return f8()}finally{this.lineStart-=f9}}};var Q=I.TextMarker=function(f9,f8){this.lines=[];this.type=f8;this.doc=f9};bx(Q);Q.prototype.clear=function(){if(this.explicitlyCleared){return}var gf=this.doc.cm,f9=gf&&!gf.curOp;if(f9){cG(gf)}if(fe(this,"clear")){var gg=this.find();if(gg){ad(this,"clear",gg.from,gg.to)}}var ga=null,gd=null;for(var gb=0;gbgf.display.maxLineLength){gf.display.maxLine=f8;gf.display.maxLineLength=gc;gf.display.maxLineChanged=true}}}if(ga!=null&&gf&&this.collapsed){ag(gf,ga,gd+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(gf){et(gf.doc)}}if(gf){ad(gf,"markerCleared",gf,this)}if(f9){al(gf)}if(this.parent){this.parent.clear()}};Q.prototype.find=function(gb,f9){if(gb==null&&this.type=="bookmark"){gb=1}var ge,gd;for(var ga=0;ga0||gh==0&&gb.clearWhenEmpty!==false){return gb}if(gb.replacedWith){gb.collapsed=true;gb.widgetNode=fT("span",[gb.replacedWith],"CodeMirror-widget");if(!gi.handleMouseEvents){gb.widgetNode.setAttribute("cm-ignore-events","true")}if(gi.insertLeft){gb.widgetNode.insertLeft=true}}if(gb.collapsed){if(z(gg,ge.line,ge,gf,gb)||ge.line!=gf.line&&z(gg,gf.line,ge,gf,gb)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}a4=true}if(gb.addToHistory){fJ(gg,{from:ge,to:gf,origin:"markText"},gg.sel,NaN)}var f9=ge.line,gd=gg.cm,f8;gg.iter(f9,gf.line+1,function(gj){if(gd&&gb.collapsed&&!gd.options.lineWrapping&&y(gj)==gd.display.maxLine){f8=true}if(gb.collapsed&&f9!=ge.line){fW(gj,0)}cc(gj,new ee(gb,f9==ge.line?ge.ch:null,f9==gf.line?gf.ch:null));++f9});if(gb.collapsed){gg.iter(ge.line,gf.line+1,function(gj){if(ft(gg,gj)){fW(gj,0)}})}if(gb.clearOnEnter){bW(gb,"beforeCursorEnter",function(){gb.clear()})}if(gb.readOnly){f3=true;if(gg.history.done.length||gg.history.undone.length){gg.clearHistory()}}if(gb.collapsed){gb.id=++a2;gb.atomic=true}if(gd){if(f8){gd.curOp.updateMaxLine=true}if(gb.collapsed){ag(gd,ge.line,gf.line+1)}else{if(gb.className||gb.title||gb.startStyle||gb.endStyle||gb.css){for(var ga=ge.line;ga<=gf.line;ga++){S(gd,ga,"text")}}}if(gb.atomic){et(gd.doc)}ad(gd,"markerAdded",gd,gb)}return gb}var x=I.SharedTextMarker=function(ga,f9){this.markers=ga;this.primary=f9;for(var f8=0;f8=ga:gg.to>ga);(gf||(gf=[])).push(new ee(gd,gg.from,gb?null:gg.to))}}}return gf}function az(f9,gb,ge){if(f9){for(var gc=0,gf;gc=gb:gg.to>gb);if(ga||gg.from==gb&&gd.type=="bookmark"&&(!ge||gg.marker.insertLeft)){var f8=gg.from==null||(gd.inclusiveLeft?gg.from<=gb:gg.from0&&ge){for(var gb=0;gb0){continue}var gh=[gb,1],f8=ce(f9.from,ga.from),gg=ce(f9.to,ga.to);if(f8<0||!gf.inclusiveLeft&&!f8){gh.push({from:f9.from,to:ga.from})}if(gg>0||!gf.inclusiveRight&&!gg){gh.push({from:ga.to,to:f9.to})}gd.splice.apply(gd,gh);gb+=gh.length-1}}return gd}function fZ(f8){var ga=f8.markedSpans;if(!ga){return}for(var f9=0;f9=0&&gd<=0||gh<=0&&gd>=0){continue}if(gh<=0&&(ce(gi.to,ge)>0||(f9.marker.inclusiveRight&&gc.inclusiveLeft))||gh>=0&&(ce(gi.from,gf)<0||(f9.marker.inclusiveLeft&&gc.inclusiveRight))){return true}}}}function y(f9){var f8;while(f8=eK(f9)){f9=f8.find(-1,true).line}return f9}function h(ga){var f8,f9;while(f8=er(ga)){ga=f8.find(1,true).line;(f9||(f9=[])).push(ga)}return f9}function aT(gb,f9){var f8=fb(gb,f9),ga=y(f8);if(f8==ga){return f9}return bM(ga)}function dZ(gb,ga){if(ga>gb.lastLine()){return ga}var f9=fb(gb,ga),f8;if(!ft(gb,f9)){return ga}while(f8=er(f9)){f9=f8.find(1,true).line}return bM(f9)+1}function ft(gc,f9){var f8=a4&&f9.markedSpans;if(f8){for(var gb,ga=0;gagc.start){return ga}}throw new Error("Mode "+gd.name+" failed to advance stream.")}function cq(gh,gf,gc,gb){function f8(gk){return{start:gi.start,end:gi.pos,string:gi.current(),type:ga||null,state:gk?b2(gg.mode,f9):f9}}var gg=gh.doc,gd=gg.mode,ga;gf=fG(gg,gf);var gj=fb(gg,gf.line),f9=dx(gh,gf.line,gc);var gi=new eP(gj.text,gh.options.tabSize),ge;if(gb){ge=[]}while((gb||gi.posgi.options.maxHighlightLength){ga=false;if(gc){dt(gi,gk,f9,gj.pos)}gj.pos=gk.length;f8=null}else{f8=dg(ew(gd,gj,f9,gm),gb)}if(gm){var gl=gm[0].name;if(gl){f8="m-"+(f8?gl+" "+f8:gl)}}if(!ga||gf!=f8){while(gggi){gg.splice(ge,1,gi,gg[ge+1],gj)}ge+=2;ga=Math.min(gi,gj)}if(!gk){return}if(gd.opaque){gg.splice(gm,ge-gm,gi,"cm-overlay "+gk);ge=gm+2}else{for(;gmgb&&gc.from<=gb){break}}if(gc.to>=gd){return f9(gg,gi,ga,ge,gj,gh)}f9(gg,gi.slice(0,gc.to-gb),ga,ge,null,gh);ge=null;gi=gi.slice(gc.to-gb);gb=gc.to}}}function ab(f9,gb,f8,ga){var gc=!ga&&f8.widgetNode;if(gc){f9.map.push(f9.pos,f9.pos+gb,gc);f9.content.appendChild(gc)}f9.pos+=gb}function bn(gh,go,gg){var gd=gh.markedSpans,gf=gh.text,gm=0;if(!gd){for(var gr=1;grgc)){if(gq.to!=null&&gv>gq.to){gv=gq.to;gu=""}if(gn.className){f8+=" "+gn.className}if(gn.css){gi=gn.css}if(gn.startStyle&&gq.from==gc){gl+=" "+gn.startStyle}if(gn.endStyle&&gq.to==gv){gu+=" "+gn.endStyle}if(gn.title&&!gw){gw=gn.title}if(gn.collapsed&&(!ga||dM(ga.marker,gn)<0)){ga=gq}}else{if(gq.from>gc&&gv>gq.from){gv=gq.from}}if(gn.type=="bookmark"&&gq.from==gc&&gn.widgetNode){ge.push(gn)}}if(ga&&(ga.from||0)==gc){ab(go,(ga.to==null?gs+1:ga.to)-gc,ga.marker,ga.from==null);if(ga.to==null){return}}if(!ga&&ge.length){for(var gp=0;gp=gs){break}var gj=Math.min(gs,gv);while(true){if(gk){var f9=gc+gk.length;if(!ga){var gb=f9>gj?gk.slice(0,gj-gc):gk;go.addToken(go,gb,gt?gt+f8:f8,gl,gc+gb.length==gv?gu:"",gw,gi)}if(f9>=gj){gk=gk.slice(gj-gc);gc=gj;break}gc=f9;gl=""}gk=gf.slice(gm,gm=gg[gr++]);gt=eS(gg[gr++],go.cm.options)}}}function dO(f8,f9){return f9.from.ch==0&&f9.to.ch==0&&fE(f9.text)==""&&(!f8.cm||f8.cm.options.wholeLineUpdateBefore)}function fv(gl,gg,f9,gc){function gm(go){return f9?f9[go]:null}function ga(go,gq,gp){ei(go,gq,gp,gc);ad(go,"change",go,gg)}function f8(gr,gp){for(var gq=gr,go=[];gq1){gl.remove(gk.line+1,ge-1)}gl.insert(gk.line+1,gd)}}}}ad(gl,"change",gl,gg)}function eV(f9){this.lines=f9;this.parent=null;for(var ga=0,f8=0;ga1||!(this.children[0] instanceof eV))){var f9=[];this.collapse(f9);this.children=[new eV(f9)];this.children[0].parent=this}},collapse:function(f8){for(var f9=0;f950){while(gf.lines.length>50){var gc=gf.lines.splice(gf.lines.length-25,25);var gb=new eV(gc);gf.height-=gb.height;this.children.splice(gd+1,0,gb);gb.parent=this}this.maybeSpill()}break}f9-=ge}},maybeSpill:function(){if(this.children.length<=10){return}var gb=this;do{var f9=gb.children.splice(gb.children.length-5,5);var ga=new fu(f9);if(!gb.parent){var gc=new fu(gb.children);gc.parent=gb;gb.children=[gc,ga];gb=gc}else{gb.size-=ga.size;gb.height-=ga.height;var f8=df(gb.parent.children,gb);gb.parent.children.splice(f8+1,0,ga)}ga.parent=gb.parent}while(gb.children.length>10);gb.parent.maybeSpill()},iterN:function(f8,ge,gd){for(var f9=0;f9=0;gb--){bd(this,gc[gb])}if(f8){e3(this,f8)}else{if(this.cm){fD(this.cm)}}}),undo:cC(function(){b7(this,"undo")}),redo:cC(function(){b7(this,"redo")}),undoSelection:cC(function(){b7(this,"undo",true)}),redoSelection:cC(function(){b7(this,"redo",true)}),setExtending:function(f8){this.extend=f8},getExtending:function(){return this.extend},historySize:function(){var gb=this.history,f8=0,ga=0;for(var f9=0;f9=gc.ch)){gb.push(ga.marker.parent||ga.marker)}}}return gb},findMarks:function(gc,gb,f8){gc=fG(this,gc);gb=fG(this,gb);var f9=[],ga=gc.line;this.iter(gc.line,gb.line+1,function(gd){var gf=gd.markedSpans;if(gf){for(var ge=0;gegg.to||gg.from==null&&ga!=gc.line||ga==gb.line&&gg.from>gb.ch)&&(!f8||f8(gg.marker))){f9.push(gg.marker.parent||gg.marker)}}}++ga});return f9},getAllMarks:function(){var f8=[];this.iter(function(ga){var f9=ga.markedSpans;if(f9){for(var gb=0;gbf9){f8=f9;return true}f9-=gc;++ga});return fG(this,X(ga,f8))},indexFromPos:function(f9){f9=fG(this,f9);var f8=f9.ch;if(f9.linegb){gb=f8.from}if(f8.to!=null&&f8.to=gb.size){throw new Error("There is no line "+(gd+gb.first)+" in the document.")}for(var f8=gb;!f8.lines;){for(var f9=0;;++f9){var gc=f8.children[f9],ga=gc.chunkSize();if(gd1&&!f9.done[f9.done.length-2].ranges){f9.done.pop();return fE(f9.done)}}}}function fJ(ge,gc,f8,gb){var ga=ge.history;ga.undone.length=0;var f9=+new Date,gf;if((ga.lastOp==gb||ga.lastOrigin==gc.origin&&gc.origin&&((gc.origin.charAt(0)=="+"&&ge.cm&&ga.lastModTime>f9-ge.cm.options.historyEventDelay)||gc.origin.charAt(0)=="*"))&&(gf=eI(ga,ga.lastOp==gb))){var gg=fE(gf.changes);if(ce(gc.from,gc.to)==0&&ce(gc.from,gg.to)==0){gg.to=cV(gc)}else{gf.changes.push(dr(ge,gc))}}else{var gd=fE(ga.done);if(!gd||!gd.ranges){cL(ge.sel,ga.done)}gf={changes:[dr(ge,gc)],generation:ga.generation};ga.done.push(gf);while(ga.done.length>ga.undoDepth){ga.done.shift();if(!ga.done[0].ranges){ga.done.shift()}}}ga.done.push(f8);ga.generation=++ga.maxGeneration;ga.lastModTime=ga.lastSelTime=f9;ga.lastOp=ga.lastSelOp=gb;ga.lastOrigin=ga.lastSelOrigin=gc.origin;if(!gg){aC(ge,"historyAdded")}}function bz(gc,f8,ga,gb){var f9=f8.charAt(0);return f9=="*"||f9=="+"&&ga.ranges.length==gb.ranges.length&&ga.somethingSelected()==gb.somethingSelected()&&new Date-gc.history.lastSelTime<=(gc.cm?gc.cm.options.historyEventDelay:500)}function f2(gd,gb,f8,ga){var gc=gd.history,f9=ga&&ga.origin;if(f8==gc.lastSelOp||(f9&&gc.lastSelOrigin==f9&&(gc.lastModTime==gc.lastSelTime&&gc.lastOrigin==f9||bz(gd,f9,fE(gc.done),gb)))){gc.done[gc.done.length-1]=gb}else{cL(gb,gc.done)}gc.lastSelTime=+new Date;gc.lastSelOrigin=f9;gc.lastSelOp=f8;if(ga&&ga.clearRedo!==false){fy(gc.undone)}}function cL(f9,f8){var ga=fE(f8);if(!(ga&&ga.ranges&&ga.equals(f9))){f8.push(f9)}}function bX(f9,gd,gc,gb){var f8=gd["spans_"+f9.id],ga=0;f9.iter(Math.max(f9.first,gc),Math.min(f9.first+f9.size,gb),function(ge){if(ge.markedSpans){(f8||(f8=gd["spans_"+f9.id]={}))[ga]=ge.markedSpans}++ga})}function bi(ga){if(!ga){return null}for(var f9=0,f8;f9-1){fE(gh)[f8]=gf[f8];delete gf[f8]}}}}}}return f9}function J(gb,ga,f9,f8){if(f90}function bx(f8){f8.prototype.on=function(f9,ga){bW(this,f9,ga)};f8.prototype.off=function(f9,ga){d9(this,f9,ga)}}var dF=30;var b9=I.Pass={toString:function(){return"CodeMirror.Pass"}};var Z={scroll:false},N={origin:"*mouse"},cU={origin:"+move"};function f7(){this.id=null}f7.prototype.set=function(f8,f9){clearTimeout(this.id);this.id=setTimeout(f9,f8)};var bS=I.countColumn=function(gb,f9,gd,ge,ga){if(f9==null){f9=gb.search(/[^\s\u00a0]/);if(f9==-1){f9=gb.length}}for(var gc=ge||0,gf=ga||0;;){var f8=gb.indexOf("\t",gc);if(f8<0||f8>=f9){return gf+(f9-gc)}gf+=f8-gc;gf+=gd-(gf%gd);gc=f8+1}};function em(gc,gb,gd){for(var ge=0,ga=0;;){var f9=gc.indexOf("\t",ge);if(f9==-1){f9=gc.length}var f8=f9-ge;if(f9==gc.length||ga+f8>=gb){return ge+Math.min(f8,gb-ga)}ga+=f9-ge;ga+=gd-(ga%gd);ge=f9+1;if(ga>=gb){return ge}}}var aW=[""];function cp(f8){while(aW.length<=f8){aW.push(fE(aW)+" ")}return aW[f8]}function fE(f8){return f8[f8.length-1]}var dH=function(f8){f8.select()};if(eX){dH=function(f8){f8.selectionStart=0;f8.selectionEnd=f8.value.length}}else{if(dG){dH=function(f9){try{f9.select()}catch(f8){}}}}function df(ga,f8){for(var f9=0;f9"\x80"&&(f8.toUpperCase()!=f8.toLowerCase()||a9.test(f8))};function cz(f8,f9){if(!f9){return fA(f8)}if(f9.source.indexOf("\\w")>-1&&fA(f8)){return true}return f9.test(f8)}function eQ(f8){for(var f9 in f8){if(f8.hasOwnProperty(f9)&&f8[f9]){return false}}return true}var eF=/[\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]/;function fm(f8){return f8.charCodeAt(0)>=768&&eF.test(f8)}function fT(f8,gc,gb,ga){var gd=document.createElement(f8);if(gb){gd.className=gb}if(ga){gd.style.cssText=ga}if(typeof gc=="string"){gd.appendChild(document.createTextNode(gc))}else{if(gc){for(var f9=0;f90;--f8){f9.removeChild(f9.firstChild)}return f9}function bQ(f8,f9){return dX(f8).appendChild(f9)}function f1(f8,f9){if(f8.contains){return f8.contains(f9)}while(f9=f9.parentNode){if(f9==f8){return true}}}function dK(){return document.activeElement}if(dG&&k<11){dK=function(){try{return document.activeElement}catch(f8){return document.body}}}function T(f8){return new RegExp("(^|\\s)"+f8+"(?:$|\\s)\\s*")}var f=I.rmClass=function(ga,f8){var gb=ga.className;var f9=T(f8).exec(gb);if(f9){var gc=gb.slice(f9.index+f9[0].length);ga.className=gb.slice(0,f9.index)+(gc?f9[1]+gc:"")}};var fx=I.addClass=function(f9,f8){var ga=f9.className;if(!T(f8).test(ga)){f9.className+=(ga?" ":"")+f8}};function fO(ga,f8){var f9=ga.split(" ");for(var gb=0;gb2&&!(dG&&k<8)}}if(fI){return fT("span","\u200b")}else{return fT("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}}var fH;function bN(gb){if(fH!=null){return fH}var f8=bQ(gb,document.createTextNode("A\u062eA"));var ga=cl(f8,0,1).getBoundingClientRect();if(!ga||ga.left==ga.right){return false}var f9=cl(f8,1,2).getBoundingClientRect();return fH=(f9.right-ga.right<3)}var aX=I.splitLines="\n\nb".split(/\n/).length!=3?function(gd){var ge=0,f8=[],gc=gd.length;while(ge<=gc){var gb=gd.indexOf("\n",ge);if(gb==-1){gb=gd.length}var ga=gd.slice(ge,gd.charAt(gb-1)=="\r"?gb-1:gb);var f9=ga.indexOf("\r");if(f9!=-1){f8.push(ga.slice(0,f9));ge+=f9+1}else{f8.push(ga);ge=gb+1}}return f8}:function(f8){return f8.split(/\r\n?|\n/)};var br=window.getSelection?function(f9){try{return f9.selectionStart!=f9.selectionEnd}catch(f8){return false}}:function(ga){try{var f8=ga.ownerDocument.selection.createRange()}catch(f9){}if(!f8||f8.parentElement()!=ga){return false}return f8.compareEndPoints("StartToEnd",f8)!=0};var c8=(function(){var f8=fT("div");if("oncopy" in f8){return true}f8.setAttribute("oncopy","return;");return typeof f8.oncopy=="function"})();var e2=null;function aI(f9){if(e2!=null){return e2}var ga=bQ(f9,fT("span","x"));var gb=ga.getBoundingClientRect();var f8=cl(ga,0,1).getBoundingClientRect();return e2=Math.abs(gb.left-f8.left)>1}var fc={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};I.keyNames=fc;(function(){for(var f8=0;f8<10;f8++){fc[f8+48]=fc[f8+96]=String(f8)}for(var f8=65;f8<=90;f8++){fc[f8]=String.fromCharCode(f8)}for(var f8=1;f8<=12;f8++){fc[f8+111]=fc[f8+63235]="F"+f8}})();function d0(f8,ge,gd,gc){if(!f8){return gc(ge,gd,"ltr")}var gb=false;for(var ga=0;gage||ge==gd&&f9.to==ge){gc(Math.max(f9.from,ge),Math.min(f9.to,gd),f9.level==1?"rtl":"ltr");gb=true}}if(!gb){gc(ge,gd,"ltr")}}function du(f8){return f8.level%2?f8.to:f8.from}function f4(f8){return f8.level%2?f8.from:f8.to}function cD(f9){var f8=a(f9);return f8?du(f8[0]):0}function cQ(f9){var f8=a(f9);if(!f8){return f9.text.length}return f4(fE(f8))}function bs(f9,gc){var ga=fb(f9.doc,gc);var gd=y(ga);if(gd!=ga){gc=bM(gd)}var f8=a(gd);var gb=!f8?0:f8[0].level%2?cQ(gd):cD(gd);return X(gc,gb)}function dL(ga,gd){var f9,gb=fb(ga.doc,gd);while(f9=er(gb)){gb=f9.find(1,true).line;gd=null}var f8=a(gb);var gc=!f8?gb.text.length:f8[0].level%2?cD(gb):cQ(gb);return X(gd==null?bM(gb):gd,gc)}function dE(f9,ge){var gd=bs(f9,ge.line);var ga=fb(f9.doc,gd.line);var f8=a(ga);if(!f8||f8[0].level==0){var gc=Math.max(0,ga.text.search(/\S/));var gb=ge.line==gd.line&&ge.ch<=gc&&ge.ch;return X(gd.line,gb?0:gc)}return gd}function am(f9,ga,f8){var gb=f9[0].level;if(ga==gb){return true}if(f8==gb){return false}return gagc){return f9}if((gb.from==gc||gb.to==gc)){if(ga==null){ga=f9}else{if(am(f8,gb.level,f8[ga].level)){if(gb.from!=gb.to){eY=ga}return f9}else{if(gb.from!=gb.to){eY=f9}return ga}}}}return ga}function fa(f8,gb,f9,ga){if(!ga){return gb+f9}do{gb+=f9}while(gb>0&&fm(f8.text.charAt(gb)));return gb}function u(f8,gf,ga,gb){var gc=a(f8);if(!gc){return ah(f8,gf,ga,gb)}var ge=aE(gc,gf),f9=gc[ge];var gd=fa(f8,gf,f9.level%2?-ga:ga,gb);for(;;){if(gd>f9.from&&gd0)==f9.level%2?f9.to:f9.from}else{f9=gc[ge+=ga];if(!f9){return null}if((ga>0)==f9.level%2){gd=fa(f8,f9.to,-1,gb)}else{gd=fa(f8,f9.from,1,gb)}}}}function ah(f8,gc,f9,ga){var gb=gc+f9;if(ga){while(gb>0&&fm(f8.text.charAt(gb))){gb+=f9}}return gb<0||gb>f8.text.length?null:gb}var be=(function(){var ge="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var gc="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm";function gb(gi){if(gi<=247){return ge.charAt(gi)}else{if(1424<=gi&&gi<=1524){return"R"}else{if(1536<=gi&&gi<=1773){return gc.charAt(gi-1536)}else{if(1774<=gi&&gi<=2220){return"r"}else{if(8192<=gi&&gi<=8203){return"w"}else{if(gi==8204){return"b"}else{return"L"}}}}}}}var f8=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var gh=/[stwN]/,ga=/[LRr]/,f9=/[Lb1n]/,gd=/[1n]/;var gg="L";function gf(gk,gj,gi){this.level=gk;this.from=gj;this.to=gi}return function(gs){if(!f8.test(gs)){return false}var gy=gs.length,go=[];for(var gx=0,gk;gx= 15) { presto = false; webkit = true; } + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || (ie && ie_version >= 9); + + // Optimize some code when these features are not used. + var sawReadOnlySpans = false, sawCollapsedSpans = false; + + // EDITOR CONSTRUCTOR + + // A CodeMirror instance represents an editor. This is the object + // that user code is usually dealing with. + + function CodeMirror(place, options) { + if (!(this instanceof CodeMirror)) return new CodeMirror(place, options); + + this.options = options = options ? copyObj(options) : {}; + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false); + setGuttersForLineNumbers(options); + + var doc = options.value; + if (typeof doc == "string") doc = new Doc(doc, options.mode); + this.doc = doc; + + var input = new CodeMirror.inputStyles[options.inputStyle](this); + var display = this.display = new Display(place, doc, input); + display.wrapper.CodeMirror = this; + updateGutters(this); + themeChanged(this); + if (options.lineWrapping) + this.display.wrapper.className += " CodeMirror-wrap"; + if (options.autofocus && !mobile) display.input.focus(); + initScrollbars(this); + + this.state = { + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll + draggingText: false, + highlight: new Delayed(), // stores highlight worker timeout + keySeq: null // Unfinished key sequence + }; + + var cm = this; + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) setTimeout(function() { cm.display.input.reset(true); }, 20); + + registerEventHandlers(this); + ensureGlobalHandlers(); + + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); + + if ((options.autofocus && !mobile) || cm.hasFocus()) + setTimeout(bind(onFocus, this), 20); + else + onBlur(this); + + for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt)) + optionHandlers[opt](this, options[opt], Init); + maybeUpdateLineNumberWidth(this); + if (options.finishInit) options.finishInit(this); + for (var i = 0; i < initHooks.length; ++i) initHooks[i](this); + endOperation(this); + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && + getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") + display.lineDiv.style.textRendering = "auto"; + } + + // DISPLAY CONSTRUCTOR + + // The display handles the DOM integration, both for input reading + // and content drawing. It holds references to DOM nodes and + // display-related state. + + function Display(place, doc, input) { + var d = this; + this.input = input; + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + d.scrollbarFiller.setAttribute("cm-not-content", "true"); + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); + d.gutterFiller.setAttribute("cm-not-content", "true"); + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = elt("div", null, "CodeMirror-code"); + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure"); + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], + null, "position: relative; outline: none"); + // Moved around its parent to cover visible view. + d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative"); + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + d.sizerWidth = null; + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (!webkit && !(gecko && mobile)) d.scroller.draggable = true; + + if (place) { + if (place.appendChild) place.appendChild(d.wrapper); + else place(d.wrapper); + } + + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first; + d.reportedViewFrom = d.reportedViewTo = doc.first; + // Information about the rendered lines. + d.view = []; + d.renderedView = null; + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null; + // Empty space (in pixels) above the view + d.viewOffset = 0; + d.lastWrapHeight = d.lastWrapWidth = 0; + d.updateLineNumbers = null; + + d.nativeBarWidth = d.barHeight = d.barWidth = 0; + d.scrollbarsClipped = false; + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false; + + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + + // True when shift is held down. + d.shift = false; + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; + + d.activeTouch = null; + + input.init(d); + } + + // STATE UPDATES + + // Used to get the editor into a consistent state again when options change. + + function loadMode(cm) { + cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption); + resetModeState(cm); + } + + function resetModeState(cm) { + cm.doc.iter(function(line) { + if (line.stateAfter) line.stateAfter = null; + if (line.styles) line.styles = null; + }); + cm.doc.frontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) regChange(cm); + } + + function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap"); + cm.display.sizer.style.minWidth = ""; + cm.display.sizerWidth = null; + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap"); + findMaxLine(cm); + } + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function(){updateScrollbars(cm);}, 100); + } + + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). + function estimateHeight(cm) { + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function(line) { + if (lineIsHidden(cm.doc, line)) return 0; + + var widgetsHeight = 0; + if (line.widgets) for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) widgetsHeight += line.widgets[i].height; + } + + if (wrapping) + return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th; + else + return widgetsHeight + th; + }; + } + + function estimateLineHeights(cm) { + var doc = cm.doc, est = estimateHeight(cm); + doc.iter(function(line) { + var estHeight = est(line); + if (estHeight != line.height) updateLineHeight(line, estHeight); + }); + } + + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } + + function guttersChanged(cm) { + updateGutters(cm); + regChange(cm); + setTimeout(function(){alignHorizontally(cm);}, 20); + } + + // Rebuild the gutter elements, ensure the margin to the left of the + // code matches their width. + function updateGutters(cm) { + var gutters = cm.display.gutters, specs = cm.options.gutters; + removeChildren(gutters); + for (var i = 0; i < specs.length; ++i) { + var gutterClass = specs[i]; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)); + if (gutterClass == "CodeMirror-linenumbers") { + cm.display.lineGutter = gElt; + gElt.style.width = (cm.display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = i ? "" : "none"; + updateGutterSpace(cm); + } + + function updateGutterSpace(cm) { + var width = cm.display.gutters.offsetWidth; + cm.display.sizer.style.marginLeft = width + "px"; + } + + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. + function lineLength(line) { + if (line.height == 0) return 0; + var len = line.text.length, merged, cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found = merged.find(0, true); + len -= cur.text.length - found.from.ch; + cur = found.to.line; + len += cur.text.length - found.to.ch; + } + return len; + } + + // Find the longest line in the document. + function findMaxLine(cm) { + var d = cm.display, doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; + doc.iter(function(line) { + var len = lineLength(line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); + } + + // Make sure the gutters options contains the element + // "CodeMirror-linenumbers" when the lineNumbers option is true. + function setGuttersForLineNumbers(options) { + var found = indexOf(options.gutters, "CodeMirror-linenumbers"); + if (found == -1 && options.lineNumbers) { + options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]); + } else if (found > -1 && !options.lineNumbers) { + options.gutters = options.gutters.slice(0); + options.gutters.splice(found, 1); + } + } + + // SCROLLBARS + + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. + function measureForScrollbars(cm) { + var d = cm.display, gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + }; + } + + function NativeScrollbars(place, scroll, cm) { + this.cm = cm; + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + place(vert); place(horiz); + + on(vert, "scroll", function() { + if (vert.clientHeight) scroll(vert.scrollTop, "vertical"); + }); + on(horiz, "scroll", function() { + if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal"); + }); + + this.checkedOverlay = false; + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; + } + + NativeScrollbars.prototype = copyObj({ + update: function(measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + var sWidth = measure.nativeBarWidth; + + if (needsV) { + this.vert.style.display = "block"; + this.vert.style.bottom = needsH ? sWidth + "px" : "0"; + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = + Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; + } else { + this.vert.style.display = ""; + this.vert.firstChild.style.height = "0"; + } + + if (needsH) { + this.horiz.style.display = "block"; + this.horiz.style.right = needsV ? sWidth + "px" : "0"; + this.horiz.style.left = measure.barLeft + "px"; + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); + this.horiz.firstChild.style.width = + (measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; + } else { + this.horiz.style.display = ""; + this.horiz.firstChild.style.width = "0"; + } + + if (!this.checkedOverlay && measure.clientHeight > 0) { + if (sWidth == 0) this.overlayHack(); + this.checkedOverlay = true; + } + + return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}; + }, + setScrollLeft: function(pos) { + if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos; + }, + setScrollTop: function(pos) { + if (this.vert.scrollTop != pos) this.vert.scrollTop = pos; + }, + overlayHack: function() { + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + this.horiz.style.minHeight = this.vert.style.minWidth = w; + var self = this; + var barMouseDown = function(e) { + if (e_target(e) != self.vert && e_target(e) != self.horiz) + operation(self.cm, onMouseDown)(e); + }; + on(this.vert, "mousedown", barMouseDown); + on(this.horiz, "mousedown", barMouseDown); + }, + clear: function() { + var parent = this.horiz.parentNode; + parent.removeChild(this.horiz); + parent.removeChild(this.vert); + } + }, NativeScrollbars.prototype); + + function NullScrollbars() {} + + NullScrollbars.prototype = copyObj({ + update: function() { return {bottom: 0, right: 0}; }, + setScrollLeft: function() {}, + setScrollTop: function() {}, + clear: function() {} + }, NullScrollbars.prototype); + + CodeMirror.scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; + + function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear(); + if (cm.display.scrollbars.addClass) + rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } + + cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function() { + if (cm.state.focused) setTimeout(function() { cm.display.input.focus(); }, 0); + }); + node.setAttribute("cm-not-content", "true"); + }, function(pos, axis) { + if (axis == "horizontal") setScrollLeft(cm, pos); + else setScrollTop(cm, pos); + }, cm); + if (cm.display.scrollbars.addClass) + addClass(cm.display.wrapper, cm.display.scrollbars.addClass); + } + + function updateScrollbars(cm, measure) { + if (!measure) measure = measureForScrollbars(cm); + var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; + updateScrollbarsInner(cm, measure); + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) + updateHeightsInViewport(cm); + updateScrollbarsInner(cm, measureForScrollbars(cm)); + startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; + } + } + + // Re-synchronize the fake scrollbars with the actual size of the + // content. + function updateScrollbarsInner(cm, measure) { + var d = cm.display; + var sizes = d.scrollbars.update(measure); + + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; + + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = sizes.bottom + "px"; + d.scrollbarFiller.style.width = sizes.right + "px"; + } else d.scrollbarFiller.style.display = ""; + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block"; + d.gutterFiller.style.height = sizes.bottom + "px"; + d.gutterFiller.style.width = measure.gutterWidth + "px"; + } else d.gutterFiller.style.display = ""; + } + + // Compute the lines that are visible in a given viewport (defaults + // the the current scroll position). viewport may contain top, + // height, and ensure (see op.scrollToPos) properties. + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; + + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; + if (ensureFrom < from) { + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; + } + } + return {from: from, to: Math.max(to, from + 1)}; + } + + // LINE NUMBERS + + // Re-align line numbers and gutter marks to compensate for + // horizontal scrolling. + function alignHorizontally(cm) { + var display = cm.display, view = display.view; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return; + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, left = comp + "px"; + for (var i = 0; i < view.length; i++) if (!view[i].hidden) { + if (cm.options.fixedGutter && view[i].gutter) + view[i].gutter.style.left = left; + var align = view[i].alignable; + if (align) for (var j = 0; j < align.length; j++) + align[j].style.left = left; + } + if (cm.options.fixedGutter) + display.gutters.style.left = (comp + gutterW) + "px"; + } + + // Used to ensure that the line number gutter is still the right + // size for the current document size. Returns true when an update + // is needed. + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) return false; + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding); + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + updateGutterSpace(cm); + return true; + } + return false; + } + + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)); + } + + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left; + } + + // DISPLAY DRAWING + + function DisplayUpdate(cm, viewport, force) { + var display = cm.display; + + this.viewport = viewport; + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.wrapperWidth = display.wrapper.clientWidth; + this.oldDisplayWidth = displayWidth(cm); + this.force = force; + this.dims = getDimensions(cm); + this.events = []; + } + + DisplayUpdate.prototype.signal = function(emitter, type) { + if (hasHandler(emitter, type)) + this.events.push(arguments); + }; + DisplayUpdate.prototype.finish = function() { + for (var i = 0; i < this.events.length; i++) + signal.apply(null, this.events[i]); + }; + + function maybeClipScrollbars(cm) { + var display = cm.display; + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; + display.heightForcer.style.height = scrollGap(cm) + "px"; + display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; + display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; + display.scrollbarsClipped = true; + } + } + + // Does the actual updating of the line display. Bails out + // (returning false) when there is nothing to be done and forced is + // false. + function updateDisplayIfNeeded(cm, update) { + var display = cm.display, doc = cm.doc; + + if (update.editorIsHidden) { + resetView(cm); + return false; + } + + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && + update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && + display.renderedView == display.view && countDirtyView(cm) == 0) + return false; + + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm); + update.dims = getDimensions(cm); + } + + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size; + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); + if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom); + if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo); + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); + } + + var different = from != display.viewFrom || to != display.viewTo || + display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; + adjustView(cm, from, to); + + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px"; + + var toUpdate = countDirtyView(cm); + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) + return false; + + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var focused = activeElt(); + if (toUpdate > 4) display.lineDiv.style.display = "none"; + patchDisplay(cm, display.updateLineNumbers, update.dims); + if (toUpdate > 4) display.lineDiv.style.display = ""; + display.renderedView = display.view; + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + if (focused && activeElt() != focused && focused.offsetHeight) focused.focus(); + + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); + display.gutters.style.height = 0; + + if (different) { + display.lastWrapHeight = update.wrapperHeight; + display.lastWrapWidth = update.wrapperWidth; + startWorker(cm, 400); + } + + display.updateLineNumbers = null; + + return true; + } + + function postUpdateDisplay(cm, update) { + var force = update.force, viewport = update.viewport; + for (var first = true;; first = false) { + if (first && cm.options.lineWrapping && update.oldDisplayWidth != displayWidth(cm)) { + force = true; + } else { + force = false; + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport); + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) + break; + } + if (!updateDisplayIfNeeded(cm, update)) break; + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + setDocumentHeight(cm, barMeasure); + updateScrollbars(cm, barMeasure); + } + + update.signal(cm, "update", cm); + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; + } + } + + function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport); + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + setDocumentHeight(cm, barMeasure); + updateScrollbars(cm, barMeasure); + update.finish(); + } + } + + function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px"; + var total = measure.docHeight + cm.display.barHeight; + cm.display.heightForcer.style.top = total + "px"; + cm.display.gutters.style.height = Math.max(total + scrollGap(cm), measure.clientHeight) + "px"; + } + + // Read the actual heights of the rendered lines, and update their + // stored heights to match. + function updateHeightsInViewport(cm) { + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], height; + if (cur.hidden) continue; + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + } + var diff = cur.line.height - height; + if (height < 2) height = textHeight(display); + if (diff > .001 || diff < -.001) { + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) for (var j = 0; j < cur.rest.length; j++) + updateWidgetHeight(cur.rest[j]); + } + } + } + + // Read and store the height of line widgets associated with the + // given line. + function updateWidgetHeight(line) { + if (line.widgets) for (var i = 0; i < line.widgets.length; ++i) + line.widgets[i].height = line.widgets[i].node.offsetHeight; + } + + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. + function getDimensions(cm) { + var d = cm.display, left = {}, width = {}; + var gutterLeft = d.gutters.clientLeft; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft; + width[cm.options.gutters[i]] = n.clientWidth; + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth}; + } + + // Sync the actual display DOM structure with display.view, removing + // nodes for lines that are no longer in view, and creating the ones + // that are not there yet, and updating the ones that are out of + // date. + function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, lineNumbers = cm.options.lineNumbers; + var container = display.lineDiv, cur = container.firstChild; + + function rm(node) { + var next = node.nextSibling; + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) + node.style.display = "none"; + else + node.parentNode.removeChild(node); + return next; + } + + var view = display.view, lineN = display.viewFrom; + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (lineView.hidden) { + } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); + } else { // Already drawn + while (cur != lineView.node) cur = rm(cur); + var updateNumber = lineNumbers && updateNumbersFrom != null && + updateNumbersFrom <= lineN && lineView.lineNumber; + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false; + updateLineForChanges(cm, lineView, lineN, dims); + } + if (updateNumber) { + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); + } + cur = lineView.node.nextSibling; + } + lineN += lineView.size; + } + while (cur) cur = rm(cur); + } + + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") updateLineText(cm, lineView); + else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims); + else if (type == "class") updateLineClasses(lineView); + else if (type == "widget") updateLineWidgets(cm, lineView, dims); + } + lineView.changes = null; + } + + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) + lineView.text.parentNode.replaceChild(lineView.node, lineView.text); + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) lineView.node.style.zIndex = 2; + } + return lineView.node; + } + + function updateLineBackground(lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) cls += " CodeMirror-linebackground"; + if (lineView.background) { + if (cls) lineView.background.className = cls; + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + } + } + + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built; + } + return buildLineContent(cm, lineView); + } + + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) lineView.node = built.pre; + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(lineView); + } else if (cls) { + lineView.text.className = cls; + } + } + + function updateLineClasses(lineView) { + updateLineBackground(lineView); + if (lineView.line.wrapClass) + ensureLineWrapped(lineView).className = lineView.line.wrapClass; + else if (lineView.node != lineView.text) + lineView.node.className = ""; + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } + + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; + } + var markers = lineView.line.gutterMarkers; + if (cm.options.lineNumbers || markers) { + var wrap = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " + + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + + "px; width: " + dims.gutterTotalWidth + "px"); + cm.display.input.setUneditable(gutterWrap); + wrap.insertBefore(gutterWrap, lineView.text); + if (lineView.line.gutterClass) + gutterWrap.className += " " + lineView.line.gutterClass; + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + lineView.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineN), + "CodeMirror-linenumber CodeMirror-gutter-elt", + "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: " + + cm.display.lineNumInnerWidth + "px")); + if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]; + if (found) + gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " + + dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px")); + } + } + } + + function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) lineView.alignable = null; + for (var node = lineView.node.firstChild, next; node; node = next) { + var next = node.nextSibling; + if (node.className == "CodeMirror-linewidget") + lineView.node.removeChild(node); + } + insertLineWidgets(cm, lineView, dims); + } + + // Build a line's DOM representation from scratch + function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) lineView.bgClass = built.bgClass; + if (built.textClass) lineView.textClass = built.textClass; + + updateLineClasses(lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(cm, lineView, dims); + return lineView.node; + } + + // A lineView may contain multiple logical lines (when merged by + // collapsed spans). The widgets for all of them need to be drawn. + function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); + if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) + insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); + } + + function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) return; + var wrap = ensureLineWrapped(lineView); + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); + if (!widget.handleMouseEvents) node.setAttribute("cm-ignore-events", "true"); + positionLineWidget(widget, node, lineView, dims); + cm.display.input.setUneditable(node); + if (allowAbove && widget.above) + wrap.insertBefore(node, lineView.gutter || lineView.text); + else + wrap.appendChild(node); + signalLater(widget, "redraw"); + } + } + + function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + (lineView.alignable || (lineView.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px"; + } + } + + // POSITION OBJECT + + // A Pos instance represents a position within the text. + var Pos = CodeMirror.Pos = function(line, ch) { + if (!(this instanceof Pos)) return new Pos(line, ch); + this.line = line; this.ch = ch; + }; + + // Compare two positions, return 0 if they are the same, a negative + // number when a is less, and a positive number otherwise. + var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; }; + + function copyPos(x) {return Pos(x.line, x.ch);} + function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; } + function minPos(a, b) { return cmp(a, b) < 0 ? a : b; } + + // INPUT HANDLING + + function ensureFocus(cm) { + if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); } + } + + function isReadOnly(cm) { + return cm.options.readOnly || cm.doc.cantEdit; + } + + // This will be set to an array of strings when copying, so that, + // when pasting, we know what kind of selections the copied text + // was made out of. + var lastCopied = null; + + function applyTextInput(cm, inserted, deleted, sel) { + var doc = cm.doc; + cm.display.shift = false; + if (!sel) sel = doc.sel; + + var textLines = splitLines(inserted), multiPaste = null; + // When pasing N lines into N selections, insert one line per selection + if (cm.state.pasteIncoming && sel.ranges.length > 1) { + if (lastCopied && lastCopied.join("\n") == inserted) + multiPaste = sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines); + else if (textLines.length == sel.ranges.length) + multiPaste = map(textLines, function(l) { return [l]; }); + } + + // Normal behavior is to insert the new text into every selection + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i]; + var from = range.from(), to = range.to(); + if (range.empty()) { + if (deleted && deleted > 0) // Handle deletion + from = Pos(from.line, from.ch - deleted); + else if (cm.state.overwrite && !cm.state.pasteIncoming) // Handle overwrite + to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); + } + var updateInput = cm.curOp.updateInput; + var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, + origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"}; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); + // When an 'electric' character is inserted, immediately trigger a reindent + if (inserted && !cm.state.pasteIncoming && cm.options.electricChars && + cm.options.smartIndent && range.head.ch < 100 && + (!i || sel.ranges[i - 1].head.line != range.head.line)) { + var mode = cm.getModeAt(range.head); + var end = changeEnd(changeEvent); + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) + if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indentLine(cm, end.line, "smart"); + break; + } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch))) + indentLine(cm, end.line, "smart"); + } + } + } + ensureCursorVisible(cm); + cm.curOp.updateInput = updateInput; + cm.curOp.typing = true; + cm.state.pasteIncoming = cm.state.cutIncoming = false; + } + + function copyableRanges(cm) { + var text = [], ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; + ranges.push(lineRange); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); + } + return {text: text, ranges: ranges}; + } + + function disableBrowserMagic(field) { + field.setAttribute("autocorrect", "off"); + field.setAttribute("autocapitalize", "off"); + field.setAttribute("spellcheck", "false"); + } + + // TEXTAREA INPUT STYLE + + function TextareaInput(cm) { + this.cm = cm; + // See input.poll and input.reset + this.prevInput = ""; + + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false; + // Self-resetting timeout for the poller + this.polling = new Delayed(); + // Tracks when input.reset has punted to just putting a short + // string into the textarea instead of the full selection. + this.inaccurateSelection = false; + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false; + }; + + function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none"); + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) te.style.width = "1000px"; + else te.setAttribute("wrap", "off"); + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) te.style.border = "1px solid black"; + disableBrowserMagic(te); + return div; + } + + TextareaInput.prototype = copyObj({ + init: function(display) { + var input = this, cm = this.cm; + + // 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); + + // 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"; + + on(te, "input", function() { + if (ie && ie_version >= 9 && input.hasSelection) input.hasSelection = null; + input.poll(); + }); + + on(te, "paste", function() { + // Workaround for webkit bug https://bugs.webkit.org/show_bug.cgi?id=90206 + // Add a char to the end of textarea before paste occur so that + // selection doesn't span to the end of textarea. + if (webkit && !cm.state.fakedLastChar && !(new Date - cm.state.lastMiddleDown < 200)) { + var start = te.selectionStart, end = te.selectionEnd; + te.value += "$"; + // The selection end needs to be set before the start, otherwise there + // can be an intermediate non-empty selection between the two, which + // can override the middle-click paste buffer on linux and cause the + // wrong thing to get pasted. + te.selectionEnd = end; + te.selectionStart = start; + cm.state.fakedLastChar = true; + } + cm.state.pasteIncoming = true; + input.fastPoll(); + }); + + function prepareCopyCut(e) { + if (cm.somethingSelected()) { + lastCopied = cm.getSelections(); + if (input.inaccurateSelection) { + input.prevInput = ""; + input.inaccurateSelection = false; + te.value = lastCopied.join("\n"); + selectInput(te); + } + } else { + var ranges = copyableRanges(cm); + lastCopied = ranges.text; + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll); + } else { + input.prevInput = ""; + te.value = ranges.text.join("\n"); + selectInput(te); + } + } + if (e.type == "cut") cm.state.cutIncoming = true; + } + on(te, "cut", prepareCopyCut); + on(te, "copy", prepareCopyCut); + + on(display.scroller, "paste", function(e) { + if (eventInWidget(display, e)) return; + cm.state.pasteIncoming = true; + input.focus(); + }); + + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function(e) { + if (!eventInWidget(display, e)) e_preventDefault(e); + }); + }, + + prepareSelection: function() { + // Redraw the selection and/or cursor + var cm = this.cm, display = cm.display, doc = cm.doc; + var result = prepareSelection(cm); + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)); + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)); + } + + return result; + }, + + showSelection: function(drawn) { + var cm = this.cm, display = cm.display; + removeChildrenAndAdd(display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(display.selectionDiv, drawn.selection); + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px"; + this.wrapper.style.left = drawn.teLeft + "px"; + } + }, + + // Reset the input to correspond to the selection (or to be empty, + // when not typing and nothing is selected) + reset: function(typing) { + if (this.contextMenuPending) return; + var minimal, selected, cm = this.cm, doc = cm.doc; + if (cm.somethingSelected()) { + this.prevInput = ""; + var range = doc.sel.primary(); + minimal = hasCopyEvent && + (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000); + var content = minimal ? "-" : selected || cm.getSelection(); + this.textarea.value = content; + if (cm.state.focused) selectInput(this.textarea); + if (ie && ie_version >= 9) this.hasSelection = content; + } else if (!typing) { + this.prevInput = this.textarea.value = ""; + if (ie && ie_version >= 9) this.hasSelection = null; + } + this.inaccurateSelection = minimal; + }, + + getField: function() { return this.textarea; }, + + supportsTouch: function() { return false; }, + + focus: function() { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { + try { this.textarea.focus(); } + catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } + }, + + blur: function() { this.textarea.blur(); }, + + resetPosition: function() { + this.wrapper.style.top = this.wrapper.style.left = 0; + }, + + receivedFocus: function() { this.slowPoll(); }, + + // Poll for input changes, using the normal rate of polling. This + // runs as long as the editor is focused. + slowPoll: function() { + var input = this; + if (input.pollingFast) return; + input.polling.set(this.cm.options.pollInterval, function() { + input.poll(); + if (input.cm.state.focused) input.slowPoll(); + }); + }, + + // When an event has just come in that is likely to add or change + // something in the input textarea, we poll faster, to ensure that + // the change appears on the screen quickly. + fastPoll: function() { + var missed = false, input = this; + input.pollingFast = true; + function p() { + var changed = input.poll(); + if (!changed && !missed) {missed = true; input.polling.set(60, p);} + else {input.pollingFast = false; input.slowPoll();} + } + input.polling.set(20, p); + }, + + // Read input from the textarea, and update the document to match. + // When something is selected, it is present in the textarea, and + // selected (unless it is huge, in which case a placeholder is + // used). When nothing is selected, the cursor sits after previously + // seen text (can be empty), which is stored in prevInput (we must + // not reset the textarea when typing, because that breaks IME). + poll: function() { + var cm = this.cm, input = this.textarea, prevInput = this.prevInput; + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (!cm.state.focused || (hasSelection(input) && !prevInput) || + isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq) + return false; + // See paste handler for more on the fakedLastChar kludge + if (cm.state.pasteIncoming && cm.state.fakedLastChar) { + input.value = input.value.substring(0, input.value.length - 1); + cm.state.fakedLastChar = false; + } + var text = input.value; + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) return false; + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || + mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset(); + return false; + } + + if (text.charCodeAt(0) == 0x200b && cm.doc.sel == cm.display.selForContextMenu && !prevInput) + prevInput = "\u200b"; + // Find the part of the input that is actually new + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; + + var self = this; + runInOp(cm, function() { + applyTextInput(cm, text.slice(same), prevInput.length - same); + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) input.value = self.prevInput = ""; + else self.prevInput = text; + }); + return true; + }, + + ensurePolled: function() { + if (this.pollingFast && this.poll()) this.pollingFast = false; + }, + + onKeyPress: function() { + if (ie && ie_version >= 9) this.hasSelection = null; + this.fastPoll(); + }, + + onContextMenu: function(e) { + var input = this, cm = input.cm, display = cm.display, te = input.textarea; + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; + if (!pos || presto) return; // Opera is difficult. + + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu; + if (reset && cm.doc.sel.contains(pos) == -1) + operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); + + var oldCSS = te.style.cssText; + input.wrapper.style.position = "absolute"; + te.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + + "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " + + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + + "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + if (webkit) var oldScrollY = window.scrollY; // Work around Chrome issue (#2712) + display.input.focus(); + if (webkit) window.scrollTo(null, oldScrollY); + display.input.reset(); + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) te.value = input.prevInput = " "; + input.contextMenuPending = true; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected(); + var extval = te.value = "\u200b" + (selected ? te.value : ""); + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; te.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel; + } + } + function rehide() { + input.contextMenuPending = false; + input.wrapper.style.position = "relative"; + te.style.cssText = oldCSS; + if (ie && ie_version < 9) display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); + + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); + var i = 0, poll = function() { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0) + operation(cm, commands.selectAll)(cm); + else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); + else display.input.reset(); + }; + display.detectingSelectAll = setTimeout(poll, 200); + } + } + + if (ie && ie_version >= 9) prepareSelectAllHack(); + if (captureRightClick) { + e_stop(e); + var mouseup = function() { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); + } else { + setTimeout(rehide, 50); + } + }, + + setUneditable: nothing, + + needsContentAttribute: false + }, TextareaInput.prototype); + + // CONTENTEDITABLE INPUT STYLE + + function ContentEditableInput(cm) { + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); + } + + ContentEditableInput.prototype = copyObj({ + init: function(display) { + var input = this, cm = input.cm; + var div = input.div = display.lineDiv; + div.contentEditable = "true"; + disableBrowserMagic(div); + + on(div, "paste", function(e) { + var pasted = e.clipboardData && e.clipboardData.getData("text/plain"); + if (pasted) { + e.preventDefault(); + cm.replaceSelection(pasted, null, "paste"); + } + }); + + on(div, "compositionstart", function(e) { + var data = e.data; + input.composing = {sel: cm.doc.sel, data: data, startData: data}; + if (!data) return; + var prim = cm.doc.sel.primary(); + var line = cm.getLine(prim.head.line); + var found = line.indexOf(data, Math.max(0, prim.head.ch - data.length)); + if (found > -1 && found <= prim.head.ch) + input.composing.sel = simpleSelection(Pos(prim.head.line, found), + Pos(prim.head.line, found + data.length)); + }); + on(div, "compositionupdate", function(e) { + input.composing.data = e.data; + }); + on(div, "compositionend", function(e) { + var ours = input.composing; + if (!ours) return; + if (e.data != ours.startData && !/\u200b/.test(e.data)) + ours.data = e.data; + // Need a small delay to prevent other code (input event, + // selection polling) from doing damage when fired right after + // compositionend. + setTimeout(function() { + if (!ours.handled) + input.applyComposition(ours); + if (input.composing == ours) + input.composing = null; + }, 50); + }); + + on(div, "touchstart", function() { + input.forceCompositionEnd(); + }); + + on(div, "input", function() { + if (input.composing) return; + if (!input.pollContent()) + runInOp(input.cm, function() {regChange(cm);}); + }); + + function onCopyCut(e) { + if (cm.somethingSelected()) { + lastCopied = cm.getSelections(); + if (e.type == "cut") cm.replaceSelection("", null, "cut"); + } else { + var ranges = copyableRanges(cm); + lastCopied = ranges.text; + if (e.type == "cut") { + cm.operation(function() { + cm.setSelections(ranges.ranges, 0, sel_dontScroll); + cm.replaceSelection("", null, "cut"); + }); + } + } + // iOS exposes the clipboard API, but seems to discard content inserted into it + if (e.clipboardData && !ios) { + e.preventDefault(); + e.clipboardData.clearData(); + e.clipboardData.setData("text/plain", lastCopied.join("\n")); + } else { + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), te = kludge.firstChild; + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.join("\n"); + var hadFocus = document.activeElement; + selectInput(te); + setTimeout(function() { + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + }, 50); + } + } + on(div, "copy", onCopyCut); + on(div, "cut", onCopyCut); + }, + + prepareSelection: function() { + var result = prepareSelection(this.cm, false); + result.focus = this.cm.state.focused; + return result; + }, + + showSelection: function(info) { + if (!info || !this.cm.display.view.length) return; + if (info.focus) this.showPrimarySelection(); + this.showMultipleSelections(info); + }, + + showPrimarySelection: function() { + var sel = window.getSelection(), prim = this.cm.doc.sel.primary(); + var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset); + var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset); + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && + cmp(minPos(curAnchor, curFocus), prim.from()) == 0 && + cmp(maxPos(curAnchor, curFocus), prim.to()) == 0) + return; + + var start = posToDOM(this.cm, prim.from()); + var end = posToDOM(this.cm, prim.to()); + if (!start && !end) return; + + var view = this.cm.display.view; + var old = sel.rangeCount && sel.getRangeAt(0); + if (!start) { + start = {node: view[0].measure.map[2], offset: 0}; + } else if (!end) { // FIXME dangerously hacky + var measure = view[view.length - 1].measure; + var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; + end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}; + } + + try { var rng = range(start.node, start.offset, end.offset, end.node); } + catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + sel.removeAllRanges(); + sel.addRange(rng); + if (old && sel.anchorNode == null) sel.addRange(old); + } + this.rememberSelection(); + }, + + showMultipleSelections: function(info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); + }, + + rememberSelection: function() { + var sel = window.getSelection(); + this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; + this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; + }, + + selectionInEditor: function() { + var sel = window.getSelection(); + if (!sel.rangeCount) return false; + var node = sel.getRangeAt(0).commonAncestorContainer; + return contains(this.div, node); + }, + + focus: function() { + if (this.cm.options.readOnly != "nocursor") this.div.focus(); + }, + blur: function() { this.div.blur(); }, + getField: function() { return this.div; }, + + supportsTouch: function() { return true; }, + + receivedFocus: function() { + var input = this; + if (this.selectionInEditor()) + this.pollSelection(); + else + runInOp(this.cm, function() { input.cm.curOp.selectionChanged = true; }); + + function poll() { + if (input.cm.state.focused) { + input.pollSelection(); + input.polling.set(input.cm.options.pollInterval, poll); + } + } + this.polling.set(this.cm.options.pollInterval, poll); + }, + + pollSelection: function() { + if (this.composing) return; + + var sel = window.getSelection(), cm = this.cm; + if (sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || + sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset) { + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); + if (anchor && head) runInOp(cm, function() { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); + if (anchor.bad || head.bad) cm.curOp.selectionChanged = true; + }); + } + }, + + pollContent: function() { + var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); + var from = sel.from(), to = sel.to(); + if (from.line < display.viewFrom || to.line > display.viewTo - 1) return false; + + var fromIndex; + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + var fromLine = lineNo(display.view[0].line); + var fromNode = display.view[0].node; + } else { + var fromLine = lineNo(display.view[fromIndex].line); + var fromNode = display.view[fromIndex - 1].node.nextSibling; + } + var toIndex = findViewIndex(cm, to.line); + if (toIndex == display.view.length - 1) { + var toLine = display.viewTo - 1; + var toNode = display.view[toIndex].node; + } else { + var toLine = lineNo(display.view[toIndex + 1].line) - 1; + var toNode = display.view[toIndex + 1].node.previousSibling; + } + + var newText = splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } + else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } + else break; + } + + var cutFront = 0, cutEnd = 0; + var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) + ++cutFront; + var newBot = lst(newText), oldBot = lst(oldText); + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), + oldBot.length - (oldText.length == 1 ? cutFront : 0)); + while (cutEnd < maxCutEnd && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) + ++cutEnd; + + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd); + newText[0] = newText[0].slice(cutFront); + + var chFrom = Pos(fromLine, cutFront); + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input"); + return true; + } + }, + + ensurePolled: function() { + this.forceCompositionEnd(); + }, + reset: function() { + this.forceCompositionEnd(); + }, + forceCompositionEnd: function() { + if (!this.composing || this.composing.handled) return; + this.applyComposition(this.composing); + this.composing.handled = true; + this.div.blur(); + this.div.focus(); + }, + applyComposition: function(composing) { + if (composing.data && composing.data != composing.startData) + operation(this.cm, applyTextInput)(this.cm, composing.data, 0, composing.sel); + }, + + setUneditable: function(node) { + node.setAttribute("contenteditable", "false"); + }, + + onKeyPress: function(e) { + e.preventDefault(); + operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); + }, + + onContextMenu: nothing, + resetPosition: nothing, + + needsContentAttribute: true + }, ContentEditableInput.prototype); + + function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line); + if (!view || view.hidden) return null; + var line = getLine(cm.doc, pos.line); + var info = mapFromLineView(view, line, pos.line); + + var order = getOrder(line), side = "left"; + if (order) { + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, "left"); + result.offset = result.collapse == "right" ? result.end : result.start; + return result; + } + + function badPos(pos, bad) { if (bad) pos.bad = true; return pos; } + + function domToPos(cm, node, offset) { + var lineNode; + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset]; + if (!lineNode) return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true); + node = null; offset = 0; + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) return null; + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) break; + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i]; + if (lineView.node == lineNode) + return locateNodeInLineView(lineView, node, offset); + } + } + + function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, bad = false; + if (!node || !contains(wrapper, node)) return badPos(Pos(lineNo(lineView.line), 0), true); + if (node == wrapper) { + bad = true; + node = wrapper.childNodes[offset]; + offset = 0; + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line; + return badPos(Pos(lineNo(line), line.text.length), bad); + } + } + + var textNode = node.nodeType == 3 ? node : null, topNode = node; + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild; + if (offset) offset = textNode.nodeValue.length; + } + while (topNode.parentNode != wrapper) topNode = topNode.parentNode; + var measure = lineView.measure, maps = measure.maps; + + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map = i < 0 ? measure.map : maps[i]; + for (var j = 0; j < map.length; j += 3) { + var curNode = map[j + 2]; + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); + var ch = map[j] + offset; + if (offset < 0 || curNode != textNode) ch = map[j + (offset ? 1 : 0)]; + return Pos(line, ch); + } + } + } + } + var found = find(textNode, topNode, offset); + if (found) return badPos(found, bad); + + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0); + if (found) + return badPos(Pos(found.line, found.ch - dist), bad); + else + dist += after.textContent.length; + } + for (var before = topNode.previousSibling, dist = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1); + if (found) + return badPos(Pos(found.line, found.ch + dist), bad); + else + dist += after.textContent.length; + } + } + + function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", closing = false; + function recognizeMarker(id) { return function(marker) { return marker.id == id; }; } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text"); + if (cmText != null) { + if (cmText == "") cmText = node.textContent.replace(/\u200b/g, ""); + text += cmText; + return; + } + var markerID = node.getAttribute("cm-marker"), range; + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); + if (found.length && (range = found[0].find())) + text += getBetween(cm.doc, range.from, range.to).join("\n"); + return; + } + if (node.getAttribute("contenteditable") == "false") return; + for (var i = 0; i < node.childNodes.length; i++) + walk(node.childNodes[i]); + if (/^(pre|div|p)$/i.test(node.nodeName)) + closing = true; + } else if (node.nodeType == 3) { + var val = node.nodeValue; + if (!val) return; + if (closing) { + text += "\n"; + closing = false; + } + text += val; + } + } + for (;;) { + walk(from); + if (from == to) break; + from = from.nextSibling; + } + return text; + } + + CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; + + // SELECTION / CURSOR + + // Selection objects are immutable. A new one is created every time + // the selection changes. A selection is one or more non-overlapping + // (and non-touching) ranges, sorted, and an integer that indicates + // which one is the primary selection (the one that's scrolled into + // view, that getCursor returns, etc). + function Selection(ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; + } + + Selection.prototype = { + primary: function() { return this.ranges[this.primIndex]; }, + equals: function(other) { + if (other == this) return true; + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) return false; + for (var i = 0; i < this.ranges.length; i++) { + var here = this.ranges[i], there = other.ranges[i]; + if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) return false; + } + return true; + }, + deepCopy: function() { + for (var out = [], i = 0; i < this.ranges.length; i++) + out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); + return new Selection(out, this.primIndex); + }, + somethingSelected: function() { + for (var i = 0; i < this.ranges.length; i++) + if (!this.ranges[i].empty()) return true; + return false; + }, + contains: function(pos, end) { + if (!end) end = pos; + for (var i = 0; i < this.ranges.length; i++) { + var range = this.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + return i; + } + return -1; + } + }; + + function Range(anchor, head) { + this.anchor = anchor; this.head = head; + } + + Range.prototype = { + from: function() { return minPos(this.anchor, this.head); }, + to: function() { return maxPos(this.anchor, this.head); }, + empty: function() { + return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch; + } + }; + + // Take an unsorted, potentially overlapping set of ranges, and + // build a selection out of it. 'Consumes' ranges array (modifying + // it). + function normalizeSelection(ranges, primIndex) { + var prim = ranges[primIndex]; + ranges.sort(function(a, b) { return cmp(a.from(), b.from()); }); + primIndex = indexOf(ranges, prim); + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], prev = ranges[i - 1]; + if (cmp(prev.to(), cur.from()) >= 0) { + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; + if (i <= primIndex) --primIndex; + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); + } + } + return new Selection(ranges, primIndex); + } + + function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0); + } + + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));} + function clipPos(doc, pos) { + if (pos.line < doc.first) return Pos(doc.first, 0); + var last = doc.first + doc.size - 1; + if (pos.line > last) return Pos(last, getLine(doc, last).text.length); + return clipToLen(pos, getLine(doc, pos.line).text.length); + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) return Pos(pos.line, linelen); + else if (ch < 0) return Pos(pos.line, 0); + else return pos; + } + function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;} + function clipPosArray(doc, array) { + for (var out = [], i = 0; i < array.length; i++) out[i] = clipPos(doc, array[i]); + return out; + } + + // SELECTION UPDATES + + // The 'scroll' parameter given to many of these indicated whether + // the new cursor position should be scrolled into view after + // modifying the selection. + + // If shift is held or the extend flag is set, extends a range to + // include a given position (and optionally a second position). + // Otherwise, simply returns the range between the given positions. + // Used for cursor motion and such. + function extendRange(doc, range, head, other) { + if (doc.cm && doc.cm.display.shift || doc.extend) { + var anchor = range.anchor; + if (other) { + var posBefore = cmp(head, anchor) < 0; + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head; + head = other; + } else if (posBefore != (cmp(head, other) < 0)) { + head = other; + } + } + return new Range(anchor, head); + } else { + return new Range(other || head, head); + } + } + + // Extend the primary selection range, discard the rest. + function extendSelection(doc, head, other, options) { + setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options); + } + + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, options) { + for (var out = [], i = 0; i < doc.sel.ranges.length; i++) + out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null); + var newSel = normalizeSelection(out, doc.sel.primIndex); + setSelection(doc, newSel, options); + } + + // Updates a single range in the selection. + function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options); + } + + // Reset the selection to a single range. + function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options); + } + + // Give beforeSelectionChange handlers a change to influence a + // selection update. + function filterSelectionChange(doc, sel) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + this.ranges = []; + for (var i = 0; i < ranges.length; i++) + this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)); + } + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj); + if (obj.ranges != sel.ranges) return normalizeSelection(obj.ranges, obj.ranges.length - 1); + else return sel; + } + + function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, last = lst(done); + if (last && last.ranges) { + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); + } else { + setSelection(doc, sel, options); + } + } + + // Set a new selection. + function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); + } + + function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + sel = filterSelectionChange(doc, sel); + + var bias = options && options.bias || + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); + + if (!(options && options.scroll === false) && doc.cm) + ensureCursorVisible(doc.cm); + } + + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) return; + + doc.sel = sel; + + if (doc.cm) { + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); + } + signalLater(doc, "cursorActivity", doc); + } + + // Verify that the selection does not partially select any atomic + // marked ranges. + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll); + } + + // Return a selection that does not partially select any atomic + // ranges. + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) out = sel.ranges.slice(0, i); + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(out, sel.primIndex) : sel; + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, bias, mayClear) { + var flipped = false, curPos = pos; + var dir = bias || 1; + doc.cantEdit = false; + search: for (;;) { + var line = getLine(doc, curPos.line); + if (line.markedSpans) { + for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) && + (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) break; + else {--i; continue;} + } + } + if (!m.atomic) continue; + var newPos = m.find(dir < 0 ? -1 : 1); + if (cmp(newPos, curPos) == 0) { + newPos.ch += dir; + if (newPos.ch < 0) { + if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1)); + else newPos = null; + } else if (newPos.ch > line.text.length) { + if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0); + else newPos = null; + } + if (!newPos) { + if (flipped) { + // Driven in a corner -- no valid cursor position found at all + // -- try again *with* clearing, if we didn't already + if (!mayClear) return skipAtomic(doc, pos, bias, true); + // Otherwise, turn off editing until further notice, and return the start of the doc + doc.cantEdit = true; + return Pos(doc.first, 0); + } + flipped = true; newPos = pos; dir = -dir; + } + } + curPos = newPos; + continue search; + } + } + } + return curPos; + } + } + + // SELECTION DRAWING + + function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()); + } + + function prepareSelection(cm, primary) { + var doc = cm.doc, result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); + + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (primary === false && i == doc.sel.primIndex) continue; + var range = doc.sel.ranges[i]; + var collapsed = range.empty(); + if (collapsed || cm.options.showCursorWhenSelecting) + drawSelectionCursor(cm, range, curFragment); + if (!collapsed) + drawSelectionRange(cm, range, selFragment); + } + return result; + } + + // Draws a cursor for the given range + function drawSelectionCursor(cm, range, output) { + var pos = cursorCoords(cm, range.head, "div", null, null, !cm.options.singleCursorHeightPerLine); + + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } + } + + // Draws the given range as a highlighted selection + function drawSelectionRange(cm, range, output) { + var display = cm.display, doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; + + function add(left, top, width, bottom) { + if (top < 0) top = 0; + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left + + "px; top: " + top + "px; width: " + (width == null ? rightSide - left : width) + + "px; height: " + (bottom - top) + "px")); + } + + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias); + } + + iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) { + var leftPos = coords(from, "left"), rightPos, left, right; + if (from == to) { + rightPos = leftPos; + left = right = leftPos.left; + } else { + rightPos = coords(to - 1, "right"); + if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; } + left = leftPos.left; + right = rightPos.right; + } + if (fromArg == null && from == 0) left = leftSide; + if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part + add(left, leftPos.top, null, leftPos.bottom); + left = leftSide; + if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top); + } + if (toArg == null && to == lineLen) right = rightSide; + if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) + start = leftPos; + if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) + end = rightPos; + if (left < leftSide + 1) left = leftSide; + add(left, rightPos.top, right - left, rightPos.bottom); + }); + return {start: start, end: end}; + } + + var sFrom = range.from(), sTo = range.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); + } else { + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); + } + } + if (leftEnd.bottom < rightStart.top) + add(leftSide, leftEnd.bottom, null, rightStart.top); + } + + output.appendChild(fragment); + } + + // Cursor-blinking + function restartBlink(cm) { + if (!cm.state.focused) return; + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; + if (cm.options.cursorBlinkRate > 0) + display.blinker = setInterval(function() { + display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; + }, cm.options.cursorBlinkRate); + else if (cm.options.cursorBlinkRate < 0) + display.cursorDiv.style.visibility = "hidden"; + } + + // HIGHLIGHT WORKER + + function startWorker(cm, time) { + if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo) + cm.state.highlight.set(time, bind(highlightWorker, cm)); + } + + function highlightWorker(cm) { + var doc = cm.doc; + if (doc.frontier < doc.first) doc.frontier = doc.first; + if (doc.frontier >= cm.display.viewTo) return; + var end = +new Date + cm.options.workTime; + var state = copyState(doc.mode, getStateBefore(cm, doc.frontier)); + var changedLines = []; + + doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function(line) { + if (doc.frontier >= cm.display.viewFrom) { // Visible + var oldStyles = line.styles; + var highlighted = highlightLine(cm, line, state, true); + line.styles = highlighted.styles; + var oldCls = line.styleClasses, newCls = highlighted.classes; + if (newCls) line.styleClasses = newCls; + else if (oldCls) line.styleClasses = null; + var ischange = !oldStyles || oldStyles.length != line.styles.length || + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); + for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i]; + if (ischange) changedLines.push(doc.frontier); + line.stateAfter = copyState(doc.mode, state); + } else { + processLine(cm, line.text, state); + line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null; + } + ++doc.frontier; + if (+new Date > end) { + startWorker(cm, cm.options.workDelay); + return true; + } + }); + if (changedLines.length) runInOp(cm, function() { + for (var i = 0; i < changedLines.length; i++) + regLineChange(cm, changedLines[i], "text"); + }); + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n, precise) { + var minindent, minline, doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); + for (var search = n; search > lim; --search) { + if (search <= doc.first) return doc.first; + var line = getLine(doc, search - 1); + if (line.stateAfter && (!precise || search <= doc.frontier)) return search; + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline; + } + + function getStateBefore(cm, n, precise) { + var doc = cm.doc, display = cm.display; + if (!doc.mode.startState) return true; + var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; + if (!state) state = startState(doc.mode); + else state = copyState(doc.mode, state); + doc.iter(pos, n, function(line) { + processLine(cm, line.text, state); + var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; + line.stateAfter = save ? copyState(doc.mode, state) : null; + ++pos; + }); + if (precise) doc.frontier = pos; + return state; + } + + // POSITION MEASUREMENT + + function paddingTop(display) {return display.lineSpace.offsetTop;} + function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;} + function paddingH(display) { + if (display.cachedPaddingH) return display.cachedPaddingH; + var e = removeChildrenAndAdd(display.measure, elt("pre", "x")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; + if (!isNaN(data.left) && !isNaN(data.right)) display.cachedPaddingH = data; + return data; + } + + function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth; } + function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth; + } + function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight; + } + + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) + heights.push((cur.bottom + next.top) / 2 - rect.top); + } + } + heights.push(rect.bottom - rect.top); + } + } + + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) + return {map: lineView.measure.map, cache: lineView.measure.cache}; + for (var i = 0; i < lineView.rest.length; i++) + if (lineView.rest[i] == line) + return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]}; + for (var i = 0; i < lineView.rest.length; i++) + if (lineNo(lineView.rest[i]) > lineN) + return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true}; + } + + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view; + } + + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias); + } + + // Find a line view that corresponds to the given line number. + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) + return cm.display.view[findViewIndex(cm, lineN)]; + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) + return ext; + } + + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) + view = null; + else if (view && view.changes) + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + if (!view) + view = updateExternalMeasurement(cm, line); + + var info = mapFromLineView(view, line, lineN); + return { + line: line, view: view, rect: null, + map: info.map, cache: info.cache, before: info.before, + hasHeights: false + }; + } + + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) ch = -1; + var key = ch + (bias || ""), found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; + } else { + if (!prepared.rect) + prepared.rect = prepared.view.text.getBoundingClientRect(); + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; + } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) prepared.cache[key] = found; + } + return {left: found.left, right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom}; + } + + var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; + + function nodeAndOffsetInLineMap(map, ch, bias) { + var node, start, end, collapse; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map.length; i += 3) { + var mStart = map[i], mEnd = map[i + 1]; + if (ch < mStart) { + start = 0; end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) collapse = "right"; + } + if (start != null) { + node = map[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) + collapse = bias; + if (bias == "left" && start == 0) + while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2]; + collapse = "left"; + } + if (bias == "right" && start == mEnd - mStart) + while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2]; + collapse = "right"; + } + break; + } + } + return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}; + } + + function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, start = place.start, end = place.end, collapse = place.collapse; + + var rect; + if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. + for (var i = 0; i < 4; i++) { // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) --start; + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) ++end; + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) { + rect = node.parentNode.getBoundingClientRect(); + } else if (ie && cm.options.lineWrapping) { + var rects = range(node, start, end).getClientRects(); + if (rects.length) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = nullRect; + } else { + rect = range(node, start, end).getBoundingClientRect() || nullRect; + } + if (rect.left || rect.right || start == 0) break; + end = start; + start = start - 1; + collapse = "right"; + } + if (ie && ie_version < 11) rect = maybeUpdateRectForZooming(cm.display.measure, rect); + } else { // If it is a widget, simply get the box for the whole widget. + if (start > 0) collapse = bias = "right"; + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) + rect = rects[bias == "right" ? rects.length - 1 : 0]; + else + rect = node.getBoundingClientRect(); + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) + rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; + else + rect = nullRect; + } + + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + for (var i = 0; i < heights.length - 1; i++) + if (mid < heights[i]) break; + var top = i ? heights[i - 1] : 0, bot = heights[i]; + var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, bottom: bot}; + if (!rect.left && !rect.right) result.bogus = true; + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } + + return result; + } + + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || + screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) + return rect; + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return {left: rect.left * scaleX, right: rect.right * scaleX, + top: rect.top * scaleY, bottom: rect.bottom * scaleY}; + } + + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++) + lineView.measure.caches[i] = {}; + } + } + + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) + clearLineMeasurementCacheFor(cm.display.view[i]); + } + + function clearCaches(cm) { + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) cm.display.maxLineChanged = true; + cm.display.lineNumChars = null; + } + + function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; } + function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; } + + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"/null (editor), "window", + // or "page". + function intoCoordSystem(cm, lineObj, rect, context) { + if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) { + var size = widgetHeight(lineObj.widgets[i]); + rect.top += size; rect.bottom += size; + } + if (context == "line") return rect; + if (!context) context = "local"; + var yOff = heightAtLine(lineObj); + if (context == "local") yOff += paddingTop(cm.display); + else yOff -= cm.display.viewOffset; + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); + rect.left += xOff; rect.right += xOff; + } + rect.top += yOff; rect.bottom += yOff; + return rect; + } + + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"/null. + function fromCoordSystem(cm, coords, context) { + if (context == "div") return coords; + var left = coords.left, top = coords.top; + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX(); + top -= pageScrollY(); + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; + } + + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); + return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}; + } + + function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) lineObj = getLine(cm.doc, pos.line); + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); + } + + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj); + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) m.left = m.right; else m.right = m.left; + return intoCoordSystem(cm, lineObj, m, context); + } + function getBidi(ch, partPos) { + var part = order[partPos], right = part.level % 2; + if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) { + part = order[--partPos]; + ch = bidiRight(part) - (part.level % 2 ? 0 : 1); + right = true; + } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) { + part = order[++partPos]; + ch = bidiLeft(part) - part.level % 2; + right = false; + } + if (right && ch == part.to && ch > part.from) return get(ch - 1); + return get(ch, right); + } + var order = getOrder(lineObj), ch = pos.ch; + if (!order) return get(ch); + var partPos = getBidiPartAt(order, ch); + var val = getBidi(ch, partPos); + if (bidiOther != null) val.other = getBidi(ch, bidiOther); + return val; + } + + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. + function estimateCoords(cm, pos) { + var left = 0, pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return {left: left, right: left, top: top, bottom: top + lineObj.height}; + } + + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. + function PosWithInfo(line, ch, outside, xRel) { + var pos = Pos(line, ch); + pos.xRel = xRel; + if (outside) pos.outside = true; + return pos; + } + + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) return PosWithInfo(doc.first, 0, true, -1); + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; + if (lineN > last) + return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1); + if (x < 0) x = 0; + + var lineObj = getLine(doc, lineN); + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var merged = collapsedSpanAtEnd(lineObj); + var mergedPos = merged && merged.find(0, true); + if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) + lineN = lineNo(lineObj = mergedPos.to.line); + else + return found; + } + } + + function coordsCharInner(cm, lineObj, lineNo, x, y) { + var innerOff = y - heightAtLine(lineObj); + var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth; + var preparedMeasure = prepareMeasureForLine(cm, lineObj); + + function getX(ch) { + var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure); + wrongLine = true; + if (innerOff > sp.bottom) return sp.left - adjust; + else if (innerOff < sp.top) return sp.left + adjust; + else wrongLine = false; + return sp.left; + } + + var bidi = getOrder(lineObj), dist = lineObj.text.length; + var from = lineLeft(lineObj), to = lineRight(lineObj); + var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine; + + if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1); + // Do a binary search between these bounds. + for (;;) { + if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) { + var ch = x < fromX || x - fromX <= toX - x ? from : to; + var xDiff = x - (ch == from ? fromX : toX); + while (isExtendingChar(lineObj.text.charAt(ch))) ++ch; + var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside, + xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0); + return pos; + } + var step = Math.ceil(dist / 2), middle = from + step; + if (bidi) { + middle = from; + for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1); + } + var middleX = getX(middle); + if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;} + else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;} + } + } + + var measureText; + // Compute the default text height. + function textHeight(display) { + if (display.cachedTextHeight != null) return display.cachedTextHeight; + if (measureText == null) { + measureText = elt("pre"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) display.cachedTextHeight = height; + removeChildren(display.measure); + return height || 1; + } + + // Compute the default character width. + function charWidth(display) { + if (display.cachedCharWidth != null) return display.cachedCharWidth; + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor]); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; + if (width > 2) display.cachedCharWidth = width; + return width || 10; + } + + // OPERATIONS + + // Operations are used to wrap a series of changes to the editor + // state in such a way that each change won't have to update the + // cursor and display (which would be awkward, slow, and + // error-prone). Instead, display updates are batched and then all + // combined and executed at once. + + var operationGroup = null; + + var nextOpId = 0; + // Start a new operation. + function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, // Used to detect need to update scrollbar + forceUpdate: false, // Used to force a redraw + updateInput: null, // Whether to reset the input textarea + typing: false, // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, // Accumulated changes, for firing change events + cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already + selectionChanged: false, // Whether the selection needs to be redrawn + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position + id: ++nextOpId // Unique ID + }; + if (operationGroup) { + operationGroup.ops.push(cm.curOp); + } else { + cm.curOp.ownsGroup = operationGroup = { + ops: [cm.curOp], + delayedCallbacks: [] + }; + } + } + + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, i = 0; + do { + for (; i < callbacks.length; i++) + callbacks[i](); + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) + while (op.cursorActivityCalled < op.cursorActivityHandlers.length) + op.cursorActivityHandlers[op.cursorActivityCalled++](op.cm); + } + } while (i < callbacks.length); + } + + // Finish an operation, updating the display and signalling delayed events + function endOperation(cm) { + var op = cm.curOp, group = op.ownsGroup; + if (!group) return; + + try { fireCallbacksForOps(group); } + finally { + operationGroup = null; + for (var i = 0; i < group.ops.length; i++) + group.ops[i].cm.curOp = null; + endOperations(group); + } + } + + // The DOM updates done when an operation finishes are batched so + // that the minimum number of relayouts are required. + function endOperations(group) { + var ops = group.ops; + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_R1(ops[i]); + for (var i = 0; i < ops.length; i++) // Write DOM (maybe) + endOperation_W1(ops[i]); + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_R2(ops[i]); + for (var i = 0; i < ops.length; i++) // Write DOM (maybe) + endOperation_W2(ops[i]); + for (var i = 0; i < ops.length; i++) // Read DOM + endOperation_finish(ops[i]); + } + + function endOperation_R1(op) { + var cm = op.cm, display = cm.display; + maybeClipScrollbars(cm); + if (op.updateMaxLine) findMaxLine(cm); + + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping; + op.update = op.mustUpdate && + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); + } + + function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } + + function endOperation_R2(op) { + var cm = op.cm, display = cm.display; + if (op.updatedDisplay) updateHeightsInViewport(cm); + + op.barMeasure = measureForScrollbars(cm); + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + cm.display.sizerWidth = op.adjustWidthTo; + op.barMeasure.scrollWidth = + Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); + } + + if (op.updatedDisplay || op.selectionChanged) + op.preparedSelection = display.input.prepareSelection(); + } + + function endOperation_W2(op) { + var cm = op.cm; + + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; + if (op.maxScrollLeft < cm.doc.scrollLeft) + setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); + cm.display.maxLineChanged = false; + } + + if (op.preparedSelection) + cm.display.input.showSelection(op.preparedSelection); + if (op.updatedDisplay) + setDocumentHeight(cm, op.barMeasure); + if (op.updatedDisplay || op.startHeight != cm.doc.height) + updateScrollbars(cm, op.barMeasure); + + if (op.selectionChanged) restartBlink(cm); + + if (cm.state.focused && op.updateInput) + cm.display.input.reset(op.typing); + } + + function endOperation_finish(op) { + var cm = op.cm, display = cm.display, doc = cm.doc; + + if (op.updatedDisplay) postUpdateDisplay(cm, op.update); + + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + display.wheelStartX = display.wheelStartY = null; + + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) { + doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop)); + display.scrollbars.setScrollTop(doc.scrollTop); + display.scroller.scrollTop = doc.scrollTop; + } + if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) { + doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - displayWidth(cm), op.scrollLeft)); + display.scrollbars.setScrollLeft(doc.scrollLeft); + display.scroller.scrollLeft = doc.scrollLeft; + alignHorizontally(cm); + } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); + if (op.scrollToPos.isCursor && cm.state.focused) maybeScrollWindow(cm, coords); + } + + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; + if (hidden) for (var i = 0; i < hidden.length; ++i) + if (!hidden[i].lines.length) signal(hidden[i], "hide"); + if (unhidden) for (var i = 0; i < unhidden.length; ++i) + if (unhidden[i].lines.length) signal(unhidden[i], "unhide"); + + if (display.wrapper.offsetHeight) + doc.scrollTop = cm.display.scroller.scrollTop; + + // Fire change events, and delayed event handlers + if (op.changeObjs) + signal(cm, "changes", cm, op.changeObjs); + if (op.update) + op.update.finish(); + } + + // Run the given function in an operation + function runInOp(cm, f) { + if (cm.curOp) return f(); + startOperation(cm); + try { return f(); } + finally { endOperation(cm); } + } + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm, f) { + return function() { + if (cm.curOp) return f.apply(cm, arguments); + startOperation(cm); + try { return f.apply(cm, arguments); } + finally { endOperation(cm); } + }; + } + // Used to add methods to editor and doc instances, wrapping them in + // operations. + function methodOp(f) { + return function() { + if (this.curOp) return f.apply(this, arguments); + startOperation(this); + try { return f.apply(this, arguments); } + finally { endOperation(this); } + }; + } + function docMethodOp(f) { + return function() { + var cm = this.cm; + if (!cm || cm.curOp) return f.apply(this, arguments); + startOperation(cm); + try { return f.apply(this, arguments); } + finally { endOperation(cm); } + }; + } + + // VIEW TRACKING + + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array; + } + + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) from = cm.doc.first; + if (to == null) to = cm.doc.first + cm.doc.size; + if (!lendiff) lendiff = 0; + + var display = cm.display; + if (lendiff && to < display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers > from)) + display.updateLineNumbers = from; + + cm.curOp.viewChanged = true; + + if (from >= display.viewTo) { // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) + resetView(cm); + } else if (to <= display.viewFrom) { // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } + } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } + } else if (to >= display.viewTo) { // Bottom overlap + var cut = viewCuttingPoint(cm, from, from, -1); + if (cut) { + display.view = display.view.slice(0, cut.index); + display.viewTo = cut.lineN; + } else { + resetView(cm); + } + } else { // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index) + .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) + .concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } + } + + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) + ext.lineN += lendiff; + else if (from < ext.lineN + ext.size) + display.externalMeasured = null; + } + } + + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) + display.externalMeasured = null; + + if (line < display.viewFrom || line >= display.viewTo) return; + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) return; + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) arr.push(type); + } + + // Clear the view. + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; + } + + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) return null; + n -= cm.display.viewFrom; + if (n < 0) return null; + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) return i; + } + } + + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), diff, view = cm.display.view; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) + return {index: index, lineN: newN}; + for (var i = 0, n = cm.display.viewFrom; i < index; i++) + n += view[i].size; + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) return null; + diff = (n + view[index].size) - oldN; + index++; + } else { + diff = n - oldN; + } + oldN += diff; newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) return null; + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return {index: index, lineN: newN}; + } + + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. + function adjustView(cm, from, to) { + var display = cm.display, view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) + display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); + else if (display.viewFrom < from) + display.view = display.view.slice(findViewIndex(cm, from)); + display.viewFrom = from; + if (display.viewTo < to) + display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); + else if (display.viewTo > to) + display.view = display.view.slice(0, findViewIndex(cm, to)); + } + display.viewTo = to; + } + + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) ++dirty; + } + return dirty; + } + + // EVENT HANDLERS + + // Attach the necessary event handlers when initializing the editor + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) + on(d.scroller, "dblclick", operation(cm, function(e) { + if (signalDOMEvent(cm, e)) return; + var pos = posFromMouse(cm, e); + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return; + e_preventDefault(e); + var word = cm.findWordAt(pos); + extendSelection(cm.doc, word.anchor, word.head); + })); + else + on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); }); + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);}); + + // Used to suppress mouse event handling when a touch happens + var touchFinished, prevTouch = {end: 0}; + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function() {d.activeTouch = null;}, 1000); + prevTouch = d.activeTouch; + prevTouch.end = +new Date; + } + }; + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) return false; + var touch = e.touches[0]; + return touch.radiusX <= 1 && touch.radiusY <= 1; + } + function farAway(touch, other) { + if (other.left == null) return true; + var dx = other.left - touch.left, dy = other.top - touch.top; + return dx * dx + dy * dy > 20 * 20; + } + on(d.scroller, "touchstart", function(e) { + if (!isMouseLikeTouchEvent(e)) { + clearTimeout(touchFinished); + var now = +new Date; + d.activeTouch = {start: now, moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null}; + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX; + d.activeTouch.top = e.touches[0].pageY; + } + } + }); + on(d.scroller, "touchmove", function() { + if (d.activeTouch) d.activeTouch.moved = true; + }); + on(d.scroller, "touchend", function(e) { + var touch = d.activeTouch; + if (touch && !eventInWidget(d, e) && touch.left != null && + !touch.moved && new Date - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), range; + if (!touch.prev || farAway(touch, touch.prev)) // Single tap + range = new Range(pos, pos); + else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap + range = cm.findWordAt(pos); + else // Triple tap + range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); + cm.setSelection(range.anchor, range.head); + cm.focus(); + e_preventDefault(e); + } + finishTouch(); + }); + on(d.scroller, "touchcancel", finishTouch); + + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function() { + if (d.scroller.clientHeight) { + setScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + } + }); + + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);}); + on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);}); + + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); + + function drag_(e) { + if (!signalDOMEvent(cm, e)) e_stop(e); + } + if (cm.options.dragDrop) { + on(d.scroller, "dragstart", function(e){onDragStart(cm, e);}); + on(d.scroller, "dragenter", drag_); + on(d.scroller, "dragover", drag_); + on(d.scroller, "drop", operation(cm, onDrop)); + } + + var inp = d.input.getField(); + on(inp, "keyup", function(e) { onKeyUp.call(cm, e); }); + on(inp, "keydown", operation(cm, onKeyDown)); + on(inp, "keypress", operation(cm, onKeyPress)); + on(inp, "focus", bind(onFocus, cm)); + on(inp, "blur", bind(onBlur, cm)); + } + + // Called when the window resizes + function onResize(cm) { + var d = cm.display; + if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) + return; + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + d.scrollbarsClipped = false; + cm.setSize(); + } + + // MOUSE EVENTS + + // Return true when the given mouse event happened in a widget + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || + (n.parentNode == display.sizer && n != display.mover)) + return true; + } + } + + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. + function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display; + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") return null; + + var x, y, space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX - space.left; y = e.clientY - space.top; } + catch (e) { return null; } + var coords = coordsChar(cm, x, y), line; + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); + } + return coords; + } + + // A mouse down can be a single click, double click, triple click, + // start of selection drag, start of text drag, new cursor + // (ctrl-click), rectangle drag (alt-drag), or xwin + // middle-click-paste. Or it might be a click on something we should + // not interfere with, such as a scrollbar or widget. + function onMouseDown(e) { + var cm = this, display = cm.display; + if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return; + display.shift = e.shiftKey; + + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false; + setTimeout(function(){display.scroller.draggable = true;}, 100); + } + return; + } + if (clickInGutter(cm, e)) return; + var start = posFromMouse(cm, e); + window.focus(); + + switch (e_button(e)) { + case 1: + if (start) + leftButtonDown(cm, e, start); + else if (e_target(e) == display.scroller) + e_preventDefault(e); + break; + case 2: + if (webkit) cm.state.lastMiddleDown = +new Date; + if (start) extendSelection(cm.doc, start); + setTimeout(function() {display.input.focus();}, 20); + e_preventDefault(e); + break; + case 3: + if (captureRightClick) onContextMenu(cm, e); + break; + } + } + + var lastClick, lastDoubleClick; + function leftButtonDown(cm, e, start) { + if (ie) setTimeout(bind(ensureFocus, cm), 0); + else ensureFocus(cm); + + var now = +new Date, type; + if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { + type = "triple"; + } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { + type = "double"; + lastDoubleClick = {time: now, pos: start}; + } else { + type = "single"; + lastClick = {time: now, pos: start}; + } + + var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained; + if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && + type == "single" && (contained = sel.contains(start)) > -1 && + !sel.ranges[contained].empty()) + leftButtonStartDrag(cm, e, start, modifier); + else + leftButtonSelect(cm, e, start, type, modifier); + } + + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. + function leftButtonStartDrag(cm, e, start, modifier) { + var display = cm.display; + var dragEnd = operation(cm, function(e2) { + if (webkit) display.scroller.draggable = false; + cm.state.draggingText = false; + off(document, "mouseup", dragEnd); + off(display.scroller, "drop", dragEnd); + if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { + e_preventDefault(e2); + if (!modifier) + extendSelection(cm.doc, start); + display.input.focus(); + // Work around unexplainable focus problem in IE9 (#2127) + if (ie && ie_version == 9) + setTimeout(function() {document.body.focus(); display.input.focus();}, 20); + } + }); + // Let the drag handler handle this. + if (webkit) display.scroller.draggable = true; + cm.state.draggingText = dragEnd; + // IE's approach to draggable + if (display.scroller.dragDrop) display.scroller.dragDrop(); + on(document, "mouseup", dragEnd); + on(display.scroller, "drop", dragEnd); + } + + // Normal selection, as opposed to text dragging. + function leftButtonSelect(cm, e, start, type, addNew) { + var display = cm.display, doc = cm.doc; + e_preventDefault(e); + + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; + if (addNew && !e.shiftKey) { + ourIndex = doc.sel.contains(start); + if (ourIndex > -1) + ourRange = ranges[ourIndex]; + else + ourRange = new Range(start, start); + } else { + ourRange = doc.sel.primary(); + } + + if (e.altKey) { + type = "rect"; + if (!addNew) ourRange = new Range(start, start); + start = posFromMouse(cm, e, true, true); + ourIndex = -1; + } else if (type == "double") { + var word = cm.findWordAt(start); + if (cm.display.shift || doc.extend) + ourRange = extendRange(doc, ourRange, word.anchor, word.head); + else + ourRange = word; + } else if (type == "triple") { + var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0))); + if (cm.display.shift || doc.extend) + ourRange = extendRange(doc, ourRange, line.anchor, line.head); + else + ourRange = line; + } else { + ourRange = extendRange(doc, ourRange, start); + } + + if (!addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; + } else if (ourIndex == -1) { + ourIndex = ranges.length; + setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}); + } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single") { + setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0)); + startSel = doc.sel; + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); + } + + var lastPos = start; + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) return; + lastPos = pos; + + if (type == "rect") { + var ranges = [], tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); + line <= end; line++) { + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); + if (left == right) + ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); + else if (text.length > leftPos) + ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); + } + if (!ranges.length) ranges.push(new Range(start, start)); + setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + {origin: "*mouse", scroll: false}); + cm.scrollIntoView(pos); + } else { + var oldRange = ourRange; + var anchor = oldRange.anchor, head = pos; + if (type != "single") { + if (type == "double") + var range = cm.findWordAt(pos); + else + var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))); + if (cmp(range.anchor, anchor) > 0) { + head = range.head; + anchor = minPos(oldRange.from(), range.anchor); + } else { + head = range.anchor; + anchor = maxPos(oldRange.to(), range.head); + } + } + var ranges = startSel.ranges.slice(0); + ranges[ourIndex] = new Range(clipPos(doc, anchor), head); + setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse); + } + } + + var editorSize = display.wrapper.getBoundingClientRect(); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; + + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true, type == "rect"); + if (!cur) return; + if (cmp(cur, lastPos) != 0) { + ensureFocus(cm); + extendTo(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) + setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150); + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) setTimeout(operation(cm, function() { + if (counter != curCount) return; + display.scroller.scrollTop += outside; + extend(e); + }), 50); + } + } + + function done(e) { + counter = Infinity; + e_preventDefault(e); + display.input.focus(); + off(document, "mousemove", move); + off(document, "mouseup", up); + doc.history.lastSelOrigin = null; + } + + var move = operation(cm, function(e) { + if (!e_button(e)) done(e); + else extend(e); + }); + var up = operation(cm, done); + on(document, "mousemove", move); + on(document, "mouseup", up); + } + + // Determines whether an event happened in the gutter, and fires the + // handlers for the corresponding event. + function gutterEvent(cm, e, type, prevent, signalfn) { + try { var mX = e.clientX, mY = e.clientY; } + catch(e) { return false; } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false; + if (prevent) e_preventDefault(e); + + var display = cm.display; + var lineBox = display.lineDiv.getBoundingClientRect(); + + if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e); + mY -= lineBox.top - display.viewOffset; + + for (var i = 0; i < cm.options.gutters.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.options.gutters[i]; + signalfn(cm, type, cm, line, gutter, e); + return e_defaultPrevented(e); + } + } + } + + function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true, signalLater); + } + + // Kludge to work around strange IE behavior where it'll sometimes + // re-fire a series of drag-related events right after the drop (#1551) + var lastDrop = 0; + + function onDrop(e) { + var cm = this; + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) + return; + e_preventDefault(e); + if (ie) lastDrop = +new Date; + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; + if (!pos || isReadOnly(cm)) return; + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0; + var loadFile = function(file, i) { + var reader = new FileReader; + reader.onload = operation(cm, function() { + text[i] = reader.result; + if (++read == n) { + pos = clipPos(cm.doc, pos); + var change = {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}; + makeChange(cm.doc, change); + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); + } + }); + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) loadFile(files[i], i); + } else { // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e); + // Ensure the editor is re-focused + setTimeout(function() {cm.display.input.focus();}, 20); + return; + } + try { + var text = e.dataTransfer.getData("Text"); + if (text) { + if (cm.state.draggingText && !(mac ? e.metaKey : e.ctrlKey)) + var selected = cm.listSelections(); + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); + if (selected) for (var i = 0; i < selected.length; ++i) + replaceRange(cm.doc, "", selected[i].anchor, selected[i].head, "drag"); + cm.replaceSelection(text, "around", "paste"); + cm.display.input.focus(); + } + } + catch(e){} + } + } + + function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; + + e.dataTransfer.setData("Text", cm.getSelection()); + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (presto) { + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop; + } + e.dataTransfer.setDragImage(img, 0, 0); + if (presto) img.parentNode.removeChild(img); + } + } + + // SCROLL EVENTS + + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. + function setScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) return; + cm.doc.scrollTop = val; + if (!gecko) updateDisplaySimple(cm, {top: val}); + if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (gecko) updateDisplaySimple(cm); + startWorker(cm, 100); + } + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. + function setScrollLeft(cm, val, isScroller) { + if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return; + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val; + cm.display.scrollbars.setScrollLeft(val); + } + + // Since the delta values reported on mouse wheel events are + // unstandardized between browsers and even browser versions, and + // generally horribly unpredictable, this code starts by measuring + // the scroll effect that the first few mouse wheel events have, + // and, from that, detects the way it can convert deltas to pixel + // offsets afterwards. + // + // The reason we want to know the amount a wheel event will scroll + // is that it gives us a chance to update the display before the + // actual scrolling happens, reducing flickering. + + var wheelSamples = 0, wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) wheelPixelsPerUnit = -.53; + else if (gecko) wheelPixelsPerUnit = 15; + else if (chrome) wheelPixelsPerUnit = -.7; + else if (safari) wheelPixelsPerUnit = -1/3; + + var wheelEventDelta = function(e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail; + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail; + else if (dy == null) dy = e.wheelDelta; + return {x: dx, y: dy}; + }; + CodeMirror.wheelEventPixels = function(e) { + var delta = wheelEventDelta(e); + delta.x *= wheelPixelsPerUnit; + delta.y *= wheelPixelsPerUnit; + return delta; + }; + + function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; + + var display = cm.display, scroll = display.scroller; + // Quit if there's nothing to scroll here + if (!(dx && scroll.scrollWidth > scroll.clientWidth || + dy && scroll.scrollHeight > scroll.clientHeight)) return; + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer; + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy) + setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))); + setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth))); + e_preventDefault(e); + display.wheelStartX = null; // Abort measurement, if in progress + return; + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; + if (pixels < 0) top = Math.max(0, top + pixels - 50); + else bot = Math.min(cm.doc.height, bot + pixels + 50); + updateDisplaySimple(cm, {top: top, bottom: bot}); + } + + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; display.wheelDY = dy; + setTimeout(function() { + if (display.wheelStartX == null) return; + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX); + display.wheelStartX = display.wheelStartY = null; + if (!sample) return; + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; display.wheelDY += dy; + } + } + } + + // KEY EVENTS + + // Run a handler that was bound to a key. + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) return false; + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled(); + var prevShift = cm.display.shift, done = false; + try { + if (isReadOnly(cm)) cm.state.suppressEdits = true; + if (dropShift) cm.display.shift = false; + done = bound(cm) != Pass; + } finally { + cm.display.shift = prevShift; + cm.state.suppressEdits = false; + } + return done; + } + + function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); + if (result) return result; + } + return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) + || lookupKey(name, cm.options.keyMap, handle, cm); + } + + var stopSeq = new Delayed; + function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq; + if (seq) { + if (isModifierKey(name)) return "handled"; + stopSeq.set(50, function() { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null; + cm.display.input.reset(); + } + }); + name = seq + " " + name; + } + var result = lookupKeyForEditor(cm, name, handle); + + if (result == "multi") + cm.state.keySeq = name; + if (result == "handled") + signalLater(cm, "keyHandled", cm, name, e); + + if (result == "handled" || result == "multi") { + e_preventDefault(e); + restartBlink(cm); + } + + if (seq && !result && /\'$/.test(name)) { + e_preventDefault(e); + return true; + } + return !!result; + } + + // Handle a key from the keydown event. + function handleKeyBinding(cm, e) { + var name = keyName(e, true); + if (!name) return false; + + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);}) + || dispatchKey(cm, name, e, function(b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) + return doHandleBinding(cm, b); + }); + } else { + return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); }); + } + } + + // Handle a key from the keypress event + function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, + function(b) { return doHandleBinding(cm, b, true); }); + } + + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + ensureFocus(cm); + if (signalDOMEvent(cm, e)) return; + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; + var code = e.keyCode; + cm.display.shift = code == 16 || e.shiftKey; + var handled = handleKeyBinding(cm, e); + if (presto) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) + cm.replaceSelection("", null, "cut"); + } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) + showCrossHair(cm); + } + + function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv; + addClass(lineDiv, "CodeMirror-crosshair"); + + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair"); + off(document, "keyup", up); + off(document, "mouseover", up); + } + } + on(document, "keyup", up); + on(document, "mouseover", up); + } + + function onKeyUp(e) { + if (e.keyCode == 16) this.doc.sel.shift = false; + signalDOMEvent(this, e); + } + + function onKeyPress(e) { + var cm = this; + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return; + var keyCode = e.keyCode, charCode = e.charCode; + if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} + if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) return; + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + if (handleCharBinding(cm, e, ch)) return; + cm.display.input.onKeyPress(e); + } + + // FOCUS/BLUR EVENTS + + function onFocus(cm) { + if (cm.options.readOnly == "nocursor") return; + if (!cm.state.focused) { + signal(cm, "focus", cm); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset(); + if (webkit) setTimeout(function() { cm.display.input.reset(true); }, 20); // Issue #1730 + } + cm.display.input.receivedFocus(); + } + restartBlink(cm); + } + function onBlur(cm) { + if (cm.state.focused) { + signal(cm, "blur", cm); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); + } + clearInterval(cm.display.blinker); + setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150); + } + + // CONTEXT MENU HANDLING + + // To make the context menu work, we need to briefly unhide the + // textarea (making it as unobtrusive as possible) to let the + // right-click take effect on it. + function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return; + cm.display.input.onContextMenu(e); + } + + function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) return false; + return gutterEvent(cm, e, "gutterContextMenu", false, signal); + } + + // UPDATING + + // Compute the position of the end of a change (its 'to' property + // refers to the pre-change end). + var changeEnd = CodeMirror.changeEnd = function(change) { + if (!change.text) return change.to; + return Pos(change.from.line + change.text.length - 1, + lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)); + }; + + // Adjust a position to refer to the post-change position of the + // same text, or the end of the change if the change covers it. + function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) return pos; + if (cmp(pos, change.to) <= 0) return changeEnd(change); + + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; + if (pos.line == change.to.line) ch += changeEnd(change).ch - change.to.ch; + return Pos(line, ch); + } + + function computeSelAfterChange(doc, change) { + var out = []; + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + out.push(new Range(adjustForChange(range.anchor, change), + adjustForChange(range.head, change))); + } + return normalizeSelection(out, doc.sel.primIndex); + } + + function offsetPos(pos, old, nw) { + if (pos.line == old.line) + return Pos(nw.line, pos.ch - old.ch + nw.ch); + else + return Pos(nw.line + (pos.line - old.line), pos.ch); + } + + // Used by replaceSelections to allow moving the selection to the + // start or around the replaced test. Hint may be "start" or "around". + function computeReplacedSel(doc, changes, hint) { + var out = []; + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; + if (hint == "around") { + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); + } else { + out[i] = new Range(from, from); + } + } + return new Selection(out, doc.sel.primIndex); + } + + // Allow "beforeChange" event handlers to influence a change + function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function() { this.canceled = true; } + }; + if (update) obj.update = function(from, to, text, origin) { + if (from) this.from = clipPos(doc, from); + if (to) this.to = clipPos(doc, to); + if (text) this.text = text; + if (origin !== undefined) this.origin = origin; + }; + signal(doc, "beforeChange", doc, obj); + if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj); + + if (obj.canceled) return null; + return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}; + } + + // Apply a change to a document, and add it to the document's + // history, and propagating it to all linked documents. + function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly); + if (doc.cm.state.suppressEdits) return; + } + + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true); + if (!change) return; + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); + if (split) { + for (var i = split.length - 1; i >= 0; --i) + makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}); + } else { + makeChangeInner(doc, change); + } + } + + function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) return; + var selAfter = computeSelAfterChange(doc, change); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); + + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; + + linkedDocs(doc, function(doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); + } + + // Revert a change stored in a document's history. + function makeChangeFromHistory(doc, type, allowSelectionOnly) { + if (doc.cm && doc.cm.state.suppressEdits) return; + + var hist = doc.history, event, selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + for (var i = 0; i < source.length; i++) { + event = source[i]; + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) + break; + } + if (i == source.length) return; + hist.lastOrigin = hist.lastSelOrigin = null; + + for (;;) { + event = source.pop(); + if (event.ranges) { + pushSelectionToHistory(event, dest); + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, {clearRedo: false}); + return; + } + selAfter = event; + } + else break; + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({changes: antiChanges, generation: hist.generation}); + hist.generation = event.generation || ++hist.maxGeneration; + + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); + + for (var i = event.changes.length - 1; i >= 0; --i) { + var change = event.changes[i]; + change.origin = type; + if (filter && !filterChange(doc, change, false)) { + source.length = 0; + return; + } + + antiChanges.push(historyChangeFromChange(doc, change)); + + var after = i ? computeSelAfterChange(doc, change) : lst(source); + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (!i && doc.cm) doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); + var rebased = []; + + // Propagate to the linked documents + linkedDocs(doc, function(doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); + } + } + + // Sub-views need their line numbers shifted when text is added + // above or below them in the parent document. + function shiftDoc(doc, distance) { + if (distance == 0) return; + doc.first += distance; + doc.sel = new Selection(map(doc.sel.ranges, function(range) { + return new Range(Pos(range.anchor.line + distance, range.anchor.ch), + Pos(range.head.line + distance, range.head.ch)); + }), doc.sel.primIndex); + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance); + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) + regLineChange(doc.cm, l, "gutter"); + } + } + + // More lower-level change function, handling only a single document + // (not linked ones). + function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) + return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans); + + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); + return; + } + if (change.from.line > doc.lastLine()) return; + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); + change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], origin: change.origin}; + } + var last = doc.lastLine(); + if (change.to.line > last) { + change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], origin: change.origin}; + } + + change.removed = getBetween(doc, change.from, change.to); + + if (!selAfter) selAfter = computeSelAfterChange(doc, change); + if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans); + else updateDoc(doc, change, spans); + setSelectionNoUndo(doc, selAfter, sel_dontScroll); + } + + // Handle the interaction of a change to a document with the editor + // that this document is part of. + function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to; + + var recomputeMaxLength = false, checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function(line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true; + } + }); + } + + if (doc.sel.contains(change.from, change.to) > -1) + signalCursorActivity(cm); + + updateDoc(doc, change, spans, estimateHeight(cm)); + + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function(line) { + var len = lineLength(line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) cm.curOp.updateMaxLine = true; + } + + // Adjust frontier, schedule worker + doc.frontier = Math.min(doc.frontier, from.line); + startWorker(cm, 400); + + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + if (change.full) + regChange(cm); + else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + regLineChange(cm, from.line, "text"); + else + regChange(cm, from.line, to.line + 1, lendiff); + + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); + if (changeHandler || changesHandler) { + var obj = { + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }; + if (changeHandler) signalLater(cm, "change", cm, obj); + if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); + } + cm.display.selForContextMenu = null; + } + + function replaceRange(doc, code, from, to, origin) { + if (!to) to = from; + if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; } + if (typeof code == "string") code = splitLines(code); + makeChange(doc, {from: from, to: to, text: code, origin: origin}); + } + + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. + function maybeScrollWindow(cm, coords) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) return; + + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; + if (coords.top + box.top < 0) doScroll = true; + else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false; + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, "position: absolute; top: " + + (coords.top - display.viewOffset - paddingTop(cm.display)) + "px; height: " + + (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px; left: " + + coords.left + "px; width: 2px;"); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } + } + + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). + function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) margin = 0; + for (var limit = 0; limit < 5; limit++) { + var changed = false, coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left), + Math.min(coords.top, endCoords.top) - margin, + Math.max(coords.left, endCoords.left), + Math.max(coords.bottom, endCoords.bottom) + margin); + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + setScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true; + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true; + } + if (!changed) break; + } + return coords; + } + + // Scroll a given set of coordinates into view (immediately). + function scrollIntoView(cm, x1, y1, x2, y2) { + var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2); + if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop); + if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft); + } + + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. + function calculateScrollPos(cm, x1, y1, x2, y2) { + var display = cm.display, snapMargin = textHeight(cm.display); + if (y1 < 0) y1 = 0; + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), result = {}; + if (y2 - y1 > screen) y2 = y1 + screen; + var docBottom = cm.doc.height + paddingVert(display); + var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin; + if (y1 < screentop) { + result.scrollTop = atTop ? 0 : y1; + } else if (y2 > screentop + screen) { + var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen); + if (newTop != screentop) result.scrollTop = newTop; + } + + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); + var tooWide = x2 - x1 > screenw; + if (tooWide) x2 = x1 + screenw; + if (x1 < 10) + result.scrollLeft = 0; + else if (x1 < screenleft) + result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)); + else if (x2 > screenw + screenleft - 3) + result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw; + return result; + } + + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). + function addToScrollPos(cm, left, top) { + if (left != null || top != null) resolveScrollToPos(cm); + if (left != null) + cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left; + if (top != null) + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; + } + + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(), from = cur, to = cur; + if (!cm.options.lineWrapping) { + from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur; + to = Pos(cur.line, cur.ch + 1); + } + cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}; + } + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. + function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos; + if (range) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); + var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), + Math.min(from.top, to.top) - range.margin, + Math.max(from.right, to.right), + Math.max(from.bottom, to.bottom) + range.margin); + cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); + } + } + + // API UTILITIES + + // Indent the given line. The how parameter can be "smart", + // "add"/null, "subtract", or "prev". When aggressive is false + // (typically set to true for forced single-line indents), empty + // lines are not indented, and places where the mode returns Pass + // are left alone. + function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, state; + if (how == null) how = "add"; + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) how = "prev"; + else state = getStateBefore(cm, n); + } + + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) line.stateAfter = null; + var curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0; + how = "not"; + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass || indentation > 150) { + if (!aggressive) return; + how = "prev"; + } + } + if (how == "prev") { + if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize); + else indentation = 0; + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit; + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit; + } else if (typeof how == "number") { + indentation = curSpace + how; + } + indentation = Math.max(0, indentation); + + var indentString = "", pos = 0; + if (cm.options.indentWithTabs) + for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} + if (pos < indentation) indentString += spaceStr(indentation - pos); + + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i, new Range(pos, pos)); + break; + } + } + } + line.stateAfter = null; + } + + // Utility for applying a change to a line by handle or number, + // returning the number and optionally registering the line as + // changed. + function changeLine(doc, handle, changeType, op) { + var no = handle, line = handle; + if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle)); + else no = lineNo(handle); + if (no == null) return null; + if (op(line, no) && doc.cm) regLineChange(doc.cm, no, changeType); + return line; + } + + // Helper for deleting text near the selection(s), used to implement + // backspace, delete, and similar functionality. + function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, kill = []; + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]); + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop(); + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from; + break; + } + } + kill.push(toKill); + } + // Next, remove those actual ranges. + runInOp(cm, function() { + for (var i = kill.length - 1; i >= 0; i--) + replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); + ensureCursorVisible(cm); + }); + } + + // Used for horizontal relative motion. Dir is -1 or 1 (left or + // right), unit can be "char", "column" (like char, but doesn't + // cross line boundaries), "word" (across next word), or "group" (to + // the start of next group of word or non-word-non-whitespace + // chars). The visually param controls whether, in right-to-left + // text, direction 1 means to move towards the next index in the + // string, or towards the character to the right of the current + // position. The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosH(doc, pos, dir, unit, visually) { + var line = pos.line, ch = pos.ch, origDir = dir; + var lineObj = getLine(doc, line); + var possible = true; + function findNextLine() { + var l = line + dir; + if (l < doc.first || l >= doc.first + doc.size) return (possible = false); + line = l; + return lineObj = getLine(doc, l); + } + function moveOnce(boundToLine) { + var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true); + if (next == null) { + if (!boundToLine && findNextLine()) { + if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj); + else ch = dir < 0 ? lineObj.text.length : 0; + } else return (possible = false); + } else ch = next; + return true; + } + + if (unit == "char") moveOnce(); + else if (unit == "column") moveOnce(true); + else if (unit == "word" || unit == "group") { + var sawType = null, group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) break; + var cur = lineObj.text.charAt(ch) || "\n"; + var type = isWordChar(cur, helper) ? "w" + : group && cur == "\n" ? "n" + : !group || /\s/.test(cur) ? null + : "p"; + if (group && !first && !type) type = "s"; + if (sawType && sawType != type) { + if (dir < 0) {dir = 1; moveOnce();} + break; + } + + if (type) sawType = type; + if (dir > 0 && !moveOnce(!first)) break; + } + } + var result = skipAtomic(doc, Pos(line, ch), origDir, true); + if (!possible) result.hitSide = true; + return result; + } + + // For relative vertical movement. Dir may be -1 or 1. Unit can be + // "page" or "line". The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, x = pos.left, y; + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + for (;;) { + var target = coordsChar(cm, x, y); + if (!target.outside) break; + if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; } + y += dir * 5; + } + return target; + } + + // EDITOR METHODS + + // The publicly visible API. Note that methodOp(f) means + // 'wrap f in an operation, performed on its `this` parameter'. + + // This is not the complete set of editor methods. Most of the + // methods defined on the Doc type are also injected into + // CodeMirror.prototype, for backwards compatibility and + // convenience. + + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function(){window.focus(); this.display.input.focus();}, + + setOption: function(option, value) { + var options = this.options, old = options[option]; + if (options[option] == value && option != "mode") return; + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) + operation(this, optionHandlers[option])(this, value, old); + }, + + getOption: function(option) {return this.options[option];}, + getDoc: function() {return this.doc;}, + + addKeyMap: function(map, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); + }, + removeKeyMap: function(map) { + var maps = this.state.keyMaps; + for (var i = 0; i < maps.length; ++i) + if (maps[i] == map || maps[i].name == map) { + maps.splice(i, 1); + return true; + } + }, + + addOverlay: methodOp(function(spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); + if (mode.startState) throw new Error("Overlays may not be stateful."); + this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque}); + this.state.modeGen++; + regChange(this); + }), + removeOverlay: methodOp(function(spec) { + var overlays = this.state.overlays; + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec; + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1); + this.state.modeGen++; + regChange(this); + return; + } + } + }), + + indentLine: methodOp(function(n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) dir = this.options.smartIndent ? "smart" : "prev"; + else dir = dir ? "add" : "subtract"; + } + if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive); + }), + indentSelection: methodOp(function(how) { + var ranges = this.doc.sel.ranges, end = -1; + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (!range.empty()) { + var from = range.from(), to = range.to(); + var start = Math.max(end, from.line); + end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; + for (var j = start; j < end; ++j) + indentLine(this, j, how); + var newRanges = this.doc.sel.ranges; + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) + replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); + } else if (range.head.line > end) { + indentLine(this, range.head.line, how, true); + end = range.head.line; + if (i == this.doc.sel.primIndex) ensureCursorVisible(this); + } + } + }), + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos, precise) { + return takeToken(this, pos, precise); + }, + + getLineTokens: function(line, precise) { + return takeToken(this, Pos(line), precise, true); + }, + + getTokenTypeAt: function(pos) { + pos = clipPos(this.doc, pos); + var styles = getLineStyles(this, getLine(this.doc, pos.line)); + var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; + var type; + if (ch == 0) type = styles[2]; + else for (;;) { + var mid = (before + after) >> 1; + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid; + else if (styles[mid * 2 + 1] < ch) before = mid + 1; + else { type = styles[mid * 2 + 2]; break; } + } + var cut = type ? type.indexOf("cm-overlay ") : -1; + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1); + }, + + getModeAt: function(pos) { + var mode = this.doc.mode; + if (!mode.innerMode) return mode; + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode; + }, + + getHelper: function(pos, type) { + return this.getHelpers(pos, type)[0]; + }, + + getHelpers: function(pos, type) { + var found = []; + if (!helpers.hasOwnProperty(type)) return helpers; + var help = helpers[type], mode = this.getModeAt(pos); + if (typeof mode[type] == "string") { + if (help[mode[type]]) found.push(help[mode[type]]); + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]]; + if (val) found.push(val); + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]); + } else if (help[mode.name]) { + found.push(help[mode.name]); + } + for (var i = 0; i < help._global.length; i++) { + var cur = help._global[i]; + if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) + found.push(cur.val); + } + return found; + }, + + getStateAfter: function(line, precise) { + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); + return getStateBefore(this, line + 1, precise); + }, + + cursorCoords: function(start, mode) { + var pos, range = this.doc.sel.primary(); + if (start == null) pos = range.head; + else if (typeof start == "object") pos = clipPos(this.doc, start); + else pos = start ? range.from() : range.to(); + return cursorCoords(this, pos, mode || "page"); + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page"); + }, + + coordsChar: function(coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page"); + return coordsChar(this, coords.left, coords.top); + }, + + lineAtHeight: function(height, mode) { + height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; + return lineAtHeight(this.doc, height + this.display.viewOffset); + }, + heightAtLine: function(line, mode) { + var end = false, last = this.doc.first + this.doc.size - 1; + if (line < this.doc.first) line = this.doc.first; + else if (line > last) { line = last; end = true; } + var lineObj = getLine(this.doc, line); + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + + (end ? this.doc.height - heightAtLine(lineObj) : 0); + }, + + defaultTextHeight: function() { return textHeight(this.display); }, + defaultCharWidth: function() { return charWidth(this.display); }, + + setGutterMarker: methodOp(function(line, gutterID, value) { + return changeLine(this.doc, line, "gutter", function(line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) line.gutterMarkers = null; + return true; + }); + }), + + clearGutter: methodOp(function(gutterID) { + var cm = this, doc = cm.doc, i = doc.first; + doc.iter(function(line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + line.gutterMarkers[gutterID] = null; + regLineChange(cm, i, "gutter"); + if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null; + } + ++i; + }); + }), + + addLineWidget: methodOp(function(handle, node, options) { + return addLineWidget(this, handle, node, options); + }), + + removeLineWidget: function(widget) { widget.clear(); }, + + lineInfo: function(line) { + if (typeof line == "number") { + if (!isLine(this.doc, line)) return null; + var n = line; + line = getLine(this.doc, line); + if (!line) return null; + } else { + var n = lineNo(line); + if (n == null) return null; + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets}; + }, + + getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo};}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, left = pos.left; + node.style.position = "absolute"; + node.setAttribute("cm-ignore-events", "true"); + this.display.input.setUneditable(node); + display.sizer.appendChild(node); + if (vert == "over") { + top = pos.top; + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) + top = pos.top - node.offsetHeight; + else if (pos.bottom + node.offsetHeight <= vspace) + top = pos.bottom; + if (left + node.offsetWidth > hspace) + left = hspace - node.offsetWidth; + } + node.style.top = top + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") left = 0; + else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2; + node.style.left = left + "px"; + } + if (scroll) + scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight); + }, + + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + + execCommand: function(cmd) { + if (commands.hasOwnProperty(cmd)) + return commands[cmd](this); + }, + + findPosH: function(from, amount, unit, visually) { + var dir = 1; + if (amount < 0) { dir = -1; amount = -amount; } + for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { + cur = findPosH(this.doc, cur, dir, unit, visually); + if (cur.hitSide) break; + } + return cur; + }, + + moveH: methodOp(function(dir, unit) { + var cm = this; + cm.extendSelectionsBy(function(range) { + if (cm.display.shift || cm.doc.extend || range.empty()) + return findPosH(cm.doc, range.head, dir, unit, cm.options.rtlMoveVisually); + else + return dir < 0 ? range.from() : range.to(); + }, sel_move); + }), + + deleteH: methodOp(function(dir, unit) { + var sel = this.doc.sel, doc = this.doc; + if (sel.somethingSelected()) + doc.replaceSelection("", null, "+delete"); + else + deleteNearSelection(this, function(range) { + var other = findPosH(doc, range.head, dir, unit, false); + return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}; + }); + }), + + findPosV: function(from, amount, unit, goalColumn) { + var dir = 1, x = goalColumn; + if (amount < 0) { dir = -1; amount = -amount; } + for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) { + var coords = cursorCoords(this, cur, "div"); + if (x == null) x = coords.left; + else coords.left = x; + cur = findPosV(this, coords, dir, unit); + if (cur.hitSide) break; + } + return cur; + }, + + moveV: methodOp(function(dir, unit) { + var cm = this, doc = this.doc, goals = []; + var collapse = !cm.display.shift && !doc.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function(range) { + if (collapse) + return dir < 0 ? range.from() : range.to(); + var headPos = cursorCoords(cm, range.head, "div"); + if (range.goalColumn != null) headPos.left = range.goalColumn; + goals.push(headPos.left); + var pos = findPosV(cm, headPos, dir, unit); + if (unit == "page" && range == doc.sel.primary()) + addToScrollPos(cm, null, charCoords(cm, pos, "div").top - headPos.top); + return pos; + }, sel_move); + if (goals.length) for (var i = 0; i < doc.sel.ranges.length; i++) + doc.sel.ranges[i].goalColumn = goals[i]; + }), + + // Find the word at the given position (as returned by coordsChar). + findWordAt: function(pos) { + var doc = this.doc, line = getLine(doc, pos.line).text; + var start = pos.ch, end = pos.ch; + if (line) { + var helper = this.getHelper(pos, "wordChars"); + if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end; + var startChar = line.charAt(start); + var check = isWordChar(startChar, helper) + ? function(ch) { return isWordChar(ch, helper); } + : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);} + : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);}; + while (start > 0 && check(line.charAt(start - 1))) --start; + while (end < line.length && check(line.charAt(end))) ++end; + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)); + }, + + toggleOverwrite: function(value) { + if (value != null && value == this.state.overwrite) return; + if (this.state.overwrite = !this.state.overwrite) + addClass(this.display.cursorDiv, "CodeMirror-overwrite"); + else + rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); + + signal(this, "overwriteToggle", this, this.state.overwrite); + }, + hasFocus: function() { return this.display.input.getField() == activeElt(); }, + + scrollTo: methodOp(function(x, y) { + if (x != null || y != null) resolveScrollToPos(this); + if (x != null) this.curOp.scrollLeft = x; + if (y != null) this.curOp.scrollTop = y; + }), + getScrollInfo: function() { + var scroller = this.display.scroller; + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), clientWidth: displayWidth(this)}; + }, + + scrollIntoView: methodOp(function(range, margin) { + if (range == null) { + range = {from: this.doc.sel.primary().head, to: null}; + if (margin == null) margin = this.options.cursorScrollMargin; + } else if (typeof range == "number") { + range = {from: Pos(range, 0), to: null}; + } else if (range.from == null) { + range = {from: range, to: null}; + } + if (!range.to) range.to = range.from; + range.margin = margin || 0; + + if (range.from.line != null) { + resolveScrollToPos(this); + this.curOp.scrollToPos = range; + } else { + var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left), + Math.min(range.from.top, range.to.top) - range.margin, + Math.max(range.from.right, range.to.right), + Math.max(range.from.bottom, range.to.bottom) + range.margin); + this.scrollTo(sPos.scrollLeft, sPos.scrollTop); + } + }), + + setSize: methodOp(function(width, height) { + var cm = this; + function interpret(val) { + return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; + } + if (width != null) cm.display.wrapper.style.width = interpret(width); + if (height != null) cm.display.wrapper.style.height = interpret(height); + if (cm.options.lineWrapping) clearLineMeasurementCache(this); + var lineNo = cm.display.viewFrom; + cm.doc.iter(lineNo, cm.display.viewTo, function(line) { + if (line.widgets) for (var i = 0; i < line.widgets.length; i++) + if (line.widgets[i].noHScroll) { regLineChange(cm, lineNo, "widget"); break; } + ++lineNo; + }); + cm.curOp.forceUpdate = true; + signal(cm, "refresh", this); + }), + + operation: function(f){return runInOp(this, f);}, + + refresh: methodOp(function() { + var oldHeight = this.display.cachedTextHeight; + regChange(this); + this.curOp.forceUpdate = true; + clearCaches(this); + this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this); + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) + estimateLineHeights(this); + signal(this, "refresh", this); + }), + + swapDoc: methodOp(function(doc) { + var old = this.doc; + old.cm = null; + attachDoc(this, doc); + clearCaches(this); + this.display.input.reset(); + this.scrollTo(doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; + signalLater(this, "swapDoc", this, old); + return old; + }), + + 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;} + }; + eventMixin(CodeMirror); + + // OPTION DEFAULTS + + // The default configuration options. + var defaults = CodeMirror.defaults = {}; + // Functions to run when options are changed. + var optionHandlers = CodeMirror.optionHandlers = {}; + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) optionHandlers[name] = + notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle; + } + + // Passed to option handlers when there is no old value. + var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}}; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function(cm, val) { + cm.setValue(val); + }, true); + option("mode", null, function(cm, val) { + cm.doc.modeOption = val; + loadMode(cm); + }, true); + + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function(cm) { + resetModeState(cm); + clearCaches(cm); + regChange(cm); + }, true); + option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val) { + cm.options.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); + cm.refresh(); + }, true); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true); + option("electricChars", true); + option("inputStyle", mobile ? "contenteditable" : "textarea", function() { + throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME + }, true); + option("rtlMoveVisually", !windows); + option("wholeLineUpdateBefore", true); + + option("theme", "default", function(cm) { + themeChanged(cm); + guttersChanged(cm); + }, true); + option("keyMap", "default", function(cm, val, old) { + var next = getKeyMap(val); + var prev = old != CodeMirror.Init && getKeyMap(old); + if (prev && prev.detach) prev.detach(cm, next); + if (next.attach) next.attach(cm, prev || null); + }); + option("extraKeys", null); + + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("fixedGutter", true, function(cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("coverGutterNextToScrollbar", false, function(cm) {updateScrollbars(cm);}, true); + option("scrollbarStyle", "native", function(cm) { + initScrollbars(cm); + updateScrollbars(cm); + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); + }, true); + option("lineNumbers", false, function(cm) { + setGuttersForLineNumbers(cm.options); + guttersChanged(cm); + }, true); + option("firstLineNumber", 1, guttersChanged, true); + option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true); + option("showCursorWhenSelecting", false, updateSelection, true); + + option("resetSelectionOnContextMenu", true); + + option("readOnly", false, function(cm, val) { + if (val == "nocursor") { + onBlur(cm); + cm.display.input.blur(); + cm.display.disabled = true; + } else { + cm.display.disabled = false; + if (!val) cm.display.input.reset(); + } + }); + option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true); + option("dragDrop", true); + + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true, resetModeState, true); + option("addModeClass", false, resetModeState, true); + option("pollInterval", 100); + option("undoDepth", 200, function(cm, val){cm.doc.history.undoDepth = val;}); + option("historyEventDelay", 1250); + option("viewportMargin", 10, function(cm){cm.refresh();}, true); + option("maxHighlightLength", 10000, resetModeState, true); + option("moveInputWithCursor", true, function(cm, val) { + if (!val) cm.display.input.resetPosition(); + }); + + option("tabindex", null, function(cm, val) { + cm.display.input.getField().tabIndex = val || ""; + }); + option("autofocus", null); + + // MODE DEFINITION AND QUERYING + + // Known modes, by name and by MIME + var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + CodeMirror.defineMode = function(name, mode) { + if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; + if (arguments.length > 2) + mode.dependencies = Array.prototype.slice.call(arguments, 2); + modes[name] = mode; + }; + + CodeMirror.defineMIME = function(mime, spec) { + mimeModes[mime] = spec; + }; + + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. + CodeMirror.resolveMode = function(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec]; + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name]; + if (typeof found == "string") found = {name: found}; + spec = createObj(found, spec); + spec.name = found.name; + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return CodeMirror.resolveMode("application/xml"); + } + if (typeof spec == "string") return {name: spec}; + else return spec || {name: "null"}; + }; + + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. + CodeMirror.getMode = function(options, spec) { + var spec = CodeMirror.resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) return CodeMirror.getMode(options, "text/plain"); + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) continue; + if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop]; + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + if (spec.helperType) modeObj.helperType = spec.helperType; + if (spec.modeProps) for (var prop in spec.modeProps) + modeObj[prop] = spec.modeProps[prop]; + + return modeObj; + }; + + // Minimal default mode. + CodeMirror.defineMode("null", function() { + return {token: function(stream) {stream.skipToEnd();}}; + }); + CodeMirror.defineMIME("text/plain", "null"); + + // This can be used to attach properties to mode objects from + // outside the actual mode definition. + var modeExtensions = CodeMirror.modeExtensions = {}; + CodeMirror.extendMode = function(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); + copyObj(properties, exts); + }; + + // EXTENSIONS + + CodeMirror.defineExtension = function(name, func) { + CodeMirror.prototype[name] = func; + }; + CodeMirror.defineDocExtension = function(name, func) { + Doc.prototype[name] = func; + }; + CodeMirror.defineOption = option; + + var initHooks = []; + CodeMirror.defineInitHook = function(f) {initHooks.push(f);}; + + var helpers = CodeMirror.helpers = {}; + CodeMirror.registerHelper = function(type, name, value) { + if (!helpers.hasOwnProperty(type)) helpers[type] = CodeMirror[type] = {_global: []}; + helpers[type][name] = value; + }; + CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value); + helpers[type]._global.push({pred: predicate, val: value}); + }; + + // MODE STATE HANDLING + + // Utility functions for working with state. Exported because nested + // modes need to do this for their inner modes. + + var copyState = CodeMirror.copyState = function(mode, state) { + if (state === true) return state; + if (mode.copyState) return mode.copyState(state); + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) val = val.concat([]); + nstate[n] = val; + } + return nstate; + }; + + var startState = CodeMirror.startState = function(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; + }; + + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. + CodeMirror.innerMode = function(mode, state) { + while (mode.innerMode) { + var info = mode.innerMode(state); + if (!info || info.mode == mode) break; + state = info.state; + mode = info.mode; + } + return info || {mode: mode, state: state}; + }; + + // STANDARD COMMANDS + + // Commands are parameter-less actions that can be performed on an + // editor, mostly used for keybindings. + var commands = CodeMirror.commands = { + selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);}, + singleSelection: function(cm) { + cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); + }, + killLine: function(cm) { + deleteNearSelection(cm, function(range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length; + if (range.head.ch == len && range.head.line < cm.lastLine()) + return {from: range.head, to: Pos(range.head.line + 1, 0)}; + else + return {from: range.head, to: Pos(range.head.line, len)}; + } else { + return {from: range.from(), to: range.to()}; + } + }); + }, + deleteLine: function(cm) { + deleteNearSelection(cm, function(range) { + return {from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0))}; + }); + }, + delLineLeft: function(cm) { + deleteNearSelection(cm, function(range) { + return {from: Pos(range.from().line, 0), to: range.from()}; + }); + }, + delWrappedLineLeft: function(cm) { + deleteNearSelection(cm, function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({left: 0, top: top}, "div"); + return {from: leftPos, to: range.from()}; + }); + }, + delWrappedLineRight: function(cm) { + deleteNearSelection(cm, function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + return {from: range.from(), to: rightPos }; + }); + }, + undo: function(cm) {cm.undo();}, + redo: function(cm) {cm.redo();}, + undoSelection: function(cm) {cm.undoSelection();}, + redoSelection: function(cm) {cm.redoSelection();}, + goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));}, + goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));}, + goLineStart: function(cm) { + cm.extendSelectionsBy(function(range) { return lineStart(cm, range.head.line); }, + {origin: "+move", bias: 1}); + }, + goLineStartSmart: function(cm) { + cm.extendSelectionsBy(function(range) { + return lineStartSmart(cm, range.head); + }, {origin: "+move", bias: 1}); + }, + goLineEnd: function(cm) { + cm.extendSelectionsBy(function(range) { return lineEnd(cm, range.head.line); }, + {origin: "+move", bias: -1}); + }, + goLineRight: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + }, sel_move); + }, + goLineLeft: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + return cm.coordsChar({left: 0, top: top}, "div"); + }, sel_move); + }, + goLineLeftSmart: function(cm) { + cm.extendSelectionsBy(function(range) { + var top = cm.charCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({left: 0, top: top}, "div"); + if (pos.ch < cm.getLine(pos.line).search(/\S/)) return lineStartSmart(cm, range.head); + return pos; + }, sel_move); + }, + goLineUp: function(cm) {cm.moveV(-1, "line");}, + goLineDown: function(cm) {cm.moveV(1, "line");}, + goPageUp: function(cm) {cm.moveV(-1, "page");}, + goPageDown: function(cm) {cm.moveV(1, "page");}, + goCharLeft: function(cm) {cm.moveH(-1, "char");}, + goCharRight: function(cm) {cm.moveH(1, "char");}, + goColumnLeft: function(cm) {cm.moveH(-1, "column");}, + goColumnRight: function(cm) {cm.moveH(1, "column");}, + goWordLeft: function(cm) {cm.moveH(-1, "word");}, + goGroupRight: function(cm) {cm.moveH(1, "group");}, + goGroupLeft: function(cm) {cm.moveH(-1, "group");}, + goWordRight: function(cm) {cm.moveH(1, "word");}, + delCharBefore: function(cm) {cm.deleteH(-1, "char");}, + delCharAfter: function(cm) {cm.deleteH(1, "char");}, + delWordBefore: function(cm) {cm.deleteH(-1, "word");}, + delWordAfter: function(cm) {cm.deleteH(1, "word");}, + delGroupBefore: function(cm) {cm.deleteH(-1, "group");}, + delGroupAfter: function(cm) {cm.deleteH(1, "group");}, + indentAuto: function(cm) {cm.indentSelection("smart");}, + indentMore: function(cm) {cm.indentSelection("add");}, + indentLess: function(cm) {cm.indentSelection("subtract");}, + insertTab: function(cm) {cm.replaceSelection("\t");}, + insertSoftTab: function(cm) { + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(new Array(tabSize - col % tabSize + 1).join(" ")); + } + cm.replaceSelections(spaces); + }, + defaultTab: function(cm) { + if (cm.somethingSelected()) cm.indentSelection("add"); + else cm.execCommand("insertTab"); + }, + transposeChars: function(cm) { + runInOp(cm, function() { + var ranges = cm.listSelections(), newSel = []; + for (var i = 0; i < ranges.length; i++) { + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; + if (line) { + if (cur.ch == line.length) cur = new Pos(cur.line, cur.ch - 1); + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1); + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), + Pos(cur.line, cur.ch - 2), cur, "+transpose"); + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text; + if (prev) + cm.replaceRange(line.charAt(0) + "\n" + prev.charAt(prev.length - 1), + Pos(cur.line - 1, prev.length - 1), Pos(cur.line, 1), "+transpose"); + } + } + newSel.push(new Range(cur, cur)); + } + cm.setSelections(newSel); + }); + }, + newlineAndIndent: function(cm) { + runInOp(cm, function() { + var len = cm.listSelections().length; + for (var i = 0; i < len; i++) { + var range = cm.listSelections()[i]; + cm.replaceRange("\n", range.anchor, range.head, "+input"); + cm.indentLine(range.from().line + 1, null, true); + ensureCursorVisible(cm); + } + }); + }, + toggleOverwrite: function(cm) {cm.toggleOverwrite();} + }; + + + // STANDARD KEYMAPS + + var keyMap = CodeMirror.keyMap = {}; + + keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", + "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", + "Esc": "singleSelection" + }; + // Note that the save and find-related commands aren't defined by + // default. User code or addons can define them. Unknown commands + // are simply ignored. + keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", + "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", + fallthrough: "basic" + }; + // Very basic readline/emacs-style bindings, which are standard on Mac. + keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" + }; + keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", + "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", + fallthrough: ["basic", "emacsy"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + + // KEYMAP DISPATCH + + function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/), name = parts[parts.length - 1]; + var alt, ctrl, shift, cmd; + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i]; + if (/^(cmd|meta|m)$/i.test(mod)) cmd = true; + else if (/^a(lt)?$/i.test(mod)) alt = true; + else if (/^(c|ctrl|control)$/i.test(mod)) ctrl = true; + else if (/^s(hift)$/i.test(mod)) shift = true; + else throw new Error("Unrecognized modifier name: " + mod); + } + if (alt) name = "Alt-" + name; + if (ctrl) name = "Ctrl-" + name; + if (cmd) name = "Cmd-" + name; + if (shift) name = "Shift-" + name; + return name; + } + + // This is a kludge to keep keymaps mostly working as raw objects + // (backwards compatibility) while at the same time support features + // like normalization and multi-stroke key bindings. It compiles a + // new normalized keymap, and then updates the old object to reflect + // this. + CodeMirror.normalizeKeyMap = function(keymap) { + var copy = {}; + for (var keyname in keymap) if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname]; + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) continue; + if (value == "...") { delete keymap[keyname]; continue; } + + var keys = map(keyname.split(" "), normalizeKeyName); + for (var i = 0; i < keys.length; i++) { + var val, name; + if (i == keys.length - 1) { + name = keyname; + val = value; + } else { + name = keys.slice(0, i + 1).join(" "); + val = "..."; + } + var prev = copy[name]; + if (!prev) copy[name] = val; + else if (prev != val) throw new Error("Inconsistent bindings for " + name); + } + delete keymap[keyname]; + } + for (var prop in copy) keymap[prop] = copy[prop]; + return keymap; + }; + + var lookupKey = CodeMirror.lookupKey = function(key, map, handle, context) { + map = getKeyMap(map); + var found = map.call ? map.call(key, context) : map[key]; + if (found === false) return "nothing"; + if (found === "...") return "multi"; + if (found != null && handle(found)) return "handled"; + + if (map.fallthrough) { + if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") + return lookupKey(key, map.fallthrough, handle, context); + for (var i = 0; i < map.fallthrough.length; i++) { + var result = lookupKey(key, map.fallthrough[i], handle, context); + if (result) return result; + } + } + }; + + // Modifier key presses don't count as 'real' key presses for the + // purpose of keymap fallthrough. + var isModifierKey = CodeMirror.isModifierKey = function(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; + }; + + // Look up the name of a key as indicated by an event object. + var keyName = CodeMirror.keyName = function(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) return false; + var base = keyNames[event.keyCode], name = base; + if (name == null || event.altGraphKey) return false; + if (event.altKey && base != "Alt") name = "Alt-" + name; + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") name = "Ctrl-" + name; + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") name = "Cmd-" + name; + if (!noShift && event.shiftKey && base != "Shift") name = "Shift-" + name; + return name; + }; + + function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val; + } + + // FROMTEXTAREA + + CodeMirror.fromTextArea = function(textarea, options) { + options = options ? copyObj(options) : {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabIndex) + options.tabindex = textarea.tabIndex; + if (!options.placeholder && textarea.placeholder) + options.placeholder = textarea.placeholder; + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt(); + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + + function save() {textarea.value = cm.getValue();} + if (textarea.form) { + on(textarea.form, "submit", save); + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form, realSubmit = form.submit; + try { + var wrappedSubmit = form.submit = function() { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch(e) {} + } + } + + options.finishInit = function(cm) { + cm.save = save; + cm.getTextArea = function() { return textarea; }; + cm.toTextArea = function() { + cm.toTextArea = isNaN; // Prevent this from being ran twice + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (typeof textarea.form.submit == "function") + textarea.form.submit = realSubmit; + } + }; + }; + + textarea.style.display = "none"; + var cm = CodeMirror(function(node) { + textarea.parentNode.insertBefore(node, textarea.nextSibling); + }, options); + return cm; + }; + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + var StringStream = CodeMirror.StringStream = function(string, tabSize) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + }; + + StringStream.prototype = { + eol: function() {return this.pos >= this.string.length;}, + sol: function() {return this.pos == this.lineStart;}, + peek: function() {return this.string.charAt(this.pos) || undefined;}, + next: function() { + if (this.pos < this.string.length) + return this.string.charAt(this.pos++); + }, + eat: function(match) { + var ch = this.string.charAt(this.pos); + if (typeof match == "string") var ok = ch == match; + else var ok = ch && (match.test ? match.test(ch) : match(ch)); + if (ok) {++this.pos; return ch;} + }, + eatWhile: function(match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start; + }, + eatSpace: function() { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; + return this.pos > start; + }, + skipToEnd: function() {this.pos = this.string.length;}, + skipTo: function(ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true;} + }, + backUp: function(n) {this.pos -= n;}, + column: function() { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }, + indentation: function() { + return countColumn(this.string, null, this.tabSize) - + (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0); + }, + match: function(pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) this.pos += pattern.length; + return true; + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) return null; + if (match && consume !== false) this.pos += match[0].length; + return match; + } + }, + current: function(){return this.string.slice(this.start, this.pos);}, + hideFirstChars: function(n, inner) { + this.lineStart += n; + try { return inner(); } + finally { this.lineStart -= n; } + } + }; + + // TEXTMARKERS + + // Created with markText and setBookmark methods. A TextMarker is a + // handle that can be used to clear or find a marked position in the + // document. Line objects hold arrays (markedSpans) containing + // {from, to, marker} object pointing to such marker objects, and + // indicating that such a marker is present on that line. Multiple + // lines may point to the same marker when it spans across lines. + // The spans will have null for their from/to properties when the + // marker continues beyond the start/end of the line. Markers have + // links back to the lines they currently touch. + + var nextMarkerId = 0; + + var TextMarker = CodeMirror.TextMarker = function(doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + this.id = ++nextMarkerId; + }; + eventMixin(TextMarker); + + // Clear the marker. + TextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + var cm = this.doc.cm, withOp = cm && !cm.curOp; + if (withOp) startOperation(cm); + if (hasHandler(this, "clear")) { + var found = this.find(); + if (found) signalLater(this, "clear", found.from, found.to); + } + var min = null, max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (cm && !this.collapsed) regLineChange(cm, lineNo(line), "text"); + else if (cm) { + if (span.to != null) max = lineNo(line); + if (span.from != null) min = lineNo(line); + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) + updateLineHeight(line, textHeight(cm.display)); + } + if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) { + var visual = visualLine(this.lines[i]), len = lineLength(visual); + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; + } + } + + if (min != null && cm && this.collapsed) regChange(cm, min, max + 1); + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false; + if (cm) reCheckSelection(cm.doc); + } + if (cm) signalLater(cm, "markerCleared", cm, this); + if (withOp) endOperation(cm); + if (this.parent) this.parent.clear(); + }; + + // Find the position of the marker in the document. Returns a {from, + // to} object by default. Side can be passed to get a specific side + // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the + // Pos objects returned contain a line object, rather than a line + // number (used to prevent looking up the same line twice). + TextMarker.prototype.find = function(side, lineObj) { + if (side == null && this.type == "bookmark") side = 1; + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this); + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from); + if (side == -1) return from; + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to); + if (side == 1) return to; + } + } + return from && {from: from, to: to}; + }; + + // Signals that the marker's widget changed, and surrounding layout + // should be recomputed. + TextMarker.prototype.changed = function() { + var pos = this.find(-1, true), widget = this, cm = this.doc.cm; + if (!pos || !cm) return; + runInOp(cm, function() { + var line = pos.line, lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) { + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; + } + cm.curOp.updateMaxLine = true; + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; + if (dHeight) + updateLineHeight(line, line.height + dHeight); + } + }); + }; + + TextMarker.prototype.attachLine = function(line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) + (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); + } + this.lines.push(line); + }; + TextMarker.prototype.detachLine = function(line) { + this.lines.splice(indexOf(this.lines, line), 1); + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); + } + }; + + // Collapsed markers have unique ids, in order to be able to order + // them, which is needed for uniquely determining an outer marker + // when they overlap (they may nest, but not partially overlap). + var nextMarkerId = 0; + + // Create a marker, wire it up to the right lines, and + function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) return markTextShared(doc, from, to, options, type); + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type); + + var marker = new TextMarker(doc, type), diff = cmp(from, to); + if (options) copyObj(options, marker, false); + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) + return marker; + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true; + marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) marker.widgetNode.setAttribute("cm-ignore-events", "true"); + if (options.insertLeft) marker.widgetNode.insertLeft = true; + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || + from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) + throw new Error("Inserting collapsed marker partially overlapping an existing one"); + sawCollapsedSpans = true; + } + + if (marker.addToHistory) + addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); + + var curLine = from.line, cm = doc.cm, updateMaxLine; + doc.iter(curLine, to.line + 1, function(line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) + updateMaxLine = true; + if (marker.collapsed && curLine != from.line) updateLineHeight(line, 0); + addMarkedSpan(line, new MarkedSpan(marker, + curLine == from.line ? from.ch : null, + curLine == to.line ? to.ch : null)); + ++curLine; + }); + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) { + if (lineIsHidden(doc, line)) updateLineHeight(line, 0); + }); + + if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); }); + + if (marker.readOnly) { + sawReadOnlySpans = true; + if (doc.history.done.length || doc.history.undone.length) + doc.clearHistory(); + } + if (marker.collapsed) { + marker.id = ++nextMarkerId; + marker.atomic = true; + } + if (cm) { + // Sync editor state + if (updateMaxLine) cm.curOp.updateMaxLine = true; + if (marker.collapsed) + regChange(cm, from.line, to.line + 1); + else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) + for (var i = from.line; i <= to.line; i++) regLineChange(cm, i, "text"); + if (marker.atomic) reCheckSelection(cm.doc); + signalLater(cm, "markerAdded", cm, marker); + } + return marker; + } + + // SHARED TEXTMARKERS + + // A shared marker spans multiple linked documents. It is + // implemented as a meta-marker-object controlling multiple normal + // markers. + var SharedTextMarker = CodeMirror.SharedTextMarker = function(markers, primary) { + this.markers = markers; + this.primary = primary; + for (var i = 0; i < markers.length; ++i) + markers[i].parent = this; + }; + eventMixin(SharedTextMarker); + + SharedTextMarker.prototype.clear = function() { + if (this.explicitlyCleared) return; + this.explicitlyCleared = true; + for (var i = 0; i < this.markers.length; ++i) + this.markers[i].clear(); + signalLater(this, "clear"); + }; + SharedTextMarker.prototype.find = function(side, lineObj) { + return this.primary.find(side, lineObj); + }; + + function markTextShared(doc, from, to, options, type) { + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], primary = markers[0]; + var widget = options.widgetNode; + linkedDocs(doc, function(doc) { + if (widget) options.widgetNode = widget.cloneNode(true); + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); + for (var i = 0; i < doc.linked.length; ++i) + if (doc.linked[i].isParent) return; + primary = lst(markers); + }); + return new SharedTextMarker(markers, primary); + } + + function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), + function(m) { return m.parent; }); + } + + function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], pos = marker.find(); + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; + } + } + } + + function detachSharedMarkers(markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], linked = [marker.primary.doc];; + linkedDocs(marker.primary.doc, function(d) { linked.push(d); }); + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j]; + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null; + marker.markers.splice(j--, 1); + } + } + } + } + + // TEXTMARKER SPANS + + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; this.to = to; + } + + // Search an array of spans for a span matching the given marker. + function getMarkedSpanFor(spans, marker) { + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) return span; + } + } + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). + function removeMarkedSpan(spans, span) { + for (var r, i = 0; i < spans.length; ++i) + if (spans[i] != span) (r || (r = [])).push(spans[i]); + return r; + } + // Add a span to a line. + function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.attachLine(line); + } + + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). + function markedSpansBefore(old, startCh, isInsert) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh); + (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); + } + } + return nw; + } + function markedSpansAfter(old, endCh, isInsert) { + if (old) for (var i = 0, nw; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh); + (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)); + } + } + return nw; + } + + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. + function stretchSpansOverChange(doc, change) { + if (change.full) return null; + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) return null; + + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) span.to = startCh; + else if (sameLine) span.to = found.to == null ? null : found.to + offset; + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i = 0; i < last.length; ++i) { + var span = last[i]; + if (span.to != null) span.to += offset; + if (span.from == null) { + var found = getMarkedSpanFor(first, span.marker); + if (!found) { + span.from = offset; + if (sameLine) (first || (first = [])).push(span); + } + } else { + span.from += offset; + if (sameLine) (first || (first = [])).push(span); + } + } + } + // Make sure we didn't create any zero-length spans + if (first) first = clearEmptySpans(first); + if (last && last != first) last = clearEmptySpans(last); + + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, gapMarkers; + if (gap > 0 && first) + for (var i = 0; i < first.length; ++i) + if (first[i].to == null) + (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i].marker, null, null)); + for (var i = 0; i < gap; ++i) + newMarkers.push(gapMarkers); + newMarkers.push(last); + } + return newMarkers; + } + + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. + function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) + spans.splice(i--, 1); + } + if (!spans.length) return null; + return spans; + } + + // Used for un/re-doing changes from the history. Combines the + // result of computing the existing spans with the set of spans that + // existed in the history (so that deleting around a span and then + // undoing brings back the span). + function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); + if (!old) return stretched; + if (!stretched) return old; + + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], stretchCur = stretched[i]; + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j]; + for (var k = 0; k < oldCur.length; ++k) + if (oldCur[k].marker == span.marker) continue spans; + oldCur.push(span); + } + } else if (stretchCur) { + old[i] = stretchCur; + } + } + return old; + } + + // Used to 'clip' out readOnly ranges when making a change. + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function(line) { + if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + (markers || (markers = [])).push(mark); + } + }); + if (!markers) return null; + var parts = [{from: from, to: to}]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], m = mk.find(0); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) continue; + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) + newParts.push({from: p.from, to: m.from}); + if (dto > 0 || !mk.inclusiveRight && !dto) + newParts.push({from: m.to, to: p.to}); + parts.splice.apply(parts, newParts); + j += newParts.length - 1; + } + } + return parts; + } + + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.detachLine(line); + line.markedSpans = null; + } + function attachMarkedSpans(line, spans) { + if (!spans) return; + for (var i = 0; i < spans.length; ++i) + spans[i].marker.attachLine(line); + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. + function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0; } + function extraRight(marker) { return marker.inclusiveRight ? 1 : 0; } + + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. + function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length; + if (lenDiff != 0) return lenDiff; + var aPos = a.find(), bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); + if (fromCmp) return -fromCmp; + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); + if (toCmp) return toCmp; + return b.id - a.id; + } + + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. + function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) + found = sp.marker; + } + return found; + } + function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true); } + function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false); } + + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. + function conflictingCollapsedRange(doc, lineNo, from, to, marker) { + var line = getLine(doc, lineNo); + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (!sp.marker.collapsed) continue; + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue; + if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) || + fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight))) + return true; + } + } + + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). + function visualLine(line) { + var merged; + while (merged = collapsedSpanAtStart(line)) + line = merged.find(-1, true).line; + return line; + } + + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + (lines || (lines = [])).push(line); + } + return lines; + } + + // Get the line number of the start of the visual line that the + // given line number is part of. + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), vis = visualLine(line); + if (line == vis) return lineN; + return lineNo(vis); + } + // Get the line number of the start of the next visual line after + // the given line. + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) return lineN; + var line = getLine(doc, lineN), merged; + if (!lineIsHidden(doc, line)) return lineN; + while (merged = collapsedSpanAtEnd(line)) + line = merged.find(1, true).line; + return lineNo(line) + 1; + } + + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) for (var sp, i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) continue; + if (sp.from == null) return true; + if (sp.marker.widgetNode) continue; + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) + return true; + } + } + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)); + } + if (span.marker.inclusiveRight && span.to == line.text.length) + return true; + for (var sp, i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && + (sp.to == null || sp.to != span.from) && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(doc, line, sp)) return true; + } + } + + // LINE WIDGETS + + // Line widgets are block elements displayed above or below a line. + + var LineWidget = CodeMirror.LineWidget = function(cm, node, options) { + if (options) for (var opt in options) if (options.hasOwnProperty(opt)) + this[opt] = options[opt]; + this.cm = cm; + this.node = node; + }; + eventMixin(LineWidget); + + function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + addToScrollPos(cm, null, diff); + } + + LineWidget.prototype.clear = function() { + var cm = this.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); + if (no == null || !ws) return; + for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); + if (!ws.length) line.widgets = null; + var height = widgetHeight(this); + runInOp(cm, function() { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + updateLineHeight(line, Math.max(0, line.height - height)); + }); + }; + LineWidget.prototype.changed = function() { + var oldH = this.height, cm = this.cm, line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) return; + runInOp(cm, function() { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + updateLineHeight(line, line.height + diff); + }); + }; + + function widgetHeight(widget) { + if (widget.height != null) return widget.height; + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) + parentStyle += "margin-left: -" + widget.cm.display.gutters.offsetWidth + "px;"; + if (widget.noHScroll) + parentStyle += "width: " + widget.cm.display.wrapper.clientWidth + "px;"; + removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.offsetHeight; + } + + function addLineWidget(cm, handle, node, options) { + var widget = new LineWidget(cm, node, options); + if (widget.noHScroll) cm.display.alignWidgets = true; + changeLine(cm.doc, handle, "widget", function(line) { + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) widgets.push(widget); + else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); + widget.line = line; + if (!lineIsHidden(cm.doc, line)) { + var aboveVisible = heightAtLine(line) < cm.doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) addToScrollPos(cm, null, widget.height); + cm.curOp.forceUpdate = true; + } + return true; + }); + return widget; + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + var Line = CodeMirror.Line = function(text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; + }; + eventMixin(Line); + Line.prototype.lineNo = function() { return lineNo(this); }; + + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) line.stateAfter = null; + if (line.styles) line.styles = null; + if (line.order != null) line.order = null; + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) updateLineHeight(line, estHeight); + } + + // Detach a line from the document tree and its markers. + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + function extractLineClasses(type, output) { + if (type) for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) break; + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) + output[prop] = lineClass[2]; + else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) + output[prop] += " " + lineClass[2]; + } + return type; + } + + function callBlankLine(mode, state) { + if (mode.blankLine) return mode.blankLine(state); + if (!mode.innerMode) return; + var inner = CodeMirror.innerMode(mode, state); + if (inner.mode.blankLine) return inner.mode.blankLine(inner.state); + } + + function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) inner[0] = CodeMirror.innerMode(mode, state).mode; + var style = mode.token(stream, state); + if (stream.pos > stream.start) return style; + } + throw new Error("Mode " + mode.name + " failed to advance stream."); + } + + // Utility for getTokenAt and getLineTokens + function takeToken(cm, pos, precise, asArray) { + function getObj(copy) { + return {start: stream.start, end: stream.pos, + string: stream.current(), + type: style || null, + state: copy ? copyState(doc.mode, state) : state}; + } + + var doc = cm.doc, mode = doc.mode, style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize), tokens; + if (asArray) tokens = []; + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos; + style = readToken(mode, stream, state); + if (asArray) tokens.push(getObj(true)); + } + return asArray ? tokens : getObj(); + } + + // Run the given mode's parser over a line, calling f for each token. + function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) flattenSpans = cm.options.flattenSpans; + var curStart = 0, curStyle = null; + var stream = new StringStream(text, cm.options.tabSize), style; + var inner = cm.options.addModeClass && [null]; + if (text == "") extractLineClasses(callBlankLine(mode, state), lineClasses); + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false; + if (forceToEnd) processLine(cm, text, state, stream.pos); + stream.pos = text.length; + style = null; + } else { + style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses); + } + if (inner) { + var mName = inner[0].name; + if (mName) style = "m-" + (style ? mName + " " + style : mName); + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 50000); + f(curStart, curStyle); + } + curStyle = style; + } + stream.start = stream.pos; + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 characters + var pos = Math.min(stream.pos, curStart + 50000); + f(pos, curStyle); + curStart = pos; + } + } + + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. + function highlightLine(cm, line, state, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], lineClasses = {}; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, state, function(end, style) { + st.push(end, style); + }, lineClasses, forceToEnd); + + // Run overlays, adjust style array. + for (var o = 0; o < cm.state.overlays.length; ++o) { + var overlay = cm.state.overlays[o], i = 1, at = 0; + runMode(cm, line.text, overlay.mode, true, function(end, style) { + var start = i; + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i]; + if (i_end > end) + st.splice(i, 1, end, st[i+1], i_end); + i += 2; + at = Math.min(end, i_end); + } + if (!style) return; + if (overlay.opaque) { + st.splice(start, i - start, end, "cm-overlay " + style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start+1]; + st[start+1] = (cur ? cur + " " : "") + "cm-overlay " + style; + } + } + }, lineClasses); + } + + return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}; + } + + function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var result = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line))); + line.styles = result.styles; + if (result.classes) line.styleClasses = result.classes; + else if (line.styleClasses) line.styleClasses = null; + if (updateFrontier === cm.doc.frontier) cm.doc.frontier++; + } + return line.styles; + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. Used for lines that + // aren't currently visible. + function processLine(cm, text, state, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize); + stream.start = stream.pos = startAt || 0; + if (text == "") callBlankLine(mode, state); + while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) { + readToken(mode, stream, state); + stream.start = stream.pos; + } + } + + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. + var styleToClassCache = {}, styleToClassCacheWithMode = {}; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) return null; + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + return cache[style] || + (cache[style] = style.replace(/\S+/g, "cm-$&")); + } + + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = {pre: elt("pre", [content]), content: content, col: 0, pos: 0, cm: cm}; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, order; + builder.pos = 0; + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if ((ie || webkit) && cm.getOption("lineWrapping")) + builder.addToken = buildTokenSplitSpaces(builder.addToken); + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) + builder.addToken = buildTokenBadBidi(builder.addToken, order); + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) + builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); + if (line.styleClasses.textClass) + builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) + builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map); + (lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + // See issue #2901 + if (webkit && /\bcm-tab\b/.test(builder.content.lastChild.className)) + builder.content.className = "cm-tab-wrap-hack"; + + signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) + builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); + + return builder; + } + + function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); + return token; + } + + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, title, css) { + if (!text) return; + var special = builder.cm.options.specialChars, mustWrap = false; + if (!special.test(text)) { + builder.col += text.length; + var content = document.createTextNode(text); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) mustWrap = true; + builder.pos += text.length; + } else { + var content = document.createDocumentFragment(), pos = 0; + while (true) { + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + var txt = document.createTextNode(text.slice(pos, pos + skipped)); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; + } + if (!m) break; + pos += skipped + 1; + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; + var txt = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt.setAttribute("role", "presentation"); + txt.setAttribute("cm-text", "\t"); + builder.col += tabWidth; + } else { + var txt = builder.cm.options.specialCharPlaceholder(m[0]); + txt.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); + builder.col += 1; + } + builder.map.push(builder.pos, builder.pos + 1, txt); + builder.pos++; + } + } + if (style || startStyle || endStyle || mustWrap || css) { + var fullStyle = style || ""; + if (startStyle) fullStyle += startStyle; + if (endStyle) fullStyle += endStyle; + var token = elt("span", [content], fullStyle, css); + if (title) token.title = title; + return builder.content.appendChild(token); + } + builder.content.appendChild(content); + } + + function buildTokenSplitSpaces(inner) { + function split(old) { + var out = " "; + for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; + out += " "; + return out; + } + return function(builder, text, style, startStyle, endStyle, title) { + inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title); + }; + } + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { + return function(builder, text, style, startStyle, endStyle, title) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + for (var i = 0; i < order.length; i++) { + var part = order[i]; + if (part.to > start && part.from <= start) break; + } + if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title); + inner(builder, text.slice(0, part.to - start), style, startStyle, null, title); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; + } + }; + } + + function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode; + if (widget) builder.map.push(builder.pos, builder.pos + size, widget); + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) + widget = builder.content.appendChild(document.createElement("span")); + widget.setAttribute("cm-marker", marker.id); + } + if (widget) { + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); + } + builder.pos += size; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, allText = line.text, at = 0; + if (!spans) { + for (var i = 1; i < styles.length; i+=2) + builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options)); + return; + } + + var len = allText.length, pos = 0, i = 1, text = "", style, css; + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed; + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = title = css = ""; + collapsed = null; nextChange = Infinity; + var foundBookmarks = []; + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker; + if (sp.from <= pos && (sp.to == null || sp.to > pos)) { + if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; } + if (m.className) spanStyle += " " + m.className; + if (m.css) css = m.css; + if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; + if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle; + if (m.title && !title) title = m.title; + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) + collapsed = sp; + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) foundBookmarks.push(m); + } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, + collapsed.marker, collapsed.from == null); + if (collapsed.to == null) return; + } + if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) + buildCollapsedSpan(builder, 0, foundBookmarks[j]); + } + if (pos >= len) break; + + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css); + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} + pos = end; + spanStartStyle = ""; + } + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); + } + } + } + + // DOCUMENT DATA STRUCTURE + + // By default, updates that start and end at the beginning of a line + // are treated specially, in order to make the association of line + // widgets and marker elements with the text behave more intuitive. + function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && + (!doc.cm || doc.cm.options.wholeLineUpdateBefore); + } + + // Perform a change on the document data structure. + function updateDoc(doc, change, markedSpans, estimateHeight) { + function spansFor(n) {return markedSpans ? markedSpans[n] : null;} + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight); + signalLater(line, "change", line, change); + } + function linesFor(start, end) { + for (var i = start, result = []; i < end; ++i) + result.push(new Line(text[i], spansFor(i), estimateHeight)); + return result; + } + + var from = change.from, to = change.to, text = change.text; + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)); + doc.remove(text.length, doc.size - text.length); + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1); + update(lastLine, lastLine.text, lastSpans); + if (nlines) doc.remove(from.line, nlines); + if (added.length) doc.insert(from.line, added); + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + } else { + var added = linesFor(1, text.length - 1); + added.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added); + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + var added = linesFor(1, text.length - 1); + if (nlines > 1) doc.remove(from.line + 1, nlines - 1); + doc.insert(from.line + 1, added); + } + + signalLater(doc, "change", doc, change); + } + + // The document is represented as a BTree consisting of leaves, with + // chunk of lines in them, and branches, with up to ten leaves or + // other branch nodes below them. The top node is always a branch + // node, and is the document object itself (meaning it has + // additional methods and properties). + // + // All nodes have parent links. The tree is used both to go from + // line numbers to line objects, and to go from objects to numbers. + // It also indexes by height, and is used to convert between height + // and line object, and to find the total height of the document. + // + // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + + function LeafChunk(lines) { + this.lines = lines; + this.parent = null; + for (var i = 0, height = 0; i < lines.length; ++i) { + lines[i].parent = this; + height += lines[i].height; + } + this.height = height; + } + + LeafChunk.prototype = { + chunkSize: function() { return this.lines.length; }, + // Remove the n lines at offset 'at'. + removeInner: function(at, n) { + for (var i = at, e = at + n; i < e; ++i) { + var line = this.lines[i]; + this.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); + } + this.lines.splice(at, n); + }, + // Helper used to collapse a small branch into a single leaf. + 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(at, lines, height) { + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0; i < lines.length; ++i) lines[i].parent = this; + }, + // Used to iterate over a part of the tree. + iterN: function(at, n, op) { + for (var e = at + n; at < e; ++at) + if (op(this.lines[at])) return true; + } + }; + + function BranchChunk(children) { + this.children = children; + var size = 0, height = 0; + for (var i = 0; i < children.length; ++i) { + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this; + } + this.size = size; + this.height = height; + this.parent = null; + } + + BranchChunk.prototype = { + chunkSize: function() { return this.size; }, + removeInner: function(at, n) { + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.removeInner(at, rm); + this.height -= oldHeight - child.height; + if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } + if ((n -= rm) == 0) break; + at = 0; + } else at -= sz; + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && + (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + collapse: function(lines) { + for (var i = 0; i < this.children.length; ++i) this.children[i].collapse(lines); + }, + insertInner: function(at, lines, height) { + this.size += lines.length; + this.height += height; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at <= sz) { + child.insertInner(at, lines, height); + if (child.lines && child.lines.length > 50) { + while (child.lines.length > 50) { + var spilled = child.lines.splice(child.lines.length - 25, 25); + var newleaf = new LeafChunk(spilled); + child.height -= newleaf.height; + this.children.splice(i + 1, 0, newleaf); + newleaf.parent = this; + } + this.maybeSpill(); + } + break; + } + at -= sz; + } + }, + // When a node has grown, check whether it should be split. + maybeSpill: function() { + if (this.children.length <= 10) return; + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10); + me.parent.maybeSpill(); + }, + iterN: function(at, n, op) { + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) return true; + if ((n -= used) == 0) break; + at = 0; + } else at -= sz; + } + } + }; + + var nextDocId = 0; + var Doc = CodeMirror.Doc = function(text, mode, firstLine) { + if (!(this instanceof Doc)) return new Doc(text, mode, firstLine); + if (firstLine == null) firstLine = 0; + + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.cleanGeneration = 1; + this.frontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = simpleSelection(start); + this.history = new History(null); + this.id = ++nextDocId; + this.modeOption = mode; + + if (typeof text == "string") text = splitLines(text); + updateDoc(this, {from: start, to: start, text: text}); + setSelection(this, simpleSelection(start), sel_dontScroll); + }; + + Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function(from, to, op) { + if (op) this.iterN(from - this.first, to - from, op); + else this.iterN(this.first, this.first + this.size, from); + }, + + // Non-public interface for adding and removing lines. + insert: function(at, lines) { + var height = 0; + for (var i = 0; i < lines.length; ++i) height += lines[i].height; + this.insertInner(at - this.first, lines, height); + }, + remove: function(at, n) { this.removeInner(at - this.first, n); }, + + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function(lineSep) { + var lines = getLines(this, this.first, this.first + this.size); + if (lineSep === false) return lines; + return lines.join(lineSep || "\n"); + }, + setValue: docMethodOp(function(code) { + var top = Pos(this.first, 0), last = this.first + this.size - 1; + makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), + text: splitLines(code), origin: "setValue", full: true}, true); + setSelection(this, simpleSelection(top)); + }), + replaceRange: function(code, from, to, origin) { + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); + }, + getRange: function(from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); + if (lineSep === false) return lines; + return lines.join(lineSep || "\n"); + }, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;}, + + getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);}, + getLineNumber: function(line) {return lineNo(line);}, + + getLineHandleVisualStart: function(line) { + if (typeof line == "number") line = getLine(this, line); + return visualLine(line); + }, + + lineCount: function() {return this.size;}, + firstLine: function() {return this.first;}, + lastLine: function() {return this.first + this.size - 1;}, + + clipPos: function(pos) {return clipPos(this, pos);}, + + getCursor: function(start) { + var range = this.sel.primary(), pos; + if (start == null || start == "head") pos = range.head; + else if (start == "anchor") pos = range.anchor; + else if (start == "end" || start == "to" || start === false) pos = range.to(); + else pos = range.from(); + return pos; + }, + listSelections: function() { return this.sel.ranges; }, + somethingSelected: function() {return this.sel.somethingSelected();}, + + setCursor: docMethodOp(function(line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); + }), + setSelection: docMethodOp(function(anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); + }), + extendSelection: docMethodOp(function(head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); + }), + extendSelections: docMethodOp(function(heads, options) { + extendSelections(this, clipPosArray(this, heads, options)); + }), + extendSelectionsBy: docMethodOp(function(f, options) { + extendSelections(this, map(this.sel.ranges, f), options); + }), + setSelections: docMethodOp(function(ranges, primary, options) { + if (!ranges.length) return; + for (var i = 0, out = []; i < ranges.length; i++) + out[i] = new Range(clipPos(this, ranges[i].anchor), + clipPos(this, ranges[i].head)); + if (primary == null) primary = Math.min(ranges.length - 1, this.sel.primIndex); + setSelection(this, normalizeSelection(out, primary), options); + }), + addSelection: docMethodOp(function(anchor, head, options) { + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(ranges, ranges.length - 1), options); + }), + + getSelection: function(lineSep) { + var ranges = this.sel.ranges, lines; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; + } + if (lineSep === false) return lines; + else return lines.join(lineSep || "\n"); + }, + getSelections: function(lineSep) { + var parts = [], ranges = this.sel.ranges; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) sel = sel.join(lineSep || "\n"); + parts[i] = sel; + } + return parts; + }, + replaceSelection: function(code, collapse, origin) { + var dup = []; + for (var i = 0; i < this.sel.ranges.length; i++) + dup[i] = code; + this.replaceSelections(dup, collapse, origin || "+input"); + }, + replaceSelections: docMethodOp(function(code, collapse, origin) { + var changes = [], sel = this.sel; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + changes[i] = {from: range.from(), to: range.to(), text: splitLines(code[i]), origin: origin}; + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); + for (var i = changes.length - 1; i >= 0; i--) + makeChange(this, changes[i]); + if (newSel) setSelectionReplaceHistory(this, newSel); + else if (this.cm) ensureCursorVisible(this.cm); + }), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), + + setExtending: function(val) {this.extend = val;}, + getExtending: function() {return this.extend;}, + + historySize: function() { + var hist = this.history, done = 0, undone = 0; + for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done; + for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone; + return {undo: done, redo: undone}; + }, + clearHistory: function() {this.history = new History(this.history.maxGeneration);}, + + markClean: function() { + this.cleanGeneration = this.changeGeneration(true); + }, + changeGeneration: function(forceSplit) { + if (forceSplit) + this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; + return this.history.generation; + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration); + }, + + getHistory: function() { + return {done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone)}; + }, + setHistory: function(histData) { + var hist = this.history = new History(this.history.maxGeneration); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); + }, + + addLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + if (!line[prop]) line[prop] = cls; + else if (classTest(cls).test(line[prop])) return false; + else line[prop] += " " + cls; + return true; + }); + }), + removeLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function(line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) return false; + else if (cls == null) line[prop] = null; + else { + var found = cur.match(classTest(cls)); + if (!found) return false; + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; + } + return true; + }); + }), + + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, shared: options && options.shared}; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark"); + }, + findMarksAt: function(pos) { + pos = clipPos(this, pos); + var markers = [], spans = getLine(this, pos.line).markedSpans; + if (spans) for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + markers.push(span.marker.parent || span.marker); + } + return markers; + }, + findMarks: function(from, to, filter) { + from = clipPos(this, from); to = clipPos(this, to); + var found = [], lineNo = from.line; + this.iter(from.line, to.line + 1, function(line) { + var spans = line.markedSpans; + if (spans) for (var i = 0; i < spans.length; i++) { + var span = spans[i]; + if (!(lineNo == from.line && from.ch > span.to || + span.from == null && lineNo != from.line|| + lineNo == to.line && span.from > to.ch) && + (!filter || filter(span.marker))) + found.push(span.marker.parent || span.marker); + } + ++lineNo; + }); + return found; + }, + getAllMarks: function() { + var markers = []; + this.iter(function(line) { + var sps = line.markedSpans; + if (sps) for (var i = 0; i < sps.length; ++i) + if (sps[i].from != null) markers.push(sps[i].marker); + }); + return markers; + }, + + posFromIndex: function(off) { + var ch, lineNo = this.first; + this.iter(function(line) { + var sz = line.text.length + 1; + if (sz > off) { ch = off; return true; } + off -= sz; + ++lineNo; + }); + return clipPos(this, Pos(lineNo, ch)); + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords); + var index = coords.ch; + if (coords.line < this.first || coords.ch < 0) return 0; + this.iter(this.first, coords.line, function (line) { + index += line.text.length + 1; + }); + return index; + }, + + copy: function(copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first); + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; + doc.sel = this.sel; + doc.extend = false; + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); + } + return doc; + }, + + linkedDoc: function(options) { + if (!options) options = {}; + var from = this.first, to = this.first + this.size; + if (options.from != null && options.from > from) from = options.from; + if (options.to != null && options.to < to) to = options.to; + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from); + if (options.sharedHist) copy.history = this.history; + (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; + copySharedMarkers(copy, findSharedMarkers(this)); + return copy; + }, + unlinkDoc: function(other) { + if (other instanceof CodeMirror) other = other.doc; + if (this.linked) for (var i = 0; i < this.linked.length; ++i) { + var link = this.linked[i]; + if (link.doc != other) continue; + this.linked.splice(i, 1); + other.unlinkDoc(this); + detachSharedMarkers(findSharedMarkers(this)); + break; + } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id]; + linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true); + other.history = new History(null); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); + } + }, + iterLinkedDocs: function(f) {linkedDocs(this, f);}, + + getMode: function() {return this.mode;}, + getEditor: function() {return this.cm;} + }); + + // Public alias. + Doc.prototype.eachLine = Doc.prototype.iter; + + // Set up methods on CodeMirror's prototype to redirect to the editor's document. + var dontDelegate = "iter insert remove copy getEditor".split(" "); + for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) + CodeMirror.prototype[prop] = (function(method) { + return function() {return method.apply(this.doc, arguments);}; + })(Doc.prototype[prop]); + + eventMixin(Doc); + + // Call f for all linked documents. + function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i]; + if (rel.doc == skip) continue; + var shared = sharedHist && rel.sharedHist; + if (sharedHistOnly && !shared) continue; + f(rel.doc, shared); + propagate(rel.doc, doc, shared); + } + } + propagate(doc, null, true); + } + + // Attach a document to an editor. + function attachDoc(cm, doc) { + if (doc.cm) throw new Error("This document is already in use."); + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + if (!cm.options.lineWrapping) findMaxLine(cm); + cm.options.mode = doc.modeOption; + regChange(cm); + } + + // LINE UTILITIES + + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) throw new Error("There is no line " + (n + doc.first) + " in the document."); + for (var chunk = doc; !chunk.lines;) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; break; } + n -= sz; + } + } + return chunk.lines[n]; + } + + // Get the part of a document between two positions, as an array of + // strings. + function getBetween(doc, start, end) { + var out = [], n = start.line; + doc.iter(start.line, end.line + 1, function(line) { + var text = line.text; + if (n == end.line) text = text.slice(0, end.ch); + if (n == start.line) text = text.slice(start.ch); + out.push(text); + ++n; + }); + return out; + } + // Get the lines between from and to, as array of strings. + function getLines(doc, from, to) { + var out = []; + doc.iter(from, to, function(line) { out.push(line.text); }); + return out; + } + + // Update the height of a line, propagating the height change + // upwards to parent nodes. + function updateLineHeight(line, height) { + var diff = height - line.height; + if (diff) for (var n = line; n; n = n.parent) n.height += diff; + } + + // Given a line object, find its line number by walking up through + // its parent links. + function lineNo(line) { + if (line.parent == null) return null; + var cur = line.parent, no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) break; + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first; + } + + // Find the line at the given vertical position, using the height + // information in the document tree. + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i = 0; i < chunk.children.length; ++i) { + var child = chunk.children[i], ch = child.height; + if (h < ch) { chunk = child; continue outer; } + h -= ch; + n += child.chunkSize(); + } + return n; + } while (!chunk.lines); + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], lh = line.height; + if (h < lh) break; + h -= lh; + } + return n + i; + } + + + // Find the height above the given line. + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); + + var h = 0, chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) break; + else h += line.height; + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i = 0; i < p.children.length; ++i) { + var cur = p.children[i]; + if (cur == chunk) break; + else h += cur.height; + } + } + return h; + } + + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. + function getOrder(line) { + var order = line.order; + if (order == null) order = line.order = bidiOrdering(line.text); + return order; + } + + // HISTORY + + function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; this.undone = []; + this.undoDepth = Infinity; + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0; + this.lastOp = this.lastSelOp = null; + this.lastOrigin = this.lastSelOrigin = null; + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1; + } + + // Create a history change event from an updateDoc-style change + // object. + function historyChangeFromChange(doc, change) { + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true); + return histChange; + } + + // Pop all selection events off the end of a history array. Stop at + // a change event. + function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array); + if (last.ranges) array.pop(); + else break; + } + } + + // Find the top change event in the history. Pop off selection + // events that are in the way. + function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done); + return lst(hist.done); + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done); + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop(); + return lst(hist.done); + } + } + + // Register a change in the history. Merges changes that are within + // a single operation, ore are close together with an origin that + // allows merging (starting with "+") into a single event. + function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date, cur; + + if ((hist.lastOp == opId || + hist.lastOrigin == change.origin && change.origin && + ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || + change.origin.charAt(0) == "*")) && + (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + var last = lst(cur.changes); + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change); + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)); + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done); + if (!before || !before.ranges) + pushSelectionToHistory(doc.sel, hist.done); + cur = {changes: [historyChangeFromChange(doc, change)], + generation: hist.generation}; + hist.done.push(cur); + while (hist.done.length > hist.undoDepth) { + hist.done.shift(); + if (!hist.done[0].ranges) hist.done.shift(); + } + } + hist.done.push(selAfter); + hist.generation = ++hist.maxGeneration; + hist.lastModTime = hist.lastSelTime = time; + hist.lastOp = hist.lastSelOp = opId; + hist.lastOrigin = hist.lastSelOrigin = change.origin; + + if (!last) signal(doc, "historyAdded"); + } + + function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0); + return ch == "*" || + ch == "+" && + prev.ranges.length == sel.ranges.length && + prev.somethingSelected() == sel.somethingSelected() && + new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500); + } + + // Called whenever the selection changes, sets the new selection as + // the pending selection in the history, and pushes the old pending + // selection into the 'done' array when it was significantly + // different (in number of selected ranges, emptiness, or time). + function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, origin = options && options.origin; + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || + (origin && hist.lastSelOrigin == origin && + (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || + selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) + hist.done[hist.done.length - 1] = sel; + else + pushSelectionToHistory(sel, hist.done); + + hist.lastSelTime = +new Date; + hist.lastSelOrigin = origin; + hist.lastSelOp = opId; + if (options && options.clearRedo !== false) + clearSelectionEvents(hist.undone); + } + + function pushSelectionToHistory(sel, dest) { + var top = lst(dest); + if (!(top && top.ranges && top.equals(sel))) + dest.push(sel); + } + + // Used to store marked span information in the history. + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) { + if (line.markedSpans) + (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; + ++n; + }); + } + + // When un/re-doing restores text containing marked spans, those + // that have been explicitly cleared should not be restored. + function removeClearedSpans(spans) { + if (!spans) return null; + for (var i = 0, out; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); } + else if (out) out.push(spans[i]); + } + return !out ? spans : out.length ? out : null; + } + + // Retrieve and filter the old marked spans stored in a change event. + function getOldSpans(doc, change) { + var found = change["spans_" + doc.id]; + if (!found) return null; + for (var i = 0, nw = []; i < change.text.length; ++i) + nw.push(removeClearedSpans(found[i])); + return nw; + } + + // Used both to provide a JSON-safe object in .getHistory, and, when + // detaching a document, to split the history in two + function copyHistoryArray(events, newGroup, instantiateSel) { + for (var i = 0, copy = []; i < events.length; ++i) { + var event = events[i]; + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); + continue; + } + var changes = event.changes, newChanges = []; + copy.push({changes: newChanges}); + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], m; + newChanges.push({from: change.from, to: change.to, text: change.text}); + if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop]; + delete change[prop]; + } + } + } + } + return copy; + } + + // Rebasing/resetting history to deal with externally-sourced changes + + function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff; + } else if (from < pos.line) { + pos.line = from; + pos.ch = 0; + } + } + + // Tries to rebase an array of history events given a change in the + // document. If the change touches the same lines as the event, the + // event, and everything 'behind' it, is discarded. If the change is + // before the event, the event's positions are updated. Uses a + // copy-on-write scheme for the positions, to avoid having to + // reallocate them all on every rebase, but also avoid problems with + // shared position objects being unsafely updated. + function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], ok = true; + if (sub.ranges) { + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); + } + continue; + } + for (var j = 0; j < sub.changes.length; ++j) { + var cur = sub.changes[j]; + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); + } else if (from <= cur.to.line) { + ok = false; + break; + } + } + if (!ok) { + array.splice(0, i + 1); + i = 0; + } + } + } + + function rebaseHist(hist, change) { + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); + } + + // EVENT UTILITIES + + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. + + var e_preventDefault = CodeMirror.e_preventDefault = function(e) { + if (e.preventDefault) e.preventDefault(); + else e.returnValue = false; + }; + var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) { + if (e.stopPropagation) e.stopPropagation(); + else e.cancelBubble = true; + }; + function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false; + } + var e_stop = CodeMirror.e_stop = function(e) {e_preventDefault(e); e_stopPropagation(e);}; + + function e_target(e) {return e.target || e.srcElement;} + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) b = 1; + else if (e.button & 2) b = 3; + else if (e.button & 4) b = 2; + } + if (mac && e.ctrlKey && b == 1) b = 3; + return b; + } + + // EVENT HANDLING + + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var on = CodeMirror.on = function(emitter, type, f) { + if (emitter.addEventListener) + emitter.addEventListener(type, f, false); + else if (emitter.attachEvent) + emitter.attachEvent("on" + type, f); + else { + var map = emitter._handlers || (emitter._handlers = {}); + var arr = map[type] || (map[type] = []); + arr.push(f); + } + }; + + var off = CodeMirror.off = function(emitter, type, f) { + if (emitter.removeEventListener) + emitter.removeEventListener(type, f, false); + else if (emitter.detachEvent) + emitter.detachEvent("on" + type, f); + else { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + for (var i = 0; i < arr.length; ++i) + if (arr[i] == f) { arr.splice(i, 1); break; } + } + }; + + var signal = CodeMirror.signal = function(emitter, type /*, values...*/) { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args); + }; + + var orphanDelayedCallbacks = null; + + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. + function signalLater(emitter, type /*, values...*/) { + var arr = emitter._handlers && emitter._handlers[type]; + if (!arr) return; + var args = Array.prototype.slice.call(arguments, 2), list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); + } + function bnd(f) {return function(){f.apply(null, args);};}; + for (var i = 0; i < arr.length; ++i) + list.push(bnd(arr[i])); + } + + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) delayed[i](); + } + + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + if (typeof e == "string") + e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore; + } + + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) return; + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) if (indexOf(set, arr[i]) == -1) + set.push(arr[i]); + } + + function hasHandler(emitter, type) { + var arr = emitter._handlers && emitter._handlers[type]; + return arr && arr.length > 0; + } + + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. + function eventMixin(ctor) { + ctor.prototype.on = function(type, f) {on(this, type, f);}; + ctor.prototype.off = function(type, f) {off(this, type, f);}; + } + + // MISC UTILITIES + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerGap = 30; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; + + // Reused option objects for setSelection & friends + var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; + + function Delayed() {this.id = null;} + Delayed.prototype.set = function(ms, f) { + clearTimeout(this.id); + this.id = setTimeout(f, ms); + }; + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) end = string.length; + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) + return n + (end - i); + n += nextTab - i; + n += tabSize - (n % tabSize); + i = nextTab + 1; + } + }; + + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) nextTab = string.length; + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) + return pos + Math.min(skipped, goal - col); + col += nextTab - pos; + col += tabSize - (col % tabSize); + pos = nextTab + 1; + if (col >= goal) return pos; + } + } + + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) + spaceStrs.push(lst(spaceStrs) + " "); + return spaceStrs[n]; + } + + function lst(arr) { return arr[arr.length-1]; } + + var selectInput = function(node) { node.select(); }; + if (ios) // Mobile Safari apparently has a bug where select() is broken. + selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; + else if (ie) // Suppress mysterious IE10 errors + selectInput = function(node) { try { node.select(); } catch(_e) {} }; + + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) + if (array[i] == elt) return i; + return -1; + } + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) out[i] = f(array[i], i); + return out; + } + + function nothing() {} + + function createObj(base, props) { + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + nothing.prototype = base; + inst = new nothing(); + } + if (props) copyObj(props, inst); + return inst; + }; + + function copyObj(obj, target, overwrite) { + if (!target) target = {}; + for (var prop in obj) + if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) + target[prop] = obj[prop]; + return target; + } + + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function(){return f.apply(null, args);}; + } + + var nonASCIISingleCaseWordChar = /[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + var isWordCharBasic = CodeMirror.isWordChar = function(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); + }; + function isWordChar(ch, helper) { + if (!helper) return isWordCharBasic(ch); + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) return true; + return helper.test(ch); + } + + function isEmpty(obj) { + for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false; + return true; + } + + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. + var extendingChars = /[\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]/; + function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch); } + + // DOM UTILITIES + + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) e.className = className; + if (style) e.style.cssText = style; + if (typeof content == "string") e.appendChild(document.createTextNode(content)); + else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]); + return e; + } + + var range; + if (document.createRange) range = function(node, start, end, endNode) { + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); + return r; + }; + else range = function(node, start, end) { + var r = document.body.createTextRange(); + try { r.moveToElementText(node.parentNode); } + catch(e) { return r; } + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r; + }; + + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) + e.removeChild(e.firstChild); + return e; + } + + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e); + } + + var contains = CodeMirror.contains = function(parent, child) { + if (child.nodeType == 3) // Android browser always returns false when child is a textnode + child = child.parentNode; + if (parent.contains) + return parent.contains(child); + do { + if (child.nodeType == 11) child = child.host; + if (child == parent) return true; + } while (child = child.parentNode); + }; + + function activeElt() { return document.activeElement; } + // Older versions of IE throws unspecified error when touching + // document.activeElement in some cases (during loading, in iframe) + if (ie && ie_version < 11) activeElt = function() { + try { return document.activeElement; } + catch(e) { return document.body; } + }; + + function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*"); } + var rmClass = CodeMirror.rmClass = function(node, cls) { + var current = node.className; + var match = classTest(cls).exec(current); + if (match) { + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); + } + }; + var addClass = CodeMirror.addClass = function(node, cls) { + var current = node.className; + if (!classTest(cls).test(current)) node.className += (current ? " " : "") + cls; + }; + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) + if (as[i] && !classTest(as[i]).test(b)) b += " " + as[i]; + return b; + } + + // WINDOW-WIDE EVENTS + + // These must be handled carefully, because naively registering a + // handler for each editor will cause the editors to never be + // garbage collected. + + function forEachCodeMirror(f) { + if (!document.body.getElementsByClassName) return; + var byClass = document.body.getElementsByClassName("CodeMirror"); + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror; + if (cm) f(cm); + } + } + + var globalsRegistered = false; + function ensureGlobalHandlers() { + if (globalsRegistered) return; + registerGlobalHandlers(); + globalsRegistered = true; + } + function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer; + on(window, "resize", function() { + if (resizeTimer == null) resizeTimer = setTimeout(function() { + resizeTimer = null; + forEachCodeMirror(onResize); + }, 100); + }); + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function() { + forEachCodeMirror(onBlur); + }); + } + + // FEATURE DETECTION + + // Detect drag-and-drop + var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) return false; + var div = elt('div'); + return "draggable" in div || "dragDrop" in div; + }(); + + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) + zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); + } + var node = zwspSupported ? elt("span", "\u200b") : + elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); + return node; + } + + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) return badBidiRects; + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + if (!r0 || r0.left == r0.right) return false; // Safari returns null in some cases (#2780) + var r1 = range(txt, 1, 2).getBoundingClientRect(); + return badBidiRects = (r1.right - r0.right < 3); + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLines = CodeMirror.splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { + var pos = 0, result = [], l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) nl = string.length; + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result; + } : function(string){return string.split(/\r\n?|\n/);}; + + var hasSelection = window.getSelection ? function(te) { + try { return te.selectionStart != te.selectionEnd; } + catch(e) { return false; } + } : function(te) { + try {var range = te.ownerDocument.selection.createRange();} + catch(e) {} + if (!range || range.parentElement() != te) return false; + return range.compareEndPoints("StartToEnd", range) != 0; + }; + + var hasCopyEvent = (function() { + var e = elt("div"); + if ("oncopy" in e) return true; + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == "function"; + })(); + + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) return badZoomedRects; + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1; + } + + // KEY NAMES + + var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 107: "=", 109: "-", 127: "Delete", + 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", + 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"}; + CodeMirror.keyNames = keyNames; + (function() { + // Number keys + for (var i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i); + // Alphabetic keys + for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); + // Function keys + for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; + })(); + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) return f(from, to, "ltr"); + var found = false; + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr"); + found = true; + } + } + if (!found) f(from, to, "ltr"); + } + + function bidiLeft(part) { return part.level % 2 ? part.to : part.from; } + function bidiRight(part) { return part.level % 2 ? part.from : part.to; } + + function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; } + function lineRight(line) { + var order = getOrder(line); + if (!order) return line.text.length; + return bidiRight(lst(order)); + } + + function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLine(line); + if (visual != line) lineN = lineNo(visual); + var order = getOrder(visual); + var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual); + return Pos(lineN, ch); + } + function lineEnd(cm, lineN) { + var merged, line = getLine(cm.doc, lineN); + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line; + lineN = null; + } + var order = getOrder(line); + var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line); + return Pos(lineN == null ? lineNo(line) : lineN, ch); + } + function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS); + } + return start; + } + + function compareBidiLevel(order, a, b) { + var linedir = order[0].level; + if (a == linedir) return true; + if (b == linedir) return false; + return a < b; + } + var bidiOther; + function getBidiPartAt(order, pos) { + bidiOther = null; + for (var i = 0, found; i < order.length; ++i) { + var cur = order[i]; + if (cur.from < pos && cur.to > pos) return i; + if ((cur.from == pos || cur.to == pos)) { + if (found == null) { + found = i; + } else if (compareBidiLevel(order, cur.level, order[found].level)) { + if (cur.from != cur.to) bidiOther = found; + return i; + } else { + if (cur.from != cur.to) bidiOther = i; + return found; + } + } + } + return found; + } + + function moveInLine(line, pos, dir, byUnit) { + if (!byUnit) return pos + dir; + do pos += dir; + while (pos > 0 && isExtendingChar(line.text.charAt(pos))); + return pos; + } + + // This is needed in order to move 'visually' through bi-directional + // text -- i.e., pressing left should make the cursor go left, even + // when in RTL text. The tricky part is the 'jumps', where RTL and + // LTR text touch each other. This often requires the cursor offset + // to move more than one unit, in order to visually move one unit. + function moveVisually(line, start, dir, byUnit) { + var bidi = getOrder(line); + if (!bidi) return moveLogically(line, start, dir, byUnit); + var pos = getBidiPartAt(bidi, start), part = bidi[pos]; + var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit); + + for (;;) { + if (target > part.from && target < part.to) return target; + if (target == part.from || target == part.to) { + if (getBidiPartAt(bidi, target) == pos) return target; + part = bidi[pos += dir]; + return (dir > 0) == part.level % 2 ? part.to : part.from; + } else { + part = bidi[pos += dir]; + if (!part) return null; + if ((dir > 0) == part.level % 2) + target = moveInLine(line, part.to, -1, byUnit); + else + target = moveInLine(line, part.from, 1, byUnit); + } + } + } + + function moveLogically(line, start, dir, byUnit) { + var target = start + dir; + if (byUnit) while (target > 0 && isExtendingChar(line.text.charAt(target))) target += dir; + return target < 0 || target > line.text.length ? null : target; + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; + // Character types for codepoints 0x600 to 0x6ff + var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm"; + function charType(code) { + if (code <= 0xf7) return lowTypes.charAt(code); + else if (0x590 <= code && code <= 0x5f4) return "R"; + else if (0x600 <= code && code <= 0x6ed) return arabicTypes.charAt(code - 0x600); + else if (0x6ee <= code && code <= 0x8ac) return "r"; + else if (0x2000 <= code && code <= 0x200b) return "w"; + else if (code == 0x200c) return "b"; + else return "L"; + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; + // Browsers seem to always treat the boundaries of block elements as being L. + var outerType = "L"; + + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; this.to = to; + } + + return function(str) { + if (!bidiRE.test(str)) return false; + var len = str.length, types = []; + for (var i = 0, type; i < len; ++i) + types.push(type = charType(str.charCodeAt(i))); + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i = 0, prev = outerType; i < len; ++i) { + var type = types[i]; + if (type == "m") types[i] = prev; + else prev = type; + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i = 0, cur = outerType; i < len; ++i) { + var type = types[i]; + if (type == "1" && cur == "r") types[i] = "n"; + else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i = 1, prev = types[0]; i < len - 1; ++i) { + var type = types[i]; + if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1"; + else if (type == "," && prev == types[i+1] && + (prev == "1" || prev == "n")) types[i] = prev; + prev = type; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i = 0; i < len; ++i) { + var type = types[i]; + if (type == ",") types[i] = "N"; + else if (type == "%") { + for (var end = i + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i && types[i-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i = 0, cur = outerType; i < len; ++i) { + var type = types[i]; + if (cur == "L" && type == "1") types[i] = "L"; + else if (isStrong.test(type)) cur = type; + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i = 0; i < len; ++i) { + if (isNeutral.test(types[i])) { + for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {} + var before = (i ? types[i-1] : outerType) == "L"; + var after = (end < len ? types[end] : outerType) == "L"; + var replace = before || after ? "L" : "R"; + for (var j = i; j < end; ++j) types[j] = replace; + i = end - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m; + for (var i = 0; i < len;) { + if (countsAsLeft.test(types[i])) { + var start = i; + for (++i; i < len && countsAsLeft.test(types[i]); ++i) {} + order.push(new BidiSpan(0, start, i)); + } else { + var pos = i, at = order.length; + for (++i; i < len && types[i] != "L"; ++i) {} + for (var j = pos; j < i;) { + if (countsAsNum.test(types[j])) { + if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j)); + var nstart = j; + for (++j; j < i && countsAsNum.test(types[j]); ++j) {} + order.splice(at, 0, new BidiSpan(2, nstart, j)); + pos = j; + } else ++j; + } + if (pos < i) order.splice(at, 0, new BidiSpan(1, pos, i)); + } + } + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } + if (order[0].level != lst(order).level) + order.push(new BidiSpan(order[0].level, len, len)); + + return order; + }; + })(); + + // THE END + + CodeMirror.version = "5.0.1"; + + return CodeMirror; +}); diff --git a/media/editors/codemirror/lib/codemirror.min.css b/media/editors/codemirror/lib/codemirror.min.css new file mode 100644 index 0000000000000..59b66773642fd --- /dev/null +++ b/media/editors/codemirror/lib/codemirror.min.css @@ -0,0 +1 @@ +.CodeMirror{font-family:monospace;height:300px;color:black}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid black}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.CodeMirror.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}@-moz-keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}@-webkit-keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}@keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;display:inline-block;margin-bottom:-30px;*zoom:1;*display:inline}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;height:100%}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;border-right:0;width:0}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror ::selection{background:#d7d4f0}.CodeMirror ::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0}.CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler,.CodeMirror-overlayscroll .CodeMirror-gutter-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%} \ No newline at end of file diff --git a/media/editors/codemirror/lib/codemirror.min.js b/media/editors/codemirror/lib/codemirror.min.js new file mode 100644 index 0000000000000..cae56bad2ccd6 --- /dev/null +++ b/media/editors/codemirror/lib/codemirror.min.js @@ -0,0 +1,5 @@ +!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);this.CodeMirror=e()}}(function(){"use strict";function e(r,n){if(!(this instanceof e))return new e(r,n);this.options=n=n?Oo(n):{},Oo(Kl,n,!1),d(n);var i=n.value;"string"==typeof i&&(i=new ps(i,n.mode)),this.doc=i;var o=new e.inputStyles[n.inputStyle](this),l=this.display=new t(r,i,o);l.wrapper.CodeMirror=this,u(this),s(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),n.autofocus&&!wl&&l.input.focus(),m(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new So,keySeq:null};var a=this;cl&&11>fl&&setTimeout(function(){a.display.input.reset(!0)},20),Rr(this),Vo(),mr(this),this.curOp.forceUpdate=!0,Vi(this,i),n.autofocus&&!wl||a.hasFocus()?setTimeout(Do(cn,this),20):fn(this);for(var c in jl)jl.hasOwnProperty(c)&&jl[c](this,n[c],Xl);C(this),n.finishInit&&n.finishInit(this);for(var f=0;ffl&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),hl||sl&&wl||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),n(t)}function n(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,zt(e,100),e.state.modeGen++,e.curOp&&Dr(e)}function i(e){e.options.lineWrapping?(Bs(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Rs(e.display.wrapper,"CodeMirror-wrap"),h(e)),l(e),Dr(e),ir(e),setTimeout(function(){y(e)},100)}function o(e){var t=gr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/vr(e.display)-3);return function(i){if(gi(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;lt.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function d(e){var t=Mo(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Gt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Vt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function g(e,t,r){this.cm=r;var n=this.vert=zo("div",[zo("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=zo("div",[zo("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),ws(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ws(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedOverlay=!1,cl&&8>fl&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function v(){}function m(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Rs(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ws(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,r){"horizontal"==r?Qr(t,e):Zr(t,e)},t),t.display.scrollbars.addClass&&Bs(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var r=e.display.barWidth,n=e.display.barHeight;b(e,t);for(var i=0;4>i&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&O(e),b(e,p(e)),r=e.display.barWidth,n=e.display.barHeight}function b(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function w(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Bt(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=$i(t,n),l=$i(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;o>s?(o=s,l=$i(t,qi(Ki(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=$i(t,qi(Ki(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function x(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=L(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Fr(e))return!1;C(e)&&(Ir(e),t.dims=H(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroml&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Ml&&(o=di(e.doc,o),l=pi(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Er(e,o,l),r.viewOffset=qi(Ki(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var a=Fr(e);if(!s&&0==a&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Ro();return a>4&&(r.lineDiv.style.display="none"),I(e,r.updateLineNumbers,t.dims),a>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,u&&Ro()!=u&&u.offsetHeight&&u.focus(),Eo(r.cursorDiv),Eo(r.selectionDiv),r.gutters.style.height=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,zt(e,400)),r.updateLineNumbers=null,!0}function A(e,t){for(var r=t.force,n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Kt(e))r=!0;else if(r=!1,n&&null!=n.top&&(n={top:Math.min(e.doc.height+Gt(e.display)-jt(e),n.top)}),t.visible=w(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!M(e,t))break;O(e);var o=p(e);Ot(e),W(e,o),y(e,o)}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function N(e,t){var r=new k(e,t);if(M(e,r)){O(e),A(e,r);var n=p(e);Ot(e),W(e,n),y(e,n),r.finish()}}function W(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var r=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=r+"px",e.display.gutters.style.height=Math.max(r+Vt(e),t.clientHeight)+"px"}function O(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;nfl){var l=o.node.offsetTop+o.node.offsetHeight;i=l-r,r=l}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var a=o.line.height-i;if(2>i&&(i=gr(t)),(a>.001||-.001>a)&&(_i(o.line,i),D(o.line),o.rest))for(var u=0;u=t&&f.lineNumber;f.changes&&(Mo(f.changes,"gutter")>-1&&(h=!1),P(e,f,u,r)),h&&(Eo(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(S(e.options,u)))),s=f.node.nextSibling}else{var d=V(e,f,u,r);l.insertBefore(d,s)}u+=f.size}for(;s;)s=n(s)}function P(e,t,r,n){for(var i=0;ifl&&(e.node.style.zIndex=2)),e.node}function E(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=z(e);e.background=r.insertBefore(zo("div",null,t),r.firstChild)}}function F(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Oi(e,t)}function R(e,t){var r=t.text.className,n=F(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,B(t)):r&&(t.text.className=r)}function B(e){E(e),e.line.wrapClass?z(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function G(e,t,r,n){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=z(t),l=t.gutter=zo("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px");if(e.display.input.setUneditable(l),o.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(zo("div",S(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var s=0;s1&&(Wl&&Wl.join("\n")==t?l=n.ranges.length%Wl.length==0&&Ao(Wl,Vs):o.length==n.ranges.length&&(l=Ao(o,function(e){return[e]})));for(var s=n.ranges.length-1;s>=0;s--){var a=n.ranges[s],u=a.from(),c=a.to();a.empty()&&(r&&r>0?u=Al(u.line,u.ch-r):e.state.overwrite&&!e.state.pasteIncoming&&(c=Al(c.line,Math.min(Ki(i,c.line).text.length,c.ch+To(o).length))));var f=e.curOp.updateInput,h={from:u,to:c,text:l?l[s%l.length]:o,origin:e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input"};if(bn(e.doc,h),mo(e,"inputRead",e,h),t&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&a.head.ch<100&&(!s||n.ranges[s-1].head.line!=a.head.line)){var d=e.getModeAt(a.head),p=Vl(h);if(d.electricChars){for(var g=0;g-1){Hn(e,p.line,"smart");break}}else d.electricInput&&d.electricInput.test(Ki(i,p.line).text.slice(0,p.ch))&&Hn(e,p.line,"smart")}}On(e),e.curOp.updateInput=f,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e){for(var t=[],r=[],n=0;ni?u.map:c[i],l=0;li?e.line:e.rest[i]),f=o[l]+n;return(0>n||s!=t)&&(f=o[l+(n?1:0)]),Al(a,f)}}}var i=e.text.firstChild,o=!1;if(!t||!zs(i,t))return ot(Al(Yi(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?To(e.rest):e.line;return ot(Al(Yi(l),l.text.length),o)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var u=e.measure,c=u.maps,f=n(s,a,r);if(f)return ot(f,o);for(var h=a.nextSibling,d=s?s.nodeValue.length-r:0;h;h=h.nextSibling){if(f=n(h,h.firstChild,0))return ot(Al(f.line,f.ch-d),o);d+=h.textContent.length}for(var p=a.previousSibling,d=r;p;p=p.previousSibling){if(f=n(p,p.firstChild,-1))return ot(Al(f.line,f.ch+d),o);d+=h.textContent.length}}function at(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function l(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return""==r&&(r=t.textContent.replace(/\u200b/g,"")),void(s+=r);var u,c=t.getAttribute("cm-marker");if(c){var f=e.findMarks(Al(n,0),Al(i+1,0),o(+c));return void(f.length&&(u=f[0].find())&&(s+=ji(e.doc,u.from,u.to).join("\n")))}if("false"==t.getAttribute("contenteditable"))return;for(var h=0;h=0){var l=$(o.from(),i.from()),s=Y(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;t>=n&&--t,e.splice(--n,2,new ct(a?s:l,a?l:s))}}return new ut(e,t)}function ht(e,t){return new ut([new ct(e,t||e)],0)}function dt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function pt(e,t){if(t.liner?Al(r,Ki(e,r).text.length):gt(t,Ki(e,t.line).text.length)}function gt(e,t){var r=e.ch;return null==r||r>t?Al(e.line,t):0>r?Al(e.line,0):e}function vt(e,t){return t>=e.first&&t=o.ch:u.to>o.ch))){if(n&&(Cs(c,"beforeCursorEnter"),c.explicitlyCleared)){if(s.markedSpans){--a;continue}break}if(!c.atomic)continue;var f=c.find(0>l?-1:1);if(0==Nl(f,o)&&(f.ch+=l,f.ch<0?f=f.line>e.first?pt(e,Al(f.line-1)):null:f.ch>s.text.length&&(f=f.linet&&(t=0),t=Math.round(t),n=Math.round(n),s.appendChild(zo("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?c-e:r)+"px; height: "+(n-t)+"px"))}function i(t,r,i){function o(r,n){return ur(e,Al(t,r),"div",f,n)}var s,a,f=Ki(l,t),h=f.text.length;return Yo(Zi(f),r||0,null==i?h:i,function(e,t,l){var f,d,p,g=o(e,"left");if(e==t)f=g,d=p=g.left;else{if(f=o(t-1,"right"),"rtl"==l){var v=g;g=f,f=v}d=g.left,p=f.right}null==r&&0==e&&(d=u),f.top-g.top>3&&(n(d,g.top,null,g.bottom),d=u,g.bottoma.bottom||f.bottom==a.bottom&&f.right>a.right)&&(a=f),u+1>d&&(d=u),n(d,f.top,p-d,f.bottom)}),{start:s,end:a}}var o=e.display,l=e.doc,s=document.createDocumentFragment(),a=Ut(e.display),u=a.left,c=Math.max(o.sizerWidth,Kt(e)-o.sizer.offsetLeft)-a.right,f=t.from(),h=t.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Ki(l,f.line),p=Ki(l,h.line),g=fi(d)==fi(p),v=i(f.line,f.ch,g?d.text.length+1:null).end,m=i(h.line,g?0:null,h.ch).start;g&&(v.top0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function zt(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Ql(t.mode,Rt(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,s=Mi(e,o,n,!0);o.styles=s.styles;var a=o.styleClasses,u=s.classes;u?o.styleClasses=u:a&&(o.styleClasses=null);for(var c=!l||l.length!=o.styles.length||a!=u&&(!a||!u||a.bgClass!=u.bgClass||a.textClass!=u.textClass),f=0;!c&&fr?(zt(e,e.options.workDelay),!0):void 0}),i.length&&Tr(e,function(){for(var t=0;tl;--s){if(s<=o.first)return o.first;var a=Ki(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=Ns(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function Rt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=Ft(e,t,r),l=o>n.first&&Ki(n,o-1).stateAfter;return l=l?Ql(n.mode,l):Jl(n.mode),n.iter(o,t,function(r){Ni(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&o2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function _t(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Yt(e,t){t=fi(t);var r=Yi(t),n=e.display.externalMeasured=new Wr(e.doc,t,r);n.lineN=r;var i=n.built=Oi(e,n);return n.text=i.pre,Fo(e.display.lineMeasure,i.pre),n}function $t(e,t,r,n){return Qt(e,Zt(e,t),r,n)}function qt(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt?(i=0,o=1,l="left"):u>t?(i=t-a,o=i+1):(s==e.length-3||t==u&&e[s+3]>t)&&(o=u-a,i=o-1,t>=u&&(l="right")),null!=i){if(n=e[s+2],a==u&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)n=e[(s-=3)+2],l="left";if("right"==r&&i==u-a)for(;sc;c++){for(;s&&Po(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+afl&&0==s&&a==o.coverEnd-o.coverStart)i=l.parentNode.getBoundingClientRect();else if(cl&&e.options.lineWrapping){var f=Ds(l,s,a).getClientRects();i=f.length?f["right"==n?f.length-1:0]:Il}else i=Ds(l,s,a).getBoundingClientRect()||Il;if(i.left||i.right||0==s)break;a=s,s-=1,u="right"}cl&&11>fl&&(i=tr(e.display.measure,i))}else{s>0&&(u=n="right");var f;i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==n?f.length-1:0]:l.getBoundingClientRect()}if(cl&&9>fl&&!s&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+vr(e.display),top:h.top,bottom:h.bottom}:Il}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,c=0;cr.from?l(e-1):l(e,n)}n=n||Ki(e.doc,t.line),i||(i=Zt(e,n));var a=Zi(n),u=t.ch;if(!a)return l(u);var c=nl(a,u),f=s(u,c);return null!=Ys&&(f.other=s(u,Ys)),f}function fr(e,t){var r=0,t=pt(e.doc,t);e.options.lineWrapping||(r=vr(e.display)*t.ch);var n=Ki(e.doc,t.line),i=qi(n)+Bt(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function hr(e,t,r,n){var i=Al(e,t);return i.xRel=n,r&&(i.outside=!0),i}function dr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,0>r)return hr(n.first,0,!0,-1);var i=$i(n,r),o=n.first+n.size-1;if(i>o)return hr(n.first+n.size-1,Ki(n,o).text.length,!0,1);0>t&&(t=0);for(var l=Ki(n,i);;){var s=pr(e,l,i,t,r),a=ui(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=Yi(l=u.to.line)}}function pr(e,t,r,n,i){function o(n){var i=cr(e,Al(r,n),"line",t,u);return s=!0,l>i.bottom?i.left-a:lv)return hr(r,d,m,1);for(;;){if(c?d==h||d==ol(t,h,1):1>=d-h){for(var y=p>n||v-n>=n-p?h:d,b=n-(y==h?p:v);Po(t.text.charAt(y));)++y;var w=hr(r,y,y==h?g:m,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(f/2),C=h+x;if(c){C=h;for(var S=0;x>S;++S)C=ol(t,C,1)}var L=o(C);L>n?(d=C,v=L,(m=s)&&(v+=1e3),f=x):(h=C,p=L,g=s,f-=x)}}function gr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ol){Ol=zo("pre");for(var t=0;49>t;++t)Ol.appendChild(document.createTextNode("x")),Ol.appendChild(zo("br"));Ol.appendChild(document.createTextNode("x"))}Fo(e.measure,Ol);var r=Ol.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Eo(e.measure),r||1}function vr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=zo("span","xxxxxxxxxx"),r=zo("pre",[t]);Fo(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function mr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++zl},Pl?Pl.ops.push(e.curOp):e.curOp.ownsGroup=Pl={ops:[e.curOp],delayedCallbacks:[]}}function yr(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new k(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Cr(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function Sr(e){var t=e.cm,r=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$t(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Vt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Kt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Lr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLefto;o=n){var l=new Wr(e.doc,Ki(e.doc,o),o);n=o+l.size,i.push(l)}return i}function Dr(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ml&&di(e.doc,t)i.viewFrom?Ir(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Ir(e);else if(t<=i.viewFrom){var o=zr(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Ir(e)}else if(r>=i.viewTo){var o=zr(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Ir(e)}else{var l=zr(e,t,t,-1),s=zr(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Or(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):Ir(e)}var a=i.externalMeasured;a&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Pr(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==Mo(l,r)&&l.push(r)}}}function Ir(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Pr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,n=0;nt)return n}function zr(e,t,r,n){var i,o=Pr(e,t),l=e.display.view;if(!Ml||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=0,a=e.display.viewFrom;o>s;s++)a+=l[s].size;if(a!=t){if(n>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}for(;di(e.doc,r)!=r;){if(o==(0>n?0:l.length-1))return null;r+=n*l[o-(0>n?1:0)].size,o+=n}return{index:o,lineN:r}}function Er(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=Or(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Or(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Pr(e,r)))),n.viewTo=r}function Fr(e){for(var t=e.display.view,r=0,n=0;n400}function i(t){bo(e,t)||bs(t)}var o=e.display;ws(o.scroller,"mousedown",Mr(e,Vr)),cl&&11>fl?ws(o.scroller,"dblclick",Mr(e,function(t){if(!bo(e,t)){var r=Ur(e,t);if(r&&!Yr(e,t)&&!Gr(e.display,t)){ms(t);var n=e.findWordAt(r);bt(e.doc,n.anchor,n.head)}}})):ws(o.scroller,"dblclick",function(t){bo(e,t)||ms(t)}),kl||ws(o.scroller,"contextmenu",function(t){hn(e,t)});var l,s={end:0};ws(o.scroller,"touchstart",function(e){if(!r(e)){clearTimeout(l);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-s.end<=300?s:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),ws(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),ws(o.scroller,"touchend",function(r){var i=o.activeTouch;if(i&&!Gr(o,r)&&null!=i.left&&!i.moved&&new Date-i.start<300){var l,s=e.coordsChar(o.activeTouch,"page");l=!i.prev||n(i,i.prev)?new ct(s,s):!i.prev.prev||n(i,i.prev.prev)?e.findWordAt(s):new ct(Al(s.line,0),pt(e.doc,Al(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),ms(r)}t()}),ws(o.scroller,"touchcancel",t),ws(o.scroller,"scroll",function(){o.scroller.clientHeight&&(Zr(e,o.scroller.scrollTop),Qr(e,o.scroller.scrollLeft,!0),Cs(e,"scroll",e))}),ws(o.scroller,"mousewheel",function(t){Jr(e,t)}),ws(o.scroller,"DOMMouseScroll",function(t){Jr(e,t)}),ws(o.wrapper,"scroll",function(){o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),e.options.dragDrop&&(ws(o.scroller,"dragstart",function(t){qr(e,t)}),ws(o.scroller,"dragenter",i),ws(o.scroller,"dragover",i),ws(o.scroller,"drop",Mr(e,$r)));var a=o.input.getField();ws(a,"keyup",function(t){an.call(e,t)}),ws(a,"keydown",Mr(e,ln)),ws(a,"keypress",Mr(e,un)),ws(a,"focus",Do(cn,e)),ws(a,"blur",Do(fn,e))}function Br(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Gr(e,t){for(var r=go(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Ur(e,t,r,n){var i=e.display;if(!r&&"true"==go(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=dr(e,o,l);if(n&&1==u.xRel&&(a=Ki(e.doc,u.line).text).length==u.ch){var c=Ns(a,a.length,e.options.tabSize)-a.length;u=Al(u.line,Math.max(0,Math.round((o-Ut(e.display).left)/vr(e.display))-c))}return u}function Vr(e){var t=this,r=t.display;if(!(r.activeTouch&&r.input.supportsTouch()||bo(t,e))){if(r.shift=e.shiftKey,Gr(r,e))return void(hl||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!Yr(t,e)){var n=Ur(t,e);switch(window.focus(),vo(e)){case 1:n?Kr(t,e,n):go(e)==r.scroller&&ms(e);break;case 2:hl&&(t.state.lastMiddleDown=+new Date),n&&bt(t.doc,n),setTimeout(function(){r.input.focus()},20),ms(e);break;case 3:kl&&hn(t,e)}}}}function Kr(e,t,r){cl?setTimeout(Do(q,e),0):q(e);var n,i=+new Date;Hl&&Hl.time>i-400&&0==Nl(Hl.pos,r)?n="triple":Dl&&Dl.time>i-400&&0==Nl(Dl.pos,r)?(n="double",Hl={time:i,pos:r}):(n="single",Dl={time:i,pos:r});var o,l=e.doc.sel,s=xl?t.metaKey:t.ctrlKey;e.options.dragDrop&&Us&&!Z(e)&&"single"==n&&(o=l.contains(r))>-1&&!l.ranges[o].empty()?jr(e,t,r,s):Xr(e,t,r,n,s)}function jr(e,t,r,n){var i=e.display,o=Mr(e,function(l){hl&&(i.scroller.draggable=!1),e.state.draggingText=!1,xs(document,"mouseup",o),xs(i.scroller,"drop",o),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(ms(l),n||bt(e.doc,r),i.input.focus(),cl&&9==fl&&setTimeout(function(){document.body.focus(),i.input.focus()},20))});hl&&(i.scroller.draggable=!0),e.state.draggingText=o,i.scroller.dragDrop&&i.scroller.dragDrop(),ws(document,"mouseup",o),ws(i.scroller,"drop",o)}function Xr(e,t,r,n,i){function o(t){if(0!=Nl(v,t))if(v=t,"rect"==n){for(var i=[],o=e.options.tabSize,l=Ns(Ki(u,r.line).text,r.ch,o),s=Ns(Ki(u,t.line).text,t.ch,o),a=Math.min(l,s),d=Math.max(l,s),p=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));g>=p;p++){var m=Ki(u,p).text,y=Lo(m,a,o);a==d?i.push(new ct(Al(p,y),Al(p,y))):m.length>y&&i.push(new ct(Al(p,y),Al(p,Lo(m,d,o))))}i.length||i.push(new ct(r,r)),kt(u,ft(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,w=b.anchor,x=t;if("single"!=n){if("double"==n)var C=e.findWordAt(t);else var C=new ct(Al(t.line,0),pt(u,Al(t.line+1,0)));Nl(C.anchor,w)>0?(x=C.head,w=$(b.from(),C.anchor)):(x=C.anchor,w=Y(b.to(),C.head))}var i=h.ranges.slice(0);i[f]=new ct(pt(u,w),x),kt(u,ft(i,f),Ms)}}function l(t){var r=++y,i=Ur(e,t,!0,"rect"==n);if(i)if(0!=Nl(i,v)){q(e),o(i);var s=w(a,u);(i.line>=s.to||i.linem.bottom?20:0;c&&setTimeout(Mr(e,function(){y==r&&(a.scroller.scrollTop+=c,l(t))}),50)}}function s(e){y=1/0,ms(e),a.input.focus(),xs(document,"mousemove",b),xs(document,"mouseup",x),u.history.lastSelOrigin=null}var a=e.display,u=e.doc;ms(t);var c,f,h=u.sel,d=h.ranges;if(i&&!t.shiftKey?(f=u.sel.contains(r),c=f>-1?d[f]:new ct(r,r)):c=u.sel.primary(),t.altKey)n="rect",i||(c=new ct(r,r)),r=Ur(e,t,!0,!0),f=-1;else if("double"==n){var p=e.findWordAt(r);c=e.display.shift||u.extend?yt(u,c,p.anchor,p.head):p}else if("triple"==n){var g=new ct(Al(r.line,0),pt(u,Al(r.line+1,0)));c=e.display.shift||u.extend?yt(u,c,g.anchor,g.head):g}else c=yt(u,c,r);i?-1==f?(f=d.length,kt(u,ft(d.concat([c]),f),{scroll:!1,origin:"*mouse"})):d.length>1&&d[f].empty()&&"single"==n?(kt(u,ft(d.slice(0,f).concat(d.slice(f+1)),0)),h=u.sel):xt(u,f,c,Ms):(f=0,kt(u,new ut([c],0),Ms),h=u.sel);var v=r,m=a.wrapper.getBoundingClientRect(),y=0,b=Mr(e,function(e){vo(e)?l(e):s(e)}),x=Mr(e,s);ws(document,"mousemove",b),ws(document,"mouseup",x)}function _r(e,t,r,n,i){try{var o=t.clientX,l=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ms(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(l>a.bottom||!xo(e,r))return po(t);l-=a.top-s.viewOffset;for(var u=0;u=o){var f=$i(e.doc,l),h=e.options.gutters[u];return i(e,r,e,f,h,t),po(t)}}}function Yr(e,t){return _r(e,t,"gutterClick",!0,mo)}function $r(e){var t=this;if(!bo(t,e)&&!Gr(t.display,e)){ms(e),cl&&(El=+new Date);var r=Ur(t,e,!0),n=e.dataTransfer.files;if(r&&!Z(t))if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){var s=new FileReader;s.onload=Mr(t,function(){if(o[n]=s.result,++l==i){r=pt(t.doc,r);var e={from:r,to:r,text:Vs(o.join("\n")),origin:"paste"};bn(t.doc,e),Lt(t.doc,ht(r,Vl(e)))}}),s.readAsText(e)},a=0;i>a;++a)s(n[a],a);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(xl?e.metaKey:e.ctrlKey))var u=t.listSelections();if(Tt(t.doc,ht(r,r)),u)for(var a=0;al.clientWidth||i&&l.scrollHeight>l.clientHeight){if(i&&xl&&hl)e:for(var s=t.target,a=o.view;s!=l;s=s.parentNode)for(var u=0;uc?f=Math.max(0,f+c-50):h=Math.min(e.doc.height,h+c+50),N(e,{top:f,bottom:h})}20>Fl&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Rl=(Rl*Fl+r)/(Fl+1),++Fl)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function en(e,t,r){if("string"==typeof t&&(t=es[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{Z(e)&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=ks}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function tn(e,t,r){for(var n=0;nfl&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=nn(t,e);gl&&(Ul=n?r:null,!n&&88==r&&!js&&(xl?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||sn(t)}}function sn(e){function t(e){18!=e.keyCode&&e.altKey||(Rs(r,"CodeMirror-crosshair"),xs(document,"keyup",t),xs(document,"mouseover",t))}var r=e.display.lineDiv;Bs(r,"CodeMirror-crosshair"),ws(document,"keyup",t),ws(document,"mouseover",t)}function an(e){16==e.keyCode&&(this.doc.sel.shift=!1),bo(this,e)}function un(e){var t=this;if(!(Gr(t.display,e)||bo(t,e)||e.ctrlKey&&!e.altKey||xl&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(gl&&r==Ul)return Ul=null,void ms(e);if(!gl||e.which&&!(e.which<10)||!nn(t,e)){var i=String.fromCharCode(null==n?r:n);on(t,e,i)||t.display.input.onKeyPress(e)}}}function cn(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(Cs(e,"focus",e),e.state.focused=!0,Bs(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),hl&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Pt(e))}function fn(e){e.state.focused&&(Cs(e,"blur",e),e.state.focused=!1,Rs(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function hn(e,t){Gr(e.display,t)||dn(e,t)||e.display.input.onContextMenu(t)}function dn(e,t){return xo(e,"gutterContextMenu")?_r(e,t,"gutterContextMenu",!1,Cs):!1}function pn(e,t){if(Nl(e,t.from)<0)return e;if(Nl(e,t.to)<=0)return Vl(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Vl(t).ch-t.to.ch),Al(r,n)}function gn(e,t){for(var r=[],n=0;n=0;--i)wn(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else wn(e,t)}}function wn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Nl(t.from,t.to)){var r=gn(e,t);ro(e,t,r,e.cm?e.cm.curOp.id:0/0),Sn(e,t,r,Qn(e,t));var n=[];Ui(e,function(e,r){r||-1!=Mo(n,e.history)||(ho(e.history,t),n.push(e.history)),Sn(e,t,null,Qn(e,t))})}}function xn(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a=0;--a){var f=n.changes[a];if(f.origin=t,c&&!yn(e,f,!1))return void(l.length=0);u.push(Ji(e,f));var h=a?gn(e,f):To(l);Sn(e,f,h,ei(e,f)),!a&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Vl(f)});var d=[];Ui(e,function(e,t){t||-1!=Mo(d,e.history)||(ho(e.history,f),d.push(e.history)),Sn(e,f,null,ei(e,f))})}}}}function Cn(e,t){if(0!=t&&(e.first+=t,e.sel=new ut(Ao(e.sel.ranges,function(e){return new ct(Al(e.anchor.line+t,e.anchor.ch),Al(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Dr(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:Al(o,Ki(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ji(e,t.from,t.to),r||(r=gn(e,t)),e.cm?Ln(e.cm,t,n):Ri(e,t,n),Tt(e,r,Ts)}}function Ln(e,t,r){var n=e.doc,i=e.display,l=t.from,s=t.to,a=!1,u=l.line;e.options.lineWrapping||(u=Yi(fi(Ki(n,l.line))),n.iter(u,s.line+1,function(e){return e==i.maxLine?(a=!0,!0):void 0})),n.sel.contains(t.from,t.to)>-1&&wo(e),Ri(n,t,r,o(e)),e.options.lineWrapping||(n.iter(u,l.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,l.line),zt(e,400);var c=t.text.length-(s.line-l.line)-1;t.full?Dr(e):l.line!=s.line||1!=t.text.length||Fi(e.doc,t)?Dr(e,l.line,s.line+1,c):Hr(e,l.line,"text");var h=xo(e,"changes"),d=xo(e,"change");if(d||h){var p={from:l,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&mo(e,"change",e,p),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function kn(e,t,r,n,i){if(n||(n=r),Nl(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=Vs(t)),bn(e,{from:r,to:n,text:t,origin:i})}function Tn(e,t){if(!bo(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!yl){var o=zo("div","​",null,"position: absolute; top: "+(t.top-r.viewOffset-Bt(e.display))+"px; height: "+(t.bottom-t.top+Vt(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Mn(e,t,r,n){null==n&&(n=0);for(var i=0;5>i;i++){var o=!1,l=cr(e,t),s=r&&r!=t?cr(e,r):l,a=Nn(e,Math.min(l.left,s.left),Math.min(l.top,s.top)-n,Math.max(l.left,s.left),Math.max(l.bottom,s.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=a.scrollTop&&(Zr(e,a.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=a.scrollLeft&&(Qr(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return l}function An(e,t,r,n,i){var o=Nn(e,t,r,n,i);null!=o.scrollTop&&Zr(e,o.scrollTop),null!=o.scrollLeft&&Qr(e,o.scrollLeft)}function Nn(e,t,r,n,i){var o=e.display,l=gr(e.display);0>r&&(r=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,a=jt(e),u={};i-r>a&&(i=r+a);var c=e.doc.height+Gt(o),f=l>r,h=i>c-l;if(s>r)u.scrollTop=f?0:r;else if(i>s+a){var d=Math.min(r,(h?c:i)-a);d!=s&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Kt(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),10>t?u.scrollLeft=0:p>t?u.scrollLeft=Math.max(0,t-(v?0:10)):n>g+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Wn(e,t,r){(null!=t||null!=r)&&Dn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function On(e){Dn(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?Al(t.line,t.ch-1):t,n=Al(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Dn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=fr(e,t.from),n=fr(e,t.to),i=Nn(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Hn(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Rt(e,t):r="prev");var l=e.options.tabSize,s=Ki(o,t),a=Ns(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=o.mode.indent(i,s.text.slice(c.length),s.text),u==ks||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?Ns(Ki(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)h+=l,f+=" ";if(u>h&&(f+=ko(u-h)),f!=c)kn(o,f,Al(t,0),Al(t,c.length),"+input");else for(var d=0;d=0;t--)kn(e.doc,"",n[t].from,n[t].to,"+delete");On(e)})}function zn(e,t,r,n,i){function o(){var t=s+r;return t=e.first+e.size?f=!1:(s=t,c=Ki(e,t))}function l(e){var t=(i?ol:ll)(c,a,r,!0);if(null==t){if(e||!o())return f=!1;a=i?(0>r?Qo:Zo)(c):0>r?c.text.length:0}else a=t;return!0}var s=t.line,a=t.ch,u=r,c=Ki(e,s),f=!0;if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var h=null,d="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),g=!0;!(0>r)||l(!g);g=!1){var v=c.text.charAt(a)||"\n",m=Ho(v,p)?"w":d&&"\n"==v?"n":!d||/\s/.test(v)?null:"p";if(!d||g||m||(m="s"),h&&h!=m){0>r&&(r=1,l());break}if(m&&(h=m),r>0&&!l(!g))break}var y=Wt(e,Al(s,a),u,!0);return f||(y.hitSide=!0),y}function En(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(s-(0>r?1.5:.5)*gr(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var a=dr(e,l,i);if(!a.outside)break;if(0>r?0>=i:i>=o.height){a.hitSide=!0;break}i+=5*r}return a}function Fn(t,r,n,i){e.defaults[t]=r,n&&(jl[t]=i?function(e,t,r){r!=Xl&&n(e,t,r)}:n)}function Rn(e){for(var t,r,n,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l0||0==l&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=zo("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(ci(e,t.line,t,r,o)||t.line!=r.line&&ci(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ml=!0}o.addToHistory&&ro(e,{from:t,to:r,origin:"markText"},e.sel,0/0);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&fi(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&_i(e,0),$n(e,new Xn(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a}),o.collapsed&&e.iter(t.line,r.line+1,function(t){gi(e,t)&&_i(t,0)}),o.clearOnEnter&&ws(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Tl=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ls,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Dr(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)Hr(u,c,"text");o.atomic&&At(u.doc),mo(u,"markerAdded",u,o)}return o}function Un(e,t,r,n,i){n=Oo(n),n.shared=!1;var o=[Gn(e,t,r,n,i)],l=o[0],s=n.widgetNode;return Ui(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Gn(e,pt(e,t),pt(e,r),n,i));for(var a=0;a=t:o.to>t);(n||(n=[])).push(new Xn(l,o.from,a?null:o.to))}}return n}function Zn(e,t,r){if(e)for(var n,i=0;i=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from0&&s)for(var f=0;ff;++f)p.push(g);p.push(a)}return p}function Jn(e){for(var t=0;t0)){var c=[a,1],f=Nl(u.from,s.from),h=Nl(u.to,s.to);(0>f||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from}),(h>0||!l.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-1}}return i}function ri(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(Nl(u.to,r)>0||a.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Nl(u.from,n)<0||a.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function fi(e){for(var t;t=ai(e);)e=t.find(-1,!0).line;return e}function hi(e){for(var t,r;t=ui(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function di(e,t){var r=Ki(e,t),n=fi(r);return r==n?t:Yi(n)}function pi(e,t){if(t>e.lastLine())return t;var r,n=Ki(e,t);if(!gi(e,n))return t;for(;r=ui(n);)n=r.find(1,!0).line;return Yi(n)+1}function gi(e,t){var r=Ml&&t.markedSpans;if(r)for(var n,i=0;io;o++){i&&(i[0]=e.innerMode(t,n).mode);var l=t.token(r,n);if(r.pos>r.start)return l}throw new Error("Mode "+t.name+" failed to advance stream.")}function ki(e,t,r,n){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?Ql(l.mode,c):c}}var o,l=e.doc,s=l.mode;t=pt(l,t);var a,u=Ki(l,t.line),c=Rt(e,t.line,r),f=new os(u.text,e.options.tabSize);for(n&&(a=[]);(n||f.pose.options.maxHighlightLength?(s=!1,l&&Ni(e,t,n,f.pos),f.pos=t.length,a=null):a=Ci(Li(r,f,n,h),o),h){var d=h[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;uu;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"cm-overlay "+t),a=r+2;else for(;a>r;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ai(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Mi(e,t,t.stateAfter=Rt(e,Yi(t)));t.styles=n.styles,n.classes?t.styleClasses=n.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Ni(e,t,r,n){var i=e.doc.mode,o=new os(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&Si(i,r);!o.eol()&&o.pos<=e.options.maxHighlightLength;)Li(i,o,r),o.start=o.pos}function Wi(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?hs:fs;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Oi(e,t){var r=zo("span",null,null,hl?"padding-right: .1px":null),n={pre:zo("pre",[r]),content:r,col:0,pos:0,cm:e};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=Hi,(cl||hl)&&e.getOption("lineWrapping")&&(n.addToken=Ii(n.addToken)),Xo(e.display.measure)&&(o=Zi(l))&&(n.addToken=Pi(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&Yi(l);Ei(l,n,Ai(e,l,s)),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=Go(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=Go(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(jo(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return hl&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),Cs(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=Go(n.pre.className,n.textClass||"")),n}function Di(e){var t=zo("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Hi(e,t,r,n,i,o,l){if(t){var s=e.cm.options.specialChars,a=!1;if(s.test(t))for(var u=document.createDocumentFragment(),c=0;;){s.lastIndex=c;var f=s.exec(t),h=f?f.index-c:t.length-c;if(h){var d=document.createTextNode(t.slice(c,c+h));u.appendChild(cl&&9>fl?zo("span",[d]):d),e.map.push(e.pos,e.pos+h,d),e.col+=h,e.pos+=h}if(!f)break;if(c+=h+1," "==f[0]){var p=e.cm.options.tabSize,g=p-e.col%p,d=u.appendChild(zo("span",ko(g),"cm-tab"));d.setAttribute("role","presentation"),d.setAttribute("cm-text"," "),e.col+=g}else{var d=e.cm.options.specialCharPlaceholder(f[0]);d.setAttribute("cm-text",f[0]),u.appendChild(cl&&9>fl?zo("span",[d]):d),e.col+=1}e.map.push(e.pos,e.pos+1,d),e.pos++}else{e.col+=t.length;var u=document.createTextNode(t);e.map.push(e.pos,e.pos+t.length,u),cl&&9>fl&&(a=!0),e.pos+=t.length}if(r||n||i||a||l){var v=r||"";n&&(v+=n),i&&(v+=i);var m=zo("span",[u],v,l);return o&&(m.title=o),e.content.appendChild(m)}e.content.appendChild(u)}}function Ii(e){function t(e){for(var t=" ",r=0;ra&&f.from<=a)break}if(f.to>=u)return e(r,n,i,o,l,s);e(r,n.slice(0,f.to-a),i,o,null,s),o=null,n=n.slice(f.to-a),a=f.to}}}function zi(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Ei(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=f=s="",h=null,m=1/0;for(var y=[],b=0;bp)?(null!=w.to&&m>w.to&&(m=w.to,u=""),x.className&&(a+=" "+x.className),x.css&&(s=x.css),x.startStyle&&w.from==p&&(c+=" "+x.startStyle),x.endStyle&&w.to==m&&(u+=" "+x.endStyle),x.title&&!f&&(f=x.title),x.collapsed&&(!h||li(h.marker,x)<0)&&(h=w)):w.from>p&&m>w.from&&(m=w.from),"bookmark"==x.type&&w.from==p&&x.widgetNode&&y.push(x)}if(h&&(h.from||0)==p&&(zi(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to))return;if(!h&&y.length)for(var b=0;b=d)break;for(var C=Math.min(d,m);;){if(v){var S=p+v.length;if(!h){var L=S>C?v.slice(0,C-p):v;t.addToken(t,L,l?l+a:a,c,p+L.length==m?u:"",f,s)}if(S>=C){v=v.slice(C-p),p=C;break}p=S,c=""}v=i.slice(o,o=r[g++]),l=Wi(r[g++],t.cm.options)}}else for(var g=1;gr;++r)o.push(new cs(u[r],i(r),n));return o}var s=t.from,a=t.to,u=t.text,c=Ki(e,s.line),f=Ki(e,a.line),h=To(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Fi(e,t)){var g=l(0,u.length-1);o(f,f.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(a.ch),d);else{var g=l(1,u.length-1);g.push(new cs(h+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(f,h+f.text.slice(a.ch),d);var g=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,g)}mo(e,"change",e,t)}function Bi(e){this.lines=e,this.parent=null;for(var t=0,r=0;tt||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(o>t){r=i;break}t-=o}return r.lines[t]}function ji(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function Xi(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function _i(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Yi(e){if(null==e.parent)return null;for(var t=e.parent,r=Mo(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function $i(e,t){var r=e.first;e:do{for(var n=0;nt){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var n=0;nt)break;t-=s}return r+n}function qi(e){e=fi(e);for(var t=0,r=e.parent,n=0;n1&&!e.done[e.done.length-2].ranges?(e.done.pop(),To(e.done)):void 0}function ro(e,t,r,n){var i=e.history;i.undone.length=0;var o,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=to(i,i.lastOp==n))){var s=To(o.changes);0==Nl(t.from,t.to)&&0==Nl(t.from,s.to)?s.to=Vl(t):o.changes.push(Ji(e,t))}else{var a=To(i.done);for(a&&a.ranges||oo(e.sel,i.done),o={changes:[Ji(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||Cs(e,"historyAdded")}function no(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function io(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||no(e,o,To(i.done),t))?i.done[i.done.length-1]=t:oo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&eo(i.undone)}function oo(e,t){var r=To(t);r&&r.ranges&&r.equals(e)||t.push(e)}function lo(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function so(e){if(!e)return null;for(var t,r=0;r-1&&(To(s)[f]=c[f],delete c[f])}}}return i}function co(e,t,r,n){r0}function Co(e){e.prototype.on=function(e,t){ws(this,e,t)},e.prototype.off=function(e,t){xs(this,e,t)}}function So(){this.id=null}function Lo(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function ko(e){for(;Ws.length<=e;)Ws.push(To(Ws)+" ");return Ws[e]}function To(e){return e[e.length-1]}function Mo(e,t){for(var r=0;r-1&&Is(e)?!0:t.test(e):Is(e)}function Io(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Po(e){return e.charCodeAt(0)>=768&&Ps.test(e)}function zo(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild);return e}function Fo(e,t){return Eo(e).appendChild(t)}function Ro(){return document.activeElement}function Bo(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Go(e,t){for(var r=e.split(" "),n=0;n2&&!(cl&&8>fl))}var r=Es?zo("span","​"):zo("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Xo(e){if(null!=Fs)return Fs;var t=Fo(e,document.createTextNode("AخA")),r=Ds(t,0,1).getBoundingClientRect();if(!r||r.left==r.right)return!1;var n=Ds(t,1,2).getBoundingClientRect();return Fs=n.right-r.right<3}function _o(e){if(null!=Xs)return Xs;var t=Fo(e,zo("span","x")),r=t.getBoundingClientRect(),n=Ds(t,0,1).getBoundingClientRect();return Xs=Math.abs(r.left-n.left)>1}function Yo(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function $o(e){return e.level%2?e.to:e.from}function qo(e){return e.level%2?e.from:e.to}function Zo(e){var t=Zi(e);return t?$o(t[0]):0}function Qo(e){var t=Zi(e);return t?qo(To(t)):e.text.length}function Jo(e,t){var r=Ki(e.doc,t),n=fi(r);n!=r&&(t=Yi(n));var i=Zi(n),o=i?i[0].level%2?Qo(n):Zo(n):0;return Al(t,o)}function el(e,t){for(var r,n=Ki(e.doc,t);r=ui(n);)n=r.find(1,!0).line,t=null;var i=Zi(n),o=i?i[0].level%2?Zo(n):Qo(n):n.text.length;return Al(null==t?Yi(n):t,o)}function tl(e,t){var r=Jo(e,t.line),n=Ki(e.doc,r.line),i=Zi(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return Al(r.line,l?0:o)}return r}function rl(e,t,r){var n=e[0].level;return t==n?!0:r==n?!1:r>t}function nl(e,t){Ys=null;for(var r,n=0;nt)return n;if(i.from==t||i.to==t){if(null!=r)return rl(e,i.level,e[r].level)?(i.from!=i.to&&(Ys=r),n):(i.from!=i.to&&(Ys=n),r);r=n}}return r}function il(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&Po(e.text.charAt(t)));return t}function ol(e,t,r,n){var i=Zi(e);if(!i)return ll(e,t,r,n);for(var o=nl(i,t),l=i[o],s=il(e,t,l.level%2?-r:r,n);;){if(s>l.from&&s0==l.level%2?l.to:l.from);if(l=i[o+=r],!l)return null;s=r>0==l.level%2?il(e,l.to,-1,n):il(e,l.from,1,n)}}function ll(e,t,r,n){var i=t+r;if(n)for(;i>0&&Po(e.text.charAt(i));)i+=r;return 0>i||i>e.text.length?null:i}var sl=/gecko\/\d/i.test(navigator.userAgent),al=/MSIE \d/.test(navigator.userAgent),ul=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),cl=al||ul,fl=cl&&(al?document.documentMode||6:ul[1]),hl=/WebKit\//.test(navigator.userAgent),dl=hl&&/Qt\/\d+\.\d+/.test(navigator.userAgent),pl=/Chrome\//.test(navigator.userAgent),gl=/Opera\//.test(navigator.userAgent),vl=/Apple Computer/.test(navigator.vendor),ml=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),yl=/PhantomJS/.test(navigator.userAgent),bl=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),wl=bl||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),xl=bl||/Mac/.test(navigator.platform),Cl=/win/i.test(navigator.platform),Sl=gl&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Sl&&(Sl=Number(Sl[1])),Sl&&Sl>=15&&(gl=!1,hl=!0);var Ll=xl&&(dl||gl&&(null==Sl||12.11>Sl)),kl=sl||cl&&fl>=9,Tl=!1,Ml=!1;g.prototype=Oo({update:function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&e.clientHeight>0&&(0==n&&this.overlayHack(),this.checkedOverlay=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},overlayHack:function(){var e=xl&&!ml?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;var t=this,r=function(e){go(e)!=t.vert&&go(e)!=t.horiz&&Mr(t.cm,Vr)(e)};ws(this.vert,"mousedown",r),ws(this.horiz,"mousedown",r)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},g.prototype),v.prototype=Oo({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},v.prototype),e.scrollbarModel={"native":g,"null":v},k.prototype.signal=function(e,t){xo(e,t)&&this.events.push(arguments)},k.prototype.finish=function(){for(var e=0;e=9&&r.hasSelection&&(r.hasSelection=null),r.poll()}),ws(o,"paste",function(){if(hl&&!n.state.fakedLastChar&&!(new Date-n.state.lastMiddleDown<200)){var e=o.selectionStart,t=o.selectionEnd;o.value+="$",o.selectionEnd=t,o.selectionStart=e,n.state.fakedLastChar=!0}n.state.pasteIncoming=!0,r.fastPoll()}),ws(o,"cut",t),ws(o,"copy",t),ws(e.scroller,"paste",function(t){Gr(e,t)||(n.state.pasteIncoming=!0,r.focus())}),ws(e.lineSpace,"selectstart",function(t){Gr(e,t)||ms(t)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Dt(e);if(e.options.moveInputWithCursor){var i=cr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},showSelection:function(e){var t=this.cm,r=t.display;Fo(r.cursorDiv,e.cursors),Fo(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=js&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var l=t?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&Os(this.textarea),cl&&fl>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",cl&&fl>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!wl||Ro()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(!e.state.focused||Ks(t)&&!r||Z(e)||e.options.disableInput||e.state.keySeq)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(cl&&fl>=9&&this.hasSelection===n||xl&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;8203!=n.charCodeAt(0)||e.doc.sel!=e.display.selForContextMenu||r||(r="​");for(var i=0,o=Math.min(r.length,n.length);o>i&&r.charCodeAt(i)==n.charCodeAt(i);)++i;var l=this;return Tr(e,function(){Q(e,n.slice(i),r.length-i),n.length>1e3||n.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=n +}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){cl&&fl>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t=l.value="​"+(e?l.value:"");n.prevInput=e?"":"​",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.position="relative",l.style.cssText=c,cl&&9>fl&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!cl||cl&&9>fl)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart?Mr(i,es.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset()};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,l=n.textarea,s=Ur(i,e),a=o.scroller.scrollTop;if(s&&!gl){var u=i.options.resetSelectionOnContextMenu;u&&-1==i.doc.sel.contains(s)&&Mr(i,kt)(i.doc,ht(s),Ts);var c=l.style.cssText;if(n.wrapper.style.position="absolute",l.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(cl?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",hl)var f=window.scrollY;if(o.input.focus(),hl&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),cl&&fl>=9&&t(),kl){bs(e);var h=function(){xs(window,"mouseup",h),setTimeout(r,20)};ws(window,"mouseup",h)}else setTimeout(r,50)}},setUneditable:No,needsContentAttribute:!1},tt.prototype),nt.prototype=Oo({init:function(e){function t(e){if(n.somethingSelected())Wl=n.getSelections(),"cut"==e.type&&n.replaceSelection("",null,"cut");else{var t=J(n);Wl=t.text,"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Ts),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!bl)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Wl.join("\n"));else{var r=rt(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=Wl.join("\n");var o=document.activeElement;Os(i),setTimeout(function(){n.display.lineSpace.removeChild(r),o.focus()},50)}}var r=this,n=r.cm,i=r.div=e.lineDiv;i.contentEditable="true",et(i),ws(i,"paste",function(e){var t=e.clipboardData&&e.clipboardData.getData("text/plain");t&&(e.preventDefault(),n.replaceSelection(t,null,"paste"))}),ws(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),l=o.indexOf(t,Math.max(0,i.head.ch-t.length));l>-1&&l<=i.head.ch&&(r.composing.sel=ht(Al(i.head.line,l),Al(i.head.line,l+t.length)))}}),ws(i,"compositionupdate",function(e){r.composing.data=e.data}),ws(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),ws(i,"touchstart",function(){r.forceCompositionEnd()}),ws(i,"input",function(){r.composing||r.pollContent()||Tr(r.cm,function(){Dr(n)})}),ws(i,"copy",t),ws(i,"cut",t)},prepareSelection:function(){var e=Dt(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=lt(this.cm,e.anchorNode,e.anchorOffset),n=lt(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=Nl($(r,n),t.from())||0!=Nl(Y(r,n),t.to())){var i=it(this.cm,t.from()),o=it(this.cm,t.to());if(i||o){var l=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var a=l[l.length-1].measure,u=a.maps?a.maps[a.maps.length-1]:a.map;o={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}}else i={node:l[0].measure.map[2],offset:0};try{var c=Ds(i.node,i.offset,o.offset,o.node)}catch(f){}c&&(e.removeAllRanges(),e.addRange(c),s&&null==e.anchorNode&&e.addRange(s)),this.rememberSelection()}}},showMultipleSelections:function(e){Fo(this.cm.display.cursorDiv,e.cursors),Fo(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return zs(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Tr(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},pollSelection:function(){if(!this.composing){var e=window.getSelection(),t=this.cm;if(e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset){this.rememberSelection();var r=lt(t,e.anchorNode,e.anchorOffset),n=lt(t,e.focusNode,e.focusOffset);r&&n&&Tr(t,function(){kt(t.doc,ht(r,n),Ts),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.linet.viewTo-1)return!1;var o;if(n.line==t.viewFrom||0==(o=Pr(e,n.line)))var l=Yi(t.view[0].line),s=t.view[0].node;else var l=Yi(t.view[o].line),s=t.view[o-1].node.nextSibling;var a=Pr(e,i.line);if(a==t.view.length-1)var u=t.viewTo-1,c=t.view[a].node;else var u=Yi(t.view[a+1].line)-1,c=t.view[a+1].node.previousSibling;for(var f=Vs(at(e,s,c,l,u)),h=ji(e.doc,Al(l,0),Al(u,Ki(e.doc,u).text.length));f.length>1&&h.length>1;)if(To(f)==To(h))f.pop(),h.pop(),u--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),l++}for(var d=0,p=0,g=f[0],v=h[0],m=Math.min(g.length,v.length);m>d&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=To(f),b=To(h),w=Math.min(y.length-(1==f.length?d:0),b.length-(1==h.length?d:0));w>p&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;f[f.length-1]=y.slice(0,y.length-p),f[0]=f[0].slice(d);var x=Al(l,d),C=Al(u,h.length?To(h).length-p:0);return f.length>1||f[0]||Nl(x,C)?(kn(e.doc,f,x,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){e.data&&e.data!=e.startData&&Mr(this.cm,Q)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.setAttribute("contenteditable","false")},onKeyPress:function(e){e.preventDefault(),Mr(this.cm,Q)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},onContextMenu:No,resetPosition:No,needsContentAttribute:!0},nt.prototype),e.inputStyles={textarea:tt,contenteditable:nt},ut.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&Nl(e,n.to())<=0)return r}return-1}},ct.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return Y(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Ol,Dl,Hl,Il={left:0,right:0,top:0,bottom:0},Pl=null,zl=0,El=0,Fl=0,Rl=null;cl?Rl=-.53:sl?Rl=15:pl?Rl=-.7:vl&&(Rl=-1/3);var Bl=function(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}};e.wheelEventPixels=function(e){var t=Bl(e);return t.x*=Rl,t.y*=Rl,t};var Gl=new So,Ul=null,Vl=e.changeEnd=function(e){return e.text?Al(e.from.line+e.text.length-1,To(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];(r[e]!=t||"mode"==e)&&(r[e]=t,jl.hasOwnProperty(e)&&Mr(this,jl[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Bn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(Hn(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&On(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;r>a;++a)Hn(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&xt(this.doc,n,new ct(o,u[n].to()),Ts)}}}),getTokenAt:function(e,t){return ki(this,e,t)},getLineTokens:function(e,t){return ki(this,Al(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,r=Ai(this,Ki(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]s?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Zl.hasOwnProperty(t))return Zl;var n=Zl[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;on&&(e=n,r=!0);var i=Ki(this.doc,e);return sr(this,i,{top:0,left:0},t||"page").top+(r?this.doc.height-qi(i):0)},defaultTextHeight:function(){return gr(this.display)},defaultCharWidth:function(){return vr(this.display)},setGutterMarker:Ar(function(e,t,r){return In(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&Io(n)&&(e.gutterMarkers=null),!0})}),clearGutter:Ar(function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,Hr(t,n,"gutter"),Io(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),addLineWidget:Ar(function(e,t,r){return bi(this,e,t,r)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!vt(this.doc,e))return null;var t=e;if(e=Ki(this.doc,e),!e)return null}else{var t=Yi(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=cr(this,pt(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&An(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:Ar(ln),triggerOnKeyPress:Ar(un),triggerOnKeyUp:an,execCommand:function(e){return es.hasOwnProperty(e)?es[e](this):void 0},findPosH:function(e,t,r,n){var i=1;0>t&&(i=-1,t=-t);for(var o=0,l=pt(this.doc,e);t>o&&(l=zn(this.doc,l,i,r,n),!l.hitSide);++o);return l},moveH:Ar(function(e,t){var r=this;r.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?zn(r.doc,n.head,e,t,r.options.rtlMoveVisually):0>e?n.from():n.to()},As)}),deleteH:Ar(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Pn(this,function(r){var i=zn(n,r.head,e,t,!1);return 0>e?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;0>t&&(i=-1,t=-t);for(var l=0,s=pt(this.doc,e);t>l;++l){var a=cr(this,s,"div");if(null==o?o=a.left:a.left=o,s=En(this,a,i,r),s.hitSide)break}return s},moveV:Ar(function(e,t){var r=this,n=this.doc,i=[],o=!r.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return 0>e?l.from():l.to();var s=cr(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=En(r,s,e,t);return"page"==t&&l==n.sel.primary()&&Wn(r,null,ur(r,a,"div").top-s.top),a},As),i.length)for(var l=0;l0&&s(r.charAt(n-1));)--n;for(;i.5)&&l(this),Cs(this,"refresh",this)}),swapDoc:Ar(function(e){var t=this.doc;return t.cm=null,Vi(this,e),ir(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,mo(this,"swapDoc",this,t),t}),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}},Co(e);var Kl=e.defaults={},jl=e.optionHandlers={},Xl=e.Init={toString:function(){return"CodeMirror.Init"}};Fn("value","",function(e,t){e.setValue(t)},!0),Fn("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Fn("indentUnit",2,r,!0),Fn("indentWithTabs",!1),Fn("smartIndent",!0),Fn("tabSize",4,function(e){n(e),ir(e),Dr(e)},!0),Fn("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t){e.options.specialChars=new RegExp(t.source+(t.test(" ")?"":"| "),"g"),e.refresh()},!0),Fn("specialCharPlaceholder",Di,function(e){e.refresh()},!0),Fn("electricChars",!0),Fn("inputStyle",wl?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Fn("rtlMoveVisually",!Cl),Fn("wholeLineUpdateBefore",!0),Fn("theme","default",function(e){s(e),a(e)},!0),Fn("keyMap","default",function(t,r,n){var i=Bn(r),o=n!=e.Init&&Bn(n);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Fn("extraKeys",null),Fn("lineWrapping",!1,i,!0),Fn("gutters",[],function(e){d(e.options),a(e)},!0),Fn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?L(e.display)+"px":"0",e.refresh()},!0),Fn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Fn("scrollbarStyle","native",function(e){m(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Fn("lineNumbers",!1,function(e){d(e.options),a(e)},!0),Fn("firstLineNumber",1,a,!0),Fn("lineNumberFormatter",function(e){return e},a,!0),Fn("showCursorWhenSelecting",!1,Ot,!0),Fn("resetSelectionOnContextMenu",!0),Fn("readOnly",!1,function(e,t){"nocursor"==t?(fn(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||e.display.input.reset())}),Fn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Fn("dragDrop",!0),Fn("cursorBlinkRate",530),Fn("cursorScrollMargin",0),Fn("cursorHeight",1,Ot,!0),Fn("singleCursorHeightPerLine",!0,Ot,!0),Fn("workTime",100),Fn("workDelay",100),Fn("flattenSpans",!0,n,!0),Fn("addModeClass",!1,n,!0),Fn("pollInterval",100),Fn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Fn("historyEventDelay",1250),Fn("viewportMargin",10,function(e){e.refresh()},!0),Fn("maxHighlightLength",1e4,n,!0),Fn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Fn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Fn("autofocus",null);var _l=e.modes={},Yl=e.mimeModes={};e.defineMode=function(t,r){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),_l[t]=r},e.defineMIME=function(e,t){Yl[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Yl.hasOwnProperty(t))t=Yl[t];else if(t&&"string"==typeof t.name&&Yl.hasOwnProperty(t.name)){var r=Yl[t.name];"string"==typeof r&&(r={name:r}),t=Wo(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),n=_l[r.name];if(!n)return e.getMode(t,"text/plain");var i=n(t,r);if($l.hasOwnProperty(r.name)){var o=$l[r.name];for(var l in o)o.hasOwnProperty(l)&&(i.hasOwnProperty(l)&&(i["_"+l]=i[l]),i[l]=o[l])}if(i.name=r.name,r.helperType&&(i.helperType=r.helperType),r.modeProps)for(var l in r.modeProps)i[l]=r.modeProps[l];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var $l=e.modeExtensions={};e.extendMode=function(e,t){var r=$l.hasOwnProperty(e)?$l[e]:$l[e]={};Oo(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){ps.prototype[e]=t},e.defineOption=Fn;var ql=[];e.defineInitHook=function(e){ql.push(e)};var Zl=e.helpers={};e.registerHelper=function(t,r,n){Zl.hasOwnProperty(t)||(Zl[t]=e[t]={_global:[]}),Zl[t][r]=n},e.registerGlobalHelper=function(t,r,n,i){e.registerHelper(t,r,i),Zl[t]._global.push({pred:n,val:i})};var Ql=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},Jl=e.startState=function(e,t,r){return e.startState?e.startState(t,r):!0};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var es=e.commands={selectAll:function(e){e.setSelection(Al(e.firstLine(),0),Al(e.lastLine()),Ts)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ts)},killLine:function(e){Pn(e,function(t){if(t.empty()){var r=Ki(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new Al(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Al(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Ki(e.doc,i.line-1).text;l&&e.replaceRange(o.charAt(0)+"\n"+l.charAt(l.length-1),Al(i.line-1,l.length-1),Al(i.line,1),"+transpose")}r.push(new ct(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){Tr(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var n=e.listSelections()[r];e.replaceRange("\n",n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0),On(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},ts=e.keyMap={};ts.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ts.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ts.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},ts.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ts["default"]=xl?ts.macDefault:ts.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Ao(r.split(" "),Rn),o=0;o=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ls=0,ss=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ls};Co(ss),ss.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&mr(e),xo(this,"clear")){var r=this.find();r&&mo(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Dr(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&At(e.doc)),e&&mo(e,"markerCleared",e,this),t&&br(e),this.parent&&this.parent.clear()}},ss.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;ir;++r){var i=this.lines[r];this.height-=i.height,xi(i),mo(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;ne;++e)if(r(this.lines[e]))return!0}},Gi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;re){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Bi))){var s=[];this.collapse(s),this.children=[new Bi(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t=e){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var l=i.lines.splice(i.lines.length-25,25),s=new Bi(l);i.height-=s.height,this.children.splice(n+1,0,s),s.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Gi(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=Mo(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new Gi(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;ne){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var ds=0,ps=e.Doc=function(e,t,r){if(!(this instanceof ps))return new ps(e,t,r);null==r&&(r=0),Gi.call(this,[new Bi([new cs("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var n=Al(r,0);this.sel=ht(n),this.history=new Qi(null),this.id=++ds,this.modeOption=t,"string"==typeof e&&(e=Vs(e)),Ri(this,{from:n,to:n,text:e}),kt(this,ht(n),Ts)};ps.prototype=Wo(Gi.prototype,{constructor:ps,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n=0;o--)bn(this,n[o]);s?Lt(this,s):this.cm&&On(this.cm)}),undo:Nr(function(){xn(this,"undo")}),redo:Nr(function(){xn(this,"redo")}),undoSelection:Nr(function(){xn(this,"undo",!0)}),redoSelection:Nr(function(){xn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=pt(this,e),t=pt(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;sa.to||null==a.from&&i!=e.line||i==t.line&&a.from>t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=i,void++r)}),pt(this,Al(r,t))},indexFromPos:function(e){e=pt(this,e);var t=e.ch;return e.linet&&(t=e.from),null!=e.to&&e.tos||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}},Ws=[""],Os=function(e){e.select()};bl?Os=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:cl&&(Os=function(e){try{e.select()}catch(t){}});var Ds,Hs=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Is=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Hs.test(e))},Ps=/[\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]/;Ds=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var zs=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};cl&&11>fl&&(Ro=function(){try{return document.activeElement}catch(e){return document.body}});var Es,Fs,Rs=e.rmClass=function(e,t){var r=e.className,n=Bo(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Bs=e.addClass=function(e,t){var r=e.className;Bo(t).test(r)||(e.className+=(r?" ":"")+t)},Gs=!1,Us=function(){if(cl&&9>fl)return!1;var e=zo("div");return"draggable"in e||"dragDrop"in e}(),Vs=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;n>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Ks=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},js=function(){var e=zo("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Xs=null,_s={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=_s,function(){for(var e=0;10>e;e++)_s[e+48]=_s[e+96]=String(e);for(var e=65;90>=e;e++)_s[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)_s[e+111]=_s[e+63235]="F"+e}();var Ys,$s=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?n.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,s=/[Lb1n]/,a=/[1n]/,u="L";return function(r){if(!i.test(r))return!1;for(var n,c=r.length,f=[],h=0;c>h;++h)f.push(n=e(r.charCodeAt(h)));for(var h=0,d=u;c>h;++h){var n=f[h];"m"==n?f[h]=d:d=n}for(var h=0,p=u;c>h;++h){var n=f[h];"1"==n&&"r"==p?f[h]="n":l.test(n)&&(p=n,"r"==n&&(f[h]="R"))}for(var h=1,d=f[0];c-1>h;++h){var n=f[h];"+"==n&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=n||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d),d=n}for(var h=0;c>h;++h){var n=f[h];if(","==n)f[h]="N";else if("%"==n){for(var g=h+1;c>g&&"%"==f[g];++g);for(var v=h&&"!"==f[h-1]||c>g&&"1"==f[g]?"1":"N",m=h;g>m;++m)f[m]=v;h=g-1}}for(var h=0,p=u;c>h;++h){var n=f[h];"L"==p&&"1"==n?f[h]="L":l.test(n)&&(p=n)}for(var h=0;c>h;++h)if(o.test(f[h])){for(var g=h+1;c>g&&o.test(f[g]);++g);for(var y="L"==(h?f[h-1]:u),b="L"==(c>g?f[g]:u),v=y||b?"L":"R",m=h;g>m;++m)f[m]=v;h=g-1}for(var w,x=[],h=0;c>h;)if(s.test(f[h])){var C=h;for(++h;c>h&&s.test(f[h]);++h);x.push(new t(0,C,h))}else{var S=h,L=x.length;for(++h;c>h&&"L"!=f[h];++h);for(var m=S;h>m;)if(a.test(f[m])){m>S&&x.splice(L,0,new t(1,S,m));var k=m;for(++m;h>m&&a.test(f[m]);++m);x.splice(L,0,new t(2,k,m)),S=m}else++m;h>S&&x.splice(L,0,new t(1,S,h))}return 1==x[0].level&&(w=r.match(/^\s+/))&&(x[0].from=w[0].length,x.unshift(new t(0,0,w[0].length))),1==To(x).level&&(w=r.match(/\s+$/))&&(To(x).to-=w[0].length,x.push(new t(0,c-w[0].length,c))),x[0].level!=To(x).level&&x.push(new t(x[0].level,c,c)),x}}();return e.version="5.0.1",e}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/apl/apl.min.js b/media/editors/codemirror/mode/apl/apl.min.js new file mode 100644 index 0000000000000..985701d49d1d0 --- /dev/null +++ b/media/editors/codemirror/mode/apl/apl.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("apl",function(){var e={".":"innerProduct","\\":"scan","/":"reduce","⌿":"reduce1Axis","⍀":"scan1Axis","¨":"each","⍣":"power"},n={"+":["conjugate","add"],"−":["negate","subtract"],"×":["signOf","multiply"],"÷":["reciprocal","divide"],"⌈":["ceiling","greaterOf"],"⌊":["floor","lesserOf"],"∣":["absolute","residue"],"⍳":["indexGenerate","indexOf"],"?":["roll","deal"],"⋆":["exponentiate","toThePowerOf"],"⍟":["naturalLog","logToTheBase"],"○":["piTimes","circularFuncs"],"!":["factorial","binomial"],"⌹":["matrixInverse","matrixDivide"],"<":[null,"lessThan"],"≤":[null,"lessThanOrEqual"],"=":[null,"equals"],">":[null,"greaterThan"],"≥":[null,"greaterThanOrEqual"],"≠":[null,"notEqual"],"≡":["depth","match"],"≢":[null,"notMatch"],"∈":["enlist","membership"],"⍷":[null,"find"],"∪":["unique","union"],"∩":[null,"intersection"],"∼":["not","without"],"∨":[null,"or"],"∧":[null,"and"],"⍱":[null,"nor"],"⍲":[null,"nand"],"⍴":["shapeOf","reshape"],",":["ravel","catenate"],"⍪":[null,"firstAxisCatenate"],"⌽":["reverse","rotate"],"⊖":["axis1Reverse","axis1Rotate"],"⍉":["transpose",null],"↑":["first","take"],"↓":[null,"drop"],"⊂":["enclose","partitionWithAxis"],"⊃":["diclose","pick"],"⌷":[null,"index"],"⍋":["gradeUp",null],"⍒":["gradeDown",null],"⊤":["encode",null],"⊥":["decode",null],"⍕":["format","formatByExample"],"⍎":["execute",null],"⊣":["stop","left"],"⊢":["pass","right"]},t=/[\.\/⌿⍀¨⍣]/,r=/⍬/,l=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,a=/←/,i=/[⍝#].*$/,o=function(e){var n;return n=!1,function(t){return n=t,t===e?"\\"===n:!0}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(u,s){var c,p,d;return u.eatSpace()?null:(c=u.next(),'"'===c||"'"===c?(u.eatWhile(o(c)),u.next(),s.prev=!0,"string"):/[\[{\(]/.test(c)?(s.prev=!1,null):/[\]}\)]/.test(c)?(s.prev=!0,null):r.test(c)?(s.prev=!1,"niladic"):/[¯\d]/.test(c)?(s.func?(s.func=!1,s.prev=!1):s.prev=!0,u.eatWhile(/[\w\.]/),"number"):t.test(c)?"operator apl-"+e[c]:a.test(c)?"apl-arrow":l.test(c)?(p="apl-",null!=n[c]&&(p+=s.prev?n[c][1]:n[c][0]),s.func=!0,s.prev=!1,"function "+p):i.test(c)?(u.skipToEnd(),"comment"):"∘"===c&&"."===u.peek()?(u.next(),"function jot-dot"):(u.eatWhile(/[\w\$_]/),d=u.current(),s.prev=!0,"keyword"))}}}),e.defineMIME("text/apl","apl")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/asterisk/asterisk.min.js b/media/editors/codemirror/mode/asterisk/asterisk.min.js new file mode 100644 index 0000000000000..e173a8226a185 --- /dev/null +++ b/media/editors/codemirror/mode/asterisk/asterisk.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("asterisk",function(){function e(e,n){var a="",r="";if(r=e.next(),";"==r)return e.skipToEnd(),"comment";if("["==r)return e.skipTo("]"),e.eat("]"),"header";if('"'==r)return e.skipTo('"'),"string";if("'"==r)return e.skipTo("'"),"string-2";if("#"==r&&(e.eatWhile(/\w/),a=e.current(),-1!==i.indexOf(a)))return e.skipToEnd(),"strong";if("$"==r){var o=e.peek();if("{"==o)return e.skipTo("}"),e.eat("}"),"variable-3"}if(e.eatWhile(/\w/),a=e.current(),-1!==t.indexOf(a)){switch(n.extenStart=!0,a){case"same":n.extenSame=!0;break;case"include":case"switch":case"ignorepat":n.extenInclude=!0}return"atom"}}var t=["exten","same","include","ignorepat","switch"],i=["#include","#exec"],n=["addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi","alarmreceiver","amd","answer","authenticate","background","backgrounddetect","bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent","changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge","congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge","dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility","datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa","dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy","externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif","goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete","ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus","jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme","meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete","minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode","mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish","originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce","parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones","privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten","readfile","receivefax","receivefax","receivefax","record","removequeuemember","resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun","saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax","sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags","setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel","slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground","speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound","speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor","stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec","trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate","vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring","waitforsilence","waitmusiconhold","waituntil","while","zapateller"];return{startState:function(){return{extenStart:!1,extenSame:!1,extenInclude:!1,extenExten:!1,extenPriority:!1,extenApplication:!1}},token:function(t,i){var a="",r="";return t.eatSpace()?null:i.extenStart?(t.eatWhile(/[^\s]/),a=t.current(),/^=>?$/.test(a)?(i.extenExten=!0,i.extenStart=!1,"strong"):(i.extenStart=!1,t.skipToEnd(),"error")):i.extenExten?(i.extenExten=!1,i.extenPriority=!0,t.eatWhile(/[^,]/),i.extenInclude&&(t.skipToEnd(),i.extenPriority=!1,i.extenInclude=!1),i.extenSame&&(i.extenPriority=!1,i.extenSame=!1,i.extenApplication=!0),"tag"):i.extenPriority?(i.extenPriority=!1,i.extenApplication=!0,r=t.next(),i.extenSame?null:(t.eatWhile(/[^,]/),"number")):i.extenApplication?(t.eatWhile(/,/),a=t.current(),","===a?null:(t.eatWhile(/\w/),a=t.current().toLowerCase(),i.extenApplication=!1,-1!==n.indexOf(a)?"def strong":null)):e(t,i)}}}),e.defineMIME("text/x-asterisk","asterisk")}); \ 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 b04b22b167f9a..e2223ccd1533a 100644 --- a/media/editors/codemirror/mode/clike/clike.js +++ b/media/editors/codemirror/mode/clike/clike.js @@ -354,7 +354,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { state.tokenize = null; break; } - escaped = stream.next() != "\\" && !escaped; + escaped = stream.next() == "\\" && !escaped; } return "string"; } @@ -398,6 +398,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { if (!stream.match('""')) return false; state.tokenize = tokenTripleString; return state.tokenize(stream, state); + }, + "'": function(stream) { + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + return "atom"; } } }); diff --git a/media/editors/codemirror/mode/clike/clike.min.js b/media/editors/codemirror/mode/clike/clike.min.js new file mode 100644 index 0000000000000..be18619e6b512 --- /dev/null +++ b/media/editors/codemirror/mode/clike/clike.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=e.split(" "),n=0;n!?|\/]/;return{startState:function(e){return{tokenize:null,context:new i((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;c=null;var o=(t.tokenize||n)(e,t);if("comment"==o||"meta"==o)return o;if(null==r.align&&(r.align=!0),";"!=c&&":"!=c&&","!=c||"statement"!=r.type)if("{"==c)l(t,e.column(),"}");else if("["==c)l(t,e.column(),"]");else if("("==c)l(t,e.column(),")");else if("}"==c){for(;"statement"==r.type;)r=s(t);for("}"==r.type&&(r=s(t));"statement"==r.type;)r=s(t)}else c==r.type?s(t):b&&(("}"==r.type||"top"==r.type)&&";"!=c||"statement"==r.type&&"newstatement"==c)&&l(t,e.column(),"statement");else s(t);return t.startOfLine=!1,o},indent:function(t,r){if(t.tokenize!=n&&null!=t.tokenize)return e.Pass;var o=t.context,a=r&&r.charAt(0);"statement"==o.type&&"}"==a&&(o=o.prev);var i=a==o.type;return"statement"==o.type?o.indented+("{"==a?0:d):!o.align||f&&")"==o.type?")"!=o.type||i?o.indented+(i?0:u):o.indented+d:o.column+(i?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var s="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";i(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:t(s),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),i(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:t(s+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),blockKeywords:t("catch class do else finally for if struct switch try while"),atoms:t("true false null"),hooks:{"#":r,u:n,U:n,L:n,R:n},modeProps:{fold:["brace","include"]}}),i("text/x-java",{name:"clike",keywords:t("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:t("catch class do else finally for if switch try while"),atoms:t("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),i("text/x-csharp",{name:"clike",keywords:t("abstract as 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"),blockKeywords:t("catch class do else finally for foreach if struct switch try while"),builtin:t("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:t("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=o,o(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),i("text/x-scala",{name:"clike",keywords:t("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq 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:t("catch class do else finally for forSome if match switch try while"),atoms:t("true false null"),indentStatements:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return e.match('""')?(t.tokenize=l,t.tokenize(e,t)):!1},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}}}),i(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:t("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:t("for while do if else struct"),builtin:t("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:t("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"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),i("text/x-nesc",{name:"clike",keywords:t(s+"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"),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),i("text/x-objectivec",{name:"clike",keywords:t(s+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),atoms:t("YES NO NULL NILL ON OFF"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":r},modeProps:{fold:"brace"}})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/clojure/clojure.min.js b/media/editors/codemirror/mode/clojure/clojure.min.js new file mode 100644 index 0000000000000..b4be817fac25f --- /dev/null +++ b/media/editors/codemirror/mode/clojure/clojure.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("clojure",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),v=t("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),w=t("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),x={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var q,j=!1;null!=(q=e.next());){if('"'==q&&!j){t.mode=!1;break}j=!j&&"\\"==q}n=c;break;default:var S=e.next();if('"'==S)t.mode="string",n=c;else if("\\"==S)i(e),n=l;else if("'"!=S||x.digit_or_colon.test(e.peek()))if(";"==S)e.skipToEnd(),n=d;else if(o(S,e))n=u;else if("("==S||"["==S||"{"==S){var z,E="",_=e.column();if("("==S)for(;null!=(z=e.eat(x.keyword_char));)E+=z;E.length>0&&(w.propertyIsEnumerable(E)||/^(?:def|with)/.test(E))?r(t,_+y,S):(e.eatSpace(),e.eol()||";"==e.peek()?r(t,_+b,S):r(t,_+e.current().length,S)),e.backUp(e.current().length-1),n=p}else if(")"==S||"]"==S||"}"==S)n=p,null!=t.indentStack&&t.indentStack.type==(")"==S?"(":"]"==S?"[":"{")&&a(t);else{if(":"==S)return e.eatWhile(x.symbol),f;e.eatWhile(x.symbol),n=k&&k.propertyIsEnumerable(e.current())?h:v&&v.propertyIsEnumerable(e.current())?s:g&&g.propertyIsEnumerable(e.current())?f:m}else n=f}return n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},lineComment:";;"}}),e.defineMIME("text/x-clojure","clojure")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/cobol/cobol.min.js b/media/editors/codemirror/mode/cobol/cobol.min.js new file mode 100644 index 0000000000000..9283fc5952969 --- /dev/null +++ b/media/editors/codemirror/mode/cobol/cobol.min.js @@ -0,0 +1 @@ +!function(E){"object"==typeof exports&&"object"==typeof module?E(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],E):E(CodeMirror)}(function(E){"use strict";E.defineMode("cobol",function(){function E(E){for(var T={},I=E.split(" "),N=0;N >= "),M={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(E,t){if(null==t.indentStack&&E.sol()&&(t.indentation=6),E.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var G=!1;null!=(G=E.next());)if('"'==G||"'"==G){t.mode=!1;break}n=R;break;default:var i=E.next(),B=E.column();if(B>=0&&5>=B)n=D;else if(B>=72&&79>=B)E.skipToEnd(),n=L;else if("*"==i&&6==B)E.skipToEnd(),n=N;else if('"'==i||"'"==i)t.mode="string",n=R;else if("'"!=i||M.digit_or_colon.test(E.peek()))if("."==i)n=S;else if(T(i,E))n=O;else{if(E.current().match(M.symbol))for(;71>B&&void 0!==E.eat(M.symbol);)B++;n=P&&P.propertyIsEnumerable(E.current().toUpperCase())?C:e&&e.propertyIsEnumerable(E.current().toUpperCase())?I:U&&U.propertyIsEnumerable(E.current().toUpperCase())?A:null}else n=A}return n},indent:function(E){return null==E.indentStack?E.indentation:E.indentStack.indent}}}),E.defineMIME("text/x-cobol","cobol")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/coffeescript/coffeescript.min.js b/media/editors/codemirror/mode/coffeescript/coffeescript.min.js new file mode 100644 index 0000000000000..6023522e7f82c --- /dev/null +++ b/media/editors/codemirror/mode/coffeescript/coffeescript.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("coffeescript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var n=t.scope.offset;if(e.eatSpace()){var r=e.indentation();return r>n&&"coffee"==t.scope.type?"indent":n>r?"dedent":null}n>0&&f(e,t)}if(e.eatSpace())return null;var c=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=i,t.tokenize(e,t);if("#"===c)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var a=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(a=!0),e.match(/^-?\d+\.\d*/)&&(a=!0),e.match(/^-?\.\d+/)&&(a=!0),a)return"."==e.peek()&&e.backUp(1),"number";var h=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(h=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(h=!0),e.match(/^-?0(?![\dx])/i)&&(h=!0),h)return"number"}if(e.match(y))return t.tokenize=o(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=o(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(s)||e.match(m)?"operator":e.match(u)?"punctuation":e.match(z)?"atom":e.match(k)?"keyword":e.match(l)?"variable":e.match(d)?"property":(e.next(),p)}function o(e,n,o){return function(i,c){for(;!i.eol();)if(i.eatWhile(/[^'"\/\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return o}else{if(i.match(e))return c.tokenize=r,o;i.eat(/['"\/]/)}return n&&(t.singleLineStringErrors?o=p:c.tokenize=r),o}}function i(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=r;break}e.eatWhile("#")}return"comment"}function c(t,n,r){r=r||"coffee";for(var o=0,i=!1,c=null,f=n.scope;f;f=f.prev)if("coffee"===f.type||"}"==f.type){o=f.offset+e.indentUnit;break}"coffee"!==r?(i=null,c=t.column()+t.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:o,type:r,prev:n.scope,align:i,alignOffset:c}}function f(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var n=e.indentation(),r=!1,o=t.scope;o;o=o.prev)if(n===o.offset){r=!0;break}if(!r)return!0;for(;t.scope.prev&&t.scope.offset!==n;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function a(e,t){var n=t.tokenize(e,t),r=e.current();if("."===r)return n=t.tokenize(e,t),r=e.current(),/^\.[\w$]+$/.test(r)?"variable":p;"return"===r&&(t.dedent=!0),("->"!==r&&"=>"!==r||t.lambda||e.peek())&&"indent"!==n||c(e,t);var o="[({".indexOf(r);if(-1!==o&&c(e,t,"])}".slice(o,o+1)),h.exec(r)&&c(e,t),"then"==r&&f(e,t),"dedent"===n&&f(e,t))return p;if(o="])}".indexOf(r),-1!==o){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==r&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),n}var p="error",s=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,u=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,l=/^[_A-Za-z$][_A-Za-z$0-9]*/,d=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,m=n(["and","or","not","is","isnt","in","instanceof","typeof"]),h=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],v=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],k=n(h.concat(v));h=n(h);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,g=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],z=n(g),x={startState:function(e){return{tokenize:r,scope:{offset:e||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=null===t.scope.align&&t.scope;n&&e.sol()&&(n.align=!1);var r=a(e,t);return n&&r&&"comment"!=r&&(n.align=!0),t.lastToken={style:r,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),r},indent:function(e,t){if(e.tokenize!=r)return 0;var n=e.scope,o=t&&"])}".indexOf(t.charAt(0))>-1;if(o)for(;"coffee"==n.type&&n.prev;)n=n.prev;var i=o&&n.type===t.charAt(0);return n.align?n.alignOffset-(i?1:0):(i?n.prev:n).offset},lineComment:"#",fold:"indent"};return x}),e.defineMIME("text/x-coffeescript","coffeescript")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/commonlisp/commonlisp.min.js b/media/editors/codemirror/mode/commonlisp/commonlisp.min.js new file mode 100644 index 0000000000000..a3cea6f3fe539 --- /dev/null +++ b/media/editors/codemirror/mode/commonlisp/commonlisp.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("commonlisp",function(t){function e(t){for(var e;e=t.next();)if("\\"==e)t.next();else if(!a.test(e)){t.backUp(1);break}return t.current()}function n(t,n){if(t.eatSpace())return i="ws",null;if(t.match(u))return"number";var a=t.next();if("\\"==a&&(a=t.next()),'"'==a)return(n.tokenize=r)(t,n);if("("==a)return i="open","bracket";if(")"==a||"]"==a)return i="close","bracket";if(";"==a)return t.skipToEnd(),i="ws","comment";if(/['`,@]/.test(a))return null;if("|"==a)return t.skipTo("|")?(t.next(),"symbol"):(t.skipToEnd(),"error");if("#"==a){var a=t.next();return"["==a?(i="open","bracket"):/[+\-=\.']/.test(a)?null:/\d/.test(a)&&t.match(/^\d*#/)?null:"|"==a?(n.tokenize=o)(t,n):":"==a?(e(t),"meta"):"error"}var f=e(t);return"."==f?null:(i="symbol","nil"==f||"t"==f||":"==f.charAt(0)?"atom":"open"==n.lastType&&(l.test(f)||c.test(f))?"keyword":"&"==f.charAt(0)?"variable-2":"variable")}function r(t,e){for(var r,o=!1;r=t.next();){if('"'==r&&!o){e.tokenize=n;break}o=!o&&"\\"==r}return"string"}function o(t,e){for(var r,o;r=t.next();){if("#"==r&&"|"==o){e.tokenize=n;break}o=r}return i="ws","comment"}var i,l=/^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/,c=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,u=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,a=/[^\s'`,@()\[\]";]/;return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastType:null,tokenize:n}},token:function(e,n){e.sol()&&"number"!=typeof n.ctx.indentTo&&(n.ctx.indentTo=n.ctx.start+1),i=null;var r=n.tokenize(e,n);return"ws"!=i&&(null==n.ctx.indentTo?n.ctx.indentTo="symbol"==i&&c.test(e.current())?n.ctx.start+t.indentUnit:"next":"next"==n.ctx.indentTo&&(n.ctx.indentTo=e.column()),n.lastType=i),"open"==i?n.ctx={prev:n.ctx,start:e.column(),indentTo:null}:"close"==i&&(n.ctx=n.ctx.prev||n.ctx),r},indent:function(t){var e=t.ctx.indentTo;return"number"==typeof e?e:t.ctx.start+1},lineComment:";;",blockCommentStart:"#|",blockCommentEnd:"|#"}}),t.defineMIME("text/x-common-lisp","commonlisp")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/css/css.js b/media/editors/codemirror/mode/css/css.js index 3f02907ed5752..34355aaa99a95 100644 --- a/media/editors/codemirror/mode/css/css.js +++ b/media/editors/codemirror/mode/css/css.js @@ -16,13 +16,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) { var indentUnit = config.indentUnit, tokenHooks = parserConfig.tokenHooks, + documentTypes = parserConfig.documentTypes || {}, mediaTypes = parserConfig.mediaTypes || {}, mediaFeatures = parserConfig.mediaFeatures || {}, propertyKeywords = parserConfig.propertyKeywords || {}, nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, + fontProperties = parserConfig.fontProperties || {}, + counterDescriptors = parserConfig.counterDescriptors || {}, colorKeywords = parserConfig.colorKeywords || {}, valueKeywords = parserConfig.valueKeywords || {}, - fontProperties = parserConfig.fontProperties || {}, allowNested = parserConfig.allowNested; var type, override; @@ -57,6 +59,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) { if (/[\d.]/.test(stream.peek())) { stream.eatWhile(/[\w.%]/); return ret("number", "unit"); + } else if (stream.match(/^-[\w\\\-]+/)) { + stream.eatWhile(/[\w\\\-]/); + if (stream.match(/^\s*:/, false)) + return ret("variable-2", "variable-definition"); + return ret("variable-2", "variable"); } else if (stream.match(/^\w+-/)) { return ret("meta", "meta"); } @@ -66,7 +73,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) { return ret("qualifier", "qualifier"); } else if (/[:;{}\[\]\(\)]/.test(ch)) { return ret(null, ch); - } else if (ch == "u" && stream.match("rl(")) { + } else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) || + (ch == "d" && stream.match("omain(")) || + (ch == "r" && stream.match("egexp("))) { stream.backUp(1); state.tokenize = tokenParenthesized; return ret("property", "word"); @@ -148,10 +157,11 @@ CodeMirror.defineMode("css", function(config, parserConfig) { return pushContext(state, stream, "block"); } else if (type == "}" && state.context.prev) { return popContext(state); - } else if (type == "@media") { - return pushContext(state, stream, "media"); - } else if (type == "@font-face") { - return "font_face_before"; + } else if (/@(media|supports|(-moz-)?document)/.test(type)) { + return pushContext(state, stream, "atBlock"); + } else if (/@(font-face|counter-style)/.test(type)) { + state.stateArg = type; + return "restricted_atBlock_before"; } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { return "keyframes"; } else if (type && type.charAt(0) == "@") { @@ -241,47 +251,63 @@ CodeMirror.defineMode("css", function(config, parserConfig) { return pass(type, stream, state); }; - states.media = function(type, stream, state) { - if (type == "(") return pushContext(state, stream, "media_parens"); + states.atBlock = function(type, stream, state) { + if (type == "(") return pushContext(state, stream, "atBlock_parens"); if (type == "}") return popAndPass(type, stream, state); if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); if (type == "word") { var word = stream.current().toLowerCase(); - if (word == "only" || word == "not" || word == "and") + if (word == "only" || word == "not" || word == "and" || word == "or") override = "keyword"; + else if (documentTypes.hasOwnProperty(word)) + override = "tag"; else if (mediaTypes.hasOwnProperty(word)) override = "attribute"; else if (mediaFeatures.hasOwnProperty(word)) override = "property"; + else if (propertyKeywords.hasOwnProperty(word)) + override = "property"; + else if (nonStandardPropertyKeywords.hasOwnProperty(word)) + override = "string-2"; + else if (valueKeywords.hasOwnProperty(word)) + override = "atom"; else override = "error"; } return state.context.type; }; - states.media_parens = function(type, stream, state) { + states.atBlock_parens = function(type, stream, state) { if (type == ")") return popContext(state); if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); - return states.media(type, stream, state); + return states.atBlock(type, stream, state); }; - states.font_face_before = function(type, stream, state) { + states.restricted_atBlock_before = function(type, stream, state) { if (type == "{") - return pushContext(state, stream, "font_face"); + return pushContext(state, stream, "restricted_atBlock"); + if (type == "word" && state.stateArg == "@counter-style") { + override = "variable"; + return "restricted_atBlock_before"; + } return pass(type, stream, state); }; - states.font_face = function(type, stream, state) { - if (type == "}") return popContext(state); + states.restricted_atBlock = function(type, stream, state) { + if (type == "}") { + state.stateArg = null; + return popContext(state); + } if (type == "word") { - if (!fontProperties.hasOwnProperty(stream.current().toLowerCase())) + if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) || + (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase()))) override = "error"; else override = "property"; return "maybeprop"; } - return "font_face"; + return "restricted_atBlock"; }; states.keyframes = function(type, stream, state) { @@ -309,6 +335,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { startState: function(base) { return {tokenize: null, state: "top", + stateArg: null, context: new Context("top", base || 0, null)}; }, @@ -329,9 +356,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) { var indent = cx.indent; if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; if (cx.prev && - (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "font_face") || - ch == ")" && (cx.type == "parens" || cx.type == "media_parens") || - ch == "{" && (cx.type == "at" || cx.type == "media"))) { + (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "restricted_atBlock") || + ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || + ch == "{" && (cx.type == "at" || cx.type == "atBlock"))) { indent = cx.indent - indentUnit; cx = cx.prev; } @@ -353,6 +380,10 @@ CodeMirror.defineMode("css", function(config, parserConfig) { return keys; } + var documentTypes_ = [ + "domain", "regexp", "url", "url-prefix" + ], documentTypes = keySet(documentTypes_); + var mediaTypes_ = [ "all", "aural", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "embossed" @@ -469,6 +500,16 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "searchfield-results-decoration", "zoom" ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); + var fontProperties_ = [ + "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", + "font-stretch", "font-weight", "font-style" + ], fontProperties = keySet(fontProperties_); + + var counterDescriptors_ = [ + "additive-symbols", "fallback", "negative", "pad", "prefix", "range", + "speak-as", "suffix", "symbols", "system" + ], counterDescriptors = keySet(counterDescriptors_); + var colorKeywords_ = [ "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", @@ -499,32 +540,33 @@ CodeMirror.defineMode("css", function(config, parserConfig) { ], colorKeywords = keySet(colorKeywords_); var valueKeywords_ = [ - "above", "absolute", "activeborder", "activecaption", "afar", - "after-white-space", "ahead", "alias", "all", "all-scroll", "alternate", + "above", "absolute", "activeborder", "additive", "activecaption", "afar", + "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate", "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", - "arabic-indic", "armenian", "asterisks", "auto", "avoid", "avoid-column", "avoid-page", + "arabic-indic", "armenian", "asterisks", "attr", "auto", "avoid", "avoid-column", "avoid-page", "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary", "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", - "both", "bottom", "break", "break-all", "break-word", "button", "button-bevel", - "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", + "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel", + "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian", "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", - "cell", "center", "checkbox", "circle", "cjk-earthly-branch", + "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch", "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", "col-resize", "collapse", "column", "compact", "condensed", "contain", "content", - "content-box", "context-menu", "continuous", "copy", "cover", "crop", - "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", + "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop", + "cross", "crosshair", "currentcolor", "cursive", "cyclic", "dashed", "decimal", "decimal-leading-zero", "default", "default-button", "destination-atop", "destination-in", "destination-out", "destination-over", "devanagari", - "disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted", - "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", + "disc", "discard", "disclosure-closed", "disclosure-open", "document", + "dot-dash", "dot-dot-dash", + "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", - "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", - "ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed", + "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", + "ethiopic-numeric", "ew-resize", "expanded", "extends", "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "footnotes", "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", @@ -533,12 +575,14 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", "inline-block", "inline-flex", "inline-table", "inset", "inside", "intrinsic", "invert", - "italic", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", + "italic", "japanese-formal", "japanese-informal", "justify", "kannada", + "katakana", "katakana-iroha", "keep-all", "khmer", + "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", "landscape", "lao", "large", "larger", "left", "level", "lighter", - "line-through", "linear", "lines", "list-item", "listbox", "listitem", + "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem", "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", - "lower-roman", "lowercase", "ltr", "malayalam", "match", + "lower-roman", "lowercase", "ltr", "malayalam", "match", "matrix", "matrix3d", "media-controls-background", "media-current-time-display", "media-fullscreen-button", "media-mute-button", "media-play-button", "media-return-to-realtime-button", "media-rewind-button", @@ -550,45 +594,48 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", - "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", + "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", - "painted", "page", "paused", "persian", "plus-darker", "plus-lighter", "pointer", - "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", - "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region", - "relative", "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", - "ridge", "right", "round", "row-resize", "rtl", "run-in", "running", - "s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield", + "painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter", + "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", + "progress", "push-button", "radial-gradient", "radio", "read-only", + "read-write", "read-write-plaintext-only", "rectangle", "region", + "relative", "repeat", "repeating-linear-gradient", + "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse", + "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY", + "rotateZ", "round", "row-resize", "rtl", "run-in", "running", + "s-resize", "sans-serif", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", + "scroll", "scrollbar", "se-resize", "searchfield", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", "searchfield-results-decoration", "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", - "single", "skip-white-space", "slide", "slider-horizontal", + "simp-chinese-formal", "simp-chinese-informal", "single", + "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", "small", "small-caps", "small-caption", "smaller", "solid", "somali", - "source-atop", "source-in", "source-out", "source-over", "space", "square", - "square-button", "start", "static", "status-bar", "stretch", "stroke", - "sub", "subpixel-antialiased", "super", "sw-resize", "table", + "source-atop", "source-in", "source-out", "source-over", "space", "spell-out", "square", + "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", + "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row", "table-row-group", + "tamil", "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", + "trad-chinese-formal", "trad-chinese-informal", + "translate", "translate3d", "translateX", "translateY", "translateZ", "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", - "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", + "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", - "window", "windowframe", "windowtext", "x-large", "x-small", "xor", + "window", "windowframe", "windowtext", "words", "x-large", "x-small", "xor", "xx-large", "xx-small" ], valueKeywords = keySet(valueKeywords_); - var fontProperties_ = [ - "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", - "font-stretch", "font-weight", "font-style" - ], fontProperties = keySet(fontProperties_); - - var allWords = mediaTypes_.concat(mediaFeatures_).concat(propertyKeywords_) + var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(propertyKeywords_) .concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_); CodeMirror.registerHelper("hintWords", "css", allWords); @@ -615,13 +662,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) { } CodeMirror.defineMIME("text/css", { + documentTypes: documentTypes, mediaTypes: mediaTypes, mediaFeatures: mediaFeatures, propertyKeywords: propertyKeywords, nonStandardPropertyKeywords: nonStandardPropertyKeywords, + fontProperties: fontProperties, + counterDescriptors: counterDescriptors, colorKeywords: colorKeywords, valueKeywords: valueKeywords, - fontProperties: fontProperties, tokenHooks: { "<": function(stream, state) { if (!stream.match("!--")) return false; diff --git a/media/editors/codemirror/mode/css/css.min.js b/media/editors/codemirror/mode/css/css.min.js new file mode 100644 index 0000000000000..e81981646f1e4 --- /dev/null +++ b/media/editors/codemirror/mode/css/css.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r")?(e.match("-->"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}e.defineMode("css",function(t,r){function o(e,t){return m=t,e}function a(e,t){var r=e.next();if(b[r]){var a=b[r](e,t);if(a!==!1)return a}return"@"==r?(e.eatWhile(/[\w\\\-]/),o("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?o(null,"compare"):'"'==r||"'"==r?(t.tokenize=i(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),o("atom","hash")):"!"==r?(e.match(/^\s*\w*/),o("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),o("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?o(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?o(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=n,o("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),o("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?o("variable-2","variable-definition"):o("variable-2","variable")):e.match(/^\w+-/)?o("meta","meta"):void 0}function i(e){return function(t,r){for(var a,i=!1;null!=(a=t.next());){if(a==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==a}return(a==e||!i&&")"!=e)&&(r.tokenize=null),o("string","string")}}function n(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:i(")"),o(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r){return e.context=new l(r,t.indentation()+g,e.context),r}function c(e){return e.context=e.context.prev,e.context.type}function d(e,t,r){return K[r.context.type](e,t,r)}function u(e,t,r,o){for(var a=o||1;a>0;a--)r.context=r.context.prev;return d(e,t,r)}function p(e){var t=e.current().toLowerCase();h=j.hasOwnProperty(t)?"atom":q.hasOwnProperty(t)?"keyword":"variable"}r.propertyKeywords||(r=e.resolveMode("text/css"));var m,h,g=t.indentUnit,b=r.tokenHooks,f=r.documentTypes||{},k=r.mediaTypes||{},y=r.mediaFeatures||{},w=r.propertyKeywords||{},v=r.nonStandardPropertyKeywords||{},x=r.fontProperties||{},z=r.counterDescriptors||{},q=r.colorKeywords||{},j=r.valueKeywords||{},P=r.allowNested,K={};return K.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(/@(media|supports|(-moz-)?document)/.test(e))return s(r,t,"atBlock");if(/@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(P&&"("==e)return s(r,t,"parens")}return r.context.type},K.block=function(e,t,r){if("word"==e){var o=t.current().toLowerCase();return w.hasOwnProperty(o)?(h="property","maybeprop"):v.hasOwnProperty(o)?(h="string-2","maybeprop"):P?(h=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(h+=" error","maybeprop")}return"meta"==e?"block":P||"hash"!=e&&"qualifier"!=e?K.top(e,t,r):(h="error","block")},K.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):d(e,t,r)},K.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&P)return s(r,t,"propBlock");if("}"==e||"{"==e)return u(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)p(t);else if("interpolation"==e)return s(r,t,"interpolation")}else h+=" error";return"prop"},K.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(h="property","maybeprop"):r.context.type},K.parens=function(e,t,r){return"{"==e||"}"==e?u(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):("word"==e&&p(t),"parens")},K.pseudo=function(e,t,r){return"word"==e?(h="variable-3",r.context.type):d(e,t,r)},K.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e)return u(e,t,r);if("{"==e)return c(r)&&s(r,t,P?"block":"top");if("word"==e){var o=t.current().toLowerCase();h="only"==o||"not"==o||"and"==o||"or"==o?"keyword":f.hasOwnProperty(o)?"tag":k.hasOwnProperty(o)?"attribute":y.hasOwnProperty(o)?"property":w.hasOwnProperty(o)?"property":v.hasOwnProperty(o)?"string-2":j.hasOwnProperty(o)?"atom":"error"}return r.context.type},K.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?u(e,t,r,2):K.atBlock(e,t,r)},K.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(h="variable","restricted_atBlock_before"):d(e,t,r)},K.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(h="@font-face"==r.stateArg&&!x.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!z.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},K.keyframes=function(e,t,r){return"word"==e?(h="variable","keyframes"):"{"==e?s(r,t,"top"):d(e,t,r)},K.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?u(e,t,r):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},K.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?u(e,t,r):("variable"!=e&&(h="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:"top",stateArg:null,context:new l("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||a)(e,t);return r&&"object"==typeof r&&(m=r[1],r=r[0]),h=r,t.state=K[t.state](m,e,t),h},indent:function(e,t){var r=e.context,o=t&&t.charAt(0),a=r.indent;return"prop"!=r.type||"}"!=o&&")"!=o||(r=r.prev),!r.prev||("}"!=o||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type)&&(")"!=o||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=o||"at"!=r.type&&"atBlock"!=r.type)||(a=r.indent-g,r=r.prev),a},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var a=["domain","regexp","url","url-prefix"],i=t(a),n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],l=t(n),s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],c=t(s),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=t(d),p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],m=t(p),h=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(h),b=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],f=t(b),k=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(k),w=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],v=t(w),x=a.concat(n).concat(s).concat(d).concat(p).concat(k).concat(w);e.registerHelper("hintWords","css",x),e.defineMIME("text/css",{documentTypes:i,mediaTypes:l,mediaFeatures:c,propertyKeywords:u,nonStandardPropertyKeywords:m,fontProperties:g,counterDescriptors:f,colorKeywords:y,valueKeywords:v,tokenHooks:{"<":function(e,t){return e.match("!--")?(t.tokenize=o,o(e,t)):!1},"/":function(e,t){return e.eat("*")?(t.tokenize=r,r(e,t)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:l,mediaFeatures:c,propertyKeywords:u,nonStandardPropertyKeywords:m,colorKeywords:y,valueKeywords:v,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/)?[null,"{"]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:l,mediaFeatures:c,propertyKeywords:u,nonStandardPropertyKeywords:m,colorKeywords:y,valueKeywords:v,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/css/less_test.min.js b/media/editors/codemirror/mode/css/less_test.min.js new file mode 100644 index 0000000000000..8e8ca9967319f --- /dev/null +++ b/media/editors/codemirror/mode/css/less_test.min.js @@ -0,0 +1 @@ +!function(){"use strict";function r(r){test.mode(r,e,Array.prototype.slice.call(arguments,1),"less")}var e=CodeMirror.getMode({indentUnit:2},"text/x-less");r("variable","[variable-2 @base]: [atom #f04615];","[qualifier .class] {"," [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]"," [property color]: [variable saturate]([variable-2 @base], [number 5%]);","}"),r("amp","[qualifier .child], [qualifier .sibling] {"," [qualifier .parent] [atom &] {"," [property color]: [keyword black];"," }"," [atom &] + [atom &] {"," [property color]: [keyword red];"," }","}"),r("mixin","[qualifier .mixin] ([variable dark]; [variable-2 @color]) {"," [property color]: [variable darken]([variable-2 @color], [number 10%]);","}","[qualifier .mixin] ([variable light]; [variable-2 @color]) {"," [property color]: [variable lighten]([variable-2 @color], [number 10%]);","}","[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {"," [property display]: [atom block];","}","[variable-2 @switch]: [variable light];","[qualifier .class] {"," [qualifier .mixin]([variable-2 @switch]; [atom #888]);","}"),r("nest","[qualifier .one] {"," [def @media] ([property width]: [number 400px]) {"," [property font-size]: [number 1.2em];"," [def @media] [attribute print] [keyword and] [property color] {"," [property color]: [keyword blue];"," }"," }","}")}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/css/scss_test.min.js b/media/editors/codemirror/mode/css/scss_test.min.js new file mode 100644 index 0000000000000..f81e79a2aa72e --- /dev/null +++ b/media/editors/codemirror/mode/css/scss_test.min.js @@ -0,0 +1 @@ +!function(){function r(r){test.mode(r,t,Array.prototype.slice.call(arguments,1),"scss")}var t=CodeMirror.getMode({indentUnit:2},"text/x-scss");r("url_with_quotation","[tag foo] { [property background]:[atom url]([string test.jpg]) }"),r("url_with_double_quotes",'[tag foo] { [property background]:[atom url]([string "test.jpg"]) }'),r("url_with_single_quotes","[tag foo] { [property background]:[atom url]([string 'test.jpg']) }"),r("string",'[def @import] [string "compass/css3"]'),r("important_keyword","[tag foo] { [property background]:[atom url]([string 'test.jpg']) [keyword !important] }"),r("variable","[variable-2 $blue]:[atom #333]"),r("variable_as_attribute","[tag foo] { [property color]:[variable-2 $blue] }"),r("numbers","[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }"),r("number_percentage","[tag foo] { [property width]:[number 80%] }"),r("selector","[builtin #hello][qualifier .world]{}"),r("singleline_comment","[comment // this is a comment]"),r("multiline_comment","[comment /*foobar*/]"),r("attribute_with_hyphen","[tag foo] { [property font-size]:[number 10px] }"),r("string_after_attribute",'[tag foo] { [property content]:[string "::"] }'),r("directives","[def @include] [qualifier .mixin]"),r("basic_structure","[tag p] { [property background]:[keyword red]; }"),r("nested_structure","[tag p] { [tag a] { [property color]:[keyword red]; } }"),r("mixin","[def @mixin] [tag table-base] {}"),r("number_without_semicolon","[tag p] {[property width]:[number 12]}","[tag a] {[property color]:[keyword red];}"),r("atom_in_nested_block","[tag p] { [tag a] { [property color]:[atom #000]; } }"),r("interpolation_in_property","[tag foo] { #{[variable-2 $hello]}:[number 2]; }"),r("interpolation_in_selector","[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }"),r("interpolation_error","[tag foo]#{[error foo]} { [property color]:[atom #000]; }"),r("divide_operator","[tag foo] { [property width]:[number 4] [operator /] [number 2] }"),r("nested_structure_with_id_selector","[tag p] { [builtin #hello] { [property color]:[keyword red]; } }"),r("indent_mixin","[def @mixin] [tag container] ("," [variable-2 $a]: [number 10],"," [variable-2 $b]: [number 10])","{}"),r("indent_nested","[tag foo] {"," [tag bar] {"," }","}"),r("indent_parentheses","[tag foo] {"," [property color]: [variable darken]([variable-2 $blue],"," [number 9%]);","}"),r("indent_vardef","[variable-2 $name]:"," [string 'val'];","[tag tag] {"," [tag inner] {"," [property margin]: [number 3px];"," }","}")}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/css/test.js b/media/editors/codemirror/mode/css/test.js index d236e2a7384af..bef7156163229 100644 --- a/media/editors/codemirror/mode/css/test.js +++ b/media/editors/codemirror/mode/css/test.js @@ -126,10 +126,70 @@ MT("parens", "[qualifier .foo] {", " [property background-image]: [variable fade]([atom #000], [number 20%]);", - " [property border-image]: [variable linear-gradient](", + " [property border-image]: [atom linear-gradient](", " [atom to] [atom bottom],", " [variable fade]([atom #000], [number 20%]) [number 0%],", " [variable fade]([atom #000], [number 20%]) [number 100%]", " );", "}"); + + MT("css_variable", + ":[variable-3 root] {", + " [variable-2 --main-color]: [atom #06c];", + "}", + "[tag h1][builtin #foo] {", + " [property color]: [atom var]([variable-2 --main-color]);", + "}"); + + MT("supports", + "[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {", + " [property text-align-last]: [atom justify];", + "}"); + + MT("document", + "[def @document] [tag url]([string http://blah]),", + " [tag url-prefix]([string https://]),", + " [tag domain]([string blah.com]),", + " [tag regexp]([string \".*blah.+\"]) {", + " [builtin #id] {", + " [property background-color]: [keyword white];", + " }", + " [tag foo] {", + " [property font-family]: [variable Verdana], [atom sans-serif];", + " }", + " }"); + + MT("document_url", + "[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }"); + + MT("document_urlPrefix", + "[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }"); + + MT("document_domain", + "[def @document] [tag domain]([string blah.com]) { [tag foo] { } }"); + + MT("document_regexp", + "[def @document] [tag regexp]([string \".*blah.+\"]) { [builtin #id] { } }"); + + MT("counter-style", + "[def @counter-style] [variable binary] {", + " [property system]: [atom numeric];", + " [property symbols]: [number 0] [number 1];", + " [property suffix]: [string \".\"];", + " [property range]: [atom infinite];", + " [property speak-as]: [atom numeric];", + "}"); + + MT("counter-style-additive-symbols", + "[def @counter-style] [variable simple-roman] {", + " [property system]: [atom additive];", + " [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];", + " [property range]: [number 1] [number 49];", + "}"); + + MT("counter-style-use", + "[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }"); + + MT("counter-style-symbols", + "[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }"); })(); diff --git a/media/editors/codemirror/mode/css/test.min.js b/media/editors/codemirror/mode/css/test.min.js new file mode 100644 index 0000000000000..c9cff95a3782c --- /dev/null +++ b/media/editors/codemirror/mode/css/test.min.js @@ -0,0 +1 @@ +!function(){function r(r){test.mode(r,o,Array.prototype.slice.call(arguments,1))}var o=CodeMirror.getMode({indentUnit:2},"css");r("atMediaUnknownType","[def @media] [attribute screen] [keyword and] [error foobarhello] { }"),r("atMediaUnknownProperty","[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }"),r("atMediaMaxWidthNested","[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"),r("tagSelector","[tag foo] { }"),r("classSelector","[qualifier .foo-bar_hello] { }"),r("idSelector","[builtin #foo] { [error #foo] }"),r("tagSelectorUnclosed","[tag foo] { [property margin]: [number 0] } [tag bar] { }"),r("tagStringNoQuotes","[tag foo] { [property font-family]: [variable hello] [variable world]; }"),r("tagStringDouble",'[tag foo] { [property font-family]: [string "hello world"]; }'),r("tagStringSingle","[tag foo] { [property font-family]: [string 'hello world']; }"),r("tagColorKeyword","[tag foo] {"," [property color]: [keyword black];"," [property color]: [keyword navy];"," [property color]: [keyword yellow];","}"),r("tagColorHex3","[tag foo] { [property background]: [atom #fff]; }"),r("tagColorHex6","[tag foo] { [property background]: [atom #ffffff]; }"),r("tagColorHex4","[tag foo] { [property background]: [atom&error #ffff]; }"),r("tagColorHexInvalid","[tag foo] { [property background]: [atom&error #ffg]; }"),r("tagNegativeNumber","[tag foo] { [property margin]: [number -5px]; }"),r("tagPositiveNumber","[tag foo] { [property padding]: [number 5px]; }"),r("tagVendor","[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }"),r("tagBogusProperty","[tag foo] { [property&error barhelloworld]: [number 0]; }"),r("tagTwoProperties","[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }"),r("tagTwoPropertiesURL","[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }"),r("commentSGML","[comment ]"),r("commentSGML2","[comment ] [tag div] {}"),r("indent_tagSelector","[tag strong], [tag em] {"," [property background]: [atom rgba]("," [number 255], [number 255], [number 0], [number .2]"," );","}"),r("indent_atMedia","[def @media] {"," [tag foo] {"," [property color]:"," [keyword yellow];"," }","}"),r("indent_comma","[tag foo] {"," [property font-family]: [variable verdana],"," [atom sans-serif];","}"),r("indent_parentheses","[tag foo]:[variable-3 before] {"," [property background]: [atom url](","[string blahblah]","[string etc]","[string ]) [keyword !important];","}"),r("font_face","[def @font-face] {"," [property font-family]: [string 'myfont'];"," [error nonsense]: [string 'abc'];"," [property src]: [atom url]([string http://blah]),"," [atom url]([string http://foo]);","}"),r("empty_url","[def @import] [tag url]() [tag screen];"),r("parens","[qualifier .foo] {"," [property background-image]: [variable fade]([atom #000], [number 20%]);"," [property border-image]: [atom linear-gradient]("," [atom to] [atom bottom],"," [variable fade]([atom #000], [number 20%]) [number 0%],"," [variable fade]([atom #000], [number 20%]) [number 100%]"," );","}"),r("css_variable",":[variable-3 root] {"," [variable-2 --main-color]: [atom #06c];","}","[tag h1][builtin #foo] {"," [property color]: [atom var]([variable-2 --main-color]);","}"),r("supports","[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {"," [property text-align-last]: [atom justify];","}"),r("document","[def @document] [tag url]([string http://blah]),"," [tag url-prefix]([string https://]),"," [tag domain]([string blah.com]),",' [tag regexp]([string ".*blah.+"]) {'," [builtin #id] {"," [property background-color]: [keyword white];"," }"," [tag foo] {"," [property font-family]: [variable Verdana], [atom sans-serif];"," }"," }"),r("document_url","[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }"),r("document_urlPrefix","[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }"),r("document_domain","[def @document] [tag domain]([string blah.com]) { [tag foo] { } }"),r("document_regexp",'[def @document] [tag regexp]([string ".*blah.+"]) { [builtin #id] { } }'),r("counter-style","[def @counter-style] [variable binary] {"," [property system]: [atom numeric];"," [property symbols]: [number 0] [number 1];",' [property suffix]: [string "."];'," [property range]: [atom infinite];"," [property speak-as]: [atom numeric];","}"),r("counter-style-additive-symbols","[def @counter-style] [variable simple-roman] {"," [property system]: [atom additive];"," [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];"," [property range]: [number 1] [number 49];","}"),r("counter-style-use","[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }"),r("counter-style-symbols",'[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string "*"] [string "\\2020"] [string "\\2021"] [string "\\A7"]); }')}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/cypher/cypher.js b/media/editors/codemirror/mode/cypher/cypher.js index 315778706ef87..9decf30753fe6 100644 --- a/media/editors/codemirror/mode/cypher/cypher.js +++ b/media/editors/codemirror/mode/cypher/cypher.js @@ -60,7 +60,7 @@ }; var indentUnit = config.indentUnit; var curPunc; - var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "right", "round", "rtrim", "shortestPath", "sign", "sin", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "trim", "type", "upper"]); + var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "right", "round", "rtrim", "shortestPath", "sign", "sin", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "trim", "type", "upper"]); var preds = wordRegexp(["all", "and", "any", "has", "in", "none", "not", "or", "single", "xor"]); var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "distinct", "drop", "else", "end", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]); var operatorChars = /[*+\-<>=&|~%^]/; diff --git a/media/editors/codemirror/mode/cypher/cypher.min.js b/media/editors/codemirror/mode/cypher/cypher.min.js new file mode 100644 index 0000000000000..ec5b3cd133961 --- /dev/null +++ b/media/editors/codemirror/mode/cypher/cypher.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=function(e){return new RegExp("^(?:"+e.join("|")+")$","i")};e.defineMode("cypher",function(n){var r,i=function(e){var t=e.next(),n=null;if('"'===t||"'"===t)return e.match(/.+?["']/),"string";if(/[{}\(\),\.;\[\]]/.test(t))return n=t,"node";if("/"===t&&e.eat("/"))return e.skipToEnd(),"comment";if(u.test(t))return e.eatWhile(u),null;if(e.eatWhile(/[_\w\d]/),e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var r=e.current();return l.test(r)?"builtin":s.test(r)?"def":d.test(r)?"keyword":"variable"},o=function(e,t,n){return e.context={prev:e.context,indent:e.indent,col:n,type:t}},a=function(e){return e.indent=e.context.indent,e.context=e.context.prev},c=n.indentUnit,l=t(["abs","acos","allShortestPaths","asin","atan","atan2","avg","ceil","coalesce","collect","cos","cot","count","degrees","e","endnode","exp","extract","filter","floor","haversin","head","id","keys","labels","last","left","length","log","log10","lower","ltrim","max","min","node","nodes","percentileCont","percentileDisc","pi","radians","rand","range","reduce","rel","relationship","relationships","replace","right","round","rtrim","shortestPath","sign","sin","split","sqrt","startnode","stdev","stdevp","str","substring","sum","tail","tan","timestamp","toFloat","toInt","trim","type","upper"]),s=t(["all","and","any","has","in","none","not","or","single","xor"]),d=t(["as","asc","ascending","assert","by","case","commit","constraint","create","csv","cypher","delete","desc","descending","distinct","drop","else","end","explain","false","fieldterminator","foreach","from","headers","in","index","is","limit","load","match","merge","null","on","optional","order","periodic","profile","remove","return","scan","set","skip","start","then","true","union","unique","unwind","using","when","where","with"]),u=/[*+\-<>=&|~%^]/;return{startState:function(){return{tokenize:i,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"!==n&&t.context&&null==t.context.align&&"pattern"!==t.context.type&&(t.context.align=!0),"("===r)o(t,")",e.column());else if("["===r)o(t,"]",e.column());else if("{"===r)o(t,"}",e.column());else if(/[\]\}\)]/.test(r)){for(;t.context&&"pattern"===t.context.type;)a(t);t.context&&r===t.context.type&&a(t)}else"."===r&&t.context&&"pattern"===t.context.type?a(t):/atom|string|variable/.test(n)&&t.context&&(/[\}\]]/.test(t.context.type)?o(t,"pattern",e.column()):"pattern"!==t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return n},indent:function(t,n){var r=n&&n.charAt(0),i=t.context;if(/[\]\}]/.test(r))for(;i&&"pattern"===i.type;)i=i.prev;var o=i&&r===i.type;return i?"keywords"===i.type?e.commands.newlineAndIndent:i.align?i.col+(o?0:1):i.indent+(o?0:c):0}}}),e.modeExtensions.cypher={autoFormatLineBreaks:function(e){for(var t,n,r,n=e.split("\n"),r=/\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g,t=0;t!?|\/]/;return{startState:function(e){return{tokenize:null,context:new u((e||0)-f,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;c=null;var i=(t.tokenize||r)(e,t);if("comment"==i||"meta"==i)return i;if(null==n.align&&(n.align=!0),";"!=c&&":"!=c&&","!=c||"statement"!=n.type)if("{"==c)l(t,e.column(),"}");else if("["==c)l(t,e.column(),"]");else if("("==c)l(t,e.column(),")");else if("}"==c){for(;"statement"==n.type;)n=s(t);for("}"==n.type&&(n=s(t));"statement"==n.type;)n=s(t)}else c==n.type?s(t):(("}"==n.type||"top"==n.type)&&";"!=c||"statement"==n.type&&"newstatement"==c)&&l(t,e.column(),"statement");else s(t);return t.startOfLine=!1,i},indent:function(t,n){if(t.tokenize!=r&&null!=t.tokenize)return e.Pass;var i=t.context,o=n&&n.charAt(0);"statement"==i.type&&"}"==o&&(i=i.prev);var a=o==i.type;return"statement"==i.type?i.indented+("{"==o?0:d):i.align?i.column+(a?0:1):i.indented+(a?0:f)},electricChars:"{}"}});var n="body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with";e.defineMIME("text/x-d",{name:"d",keywords:t("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters "+n),blockKeywords:t(n),builtin:t("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t"),atoms:t("exit failure success true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}}})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/dart/dart.min.js b/media/editors/codemirror/mode/dart/dart.min.js new file mode 100644 index 0000000000000..dc9c3355bd602 --- /dev/null +++ b/media/editors/codemirror/mode/dart/dart.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},i=0;i"),e("meta",a);if("#"==a&&t.eatWhile(/[\w]/))return e("atom","tag");if("|"==a)return e("keyword","seperator");if(a.match(/[\(\)\[\]\-\.,\+\?>]/))return e(null,a);if(a.match(/[\[\]]/))return e("rule",a);if('"'==a||"'"==a)return n.tokenize=i(a),n.tokenize(t,n);if(t.eatWhile(/[a-zA-Z\?\+\d]/)){var o=t.current();return null!==o.substr(o.length-1,o.length).match(/\?|\+/)&&t.backUp(1),e("tag","tag")}return"%"==a||"*"==a?e("number","number"):(t.eatWhile(/[\w\\\-_%.{,]/),e(null,null))}return t.eatWhile(/[\-]/)?(n.tokenize=r,r(t,n)):t.eatWhile(/[\w]/)?e("keyword","doindent"):void 0}function r(t,r){for(var i,u=0;null!=(i=t.next());){if(u>=2&&">"==i){r.tokenize=n;break}u="-"==i?u+1:0}return e("comment","comment")}function i(t){return function(r,i){for(var u,a=!1;null!=(u=r.next());){if(u==t&&!a){i.tokenize=n;break}a=!a&&"\\"==u}return e("string","tag")}}function u(t,e){return function(r,i){for(;!r.eol();){if(r.match(e)){i.tokenize=n;break}r.next()}return t}}var a,o=t.indentUnit;return{startState:function(t){return{tokenize:n,baseIndent:t||0,stack:[]}},token:function(t,e){if(t.eatSpace())return null;var n=e.tokenize(t,e),r=e.stack[e.stack.length-1];return"["==t.current()||"doindent"===a||"["==a?e.stack.push("rule"):"endtag"===a?e.stack[e.stack.length-1]="endtag":"]"==t.current()||"]"==a||">"==a&&"rule"==r?e.stack.pop():"["==a&&e.stack.push("["),n},indent:function(t,e){var n=t.stack.length;return e.match(/\]\s+|\]/)?n-=1:">"===e.substr(e.length-1,e.length)&&("<"===e.substr(0,1)||"doindent"==a&&e.length>1||("doindent"==a?n--:">"==a&&e.length>1||"tag"==a&&">"!==e||("tag"==a&&"rule"==t.stack[t.stack.length-1]?n--:"tag"==a?n++:">"===e&&"rule"==t.stack[t.stack.length-1]&&">"===a?n--:">"===e&&"rule"==t.stack[t.stack.length-1]||("<"!==e.substr(0,1)&&">"===e.substr(0,1)?n-=1:">"===e||(n-=1)))),(null==a||"]"==a)&&n--),t.baseIndent+n*o},electricChars:"]>"}}),t.defineMIME("application/xml-dtd","dtd")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/dylan/dylan.min.js b/media/editors/codemirror/mode/dylan/dylan.min.js new file mode 100644 index 0000000000000..2abfa10300001 --- /dev/null +++ b/media/editors/codemirror/mode/dylan/dylan.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("dylan",function(){function e(e,n,t){return n.tokenize=t,t(e,n)}function n(e,n,t){return b=e,p=t,n}function t(t,o){var a=t.peek();if("'"==a||'"'==a)return t.next(),e(t,o,r(a,"string","string"));if("/"==a)return t.next(),t.eat("*")?e(t,o,i):t.eat("/")?(t.skipToEnd(),n("comment","comment")):(t.skipTo(" "),n("operator","operator"));if(/\d/.test(a))return t.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/),n("number","number");if("#"==a)return t.next(),a=t.peek(),'"'==a?(t.next(),e(t,o,r('"',"symbol","string-2"))):"b"==a?(t.next(),t.eatWhile(/[01]/),n("number","number")):"x"==a?(t.next(),t.eatWhile(/[\da-f]/i),n("number","number")):"o"==a?(t.next(),t.eatWhile(/[0-7]/),n("number","number")):(t.eatWhile(/[-a-zA-Z]/),n("hash","keyword"));if(t.match("end"))return n("end","keyword");for(var m in c)if(c.hasOwnProperty(m)){var u=c[m];if(u instanceof Array&&u.some(function(e){return t.match(e)})||t.match(u))return n(m,f[m],t.current())}return t.match("define")?n("definition","def"):(t.eatWhile(/[\w\-]/),s[t.current()]?n(s[t.current()],d[t.current()],t.current()):t.current().match(l)?n("variable","variable"):(t.next(),n("other","variable-2")))}function i(e,i){for(var r,o=!1;r=e.next();){if("/"==r&&o){i.tokenize=t;break}o="*"==r}return n("comment","comment")}function r(e,i,r){return function(o,a){for(var l,c=!1;null!=(l=o.next());)if(l==e){c=!0;break}return c&&(a.tokenize=t),n(i,r)}}var o={unnamedDefinition:["interface"],namedDefinition:["module","library","macro","C-struct","C-union","C-function","C-callable-wrapper"],typeParameterizedDefinition:["class","C-subtype","C-mapped-subtype"],otherParameterizedDefinition:["method","function","C-variable","C-address"],constantSimpleDefinition:["constant"],variableSimpleDefinition:["variable"],otherSimpleDefinition:["generic","domain","C-pointer-type","table"],statement:["if","block","begin","method","case","for","select","when","unless","until","while","iterate","profiling","dynamic-bind"],separator:["finally","exception","cleanup","else","elseif","afterwards"],other:["above","below","by","from","handler","in","instance","let","local","otherwise","slot","subclass","then","to","keyed-by","virtual"],signalingCalls:["signal","error","cerror","break","check-type","abort"]};o.otherDefinition=o.unnamedDefinition.concat(o.namedDefinition).concat(o.otherParameterizedDefinition),o.definition=o.typeParameterizedDefinition.concat(o.otherDefinition),o.parameterizedDefinition=o.typeParameterizedDefinition.concat(o.otherParameterizedDefinition),o.simpleDefinition=o.constantSimpleDefinition.concat(o.variableSimpleDefinition).concat(o.otherSimpleDefinition),o.keyword=o.statement.concat(o.separator).concat(o.other);var a="[-_a-zA-Z?!*@<>$%]+",l=new RegExp("^"+a),c={symbolKeyword:a+":",symbolClass:"<"+a+">",symbolGlobal:"\\*"+a+"\\*",symbolConstant:"\\$"+a},f={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variable-2",symbolConstant:"variable-3"};for(var m in c)c.hasOwnProperty(m)&&(c[m]=new RegExp("^"+c[m]));c.keyword=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var u={};u.keyword="keyword",u.definition="def",u.simpleDefinition="def",u.signalingCalls="builtin";var s={},d={};["keyword","definition","simpleDefinition","signalingCalls"].forEach(function(e){o[e].forEach(function(n){s[n]=e,d[n]=u[e]})});var b,p;return{startState:function(){return{tokenize:t,currentIndent:0}},token:function(e,n){if(e.eatSpace())return null;var t=n.tokenize(e,n);return t},blockCommentStart:"/*",blockCommentEnd:"*/"}}),e.defineMIME("text/x-dylan","dylan")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/ebnf/ebnf.min.js b/media/editors/codemirror/mode/ebnf/ebnf.min.js new file mode 100644 index 0000000000000..01bf41b832b9a --- /dev/null +++ b/media/editors/codemirror/mode/ebnf/ebnf.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ebnf",function(t){var a={slash:0,parenthesis:1},r={comment:0,_string:1,characterClass:2},c=null;return t.bracesMode&&(c=e.getMode(t,t.bracesMode)),{startState:function(){return{stringType:null,commentType:null,braced:0,lhs:!0,localState:null,stack:[],inDefinition:!1}},token:function(e,t){if(e){switch(0===t.stack.length&&('"'==e.peek()||"'"==e.peek()?(t.stringType=e.peek(),e.next(),t.stack.unshift(r._string)):e.match(/^\/\*/)?(t.stack.unshift(r.comment),t.commentType=a.slash):e.match(/^\(\*/)&&(t.stack.unshift(r.comment),t.commentType=a.parenthesis)),t.stack[0]){case r._string:for(;t.stack[0]===r._string&&!e.eol();)e.peek()===t.stringType?(e.next(),t.stack.shift()):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string";case r.comment:for(;t.stack[0]===r.comment&&!e.eol();)t.commentType===a.slash&&e.match(/\*\//)?(t.stack.shift(),t.commentType=null):t.commentType===a.parenthesis&&e.match(/\*\)/)?(t.stack.shift(),t.commentType=null):e.match(/^.[^\*]*/);return"comment";case r.characterClass:for(;t.stack[0]===r.characterClass&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(/^\\./)||t.stack.shift();return"operator"}var n=e.peek();if(null!==c&&(t.braced||"{"===n)){null===t.localState&&(t.localState=c.startState());var s=c.token(e,t.localState),i=e.current();if(!s)for(var o=0;o>/))return"builtin"}return e.match(/^\/\//)?(e.skipToEnd(),"comment"):e.match(/return/)?"operator":e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)?e.match(/(?=[\(.])/)?"variable":e.match(/(?=[\s\n]*[:=])/)?"def":"variable-2":-1!=["[","]","(",")"].indexOf(e.peek())?(e.next(),"bracket"):(e.eatSpace()||e.next(),null)}}}}),e.defineMIME("text/x-ebnf","ebnf")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/ecl/ecl.min.js b/media/editors/codemirror/mode/ecl/ecl.min.js new file mode 100644 index 0000000000000..31a372f5d7235 --- /dev/null +++ b/media/editors/codemirror/mode/ecl/ecl.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ecl",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r=0&&(!isNaN(a[l])||"_"==a[l]);)--l;if(l>0){var s=a.substr(0,l+1);if(h.propertyIsEnumerable(s))return b.propertyIsEnumerable(s)&&(u="newstatement"),"variable-3"}return g.propertyIsEnumerable(a)?"atom":null}function o(e){return function(t,n){for(var o,i=!1,a=!1;null!=(o=t.next());){if(o==e&&!i){a=!0;break}i=!i&&"\\"==o}return(a||!i&&!c)&&(n.tokenize=r),"string"}}function i(e,t){for(var n,o=!1;n=e.next();){if("/"==n&&o){t.tokenize=r;break}o="*"==n}return"comment"}function a(e,t,n,r,o){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=o}function l(e,t,n){return e.context=new a(e.indented,t,n,null,e.context)}function s(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var c,u,d=e.indentUnit,p=t("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"),f=t("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"),m=t("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"),h=t("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"),y=t("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"),b=t("catch class do else finally for if switch try while"),g=t("true false null"),v={"#":n},x=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new a((e||0)-d,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;u=null;var o=(t.tokenize||r)(e,t);if("comment"==o||"meta"==o)return o;if(null==n.align&&(n.align=!0),";"!=u&&":"!=u||"statement"!=n.type)if("{"==u)l(t,e.column(),"}");else if("["==u)l(t,e.column(),"]");else if("("==u)l(t,e.column(),")");else if("}"==u){for(;"statement"==n.type;)n=s(t);for("}"==n.type&&(n=s(t));"statement"==n.type;)n=s(t)}else u==n.type?s(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==u)&&l(t,e.column(),"statement");else s(t);return t.startOfLine=!1,o},indent:function(e,t){if(e.tokenize!=r&&null!=e.tokenize)return 0;var n=e.context,o=t&&t.charAt(0);"statement"==n.type&&"}"==o&&(n=n.prev);var i=o==n.type;return"statement"==n.type?n.indented+("{"==o?0:d):n.align?n.column+(i?0:1):n.indented+(i?0:d)},electricChars:"{}"}}),e.defineMIME("text/x-ecl","ecl")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/eiffel/eiffel.min.js b/media/editors/codemirror/mode/eiffel/eiffel.min.js new file mode 100644 index 0000000000000..7d8843ed9c520 --- /dev/null +++ b/media/editors/codemirror/mode/eiffel/eiffel.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("eiffel",function(){function e(e){for(var t={},r=0,n=e.length;n>r;++r)t[e[r]]=!0;return t}function t(e,t,r){return r.tokenize.push(e),e(t,r)}function r(e,r){if(i=null,e.eatSpace())return null;var o=e.next();return'"'==o||"'"==o?t(n(o,"string"),e,r):"-"==o&&e.eat("-")?(e.skipToEnd(),"comment"):":"==o&&e.eat("=")?"operator":/[0-9]/.test(o)?(e.eatWhile(/[xXbBCc0-9\.]/),e.eat(/[\?\!]/),"ident"):/[a-zA-Z_0-9]/.test(o)?(e.eatWhile(/[a-zA-Z_0-9]/),e.eat(/[\?\!]/),"ident"):/[=+\-\/*^%<>~]/.test(o)?(e.eatWhile(/[=+\-\/*^%<>~]/),"operator"):null}function n(e,t,r){return function(n,i){for(var o,a=!1;null!=(o=n.next());){if(o==e&&(r||!a)){i.tokenize.pop();break}a=!a&&"%"==o}return t}}var i,o=e(["note","across","when","variant","until","unique","undefine","then","strip","select","retry","rescue","require","rename","reference","redefine","prefix","once","old","obsolete","loop","local","like","is","inspect","infix","include","if","frozen","from","external","export","ensure","end","elseif","else","do","creation","create","check","alias","agent","separate","invariant","inherit","indexing","feature","expanded","deferred","class","Void","True","Result","Precursor","False","Current","create","attached","detachable","as","and","implies","not","or"]),a=e([":=","and then","and","or","<<",">>"]);return{startState:function(){return{tokenize:[r]}},token:function(e,t){var r=t.tokenize[t.tokenize.length-1](e,t);if("ident"==r){var n=e.current();r=o.propertyIsEnumerable(e.current())?"keyword":a.propertyIsEnumerable(e.current())?"operator":/^[A-Z][A-Z_0-9]*$/g.test(n)?"tag":/^0[bB][0-1]+$/g.test(n)?"number":/^0[cC][0-7]+$/g.test(n)?"number":/^0[xX][a-fA-F0-9]+$/g.test(n)?"number":/^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(n)?"number":/^[0-9]+$/g.test(n)?"number":"variable"}return r},lineComment:"--"}}),e.defineMIME("text/x-eiffel","eiffel")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/erlang/erlang.min.js b/media/editors/codemirror/mode/erlang/erlang.min.js new file mode 100644 index 0000000000000..40744bdca1146 --- /dev/null +++ b/media/editors/codemirror/mode/erlang/erlang.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMIME("text/x-erlang","erlang"),e.defineMode("erlang",function(t){function n(e,t){if(t.in_string)return t.in_string=!i(e),l(t,e,"string");if(t.in_atom)return t.in_atom=!a(e),l(t,e,"atom");if(e.eatSpace())return l(t,e,"whitespace");if(!m(t)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return s(e.current(),W)?l(t,e,"type"):l(t,e,"attribute");var n=e.next();if("%"==n)return e.skipToEnd(),l(t,e,"comment");if(":"==n)return l(t,e,"colon");if("?"==n)return e.eatSpace(),e.eatWhile($),l(t,e,"macro");if("#"==n)return e.eatSpace(),e.eatWhile($),l(t,e,"record");if("$"==n)return"\\"!=e.next()||e.match(B)?l(t,e,"number"):l(t,e,"error");if("."==n)return l(t,e,"dot");if("'"==n){if(!(t.in_atom=!a(e))){if(e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),l(t,e,"fun");if(e.match(/\s*\(/,!1)||e.match(/\s*:/,!1))return l(t,e,"function")}return l(t,e,"atom")}if('"'==n)return t.in_string=!i(e),l(t,e,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(n))return e.eatWhile($),l(t,e,"variable");if(/[a-z_ß-öø-ÿ]/.test(n)){if(e.eatWhile($),e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),l(t,e,"fun");var c=e.current();return s(c,U)?l(t,e,"keyword"):s(c,Z)?l(t,e,"operator"):e.match(/\s*\(/,!1)?!s(c,T)||":"==m(t).token&&"erlang"!=m(t,2).token?s(c,O)?l(t,e,"guard"):l(t,e,"function"):l(t,e,"builtin"):s(c,Z)?l(t,e,"operator"):":"==u(e)?"erlang"==c?l(t,e,"builtin"):l(t,e,"function"):s(c,["true","false"])?l(t,e,"boolean"):s(c,["true","false"])?l(t,e,"boolean"):l(t,e,"atom")}var _=/[0-9]/,f=/[0-9a-zA-Z]/;return _.test(n)?(e.eatWhile(_),e.eat("#")?e.eatWhile(f)||e.backUp(1):e.eat(".")&&(e.eatWhile(_)?e.eat(/[eE]/)&&(e.eat(/[-+]/)?e.eatWhile(_)||e.backUp(2):e.eatWhile(_)||e.backUp(1)):e.backUp(1)),l(t,e,"number")):r(e,P,j)?l(t,e,"open_paren"):r(e,C,I)?l(t,e,"close_paren"):o(e,E,A)?l(t,e,"separator"):o(e,M,q)?l(t,e,"operator"):l(t,e,null)}function r(e,t,n){if(1==e.current().length&&t.test(e.current())){for(e.backUp(1);t.test(e.peek());)if(e.next(),s(e.current(),n))return!0;e.backUp(e.current().length-1)}return!1}function o(e,t,n){if(1==e.current().length&&t.test(e.current())){for(;t.test(e.peek());)e.next();for(;0n?!1:e.tokenStack[n-r]}function d(e,t){"comment"!=t.type&&"whitespace"!=t.type&&(e.tokenStack=b(e.tokenStack,t),e.tokenStack=g(e.tokenStack))}function b(e,t){var n=e.length-1;return n>0&&"record"===e[n].type&&"dot"===t.type?e.pop():n>0&&"group"===e[n].type?(e.pop(),e.push(t)):e.push(t),e}function g(e){var t=e.length-1;if("dot"===e[t].type)return[];if("fun"===e[t].type&&"fun"===e[t-1].token)return e.slice(0,t-1);switch(e[e.length-1].token){case"}":return k(e,{g:["{"]});case"]":return k(e,{i:["["]});case")":return k(e,{i:["("]});case">>":return k(e,{i:["<<"]});case"end":return k(e,{i:["begin","case","fun","if","receive","try"]});case",":return k(e,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return k(e,{r:["when"],m:["try","if","case","receive"]});case";":return k(e,{E:["case","fun","if","receive","try","when"]});case"catch":return k(e,{e:["try"]});case"of":return k(e,{e:["case"]});case"after":return k(e,{e:["receive","try"]});default:return e}}function k(e,t){for(var n in t)for(var r=e.length-1,o=t[n],i=r-1;i>-1;i--)if(s(e[i].token,o)){var a=e.slice(0,i);switch(n){case"m":return a.concat(e[i]).concat(e[r]);case"r":return a.concat(e[r]);case"i":return a;case"g":return a.concat(p("group"));case"E":return a.concat(e[i]);case"e":return a.concat(e[i])}}return"E"==n?[]:e}function h(n,r){var o,i=t.indentUnit,a=y(r),c=m(n,1),u=m(n,2);return n.in_string||n.in_atom?e.Pass:u?"when"==c.token?c.column+i:"when"===a&&"function"===u.type?u.indent+i:"("===a&&"fun"===c.token?c.column+3:"catch"===a&&(o=x(n,["try"]))?o.column:s(a,["end","after","of"])?(o=x(n,["begin","case","fun","if","receive","try"]),o?o.column:e.Pass):s(a,I)?(o=x(n,j),o?o.column:e.Pass):s(c.token,[",","|","||"])||s(a,[",","|","||"])?(o=v(n),o?o.column+o.token.length:i):"->"==c.token?s(u.token,["receive","case","if","try"])?u.column+i+i:u.column+i:s(c.token,j)?c.column+c.token.length:(o=w(n),z(o)?o.column+i:0):0}function y(e){var t=e.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return z(t)&&0===t.index?t[0]:""}function v(e){var t=e.tokenStack.slice(0,-1),n=S(t,"type",["open_paren"]);return z(t[n])?t[n]:!1}function w(e){var t=e.tokenStack,n=S(t,"type",["open_paren","separator","keyword"]),r=S(t,"type",["operator"]);return z(n)&&z(r)&&r>n?t[n+1]:z(n)?t[n]:!1}function x(e,t){var n=e.tokenStack,r=S(n,"token",t);return z(n[r])?n[r]:!1}function S(e,t,n){for(var r=e.length-1;r>-1;r--)if(s(e[r][t],n))return r;return!1}function z(e){return e!==!1&&null!=e}var W=["-type","-spec","-export_type","-opaque"],U=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],E=/[\->,;]/,A=["->",";",","],Z=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],M=/[\+\-\*\/<>=\|:!]/,q=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],P=/[<\(\[\{]/,j=["<<","(","[","{"],C=/[>\)\]\}]/,I=["}","]",")",">>"],O=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],T=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],$=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,B=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(e,t){return n(e,t)},indent:function(e,t){return h(e,t)},lineComment:"%"}})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/forth/forth.js b/media/editors/codemirror/mode/forth/forth.js new file mode 100644 index 0000000000000..1f519d886212b --- /dev/null +++ b/media/editors/codemirror/mode/forth/forth.js @@ -0,0 +1,180 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Author: Aliaksei Chapyzhenka + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function toWordList(words) { + var ret = []; + words.split(' ').forEach(function(e){ + ret.push({name: e}); + }); + return ret; + } + + var coreWordList = toWordList( +'INVERT AND OR XOR\ + 2* 2/ LSHIFT RSHIFT\ + 0= = 0< < > U< MIN MAX\ + 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP\ + >R R> R@\ + + - 1+ 1- ABS NEGATE\ + S>D * M* UM*\ + FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD\ + HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2!\ + ALIGN ALIGNED +! ALLOT\ + CHAR [CHAR] [ ] BL\ + FIND EXECUTE IMMEDIATE COUNT LITERAL STATE\ + ; DOES> >BODY\ + EVALUATE\ + SOURCE >IN\ + <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL\ + FILL MOVE\ + . CR EMIT SPACE SPACES TYPE U. .R U.R\ + ACCEPT\ + TRUE FALSE\ + <> U> 0<> 0>\ + NIP TUCK ROLL PICK\ + 2>R 2R@ 2R>\ + WITHIN UNUSED MARKER\ + I J\ + TO\ + COMPILE, [COMPILE]\ + SAVE-INPUT RESTORE-INPUT\ + PAD ERASE\ + 2LITERAL DNEGATE\ + D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS\ + M+ M*/ D. D.R 2ROT DU<\ + CATCH THROW\ + FREE RESIZE ALLOCATE\ + CS-PICK CS-ROLL\ + GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER\ + PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER\ + -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL'); + + var immediateWordList = toWordList('IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE'); + + CodeMirror.defineMode('forth', function() { + function searchWordList (wordList, word) { + var i; + for (i = wordList.length - 1; i >= 0; i--) { + if (wordList[i].name === word.toUpperCase()) { + return wordList[i]; + } + } + return undefined; + } + return { + startState: function() { + return { + state: '', + base: 10, + coreWordList: coreWordList, + immediateWordList: immediateWordList, + wordList: [] + }; + }, + token: function (stream, stt) { + var mat; + if (stream.eatSpace()) { + return null; + } + if (stt.state === '') { // interpretation + if (stream.match(/^(\]|:NONAME)(\s|$)/i)) { + stt.state = ' compilation'; + return 'builtin compilation'; + } + mat = stream.match(/^(\:)\s+(\S+)(\s|$)+/); + if (mat) { + stt.wordList.push({name: mat[2].toUpperCase()}); + stt.state = ' compilation'; + return 'def' + stt.state; + } + mat = stream.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i); + if (mat) { + stt.wordList.push({name: mat[2].toUpperCase()}); + return 'def' + stt.state; + } + mat = stream.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/); + if (mat) { + return 'builtin' + stt.state; + } + } else { // compilation + // ; [ + if (stream.match(/^(\;|\[)(\s)/)) { + stt.state = ''; + stream.backUp(1); + return 'builtin compilation'; + } + if (stream.match(/^(\;|\[)($)/)) { + stt.state = ''; + return 'builtin compilation'; + } + if (stream.match(/^(POSTPONE)\s+\S+(\s|$)+/)) { + return 'builtin'; + } + } + + // dynamic wordlist + mat = stream.match(/^(\S+)(\s+|$)/); + if (mat) { + if (searchWordList(stt.wordList, mat[1]) !== undefined) { + return 'variable' + stt.state; + } + + // comments + if (mat[1] === '\\') { + stream.skipToEnd(); + return 'comment' + stt.state; + } + + // core words + if (searchWordList(stt.coreWordList, mat[1]) !== undefined) { + return 'builtin' + stt.state; + } + if (searchWordList(stt.immediateWordList, mat[1]) !== undefined) { + return 'keyword' + stt.state; + } + + if (mat[1] === '(') { + stream.eatWhile(function (s) { return s !== ')'; }); + stream.eat(')'); + return 'comment' + stt.state; + } + + // // strings + if (mat[1] === '.(') { + stream.eatWhile(function (s) { return s !== ')'; }); + stream.eat(')'); + return 'string' + stt.state; + } + if (mat[1] === 'S"' || mat[1] === '."' || mat[1] === 'C"') { + stream.eatWhile(function (s) { return s !== '"'; }); + stream.eat('"'); + return 'string' + stt.state; + } + + // numbers + if (mat[1] - 0xfffffffff) { + return 'number' + stt.state; + } + // if (mat[1].match(/^[-+]?[0-9]+\.[0-9]*/)) { + // return 'number' + stt.state; + // } + + return 'atom' + stt.state; + } + } + }; + }); + CodeMirror.defineMIME("text/x-forth", "forth"); +}); diff --git a/media/editors/codemirror/mode/forth/forth.min.js b/media/editors/codemirror/mode/forth/forth.min.js new file mode 100644 index 0000000000000..cbc6ae1dacd77 --- /dev/null +++ b/media/editors/codemirror/mode/forth/forth.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t){var e=[];return t.split(" ").forEach(function(t){e.push({name:t})}),e}var E=e("INVERT AND OR XOR 2* 2/ LSHIFT RSHIFT 0= = 0< < > U< MIN MAX 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP >R R> R@ + - 1+ 1- ABS NEGATE S>D * M* UM* FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2! ALIGN ALIGNED +! ALLOT CHAR [CHAR] [ ] BL FIND EXECUTE IMMEDIATE COUNT LITERAL STATE ; DOES> >BODY EVALUATE SOURCE >IN <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL FILL MOVE . CR EMIT SPACE SPACES TYPE U. .R U.R ACCEPT TRUE FALSE <> U> 0<> 0> NIP TUCK ROLL PICK 2>R 2R@ 2R> WITHIN UNUSED MARKER I J TO COMPILE, [COMPILE] SAVE-INPUT RESTORE-INPUT PAD ERASE 2LITERAL DNEGATE D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS M+ M*/ D. D.R 2ROT DU< CATCH THROW FREE RESIZE ALLOCATE CS-PICK CS-ROLL GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL"),i=e("IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE");t.defineMode("forth",function(){function t(t,e){var E;for(E=t.length-1;E>=0;E--)if(t[E].name===e.toUpperCase())return t[E];return void 0}return{startState:function(){return{state:"",base:10,coreWordList:E,immediateWordList:i,wordList:[]}},token:function(e,E){var i;if(e.eatSpace())return null;if(""===E.state){if(e.match(/^(\]|:NONAME)(\s|$)/i))return E.state=" compilation","builtin compilation";if(i=e.match(/^(\:)\s+(\S+)(\s|$)+/))return E.wordList.push({name:i[2].toUpperCase()}),E.state=" compilation","def"+E.state;if(i=e.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i))return E.wordList.push({name:i[2].toUpperCase()}),"def"+E.state;if(i=e.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/))return"builtin"+E.state}else{if(e.match(/^(\;|\[)(\s)/))return E.state="",e.backUp(1),"builtin compilation";if(e.match(/^(\;|\[)($)/))return E.state="","builtin compilation";if(e.match(/^(POSTPONE)\s+\S+(\s|$)+/))return"builtin"}return i=e.match(/^(\S+)(\s+|$)/),i?void 0!==t(E.wordList,i[1])?"variable"+E.state:"\\"===i[1]?(e.skipToEnd(),"comment"+E.state):void 0!==t(E.coreWordList,i[1])?"builtin"+E.state:void 0!==t(E.immediateWordList,i[1])?"keyword"+E.state:"("===i[1]?(e.eatWhile(function(t){return")"!==t}),e.eat(")"),"comment"+E.state):".("===i[1]?(e.eatWhile(function(t){return")"!==t}),e.eat(")"),"string"+E.state):'S"'===i[1]||'."'===i[1]||'C"'===i[1]?(e.eatWhile(function(t){return'"'!==t}),e.eat('"'),"string"+E.state):i[1]-68719476735?"number"+E.state:"atom"+E.state:void 0}}}),t.defineMIME("text/x-forth","forth")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/fortran/fortran.min.js b/media/editors/codemirror/mode/fortran/fortran.min.js new file mode 100644 index 0000000000000..33cfbbca4648d --- /dev/null +++ b/media/editors/codemirror/mode/fortran/fortran.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("fortran",function(){function e(e){for(var t={},n=0;n\/\:]/,c=new RegExp("(.and.|.or.|.eq.|.lt.|.le.|.gt.|.ge.|.ne.|.not.|.eqv.|.neqv.)","i");return{startState:function(){return{tokenize:null}},token:function(e,n){if(e.eatSpace())return null;var i=(n.tokenize||t)(e,n);return"comment"==i||"meta"==i?i:i}}}),e.defineMIME("text/x-fortran","fortran")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/gas/gas.min.js b/media/editors/codemirror/mode/gas/gas.min.js new file mode 100644 index 0000000000000..c39035a36d276 --- /dev/null +++ b/media/editors/codemirror/mode/gas/gas.min.js @@ -0,0 +1 @@ +!function(i){"object"==typeof exports&&"object"==typeof module?i(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],i):i(CodeMirror)}(function(i){"use strict";i.defineMode("gas",function(i,t){function l(){u="#",o.ax="variable",o.eax="variable-2",o.rax="variable-3",o.bx="variable",o.ebx="variable-2",o.rbx="variable-3",o.cx="variable",o.ecx="variable-2",o.rcx="variable-3",o.dx="variable",o.edx="variable-2",o.rdx="variable-3",o.si="variable",o.esi="variable-2",o.rsi="variable-3",o.di="variable",o.edi="variable-2",o.rdi="variable-3",o.sp="variable",o.esp="variable-2",o.rsp="variable-3",o.bp="variable",o.ebp="variable-2",o.rbp="variable-3",o.ip="variable",o.eip="variable-2",o.rip="variable-3",o.cs="keyword",o.ds="keyword",o.ss="keyword",o.es="keyword",o.fs="keyword",o.gs="keyword"}function n(){u="@",a.syntax="builtin",o.r0="variable",o.r1="variable",o.r2="variable",o.r3="variable",o.r4="variable",o.r5="variable",o.r6="variable",o.r7="variable",o.r8="variable",o.r9="variable",o.r10="variable",o.r11="variable",o.r12="variable",o.sp="variable-2",o.lr="variable-2",o.pc="variable-2",o.r13=o.sp,o.r14=o.lr,o.r15=o.pc,b.push(function(i,t){return"#"===i?(t.eatWhile(/\w/),"number"):void 0})}function e(i,t){for(var l,n=!1;null!=(l=i.next());){if(l===t&&!n)return!1;n=!n&&"\\"===l}return n}function r(i,t){for(var l,n=!1;null!=(l=i.next());){if("/"===l&&n){t.tokenize=null;break}n="*"===l}return"comment"}var b=[],u="",a={".abort":"builtin",".align":"builtin",".altmacro":"builtin",".ascii":"builtin",".asciz":"builtin",".balign":"builtin",".balignw":"builtin",".balignl":"builtin",".bundle_align_mode":"builtin",".bundle_lock":"builtin",".bundle_unlock":"builtin",".byte":"builtin",".cfi_startproc":"builtin",".comm":"builtin",".data":"builtin",".def":"builtin",".desc":"builtin",".dim":"builtin",".double":"builtin",".eject":"builtin",".else":"builtin",".elseif":"builtin",".end":"builtin",".endef":"builtin",".endfunc":"builtin",".endif":"builtin",".equ":"builtin",".equiv":"builtin",".eqv":"builtin",".err":"builtin",".error":"builtin",".exitm":"builtin",".extern":"builtin",".fail":"builtin",".file":"builtin",".fill":"builtin",".float":"builtin",".func":"builtin",".global":"builtin",".gnu_attribute":"builtin",".hidden":"builtin",".hword":"builtin",".ident":"builtin",".if":"builtin",".incbin":"builtin",".include":"builtin",".int":"builtin",".internal":"builtin",".irp":"builtin",".irpc":"builtin",".lcomm":"builtin",".lflags":"builtin",".line":"builtin",".linkonce":"builtin",".list":"builtin",".ln":"builtin",".loc":"builtin",".loc_mark_labels":"builtin",".local":"builtin",".long":"builtin",".macro":"builtin",".mri":"builtin",".noaltmacro":"builtin",".nolist":"builtin",".octa":"builtin",".offset":"builtin",".org":"builtin",".p2align":"builtin",".popsection":"builtin",".previous":"builtin",".print":"builtin",".protected":"builtin",".psize":"builtin",".purgem":"builtin",".pushsection":"builtin",".quad":"builtin",".reloc":"builtin",".rept":"builtin",".sbttl":"builtin",".scl":"builtin",".section":"builtin",".set":"builtin",".short":"builtin",".single":"builtin",".size":"builtin",".skip":"builtin",".sleb128":"builtin",".space":"builtin",".stab":"builtin",".string":"builtin",".struct":"builtin",".subsection":"builtin",".symver":"builtin",".tag":"builtin",".text":"builtin",".title":"builtin",".type":"builtin",".uleb128":"builtin",".val":"builtin",".version":"builtin",".vtable_entry":"builtin",".vtable_inherit":"builtin",".warning":"builtin",".weak":"builtin",".weakref":"builtin",".word":"builtin"},o={},c=(t.architecture||"x86").toLowerCase();return"x86"===c?l(t):("arm"===c||"armv6"===c)&&n(t),{startState:function(){return{tokenize:null}},token:function(i,t){if(t.tokenize)return t.tokenize(i,t);if(i.eatSpace())return null;var l,n,c=i.next();if("/"===c&&i.eat("*"))return t.tokenize=r,r(i,t);if(c===u)return i.skipToEnd(),"comment";if('"'===c)return e(i,'"'),"string";if("."===c)return i.eatWhile(/\w/),n=i.current().toLowerCase(),l=a[n],l||null;if("="===c)return i.eatWhile(/\w/),"tag";if("{"===c)return"braket";if("}"===c)return"braket";if(/\d/.test(c))return"0"===c&&i.eat("x")?(i.eatWhile(/[0-9a-fA-F]/),"number"):(i.eatWhile(/\d/),"number");if(/\w/.test(c))return i.eatWhile(/\w/),i.eat(":")?"tag":(n=i.current().toLowerCase(),l=o[n],l||null);for(var s=0;s]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(o.combineTokens=!0,"link"):(e.next(),null)},blankLine:r},c={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var d in n)c[d]=n[d];return c.name="markdown",e.defineMIME("gfmBase",c),e.overlayMode(e.getMode(o,"gfmBase"),a)},"markdown")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/gfm/test.min.js b/media/editors/codemirror/mode/gfm/test.min.js new file mode 100644 index 0000000000000..d229c4680d65e --- /dev/null +++ b/media/editors/codemirror/mode/gfm/test.min.js @@ -0,0 +1 @@ +!function(){function o(o){test.mode(o,t,Array.prototype.slice.call(arguments,1))}function e(o){test.mode(o,r,Array.prototype.slice.call(arguments,1))}var t=CodeMirror.getMode({tabSize:4},"gfm"),r=CodeMirror.getMode({tabSize:4},{name:"gfm",highlightFormatting:!0});e("codeBackticks","[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"),e("doubleBackticks","[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"),e("codeBlock","[comment&formatting&formatting-code-block ```css]","[tag foo]","[comment&formatting&formatting-code-block ```]"),e("taskList","[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]","[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]"),e("formatting_strikethrough","[strikethrough&formatting&formatting-strikethrough ~~][strikethrough foo][strikethrough&formatting&formatting-strikethrough ~~]"),e("formatting_strikethrough","foo [strikethrough&formatting&formatting-strikethrough ~~][strikethrough bar][strikethrough&formatting&formatting-strikethrough ~~]"),o("emInWordAsterisk","foo[em *bar*]hello"),o("emInWordUnderscore","foo_bar_hello"),o("emStrongUnderscore","[strong __][em&strong _foo__][em _] bar"),o("fencedCodeBlocks","[comment ```]","[comment foo]","","[comment ```]","bar"),o("fencedCodeBlockModeSwitching","[comment ```javascript]","[variable foo]","","[comment ```]","bar"),o("taskListAsterisk","[variable-2 * []] foo]","[variable-2 * [ ]]bar]","[variable-2 * [x]]hello]","[variable-2 * ][meta [ ]]][variable-2 [world]]]"," [variable-3 * ][property [x]]][variable-3 foo]"),o("taskListPlus","[variable-2 + []] foo]","[variable-2 + [ ]]bar]","[variable-2 + [x]]hello]","[variable-2 + ][meta [ ]]][variable-2 [world]]]"," [variable-3 + ][property [x]]][variable-3 foo]"),o("taskListDash","[variable-2 - []] foo]","[variable-2 - [ ]]bar]","[variable-2 - [x]]hello]","[variable-2 - ][meta [ ]]][variable-2 [world]]]"," [variable-3 - ][property [x]]][variable-3 foo]"),o("taskListNumber","[variable-2 1. []] foo]","[variable-2 2. [ ]]bar]","[variable-2 3. [x]]hello]","[variable-2 4. ][meta [ ]]][variable-2 [world]]]"," [variable-3 1. ][property [x]]][variable-3 foo]"),o("SHA","foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar"),o("SHAEmphasis","[em *foo ][em&link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"),o("shortSHA","foo [link be6a8cc] bar"),o("tooShortSHA","foo be6a8c bar"),o("longSHA","foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar"),o("badSHA","foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar"),o("userSHA","foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello"),o("userSHAEmphasis","[em *foo ][em&link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"),o("userProjectSHA","foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world"),o("userProjectSHAEmphasis","[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"),o("num","foo [link #1] bar"),o("numEmphasis","[em *foo ][em&link #1][em *]"),o("badNum","foo #1bar hello"),o("userNum","foo [link bar#1] hello"),o("userNumEmphasis","[em *foo ][em&link bar#1][em *]"),o("userProjectNum","foo [link bar/hello#1] world"),o("userProjectNumEmphasis","[em *foo ][em&link bar/hello#1][em *]"),o("vanillaLink","foo [link http://www.example.com/] bar"),o("vanillaLinkPunctuation","foo [link http://www.example.com/]. bar"),o("vanillaLinkExtension","foo [link http://www.example.com/index.html] bar"),o("vanillaLinkEmphasis","foo [em *][em&link http://www.example.com/index.html][em *] bar"),o("notALink","[comment ```css]","[tag foo] {[property color]:[keyword black];}","[comment ```][link http://www.example.com/]"),o("notALink","[comment ``foo `bar` http://www.example.com/``] hello"),o("notALink","[comment `foo]","[link http://www.example.com/]","[comment `foo]","","[link http://www.example.com/]"),o("headerCodeBlockGithub","[header&header-1 # heading]","","[comment ```]","[comment code]","[comment ```]","","Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]","Issue: [link #1]","Link: [link http://www.example.com/]"),o("strikethrough","[strikethrough ~~foo~~]"),o("strikethroughWithStartingSpace","~~ foo~~"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo~~~]"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo ~~]"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo ~~ bar]"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo ~~ bar~~]hello"),o("strikethroughOneLetter","[strikethrough ~~a~~]"),o("strikethroughWrapped","[strikethrough ~~foo]","[strikethrough foo~~]"),o("strikethroughParagraph","[strikethrough ~~foo]","","foo[strikethrough ~~bar]"),o("strikethroughEm","[strikethrough ~~foo][em&strikethrough *bar*][strikethrough ~~]"),o("strikethroughEm","[em *][em&strikethrough ~~foo~~][em *]"),o("strikethroughStrong","[strikethrough ~~][strong&strikethrough **foo**][strikethrough ~~]"),o("strikethroughStrong","[strong **][strong&strikethrough ~~foo~~][strong **]")}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/gherkin/gherkin.min.js b/media/editors/codemirror/mode/gherkin/gherkin.min.js new file mode 100644 index 0000000000000..873b25c0a4148 --- /dev/null +++ b/media/editors/codemirror/mode/gherkin/gherkin.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("gherkin",function(){return{startState:function(){return{lineNumber:0,tableHeaderLine:!1,allowFeature:!0,allowBackground:!1,allowScenario:!1,allowSteps:!1,allowPlaceholders:!1,allowMultilineArgument:!1,inMultilineString:!1,inMultilineTable:!1,inKeywordLine:!1}},token:function(e,a){if(e.sol()&&(a.lineNumber++,a.inKeywordLine=!1,a.inMultilineTable&&(a.tableHeaderLine=!1,e.match(/\s*\|/,!1)||(a.allowMultilineArgument=!1,a.inMultilineTable=!1))),e.eatSpace(),a.allowMultilineArgument){if(a.inMultilineString)return e.match('"""')?(a.inMultilineString=!1,a.allowMultilineArgument=!1):e.match(/.*/),"string";if(a.inMultilineTable)return e.match(/\|\s*/)?"bracket":(e.match(/[^\|]*/),a.tableHeaderLine?"header":"string");if(e.match('"""'))return a.inMultilineString=!0,"string";if(e.match("|"))return a.inMultilineTable=!0,a.tableHeaderLine=!0,"bracket"}return e.match(/#.*/)?"comment":!a.inKeywordLine&&e.match(/@\S+/)?"tag":!a.inKeywordLine&&a.allowFeature&&e.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)?(a.allowScenario=!0,a.allowBackground=!0,a.allowPlaceholders=!1,a.allowSteps=!1,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):!a.inKeywordLine&&a.allowBackground&&e.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)?(a.allowPlaceholders=!1,a.allowSteps=!0,a.allowBackground=!1,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):!a.inKeywordLine&&a.allowScenario&&e.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)?(a.allowPlaceholders=!0,a.allowSteps=!0,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):a.allowScenario&&e.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)?(a.allowPlaceholders=!1,a.allowSteps=!0,a.allowBackground=!1,a.allowMultilineArgument=!0,"keyword"):!a.inKeywordLine&&a.allowScenario&&e.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)?(a.allowPlaceholders=!1,a.allowSteps=!0,a.allowBackground=!1,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):!a.inKeywordLine&&a.allowSteps&&e.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)?(a.inStep=!0,a.allowPlaceholders=!0,a.allowMultilineArgument=!0,a.inKeywordLine=!0,"keyword"):e.match(/"[^"]*"?/)?"string":a.allowPlaceholders&&e.match(/<[^>]*>?/)?"variable":(e.next(),e.eatWhile(/[^@"<#]/),null)}}}),e.defineMIME("text/x-feature","gherkin")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/go/go.js b/media/editors/codemirror/mode/go/go.js index 173e034d0c836..b121f4e6eb7b3 100644 --- a/media/editors/codemirror/mode/go/go.js +++ b/media/editors/codemirror/mode/go/go.js @@ -117,6 +117,7 @@ CodeMirror.defineMode("go", function(config) { return state.context = new Context(state.indented, col, type, null, state.context); } function popContext(state) { + if (!state.context.prev) return; var t = state.context.type; if (t == ")" || t == "]" || t == "}") state.indented = state.context.indented; diff --git a/media/editors/codemirror/mode/go/go.min.js b/media/editors/codemirror/mode/go/go.min.js new file mode 100644 index 0000000000000..c52396eb87d37 --- /dev/null +++ b/media/editors/codemirror/mode/go/go.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("go",function(e){function t(e,t){var i=e.next();if('"'==i||"'"==i||"`"==i)return t.tokenize=n(i),t.tokenize(e,t);if(/[\d\.]/.test(i))return"."==i?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==i?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(i))return c=i,null;if("/"==i){if(e.eat("*"))return t.tokenize=r,r(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(d.test(i))return e.eatWhile(d),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var o=e.current();return l.propertyIsEnumerable(o)?(("case"==o||"default"==o)&&(c="case"),"keyword"):f.propertyIsEnumerable(o)?"atom":"variable"}function n(e){return function(n,r){for(var i,o=!1,a=!1;null!=(i=n.next());){if(i==e&&!o){a=!0;break}o=!o&&"\\"==i}return(a||!o&&"`"!=e)&&(r.tokenize=t),"string"}}function r(e,n){for(var r,i=!1;r=e.next();){if("/"==r&&i){n.tokenize=t;break}i="*"==r}return"comment"}function i(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function o(e,t,n){return e.context=new i(e.indented,t,n,null,e.context)}function a(e){if(e.context.prev){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}}var c,u=e.indentUnit,l={"break":!0,"case":!0,chan:!0,"const":!0,"continue":!0,"default":!0,defer:!0,"else":!0,fallthrough:!0,"for":!0,func:!0,go:!0,"goto":!0,"if":!0,"import":!0,"interface":!0,map:!0,"package":!0,range:!0,"return":!0,select:!0,struct:!0,"switch":!0,type:!0,"var":!0,bool:!0,"byte":!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,"int":!0,uint:!0,uintptr:!0},f={"true":!0,"false":!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,"new":!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},d=/[+\-*&^%:=<>!|\/]/;return{startState:function(e){return{tokenize:null,context:new i((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,n){var r=n.context;if(e.sol()&&(null==r.align&&(r.align=!1),n.indented=e.indentation(),n.startOfLine=!0,"case"==r.type&&(r.type="}")),e.eatSpace())return null;c=null;var i=(n.tokenize||t)(e,n);return"comment"==i?i:(null==r.align&&(r.align=!0),"{"==c?o(n,e.column(),"}"):"["==c?o(n,e.column(),"]"):"("==c?o(n,e.column(),")"):"case"==c?r.type="case":"}"==c&&"}"==r.type?r=a(n):c==r.type&&a(n),n.startOfLine=!1,i)},indent:function(e,n){if(e.tokenize!=t&&null!=e.tokenize)return 0;var r=e.context,i=n&&n.charAt(0);if("case"==r.type&&/^(?:case|default)\b/.test(n))return e.context.type="}",r.indented;var o=i==r.type;return r.align?r.column+(o?0:1):r.indented+(o?0:u)},electricChars:"{}):",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-go","go")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/groovy/groovy.min.js b/media/editors/codemirror/mode/groovy/groovy.min.js new file mode 100644 index 0000000000000..a251b5ec790e1 --- /dev/null +++ b/media/editors/codemirror/mode/groovy/groovy.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("groovy",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r"))return f="->",null;if(/[+\-*&%=<>!?|\/~]/.test(n))return e.eatWhile(/[+\-*&%=<>|~]/),"operator";if(e.eatWhile(/[\w\$_]/),"@"==n)return e.eatWhile(/[\w\$_\.]/),"meta";if("."==t.lastToken)return"property";if(e.eat(":"))return f="proplabel","property";var i=e.current();return d.propertyIsEnumerable(i)?"atom":c.propertyIsEnumerable(i)?(p.propertyIsEnumerable(i)&&(f="newstatement"),"keyword"):"variable"}function r(e,t,n){function r(t,n){for(var r,a=!1,l=!o;null!=(r=t.next());){if(r==e&&!a){if(!o)break;if(t.match(e+e)){l=!0;break}}if('"'==e&&"$"==r&&!a&&t.eat("{"))return n.tokenize.push(i()),"string";a=!a&&"\\"==r}return l&&n.tokenize.pop(),"string"}var o=!1;if("/"!=e&&t.eat(e)){if(!t.eat(e))return"string";o=!0}return n.tokenize.push(r),r(t,n)}function i(){function e(e,r){if("}"==e.peek()){if(t--,0==t)return r.tokenize.pop(),r.tokenize[r.tokenize.length-1](e,r)}else"{"==e.peek()&&t++;return n(e,r)}var t=1;return e.isBase=!0,e}function o(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize.pop();break}r="*"==n}return"comment"}function a(e){return!e||"operator"==e||"->"==e||/[\.\[\{\(,;:]/.test(e)||"newstatement"==e||"keyword"==e||"proplabel"==e}function l(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function s(e,t,n){return e.context=new l(e.indented,t,n,null,e.context)}function u(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var f,c=t("abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws transient try void volatile while"),p=t("catch class do else finally for if switch try while enum interface def"),d=t("null true false this");return n.isBase=!0,{startState:function(t){return{tokenize:[n],context:new l((t||0)-e.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"statement"!=n.type||a(t.lastToken)||(u(t),n=t.context)),e.eatSpace())return null;f=null;var r=t.tokenize[t.tokenize.length-1](e,t);if("comment"==r)return r;if(null==n.align&&(n.align=!0),";"!=f&&":"!=f||"statement"!=n.type)if("->"==f&&"statement"==n.type&&"}"==n.prev.type)u(t),t.context.align=!1;else if("{"==f)s(t,e.column(),"}");else if("["==f)s(t,e.column(),"]");else if("("==f)s(t,e.column(),")");else if("}"==f){for(;"statement"==n.type;)n=u(t);for("}"==n.type&&(n=u(t));"statement"==n.type;)n=u(t)}else f==n.type?u(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==f)&&s(t,e.column(),"statement");else u(t);return t.startOfLine=!1,t.lastToken=f||r,r},indent:function(t,n){if(!t.tokenize[t.tokenize.length-1].isBase)return 0;var r=n&&n.charAt(0),i=t.context;"statement"!=i.type||a(t.lastToken)||(i=i.prev);var o=r==i.type;return"statement"==i.type?i.indented+("{"==r?0:e.indentUnit):i.align?i.column+(o?0:1):i.indented+(o?0:e.indentUnit)},electricChars:"{}",fold:"brace"}}),e.defineMIME("text/x-groovy","groovy")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/haml/haml.min.js b/media/editors/codemirror/mode/haml/haml.min.js new file mode 100644 index 0000000000000..8fe9598bcd34b --- /dev/null +++ b/media/editors/codemirror/mode/haml/haml.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("haml",function(t){function n(e){return function(t,n){var o=t.peek();return o==e&&1==n.rubyState.tokenize.length?(t.next(),n.tokenize=r,"closeAttributeTag"):i(t,n)}}function i(e,t){return e.match("-#")?(e.skipToEnd(),"comment"):u.token(e,t.rubyState)}function r(e,t){var r=e.peek();if("comment"==t.previousToken.style&&t.indented>t.previousToken.indented)return e.skipToEnd(),"commentLine";if(t.startOfLine){if("!"==r&&e.match("!!"))return e.skipToEnd(),"tag";if(e.match(/^%[\w:#\.]+=/))return t.tokenize=i,"hamlTag";if(e.match(/^%[\w:]+/))return"hamlTag";if("/"==r)return e.skipToEnd(),"comment"}if((t.startOfLine||"hamlTag"==t.previousToken.style)&&("#"==r||"."==r))return e.match(/[\w-#\.]*/),"hamlAttribute";if(t.startOfLine&&!e.match("-->",!1)&&("="==r||"-"==r))return t.tokenize=i,t.tokenize(e,t);if("hamlTag"==t.previousToken.style||"closeAttributeTag"==t.previousToken.style||"hamlAttribute"==t.previousToken.style){if("("==r)return t.tokenize=n(")"),t.tokenize(e,t);if("{"==r)return t.tokenize=n("}"),t.tokenize(e,t)}return o.token(e,t.htmlState)}var o=e.getMode(t,{name:"htmlmixed"}),u=e.getMode(t,"ruby");return{startState:function(){var e=o.startState(),t=u.startState();return{htmlState:e,rubyState:t,indented:0,previousToken:{style:null,indented:0},tokenize:r}},copyState:function(t){return{htmlState:e.copyState(o,t.htmlState),rubyState:e.copyState(u,t.rubyState),indented:t.indented,previousToken:t.previousToken,tokenize:t.tokenize}},token:function(e,t){if(e.sol()&&(t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;var n=t.tokenize(e,t);if(t.startOfLine=!1,n&&"commentLine"!=n&&(t.previousToken={style:n,indented:t.indented}),e.eol()&&t.tokenize==i){e.backUp(1);var o=e.peek();e.next(),o&&","!=o&&(t.tokenize=r)}return"hamlTag"==n?n="tag":"commentLine"==n?n="comment":"hamlAttribute"==n?n="attribute":"closeAttributeTag"==n&&(n=null),n}}},"htmlmixed","ruby"),e.defineMIME("text/x-haml","haml")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/haml/test.min.js b/media/editors/codemirror/mode/haml/test.min.js new file mode 100644 index 0000000000000..281a376e540f2 --- /dev/null +++ b/media/editors/codemirror/mode/haml/test.min.js @@ -0,0 +1 @@ +!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4,indentUnit:2},"haml");t("elementName","[tag %h1] Hey There"),t("oneElementPerLine","[tag %h1] Hey There %h2"),t("idSelector","[tag %h1][attribute #test] Hey There"),t("classSelector","[tag %h1][attribute .hello] Hey There"),t("docType","[tag !!! XML]"),t("comment","[comment / Hello WORLD]"),t("notComment","[tag %h1] This is not a / comment "),t("attributes",'[tag %a]([variable title][operator =][string "test"]){[atom :title] [operator =>] [string "test"]}'),t("htmlCode","[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"),t("rubyBlock","[operator =][variable-2 @item]"),t("selectorRubyBlock","[tag %a.selector=] [variable-2 @item]"),t("nestedRubyBlock","[tag %a]",' [operator =][variable puts] [string "test"]'),t("multilinePlaintext","[tag %p]"," Hello,"," World"),t("multilineRuby","[tag %p]"," [comment -# this is a comment]"," [comment and this is a comment too]"," Date/Time"," [operator -] [variable now] [operator =] [tag DateTime][operator .][property now]"," [tag %strong=] [variable now]",' [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string "December 31, 2006"])',' [operator =][string "Happy"]',' [operator =][string "Belated"]',' [operator =][string "Birthday"]'),t("multilineComment","[comment /]"," [comment Multiline]"," [comment Comment]"),t("hamlComment","[comment -# this is a comment]"),t("multilineHamlComment","[comment -# this is a comment]"," [comment and this is a comment too]"),t("multilineHTMLComment","[comment ]"),t("hamlAfterRubyTag","[attribute .block]"," [tag %strong=] [variable now]"," [attribute .test]"," [operator =][variable now]"," [attribute .right]"),t("stretchedRuby",'[operator =] [variable puts] [string "Hello"],',' [string "World"]'),t("interpolationInHashAttribute",'[tag %div]{[atom :id] [operator =>] [string "#{][variable test][string }_#{][variable ting][string }"]} test'),t("interpolationInHTMLAttribute",'[tag %div]([variable title][operator =][string "#{][variable test][string }_#{][variable ting]()[string }"]) Test')}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/haskell/haskell.min.js b/media/editors/codemirror/mode/haskell/haskell.min.js new file mode 100644 index 0000000000000..dae77560a51a8 --- /dev/null +++ b/media/editors/codemirror/mode/haskell/haskell.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("haskell",function(e,r){function t(e,r,t){return r(t),t(e,r)}function n(e,r){if(e.eatWhile(p))return null;var n=e.next();if(h.test(n)){if("{"==n&&e.eat("-")){var o="comment";return e.eat("#")&&(o="meta"),t(e,r,a(o,1))}return null}if("'"==n)return e.eat("\\"),e.next(),e.eat("'")?"string":"error";if('"'==n)return t(e,r,i);if(l.test(n))return e.eatWhile(d),e.eat(".")?"qualifier":"variable-2";if(u.test(n))return e.eatWhile(d),"variable";if(f.test(n)){if("0"==n){if(e.eat(/[xX]/))return e.eatWhile(s),"integer";if(e.eat(/[oO]/))return e.eatWhile(c),"number"}e.eatWhile(f);var o="number";return e.match(/^\.\d+/)&&(o="number"),e.eat(/[eE]/)&&(o="number",e.eat(/[-+]/),e.eatWhile(f)),o}if("."==n&&e.eat("."))return"keyword";if(m.test(n)){if("-"==n&&e.eat(/-/)&&(e.eatWhile(/-/),!e.eat(m)))return e.skipToEnd(),"comment";var o="variable";return":"==n&&(o="variable-2"),e.eatWhile(m),o}return"error"}function a(e,r){return 0==r?n:function(t,i){for(var o=r;!t.eol();){var u=t.next();if("{"==u&&t.eat("-"))++o;else if("-"==u&&t.eat("}")&&(--o,0==o))return i(n),e}return i(a(e,o)),e}}function i(e,r){for(;!e.eol();){var t=e.next();if('"'==t)return r(n),"string";if("\\"==t){if(e.eol()||e.eat(p))return r(o),"string";e.eat("&")||e.next()}}return r(n),"error"}function o(e,r){return e.eat("\\")?t(e,r,i):(e.next(),r(n),"error")}var u=/[a-z_]/,l=/[A-Z]/,f=/\d/,s=/[0-9A-Fa-f]/,c=/[0-7]/,d=/[a-z_A-Z0-9'\xa1-\uffff]/,m=/[-!#$%&*+.\/<=>?@\\^|~:]/,h=/[(),;[\]`{}]/,p=/[ \t\v\f]/,g=function(){function e(e){return function(){for(var r=0;r","@","~","=>"),e("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**"),e("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),e("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3");var n=r.overrideKeywords;if(n)for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return t}();return{startState:function(){return{f:n}},copyState:function(e){return{f:e.f}},token:function(e,r){var t=r.f(e,function(e){r.f=e}),n=e.current();return g.hasOwnProperty(n)?g[n]:t},blockCommentStart:"{-",blockCommentEnd:"-}",lineComment:"--"}}),e.defineMIME("text/x-haskell","haskell")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/haxe/haxe.min.js b/media/editors/codemirror/mode/haxe/haxe.min.js new file mode 100644 index 0000000000000..6474056faefdd --- /dev/null +++ b/media/editors/codemirror/mode/haxe/haxe.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("haxe",function(e,t){function n(e,t,n){return t.tokenize=n,n(e,t)}function r(e,t){for(var n,r=!1;null!=(n=e.next());){if(n==t&&!r)return!1;r=!r&&"\\"==n}return r}function i(e,t,n){return G=e,H=n,t}function a(e,t){var a=e.next();if('"'==a||"'"==a)return n(e,t,o(a));if(/[\[\]{}\(\),;\:\.]/.test(a))return i(a);if("0"==a&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(a)||"-"==a&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if(t.reAllowed&&"~"==a&&e.eat(/\//))return r(e,"/"),e.eatWhile(/[gimsu]/),i("regexp","string-2");if("/"==a)return e.eat("*")?n(e,t,u):e.eat("/")?(e.skipToEnd(),i("comment","comment")):(e.eatWhile(L),i("operator",null,e.current()));if("#"==a)return e.skipToEnd(),i("conditional","meta");if("@"==a)return e.eat(/:/),e.eatWhile(/[\w_]/),i("metadata","meta");if(L.test(a))return e.eatWhile(L),i("operator",null,e.current());var c;if(/[A-Z]/.test(a))return e.eatWhile(/[\w_<>]/),c=e.current(),i("type","variable-3",c);e.eatWhile(/[\w_]/);var c=e.current(),l=K.propertyIsEnumerable(c)&&K[c];return l&&t.kwAllowed?i(l.type,l.style,c):i("variable","variable",c)}function o(e){return function(t,n){return r(t,e)||(n.tokenize=a),i("string","string")}}function u(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=a;break}r="*"==n}return i("comment","comment")}function c(e,t,n,r,i,a){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=a,null!=r&&(this.align=r)}function l(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function f(e,t,n,r,i){var a=e.cc;for(Q.state=e,Q.stream=i,Q.marked=null,Q.cc=a,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=a.length?a.pop():w;if(o(n,r)){for(;a.length&&a[a.length-1].lex;)a.pop()();return Q.marked?Q.marked:"variable"==n&&l(e,r)?"variable-2":"variable"==n&&d(e,r)?"variable-3":t}}}function d(e,t){if(/[a-z]/.test(t.charAt(0)))return!1;for(var n=e.importedtypes.length,r=0;n>r;r++)if(e.importedtypes[r]==t)return!0}function s(e){for(var t=Q.state,n=t.importedtypes;n;n=n.next)if(n.name==e)return;t.importedtypes={name:e,next:t.importedtypes}}function m(){for(var e=arguments.length-1;e>=0;e--)Q.cc.push(arguments[e])}function p(){return m.apply(null,arguments),!0}function v(e){var t=Q.state;if(t.context){Q.marked="def";for(var n=t.localVars;n;n=n.next)if(n.name==e)return;t.localVars={name:e,next:t.localVars}}}function y(){Q.state.context||(Q.state.localVars=R),Q.state.context={prev:Q.state.context,vars:Q.state.localVars}}function x(){Q.state.localVars=Q.state.context.vars,Q.state.context=Q.state.context.prev}function h(e,t){var n=function(){var n=Q.state;n.lexical=new c(n.indented,Q.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function b(){var e=Q.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function k(e){function t(n){return n==e?p():";"==e?m():p(t)}return t}function w(e){return"@"==e?p(E):"var"==e?p(h("vardef"),P,k(";"),b):"keyword a"==e?p(h("form"),g,w,b):"keyword b"==e?p(h("form"),w,b):"{"==e?p(h("}"),y,O,b,x):";"==e?p():"attribute"==e?p(S):"function"==e?p(q):"for"==e?p(h("form"),k("("),h(")"),D,k(")"),b,w,b):"variable"==e?p(h("stat"),C):"switch"==e?p(h("form"),g,h("}","switch"),k("{"),O,b,b):"case"==e?p(g,k(":")):"default"==e?p(k(":")):"catch"==e?p(h("form"),y,k("("),$,k(")"),w,b,x):"import"==e?p(z,k(";")):"typedef"==e?p(M):m(h("stat"),g,k(";"),b)}function g(e){return N.hasOwnProperty(e)?p(V):"function"==e?p(q):"keyword c"==e?p(A):"("==e?p(h(")"),A,k(")"),b,V):"operator"==e?p(g):"["==e?p(h("]"),I(g,"]"),b,V):"{"==e?p(h("}"),I(Z,"}"),b,V):p()}function A(e){return e.match(/[;\}\)\],]/)?m():m(g)}function V(e,t){if("operator"==e&&/\+\+|--/.test(t))return p(V);if("operator"==e||":"==e)return p(g);if(";"!=e)return"("==e?p(h(")"),I(g,")"),b,V):"."==e?p(T,V):"["==e?p(h("]"),g,k("]"),b,V):void 0}function S(e){return"attribute"==e?p(S):"function"==e?p(q):"var"==e?p(P):void 0}function E(e){return":"==e?p(E):"variable"==e?p(E):"("==e?p(h(")"),I(W,")"),b,w):void 0}function W(e){return"variable"==e?p():void 0}function z(e,t){return"variable"==e&&/[A-Z]/.test(t.charAt(0))?(s(t),p()):"variable"==e||"property"==e||"."==e||"*"==t?p(z):void 0}function M(e,t){return"variable"==e&&/[A-Z]/.test(t.charAt(0))?(s(t),p()):"type"==e&&/[A-Z]/.test(t.charAt(0))?p():void 0}function C(e){return":"==e?p(b,w):m(V,k(";"),b)}function T(e){return"variable"==e?(Q.marked="property",p()):void 0}function Z(e){return"variable"==e&&(Q.marked="property"),N.hasOwnProperty(e)?p(k(":"),g):void 0}function I(e,t){function n(r){return","==r?p(e,n):r==t?p():p(k(t))}return function(r){return r==t?p():m(e,n)}}function O(e){return"}"==e?p():m(w,O)}function P(e,t){return"variable"==e?(v(t),p(B,_)):p()}function _(e,t){return"="==t?p(g,_):","==e?p(P):void 0}function D(e,t){return"variable"==e&&v(t),p(h(")"),y,j,g,b,w,x)}function j(e,t){return"in"==t?p():void 0}function q(e,t){return"variable"==e?(v(t),p(q)):"new"==t?p(q):"("==e?p(h(")"),y,I($,")"),b,B,w,x):void 0}function B(e){return":"==e?p(F):void 0}function F(e){return"type"==e?p():"variable"==e?p():"{"==e?p(h("}"),I(U,"}"),b):void 0}function U(e){return"variable"==e?p(B):void 0}function $(e,t){return"variable"==e?(v(t),p(B)):void 0}var G,H,J=e.indentUnit,K=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),a={type:"atom",style:"atom"},o={type:"attribute",style:"attribute"},u=e("typedef");return{"if":t,"while":t,"else":n,"do":n,"try":n,"return":r,"break":r,"continue":r,"new":r,"throw":r,"var":e("var"),inline:o,"static":o,using:e("import"),"public":o,"private":o,cast:e("cast"),"import":e("import"),macro:e("macro"),"function":e("function"),"catch":e("catch"),untyped:e("untyped"),callback:e("cb"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,never:e("property_access"),trace:e("trace"),"class":u,"abstract":u,"enum":u,"interface":u,typedef:u,"extends":u,"implements":u,dynamic:u,"true":a,"false":a,"null":a}}(),L=/[+\-*&%=<>!?|]/,N={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},Q={state:null,column:null,marked:null,cc:null},R={name:"this",next:null};return b.lex=!0,{startState:function(e){var n=["Int","Float","String","Void","Std","Bool","Dynamic","Array"];return{tokenize:a,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new c((e||0)-J,0,"block",!1),localVars:t.localVars,importedtypes:n,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==G?n:(t.reAllowed=!("operator"!=G&&"keyword c"!=G&&!G.match(/^[\[{}\(,;:]$/)),t.kwAllowed="."!=G,f(t,n,G,H,e))},indent:function(e,t){if(e.tokenize!=a)return 0;var n=t&&t.charAt(0),r=e.lexical;"stat"==r.type&&"}"==n&&(r=r.prev);var i=r.type,o=n==i;return"vardef"==i?r.indented+4:"form"==i&&"{"==n?r.indented:"stat"==i||"form"==i?r.indented+J:"switch"!=r.info||o?r.align?r.column+(o?0:1):r.indented+(o?0:J):r.indented+(/^(?:case|default)\b/.test(t)?J:2*J)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-haxe","haxe"),e.defineMode("hxml",function(){return{startState:function(){return{define:!1,inString:!1}},token:function(e,t){var n=e.peek(),r=e.sol();if("#"==n)return e.skipToEnd(),"comment";if(r&&"-"==n){var i="variable-2";return e.eat(/-/),"-"==e.peek()&&(e.eat(/-/),i="keyword a"),"D"==e.peek()&&(e.eat(/[D]/),i="keyword c",t.define=!0),e.eatWhile(/[A-Z]/i),i}var n=e.peek();return 0==t.inString&&"'"==n&&(t.inString=!0,n=e.next()),1==t.inString?(e.skipTo("'")||e.skipToEnd(),"'"==e.peek()&&(e.next(),t.inString=!1),"string"):(e.next(),null)},lineComment:"#"}}),e.defineMIME("text/x-hxml","hxml")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js b/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js new file mode 100644 index 0000000000000..d93535fa490b4 --- /dev/null +++ b/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("htmlembedded",function(e,n){function i(t,e){return t.match(a,!1)?(e.token=o,r.token(t,e.scriptState)):d.token(t,e.htmlState)}function o(t,e){return t.match(c,!1)?(e.token=i,d.token(t,e.htmlState)):r.token(t,e.scriptState)}var r,d,a=n.scriptStartRegex||/^<%/i,c=n.scriptEndRegex||/^%>/i;return{startState:function(){return r=r||t.getMode(e,n.scriptingModeSpec),d=d||t.getMode(e,"htmlmixed"),{token:n.startOpen?o:i,htmlState:t.startState(d),scriptState:t.startState(r)}},token:function(t,e){return e.token(t,e)},indent:function(t,e){return t.token==i?d.indent(t.htmlState,e):r.indent?r.indent(t.scriptState,e):void 0},copyState:function(e){return{token:e.token,htmlState:t.copyState(d,e.htmlState),scriptState:t.copyState(r,e.scriptState)}},innerMode:function(t){return t.token==o?{state:t.scriptState,mode:r}:{state:t.htmlState,mode:d}}}},"htmlmixed"),t.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),t.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),t.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),t.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js b/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js new file mode 100644 index 0000000000000..2734acdf52686 --- /dev/null +++ b/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("htmlmixed",function(e,a){function o(t,e){var a=e.htmlState.tagName;a&&(a=a.toLowerCase());var o=r.token(t,e.htmlState);if("script"==a&&/\btag\b/.test(o)&&">"==t.current()){var l=t.string.slice(Math.max(0,t.pos-100),t.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);l=l?l[1]:"",l&&/[\"\']/.test(l.charAt(0))&&(l=l.slice(1,l.length-1));for(var m=0;m"==t.current()&&(e.token=c,e.localMode=s,e.localState=s.startState(r.indent(e.htmlState,"")));return o}function l(t,e,a){var o,l=t.current(),n=l.search(e);return n>-1?t.backUp(l.length-n):(o=l.match(/<\/?$/))&&(t.backUp(l.length),t.match(e,!1)||t.match(l)),a}function n(t,e){return t.match(/^<\/\s*script\s*>/i,!1)?(e.token=o,e.localState=e.localMode=null,null):l(t,/<\/\s*script\s*>/,e.localMode.token(t,e.localState))}function c(t,e){return t.match(/^<\/\s*style\s*>/i,!1)?(e.token=o,e.localState=e.localMode=null,null):l(t,/<\/\s*style\s*>/,s.token(t,e.localState))}var r=t.getMode(e,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag}),s=t.getMode(e,"css"),i=[],m=a&&a.scriptTypes;if(i.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:t.getMode(e,"javascript")}),m)for(var d=0;d=100&&200>i?"positive informational":i>=200&&300>i?"positive success":i>=300&&400>i?"positive redirect":i>=400&&500>i?"negative client-error":i>=500&&600>i?"negative server-error":"error"}function n(r,e){return r.skipToEnd(),e.cur=u,null}function o(r,e){return r.eatWhile(/\S/),e.cur=i,"string-2"}function i(e,t){return e.match(/^HTTP\/\d\.\d$/)?(t.cur=u,"keyword"):r(e,t)}function u(r){return r.sol()&&!r.eat(/[ \t]/)?r.match(/^.*?:/)?"atom":(r.skipToEnd(),"error"):(r.skipToEnd(),"string")}function c(r){return r.skipToEnd(),null}return{token:function(r,e){var t=e.cur;return t!=u&&t!=c&&r.eatSpace()?null:t(r,e)},blankLine:function(r){r.cur=c},startState:function(){return{cur:e}}}}),r.defineMIME("message/http","http")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/idl/idl.js b/media/editors/codemirror/mode/idl/idl.js index 15c852e36cff1..07308d71dcc86 100644 --- a/media/editors/codemirror/mode/idl/idl.js +++ b/media/editors/codemirror/mode/idl/idl.js @@ -275,7 +275,7 @@ // Handle non-detected items stream.next(); - return 'error'; + return null; }; CodeMirror.defineMode('idl', function() { diff --git a/media/editors/codemirror/mode/idl/idl.min.js b/media/editors/codemirror/mode/idl/idl.min.js new file mode 100644 index 0000000000000..7decde6c07cf0 --- /dev/null +++ b/media/editors/codemirror/mode/idl/idl.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e){if(e.eatSpace())return null;if(e.match(";"))return e.skipToEnd(),"comment";if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return"number";if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return"number"}return e.match(/^"([^"]|(""))*"/)?"string":e.match(/^'([^']|(''))*'/)?"string":e.match(o)?"keyword":e.match(a)?"builtin":e.match(l)?"variable":e.match(s)||e.match(n)?"operator":(e.next(),null)}var i=["a_correlate","abs","acos","adapt_hist_equal","alog","alog2","alog10","amoeba","annotate","app_user_dir","app_user_dir_query","arg_present","array_equal","array_indices","arrow","ascii_template","asin","assoc","atan","axis","axis","bandpass_filter","bandreject_filter","barplot","bar_plot","beseli","beselj","beselk","besely","beta","biginteger","bilinear","bin_date","binary_template","bindgen","binomial","bit_ffs","bit_population","blas_axpy","blk_con","boolarr","boolean","boxplot","box_cursor","breakpoint","broyden","bubbleplot","butterworth","bytarr","byte","byteorder","bytscl","c_correlate","calendar","caldat","call_external","call_function","call_method","call_procedure","canny","catch","cd","cdf","ceil","chebyshev","check_math","chisqr_cvf","chisqr_pdf","choldc","cholsol","cindgen","cir_3pnt","clipboard","close","clust_wts","cluster","cluster_tree","cmyk_convert","code_coverage","color_convert","color_exchange","color_quan","color_range_map","colorbar","colorize_sample","colormap_applicable","colormap_gradient","colormap_rotation","colortable","comfit","command_line_args","common","compile_opt","complex","complexarr","complexround","compute_mesh_normals","cond","congrid","conj","constrained_min","contour","contour","convert_coord","convol","convol_fft","coord2to3","copy_lun","correlate","cos","cosh","cpu","cramer","createboxplotdata","create_cursor","create_struct","create_view","crossp","crvlength","ct_luminance","cti_test","cursor","curvefit","cv_coord","cvttobm","cw_animate","cw_animate_getp","cw_animate_load","cw_animate_run","cw_arcball","cw_bgroup","cw_clr_index","cw_colorsel","cw_defroi","cw_field","cw_filesel","cw_form","cw_fslider","cw_light_editor","cw_light_editor_get","cw_light_editor_set","cw_orient","cw_palette_editor","cw_palette_editor_get","cw_palette_editor_set","cw_pdmenu","cw_rgbslider","cw_tmpl","cw_zoom","db_exists","dblarr","dcindgen","dcomplex","dcomplexarr","define_key","define_msgblk","define_msgblk_from_file","defroi","defsysv","delvar","dendro_plot","dendrogram","deriv","derivsig","determ","device","dfpmin","diag_matrix","dialog_dbconnect","dialog_message","dialog_pickfile","dialog_printersetup","dialog_printjob","dialog_read_image","dialog_write_image","dictionary","digital_filter","dilate","dindgen","dissolve","dist","distance_measure","dlm_load","dlm_register","doc_library","double","draw_roi","edge_dog","efont","eigenql","eigenvec","ellipse","elmhes","emboss","empty","enable_sysrtn","eof","eos","erase","erf","erfc","erfcx","erode","errorplot","errplot","estimator_filter","execute","exit","exp","expand","expand_path","expint","extrac","extract_slice","f_cvf","f_pdf","factorial","fft","file_basename","file_chmod","file_copy","file_delete","file_dirname","file_expand_path","file_gunzip","file_gzip","file_info","file_lines","file_link","file_mkdir","file_move","file_poll_input","file_readlink","file_same","file_search","file_tar","file_test","file_untar","file_unzip","file_which","file_zip","filepath","findgen","finite","fix","flick","float","floor","flow3","fltarr","flush","format_axis_values","forward_function","free_lun","fstat","fulstr","funct","function","fv_test","fx_root","fz_roots","gamma","gamma_ct","gauss_cvf","gauss_pdf","gauss_smooth","gauss2dfit","gaussfit","gaussian_function","gaussint","get_drive_list","get_dxf_objects","get_kbrd","get_login_info","get_lun","get_screen_size","getenv","getwindows","greg2jul","grib","grid_input","grid_tps","grid3","griddata","gs_iter","h_eq_ct","h_eq_int","hanning","hash","hdf","hdf5","heap_free","heap_gc","heap_nosave","heap_refcount","heap_save","help","hilbert","hist_2d","hist_equal","histogram","hls","hough","hqr","hsv","i18n_multibytetoutf8","i18n_multibytetowidechar","i18n_utf8tomultibyte","i18n_widechartomultibyte","ibeta","icontour","iconvertcoord","idelete","identity","idl_base64","idl_container","idl_validname","idlexbr_assistant","idlitsys_createtool","idlunit","iellipse","igamma","igetcurrent","igetdata","igetid","igetproperty","iimage","image","image_cont","image_statistics","image_threshold","imaginary","imap","indgen","int_2d","int_3d","int_tabulated","intarr","interpol","interpolate","interval_volume","invert","ioctl","iopen","ir_filter","iplot","ipolygon","ipolyline","iputdata","iregister","ireset","iresolve","irotate","isa","isave","iscale","isetcurrent","isetproperty","ishft","isocontour","isosurface","isurface","itext","itranslate","ivector","ivolume","izoom","journal","json_parse","json_serialize","jul2greg","julday","keyword_set","krig2d","kurtosis","kw_test","l64indgen","la_choldc","la_cholmprove","la_cholsol","la_determ","la_eigenproblem","la_eigenql","la_eigenvec","la_elmhes","la_gm_linear_model","la_hqr","la_invert","la_least_square_equality","la_least_squares","la_linear_equation","la_ludc","la_lumprove","la_lusol","la_svd","la_tridc","la_trimprove","la_triql","la_trired","la_trisol","label_date","label_region","ladfit","laguerre","lambda","lambdap","lambertw","laplacian","least_squares_filter","leefilt","legend","legendre","linbcg","lindgen","linfit","linkimage","list","ll_arc_distance","lmfit","lmgr","lngamma","lnp_test","loadct","locale_get","logical_and","logical_or","logical_true","lon64arr","lonarr","long","long64","lsode","lu_complex","ludc","lumprove","lusol","m_correlate","machar","make_array","make_dll","make_rt","map","mapcontinents","mapgrid","map_2points","map_continents","map_grid","map_image","map_patch","map_proj_forward","map_proj_image","map_proj_info","map_proj_init","map_proj_inverse","map_set","matrix_multiply","matrix_power","max","md_test","mean","meanabsdev","mean_filter","median","memory","mesh_clip","mesh_decimate","mesh_issolid","mesh_merge","mesh_numtriangles","mesh_obj","mesh_smooth","mesh_surfacearea","mesh_validate","mesh_volume","message","min","min_curve_surf","mk_html_help","modifyct","moment","morph_close","morph_distance","morph_gradient","morph_hitormiss","morph_open","morph_thin","morph_tophat","multi","n_elements","n_params","n_tags","ncdf","newton","noise_hurl","noise_pick","noise_scatter","noise_slur","norm","obj_class","obj_destroy","obj_hasmethod","obj_isa","obj_new","obj_valid","objarr","on_error","on_ioerror","online_help","openr","openu","openw","oplot","oploterr","orderedhash","p_correlate","parse_url","particle_trace","path_cache","path_sep","pcomp","plot","plot3d","plot","plot_3dbox","plot_field","ploterr","plots","polar_contour","polar_surface","polyfill","polyshade","pnt_line","point_lun","polarplot","poly","poly_2d","poly_area","poly_fit","polyfillv","polygon","polyline","polywarp","popd","powell","pref_commit","pref_get","pref_set","prewitt","primes","print","printf","printd","pro","product","profile","profiler","profiles","project_vol","ps_show_fonts","psafm","pseudo","ptr_free","ptr_new","ptr_valid","ptrarr","pushd","qgrid3","qhull","qromb","qromo","qsimp","query_*","query_ascii","query_bmp","query_csv","query_dicom","query_gif","query_image","query_jpeg","query_jpeg2000","query_mrsid","query_pict","query_png","query_ppm","query_srf","query_tiff","query_video","query_wav","r_correlate","r_test","radon","randomn","randomu","ranks","rdpix","read","readf","read_ascii","read_binary","read_bmp","read_csv","read_dicom","read_gif","read_image","read_interfile","read_jpeg","read_jpeg2000","read_mrsid","read_pict","read_png","read_ppm","read_spr","read_srf","read_sylk","read_tiff","read_video","read_wav","read_wave","read_x11_bitmap","read_xwd","reads","readu","real_part","rebin","recall_commands","recon3","reduce_colors","reform","region_grow","register_cursor","regress","replicate","replicate_inplace","resolve_all","resolve_routine","restore","retall","return","reverse","rk4","roberts","rot","rotate","round","routine_filepath","routine_info","rs_test","s_test","save","savgol","scale3","scale3d","scatterplot","scatterplot3d","scope_level","scope_traceback","scope_varfetch","scope_varname","search2d","search3d","sem_create","sem_delete","sem_lock","sem_release","set_plot","set_shading","setenv","sfit","shade_surf","shade_surf_irr","shade_volume","shift","shift_diff","shmdebug","shmmap","shmunmap","shmvar","show3","showfont","signum","simplex","sin","sindgen","sinh","size","skewness","skip_lun","slicer3","slide_image","smooth","sobel","socket","sort","spawn","sph_4pnt","sph_scat","spher_harm","spl_init","spl_interp","spline","spline_p","sprsab","sprsax","sprsin","sprstp","sqrt","standardize","stddev","stop","strarr","strcmp","strcompress","streamline","streamline","stregex","stretch","string","strjoin","strlen","strlowcase","strmatch","strmessage","strmid","strpos","strput","strsplit","strtrim","struct_assign","struct_hide","strupcase","surface","surface","surfr","svdc","svdfit","svsol","swap_endian","swap_endian_inplace","symbol","systime","t_cvf","t_pdf","t3d","tag_names","tan","tanh","tek_color","temporary","terminal_size","tetra_clip","tetra_surface","tetra_volume","text","thin","thread","threed","tic","time_test2","timegen","timer","timestamp","timestamptovalues","tm_test","toc","total","trace","transpose","tri_surf","triangulate","trigrid","triql","trired","trisol","truncate_lun","ts_coef","ts_diff","ts_fcast","ts_smooth","tv","tvcrs","tvlct","tvrd","tvscl","typename","uindgen","uint","uintarr","ul64indgen","ulindgen","ulon64arr","ulonarr","ulong","ulong64","uniq","unsharp_mask","usersym","value_locate","variance","vector","vector_field","vel","velovect","vert_t3d","voigt","volume","voronoi","voxel_proj","wait","warp_tri","watershed","wdelete","wf_draw","where","widget_base","widget_button","widget_combobox","widget_control","widget_displaycontextmenu","widget_draw","widget_droplist","widget_event","widget_info","widget_label","widget_list","widget_propertysheet","widget_slider","widget_tab","widget_table","widget_text","widget_tree","widget_tree_move","widget_window","wiener_filter","window","window","write_bmp","write_csv","write_gif","write_image","write_jpeg","write_jpeg2000","write_nrif","write_pict","write_png","write_ppm","write_spr","write_srf","write_sylk","write_tiff","write_video","write_wav","write_wave","writeu","wset","wshow","wtn","wv_applet","wv_cwt","wv_cw_wavelet","wv_denoise","wv_dwt","wv_fn_coiflet","wv_fn_daubechies","wv_fn_gaussian","wv_fn_haar","wv_fn_morlet","wv_fn_paul","wv_fn_symlet","wv_import_data","wv_import_wavelet","wv_plot3d_wps","wv_plot_multires","wv_pwt","wv_tool_denoise","xbm_edit","xdisplayfile","xdxf","xfont","xinteranimate","xloadct","xmanager","xmng_tmpl","xmtool","xobjview","xobjview_rotate","xobjview_write_image","xpalette","xpcolor","xplot3d","xregistered","xroi","xsq_test","xsurface","xvaredit","xvolume","xvolume_rotate","xvolume_write_image","xyouts","zlib_compress","zlib_uncompress","zoom","zoom_24"],a=t(i),_=["begin","end","endcase","endfor","endwhile","endif","endrep","endforeach","break","case","continue","for","foreach","goto","if","then","else","repeat","until","switch","while","do","pro","function"],o=t(_);e.registerHelper("hintWords","idl",i.concat(_));var l=new RegExp("^[_a-z¡-￿][_a-z0-9¡-￿]*","i"),s=/[+\-*&=<>\/@#~$]/,n=new RegExp("(and|or|eq|lt|le|gt|ge|ne|not)","i");e.defineMode("idl",function(){return{token:function(e){return r(e)}}}),e.defineMIME("text/x-idl","idl")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/jade/jade.min.js b/media/editors/codemirror/mode/jade/jade.min.js new file mode 100644 index 0000000000000..eb17b9629b1ae --- /dev/null +++ b/media/editors/codemirror/mode/jade/jade.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("jade",function(e){function n(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=X.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function i(t,e){if(t.sol()&&(e.javaScriptLine=!1,e.javaScriptLineExcludesColon=!1),e.javaScriptLine){if(e.javaScriptLineExcludesColon&&":"===t.peek())return e.javaScriptLine=!1,void(e.javaScriptLineExcludesColon=!1);var n=X.token(t,e.jsState);return t.eol()&&(e.javaScriptLine=!1),n||!0}}function r(t,e){if(e.javaScriptArguments){if(0===e.javaScriptArgumentsDepth&&"("!==t.peek())return void(e.javaScriptArguments=!1);if("("===t.peek()?e.javaScriptArgumentsDepth++:")"===t.peek()&&e.javaScriptArgumentsDepth--,0===e.javaScriptArgumentsDepth)return void(e.javaScriptArguments=!1);var n=X.token(t,e.jsState);return n||!0}}function a(t){return t.match(/^yield\b/)?"keyword":void 0}function s(t){return t.match(/^(?:doctype) *([^\n]+)?/)?P:void 0}function o(t,e){return t.match("#{")?(e.isInterpolating=!0,e.interpolationNesting=0,"punctuation"):void 0}function c(t,e){if(e.isInterpolating){if("}"===t.peek()){if(e.interpolationNesting--,e.interpolationNesting<0)return t.next(),e.isInterpolating=!1,"puncutation"}else"{"===t.peek()&&e.interpolationNesting++;return X.token(t,e.jsState)||!0}}function u(t,e){return t.match(/^case\b/)?(e.javaScriptLine=!0,K):void 0}function p(t,e){return t.match(/^when\b/)?(e.javaScriptLine=!0,e.javaScriptLineExcludesColon=!0,K):void 0}function d(t){return t.match(/^default\b/)?K:void 0}function l(t,e){return t.match(/^extends?\b/)?(e.restOfLine="string",K):void 0}function h(t,e){return t.match(/^append\b/)?(e.restOfLine="variable",K):void 0}function f(t,e){return t.match(/^prepend\b/)?(e.restOfLine="variable",K):void 0}function v(t,e){return t.match(/^block\b *(?:(prepend|append)\b)?/)?(e.restOfLine="variable",K):void 0}function m(t,e){return t.match(/^include\b/)?(e.restOfLine="string",K):void 0}function S(t,e){return t.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&t.match("include")?(e.isIncludeFiltered=!0,K):void 0}function j(t,e){if(e.isIncludeFiltered){var n=x(t,e);return e.isIncludeFiltered=!1,e.restOfLine="string",n}}function g(t,e){return t.match(/^mixin\b/)?(e.javaScriptLine=!0,K):void 0}function b(t,e){return t.match(/^\+([-\w]+)/)?(t.match(/^\( *[-\w]+ *=/,!1)||(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0),"variable"):t.match(/^\+#{/,!1)?(t.next(),e.mixinCallAfter=!0,o(t,e)):void 0}function L(t,e){return e.mixinCallAfter?(e.mixinCallAfter=!1,t.match(/^\( *[-\w]+ *=/,!1)||(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0),!0):void 0}function A(t,e){return t.match(/^(if|unless|else if|else)\b/)?(e.javaScriptLine=!0,K):void 0}function k(t,e){return t.match(/^(- *)?(each|for)\b/)?(e.isEach=!0,K):void 0}function y(t,e){if(e.isEach){if(t.match(/^ in\b/))return e.javaScriptLine=!0,e.isEach=!1,K;if(t.sol()||t.eol())e.isEach=!1;else if(t.next()){for(;!t.match(/^ in\b/,!1)&&t.next(););return"variable"}}}function T(t,e){return t.match(/^while\b/)?(e.javaScriptLine=!0,K):void 0}function M(t,e){var n;return(n=t.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(e.lastTag=n[1].toLowerCase(),"script"===e.lastTag&&(e.scriptType="application/javascript"),"tag"):void 0}function x(n,i){if(n.match(/^:([\w\-]+)/)){var r;return e&&e.innerModes&&(r=e.innerModes(n.current().substring(1))),r||(r=n.current().substring(1)),"string"==typeof r&&(r=t.getMode(e,r)),Z(n,i,r),"atom"}}function N(t,e){return t.match(/^(!?=|-)/)?(e.javaScriptLine=!0,"punctuation"):void 0}function O(t){return t.match(/^#([\w-]+)/)?Q:void 0}function w(t){return t.match(/^\.([\w-]+)/)?R:void 0}function I(t,e){return"("==t.peek()?(t.next(),e.isAttrs=!0,e.attrsNest=[],e.inAttributeName=!0,e.attrValue="",e.attributeIsType=!1,"punctuation"):void 0}function E(t,e){if(e.isAttrs){if(W[t.peek()]&&e.attrsNest.push(W[t.peek()]),e.attrsNest[e.attrsNest.length-1]===t.peek())e.attrsNest.pop();else if(t.eat(")"))return e.isAttrs=!1,"punctuation";if(e.inAttributeName&&t.match(/^[^=,\)!]+/))return("="===t.peek()||"!"===t.peek())&&(e.inAttributeName=!1,e.jsState=X.startState(),e.attributeIsType="script"===e.lastTag&&"type"===t.current().trim().toLowerCase()?!0:!1),"attribute";var n=X.token(t,e.jsState);if(e.attributeIsType&&"string"===n&&(e.scriptType=t.current().toString()),0===e.attrsNest.length&&("string"===n||"variable"===n||"keyword"===n))try{return Function("","var x "+e.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),e.inAttributeName=!0,e.attrValue="",t.backUp(t.current().length),E(t,e)}catch(i){}return e.attrValue+=t.current(),n||!0}}function C(t,e){return t.match(/^&attributes\b/)?(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0,"keyword"):void 0}function F(t){return t.sol()&&t.eatSpace()?"indent":void 0}function D(t,e){return t.match(/^ *\/\/(-)?([^\n]*)/)?(e.indentOf=t.indentation(),e.indentToken="comment","comment"):void 0}function V(t){return t.match(/^: */)?"colon":void 0}function q(t,e){return t.match(/^(?:\| ?| )([^\n]+)/)?"string":t.match(/^(<[^\n]*)/,!1)?(Z(t,e,"htmlmixed"),e.innerModeForLine=!0,$(t,e,!0)):void 0}function z(t,e){if(t.eat(".")){var n=null;return"script"===e.lastTag&&-1!=e.scriptType.toLowerCase().indexOf("javascript")?n=e.scriptType.toLowerCase().replace(/"|'/g,""):"style"===e.lastTag&&(n="css"),Z(t,e,n),"dot"}}function U(t){return t.next(),null}function Z(n,i,r){r=t.mimeModes[r]||r,r=e.innerModes?e.innerModes(r)||r:r,r=t.mimeModes[r]||r,r=t.getMode(e,r),i.indentOf=n.indentation(),r&&"null"!==r.name?i.innerMode=r:i.indentToken="string"}function $(t,e,n){return t.indentation()>e.indentOf||e.innerModeForLine&&!t.sol()||n?e.innerMode?(e.innerState||(e.innerState=e.innerMode.startState?e.innerMode.startState(t.indentation()):{}),t.hideFirstChars(e.indentOf+2,function(){return e.innerMode.token(t,e.innerState)||!0})):(t.skipToEnd(),e.indentToken):void(t.sol()&&(e.indentOf=1/0,e.indentToken=null,e.innerMode=null,e.innerState=null))}function B(t,e){if(t.sol()&&(e.restOfLine=""),e.restOfLine){t.skipToEnd();var n=e.restOfLine;return e.restOfLine="",n}}function G(){return new n}function H(t){return t.copy()}function J(t,e){var n=$(t,e)||B(t,e)||c(t,e)||j(t,e)||y(t,e)||E(t,e)||i(t,e)||r(t,e)||L(t,e)||a(t,e)||s(t,e)||o(t,e)||u(t,e)||p(t,e)||d(t,e)||l(t,e)||h(t,e)||f(t,e)||v(t,e)||m(t,e)||S(t,e)||g(t,e)||b(t,e)||A(t,e)||k(t,e)||T(t,e)||M(t,e)||x(t,e)||N(t,e)||O(t,e)||w(t,e)||I(t,e)||C(t,e)||F(t,e)||q(t,e)||D(t,e)||V(t,e)||z(t,e)||U(t,e);return n===!0?null:n}var K="keyword",P="meta",Q="builtin",R="qualifier",W={"{":"}","(":")","[":"]"},X=t.getMode(e,"javascript");return n.prototype.copy=function(){var e=new n;return e.javaScriptLine=this.javaScriptLine,e.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,e.javaScriptArguments=this.javaScriptArguments,e.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,e.isInterpolating=this.isInterpolating,e.interpolationNesting=this.intpolationNesting,e.jsState=t.copyState(X,this.jsState),e.innerMode=this.innerMode,this.innerMode&&this.innerState&&(e.innerState=t.copyState(this.innerMode,this.innerState)),e.restOfLine=this.restOfLine,e.isIncludeFiltered=this.isIncludeFiltered,e.isEach=this.isEach,e.lastTag=this.lastTag,e.scriptType=this.scriptType,e.isAttrs=this.isAttrs,e.attrsNest=this.attrsNest.slice(),e.inAttributeName=this.inAttributeName,e.attributeIsType=this.attributeIsType,e.attrValue=this.attrValue,e.indentOf=this.indentOf,e.indentToken=this.indentToken,e.innerModeForLine=this.innerModeForLine,e},{startState:G,copyState:H,token:J}}),t.defineMIME("text/x-jade","jade")}); \ 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 93df06d152d74..3f05ac46c3326 100644 --- a/media/editors/codemirror/mode/javascript/javascript.js +++ b/media/editors/codemirror/mode/javascript/javascript.js @@ -118,7 +118,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { } else if (state.lastType == "operator" || state.lastType == "keyword c" || state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) { readRegexp(stream); - stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla + stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/); return ret("regexp", "string-2"); } else { stream.eatWhile(isOperatorChar); diff --git a/media/editors/codemirror/mode/javascript/javascript.min.js b/media/editors/codemirror/mode/javascript/javascript.min.js new file mode 100644 index 0000000000000..e031cf7b866fd --- /dev/null +++ b/media/editors/codemirror/mode/javascript/javascript.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,r){function n(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function a(e,t,r){return mt=e,yt=r,t}function i(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=o(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return a("number","number");if("."==r&&e.match(".."))return a("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return a(r);if("="==r&&e.eat(">"))return a("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),a("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),a("number","number");if("/"==r)return e.eat("*")?(t.tokenize=c,c(e,t)):e.eat("/")?(e.skipToEnd(),a("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(n(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),a("regexp","string-2")):(e.eatWhile(Mt),a("operator","operator",e.current()));if("`"==r)return t.tokenize=u,u(e,t);if("#"==r)return e.skipToEnd(),a("error","error");if(Mt.test(r))return e.eatWhile(Mt),a("operator","operator",e.current());if(wt.test(r)){e.eatWhile(wt);var i=e.current(),l=jt.propertyIsEnumerable(i)&&jt[i];return l&&"."!=t.lastType?a(l.type,l.style,i):a("variable","variable",i)}}function o(e){return function(t,r){var n,o=!1;if(xt&&"@"==t.peek()&&t.match(Vt))return r.tokenize=i,a("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||o);)o=!o&&"\\"==n;return o||(r.tokenize=i),a("string","string")}}function c(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=i;break}n="*"==r}return a("comment","comment")}function u(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=i;break}n=!n&&"\\"==r}return a("quasi","string-2",e.current())}function l(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(0>r)){for(var n=0,a=!1,i=r-1;i>=0;--i){var o=e.string.charAt(i),c=Et.indexOf(o);if(c>=0&&3>c){if(!n){++i;break}if(0==--n)break}else if(c>=3&&6>c)++n;else if(wt.test(o))a=!0;else{if(/["'\/]/.test(o))return;if(a&&!n){++i;break}}}a&&!n&&(t.fatArrowAt=i)}}function s(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function d(e,t,r,n,a){var i=e.cc;for(zt.state=e,zt.stream=a,zt.marked=null,zt.cc=i,zt.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=i.length?i.pop():ht?w:g;if(o(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return zt.marked?zt.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)zt.cc.push(arguments[e])}function v(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var n=zt.state;if(n.context){if(zt.marked="def",t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function y(){zt.state.context={prev:zt.state.context,vars:zt.state.localVars},zt.state.localVars=Tt}function b(){zt.state.localVars=zt.state.context.vars,zt.state.context=zt.state.context.prev}function k(e,t){var r=function(){var r=zt.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new s(n,zt.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function x(){var e=zt.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function h(e){function t(r){return r==e?v():";"==e?p():v(t)}return t}function g(e,t){return"var"==e?v(k("vardef",t.length),F,h(";"),x):"keyword a"==e?v(k("form"),w,g,x):"keyword b"==e?v(k("form"),g,x):"{"==e?v(k("}"),U,x):";"==e?v():"if"==e?("else"==zt.state.lexical.info&&zt.state.cc[zt.state.cc.length-1]==x&&zt.state.cc.pop()(),v(k("form"),w,g,x,Q)):"function"==e?v(et):"for"==e?v(k("form"),R,g,x):"variable"==e?v(k("stat"),q):"switch"==e?v(k("form"),w,k("}","switch"),h("{"),U,x,x):"case"==e?v(w,h(":")):"default"==e?v(h(":")):"catch"==e?v(k("form"),y,h("("),tt,h(")"),g,x,b):"module"==e?v(k("form"),y,ot,b,x):"class"==e?v(k("form"),rt,x):"export"==e?v(k("form"),ct,x):"import"==e?v(k("form"),ut,x):p(k("stat"),w,h(";"),x)}function w(e){return M(e,!1)}function j(e){return M(e,!0)}function M(e,t){if(zt.state.fatArrowAt==zt.stream.start){var r=t?$:C;if("("==e)return v(y,k(")"),N(G,")"),x,h("=>"),r,b);if("variable"==e)return p(y,G,h("=>"),r,b)}var n=t?z:I;return It.hasOwnProperty(e)?v(n):"function"==e?v(et,n):"keyword c"==e?v(t?E:V):"("==e?v(k(")"),V,pt,h(")"),x,n):"operator"==e||"spread"==e?v(t?j:w):"["==e?v(k("]"),ft,x,n):"{"==e?H(P,"}",null,n):"quasi"==e?p(T,n):v()}function V(e){return e.match(/[;\}\)\],]/)?p():p(w)}function E(e){return e.match(/[;\}\)\],]/)?p():p(j)}function I(e,t){return","==e?v(w):z(e,t,!1)}function z(e,t,r){var n=0==r?I:z,a=0==r?w:j;return"=>"==e?v(y,r?$:C,b):"operator"==e?/\+\+|--/.test(t)?v(n):"?"==t?v(w,h(":"),a):v(a):"quasi"==e?p(T,n):";"!=e?"("==e?H(j,")","call",n):"."==e?v(O,n):"["==e?v(k("]"),V,h("]"),x,n):void 0:void 0}function T(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?v(T):v(w,A)}function A(e){return"}"==e?(zt.marked="string-2",zt.state.tokenize=u,v(T)):void 0}function C(e){return l(zt.stream,zt.state),p("{"==e?g:w)}function $(e){return l(zt.stream,zt.state),p("{"==e?g:j)}function q(e){return":"==e?v(x,g):p(I,h(";"),x)}function O(e){return"variable"==e?(zt.marked="property",v()):void 0}function P(e,t){return"variable"==e||"keyword"==zt.style?(zt.marked="property",v("get"==t||"set"==t?S:W)):"number"==e||"string"==e?(zt.marked=xt?"property":zt.style+" property",v(W)):"jsonld-keyword"==e?v(W):"["==e?v(w,h("]"),W):void 0}function S(e){return"variable"!=e?p(W):(zt.marked="property",v(et))}function W(e){return":"==e?v(j):"("==e?p(et):void 0}function N(e,t){function r(n){if(","==n){var a=zt.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),v(e,r)}return n==t?v():v(h(t))}return function(n){return n==t?v():p(e,r)}}function H(e,t,r){for(var n=3;n!?|~^]/,Vt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Et="([{}])",It={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},zt={state:null,column:null,marked:null,cc:null},Tt={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:i,lastType:"sof",cc:[],lexical:new s((e||0)-bt,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),l(e,t)),t.tokenize!=c&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==mt?r:(t.lastType="operator"!=mt||"++"!=yt&&"--"!=yt?mt:"incdec",d(t,r,mt,yt,e))},indent:function(t,n){if(t.tokenize==c)return e.Pass;if(t.tokenize!=i)return 0;var a=n&&n.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var l=t.cc[u];if(l==x)o=o.prev;else if(l!=Q)break}"stat"==o.type&&"}"==a&&(o=o.prev),kt&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var s=o.type,f=a==s;return"vardef"==s?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==s&&"{"==a?o.indented:"form"==s?o.indented+bt:"stat"==s?o.indented+(vt(t,n)?kt||bt:0):"switch"!=o.info||f||0==r.doubleIndentSwitch?o.align?o.column+(f?0:1):o.indented+(f?0:bt):o.indented+(/^(?:case|default)\b/.test(n)?bt:2*bt)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:ht?null:"/*",blockCommentEnd:ht?null:"*/",lineComment:ht?null:"//",fold:"brace",helperType:ht?"json":"javascript",jsonldMode:xt,jsonMode:ht}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/javascript/test.min.js b/media/editors/codemirror/mode/javascript/test.min.js new file mode 100644 index 0000000000000..24c2a2d38ee31 --- /dev/null +++ b/media/editors/codemirror/mode/javascript/test.min.js @@ -0,0 +1 @@ +!function(){function r(r){test.mode(r,o,Array.prototype.slice.call(arguments,1))}function e(r){test.mode(r,a,Array.prototype.slice.call(arguments,1))}var o=CodeMirror.getMode({indentUnit:2},"javascript");r("locals","[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"),r("comma-and-binop","[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"),r("destructuring","([keyword function]([def a], [[[def b], [def c] ]]) {"," [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);"," [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];","})();"),r("class_body","[keyword class] [variable Foo] {"," [property constructor]() {}"," [property sayName]() {"," [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];"," }","}"),r("class","[keyword class] [variable Point] [keyword extends] [variable SuperThing] {"," [property get] [property prop]() { [keyword return] [number 24]; }"," [property constructor]([def x], [def y]) {"," [keyword super]([string 'something']);"," [keyword this].[property x] [operator =] [variable-2 x];"," }","}"),r("module","[keyword module] [string 'foo'] {"," [keyword export] [keyword let] [def x] [operator =] [number 42];"," [keyword export] [keyword *] [keyword from] [string 'somewhere'];","}"),r("import","[keyword function] [variable foo]() {"," [keyword import] [def $] [keyword from] [string 'jquery'];"," [keyword module] [def crypto] [keyword from] [string 'crypto'];"," [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];","}"),r("const","[keyword function] [variable f]() {"," [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];","}"),r("for/of","[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}"),r("generator","[keyword function*] [variable repeat]([def n]) {"," [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])"," [keyword yield] [variable-2 i];","}"),r("quotedStringAddition","[keyword let] [variable f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];"),r("quotedFatArrow","[keyword let] [variable f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];"),r("fatArrow","[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);","[variable a];","[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];","[variable c];"),r("spread","[keyword function] [variable f]([def a], [meta ...][def b]) {"," [variable something]([variable-2 a], [meta ...][variable-2 b]);","}"),r("comprehension","[keyword function] [variable f]() {"," [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];"," ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));","}"),r("quasi","[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"),r("quasi_no_function","[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"),r("indent_statement","[keyword var] [variable x] [operator =] [number 10]","[variable x] [operator +=] [variable y] [operator +]"," [atom Infinity]","[keyword debugger];"),r("indent_if","[keyword if] ([number 1])"," [keyword break];","[keyword else] [keyword if] ([number 2])"," [keyword continue];","[keyword else]"," [number 10];","[keyword if] ([number 1]) {"," [keyword break];","} [keyword else] [keyword if] ([number 2]) {"," [keyword continue];","} [keyword else] {"," [number 10];","}"),r("indent_for","[keyword for] ([keyword var] [variable i] [operator =] [number 0];"," [variable i] [operator <] [number 100];"," [variable i][operator ++])"," [variable doSomething]([variable i]);","[keyword debugger];"),r("indent_c_style","[keyword function] [variable foo]()","{"," [keyword debugger];","}"),r("indent_else","[keyword for] (;;)"," [keyword if] ([variable foo])"," [keyword if] ([variable bar])"," [number 1];"," [keyword else]"," [number 2];"," [keyword else]"," [number 3];"),r("indent_funarg","[variable foo]([number 10000],"," [keyword function]([def a]) {"," [keyword debugger];","};"),r("indent_below_if","[keyword for] (;;)"," [keyword if] ([variable foo])"," [number 1];","[number 2];"),r("multilinestring","[keyword var] [variable x] [operator =] [string 'foo\\]","[string bar'];"),r("scary_regexp","[string-2 /foo[[/]]bar/];"),r("indent_strange_array","[keyword var] [variable x] [operator =] [["," [number 1],,"," [number 2],","]];","[number 10];");var a=CodeMirror.getMode({indentUnit:2},{name:"javascript",jsonld:!0});e("json_ld_keywords","{",' [meta "@context"]: {',' [meta "@base"]: [string "http://example.com"],',' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],',' [property "likesFlavor"]: {',' [meta "@container"]: [meta "@list"]',' [meta "@reverse"]: [string "@beFavoriteOf"]'," },",' [property "nick"]: { [meta "@container"]: [meta "@set"] },',' [property "nick"]: { [meta "@container"]: [meta "@index"] }'," },",' [meta "@graph"]: [[ {',' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],',' [property "name"]: [string "John Lennon"],',' [property "modified"]: {',' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],',' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]'," }"," } ]]","}"),e("json_ld_fake","{",' [property "@fake"]: [string "@fake"],',' [property "@contextual"]: [string "@identifier"],',' [property "user@domain.com"]: [string "@graphical"],',' [property "@ID"]: [string "@@ID"]',"}")}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/jinja2/jinja2.min.js b/media/editors/codemirror/mode/jinja2/jinja2.min.js new file mode 100644 index 0000000000000..0e2246150806e --- /dev/null +++ b/media/editors/codemirror/mode/jinja2/jinja2.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("jinja2",function(){function e(e,a){var c=e.peek();if(a.incomment)return e.skipTo("#}")?(e.eatWhile(/\#|}/),a.incomment=!1):e.skipToEnd(),"comment";if(a.intag){if(a.operator){if(a.operator=!1,e.match(i))return"atom";if(e.match(o))return"number"}if(a.sign){if(a.sign=!1,e.match(i))return"atom";if(e.match(o))return"number"}if(a.instring)return c==a.instring&&(a.instring=!1),e.next(),"string";if("'"==c||'"'==c)return a.instring=c,e.next(),"string";if(e.match(a.intag+"}")||e.eat("-")&&e.match(a.intag+"}"))return a.intag=!1,"tag";if(e.match(t))return a.operator=!0,"operator";if(e.match(r))a.sign=!0;else if(e.eat(" ")||e.sol()){if(e.match(n))return"keyword";if(e.match(i))return"atom";if(e.match(o))return"number";e.sol()&&e.next()}else e.next();return"variable"}if(e.eat("{")){if(c=e.eat("#"))return a.incomment=!0,e.skipTo("#}")?(e.eatWhile(/\#|}/),a.incomment=!1):e.skipToEnd(),"comment";if(c=e.eat(/\{|%/))return a.intag=c,"{"==c&&(a.intag="}"),e.eat("-"),"tag"}e.next()}var n=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","plural"],t=/^[+\-*&%=<>!?|~^]/,r=/^[:\[\(\{]/,i=["true","false"],o=/^(\d[+\-\*\/])?\d+(\.\d+)?/;return n=new RegExp("(("+n.join(")|(")+"))\\b"),i=new RegExp("(("+i.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,n){return n.tokenize(e,n)}}})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/julia/julia.min.js b/media/editors/codemirror/mode/julia/julia.min.js new file mode 100644 index 0000000000000..644eb80b7ea0b --- /dev/null +++ b/media/editors/codemirror/mode/julia/julia.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("julia",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e){var t=i(e);return"["==t||"{"==t?!0:!1}function i(e){return 0==e.scopes.length?null:e.scopes[e.scopes.length-1]}function a(e,t){var n=t.leaving_expr;if(e.sol()&&(n=!1),t.leaving_expr=!1,n&&e.match(/^'+/))return"operator";if(e.match(/^\.{2,3}/))return"operator";if(e.eatSpace())return null;var a=e.peek();if("#"===a)return e.skipToEnd(),"comment";"["===a&&t.scopes.push("["),"{"===a&&t.scopes.push("{");var l=i(t);"["===l&&"]"===a&&(t.scopes.pop(),t.leaving_expr=!0),"{"===l&&"}"===a&&(t.scopes.pop(),t.leaving_expr=!0),")"===a&&(t.leaving_expr=!0);var m;if(!r(t)&&(m=e.match(x,!1))&&t.scopes.push(m),!r(t)&&e.match(y,!1)&&t.scopes.pop(),r(t)&&e.match(/^end/))return"number";if(e.match(/^=>/))return"operator";if(e.match(/^[0-9\.]/,!1)){var p=RegExp(/^im\b/),h=!1;if(e.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)&&(h=!0),e.match(/^\d+\.(?!\.)\d*/)&&(h=!0),e.match(/^\.\d+/)&&(h=!0),h)return e.match(p),t.leaving_expr=!0,"number";var d=!1;if(e.match(/^0x[0-9a-f]+/i)&&(d=!0),e.match(/^0b[01]+/i)&&(d=!0),e.match(/^0o[0-7]+/i)&&(d=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(d=!0),e.match(/^0(?![\dx])/i)&&(d=!0),d)return e.match(p),t.leaving_expr=!0,"number"}return e.match(/^(::)|(<:)/)?"operator":!n&&e.match(z)?"string":e.match(u)?"operator":e.match(g)?(t.tokenize=o(e.current()),t.tokenize(e,t)):e.match(_)?"meta":e.match(f)?null:e.match(b)?"keyword":e.match(v)?"builtin":e.match(s)?(t.leaving_expr=!0,"variable"):(e.next(),c)}function o(e){function n(n,o){for(;!n.eol();)if(n.eatWhile(/[^'"\\]/),n.eat("\\")){if(n.next(),r&&n.eol())return i}else{if(n.match(e))return o.tokenize=a,i;n.eat(/['"]/)}if(r){if(t.singleLineStringErrors)return c;o.tokenize=a}return i}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var r=1==e.length,i="string";return n.isString=!0,n}function l(e,t){F=null;var n=t.tokenize(e,t),r=e.current();return"."===r?(n=e.match(s,!1)?null:c,null===n&&"meta"===t.lastStyle&&(n="meta"),n):n}var c="error",u=t.operators||/^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/,f=t.delimiters||/^[;,()[\]{}]/,s=t.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/,m=["begin","function","type","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"],p=["end","else","elseif","catch","finally"],h=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","macro","module","baremodule","type","immutable","quote","typealias","abstract","bitstype","ccall"],d=["true","false","enumerate","open","close","nothing","NaN","Inf","print","println","Int","Int8","Uint8","Int16","Uint16","Int32","Uint32","Int64","Uint64","Int128","Uint128","Bool","Char","Float16","Float32","Float64","Array","Vector","Matrix","String","UTF8String","ASCIIString","error","warn","info","@printf"],g=/^(`|'|"{3}|([br]?"))/,b=n(h),v=n(d),x=n(m),y=n(p),_=/^@[_A-Za-z][_A-Za-z0-9]*/,z=/^:[_A-Za-z][_A-Za-z0-9]*/,F=null,k={startState:function(){return{tokenize:a,scopes:[],leaving_expr:!1}},token:function(e,t){var n=l(e,t);return t.lastStyle=n,n},indent:function(e,t){var n=0;return("end"==t||"]"==t||"}"==t||"else"==t||"elseif"==t||"catch"==t||"finally"==t)&&(n=-1),4*(e.scopes.length+n)},lineComment:"#",fold:"indent",electricChars:"edlsifyh]}"};return k}),e.defineMIME("text/x-julia","julia")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/kotlin/kotlin.min.js b/media/editors/codemirror/mode/kotlin/kotlin.min.js new file mode 100644 index 0000000000000..4fbf7b91dc6c4 --- /dev/null +++ b/media/editors/codemirror/mode/kotlin/kotlin.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("kotlin",function(e,t){function n(e){for(var t={},n=e.split(" "),r=0;r"))return c="->",null;if(/[\-+*&%=<>!?|\/~]/.test(n))return e.eatWhile(/[\-+*&%=<>|~]/),"operator";e.eatWhile(/[\w\$_]/);var r=e.current();return h.propertyIsEnumerable(r)?"atom":k.propertyIsEnumerable(r)?(y.propertyIsEnumerable(r)&&(c="newstatement"),"softKeyword"):m.propertyIsEnumerable(r)?(y.propertyIsEnumerable(r)&&(c="newstatement"),"keyword"):"word"}function i(e,t,n){function r(t,n){for(var u,l=!1,s=!i;null!=(u=t.next());){if(u==e&&!l){if(!i)break;if(t.match(e+e)){s=!0;break}}if('"'==e&&"$"==u&&!l&&t.eat("{"))return n.tokenize.push(o()),"string";if("$"==u&&!l&&!t.eat(" "))return n.tokenize.push(a()),"string";l=!l&&"\\"==u}return d&&n.tokenize.push(r),s&&n.tokenize.pop(),"string"}var i=!1;if("/"!=e&&t.eat(e)){if(!t.eat(e))return"string";i=!0}return n.tokenize.push(r),r(t,n)}function o(){function e(e,n){if("}"==e.peek()){if(t--,0==t)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](e,n)}else"{"==e.peek()&&t++;return r(e,n)}var t=1;return e.isBase=!0,e}function a(){function e(e,t){if(e.eat(/[\w]/)){var n=e.eatWhile(/[\w]/);if(n)return t.tokenize.pop(),"word"}return t.tokenize.pop(),"string"}return e.isBase=!0,e}function u(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize.pop();break}r="*"==n}return"comment"}function l(e){return!e||"operator"==e||"->"==e||/[\.\[\{\(,;:]/.test(e)||"newstatement"==e||"keyword"==e||"proplabel"==e}function s(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function f(e,t,n){return e.context=new s(e.indented,t,n,null,e.context)}function p(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var c,d=t.multiLineStrings,m=n("package continue return object while break class data trait throw super when type this else This try val var fun for is in if do as true false null get set"),k=n("import where by get set abstract enum open annotation override private public internal protected catch out vararg inline finally final ref"),y=n("catch class do else finally for if where try while enum"),h=n("null true false this");return r.isBase=!0,{startState:function(t){return{tokenize:[r],context:new s((t||0)-e.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"statement"!=n.type||l(t.lastToken)||(p(t),n=t.context)),e.eatSpace())return null;c=null;var r=t.tokenize[t.tokenize.length-1](e,t);if("comment"==r)return r;if(null==n.align&&(n.align=!0),";"!=c&&":"!=c||"statement"!=n.type)if("->"==c&&"statement"==n.type&&"}"==n.prev.type)p(t),t.context.align=!1;else if("{"==c)f(t,e.column(),"}");else if("["==c)f(t,e.column(),"]");else if("("==c)f(t,e.column(),")");else if("}"==c){for(;"statement"==n.type;)n=p(t);for("}"==n.type&&(n=p(t));"statement"==n.type;)n=p(t)}else c==n.type?p(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==c)&&f(t,e.column(),"statement");else p(t);return t.startOfLine=!1,t.lastToken=c||r,r},indent:function(t,n){if(!t.tokenize[t.tokenize.length-1].isBase)return 0;var r=n&&n.charAt(0),i=t.context;"statement"!=i.type||l(t.lastToken)||(i=i.prev);var o=r==i.type;return"statement"==i.type?i.indented+("{"==r?0:e.indentUnit):i.align?i.column+(o?0:1):i.indented+(o?0:e.indentUnit)},electricChars:"{}"}}),e.defineMIME("text/x-kotlin","kotlin")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/livescript/livescript.min.js b/media/editors/codemirror/mode/livescript/livescript.min.js new file mode 100644 index 0000000000000..ca302a92517ba --- /dev/null +++ b/media/editors/codemirror/mode/livescript/livescript.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("livescript",function(){var e=function(e,t){var r=t.next||"start";if(r){t.next=t.next;var n=g[r];if(n.splice){for(var o=0;o|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+t+")?))\\s*$"),n="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",o={token:"string",regex:".+"},g={start:[{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)"+n},{token:"constant.language",regex:"(?:true|false|yes|no|on|off|null|void|undefined)"+n},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+n},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+n},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+n},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+n},{token:"identifier",regex:t+"\\s*:(?![:=])"},{token:"variable",regex:t},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:t,next:"start"},{token:"text",regex:"",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},o],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},o],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},o],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},o],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},o],words:[{token:"string",regex:".*?\\]>",next:"key"},o]};for(var x in g){var i=g[x];if(i.splice)for(var a=0,s=i.length;s>a;++a){var k=i[a];"string"==typeof k.regex&&(g[x][a].regex=new RegExp("^"+k.regex))}else"string"==typeof k.regex&&(g[x].regex=new RegExp("^"+i.regex))}e.defineMIME("text/x-livescript","livescript")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/lua/lua.min.js b/media/editors/codemirror/mode/lua/lua.min.js new file mode 100644 index 0000000000000..c5151cdbc35fd --- /dev/null +++ b/media/editors/codemirror/mode/lua/lua.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("lua",function(e,t){function n(e){return new RegExp("^(?:"+e.join("|")+")","i")}function a(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function r(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var n=e.next();return"-"==n&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=i(r(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==n||"'"==n?(t.cur=u(n))(e,t):"["==n&&/[\[=]/.test(e.peek())?(t.cur=i(r(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function i(e,t){return function(n,a){for(var r,i=null;null!=(r=n.next());)if(null==i)"]"==r&&(i=0);else if("="==r)++i;else{if("]"==r&&i==e){a.cur=o;break}i=null}return t}}function u(e){return function(t,n){for(var a,r=!1;null!=(a=t.next())&&(a!=e||r);)r=!r&&"\\"==a;return r||(n.cur=o),"string"}}var l=e.indentUnit,s=a(t.specials||[]),c=a(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),m=a(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),d=a(["function","if","repeat","do","\\(","{"]),g=a(["end","until","\\)","}"]),f=n(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),a=e.current();return"variable"==n&&(m.test(a)?n="keyword":c.test(a)?n="builtin":s.test(a)&&(n="variable-2")),"comment"!=n&&"string"!=n&&(d.test(a)?++t.indentDepth:g.test(a)&&--t.indentDepth),n},indent:function(e,t){var n=f.test(t);return e.basecol+l*(e.indentDepth-(n?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/markdown/markdown.min.js b/media/editors/codemirror/mode/markdown/markdown.min.js new file mode 100644 index 0000000000000..efd4af7d209af --- /dev/null +++ b/media/editors/codemirror/mode/markdown/markdown.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("markdown",function(e,i){function n(i){if(t.findModeByName){var n=t.findModeByName(i);n&&(i=n.mime||n.mimes[0])}var r=t.getMode(e,i);return"null"==r.name?null:r}function r(t,e,i){return e.f=e.inline=i,i(t,e)}function a(t,e,i){return e.f=e.block=i,i(t,e)}function o(t){return t.linkTitle=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,L||t.f!=h||(t.f=m,t.block=l),t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.thisLineHasContent=!1,null}function l(t,e){var a=t.sol(),o=e.list!==!1;e.list!==!1&&e.indentationDiff>=0?(e.indentationDiff<4&&(e.indentation-=e.indentationDiff),e.list=null):e.list!==!1&&e.indentation>0?(e.list=null,e.listDepth=Math.floor(e.indentation/4)):e.list!==!1&&(e.list=!1,e.listDepth=0);var l=null;if(e.indentationDiff>=4)return e.indentation-=4,t.skipToEnd(),M;if(t.eatSpace())return null;if(l=t.match(P))return e.header=l[0].length<=6?l[0].length:6,i.highlightFormatting&&(e.formatting="header"),e.f=e.inline,f(e);if(e.prevLineHasContent&&(l=t.match(z)))return e.header="="==l[0].charAt(0)?1:2,i.highlightFormatting&&(e.formatting="header"),e.f=e.inline,f(e);if(t.eat(">"))return e.indentation++,e.quote=a?1:e.quote+1,i.highlightFormatting&&(e.formatting="quote"),t.eatSpace(),f(e);if("["===t.peek())return r(t,e,p);if(t.match(U,!0))return T;if((!e.prevLineHasContent||o)&&(t.match(R,!1)||t.match(A,!1))){var h=null;return t.match(R,!0)?h="ul":(t.match(A,!0),h="ol"),e.indentation+=4,e.list=!0,e.listDepth++,i.taskLists&&t.match(I,!1)&&(e.taskList=!0),e.f=e.inline,i.highlightFormatting&&(e.formatting=["list","list-"+h]),f(e)}return i.fencedCodeBlocks&&t.match(/^```[ \t]*([\w+#]*)/,!0)?(e.localMode=n(RegExp.$1),e.localMode&&(e.localState=e.localMode.startState()),e.f=e.block=g,i.highlightFormatting&&(e.formatting="code-block"),e.code=!0,f(e)):r(t,e,e.inline)}function h(t,e){var i=F.token(t,e.htmlState);return(L&&null===e.htmlState.tagStart&&!e.htmlState.context||e.md_inside&&t.current().indexOf(">")>-1)&&(e.f=m,e.block=l,e.htmlState=null),i}function g(t,e){return t.sol()&&t.match("```",!1)?(e.localMode=e.localState=null,e.f=e.block=s,null):e.localMode?e.localMode.token(t,e.localState):(t.skipToEnd(),M)}function s(t,e){t.match("```"),e.block=l,e.f=m,i.highlightFormatting&&(e.formatting="code-block"),e.code=!0;var n=f(e);return e.code=!1,n}function f(t){var e=[];if(t.formatting){e.push(y),"string"==typeof t.formatting&&(t.formatting=[t.formatting]);for(var n=0;n=t.quote?y+"-"+t.formatting[n]+"-"+t.quote:"error")}if(t.taskOpen)return e.push("meta"),e.length?e.join(" "):null;if(t.taskClosed)return e.push("property"),e.length?e.join(" "):null;if(t.linkHref)return e.push(O),e.length?e.join(" "):null;if(t.strong&&e.push(E),t.em&&e.push(j),t.strikethrough&&e.push(W),t.linkText&&e.push(N),t.code&&e.push(M),t.header&&(e.push(q),e.push(q+"-"+t.header)),t.quote&&(e.push(w),e.push(!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=t.quote?w+"-"+t.quote:w+"-"+i.maxBlockquoteDepth)),t.list!==!1){var r=(t.listDepth-1)%3;e.push(r?1===r?D:H:C)}return t.trailingSpaceNewLine?e.push("trailing-space-new-line"):t.trailingSpace&&e.push("trailing-space-"+(t.trailingSpace%2?"a":"b")),e.length?e.join(" "):null}function u(t,e){return t.match(G,!0)?f(e):void 0}function m(e,n){var r=n.text(e,n);if("undefined"!=typeof r)return r;if(n.list)return n.list=null,f(n);if(n.taskList){var o="x"!==e.match(I,!0)[1];return o?n.taskOpen=!0:n.taskClosed=!0,i.highlightFormatting&&(n.formatting="task"),n.taskList=!1,f(n)}if(n.taskOpen=!1,n.taskClosed=!1,n.header&&e.match(/^#+$/,!0))return i.highlightFormatting&&(n.formatting="header"),f(n);var l=e.sol(),g=e.next();if("\\"===g&&(e.next(),i.highlightFormatting)){var s=f(n);return s?s+" formatting-escape":"formatting-escape"}if(n.linkTitle){n.linkTitle=!1;var u=g;"("===g&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var m="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(e.match(new RegExp(m),!0))return O}if("`"===g){var k=n.formatting;i.highlightFormatting&&(n.formatting="code");var p=f(n),v=e.pos;e.eatWhile("`");var x=1+e.pos-v;return n.code?x===b?(n.code=!1,p):(n.formatting=k,f(n)):(b=x,n.code=!0,f(n))}if(n.code)return f(n);if("!"===g&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return e.match(/\[[^\]]*\]/),n.inline=n.f=d,B;if("["===g&&e.match(/.*\](\(.*\)| ?\[.*\])/,!1))return n.linkText=!0,i.highlightFormatting&&(n.formatting="link"),f(n);if("]"===g&&n.linkText&&e.match(/\(.*\)| ?\[.*\]/,!1)){i.highlightFormatting&&(n.formatting="link");var s=f(n);return n.linkText=!1,n.inline=n.f=d,s}if("<"===g&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=c,i.highlightFormatting&&(n.formatting="link");var s=f(n);return s?s+=" ":s="",s+_}if("<"===g&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=c,i.highlightFormatting&&(n.formatting="link");var s=f(n);return s?s+=" ":s="",s+$}if("<"===g&&e.match(/^\w/,!1)){if(-1!=e.string.indexOf(">")){var S=e.string.substring(1,e.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(S)&&(n.md_inside=!0)}return e.backUp(1),n.htmlState=t.startState(F),a(e,n,h)}if("<"===g&&e.match(/^\/\w*?>/))return n.md_inside=!1,"tag";var L=!1;if(!i.underscoresBreakWords&&"_"===g&&"_"!==e.peek()&&e.match(/(\w)/,!1)){var q=e.pos-2;if(q>=0){var M=e.string.charAt(q);"_"!==M&&M.match(/(\w)/,!1)&&(L=!0)}}if("*"===g||"_"===g&&!L)if(l&&" "===e.peek());else{if(n.strong===g&&e.eat(g)){i.highlightFormatting&&(n.formatting="strong");var p=f(n);return n.strong=!1,p}if(!n.strong&&e.eat(g))return n.strong=g,i.highlightFormatting&&(n.formatting="strong"),f(n);if(n.em===g){i.highlightFormatting&&(n.formatting="em");var p=f(n);return n.em=!1,p}if(!n.em)return n.em=g,i.highlightFormatting&&(n.formatting="em"),f(n)}else if(" "===g&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return f(n);e.backUp(1)}if(i.strikethrough)if("~"===g&&e.eatWhile(g)){if(n.strikethrough){i.highlightFormatting&&(n.formatting="strikethrough");var p=f(n);return n.strikethrough=!1,p}if(e.match(/^[^\s]/,!1))return n.strikethrough=!0,i.highlightFormatting&&(n.formatting="strikethrough"),f(n)}else if(" "===g&&e.match(/^~~/,!0)){if(" "===e.peek())return f(n);e.backUp(2)}return" "===g&&(e.match(/ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),f(n)}function c(t,e){var n=t.next();if(">"===n){e.f=e.inline=m,i.highlightFormatting&&(e.formatting="link");var r=f(e);return r?r+=" ":r="",r+_}return t.match(/^[^>]+/,!0),_}function d(t,e){if(t.eatSpace())return null;var n=t.next();return"("===n||"["===n?(e.f=e.inline=k("("===n?")":"]"),i.highlightFormatting&&(e.formatting="link-string"),e.linkHref=!0,f(e)):"error"}function k(t){return function(e,n){var r=e.next();if(r===t){n.f=n.inline=m,i.highlightFormatting&&(n.formatting="link-string");var a=f(n);return n.linkHref=!1,a}return e.match(S(t),!0)&&e.backUp(1),n.linkHref=!0,f(n)}}function p(t,e){return t.match(/^[^\]]*\]:/,!1)?(e.f=v,t.next(),i.highlightFormatting&&(e.formatting="link"),e.linkText=!0,f(e)):r(t,e,m)}function v(t,e){if(t.match(/^\]:/,!0)){e.f=e.inline=x,i.highlightFormatting&&(e.formatting="link");var n=f(e);return e.linkText=!1,n}return t.match(/^[^\]]+/,!0),N}function x(t,e){return t.eatSpace()?null:(t.match(/^[^\s]+/,!0),void 0===t.peek()?e.linkTitle=!0:t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),e.f=e.inline=m,O)}function S(t){return J[t]||(t=(t+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),J[t]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+t+")")),J[t]}var L=t.modes.hasOwnProperty("xml"),F=t.getMode(e,L?{name:"xml",htmlMode:!0}:"text/plain");void 0===i.highlightFormatting&&(i.highlightFormatting=!1),void 0===i.maxBlockquoteDepth&&(i.maxBlockquoteDepth=0),void 0===i.underscoresBreakWords&&(i.underscoresBreakWords=!0),void 0===i.fencedCodeBlocks&&(i.fencedCodeBlocks=!1),void 0===i.taskLists&&(i.taskLists=!1),void 0===i.strikethrough&&(i.strikethrough=!1);var b=0,q="header",M="comment",w="quote",C="variable-2",D="variable-3",H="keyword",T="hr",B="tag",y="formatting",_="link",$="link",N="link",O="string",j="em",E="strong",W="strikethrough",U=/^([*\-=_])(?:\s*\1){2,}\s*$/,R=/^[*\-+]\s+/,A=/^[0-9]+\.\s+/,I=/^\[(x| )\](?=\s)/,P=/^#+/,z=/^(?:\={1,}|-{1,})$/,G=/^[^#!\[\]*_\\<>` "'(~]+/,J=[],K={startState:function(){return{f:l,prevLineHasContent:!1,thisLineHasContent:!1,block:l,htmlState:null,indentation:0,inline:m,text:u,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(e){return{f:e.f,prevLineHasContent:e.prevLineHasContent,thisLineHasContent:e.thisLineHasContent,block:e.block,htmlState:e.htmlState&&t.copyState(F,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkTitle:e.linkTitle,em:e.em,strong:e.strong,strikethrough:e.strikethrough,header:e.header,taskList:e.taskList,list:e.list,listDepth:e.listDepth,quote:e.quote,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside}},token:function(t,e){if(e.formatting=!1,t.sol()){var i=!!e.header;if(e.header=0,t.match(/^\s*$/,!0)||i)return e.prevLineHasContent=!1,o(e),i?this.token(t,e):null;e.prevLineHasContent=e.thisLineHasContent,e.thisLineHasContent=!0,e.taskList=!1,e.code=!1,e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.f=e.block;var n=t.match(/^\s*/,!0)[0].replace(/\t/g," ").length,r=4*Math.floor((n-e.indentation)/4);r>4&&(r=4);var a=e.indentation+r;if(e.indentationDiff=a-e.indentation,e.indentation=a,n>0)return null}return e.f(t,e)},innerMode:function(t){return t.block==h?{state:t.htmlState,mode:F}:t.localState?{state:t.localState,mode:t.localMode}:{state:t,mode:K}},blankLine:o,getType:f,fold:"markdown"};return K},"xml"),t.defineMIME("text/x-markdown","markdown")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/markdown/test.min.js b/media/editors/codemirror/mode/markdown/test.min.js new file mode 100644 index 0000000000000..2de7c7ae45bda --- /dev/null +++ b/media/editors/codemirror/mode/markdown/test.min.js @@ -0,0 +1 @@ +!function(){function e(e){test.mode(e,a,Array.prototype.slice.call(arguments,1))}function o(e){test.mode(e,t,Array.prototype.slice.call(arguments,1))}var a=CodeMirror.getMode({tabSize:4},"markdown"),t=CodeMirror.getMode({tabSize:4},{name:"markdown",highlightFormatting:!0});o("formatting_emAsterisk","[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]"),o("formatting_emUnderscore","[em&formatting&formatting-em _][em foo][em&formatting&formatting-em _]"),o("formatting_strongAsterisk","[strong&formatting&formatting-strong **][strong foo][strong&formatting&formatting-strong **]"),o("formatting_strongUnderscore","[strong&formatting&formatting-strong __][strong foo][strong&formatting&formatting-strong __]"),o("formatting_codeBackticks","[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"),o("formatting_doubleBackticks","[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"),o("formatting_atxHeader","[header&header-1&formatting&formatting-header&formatting-header-1 #][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]"),o("formatting_setextHeader","foo","[header&header-1&formatting&formatting-header&formatting-header-1 =]"),o("formatting_blockquote","[quote"e-1&formatting&formatting-quote&formatting-quote-1 > ][quote"e-1 foo]"),o("formatting_list","[variable-2&formatting&formatting-list&formatting-list-ul - ][variable-2 foo]"),o("formatting_list","[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]"),o("formatting_link","[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]"),o("formatting_linkReference","[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]","[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]"),o("formatting_linkWeb","[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]"),o("formatting_linkEmail","[link&formatting&formatting-link <][link user@example.com][link&formatting&formatting-link >]"),o("formatting_escape","[formatting-escape \\*]"),e("plainText","foo"),e("trailingSpace1","foo "),e("trailingSpace2","foo[trailing-space-a ][trailing-space-new-line ]"),e("trailingSpace3","foo[trailing-space-a ][trailing-space-b ][trailing-space-new-line ]"),e("trailingSpace4","foo[trailing-space-a ][trailing-space-b ][trailing-space-a ][trailing-space-new-line ]"),e("codeBlocksUsing4Spaces"," [comment foo]"),e("codeBlocksUsing4SpacesIndentation"," [comment bar]"," [comment hello]"," [comment world]"," [comment foo]","bar"),e("codeBlocksUsing4SpacesIndentation"," foo"," [comment bar]"," [comment hello]"," [comment world]"),e("codeBlocksWithTrailingIndentedLine"," [comment foo]"," [comment bar]"," [comment baz]"," ","hello"),e("codeBlocksUsing1Tab"," [comment foo]"),e("inlineCodeUsingBackticks","foo [comment `bar`]"),e("blockCodeSingleBacktick","[comment `]","foo","[comment `]"),e("unclosedBackticks","foo [comment `bar]"),e("doubleBackticks","[comment ``foo ` bar``]"),e("consecutiveBackticks","[comment `foo```bar`]"),e("consecutiveBackticks","[comment `foo```bar`] hello [comment `world`]"),e("unclosedBackticks","[comment ``foo ``` bar` hello]"),e("closedBackticks","[comment ``foo ``` bar` hello``] world"),e("atxH1","[header&header-1 # foo]"),e("atxH2","[header&header-2 ## foo]"),e("atxH3","[header&header-3 ### foo]"),e("atxH4","[header&header-4 #### foo]"),e("atxH5","[header&header-5 ##### foo]"),e("atxH6","[header&header-6 ###### foo]"),e("atxH6NotH7","[header&header-6 ####### foo]"),e("atxH1inline","[header&header-1 # foo ][header&header-1&em *bar*]"),e("setextH1","foo","[header&header-1 =]"),e("setextH1","foo","[header&header-1 ===]"),e("setextH2","foo","[header&header-2 -]"),e("setextH2","foo","[header&header-2 ---]"),e("blockquoteSpace","[quote"e-1 > foo]"),e("blockquoteNoSpace","[quote"e-1 >foo]"),e("blockquoteNoBlankLine","foo","[quote"e-1 > bar]"),e("blockquoteSpace","[quote"e-1 > foo]","[quote"e-1 >][quote"e-2 > foo]","[quote"e-1 >][quote"e-2 >][quote"e-3 > foo]"),e("blockquoteThenParagraph","[quote"e-1 >foo]","","bar"),e("multiBlockquoteLazy","[quote"e-1 >foo]","[quote"e-1 bar]"),e("multiBlockquoteLazyThenParagraph","[quote"e-1 >foo]","[quote"e-1 bar]","","hello"),e("multiBlockquote","[quote"e-1 >foo]","[quote"e-1 >bar]"),e("multiBlockquoteThenParagraph","[quote"e-1 >foo]","[quote"e-1 >bar]","","hello"),e("listAsterisk","foo","bar","","[variable-2 * foo]","[variable-2 * bar]"),e("listPlus","foo","bar","","[variable-2 + foo]","[variable-2 + bar]"),e("listDash","foo","bar","","[variable-2 - foo]","[variable-2 - bar]"),e("listNumber","foo","bar","","[variable-2 1. foo]","[variable-2 2. bar]"),e("listBogus","foo","1. bar","2. hello"),e("listAfterHeader","[header&header-1 # foo]","[variable-2 - bar]"),e("listAsteriskFormatting","[variable-2 * ][variable-2&em *foo*][variable-2 bar]","[variable-2 * ][variable-2&strong **foo**][variable-2 bar]","[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 * ][variable-2&comment `foo`][variable-2 bar]"),e("listPlusFormatting","[variable-2 + ][variable-2&em *foo*][variable-2 bar]","[variable-2 + ][variable-2&strong **foo**][variable-2 bar]","[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 + ][variable-2&comment `foo`][variable-2 bar]"),e("listDashFormatting","[variable-2 - ][variable-2&em *foo*][variable-2 bar]","[variable-2 - ][variable-2&strong **foo**][variable-2 bar]","[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 - ][variable-2&comment `foo`][variable-2 bar]"),e("listNumberFormatting","[variable-2 1. ][variable-2&em *foo*][variable-2 bar]","[variable-2 2. ][variable-2&strong **foo**][variable-2 bar]","[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 4. ][variable-2&comment `foo`][variable-2 bar]"),e("listParagraph","[variable-2 * foo]","","[variable-2 * bar]"),e("listMultiParagraph","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2 hello]"),e("listMultiParagraphExtra","[variable-2 * foo]","","[variable-2 * bar]","",""," [variable-2 hello]"),e("listMultiParagraphExtraSpace","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2 hello]",""," [variable-2 world]"),e("listTab","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2 hello]"),e("listNoIndent","[variable-2 * foo]","","[variable-2 * bar]","","hello"),e("blockquote","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2"e"e-1 > hello]"),e("blockquoteCode","[variable-2 * foo]","","[variable-2 * bar]",""," [comment > hello]",""," [variable-2 world]"),e("blockquoteCodeText","[variable-2 * foo]",""," [variable-2 bar]",""," [comment hello]",""," [variable-2 world]"),e("listAsteriskNested","[variable-2 * foo]",""," [variable-3 * bar]"),e("listPlusNested","[variable-2 + foo]",""," [variable-3 + bar]"),e("listDashNested","[variable-2 - foo]",""," [variable-3 - bar]"),e("listNumberNested","[variable-2 1. foo]",""," [variable-3 2. bar]"),e("listMixed","[variable-2 * foo]",""," [variable-3 + bar]",""," [keyword - hello]",""," [variable-2 1. world]"),e("listBlockquote","[variable-2 * foo]",""," [variable-3 + bar]",""," [quote"e-1&variable-3 > hello]"),e("listCode","[variable-2 * foo]",""," [variable-3 + bar]",""," [comment hello]"),e("listCodeIndentation","[variable-2 * foo]",""," [comment bar]"," [comment hello]"," [comment world]"," [comment foo]"," [variable-2 bar]"),e("listNested","[variable-2 * foo]",""," [variable-3 * bar]",""," [variable-2 hello]"),e("listNested","[variable-2 * foo]",""," [variable-3 * bar]",""," [variable-3 * foo]"),e("listCodeText","[variable-2 * foo]",""," [comment bar]","","hello"),e("hrSpace","[hr * * *]"),e("hr","[hr ***]"),e("hrLong","[hr *****]"),e("hrSpaceDash","[hr - - -]"),e("hrDashLong","[hr ---------------------------------------]"),e("linkTitle",'[link [[foo]]][string (http://example.com/ "bar")] hello'),e("linkNoTitle","[link [[foo]]][string (http://example.com/)] bar"),e("linkImage","[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar"),e("linkEm","[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar"),e("linkStrong","[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar"),e("linkEmStrong","[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar"),e("imageTitle",'[tag ![[foo]]][string (http://example.com/ "bar")] hello'),e("imageNoTitle","[tag ![[foo]]][string (http://example.com/)] bar"),e("imageAsterisks","[tag ![[*foo*]]][string (http://example.com/)] bar"),e("notALink","[[foo]] (bar)"),e("linkReference","[link [[foo]]][string [[bar]]] hello"),e("linkReferenceEm","[link [[][link&em *foo*][link ]]][string [[bar]]] hello"),e("linkReferenceStrong","[link [[][link&strong **foo**][link ]]][string [[bar]]] hello"),e("linkReferenceEmStrong","[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello"),e("linkReferenceSpace","[link [[foo]]] [string [[bar]]] hello"),e("linkReferenceDoubleSpace","[[foo]] [[bar]] hello"),e("linkImplicit","[link [[foo]]][string [[]]] hello"),e("labelNoTitle","[link [[foo]]:] [string http://example.com/]"),e("labelIndented"," [link [[foo]]:] [string http://example.com/]"),e("labelSpaceTitle",'[link [[foo bar]]:] [string http://example.com/ "hello"]'),e("labelDoubleTitle",'[link [[foo bar]]:] [string http://example.com/ "hello"] "world"'),e("labelTitleDoubleQuotes",'[link [[foo]]:] [string http://example.com/ "bar"]'),e("labelTitleSingleQuotes","[link [[foo]]:] [string http://example.com/ 'bar']"),e("labelTitleParenthese","[link [[foo]]:] [string http://example.com/ (bar)]"),e("labelTitleInvalid","[link [[foo]]:] [string http://example.com/] bar"),e("labelLinkAngleBrackets",'[link [[foo]]:] [string "bar"]'),e("labelTitleNextDoubleQuotes","[link [[foo]]:] [string http://example.com/]",'[string "bar"] hello'),e("labelTitleNextSingleQuotes","[link [[foo]]:] [string http://example.com/]","[string 'bar'] hello"),e("labelTitleNextParenthese","[link [[foo]]:] [string http://example.com/]","[string (bar)] hello"),e("labelTitleNextMixed","[link [[foo]]:] [string http://example.com/]",'(bar" hello'),e("linkWeb","[link ] foo"),e("linkWebDouble","[link ] foo [link ]"),e("linkEmail","[link ] foo"),e("linkEmailDouble","[link ] foo [link ]"),e("emAsterisk","[em *foo*] bar"),e("emUnderscore","[em _foo_] bar"),e("emInWordAsterisk","foo[em *bar*]hello"),e("emInWordUnderscore","foo[em _bar_]hello"),e("emEscapedBySpaceIn","foo [em _bar _ hello_] world"),e("emEscapedBySpaceOut","foo _ bar[em _hello_]world"),e("emEscapedByNewline","foo","_ bar[em _hello_]world"),e("emIncompleteAsterisk","foo [em *bar]"),e("emIncompleteUnderscore","foo [em _bar]"),e("strongAsterisk","[strong **foo**] bar"),e("strongUnderscore","[strong __foo__] bar"),e("emStrongAsterisk","[em *foo][em&strong **bar*][strong hello**] world"),e("emStrongUnderscore","[em _foo][em&strong __bar_][strong hello__] world"),e("emStrongMixed","[em _foo][em&strong **bar*hello__ world]"),e("emStrongMixed","[em *foo][em&strong __bar_hello** world]"),e("escapeBacktick","foo \\`bar\\`"),e("doubleEscapeBacktick","foo \\\\[comment `bar\\\\`]"),e("escapeAsterisk","foo \\*bar\\*"),e("doubleEscapeAsterisk","foo \\\\[em *bar\\\\*]"),e("escapeUnderscore","foo \\_bar\\_"),e("doubleEscapeUnderscore","foo \\\\[em _bar\\\\_]"),e("escapeHash","\\# foo"),e("doubleEscapeHash","\\\\# foo"),e("escapeNewline","\\","[em *foo*]"),e("taskList","[variable-2 * [ ]] bar]"),e("fencedCodeBlocks","[comment ```]","foo","[comment ```]"),e("xmlMode","[tag&bracket <][tag div][tag&bracket >]","*foo*","[tag&bracket <][tag http://github.com][tag&bracket />]","[tag&bracket ]","[link ]"),e("xmlModeWithMarkdownInside","[tag&bracket <][tag div] [attribute markdown]=[string 1][tag&bracket >]","[em *foo*]","[link ]","[tag
]","[link ]","[tag&bracket <][tag div][tag&bracket >]","[tag&bracket ]")}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/meta.js b/media/editors/codemirror/mode/meta.js index 8d91df7d77c47..e110288afc512 100644 --- a/media/editors/codemirror/mode/meta.js +++ b/media/editors/codemirror/mode/meta.js @@ -38,6 +38,7 @@ {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]}, {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]}, + {name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]}, {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]}, {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]}, {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]}, diff --git a/media/editors/codemirror/mode/meta.min.js b/media/editors/codemirror/mode/meta.min.js new file mode 100644 index 0000000000000..fb300fdccfff6 --- /dev/null +++ b/media/editors/codemirror/mode/meta.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj"]},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"kotlin",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["py","pyw"]},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"]},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"SmartyMixed",mime:"text/x-smarty",mode:"smartymixed"},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"MariaDB",mime:"text/x-mariadb",mode:"sql"},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]}];for(var m=0;m-1&&m.substring(i+1,m.length);return x?e.findModeByExtension(x):void 0},e.findModeByName=function(m){m=m.toLowerCase();for(var t=0;t!?^\/\|]/;return{startState:function(){return{tokenize:$,beforeParams:!1,inParams:!1}},token:function(e,i){return e.eatSpace()?null:i.tokenize(e,i)}}})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/mllike/mllike.min.js b/media/editors/codemirror/mode/mllike/mllike.min.js new file mode 100644 index 0000000000000..df8d59dee4fcb --- /dev/null +++ b/media/editors/codemirror/mode/mllike/mllike.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("mllike",function(e,r){function t(e,t){var d=e.next();if('"'===d)return t.tokenize=o,t.tokenize(e,t);if("("===d&&e.eat("*"))return t.commentLevel++,t.tokenize=n,t.tokenize(e,t);if("~"===d)return e.eatWhile(/\w/),"variable-2";if("`"===d)return e.eatWhile(/\w/),"quote";if("/"===d&&r.slashComments&&e.eat("/"))return e.skipToEnd(),"comment";if(/\d/.test(d))return e.eatWhile(/[\d]/),e.eat(".")&&e.eatWhile(/[\d]/),"number";if(/[+\-*&%=<>!?|]/.test(d))return"operator";e.eatWhile(/\w/);var l=e.current();return i[l]||"variable"}function o(e,r){for(var o,n=!1,i=!1;null!=(o=e.next());){if('"'===o&&!i){n=!0;break}i=!i&&"\\"===o}return n&&!i&&(r.tokenize=t),"string"}function n(e,r){for(var o,n;r.commentLevel>0&&null!=(n=e.next());)"("===o&&"*"===n&&r.commentLevel++,"*"===o&&")"===n&&r.commentLevel--,o=n;return r.commentLevel<=0&&(r.tokenize=t),"comment"}var i={let:"keyword",rec:"keyword","in":"keyword",of:"keyword",and:"keyword","if":"keyword",then:"keyword","else":"keyword","for":"keyword",to:"keyword","while":"keyword","do":"keyword",done:"keyword",fun:"keyword","function":"keyword",val:"keyword",type:"keyword",mutable:"keyword",match:"keyword","with":"keyword","try":"keyword",open:"builtin",ignore:"builtin",begin:"keyword",end:"keyword"},d=r.extraWords||{};for(var l in d)d.hasOwnProperty(l)&&(i[l]=r.extraWords[l]);return{startState:function(){return{tokenize:t,commentLevel:0}},token:function(e,r){return e.eatSpace()?null:r.tokenize(e,r)},blockCommentStart:"(*",blockCommentEnd:"*)",lineComment:r.slashComments?"//":null}}),e.defineMIME("text/x-ocaml",{name:"mllike",extraWords:{succ:"keyword",trace:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin","true":"atom","false":"atom",raise:"keyword"}}),e.defineMIME("text/x-fsharp",{name:"mllike",extraWords:{"abstract":"keyword",as:"keyword",assert:"keyword",base:"keyword","class":"keyword","default":"keyword",delegate:"keyword",downcast:"keyword",downto:"keyword",elif:"keyword",exception:"keyword",extern:"keyword","finally":"keyword",global:"keyword",inherit:"keyword",inline:"keyword","interface":"keyword",internal:"keyword",lazy:"keyword","let!":"keyword",member:"keyword",module:"keyword",namespace:"keyword","new":"keyword","null":"keyword",override:"keyword","private":"keyword","public":"keyword","return":"keyword","return!":"keyword",select:"keyword","static":"keyword",struct:"keyword",upcast:"keyword",use:"keyword","use!":"keyword",val:"keyword",when:"keyword","yield":"keyword","yield!":"keyword",List:"builtin",Seq:"builtin",Map:"builtin",Set:"builtin","int":"builtin",string:"builtin",raise:"builtin",failwith:"builtin",not:"builtin","true":"builtin","false":"builtin"},slashComments:!0})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/modelica/modelica.min.js b/media/editors/codemirror/mode/modelica/modelica.min.js new file mode 100644 index 0000000000000..bd9f492a9854d --- /dev/null +++ b/media/editors/codemirror/mode/modelica/modelica.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r0&&t.level--:t.level++,t.tokenize=null,t.sol=!1,c.propertyIsEnumerable(n)?"keyword":f.propertyIsEnumerable(n)?"builtin":p.propertyIsEnumerable(n)?"atom":"variable"}function a(e,t){for(;e.eat(/[^']/););return t.tokenize=null,t.sol=!1,e.eat("'")?"variable":"error"}function u(e,t){return e.eatWhile(k),e.eat(".")&&e.eatWhile(k),(e.eat("e")||e.eat("E"))&&(e.eat("-")||e.eat("+"),e.eatWhile(k)),t.tokenize=null,t.sol=!1,"number"}var s=t.indentUnit,c=n.keywords||{},f=n.builtin||{},p=n.atoms||{},d=/[;=\(:\),{}.*<>+\-\/^\[\]]/,m=/(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/,k=/[0-9]/,b=/[_a-zA-Z]/;return{startState:function(){return{tokenize:null,level:0,sol:!0}},token:function(e,t){if(null!=t.tokenize)return t.tokenize(e,t);if(e.sol()&&(t.sol=!0),e.eatSpace())return t.tokenize=null,null;var n=e.next();if("/"==n&&e.eat("/"))t.tokenize=r;else if("/"==n&&e.eat("*"))t.tokenize=o;else{if(m.test(n+e.peek()))return e.next(),t.tokenize=null,"operator";if(d.test(n))return t.tokenize=null,"operator";if(b.test(n))t.tokenize=l;else if("'"==n&&e.peek()&&"'"!=e.peek())t.tokenize=a;else if('"'==n)t.tokenize=i;else{if(!k.test(n))return t.tokenize=null,"error";t.tokenize=u}}return t.tokenize(e,t)},indent:function(t,n){if(null!=t.tokenize)return e.Pass;var r=t.level;return/(algorithm)/.test(n)&&r--,/(equation)/.test(n)&&r--,/(initial algorithm)/.test(n)&&r--,/(initial equation)/.test(n)&&r--,/(end)/.test(n)&&r--,r>0?s*r:0},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});var r="algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within",o="abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh",i="Real Boolean Integer String";n(["text/x-modelica"],{name:"modelica",keywords:t(r),builtin:t(o),atoms:t(i)})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/nginx/nginx.min.js b/media/editors/codemirror/mode/nginx/nginx.min.js new file mode 100644 index 0000000000000..9aaa18c8c2857 --- /dev/null +++ b/media/editors/codemirror/mode/nginx/nginx.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("nginx",function(e){function _(e){for(var _={},t=e.split(" "),i=0;i*\/]/.test(o)?t(null,"select-op"):/[;{}:\[\]]/.test(o)?t(null,o):(e.eatWhile(/[\w\\\-]/),t("variable","variable")):t(null,"compare"):void t(null,"compare")}function r(e,_){for(var r,s=!1;null!=(r=e.next());){if(s&&"/"==r){_.tokenize=i;break}s="*"==r}return t("comment","comment")}function s(e,_){for(var r,s=0;null!=(r=e.next());){if(s>=2&&">"==r){_.tokenize=i;break}s="-"==r?s+1:0}return t("comment","comment")}function a(e){return function(_,r){for(var s,a=!1;null!=(s=_.next())&&(s!=e||a);)a=!a&&"\\"==s;return a||(r.tokenize=i),t("string","string")}}var o,n=_("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=_("http mail events server types location upstream charset_map limit_except if geo map"),l=_("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),p=e.indentUnit;return{startState:function(e){return{tokenize:i,baseIndent:e||0,stack:[]}},token:function(e,_){if(e.eatSpace())return null;o=null;var t=_.tokenize(e,_),i=_.stack[_.stack.length-1];return"hash"==o&&"rule"==i?t="atom":"variable"==t&&("rule"==i?t="number":i&&"@media{"!=i||(t="tag")),"rule"==i&&/^[\{\};]$/.test(o)&&_.stack.pop(),"{"==o?"@media"==i?_.stack[_.stack.length-1]="@media{":_.stack.push("{"):"}"==o?_.stack.pop():"@media"==o?_.stack.push("@media"):"{"==i&&"comment"!=o&&_.stack.push("rule"),t},indent:function(e,_){var t=e.stack.length;return/^\}/.test(_)&&(t-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+t*p},electricChars:"}"}}),e.defineMIME("text/nginx","text/x-nginx-conf")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/ntriples/ntriples.min.js b/media/editors/codemirror/mode/ntriples/ntriples.min.js new file mode 100644 index 0000000000000..2f03eedf4ef10 --- /dev/null +++ b/media/editors/codemirror/mode/ntriples/ntriples.min.js @@ -0,0 +1 @@ +!function(_){"object"==typeof exports&&"object"==typeof module?_(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],_):_(CodeMirror)}(function(_){"use strict";_.defineMode("ntriples",function(){function _(_,I){var R,n=_.location;R=n==e.PRE_SUBJECT&&"<"==I?e.WRITING_SUB_URI:n==e.PRE_SUBJECT&&"_"==I?e.WRITING_BNODE_URI:n==e.PRE_PRED&&"<"==I?e.WRITING_PRED_URI:n==e.PRE_OBJ&&"<"==I?e.WRITING_OBJ_URI:n==e.PRE_OBJ&&"_"==I?e.WRITING_OBJ_BNODE:n==e.PRE_OBJ&&'"'==I?e.WRITING_OBJ_LITERAL:n==e.WRITING_SUB_URI&&">"==I?e.PRE_PRED:n==e.WRITING_BNODE_URI&&" "==I?e.PRE_PRED:n==e.WRITING_PRED_URI&&">"==I?e.PRE_OBJ:n==e.WRITING_OBJ_URI&&">"==I?e.POST_OBJ:n==e.WRITING_OBJ_BNODE&&" "==I?e.POST_OBJ:n==e.WRITING_OBJ_LITERAL&&'"'==I?e.POST_OBJ:n==e.WRITING_LIT_LANG&&" "==I?e.POST_OBJ:n==e.WRITING_LIT_TYPE&&">"==I?e.POST_OBJ:n==e.WRITING_OBJ_LITERAL&&"@"==I?e.WRITING_LIT_LANG:n==e.WRITING_OBJ_LITERAL&&"^"==I?e.WRITING_LIT_TYPE:" "!=I||n!=e.PRE_SUBJECT&&n!=e.PRE_PRED&&n!=e.PRE_OBJ&&n!=e.POST_OBJ?n==e.POST_OBJ&&"."==I?e.PRE_SUBJECT:e.ERROR:n,_.location=R}var e={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};return{startState:function(){return{location:e.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(e,I){var R=e.next();if("<"==R){_(I,R);var n="";return e.eatWhile(function(_){return"#"!=_&&">"!=_?(n+=_,!0):!1}),I.uris.push(n),e.match("#",!1)?"variable":(e.next(),_(I,">"),"variable")}if("#"==R){var t="";return e.eatWhile(function(_){return">"!=_&&" "!=_?(t+=_,!0):!1}),I.anchors.push(t),"variable-2"}if(">"==R)return _(I,">"),"variable";if("_"==R){_(I,R);var r="";return e.eatWhile(function(_){return" "!=_?(r+=_,!0):!1}),I.bnodes.push(r),e.next(),_(I," "),"builtin"}if('"'==R)return _(I,R),e.eatWhile(function(_){return'"'!=_}),e.next(),"@"!=e.peek()&&"^"!=e.peek()&&_(I,'"'),"string";if("@"==R){_(I,"@");var i="";return e.eatWhile(function(_){return" "!=_?(i+=_,!0):!1}),I.langs.push(i),e.next(),_(I," "),"string-2"}if("^"==R){e.next(),_(I,"^");var T="";return e.eatWhile(function(_){return">"!=_?(T+=_,!0):!1}),I.types.push(T),e.next(),_(I,">"),"variable"}" "==R&&_(I,R),"."==R&&_(I,R)}}}),_.defineMIME("text/n-triples","ntriples")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/octave/octave.min.js b/media/editors/codemirror/mode/octave/octave.min.js new file mode 100644 index 0000000000000..622383af47d33 --- /dev/null +++ b/media/editors/codemirror/mode/octave/octave.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("octave",function(){function e(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e,n){return e.sol()||"'"!==e.peek()?(n.tokenize=r,r(e,n)):(e.next(),n.tokenize=r,"operator")}function t(e,n){return e.match(/^.*%}/)?(n.tokenize=r,"comment"):(e.skipToEnd(),"comment")}function r(d,p){if(d.eatSpace())return null;if(d.match("%{"))return p.tokenize=t,d.skipToEnd(),"comment";if(d.match(/^[%#]/))return d.skipToEnd(),"comment";if(d.match(/^[0-9\.+-]/,!1)){if(d.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return d.tokenize=r,"number";if(d.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/))return"number";if(d.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}return d.match(e(["nan","NaN","inf","Inf"]))?"number":d.match(/^"([^"]|(""))*"/)?"string":d.match(/^'([^']|(''))*'/)?"string":d.match(l)?"keyword":d.match(s)?"builtin":d.match(u)?"variable":d.match(i)||d.match(a)?"operator":d.match(o)||d.match(c)||d.match(m)?null:d.match(f)?(p.tokenize=n,null):(d.next(),"error")}var i=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),o=new RegExp("^[\\(\\[\\{\\},:=;]"),a=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),c=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),m=new RegExp("^((>>=)|(<<=))"),f=new RegExp("^[\\]\\)]"),u=new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*"),s=e(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),l=e(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);return{startState:function(){return{tokenize:r}},token:function(e,t){var r=t.tokenize(e,t);return("number"===r||"variable"===r)&&(t.tokenize=n),r}}}),e.defineMIME("text/x-octave","octave")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/pascal/pascal.min.js b/media/editors/codemirror/mode/pascal/pascal.min.js new file mode 100644 index 0000000000000..a58c8bd25ebce --- /dev/null +++ b/media/editors/codemirror/mode/pascal/pascal.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("pascal",function(){function e(e){for(var t={},r=e.split(" "),n=0;n!?|\/]/;return{startState:function(){return{tokenize:null}},token:function(e,r){if(e.eatSpace())return null;var n=(r.tokenize||t)(e,r);return"comment"==n||"meta"==n?n:n},electricChars:"{}"}}),e.defineMIME("text/x-pascal","pascal")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/pegjs/pegjs.min.js b/media/editors/codemirror/mode/pegjs/pegjs.min.js new file mode 100644 index 0000000000000..af0359eb24b41 --- /dev/null +++ b/media/editors/codemirror/mode/pegjs/pegjs.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("pegjs",function(t){function n(e){return e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)}var r=e.getMode(t,"javascript");return{startState:function(){return{inString:!1,stringType:null,inComment:!1,inChracterClass:!1,braced:0,lhs:!0,localState:null}},token:function(e,t){if(e&&(t.inString||t.inComment||'"'!=e.peek()&&"'"!=e.peek()||(t.stringType=e.peek(),e.next(),t.inString=!0)),t.inString||t.inComment||!e.match(/^\/\*/)||(t.inComment=!0),t.inString){for(;t.inString&&!e.eol();)e.peek()===t.stringType?(e.next(),t.inString=!1):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string"}if(t.inComment){for(;t.inComment&&!e.eol();)e.match(/\*\//)?t.inComment=!1:e.match(/^.[^\*]*/);return"comment"}if(t.inChracterClass)for(;t.inChracterClass&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(/^\\./)||(t.inChracterClass=!1);else{if("["===e.peek())return e.next(),t.inChracterClass=!0,"bracket";if(e.match(/^\/\//))return e.skipToEnd(),"comment";if(t.braced||"{"===e.peek()){null===t.localState&&(t.localState=r.startState());var i=r.token(e,t.localState),a=e.current();if(!i)for(var o=0;o=0?r:0,t)}return e.string.substr(0,e.pos-1)}function n(e,t){var r=e.string.length,n=r-e.pos+1;return e.string.substr(e.pos,t&&r>t?t:n)}function i(e,t){var r,n=e.pos+t;e.pos=0>=n?0:n>=(r=e.string.length-1)?r:n}e.defineMode("perl",function(){function e(e,t,r,n,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var s,o=!1,u=0;s=e.next();){if(s===r[u]&&!o)return void 0!==r[++u]?(t.chain=r[u],t.style=n,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,n;o=!o&&"\\"==s}return n},t.tokenize(e,t)}function s(e,t,r){return t.tokenize=function(e,t){return e.string==r&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,l){if(a.eatSpace())return null;if(l.chain)return e(a,l,l.chain,l.style,l.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),s(a,l,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return s(a,l,"=cut");var f=a.next();if('"'==f||"'"==f){if(r(a,3)=="<<"+f){var E=a.pos;a.eatWhile(/\w/);var R=a.current().substr(1);if(R&&a.eat(f))return s(a,l,R);a.pos=E}return e(a,l,[f],"string")}if("q"==f){var c=t(a,-2);if(!c||!/\w/.test(c))if(c=t(a,0),"x"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],u,$);if("["==c)return i(a,2),e(a,l,["]"],u,$);if("{"==c)return i(a,2),e(a,l,["}"],u,$);if("<"==c)return i(a,2),e(a,l,[">"],u,$);if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],u,$)}else if("q"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],"string");if("["==c)return i(a,2),e(a,l,["]"],"string");if("{"==c)return i(a,2),e(a,l,["}"],"string");if("<"==c)return i(a,2),e(a,l,[">"],"string");if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],"string")}else if("w"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],"bracket");if("["==c)return i(a,2),e(a,l,["]"],"bracket");if("{"==c)return i(a,2),e(a,l,["}"],"bracket");if("<"==c)return i(a,2),e(a,l,[">"],"bracket");if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],"bracket")}else if("r"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],u,$);if("["==c)return i(a,2),e(a,l,["]"],u,$);if("{"==c)return i(a,2),e(a,l,["}"],u,$);if("<"==c)return i(a,2),e(a,l,[">"],u,$);if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],u,$)}else if(/[\^'"!~\/(\[{<]/.test(c)){if("("==c)return i(a,1),e(a,l,[")"],"string");if("["==c)return i(a,1),e(a,l,["]"],"string");if("{"==c)return i(a,1),e(a,l,["}"],"string");if("<"==c)return i(a,1),e(a,l,[">"],"string");if(/[\^'"!~\/]/.test(c))return e(a,l,[a.eat(c)],"string")}}if("m"==f){var c=t(a,-2);if((!c||!/\w/.test(c))&&(c=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(c))return e(a,l,[c],u,$);if("("==c)return e(a,l,[")"],u,$);if("["==c)return e(a,l,["]"],u,$);if("{"==c)return e(a,l,["}"],u,$);if("<"==c)return e(a,l,[">"],u,$)}}if("s"==f){var c=/[\/>\]})\w]/.test(t(a,-2));if(!c&&(c=a.eat(/[(\[{<\^'"!~\/]/)))return"["==c?e(a,l,["]","]"],u,$):"{"==c?e(a,l,["}","}"],u,$):"<"==c?e(a,l,[">",">"],u,$):"("==c?e(a,l,[")",")"],u,$):e(a,l,[c,c],u,$)}if("y"==f){var c=/[\/>\]})\w]/.test(t(a,-2));if(!c&&(c=a.eat(/[(\[{<\^'"!~\/]/)))return"["==c?e(a,l,["]","]"],u,$):"{"==c?e(a,l,["}","}"],u,$):"<"==c?e(a,l,[">",">"],u,$):"("==c?e(a,l,[")",")"],u,$):e(a,l,[c,c],u,$)}if("t"==f){var c=/[\/>\]})\w]/.test(t(a,-2));if(!c&&(c=a.eat("r"),c&&(c=a.eat(/[(\[{<\^'"!~\/]/))))return"["==c?e(a,l,["]","]"],u,$):"{"==c?e(a,l,["}","}"],u,$):"<"==c?e(a,l,[">",">"],u,$):"("==c?e(a,l,[")",")"],u,$):e(a,l,[c,c],u,$)}if("`"==f)return e(a,l,[f],"variable-2");if("/"==f)return/~\s*$/.test(r(a))?e(a,l,[f],u,$):"operator";if("$"==f){var E=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=E}if(/[$@%]/.test(f)){var E=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(t(a,-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var c=a.current();if(o[c])return"variable-2"}a.pos=E}if(/[$@%&]/.test(f)&&(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}"))){var c=a.current();return o[c]?"variable-2":"variable"}if("#"==f&&"$"!=t(a,-2))return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(f)){var E=a.pos;if(a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),o[a.current()])return"operator";a.pos=E}if("_"==f&&1==a.pos){if("_END__"==n(a,6))return e(a,l,["\x00"],"comment");if("_DATA__"==n(a,7))return e(a,l,["\x00"],"variable-2");if("_C__"==n(a,7))return e(a,l,["\x00"],"string")}if(/\w/.test(f)){var E=a.pos;if("{"==t(a,-2)&&("}"==t(a,0)||a.eatWhile(/\w/)&&"}"==t(a,0)))return"string";a.pos=E}if(/[A-Z]/.test(f)){var p=t(a,-2),E=a.pos;if(a.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(a,0))){var c=o[a.current()];return c?(c[1]&&(c=c[0]),":"!=p?1==c?"keyword":2==c?"def":3==c?"atom":4==c?"operator":5==c?"variable-2":"meta":"meta"):"meta"}a.pos=E}if(/[a-zA-Z_]/.test(f)){var p=t(a,-2);a.eatWhile(/\w/);var c=o[a.current()];return c?(c[1]&&(c=c[0]),":"!=p?1==c?"keyword":2==c?"def":3==c?"atom":4==c?"operator":5==c?"variable-2":"meta":"meta"):"meta"}return null}var o={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},u="string-2",$=/[goseximacplud]/;return{startState:function(){return{tokenize:a,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||a)(e,t)},lineComment:"#"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/php/php.min.js b/media/editors/codemirror/mode/php/php.min.js new file mode 100644 index 0000000000000..9e87aa41d1525 --- /dev/null +++ b/media/editors/codemirror/mode/php/php.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},_=e.split(" "),r=0;r<_.length;++r)t[_[r]]=!0;return t}function _(e,t){return 0==e.length?r(t):function(s,i){for(var l=e[0],n=0;n\w/,!1)&&(t.tokenize=_([[["->",null]],[[/[\w]+/,"variable"]]],r)),"variable-2";for(var s=!1;!e.eol()&&(s||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!s&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}s="\\"==e.next()&&!s}return"string"}var i="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",l="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",n="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[i,l,n].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var a={name:"clike",helperType:"php",keywords:t(i),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),atoms:t(l),builtin:t(n),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){if(e.match(/<",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,_){function r(e,t){var _=t.curMode==i;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),_)return _&&null==t.php.tokenize&&e.match("?>")?(t.curMode=s,t.curState=t.html,"meta"):i.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=i,t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var r="string"}else if(t.pending&&e.pos/.test(n)?l[0]:{end:e.pos,style:r},e.backUp(n.length-a)),r}var s=e.getMode(t,"text/html"),i=e.getMode(t,a);return{startState:function(){var t=e.startState(s),r=e.startState(i);return{html:t,php:r,curMode:_.startOpen?i:s,curState:_.startOpen?r:t,pending:null}},copyState:function(t){var _,r=t.html,l=e.copyState(s,r),n=t.php,a=e.copyState(i,n);return _=t.curMode==s?l:a,{html:l,php:a,curMode:t.curMode,curState:_,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=i&&/^\s*<\//.test(t)||e.curMode==i&&/^\?>/.test(t)?s.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",a)}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/php/test.min.js b/media/editors/codemirror/mode/php/test.min.js new file mode 100644 index 0000000000000..d2eaa55225bb4 --- /dev/null +++ b/media/editors/codemirror/mode/php/test.min.js @@ -0,0 +1 @@ +!function(){function a(a){test.mode(a,o,Array.prototype.slice.call(arguments,1))}function e(a,e,r){for(var o=[e],i=1;r>=i;++i)o[i]=a.join(o[i-1]);return o}function r(a,e,r,o,i){for(var t=[o],n=1;i>=n;++n)t[n]=r[0]+a[n-1]+r[1]+e[n-1]+r[2]+t[n-1]+r[3];return t}var o=CodeMirror.getMode({indentUnit:2},"php");a("simple_test",'[meta ]'),a("variable_interpolation_non_alphanumeric","[meta $/$\\$}$\\"$:$;$?$|$[[$]]$+$=aaa"]',"[meta ?>]"),a("variable_interpolation_digits","[meta ]"),a("variable_interpolation_simple_syntax_1","[meta ]"),a("variable_interpolation_simple_syntax_2","[meta ]"),a("variable_interpolation_simple_syntax_3","[meta [variable aaaaa][string .aaaaaa"];','[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];','[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];','[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];',"[meta ?>]"),a("variable_interpolation_escaping","[meta aaa.aaa"];','[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];','[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];','[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];','[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];','[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];','[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];','[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];','[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];',"[meta ?>]"),a("variable_interpolation_complex_syntax_1","[meta aaa.aaa"];','[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];','[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][['," [number 42]",']]}[string ->aaa.aaa"];','[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa'),a("variable_interpolation_complex_syntax_2","[meta } $aaaaaa.aaa"];','[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];','[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];');var i=e(['[string "][variable-2 $]{[variable aaa] [operator +] ','}[string "]'],'[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]',10);a("variable_interpolation_complex_syntax_3_1","[meta ]");var t=e(['[string "a][variable-2 $]{[variable aaa] [operator +] '," [operator +] ",'}[string .a"]'],'[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]',5);a("variable_interpolation_complex_syntax_3_2","[meta ]");var n=r(i,t,['[string "a][variable-2 $]{[variable aaa] [operator +] '," [operator +] "," [operator +] ",'}[string .a"]'],'[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]',4);a("variable_interpolation_complex_syntax_3_3","[meta ]"),a("variable_interpolation_heredoc","[meta =&?:\/!|]/;return{startState:function(){return{tokenize:I,startOfLine:!0}},token:function(e,O){if(e.eatSpace())return null;var T=O.tokenize(e,O);return T}}}),function(){function O(e){for(var O={},T=e.split(" "),E=0;E.*/,!1),s=e.match(/(\s+)?[\w:_]+(\s+)?{/,!1),c=e.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/,!1),u=e.next();if("$"===u)return e.match(o)?t.continueString?"variable-2":"variable":"error";if(t.continueString)return e.backUp(1),n(e,t);if(t.inDefinition){if(e.match(/(\s+)?[\w:_]+(\s+)?/))return"def";e.match(/\s+{/),t.inDefinition=!1}return t.inInclude?(e.match(/(\s+)?\S+(\s+)?/),t.inInclude=!1,"def"):e.match(/(\s+)?\w+\(/)?(e.backUp(1),"def"):r?(e.match(/(\s+)?\w+/),"tag"):a&&i.hasOwnProperty(a)?(e.backUp(1),e.match(/[\w]+/),e.match(/\s+\S+\s+{/,!1)&&(t.inDefinition=!0),"include"==a&&(t.inInclude=!0),i[a]):/(^|\s+)[A-Z][\w:_]+/.test(a)?(e.backUp(1),e.match(/(^|\s+)[A-Z][\w:_]+/),"def"):s?(e.match(/(\s+)?[\w:_]+/),"def"):c?(e.match(/(\s+)?[@]{1,2}/),"special"):"#"==u?(e.skipToEnd(),"comment"):"'"==u||'"'==u?(t.pending=u,n(e,t)):"{"==u||"}"==u?"bracket":"/"==u?(e.match(/.*?\//),"variable-3"):u.match(/[0-9]/)?(e.eatWhile(/[0-9]+/),"number"):"="==u?(">"==e.peek()&&e.next(),"operator"):(e.eatWhile(/[\w-]/),null)}var i={},o=/({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;return e("keyword","class define site node include import inherits"),e("keyword","case if else in and elsif default or"),e("atom","false true running present absent file directory undef"),e("builtin","action augeas burst chain computer cron destination dport exec file filebucket group host icmp iniface interface jump k5login limit log_level log_prefix macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod name notify outiface package proto reject resources router schedule scheduled_task selboolean selmodule service source sport ssh_authorized_key sshkey stage state table tidy todest toports tosource user vlan yumrepo zfs zone zpool"),{startState:function(){var e={};return e.inDefinition=!1,e.inInclude=!1,e.continueString=!1,e.pending=!1,e},token:function(e,n){return e.eatSpace()?null:t(e,n)}}}),e.defineMIME("text/x-puppet","puppet")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/python/python.min.js b/media/editors/codemirror/mode/python/python.min.js new file mode 100644 index 0000000000000..76d5058090c04 --- /dev/null +++ b/media/editors/codemirror/mode/python/python.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e){return e.scopes[e.scopes.length-1]}var r=t(["and","or","not","is"]),i=["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"],a=["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__"],o={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},s={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};e.registerHelper("hintWords","python",i.concat(a)),e.defineMode("python",function(l,c){function p(e,t){if(e.sol()&&"py"==n(t).type){var r=n(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?d(e,t,"py"):r>i&&m(e,t)&&(t.errorToken=!0),null}var a=u(e,t);return r>0&&m(e,t)&&(a+=" "+h),a}return u(e,t)}function u(e,t){if(e.eatSpace())return null;var n=e.peek();if("#"==n)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var a=!1;if(e.match(/^0x[0-9a-f]+/i)&&(a=!0),e.match(/^0b[01]+/i)&&(a=!0),e.match(/^0o[0-7]+/i)&&(a=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),a=!0),e.match(/^0(?![\dx])/i)&&(a=!0),a)return e.eat(/L/i),"number"}return e.match(R)?(t.tokenize=f(e.current()),t.tokenize(e,t)):e.match(x)||e.match(v)?null:e.match(g)||e.match(k)||e.match(r)?"operator":e.match(b)?null:e.match(S)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(w)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),h)}function f(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=p,r;t.eat(/['"]/)}if(n){if(c.singleLineStringErrors)return h;i.tokenize=p}return r}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function d(e,t,r){var i=0,a=null;if("py"==r)for(;"py"!=n(t).type;)t.scopes.pop();i=n(t).offset+("py"==r?l.indentUnit:E),"py"==r||e.match(/^(\s|#.*)*$/,!1)||(a=e.column()+1),t.scopes.push({offset:i,type:r,align:a})}function m(e,t){for(var r=e.indentation();n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function y(e,t){var r=t.tokenize(e,t),i=e.current();if("."==i)return r=e.match(w,!1)?null:h,null==r&&"meta"==t.lastStyle&&(r="meta"),r;if("@"==i)return c.version&&3==parseInt(c.version,10)?e.match(w,!1)?"meta":"operator":e.match(w,!1)?"meta":h;"variable"!=r&&"builtin"!=r||"meta"!=t.lastStyle||(r="meta"),("pass"==i||"return"==i)&&(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||d(e,t,"py");var a=1==i.length?"[({".indexOf(i):-1;if(-1!=a&&d(e,t,"])}".slice(a,a+1)),a="])}".indexOf(i),-1!=a){if(n(t).type!=i)return h;t.scopes.pop()}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var h="error",b=c.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),g=c.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),v=c.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),x=c.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(c.version&&3==parseInt(c.version,10))var k=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"),w=c.identifiers||new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*");else var k=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),w=c.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*");var E=c.hangingIndent||l.indentUnit,_=i,z=a;if(void 0!=c.extra_keywords&&(_=_.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(z=z.concat(c.extra_builtins)),c.version&&3==parseInt(c.version,10)){_=_.concat(s.keywords),z=z.concat(s.builtins);var R=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{_=_.concat(o.keywords),z=z.concat(o.builtins);var R=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var S=t(_),T=t(z),I={startState:function(e){return{tokenize:p,scopes:[{offset:e||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=y(e,t);t.lastStyle=r;var i=e.current();return i&&r&&(t.lastToken=i),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+h:r},indent:function(t,r){if(t.tokenize!=p)return t.tokenize.isString?e.Pass:0;var i=n(t),a=r&&r.charAt(0)==i.type;return null!=i.align?i.align-(a?1:0):a&&t.scopes.length>1?t.scopes[t.scopes.length-2].offset:i.offset},lineComment:"#",fold:"indent"};return I}),e.defineMIME("text/x-python","python");var l=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:l("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/q/q.min.js b/media/editors/codemirror/mode/q/q.min.js new file mode 100644 index 0000000000000..9703566b4a49f --- /dev/null +++ b/media/editors/codemirror/mode/q/q.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("q",function(e){function t(e){return new RegExp("^("+e.join("|")+")$")}function n(e,t){var r=e.sol(),s=e.next();if(l=null,r){if("/"==s)return(t.tokenize=o)(e,t);if("\\"==s)return e.eol()||/\s/.test(e.peek())?(e.skipToEnd(),/^\\\s*$/.test(e.current())?(t.tokenize=i)(e,t):t.tokenize=n,"comment"):(t.tokenize=n,"builtin")}if(/\s/.test(s))return"/"==e.peek()?(e.skipToEnd(),"comment"):"whitespace";if('"'==s)return(t.tokenize=c)(e,t);if("`"==s)return e.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";if("."==s&&/\d/.test(e.peek())||/\d/.test(s)){var a=null;return e.backUp(1),e.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)||e.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)||e.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)||e.match(/^\d+[ptuv]{1}/)?a="temporal":(e.match(/^0[NwW]{1}/)||e.match(/^0x[\d|a-f|A-F]*/)||e.match(/^[0|1]+[b]{1}/)||e.match(/^\d+[chijn]{1}/)||e.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))&&(a="number"),!a||(s=e.peek())&&!m.test(s)?(e.next(),"error"):a}return/[A-Z|a-z]|\./.test(s)?(e.eatWhile(/[A-Z|a-z|\.|_|\d]/),u.test(e.current())?"keyword":"variable"):/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(s)?null:/[{}\(\[\]\)]/.test(s)?null:"error"}function o(e,t){return e.skipToEnd(),/\/\s*$/.test(e.current())?(t.tokenize=r)(e,t):t.tokenize=n,"comment"}function r(e,t){var o=e.sol()&&"\\"==e.peek();return e.skipToEnd(),o&&/^\\\s*$/.test(e.current())&&(t.tokenize=n),"comment"}function i(e){return e.skipToEnd(),"comment"}function c(e,t){for(var o,r=!1,i=!1;o=e.next();){if('"'==o&&!r){i=!0;break}r=!r&&"\\"==o}return i&&(t.tokenize=n),"string"}function s(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function a(e){e.indent=e.context.indent,e.context=e.context.prev}var l,d=e.indentUnit,u=t(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),m=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation());var n=t.tokenize(e,t);if("comment"!=n&&t.context&&null==t.context.align&&"pattern"!=t.context.type&&(t.context.align=!0),"("==l)s(t,")",e.column());else if("["==l)s(t,"]",e.column());else if("{"==l)s(t,"}",e.column());else if(/[\]\}\)]/.test(l)){for(;t.context&&"pattern"==t.context.type;)a(t);t.context&&l==t.context.type&&a(t)}else"."==l&&t.context&&"pattern"==t.context.type?a(t):/atom|string|variable/.test(n)&&t.context&&(/[\}\]]/.test(t.context.type)?s(t,"pattern",e.column()):"pattern"!=t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return n},indent:function(e,t){var n=t&&t.charAt(0),o=e.context;if(/[\]\}]/.test(n))for(;o&&"pattern"==o.type;)o=o.prev;var r=o&&n==o.type;return o?"pattern"==o.type?o.col:o.align?o.col+(r?0:1):o.indent+(r?0:d):0}}}),e.defineMIME("text/x-q","q")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/r/r.min.js b/media/editors/codemirror/mode/r/r.min.js new file mode 100644 index 0000000000000..b2eb9576eddb2 --- /dev/null +++ b/media/editors/codemirror/mode/r/r.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),n={},r=0;r=!&|~$:]/;return{startState:function(){return{tokenize:n,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);"comment"!=n&&null==t.ctx.align&&(t.ctx.align=!0);var r=t.ctx.type;return";"!=o&&"{"!=o&&"}"!=o||"block"!=r||a(t),"{"==o?i(t,"}",e):"("==o?(i(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==o?i(t,"]",e):"block"==o?i(t,"block",e):o==r&&a(t),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(t,r){if(t.tokenize!=n)return 0;var i=r&&r.charAt(0),a=t.ctx,o=i==a.type;return"block"==a.type?a.indent+("{"==i?0:e.indentUnit):a.align?a.column+(o?0:1):a.indent+(o?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/rpm/rpm.min.js b/media/editors/codemirror/mode/rpm/rpm.min.js new file mode 100644 index 0000000000000..6dd1814522363 --- /dev/null +++ b/media/editors/codemirror/mode/rpm/rpm.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("rpm-changes",function(){var e=/^-+$/,r=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /,t=/^[\w+.-]+@[\w.-]+/;return{token:function(n){if(n.sol()){if(n.match(e))return"tag";if(n.match(r))return"tag"}return n.match(t)?"string":(n.next(),null)}}}),e.defineMIME("text/x-rpm-changes","rpm-changes"),e.defineMode("rpm-spec",function(){var e=/^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/,r=/^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/,t=/^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/,n=/^%(ifnarch|ifarch|if)/,i=/^%(else|endif)/,o=/^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;return{startState:function(){return{controlFlow:!1,macroParameters:!1,section:!1}},token:function(c,a){var u=c.peek();if("#"==u)return c.skipToEnd(),"comment";if(c.sol()){if(c.match(r))return"preamble";if(c.match(t))return"section"}if(c.match(/^\$\w+/))return"def";if(c.match(/^\$\{\w+\}/))return"def";if(c.match(i))return"keyword";if(c.match(n))return a.controlFlow=!0,"keyword";if(a.controlFlow){if(c.match(o))return"operator";if(c.match(/^(\d+)/))return"number";c.eol()&&(a.controlFlow=!1)}if(c.match(e))return"number";if(c.match(/^%[\w]+/))return c.match(/^\(/)&&(a.macroParameters=!0),"macro";if(a.macroParameters){if(c.match(/^\d+/))return"number";if(c.match(/^\)/))return a.macroParameters=!1,"macro"}return c.match(/^%\{\??[\w \-]+\}/)?"macro":(c.next(),null)}}}),e.defineMIME("text/x-rpm-spec","rpm-spec")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/rst/rst.min.js b/media/editors/codemirror/mode/rst/rst.min.js new file mode 100644 index 0000000000000..ca19d9a5ab0ff --- /dev/null +++ b/media/editors/codemirror/mode/rst/rst.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../python/python"),require("../stex/stex"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../python/python","../stex/stex","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("rst",function(t,a){var c=/^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/,n=/^\*[^\*\s](?:[^\*]*[^\*\s])?\*/,r=/^``[^`\s](?:[^`]*[^`\s])``/,m=/^(?:[\d]+(?:[\.,]\d+)*)/,o=/^(?:\s\+[\d]+(?:[\.,]\d+)*)/,s=/^(?:\s\-[\d]+(?:[\.,]\d+)*)/,h="[Hh][Tt][Tt][Pp][Ss]?://",l="(?:[\\d\\w.-]+)\\.(?:\\w{2,6})",i="(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*",p=new RegExp("^"+h+l+i),d={token:function(e){if(e.match(c)&&e.match(/\W+|$/,!1))return"strong";if(e.match(n)&&e.match(/\W+|$/,!1))return"em";if(e.match(r)&&e.match(/\W+|$/,!1))return"string-2";if(e.match(m))return"number";if(e.match(o))return"positive";if(e.match(s))return"negative";if(e.match(p))return"link";for(;!(null==e.next()||e.match(c,!1)||e.match(n,!1)||e.match(r,!1)||e.match(m,!1)||e.match(o,!1)||e.match(s,!1)||e.match(p,!1)););return null}},u=e.getMode(t,a.backdrop||"rst-base");return e.overlayMode(u,d,!0)},"python","stex"),e.defineMode("rst-base",function(t){function a(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,a){return"undefined"!=typeof t[a]?t[a]:e})}function c(t,a){var r=null;if(t.sol()&&t.match(V,!1))l(a,s,{mode:d,local:e.startState(d)});else if(t.sol()&&t.match($))l(a,n),r="meta";else if(t.sol()&&t.match(v))l(a,c),r="header";else if(p(a)==P||t.match(P,!1))switch(i(a)){case 0:l(a,c,h(P,1)),t.match(/^:/),r="meta";break;case 1:l(a,c,h(P,2)),t.match(b),r="keyword",t.current().match(/^(?:math|latex)/)&&(a.tmp_stex=!0);break;case 2:l(a,c,h(P,3)),t.match(/^:`/),r="meta";break;case 3:if(a.tmp_stex&&(a.tmp_stex=void 0,a.tmp={mode:u,local:e.startState(u)}),a.tmp){if("`"==t.peek()){l(a,c,h(P,4)),a.tmp=void 0;break}r=a.tmp.mode.token(t,a.tmp.local);break}l(a,c,h(P,4)),t.match(_),r="string";break;case 4:l(a,c,h(P,5)),t.match(/^`/),r="meta";break;case 5:l(a,c,h(P,6)),t.match(k);break;default:l(a,c)}else if(p(a)==z||t.match(z,!1))switch(i(a)){case 0:l(a,c,h(z,1)),t.match(/^`/),r="meta";break;case 1:l(a,c,h(z,2)),t.match(_),r="string";break;case 2:l(a,c,h(z,3)),t.match(/^`:/),r="meta";break;case 3:l(a,c,h(z,4)),t.match(b),r="keyword";break;case 4:l(a,c,h(z,5)),t.match(/^:/),r="meta";break;case 5:l(a,c,h(z,6)),t.match(k);break;default:l(a,c)}else if(p(a)==B||t.match(B,!1))switch(i(a)){case 0:l(a,c,h(B,1)),t.match(/^:/),r="meta";break;case 1:l(a,c,h(B,2)),t.match(b),r="keyword";break;case 2:l(a,c,h(B,3)),t.match(/^:/),r="meta";break;case 3:l(a,c,h(B,4)),t.match(k);break;default:l(a,c)}else if(p(a)==j||t.match(j,!1))switch(i(a)){case 0:l(a,c,h(j,1)),t.match(G),r="variable-2";break;case 1:l(a,c,h(j,2)),t.match(/^_?_?/)&&(r="link");break;default:l(a,c)}else if(t.match(I))l(a,c),r="quote";else if(t.match(A))l(a,c),r="quote";else if(t.match(C))l(a,c),(!t.peek()||t.peek().match(/^\W$/))&&(r="link");else if(p(a)==H||t.match(H,!1))switch(i(a)){case 0:!t.peek()||t.peek().match(/^\W$/)?l(a,c,h(H,1)):t.match(H);break;case 1:l(a,c,h(H,2)),t.match(/^`/),r="link";break;case 2:l(a,c,h(H,3)),t.match(_);break;case 3:l(a,c,h(H,4)),t.match(/^`_/),r="link";break;default:l(a,c)}else t.match(U)?l(a,m):t.next()&&l(a,c);return r}function n(t,a){var m=null;if(p(a)==W||t.match(W,!1))switch(i(a)){case 0:l(a,n,h(W,1)),t.match(G),m="variable-2";break;case 1:l(a,n,h(W,2)),t.match(J);break;case 2:l(a,n,h(W,3)),t.match(K),m="keyword";break;case 3:l(a,n,h(W,4)),t.match(L),m="meta";break;default:l(a,c)}else if(p(a)==M||t.match(M,!1))switch(i(a)){case 0:l(a,n,h(M,1)),t.match(D),m="keyword",t.current().match(/^(?:math|latex)/)?a.tmp_stex=!0:t.current().match(/^python/)&&(a.tmp_py=!0);break;case 1:l(a,n,h(M,2)),t.match(F),m="meta",(t.match(/^latex\s*$/)||a.tmp_stex)&&(a.tmp_stex=void 0,l(a,s,{mode:u,local:e.startState(u)}));break;case 2:l(a,n,h(M,3)),(t.match(/^python\s*$/)||a.tmp_py)&&(a.tmp_py=void 0,l(a,s,{mode:d,local:e.startState(d)}));break;default:l(a,c)}else if(p(a)==S||t.match(S,!1))switch(i(a)){case 0:l(a,n,h(S,1)),t.match(N),t.match(O),m="link";break;case 1:l(a,n,h(S,2)),t.match(Q),m="meta";break;default:l(a,c)}else t.match(q)?(l(a,c),m="quote"):t.match(T)?(l(a,c),m="quote"):(t.eatSpace(),t.eol()?l(a,c):(t.skipToEnd(),l(a,r),m="comment"));return m}function r(e,t){return o(e,t,"comment")}function m(e,t){return o(e,t,"meta")}function o(e,t,a){return e.eol()||e.eatSpace()?(e.skipToEnd(),a):(l(t,c),null)}function s(e,t){return t.ctx.mode&&t.ctx.local?e.sol()?(e.eatSpace()||l(t,c),null):t.ctx.mode.token(e,t.ctx.local):(l(t,c),null)}function h(e,t,a,c){return{phase:e,stage:t,mode:a,local:c}}function l(e,t,a){e.tok=t,e.ctx=a||{}}function i(e){return e.ctx.stage||0}function p(e){return e.ctx.phase}var d=e.getMode(t,"python"),u=e.getMode(t,"stex"),f="\\s+",x="(?:\\s*|\\W|$)",k=new RegExp(a("^{0}",x)),w="(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",b=new RegExp(a("^{0}",w)),g="(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",E=a("(?:{0}|`{1}`)",w,g),R="(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)",y="(?:[^\\`]+)",_=new RegExp(a("^{0}",y)),v=new RegExp("^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"),$=new RegExp(a("^\\.\\.{0}",f)),S=new RegExp(a("^_{0}:{1}|^__:{1}",E,x)),M=new RegExp(a("^{0}::{1}",E,x)),W=new RegExp(a("^\\|{0}\\|{1}{2}::{3}",R,f,E,x)),q=new RegExp(a("^\\[(?:\\d+|#{0}?|\\*)]{1}",E,x)),T=new RegExp(a("^\\[{0}\\]{1}",E,x)),j=new RegExp(a("^\\|{0}\\|",R)),I=new RegExp(a("^\\[(?:\\d+|#{0}?|\\*)]_",E)),A=new RegExp(a("^\\[{0}\\]_",E)),C=new RegExp(a("^{0}__?",E)),H=new RegExp(a("^`{0}`_",y)),P=new RegExp(a("^:{0}:`{1}`{2}",w,y,x)),z=new RegExp(a("^`{1}`:{0}:{2}",w,y,x)),B=new RegExp(a("^:{0}:{1}",w,x)),D=new RegExp(a("^{0}",E)),F=new RegExp(a("^::{0}",x)),G=new RegExp(a("^\\|{0}\\|",R)),J=new RegExp(a("^{0}",f)),K=new RegExp(a("^{0}",E)),L=new RegExp(a("^::{0}",x)),N=new RegExp("^_"),O=new RegExp(a("^{0}|_",E)),Q=new RegExp(a("^:{0}",x)),U=new RegExp("^::\\s*$"),V=new RegExp("^\\s+(?:>>>|In \\[\\d+\\]:)\\s");return{startState:function(){return{tok:c,ctx:h(void 0,0)}},copyState:function(t){var a=t.ctx,c=t.tmp;return a.local&&(a={mode:a.mode,local:e.copyState(a.mode,a.local)}),c&&(c={mode:c.mode,local:e.copyState(c.mode,c.local)}),{tok:t.tok,ctx:a,tmp:c}},innerMode:function(e){return e.tmp?{state:e.tmp.local,mode:e.tmp.mode}:e.ctx.mode?{state:e.ctx.local,mode:e.ctx.mode}:null},token:function(e,t){return t.tok(e,t)}}},"python","stex"),e.defineMIME("text/x-rst","rst")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/ruby/ruby.min.js b/media/editors/codemirror/mode/ruby/ruby.min.js new file mode 100644 index 0000000000000..e2a5a7b2b5a11 --- /dev/null +++ b/media/editors/codemirror/mode/ruby/ruby.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;r>n;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(l=null,e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(f),"comment";if(e.eatSpace())return null;var r,i=e.next();if("`"==i||"'"==i||'"'==i)return n(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var d=e.current().length;e.backUp(e.current().length-o);for(var c=0;e.current().lengthc)break}if(e.backUp(e.current().length-o),0==c)return n(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var k="string",h=!0;e.eat("s")?k="atom":e.eat(/[WQ]/)?k="string":e.eat(/[r]/)?k="string-2":e.eat(/[wxq]/)&&(k="string",h=!1);var m=e.eat(/[^\w\s=]/);return m?(p.propertyIsEnumerable(m)&&(m=p[m]),n(a(m,k,h,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(u(r[1]),e,t);if("0"==i)return e.eatWhile(e.eat("x")?/[\da-fA-F]/:e.eat("b")?/[01]/:/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?n(a("'","atom",!1),e,t):e.eat('"')?n(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return l=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var x=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||x||(l="."),"operator"}return null}return l="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,u){var f,l=!1;for("read-quoted-paused"===u.context.type&&(u.context=u.context.prev,a.eat("}"));null!=(f=a.next());){if(f==e&&(r||!l)){u.tokenize.pop();break}if(n&&"#"==f&&!l){if(a.eat("{")){"}"==e&&(u.context={prev:u.context,type:"read-quoted-paused"}),u.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){u.tokenize.push(o());break}}l=!l&&"\\"==f}return t}}function u(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function f(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var l,d=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),c=t(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),s=t(["end","until"]),p={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=l;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":d.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,c.propertyIsEnumerable(o)?n="indent":s.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indented")?e("->",null):a.match(V)?(t.eatWhile(V),e("op",null)):(t.eatWhile(/\w/),K=t.current(),t.match(/^::\w/)?(t.backUp(1),e("prefix","variable-2")):o.keywords.propertyIsEnumerable(K)?e(o.keywords[K],K.match(/true|false/)?"atom":"keyword"):e("name","variable"))}function n(n,r){for(var o,a=!1;o=n.next();){if('"'==o&&!a)return r.tokenize=t,e("atom","string");a=!a&&"\\"==o}return e("op","string")}function r(e){return function(n,o){for(var a,i=null;a=n.next();){if("/"==a&&"*"==i){if(1==e){o.tokenize=t;break}return o.tokenize=r(e-1),o.tokenize(n,o)}if("*"==a&&"/"==i)return o.tokenize=r(e+1),o.tokenize(n,o);i=a}return"comment"}}function o(){for(var e=arguments.length-1;e>=0;e--)X.cc.push(arguments[e])}function a(){return o.apply(null,arguments),!0}function i(e,t){var n=function(){var n=X.state;n.lexical={indented:n.indented,column:X.stream.column(),type:e,prev:n.lexical,info:t}};return n.lex=!0,n}function u(){var e=X.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function l(){X.state.keywords=R}function c(){X.state.keywords=Q}function f(e,t){function n(r){return","==r?a(e,n):r==t?a():a(n)}return function(r){return r==t?a():o(e,n)}}function m(e,t){return a(i("stat",t),e,u,d)}function d(e){return"}"==e?a():"let"==e?m(w,"let"):"fn"==e?m(j):"type"==e?a(i("stat"),C,s,u,d):"enum"==e?m(W):"mod"==e?m(M):"iface"==e?m($):"impl"==e?m(S):"open-attr"==e?a(i("]"),f(k,"]"),u):"ignore"==e||e.match(/[\]\);,]/)?a(d):o(i("stat"),k,u,s,d)}function s(e){return";"==e?a():o()}function k(e){return"atom"==e||"name"==e?a(p):"{"==e?a(i("}"),y,u):e.match(/[\[\(]/)?G(e,k):e.match(/[\]\)\};,]/)?o():"if-style"==e?a(k,k):"else-style"==e||"op"==e?a(k):"for"==e?a(A,v,z,k,k):"alt"==e?a(k,_):"fn"==e?a(j):"macro"==e?a(F):a()}function p(e){return"."==K?a(h):"::<"==K?a(I,p):"op"==e||":"==K?a(k):"("==e||"["==e?G(e,k):o()}function h(){return K.match(/^\w+$/)?(X.marked="variable",a(p)):o(k)}function y(e){if("op"==e){if("|"==K)return a(b,u,i("}","block"),d);if("||"==K)return a(u,i("}","block"),d)}return o("mutable"==K||K.match(/^\w+$/)&&":"==X.stream.peek()&&!X.stream.match("::",!1)?x(k):d)}function x(e){function t(n){return"mutable"==K||"with"==K?(X.marked="keyword",a(t)):K.match(/^\w*$/)?(X.marked="variable",a(t)):":"==n?a(e,t):"}"==n?a():a(t)}return t}function b(e){return"name"==e?(X.marked="def",a(b)):"op"==e&&"|"==K?a():a(b)}function w(e){return e.match(/[\]\)\};]/)?a():"="==K?a(k,g):","==e?a(w):o(A,v,w)}function g(e){return e.match(/[\]\)\};,]/)?o(w):o(k,g)}function v(e){return":"==e?a(l,P,c):o()}function z(e){return"name"==e&&"in"==K?(X.marked="keyword",a()):o()}function j(e){return"@"==K||"~"==K?(X.marked="keyword",a(j)):"name"==e?(X.marked="def",a(j)):"<"==K?a(I,j):"{"==e?o(k):"("==e?a(i(")"),f(O,")"),u,j):"->"==e?a(l,P,c,j):";"==e?a():a(j)}function C(e){return"name"==e?(X.marked="def",a(C)):"<"==K?a(I,C):"="==K?a(l,P,c):a(C)}function W(e){return"name"==e?(X.marked="def",a(W)):"<"==K?a(I,W):"="==K?a(l,P,c,s):"{"==e?a(i("}"),l,E,c,u):a(W)}function E(e){return"}"==e?a():"("==e?a(i(")"),f(P,")"),u,E):(K.match(/^\w+$/)&&(X.marked="def"),a(E))}function M(e){return"name"==e?(X.marked="def",a(M)):"{"==e?a(i("}"),d,u):o()}function $(e){return"name"==e?(X.marked="def",a($)):"<"==K?a(I,$):"{"==e?a(i("}"),d,u):o()}function S(e){return"<"==K?a(I,S):"of"==K||"for"==K?(X.marked="keyword",a(P,S)):"name"==e?(X.marked="def",a(S)):"{"==e?a(i("}"),d,u):o()}function I(){return">"==K?a():","==K?a(I):":"==K?a(P,I):o(P,I)}function O(e){return"name"==e?(X.marked="def",a(O)):":"==e?a(l,P,c):o()}function P(e){return"name"==e?(X.marked="variable-3",a(T)):"mutable"==K?(X.marked="keyword",a(P)):"atom"==e?a(T):"op"==e||"obj"==e?a(P):"fn"==e?a(q):"{"==e?a(i("{"),x(P),u):G(e,P)}function T(){return"<"==K?a(I):o()}function q(e){return"("==e?a(i("("),f(P,")"),u,q):"->"==e?a(P):o()}function A(e){return"name"==e?(X.marked="def",a(U)):"atom"==e?a(U):"op"==e?a(A):e.match(/[\]\)\};,]/)?o():G(e,A)}function U(e){return"op"==e&&"."==K?a():"to"==K?(X.marked="keyword",a(A)):o()}function _(e){return"{"==e?a(i("}","alt"),B,u):o()}function B(e){return"}"==e?a():"|"==e?a(B):"when"==K?(X.marked="keyword",a(k,D)):e.match(/[\]\);,]/)?a(B):o(A,D)}function D(e){return"{"==e?a(i("}","alt"),d,u,B):o(B)}function F(e){return e.match(/[\[\(\{]/)?G(e,k):o()}function G(e,t){return"["==e?a(i("]"),f(t,"]"),u):"("==e?a(i(")"),f(t,")"),u):"{"==e?a(i("}"),f(t,"}"),u):a()}function H(e,t,n){var r=e.cc;for(X.state=e,X.stream=t,X.marked=null,X.cc=r;;){var o=r.length?r.pop():d;if(o(J)){for(;r.length&&r[r.length-1].lex;)r.pop()();return X.marked||n}}}var J,K,L=4,N=2,Q={"if":"if-style","while":"if-style",loop:"else-style","else":"else-style","do":"else-style",ret:"else-style",fail:"else-style","break":"atom",cont:"atom","const":"let",resource:"fn",let:"let",fn:"fn","for":"for",alt:"alt",iface:"iface",impl:"impl",type:"type","enum":"enum",mod:"mod",as:"op","true":"atom","false":"atom",assert:"op",check:"op",claim:"op","native":"ignore",unsafe:"ignore","import":"else-style","export":"else-style",copy:"op",log:"op",log_err:"op",use:"op",bind:"op",self:"atom",struct:"enum"},R=function(){for(var e={fn:"fn",block:"fn",obj:"obj"},t="bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "),n=0,r=t.length;r>n;++n)e[t[n]]="atom";return e}(),V=/[+\-*&%=<>!?|\.@]/,X={state:null,stream:null,marked:null,cc:null};return u.lex=l.lex=c.lex=!0,{startState:function(){return{tokenize:t,cc:[],lexical:{indented:-L,column:0,type:"top",align:!1},keywords:Q,indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null;J=K=null;var n=t.tokenize(e,t);return"comment"==n?n:(t.lexical.hasOwnProperty("align")||(t.lexical.align=!0),"prefix"==J?n:(K||(K=e.current()),H(t,e,n)))},indent:function(e,n){if(e.tokenize!=t)return 0;var r=n&&n.charAt(0),o=e.lexical,a=o.type,i=r==a;return"stat"==a?o.indented+L:o.align?o.column+(i?0:1):o.indented+(i?0:"alt"==o.info?N:L)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),e.defineMIME("text/x-rustsrc","rust")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/sass/sass.min.js b/media/editors/codemirror/mode/sass/sass.min.js new file mode 100644 index 0000000000000..756676e08a075 --- /dev/null +++ b/media/editors/codemirror/mode/sass/sass.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sass",function(e){function t(e){return new RegExp("^"+e.join("|"))}function r(e,t){var r=e.peek();return")"===r?(e.next(),t.tokenizer=f,"operator"):"("===r?(e.next(),e.eatSpace(),"operator"):"'"===r||'"'===r?(t.tokenizer=o(e.next()),"string"):(t.tokenizer=o(")",!1),"string")}function n(e,t){return function(r,n){return r.sol()&&r.indentation()<=e?(n.tokenizer=f,f(r,n)):(t&&r.skipTo("*/")?(r.next(),r.next(),n.tokenizer=f):r.skipToEnd(),"comment")}}function o(e,t){function r(n,o){var a=n.next(),u=n.peek(),c=n.string.charAt(n.pos-2),s="\\"!==a&&u===e||a===e&&"\\"!==c;return s?(a!==e&&t&&n.next(),o.tokenizer=f,"string"):"#"===a&&"{"===u?(o.tokenizer=i(r),n.next(),"operator"):"string"}return null==t&&(t=!0),r}function i(e){return function(t,r){return"}"===t.peek()?(t.next(),r.tokenizer=e,"operator"):f(t,r)}}function a(t){if(0==t.indentCount){t.indentCount++;var r=t.scopes[0].offset,n=r+e.indentUnit;t.scopes.unshift({offset:n})}}function u(e){1!=e.scopes.length&&e.scopes.shift()}function f(e,t){var c=e.peek();if(e.match("/*"))return t.tokenizer=n(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=n(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=i(f),"operator";if('"'===c||"'"===c)return e.next(),t.tokenizer=o(c),"string";if(t.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(t.cursorHalf=0),"unit";if(e.match(p))return e.peek()||(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=r,e.peek()||(t.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(t.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(t.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(l))return e.peek()||(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(t.cursorHalf=0),"attribute";if(!e.peek())return t.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(p))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=r,"atom";if("="===c&&e.match(/^=[\w-]+/))return a(t),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||u(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return a(t),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"propery":e.match(/ *:/,!1)?(a(t),t.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(a(t),"atom");if(":"===c)return e.match(k)?"keyword":(e.next(),t.cursorHalf=1,"operator")}return e.match(l)?"operator":(e.next(),null)}function c(t,r){t.sol()&&(r.indentCount=0);var n=r.tokenizer(t,r),o=t.current();if(("@return"===o||"}"===o)&&u(r),null!==n){for(var i=t.pos-o.length,a=i+e.indentUnit*r.indentCount,f=[],c=0;c","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],l=t(m),k=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:f,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var r=c(e,t);return t.lastToken={style:r,content:e.current()},r},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/scheme/scheme.min.js b/media/editors/codemirror/mode/scheme/scheme.min.js new file mode 100644 index 0000000000000..b2ef963ad2d7a --- /dev/null +++ b/media/editors/codemirror/mode/scheme/scheme.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("scheme",function(){function e(e){for(var t={},n=e.split(" "),r=0;rinteger char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),g=e("define let letrec let* lambda"),x=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),b=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),v=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),k=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var x=null;switch(t.mode){case"string":for(var b,v=!1;null!=(b=e.next());){if('"'==b&&!v){t.mode=!1;break}v=!v&&"\\"==b}x=s;break;case"comment":for(var b,k=!1;null!=(b=e.next());){if("#"==b&&k){t.mode=!1;break}k="|"==b}x=d;break;case"s-expr-comment":if(t.mode=!1,"("!=e.peek()&&"["!=e.peek()){e.eatWhile(/[^/s]/),x=d;break}t.sExprComment=0;default:var y=e.next();if('"'==y)t.mode="string",x=s;else if("'"==y)x=u;else if("#"==y)if(e.eat("|"))t.mode="comment",x=d;else if(e.eat(/[tf]/i))x=u;else if(e.eat(";"))t.mode="s-expr-comment",x=d;else{var w=null,E=!1,q=!0;e.eat(/[ei]/i)?E=!0:e.backUp(1),e.match(/^#b/i)?w=i:e.match(/^#o/i)?w=a:e.match(/^#x/i)?w=o:e.match(/^#d/i)?w=c:e.match(/^[-+0-9.]/,!1)?(q=!1,w=c):E||e.eat("#"),null!=w&&(q&&!E&&e.match(/^#[ei]/i),w(e)&&(x=m))}else if(/^[-+0-9.]/.test(y)&&c(e,!0))x=m;else if(";"==y)e.skipToEnd(),x=d;else if("("==y||"["==y){for(var S,C="",$=e.column();null!=(S=e.eat(/[^\s\(\[\;\)\]]/));)C+=S;C.length>0&&g.propertyIsEnumerable(C)?n(t,$+f,y):(e.eatSpace(),e.eol()||";"==e.peek()?n(t,$+1,y):n(t,$+e.current().length,y)),e.backUp(e.current().length-1),"number"==typeof t.sExprComment&&t.sExprComment++,x=p}else")"==y||"]"==y?(x=p,null!=t.indentStack&&t.indentStack.type==(")"==y?"(":"[")&&(r(t),"number"==typeof t.sExprComment&&0==--t.sExprComment&&(x=d,t.sExprComment=!1))):(e.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/),x=h&&h.propertyIsEnumerable(e.current())?l:"variable")}return"number"==typeof t.sExprComment?d:x},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},lineComment:";;"}}),e.defineMIME("text/x-scheme","scheme")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/shell/shell.min.js b/media/editors/codemirror/mode/shell/shell.min.js new file mode 100644 index 0000000000000..08b6fe20c5535 --- /dev/null +++ b/media/editors/codemirror/mode/shell/shell.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/shell/test.min.js b/media/editors/codemirror/mode/shell/test.min.js new file mode 100644 index 0000000000000..cc88c5b1b7dee --- /dev/null +++ b/media/editors/codemirror/mode/shell/test.min.js @@ -0,0 +1 @@ +!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({},"shell");t("var","text [def $var] text"),t("varBraces","text[def ${var}]text"),t("varVar","text [def $a$b] text"),t("varBracesVarBraces","text[def ${a}${b}]text"),t("singleQuotedVar","[string 'text $var text']"),t("singleQuotedVarBraces","[string 'text ${var} text']"),t("doubleQuotedVar",'[string "text ][def $var][string text"]'),t("doubleQuotedVarBraces",'[string "text][def ${var}][string text"]'),t("doubleQuotedVarPunct",'[string "text ][def $@][string text"]'),t("doubleQuotedVarVar",'[string "][def $a$b][string "]'),t("doubleQuotedVarBracesVarBraces",'[string "][def ${a}${b}][string "]'),t("notAString","text\\'text"),t("escapes",'outside\\\'\\"\\`\\\\[string "inside\\`\\\'\\"\\\\`\\$notAVar"]outside\\$\\(notASubShell\\)'),t("subshell","[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."),t("doubleQuotedSubshell",'[builtin echo] [string "][quote $(whoami)][string \'s log, stardate `date`."]'),t("hashbang","[meta #!/bin/bash]"),t("comment","text [comment # Blurb]"),t("numbers","[number 0] [number 1] [number 2]"),t("keywords","[keyword while] [atom true]; [keyword do]"," [builtin sleep] [number 3]","[keyword done]"),t("options","[builtin ls] [attribute -l] [attribute --human-readable]"),t("operator","[def var][operator =]value")}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/sieve/sieve.min.js b/media/editors/codemirror/mode/sieve/sieve.min.js new file mode 100644 index 0000000000000..255c2364f5f0d --- /dev/null +++ b/media/editors/codemirror/mode/sieve/sieve.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sieve",function(e){function n(e){for(var n={},t=e.split(" "),r=0;rt&&(t=0),t*f},electricChars:"}"}}),e.defineMIME("application/sieve","sieve")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/slim/slim.min.js b/media/editors/codemirror/mode/slim/slim.min.js new file mode 100644 index 0000000000000..e759bef29c69d --- /dev/null +++ b/media/editors/codemirror/mode/slim/slim.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("slim",function(e){function n(t,e,n){var i=function(i,r){return r.tokenize=e,i.pos-1&&(e.tokenize=n(t.pos,e.tokenize,o),t.backUp(u.length-a-r)),o}function r(t,e){t.stack={parent:t.stack,style:"continuation",indented:e,tokenize:t.line},t.line=t.tokenize}function o(t){t.line==t.tokenize&&(t.line=t.stack.tokenize,t.stack=t.stack.parent)}function u(t,e){return function(n,i){if(o(i),n.match(/^\\$/))return r(i,t),"lineContinuation";var u=e(n,i);return n.eol()&&n.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)&&n.backUp(1),u}}function a(t,e){return function(n,i){o(i);var u=e(n,i);return n.eol()&&n.current().match(/,$/)&&r(i,t),u}}function c(t,e){return function(n,i){var r=n.peek();return r==t&&1==i.rubyState.tokenize.length?(n.next(),i.tokenize=e,"closeAttributeTag"):s(n,i)}}function l(t){var e,n=function(n,i){if(1==i.rubyState.tokenize.length&&!i.rubyState.context.prev){if(n.backUp(1),n.eatSpace())return i.rubyState=e,i.tokenize=t,t(n,i);n.next()}return s(n,i)};return function(t,i){return e=i.rubyState,i.rubyState=Z.startState(),i.tokenize=n,s(t,i)}}function s(t,e){return Z.token(t,e.rubyState)}function k(t,e){return t.match(/^\\$/)?"lineContinuation":d(t,e)}function d(t,e){return t.match(/^#\{/)?(e.tokenize=c("}",e.tokenize),null):i(t,e,/[^\\]#\{/,1,P.token(t,e.htmlState))}function m(t){return function(e,n){var i=k(e,n);return e.eol()&&(n.tokenize=t),i}}function f(t,e,n){return e.stack={parent:e.stack,style:"html",indented:t.column()+n,tokenize:e.line},e.line=e.tokenize=d,null}function b(t,e){return t.skipToEnd(),e.stack.style}function z(t,e){return e.stack={parent:e.stack,style:"comment",indented:e.indented+1,tokenize:e.line},e.line=b,b(t,e)}function p(t,e){return t.eat(e.stack.endQuote)?(e.line=e.stack.line,e.tokenize=e.stack.tokenize,e.stack=e.stack.parent,null):t.match(K)?(e.tokenize=x,"slimAttribute"):(t.next(),null)}function x(t,e){return t.match(/^==?/)?(e.tokenize=h,null):p(t,e)}function h(t,e){var n=t.peek();return'"'==n||"'"==n?(e.tokenize=q(n,"string",!0,!1,p),t.next(),e.tokenize(t,e)):"["==n?l(p)(t,e):t.match(/^(true|false|nil)\b/)?(e.tokenize=p,"keyword"):l(p)(t,e)}function y(t,e,n){return t.stack={parent:t.stack,style:"wrapper",indented:t.indented+1,tokenize:n,line:t.line,endQuote:e},t.line=t.tokenize=p,null}function S(e,n){if(e.match(/^#\{/))return n.tokenize=c("}",n.tokenize),null;var i=new t.StringStream(e.string.slice(n.stack.indented),e.tabSize);i.pos=e.pos-n.stack.indented,i.start=e.start-n.stack.indented,i.lastColumnPos=e.lastColumnPos-n.stack.indented,i.lastColumnValue=e.lastColumnValue-n.stack.indented;var r=n.subMode.token(i,n.subState);return e.pos=i.pos+n.stack.indented,r}function v(t,e){return e.stack.indented=t.column(),e.line=e.tokenize=S,e.tokenize(t,e)}function w(n){var i=D[n],r=t.mimeModes[i];if(r)return t.getMode(e,r);var o=t.modes[i];return o?o(e,{name:i}):t.getMode(e,"null")}function g(t){return _.hasOwnProperty(t)?_[t]:_[t]=w(t)}function M(t,e){var n=g(t),i=n.startState&&n.startState();return e.subMode=n,e.subState=i,e.stack={parent:e.stack,style:"sub",indented:e.indented+1,tokenize:e.line},e.line=e.tokenize=v,"slimSubmode"}function C(t){return t.skipToEnd(),"slimDoctype"}function E(t,e){var n=t.peek();if("<"==n)return(e.tokenize=m(e.tokenize))(t,e);if(t.match(/^[|']/))return f(t,e,1);if(t.match(/^\/(!|\[\w+])?/))return z(t,e);if(t.match(/^(-|==?[<>]?)/))return e.tokenize=u(t.column(),a(t.column(),s)),"slimSwitch";if(t.match(/^doctype\b/))return e.tokenize=C,"keyword";var i=t.match(Q);return i?M(i[1],e):L(t,e)}function A(t,e){return e.startOfLine?E(t,e):L(t,e)}function L(t,e){return t.eat("*")?(e.tokenize=l($),null):t.match(H)?(e.tokenize=$,"slimTag"):T(t,e)}function $(t,e){return t.match(/^(<>?|>e.indented&&"slimSubmode"!=e.last;)e.line=e.tokenize=e.stack.tokenize,e.stack=e.stack.parent,e.subMode=null,e.subState=null;if(t.eatSpace())return null;var n=e.tokenize(t,e);return e.startOfLine=!1,n&&(e.last=n),V.hasOwnProperty(n)?V[n]:n},blankLine:function(t){return t.subMode&&t.subMode.blankLine?t.subMode.blankLine(t.subState):void 0},innerMode:function(t){return t.subMode?{state:t.subState,mode:t.subMode}:{state:t,mode:X}}};return X},"htmlmixed","ruby"),t.defineMIME("text/x-slim","slim"),t.defineMIME("application/x-slim","slim")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/slim/test.min.js b/media/editors/codemirror/mode/slim/test.min.js new file mode 100644 index 0000000000000..60f066171df5e --- /dev/null +++ b/media/editors/codemirror/mode/slim/test.min.js @@ -0,0 +1 @@ +!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4,indentUnit:2},"slim");t("elementName","[tag h1] Hey There"),t("oneElementPerLine","[tag h1] Hey There .h2"),t("idShortcut","[attribute&def #test] Hey There"),t("tagWithIdShortcuts","[tag h1][attribute&def #test] Hey There"),t("classShortcut","[attribute&qualifier .hello] Hey There"),t("tagWithIdAndClassShortcuts","[tag h1][attribute&def #test][attribute&qualifier .hello] Hey There"),t("docType","[keyword doctype] xml"),t("comment","[comment / Hello WORLD]"),t("notComment","[tag h1] This is not a / comment "),t("attributes",'[tag a]([attribute title]=[string "test"]) [attribute href]=[string "link"]}'),t("multiLineAttributes",'[tag a]([attribute title]=[string "test"]',' ) [attribute href]=[string "link"]}'),t("htmlCode","[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"),t("rubyBlock","[operator&special =][variable-2 @item]"),t("selectorRubyBlock","[tag a][attribute&qualifier .test][operator&special =] [variable-2 @item]"),t("nestedRubyBlock","[tag a]",' [operator&special =][variable puts] [string "test"]'),t("multilinePlaintext","[tag p]"," | Hello,"," World"),t("multilineRuby","[tag p]"," [comment /# this is a comment]"," [comment and this is a comment too]"," | Date/Time"," [operator&special -] [variable now] [operator =] [tag DateTime][operator .][property now]"," [tag strong][operator&special =] [variable now]",' [operator&special -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string "December 31, 2006"])',' [operator&special =][string "Happy"]',' [operator&special =][string "Belated"]',' [operator&special =][string "Birthday"]'),t("multilineComment","[comment /]"," [comment Multiline]"," [comment Comment]"),t("hamlAfterRubyTag","[attribute&qualifier .block]"," [tag strong][operator&special =] [variable now]"," [attribute&qualifier .test]"," [operator&special =][variable now]"," [attribute&qualifier .right]"),t("stretchedRuby",'[operator&special =] [variable puts] [string "Hello"],',' [string "World"]'),t("interpolationInHashAttribute",'[tag div]{[attribute id] = [string "]#{[variable test]}[string _]#{[variable ting]}[string "]} test'),t("interpolationInHTMLAttribute",'[tag div]([attribute title]=[string "]#{[variable test]}[string _]#{[variable ting]()}[string "]) Test')}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/smalltalk/smalltalk.min.js b/media/editors/codemirror/mode/smalltalk/smalltalk.min.js new file mode 100644 index 0000000000000..cf3f1f032b1c8 --- /dev/null +++ b/media/editors/codemirror/mode/smalltalk/smalltalk.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("smalltalk",function(e){var t=/[+\-\/\\*~<>=@%|&?!.,:;^]/,n=/true|false|nil|self|super|thisContext/,i=function(e,t){this.next=e,this.parent=t},a=function(e,t,n){this.name=e,this.context=t,this.eos=n},r=function(){this.context=new i(o,null),this.expectVariable=!0,this.indentation=0,this.userIndentationDelta=0};r.prototype.userIndent=function(t){this.userIndentationDelta=t>0?t/e.indentUnit-this.indentation:0};var o=function(e,r,o){var d=new a(null,r,!1),f=e.next();return'"'===f?d=s(e,new i(s,r)):"'"===f?d=u(e,new i(u,r)):"#"===f?"'"===e.peek()?(e.next(),d=c(e,new i(c,r))):d.name=e.eatWhile(/[^\s.{}\[\]()]/)?"string-2":"meta":"$"===f?("<"===e.next()&&(e.eatWhile(/[^\s>]/),e.next()),d.name="string-2"):"|"===f&&o.expectVariable?d.context=new i(l,r):/[\[\]{}()]/.test(f)?(d.name="bracket",d.eos=/[\[{(]/.test(f),"["===f?o.indentation++:"]"===f&&(o.indentation=Math.max(0,o.indentation-1))):t.test(f)?(e.eatWhile(t),d.name="operator",d.eos=";"!==f):/\d/.test(f)?(e.eatWhile(/[\w\d]/),d.name="number"):/[\w_]/.test(f)?(e.eatWhile(/[\w\d_]/),d.name=o.expectVariable?n.test(e.current())?"keyword":"variable":null):d.eos=o.expectVariable,d},s=function(e,t){return e.eatWhile(/[^"]/),new a("comment",e.eat('"')?t.parent:t,!0)},u=function(e,t){return e.eatWhile(/[^']/),new a("string",e.eat("'")?t.parent:t,!1)},c=function(e,t){return e.eatWhile(/[^']/),new a("string-2",e.eat("'")?t.parent:t,!1)},l=function(e,t){var n=new a(null,t,!1),i=e.next();return"|"===i?(n.context=t.parent,n.eos=!0):(e.eatWhile(/[^|]/),n.name="variable"),n};return{startState:function(){return new r},token:function(e,t){if(t.userIndent(e.indentation()),e.eatSpace())return null;var n=t.context.next(e,t.context,t);return t.context=n.context,t.expectVariable=n.eos,n.name},blankLine:function(e){e.userIndent(0)},indent:function(t,n){var i=t.context.next===o&&n&&"]"===n.charAt(0)?-1:t.userIndentationDelta;return(t.indentation+i)*e.indentUnit},electricChars:"]"}}),e.defineMIME("text/x-stsrc",{name:"smalltalk"})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/smarty/smarty.min.js b/media/editors/codemirror/mode/smarty/smarty.min.js new file mode 100644 index 0000000000000..5755060d37d53 --- /dev/null +++ b/media/editors/codemirror/mode/smarty/smarty.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("smarty",function(e){var t={rightDelimiter:"}",leftDelimiter:"{",smartyVersion:2};e.hasOwnProperty("leftDelimiter")&&(t.leftDelimiter=e.leftDelimiter),e.hasOwnProperty("rightDelimiter")&&(t.rightDelimiter=e.rightDelimiter),e.hasOwnProperty("smartyVersion")&&3===e.smartyVersion&&(t.smartyVersion=3);var r,i=["debug","extends","function","include","literal"],n={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/},o={cont:function(e,t){return r=t,e},chain:function(e,t,r){return t.tokenize=r,r(e,t)}},a={tokenizer:function(e,i){if(e.match(t.leftDelimiter,!0)){if(e.eat("*"))return o.chain(e,i,a.inBlock("comment","*"+t.rightDelimiter));i.depth++;var n=e.eol(),l=/\s/.test(e.peek());return 3===t.smartyVersion&&"{"===t.leftDelimiter&&(n||l)?(i.depth--,null):(i.tokenize=a.smarty,r="startTag","tag")}return e.next(),null},smarty:function(e,l){if(e.match(t.rightDelimiter,!0))return 3===t.smartyVersion?(l.depth--,l.depth<=0&&(l.tokenize=a.tokenizer)):l.tokenize=a.tokenizer,o.cont("tag",null);if(e.match(t.leftDelimiter,!0))return l.depth++,o.cont("tag","startTag");var f=e.next();if("$"==f)return e.eatWhile(n.validIdentifier),o.cont("variable-2","variable");if("|"==f)return o.cont("operator","pipe");if("."==f)return o.cont("operator","property");if(n.stringChar.test(f))return l.tokenize=a.inAttribute(f),o.cont("string","string");if(n.operatorChars.test(f))return e.eatWhile(n.operatorChars),o.cont("operator","operator");if("["==f||"]"==f)return o.cont("bracket","bracket");if("("==f||")"==f)return o.cont("bracket","operator");if(/\d/.test(f))return e.eatWhile(/\d/),o.cont("number","number");if("variable"==l.last){if("@"==f)return e.eatWhile(n.validIdentifier),o.cont("property","property");if("|"==f)return e.eatWhile(n.validIdentifier),o.cont("qualifier","modifier")}else{if("pipe"==l.last)return e.eatWhile(n.validIdentifier),o.cont("qualifier","modifier");if("whitespace"==l.last)return e.eatWhile(n.validIdentifier),o.cont("attribute","modifier")}if("property"==l.last)return e.eatWhile(n.validIdentifier),o.cont("property",null);if(/\s/.test(f))return r="whitespace",null;var u="";"/"!=f&&(u+=f);for(var s=null;s=e.eat(n.validIdentifier);)u+=s;for(var c=0,d=i.length;d>c;c++)if(i[c]==u)return o.cont("keyword","keyword");return/\s/.test(f)?null:o.cont("tag","tag")},inAttribute:function(e){return function(t,r){for(var i=null,n=null;!t.eol();){if(n=t.peek(),t.next()==e&&"\\"!==i){r.tokenize=a.smarty;break}i=n}return"string"}},inBlock:function(e,t){return function(r,i){for(;!r.eol();){if(r.match(t)){i.tokenize=a.tokenizer;break}r.next()}return e}}};return{startState:function(){return{tokenize:a.tokenizer,mode:"smarty",last:null,depth:0}},token:function(e,t){var i=t.tokenize(e,t);return t.last=r,i},electricChars:""}}),e.defineMIME("text/x-smarty","smarty")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/smartymixed/smartymixed.min.js b/media/editors/codemirror/mode/smartymixed/smartymixed.min.js new file mode 100644 index 0000000000000..e03874816389f --- /dev/null +++ b/media/editors/codemirror/mode/smartymixed/smartymixed.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../smarty/smarty")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../smarty/smarty"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("smartymixed",function(e){function l(t){return t.replace(/[^\s\w]/g,"\\$&")}var i=t.getMode(e,"htmlmixed"),a=t.getMode(e,"smarty"),r={rightDelimiter:"}",leftDelimiter:"{"};e.hasOwnProperty("leftDelimiter")&&(r.leftDelimiter=e.leftDelimiter),e.hasOwnProperty("rightDelimiter")&&(r.rightDelimiter=e.rightDelimiter);var n=l(r.leftDelimiter),o=l(r.rightDelimiter),m={smartyComment:new RegExp("^"+o+"\\*"),literalOpen:new RegExp(n+"literal"+o),literalClose:new RegExp(n+"/literal"+o),hasLeftDelimeter:new RegExp(".*"+n),htmlHasLeftDelimeter:new RegExp("[^<>]*"+n)},c={chain:function(t,e,l){return e.tokenize=l,l(t,e)},cleanChain:function(t,e,l){return e.tokenize=null,e.localState=null,e.localMode=null,"string"==typeof l?l?l:null:l(t,e)},maybeBackup:function(t,e,l){var i,a=t.current(),r=a.search(e);return r>-1?t.backUp(a.length-r):(i=a.match(/<\/?$/))&&(t.backUp(a.length),t.match(e,!1)||t.match(a[0])),l}},h={html:function(t,e){var l=e.htmlMixedState.htmlState.context&&e.htmlMixedState.htmlState.context.tagName?e.htmlMixedState.htmlState.context.tagName:null;return!e.inLiteral&&t.match(m.htmlHasLeftDelimeter,!1)&&null===l?(e.tokenize=h.smarty,e.localMode=a,e.localState=a.startState(i.indent(e.htmlMixedState,"")),c.maybeBackup(t,r.leftDelimiter,a.token(t,e.localState))):!e.inLiteral&&t.match(r.leftDelimiter,!1)?(e.tokenize=h.smarty,e.localMode=a,e.localState=a.startState(i.indent(e.htmlMixedState,"")),c.maybeBackup(t,r.leftDelimiter,a.token(t,e.localState))):i.token(t,e.htmlMixedState)},smarty:function(t,e){if(t.match(r.leftDelimiter,!1)){if(t.match(m.smartyComment,!1))return c.chain(t,e,h.inBlock("comment","*"+r.rightDelimiter))}else if(t.match(r.rightDelimiter,!1))return t.eat(r.rightDelimiter),e.tokenize=h.html,e.localMode=i,e.localState=e.htmlMixedState,"tag";return c.maybeBackup(t,r.rightDelimiter,a.token(t,e.localState))},inBlock:function(t,e){return function(l,i){for(;!l.eol();){if(l.match(e)){c.cleanChain(l,i,"");break}l.next()}return t}}};return{startState:function(){var t=i.startState();return{token:h.html,localMode:null,localState:null,htmlMixedState:t,tokenize:null,inLiteral:!1}},copyState:function(e){var l=null,r=e.tokenize||e.token;return e.localState&&(l=t.copyState(r!=h.html?a:i,e.localState)),{token:e.token,tokenize:e.tokenize,localMode:e.localMode,localState:l,htmlMixedState:t.copyState(i,e.htmlMixedState),inLiteral:e.inLiteral}},token:function(t,e){if(t.match(r.leftDelimiter,!1)){if(!e.inLiteral&&t.match(m.literalOpen,!0))return e.inLiteral=!0,"keyword";if(e.inLiteral&&t.match(m.literalClose,!0))return e.inLiteral=!1,"keyword"}e.inLiteral&&e.localState!=e.htmlMixedState&&(e.tokenize=h.html,e.localMode=i,e.localState=e.htmlMixedState);var l=(e.tokenize||e.token)(t,e);return l},indent:function(e,l){return e.localMode==a||e.inLiteral&&!e.localMode||m.hasLeftDelimeter.test(l)?t.Pass:i.indent(e.htmlMixedState,l)},innerMode:function(t){return{state:t.localState||t.htmlMixedState,mode:t.localMode||i}}}},"htmlmixed","smarty"),t.defineMIME("text/x-smarty","smartymixed")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/solr/solr.min.js b/media/editors/codemirror/mode/solr/solr.min.js new file mode 100644 index 0000000000000..e7af1e6699d06 --- /dev/null +++ b/media/editors/codemirror/mode/solr/solr.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("solr",function(){function e(e){return parseFloat(e,10).toString()===e}function t(e){return function(t,n){for(var r,i=!1;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=o),"string"}}function n(e){return function(t,n){var r="operator";return"+"==e?r+=" positive":"-"==e?r+=" negative":"|"==e?t.eat(/\|/):"&"==e?t.eat(/\&/):"^"==e&&(r+=" boost"),n.tokenize=o,r}}function r(t){return function(n,r){for(var u=t;(t=n.peek())&&null!=t.match(i);)u+=n.next();return r.tokenize=o,f.test(u)?"operator":e(u)?"number":":"==n.peek()?"field":"string"}}function o(e,f){var c=e.next();return'"'==c?f.tokenize=t(c):u.test(c)?f.tokenize=n(c):i.test(c)&&(f.tokenize=r(c)),f.tokenize!=o?f.tokenize(e,f):null}var i=/[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/,u=/[\|\!\+\-\*\?\~\^\&]/,f=/^(OR|AND|NOT|TO)$/i;return{startState:function(){return{tokenize:o}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)}}}),e.defineMIME("text/x-solr","solr")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/soy/soy.min.js b/media/editors/codemirror/mode/soy/soy.min.js new file mode 100644 index 0000000000000..aef317fedb464 --- /dev/null +++ b/media/editors/codemirror/mode/soy/soy.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],t):t(CodeMirror)}(function(t){"use strict";var e=["template","literal","msg","fallbackmsg","let","if","elseif","else","switch","case","default","foreach","ifempty","for","call","param","deltemplate","delcall","log"];t.defineMode("soy",function(n){function a(t){return t[t.length-1]}function i(t,e,n){var a=t.string,i=n.exec(a.substr(t.pos));i&&(t.string=a.substr(0,t.pos+i.index));var l=t.hideFirstChars(e.indent,function(){return e.localMode.token(t,e.localState)});return t.string=a,l}var l=t.getMode(n,"text/plain"),o={html:t.getMode(n,{name:"text/html",multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:l,text:l,uri:l,css:t.getMode(n,"text/css"),js:t.getMode(n,{name:"text/javascript",statementIndent:2*n.indentUnit})};return{startState:function(){return{kind:[],kindTag:[],soyState:[],indent:0,localMode:o.html,localState:t.startState(o.html)}},copyState:function(e){return{tag:e.tag,kind:e.kind.concat([]),kindTag:e.kindTag.concat([]),soyState:e.soyState.concat([]),indent:e.indent,localMode:e.localMode,localState:t.copyState(e.localMode,e.localState)}},token:function(l,s){var r;switch(a(s.soyState)){case"comment":return l.match(/^.*?\*\//)?s.soyState.pop():l.skipToEnd(),"comment";case"variable":return l.match(/^}/)?(s.indent-=2*n.indentUnit,s.soyState.pop(),"variable-2"):(l.next(),null);case"tag":if(l.match(/^\/?}/))return"/template"==s.tag||"/deltemplate"==s.tag?s.indent=0:s.indent-=("/}"==l.current()||-1==e.indexOf(s.tag)?2:1)*n.indentUnit,s.soyState.pop(),"keyword";if(l.match(/^(\w+)(?==)/)){if("kind"==l.current()&&(r=l.match(/^="([^"]+)/,!1))){var c=r[1];s.kind.push(c),s.kindTag.push(s.tag),s.localMode=o[c]||o.html,s.localState=t.startState(s.localMode)}return"attribute"}return l.match(/^"/)?(s.soyState.push("string"),"string"):(l.next(),null);case"literal":return l.match(/^(?=\{\/literal})/)?(s.indent-=n.indentUnit,s.soyState.pop(),this.token(l,s)):i(l,s,/\{\/literal}/);case"string":return l.match(/^.*?"/)?s.soyState.pop():l.skipToEnd(),"string"}return l.match(/^\/\*/)?(s.soyState.push("comment"),"comment"):l.match(l.sol()?/^\s*\/\/.*/:/^\s+\/\/.*/)?"comment":l.match(/^\{\$\w*/)?(s.indent+=2*n.indentUnit,s.soyState.push("variable"),"variable-2"):l.match(/^\{literal}/)?(s.indent+=n.indentUnit,s.soyState.push("literal"),"keyword"):(r=l.match(/^\{([\/@\\]?\w*)/))?("/switch"!=r[1]&&(s.indent+=(/^(\/|(else|elseif|case|default)$)/.test(r[1])&&"switch"!=s.tag?1:2)*n.indentUnit),s.tag=r[1],s.tag=="/"+a(s.kindTag)&&(s.kind.pop(),s.kindTag.pop(),s.localMode=o[a(s.kind)]||o.html,s.localState=t.startState(s.localMode)),s.soyState.push("tag"),"keyword"):i(l,s,/\{|\s+\/\/|\/\*/)},indent:function(e,i){var l=e.indent,o=a(e.soyState);if("comment"==o)return t.Pass;if("literal"==o)/^\{\/literal}/.test(i)&&(l-=n.indentUnit);else{if(/^\s*\{\/(template|deltemplate)\b/.test(i))return 0;/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(i)&&(l-=n.indentUnit),"switch"!=e.tag&&/^\{(case|default)\b/.test(i)&&(l-=n.indentUnit),/^\{\/switch\b/.test(i)&&(l-=n.indentUnit)}return l&&e.localMode.indent&&(l+=e.localMode.indent(e.localState,i)),l},innerMode:function(t){return t.soyState.length&&"literal"!=a(t.soyState)?null:{state:t.localState,mode:t.localMode}},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",fold:"indent"}},"htmlmixed"),t.registerHelper("hintWords","soy",e.concat(["delpackage","namespace","alias","print","css","debugger"])),t.defineMIME("text/x-soy","soy")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/sparql/sparql.min.js b/media/editors/codemirror/mode/sparql/sparql.min.js new file mode 100644 index 0000000000000..ed0d4718f4768 --- /dev/null +++ b/media/editors/codemirror/mode/sparql/sparql.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("sparql",function(t){function e(t){return new RegExp("^(?:"+t.join("|")+")$","i")}function n(t,e){var n=t.next();if(a=null,"$"==n||"?"==n)return"?"==n&&t.match(/\s/,!1)?"operator":(t.match(/^[\w\d]*/),"variable-2");if("<"!=n||t.match(/^[\s\u00a0=]/,!1)){if('"'==n||"'"==n)return e.tokenize=r(n),e.tokenize(t,e);if(/[{}\(\),\.;\[\]]/.test(n))return a=n,"bracket";if("#"==n)return t.skipToEnd(),"comment";if(l.test(n))return t.eatWhile(l),"operator";if(":"==n)return t.eatWhile(/[\w\d\._\-]/),"atom";if("@"==n)return t.eatWhile(/[a-z\d\-]/i),"meta";if(t.eatWhile(/[_\w\d]/),t.eat(":"))return t.eatWhile(/[\w\d_\-]/),"atom";var i=t.current();return s.test(i)?"builtin":u.test(i)?"keyword":"variable"}return t.match(/^[^\s\u00a0>]*>?/),"atom"}function r(t){return function(e,r){for(var i,o=!1;null!=(i=e.next());){if(i==t&&!o){r.tokenize=n;break}o=!o&&"\\"==i}return"string"}}function i(t,e,n){t.context={prev:t.context,indent:t.indent,col:n,type:e}}function o(t){t.indent=t.context.indent,t.context=t.context.prev}var a,c=t.indentUnit,s=e(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","iri","uri","bnode","count","sum","min","max","avg","sample","group_concat","rand","abs","ceil","floor","round","concat","substr","strlen","replace","ucase","lcase","encode_for_uri","contains","strstarts","strends","strbefore","strafter","year","month","day","hours","minutes","seconds","timezone","tz","now","uuid","struuid","md5","sha1","sha256","sha384","sha512","coalesce","if","strlang","strdt","isnumeric","regex","exists","isblank","isliteral","a"]),u=e(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc","as","having","undef","values","group","minus","in","not","service","silent","using","insert","delete","union","true","false","with","data","copy","to","move","add","create","drop","clear","load"]),l=/[*+\-<>=&|\^\/!\?]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(t,e){if(t.sol()&&(e.context&&null==e.context.align&&(e.context.align=!1),e.indent=t.indentation()),t.eatSpace())return null;var n=e.tokenize(t,e);if("comment"!=n&&e.context&&null==e.context.align&&"pattern"!=e.context.type&&(e.context.align=!0),"("==a)i(e,")",t.column());else if("["==a)i(e,"]",t.column());else if("{"==a)i(e,"}",t.column());else if(/[\]\}\)]/.test(a)){for(;e.context&&"pattern"==e.context.type;)o(e);e.context&&a==e.context.type&&o(e)}else"."==a&&e.context&&"pattern"==e.context.type?o(e):/atom|string|variable/.test(n)&&e.context&&(/[\}\]]/.test(e.context.type)?i(e,"pattern",t.column()):"pattern"!=e.context.type||e.context.align||(e.context.align=!0,e.context.col=t.column()));return n},indent:function(t,e){var n=e&&e.charAt(0),r=t.context;if(/[\]\}]/.test(n))for(;r&&"pattern"==r.type;)r=r.prev;var i=r&&n==r.type;return r?"pattern"==r.type?r.col:r.align?r.col+(i?0:1):r.indent+(i?0:c):0}}}),t.defineMIME("application/sparql-query","sparql")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js b/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js new file mode 100644 index 0000000000000..b78270613dbc1 --- /dev/null +++ b/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("spreadsheet",function(){return{startState:function(){return{stringType:null,stack:[]}},token:function(e,t){if(e){switch(0===t.stack.length&&('"'==e.peek()||"'"==e.peek())&&(t.stringType=e.peek(),e.next(),t.stack.unshift("string")),t.stack[0]){case"string":for(;"string"===t.stack[0]&&!e.eol();)e.peek()===t.stringType?(e.next(),t.stack.shift()):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return"string";case"characterClass":for(;"characterClass"===t.stack[0]&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(/^\\./)||t.stack.shift();return"operator"}var r=e.peek();switch(r){case"[":return e.next(),t.stack.unshift("characterClass"),"bracket";case":":return e.next(),"operator";case"\\":return e.match(/\\[a-z]+/)?"string-2":null;case".":case",":case";":case"*":case"-":case"+":case"^":case"<":case"/":case"=":return e.next(),"atom";case"$":return e.next(),"builtin"}return e.match(/\d+/)?e.match(/^\w+/)?"error":"number":e.match(/^[a-zA-Z_]\w*/)?e.match(/(?=[\(.])/,!1)?"keyword":"variable-2":-1!=["[","]","(",")","{","}"].indexOf(r)?(e.next(),"bracket"):(e.eatSpace()||e.next(),null)}}}}),e.defineMIME("text/x-spreadsheet","spreadsheet")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/sql/sql.js b/media/editors/codemirror/mode/sql/sql.js index f2c2384a7289c..ee6c194b0e8c9 100644 --- a/media/editors/codemirror/mode/sql/sql.js +++ b/media/editors/codemirror/mode/sql/sql.js @@ -190,7 +190,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { indent: function(state, textAfter) { var cx = state.context; - if (!cx) return 0; + if (!cx) return CodeMirror.Pass; var closing = textAfter.charAt(0) == cx.type; if (cx.align) return cx.col + (closing ? 0 : 1); else return cx.indent + (closing ? 0 : config.indentUnit); diff --git a/media/editors/codemirror/mode/sql/sql.min.js b/media/editors/codemirror/mode/sql/sql.min.js new file mode 100644 index 0000000000000..d88b6912e3f17 --- /dev/null +++ b/media/editors/codemirror/mode/sql/sql.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,r){function a(e,t){var r=e.next();if(b[r]){var a=b[r](e,t);if(a!==!1)return a}if(1==p.hexNumber&&("0"==r&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==r||"X"==r)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==r||"B"==r)&&e.match(/^'[01]+'/)||"0"==r&&e.match(/^b[01]+/)))return"number";if(r.charCodeAt(0)>47&&r.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==r&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==r||'"'==r&&p.doubleQuote)return t.tokenize=n(r),t.tokenize(e,t);if((1==p.nCharCast&&("n"==r||"N"==r)||1==p.charsetCast&&"_"==r&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(r))return null;if(p.commentSlashSlash&&"/"==r&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==r||"-"==r&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==r&&e.eat("*"))return t.tokenize=i,t.tokenize(e,t);if("."!=r){if(m.test(r))return e.eatWhile(m),null;if("{"==r&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var o=e.current().toLowerCase();return h.hasOwnProperty(o)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(o)?"atom":u.hasOwnProperty(o)?"builtin":d.hasOwnProperty(o)?"keyword":l.hasOwnProperty(o)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function n(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){r.tokenize=a;break}i=!i&&"\\"==n}return"string"}}function i(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=a;break}}return"comment"}function o(e,t,r){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:r}}function s(e){e.indent=e.context.indent,e.context=e.context.prev}var l=r.client||{},c=r.atoms||{"false":!0,"true":!0,"null":!0},u=r.builtin||{},d=r.keywords||{},m=r.operatorChars||/^[*+\-%<>!=&|~^]/,p=r.support||{},b=r.hooks||{},h=r.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:a,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var r=t.tokenize(e,t);if("comment"==r)return r;t.context&&null==t.context.align&&(t.context.align=!0);var a=e.current();return"("==a?o(e,t,")"):"["==a?o(e,t,"]"):t.context&&t.context.type==a&&s(t),r},indent:function(r,a){var n=r.context;if(!n)return e.Pass;var i=a.charAt(0)==n.type;return n.align?n.col+(i?0:1):n.indent+(i?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function r(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function a(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function n(e){for(var t={},r=e.split(" "),a=0;a!=]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),builtin:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:n("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":r}}),e.defineMIME("text/x-mysql",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"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 groupby_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:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":a}}),e.defineMIME("text/x-mariadb",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"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:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":a}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:n("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"),builtin:n("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"),atoms:n("false true"),operatorChars:/^[<>=]/,dateSQL:{},support:n("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:n("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:n("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:n("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 lenght lenghtb 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:n("date time timestamp"),support:n("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:n("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:n("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:n("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:n("date timestamp"),support:n("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/stex/stex.min.js b/media/editors/codemirror/mode/stex/stex.min.js new file mode 100644 index 0000000000000..66b9ba2206e94 --- /dev/null +++ b/media/editors/codemirror/mode/stex/stex.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("stex",function(){function t(t,e){t.cmdState.push(e)}function e(t){return t.cmdState.length>0?t.cmdState[t.cmdState.length-1]:null}function n(t){var e=t.cmdState.pop();e&&e.closeBracket()}function r(t){for(var e=t.cmdState,n=e.length-1;n>=0;n--){var r=e[n];if("DEFAULT"!=r.name)return r}return{styleIdentifier:function(){return null}}}function i(t,e,n){return function(){this.name=t,this.bracketNo=0,this.style=e,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}function a(t,e){t.f=e}function c(n,i){var c;if(n.match(/^\\[a-zA-Z@]+/)){var s=n.current().slice(1);return c=f[s]||f.DEFAULT,c=new c,t(i,c),a(i,o),c.style}if(n.match(/^\\[$&%#{}_]/))return"tag";if(n.match(/^\\[,;!\/\\]/))return"tag";if(n.match("\\["))return a(i,function(t,e){return u(t,e,"\\]")}),"keyword";if(n.match("$$"))return a(i,function(t,e){return u(t,e,"$$")}),"keyword";if(n.match("$"))return a(i,function(t,e){return u(t,e,"$")}),"keyword";var m=n.next();return"%"==m?(n.skipToEnd(),"comment"):"}"==m||"]"==m?(c=e(i))?(c.closeBracket(m),a(i,o),"bracket"):"error":"{"==m||"["==m?(c=f.DEFAULT,c=new c,t(i,c),"bracket"):/\d/.test(m)?(n.eatWhile(/[\w.%]/),"atom"):(n.eatWhile(/[\w\-_]/),c=r(i),"begin"==c.name&&(c.argument=n.current()),c.styleIdentifier())}function u(t,e,n){if(t.eatSpace())return null;if(t.match(n))return a(e,c),"keyword";if(t.match(/^\\[a-zA-Z@]+/))return"tag";if(t.match(/^[a-zA-Z]+/))return"variable-2";if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/]/))return"tag";if(t.match(/^[\^_&]/))return"tag";if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=t.next();return"{"==r||"}"==r||"["==r||"]"==r||"("==r||")"==r?"bracket":"%"==r?(t.skipToEnd(),"comment"):"error"}function o(t,r){var i,u=t.peek();return"{"==u||"["==u?(i=e(r),i.openBracket(u),t.eat(u),a(r,c),"bracket"):/[ \t\r]/.test(u)?(t.eat(u),null):(a(r,c),n(r),c(t,r))}var f={};return f.importmodule=i("importmodule","tag",["string","builtin"]),f.documentclass=i("documentclass","tag",["","atom"]),f.usepackage=i("usepackage","tag",["atom"]),f.begin=i("begin","tag",["atom"]),f.end=i("end","tag",["atom"]),f.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:c}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=c,t.cmdState.length=0},lineComment:"%"}}),t.defineMIME("text/x-stex","stex"),t.defineMIME("text/x-latex","stex")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/stex/test.min.js b/media/editors/codemirror/mode/stex/test.min.js new file mode 100644 index 0000000000000..3ca4b62bfee4c --- /dev/null +++ b/media/editors/codemirror/mode/stex/test.min.js @@ -0,0 +1 @@ +!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4},"stex");t("word","foo"),t("twoWords","foo bar"),t("beginEndDocument","[tag \\begin][bracket {][atom document][bracket }]","[tag \\end][bracket {][atom document][bracket }]"),t("beginEndEquation","[tag \\begin][bracket {][atom equation][bracket }]"," E=mc^2","[tag \\end][bracket {][atom equation][bracket }]"),t("beginModule","[tag \\begin][bracket {][atom module][bracket }[[]]]"),t("beginModuleId","[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]"),t("importModule","[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]"),t("importModulePath","[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]"),t("psForPDF","[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]"),t("comment","[comment % foo]"),t("tagComment","[tag \\item][comment % bar]"),t("commentTag"," [comment % \\item]"),t("commentLineBreak","[comment %]","foo"),t("tagErrorCurly","[tag \\begin][error }][bracket {]"),t("tagErrorSquare","[tag \\item][error ]]][bracket {]"),t("commentCurly","[comment % }]"),t("tagHash","the [tag \\#] key"),t("tagNumber","a [tag \\$][atom 5] stetson"),t("tagPercent","[atom 100][tag \\%] beef"),t("tagAmpersand","L [tag \\&] N"),t("tagUnderscore","foo[tag \\_]bar"),t("tagBracketOpen","[tag \\emph][bracket {][tag \\{][bracket }]"),t("tagBracketClose","[tag \\emph][bracket {][tag \\}][bracket }]"),t("tagLetterNumber","section [tag \\S][atom 1]"),t("textTagNumber","para [tag \\P][atom 2]"),t("thinspace","x[tag \\,]y"),t("thickspace","x[tag \\;]y"),t("negativeThinspace","x[tag \\!]y"),t("periodNotSentence","J.\\ L.\\ is"),t("periodSentence","X[tag \\@]. The"),t("italicCorrection","[bracket {][tag \\em] If[tag \\/][bracket }] I"),t("tagBracket","[tag \\newcommand][bracket {][tag \\pop][bracket }]"),t("inlineMathTagFollowedByNumber","[keyword $][tag \\pi][number 2][keyword $]"),t("inlineMath","[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text"),t("displayMath","More [keyword $$] [variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text"),t("mathWithComment","[keyword $][variable-2 x] [comment % $]","[variable-2 y][keyword $] other text"),t("lineBreakArgument","[tag \\\\][bracket [[][atom 1cm][bracket ]]]")}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/stylus/stylus.js b/media/editors/codemirror/mode/stylus/stylus.js new file mode 100644 index 0000000000000..6f7c75442531e --- /dev/null +++ b/media/editors/codemirror/mode/stylus/stylus.js @@ -0,0 +1,444 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("stylus", function(config) { + + var operatorsRegexp = /^(\?:?|\+[+=]?|-[\-=]?|\*[\*=]?|\/=?|[=!:\?]?=|<=?|>=?|%=?|&&|\|=?|\~|!|\^|\\)/, + delimitersRegexp = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/, + wordOperatorsRegexp = wordRegexp(wordOperators), + commonKeywordsRegexp = wordRegexp(commonKeywords), + commonAtomsRegexp = wordRegexp(commonAtoms), + commonDefRegexp = wordRegexp(commonDef), + vendorPrefixesRegexp = new RegExp(/^\-(moz|ms|o|webkit)-/), + cssValuesWithBracketsRegexp = new RegExp("^(" + cssValuesWithBrackets_.join("|") + ")\\([\\w\-\\#\\,\\.\\%\\s\\(\\)]*\\)"); + + var tokenBase = function(stream, state) { + + if (stream.eatSpace()) return null; + + var ch = stream.peek(); + + // Single line Comment + if (stream.match('//')) { + stream.skipToEnd(); + return "comment"; + } + + // Multiline Comment + if (stream.match('/*')) { + state.tokenizer = multilineComment; + return state.tokenizer(stream, state); + } + + // Strings + if (ch === '"' || ch === "'") { + stream.next(); + state.tokenizer = buildStringTokenizer(ch); + return "string"; + } + + // Def + if (ch === "@") { + stream.next(); + if (stream.match(/extend/)) { + dedent(state); // remove indentation after selectors + } else if (stream.match(/media[\w-\s]*[\w-]/)) { + indent(state); + } else if(stream.eatWhile(/[\w-]/)) { + if(stream.current().match(commonDefRegexp)) { + indent(state); + } + } + return "def"; + } + + // Number + if (stream.match(/^-?[0-9\.]/, false)) { + + // Floats + if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i) || stream.match(/^-?\d+\.\d*/)) { + + // Prevent from getting extra . on 1.. + if (stream.peek() == ".") { + stream.backUp(1); + } + // Units + stream.eatWhile(/[a-z%]/i); + return "number"; + } + // Integers + if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/) || stream.match(/^-?0(?![\dx])/i)) { + // Units + stream.eatWhile(/[a-z%]/i); + return "number"; + } + } + + // Hex color and id selector + if (ch === "#") { + stream.next(); + + // Hex color + if (stream.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i)) { + return "atom"; + } + + // ID selector + if (stream.match(/^[\w-]+/i)) { + indent(state); + return "builtin"; + } + } + + // Vendor prefixes + if (stream.match(vendorPrefixesRegexp)) { + return "meta"; + } + + // Gradients and animation as CSS value + if (stream.match(cssValuesWithBracketsRegexp)) { + return "atom"; + } + + // Mixins / Functions with indentation + if (stream.sol() && stream.match(/^\.?[a-z][\w-]*\(/i)) { + stream.backUp(1); + indent(state); + return "keyword"; + } + + // Mixins / Functions + if (stream.match(/^\.?[a-z][\w-]*\(/i)) { + stream.backUp(1); + return "keyword"; + } + + // +Block mixins + if (stream.match(/^(\+|\-)[a-z][\w-]+\(/i)) { + stream.backUp(1); + indent(state); + return "keyword"; + } + + // url tokens + if (stream.match(/^url/) && stream.peek() === "(") { + state.tokenizer = urlTokens; + if(!stream.peek()) { + state.cursorHalf = 0; + } + return "atom"; + } + + // Class + if (stream.match(/^\.[a-z][\w-]*/i)) { + indent(state); + return "qualifier"; + } + + // & Parent Reference with BEM naming + if (stream.match(/^(_|__|-|--)[a-z0-9-]+/)) { + return "qualifier"; + } + + // Pseudo elements/classes + if (ch == ':' && stream.match(/^::?[\w-]+/)) { + indent(state); + return "variable-3"; + } + + // Conditionals + if (stream.match(wordRegexp(["for", "if", "else", "unless"]))) { + indent(state); + return "keyword"; + } + + // Keywords + if (stream.match(commonKeywordsRegexp)) { + return "keyword"; + } + + // Atoms + if (stream.match(commonAtomsRegexp)) { + return "atom"; + } + + // Variables + if (stream.match(/^\$?[a-z][\w-]+\s?=(\s|[\w-'"\$])/i)) { + stream.backUp(2); + var cssPropertie = stream.current().toLowerCase().match(/[\w-]+/)[0]; + return cssProperties[cssPropertie] === undefined ? "variable-2" : "property"; + } else if (stream.match(/\$[\w-\.]+/i)) { + return "variable-2"; + } else if (stream.match(/\$?[\w-]+\.[\w-]+/i)) { + var cssTypeSelector = stream.current().toLowerCase().match(/[\w]+/)[0]; + if(cssTypeSelectors[cssTypeSelector] === undefined) { + return "variable-2"; + } else stream.backUp(stream.current().length); + } + + // !important + if (ch === "!") { + stream.next(); + return stream.match(/^[\w]+/) ? "keyword": "operator"; + } + + // / Root Reference + if (stream.match(/^\/(:|\.|#|[a-z])/)) { + stream.backUp(1); + return "variable-3"; + } + + // Operators and delimiters + if (stream.match(operatorsRegexp) || stream.match(wordOperatorsRegexp)) { + return "operator"; + } + if (stream.match(delimitersRegexp)) { + return null; + } + + // & Parent Reference + if (ch === "&") { + stream.next(); + return "variable-3"; + } + + // Font family + if (stream.match(/^[A-Z][a-z0-9-]+/)) { + return "string"; + } + + // CSS rule + // NOTE: Some css selectors and property values have the same name + // (embed, menu, pre, progress, sub, table), + // so they will have the same color (.cm-atom). + if (stream.match(/[\w-]*/i)) { + + var word = stream.current().toLowerCase(); + + if(cssProperties[word] !== undefined) { + // CSS property + if(!stream.eol()) + return "property"; + else + return "variable-2"; + + } else if(cssValues[word] !== undefined) { + // CSS value + return "atom"; + + } else if(cssTypeSelectors[word] !== undefined) { + // CSS type selectors + indent(state); + return "tag"; + + } else if(word) { + // By default variable-2 + return "variable-2"; + } + } + + // Handle non-detected items + stream.next(); + return null; + + }; + + var tokenLexer = function(stream, state) { + + if (stream.sol()) { + state.indentCount = 0; + } + + var style = state.tokenizer(stream, state); + var current = stream.current(); + + if (stream.eol() && (current === "}" || current === ",")) { + dedent(state); + } + + if (style !== null) { + var startOfToken = stream.pos - current.length; + var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); + + var newScopes = []; + + for (var i = 0; i < state.scopes.length; i++) { + var scope = state.scopes[i]; + + if (scope.offset <= withCurrentIndent) { + newScopes.push(scope); + } + } + + state.scopes = newScopes; + } + + return style; + }; + + return { + startState: function() { + return { + tokenizer: tokenBase, + scopes: [{offset: 0, type: 'styl'}] + }; + }, + + token: function(stream, state) { + var style = tokenLexer(stream, state); + state.lastToken = { style: style, content: stream.current() }; + return style; + }, + + indent: function(state) { + return state.scopes[0].offset; + }, + + lineComment: "//", + fold: "indent" + + }; + + function urlTokens(stream, state) { + var ch = stream.peek(); + + if (ch === ")") { + stream.next(); + state.tokenizer = tokenBase; + return "operator"; + } else if (ch === "(") { + stream.next(); + stream.eatSpace(); + + return "operator"; + } else if (ch === "'" || ch === '"') { + state.tokenizer = buildStringTokenizer(stream.next()); + return "string"; + } else { + state.tokenizer = buildStringTokenizer(")", false); + return "string"; + } + } + + function multilineComment(stream, state) { + if (stream.skipTo("*/")) { + stream.next(); + stream.next(); + state.tokenizer = tokenBase; + } else { + stream.next(); + } + return "comment"; + } + + function buildStringTokenizer(quote, greedy) { + + if(greedy == null) { + greedy = true; + } + + function stringTokenizer(stream, state) { + var nextChar = stream.next(); + var peekChar = stream.peek(); + var previousChar = stream.string.charAt(stream.pos-2); + + var endingString = ((nextChar !== "\\" && peekChar === quote) || + (nextChar === quote && previousChar !== "\\")); + + if (endingString) { + if (nextChar !== quote && greedy) { + stream.next(); + } + state.tokenizer = tokenBase; + return "string"; + } else if (nextChar === "#" && peekChar === "{") { + state.tokenizer = buildInterpolationTokenizer(stringTokenizer); + stream.next(); + return "operator"; + } else { + return "string"; + } + } + + return stringTokenizer; + } + + function buildInterpolationTokenizer(currentTokenizer) { + return function(stream, state) { + if (stream.peek() === "}") { + stream.next(); + state.tokenizer = currentTokenizer; + return "operator"; + } else { + return tokenBase(stream, state); + } + }; + } + + function indent(state) { + if (state.indentCount == 0) { + state.indentCount++; + var lastScopeOffset = state.scopes[0].offset; + var currentOffset = lastScopeOffset + config.indentUnit; + state.scopes.unshift({ offset:currentOffset }); + } + } + + function dedent(state) { + if (state.scopes.length == 1) { return true; } + state.scopes.shift(); + } + + }); + + // https://developer.mozilla.org/en-US/docs/Web/HTML/Element + var cssTypeSelectors_ = ["a","abbr","address","area","article","aside","audio", "b", "base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]; + // https://github.com/csscomb/csscomb.js/blob/master/config/zen.json + var cssProperties_ = ["position","top","right","bottom","left","z-index","display","visibility","flex-direction","flex-order","flex-pack","float","clear","flex-align","overflow","overflow-x","overflow-y","overflow-scrolling","clip","box-sizing","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","min-width","min-height","max-width","max-height","width","height","outline","outline-width","outline-style","outline-color","outline-offset","border","border-spacing","border-collapse","border-width","border-style","border-color","border-top","border-top-width","border-top-style","border-top-color","border-right","border-right-width","border-right-style","border-right-color","border-bottom","border-bottom-width","border-bottom-style","border-bottom-color","border-left","border-left-width","border-left-style","border-left-color","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-image","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat","border-top-image","border-right-image","border-bottom-image","border-left-image","border-corner-image","border-top-left-image","border-top-right-image","border-bottom-right-image","border-bottom-left-image","background","filter:progid:DXImageTransform\\.Microsoft\\.AlphaImageLoader","background-color","background-image","background-attachment","background-position","background-position-x","background-position-y","background-clip","background-origin","background-size","background-repeat","box-decoration-break","box-shadow","color","table-layout","caption-side","empty-cells","list-style","list-style-position","list-style-type","list-style-image","quotes","content","counter-increment","counter-reset","writing-mode","vertical-align","text-align","text-align-last","text-decoration","text-emphasis","text-emphasis-position","text-emphasis-style","text-emphasis-color","text-indent","-ms-text-justify","text-justify","text-outline","text-transform","text-wrap","text-overflow","text-overflow-ellipsis","text-overflow-mode","text-size-adjust","text-shadow","white-space","word-spacing","word-wrap","word-break","tab-size","hyphens","letter-spacing","font","font-weight","font-style","font-variant","font-size-adjust","font-stretch","font-size","font-family","src","line-height","opacity","filter:\\\\\\\\'progid:DXImageTransform.Microsoft.Alpha","filter:progid:DXImageTransform.Microsoft.Alpha\\(Opacity","interpolation-mode","filter","resize","cursor","nav-index","nav-up","nav-right","nav-down","nav-left","transition","transition-delay","transition-timing-function","transition-duration","transition-property","transform","transform-origin","animation","animation-name","animation-duration","animation-play-state","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","pointer-events","unicode-bidi","direction","columns","column-span","column-width","column-count","column-fill","column-gap","column-rule","column-rule-width","column-rule-style","column-rule-color","break-before","break-inside","break-after","page-break-before","page-break-inside","page-break-after","orphans","widows","zoom","max-zoom","min-zoom","user-zoom","orientation","text-rendering","speak","animation-fill-mode","backface-visibility","user-drag","user-select","appearance"]; + // https://github.com/codemirror/CodeMirror/blob/master/mode/css/css.js#L501 + var cssValues_ = ["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale"]; + var cssColorValues_ = ["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]; + var cssValuesWithBrackets_ = ["gradient","linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","cubic-bezier","translateX","translateY","translate3d","rotate3d","scale","scale3d","perspective","skewX"]; + + var wordOperators = ["in", "and", "or", "not", "is a", "is", "isnt", "defined", "if unless"], + commonKeywords = ["for", "if", "else", "unless", "return"], + commonAtoms = ["null", "true", "false", "href", "title", "type", "not-allowed", "readonly", "disabled"], + commonDef = ["@font-face", "@keyframes", "@media", "@viewport", "@page", "@host", "@supports", "@block", "@css"], + cssTypeSelectors = keySet(cssTypeSelectors_), + cssProperties = keySet(cssProperties_), + cssValues = keySet(cssValues_.concat(cssColorValues_)), + hintWords = wordOperators.concat(commonKeywords, + commonAtoms, + commonDef, + cssTypeSelectors_, + cssProperties_, + cssValues_, + cssValuesWithBrackets_, + cssColorValues_); + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + }; + + function keySet(array) { + var keys = {}; + for (var i = 0; i < array.length; ++i) { + keys[array[i]] = true; + } + return keys; + }; + + CodeMirror.registerHelper("hintWords", "stylus", hintWords); + CodeMirror.defineMIME("text/x-styl", "stylus"); + +}); diff --git a/media/editors/codemirror/mode/stylus/stylus.min.js b/media/editors/codemirror/mode/stylus/stylus.min.js new file mode 100644 index 0000000000000..9f470c9406f01 --- /dev/null +++ b/media/editors/codemirror/mode/stylus/stylus.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e){for(var t={},r=0;r=?|%=?|&&|\|=?|\~|!|\^|\\)/,f=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,w=t(s),k=t(d),y=t(c),v=t(u),x=new RegExp(/^\-(moz|ms|o|webkit)-/),z=new RegExp("^("+l.join("|")+")\\([\\w-\\#\\,\\.\\%\\s\\(\\)]*\\)"),q=function(e,o){if(e.eatSpace())return null;var l=e.peek();if(e.match("//"))return e.skipToEnd(),"comment";if(e.match("/*"))return o.tokenizer=i,o.tokenizer(e,o);if('"'===l||"'"===l)return e.next(),o.tokenizer=a(l),"string";if("@"===l)return e.next(),e.match(/extend/)?b(o):e.match(/media[\w-\s]*[\w-]/)?n(o):e.eatWhile(/[\w-]/)&&e.current().match(v)&&n(o),"def";if(e.match(/^-?[0-9\.]/,!1)){if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)||e.match(/^-?\d+\.\d*/))return"."==e.peek()&&e.backUp(1),e.eatWhile(/[a-z%]/i),"number";if(e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)||e.match(/^-?0(?![\dx])/i))return e.eatWhile(/[a-z%]/i),"number"}if("#"===l){if(e.next(),e.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i))return"atom";if(e.match(/^[\w-]+/i))return n(o),"builtin"}if(e.match(x))return"meta";if(e.match(z))return"atom";if(e.sol()&&e.match(/^\.?[a-z][\w-]*\(/i))return e.backUp(1),n(o),"keyword";if(e.match(/^\.?[a-z][\w-]*\(/i))return e.backUp(1),"keyword";if(e.match(/^(\+|\-)[a-z][\w-]+\(/i))return e.backUp(1),n(o),"keyword";if(e.match(/^url/)&&"("===e.peek())return o.tokenizer=r,e.peek()||(o.cursorHalf=0),"atom";if(e.match(/^\.[a-z][\w-]*/i))return n(o),"qualifier";if(e.match(/^(_|__|-|--)[a-z0-9-]+/))return"qualifier";if(":"==l&&e.match(/^::?[\w-]+/))return n(o),"variable-3";if(e.match(t(["for","if","else","unless"])))return n(o),"keyword";if(e.match(k))return"keyword";if(e.match(y))return"atom";if(e.match(/^\$?[a-z][\w-]+\s?=(\s|[\w-'"\$])/i)){e.backUp(2);var s=e.current().toLowerCase().match(/[\w-]+/)[0];return void 0===p[s]?"variable-2":"property"}if(e.match(/\$[\w-\.]+/i))return"variable-2";if(e.match(/\$?[\w-]+\.[\w-]+/i)){var d=e.current().toLowerCase().match(/[\w]+/)[0];if(void 0===m[d])return"variable-2";e.backUp(e.current().length)}if("!"===l)return e.next(),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(/^\/(:|\.|#|[a-z])/))return e.backUp(1),"variable-3";if(e.match(g)||e.match(w))return"operator";if(e.match(f))return null;if("&"===l)return e.next(),"variable-3";if(e.match(/^[A-Z][a-z0-9-]+/))return"string";if(e.match(/[\w-]*/i)){var c=e.current().toLowerCase();if(void 0!==p[c])return e.eol()?"variable-2":"property";if(void 0!==h[c])return"atom";if(void 0!==m[c])return n(o),"tag";if(c)return"variable-2"}return e.next(),null},j=function(t,r){t.sol()&&(r.indentCount=0);var i=r.tokenizer(t,r),a=t.current();if(!t.eol()||"}"!==a&&","!==a||b(r),null!==i){for(var o=t.pos-a.length,n=o+e.indentUnit*r.indentCount,l=[],s=0;s!?^\/\|]/;return{startState:function(){return{tokenize:t,beforeParams:!1,inParams:!1}},token:function(e,r){return e.eatSpace()?null:r.tokenize(e,r)}}}),e.defineMIME("text/x-tcl","tcl")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/textile/test.min.js b/media/editors/codemirror/mode/textile/test.min.js new file mode 100644 index 0000000000000..d15f50b28b3d5 --- /dev/null +++ b/media/editors/codemirror/mode/textile/test.min.js @@ -0,0 +1 @@ +!function(){function a(a){test.mode(a,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4},"textile");a("simpleParagraphs","Some text.","","Some more text."),a("em","foo [em _bar_]"),a("emBoogus","code_mirror"),a("strong","foo [strong *bar*]"),a("strongBogus","3 * 3 = 9"),a("italic","foo [em __bar__]"),a("italicBogus","code__mirror"),a("bold","foo [strong **bar**]"),a("boldBogus","3 ** 3 = 27"),a("simpleLink",'[link "CodeMirror":http://codemirror.net]'),a("referenceLink",'[link "CodeMirror":code_mirror]',"Normal Text.","[link [[code_mirror]]http://codemirror.net]"),a("footCite","foo bar[qualifier [[1]]]"),a("footCiteBogus","foo bar[[1a2]]"),a("special-characters","Registered [tag (r)], Trademark [tag (tm)], and Copyright [tag (c)] 2008"),a("cite","A book is [keyword ??The Count of Monte Cristo??] by Dumas."),a("additionAndDeletion","The news networks declared [negative -Al Gore-] [positive +George W. Bush+] the winner in Florida."),a("subAndSup","f(x, n) = log [builtin ~4~] x [builtin ^n^]"),a("spanAndCode","A [quote %span element%] and [atom @code element@]"),a("spanBogus","Percentage 25% is not a span."),a("citeBogus","Question? is not a citation."),a("codeBogus","user@example.com"),a("subBogus","~username"),a("supBogus","foo ^ bar"),a("deletionBogus","3 - 3 = 0"),a("additionBogus","3 + 3 = 6"),a("image","An image: [string !http://www.example.com/image.png!]"),a("imageWithAltText","An image: [string !http://www.example.com/image.png (Alt Text)!]"),a("imageWithUrl","An image: [string !http://www.example.com/image.png!:http://www.example.com/]"),a("h1","[header&header-1 h1. foo]"),a("h2","[header&header-2 h2. foo]"),a("h3","[header&header-3 h3. foo]"),a("h4","[header&header-4 h4. foo]"),a("h5","[header&header-5 h5. foo]"),a("h6","[header&header-6 h6. foo]"),a("h7Bogus","h7. foo"),a("multipleHeaders","[header&header-1 h1. Heading 1]","","Some text.","","[header&header-2 h2. Heading 2]","","More text."),a("h1inline","[header&header-1 h1. foo ][header&header-1&em _bar_][header&header-1 baz]"),a("ul","foo","bar","","[variable-2 * foo]","[variable-2 * bar]"),a("ulNoBlank","foo","bar","[variable-2 * foo]","[variable-2 * bar]"),a("ol","foo","bar","","[variable-2 # foo]","[variable-2 # bar]"),a("olNoBlank","foo","bar","[variable-2 # foo]","[variable-2 # bar]"),a("ulFormatting","[variable-2 * ][variable-2&em _foo_][variable-2 bar]","[variable-2 * ][variable-2&strong *][variable-2&em&strong _foo_][variable-2&strong *][variable-2 bar]","[variable-2 * ][variable-2&strong *foo*][variable-2 bar]"),a("olFormatting","[variable-2 # ][variable-2&em _foo_][variable-2 bar]","[variable-2 # ][variable-2&strong *][variable-2&em&strong _foo_][variable-2&strong *][variable-2 bar]","[variable-2 # ][variable-2&strong *foo*][variable-2 bar]"),a("ulNested","[variable-2 * foo]","[variable-3 ** bar]","[keyword *** bar]","[variable-2 **** bar]","[variable-3 ** bar]"),a("olNested","[variable-2 # foo]","[variable-3 ## bar]","[keyword ### bar]","[variable-2 #### bar]","[variable-3 ## bar]"),a("ulNestedWithOl","[variable-2 * foo]","[variable-3 ## bar]","[keyword *** bar]","[variable-2 #### bar]","[variable-3 ** bar]"),a("olNestedWithUl","[variable-2 # foo]","[variable-3 ** bar]","[keyword ### bar]","[variable-2 **** bar]","[variable-3 ## bar]"),a("definitionList","[number - coffee := Hot ][number&em _and_][number black]","","Normal text."),a("definitionListSpan","[number - coffee :=]","","[number Hot ][number&em _and_][number black =:]","","Normal text."),a("boo","[number - dog := woof woof]","[number - cat := meow meow]","[number - whale :=]","[number Whale noises.]","","[number Also, ][number&em _splashing_][number . =:]"),a("divWithAttribute","[punctuation div][punctuation&attribute (#my-id)][punctuation . foo bar]"),a("divWithAttributeAnd2emRightPadding","[punctuation div][punctuation&attribute (#my-id)((][punctuation . foo bar]"),a("divWithClassAndId","[punctuation div][punctuation&attribute (my-class#my-id)][punctuation . foo bar]"),a("paragraphWithCss","p[attribute {color:red;}]. foo bar"),a("paragraphNestedStyles","p. [strong *foo ][strong&em _bar_][strong *]"),a("paragraphWithLanguage","p[attribute [[fr]]]. Parlez-vous français?"),a("paragraphLeftAlign","p[attribute <]. Left"),a("paragraphRightAlign","p[attribute >]. Right"),a("paragraphRightAlign","p[attribute =]. Center"),a("paragraphJustified","p[attribute <>]. Justified"),a("paragraphWithLeftIndent1em","p[attribute (]. Left"),a("paragraphWithRightIndent1em","p[attribute )]. Right"),a("paragraphWithLeftIndent2em","p[attribute ((]. Left"),a("paragraphWithRightIndent2em","p[attribute ))]. Right"),a("paragraphWithLeftIndent3emRightIndent2em","p[attribute ((())]. Right"),a("divFormatting","[punctuation div. ][punctuation&strong *foo ][punctuation&strong&em _bar_][punctuation&strong *]"),a("phraseModifierAttributes","p[attribute (my-class)]. This is a paragraph that has a class and this [em _][em&attribute (#special-phrase)][em emphasized phrase_] has an id."),a("linkWithClass",'[link "(my-class). This is a link with class":http://redcloth.org]'),a("paragraphLayouts","p. This is one paragraph.","","p. This is another."),a("div","[punctuation div. foo bar]"),a("pre","[operator pre. Text]"),a("bq.","[bracket bq. foo bar]","","Normal text."),a("footnote","[variable fn123. foo ][variable&strong *bar*]"),a("bq..ThenParagraph","[bracket bq.. foo bar]","","[bracket More quote.]","p. Normal Text"),a("bq..ThenH1","[bracket bq.. foo bar]","","[bracket More quote.]","[header&header-1 h1. Header Text]"),a("bc..ThenParagraph","[atom bc.. # Some ruby code]","[atom obj = {foo: :bar}]","[atom puts obj]","",'[atom obj[[:love]] = "*love*"]',"[atom puts obj.love.upcase]","","p. Normal text."),a("fn1..ThenParagraph","[variable fn1.. foo bar]","","[variable More.]","p. Normal Text"),a("pre..ThenParagraph","[operator pre.. foo bar]","","[operator More.]","p. Normal Text"),a("table","[variable-3&operator |_. name |_. age|]","[variable-3 |][variable-3&strong *Walter*][variable-3 | 5 |]","[variable-3 |Florence| 6 |]","","p. Normal text."),a("tableWithAttributes","[variable-3&operator |_. name |_. age|]","[variable-3 |][variable-3&attribute /2.][variable-3 Jim |]","[variable-3 |][variable-3&attribute \\2{color: red}.][variable-3 Sam |]"),a("html",'[comment
]','[comment
]',"","[header&header-1 h1. Welcome]","","[variable-2 * Item one]","[variable-2 * Item two]","",'[comment Example]',"","[comment
]","[comment
]"),a("inlineHtml",'I can use HTML directly in my [comment Textile].'),a("notextile","[string-2 notextile. *No* formatting]"),a("notextileInline","Use [string-2 ==*asterisks*==] for [strong *strong*] text."),a("notextileWithPre","[operator pre. *No* formatting]"),a("notextileWithSpanningPre","[operator pre.. *No* formatting]","","[operator *No* formatting]"),a("phrase-in-word","foo_bar_baz"),a("phrase-non-word","[negative -x-] aaa-bbb ccc-ddd [negative -eee-] fff [negative -ggg-]"),a("phrase-lone-dash","foo - bar - baz")}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/textile/textile.min.js b/media/editors/codemirror/mode/textile/textile.min.js new file mode 100644 index 0000000000000..1700000408358 --- /dev/null +++ b/media/editors/codemirror/mode/textile/textile.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){e.mode=f.newLayout,e.tableHeading=!1,"definitionList"===e.layoutType&&e.spanningLayout&&t.match(s("definitionListEnd"),!1)&&(e.spanningLayout=!1)}function n(t,e,n){if("_"===n)return t.eat("_")?i(t,e,"italic",/__/,2):i(t,e,"em",/_/,1);if("*"===n)return t.eat("*")?i(t,e,"bold",/\*\*/,2):i(t,e,"strong",/\*/,1);if("["===n)return t.match(/\d+\]/)&&(e.footCite=!0),a(e);if("("===n){var r=t.match(/^(r|tm|c)\)/);if(r)return l(e,c.specialChar)}if("<"===n&&t.match(/(\w+)[^>]+>[^<]+<\/\1>/))return l(e,c.html);if("?"===n&&t.eat("?"))return i(t,e,"cite",/\?\?/,2);if("="===n&&t.eat("="))return i(t,e,"notextile",/==/,2);if("-"===n&&!t.eat("-"))return i(t,e,"deletion",/-/,1);if("+"===n)return i(t,e,"addition",/\+/,1);if("~"===n)return i(t,e,"sub",/~/,1);if("^"===n)return i(t,e,"sup",/\^/,1);if("%"===n)return i(t,e,"span",/%/,1);if("@"===n)return i(t,e,"code",/@/,1);if("!"===n){var o=i(t,e,"image",/(?:\([^\)]+\))?!/,1);return t.match(/^:\S+/),o}return a(e)}function i(t,e,n,i,r){var l=t.pos>r?t.string.charAt(t.pos-r-1):null,o=t.peek();if(e[n]){if((!o||/\W/.test(o))&&l&&/\S/.test(l)){var u=a(e);return e[n]=!1,u}}else(!l||/\W/.test(l))&&o&&/\S/.test(o)&&t.match(new RegExp("^.*\\S"+i.source+"(?:\\W|$)"),!1)&&(e[n]=!0,e.mode=f.attributes);return a(e)}function a(t){var e=r(t);if(e)return e;var n=[];return t.layoutType&&n.push(c[t.layoutType]),n=n.concat(o(t,"addition","bold","cite","code","deletion","em","footCite","image","italic","link","span","strong","sub","sup","table","tableHeading")),"header"===t.layoutType&&n.push(c.header+"-"+t.header),n.length?n.join(" "):null}function r(t){var e=t.layoutType;switch(e){case"notextile":case"code":case"pre":return c[e];default:return t.notextile?c.notextile+(e?" "+c[e]:""):null}}function l(t,e){var n=r(t);if(n)return n;var i=a(t);return e?i?i+" "+e:e:i}function o(t){for(var e=[],n=1;n]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(t){switch(t){case"drawTable":return d.makeRe("^",d.single.drawTable,"$");case"html":return d.makeRe("^",d.single.html,"(?:",d.single.html,")*","$");case"linkDefinition":return d.makeRe("^",d.single.linkDefinition,"$");case"listLayout":return d.makeRe("^",d.single.list,s("allAttributes"),"*\\s+");case"tableCellAttributes":return d.makeRe("^",d.choiceRe(d.single.tableCellAttributes,s("allAttributes")),"+\\.");case"type":return d.makeRe("^",s("allTypes"));case"typeLayout":return d.makeRe("^",s("allTypes"),s("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return d.makeRe("^",s("allAttributes"),"+");case"allTypes":return d.choiceRe(d.single.div,d.single.foot,d.single.header,d.single.bc,d.single.bq,d.single.notextile,d.single.pre,d.single.table,d.single.para);case"allAttributes":return d.choiceRe(d.attributes.selector,d.attributes.css,d.attributes.lang,d.attributes.align,d.attributes.pad);default:return d.makeRe("^",d.single[t])}},makeRe:function(){for(var t="",e=0;e|]/.test(m)){if("!"==m)return r.skipToEnd(),t("header","header");if("*"==m)return r.eatWhile("*"),t("list","comment");if("#"==m)return r.eatWhile("#"),t("list","comment");if(";"==m)return r.eatWhile(";"),t("list","comment");if(":"==m)return r.eatWhile(":"),t("list","comment");if(">"==m)return r.eatWhile(">"),t("quote","quote");if("|"==m)return t("table","header")}if("{"==m&&r.match(/\{\{/))return e(r,l,o);if(/[hf]/i.test(m)&&/[ti]/i.test(r.peek())&&r.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return t("link","link");if('"'==m)return t("string","string");if("~"==m)return t("text","brace");if(/[\[\]]/.test(m)&&r.peek()==m)return r.next(),t("brace","brace");if("@"==m)return r.eatWhile(h),t("link","link");if(/\d/.test(m))return r.eatWhile(/\d/),t("number","number");if("/"==m){if(r.eat("%"))return e(r,l,n);if(r.eat("/"))return e(r,l,a)}if("_"==m&&r.eat("_"))return e(r,l,u);if("-"==m&&r.eat("-")){if(" "!=r.peek())return e(r,l,c);if(" "==r.peek())return t("text","brace")}if("'"==m&&r.eat("'"))return e(r,l,i);if("<"!=m)return t(m);if(r.eat("<"))return e(r,l,f);r.eatWhile(/[\w\$_]/);var z=r.current(),W=s.propertyIsEnumerable(z)&&s[z];return W?t(W.type,W.style,z):t("text",null,z)}function n(e,n){for(var i,o=!1;i=e.next();){if("/"==i&&o){n.tokenize=r;break}o="%"==i}return t("comment","comment")}function i(e,n){for(var i,o=!1;i=e.next();){if("'"==i&&o){n.tokenize=r;break}o="'"==i}return t("text","strong")}function o(e,n){var i,o=n.block;return o&&e.current()?t("code","comment"):!o&&e.match(W)?(n.tokenize=r,t("code","comment")):o&&e.sol()&&e.match(z)?(n.tokenize=r,t("code","comment")):(i=e.next(),o?t("code","comment"):t("code","comment"))}function a(e,n){for(var i,o=!1;i=e.next();){if("/"==i&&o){n.tokenize=r;break}o="/"==i}return t("text","em")}function u(e,n){for(var i,o=!1;i=e.next();){if("_"==i&&o){n.tokenize=r;break}o="_"==i}return t("text","underlined")}function c(e,n){for(var i,o=!1;i=e.next();){if("-"==i&&o){n.tokenize=r;break}o="-"==i}return t("text","strikethrough")}function f(e,n){var i,o,a;return"<<"==e.current()?t("brace","macro"):(i=e.next())?">"==i&&">"==e.peek()?(e.next(),n.tokenize=r,t("brace","macro")):(e.eatWhile(/[\w\$_]/),o=e.current(),a=d.propertyIsEnumerable(o)&&d[o],a?t(a.type,a.style,o):t("macro",null,o)):(n.tokenize=r,t(i))}var l,m,s={},d=function(){function e(e){return{type:e,style:"macro"}}return{allTags:e("allTags"),closeAll:e("closeAll"),list:e("list"),newJournal:e("newJournal"),newTiddler:e("newTiddler"),permaview:e("permaview"),saveChanges:e("saveChanges"),search:e("search"),slider:e("slider"),tabs:e("tabs"),tag:e("tag"),tagging:e("tagging"),tags:e("tags"),tiddler:e("tiddler"),timeline:e("timeline"),today:e("today"),version:e("version"),option:e("option"),"with":e("with"),filter:e("filter")}}(),h=/[\w_\-]/i,k=/^\-\-\-\-+$/,b=/^\/\*\*\*$/,p=/^\*\*\*\/$/,x=/^<<<$/,g=/^\/\/\{\{\{$/,v=/^\/\/\}\}\}$/,y=/^$/,w=/^$/,$=/^\{\{\{$/,z=/^\}\}\}$/,W=/.*?\}\}\}/;return{startState:function(){return{tokenize:r,indented:0,level:0}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t);return r},electricChars:""}}),e.defineMIME("text/x-tiddlywiki","tiddlywiki")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/tiki/tiki.min.css b/media/editors/codemirror/mode/tiki/tiki.min.css new file mode 100644 index 0000000000000..c52ac1961d590 --- /dev/null +++ b/media/editors/codemirror/mode/tiki/tiki.min.css @@ -0,0 +1 @@ +.cm-tw-syntaxerror{color:#FFF;background-color:#900}.cm-tw-deleted{text-decoration:line-through}.cm-tw-header5{font-weight:bold}.cm-tw-listitem:first-child{padding-left:10px}.cm-tw-box{border-top-width:0!important;border-style:solid;border-width:1px;border-color:inherit}.cm-tw-underline{text-decoration:underline} \ No newline at end of file diff --git a/media/editors/codemirror/mode/tiki/tiki.min.js b/media/editors/codemirror/mode/tiki/tiki.min.js new file mode 100644 index 0000000000000..58412267e600c --- /dev/null +++ b/media/editors/codemirror/mode/tiki/tiki.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tiki",function(e){function t(e,t,n){return function(i,o){for(;!i.eol();){if(i.match(t)){o.tokenize=r;break}i.next()}return n&&(o.tokenize=n),e}}function n(e){return function(t,n){for(;!t.eol();)t.next();return n.tokenize=r,e}}function r(e,o){function a(t){return o.tokenize=t,t(e,o)}var u=e.sol(),c=e.next();switch(c){case"{":e.eat("/"),e.eatSpace();for(var f,s="";f=e.eat(/[^\s\u00a0=\"\'\/?(}]/);)s+=f;return o.tokenize=i,"tag";case"_":if(e.eat("_"))return a(t("strong","__",r));break;case"'":if(e.eat("'"))return a(t("em","''",r));break;case"(":if(e.eat("("))return a(t("variable-2","))",r));break;case"[":return a(t("variable-3","]",r));case"|":if(e.eat("|"))return a(t("comment","||"));break;case"-":if(e.eat("="))return a(t("header string","=-",r));if(e.eat("-"))return a(t("error tw-deleted","--",r));break;case"=":if(e.match("=="))return a(t("tw-underline","===",r));break;case":":if(e.eat(":"))return a(t("comment","::"));break;case"^":return a(t("tw-box","^"));case"~":if(e.match("np~"))return a(t("meta","~/np~"))}if(u)switch(c){case"!":return a(e.match("!!!!!")?n("header string"):e.match("!!!!")?n("header string"):e.match("!!!")?n("header string"):e.match("!!")?n("header string"):n("header string"));case"*":case"#":case"+":return a(n("tw-listitem bracket"))}return null}function i(e,t){var n=e.next(),i=e.peek();return"}"==n?(t.tokenize=r,"tag"):"("==n||")"==n?"bracket":"="==n?(b="equals",">"==i&&(n=e.next(),i=e.peek()),/[\'\"]/.test(i)||(t.tokenize=a()),"operator"):/[\'\"]/.test(n)?(t.tokenize=o(n),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=\"\'\/?]/),"keyword")}function o(e){return function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return"string"}}function a(){return function(e,t){for(;!e.eol();){var n=e.next(),r=e.peek();if(" "==n||","==n||/[ )}]/.test(r)){t.tokenize=i;break}}return"string"}}function u(){for(var e=arguments.length-1;e>=0;e--)h.cc.push(arguments[e])}function c(){return u.apply(null,arguments),!0}function f(e,t){var n=h.context&&h.context.noIndent;h.context={prev:h.context,pluginName:e,indent:h.indented,startOfLine:t,noIndent:n}}function s(){h.context&&(h.context=h.context.prev)}function l(e){if("openPlugin"==e)return h.pluginName=x,c(g,d(h.startOfLine));if("closePlugin"==e){var t=!1;return h.context?(t=h.context.pluginName!=x,s()):t=!0,t&&(v="error"),c(k(t))}return"string"==e?(h.context&&"!cdata"==h.context.name||f("!cdata"),h.tokenize==r&&s(),c()):c()}function d(e){return function(t){return"selfclosePlugin"==t||"endPlugin"==t?c():"endPlugin"==t?(f(h.pluginName,e),c()):c()}}function k(e){return function(t){return e&&(v="error"),"endPlugin"==t?c():u()}}function g(e){return"keyword"==e?(v="attribute",c(g)):"equals"==e?c(m,g):u()}function m(e){return"keyword"==e?(v="string",c()):"string"==e?c(p):u()}function p(e){return"string"==e?c(p):u()}var x,b,h,v,z=e.indentUnit;return{startState:function(){return{tokenize:r,cc:[],indented:0,startOfLine:!0,pluginName:null,context:null}},token:function(e,t){if(e.sol()&&(t.startOfLine=!0,t.indented=e.indentation()),e.eatSpace())return null;v=b=x=null;var n=t.tokenize(e,t);if((n||b)&&"comment"!=n)for(h=t;;){var r=t.cc.pop()||l;if(r(b||n))break}return t.startOfLine=!1,v||n},indent:function(e,t){var n=e.context;if(n&&n.noIndent)return 0;for(n&&/^{\//.test(t)&&(n=n.prev);n&&!n.startOfLine;)n=n.prev;return n?n.indent+z:0},electricChars:"/"}}),e.defineMIME("text/tiki","tiki")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/toml/toml.min.js b/media/editors/codemirror/mode/toml/toml.min.js new file mode 100644 index 0000000000000..1b8beba3ff980 --- /dev/null +++ b/media/editors/codemirror/mode/toml/toml.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("toml",function(){return{startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(e,t){if(t.inString||'"'!=e.peek()&&"'"!=e.peek()||(t.stringType=e.peek(),e.next(),t.inString=!0),e.sol()&&0===t.inArray&&(t.lhs=!0),t.inString){for(;t.inString&&!e.eol();)e.peek()===t.stringType?(e.next(),t.inString=!1):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string"}return t.inArray&&"]"===e.peek()?(e.next(),t.inArray--,"bracket"):t.lhs&&"["===e.peek()&&e.skipTo("]")?(e.next(),"]"===e.peek()&&e.next(),"atom"):"#"===e.peek()?(e.skipToEnd(),"comment"):e.eatSpace()?null:t.lhs&&e.eatWhile(function(e){return"="!=e&&" "!=e})?"property":t.lhs&&"="===e.peek()?(e.next(),t.lhs=!1,null):!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/)?"atom":t.lhs||!e.match("true")&&!e.match("false")?t.lhs||"["!==e.peek()?!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/)?"number":(e.eatSpace()||e.next(),null):(t.inArray++,e.next(),"bracket"):"atom"}}}),e.defineMIME("text/x-toml","toml")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/tornado/tornado.min.js b/media/editors/codemirror/mode/tornado/tornado.min.js new file mode 100644 index 0000000000000..e0d609085ac48 --- /dev/null +++ b/media/editors/codemirror/mode/tornado/tornado.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tornado:inner",function(){function e(e,n){e.eatWhile(/[^\{]/);var o=e.next();return"{"==o&&(o=e.eat(/\{|%|#/))?(n.tokenize=t(o),"tag"):void 0}function t(t){return"{"==t&&(t="}"),function(o,r){var i=o.next();return i==t&&o.eat("}")?(r.tokenize=e,"tag"):o.match(n)?"keyword":"#"==t?"comment":"string"}}var n=["and","as","assert","autoescape","block","break","class","comment","context","continue","datetime","def","del","elif","else","end","escape","except","exec","extends","false","finally","for","from","global","if","import","in","include","is","json_encode","lambda","length","linkify","load","module","none","not","or","pass","print","put","raise","raw","return","self","set","squeeze","super","true","try","url_escape","while","with","without","xhtml_escape","yield"];return n=new RegExp("^(("+n.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,t){return t.tokenize(e,t)}}}),e.defineMode("tornado",function(t){var n=e.getMode(t,"text/html"),o=e.getMode(t,"tornado:inner");return e.overlayMode(n,o)}),e.defineMIME("text/x-tornado","tornado")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/turtle/turtle.min.js b/media/editors/codemirror/mode/turtle/turtle.min.js new file mode 100644 index 0000000000000..7d202be9d537f --- /dev/null +++ b/media/editors/codemirror/mode/turtle/turtle.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("turtle",function(t){function e(t){return new RegExp("^(?:"+t.join("|")+")$","i")}function n(t,e){var n=t.next();if(c=null,"<"==n&&!t.match(/^[\s\u00a0=]/,!1))return t.match(/^[^\s\u00a0>]*>?/),"atom";if('"'==n||"'"==n)return e.tokenize=o(n),e.tokenize(t,e);if(/[{}\(\),\.;\[\]]/.test(n))return c=n,null;if("#"==n)return t.skipToEnd(),"comment";if(a.test(n))return t.eatWhile(a),null;if(":"==n)return"operator";if(t.eatWhile(/[_\w\d]/),":"==t.peek())return"variable-3";var r=t.current();return l.test(r)?"meta":n>="A"&&"Z">=n?"comment":"keyword";var r}function o(t){return function(e,o){for(var r,i=!1;null!=(r=e.next());){if(r==t&&!i){o.tokenize=n;break}i=!i&&"\\"==r}return"string"}}function r(t,e,n){t.context={prev:t.context,indent:t.indent,col:n,type:e}}function i(t){t.indent=t.context.indent,t.context=t.context.prev}var c,u=t.indentUnit,l=(e([]),e(["@prefix","@base","a"])),a=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(t,e){if(t.sol()&&(e.context&&null==e.context.align&&(e.context.align=!1),e.indent=t.indentation()),t.eatSpace())return null;var n=e.tokenize(t,e);if("comment"!=n&&e.context&&null==e.context.align&&"pattern"!=e.context.type&&(e.context.align=!0),"("==c)r(e,")",t.column());else if("["==c)r(e,"]",t.column());else if("{"==c)r(e,"}",t.column());else if(/[\]\}\)]/.test(c)){for(;e.context&&"pattern"==e.context.type;)i(e);e.context&&c==e.context.type&&i(e)}else"."==c&&e.context&&"pattern"==e.context.type?i(e):/atom|string|variable/.test(n)&&e.context&&(/[\}\]]/.test(e.context.type)?r(e,"pattern",t.column()):"pattern"!=e.context.type||e.context.align||(e.context.align=!0,e.context.col=t.column()));return n},indent:function(t,e){var n=e&&e.charAt(0),o=t.context;if(/[\]\}]/.test(n))for(;o&&"pattern"==o.type;)o=o.prev;var r=o&&n==o.type;return o?"pattern"==o.type?o.col:o.align?o.col+(r?0:1):o.indent+(r?0:u):0},lineComment:"#"}}),t.defineMIME("text/turtle","turtle")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/vb/vb.min.js b/media/editors/codemirror/mode/vb/vb.min.js new file mode 100644 index 0000000000000..784a7a704be58 --- /dev/null +++ b/media/editors/codemirror/mode/vb/vb.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("vb",function(e,n){function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e,n){n.currentIndent++}function i(e,n){n.currentIndent--}function o(e,n){if(e.eatSpace())return null;var t=e.peek();if("'"===t)return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var o=!1;if(e.match(/^\d*\.\d+F?/i)?o=!0:e.match(/^\d+\.\d*F?/)?o=!0:e.match(/^\.\d+F?/)&&(o=!0),o)return e.eat(/J/i),"number";var c=!1;if(e.match(/^&H[0-9a-f]+/i)?c=!0:e.match(/^&O[0-7]+/i)?c=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),c=!0):e.match(/^0(?![\dx])/i)&&(c=!0),c)return e.eat(/L/i),"number"}return e.match(I)?(n.tokenize=a(e.current()),n.tokenize(e,n)):e.match(h)||e.match(m)?null:e.match(l)||e.match(d)||e.match(x)?"operator":e.match(f)?null:e.match(R)?(r(e,n),n.doInCurrentLine=!0,"keyword"):e.match(E)?(n.doInCurrentLine?n.doInCurrentLine=!1:r(e,n),"keyword"):e.match(L)?"keyword":e.match(C)?(i(e,n),i(e,n),"keyword"):e.match(z)?(i(e,n),"keyword"):e.match(y)?"keyword":e.match(w)?"keyword":e.match(s)?"variable":(e.next(),u)}function a(e){var t=1==e.length,r="string";return function(i,a){for(;!i.eol();){if(i.eatWhile(/[^'"]/),i.match(e))return a.tokenize=o,r;i.eat(/['"]/)}if(t){if(n.singleLineStringErrors)return u;a.tokenize=o}return r}}function c(e,n){var t=n.tokenize(e,n),o=e.current();if("."===o)return t=n.tokenize(e,n),o=e.current(),"variable"===t?"variable":u;var a="[({".indexOf(o);return-1!==a&&r(e,n),"dedent"===F&&i(e,n)?u:(a="])}".indexOf(o),-1!==a&&i(e,n)?u:t)}var u="error",d=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),f=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),l=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),m=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),h=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),s=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),p=["class","module","sub","enum","select","while","if","function","get","set","property","try"],b=["else","elseif","case","catch"],k=["next","loop"],x=t(["and","or","not","xor","in"]),g=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],v=["integer","string","double","decimal","boolean","short","char","float","single"],w=t(g),y=t(v),I='"',E=t(p),L=t(b),z=t(k),C=t(["end"]),R=t(["do"]),F=null,M={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:o,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,n){e.sol()&&(n.currentIndent+=n.nextLineIndent,n.nextLineIndent=0,n.doInCurrentLine=0);var t=c(e,n);return n.lastToken={style:t,content:e.current()},t},indent:function(n,t){var r=t.replace(/^\s+|\s+$/g,"");return r.match(z)||r.match(C)||r.match(L)?e.indentUnit*(n.currentIndent-1):n.currentIndent<0?0:n.currentIndent*e.indentUnit}};return M}),e.defineMIME("text/x-vb","vb")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/vbscript/vbscript.min.js b/media/editors/codemirror/mode/vbscript/vbscript.min.js new file mode 100644 index 0000000000000..4d021e15c180b --- /dev/null +++ b/media/editors/codemirror/mode/vbscript/vbscript.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("vbscript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e,t){t.currentIndent++}function a(e,t){t.currentIndent--}function i(e,t){if(e.eatSpace())return"space";var n=e.peek();if("'"===n)return e.skipToEnd(),"comment";if(e.match(K))return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var i=!1;if(e.match(/^\d*\.\d+/i)?i=!0:e.match(/^\d+\.\d*/)?i=!0:e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var c=!1;if(e.match(/^&H[0-9a-f]+/i)?c=!0:e.match(/^&O[0-7]+/i)?c=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),c=!0):e.match(/^0(?![\dx])/i)&&(c=!0),c)return e.eat(/L/i),"number"}return e.match(R)?(t.tokenize=o(e.current()),t.tokenize(e,t)):e.match(l)||e.match(s)||e.match(h)?"operator":e.match(u)?null:e.match(d)?"bracket":e.match(W)?(t.doInCurrentLine=!0,"keyword"):e.match(q)?(r(e,t),t.doInCurrentLine=!0,"keyword"):e.match(B)?(t.doInCurrentLine?t.doInCurrentLine=!1:r(e,t),"keyword"):e.match(M)?"keyword":e.match(N)?(a(e,t),a(e,t),"keyword"):e.match(A)?(t.doInCurrentLine?t.doInCurrentLine=!1:a(e,t),"keyword"):e.match(T)?"keyword":e.match(j)?"atom":e.match(F)?"variable-2":e.match(O)?"builtin":e.match(z)?"variable-2":e.match(v)?"variable":(e.next(),b)}function o(e){var n=1==e.length,r="string";return function(a,o){for(;!a.eol();){if(a.eatWhile(/[^'"]/),a.match(e))return o.tokenize=i,r;a.eat(/['"]/)}if(n){if(t.singleLineStringErrors)return b;o.tokenize=i}return r}}function c(e,t){var n=t.tokenize(e,t),r=e.current();return"."===r?(n=t.tokenize(e,t),r=e.current(),!n||"variable"!==n.substr(0,8)&&"builtin"!==n&&"keyword"!==n?b:(("builtin"===n||"keyword"===n)&&(n="variable"),S.indexOf(r.substr(1))>-1&&(n="variable-2"),n)):n}var b="error",s=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),l=new RegExp("^((<>)|(<=)|(>=))"),u=new RegExp("^[\\.,]"),d=new RegExp("^[\\(\\)]"),v=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),m=["class","sub","select","while","if","function","property","with","for"],p=["else","elseif","case"],f=["next","loop","wend"],h=n(["and","or","not","xor","is","mod","eqv","imp"]),y=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],g=["true","false","nothing","empty","null"],x=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],k=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],w=["WScript","err","debug","RegExp"],I=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],C=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],L=["server","response","request","session","application"],E=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],D=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],S=C.concat(I);w=w.concat(k),e.isASP&&(w=w.concat(L),S=S.concat(D,E));var T=n(y),j=n(g),O=n(x),z=n(w),F=n(S),R='"',B=n(m),M=n(p),A=n(f),N=n(["end"]),q=n(["do"]),W=n(["on error resume next","exit"]),K=n(["rem"]),U={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:i,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var n=c(e,t);return t.lastToken={style:n,content:e.current()},"space"===n&&(n=null),n},indent:function(t,n){var r=n.replace(/^\s+|\s+$/g,"");return r.match(A)||r.match(N)||r.match(M)?e.indentUnit*(t.currentIndent-1):t.currentIndent<0?0:t.currentIndent*e.indentUnit}};return U}),e.defineMIME("text/vbscript","vbscript")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/velocity/velocity.min.js b/media/editors/codemirror/mode/velocity/velocity.min.js new file mode 100644 index 0000000000000..0d64e640aa98e --- /dev/null +++ b/media/editors/codemirror/mode/velocity/velocity.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("velocity",function(){function e(e){for(var t={},n=e.split(" "),r=0;rk.length&&"."==e.string.charAt(e.pos-k.length-1)&&n.lastTokenWasBuiltin?"builtin":(n.lastTokenWasBuiltin=!1,null)}return n.lastTokenWasBuiltin=!1,n.inString?(n.inString=!1,"string"):n.inParams?t(e,n,r(c)):void 0}function r(e){return function(t,r){for(var i,a=!1,o=!1;null!=(i=t.next());){if(i==e&&!a){o=!0;break}if('"'==e&&"$"==t.peek()&&!a){r.inString=!0,o=!0;break}a=!a&&"\\"==i}return o&&(r.tokenize=n),"string"}}function i(e,t){for(var r,i=!1;r=e.next();){if("#"==r&&i){t.tokenize=n;break}i="*"==r}return"comment"}function a(e,t){for(var r,i=0;r=e.next();){if("#"==r&&2==i){t.tokenize=n;break}"]"==r?i++:" "!=r&&(i=0)}return"meta"}var o=e("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"),s=e("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"),l=e("$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"),u=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:n,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},blockCommentStart:"#*",blockCommentEnd:"*#",lineComment:"##",fold:"velocity"}}),e.defineMIME("text/velocity","velocity")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/verilog/test.min.js b/media/editors/codemirror/mode/verilog/test.min.js new file mode 100644 index 0000000000000..37f74d05a0eac --- /dev/null +++ b/media/editors/codemirror/mode/verilog/test.min.js @@ -0,0 +1 @@ +!function(){function e(e){test.mode(e,r,Array.prototype.slice.call(arguments,1))}var r=CodeMirror.getMode({indentUnit:4},"verilog");e("binary_literals","[number 1'b0]","[number 1'b1]","[number 1'bx]","[number 1'bz]","[number 1'bX]","[number 1'bZ]","[number 1'B0]","[number 1'B1]","[number 1'Bx]","[number 1'Bz]","[number 1'BX]","[number 1'BZ]","[number 1'b0]","[number 1'b1]","[number 2'b01]","[number 2'bxz]","[number 2'b11]","[number 2'b10]","[number 2'b1Z]","[number 12'b0101_0101_0101]","[number 1'b 0]","[number 'b0101]"),e("octal_literals","[number 3'o7]","[number 3'O7]","[number 3'so7]","[number 3'SO7]"),e("decimal_literals","[number 0]","[number 1]","[number 7]","[number 123_456]","[number 'd33]","[number 8'd255]","[number 8'D255]","[number 8'sd255]","[number 8'SD255]","[number 32'd123]","[number 32 'd123]","[number 32 'd 123]"),e("hex_literals","[number 4'h0]","[number 4'ha]","[number 4'hF]","[number 4'hx]","[number 4'hz]","[number 4'hX]","[number 4'hZ]","[number 32'hdc78]","[number 32'hDC78]","[number 32 'hDC78]","[number 32'h DC78]","[number 32 'h DC78]","[number 32'h44x7]","[number 32'hFFF?]"),e("real_number_literals","[number 1.2]","[number 0.1]","[number 2394.26331]","[number 1.2E12]","[number 1.2e12]","[number 1.30e-2]","[number 0.1e-0]","[number 23E10]","[number 29E-2]","[number 236.123_763_e-12]"),e("operators","[meta ^]"),e("keywords","[keyword logic]","[keyword logic] [variable foo]","[keyword reg] [variable abc]"),e("variables","[variable _leading_underscore]","[variable _if]","[number 12] [variable foo]","[variable foo] [number 14]"),e("tick_defines","[def `FOO]","[def `foo]","[def `FOO_bar]"),e("system_calls","[meta $display]","[meta $vpi_printf]"),e("line_comment","[comment // Hello world]"),e("align_port_map_style1","[variable mod] [variable mod][bracket (].[variable a][bracket (][variable a][bracket )],"," .[variable b][bracket (][variable b][bracket )]"," [bracket )];",""),e("align_port_map_style2","[variable mod] [variable mod][bracket (]"," .[variable a][bracket (][variable a][bracket )],"," .[variable b][bracket (][variable b][bracket )]","[bracket )];",""),e("indent_single_statement_if","[keyword if] [bracket (][variable foo][bracket )]"," [keyword break];",""),e("no_indent_after_single_line_if","[keyword if] [bracket (][variable foo][bracket )] [keyword break];",""),e("indent_after_if_begin_same_line","[keyword if] [bracket (][variable foo][bracket )] [keyword begin]"," [keyword break];"," [keyword break];","[keyword end]",""),e("indent_after_if_begin_next_line","[keyword if] [bracket (][variable foo][bracket )]"," [keyword begin]"," [keyword break];"," [keyword break];"," [keyword end]",""),e("indent_single_statement_if_else","[keyword if] [bracket (][variable foo][bracket )]"," [keyword break];","[keyword else]"," [keyword break];",""),e("indent_if_else_begin_same_line","[keyword if] [bracket (][variable foo][bracket )] [keyword begin]"," [keyword break];"," [keyword break];","[keyword end] [keyword else] [keyword begin]"," [keyword break];"," [keyword break];","[keyword end]",""),e("indent_if_else_begin_next_line","[keyword if] [bracket (][variable foo][bracket )]"," [keyword begin]"," [keyword break];"," [keyword break];"," [keyword end]","[keyword else]"," [keyword begin]"," [keyword break];"," [keyword break];"," [keyword end]",""),e("indent_if_nested_without_begin","[keyword if] [bracket (][variable foo][bracket )]"," [keyword if] [bracket (][variable foo][bracket )]"," [keyword if] [bracket (][variable foo][bracket )]"," [keyword break];",""),e("indent_case","[keyword case] [bracket (][variable state][bracket )]"," [variable FOO]:"," [keyword break];"," [variable BAR]:"," [keyword break];","[keyword endcase]",""),e("unindent_after_end_with_preceding_text","[keyword begin]"," [keyword break]; [keyword end]",""),e("export_function_one_line_does_not_indent",'[keyword export] [string "DPI-C"] [keyword function] [variable helloFromSV];',""),e("export_task_one_line_does_not_indent",'[keyword export] [string "DPI-C"] [keyword task] [variable helloFromSV];',""),e("export_function_two_lines_indents_properly","[keyword export]",' [string "DPI-C"] [keyword function] [variable helloFromSV];',""),e("export_task_two_lines_indents_properly","[keyword export]",' [string "DPI-C"] [keyword task] [variable helloFromSV];',""),e("import_function_one_line_does_not_indent",'[keyword import] [string "DPI-C"] [keyword function] [variable helloFromC];',""),e("import_task_one_line_does_not_indent",'[keyword import] [string "DPI-C"] [keyword task] [variable helloFromC];',""),e("import_package_single_line_does_not_indent","[keyword import] [variable p]::[variable x];","[keyword import] [variable p]::[variable y];",""),e("covergoup_with_function_indents_properly","[keyword covergroup] [variable cg] [keyword with] [keyword function] [variable sample][bracket (][keyword bit] [variable b][bracket )];"," [variable c] : [keyword coverpoint] [variable c];","[keyword endgroup]: [variable cg]","")}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/verilog/verilog.js b/media/editors/codemirror/mode/verilog/verilog.js index 8fc9ea4f8cda3..96b9f24581e5c 100644 --- a/media/editors/codemirror/mode/verilog/verilog.js +++ b/media/editors/codemirror/mode/verilog/verilog.js @@ -17,7 +17,8 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, dontAlignCalls = parserConfig.dontAlignCalls, noIndentKeywords = parserConfig.noIndentKeywords || [], - multiLineStrings = parserConfig.multiLineStrings; + multiLineStrings = parserConfig.multiLineStrings, + hooks = parserConfig.hooks || {}; function words(str) { var obj = {}, words = str.split(" "); @@ -107,7 +108,11 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { var statementKeywords = words("always always_comb always_ff always_latch assert assign assume else export for foreach forever if import initial repeat while"); function tokenBase(stream, state) { - var ch = stream.peek(); + var ch = stream.peek(), style; + if (hooks[ch] && (style = hooks[ch](stream, state)) != false) return style; + if (hooks.tokenBase && (style = hooks.tokenBase(stream, state)) != false) + return style; + if (/[,;:\.]/.test(ch)) { curPunc = stream.next(); return null; @@ -280,12 +285,14 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { electricInput: buildElectricInputRegEx(), startState: function(basecolumn) { - return { + var state = { tokenize: null, context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), indented: 0, startOfLine: true }; + if (hooks.startState) hooks.startState(state); + return state; }, token: function(stream, state) { @@ -295,6 +302,7 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { state.indented = stream.indentation(); state.startOfLine = true; } + if (hooks.token) hooks.token(stream, state); if (stream.eatSpace()) return null; curPunc = null; curKeyword = null; @@ -304,17 +312,19 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { if (curPunc == ctx.type) { popContext(state); - } - else if ((curPunc == ";" && ctx.type == "statement") || + } else if ((curPunc == ";" && ctx.type == "statement") || (ctx.type && isClosing(curKeyword, ctx.type))) { ctx = popContext(state); while (ctx && ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == "{") { pushContext(state, stream.column(), "}"); } - else if (curPunc == "[") { pushContext(state, stream.column(), "]"); } - else if (curPunc == "(") { pushContext(state, stream.column(), ")"); } - else if (ctx && ctx.type == "endcase" && curPunc == ":") { pushContext(state, stream.column(), "statement"); } - else if (curPunc == "newstatement") { + } else if (curPunc == "{") { + pushContext(state, stream.column(), "}"); + } else if (curPunc == "[") { + pushContext(state, stream.column(), "]"); + } else if (curPunc == "(") { + pushContext(state, stream.column(), ")"); + } else if (ctx && ctx.type == "endcase" && curPunc == ":") { + pushContext(state, stream.column(), "statement"); + } else if (curPunc == "newstatement") { pushContext(state, stream.column(), "statement"); } else if (curPunc == "newblock") { if (curKeyword == "function" && ctx && (ctx.type == "statement" || ctx.type == "endgroup")) { @@ -335,13 +345,16 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { indent: function(state, textAfter) { if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; + if (hooks.indent) { + var fromHook = hooks.indent(state); + if (fromHook >= 0) return fromHook; + } var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; var closing = false; var possibleClosing = textAfter.match(closingBracketOrWord); - if (possibleClosing) { + if (possibleClosing) closing = isClosing(possibleClosing[0], ctx.type); - } if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); else if (closingBracket.test(ctx.type) && ctx.align && !dontAlignCalls) return ctx.column + (closing ? 0 : 1); else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; @@ -354,11 +367,171 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { }; }); -CodeMirror.defineMIME("text/x-verilog", { - name: "verilog" -}); -CodeMirror.defineMIME("text/x-systemverilog", { - name: "systemverilog" -}); + CodeMirror.defineMIME("text/x-verilog", { + name: "verilog" + }); + + CodeMirror.defineMIME("text/x-systemverilog", { + name: "verilog" + }); + + // SVXVerilog mode + + var svxchScopePrefixes = { + ">": "property", "->": "property", "-": "hr", "|": "link", "?$": "qualifier", "?*": "qualifier", + "@-": "variable-3", "@": "variable-3", "?": "qualifier" + }; + function svxGenIndent(stream, state) { + var svxindentUnit = 2; + var rtnIndent = -1, indentUnitRq = 0, curIndent = stream.indentation(); + switch (state.svxCurCtlFlowChar) { + case "\\": + curIndent = 0; + break; + case "|": + if (state.svxPrevPrevCtlFlowChar == "@") { + indentUnitRq = -2; //-2 new pipe rq after cur pipe + break; + } + if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) + indentUnitRq = 1; // +1 new scope + break; + case "M": // m4 + if (state.svxPrevPrevCtlFlowChar == "@") { + indentUnitRq = -2; //-2 new inst rq after pipe + break; + } + if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) + indentUnitRq = 1; // +1 new scope + break; + case "@": + if (state.svxPrevCtlFlowChar == "S") + indentUnitRq = -1; // new pipe stage after stmts + if (state.svxPrevCtlFlowChar == "|") + indentUnitRq = 1; // 1st pipe stage + break; + case "S": + if (state.svxPrevCtlFlowChar == "@") + indentUnitRq = 1; // flow in pipe stage + if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) + indentUnitRq = 1; // +1 new scope + break; + } + var statementIndentUnit = svxindentUnit; + rtnIndent = curIndent + (indentUnitRq*statementIndentUnit); + return rtnIndent >= 0 ? rtnIndent : curIndent; + } + + CodeMirror.defineMIME("text/x-svx", { + name: "verilog", + hooks: { + "\\": function(stream, state) { + var vxIndent = 0, style = false; + var curPunc = stream.string; + if ((stream.sol()) && (/\\SV/.test(stream.string))) { + curPunc = (/\\SVX_version/.test(stream.string)) + ? "\\SVX_version" : stream.string; + stream.skipToEnd(); + if (curPunc == "\\SV" && state.vxCodeActive) {state.vxCodeActive = false;}; + if ((/\\SVX/.test(curPunc) && !state.vxCodeActive) + || (curPunc=="\\SVX_version" && state.vxCodeActive)) {state.vxCodeActive = true;}; + style = "keyword"; + state.svxCurCtlFlowChar = state.svxPrevPrevCtlFlowChar + = state.svxPrevCtlFlowChar = ""; + if (state.vxCodeActive == true) { + state.svxCurCtlFlowChar = "\\"; + vxIndent = svxGenIndent(stream, state); + } + state.vxIndentRq = vxIndent; + } + return style; + }, + tokenBase: function(stream, state) { + var vxIndent = 0, style = false; + var svxisOperatorChar = /[\[\]=:]/; + var svxkpScopePrefixs = { + "**":"variable-2", "*":"variable-2", "$$":"variable", "$":"variable", + "^^":"attribute", "^":"attribute"}; + var ch = stream.peek(); + var vxCurCtlFlowCharValueAtStart = state.svxCurCtlFlowChar; + if (state.vxCodeActive == true) { + if (/[\[\]{}\(\);\:]/.test(ch)) { + // bypass nesting and 1 char punc + style = "meta"; + stream.next(); + } else if (ch == "/") { + stream.next(); + if (stream.eat("/")) { + stream.skipToEnd(); + style = "comment"; + state.svxCurCtlFlowChar = "S"; + } else { + stream.backUp(1); + } + } else if (ch == "@") { + // pipeline stage + style = svxchScopePrefixes[ch]; + state.svxCurCtlFlowChar = "@"; + stream.next(); + stream.eatWhile(/[\w\$_]/); + } else if (stream.match(/\b[mM]4+/, true)) { // match: function(pattern, consume, caseInsensitive) + // m4 pre proc + stream.skipTo("("); + style = "def"; + state.svxCurCtlFlowChar = "M"; + } else if (ch == "!" && stream.sol()) { + // v stmt in svx region + // state.svxCurCtlFlowChar = "S"; + style = "comment"; + stream.next(); + } else if (svxisOperatorChar.test(ch)) { + // operators + stream.eatWhile(svxisOperatorChar); + style = "operator"; + } else if (ch == "#") { + // phy hier + state.svxCurCtlFlowChar = (state.svxCurCtlFlowChar == "") + ? ch : state.svxCurCtlFlowChar; + stream.next(); + stream.eatWhile(/[+-]\d/); + style = "tag"; + } else if (svxkpScopePrefixs.propertyIsEnumerable(ch)) { + // special SVX operators + style = svxkpScopePrefixs[ch]; + state.svxCurCtlFlowChar = state.svxCurCtlFlowChar == "" ? "S" : state.svxCurCtlFlowChar; // stmt + stream.next(); + stream.match(/[a-zA-Z_0-9]+/); + } else if (style = svxchScopePrefixes[ch] || false) { + // special SVX operators + state.svxCurCtlFlowChar = state.svxCurCtlFlowChar == "" ? ch : state.svxCurCtlFlowChar; + stream.next(); + stream.match(/[a-zA-Z_0-9]+/); + } + if (state.svxCurCtlFlowChar != vxCurCtlFlowCharValueAtStart) { // flow change + vxIndent = svxGenIndent(stream, state); + state.vxIndentRq = vxIndent; + } + } + return style; + }, + token: function(stream, state) { + if (state.vxCodeActive == true && stream.sol() && state.svxCurCtlFlowChar != "") { + state.svxPrevPrevCtlFlowChar = state.svxPrevCtlFlowChar; + state.svxPrevCtlFlowChar = state.svxCurCtlFlowChar; + state.svxCurCtlFlowChar = ""; + } + }, + indent: function(state) { + return (state.vxCodeActive == true) ? state.vxIndentRq : -1; + }, + startState: function(state) { + state.svxCurCtlFlowChar = ""; + state.svxPrevCtlFlowChar = ""; + state.svxPrevPrevCtlFlowChar = ""; + state.vxCodeActive = true; + state.vxIndentRq = 0; + } + } + }); }); diff --git a/media/editors/codemirror/mode/verilog/verilog.min.js b/media/editors/codemirror/mode/verilog/verilog.min.js new file mode 100644 index 0000000000000..1f4e3207dd8e8 --- /dev/null +++ b/media/editors/codemirror/mode/verilog/verilog.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){var r=2,i=-1,a=0,o=e.indentation();switch(t.svxCurCtlFlowChar){case"\\":o=0;break;case"|":if("@"==t.svxPrevPrevCtlFlowChar){a=-2;break}n[t.svxPrevCtlFlowChar]&&(a=1);break;case"M":if("@"==t.svxPrevPrevCtlFlowChar){a=-2;break}n[t.svxPrevCtlFlowChar]&&(a=1);break;case"@":"S"==t.svxPrevCtlFlowChar&&(a=-1),"|"==t.svxPrevCtlFlowChar&&(a=1);break;case"S":"@"==t.svxPrevCtlFlowChar&&(a=1),n[t.svxPrevCtlFlowChar]&&(a=1)}var l=r;return i=o+a*l,i>=0?i:o}e.defineMode("verilog",function(t,n){function r(e){for(var t={},n=e.split(" "),r=0;r=0)return r}var a=t.context,o=n&&n.charAt(0);"statement"==a.type&&"}"==o&&(a=a.prev);var l=!1,s=n.match(q);return s&&(l=u(s[0],a.type)),"statement"==a.type?a.indented+("{"==o?0:C):A.test(a.type)&&a.align&&!m?a.column+(l?0:1):")"!=a.type||l?a.indented+(l?0:p):a.indented+C},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-verilog",{name:"verilog"}),e.defineMIME("text/x-systemverilog",{name:"verilog"});var n={">":"property","->":"property","-":"hr","|":"link","?$":"qualifier","?*":"qualifier","@-":"variable-3","@":"variable-3","?":"qualifier"};e.defineMIME("text/x-svx",{name:"verilog",hooks:{"\\":function(e,n){var r=0,i=!1,a=e.string;return e.sol()&&/\\SV/.test(e.string)&&(a=/\\SVX_version/.test(e.string)?"\\SVX_version":e.string,e.skipToEnd(),"\\SV"==a&&n.vxCodeActive&&(n.vxCodeActive=!1),(/\\SVX/.test(a)&&!n.vxCodeActive||"\\SVX_version"==a&&n.vxCodeActive)&&(n.vxCodeActive=!0),i="keyword",n.svxCurCtlFlowChar=n.svxPrevPrevCtlFlowChar=n.svxPrevCtlFlowChar="",1==n.vxCodeActive&&(n.svxCurCtlFlowChar="\\",r=t(e,n)),n.vxIndentRq=r),i},tokenBase:function(e,r){var i=0,a=!1,o=/[\[\]=:]/,l={"**":"variable-2","*":"variable-2",$$:"variable",$:"variable","^^":"attribute","^":"attribute"},s=e.peek(),c=r.svxCurCtlFlowChar;return 1==r.vxCodeActive&&(/[\[\]{}\(\);\:]/.test(s)?(a="meta",e.next()):"/"==s?(e.next(),e.eat("/")?(e.skipToEnd(),a="comment",r.svxCurCtlFlowChar="S"):e.backUp(1)):"@"==s?(a=n[s],r.svxCurCtlFlowChar="@",e.next(),e.eatWhile(/[\w\$_]/)):e.match(/\b[mM]4+/,!0)?(e.skipTo("("),a="def",r.svxCurCtlFlowChar="M"):"!"==s&&e.sol()?(a="comment",e.next()):o.test(s)?(e.eatWhile(o),a="operator"):"#"==s?(r.svxCurCtlFlowChar=""==r.svxCurCtlFlowChar?s:r.svxCurCtlFlowChar,e.next(),e.eatWhile(/[+-]\d/),a="tag"):l.propertyIsEnumerable(s)?(a=l[s],r.svxCurCtlFlowChar=""==r.svxCurCtlFlowChar?"S":r.svxCurCtlFlowChar,e.next(),e.match(/[a-zA-Z_0-9]+/)):(a=n[s]||!1)&&(r.svxCurCtlFlowChar=""==r.svxCurCtlFlowChar?s:r.svxCurCtlFlowChar,e.next(),e.match(/[a-zA-Z_0-9]+/)),r.svxCurCtlFlowChar!=c&&(i=t(e,r),r.vxIndentRq=i)),a},token:function(e,t){1==t.vxCodeActive&&e.sol()&&""!=t.svxCurCtlFlowChar&&(t.svxPrevPrevCtlFlowChar=t.svxPrevCtlFlowChar,t.svxPrevCtlFlowChar=t.svxCurCtlFlowChar,t.svxCurCtlFlowChar="")},indent:function(e){return 1==e.vxCodeActive?e.vxIndentRq:-1},startState:function(e){e.svxCurCtlFlowChar="",e.svxPrevCtlFlowChar="",e.svxPrevPrevCtlFlowChar="",e.vxCodeActive=!0,e.vxIndentRq=0}}})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/xml/test.min.js b/media/editors/codemirror/mode/xml/test.min.js new file mode 100644 index 0000000000000..6fe19d35e8c6e --- /dev/null +++ b/media/editors/codemirror/mode/xml/test.min.js @@ -0,0 +1 @@ +!function(){function t(t){test.mode(t,a,Array.prototype.slice.call(arguments,1),e)}var a=CodeMirror.getMode({indentUnit:2},"xml"),e="xml";t("matching","[tag&bracket <][tag top][tag&bracket >]"," text"," [tag&bracket <][tag inner][tag&bracket />]","[tag&bracket ]"),t("nonmatching","[tag&bracket <][tag top][tag&bracket >]"," [tag&bracket <][tag inner][tag&bracket />]"," [tag&bracket ]"),t("doctype","[meta ]","[tag&bracket <][tag top][tag&bracket />]"),t("cdata","[tag&bracket <][tag top][tag&bracket >]"," [atom ]","[tag&bracket ]"),a=CodeMirror.getMode({indentUnit:2},"text/html"),t("selfclose","[tag&bracket <][tag html][tag&bracket >]",' [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string "/foobar"][tag&bracket >]',"[tag&bracket ]"),t("list","[tag&bracket <][tag ol][tag&bracket >]"," [tag&bracket <][tag li][tag&bracket >]one"," [tag&bracket <][tag li][tag&bracket >]two","[tag&bracket ]"),t("valueless","[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"),t("pThenArticle","[tag&bracket <][tag p][tag&bracket >]"," foo","[tag&bracket <][tag article][tag&bracket >]bar")}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/xml/xml.min.js b/media/editors/codemirror/mode/xml/xml.min.js new file mode 100644 index 0000000000000..fd99f6660203c --- /dev/null +++ b/media/editors/codemirror/mode/xml/xml.min.js @@ -0,0 +1 @@ +!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("xml",function(e,n){function r(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();if("<"==r)return t.eat("!")?t.eat("[")?t.match("CDATA[")?n(i("atom","]]>")):null:t.match("--")?n(i("comment","-->")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(l(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=i("meta","?>"),"meta"):(z=t.eat("/")?"closeTag":"openTag",e.tokenize=o,"tag bracket");if("&"==r){var a;return a=t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"),a?"atom":"error"}return t.eatWhile(/[^&<]/),null}function o(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=r,z=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return z="equals",null;if("<"==n){e.tokenize=r,e.state=f,e.tagName=e.tagStart=null;var o=e.tokenize(t,e);return o?o+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=a(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=o;break}return"string"};return e.isInAttribute=!0,e}function i(t,e){return function(n,o){for(;!n.eol();){if(n.match(e)){o.tokenize=r;break}n.next()}return t}}function l(t){return function(e,n){for(var o;null!=(o=e.next());){if("<"==o)return n.tokenize=l(t+1),n.tokenize(e,n);if(">"==o){if(1==t){n.tokenize=r;break}return n.tokenize=l(t-1),n.tokenize(e,n)}}return"meta"}}function u(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(T.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function d(t){t.context&&(t.context=t.context.prev)}function c(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!T.contextGrabbers.hasOwnProperty(n)||!T.contextGrabbers[n].hasOwnProperty(e))return;d(t)}}function f(t,e,n){return"openTag"==t?(n.tagStart=e.column(),s):"closeTag"==t?m:f}function s(t,e,n){return"word"==t?(n.tagName=e.current(),N="tag",h):(N="error",s)}function m(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&T.implicitlyClosed.hasOwnProperty(n.context.tagName)&&d(n),n.context&&n.context.tagName==r?(N="tag",g):(N="tag error",p)}return N="error",p}function g(t,e,n){return"endTag"!=t?(N="error",g):(d(n),f)}function p(t,e,n){return N="error",g(t,e,n)}function h(t,e,n){if("word"==t)return N="attribute",x;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||T.autoSelfClosers.hasOwnProperty(r)?c(n,r):(c(n,r),n.context=new u(n,r,o==n.indented)),f}return N="error",h}function x(t,e,n){return"equals"==t?b:(T.allowMissing||(N="error"),h(t,e,n))}function b(t,e,n){return"string"==t?k:"word"==t&&T.allowUnquoted?(N="string",h):(N="error",h(t,e,n))}function k(t,e,n){return"string"==t?k:h(t,e,n)}var w=e.indentUnit,v=n.multilineTagIndentFactor||1,y=n.multilineTagIndentPastTag;null==y&&(y=!0);var z,N,T=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},C=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;z=null;var n=e.tokenize(t,e);return(n||z)&&"comment"!=n&&(N=null,e.state=e.state(z||n,t,e),N&&(n="error"==N?n+" error":N)),n},indent:function(e,n,a){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+w;if(i&&i.noIndent)return t.Pass;if(e.tokenize!=o&&e.tokenize!=r)return a?a.match(/^(\s*)/)[0].length:0;if(e.tagName)return y?e.tagStart+e.tagName.length+2:e.tagStart+w*v;if(C&&/$/,blockCommentStart:"",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}}),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/xquery/test.min.js b/media/editors/codemirror/mode/xquery/test.min.js new file mode 100644 index 0000000000000..9fa2f9149e64a --- /dev/null +++ b/media/editors/codemirror/mode/xquery/test.min.js @@ -0,0 +1 @@ +!function(){function e(e){test.mode(e,a,Array.prototype.slice.call(arguments,1))}var a=CodeMirror.getMode({tabSize:4},"xquery");e("eviltest",'[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a "comment" :)]'," [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]"," [keyword let] [variable $joe][keyword :=][atom 1]"," [keyword return] [keyword element] [variable element] {"," [keyword attribute] [variable attribute] { [atom 1] },"," [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },"," [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],"," [keyword //][variable x] } [comment (: a more 'evil' test :)]"," [comment (: Modified Blakeley example (: with nested comment :) ... :)]"," [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]"," [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]"," [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]"," [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]"," [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]"," [keyword return] [keyword element] [variable element] {"," [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },"," [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },"," [keyword element] [variable text] { [keyword text] { [variable "text"] } },"," [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],"," [keyword //][variable fn:doc]"," }"),e("testEmptySequenceKeyword",'[string "foo"] [keyword instance] [keyword of] [keyword empty-sequence]()'),e("testMultiAttr",'[tag

][variable hello] [variable world][tag

]'),e("test namespaced variable",'[keyword declare] [keyword namespace] [variable e] [keyword =] [string "http://example.com/ANamespace"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]'),e("test EQName variable",'[keyword declare] [keyword variable] [variable $"http://www.example.com/ns/my":var] [keyword :=] [atom 12][variable ;]','[tag ]{[variable $"http://www.example.com/ns/my":var]}[tag ]'),e("test EQName function",'[keyword declare] [keyword function] [def&variable "http://www.example.com/ns/my":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {'," [variable $a] [keyword +] [atom 2]","}[variable ;]",'[tag ]{[def&variable "http://www.example.com/ns/my":fn]([atom 12])}[tag ]'),e("test EQName function with single quotes","[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {"," [variable $a] [keyword +] [atom 2]","}[variable ;]","[tag ]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag ]"),e("testProcessingInstructions","[def&variable data]([comment&meta ]) [keyword instance] [keyword of] [atom xs:string]"),e("testQuoteEscapeDouble",'[keyword let] [variable $rootfolder] [keyword :=] [string "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"]','[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string "keys\\"])')}(); \ No newline at end of file diff --git a/media/editors/codemirror/mode/xquery/xquery.min.js b/media/editors/codemirror/mode/xquery/xquery.min.js new file mode 100644 index 0000000000000..b5ee70cb739bc --- /dev/null +++ b/media/editors/codemirror/mode/xquery/xquery.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("xquery",function(){function e(e,t,n){return b=e,k=n,t}function t(e,t,n){return t.tokenize=n,n(e,t)}function n(n,c){var m=n.next(),p=!1,y=g(n);if("<"==m){if(n.match("!--",!0))return t(n,c,u);if(n.match("![CDATA",!1))return c.tokenize=s,e("tag","tag");if(n.match("?",!1))return t(n,c,f);var b=n.eat("/");n.eatSpace();for(var k,z="";k=n.eat(/[^\s\u00a0=<>\"\'\/?]/);)z+=k;return t(n,c,o(z,b))}if("{"==m)return h(c,{type:"codeblock"}),e("",null);if("}"==m)return x(c),e("",null);if(l(c))return">"==m?e("tag","tag"):"/"==m&&n.eat(">")?(x(c),e("tag","tag")):e("word","variable");if(/\d/.test(m))return n.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),e("number","atom");if("("===m&&n.eat(":"))return h(c,{type:"comment"}),t(n,c,r);if(y||'"'!==m&&"'"!==m){if("$"===m)return t(n,c,i);if(":"===m&&n.eat("="))return e("operator","keyword");if("("===m)return h(c,{type:"paren"}),e("",null);if(")"===m)return x(c),e("",null);if("["===m)return h(c,{type:"bracket"}),e("",null);if("]"===m)return x(c),e("",null);var w=v.propertyIsEnumerable(m)&&v[m];if(y&&'"'===m)for(;'"'!==n.next(););if(y&&"'"===m)for(;"'"!==n.next(););w||n.eatWhile(/[\w\$_-]/);var q=n.eat(":");!n.eat(":")&&q&&n.eatWhile(/[\w\$_-]/),n.match(/^[ \t]*\(/,!1)&&(p=!0);var _=n.current();return w=v.propertyIsEnumerable(_)&&v[_],p&&!w&&(w={type:"function_call",style:"variable def"}),d(c)?(x(c),e("word","variable",_)):(("element"==_||"attribute"==_||"axis_specifier"==w.type)&&h(c,{type:"xmlconstructor"}),w?e(w.type,w.style,_):e("word","variable",_))}return t(n,c,a(m))}function r(t,n){for(var r,a=!1,i=!1,o=0;r=t.next();){if(")"==r&&a){if(!(o>0)){x(n);break}o--}else":"==r&&i&&o++;a=":"==r,i="("==r}return e("comment","comment")}function a(t,r){return function(i,o){var c;if(p(o)&&i.current()==t)return x(o),r&&(o.tokenize=r),e("string","string");if(h(o,{type:"string",name:t,tokenize:a(t,r)}),i.match("{",!1)&&m(o))return o.tokenize=n,e("string","string");for(;c=i.next();){if(c==t){x(o),r&&(o.tokenize=r);break}if(i.match("{",!1)&&m(o))return o.tokenize=n,e("string","string")}return e("string","string")}}function i(t,r){var a=/[\w\$_-]/;if(t.eat('"')){for(;'"'!==t.next(););t.eat(":")}else t.eatWhile(a),t.match(":=",!1)||t.eat(":");return t.eatWhile(a),r.tokenize=n,e("variable","variable")}function o(t,r){return function(a,i){return a.eatSpace(),r&&a.eat(">")?(x(i),i.tokenize=n,e("tag","tag")):(a.eat("/")||h(i,{type:"tag",name:t,tokenize:n}),a.eat(">")?(i.tokenize=n,e("tag","tag")):(i.tokenize=c,e("tag","tag")))}}function c(r,i){var o=r.next();return"/"==o&&r.eat(">")?(m(i)&&x(i),l(i)&&x(i),e("tag","tag")):">"==o?(m(i)&&x(i),e("tag","tag")):"="==o?e("",null):'"'==o||"'"==o?t(r,i,a(o,c)):(m(i)||h(i,{type:"attribute",tokenize:c}),r.eat(/[a-zA-Z_:]/),r.eatWhile(/[-a-zA-Z0-9_:.]/),r.eatSpace(),(r.match(">",!1)||r.match("/",!1))&&(x(i),i.tokenize=n),e("attribute","attribute"))}function u(t,r){for(var a;a=t.next();)if("-"==a&&t.match("->",!0))return r.tokenize=n,e("comment","comment")}function s(t,r){for(var a;a=t.next();)if("]"==a&&t.match("]",!0))return r.tokenize=n,e("comment","comment")}function f(t,r){for(var a;a=t.next();)if("?"==a&&t.match(">",!0))return r.tokenize=n,e("comment","comment meta")}function l(e){return y(e,"tag")}function m(e){return y(e,"attribute")}function d(e){return y(e,"xmlconstructor")}function p(e){return y(e,"string")}function g(e){return'"'===e.current()?e.match(/^[^\"]+\"\:/,!1):"'"===e.current()?e.match(/^[^\"]+\'\:/,!1):!1}function y(e,t){return e.stack.length&&e.stack[e.stack.length-1].type==t}function h(e,t){e.stack.push(t)}function x(e){e.stack.pop();var t=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=t||n}var b,k,v=function(){function e(e){return{type:e,style:"keyword"}}for(var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),a=e("operator"),i={type:"atom",style:"atom"},o={type:"punctuation",style:null},c={type:"axis_specifier",style:"qualifier"},u={"if":t,"switch":t,"while":t,"for":t,"else":n,then:n,"try":n,"finally":n,"catch":n,element:r,attribute:r,let:r,"implements":r,"import":r,module:r,namespace:r,"return":r,"super":r,"this":r,"throws":r,where:r,"private":r,",":o,"null":i,"fn:false()":i,"fn:true()":i},s=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"],f=0,l=s.length;l>f;f++)u[s[f]]=e(s[f]);for(var m=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"],f=0,l=m.length;l>f;f++)u[m[f]]=i;for(var d=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"],f=0,l=d.length;l>f;f++)u[d[f]]=a;for(var p=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"],f=0,l=p.length;l>f;f++)u[p[f]]=c;return u}();return{startState:function(){return{tokenize:n,cc:[],stack:[]}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},blockCommentStart:"(:",blockCommentEnd:":)"}}),e.defineMIME("application/xquery","xquery")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/yaml/yaml.min.js b/media/editors/codemirror/mode/yaml/yaml.min.js new file mode 100644 index 0000000000000..d435782e02628 --- /dev/null +++ b/media/editors/codemirror/mode/yaml/yaml.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],i=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,t){var r=e.peek(),n=t.escaped;if(t.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(t.literal&&e.indentation()>t.keyCol)return e.skipToEnd(),"string";if(t.literal&&(t.literal=!1),e.sol()){if(t.keyCol=0,t.pair=!1,t.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?t.inlinePairs++:"}"==r?t.inlinePairs--:"["==r?t.inlineList++:t.inlineList--,"meta";if(t.inlineList>0&&!n&&","==r)return e.next(),"meta";if(t.inlinePairs>0&&!n&&","==r)return t.keyCol=0,t.pair=!1,t.pairStart=!1,e.next(),"meta";if(t.pairStart){if(e.match(/^\s*(\||\>)\s*/))return t.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==t.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(t.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(i))return"keyword"}return!t.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(t.pair=!0,t.keyCol=e.indentation(),"atom"):t.pair&&e.match(/^:\s*/)?(t.pairStart=!0,"meta"):(t.pairStart=!1,t.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/z80/z80.min.js b/media/editors/codemirror/mode/z80/z80.min.js new file mode 100644 index 0000000000000..8c8b86c3a495b --- /dev/null +++ b/media/editors/codemirror/mode/z80/z80.min.js @@ -0,0 +1 @@ +!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("z80",function(){var e=/^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i,t=/^(call|j[pr]|ret[in]?)\b/i,r=/^b_?(call|jump)\b/i,n=/^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i,i=/^(n?[zc]|p[oe]?|m)\b/i,o=/^([hl][xy]|i[xy][hl]|slia|sll)\b/i,l=/^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i;return{startState:function(){return{context:0}},token:function(f,u){if(f.column()||(u.context=0),f.eatSpace())return null;var c;if(f.eatWhile(/\w/)){if(c=f.current(),!f.indentation())return l.test(c)?"number":null;if(1==u.context&&n.test(c))return"variable-2";if(2==u.context&&i.test(c))return"variable-3";if(e.test(c))return u.context=1,"keyword";if(t.test(c))return u.context=2,"keyword";if(r.test(c))return u.context=3,"keyword";if(o.test(c))return"error"}else{if(f.eat(";"))return f.skipToEnd(),"comment";if(f.eat('"')){for(;(c=f.next())&&'"'!=c;)"\\"==c&&f.next();return"string"}if(f.eat("'")){if(f.match(/\\?.'/))return"number"}else if(f.eat(".")||f.sol()&&f.eat("#")){if(u.context=4,f.eatWhile(/\w/))return"def"}else if(f.eat("$")){if(f.eatWhile(/[\da-f]/i))return"number"}else if(f.eat("%")){if(f.eatWhile(/[01]/))return"number"}else f.next()}return null}}}),e.defineMIME("text/x-z80","z80")}); \ No newline at end of file diff --git a/media/editors/codemirror/theme/3024-day.css b/media/editors/codemirror/theme/3024-day.css index 3c01c2bf58720..359281621bc2a 100644 --- a/media/editors/codemirror/theme/3024-day.css +++ b/media/editors/codemirror/theme/3024-day.css @@ -10,6 +10,8 @@ .cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;} .cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;} +.cm-s-3024-day.CodeMirror ::selection { background: #d6d5d4; } +.cm-s-3024-day.CodeMirror ::-moz-selection { background: #d9d9d9; } .cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;} .cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; } diff --git a/media/editors/codemirror/theme/3024-night.css b/media/editors/codemirror/theme/3024-night.css index 631757fc47de9..ccab9d50bfa3e 100644 --- a/media/editors/codemirror/theme/3024-night.css +++ b/media/editors/codemirror/theme/3024-night.css @@ -10,6 +10,8 @@ .cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;} .cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;} +.cm-s-3024-night.CodeMirror ::selection { background: rgba(58, 52, 50, .99); } +.cm-s-3024-night.CodeMirror ::-moz-selection { background: rgba(58, 52, 50, .99); } .cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;} .cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; } .cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; } diff --git a/media/editors/codemirror/theme/ambiance.css b/media/editors/codemirror/theme/ambiance.css index c844566eac848..afcf15a37af5b 100644 --- a/media/editors/codemirror/theme/ambiance.css +++ b/media/editors/codemirror/theme/ambiance.css @@ -30,12 +30,10 @@ .cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; } .cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; } -.cm-s-ambiance .CodeMirror-selected { - background: rgba(255, 255, 255, 0.15); -} -.cm-s-ambiance.CodeMirror-focused .CodeMirror-selected { - background: rgba(255, 255, 255, 0.10); -} +.cm-s-ambiance .CodeMirror-selected { background: rgba(255, 255, 255, 0.15); } +.cm-s-ambiance.CodeMirror-focused .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); } +.cm-s-ambiance.CodeMirror ::selection { background: rgba(255, 255, 255, 0.10); } +.cm-s-ambiance.CodeMirror ::-moz-selection { background: rgba(255, 255, 255, 0.10); } /* Editor styling */ diff --git a/media/editors/codemirror/theme/base16-dark.css b/media/editors/codemirror/theme/base16-dark.css index a46abdbbbde4a..b009d2b9d686a 100644 --- a/media/editors/codemirror/theme/base16-dark.css +++ b/media/editors/codemirror/theme/base16-dark.css @@ -10,6 +10,8 @@ .cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;} .cm-s-base16-dark div.CodeMirror-selected {background: #303030 !important;} +.cm-s-base16-dark.CodeMirror ::selection { background: rgba(48, 48, 48, .99); } +.cm-s-base16-dark.CodeMirror ::-moz-selection { background: rgba(48, 48, 48, .99); } .cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;} .cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; } .cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; } diff --git a/media/editors/codemirror/theme/base16-light.css b/media/editors/codemirror/theme/base16-light.css index 12ff2eb06fdd5..15df6d3807ebe 100644 --- a/media/editors/codemirror/theme/base16-light.css +++ b/media/editors/codemirror/theme/base16-light.css @@ -10,6 +10,8 @@ .cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;} .cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;} +.cm-s-base16-light.CodeMirror ::selection { background: #e0e0e0; } +.cm-s-base16-light.CodeMirror ::-moz-selection { background: #e0e0e0; } .cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;} .cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; } .cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; } diff --git a/media/editors/codemirror/theme/blackboard.css b/media/editors/codemirror/theme/blackboard.css index d7a2dc96953e3..02289b630b8bb 100644 --- a/media/editors/codemirror/theme/blackboard.css +++ b/media/editors/codemirror/theme/blackboard.css @@ -2,6 +2,8 @@ .cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } .cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; } +.cm-s-blackboard.CodeMirror ::selection { background: rgba(37, 59, 118, .99); } +.cm-s-blackboard.CodeMirror ::-moz-selection { background: rgba(37, 59, 118, .99); } .cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } .cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; } .cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; } diff --git a/media/editors/codemirror/theme/cobalt.css b/media/editors/codemirror/theme/cobalt.css index 47440531a03d8..3915589494174 100644 --- a/media/editors/codemirror/theme/cobalt.css +++ b/media/editors/codemirror/theme/cobalt.css @@ -1,5 +1,7 @@ .cm-s-cobalt.CodeMirror { background: #002240; color: white; } .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } +.cm-s-cobalt.CodeMirror ::selection { background: rgba(179, 101, 57, .99); } +.cm-s-cobalt.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); } .cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } .cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; } .cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; } diff --git a/media/editors/codemirror/theme/colorforth.css b/media/editors/codemirror/theme/colorforth.css new file mode 100644 index 0000000000000..73fbf80824de0 --- /dev/null +++ b/media/editors/codemirror/theme/colorforth.css @@ -0,0 +1,33 @@ +.cm-s-colorforth.CodeMirror { background: #000000; color: #f8f8f8; } +.cm-s-colorforth .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } +.cm-s-colorforth .CodeMirror-guttermarker { color: #FFBD40; } +.cm-s-colorforth .CodeMirror-guttermarker-subtle { color: #78846f; } +.cm-s-colorforth .CodeMirror-linenumber { color: #bababa; } +.cm-s-colorforth .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-colorforth span.cm-comment { color: #ededed; } +.cm-s-colorforth span.cm-def { color: #ff1c1c; font-weight:bold; } +.cm-s-colorforth span.cm-keyword { color: #ffd900; } +.cm-s-colorforth span.cm-builtin { color: #00d95a; } +.cm-s-colorforth span.cm-variable { color: #73ff00; } +.cm-s-colorforth span.cm-string { color: #007bff; } +.cm-s-colorforth span.cm-number { color: #00c4ff; } +.cm-s-colorforth span.cm-atom { color: #606060; } + +.cm-s-colorforth span.cm-variable-2 { color: #EEE; } +.cm-s-colorforth span.cm-variable-3 { color: #DDD; } +.cm-s-colorforth span.cm-property {} +.cm-s-colorforth span.cm-operator {} + +.cm-s-colorforth span.cm-meta { color: yellow; } +.cm-s-colorforth span.cm-qualifier { color: #FFF700; } +.cm-s-colorforth span.cm-bracket { color: #cc7; } +.cm-s-colorforth span.cm-tag { color: #FFBD40; } +.cm-s-colorforth span.cm-attribute { color: #FFF700; } +.cm-s-colorforth span.cm-error { color: #f00; } + +.cm-s-colorforth .CodeMirror-selected { background: #333d53 !important; } + +.cm-s-colorforth span.cm-compilation { background: rgba(255, 255, 255, 0.12); } + +.cm-s-colorforth .CodeMirror-activeline-background {background: #253540 !important;} diff --git a/media/editors/codemirror/theme/erlang-dark.css b/media/editors/codemirror/theme/erlang-dark.css index ff47d7f8de0a8..25c7e0a2aad79 100644 --- a/media/editors/codemirror/theme/erlang-dark.css +++ b/media/editors/codemirror/theme/erlang-dark.css @@ -1,5 +1,7 @@ .cm-s-erlang-dark.CodeMirror { background: #002240; color: white; } .cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; } +.cm-s-erlang-dark.CodeMirror ::selection { background: rgba(179, 101, 57, .99); } +.cm-s-erlang-dark.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); } .cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } .cm-s-erlang-dark .CodeMirror-guttermarker { color: white; } .cm-s-erlang-dark .CodeMirror-guttermarker-subtle { color: #d0d0d0; } diff --git a/media/editors/codemirror/theme/lesser-dark.css b/media/editors/codemirror/theme/lesser-dark.css index a78247473966f..5af8b7f627167 100644 --- a/media/editors/codemirror/theme/lesser-dark.css +++ b/media/editors/codemirror/theme/lesser-dark.css @@ -7,6 +7,8 @@ Ported to CodeMirror by Peter Kroon } .cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } .cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ +.cm-s-lesser-dark.CodeMirror ::selection { background: rgba(69, 68, 59, .99); } +.cm-s-lesser-dark.CodeMirror ::-moz-selection { background: rgba(69, 68, 59, .99); } .cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } .cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/ diff --git a/media/editors/codemirror/theme/mbo.css b/media/editors/codemirror/theme/mbo.css index 0ad6360b50ecc..e39879522e37f 100644 --- a/media/editors/codemirror/theme/mbo.css +++ b/media/editors/codemirror/theme/mbo.css @@ -6,6 +6,8 @@ .cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffec;} .cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;} +.cm-s-mbo.CodeMirror ::selection { background: rgba(113, 108, 98, .99); } +.cm-s-mbo.CodeMirror ::-moz-selection { background: rgba(113, 108, 98, .99); } .cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;} .cm-s-mbo .CodeMirror-guttermarker { color: white; } .cm-s-mbo .CodeMirror-guttermarker-subtle { color: grey; } diff --git a/media/editors/codemirror/theme/mdn-like.css b/media/editors/codemirror/theme/mdn-like.css index 81b21772d2411..93293c01c85f1 100644 --- a/media/editors/codemirror/theme/mdn-like.css +++ b/media/editors/codemirror/theme/mdn-like.css @@ -9,6 +9,8 @@ */ .cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; } .cm-s-mdn-like .CodeMirror-selected { background: #cfc !important; } +.cm-s-mdn-like.CodeMirror ::selection { background: #cfc; } +.cm-s-mdn-like.CodeMirror ::-moz-selection { background: #cfc; } .cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; } .cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; margin-left: 3px; } diff --git a/media/editors/codemirror/theme/midnight.css b/media/editors/codemirror/theme/midnight.css index 4567d29399bc7..296af4f7d221a 100644 --- a/media/editors/codemirror/theme/midnight.css +++ b/media/editors/codemirror/theme/midnight.css @@ -15,6 +15,8 @@ .cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} .cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;} +.cm-s-midnight.CodeMirror ::selection { background: rgba(49, 77, 103, .99); } +.cm-s-midnight.CodeMirror ::-moz-selection { background: rgba(49, 77, 103, .99); } .cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;} .cm-s-midnight .CodeMirror-guttermarker { color: white; } .cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; } diff --git a/media/editors/codemirror/theme/monokai.css b/media/editors/codemirror/theme/monokai.css index 548d2dfff6033..6dfcc73ce4245 100644 --- a/media/editors/codemirror/theme/monokai.css +++ b/media/editors/codemirror/theme/monokai.css @@ -2,6 +2,8 @@ .cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} +.cm-s-monokai.CodeMirror ::selection { background: rgba(73, 72, 62, .99); } +.cm-s-monokai.CodeMirror ::-moz-selection { background: rgba(73, 72, 62, .99); } .cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;} .cm-s-monokai .CodeMirror-guttermarker { color: white; } .cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; } diff --git a/media/editors/codemirror/theme/night.css b/media/editors/codemirror/theme/night.css index a0bf8cfa7875c..6b2ac6c7cf02d 100644 --- a/media/editors/codemirror/theme/night.css +++ b/media/editors/codemirror/theme/night.css @@ -2,6 +2,8 @@ .cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } .cm-s-night div.CodeMirror-selected { background: #447 !important; } +.cm-s-night.CodeMirror ::selection { background: rgba(68, 68, 119, .99); } +.cm-s-night.CodeMirror ::-moz-selection { background: rgba(68, 68, 119, .99); } .cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } .cm-s-night .CodeMirror-guttermarker { color: white; } .cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; } diff --git a/media/editors/codemirror/theme/paraiso-dark.css b/media/editors/codemirror/theme/paraiso-dark.css index 53dcdf7a2ae9e..af914b60bf288 100644 --- a/media/editors/codemirror/theme/paraiso-dark.css +++ b/media/editors/codemirror/theme/paraiso-dark.css @@ -10,6 +10,8 @@ .cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;} .cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;} +.cm-s-paraiso-dark.CodeMirror ::selection { background: rgba(65, 50, 63, .99); } +.cm-s-paraiso-dark.CodeMirror ::-moz-selection { background: rgba(65, 50, 63, .99); } .cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;} .cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; } .cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; } diff --git a/media/editors/codemirror/theme/paraiso-light.css b/media/editors/codemirror/theme/paraiso-light.css index 07ca325978d52..e198066faa7d2 100644 --- a/media/editors/codemirror/theme/paraiso-light.css +++ b/media/editors/codemirror/theme/paraiso-light.css @@ -10,6 +10,8 @@ .cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;} .cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;} +.cm-s-paraiso-light.CodeMirror ::selection { background: #b9b6b0; } +.cm-s-paraiso-light.CodeMirror ::-moz-selection { background: #b9b6b0; } .cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;} .cm-s-paraiso-light .CodeMirror-guttermarker { color: black; } .cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; } diff --git a/media/editors/codemirror/theme/pastel-on-dark.css b/media/editors/codemirror/theme/pastel-on-dark.css index 7992ac7d2d086..0d06f63284d30 100644 --- a/media/editors/codemirror/theme/pastel-on-dark.css +++ b/media/editors/codemirror/theme/pastel-on-dark.css @@ -14,6 +14,9 @@ font-size: 14px; } .cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2) !important; } +.cm-s-pastel-on-dark.CodeMirror ::selection { background: rgba(221,240,255,0.2); } +.cm-s-pastel-on-dark.CodeMirror ::-moz-selection { background: rgba(221,240,255,0.2); } + .cm-s-pastel-on-dark .CodeMirror-gutters { background: #34302f; border-right: 0px; diff --git a/media/editors/codemirror/theme/rubyblue.css b/media/editors/codemirror/theme/rubyblue.css index 5349838940cb0..d2fc0ecdbcf07 100644 --- a/media/editors/codemirror/theme/rubyblue.css +++ b/media/editors/codemirror/theme/rubyblue.css @@ -1,5 +1,7 @@ .cm-s-rubyblue.CodeMirror { background: #112435; color: white; } .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } +.cm-s-rubyblue.CodeMirror ::selection { background: rgba(56, 86, 111, 0.99); } +.cm-s-rubyblue.CodeMirror ::-moz-selection { background: rgba(56, 86, 111, 0.99); } .cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } .cm-s-rubyblue .CodeMirror-guttermarker { color: white; } .cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; } diff --git a/media/editors/codemirror/theme/solarized.css b/media/editors/codemirror/theme/solarized.css index 07ef4068040d5..4a10b7c059247 100644 --- a/media/editors/codemirror/theme/solarized.css +++ b/media/editors/codemirror/theme/solarized.css @@ -94,13 +94,13 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png border-bottom: 1px dotted #dc322f; } -.cm-s-solarized.cm-s-dark .CodeMirror-selected { - background: #073642; -} +.cm-s-solarized.cm-s-dark .CodeMirror-selected { background: #073642; } +.cm-s-solarized.cm-s-dark.CodeMirror ::selection { background: rgba(7, 54, 66, 0.99); } +.cm-s-solarized.cm-s-dark.CodeMirror ::-moz-selection { background: rgba(7, 54, 66, 0.99); } -.cm-s-solarized.cm-s-light .CodeMirror-selected { - background: #eee8d5; -} +.cm-s-solarized.cm-s-light .CodeMirror-selected { background: #eee8d5; } +.cm-s-solarized.cm-s-light.CodeMirror ::selection { background: #eee8d5; } +.cm-s-solarized.cm-s-lightCodeMirror ::-moz-selection { background: #eee8d5; } /* Editor styling */ diff --git a/media/editors/codemirror/theme/the-matrix.css b/media/editors/codemirror/theme/the-matrix.css index 01474ca94dece..f29b22b0da4d5 100644 --- a/media/editors/codemirror/theme/the-matrix.css +++ b/media/editors/codemirror/theme/the-matrix.css @@ -1,5 +1,7 @@ .cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } .cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; } +.cm-s-the-matrix.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); } +.cm-s-the-matrix.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); } .cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } .cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; } .cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; } diff --git a/media/editors/codemirror/theme/tomorrow-night-eighties.css b/media/editors/codemirror/theme/tomorrow-night-eighties.css index 841413546c0de..5fca3cafbf3fa 100644 --- a/media/editors/codemirror/theme/tomorrow-night-eighties.css +++ b/media/editors/codemirror/theme/tomorrow-night-eighties.css @@ -10,6 +10,8 @@ .cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;} .cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;} +.cm-s-tomorrow-night-eighties.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); } +.cm-s-tomorrow-night-eighties.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); } .cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;} .cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; } .cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; } diff --git a/media/editors/codemirror/theme/twilight.css b/media/editors/codemirror/theme/twilight.css index 9ca50576d849d..889a83d7993e2 100644 --- a/media/editors/codemirror/theme/twilight.css +++ b/media/editors/codemirror/theme/twilight.css @@ -1,5 +1,7 @@ .cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/ .cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/ +.cm-s-twilight.CodeMirror ::selection { background: rgba(50, 50, 50, 0.99); } +.cm-s-twilight.CodeMirror ::-moz-selection { background: rgba(50, 50, 50, 0.99); } .cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; } .cm-s-twilight .CodeMirror-guttermarker { color: white; } diff --git a/media/editors/codemirror/theme/vibrant-ink.css b/media/editors/codemirror/theme/vibrant-ink.css index 5177282325c88..8ea535973c6ce 100644 --- a/media/editors/codemirror/theme/vibrant-ink.css +++ b/media/editors/codemirror/theme/vibrant-ink.css @@ -2,6 +2,8 @@ .cm-s-vibrant-ink.CodeMirror { background: black; color: white; } .cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } +.cm-s-vibrant-ink.CodeMirror ::selection { background: rgba(53, 73, 60, 0.99); } +.cm-s-vibrant-ink.CodeMirror ::-moz-selection { background: rgba(53, 73, 60, 0.99); } .cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } .cm-s-vibrant-ink .CodeMirror-guttermarker { color: white; } diff --git a/media/editors/codemirror/theme/xq-dark.css b/media/editors/codemirror/theme/xq-dark.css index 116eccf21bc48..d537993e89f97 100644 --- a/media/editors/codemirror/theme/xq-dark.css +++ b/media/editors/codemirror/theme/xq-dark.css @@ -22,6 +22,8 @@ THE SOFTWARE. */ .cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; } .cm-s-xq-dark .CodeMirror-selected { background: #27007A !important; } +.cm-s-xq-dark.CodeMirror ::selection { background: rgba(39, 0, 122, 0.99); } +.cm-s-xq-dark.CodeMirror ::-moz-selection { background: rgba(39, 0, 122, 0.99); } .cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } .cm-s-xq-dark .CodeMirror-guttermarker { color: #FFBD40; } .cm-s-xq-dark .CodeMirror-guttermarker-subtle { color: #f8f8f8; } diff --git a/plugins/editors/codemirror/codemirror.php b/plugins/editors/codemirror/codemirror.php index c5e69f6067909..45558d51cc9b6 100644 --- a/plugins/editors/codemirror/codemirror.php +++ b/plugins/editors/codemirror/codemirror.php @@ -67,9 +67,9 @@ public function onInit() $done = true; JHtml::_('behavior.framework'); - JHtml::_('script', $this->basePath . 'lib/codemirror.js'); - JHtml::_('script', $this->basePath . 'lib/addons.js'); - JHtml::_('stylesheet', $this->basePath . 'lib/codemirror.css'); + JHtml::_('script', $this->basePath . 'lib/codemirror.min.js'); + JHtml::_('script', $this->basePath . 'lib/addons.min.js'); + JHtml::_('stylesheet', $this->basePath . 'lib/codemirror.min.css'); JFactory::getDocument() ->addScriptDeclaration($this->getInitScript()) @@ -89,7 +89,8 @@ protected function getInitScript() $fskeys[] = $this->params->get('fullScreen', 'F10'); $this->fullScreenCombo = implode('-', $fskeys); - $modeURL = JURI::root(true) . '/media/editors/codemirror/mode/%N/%N.js'; + $ext = JFactory::getConfig()->get('debug') ? '.js' : '.min.js'; + $modeURL = JURI::root(true) . '/media/editors/codemirror/mode/%N/%N' . $ext; $script = array( ';(function (cm) {', @@ -118,7 +119,8 @@ protected function getInitScript() protected function getExtraStyles() { // Get our custom styles from a css file - $styles = JFile::read(__DIR__ . (JDEBUG ? '/styles.css' : '/styles.min.css')); + $filename = JFactory::getConfig()->get('debug') ? 'styles.css' : 'styles.min.css'; + $styles = JFile::read(__DIR__ . '/' . $filename); // Set the active line color. $color = $this->params->get('activeLineColor', '#a4c2eb'); diff --git a/plugins/editors/codemirror/codemirror.xml b/plugins/editors/codemirror/codemirror.xml index 115072d605511..366605f103d18 100644 --- a/plugins/editors/codemirror/codemirror.xml +++ b/plugins/editors/codemirror/codemirror.xml @@ -1,7 +1,7 @@ plg_editors_codemirror - 4.12 + 5.0 28 March 2011 Marijn Haverbeke marijnh@gmail.com From 6e67ff92ed9c927ffec4a07d2ed984cb9f07c629 Mon Sep 17 00:00:00 2001 From: Ramindu Deshapriya Date: Mon, 23 Feb 2015 16:05:49 +0530 Subject: [PATCH 046/809] Added text wrapping to tooltip in installation template CSS --- installation/template/css/template.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/installation/template/css/template.css b/installation/template/css/template.css index fc85d4be69e37..ed7633c32f68d 100644 --- a/installation/template/css/template.css +++ b/installation/template/css/template.css @@ -136,3 +136,7 @@ textarea.vert { textarea.noResize { resize: none; } +/* Tooltip */ +.tooltip { + white-space: pre-wrap; +} From 26300795be3650cff92c0e85f9ccf017a60b799d Mon Sep 17 00:00:00 2001 From: Wolfgang Naber Date: Mon, 23 Feb 2015 17:16:50 +0100 Subject: [PATCH 047/809] FIX for issue #5764: archived articles list filter --- components/com_content/views/archive/view.html.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/com_content/views/archive/view.html.php b/components/com_content/views/archive/view.html.php index 0913796196800..e25d5fca71895 100644 --- a/components/com_content/views/archive/view.html.php +++ b/components/com_content/views/archive/view.html.php @@ -134,6 +134,8 @@ public function display($tpl = null) $this->params = &$params; $this->user = &$user; $this->pagination = &$pagination; + $this->pagination->setAdditionalUrlParam("month", $state->get('filter.month')); + $this->pagination->setAdditionalUrlParam("year", $state->get('filter.year')); $this->_prepareDocument(); From 9346b03bcee6222b60639155afab8c7483d91fdd Mon Sep 17 00:00:00 2001 From: Hils Date: Fri, 27 Feb 2015 11:49:23 +0000 Subject: [PATCH 048/809] Update en-GB.com_postinstall.ini --- administrator/language/en-GB/en-GB.com_postinstall.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_postinstall.ini b/administrator/language/en-GB/en-GB.com_postinstall.ini index ca22bbce0922c..861026dde4fb7 100644 --- a/administrator/language/en-GB/en-GB.com_postinstall.ini +++ b/administrator/language/en-GB/en-GB.com_postinstall.ini @@ -10,9 +10,9 @@ COM_POSTINSTALL_CONFIGURATION="Post-installation Messages Configuration" COM_POSTINSTALL_LBL_MESSAGES="Post-installation and Upgrade Messages" COM_POSTINSTALL_LBL_NOMESSAGES_DESC="You have already seen and hidden all messages for the current version. If you want to reset the messages, meaning that all messages you have hidden will be displayed again, please click on the Reset Messages button below." COM_POSTINSTALL_LBL_NOMESSAGES_TITLE="No Messages" -COM_POSTINSTALL_LBL_RELEASENEWS="Release news (from Joomla.org)" +COM_POSTINSTALL_LBL_RELEASENEWS="Release news (http://www.joomla.org/)" COM_POSTINSTALL_LBL_SINCEVERSION="Since version %s" COM_POSTINSTALL_MESSAGES_FOR="Showing messages for" COM_POSTINSTALL_MESSAGES_TITLE="Post-installation Messages for %s" -COM_POSTINSTALL_TITLE_JOOMLA="Joomla!" -COM_POSTINSTALL_XML_DESCRIPTION="Displays post-installation and post-upgrade messages for Joomla! and its extensions." +COM_POSTINSTALL_TITLE_JOOMLA="Joomla" +COM_POSTINSTALL_XML_DESCRIPTION="Displays post-installation and post-upgrade messages for Joomla and its extensions." From 0496634e3173a5de8aff6a4a60ac2930cd23ba23 Mon Sep 17 00:00:00 2001 From: Hils Date: Fri, 27 Feb 2015 12:41:08 +0000 Subject: [PATCH 049/809] Update en-GB.com_cpanel.ini ref: https://github.com/joomla/user-interface-text/commit/1b384a25f046254d75a518b13db21f2835e00345 --- administrator/language/en-GB/en-GB.com_cpanel.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_cpanel.ini b/administrator/language/en-GB/en-GB.com_cpanel.ini index 66f79d05a7fe1..5b9b795fc80ed 100644 --- a/administrator/language/en-GB/en-GB.com_cpanel.ini +++ b/administrator/language/en-GB/en-GB.com_cpanel.ini @@ -16,17 +16,17 @@ COM_CPANEL_MESSAGES_BODY_NOCLOSE="There are important post-installation messages COM_CPANEL_MESSAGES_BODYMORE_NOCLOSE="You can review the messages at any time by clicking on the Components, Post-installation messages menu item of your site's Administrator section. This information area won't appear when you have hidden all messages." COM_CPANEL_MESSAGES_REVIEW="Review Messages" COM_CPANEL_MESSAGES_TITLE="You have post-installation messages" -COM_CPANEL_MSG_EACCELERATOR_BODY="eAccelerator is not compatible with Joomla! By clicking on the Change to File Caching button below we will change the cache handler to file. If you want to use a different cache handler, please change it in the Global Configuration page." +COM_CPANEL_MSG_EACCELERATOR_BODY="eAccelerator is not compatible with Joomla By clicking on the Change to File Caching button below we will change the cache handler to file. If you want to use a different cache handler, please change it in the Global Configuration page." COM_CPANEL_MSG_EACCELERATOR_BUTTON="Change to File." COM_CPANEL_MSG_EACCELERATOR_TITLE="eAccelerator is not compatible with Joomla!" COM_CPANEL_MSG_HTACCESS_BODY="A change to the default .htaccess and web.config files was made in Joomla! 3.4 to disallow directory listings by default. Users are recommended to implement this change in their files. Please see this page for more information." COM_CPANEL_MSG_HTACCESS_TITLE=".htaccess & web.config Update" COM_CPANEL_MSG_LANGUAGEACCESS340_TITLE="You have possible issues with your multilingual settings" -COM_CPANEL_MSG_LANGUAGEACCESS340_BODY="Since Joomla 3.4.0 you may have issues with the System - Language Filter plugin on your web site. To fix them please open the Language Manager and save each content language manually to make sure an Access level is saved." +COM_CPANEL_MSG_LANGUAGEACCESS340_BODY="Since Joomla! 3.4.0 you may have issues with the System - Language Filter plugin on your web site. To fix them please open the Language Manager and save each content language manually to make sure an Access level is saved." COM_CPANEL_MSG_PHPVERSION_BODY="Beginning with Joomla! 3.3, the version of PHP this site is using will no longer be supported. Joomla! 3.3 will require at least PHP version 5.3.10 in order to provide enhanced security features to its users." COM_CPANEL_MSG_PHPVERSION_TITLE="Your PHP Version Will Be Unsupported in Joomla! 3.3" COM_CPANEL_MSG_ROBOTS_TITLE="robots.txt Update" COM_CPANEL_MSG_ROBOTS_BODY="A change to the default robots.txt files was made in Joomla! 3.3 to allow Google to access templates and media files by default to improve SEO. This change is not applied automatically on upgrades and users are recommended to review the changes in the robots.txt.dist file and implement these change in their own robots.txt file." -COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="

Community resources are available for new users

  • Joomla! Beginners Guide
  • New to Joomla! Forum
    • " +COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="

      Community resources are available for new users

      • Joomla! Beginners' Guide
      • New to Joomla! Forum
        • " COM_CPANEL_WELCOME_BEGINNERS_TITLE="Welcome to Joomla!" COM_CPANEL_XML_DESCRIPTION="Control Panel component" From 6fb541e15b18edb0e753a230eda72868a7079983 Mon Sep 17 00:00:00 2001 From: Hils Date: Fri, 27 Feb 2015 13:56:09 +0000 Subject: [PATCH 050/809] Update en-GB.com_postinstall.ini --- administrator/language/en-GB/en-GB.com_postinstall.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_postinstall.ini b/administrator/language/en-GB/en-GB.com_postinstall.ini index 861026dde4fb7..784351054c7a0 100644 --- a/administrator/language/en-GB/en-GB.com_postinstall.ini +++ b/administrator/language/en-GB/en-GB.com_postinstall.ini @@ -10,7 +10,7 @@ COM_POSTINSTALL_CONFIGURATION="Post-installation Messages Configuration" COM_POSTINSTALL_LBL_MESSAGES="Post-installation and Upgrade Messages" COM_POSTINSTALL_LBL_NOMESSAGES_DESC="You have already seen and hidden all messages for the current version. If you want to reset the messages, meaning that all messages you have hidden will be displayed again, please click on the Reset Messages button below." COM_POSTINSTALL_LBL_NOMESSAGES_TITLE="No Messages" -COM_POSTINSTALL_LBL_RELEASENEWS="Release news (http://www.joomla.org/)" +COM_POSTINSTALL_LBL_RELEASENEWS="Release news from the Joomla! Project" COM_POSTINSTALL_LBL_SINCEVERSION="Since version %s" COM_POSTINSTALL_MESSAGES_FOR="Showing messages for" COM_POSTINSTALL_MESSAGES_TITLE="Post-installation Messages for %s" From 24e53214f4f70d218b5f06678f8f35591b3c357a Mon Sep 17 00:00:00 2001 From: Hils Date: Fri, 27 Feb 2015 14:18:09 +0000 Subject: [PATCH 051/809] Revert "Update en-GB.com_cpanel.ini (cosmetic)" --- administrator/language/en-GB/en-GB.com_cpanel.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_cpanel.ini b/administrator/language/en-GB/en-GB.com_cpanel.ini index 5b9b795fc80ed..66f79d05a7fe1 100644 --- a/administrator/language/en-GB/en-GB.com_cpanel.ini +++ b/administrator/language/en-GB/en-GB.com_cpanel.ini @@ -16,17 +16,17 @@ COM_CPANEL_MESSAGES_BODY_NOCLOSE="There are important post-installation messages COM_CPANEL_MESSAGES_BODYMORE_NOCLOSE="You can review the messages at any time by clicking on the Components, Post-installation messages menu item of your site's Administrator section. This information area won't appear when you have hidden all messages." COM_CPANEL_MESSAGES_REVIEW="Review Messages" COM_CPANEL_MESSAGES_TITLE="You have post-installation messages" -COM_CPANEL_MSG_EACCELERATOR_BODY="eAccelerator is not compatible with Joomla By clicking on the Change to File Caching button below we will change the cache handler to file. If you want to use a different cache handler, please change it in the Global Configuration page." +COM_CPANEL_MSG_EACCELERATOR_BODY="eAccelerator is not compatible with Joomla! By clicking on the Change to File Caching button below we will change the cache handler to file. If you want to use a different cache handler, please change it in the Global Configuration page." COM_CPANEL_MSG_EACCELERATOR_BUTTON="Change to File." COM_CPANEL_MSG_EACCELERATOR_TITLE="eAccelerator is not compatible with Joomla!" COM_CPANEL_MSG_HTACCESS_BODY="A change to the default .htaccess and web.config files was made in Joomla! 3.4 to disallow directory listings by default. Users are recommended to implement this change in their files. Please see this page for more information." COM_CPANEL_MSG_HTACCESS_TITLE=".htaccess & web.config Update" COM_CPANEL_MSG_LANGUAGEACCESS340_TITLE="You have possible issues with your multilingual settings" -COM_CPANEL_MSG_LANGUAGEACCESS340_BODY="Since Joomla! 3.4.0 you may have issues with the System - Language Filter plugin on your web site. To fix them please open the Language Manager and save each content language manually to make sure an Access level is saved." +COM_CPANEL_MSG_LANGUAGEACCESS340_BODY="Since Joomla 3.4.0 you may have issues with the System - Language Filter plugin on your web site. To fix them please open the Language Manager and save each content language manually to make sure an Access level is saved." COM_CPANEL_MSG_PHPVERSION_BODY="Beginning with Joomla! 3.3, the version of PHP this site is using will no longer be supported. Joomla! 3.3 will require at least PHP version 5.3.10 in order to provide enhanced security features to its users." COM_CPANEL_MSG_PHPVERSION_TITLE="Your PHP Version Will Be Unsupported in Joomla! 3.3" COM_CPANEL_MSG_ROBOTS_TITLE="robots.txt Update" COM_CPANEL_MSG_ROBOTS_BODY="A change to the default robots.txt files was made in Joomla! 3.3 to allow Google to access templates and media files by default to improve SEO. This change is not applied automatically on upgrades and users are recommended to review the changes in the robots.txt.dist file and implement these change in their own robots.txt file." -COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="

          Community resources are available for new users

          • Joomla! Beginners' Guide
          • New to Joomla! Forum
            • " +COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="

              Community resources are available for new users

              • Joomla! Beginners Guide
              • New to Joomla! Forum
                • " COM_CPANEL_WELCOME_BEGINNERS_TITLE="Welcome to Joomla!" COM_CPANEL_XML_DESCRIPTION="Control Panel component" From c0da379e352ae960700ad92ad553c9603ec4579b Mon Sep 17 00:00:00 2001 From: Hils Date: Fri, 27 Feb 2015 14:42:55 +0000 Subject: [PATCH 052/809] Update en-GB.com_cpanel.ini --- administrator/language/en-GB/en-GB.com_cpanel.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_cpanel.ini b/administrator/language/en-GB/en-GB.com_cpanel.ini index 66f79d05a7fe1..a68536dbebacf 100644 --- a/administrator/language/en-GB/en-GB.com_cpanel.ini +++ b/administrator/language/en-GB/en-GB.com_cpanel.ini @@ -22,7 +22,7 @@ COM_CPANEL_MSG_EACCELERATOR_TITLE="eAccelerator is not compatible with Joomla!" COM_CPANEL_MSG_HTACCESS_BODY="A change to the default .htaccess and web.config files was made in Joomla! 3.4 to disallow directory listings by default. Users are recommended to implement this change in their files. Please see this page for more information." COM_CPANEL_MSG_HTACCESS_TITLE=".htaccess & web.config Update" COM_CPANEL_MSG_LANGUAGEACCESS340_TITLE="You have possible issues with your multilingual settings" -COM_CPANEL_MSG_LANGUAGEACCESS340_BODY="Since Joomla 3.4.0 you may have issues with the System - Language Filter plugin on your web site. To fix them please open the Language Manager and save each content language manually to make sure an Access level is saved." +COM_CPANEL_MSG_LANGUAGEACCESS340_BODY="Since Joomla! 3.4.0 you may have issues with the System - Language Filter plugin on your web site. To fix them please open the Language Manager and save each content language manually to make sure an Access level is saved." COM_CPANEL_MSG_PHPVERSION_BODY="Beginning with Joomla! 3.3, the version of PHP this site is using will no longer be supported. Joomla! 3.3 will require at least PHP version 5.3.10 in order to provide enhanced security features to its users." COM_CPANEL_MSG_PHPVERSION_TITLE="Your PHP Version Will Be Unsupported in Joomla! 3.3" COM_CPANEL_MSG_ROBOTS_TITLE="robots.txt Update" From 42d588391c5438a70328277f7e179408cb2dcb49 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sat, 28 Feb 2015 23:53:22 +0000 Subject: [PATCH 053/809] Fix undefined var for ReCapture 2.0 API calls. --- plugins/captcha/recaptcha/recaptcha.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/captcha/recaptcha/recaptcha.php b/plugins/captcha/recaptcha/recaptcha.php index 26836185469f0..7d461ba559694 100644 --- a/plugins/captcha/recaptcha/recaptcha.php +++ b/plugins/captcha/recaptcha/recaptcha.php @@ -126,6 +126,7 @@ public function onCheckAnswer($code) $spam = ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0); break; case '2.0': + $challenge = NULL; // Not needed in 2.0 but needed for getResponse call $response = $input->get('g-recaptcha-response', '', 'string'); $spam = ($response == null || strlen($response) == 0); break; @@ -164,7 +165,7 @@ public function onCheckAnswer($code) * @param string $privatekey The private key for authentication. * @param string $remoteip The remote IP of the visitor. * @param string $response The response received from Google. - * @param string $challenge The challenge field from the reCaptcha. + * @param string $challenge The challenge field from the reCaptcha. Only for 1.0. * * @return bool True if response is good | False if response is bad. * From 6b3f4b53c4661c58bb232e34def5ef3717bbf84f Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sat, 28 Feb 2015 23:59:05 +0000 Subject: [PATCH 054/809] Fix another unused param warning in recaptcha --- plugins/captcha/recaptcha/recaptcha.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/captcha/recaptcha/recaptcha.php b/plugins/captcha/recaptcha/recaptcha.php index 7d461ba559694..7ef33cc3d4cf5 100644 --- a/plugins/captcha/recaptcha/recaptcha.php +++ b/plugins/captcha/recaptcha/recaptcha.php @@ -88,7 +88,7 @@ public function onInit($id = 'dynamic_recaptcha_1') /** * Gets the challenge HTML * - * @param string $name The name of the field. + * @param string $name The name of the field. Not Used. * @param string $id The id of the field. * @param string $class The class of the field. This should be passed as * e.g. 'class="required"'. @@ -97,7 +97,7 @@ public function onInit($id = 'dynamic_recaptcha_1') * * @since 2.5 */ - public function onDisplay($name, $id = 'dynamic_recaptcha_1', $class = '') + public function onDisplay($name = null, $id = 'dynamic_recaptcha_1', $class = '') { return '
                  '; } From 5eb68e7dde8c6340e7f159e8fb8ddb5b9ae7ad1a Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sun, 1 Mar 2015 00:06:17 +0000 Subject: [PATCH 055/809] Highlight deprecated unused code in reCaptcha --- plugins/captcha/recaptcha/recaptcha.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/captcha/recaptcha/recaptcha.php b/plugins/captcha/recaptcha/recaptcha.php index 7ef33cc3d4cf5..f8f901a88c5b3 100644 --- a/plugins/captcha/recaptcha/recaptcha.php +++ b/plugins/captcha/recaptcha/recaptcha.php @@ -105,13 +105,13 @@ public function onDisplay($name = null, $id = 'dynamic_recaptcha_1', $class = '' /** * Calls an HTTP POST function to verify if the user's guess was correct * - * @param string $code Answer provided by user. + * @param string $code Answer provided by user. @Deprecated and not needed for the current implementation * * @return True if the answer is correct, false otherwise * * @since 2.5 */ - public function onCheckAnswer($code) + public function onCheckAnswer($code = null) { $input = JFactory::getApplication()->input; $privatekey = $this->params->get('private_key'); From c991cc5ba1f2bd4e7c324bf6a6f7ab39a1010760 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sun, 1 Mar 2015 11:00:47 +0000 Subject: [PATCH 056/809] codestyle for Travis --- plugins/captcha/recaptcha/recaptcha.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/captcha/recaptcha/recaptcha.php b/plugins/captcha/recaptcha/recaptcha.php index f8f901a88c5b3..9006399f623a1 100644 --- a/plugins/captcha/recaptcha/recaptcha.php +++ b/plugins/captcha/recaptcha/recaptcha.php @@ -126,7 +126,8 @@ public function onCheckAnswer($code = null) $spam = ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0); break; case '2.0': - $challenge = NULL; // Not needed in 2.0 but needed for getResponse call + // Challenge Not needed in 2.0 but needed for getResponse call + $challenge = null; $response = $input->get('g-recaptcha-response', '', 'string'); $spam = ($response == null || strlen($response) == 0); break; From 9cc047c28f9780cef9bf152ef53d3f9287c993cc Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sun, 1 Mar 2015 20:23:11 +0000 Subject: [PATCH 057/809] code style --- plugins/captcha/recaptcha/recaptcha.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/captcha/recaptcha/recaptcha.php b/plugins/captcha/recaptcha/recaptcha.php index 9006399f623a1..4dc3958d58ce3 100644 --- a/plugins/captcha/recaptcha/recaptcha.php +++ b/plugins/captcha/recaptcha/recaptcha.php @@ -128,8 +128,8 @@ public function onCheckAnswer($code = null) case '2.0': // Challenge Not needed in 2.0 but needed for getResponse call $challenge = null; - $response = $input->get('g-recaptcha-response', '', 'string'); - $spam = ($response == null || strlen($response) == 0); + $response = $input->get('g-recaptcha-response', '', 'string'); + $spam = ($response == null || strlen($response) == 0); break; } From 0e22bc1a57da2b223205d40cf830b0e33e15ed8f Mon Sep 17 00:00:00 2001 From: Roberto Segura - phproberto Date: Tue, 3 Mar 2015 12:03:44 +0100 Subject: [PATCH 058/809] [fix] only define constants if they are not defined --- libraries/cms/component/helper.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/libraries/cms/component/helper.php b/libraries/cms/component/helper.php index 1b87717919e54..7d44b1576ad1c 100644 --- a/libraries/cms/component/helper.php +++ b/libraries/cms/component/helper.php @@ -338,9 +338,20 @@ public static function renderComponent($option, $params = array()) $file = substr($option, 4); // Define component path. - define('JPATH_COMPONENT', JPATH_BASE . '/components/' . $option); - define('JPATH_COMPONENT_SITE', JPATH_SITE . '/components/' . $option); - define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/' . $option); + if (!defined('JPATH_COMPONENT')) + { + define('JPATH_COMPONENT', JPATH_BASE . '/components/' . $option); + } + + if (!defined('JPATH_COMPONENT_SITE')) + { + define('JPATH_COMPONENT_SITE', JPATH_SITE . '/components/' . $option); + } + + if (!defined('JPATH_COMPONENT_ADMINISTRATOR')) + { + define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/' . $option); + } $path = JPATH_COMPONENT . '/' . $file . '.php'; From 6c8f5ae719c495f3c452860bde9d153492f4f2c9 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Fri, 6 Mar 2015 19:10:52 +0100 Subject: [PATCH 059/809] Removing more unnecessary code --- modules/mod_menu/helper.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/mod_menu/helper.php b/modules/mod_menu/helper.php index ac595b4eb1487..f8af3e3f2e41b 100644 --- a/modules/mod_menu/helper.php +++ b/modules/mod_menu/helper.php @@ -103,11 +103,6 @@ public static function getList(&$params) default: $item->flink = 'index.php?Itemid=' . $item->id; - - if (isset($item->query['format']) && $app->get('sef_suffix')) - { - $item->flink .= '&format=' . $item->query['format']; - } break; } From 88b9d4add77c776c664fbbe736bc615b6997dfd9 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Mon, 2 Mar 2015 11:06:37 -0500 Subject: [PATCH 060/809] Update joomla/registry package to 1.4.2 release --- composer.lock | 10 +- libraries/vendor/autoload.php | 2 +- libraries/vendor/composer/autoload_real.php | 10 +- libraries/vendor/composer/installed.json | 112 +++---- .../vendor/joomla/registry/src/Registry.php | 286 +++++++++++++----- 5 files changed, 278 insertions(+), 142 deletions(-) diff --git a/composer.lock b/composer.lock index 4c0c55a6a1767..c8523ce86c4c3 100644 --- a/composer.lock +++ b/composer.lock @@ -325,16 +325,16 @@ }, { "name": "joomla/registry", - "version": "1.3.0", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/joomla-framework/registry.git", - "reference": "7330ea6481d0fe062f46d2b6cb848c212789915e" + "reference": "5c2e607ff61f8df07c3c0630ed62a8c3d892469e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/registry/zipball/7330ea6481d0fe062f46d2b6cb848c212789915e", - "reference": "7330ea6481d0fe062f46d2b6cb848c212789915e", + "url": "https://api.github.com/repos/joomla-framework/registry/zipball/5c2e607ff61f8df07c3c0630ed62a8c3d892469e", + "reference": "5c2e607ff61f8df07c3c0630ed62a8c3d892469e", "shasum": "" }, "require": { @@ -375,7 +375,7 @@ "joomla", "registry" ], - "time": "2014-10-08 16:14:29" + "time": "2015-03-07 18:48:26" }, { "name": "joomla/session", diff --git a/libraries/vendor/autoload.php b/libraries/vendor/autoload.php index 0cf0fb16d8578..23ca6f1ceed47 100644 --- a/libraries/vendor/autoload.php +++ b/libraries/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInitf813baef5785848a572e54f19799bcd2::getLoader(); +return ComposerAutoloaderInit49c8bb076e4b3d05954030bb4161f348::getLoader(); diff --git a/libraries/vendor/composer/autoload_real.php b/libraries/vendor/composer/autoload_real.php index 71d175c9f2e57..f9735f4861856 100644 --- a/libraries/vendor/composer/autoload_real.php +++ b/libraries/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitf813baef5785848a572e54f19799bcd2 +class ComposerAutoloaderInit49c8bb076e4b3d05954030bb4161f348 { private static $loader; @@ -19,9 +19,9 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitf813baef5785848a572e54f19799bcd2', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit49c8bb076e4b3d05954030bb4161f348', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitf813baef5785848a572e54f19799bcd2', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit49c8bb076e4b3d05954030bb4161f348', 'loadClassLoader')); $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -42,14 +42,14 @@ public static function getLoader() $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - composerRequiref813baef5785848a572e54f19799bcd2($file); + composerRequire49c8bb076e4b3d05954030bb4161f348($file); } return $loader; } } -function composerRequiref813baef5785848a572e54f19799bcd2($file) +function composerRequire49c8bb076e4b3d05954030bb4161f348($file) { require $file; } diff --git a/libraries/vendor/composer/installed.json b/libraries/vendor/composer/installed.json index 437fe179a5684..adbc004a2b002 100644 --- a/libraries/vendor/composer/installed.json +++ b/libraries/vendor/composer/installed.json @@ -343,62 +343,6 @@ "string" ] }, - { - "name": "joomla/registry", - "version": "1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/joomla-framework/registry.git", - "reference": "7330ea6481d0fe062f46d2b6cb848c212789915e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/registry/zipball/7330ea6481d0fe062f46d2b6cb848c212789915e", - "reference": "7330ea6481d0fe062f46d2b6cb848c212789915e", - "shasum": "" - }, - "require": { - "joomla/compat": "~1.0", - "joomla/string": "~1.2", - "joomla/utilities": "~1.0", - "php": ">=5.3.10" - }, - "require-dev": { - "joomla/test": "~1.0", - "phpunit/phpunit": "4.*", - "squizlabs/php_codesniffer": "1.*", - "symfony/yaml": "~2.0" - }, - "suggest": { - "symfony/yaml": "Install 2.* if you require YAML support." - }, - "time": "2014-10-08 16:14:29", - "type": "joomla-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Joomla\\Registry\\": "src/", - "Joomla\\Registry\\Tests\\": "Tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0+" - ], - "description": "Joomla Registry Package", - "homepage": "https://github.com/joomla-framework/registry", - "keywords": [ - "framework", - "joomla", - "registry" - ] - }, { "name": "joomla/input", "version": "1.2.0", @@ -756,5 +700,61 @@ "ioc", "joomla" ] + }, + { + "name": "joomla/registry", + "version": "1.4.2", + "version_normalized": "1.4.2.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/registry.git", + "reference": "5c2e607ff61f8df07c3c0630ed62a8c3d892469e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/registry/zipball/5c2e607ff61f8df07c3c0630ed62a8c3d892469e", + "reference": "5c2e607ff61f8df07c3c0630ed62a8c3d892469e", + "shasum": "" + }, + "require": { + "joomla/compat": "~1.0", + "joomla/string": "~1.2", + "joomla/utilities": "~1.0", + "php": ">=5.3.10" + }, + "require-dev": { + "joomla/test": "~1.0", + "phpunit/phpunit": "4.*", + "squizlabs/php_codesniffer": "1.*", + "symfony/yaml": "~2.0" + }, + "suggest": { + "symfony/yaml": "Install 2.* if you require YAML support." + }, + "time": "2015-03-07 18:48:26", + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Joomla\\Registry\\": "src/", + "Joomla\\Registry\\Tests\\": "Tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "description": "Joomla Registry Package", + "homepage": "https://github.com/joomla-framework/registry", + "keywords": [ + "framework", + "joomla", + "registry" + ] } ] diff --git a/libraries/vendor/joomla/registry/src/Registry.php b/libraries/vendor/joomla/registry/src/Registry.php index 6de99b42a9027..8c970b8f1d636 100644 --- a/libraries/vendor/joomla/registry/src/Registry.php +++ b/libraries/vendor/joomla/registry/src/Registry.php @@ -33,6 +33,14 @@ class Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \ */ protected static $instances = array(); + /** + * Path separator + * + * @var string + * @since 1.4.0 + */ + public $separator = '.'; + /** * Constructor * @@ -49,8 +57,11 @@ public function __construct($data = null) if (is_array($data) || is_object($data)) { $this->bindData($this->data, $data); + + return; } - elseif (!empty($data) && is_string($data)) + + if (!empty($data) && is_string($data)) { $this->loadString($data); } @@ -90,14 +101,7 @@ public function __toString() */ public function count() { - $i = 0; - - foreach ($this->data as $item) - { - $i++; - } - - return $i++; + return count(get_object_vars($this->data)); } /** @@ -143,34 +147,39 @@ public function def($key, $default = '') */ public function exists($path) { + // Return default value if path is empty + if (empty($path)) + { + return false; + } + // Explode the registry path into an array - $nodes = explode('.', $path); + $nodes = explode($this->separator, $path); - if ($nodes) - { - // Initialize the current node to be the registry root. - $node = $this->data; + // Initialize the current node to be the registry root. + $node = $this->data; + $found = false; - // Traverse the registry to find the correct node for the result. - for ($i = 0, $n = count($nodes); $i < $n; $i++) + // Traverse the registry to find the correct node for the result. + foreach ($nodes as $n) + { + if (is_array($node) && isset($node[$n])) { - if (isset($node->$nodes[$i])) - { - $node = $node->$nodes[$i]; - } - else - { - break; - } + $node = $node[$n]; + $found = true; + continue; + } - if ($i + 1 == $n) - { - return true; - } + if (!isset($node->$n)) + { + return false; } + + $node = $node->$n; + $found = true; } - return false; + return $found; } /** @@ -185,15 +194,19 @@ public function exists($path) */ public function get($path, $default = null) { - $result = $default; + // Return default value if path is empty + if (empty($path)) + { + return $default; + } - if (!strpos($path, '.')) + if (!strpos($path, $this->separator)) { return (isset($this->data->$path) && $this->data->$path !== null && $this->data->$path !== '') ? $this->data->$path : $default; } // Explode the registry path into an array - $nodes = explode('.', $path); + $nodes = explode($this->separator, trim($path)); // Initialize the current node to be the registry root. $node = $this->data; @@ -202,24 +215,29 @@ public function get($path, $default = null) // Traverse the registry to find the correct node for the result. foreach ($nodes as $n) { - if (isset($node->$n)) + if (is_array($node) && isset($node[$n])) { - $node = $node->$n; + $node = $node[$n]; $found = true; + + continue; } - else + + if (!isset($node->$n)) { - $found = false; - break; + return $default; } + + $node = $node->$n; + $found = true; } - if ($found && $node !== null && $node !== '') + if (!$found || $node === null || $node === '') { - $result = $node; + return $default; } - return $result; + return $node; } /** @@ -263,15 +281,27 @@ public function getIterator() /** * Load a associative array of values into the default namespace * - * @param array $array Associative array of value to load + * @param array $array Associative array of value to load + * @param boolean $flattened Load from a one-dimensional array + * @param string $separator The key separator * * @return Registry Return this object to support chaining. * * @since 1.0 */ - public function loadArray($array) + public function loadArray($array, $flattened = false, $separator = null) { - $this->bindData($this->data, $array); + if (!$flattened) + { + $this->bindData($this->data, $array); + + return $this; + } + + foreach ($array as $k => $v) + { + $this->set($k, $v, $separator); + } return $this; } @@ -357,7 +387,7 @@ public function merge($source, $recursive = false) /** * Method to extract a sub-registry from path * - * @param string $path Registry path (e.g. joomla.content.showauthor) + * @param string $path Registry path (e.g. joomla.content.showauthor) * * @return Registry|null Registry object if data is present * @@ -435,14 +465,94 @@ public function offsetUnset($offset) /** * Set a registry value. * - * @param string $path Registry Path (e.g. joomla.content.showauthor) - * @param mixed $value Value of entry + * @param string $path Registry Path (e.g. joomla.content.showauthor) + * @param mixed $value Value of entry + * @param string $separator The key separator * * @return mixed The value of the that has been set. * * @since 1.0 */ - public function set($path, $value) + public function set($path, $value, $separator = null) + { + if (empty($separator)) + { + $separator = $this->separator; + } + + /** + * Explode the registry path into an array and remove empty + * nodes that occur as a result of a double separator. ex: joomla..test + * Finally, re-key the array so they are sequential. + */ + $nodes = array_values(array_filter(explode($separator, $path), 'strlen')); + + if (!$nodes) + { + return null; + } + + // Initialize the current node to be the registry root. + $node = $this->data; + + // Traverse the registry to find the correct node for the result. + for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++) + { + if (is_object($node)) + { + if (!isset($node->$nodes[$i]) && ($i != $n)) + { + $node->$nodes[$i] = new \stdClass; + } + + // Pass the child as pointer in case it is an object + $node = &$node->$nodes[$i]; + + continue; + } + + if (is_array($node)) + { + if (!isset($node[$nodes[$i]]) && ($i != $n)) + { + $node[$nodes[$i]] = new \stdClass; + } + + // Pass the child as pointer in case it is an array + $node = &$node[$nodes[$i]]; + } + } + + // Get the old value if exists so we can return it + switch (true) + { + case (is_object($node)): + $result = $node->$nodes[$i] = $value; + break; + + case (is_array($node)): + $result = $node[$nodes[$i]] = $value; + break; + + default: + $result = null; + break; + } + + return $result; + } + + /** + * Append value to a path in registry + * + * @param string $path Parent registry Path (e.g. joomla.content.showauthor) + * @param mixed $value Value of entry + * + * @return mixed The value of the that has been set. + * + * @since 1.4.0 + */ + public function append($path, $value) { $result = null; @@ -459,18 +569,39 @@ public function set($path, $value) $node = $this->data; // Traverse the registry to find the correct node for the result. - for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++) + // TODO Create a new private method from part of code below, as it is almost equal to 'set' method + for ($i = 0, $n = count($nodes) - 1; $i <= $n; $i++) { - if (!isset($node->$nodes[$i]) && ($i != $n)) + if (is_object($node)) { - $node->$nodes[$i] = new \stdClass; + if (!isset($node->$nodes[$i]) && ($i != $n)) + { + $node->$nodes[$i] = new \stdClass; + } + + // Pass the child as pointer in case it is an array + $node = &$node->$nodes[$i]; } + elseif (is_array($node)) + { + if (!isset($node[$nodes[$i]]) && ($i != $n)) + { + $node[$nodes[$i]] = new \stdClass; + } - $node = $node->$nodes[$i]; + // Pass the child as pointer in case it is an array + $node = &$node[$nodes[$i]]; + } } - // Get the old value if exists so we can return it - $result = $node->$nodes[$i] = $value; + if (!is_array($node)) + // Convert the node to array to make append possible + { + $node = get_object_vars($node); + } + + array_push($node, $value); + $result = $value; } return $result; @@ -533,14 +664,9 @@ public function toString($format = 'JSON', $options = array()) protected function bindData($parent, $data, $recursive = true, $allowNull = true) { // Ensure the input data is an array. - if (is_object($data)) - { - $data = get_object_vars($data); - } - else - { - $data = (array) $data; - } + $data = is_object($data) + ? get_object_vars($data) + : (array) $data; foreach ($data as $k => $v) { @@ -557,11 +683,11 @@ protected function bindData($parent, $data, $recursive = true, $allowNull = true } $this->bindData($parent->$k, $v); + + continue; } - else - { - $parent->$k = $v; - } + + $parent->$k = $v; } } @@ -588,11 +714,11 @@ protected function asArray($data) if (is_object($v) || is_array($v)) { $array[$k] = $this->asArray($v); + + continue; } - else - { - $array[$k] = $v; - } + + $array[$k] = $v; } return $array; @@ -607,10 +733,15 @@ protected function asArray($data) * * @since 1.3.0 */ - public function flatten($separator = '.') + public function flatten($separator = null) { $array = array(); + if (empty($separator)) + { + $separator = $this->separator; + } + $this->toFlatten($separator, $this->data, $array); return $array; @@ -628,10 +759,15 @@ public function flatten($separator = '.') * * @since 1.3.0 */ - protected function toFlatten($separator = '.', $data = null, &$array = array(), $prefix = '') + protected function toFlatten($separator = null, $data = null, &$array = array(), $prefix = '') { $data = (array) $data; + if (empty($separator)) + { + $separator = $this->separator; + } + foreach ($data as $k => $v) { $key = $prefix ? $prefix . $separator . $k : $k; @@ -639,11 +775,11 @@ protected function toFlatten($separator = '.', $data = null, &$array = array(), if (is_object($v) || is_array($v)) { $this->toFlatten($separator, $v, $array, $key); + + continue; } - else - { - $array[$key] = $v; - } + + $array[$key] = $v; } } } From 0c3e54d2ea32e700a39cfd2c160416389ec0cdee Mon Sep 17 00:00:00 2001 From: David Beuving Date: Mon, 9 Mar 2015 09:14:57 -0700 Subject: [PATCH 061/809] Moving language string to JLIB language file, and Adjusting the comment to keep it standard --- administrator/language/en-GB/en-GB.com_menus.ini | 1 - administrator/language/en-GB/en-GB.lib_joomla.ini | 1 + libraries/legacy/table/menu.php | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_menus.ini b/administrator/language/en-GB/en-GB.com_menus.ini index cc34af6d3cb01..6a9d0117cc21f 100644 --- a/administrator/language/en-GB/en-GB.com_menus.ini +++ b/administrator/language/en-GB/en-GB.com_menus.ini @@ -180,6 +180,5 @@ COM_MENUS_VIEW_ITEMS_TITLE="Menu Manager: Menu Items" COM_MENUS_VIEW_MENUS_TITLE="Menu Manager: Menus" COM_MENUS_VIEW_NEW_ITEM_TITLE="Menu Manager: New Menu Item" COM_MENUS_VIEW_NEW_MENU_TITLE="Menu Manager: Add Menu" -COM_MENUS_WARNING_PROVIDE_VALID_TITLE="Please provide a valid, non-blank title." COM_MENUS_XML_DESCRIPTION="Component for creating menus." JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
                  Inherited means that the permissions from global configuration and parent group will be used.
                  Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
                  Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
                  2. If you select a new setting, click Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.lib_joomla.ini b/administrator/language/en-GB/en-GB.lib_joomla.ini index 26ead5955601a..515a0077d6506 100644 --- a/administrator/language/en-GB/en-GB.lib_joomla.ini +++ b/administrator/language/en-GB/en-GB.lib_joomla.ini @@ -189,6 +189,7 @@ JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_FOLDER="A first level menu item alias can't JLIB_DATABASE_ERROR_MOVE_FAILED="%s: :move failed - %s" JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_CATEGORY="Category must have a title." JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_EXTENSION="Extension must have a title." +JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_MENUITEM="Menu Item must have a title." JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_MODULE="Module must have a title." JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_UPDATESITE="Update site must have a title." JLIB_DATABASE_ERROR_NEGATIVE_NOT_PERMITTED="%s can't be negative." diff --git a/libraries/legacy/table/menu.php b/libraries/legacy/table/menu.php index e85586d5fbd5a..238cae7e8f3a3 100644 --- a/libraries/legacy/table/menu.php +++ b/libraries/legacy/table/menu.php @@ -90,10 +90,10 @@ public function bind($array, $ignore = '') */ public function check() { - // Make sure there is a valid title, a space doesn't count + // Check for a title. if (trim($this->title) == '') { - $this->setError(JText::_('COM_MENUS_WARNING_PROVIDE_VALID_TITLE')); + $this->setError(JText::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_MENUITEM')); return false; } From 0e701fc22da87fc0a09de2372a27d86b71f98f32 Mon Sep 17 00:00:00 2001 From: David Beuving Date: Mon, 9 Mar 2015 09:17:24 -0700 Subject: [PATCH 062/809] Adding Launguage string to the frontend as well. --- language/en-GB/en-GB.lib_joomla.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/language/en-GB/en-GB.lib_joomla.ini b/language/en-GB/en-GB.lib_joomla.ini index ce8a626e4630b..11a19cf54d8be 100644 --- a/language/en-GB/en-GB.lib_joomla.ini +++ b/language/en-GB/en-GB.lib_joomla.ini @@ -189,6 +189,7 @@ JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_FOLDER="A first level menu item alias can't JLIB_DATABASE_ERROR_MOVE_FAILED="%s: :move failed - %s" JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_CATEGORY="Category must have a title." JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_EXTENSION="Extension must have a title." +JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_MENUITEM="Menu Item must have a title." JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_MODULE="Module must have a title." JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_UPDATESITE="Update site must have a title." JLIB_DATABASE_ERROR_NEGATIVE_NOT_PERMITTED="%s can't be negative." From a8a6b7aac12f5ce4e294fc4748f0a137020ad04b Mon Sep 17 00:00:00 2001 From: George Wilson Date: Mon, 9 Mar 2015 17:19:17 +0000 Subject: [PATCH 063/809] Add another --- media/system/js/core-uncompressed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/system/js/core-uncompressed.js b/media/system/js/core-uncompressed.js index 7a746ae548ee2..d7558f33d7818 100644 --- a/media/system/js/core-uncompressed.js +++ b/media/system/js/core-uncompressed.js @@ -148,7 +148,7 @@ Joomla.renderMessages = function(messages) { titleWrapper.className = 'alert-heading'; titleWrapper.innerHTML = Joomla.JText._(type); - messagesBox.appendChild(titleWrapper) + messagesBox.appendChild(titleWrapper); } // Add messages to the message box From ca34eaca2021ed4336cd674f7327054f7f4010a0 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Tue, 10 Mar 2015 07:35:45 +0100 Subject: [PATCH 064/809] RTL Module Manager wrong column width --- .../components/com_modules/views/modules/tmpl/default.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_modules/views/modules/tmpl/default.php b/administrator/components/com_modules/views/modules/tmpl/default.php index 4750051c6ee72..c4812538160db 100644 --- a/administrator/components/com_modules/views/modules/tmpl/default.php +++ b/administrator/components/com_modules/views/modules/tmpl/default.php @@ -99,7 +99,7 @@ - + From 07c25746859949d9bca38f15ea8f4487d2d5a19d Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Tue, 10 Mar 2015 15:19:23 +0100 Subject: [PATCH 065/809] Raising version tag in NL installation file. Sorry, that slipped through in the previous commit. --- installation/language/nl-NL/nl-NL.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/language/nl-NL/nl-NL.xml b/installation/language/nl-NL/nl-NL.xml index afd074d156c07..927ec1d769a9a 100644 --- a/installation/language/nl-NL/nl-NL.xml +++ b/installation/language/nl-NL/nl-NL.xml @@ -1,6 +1,6 @@ Dutch nl-NL 3.4.0 From a935445f1ab2c5b750ead6e7fcd961372f94a262 Mon Sep 17 00:00:00 2001 From: Fedik Date: Thu, 5 Mar 2015 11:21:38 +0200 Subject: [PATCH 066/809] speed up the rule field. Fixes #6317 c.s. --- libraries/joomla/form/fields/rules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/joomla/form/fields/rules.php b/libraries/joomla/form/fields/rules.php index ae69abace6f57..fd3e9e573616a 100644 --- a/libraries/joomla/form/fields/rules.php +++ b/libraries/joomla/form/fields/rules.php @@ -266,10 +266,10 @@ protected function getInput() $html[] = ''; - $html[] = ''; $inheritedRule = JAccess::checkGroup($group->value, $action->name, $assetId); From 414613a1792f82076d9a1bf6e3274250c060b0eb Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Tue, 10 Mar 2015 19:41:13 +0100 Subject: [PATCH 067/809] Updating en-GB version tags to 3.4.1 --- administrator/language/en-GB/en-GB.xml | 2 +- administrator/language/en-GB/install.xml | 2 +- language/en-GB/en-GB.xml | 2 +- language/en-GB/install.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/administrator/language/en-GB/en-GB.xml b/administrator/language/en-GB/en-GB.xml index 69d9e598642b8..cb7ad0b28c8c0 100644 --- a/administrator/language/en-GB/en-GB.xml +++ b/administrator/language/en-GB/en-GB.xml @@ -1,7 +1,7 @@ English (en-GB) - 3.4.0 + 3.4.1 2013-03-07 Joomla! Project admin@joomla.org diff --git a/administrator/language/en-GB/install.xml b/administrator/language/en-GB/install.xml index 6689f4381f200..aa75ed353f977 100644 --- a/administrator/language/en-GB/install.xml +++ b/administrator/language/en-GB/install.xml @@ -2,7 +2,7 @@ English (United Kingdom) en-GB - 3.4.0 + 3.4.1 2013-03-07 Joomla! Project admin@joomla.org diff --git a/language/en-GB/en-GB.xml b/language/en-GB/en-GB.xml index cc3d7f3716d14..5324d81b3bf7c 100644 --- a/language/en-GB/en-GB.xml +++ b/language/en-GB/en-GB.xml @@ -1,7 +1,7 @@ English (en-GB) - 3.4.0 + 3.4.1 2013-03-07 Joomla! Project admin@joomla.org diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index 4e3d3ecd90dbe..3f10b3b8056bd 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -2,7 +2,7 @@ English (United Kingdom) en-GB - 3.4.0 + 3.4.1 2013-03-07 Joomla! Project admin@joomla.org From 0953755760009e3515ec62c88eda5db3702a70e5 Mon Sep 17 00:00:00 2001 From: Eric Fernance Date: Wed, 11 Mar 2015 13:17:03 +1000 Subject: [PATCH 068/809] Changes fireEvent to onsubmit from submit --- media/system/js/core-uncompressed.js | 2 +- media/system/js/core.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/media/system/js/core-uncompressed.js b/media/system/js/core-uncompressed.js index 3a699bd1eba0d..67b3b7bd9af83 100644 --- a/media/system/js/core-uncompressed.js +++ b/media/system/js/core-uncompressed.js @@ -425,7 +425,7 @@ function submitform(pressbutton) { document.adminForm.onsubmit(); } if (typeof document.adminForm.fireEvent == "function") { - document.adminForm.fireEvent('submit'); + document.adminForm.fireEvent('onsubmit'); } document.adminForm.submit(); } diff --git a/media/system/js/core.js b/media/system/js/core.js index d2c867a1170f5..322924c7b0acf 100644 --- a/media/system/js/core.js +++ b/media/system/js/core.js @@ -1 +1 @@ -Joomla=window.Joomla||{};Joomla.editors={};Joomla.editors.instances={};Joomla.submitform=function(task,form){if(typeof form==="undefined"){form=document.getElementById("adminForm")}if(typeof task!=="undefined"&&task!==""){form.task.value=task}if(typeof form.onsubmit=="function"){form.onsubmit()}if(typeof form.fireEvent=="function"){form.fireEvent("onsubmit")}form.submit()};Joomla.submitbutton=function(pressbutton){Joomla.submitform(pressbutton)};Joomla.JText={strings:{},_:function(key,def){return typeof this.strings[key.toUpperCase()]!=="undefined"?this.strings[key.toUpperCase()]:def},load:function(object){for(var key in object){this.strings[key.toUpperCase()]=object[key]}return this}};Joomla.replaceTokens=function(n){var els=document.getElementsByTagName("input"),i;for(i=0;i=0;i--){var messageWrapper=document.createElement("p");messageWrapper.innerHTML=typeMessages[i];messagesBox.appendChild(messageWrapper)}messageContainer.appendChild(messagesBox)}}};Joomla.removeMessages=function(){var messageContainer=document.getElementById("system-message-container");while(messageContainer.firstChild)messageContainer.removeChild(messageContainer.firstChild);messageContainer.style.display="none";messageContainer.offsetHeight;messageContainer.style.display=""};Joomla.isChecked=function(isitchecked,form){if(typeof form==="undefined"){form=document.getElementById("adminForm")}if(isitchecked==true){form.boxchecked.value++}else{form.boxchecked.value--}var c=true,i,e;for(i=0,n=form.elements.length;i",i,selected;i=0;for(x in source){if(source[x][0]==key){selected="";if(orig_key==key&&orig_val==source[x][1]||i==0&&orig_key!=key){selected='selected="selected"'}html+='\n "}i++}html+="\n ";document.writeln(html)}function changeDynaList(listname,source,key,orig_key,orig_val){var list=document.adminForm[listname];for(i in list.options.length){list.options[i]=null}i=0;for(x in source){if(source[x][0]==key){opt=new Option;opt.value=source[x][1];opt.text=source[x][2];if(orig_key==key&&orig_val==opt.value||i==0){opt.selected=true}list.options[i++]=opt}}list.length=i}function radioGetCheckedValue(radioObj){if(!radioObj){return""}var n=radioObj.length,i;if(n==undefined){if(radioObj.checked){return radioObj.value}else{return""}}for(i=0;i-1){return srcList.options[i].value}else{return null}}function listItemTask(id,task){var f=document.adminForm,i,cbx,cb=f[id];if(cb){for(i=0;true;i++){cbx=f["cb"+i];if(!cbx)break;cbx.checked=false}cb.checked=true;f.boxchecked.value=1;submitbutton(task)}return false}function submitbutton(pressbutton){submitform(pressbutton)}function submitform(pressbutton){if(pressbutton){document.adminForm.task.value=pressbutton}if(typeof document.adminForm.onsubmit=="function"){document.adminForm.onsubmit()}if(typeof document.adminForm.fireEvent=="function"){document.adminForm.fireEvent("submit")}document.adminForm.submit()}function saveorder(n,task){checkAll_button(n,task)}function checkAll_button(n,task){if(!task){task="saveorder"}var j,box;for(j=0;j<=n;j++){box=document.adminForm["cb"+j];if(box){if(box.checked==false){box.checked=true}}else{alert("You cannot change the order of items, as an item in the list is `Checked Out`");return}}submitform(task)} \ No newline at end of file +function writeDynaList(a,b,c,d,e){var g,h,f="\n ",document.writeln(f)}function changeDynaList(a,b,c,d,e){var f=document.adminForm[a];for(i in f.options.length)f.options[i]=null;i=0;for(x in b)b[x][0]==c&&(opt=new Option,opt.value=b[x][1],opt.text=b[x][2],(d==c&&e==opt.value||0==i)&&(opt.selected=!0),f.options[i++]=opt);f.length=i}function radioGetCheckedValue(a){if(!a)return"";var c,b=a.length;if(void 0==b)return a.checked?a.value:"";for(c=0;b>c;c++)if(a[c].checked)return a[c].value;return""}function getSelectedValue(a,b){var c=document[a],d=c[b];return i=d.selectedIndex,null!=i&&i>-1?d.options[i].value:null}function listItemTask(a,b){var d,e,c=document.adminForm,f=c[a];if(f){for(d=0;!0&&(e=c["cb"+d],e);d++)e.checked=!1;f.checked=!0,c.boxchecked.value=1,submitbutton(b)}return!1}function submitbutton(a){submitform(a)}function submitform(a){a&&(document.adminForm.task.value=a),"function"==typeof document.adminForm.onsubmit&&document.adminForm.onsubmit(),"function"==typeof document.adminForm.fireEvent&&document.adminForm.fireEvent("onsubmit"),document.adminForm.submit()}function saveorder(a,b){checkAll_button(a,b)}function checkAll_button(a,b){b||(b="saveorder");var c,d;for(c=0;a>=c;c++){if(d=document.adminForm["cb"+c],!d)return alert("You cannot change the order of items, as an item in the list is `Checked Out`"),void 0;0==d.checked&&(d.checked=!0)}submitform(b)}Joomla=window.Joomla||{},Joomla.editors={},Joomla.editors.instances={},Joomla.submitform=function(a,b){"undefined"==typeof b&&(b=document.getElementById("adminForm")),"undefined"!=typeof a&&""!==a&&(b.task.value=a),"function"==typeof b.onsubmit&&b.onsubmit(),"function"==typeof b.fireEvent&&b.fireEvent("onsubmit"),b.submit()},Joomla.submitbutton=function(a){Joomla.submitform(a)},Joomla.JText={strings:{},_:function(a,b){return"undefined"!=typeof this.strings[a.toUpperCase()]?this.strings[a.toUpperCase()]:b},load:function(a){for(var b in a)this.strings[b.toUpperCase()]=a[b];return this}},Joomla.replaceTokens=function(a){var c,b=document.getElementsByTagName("input");for(c=0;cd;d++)e=a.form.elements[d],e.type==a.type&&(b&&0==e.id.indexOf(b)||!b)&&(e.checked=a.checked,c+=1==e.checked?1:0);return a.form.boxchecked&&(a.form.boxchecked.value=c),!0}return!1},Joomla.renderMessages=function(a){Joomla.removeMessages();var b=document.getElementById("system-message-container");for(var c in a)if(a.hasOwnProperty(c)){var d=a[c],e=document.createElement("div");e.className="alert alert-"+c;var f=Joomla.JText._(c);if("undefined"!=typeof f){var g=document.createElement("h4");g.className="alert-heading",g.innerHTML=Joomla.JText._(c),e.appendChild(g)}for(var h=d.length-1;h>=0;h--){var i=document.createElement("p");i.innerHTML=d[h],e.appendChild(i)}b.appendChild(e)}},Joomla.removeMessages=function(){for(var a=document.getElementById("system-message-container");a.firstChild;)a.removeChild(a.firstChild);a.style.display="none",a.offsetHeight,a.style.display=""},Joomla.isChecked=function(a,b){"undefined"==typeof b&&(b=document.getElementById("adminForm")),1==a?b.boxchecked.value++:b.boxchecked.value--;var d,e,c=!0;for(d=0,n=b.elements.length;n>d;d++)if(e=b.elements[d],"checkbox"==e.type&&"checkall-toggle"!=e.name&&0==e.checked){c=!1;break}b.elements["checkall-toggle"]&&(b.elements["checkall-toggle"].checked=c)},Joomla.popupWindow=function(a,b,c,d,e){var g,h,i,f=(screen.width-c)/2;g=(screen.height-d)/2,h="height="+d+",width="+c+",top="+g+",left="+f+",scrollbars="+e+",resizable",i=window.open(a,b,h),i.window.focus()},Joomla.tableOrdering=function(a,b,c,d){"undefined"==typeof d&&(d=document.getElementById("adminForm")),d.filter_order.value=a,d.filter_order_Dir.value=b,Joomla.submitform(c,d)}; \ No newline at end of file From 739b39e0810530bbf759328806a29c8d46800bee Mon Sep 17 00:00:00 2001 From: Syam Mohan Date: Wed, 11 Mar 2015 12:46:30 +0530 Subject: [PATCH 069/809] Update user.php Comment changed --- components/com_users/controllers/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/com_users/controllers/user.php b/components/com_users/controllers/user.php index 01bfeb065fae7..0ed6a558fa3cc 100644 --- a/components/com_users/controllers/user.php +++ b/components/com_users/controllers/user.php @@ -95,7 +95,7 @@ public function logout() $app = JFactory::getApplication(); - // Perform the log in. + // Perform the log out. $error = $app->logout(); $input = $app->input; $method = $input->getMethod(); From cda13f5f4e40847e35bc11a5a83df89a12d551eb Mon Sep 17 00:00:00 2001 From: "Nicholas K. Dionysopoulos" Date: Wed, 11 Mar 2015 12:04:46 +0200 Subject: [PATCH 070/809] Update FOF to version 2.4.2 --- administrator/manifests/libraries/fof.xml | 6 +- libraries/fof/autoloader/component.php | 2 +- libraries/fof/autoloader/fof.php | 2 +- libraries/fof/config/domain/dispatcher.php | 2 +- libraries/fof/config/domain/interface.php | 2 +- libraries/fof/config/domain/tables.php | 2 +- libraries/fof/config/domain/views.php | 2 +- libraries/fof/config/provider.php | 2 +- libraries/fof/controller/controller.php | 2 +- libraries/fof/database/installer.php | 0 libraries/fof/database/iterator.php | 4 +- libraries/fof/database/iterator/azure.php | 2 +- libraries/fof/database/iterator/mysql.php | 2 +- libraries/fof/database/iterator/mysqli.php | 2 +- libraries/fof/database/iterator/pdo.php | 2 +- .../fof/database/iterator/postgresql.php | 2 +- libraries/fof/database/iterator/sqlsrv.php | 2 +- libraries/fof/dispatcher/dispatcher.php | 2 +- libraries/fof/download/adapter/abstract.php | 2 +- libraries/fof/download/adapter/cacert.pem | 3869 +++++++++++++++++ libraries/fof/download/adapter/curl.php | 4 +- libraries/fof/download/adapter/fopen.php | 6 +- libraries/fof/download/download.php | 2 +- libraries/fof/download/interface.php | 2 +- libraries/fof/encrypt/aes.php | 2 +- libraries/fof/encrypt/base32.php | 2 +- libraries/fof/encrypt/totp.php | 2 +- libraries/fof/form/field.php | 2 +- libraries/fof/form/field/accesslevel.php | 2 +- libraries/fof/form/field/actions.php | 2 +- libraries/fof/form/field/button.php | 2 +- libraries/fof/form/field/cachehandler.php | 2 +- libraries/fof/form/field/calendar.php | 6 +- libraries/fof/form/field/captcha.php | 2 +- libraries/fof/form/field/checkbox.php | 2 +- libraries/fof/form/field/checkboxes.php | 2 +- libraries/fof/form/field/components.php | 2 +- libraries/fof/form/field/editor.php | 2 +- libraries/fof/form/field/email.php | 2 +- libraries/fof/form/field/groupedbutton.php | 2 +- libraries/fof/form/field/groupedlist.php | 2 +- libraries/fof/form/field/hidden.php | 2 +- libraries/fof/form/field/image.php | 2 +- libraries/fof/form/field/imagelist.php | 2 +- libraries/fof/form/field/integer.php | 2 +- libraries/fof/form/field/language.php | 2 +- libraries/fof/form/field/list.php | 2 +- libraries/fof/form/field/media.php | 2 +- libraries/fof/form/field/model.php | 2 +- libraries/fof/form/field/ordering.php | 2 +- libraries/fof/form/field/password.php | 2 +- libraries/fof/form/field/plugins.php | 2 +- libraries/fof/form/field/published.php | 2 +- libraries/fof/form/field/radio.php | 2 +- libraries/fof/form/field/relation.php | 2 +- libraries/fof/form/field/rules.php | 2 +- libraries/fof/form/field/selectrow.php | 2 +- libraries/fof/form/field/sessionhandler.php | 2 +- libraries/fof/form/field/spacer.php | 2 +- libraries/fof/form/field/sql.php | 2 +- libraries/fof/form/field/tag.php | 102 +- libraries/fof/form/field/tel.php | 2 +- libraries/fof/form/field/text.php | 2 +- libraries/fof/form/field/textarea.php | 2 +- libraries/fof/form/field/timezone.php | 2 +- libraries/fof/form/field/title.php | 7 +- libraries/fof/form/field/url.php | 2 +- libraries/fof/form/field/user.php | 2 +- libraries/fof/form/field/usergroup.php | 2 +- libraries/fof/form/form.php | 2 +- libraries/fof/form/header.php | 2 +- libraries/fof/form/header/accesslevel.php | 2 +- libraries/fof/form/header/field.php | 2 +- libraries/fof/form/header/fielddate.php | 2 +- libraries/fof/form/header/fieldfilterable.php | 2 +- libraries/fof/form/header/fieldsearchable.php | 2 +- libraries/fof/form/header/fieldselectable.php | 2 +- libraries/fof/form/header/fieldsql.php | 2 +- libraries/fof/form/header/filterdate.php | 2 +- .../fof/form/header/filterfilterable.php | 2 +- .../fof/form/header/filtersearchable.php | 2 +- .../fof/form/header/filterselectable.php | 2 +- libraries/fof/form/header/filtersql.php | 2 +- libraries/fof/form/header/language.php | 2 +- libraries/fof/form/header/model.php | 2 +- libraries/fof/form/header/ordering.php | 2 +- libraries/fof/form/header/published.php | 2 +- libraries/fof/form/header/rowselect.php | 2 +- libraries/fof/form/helper.php | 2 +- libraries/fof/hal/document.php | 2 +- libraries/fof/hal/link.php | 2 +- libraries/fof/hal/links.php | 2 +- libraries/fof/hal/render/interface.php | 2 +- libraries/fof/hal/render/json.php | 2 +- libraries/fof/include.php | 4 +- libraries/fof/inflector/inflector.php | 2 +- libraries/fof/input/input.php | 2 +- .../joomla/filesystem/filesystem.php | 2 +- libraries/fof/integration/joomla/platform.php | 2 +- libraries/fof/layout/file.php | 2 +- libraries/fof/layout/helper.php | 2 +- libraries/fof/less/formatter/classic.php | 2 +- libraries/fof/less/formatter/compressed.php | 2 +- libraries/fof/less/formatter/joomla.php | 2 +- libraries/fof/less/formatter/lessjs.php | 2 +- libraries/fof/less/less.php | 2 +- libraries/fof/less/parser/parser.php | 2 +- libraries/fof/model/behavior.php | 2 +- libraries/fof/model/behavior/access.php | 2 +- libraries/fof/model/behavior/emptynonzero.php | 2 +- libraries/fof/model/behavior/enabled.php | 2 +- libraries/fof/model/behavior/filters.php | 6 +- libraries/fof/model/behavior/language.php | 19 +- libraries/fof/model/behavior/private.php | 2 +- libraries/fof/model/dispatcher/behavior.php | 2 +- libraries/fof/model/field.php | 2 +- libraries/fof/model/field/boolean.php | 2 +- libraries/fof/model/field/date.php | 2 +- libraries/fof/model/field/number.php | 2 +- libraries/fof/model/field/text.php | 2 +- libraries/fof/model/model.php | 65 +- .../fof/platform/filesystem/filesystem.php | 2 +- .../fof/platform/filesystem/interface.php | 2 +- libraries/fof/platform/interface.php | 2 +- libraries/fof/platform/platform.php | 2 +- libraries/fof/query/abstract.php | 2 +- libraries/fof/render/abstract.php | 2 +- libraries/fof/render/joomla.php | 15 +- libraries/fof/render/joomla3.php | 5 +- libraries/fof/render/strapper.php | 19 +- libraries/fof/string/utils.php | 2 +- libraries/fof/table/behavior.php | 2 +- libraries/fof/table/behavior/assets.php | 2 +- .../fof/table/behavior/contenthistory.php | 2 +- libraries/fof/table/behavior/tags.php | 2 +- libraries/fof/table/dispatcher/behavior.php | 2 +- libraries/fof/table/nested.php | 2 +- libraries/fof/table/relations.php | 2 +- libraries/fof/table/table.php | 12 +- libraries/fof/template/utils.php | 2 +- libraries/fof/toolbar/toolbar.php | 12 +- libraries/fof/utils/array/array.php | 2 +- libraries/fof/utils/cache/cleaner.php | 2 +- libraries/fof/utils/filescheck/filescheck.php | 2 +- .../fof/utils/installscript/installscript.php | 38 +- libraries/fof/utils/ip/ip.php | 504 +++ libraries/fof/utils/object/object.php | 2 +- libraries/fof/utils/observable/dispatcher.php | 2 +- libraries/fof/utils/observable/event.php | 2 +- libraries/fof/utils/timer/timer.php | 2 +- libraries/fof/utils/update/collection.php | 2 +- libraries/fof/utils/update/extension.php | 2 +- libraries/fof/utils/update/joomla.php | 2 +- libraries/fof/utils/update/update.php | 2 +- libraries/fof/version.txt | 4 +- libraries/fof/view/csv.php | 2 +- libraries/fof/view/form.php | 2 +- libraries/fof/view/html.php | 2 +- libraries/fof/view/json.php | 2 +- libraries/fof/view/raw.php | 2 +- libraries/fof/view/view.php | 2 +- 161 files changed, 4796 insertions(+), 191 deletions(-) mode change 100644 => 100755 libraries/fof/autoloader/component.php mode change 100644 => 100755 libraries/fof/autoloader/fof.php mode change 100644 => 100755 libraries/fof/config/domain/dispatcher.php mode change 100644 => 100755 libraries/fof/config/domain/interface.php mode change 100644 => 100755 libraries/fof/config/domain/tables.php mode change 100644 => 100755 libraries/fof/config/domain/views.php mode change 100644 => 100755 libraries/fof/config/provider.php mode change 100644 => 100755 libraries/fof/controller/controller.php mode change 100644 => 100755 libraries/fof/database/installer.php mode change 100644 => 100755 libraries/fof/database/iterator.php mode change 100644 => 100755 libraries/fof/database/iterator/azure.php mode change 100644 => 100755 libraries/fof/database/iterator/mysql.php mode change 100644 => 100755 libraries/fof/database/iterator/mysqli.php mode change 100644 => 100755 libraries/fof/database/iterator/pdo.php mode change 100644 => 100755 libraries/fof/database/iterator/postgresql.php mode change 100644 => 100755 libraries/fof/database/iterator/sqlsrv.php mode change 100644 => 100755 libraries/fof/dispatcher/dispatcher.php mode change 100644 => 100755 libraries/fof/download/adapter/abstract.php create mode 100755 libraries/fof/download/adapter/cacert.pem mode change 100644 => 100755 libraries/fof/download/adapter/curl.php mode change 100644 => 100755 libraries/fof/download/adapter/fopen.php mode change 100644 => 100755 libraries/fof/download/download.php mode change 100644 => 100755 libraries/fof/download/interface.php mode change 100644 => 100755 libraries/fof/encrypt/aes.php mode change 100644 => 100755 libraries/fof/encrypt/base32.php mode change 100644 => 100755 libraries/fof/encrypt/totp.php mode change 100644 => 100755 libraries/fof/form/field.php mode change 100644 => 100755 libraries/fof/form/field/accesslevel.php mode change 100644 => 100755 libraries/fof/form/field/actions.php mode change 100644 => 100755 libraries/fof/form/field/button.php mode change 100644 => 100755 libraries/fof/form/field/cachehandler.php mode change 100644 => 100755 libraries/fof/form/field/calendar.php mode change 100644 => 100755 libraries/fof/form/field/captcha.php mode change 100644 => 100755 libraries/fof/form/field/checkbox.php mode change 100644 => 100755 libraries/fof/form/field/checkboxes.php mode change 100644 => 100755 libraries/fof/form/field/components.php mode change 100644 => 100755 libraries/fof/form/field/editor.php mode change 100644 => 100755 libraries/fof/form/field/email.php mode change 100644 => 100755 libraries/fof/form/field/groupedbutton.php mode change 100644 => 100755 libraries/fof/form/field/groupedlist.php mode change 100644 => 100755 libraries/fof/form/field/hidden.php mode change 100644 => 100755 libraries/fof/form/field/image.php mode change 100644 => 100755 libraries/fof/form/field/imagelist.php mode change 100644 => 100755 libraries/fof/form/field/integer.php mode change 100644 => 100755 libraries/fof/form/field/language.php mode change 100644 => 100755 libraries/fof/form/field/list.php mode change 100644 => 100755 libraries/fof/form/field/media.php mode change 100644 => 100755 libraries/fof/form/field/model.php mode change 100644 => 100755 libraries/fof/form/field/ordering.php mode change 100644 => 100755 libraries/fof/form/field/password.php mode change 100644 => 100755 libraries/fof/form/field/plugins.php mode change 100644 => 100755 libraries/fof/form/field/published.php mode change 100644 => 100755 libraries/fof/form/field/radio.php mode change 100644 => 100755 libraries/fof/form/field/relation.php mode change 100644 => 100755 libraries/fof/form/field/rules.php mode change 100644 => 100755 libraries/fof/form/field/selectrow.php mode change 100644 => 100755 libraries/fof/form/field/sessionhandler.php mode change 100644 => 100755 libraries/fof/form/field/spacer.php mode change 100644 => 100755 libraries/fof/form/field/sql.php mode change 100644 => 100755 libraries/fof/form/field/tag.php mode change 100644 => 100755 libraries/fof/form/field/tel.php mode change 100644 => 100755 libraries/fof/form/field/text.php mode change 100644 => 100755 libraries/fof/form/field/textarea.php mode change 100644 => 100755 libraries/fof/form/field/timezone.php mode change 100644 => 100755 libraries/fof/form/field/title.php mode change 100644 => 100755 libraries/fof/form/field/url.php mode change 100644 => 100755 libraries/fof/form/field/user.php mode change 100644 => 100755 libraries/fof/form/field/usergroup.php mode change 100644 => 100755 libraries/fof/form/form.php mode change 100644 => 100755 libraries/fof/form/header.php mode change 100644 => 100755 libraries/fof/form/header/accesslevel.php mode change 100644 => 100755 libraries/fof/form/header/field.php mode change 100644 => 100755 libraries/fof/form/header/fielddate.php mode change 100644 => 100755 libraries/fof/form/header/fieldfilterable.php mode change 100644 => 100755 libraries/fof/form/header/fieldsearchable.php mode change 100644 => 100755 libraries/fof/form/header/fieldselectable.php mode change 100644 => 100755 libraries/fof/form/header/fieldsql.php mode change 100644 => 100755 libraries/fof/form/header/filterdate.php mode change 100644 => 100755 libraries/fof/form/header/filterfilterable.php mode change 100644 => 100755 libraries/fof/form/header/filtersearchable.php mode change 100644 => 100755 libraries/fof/form/header/filterselectable.php mode change 100644 => 100755 libraries/fof/form/header/filtersql.php mode change 100644 => 100755 libraries/fof/form/header/language.php mode change 100644 => 100755 libraries/fof/form/header/model.php mode change 100644 => 100755 libraries/fof/form/header/ordering.php mode change 100644 => 100755 libraries/fof/form/header/published.php mode change 100644 => 100755 libraries/fof/form/header/rowselect.php mode change 100644 => 100755 libraries/fof/form/helper.php mode change 100644 => 100755 libraries/fof/hal/document.php mode change 100644 => 100755 libraries/fof/hal/link.php mode change 100644 => 100755 libraries/fof/hal/links.php mode change 100644 => 100755 libraries/fof/hal/render/interface.php mode change 100644 => 100755 libraries/fof/hal/render/json.php mode change 100644 => 100755 libraries/fof/include.php mode change 100644 => 100755 libraries/fof/inflector/inflector.php mode change 100644 => 100755 libraries/fof/input/input.php mode change 100644 => 100755 libraries/fof/integration/joomla/filesystem/filesystem.php mode change 100644 => 100755 libraries/fof/integration/joomla/platform.php mode change 100644 => 100755 libraries/fof/layout/file.php mode change 100644 => 100755 libraries/fof/layout/helper.php mode change 100644 => 100755 libraries/fof/less/formatter/classic.php mode change 100644 => 100755 libraries/fof/less/formatter/compressed.php mode change 100644 => 100755 libraries/fof/less/formatter/joomla.php mode change 100644 => 100755 libraries/fof/less/formatter/lessjs.php mode change 100644 => 100755 libraries/fof/less/less.php mode change 100644 => 100755 libraries/fof/less/parser/parser.php mode change 100644 => 100755 libraries/fof/model/behavior.php mode change 100644 => 100755 libraries/fof/model/behavior/access.php mode change 100644 => 100755 libraries/fof/model/behavior/emptynonzero.php mode change 100644 => 100755 libraries/fof/model/behavior/enabled.php mode change 100644 => 100755 libraries/fof/model/behavior/filters.php mode change 100644 => 100755 libraries/fof/model/behavior/language.php mode change 100644 => 100755 libraries/fof/model/behavior/private.php mode change 100644 => 100755 libraries/fof/model/dispatcher/behavior.php mode change 100644 => 100755 libraries/fof/model/field.php mode change 100644 => 100755 libraries/fof/model/field/boolean.php mode change 100644 => 100755 libraries/fof/model/field/date.php mode change 100644 => 100755 libraries/fof/model/field/number.php mode change 100644 => 100755 libraries/fof/model/field/text.php mode change 100644 => 100755 libraries/fof/model/model.php mode change 100644 => 100755 libraries/fof/platform/filesystem/filesystem.php mode change 100644 => 100755 libraries/fof/platform/filesystem/interface.php mode change 100644 => 100755 libraries/fof/platform/interface.php mode change 100644 => 100755 libraries/fof/platform/platform.php mode change 100644 => 100755 libraries/fof/query/abstract.php mode change 100644 => 100755 libraries/fof/render/abstract.php mode change 100644 => 100755 libraries/fof/render/joomla.php mode change 100644 => 100755 libraries/fof/render/joomla3.php mode change 100644 => 100755 libraries/fof/render/strapper.php mode change 100644 => 100755 libraries/fof/string/utils.php mode change 100644 => 100755 libraries/fof/table/behavior.php mode change 100644 => 100755 libraries/fof/table/behavior/assets.php mode change 100644 => 100755 libraries/fof/table/behavior/contenthistory.php mode change 100644 => 100755 libraries/fof/table/behavior/tags.php mode change 100644 => 100755 libraries/fof/table/dispatcher/behavior.php mode change 100644 => 100755 libraries/fof/table/nested.php mode change 100644 => 100755 libraries/fof/table/relations.php mode change 100644 => 100755 libraries/fof/table/table.php mode change 100644 => 100755 libraries/fof/template/utils.php mode change 100644 => 100755 libraries/fof/toolbar/toolbar.php mode change 100644 => 100755 libraries/fof/utils/array/array.php mode change 100644 => 100755 libraries/fof/utils/cache/cleaner.php mode change 100644 => 100755 libraries/fof/utils/filescheck/filescheck.php mode change 100644 => 100755 libraries/fof/utils/installscript/installscript.php create mode 100755 libraries/fof/utils/ip/ip.php mode change 100644 => 100755 libraries/fof/utils/object/object.php mode change 100644 => 100755 libraries/fof/utils/observable/dispatcher.php mode change 100644 => 100755 libraries/fof/utils/observable/event.php mode change 100644 => 100755 libraries/fof/utils/timer/timer.php mode change 100644 => 100755 libraries/fof/utils/update/collection.php mode change 100644 => 100755 libraries/fof/utils/update/extension.php mode change 100644 => 100755 libraries/fof/utils/update/joomla.php mode change 100644 => 100755 libraries/fof/utils/update/update.php mode change 100644 => 100755 libraries/fof/version.txt mode change 100644 => 100755 libraries/fof/view/csv.php mode change 100644 => 100755 libraries/fof/view/form.php mode change 100644 => 100755 libraries/fof/view/html.php mode change 100644 => 100755 libraries/fof/view/json.php mode change 100644 => 100755 libraries/fof/view/raw.php mode change 100644 => 100755 libraries/fof/view/view.php diff --git a/administrator/manifests/libraries/fof.xml b/administrator/manifests/libraries/fof.xml index 113ed5d67178b..3af14cc251c1e 100644 --- a/administrator/manifests/libraries/fof.xml +++ b/administrator/manifests/libraries/fof.xml @@ -3,13 +3,13 @@ FOF fof LIB_FOF_XML_DESCRIPTION - 2014-11-28 11:21:40 + 2015-03-11 11:59:00 Nicholas K. Dionysopoulos / Akeeba Ltd nicholas@akeebabackup.com https://www.akeebabackup.com - (C)2011-2014 Nicholas K. Dionysopoulos + (C)2011-2015 Nicholas K. Dionysopoulos GNU GPLv2 or later - 2.4.1 + 2.4.2 Akeeba Ltd https://www.AkeebaBackup.com/download.html diff --git a/libraries/fof/autoloader/component.php b/libraries/fof/autoloader/component.php old mode 100644 new mode 100755 index 1ed3074148e5b..c97d2333df014 --- a/libraries/fof/autoloader/component.php +++ b/libraries/fof/autoloader/component.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage autoloader - * @copyright Copyright (c)2010-2014 Nicholas K. Dionysopoulos + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ diff --git a/libraries/fof/autoloader/fof.php b/libraries/fof/autoloader/fof.php old mode 100644 new mode 100755 index ed8df1c323f19..d771df89cf3b2 --- a/libraries/fof/autoloader/fof.php +++ b/libraries/fof/autoloader/fof.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage autoloader - * @copyright Copyright (c)2010-2014 Nicholas K. Dionysopoulos + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ diff --git a/libraries/fof/config/domain/dispatcher.php b/libraries/fof/config/domain/dispatcher.php old mode 100644 new mode 100755 index 5017cebb7b174..b9726ccbe2899 --- a/libraries/fof/config/domain/dispatcher.php +++ b/libraries/fof/config/domain/dispatcher.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage config - * @copyright Copyright (c)2010-2014 Nicholas K. Dionysopoulos + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ diff --git a/libraries/fof/config/domain/interface.php b/libraries/fof/config/domain/interface.php old mode 100644 new mode 100755 index 603caeb0b3cb6..ea5935e9cec5b --- a/libraries/fof/config/domain/interface.php +++ b/libraries/fof/config/domain/interface.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage config - * @copyright Copyright (c)2010-2014 Nicholas K. Dionysopoulos + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ diff --git a/libraries/fof/config/domain/tables.php b/libraries/fof/config/domain/tables.php old mode 100644 new mode 100755 index 980a105219caf..e5ae9167fa7b3 --- a/libraries/fof/config/domain/tables.php +++ b/libraries/fof/config/domain/tables.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage config - * @copyright Copyright (c)2010-2014 Nicholas K. Dionysopoulos + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ diff --git a/libraries/fof/config/domain/views.php b/libraries/fof/config/domain/views.php old mode 100644 new mode 100755 index ac4e98192ed3d..8674d8c9eec29 --- a/libraries/fof/config/domain/views.php +++ b/libraries/fof/config/domain/views.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage config - * @copyright Copyright (c)2010-2014 Nicholas K. Dionysopoulos + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ diff --git a/libraries/fof/config/provider.php b/libraries/fof/config/provider.php old mode 100644 new mode 100755 index 9f9a8a55413f3..4faba8f399008 --- a/libraries/fof/config/provider.php +++ b/libraries/fof/config/provider.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage config - * @copyright Copyright (c)2010-2014 Nicholas K. Dionysopoulos + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2, or later */ diff --git a/libraries/fof/controller/controller.php b/libraries/fof/controller/controller.php old mode 100644 new mode 100755 index 33f23539f5e7d..458164fecef8e --- a/libraries/fof/controller/controller.php +++ b/libraries/fof/controller/controller.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage controller - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/database/installer.php b/libraries/fof/database/installer.php old mode 100644 new mode 100755 diff --git a/libraries/fof/database/iterator.php b/libraries/fof/database/iterator.php old mode 100644 new mode 100755 index e93754add67fa..3e562348fe151 --- a/libraries/fof/database/iterator.php +++ b/libraries/fof/database/iterator.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage database - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects @@ -15,7 +15,7 @@ /** * Database iterator */ -abstract class FOFDatabaseIterator implements Countable, Iterator +abstract class FOFDatabaseIterator implements Iterator { /** * The database cursor. diff --git a/libraries/fof/database/iterator/azure.php b/libraries/fof/database/iterator/azure.php old mode 100644 new mode 100755 index e7d812da94d78..335ab562ef1f9 --- a/libraries/fof/database/iterator/azure.php +++ b/libraries/fof/database/iterator/azure.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage database - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects diff --git a/libraries/fof/database/iterator/mysql.php b/libraries/fof/database/iterator/mysql.php old mode 100644 new mode 100755 index 085ed87c55c57..78401e6bae785 --- a/libraries/fof/database/iterator/mysql.php +++ b/libraries/fof/database/iterator/mysql.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage database - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects diff --git a/libraries/fof/database/iterator/mysqli.php b/libraries/fof/database/iterator/mysqli.php old mode 100644 new mode 100755 index 11fc3e37c3335..465e33e673a78 --- a/libraries/fof/database/iterator/mysqli.php +++ b/libraries/fof/database/iterator/mysqli.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage database - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects diff --git a/libraries/fof/database/iterator/pdo.php b/libraries/fof/database/iterator/pdo.php old mode 100644 new mode 100755 index 2a38e9f4aa926..b14dd750a3046 --- a/libraries/fof/database/iterator/pdo.php +++ b/libraries/fof/database/iterator/pdo.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage database - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects diff --git a/libraries/fof/database/iterator/postgresql.php b/libraries/fof/database/iterator/postgresql.php old mode 100644 new mode 100755 index 2657d623046e7..b3376c016c377 --- a/libraries/fof/database/iterator/postgresql.php +++ b/libraries/fof/database/iterator/postgresql.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage database - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects diff --git a/libraries/fof/database/iterator/sqlsrv.php b/libraries/fof/database/iterator/sqlsrv.php old mode 100644 new mode 100755 index 768a0980537f4..461904f1391ba --- a/libraries/fof/database/iterator/sqlsrv.php +++ b/libraries/fof/database/iterator/sqlsrv.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage database - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects diff --git a/libraries/fof/dispatcher/dispatcher.php b/libraries/fof/dispatcher/dispatcher.php old mode 100644 new mode 100755 index a556464dcb497..fc1cccc547045 --- a/libraries/fof/dispatcher/dispatcher.php +++ b/libraries/fof/dispatcher/dispatcher.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage dispatcher - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/download/adapter/abstract.php b/libraries/fof/download/adapter/abstract.php old mode 100644 new mode 100755 index 79cac6f98750b..4bf4be7e0d63e --- a/libraries/fof/download/adapter/abstract.php +++ b/libraries/fof/download/adapter/abstract.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage dispatcher - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/download/adapter/cacert.pem b/libraries/fof/download/adapter/cacert.pem new file mode 100755 index 0000000000000..1a0aa6d3d6c7f --- /dev/null +++ b/libraries/fof/download/adapter/cacert.pem @@ -0,0 +1,3869 @@ +## +## Bundle of CA Root Certificates +## +## Certificate data from Mozilla downloaded on: Wed Aug 13 21:49:32 2014 +## +## This is a bundle of X.509 certificates of public Certificate Authorities +## (CA). These were automatically extracted from Mozilla's root certificates +## file (certdata.txt). This file can be found in the mozilla source tree: +## http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt +## +## It contains the certificates in PEM format and therefore +## can be directly used with curl / libcurl / php_curl, or with +## an Apache+mod_ssl webserver for SSL client authentication. +## Just configure this file as the SSLCACertificateFile. +## +## Conversion done with mk-ca-bundle.pl verison 1.22. +## SHA1: bf2c15b3019e696660321d2227d942936dc50aa7 +## + + +GTE CyberTrust Global Root +========================== +-----BEGIN CERTIFICATE----- +MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg +Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG +A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz +MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL +Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0 +IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u +sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql +HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID +AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW +M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF +NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ +-----END CERTIFICATE----- + +Thawte Server CA +================ +-----BEGIN CERTIFICATE----- +MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs +dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE +AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j +b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV +BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u +c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG +A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0 +ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl +/Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7 +1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J +GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ +GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc= +-----END CERTIFICATE----- + +Thawte Premium Server CA +======================== +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs +dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE +AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl +ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT +AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU +VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 +aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ +cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2 +aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh +Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/ +qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm +SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf +8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t +UCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- + +Equifax Secure CA +================= +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE +ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT +B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR +fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW +8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG +A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE +CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG +A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS +spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB +Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961 +zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB +BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95 +70+sB3c4 +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority +======================================================= +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx +FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow +XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 +f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol +hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA +TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah +WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf +Tqj/ZA1k +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority - G2 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz +dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz +dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO +FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71 +lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB +MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT +1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD +Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9 +-----END CERTIFICATE----- + +GlobalSign Root CA +================== +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx +GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds +b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV +BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD +VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa +DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc +THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb +Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP +c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX +gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF +AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj +Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG +j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH +hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC +X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +GlobalSign Root CA - R2 +======================= +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 +ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp +s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN +S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL +TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C +ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E +FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i +YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN +BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp +9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu +01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 +9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +ValiCert Class 1 VA +=================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIy +MjM0OFoXDTE5MDYyNTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9YLqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIi +GQj4/xEjm84H9b9pGib+TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCm +DuJWBQ8YTfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0LBwG +lN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLWI8sogTLDAHkY7FkX +icnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPwnXS3qT6gpf+2SQMT2iLM7XGCK5nP +Orf1LXLI +-----END CERTIFICATE----- + +ValiCert Class 2 VA +=================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw +MTk1NFoXDTE5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDOOnHK5avIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVC +CSRrCl6zfN1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7Rf +ZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9vUJSZ +SWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTuIYEZoDJJKPTEjlbV +UjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8 +W9ViH0Pd +-----END CERTIFICATE----- + +RSA Root Certificate 1 +====================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw +MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td +3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H +BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs +3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF +V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r +on+jjBXu +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 +EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc +cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw +EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj +055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f +j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC +/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 +xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa +t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== +-----END CERTIFICATE----- + +Verisign Class 4 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS +tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM +8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW +Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX +Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt +mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm +fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd +RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG +UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== +-----END CERTIFICATE----- + +Entrust.net Secure Server CA +============================ +-----BEGIN CERTIFICATE----- +MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV +BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg +cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl +ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG +A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi +eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1p +dGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQ +aO2f55M28Qpku0f1BBc/I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5 +gXpa0zf3wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OCAdcw +ggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHboIHYpIHVMIHSMQsw +CQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5l +dC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF +bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu +dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0MFqBDzIwMTkw +NTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0Bow +HQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAaMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA +BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyN +Ewr75Ji174z4xRAN95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9 +n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= +-----END CERTIFICATE----- + +Entrust.net Premium 2048 Secure Server CA +========================================= +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u +ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp +bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV +BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx +NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 +d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl +MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u +ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL +Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr +hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW +nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi +VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ +KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy +T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf +zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT +J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e +nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= +-----END CERTIFICATE----- + +Baltimore CyberTrust Root +========================= +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE +ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li +ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC +SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs +dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME +uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB +UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C +G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 +XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr +l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI +VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB +BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh +cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 +hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa +Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H +RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +Equifax Secure Global eBusiness CA +================================== +-----BEGIN CERTIFICATE----- +MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp +bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx +HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds +b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV +PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN +qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn +hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j +BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs +MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN +I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY +NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV +-----END CERTIFICATE----- + +Equifax Secure eBusiness CA 1 +============================= +-----BEGIN CERTIFICATE----- +MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB +LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE +ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz +IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ +1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a +IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk +MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kW +Nl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRKeDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQF +AAOBgQB1W6ibAxHm6VZMzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5 +lSE/9dR+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN/Bf+ +KpYrtWKmpj29f5JZzVoqgrI3eQ== +-----END CERTIFICATE----- + +AddTrust Low-Value Services Root +================================ +-----BEGIN CERTIFICATE----- +MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU +cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw +CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO +ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6 +54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr +oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1 +Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui +GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w +HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD +AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT +RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw +HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt +ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph +iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY +eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr +mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj +ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= +-----END CERTIFICATE----- + +AddTrust External Root +====================== +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD +VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw +NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU +cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg +Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 ++iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw +Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo +aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy +2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 +7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL +VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk +VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB +IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl +j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 +e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u +G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- + +AddTrust Public Services Root +============================= +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU +cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ +BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l +dHdvcmsxIDAeBgNVBAMTFOFkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu +nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i +d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG +Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw +HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G +A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux +FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G +A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4 +JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL ++YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao +GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9 +Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H +EufOX1362KqxMy3ZdvJOOjMMK7MtkAY= +-----END CERTIFICATE----- + +AddTrust Qualified Certificates Root +==================================== +-----BEGIN CERTIFICATE----- +MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU +cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx +CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ +IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx +64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3 +KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o +L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR +wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU +MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE +BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y +azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD +ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG +GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X +dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze +RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB +iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE= +-----END CERTIFICATE----- + +Entrust Root Certification Authority +==================================== +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw +b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG +A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 +MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu +MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu +Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v +dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz +A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww +Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 +j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN +rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 +MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH +hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM +Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa +v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS +W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 +tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +RSA Security 2048 v3 +==================== +-----BEGIN CERTIFICATE----- +MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK +ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy +MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb +BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7 +Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb +WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH +KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP ++Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/ +MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E +FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY +v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj +0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj +VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395 +nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA +pKnXwiJPZ9d37CAFYd4= +-----END CERTIFICATE----- + +GeoTrust Global CA +================== +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw +MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j +LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo +BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet +8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc +T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU +vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk +DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q +zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 +d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 +mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p +XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm +Mw== +-----END CERTIFICATE----- + +GeoTrust Global CA 2 +==================== +-----BEGIN CERTIFICATE----- +MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw +MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j +LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/ +NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k +LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA +Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b +HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH +K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7 +srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh +ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL +OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC +x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF +H4z1Ir+rzoPz4iIprn2DQKi6bA== +-----END CERTIFICATE----- + +GeoTrust Universal CA +===================== +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 +MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu +Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t +JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e +RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs +7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d +8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V +qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga +Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB +Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu +KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 +ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 +XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB +hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc +aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 +qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL +oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK +xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF +KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 +DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK +xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU +p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI +P/rmMuGNG2+k5o7Y+SlIis5z/iw= +-----END CERTIFICATE----- + +GeoTrust Universal CA 2 +======================= +-----BEGIN CERTIFICATE----- +MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 +MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg +SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 +DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17 +j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q +JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a +QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2 +WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP +20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn +ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC +SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG +8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2 ++/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E +BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z +dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ +4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ +mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq +A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg +Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP +pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d +FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp +gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm +X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS +-----END CERTIFICATE----- + +America Online Root Certification Authority 1 +============================================= +-----BEGIN CERTIFICATE----- +MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkG +A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg +T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lkhsmj76CG +v2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym1BW32J/X3HGrfpq/m44z +DyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsWOqMFf6Dch9Wc/HKpoH145LcxVR5lu9Rh +sCFg7RAycsWSJR74kEoYeEfffjA3PlAb2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP +8c9GsEsPPt2IYriMqQkoO3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0T +AQH/BAUwAwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAUAK3Z +o/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQB8itEf +GDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkFZu90821fnZmv9ov761KyBZiibyrF +VL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAbLjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft +3OJvx8Fi8eNy1gTIdGcL+oiroQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43g +Kd8hdIaC2y+CMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds +sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 +-----END CERTIFICATE----- + +America Online Root Certification Authority 2 +============================================= +-----BEGIN CERTIFICATE----- +MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG +A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg +T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en +fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8 +f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO +qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN +RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0 +gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn +6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEqZ8A9W6Wa6897Gqid +FEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZo2C7HK2JNDJiuEMhBnIMoVxtRsX6 +Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnj +B453cMor9H124HhnAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3Op +aaEg5+31IqEjFNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE +AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmnxPBUlgtk87FY +T15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2LHo1YGwRgJfMqZJS5ivmae2p ++DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzcccobGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXg +JXUjhx5c3LqdsKyzadsXg8n33gy8CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//Zoy +zH1kUQ7rVyZ2OuMeIjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgO +ZtMADjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2FAjgQ5ANh +1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUXOm/9riW99XJZZLF0Kjhf +GEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPbAZO1XB4Y3WRayhgoPmMEEf0cjQAPuDff +Z4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQlZvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuP +cX/9XhmgD0uRuMRUvAawRY8mkaKO/qk= +-----END CERTIFICATE----- + +Visa eCommerce Root +=================== +-----BEGIN CERTIFICATE----- +MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG +EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug +QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2 +WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm +VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv +bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL +F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b +RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0 +TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI +/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs +GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG +MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc +CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW +YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz +zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu +YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt +398znM/jra6O1I7mT1GvFpLgXPYHDw== +-----END CERTIFICATE----- + +Certum Root CA +============== +-----BEGIN CERTIFICATE----- +MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK +ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla +Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u +by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x +wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL +kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ +89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K +Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P +NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq +hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+ +GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg +GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/ +0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS +qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== +-----END CERTIFICATE----- + +Comodo AAA Services root +======================== +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw +MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl +c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV +BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG +C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs +i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW +Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH +Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK +Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f +BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl +cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz +LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm +7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z +8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C +12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +Comodo Secure Services root +=========================== +-----BEGIN CERTIFICATE----- +MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw +MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu +Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi +BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP +9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc +rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC +oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V +p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E +FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w +gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj +YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm +aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm +4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj +Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL +DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw +pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H +RR3B7Hzs/Sk= +-----END CERTIFICATE----- + +Comodo Trusted Services root +============================ +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw +MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h +bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw +IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7 +3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y +/9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6 +juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS +ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud +DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp +ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl +cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw +uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 +pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA +BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l +R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O +9y5Xt5hwXsjEeLBi +-----END CERTIFICATE----- + +QuoVadis Root CA +================ +-----BEGIN CERTIFICATE----- +MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE +ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz +MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp +cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD +EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk +J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL +F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL +YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen +AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w +PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y +ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 +MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj +YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs +ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh +Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW +Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu +BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw +FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 +tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo +fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul +LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x +gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi +5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi +5nrQNiOKSnQ2+Q== +-----END CERTIFICATE----- + +QuoVadis Root CA 2 +================== +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx +ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 +XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk +lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB +lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy +lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt +66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn +wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh +D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy +BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie +J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud +DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU +a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT +ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv +Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 +UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm +VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK ++JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW +IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 +WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X +f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II +4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 +VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u +-----END CERTIFICATE----- + +QuoVadis Root CA 3 +================== +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx +OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg +DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij +KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K +DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv +BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp +p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 +nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX +MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM +Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz +uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT +BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj +YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 +aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB +BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD +VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 +ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE +AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV +qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s +hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z +POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 +Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp +8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC +bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu +g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p +vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr +qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +Security Communication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw +8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM +DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX +5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd +DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 +JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g +0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a +mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ +s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ +6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi +FL39vmwLAw== +-----END CERTIFICATE----- + +Sonera Class 2 Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG +U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw +NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh +IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 +/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT +dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG +f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P +tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH +nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT +XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt +0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI +cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph +Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx +EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH +llpwrN9M +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA +============================= +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE +ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w +HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh +bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt +vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P +jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca +C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth +vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6 +22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV +HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v +dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN +BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR +EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw +MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y +nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR +iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== +-----END CERTIFICATE----- + +TDC Internet Root CA +==================== +-----BEGIN CERTIFICATE----- +MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJESzEVMBMGA1UE +ChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTAeFw0wMTA0MDUx +NjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNVBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJu +ZXQxHTAbBgNVBAsTFFREQyBJbnRlcm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxLhAvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20j +xsNuZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a0vnRrEvL +znWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc14izbSysseLlJ28TQx5yc +5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGNeGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6 +otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcDR0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZI +AYb4QgEBBAQDAgAHMGUGA1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMM +VERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxMEQ1JM +MTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3WjALBgNVHQ8EBAMC +AQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAwHQYDVR0OBBYEFGxkAcf9hW2syNqe +UAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJKoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0G +CSqGSIb3DQEBBQUAA4IBAQBOQ8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540m +gwV5dOy0uaOXwTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+ +2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm899qNLPg7kbWzb +O0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0jUNAE4z9mQNUecYu6oah9jrU +Cbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38aQNiuJkFBT1reBK9sG9l +-----END CERTIFICATE----- + +UTN DATACorp SGC Root CA +======================== +-----BEGIN CERTIFICATE----- +MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ +BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa +MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w +HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy +dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys +raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo +wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA +9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv +33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud +DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9 +BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD +LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3 +DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft +Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0 +I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx +EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP +DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI +-----END CERTIFICATE----- + +UTN USERFirst Hardware Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd +BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx +OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0 +eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz +ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI +wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd +tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8 +i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf +Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw +gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF +lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF +UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF +BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM +//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW +XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2 +lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn +iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 +nfhmqA== +-----END CERTIFICATE----- + +Camerfirma Chambers of Commerce Root +==================================== +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe +QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i +ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx +NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp +cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn +MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC +AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU +xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH +NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW +DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV +d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud +EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v +cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P +AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh +bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD +VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz +aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi +fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD +L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN +UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n +ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 +erfutGWaIZDgqtCYvDi1czyL+Nw= +-----END CERTIFICATE----- + +Camerfirma Global Chambersign Root +================================== +-----BEGIN CERTIFICATE----- +MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe +QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i +ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx +NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt +YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg +MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw +ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J +1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O +by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl +6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c +8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/ +BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j +aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B +Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj +aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y +ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh +bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA +PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y +gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ +PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4 +IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes +t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== +-----END CERTIFICATE----- + +NetLock Notary (Class A) Root +============================= +-----BEGIN CERTIFICATE----- +MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI +EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 +dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j +ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX +DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH +EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD +VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz +cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM +D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ +z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC +/tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7 +tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6 +4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG +A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC +Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv +bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu +IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn +LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0 +ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz +IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh +IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu +b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh +bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg +Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp +bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5 +ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP +ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB +CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr +KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM +8CgHrTwXZoi1/baI +-----END CERTIFICATE----- + +NetLock Business (Class B) Root +=============================== +-----BEGIN CERTIFICATE----- +MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT +CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV +BAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQDEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikg +VGFudXNpdHZhbnlraWFkbzAeFw05OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYD +VQQGEwJIVTERMA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRv +bnNhZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5ldExvY2sg +VXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB +iQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xKgZjupNTKihe5In+DCnVMm8Bp2GQ5o+2S +o/1bXHQawEfKOml2mrriRBf8TKPV/riXiK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr +1nGTLbO/CVRY7QbrqHvcQ7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV +HQ8BAf8EBAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZ +RUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRh +dGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQuIEEgaGl0 +ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRv +c2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUg +YXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh +c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBz +Oi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6ZXNA +bmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhl +IHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2 +YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBj +cHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06sPgzTEdM +43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR +stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI +-----END CERTIFICATE----- + +NetLock Express (Class C) Root +============================== +-----BEGIN CERTIFICATE----- +MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT +CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV +BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD +KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ +BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 +dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMrTmV0TG9j +ayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzANBgkqhkiG9w0BAQEFAAOB +jQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNAOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3Z +W3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63 +euyucYT2BDMIJTLrdKwWRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQw +DgYDVR0PAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEWggJN +RklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0YWxhbm9zIFN6b2xn +YWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBB +IGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBOZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1i +aXp0b3NpdGFzYSB2ZWRpLiBBIGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0 +ZWxlIGF6IGVsb2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs +ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25sYXBqYW4gYSBo +dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kga2VyaGV0byBheiBlbGxlbm9y +emVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4gSU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5k +IHRoZSB1c2Ugb2YgdGhpcyBjZXJ0aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQ +UyBhdmFpbGFibGUgYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwg +YXQgY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmYta3UzbM2 +xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2gpO0u9f38vf5NNwgMvOOW +gyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4Fp1hBWeAyNDYpQcCNJgEjTME1A== +-----END CERTIFICATE----- + +XRamp Global CA Root +==================== +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE +BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj +dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx +HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg +U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu +IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx +foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE +zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs +AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry +xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap +oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC +AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc +/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n +nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz +8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- + +Go Daddy Class 2 CA +=================== +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY +VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG +A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g +RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD +ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv +2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 +qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j +YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY +vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O +BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o +atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu +MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG +A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim +PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt +I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI +Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b +vZ8= +-----END CERTIFICATE----- + +Starfield Class 2 CA +==================== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc +U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo +MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG +A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG +SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY +bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ +JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm +epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN +F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF +MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f +hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo +bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g +QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs +afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM +PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD +KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 +QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +StartCom Certification Authority +================================ +-----BEGIN CERTIFICATE----- +MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu +ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 +NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk +LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg +U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y +o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ +Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d +eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt +2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z +6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ +osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ +untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc +UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT +37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE +FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0 +Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj +YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH +AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw +Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg +U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5 +LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh +cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT +dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC +AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh +3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm +vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk +fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3 +fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ +EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq +yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl +1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/ +lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro +g14= +-----END CERTIFICATE----- + +Taiwan GRCA +=========== +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG +EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X +DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv +dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN +w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 +BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O +1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO +htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov +J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7 +Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t +B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB +O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8 +lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV +HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2 +09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ +TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj +Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2 +Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU +D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz +DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk +Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk +7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ +CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy ++fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS +-----END CERTIFICATE----- + +Swisscom Root CA 1 +================== +-----BEGIN CERTIFICATE----- +MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG +EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy +dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4 +MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln +aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC +IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM +MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF +NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe +AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC +b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn +7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN +cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp +WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5 +haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY +MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw +HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j +BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9 +MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn +jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ +MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H +VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl +vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl +OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3 +1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq +nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy +x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW +NY6E0F/6MBr1mmz0DlP5OlvRHA== +-----END CERTIFICATE----- + +DigiCert Assured ID Root CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx +MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO +9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy +UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW +/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy +oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf +GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF +66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq +hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc +EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn +SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i +8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +DigiCert Global Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw +MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn +TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 +BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H +4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y +7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB +o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm +8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF +BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr +EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt +tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 +UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +DigiCert High Assurance EV Root CA +================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw +KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw +MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ +MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu +Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t +Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS +OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 +MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ +NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe +h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY +JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ +V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp +myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK +mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K +-----END CERTIFICATE----- + +Certplus Class 2 Primary CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE +BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN +OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy +dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR +5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ +Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO +YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e +e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME +CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ +YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t +L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD +P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R +TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+ +7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW +//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 +l7+ijrRU +-----END CERTIFICATE----- + +DST Root CA X3 +============== +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK +ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X +DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 +cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT +rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 +UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy +xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d +utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ +MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug +dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE +GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw +RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS +fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- + +DST ACES CA X6 +============== +-----BEGIN CERTIFICATE----- +MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT +MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha +MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE +CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI +DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa +pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow +GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy +MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu +Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy +dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU +CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2 +5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t +Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq +nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs +vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 +oKfN5XozNmr6mis= +-----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 1 +============================================== +-----BEGIN CERTIFICATE----- +MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP +MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0 +acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx +MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg +U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB +TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC +aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX +yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i +Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ +8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4 +W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME +BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46 +sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE +q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy +B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY +nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H +-----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 2 +============================================== +-----BEGIN CERTIFICATE----- +MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP +MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg +QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN +MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr +dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G +A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls +acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe +LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI +x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g +QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr +5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB +AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G +A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt +Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 +Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+ +hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P +9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5 +UrbnBEI= +-----END CERTIFICATE----- + +SwissSign Gold CA - G2 +====================== +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw +EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN +MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp +c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq +t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C +jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg +vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF +ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR +AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend +jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO +peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR +7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi +GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 +OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm +5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr +44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf +Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m +Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp +mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk +vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf +KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br +NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj +viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +SwissSign Silver CA - G2 +======================== +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT +BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X +DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 +aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG +9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 +N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm ++/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH +6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu +MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h +qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 +FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs +ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc +celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X +CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB +tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 +cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P +4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F +kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L +3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx +/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa +DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP +e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu +WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ +DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub +DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority +======================================== +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx +CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ +cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN +b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 +nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge +RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt +tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI +hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K +Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN +NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa +Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG +1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= +-----END CERTIFICATE----- + +thawte Primary Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE +BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 +aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 +MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg +SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv +KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT +FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs +oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ +1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc +q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K +aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p +afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF +AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE +uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX +xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 +jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH +z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G5 +============================================================ +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln +biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh +dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz +j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD +Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ +Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r +fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ +BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv +Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG +SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ +X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE +KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC +Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE +ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- + +SecureTrust CA +============== +-----BEGIN CERTIFICATE----- +MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy +dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe +BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX +OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t +DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH +GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b +01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH +ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj +aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ +KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu +SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf +mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ +nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR +3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= +-----END CERTIFICATE----- + +Secure Global CA +================ +-----BEGIN CERTIFICATE----- +MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH +bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg +MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg +Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx +YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ +bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g +8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV +HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi +0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn +oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA +MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ +OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn +CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 +3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +COMODO Certification Authority +============================== +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb +MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD +T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH ++7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww +xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV +4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA +1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI +rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k +b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC +AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP +OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc +IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN ++8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== +-----END CERTIFICATE----- + +Network Solutions Certificate Authority +======================================= +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG +EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr +IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx +MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx +jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT +aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT +crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc +/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB +AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv +bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA +A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q +4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ +GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD +ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +WellsSecure Public Root Certificate Authority +============================================= +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM +F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw +NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN +MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl +bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD +VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1 +iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13 +i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8 +bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB +K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB +AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu +cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm +lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB +i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww +GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI +K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0 +bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj +qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es +E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ +tylv2G0xffX8oRAHh84vWdw+WNs= +-----END CERTIFICATE----- + +COMODO ECC Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix +GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X +4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni +wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG +FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA +U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +IGC/A +===== +-----BEGIN CERTIFICATE----- +MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD +VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE +Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy +MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI +EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT +STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2 +TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW +So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy +HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd +frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ +tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB +egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC +iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK +q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q +MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg +Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI +lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF +0mBWWg== +-----END CERTIFICATE----- + +Security Communication EV RootCA1 +================================= +-----BEGIN CERTIFICATE----- +MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE +BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl +Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO +/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX +WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z +ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4 +bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK +9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG +SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm +iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG +Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW +mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW +T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GA CA +=============================== +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE +BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG +A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH +bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD +VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw +IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 +IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 +Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg +Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD +d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ +/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R +LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ +KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm +MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 ++vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa +hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY +okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= +-----END CERTIFICATE----- + +Microsec e-Szigno Root CA +========================= +-----BEGIN CERTIFICATE----- +MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE +BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL +EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0 +MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz +dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT +GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG +d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N +oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc +QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ +PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb +MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG +IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD +VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3 +LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A +dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn +AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA +4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg +AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA +egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6 +Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO +PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv +c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h +cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw +IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT +WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV +MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER +MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp +Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal +HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT +nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE +aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a +86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK +yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB +S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU= +-----END CERTIFICATE----- + +Certigna +======== +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw +EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 +MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI +Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q +XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH +GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p +ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg +DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf +Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ +tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ +BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J +SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA +hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ +ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu +PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY +1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +AC Ra\xC3\xADz Certic\xC3\xA1mara S.A. +====================================== +-----BEGIN CERTIFICATE----- +MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYT +AkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRpZmljYWNpw7NuIERpZ2l0YWwg +LSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwaQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4w +HhcNMDYxMTI3MjA0NjI5WhcNMzAwNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+ +U29jaWVkYWQgQ2FtZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJh +IFMuQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeGqentLhM0R7LQcNzJPNCN +yu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzLfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU +2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU3 +4ojC2I+GdV75LaeHM/J4Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP +2yYe68yQ54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+bMMCm +8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48jilSH5L887uvDdUhf +HjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++EjYfDIJss2yKHzMI+ko6Kh3VOz3vCa +Mh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/ztA/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK +5lw1omdMEWux+IBkAC1vImHFrEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1b +czwmPS9KvqfJpxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE +AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCBlTCBkgYEVR0g +ADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFyYS5jb20vZHBjLzBaBggrBgEF +BQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW507WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2Ug +cHVlZGVuIGVuY29udHJhciBlbiBsYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEf +AygPU3zmpFmps4p6xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuX +EpBcunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/Jre7Ir5v +/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dpezy4ydV/NgIlqmjCMRW3 +MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42gzmRkBDI8ck1fj+404HGIGQatlDCIaR4 +3NAvO2STdPCWkPHv+wlaNECW8DYSwaN0jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wk +eZBWN7PGKX6jD/EpOe9+XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f +/RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h +RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU +Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ== +-----END CERTIFICATE----- + +TC TrustCenter Class 2 CA II +============================ +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy +IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw +MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 +c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE +AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw +IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2 +xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ +Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u +SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB +7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 +Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU +cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i +SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G +dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ +KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj +TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP +JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk +vQ== +-----END CERTIFICATE----- + +TC TrustCenter Class 3 CA II +============================ +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy +IENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYw +MTEyMTQ0MTU3WhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 +c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UE +AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJWHt4bNwcwIi9v8Qbxq63W +yKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+QVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo +6SI7dYnWRBpl8huXJh0obazovVkdKyT21oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZ +uV3bOx4a+9P/FRQI2AlqukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk +2ZyqBwi1Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NXXAek0CSnwPIA1DCB +7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 +Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU +cnVzdENlbnRlciUyMENsYXNzJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i +SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE +O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8 +yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9 +IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal +092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc +5A== +-----END CERTIFICATE----- + +TC TrustCenter Universal CA I +============================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy +IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN +MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg +VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw +JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC +qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv +xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw +ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O +gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j +BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG +1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy +vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3 +ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT +ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a +7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY +-----END CERTIFICATE----- + +Deutsche Telekom Root CA 2 +========================== +-----BEGIN CERTIFICATE----- +MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT +RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG +A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 +MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G +A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS +b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 +bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI +KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY +AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK +Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV +jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV +HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr +E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy +zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 +rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G +dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU +Cm26OWMohpLzGITY+9HPBVZkVw== +-----END CERTIFICATE----- + +ComSign Secured CA +================== +-----BEGIN CERTIFICATE----- +MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE +AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w +NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD +QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs +49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH +7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB +kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1 +9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw +AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t +U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA +j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC +AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a +BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp +FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP +51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz +OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== +-----END CERTIFICATE----- + +Cybertrust Global Root +====================== +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li +ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 +MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD +ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA ++Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW +0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL +AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin +89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT +8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 +MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G +A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO +lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi +5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 +hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T +X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +ePKI Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG +EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg +Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx +MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq +MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs +IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi +lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv +qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX +12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O +WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ +ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao +lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ +vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi +Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi +MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 +1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq +KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV +xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP +NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r +GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE +xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx +gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy +sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD +BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- + +T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 +============================================================================================================================= +-----BEGIN CERTIFICATE----- +MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH +DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q +aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry +b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV +BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg +S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4 +MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl +IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF +n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl +IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft +dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl +cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO +Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1 +xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR +6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL +hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd +BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4 +N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT +y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh +LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M +dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI= +-----END CERTIFICATE----- + +Buypass Class 2 CA 1 +==================== +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2 +MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh +c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M +cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83 +0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4 +0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R +uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P +AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV +1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt +7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2 +fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w +wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho +-----END CERTIFICATE----- + +Buypass Class 3 CA 1 +==================== +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1 +MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh +c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx +ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0 +n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia +AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c +1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P +AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7 +pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA +EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5 +htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj +el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 +-----END CERTIFICATE----- + +EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 +========================================================================== +-----BEGIN CERTIFICATE----- +MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg +QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe +Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p +ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt +IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by +X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b +gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr +eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ +TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy +Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn +uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI +qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm +ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0 +Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB +/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW +Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t +FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm +zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k +XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT +bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU +RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK +1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt +2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ +Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9 +AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT +-----END CERTIFICATE----- + +certSIGN ROOT CA +================ +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD +VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa +Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE +CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I +JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH +rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 +ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD +0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 +AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B +Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB +AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 +SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 +x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt +vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz +TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +CNNIC ROOT +========== +-----BEGIN CERTIFICATE----- +MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE +ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw +OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD +o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz +VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT +VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or +czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK +y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC +wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S +lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5 +Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM +O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8 +BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2 +G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m +mxE= +-----END CERTIFICATE----- + +ApplicationCA - Japanese Government +=================================== +-----BEGIN CERTIFICATE----- +MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT +SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw +MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl +cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4 +fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN +wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE +jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu +nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU +WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV +BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD +vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs +o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g +/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD +io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW +dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL +rosot4LKGAfmt1t06SAZf7IbiVQ= +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G3 +============================================= +-----BEGIN CERTIFICATE----- +MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE +BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 +IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz +NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo +YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT +LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j +K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE +c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C +IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu +dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr +2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 +cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE +Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD +AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s +t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt +-----END CERTIFICATE----- + +thawte Primary Root CA - G2 +=========================== +-----BEGIN CERTIFICATE----- +MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC +VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu +IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg +Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV +MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG +b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt +IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS +LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 +8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU +mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN +G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K +rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== +-----END CERTIFICATE----- + +thawte Primary Root CA - G3 +=========================== +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE +BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 +aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w +ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh +d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD +VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG +A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At +P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC ++BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY +7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW +vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ +KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK +A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu +t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC +8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm +er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G2 +============================================= +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu +Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 +OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg +MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl +b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG +BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc +KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD +VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ +EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m +ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 +npaqBA+K +-----END CERTIFICATE----- + +VeriSign Universal Root Certification Authority +=============================================== +-----BEGIN CERTIFICATE----- +MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj +1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP +MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 +9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I +AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR +tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G +CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O +a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud +DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 +Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx +Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx +P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P +wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 +mJO37M2CYfE45k+XmCpajQ== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G4 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC +VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 +b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz +ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU +cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo +b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 +Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz +rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw +HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u +Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD +A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx +AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== +-----END CERTIFICATE----- + +NetLock Arany (Class Gold) Főtanúsítvány +============================================ +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G +A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 +dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB +cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx +MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO +ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 +c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu +0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw +/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk +H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw +fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 +neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW +qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta +YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC +bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna +NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu +dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA - G2 +================================== +-----BEGIN CERTIFICATE----- +MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC +TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l +ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ +5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn +vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj +CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil +e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR +OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI +CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 +48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi +trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737 +qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB +AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC +ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA +A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz ++51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj +f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN +kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk +CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF +URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb +CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h +oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV +IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm +66+KAQ== +-----END CERTIFICATE----- + +CA Disig +======== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK +QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw +MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz +bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm +GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD +Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo +hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt +ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w +gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P +AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz +aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff +ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa +BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t +WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3 +mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ +CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K +ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA +4Z7CRneC9VkGjCFMhwnN5ag= +-----END CERTIFICATE----- + +Juur-SK +======= +-----BEGIN CERTIFICATE----- +MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA +c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw +DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG +SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy +aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf +TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC ++Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw +UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa +Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF +MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD +HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh +AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA +cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr +AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw +cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE +FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G +A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo +ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL +abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678 +IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh +Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2 +yyqcjg== +-----END CERTIFICATE----- + +Hongkong Post Root CA 1 +======================= +-----BEGIN CERTIFICATE----- +MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT +DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx +NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n +IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 +ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr +auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh +qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY +V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV +HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i +h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio +l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei +IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps +T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT +c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== +-----END CERTIFICATE----- + +SecureSign RootCA11 +=================== +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi +SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS +b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw +KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 +cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL +TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO +wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq +g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP +O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA +bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX +t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh +OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r +bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ +Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 +y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 +lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= +-----END CERTIFICATE----- + +ACEDICOM Root +============= +-----BEGIN CERTIFICATE----- +MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD +T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4 +MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG +A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk +WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD +YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew +MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb +m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk +HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT +xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2 +3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9 +2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq +TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz +4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU +9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv +bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg +aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP +eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk +zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 +ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI +KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq +nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE +I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp +MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o +tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority +======================================================= +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx +FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow +XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 +f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol +hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky +CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX +bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/ +D/xwzoiQ +-----END CERTIFICATE----- + +Microsec e-Szigno Root CA 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER +MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv +c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE +BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt +U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA +fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG +0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA +pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm +1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC +AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf +QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE +FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o +lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX +I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 +yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi +LXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +E-Guven Kok Elektronik Sertifika Hizmet Saglayicisi +=================================================== +-----BEGIN CERTIFICATE----- +MIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG +EwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxpZ2kgQS5TLjE8MDoGA1UEAxMz +ZS1HdXZlbiBLb2sgRWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhZ2xheWljaXNpMB4XDTA3 +MDEwNDExMzI0OFoXDTE3MDEwNDExMzI0OFowdTELMAkGA1UEBhMCVFIxKDAmBgNVBAoTH0VsZWt0 +cm9uaWsgQmlsZ2kgR3V2ZW5saWdpIEEuUy4xPDA6BgNVBAMTM2UtR3V2ZW4gS29rIEVsZWt0cm9u +aWsgU2VydGlmaWthIEhpem1ldCBTYWdsYXlpY2lzaTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAMMSIJ6wXgBljU5Gu4Bc6SwGl9XzcslwuedLZYDBS75+PNdUMZTe1RK6UxYC6lhj71vY +8+0qGqpxSKPcEC1fX+tcS5yWCEIlKBHMilpiAVDV6wlTL/jDj/6z/P2douNffb7tC+Bg62nsM+3Y +jfsSSYMAyYuXjDtzKjKzEve5TfL0TW3H5tYmNwjy2f1rXKPlSFxYvEK+A1qBuhw1DADT9SN+cTAI +JjjcJRFHLfO6IxClv7wC90Nex/6wN1CZew+TzuZDLMN+DfIcQ2Zgy2ExR4ejT669VmxMvLz4Bcpk +9Ok0oSy1c+HCPujIyTQlCFzz7abHlJ+tiEMl1+E5YP6sOVkCAwEAAaNCMEAwDgYDVR0PAQH/BAQD +AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ/uRLOU1fqRTy7ZVZoEVtstxNulMA0GCSqG +SIb3DQEBBQUAA4IBAQB/X7lTW2M9dTLn+sR0GstG30ZpHFLPqk/CaOv/gKlR6D1id4k9CnU58W5d +F4dvaAXBlGzZXd/aslnLpRCKysw5zZ/rTt5S/wzw9JKp8mxTq5vSR6AfdPebmvEvFZ96ZDAYBzwq +D2fK/A+JYZ1lpTzlvBNbCNvj/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4 +Vwpm+Vganf2XKWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq +fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX +-----END CERTIFICATE----- + +GlobalSign Root CA - R3 +======================= +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt +iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ +0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 +rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl +OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 +xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 +lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 +EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E +bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 +YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r +kpeDMdmztcpHWD9f +-----END CERTIFICATE----- + +Autoridad de Certificacion Firmaprofesional CIF A62634068 +========================================================= +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA +BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 +MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw +QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB +NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD +Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P +B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY +7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH +ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI +plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX +MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX +LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK +bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU +vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud +EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH +DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp +cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA +bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx +ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx +51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk +R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP +T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f +Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl +osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR +crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR +saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD +KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi +6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +Izenpe.com +========== +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG +EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz +MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu +QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ +03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK +ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU ++zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC +PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT +OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK +F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK +0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ +0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB +leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID +AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ +SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG +NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx +MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O +BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l +Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga +kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q +hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs +g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 +aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 +nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC +ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo +Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z +WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +Chambers of Commerce Root - 2008 +================================ +-----BEGIN CERTIFICATE----- +MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy +Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl +ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF +EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl +cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA +XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj +h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ +ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk +NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g +D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331 +lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ +0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj +ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2 +EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI +G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ +BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh +bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh +bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC +CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH +AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 +wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH +3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU +RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 +M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 +YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF +9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK +zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG +nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg +OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ +-----END CERTIFICATE----- + +Global Chambersign Root - 2008 +============================== +-----BEGIN CERTIFICATE----- +MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx +NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg +Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ +QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD +aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf +VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf +XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0 +ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB +/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA +TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M +H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe +Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF +HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh +wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB +AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT +BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE +BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm +aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm +aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp +1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 +dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG +/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 +ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s +dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg +9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH +foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du +qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr +P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq +c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z +09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B +-----END CERTIFICATE----- + +Go Daddy Root Certificate Authority - G2 +======================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu +MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G +A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq +9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD ++qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd +fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl +NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 +BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac +vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r +5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV +N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 +-----END CERTIFICATE----- + +Starfield Root Certificate Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 +eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw +DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg +VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB +dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv +W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs +bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk +N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf +ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU +JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol +TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx +4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw +F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ +c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +Starfield Services Root Certificate Authority - G2 +================================================== +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl +IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT +dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 +h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa +hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP +LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB +rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG +SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP +E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy +xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza +YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 +-----END CERTIFICATE----- + +AffirmTrust Commercial +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw +MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb +DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV +C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 +BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww +MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV +HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG +hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi +qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv +0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh +sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +AffirmTrust Networking +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw +MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE +Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI +dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 +/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb +h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV +HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu +UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 +12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 +WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 +/ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- + +AffirmTrust Premium +=================== +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy +OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy +dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn +BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV +5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs ++7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd +GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R +p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI +S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 +6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 +/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo ++Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv +MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC +6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S +L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK ++4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV +BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg +IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 +g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb +zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== +-----END CERTIFICATE----- + +AffirmTrust Premium ECC +======================= +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV +BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx +MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U +cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ +N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW +BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK +BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X +57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM +eQ== +-----END CERTIFICATE----- + +Certum Trusted Network CA +========================= +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK +ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy +MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU +ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC +l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J +J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 +fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 +cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw +DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj +jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 +mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj +Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +Certinomis - Autorité Racine +============================= +-----BEGIN CERTIFICATE----- +MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK +Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg +LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG +A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw +JAYDVQQDDB1DZXJ0aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jYF1AMnmHa +wE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N8y4oH3DfVS9O7cdxbwly +Lu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWerP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw +2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92N +jMD2AR5vpTESOH2VwnHu7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9q +c1pkIuVC28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6lSTC +lrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1Enn1So2+WLhl+HPNb +xxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB0iSVL1N6aaLwD4ZFjliCK0wi1F6g +530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql095gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna +4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ +KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x +WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva +R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 +nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B +CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv +JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE +qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b +WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE +wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ +vgt2Fl43N+bYdJeimUV5 +-----END CERTIFICATE----- + +Root CA Generalitat Valenciana +============================== +-----BEGIN CERTIFICATE----- +MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE +ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290 +IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3 +WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE +CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+WmmmO3I2 +F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKjSgbwJ/BXufjpTjJ3Cj9B +ZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGlu6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQ +D0EbtFpKd71ng+CT516nDOeB0/RSrFOyA8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXte +JajCq+TA81yc477OMUxkHl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMB +AAGjggM7MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBraS5n +dmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIICIwYKKwYBBAG/VQIB +ADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBl +AHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIAYQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIA +YQBsAGkAdABhAHQAIABWAGEAbABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQBy +AGEAYwBpAPMAbgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA +aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMAaQBvAG4AYQBt +AGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQAZQAgAEEAdQB0AG8AcgBpAGQA +YQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu +AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA +OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0 +dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV +BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G +A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S +b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh +TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz +Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63 +NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH +iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt ++GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= +-----END CERTIFICATE----- + +A-Trust-nQual-03 +================ +-----BEGIN CERTIFICATE----- +MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJBVDFIMEYGA1UE +Cgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy +a2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5RdWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5R +dWFsLTAzMB4XDTA1MDgxNzIyMDAwMFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgw +RgYDVQQKDD9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0 +ZW52ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMMEEEtVHJ1 +c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtPWFuA/OQO8BBC4SA +zewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUjlUC5B3ilJfYKvUWG6Nm9wASOhURh73+n +yfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZznF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPE +SU7l0+m0iKsMrmKS1GWH2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4 +iHQF63n1k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs2e3V +cuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECERqlWdV +eRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAVdRU0VlIXLOThaq/Yy/kgM40 +ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fGKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmr +sQd7TZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd +JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS +mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6 +ahq97BvIxYSazQ== +-----END CERTIFICATE----- + +TWCA Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ +VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG +EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB +IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx +QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC +oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP +4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r +y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG +9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC +mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW +QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY +T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny +Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +Security Communication RootCA2 +============================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC +SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy +aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ ++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R +3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV +spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K +EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 +QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB +CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj +u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk +3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q +tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29 +mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 +-----END CERTIFICATE----- + +EC-ACC +====== +-----BEGIN CERTIFICATE----- +MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE +BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w +ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD +VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UE +CxMsSmVyYXJxdWlhIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMT +BkVDLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQGEwJFUzE7 +MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8gKE5JRiBRLTA4MDExNzYt +SSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZl +Z2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQubmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJh +cnF1aWEgRW50aXRhdHMgZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUND +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R85iK +w5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm4CgPukLjbo73FCeT +ae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaVHMf5NLWUhdWZXqBIoH7nF2W4onW4 +HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNdQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0a +E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw +0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD +VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 +Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l +dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ +lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa +Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe +l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 +E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D +5EI= +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions RootCA 2011 +======================================================= +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT +O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y +aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z +IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT +AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z +IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo +IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI +1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa +71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u +8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH +3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/ +MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8 +MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu +b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt +XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 +TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD +/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N +7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 +-----END CERTIFICATE----- + +Actalis Authentication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM +BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE +AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky +MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz +IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ +wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa +by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 +zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f +YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 +oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l +EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7 +hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4Fv6MGn8i1zeQf1xcGDXqVdFUNaBr8 +EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbnfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5 +jF66CyCU3nuDuP/jVo23Eek7jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLY +iDrIn3hm7YnzezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt +ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI +WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0 +JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx +K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+ +Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC +4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo +2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz +lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem +OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 +vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- + +Trustis FPS Root CA +=================== +-----BEGIN CERTIFICATE----- +MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG +EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 +IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV +BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ +RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk +H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa +cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt +o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA +AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd +BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c +GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC +yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P +8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV +l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl +iB6XzCGcKQENZetX2fNXlrtIzYE= +-----END CERTIFICATE----- + +StartCom Certification Authority +================================ +-----BEGIN CERTIFICATE----- +MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu +ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 +NjM3WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk +LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg +U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y +o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ +Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d +eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt +2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z +6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ +osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ +untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc +UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT +37uMdBNSSwIDAQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD +VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFulF2mHMMo0aEPQ +Qa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCCATgwLgYIKwYBBQUHAgEWImh0 +dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cu +c3RhcnRzc2wuY29tL2ludGVybWVkaWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENv +bW1lcmNpYWwgKFN0YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0 +aGUgc2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0aWZpY2F0 +aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93d3cuc3RhcnRzc2wuY29t +L3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBG +cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5 +fPGFf59Jb2vKXfuM/gTFwWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWm +N3PH/UvSTa0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst0OcN +Org+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNcpRJvkrKTlMeIFw6T +tn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKlCcWw0bdT82AUuoVpaiF8H3VhFyAX +e2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVFP0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA +2MFrLH9ZXF2RsXAiV+uKa0hK1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBs +HvUwyKMQ5bLmKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE +JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ8dCAWZvLMdib +D4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnmfyWl8kgAwKQB2j8= +-----END CERTIFICATE----- + +StartCom Certification Authority G2 +=================================== +-----BEGIN CERTIFICATE----- +MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +RzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UE +ChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8O +o1XJJZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsDvfOpL9HG +4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnooD/Uefyf3lLE3PbfHkffi +Aez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/Q0kGi4xDuFby2X8hQxfqp0iVAXV16iul +Q5XqFYSdCI0mblWbq9zSOdIxHWDirMxWRST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbs +O+wmETRIjfaAKxojAuuKHDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8H +vKTlXcxNnw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM0D4L +nMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/iUUjXuG+v+E5+M5iS +FGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9Ha90OrInwMEePnWjFqmveiJdnxMa +z6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHgTuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJ +KoZIhvcNAQELBQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K +2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfXUfEpY9Z1zRbk +J4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl6/2o1PXWT6RbdejF0mCy2wl+ +JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG +/+gyRr61M3Z3qAFdlsHB1b6uJcDJHgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTc +nIhT76IxW1hPkWLIwpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/Xld +blhYXzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5lIxKVCCIc +l85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoohdVddLHRDiBYmxOlsGOm +7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulrso8uBtjRkcfGEvRM/TAXw8HaOFvjqerm +obp573PYtlNXLfbQ4ddI +-----END CERTIFICATE----- + +Buypass Class 2 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X +DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 +eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1 +g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn +9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b +/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU +CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff +awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI +zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn +Bkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRSP/TizPJhk9H9Z2vX +Uq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN9SG9dKpN6nIDSdvHXx1iY8f93ZHs +M+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxPAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF +AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s +A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI +osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S +aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd +DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD +LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 +oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC +wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS +CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN +rJgWVqA= +-----END CERTIFICATE----- + +Buypass Class 3 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X +DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 +eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH +sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR +5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh +7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ +ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH +2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV +/afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ +RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA +Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq +j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF +AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV +cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G +uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG +Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 +ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 +KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz +6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug +UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe +eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi +Cp/HuZc= +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 3 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU +cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx +MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz +dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD +ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK +9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU +NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF +iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W +0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr +AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb +fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT +ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h +P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml +e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== +-----END CERTIFICATE----- + +EE Certification Centre Root CA +=============================== +-----BEGIN CERTIFICATE----- +MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG +EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy +dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw +MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB +UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy +ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM +TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2 +rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw +93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN +P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ +MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF +BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj +xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM +lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u +uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU +3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM +dcGWxZ0= +-----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 2007 +================================================= +-----BEGIN CERTIFICATE----- +MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP +MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg +QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X +DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxl +a3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMCVFIxDzAN +BgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp +bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4gKGMpIEFyYWzEsWsgMjAwNzCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9N +YvDdE3ePYakqtdTyuTFYKTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQv +KUmi8wUG+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveGHtya +KhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6PIzdezKKqdfcYbwnT +rqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M733WB2+Y8a+xwXrXgTW4qhe04MsC +AwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHkYb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/s +Px+EnWVUXKgWAkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I +aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5mxRZNTZPz/OO +Xl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsaXRik7r4EW5nVcV9VZWRi1aKb +BFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAK +poRq0Tl9 +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe +Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE +LVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOAD +ER03UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42tSHKXzlA +BF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9RySPocq60vFYJfxLLHLGv +KZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsMlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7z +p+hnUquVH+BGPtikw8paxTGA6Eian5Rp/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUC +AwEAAaOCARowggEWMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ +4PGEMA4GA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVjdG9y +eS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUyMENBJTIwMiUyMDIw +MDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3QwQ6BBoD+G +PWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3JsL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw +OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm +2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 +o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV +dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph +X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 EV 2009 +================================= +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS +egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh +zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T +7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 +sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35 +11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv +cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFwOi8v +ZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xhc3MlMjAzJTIwQ0El +MjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1ERT9jZXJ0aWZpY2F0ZXJldm9jYXRp +b25saXN0MEagRKBChkBodHRwOi8vd3d3LmQtdHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xh +c3NfM19jYV8yX2V2XzIwMDkuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+ +PPoeUSbrh/Yp3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 +nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNFCSuGdXzfX2lX +ANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7naxpeG0ILD5EJt/rDiZE4OJudA +NCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqXKVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVv +w9y4AyHqnxbxLFS1 +-----END CERTIFICATE----- + +PSCProcert +========== +-----BEGIN CERTIFICATE----- +MIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1dG9yaWRhZCBk +ZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9sYW5vMQswCQYDVQQGEwJWRTEQ +MA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlzdHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lz +dGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBl +cmludGVuZGVuY2lhIGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUw +IwYJKoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyODE2NTEwMFoXDTIw +MTIyNTIzNTk1OVowgdExJjAkBgkqhkiG9w0BCQEWF2NvbnRhY3RvQHByb2NlcnQubmV0LnZlMQ8w +DQYDVQQHEwZDaGFjYW8xEDAOBgNVBAgTB01pcmFuZGExKjAoBgNVBAsTIVByb3ZlZWRvciBkZSBD +ZXJ0aWZpY2Fkb3MgUFJPQ0VSVDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZp +Y2FjaW9uIEVsZWN0cm9uaWNhMQswCQYDVQQGEwJWRTETMBEGA1UEAxMKUFNDUHJvY2VydDCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANW39KOUM6FGqVVhSQ2oh3NekS1wwQYalNo97BVC +wfWMrmoX8Yqt/ICV6oNEolt6Vc5Pp6XVurgfoCfAUFM+jbnADrgV3NZs+J74BCXfgI8Qhd19L3uA +3VcAZCP4bsm+lU/hdezgfl6VzbHvvnpC2Mks0+saGiKLt38GieU89RLAu9MLmV+QfI4tL3czkkoh +RqipCKzx9hEC2ZUWno0vluYC3XXCFCpa1sl9JcLB/KpnheLsvtF8PPqv1W7/U0HU9TI4seJfxPmO +EO8GqQKJ/+MMbpfg353bIdD0PghpbNjU5Db4g7ayNo+c7zo3Fn2/omnXO1ty0K+qP1xmk6wKImG2 +0qCZyFSTXai20b1dCl53lKItwIKOvMoDKjSuc/HUtQy9vmebVOvh+qBa7Dh+PsHMosdEMXXqP+UH +0quhJZb25uSgXTcYOWEAM11G1ADEtMo88aKjPvM6/2kwLkDd9p+cJsmWN63nOaK/6mnbVSKVUyqU +td+tFjiBdWbjxywbk5yqjKPK2Ww8F22c3HxT4CAnQzb5EuE8XL1mv6JpIzi4mWCZDlZTOpx+FIyw +Bm/xhnaQr/2v/pDGj59/i5IjnOcVdo/Vi5QTcmn7K2FjiO/mpF7moxdqWEfLcU8UC17IAggmosvp +r2uKGcfLFFb14dq12fy/czja+eevbqQ34gcnAgMBAAGjggMXMIIDEzASBgNVHRMBAf8ECDAGAQH/ +AgEBMDcGA1UdEgQwMC6CD3N1c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAz +Ni0wMB0GA1UdDgQWBBRBDxk4qpl/Qguk1yeYVKIXTC1RVDCCAVAGA1UdIwSCAUcwggFDgBStuyId +xuDSAaj9dlBSk+2YwU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0b3JpZGFkIGRlIENlcnRp +ZmljYWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xhbm8xCzAJBgNVBAYTAlZFMRAwDgYDVQQH +EwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0cml0byBDYXBpdGFsMTYwNAYDVQQKEy1TaXN0ZW1hIE5h +Y2lvbmFsIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5k +ZW5jaWEgZGUgU2VydmljaW9zIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkqhkiG +9w0BCQEWFmFjcmFpekBzdXNjZXJ0ZS5nb2IudmWCAQowDgYDVR0PAQH/BAQDAgEGME0GA1UdEQRG +MESCDnByb2NlcnQubmV0LnZloBUGBWCGXgIBoAwMClBTQy0wMDAwMDKgGwYFYIZeAgKgEgwQUklG +LUotMzE2MzUzNzMtNzB2BgNVHR8EbzBtMEagRKBChkBodHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52 +ZS9sY3IvQ0VSVElGSUNBRE8tUkFJWi1TSEEzODRDUkxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNy +YWl6LnN1c2NlcnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v +Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsGAQUFBwIBFh5o +dHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcNAQELBQADggIBACtZ6yKZu4Sq +T96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmN +g7+mvTV+LFwxNG9s2/NkAZiqlCxB3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4q +uxtxj7mkoP3YldmvWb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1 +n8GhHVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHmpHmJWhSn +FFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXzsOfIt+FTvZLm8wyWuevo +5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bEqCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq +3TNWOByyrYDT13K9mmyZY+gAu0F2BbdbmRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5 +poLWccret9W6aAjtmcz9opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y +eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km +-----END CERTIFICATE----- + +China Internet Network Information Center EV Certificates Root +============================================================== +-----BEGIN CERTIFICATE----- +MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCQ04xMjAwBgNV +BAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyMUcwRQYDVQQDDD5D +aGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0aW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMg +Um9vdDAeFw0xMDA4MzEwNzExMjVaFw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAG +A1UECgwpQ2hpbmEgSW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMM +PkNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRpZmljYXRl +cyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z7r07eKpkQ0H1UN+U8i6y +jUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA//DdmEEbK40ctb3B75aDFk4Zv6dOtouSCV +98YPjUesWgbdYavi7NifFy2cyjw1l1VxzUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2H +klY0bBoQCxfVWhyXWIQ8hBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23 +KzhmBsUs4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54ugQEC +7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6oYNJKiyoOCWTAPBgNV +HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUfHJLOcfA22KlT5uqGDSSosqD +glkwDQYJKoZIhvcNAQEFBQADggEBACrDx0M3j92tpLIM7twUbY8opJhJywyA6vPtI2Z1fcXTIWd5 +0XPFtQO3WKwMVC/GVhMPMdoG52U7HW8228gd+f2ABsqjPWYWqJ1MFn3AlUa1UeTiH9fqBk1jjZaM +7+czV0I664zBechNdn3e9rG3geCg+aF4RhcaVpjwTj2rHO3sOdwHSPdj/gauwqRcalsyiMXHM4Ws +ZkJHwlgkmeHlPuV1LI5D1l08eB6olYIpUNHRFrrvwb562bTYzB5MRuF3sTGrvSrIzo9uoV1/A3U0 +5K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATywy39FCqQmbkHzJ8= +-----END CERTIFICATE----- + +Swisscom Root CA 2 +================== +-----BEGIN CERTIFICATE----- +MIIF2TCCA8GgAwIBAgIQHp4o6Ejy5e/DfEoeWhhntjANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQG +EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy +dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMjAeFw0xMTA2MjQwODM4MTRaFw0zMTA2 +MjUwNzM4MTRaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln +aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAyMIIC +IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlUJOhJ1R5tMJ6HJaI2nbeHCOFvErjw0DzpPM +LgAIe6szjPTpQOYXTKueuEcUMncy3SgM3hhLX3af+Dk7/E6J2HzFZ++r0rk0X2s682Q2zsKwzxNo +ysjL67XiPS4h3+os1OD5cJZM/2pYmLcX5BtS5X4HAB1f2uY+lQS3aYg5oUFgJWFLlTloYhyxCwWJ +wDaCFCE/rtuh/bxvHGCGtlOUSbkrRsVPACu/obvLP+DHVxxX6NZp+MEkUp2IVd3Chy50I9AU/SpH +Wrumnf2U5NGKpV+GY3aFy6//SSj8gO1MedK75MDvAe5QQQg1I3ArqRa0jG6F6bYRzzHdUyYb3y1a +SgJA/MTAtukxGggo5WDDH8SQjhBiYEQN7Aq+VRhxLKX0srwVYv8c474d2h5Xszx+zYIdkeNL6yxS +NLCK/RJOlrDrcH+eOfdmQrGrrFLadkBXeyq96G4DsguAhYidDMfCd7Camlf0uPoTXGiTOmekl9Ab +mbeGMktg2M7v0Ax/lZ9vh0+Hio5fCHyqW/xavqGRn1V9TrALacywlKinh/LTSlDcX3KwFnUey7QY +Ypqwpzmqm59m2I2mbJYV4+by+PGDYmy7Velhk6M99bFXi08jsJvllGov34zflVEpYKELKeRcVVi3 +qPyZ7iVNTA6z00yPhOgpD/0QVAKFyPnlw4vP5w8CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw +HQYDVR0hBBYwFDASBgdghXQBUwIBBgdghXQBUwIBMBIGA1UdEwEB/wQIMAYBAf8CAQcwHQYDVR0O +BBYEFE0mICKJS9PVpAqhb97iEoHF8TwuMB8GA1UdIwQYMBaAFE0mICKJS9PVpAqhb97iEoHF8Twu +MA0GCSqGSIb3DQEBCwUAA4ICAQAyCrKkG8t9voJXiblqf/P0wS4RfbgZPnm3qKhyN2abGu2sEzsO +v2LwnN+ee6FTSA5BesogpxcbtnjsQJHzQq0Qw1zv/2BZf82Fo4s9SBwlAjxnffUy6S8w5X2lejjQ +82YqZh6NM4OKb3xuqFp1mrjX2lhIREeoTPpMSQpKwhI3qEAMw8jh0FcNlzKVxzqfl9NX+Ave5XLz +o9v/tdhZsnPdTSpxsrpJ9csc1fV5yJmz/MFMdOO0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcs +a0vvaGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciATwoCqISxx +OQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99nBjx8Oto0QuFmtEYE3saW +mA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5Wt6NlUe07qxS/TFED6F+KBZvuim6c779o ++sjaC+NCydAXFJy3SuCvkychVSa1ZC+N8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TC +rvJcwhbtkj6EPnNgiLx29CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX +5OfNeOI5wSsSnqaeG8XmDtkx2Q== +-----END CERTIFICATE----- + +Swisscom Root EV CA 2 +===================== +-----BEGIN CERTIFICATE----- +MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UE +BhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdpdGFsIENlcnRpZmljYXRlIFNl +cnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcN +MzEwNjI1MDg0NTA4WjBnMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsT +HERpZ2l0YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYg +Q0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7BxUglgRCgz +o3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD1ycfMQ4jFrclyxy0uYAy +Xhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPHoCE2G3pXKSinLr9xJZDzRINpUKTk4Rti +GZQJo/PDvO/0vezbE53PnUgJUmfANykRHvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8Li +qG12W0OfvrSdsyaGOx9/5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaH +Za0zKcQvidm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHLOdAG +alNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaCNYGu+HuB5ur+rPQa +m3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f46Fq9mDU5zXNysRojddxyNMkM3Ox +bPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCBUWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDi +xzgHcgplwLa7JSnaFp6LNYth7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/ +BAQDAgGGMB0GA1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED +MB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWBbj2ITY1x0kbB +bkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6xXCX5145v9Ydkn+0UjrgEjihL +j6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98TPLr+flaYC/NUn81ETm484T4VvwYmneTwkLbU +wp4wLh/vx3rEUMfqe9pQy3omywC0Wqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7 +XwgiG/W9mR4U9s70WBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH +59yLGn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm7JFe3VE/ +23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4Snr8PyQUQ3nqjsTzyP6Wq +J3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VNvBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyA +HmBR3NdUIR7KYndP+tiPsys6DXhyyWhBWkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/gi +uMod89a2GQ+fYWVq6nTIfI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuW +l8PVP3wbI+2ksx0WckNLIOFZfsLorSa/ovc= +-----END CERTIFICATE----- + +CA Disig Root R1 +================ +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNVBAYTAlNLMRMw +EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp +ZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQyMDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sx +EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp +c2lnIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy +3QRkD2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/oOI7bm+V8 +u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3AfQ+lekLZWnDZv6fXARz2 +m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJeIgpFy4QxTaz+29FHuvlglzmxZcfe+5nk +CiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8noc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTa +YVKvJrT1cU/J19IG32PK/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6 +vpmumwKjrckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD3AjL +LhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE7cderVC6xkGbrPAX +ZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkCyC2fg69naQanMVXVz0tv/wQFx1is +XxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLdqvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ +04IwDQYJKoZIhvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR +xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaASfX8MPWbTx9B +LxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXoHqJPYNcHKfyyo6SdbhWSVhlM +CrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpBemOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5Gfb +VSUZP/3oNn6z4eGBrxEWi1CXYBmCAMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85 +YmLLW1AL14FABZyb7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKS +ds+xDzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvkF7mGnjix +lAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqFa3qdnom2piiZk4hA9z7N +UaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsTQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJ +a7+h89n07eLw4+1knj0vllJPgFOL +-----END CERTIFICATE----- + +CA Disig Root R2 +================ +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw +EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp +ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sx +EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp +c2lnIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbC +w3OeNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNHPWSb6Wia +xswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3Ix2ymrdMxp7zo5eFm1tL7 +A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbeQTg06ov80egEFGEtQX6sx3dOy1FU+16S +GBsEWmjGycT6txOgmLcRK7fWV8x8nhfRyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqV +g8NTEQxzHQuyRpDRQjrOQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa +5Beny912H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJQfYE +koopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUDi/ZnWejBBhG93c+A +Ak9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORsnLMOPReisjQS1n6yqEm70XooQL6i +Fh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5u +Qu0wDQYJKoZIhvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM +tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqfGopTpti72TVV +sRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkblvdhuDvEK7Z4bLQjb/D907Je +dR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W8 +1k/BfDxujRNt+3vrMNDcTa/F1balTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjx +mHHEt38OFdAlab0inSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01 +utI3gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18DrG5gPcFw0 +sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3OszMOl6W8KjptlwlCFtaOg +UxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8xL4ysEr3vQCj8KWefshNPZiTEUxnpHikV +7+ZtsH8tZ/3zbBt1RqPlShfppNcL +-----END CERTIFICATE----- + +ACCVRAIZ1 +========= +-----BEGIN CERTIFICATE----- +MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UEAwwJQUNDVlJB +SVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQswCQYDVQQGEwJFUzAeFw0xMTA1 +MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQBgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwH +UEtJQUNDVjENMAsGA1UECgwEQUNDVjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQCbqau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gM +jmoYHtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWoG2ioPej0 +RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpAlHPrzg5XPAOBOp0KoVdD +aaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhrIA8wKFSVf+DuzgpmndFALW4ir50awQUZ +0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDG +WuzndN9wrqODJerWx5eHk6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs7 +8yM2x/474KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMOm3WR +5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpacXpkatcnYGMN285J +9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPluUsXQA+xtrn13k/c4LOsOxFwYIRK +Q26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYIKwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRw +Oi8vd3d3LmFjY3YuZXMvZmlsZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEu +Y3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 +VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeTVfZW6oHlNsyM +Hj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIGCCsGAQUFBwICMIIBFB6CARAA +QQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUAcgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBh +AO0AegAgAGQAZQAgAGwAYQAgAEEAQwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUA +YwBuAG8AbABvAGcA7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBj +AHQAcgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAAQwBQAFMA +IABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUAczAwBggrBgEFBQcCARYk +aHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2MuaHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0 +dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRtaW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2 +MV9kZXIuY3JsMA4GA1UdDwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZI +hvcNAQEFBQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdpD70E +R9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gUJyCpZET/LtZ1qmxN +YEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+mAM/EKXMRNt6GGT6d7hmKG9Ww7Y49 +nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepDvV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJ +TS+xJlsndQAJxGJ3KQhfnlmstn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3 +sCPdK6jT2iWH7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h +I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szAh1xA2syVP1Xg +Nce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xFd3+YJ5oyXSrjhO7FmGYvliAd +3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2HpPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3p +EfbRD0tVNEYqi4Y7 +-----END CERTIFICATE----- + +TWCA Global Root CA +=================== +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcxEjAQBgNVBAoT +CVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMTVFdDQSBHbG9iYWwgUm9vdCBD +QTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQK +EwlUQUlXQU4tQ0ExEDAOBgNVBAsTB1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3Qg +Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2C +nJfF10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz0ALfUPZV +r2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfChMBwqoJimFb3u/Rk28OKR +Q4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbHzIh1HrtsBv+baz4X7GGqcXzGHaL3SekV +tTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1W +KKD+u4ZqyPpcC1jcxkt2yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99 +sy2sbZCilaLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYPoA/p +yJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQABDzfuBSO6N+pjWxn +kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI +zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g +cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn +LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M +8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg +/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg +lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP +A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m +i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 +EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 +zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= +-----END CERTIFICATE----- + +TeliaSonera Root CA v1 +====================== +-----BEGIN CERTIFICATE----- +MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE +CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcNMDcxMDE4 +MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwW +VGVsaWFTb25lcmEgUm9vdCBDQSB2MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+ +6yfwIaPzaSZVfp3FVRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA +3GV17CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+XZ75Ljo1k +B1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+/jXh7VB7qTCNGdMJjmhn +Xb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxH +oLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkmdtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3 +F0fUTPHSiXk+TT2YqGHeOh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJ +oWjiUIMusDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4pgd7 +gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fsslESl1MpWtTwEhDc +TwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQarMCpgKIv7NHfirZ1fpoeDVNAgMB +AAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qW +DNXr+nuqF+gTEjANBgkqhkiG9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNm +zqjMDfz1mgbldxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx +0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW +pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV +G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc +c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT +JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 +qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 +Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems +WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= +-----END CERTIFICATE----- + +E-Tugra Certification Authority +=============================== +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w +DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls +ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN +ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw +NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx +QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl +cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD +DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd +hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5K +CKpbknSFQ9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEoq1+g +ElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3Dk14opz8n8Y4e0ypQ +BaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcHfC425lAcP9tDJMW/hkd5s3kc91r0 +E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsutdEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gz +rt48Ue7LE3wBf4QOXVGUnhMMti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAq +jqFGOjGY5RH8zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn +rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUXU8u3Zg5mTPj5 +dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6Jyr+zE7S6E5UMA8GA1UdEwEB +/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG +MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK +kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO +XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 +VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo +a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc +dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV +KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT +Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 +8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G +C7TbO6Orb1wdtn7os4I07QZcJA== +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 2 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU +cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx +MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz +dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD +ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ +SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F +vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970 +2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV +WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy +YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4 +r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf +vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR +3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN +9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== +-----END CERTIFICATE----- + +Atos TrustedRoot 2011 +===================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU +cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 +MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG +A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV +hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr +54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ +DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 +HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR +z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R +l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ +bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB +CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h +k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kPDpFrdRbhIfzYJsdHt6bPWHJxfrrh +TZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pcmaHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a9 +61qn8FYiqTxlVMYVqL2Gns2Dlmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G +3mB/ufNPRJLvKrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed +-----END CERTIFICATE----- \ No newline at end of file diff --git a/libraries/fof/download/adapter/curl.php b/libraries/fof/download/adapter/curl.php old mode 100644 new mode 100755 index a6da535ecc584..04260c8e00d2c --- a/libraries/fof/download/adapter/curl.php +++ b/libraries/fof/download/adapter/curl.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage dispatcher - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access @@ -141,7 +141,7 @@ public function getFileSize($url) curl_setopt($ch, CURLOPT_HEADER, true ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true ); - @curl_setopt($ch, CURLOPT_CAINFO, JPATH_LIBRARIES . '/joomla/http/transport/cacert.pem'); + @curl_setopt($ch, CURLOPT_CAINFO, __DIR__ . '/cacert.pem'); $data = curl_exec($ch); curl_close($ch); diff --git a/libraries/fof/download/adapter/fopen.php b/libraries/fof/download/adapter/fopen.php old mode 100644 new mode 100755 index ecc994728b221..0fe035ab3abe8 --- a/libraries/fof/download/adapter/fopen.php +++ b/libraries/fof/download/adapter/fopen.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage dispatcher - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access @@ -81,7 +81,7 @@ public function downloadAndReturn($url, $from = null, $to = null, array $params ), 'ssl' => array( 'verify_peer' => true, - 'cafile' => JPATH_LIBRARIES . '/joomla/http/transport/cacert.pem', + 'cafile' => __DIR__ . '/cacert.pem', 'verify_depth' => 5, ) ); @@ -99,7 +99,7 @@ public function downloadAndReturn($url, $from = null, $to = null, array $params ), 'ssl' => array( 'verify_peer' => true, - 'cafile' => JPATH_LIBRARIES . '/joomla/http/transport/cacert.pem', + 'cafile' => __DIR__ . '/cacert.pem', 'verify_depth' => 5, ) ); diff --git a/libraries/fof/download/download.php b/libraries/fof/download/download.php old mode 100644 new mode 100755 index b5eba239e4aba..0df518fe48cca --- a/libraries/fof/download/download.php +++ b/libraries/fof/download/download.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage dispatcher - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/download/interface.php b/libraries/fof/download/interface.php old mode 100644 new mode 100755 index 77fa723300f6f..9958b8d019d76 --- a/libraries/fof/download/interface.php +++ b/libraries/fof/download/interface.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage dispatcher - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/encrypt/aes.php b/libraries/fof/encrypt/aes.php old mode 100644 new mode 100755 index 1ad7952a9c053..035986035f50b --- a/libraries/fof/encrypt/aes.php +++ b/libraries/fof/encrypt/aes.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage encrypt - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/encrypt/base32.php b/libraries/fof/encrypt/base32.php old mode 100644 new mode 100755 index b76e7ff12491b..11bc11877b3d2 --- a/libraries/fof/encrypt/base32.php +++ b/libraries/fof/encrypt/base32.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage encrypt - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; diff --git a/libraries/fof/encrypt/totp.php b/libraries/fof/encrypt/totp.php old mode 100644 new mode 100755 index d291471453ae9..42381f9b4a7a0 --- a/libraries/fof/encrypt/totp.php +++ b/libraries/fof/encrypt/totp.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage encrypt - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; diff --git a/libraries/fof/form/field.php b/libraries/fof/form/field.php old mode 100644 new mode 100755 index aaffd32eabb42..27eeb8149489d --- a/libraries/fof/form/field.php +++ b/libraries/fof/form/field.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/accesslevel.php b/libraries/fof/form/field/accesslevel.php old mode 100644 new mode 100755 index 51b827b6dad98..20847daf5e41e --- a/libraries/fof/form/field/accesslevel.php +++ b/libraries/fof/form/field/accesslevel.php @@ -3,7 +3,7 @@ * @package FrameworkOnFramework * @subpackage form * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/actions.php b/libraries/fof/form/field/actions.php old mode 100644 new mode 100755 index 3e41ebae31c82..4346ad2917b2f --- a/libraries/fof/form/field/actions.php +++ b/libraries/fof/form/field/actions.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/button.php b/libraries/fof/form/field/button.php old mode 100644 new mode 100755 index 3d6ee5528dd91..8f07d25d3fd21 --- a/libraries/fof/form/field/button.php +++ b/libraries/fof/form/field/button.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/cachehandler.php b/libraries/fof/form/field/cachehandler.php old mode 100644 new mode 100755 index ed7ec4940df8f..0acd63997a3a0 --- a/libraries/fof/form/field/cachehandler.php +++ b/libraries/fof/form/field/cachehandler.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/form/field/calendar.php b/libraries/fof/form/field/calendar.php old mode 100644 new mode 100755 index 4dc65a2f32f50..c23eb99a1eca0 --- a/libraries/fof/form/field/calendar.php +++ b/libraries/fof/form/field/calendar.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access @@ -112,10 +112,10 @@ protected function getCalendar($display) // PHP date doesn't use percentages (%) for the format, but the calendar Javascript // DOES use it (@see: calendar-uncompressed.js). Therefore we have to convert it. $formatJS = $format; - $formatPHP = str_replace(array('%', 'H:M:S'), array('', 'H:i:s'), $formatJS); + $formatPHP = str_replace(array('%', 'H:M:S', 'B'), array('', 'H:i:s', 'F'), $formatJS); // Check for empty date values - if (empty($this->value) || $this->value == '0000-00-00 00:00:00' || $this->value == '0000-00-00') + if (empty($this->value) || $this->value == FOFPlatform::getInstance()->getDbo()->getNullDate() || $this->value == '0000-00-00') { $this->value = $default; } diff --git a/libraries/fof/form/field/captcha.php b/libraries/fof/form/field/captcha.php old mode 100644 new mode 100755 index 30a32e353e7cf..94582fd4e2b44 --- a/libraries/fof/form/field/captcha.php +++ b/libraries/fof/form/field/captcha.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/checkbox.php b/libraries/fof/form/field/checkbox.php old mode 100644 new mode 100755 index 34b4af539c6e4..33704ff195137 --- a/libraries/fof/form/field/checkbox.php +++ b/libraries/fof/form/field/checkbox.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/checkboxes.php b/libraries/fof/form/field/checkboxes.php old mode 100644 new mode 100755 index 7d93213b09a92..9c10e892ddca8 --- a/libraries/fof/form/field/checkboxes.php +++ b/libraries/fof/form/field/checkboxes.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/components.php b/libraries/fof/form/field/components.php old mode 100644 new mode 100755 index 7d0d6fafb8ada..224bd8a4685a3 --- a/libraries/fof/form/field/components.php +++ b/libraries/fof/form/field/components.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/editor.php b/libraries/fof/form/field/editor.php old mode 100644 new mode 100755 index 2c28e327d0f8b..0c0314cfc9976 --- a/libraries/fof/form/field/editor.php +++ b/libraries/fof/form/field/editor.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/email.php b/libraries/fof/form/field/email.php old mode 100644 new mode 100755 index beea08af2abc1..01d00c4c01e75 --- a/libraries/fof/form/field/email.php +++ b/libraries/fof/form/field/email.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/groupedbutton.php b/libraries/fof/form/field/groupedbutton.php old mode 100644 new mode 100755 index ce82440a764fd..3cad129701aac --- a/libraries/fof/form/field/groupedbutton.php +++ b/libraries/fof/form/field/groupedbutton.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/groupedlist.php b/libraries/fof/form/field/groupedlist.php old mode 100644 new mode 100755 index ebd12307a443f..9fdd7b1e1d55d --- a/libraries/fof/form/field/groupedlist.php +++ b/libraries/fof/form/field/groupedlist.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/hidden.php b/libraries/fof/form/field/hidden.php old mode 100644 new mode 100755 index 6f69d45d85732..5bfa0f655029d --- a/libraries/fof/form/field/hidden.php +++ b/libraries/fof/form/field/hidden.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/image.php b/libraries/fof/form/field/image.php old mode 100644 new mode 100755 index 29f8f84b41852..8c111e7b1c062 --- a/libraries/fof/form/field/image.php +++ b/libraries/fof/form/field/image.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/imagelist.php b/libraries/fof/form/field/imagelist.php old mode 100644 new mode 100755 index e899f1c391856..7dc86a7ee51ab --- a/libraries/fof/form/field/imagelist.php +++ b/libraries/fof/form/field/imagelist.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/integer.php b/libraries/fof/form/field/integer.php old mode 100644 new mode 100755 index 34e92e48f627a..61f07356adb42 --- a/libraries/fof/form/field/integer.php +++ b/libraries/fof/form/field/integer.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/language.php b/libraries/fof/form/field/language.php old mode 100644 new mode 100755 index e0ef8792d92b1..afa4151869117 --- a/libraries/fof/form/field/language.php +++ b/libraries/fof/form/field/language.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/list.php b/libraries/fof/form/field/list.php old mode 100644 new mode 100755 index 0df582f603bc5..c6d1924ead617 --- a/libraries/fof/form/field/list.php +++ b/libraries/fof/form/field/list.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/media.php b/libraries/fof/form/field/media.php old mode 100644 new mode 100755 index cd80e565b4efb..2f6b16cc1ee42 --- a/libraries/fof/form/field/media.php +++ b/libraries/fof/form/field/media.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/model.php b/libraries/fof/form/field/model.php old mode 100644 new mode 100755 index c1c90abc27351..81bfbb39d532a --- a/libraries/fof/form/field/model.php +++ b/libraries/fof/form/field/model.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/ordering.php b/libraries/fof/form/field/ordering.php old mode 100644 new mode 100755 index 59a2862db2486..97dfcf5ab3633 --- a/libraries/fof/form/field/ordering.php +++ b/libraries/fof/form/field/ordering.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/password.php b/libraries/fof/form/field/password.php old mode 100644 new mode 100755 index aaf46ceffa6f0..b1337a481d790 --- a/libraries/fof/form/field/password.php +++ b/libraries/fof/form/field/password.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/plugins.php b/libraries/fof/form/field/plugins.php old mode 100644 new mode 100755 index 1166cb27bf8ed..6e9f1abe28279 --- a/libraries/fof/form/field/plugins.php +++ b/libraries/fof/form/field/plugins.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/published.php b/libraries/fof/form/field/published.php old mode 100644 new mode 100755 index d51c8fdb7e969..ca3f0b859fe8a --- a/libraries/fof/form/field/published.php +++ b/libraries/fof/form/field/published.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/radio.php b/libraries/fof/form/field/radio.php old mode 100644 new mode 100755 index 33016c7a330d8..cc7ddafb94ea0 --- a/libraries/fof/form/field/radio.php +++ b/libraries/fof/form/field/radio.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/relation.php b/libraries/fof/form/field/relation.php old mode 100644 new mode 100755 index 7293dce6d8657..535c0bc7496fa --- a/libraries/fof/form/field/relation.php +++ b/libraries/fof/form/field/relation.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/rules.php b/libraries/fof/form/field/rules.php old mode 100644 new mode 100755 index fd19556962586..0f132210ae09f --- a/libraries/fof/form/field/rules.php +++ b/libraries/fof/form/field/rules.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/selectrow.php b/libraries/fof/form/field/selectrow.php old mode 100644 new mode 100755 index 713ff60f2466a..fd30c427bedbc --- a/libraries/fof/form/field/selectrow.php +++ b/libraries/fof/form/field/selectrow.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/sessionhandler.php b/libraries/fof/form/field/sessionhandler.php old mode 100644 new mode 100755 index 503be8a5e7ea7..07f94f2713171 --- a/libraries/fof/form/field/sessionhandler.php +++ b/libraries/fof/form/field/sessionhandler.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/spacer.php b/libraries/fof/form/field/spacer.php old mode 100644 new mode 100755 index af3e953a9a48c..4bfe9a2bf7552 --- a/libraries/fof/form/field/spacer.php +++ b/libraries/fof/form/field/spacer.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/sql.php b/libraries/fof/form/field/sql.php old mode 100644 new mode 100755 index 5825d1698e32d..bc3b7c1b52886 --- a/libraries/fof/form/field/sql.php +++ b/libraries/fof/form/field/sql.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/tag.php b/libraries/fof/form/field/tag.php old mode 100644 new mode 100755 index d670d10d7fcfc..513eac7f10c21 --- a/libraries/fof/form/field/tag.php +++ b/libraries/fof/form/field/tag.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access @@ -29,6 +29,42 @@ class FOFFormFieldTag extends JFormFieldTag implements FOFFormField /** @var int A monotonically increasing number, denoting the row number in a repeatable view */ public $rowid; + /** + * Method to get certain otherwise inaccessible properties from the form field object. + * + * @param string $name The property name for which to the the value. + * + * @return mixed The property value or null. + * + * @since 2.0 + */ + public function __get($name) + { + switch ($name) + { + case 'static': + if (empty($this->static)) + { + $this->static = $this->getStatic(); + } + + return $this->static; + break; + + case 'repeatable': + if (empty($this->repeatable)) + { + $this->repeatable = $this->getRepeatable(); + } + + return $this->repeatable; + break; + + default: + return parent::__get($name); + } + } + /** * Method to get a list of tags * @@ -41,7 +77,6 @@ protected function getOptions() $options = array(); $published = $this->element['published']? $this->element['published'] : array(0,1); - $name = (string) $this->element['name']; $db = FOFPlatform::getInstance()->getDbo(); $query = $db->getQuery(true) @@ -49,7 +84,14 @@ protected function getOptions() ->from('#__tags AS a') ->join('LEFT', $db->quoteName('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt'); - $item = $this->form->getModel()->getItem(); + if ($this->item instanceof FOFTable) + { + $item = $this->item; + } + else + { + $item = $this->form->getModel()->getItem(); + } if ($item instanceof FOFTable) { @@ -138,7 +180,32 @@ protected function getOptions() */ public function getStatic() { - return ''; + $class = $this->element['class'] ? (string) $this->element['class'] : ''; + $translate = $this->element['translate'] ? (string) $this->element['translate'] : false; + + $options = $this->getOptions(); + + $html = ''; + + foreach ($options as $option) { + + $html .= ''; + + if ($translate == true) + { + $html .= JText::_($option->text); + } + else + { + $html .= $option->text; + } + + $html .= ''; + } + + return '' . + $html . + ''; } /** @@ -151,6 +218,31 @@ public function getStatic() */ public function getRepeatable() { - return ''; + $class = $this->element['class'] ? (string) $this->element['class'] : ''; + $translate = $this->element['translate'] ? (string) $this->element['translate'] : false; + + $options = $this->getOptions(); + + $html = ''; + + foreach ($options as $option) { + + $html .= ''; + + if ($translate == true) + { + $html .= JText::_($option->text); + } + else + { + $html .= $option->text; + } + + $html .= ''; + } + + return '' . + $html . + ''; } } diff --git a/libraries/fof/form/field/tel.php b/libraries/fof/form/field/tel.php old mode 100644 new mode 100755 index 4b58901f3dc65..2f8827d9b1e9e --- a/libraries/fof/form/field/tel.php +++ b/libraries/fof/form/field/tel.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/text.php b/libraries/fof/form/field/text.php old mode 100644 new mode 100755 index 5a1df0f6e25db..157381ec0cb8b --- a/libraries/fof/form/field/text.php +++ b/libraries/fof/form/field/text.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/textarea.php b/libraries/fof/form/field/textarea.php old mode 100644 new mode 100755 index 1cc7d7c6b3709..1694380ce7e1c --- a/libraries/fof/form/field/textarea.php +++ b/libraries/fof/form/field/textarea.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/timezone.php b/libraries/fof/form/field/timezone.php old mode 100644 new mode 100755 index aa4ed99186a15..196d5274e5c1b --- a/libraries/fof/form/field/timezone.php +++ b/libraries/fof/form/field/timezone.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/title.php b/libraries/fof/form/field/title.php old mode 100644 new mode 100755 index 49f7a13fce6c3..b8f15330e6c86 --- a/libraries/fof/form/field/title.php +++ b/libraries/fof/form/field/title.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access @@ -30,7 +30,6 @@ class FOFFormFieldTitle extends FOFFormFieldText implements FOFFormField public function getRepeatable() { // Initialise - $slug_field = 'slug'; $slug_format = '(%s)'; $slug_class = 'small'; @@ -39,6 +38,10 @@ public function getRepeatable() { $slug_field = (string) $this->element['slug_field']; } + else + { + $slug_field = $this->item->getColumnAlias('slug'); + } if ($this->element['slug_format']) { diff --git a/libraries/fof/form/field/url.php b/libraries/fof/form/field/url.php old mode 100644 new mode 100755 index 5c37fcddbf8b3..0c6885996cd48 --- a/libraries/fof/form/field/url.php +++ b/libraries/fof/form/field/url.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/user.php b/libraries/fof/form/field/user.php old mode 100644 new mode 100755 index aaee871251979..179c42963c652 --- a/libraries/fof/form/field/user.php +++ b/libraries/fof/form/field/user.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/field/usergroup.php b/libraries/fof/form/field/usergroup.php old mode 100644 new mode 100755 index 3b2f9fe282c64..5e300a8a03977 --- a/libraries/fof/form/field/usergroup.php +++ b/libraries/fof/form/field/usergroup.php @@ -3,7 +3,7 @@ * @package FrameworkOnFramework * @subpackage form * @subpackage form - * @copyright Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/form.php b/libraries/fof/form/form.php old mode 100644 new mode 100755 index 2908633cb68b3..b01af9a1e7472 --- a/libraries/fof/form/form.php +++ b/libraries/fof/form/form.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header.php b/libraries/fof/form/header.php old mode 100644 new mode 100755 index 1f59bc9e50c75..52921b549245a --- a/libraries/fof/form/header.php +++ b/libraries/fof/form/header.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/accesslevel.php b/libraries/fof/form/header/accesslevel.php old mode 100644 new mode 100755 index c25f71da94e64..7d0ad03e0fecf --- a/libraries/fof/form/header/accesslevel.php +++ b/libraries/fof/form/header/accesslevel.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/field.php b/libraries/fof/form/header/field.php old mode 100644 new mode 100755 index 1aa1dc28fb2d5..452ed27f075b1 --- a/libraries/fof/form/header/field.php +++ b/libraries/fof/form/header/field.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/fielddate.php b/libraries/fof/form/header/fielddate.php old mode 100644 new mode 100755 index db637f91f65bd..cc7aa2f275b41 --- a/libraries/fof/form/header/fielddate.php +++ b/libraries/fof/form/header/fielddate.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/fieldfilterable.php b/libraries/fof/form/header/fieldfilterable.php old mode 100644 new mode 100755 index c547d31a82d8f..342e069f309e6 --- a/libraries/fof/form/header/fieldfilterable.php +++ b/libraries/fof/form/header/fieldfilterable.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/fieldsearchable.php b/libraries/fof/form/header/fieldsearchable.php old mode 100644 new mode 100755 index 070db03078ccf..7583949de2a29 --- a/libraries/fof/form/header/fieldsearchable.php +++ b/libraries/fof/form/header/fieldsearchable.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/fieldselectable.php b/libraries/fof/form/header/fieldselectable.php old mode 100644 new mode 100755 index 4b1c03dd87081..5150b7f473cc3 --- a/libraries/fof/form/header/fieldselectable.php +++ b/libraries/fof/form/header/fieldselectable.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/fieldsql.php b/libraries/fof/form/header/fieldsql.php old mode 100644 new mode 100755 index ab3091a267b02..811a653982f75 --- a/libraries/fof/form/header/fieldsql.php +++ b/libraries/fof/form/header/fieldsql.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/filterdate.php b/libraries/fof/form/header/filterdate.php old mode 100644 new mode 100755 index 2a608fa6d08a6..c4b35b6f9d0cd --- a/libraries/fof/form/header/filterdate.php +++ b/libraries/fof/form/header/filterdate.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/filterfilterable.php b/libraries/fof/form/header/filterfilterable.php old mode 100644 new mode 100755 index 331a963e5221a..17e0fa76de553 --- a/libraries/fof/form/header/filterfilterable.php +++ b/libraries/fof/form/header/filterfilterable.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/filtersearchable.php b/libraries/fof/form/header/filtersearchable.php old mode 100644 new mode 100755 index 8a414019796ca..199beeca7bc43 --- a/libraries/fof/form/header/filtersearchable.php +++ b/libraries/fof/form/header/filtersearchable.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/filterselectable.php b/libraries/fof/form/header/filterselectable.php old mode 100644 new mode 100755 index e6c7040520b7d..4f9011cbbd923 --- a/libraries/fof/form/header/filterselectable.php +++ b/libraries/fof/form/header/filterselectable.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/filtersql.php b/libraries/fof/form/header/filtersql.php old mode 100644 new mode 100755 index a2771bfe2e7f1..cf6458f77c739 --- a/libraries/fof/form/header/filtersql.php +++ b/libraries/fof/form/header/filtersql.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/language.php b/libraries/fof/form/header/language.php old mode 100644 new mode 100755 index 64d3e2e6537b8..16c9e874d700e --- a/libraries/fof/form/header/language.php +++ b/libraries/fof/form/header/language.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/model.php b/libraries/fof/form/header/model.php old mode 100644 new mode 100755 index 80ee6dbf14eec..ebce52d440442 --- a/libraries/fof/form/header/model.php +++ b/libraries/fof/form/header/model.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/ordering.php b/libraries/fof/form/header/ordering.php old mode 100644 new mode 100755 index 6fa4876aa51b7..b5f47fb6705ca --- a/libraries/fof/form/header/ordering.php +++ b/libraries/fof/form/header/ordering.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/published.php b/libraries/fof/form/header/published.php old mode 100644 new mode 100755 index 07e9165dff6df..50ffab3a25667 --- a/libraries/fof/form/header/published.php +++ b/libraries/fof/form/header/published.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/header/rowselect.php b/libraries/fof/form/header/rowselect.php old mode 100644 new mode 100755 index e63485718027f..f1a360f2cf9cc --- a/libraries/fof/form/header/rowselect.php +++ b/libraries/fof/form/header/rowselect.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/form/helper.php b/libraries/fof/form/helper.php old mode 100644 new mode 100755 index cd30e1c4d6411..414dccd510a81 --- a/libraries/fof/form/helper.php +++ b/libraries/fof/form/helper.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage form - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/hal/document.php b/libraries/fof/hal/document.php old mode 100644 new mode 100755 index d7535710b35d6..17a72cf38e791 --- a/libraries/fof/hal/document.php +++ b/libraries/fof/hal/document.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage hal - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; diff --git a/libraries/fof/hal/link.php b/libraries/fof/hal/link.php old mode 100644 new mode 100755 index 9a7e3f79880ea..d3ef0e2314e84 --- a/libraries/fof/hal/link.php +++ b/libraries/fof/hal/link.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage hal - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; diff --git a/libraries/fof/hal/links.php b/libraries/fof/hal/links.php old mode 100644 new mode 100755 index 0e2365fa63d7f..7031e566d9dc4 --- a/libraries/fof/hal/links.php +++ b/libraries/fof/hal/links.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage hal - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; diff --git a/libraries/fof/hal/render/interface.php b/libraries/fof/hal/render/interface.php old mode 100644 new mode 100755 index f038dd7b6145e..b2822a352d31e --- a/libraries/fof/hal/render/interface.php +++ b/libraries/fof/hal/render/interface.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage hal - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; diff --git a/libraries/fof/hal/render/json.php b/libraries/fof/hal/render/json.php old mode 100644 new mode 100755 index a8058863a8607..5c8cb863fc918 --- a/libraries/fof/hal/render/json.php +++ b/libraries/fof/hal/render/json.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage hal - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; diff --git a/libraries/fof/include.php b/libraries/fof/include.php old mode 100644 new mode 100755 index 5879e057842a6..17e3781fabe0f --- a/libraries/fof/include.php +++ b/libraries/fof/include.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage include - * @copyright Copyright (c)2010-2014 Nicholas K. Dionysopoulos + * @copyright Copyright (C) 2010-2015 Nicholas K. Dionysopoulos * @license GNU General Public License version 2, or later * * Initializes FOF @@ -12,7 +12,7 @@ if (!defined('FOF_INCLUDED')) { - define('FOF_INCLUDED', '2.4.1'); + define('FOF_INCLUDED', '2.4.2'); // Register the FOF autoloader require_once __DIR__ . '/autoloader/fof.php'; diff --git a/libraries/fof/inflector/inflector.php b/libraries/fof/inflector/inflector.php old mode 100644 new mode 100755 index 3abac8577f9a1..004b224f64ef9 --- a/libraries/fof/inflector/inflector.php +++ b/libraries/fof/inflector/inflector.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage inflector - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; diff --git a/libraries/fof/input/input.php b/libraries/fof/input/input.php old mode 100644 new mode 100755 index 30800ba37758c..d84144ccb34f1 --- a/libraries/fof/input/input.php +++ b/libraries/fof/input/input.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage input - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/integration/joomla/filesystem/filesystem.php b/libraries/fof/integration/joomla/filesystem/filesystem.php old mode 100644 new mode 100755 index 53f352994c59b..a300edf6e1202 --- a/libraries/fof/integration/joomla/filesystem/filesystem.php +++ b/libraries/fof/integration/joomla/filesystem/filesystem.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage platformFilesystem - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/integration/joomla/platform.php b/libraries/fof/integration/joomla/platform.php old mode 100644 new mode 100755 index 75bf001ecb413..705b0b4f8c25a --- a/libraries/fof/integration/joomla/platform.php +++ b/libraries/fof/integration/joomla/platform.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage platform - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/layout/file.php b/libraries/fof/layout/file.php old mode 100644 new mode 100755 index 3999640a0d8a1..15f9f78c8ecd1 --- a/libraries/fof/layout/file.php +++ b/libraries/fof/layout/file.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage layout - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/layout/helper.php b/libraries/fof/layout/helper.php old mode 100644 new mode 100755 index ee31ad9ca6641..8d0ec127a357e --- a/libraries/fof/layout/helper.php +++ b/libraries/fof/layout/helper.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage layout - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/less/formatter/classic.php b/libraries/fof/less/formatter/classic.php old mode 100644 new mode 100755 index 877cd979a228c..a53fa1b8c6dee --- a/libraries/fof/less/formatter/classic.php +++ b/libraries/fof/less/formatter/classic.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage less - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/less/formatter/compressed.php b/libraries/fof/less/formatter/compressed.php old mode 100644 new mode 100755 index 27e838b9e7fba..d18e8a763bca1 --- a/libraries/fof/less/formatter/compressed.php +++ b/libraries/fof/less/formatter/compressed.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage less - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/less/formatter/joomla.php b/libraries/fof/less/formatter/joomla.php old mode 100644 new mode 100755 index 2d577e9be19b6..e81250e430ca2 --- a/libraries/fof/less/formatter/joomla.php +++ b/libraries/fof/less/formatter/joomla.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage less - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/less/formatter/lessjs.php b/libraries/fof/less/formatter/lessjs.php old mode 100644 new mode 100755 index fd98ccf636550..db4f686471e17 --- a/libraries/fof/less/formatter/lessjs.php +++ b/libraries/fof/less/formatter/lessjs.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage less - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/less/less.php b/libraries/fof/less/less.php old mode 100644 new mode 100755 index 41153ca1d9b4d..964670f65d134 --- a/libraries/fof/less/less.php +++ b/libraries/fof/less/less.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage less - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/less/parser/parser.php b/libraries/fof/less/parser/parser.php old mode 100644 new mode 100755 index 6a88d685746b2..195a88243b15b --- a/libraries/fof/less/parser/parser.php +++ b/libraries/fof/less/parser/parser.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage less - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/behavior.php b/libraries/fof/model/behavior.php old mode 100644 new mode 100755 index 5365bc1c607c1..d95054404628c --- a/libraries/fof/model/behavior.php +++ b/libraries/fof/model/behavior.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/behavior/access.php b/libraries/fof/model/behavior/access.php old mode 100644 new mode 100755 index 4973311966014..f8d3eea13e918 --- a/libraries/fof/model/behavior/access.php +++ b/libraries/fof/model/behavior/access.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/behavior/emptynonzero.php b/libraries/fof/model/behavior/emptynonzero.php old mode 100644 new mode 100755 index 420330d57f02c..56ffabd17b102 --- a/libraries/fof/model/behavior/emptynonzero.php +++ b/libraries/fof/model/behavior/emptynonzero.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/behavior/enabled.php b/libraries/fof/model/behavior/enabled.php old mode 100644 new mode 100755 index 518aca0b71586..2f6207b4b2f51 --- a/libraries/fof/model/behavior/enabled.php +++ b/libraries/fof/model/behavior/enabled.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/behavior/filters.php b/libraries/fof/model/behavior/filters.php old mode 100644 new mode 100755 index e5bf340dc34be..6e54cd3c9e385 --- a/libraries/fof/model/behavior/filters.php +++ b/libraries/fof/model/behavior/filters.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access @@ -35,9 +35,13 @@ public function onAfterBuildQuery(&$model, &$query) $filterzero = $model->getState('_emptynonzero', null); $fields = $model->getTableFields(); + $backlist = $model->blacklistFilters(); foreach ($fields as $fieldname => $fieldtype) { + if (in_array($fieldname, $backlist)) { + continue; + } $field = new stdClass; $field->name = $fieldname; $field->type = $fieldtype; diff --git a/libraries/fof/model/behavior/language.php b/libraries/fof/model/behavior/language.php old mode 100644 new mode 100755 index 281d1ec5fa465..f4b091e5409d5 --- a/libraries/fof/model/behavior/language.php +++ b/libraries/fof/model/behavior/language.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access @@ -17,6 +17,23 @@ */ class FOFModelBehaviorLanguage extends FOFModelBehavior { + /** + * This event runs before we have built the query used to fetch a record + * list in a model. It is used to blacklist the language filter + * + * @param FOFModel &$model The model which calls this event + * @param JDatabaseQuery &$query The model which calls this event + * + * @return void + */ + public function onBeforeBuildQuery(&$model, &$query) + { + if (FOFPlatform::getInstance()->isFrontend()) + { + $model->blacklistFilters('language'); + } + } + /** * This event runs after we have built the query used to fetch a record * list in a model. It is used to apply automatic query filters. diff --git a/libraries/fof/model/behavior/private.php b/libraries/fof/model/behavior/private.php old mode 100644 new mode 100755 index f2bad11430361..85cb9d9a669e3 --- a/libraries/fof/model/behavior/private.php +++ b/libraries/fof/model/behavior/private.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/dispatcher/behavior.php b/libraries/fof/model/dispatcher/behavior.php old mode 100644 new mode 100755 index 843484a0589fc..554908afe119f --- a/libraries/fof/model/dispatcher/behavior.php +++ b/libraries/fof/model/dispatcher/behavior.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/field.php b/libraries/fof/model/field.php old mode 100644 new mode 100755 index 8503619ddd4f8..4eeec40c619f6 --- a/libraries/fof/model/field.php +++ b/libraries/fof/model/field.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/model/field/boolean.php b/libraries/fof/model/field/boolean.php old mode 100644 new mode 100755 index 9a982e86a4766..114acce813973 --- a/libraries/fof/model/field/boolean.php +++ b/libraries/fof/model/field/boolean.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/field/date.php b/libraries/fof/model/field/date.php old mode 100644 new mode 100755 index 10dfc9879fa49..4319976dc1ffd --- a/libraries/fof/model/field/date.php +++ b/libraries/fof/model/field/date.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/field/number.php b/libraries/fof/model/field/number.php old mode 100644 new mode 100755 index 5255a2844cde2..9d3bd09810778 --- a/libraries/fof/model/field/number.php +++ b/libraries/fof/model/field/number.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/field/text.php b/libraries/fof/model/field/text.php old mode 100644 new mode 100755 index 323585dc754f0..580b6d3ae4dd6 --- a/libraries/fof/model/field/text.php +++ b/libraries/fof/model/field/text.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/model/model.php b/libraries/fof/model/model.php old mode 100644 new mode 100755 index e833ef9508dfd..99a026220acde --- a/libraries/fof/model/model.php +++ b/libraries/fof/model/model.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage model - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access @@ -196,6 +196,13 @@ class FOFModel extends FOFUtilsObject */ protected $default_behaviors = array('filters'); + /** + * Behavior parameters + * + * @var array + */ + protected $_behaviorParams = array(); + /** * Returns a new model object. Unless overriden by the $config array, it will * try to automatically populate its state from the request variables. @@ -3190,4 +3197,60 @@ protected function cleanCache($group = null, $client_id = 0) // Trigger the onContentCleanCache event. FOFPlatform::getInstance()->runPlugins($this->event_clean_cache, $options); } + + /** + * Set a behavior param + * + * @param string $name The name of the param + * @param mixed $value The param value to set + * + * @return FOFModel + */ + public function setBehaviorParam($name, $value) + { + $this->_behaviorParams[$name] = $value; + + return $this; + } + + /** + * Get a behavior param + * + * @param string $name The name of the param + * @param mixed $default The default value returned if not set + * + * @return mixed + */ + public function getBehaviorParam($name, $default = null) + { + return isset($this->_behaviorParams[$name]) ? $this->_behaviorParams[$name] : $default; + } + + /** + * Set or get the backlisted filters + * + * @param mixed $list A filter or list of filters to backlist. If null return the list of backlisted filter + * @param boolean $reset Reset the blacklist if true + * + * @return void|array Return an array of value if $list is null + */ + public function blacklistFilters($list = null, $reset = false) + { + if (!isset($list)) + { + return $this->getBehaviorParam('blacklistFilters', array()); + } + + if (is_string($list)) + { + $list = (array) $list; + } + + if (!$reset) + { + $list = array_unique(array_merge($this->getBehaviorParam('blacklistFilters', array()), $list)); + } + + $this->setBehaviorParam('blacklistFilters', $list); + } } diff --git a/libraries/fof/platform/filesystem/filesystem.php b/libraries/fof/platform/filesystem/filesystem.php old mode 100644 new mode 100755 index c62b48543b00b..b2291efe5ad12 --- a/libraries/fof/platform/filesystem/filesystem.php +++ b/libraries/fof/platform/filesystem/filesystem.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage platform -* @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/platform/filesystem/interface.php b/libraries/fof/platform/filesystem/interface.php old mode 100644 new mode 100755 index 8069d72000819..4d57888559280 --- a/libraries/fof/platform/filesystem/interface.php +++ b/libraries/fof/platform/filesystem/interface.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage platformFilesystem - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/platform/interface.php b/libraries/fof/platform/interface.php old mode 100644 new mode 100755 index 537ced5194698..e00c138817671 --- a/libraries/fof/platform/interface.php +++ b/libraries/fof/platform/interface.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage platform - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/platform/platform.php b/libraries/fof/platform/platform.php old mode 100644 new mode 100755 index 73e547fd6e51a..f3101d697961f --- a/libraries/fof/platform/platform.php +++ b/libraries/fof/platform/platform.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage platform - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/query/abstract.php b/libraries/fof/query/abstract.php old mode 100644 new mode 100755 index 772b9d64eaea3..7fde3a3fd8d45 --- a/libraries/fof/query/abstract.php +++ b/libraries/fof/query/abstract.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage query - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/render/abstract.php b/libraries/fof/render/abstract.php old mode 100644 new mode 100755 index 14490caad2437..fe1cdcbedd20b --- a/libraries/fof/render/abstract.php +++ b/libraries/fof/render/abstract.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage render - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; diff --git a/libraries/fof/render/joomla.php b/libraries/fof/render/joomla.php old mode 100644 new mode 100755 index cf3d4f27916ec..0f9435f21e910 --- a/libraries/fof/render/joomla.php +++ b/libraries/fof/render/joomla.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage render - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; @@ -55,6 +55,16 @@ public function preRender($view, $task, $input, $config = array()) return; } + if (version_compare(JVERSION, '3.0.0', 'lt')) + { + JHtml::_('behavior.framework'); + } + else + { + JHtml::_('behavior.core'); + JHtml::_('jquery.framework'); + } + // Wrap output in various classes $version = new JVersion; $versionParts = explode('.', $version->RELEASE); @@ -390,8 +400,7 @@ protected function renderFormEdit(FOFForm &$form, FOFModel $model, FOFInput $inp if (in_array($validate, array('true', 'yes', '1', 'on'))) { - JHTML::_('behavior.framework', true); - JHTML::_('behavior.formvalidation'); + JHtml::_('behavior.formvalidation'); $class = 'form-validate '; $this->loadValidationScript($form); } diff --git a/libraries/fof/render/joomla3.php b/libraries/fof/render/joomla3.php old mode 100644 new mode 100755 index cddb8d3205c82..e5376d87679ff --- a/libraries/fof/render/joomla3.php +++ b/libraries/fof/render/joomla3.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage render - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; @@ -55,6 +55,9 @@ public function preRender($view, $task, $input, $config = array()) return; } + JHtml::_('behavior.core'); + JHtml::_('jquery.framework'); + if ($platform->isBackend()) { // Wrap output in various classes diff --git a/libraries/fof/render/strapper.php b/libraries/fof/render/strapper.php old mode 100644 new mode 100755 index 25ae8e4c7a212..462d2851ddb6f --- a/libraries/fof/render/strapper.php +++ b/libraries/fof/render/strapper.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage render - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('FOF_INCLUDED') or die; @@ -55,6 +55,16 @@ public function preRender($view, $task, $input, $config = array()) return; } + if (version_compare(JVERSION, '3.0.0', 'lt')) + { + JHtml::_('behavior.framework'); + } + else + { + JHtml::_('behavior.core'); + JHtml::_('jquery.framework'); + } + // Wrap output in various classes $version = new JVersion; $versionParts = explode('.', $version->RELEASE); @@ -77,6 +87,10 @@ public function preRender($view, $task, $input, $config = array()) 'view-' . $view, 'layout-' . $layout, 'task-' . $task, + // We have a floating sidebar, they said. It looks great, they said. They must've been blind, I say! + 'j-toggle-main', + 'j-toggle-transition', + 'span12', ); } elseif ($platform->isFrontend()) @@ -996,8 +1010,7 @@ protected function renderFormEdit(FOFForm &$form, FOFModel $model, FOFInput $inp if (in_array($validate, array('true', 'yes', '1', 'on'))) { - JHTML::_('behavior.framework', true); - JHTML::_('behavior.formvalidation'); + JHtml::_('behavior.formvalidation'); $class = ' form-validate'; $this->loadValidationScript($form); } diff --git a/libraries/fof/string/utils.php b/libraries/fof/string/utils.php old mode 100644 new mode 100755 index 76656a9af1af6..a3a701a63d4a6 --- a/libraries/fof/string/utils.php +++ b/libraries/fof/string/utils.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/table/behavior.php b/libraries/fof/table/behavior.php old mode 100644 new mode 100755 index a64b219fb56c6..487dbbe086b09 --- a/libraries/fof/table/behavior.php +++ b/libraries/fof/table/behavior.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage table - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/table/behavior/assets.php b/libraries/fof/table/behavior/assets.php old mode 100644 new mode 100755 index 96f1cc4013d7f..c171cdbd4b97e --- a/libraries/fof/table/behavior/assets.php +++ b/libraries/fof/table/behavior/assets.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage table - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/table/behavior/contenthistory.php b/libraries/fof/table/behavior/contenthistory.php old mode 100644 new mode 100755 index f93c93e7bf91c..b86a430e057ec --- a/libraries/fof/table/behavior/contenthistory.php +++ b/libraries/fof/table/behavior/contenthistory.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage table - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/table/behavior/tags.php b/libraries/fof/table/behavior/tags.php old mode 100644 new mode 100755 index b57b6e21bc1d0..30bae5e085b92 --- a/libraries/fof/table/behavior/tags.php +++ b/libraries/fof/table/behavior/tags.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage table - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/table/dispatcher/behavior.php b/libraries/fof/table/dispatcher/behavior.php old mode 100644 new mode 100755 index 221d4f5fda800..0b331a937d270 --- a/libraries/fof/table/dispatcher/behavior.php +++ b/libraries/fof/table/dispatcher/behavior.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage table - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/table/nested.php b/libraries/fof/table/nested.php old mode 100644 new mode 100755 index 80bc00d33ac2f..e2a99ce20ba6f --- a/libraries/fof/table/nested.php +++ b/libraries/fof/table/nested.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage table - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/table/relations.php b/libraries/fof/table/relations.php old mode 100644 new mode 100755 index 22f7ebcc7c90a..fd548e314c59d --- a/libraries/fof/table/relations.php +++ b/libraries/fof/table/relations.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage table - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/table/table.php b/libraries/fof/table/table.php old mode 100644 new mode 100755 index d4f504b946aae..33c0eee4c9150 --- a/libraries/fof/table/table.php +++ b/libraries/fof/table/table.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage table - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access @@ -2472,13 +2472,13 @@ protected function isQuoted($column) * plugin events do NOT get triggered * * Example: - * protected function onAfterStore(){ + * protected function onBeforeBind(){ * // Your code here - * return parent::onAfterStore() && $your_result; + * return parent::onBeforeBind() && $your_result; * } * - * Do not do it the other way around, e.g. return $your_result && parent::onAfterStore() - * Due to PHP short-circuit boolean evaluation the parent::onAfterStore() + * Do not do it the other way around, e.g. return $your_result && parent::onBeforeBind() + * Due to PHP short-circuit boolean evaluation the parent::onBeforeBind() * will not be called if $your_result is false. * * @param object|array &$from The data to bind @@ -3699,7 +3699,7 @@ public function getConfigProviderKey() * * @return null */ - public function checkContentType($alias) + public function checkContentType($alias = null) { $contentType = new JTableContenttype($this->getDbo()); diff --git a/libraries/fof/template/utils.php b/libraries/fof/template/utils.php old mode 100644 new mode 100755 index 66d74936ded64..511dd86095da1 --- a/libraries/fof/template/utils.php +++ b/libraries/fof/template/utils.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage template - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/toolbar/toolbar.php b/libraries/fof/toolbar/toolbar.php old mode 100644 new mode 100755 index bd7062d8b5806..95ee37ff6d065 --- a/libraries/fof/toolbar/toolbar.php +++ b/libraries/fof/toolbar/toolbar.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage toolbar - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access @@ -207,7 +207,15 @@ public function __construct($config = array()) if(!FOFPlatform::getInstance()->isCli()) { // Load the core Javascript - JHtml::_('behavior.framework', true); + if (version_compare(JVERSION, '3.0', 'ge')) + { + JHtml::_('jquery.framework'); + JHtml::_('behavior.core'); + } + else + { + JHtml::_('behavior.framework'); + } } } } diff --git a/libraries/fof/utils/array/array.php b/libraries/fof/utils/array/array.php old mode 100644 new mode 100755 index 498e018ba9c6a..a57ed3a2ebe02 --- a/libraries/fof/utils/array/array.php +++ b/libraries/fof/utils/array/array.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/utils/cache/cleaner.php b/libraries/fof/utils/cache/cleaner.php old mode 100644 new mode 100755 index e8fe35ad79e16..7edaa7b0ab3ff --- a/libraries/fof/utils/cache/cleaner.php +++ b/libraries/fof/utils/cache/cleaner.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/utils/filescheck/filescheck.php b/libraries/fof/utils/filescheck/filescheck.php old mode 100644 new mode 100755 index 68bf7398a629f..2791eceb00019 --- a/libraries/fof/utils/filescheck/filescheck.php +++ b/libraries/fof/utils/filescheck/filescheck.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/utils/installscript/installscript.php b/libraries/fof/utils/installscript/installscript.php old mode 100644 new mode 100755 index 2949e7a3bf65f..d97479cef2101 --- a/libraries/fof/utils/installscript/installscript.php +++ b/libraries/fof/utils/installscript/installscript.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -281,14 +281,14 @@ public function preflight($type, $parent) return false; } - // Workarounds for notorious JInstaller bugs we submitted patches for but were rejected – yet the bugs were never - // fixed. Way to go, Joomla!... - if (in_array($type, array('install'))) + // Workarounds for notorious JInstaller bugs we submitted patches for but were rejected – yet the bugs were + // never fixed. Way to go, Joomla!... + if (in_array($type, array('install', 'discover_install'))) { // Bugfix for "Database function returned no error" $this->bugfixDBFunctionReturnedNoError(); } - elseif ($type != 'discover_install') + else { // Bugfix for "Can not build admin menus" $this->bugfixCantBuildAdminMenus(); @@ -780,7 +780,9 @@ protected function bugfixCantBuildAdminMenus() } } - // Remove #__menu records for good measure! + // Remove #__menu records for good measure! –– I think this is not necessary and causes the menu item to + // disappear on extension update. + /** $query = $db->getQuery(true); $query->select('id') ->from('#__menu') @@ -846,6 +848,7 @@ protected function bugfixCantBuildAdminMenus() } } } + /**/ } /** @@ -1750,9 +1753,9 @@ private function _createAdminMenus($parent) ->where('home = 0'); $db->setQuery($query); - $menu_id = $db->loadResult(); + $menu_ids_level1 = $db->loadColumn(); - if (!$menu_id) + if (empty($menu_ids_level1)) { // Oops! Could not get the menu ID. Go back and rollback changes. JError::raiseWarning(1, $table->getError()); @@ -1761,10 +1764,27 @@ private function _createAdminMenus($parent) } else { + $ids = implode(',', $menu_ids_level1); + + $query->clear() + ->select('id') + ->from('#__menu') + ->where('menutype = ' . $db->quote('main')) + ->where('client_id = 1') + ->where('type = ' . $db->quote('component')) + ->where('parent_id in (' . $ids . ')') + ->where('level = 2') + ->where('home = 0'); + + $db->setQuery($query); + $menu_ids_level2 = $db->loadColumn(); + + $ids = implode(',', array_merge($menu_ids_level1, $menu_ids_level2)); + // Remove the old menu item $query->clear() ->delete('#__menu') - ->where('id = ' . (int)$menu_id); + ->where('id in (' . $ids . ')'); $db->setQuery($query); $db->query(); diff --git a/libraries/fof/utils/ip/ip.php b/libraries/fof/utils/ip/ip.php new file mode 100755 index 0000000000000..aa68ae266e140 --- /dev/null +++ b/libraries/fof/utils/ip/ip.php @@ -0,0 +1,504 @@ + $to) + { + list($from, $to) = array($to, $from); + } + + if (($myIP >= $from) && ($myIP <= $to)) + { + return true; + } + } + // Netmask or CIDR provided + elseif (strstr($ipExpression, '/')) + { + $binaryip = self::inet_to_bits($myIP); + + list($net, $maskbits) = explode('/', $ipExpression, 2); + if ($ipv6 && !self::isIPv6($net)) + { + // Do not apply IPv4 filtering on an IPv6 address + continue; + } + elseif (!$ipv6 && self::isIPv6($net)) + { + // Do not apply IPv6 filtering on an IPv4 address + continue; + } + elseif ($ipv6 && strstr($maskbits, ':')) + { + // Perform an IPv6 CIDR check + if (self::checkIPv6CIDR($myIP, $ipExpression)) + { + return true; + } + + // If we didn't match it proceed to the next expression + continue; + } + elseif (!$ipv6 && strstr($maskbits, '.')) + { + // Convert IPv4 netmask to CIDR + $long = ip2long($maskbits); + $base = ip2long('255.255.255.255'); + $maskbits = 32 - log(($long ^ $base) + 1, 2); + } + + // Convert network IP to in_addr representation + $net = @inet_pton($net); + + // Sanity check + if ($net === false) + { + continue; + } + + // Get the network's binary representation + $binarynet = self::inet_to_bits($net); + $expectedNumberOfBits = $ipv6 ? 128 : 24; + $binarynet = str_pad($binarynet, $expectedNumberOfBits, '0', STR_PAD_RIGHT); + + // Check the corresponding bits of the IP and the network + $ip_net_bits = substr($binaryip, 0, $maskbits); + $net_bits = substr($binarynet, 0, $maskbits); + + if ($ip_net_bits == $net_bits) + { + return true; + } + } + else + { + // IPv6: Only single IPs are supported + if ($ipv6) + { + $ipExpression = trim($ipExpression); + + if (!self::isIPv6($ipExpression)) + { + continue; + } + + $ipCheck = @inet_pton($ipExpression); + if ($ipCheck === false) + { + continue; + } + + if ($ipCheck == $myIP) + { + return true; + } + } + else + { + // Standard IPv4 address, i.e. 123.123.123.123 or partial IP address, i.e. 123.[123.][123.][123] + $dots = 0; + if (substr($ipExpression, -1) == '.') + { + // Partial IP address. Convert to CIDR and re-match + foreach (count_chars($ipExpression, 1) as $i => $val) + { + if ($i == 46) + { + $dots = $val; + } + } + switch ($dots) + { + case 1: + $netmask = '255.0.0.0'; + $ipExpression .= '0.0.0'; + break; + + case 2: + $netmask = '255.255.0.0'; + $ipExpression .= '0.0'; + break; + + case 3: + $netmask = '255.255.255.0'; + $ipExpression .= '0'; + break; + + default: + $dots = 0; + } + + if ($dots) + { + $binaryip = self::inet_to_bits($myIP); + + // Convert netmask to CIDR + $long = ip2long($netmask); + $base = ip2long('255.255.255.255'); + $maskbits = 32 - log(($long ^ $base) + 1, 2); + + $net = @inet_pton($ipExpression); + + // Sanity check + if ($net === false) + { + continue; + } + + // Get the network's binary representation + $binarynet = self::inet_to_bits($net); + $expectedNumberOfBits = $ipv6 ? 128 : 24; + $binarynet = str_pad($binarynet, $expectedNumberOfBits, '0', STR_PAD_RIGHT); + + // Check the corresponding bits of the IP and the network + $ip_net_bits = substr($binaryip, 0, $maskbits); + $net_bits = substr($binarynet, 0, $maskbits); + + if ($ip_net_bits == $net_bits) + { + return true; + } + } + } + if (!$dots) + { + $ip = @inet_pton(trim($ipExpression)); + if ($ip == $myIP) + { + return true; + } + } + } + } + } + + return false; + } + + /** + * Works around the REMOTE_ADDR not containing the user's IP + */ + public static function workaroundIPIssues() + { + $ip = self::getIp(); + + if ($_SERVER['REMOTE_ADDR'] == $ip) + { + return; + } + + if (array_key_exists('REMOTE_ADDR', $_SERVER)) + { + $_SERVER['FOF_REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR']; + } + elseif (function_exists('getenv')) + { + if (getenv('REMOTE_ADDR')) + { + $_SERVER['FOF_REMOTE_ADDR'] = getenv('REMOTE_ADDR'); + } + } + + $_SERVER['REMOTE_ADDR'] = $ip; + } + + /** + * Gets the visitor's IP address. Automatically handles reverse proxies + * reporting the IPs of intermediate devices, like load balancers. Examples: + * https://www.akeebabackup.com/support/admin-tools/13743-double-ip-adresses-in-security-exception-log-warnings.html + * http://stackoverflow.com/questions/2422395/why-is-request-envremote-addr-returning-two-ips + * The solution used is assuming that the last IP address is the external one. + * + * @return string + */ + protected static function detectAndCleanIP() + { + $ip = self::detectIP(); + + if ((strstr($ip, ',') !== false) || (strstr($ip, ' ') !== false)) + { + $ip = str_replace(' ', ',', $ip); + $ip = str_replace(',,', ',', $ip); + $ips = explode(',', $ip); + $ip = ''; + while (empty($ip) && !empty($ips)) + { + $ip = array_pop($ips); + $ip = trim($ip); + } + } + else + { + $ip = trim($ip); + } + + return $ip; + } + + /** + * Gets the visitor's IP address + * + * @return string + */ + protected static function detectIP() + { + // Normally the $_SERVER superglobal is set + if (isset($_SERVER)) + { + // Do we have an x-forwarded-for HTTP header (e.g. NginX)? + if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) + { + return $_SERVER['HTTP_X_FORWARDED_FOR']; + } + + // Do we have a client-ip header (e.g. non-transparent proxy)? + if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) + { + return $_SERVER['HTTP_CLIENT_IP']; + } + + // Normal, non-proxied server or server behind a transparent proxy + return $_SERVER['REMOTE_ADDR']; + } + + // This part is executed on PHP running as CGI, or on SAPIs which do + // not set the $_SERVER superglobal + // If getenv() is disabled, you're screwed + if (!function_exists('getenv')) + { + return ''; + } + + // Do we have an x-forwarded-for HTTP header? + if (getenv('HTTP_X_FORWARDED_FOR')) + { + return getenv('HTTP_X_FORWARDED_FOR'); + } + + // Do we have a client-ip header? + if (getenv('HTTP_CLIENT_IP')) + { + return getenv('HTTP_CLIENT_IP'); + } + + // Normal, non-proxied server or server behind a transparent proxy + if (getenv('REMOTE_ADDR')) + { + return getenv('REMOTE_ADDR'); + } + + // Catch-all case for broken servers, apparently + return ''; + } + + /** + * Converts inet_pton output to bits string + * + * @param string $inet The in_addr representation of an IPv4 or IPv6 address + * + * @return string + */ + protected static function inet_to_bits($inet) + { + if (strlen($inet) == 4) + { + $unpacked = unpack('A4', $inet); + } + else + { + $unpacked = unpack('A16', $inet); + } + $unpacked = str_split($unpacked[1]); + $binaryip = ''; + + foreach ($unpacked as $char) + { + $binaryip .= str_pad(decbin(ord($char)), 8, '0', STR_PAD_LEFT); + } + + return $binaryip; + } + + /** + * Checks if an IPv6 address $ip is part of the IPv6 CIDR block $cidrnet + * + * @param string $ip The IPv6 address to check, e.g. 21DA:00D3:0000:2F3B:02AC:00FF:FE28:9C5A + * @param string $cidrnet The IPv6 CIDR block, e.g. 21DA:00D3:0000:2F3B::/64 + * + * @return bool + */ + protected static function checkIPv6CIDR($ip, $cidrnet) + { + $ip = inet_pton($ip); + $binaryip=self::inet_to_bits($ip); + + list($net,$maskbits)=explode('/',$cidrnet); + $net=inet_pton($net); + $binarynet=self::inet_to_bits($net); + + $ip_net_bits=substr($binaryip,0,$maskbits); + $net_bits =substr($binarynet,0,$maskbits); + + return $ip_net_bits === $net_bits; + } +} \ No newline at end of file diff --git a/libraries/fof/utils/object/object.php b/libraries/fof/utils/object/object.php old mode 100644 new mode 100755 index b4dd62f34defe..d62df2dc07bd7 --- a/libraries/fof/utils/object/object.php +++ b/libraries/fof/utils/object/object.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/utils/observable/dispatcher.php b/libraries/fof/utils/observable/dispatcher.php old mode 100644 new mode 100755 index 7e4791479a946..cd127ae1aa1da --- a/libraries/fof/utils/observable/dispatcher.php +++ b/libraries/fof/utils/observable/dispatcher.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/utils/observable/event.php b/libraries/fof/utils/observable/event.php old mode 100644 new mode 100755 index c80bacba499ab..78fde068cfe26 --- a/libraries/fof/utils/observable/event.php +++ b/libraries/fof/utils/observable/event.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/utils/timer/timer.php b/libraries/fof/utils/timer/timer.php old mode 100644 new mode 100755 index 6c8849cd420a9..70c35a92b0960 --- a/libraries/fof/utils/timer/timer.php +++ b/libraries/fof/utils/timer/timer.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/utils/update/collection.php b/libraries/fof/utils/update/collection.php old mode 100644 new mode 100755 index ae568497e7adc..7bac20fc18c75 --- a/libraries/fof/utils/update/collection.php +++ b/libraries/fof/utils/update/collection.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/utils/update/extension.php b/libraries/fof/utils/update/extension.php old mode 100644 new mode 100755 index ad7e90fdfa72a..46fb2653b93d0 --- a/libraries/fof/utils/update/extension.php +++ b/libraries/fof/utils/update/extension.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/utils/update/joomla.php b/libraries/fof/utils/update/joomla.php old mode 100644 new mode 100755 index 002a0932b110b..4ceffbddd8500 --- a/libraries/fof/utils/update/joomla.php +++ b/libraries/fof/utils/update/joomla.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/utils/update/update.php b/libraries/fof/utils/update/update.php old mode 100644 new mode 100755 index 1ec1ea6998388..9bd04a5724b28 --- a/libraries/fof/utils/update/update.php +++ b/libraries/fof/utils/update/update.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage utils - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/libraries/fof/version.txt b/libraries/fof/version.txt old mode 100644 new mode 100755 index 94d9da86f5601..a7d3e3ef2bbcb --- a/libraries/fof/version.txt +++ b/libraries/fof/version.txt @@ -1,2 +1,2 @@ -2.4.1 -2014-11-28 11:21:40 \ No newline at end of file +2.4.2 +2015-03-02 16:26:53 \ No newline at end of file diff --git a/libraries/fof/view/csv.php b/libraries/fof/view/csv.php old mode 100644 new mode 100755 index d1e1f3a63f8dc..f7707a4041bd7 --- a/libraries/fof/view/csv.php +++ b/libraries/fof/view/csv.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage view - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/view/form.php b/libraries/fof/view/form.php old mode 100644 new mode 100755 index 2df1132ab7d90..d5c6c6eaf5441 --- a/libraries/fof/view/form.php +++ b/libraries/fof/view/form.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage view - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/view/html.php b/libraries/fof/view/html.php old mode 100644 new mode 100755 index 502075f6448ef..d0f3ecf474f02 --- a/libraries/fof/view/html.php +++ b/libraries/fof/view/html.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage view - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/view/json.php b/libraries/fof/view/json.php old mode 100644 new mode 100755 index 74a7823713c71..035e2983882be --- a/libraries/fof/view/json.php +++ b/libraries/fof/view/json.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage view - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/view/raw.php b/libraries/fof/view/raw.php old mode 100644 new mode 100755 index 6dd777f04d484..722959c5f5d5d --- a/libraries/fof/view/raw.php +++ b/libraries/fof/view/raw.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage view - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access diff --git a/libraries/fof/view/view.php b/libraries/fof/view/view.php old mode 100644 new mode 100755 index bc3dc1a0d5747..ac66f73e47f54 --- a/libraries/fof/view/view.php +++ b/libraries/fof/view/view.php @@ -2,7 +2,7 @@ /** * @package FrameworkOnFramework * @subpackage view - * @copyright Copyright (C) 2010 - 2014 Akeeba Ltd. All rights reserved. + * @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Protect from unauthorized access From 1d40191316d0a02cf819652fcd61847c06b412be Mon Sep 17 00:00:00 2001 From: "Nicholas K. Dionysopoulos" Date: Wed, 11 Mar 2015 13:20:11 +0200 Subject: [PATCH 071/809] Permissions, again. --- libraries/fof/autoloader/component.php | 0 libraries/fof/autoloader/fof.php | 0 libraries/fof/config/domain/dispatcher.php | 0 libraries/fof/config/domain/interface.php | 0 libraries/fof/config/domain/tables.php | 0 libraries/fof/config/domain/views.php | 0 libraries/fof/config/provider.php | 0 libraries/fof/controller/controller.php | 0 libraries/fof/database/installer.php | 0 libraries/fof/database/iterator.php | 0 libraries/fof/database/iterator/azure.php | 0 libraries/fof/database/iterator/mysql.php | 0 libraries/fof/database/iterator/mysqli.php | 0 libraries/fof/database/iterator/pdo.php | 0 libraries/fof/database/iterator/postgresql.php | 0 libraries/fof/database/iterator/sqlsrv.php | 0 libraries/fof/dispatcher/dispatcher.php | 0 libraries/fof/download/adapter/abstract.php | 0 libraries/fof/download/adapter/cacert.pem | 0 libraries/fof/download/adapter/curl.php | 0 libraries/fof/download/adapter/fopen.php | 0 libraries/fof/download/download.php | 0 libraries/fof/download/interface.php | 0 libraries/fof/encrypt/aes.php | 0 libraries/fof/encrypt/base32.php | 0 libraries/fof/encrypt/totp.php | 0 libraries/fof/form/field.php | 0 libraries/fof/form/field/accesslevel.php | 0 libraries/fof/form/field/actions.php | 0 libraries/fof/form/field/button.php | 0 libraries/fof/form/field/cachehandler.php | 0 libraries/fof/form/field/calendar.php | 0 libraries/fof/form/field/captcha.php | 0 libraries/fof/form/field/checkbox.php | 0 libraries/fof/form/field/checkboxes.php | 0 libraries/fof/form/field/components.php | 0 libraries/fof/form/field/editor.php | 0 libraries/fof/form/field/email.php | 0 libraries/fof/form/field/groupedbutton.php | 0 libraries/fof/form/field/groupedlist.php | 0 libraries/fof/form/field/hidden.php | 0 libraries/fof/form/field/image.php | 0 libraries/fof/form/field/imagelist.php | 0 libraries/fof/form/field/integer.php | 0 libraries/fof/form/field/language.php | 0 libraries/fof/form/field/list.php | 0 libraries/fof/form/field/media.php | 0 libraries/fof/form/field/model.php | 0 libraries/fof/form/field/ordering.php | 0 libraries/fof/form/field/password.php | 0 libraries/fof/form/field/plugins.php | 0 libraries/fof/form/field/published.php | 0 libraries/fof/form/field/radio.php | 0 libraries/fof/form/field/relation.php | 0 libraries/fof/form/field/rules.php | 0 libraries/fof/form/field/selectrow.php | 0 libraries/fof/form/field/sessionhandler.php | 0 libraries/fof/form/field/spacer.php | 0 libraries/fof/form/field/sql.php | 0 libraries/fof/form/field/tag.php | 0 libraries/fof/form/field/tel.php | 0 libraries/fof/form/field/text.php | 0 libraries/fof/form/field/textarea.php | 0 libraries/fof/form/field/timezone.php | 0 libraries/fof/form/field/title.php | 0 libraries/fof/form/field/url.php | 0 libraries/fof/form/field/user.php | 0 libraries/fof/form/field/usergroup.php | 0 libraries/fof/form/form.php | 0 libraries/fof/form/header.php | 0 libraries/fof/form/header/accesslevel.php | 0 libraries/fof/form/header/field.php | 0 libraries/fof/form/header/fielddate.php | 0 libraries/fof/form/header/fieldfilterable.php | 0 libraries/fof/form/header/fieldsearchable.php | 0 libraries/fof/form/header/fieldselectable.php | 0 libraries/fof/form/header/fieldsql.php | 0 libraries/fof/form/header/filterdate.php | 0 libraries/fof/form/header/filterfilterable.php | 0 libraries/fof/form/header/filtersearchable.php | 0 libraries/fof/form/header/filterselectable.php | 0 libraries/fof/form/header/filtersql.php | 0 libraries/fof/form/header/language.php | 0 libraries/fof/form/header/model.php | 0 libraries/fof/form/header/ordering.php | 0 libraries/fof/form/header/published.php | 0 libraries/fof/form/header/rowselect.php | 0 libraries/fof/form/helper.php | 0 libraries/fof/hal/document.php | 0 libraries/fof/hal/link.php | 0 libraries/fof/hal/links.php | 0 libraries/fof/hal/render/interface.php | 0 libraries/fof/hal/render/json.php | 0 libraries/fof/include.php | 0 libraries/fof/inflector/inflector.php | 0 libraries/fof/input/input.php | 0 libraries/fof/integration/joomla/filesystem/filesystem.php | 0 libraries/fof/integration/joomla/platform.php | 0 libraries/fof/layout/file.php | 0 libraries/fof/layout/helper.php | 0 libraries/fof/less/formatter/classic.php | 0 libraries/fof/less/formatter/compressed.php | 0 libraries/fof/less/formatter/joomla.php | 0 libraries/fof/less/formatter/lessjs.php | 0 libraries/fof/less/less.php | 0 libraries/fof/less/parser/parser.php | 0 libraries/fof/model/behavior.php | 0 libraries/fof/model/behavior/access.php | 0 libraries/fof/model/behavior/emptynonzero.php | 0 libraries/fof/model/behavior/enabled.php | 0 libraries/fof/model/behavior/filters.php | 0 libraries/fof/model/behavior/language.php | 0 libraries/fof/model/behavior/private.php | 0 libraries/fof/model/dispatcher/behavior.php | 0 libraries/fof/model/field.php | 0 libraries/fof/model/field/boolean.php | 0 libraries/fof/model/field/date.php | 0 libraries/fof/model/field/number.php | 0 libraries/fof/model/field/text.php | 0 libraries/fof/model/model.php | 0 libraries/fof/platform/filesystem/filesystem.php | 0 libraries/fof/platform/filesystem/interface.php | 0 libraries/fof/platform/interface.php | 0 libraries/fof/platform/platform.php | 0 libraries/fof/query/abstract.php | 0 libraries/fof/render/abstract.php | 0 libraries/fof/render/joomla.php | 0 libraries/fof/render/joomla3.php | 0 libraries/fof/render/strapper.php | 0 libraries/fof/string/utils.php | 0 libraries/fof/table/behavior.php | 0 libraries/fof/table/behavior/assets.php | 0 libraries/fof/table/behavior/contenthistory.php | 0 libraries/fof/table/behavior/tags.php | 0 libraries/fof/table/dispatcher/behavior.php | 0 libraries/fof/table/nested.php | 0 libraries/fof/table/relations.php | 0 libraries/fof/table/table.php | 0 libraries/fof/template/utils.php | 0 libraries/fof/toolbar/toolbar.php | 0 libraries/fof/utils/array/array.php | 0 libraries/fof/utils/cache/cleaner.php | 0 libraries/fof/utils/filescheck/filescheck.php | 0 libraries/fof/utils/installscript/installscript.php | 0 libraries/fof/utils/ip/ip.php | 0 libraries/fof/utils/object/object.php | 0 libraries/fof/utils/observable/dispatcher.php | 0 libraries/fof/utils/observable/event.php | 0 libraries/fof/utils/timer/timer.php | 0 libraries/fof/utils/update/collection.php | 0 libraries/fof/utils/update/extension.php | 0 libraries/fof/utils/update/joomla.php | 0 libraries/fof/utils/update/update.php | 0 libraries/fof/version.txt | 0 libraries/fof/view/csv.php | 0 libraries/fof/view/form.php | 0 libraries/fof/view/html.php | 0 libraries/fof/view/json.php | 0 libraries/fof/view/raw.php | 0 libraries/fof/view/view.php | 0 160 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 libraries/fof/autoloader/component.php mode change 100755 => 100644 libraries/fof/autoloader/fof.php mode change 100755 => 100644 libraries/fof/config/domain/dispatcher.php mode change 100755 => 100644 libraries/fof/config/domain/interface.php mode change 100755 => 100644 libraries/fof/config/domain/tables.php mode change 100755 => 100644 libraries/fof/config/domain/views.php mode change 100755 => 100644 libraries/fof/config/provider.php mode change 100755 => 100644 libraries/fof/controller/controller.php mode change 100755 => 100644 libraries/fof/database/installer.php mode change 100755 => 100644 libraries/fof/database/iterator.php mode change 100755 => 100644 libraries/fof/database/iterator/azure.php mode change 100755 => 100644 libraries/fof/database/iterator/mysql.php mode change 100755 => 100644 libraries/fof/database/iterator/mysqli.php mode change 100755 => 100644 libraries/fof/database/iterator/pdo.php mode change 100755 => 100644 libraries/fof/database/iterator/postgresql.php mode change 100755 => 100644 libraries/fof/database/iterator/sqlsrv.php mode change 100755 => 100644 libraries/fof/dispatcher/dispatcher.php mode change 100755 => 100644 libraries/fof/download/adapter/abstract.php mode change 100755 => 100644 libraries/fof/download/adapter/cacert.pem mode change 100755 => 100644 libraries/fof/download/adapter/curl.php mode change 100755 => 100644 libraries/fof/download/adapter/fopen.php mode change 100755 => 100644 libraries/fof/download/download.php mode change 100755 => 100644 libraries/fof/download/interface.php mode change 100755 => 100644 libraries/fof/encrypt/aes.php mode change 100755 => 100644 libraries/fof/encrypt/base32.php mode change 100755 => 100644 libraries/fof/encrypt/totp.php mode change 100755 => 100644 libraries/fof/form/field.php mode change 100755 => 100644 libraries/fof/form/field/accesslevel.php mode change 100755 => 100644 libraries/fof/form/field/actions.php mode change 100755 => 100644 libraries/fof/form/field/button.php mode change 100755 => 100644 libraries/fof/form/field/cachehandler.php mode change 100755 => 100644 libraries/fof/form/field/calendar.php mode change 100755 => 100644 libraries/fof/form/field/captcha.php mode change 100755 => 100644 libraries/fof/form/field/checkbox.php mode change 100755 => 100644 libraries/fof/form/field/checkboxes.php mode change 100755 => 100644 libraries/fof/form/field/components.php mode change 100755 => 100644 libraries/fof/form/field/editor.php mode change 100755 => 100644 libraries/fof/form/field/email.php mode change 100755 => 100644 libraries/fof/form/field/groupedbutton.php mode change 100755 => 100644 libraries/fof/form/field/groupedlist.php mode change 100755 => 100644 libraries/fof/form/field/hidden.php mode change 100755 => 100644 libraries/fof/form/field/image.php mode change 100755 => 100644 libraries/fof/form/field/imagelist.php mode change 100755 => 100644 libraries/fof/form/field/integer.php mode change 100755 => 100644 libraries/fof/form/field/language.php mode change 100755 => 100644 libraries/fof/form/field/list.php mode change 100755 => 100644 libraries/fof/form/field/media.php mode change 100755 => 100644 libraries/fof/form/field/model.php mode change 100755 => 100644 libraries/fof/form/field/ordering.php mode change 100755 => 100644 libraries/fof/form/field/password.php mode change 100755 => 100644 libraries/fof/form/field/plugins.php mode change 100755 => 100644 libraries/fof/form/field/published.php mode change 100755 => 100644 libraries/fof/form/field/radio.php mode change 100755 => 100644 libraries/fof/form/field/relation.php mode change 100755 => 100644 libraries/fof/form/field/rules.php mode change 100755 => 100644 libraries/fof/form/field/selectrow.php mode change 100755 => 100644 libraries/fof/form/field/sessionhandler.php mode change 100755 => 100644 libraries/fof/form/field/spacer.php mode change 100755 => 100644 libraries/fof/form/field/sql.php mode change 100755 => 100644 libraries/fof/form/field/tag.php mode change 100755 => 100644 libraries/fof/form/field/tel.php mode change 100755 => 100644 libraries/fof/form/field/text.php mode change 100755 => 100644 libraries/fof/form/field/textarea.php mode change 100755 => 100644 libraries/fof/form/field/timezone.php mode change 100755 => 100644 libraries/fof/form/field/title.php mode change 100755 => 100644 libraries/fof/form/field/url.php mode change 100755 => 100644 libraries/fof/form/field/user.php mode change 100755 => 100644 libraries/fof/form/field/usergroup.php mode change 100755 => 100644 libraries/fof/form/form.php mode change 100755 => 100644 libraries/fof/form/header.php mode change 100755 => 100644 libraries/fof/form/header/accesslevel.php mode change 100755 => 100644 libraries/fof/form/header/field.php mode change 100755 => 100644 libraries/fof/form/header/fielddate.php mode change 100755 => 100644 libraries/fof/form/header/fieldfilterable.php mode change 100755 => 100644 libraries/fof/form/header/fieldsearchable.php mode change 100755 => 100644 libraries/fof/form/header/fieldselectable.php mode change 100755 => 100644 libraries/fof/form/header/fieldsql.php mode change 100755 => 100644 libraries/fof/form/header/filterdate.php mode change 100755 => 100644 libraries/fof/form/header/filterfilterable.php mode change 100755 => 100644 libraries/fof/form/header/filtersearchable.php mode change 100755 => 100644 libraries/fof/form/header/filterselectable.php mode change 100755 => 100644 libraries/fof/form/header/filtersql.php mode change 100755 => 100644 libraries/fof/form/header/language.php mode change 100755 => 100644 libraries/fof/form/header/model.php mode change 100755 => 100644 libraries/fof/form/header/ordering.php mode change 100755 => 100644 libraries/fof/form/header/published.php mode change 100755 => 100644 libraries/fof/form/header/rowselect.php mode change 100755 => 100644 libraries/fof/form/helper.php mode change 100755 => 100644 libraries/fof/hal/document.php mode change 100755 => 100644 libraries/fof/hal/link.php mode change 100755 => 100644 libraries/fof/hal/links.php mode change 100755 => 100644 libraries/fof/hal/render/interface.php mode change 100755 => 100644 libraries/fof/hal/render/json.php mode change 100755 => 100644 libraries/fof/include.php mode change 100755 => 100644 libraries/fof/inflector/inflector.php mode change 100755 => 100644 libraries/fof/input/input.php mode change 100755 => 100644 libraries/fof/integration/joomla/filesystem/filesystem.php mode change 100755 => 100644 libraries/fof/integration/joomla/platform.php mode change 100755 => 100644 libraries/fof/layout/file.php mode change 100755 => 100644 libraries/fof/layout/helper.php mode change 100755 => 100644 libraries/fof/less/formatter/classic.php mode change 100755 => 100644 libraries/fof/less/formatter/compressed.php mode change 100755 => 100644 libraries/fof/less/formatter/joomla.php mode change 100755 => 100644 libraries/fof/less/formatter/lessjs.php mode change 100755 => 100644 libraries/fof/less/less.php mode change 100755 => 100644 libraries/fof/less/parser/parser.php mode change 100755 => 100644 libraries/fof/model/behavior.php mode change 100755 => 100644 libraries/fof/model/behavior/access.php mode change 100755 => 100644 libraries/fof/model/behavior/emptynonzero.php mode change 100755 => 100644 libraries/fof/model/behavior/enabled.php mode change 100755 => 100644 libraries/fof/model/behavior/filters.php mode change 100755 => 100644 libraries/fof/model/behavior/language.php mode change 100755 => 100644 libraries/fof/model/behavior/private.php mode change 100755 => 100644 libraries/fof/model/dispatcher/behavior.php mode change 100755 => 100644 libraries/fof/model/field.php mode change 100755 => 100644 libraries/fof/model/field/boolean.php mode change 100755 => 100644 libraries/fof/model/field/date.php mode change 100755 => 100644 libraries/fof/model/field/number.php mode change 100755 => 100644 libraries/fof/model/field/text.php mode change 100755 => 100644 libraries/fof/model/model.php mode change 100755 => 100644 libraries/fof/platform/filesystem/filesystem.php mode change 100755 => 100644 libraries/fof/platform/filesystem/interface.php mode change 100755 => 100644 libraries/fof/platform/interface.php mode change 100755 => 100644 libraries/fof/platform/platform.php mode change 100755 => 100644 libraries/fof/query/abstract.php mode change 100755 => 100644 libraries/fof/render/abstract.php mode change 100755 => 100644 libraries/fof/render/joomla.php mode change 100755 => 100644 libraries/fof/render/joomla3.php mode change 100755 => 100644 libraries/fof/render/strapper.php mode change 100755 => 100644 libraries/fof/string/utils.php mode change 100755 => 100644 libraries/fof/table/behavior.php mode change 100755 => 100644 libraries/fof/table/behavior/assets.php mode change 100755 => 100644 libraries/fof/table/behavior/contenthistory.php mode change 100755 => 100644 libraries/fof/table/behavior/tags.php mode change 100755 => 100644 libraries/fof/table/dispatcher/behavior.php mode change 100755 => 100644 libraries/fof/table/nested.php mode change 100755 => 100644 libraries/fof/table/relations.php mode change 100755 => 100644 libraries/fof/table/table.php mode change 100755 => 100644 libraries/fof/template/utils.php mode change 100755 => 100644 libraries/fof/toolbar/toolbar.php mode change 100755 => 100644 libraries/fof/utils/array/array.php mode change 100755 => 100644 libraries/fof/utils/cache/cleaner.php mode change 100755 => 100644 libraries/fof/utils/filescheck/filescheck.php mode change 100755 => 100644 libraries/fof/utils/installscript/installscript.php mode change 100755 => 100644 libraries/fof/utils/ip/ip.php mode change 100755 => 100644 libraries/fof/utils/object/object.php mode change 100755 => 100644 libraries/fof/utils/observable/dispatcher.php mode change 100755 => 100644 libraries/fof/utils/observable/event.php mode change 100755 => 100644 libraries/fof/utils/timer/timer.php mode change 100755 => 100644 libraries/fof/utils/update/collection.php mode change 100755 => 100644 libraries/fof/utils/update/extension.php mode change 100755 => 100644 libraries/fof/utils/update/joomla.php mode change 100755 => 100644 libraries/fof/utils/update/update.php mode change 100755 => 100644 libraries/fof/version.txt mode change 100755 => 100644 libraries/fof/view/csv.php mode change 100755 => 100644 libraries/fof/view/form.php mode change 100755 => 100644 libraries/fof/view/html.php mode change 100755 => 100644 libraries/fof/view/json.php mode change 100755 => 100644 libraries/fof/view/raw.php mode change 100755 => 100644 libraries/fof/view/view.php diff --git a/libraries/fof/autoloader/component.php b/libraries/fof/autoloader/component.php old mode 100755 new mode 100644 diff --git a/libraries/fof/autoloader/fof.php b/libraries/fof/autoloader/fof.php old mode 100755 new mode 100644 diff --git a/libraries/fof/config/domain/dispatcher.php b/libraries/fof/config/domain/dispatcher.php old mode 100755 new mode 100644 diff --git a/libraries/fof/config/domain/interface.php b/libraries/fof/config/domain/interface.php old mode 100755 new mode 100644 diff --git a/libraries/fof/config/domain/tables.php b/libraries/fof/config/domain/tables.php old mode 100755 new mode 100644 diff --git a/libraries/fof/config/domain/views.php b/libraries/fof/config/domain/views.php old mode 100755 new mode 100644 diff --git a/libraries/fof/config/provider.php b/libraries/fof/config/provider.php old mode 100755 new mode 100644 diff --git a/libraries/fof/controller/controller.php b/libraries/fof/controller/controller.php old mode 100755 new mode 100644 diff --git a/libraries/fof/database/installer.php b/libraries/fof/database/installer.php old mode 100755 new mode 100644 diff --git a/libraries/fof/database/iterator.php b/libraries/fof/database/iterator.php old mode 100755 new mode 100644 diff --git a/libraries/fof/database/iterator/azure.php b/libraries/fof/database/iterator/azure.php old mode 100755 new mode 100644 diff --git a/libraries/fof/database/iterator/mysql.php b/libraries/fof/database/iterator/mysql.php old mode 100755 new mode 100644 diff --git a/libraries/fof/database/iterator/mysqli.php b/libraries/fof/database/iterator/mysqli.php old mode 100755 new mode 100644 diff --git a/libraries/fof/database/iterator/pdo.php b/libraries/fof/database/iterator/pdo.php old mode 100755 new mode 100644 diff --git a/libraries/fof/database/iterator/postgresql.php b/libraries/fof/database/iterator/postgresql.php old mode 100755 new mode 100644 diff --git a/libraries/fof/database/iterator/sqlsrv.php b/libraries/fof/database/iterator/sqlsrv.php old mode 100755 new mode 100644 diff --git a/libraries/fof/dispatcher/dispatcher.php b/libraries/fof/dispatcher/dispatcher.php old mode 100755 new mode 100644 diff --git a/libraries/fof/download/adapter/abstract.php b/libraries/fof/download/adapter/abstract.php old mode 100755 new mode 100644 diff --git a/libraries/fof/download/adapter/cacert.pem b/libraries/fof/download/adapter/cacert.pem old mode 100755 new mode 100644 diff --git a/libraries/fof/download/adapter/curl.php b/libraries/fof/download/adapter/curl.php old mode 100755 new mode 100644 diff --git a/libraries/fof/download/adapter/fopen.php b/libraries/fof/download/adapter/fopen.php old mode 100755 new mode 100644 diff --git a/libraries/fof/download/download.php b/libraries/fof/download/download.php old mode 100755 new mode 100644 diff --git a/libraries/fof/download/interface.php b/libraries/fof/download/interface.php old mode 100755 new mode 100644 diff --git a/libraries/fof/encrypt/aes.php b/libraries/fof/encrypt/aes.php old mode 100755 new mode 100644 diff --git a/libraries/fof/encrypt/base32.php b/libraries/fof/encrypt/base32.php old mode 100755 new mode 100644 diff --git a/libraries/fof/encrypt/totp.php b/libraries/fof/encrypt/totp.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field.php b/libraries/fof/form/field.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/accesslevel.php b/libraries/fof/form/field/accesslevel.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/actions.php b/libraries/fof/form/field/actions.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/button.php b/libraries/fof/form/field/button.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/cachehandler.php b/libraries/fof/form/field/cachehandler.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/calendar.php b/libraries/fof/form/field/calendar.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/captcha.php b/libraries/fof/form/field/captcha.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/checkbox.php b/libraries/fof/form/field/checkbox.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/checkboxes.php b/libraries/fof/form/field/checkboxes.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/components.php b/libraries/fof/form/field/components.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/editor.php b/libraries/fof/form/field/editor.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/email.php b/libraries/fof/form/field/email.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/groupedbutton.php b/libraries/fof/form/field/groupedbutton.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/groupedlist.php b/libraries/fof/form/field/groupedlist.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/hidden.php b/libraries/fof/form/field/hidden.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/image.php b/libraries/fof/form/field/image.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/imagelist.php b/libraries/fof/form/field/imagelist.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/integer.php b/libraries/fof/form/field/integer.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/language.php b/libraries/fof/form/field/language.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/list.php b/libraries/fof/form/field/list.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/media.php b/libraries/fof/form/field/media.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/model.php b/libraries/fof/form/field/model.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/ordering.php b/libraries/fof/form/field/ordering.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/password.php b/libraries/fof/form/field/password.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/plugins.php b/libraries/fof/form/field/plugins.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/published.php b/libraries/fof/form/field/published.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/radio.php b/libraries/fof/form/field/radio.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/relation.php b/libraries/fof/form/field/relation.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/rules.php b/libraries/fof/form/field/rules.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/selectrow.php b/libraries/fof/form/field/selectrow.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/sessionhandler.php b/libraries/fof/form/field/sessionhandler.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/spacer.php b/libraries/fof/form/field/spacer.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/sql.php b/libraries/fof/form/field/sql.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/tag.php b/libraries/fof/form/field/tag.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/tel.php b/libraries/fof/form/field/tel.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/text.php b/libraries/fof/form/field/text.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/textarea.php b/libraries/fof/form/field/textarea.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/timezone.php b/libraries/fof/form/field/timezone.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/title.php b/libraries/fof/form/field/title.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/url.php b/libraries/fof/form/field/url.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/user.php b/libraries/fof/form/field/user.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/field/usergroup.php b/libraries/fof/form/field/usergroup.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/form.php b/libraries/fof/form/form.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header.php b/libraries/fof/form/header.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/accesslevel.php b/libraries/fof/form/header/accesslevel.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/field.php b/libraries/fof/form/header/field.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/fielddate.php b/libraries/fof/form/header/fielddate.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/fieldfilterable.php b/libraries/fof/form/header/fieldfilterable.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/fieldsearchable.php b/libraries/fof/form/header/fieldsearchable.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/fieldselectable.php b/libraries/fof/form/header/fieldselectable.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/fieldsql.php b/libraries/fof/form/header/fieldsql.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/filterdate.php b/libraries/fof/form/header/filterdate.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/filterfilterable.php b/libraries/fof/form/header/filterfilterable.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/filtersearchable.php b/libraries/fof/form/header/filtersearchable.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/filterselectable.php b/libraries/fof/form/header/filterselectable.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/filtersql.php b/libraries/fof/form/header/filtersql.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/language.php b/libraries/fof/form/header/language.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/model.php b/libraries/fof/form/header/model.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/ordering.php b/libraries/fof/form/header/ordering.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/published.php b/libraries/fof/form/header/published.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/header/rowselect.php b/libraries/fof/form/header/rowselect.php old mode 100755 new mode 100644 diff --git a/libraries/fof/form/helper.php b/libraries/fof/form/helper.php old mode 100755 new mode 100644 diff --git a/libraries/fof/hal/document.php b/libraries/fof/hal/document.php old mode 100755 new mode 100644 diff --git a/libraries/fof/hal/link.php b/libraries/fof/hal/link.php old mode 100755 new mode 100644 diff --git a/libraries/fof/hal/links.php b/libraries/fof/hal/links.php old mode 100755 new mode 100644 diff --git a/libraries/fof/hal/render/interface.php b/libraries/fof/hal/render/interface.php old mode 100755 new mode 100644 diff --git a/libraries/fof/hal/render/json.php b/libraries/fof/hal/render/json.php old mode 100755 new mode 100644 diff --git a/libraries/fof/include.php b/libraries/fof/include.php old mode 100755 new mode 100644 diff --git a/libraries/fof/inflector/inflector.php b/libraries/fof/inflector/inflector.php old mode 100755 new mode 100644 diff --git a/libraries/fof/input/input.php b/libraries/fof/input/input.php old mode 100755 new mode 100644 diff --git a/libraries/fof/integration/joomla/filesystem/filesystem.php b/libraries/fof/integration/joomla/filesystem/filesystem.php old mode 100755 new mode 100644 diff --git a/libraries/fof/integration/joomla/platform.php b/libraries/fof/integration/joomla/platform.php old mode 100755 new mode 100644 diff --git a/libraries/fof/layout/file.php b/libraries/fof/layout/file.php old mode 100755 new mode 100644 diff --git a/libraries/fof/layout/helper.php b/libraries/fof/layout/helper.php old mode 100755 new mode 100644 diff --git a/libraries/fof/less/formatter/classic.php b/libraries/fof/less/formatter/classic.php old mode 100755 new mode 100644 diff --git a/libraries/fof/less/formatter/compressed.php b/libraries/fof/less/formatter/compressed.php old mode 100755 new mode 100644 diff --git a/libraries/fof/less/formatter/joomla.php b/libraries/fof/less/formatter/joomla.php old mode 100755 new mode 100644 diff --git a/libraries/fof/less/formatter/lessjs.php b/libraries/fof/less/formatter/lessjs.php old mode 100755 new mode 100644 diff --git a/libraries/fof/less/less.php b/libraries/fof/less/less.php old mode 100755 new mode 100644 diff --git a/libraries/fof/less/parser/parser.php b/libraries/fof/less/parser/parser.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/behavior.php b/libraries/fof/model/behavior.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/behavior/access.php b/libraries/fof/model/behavior/access.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/behavior/emptynonzero.php b/libraries/fof/model/behavior/emptynonzero.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/behavior/enabled.php b/libraries/fof/model/behavior/enabled.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/behavior/filters.php b/libraries/fof/model/behavior/filters.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/behavior/language.php b/libraries/fof/model/behavior/language.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/behavior/private.php b/libraries/fof/model/behavior/private.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/dispatcher/behavior.php b/libraries/fof/model/dispatcher/behavior.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/field.php b/libraries/fof/model/field.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/field/boolean.php b/libraries/fof/model/field/boolean.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/field/date.php b/libraries/fof/model/field/date.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/field/number.php b/libraries/fof/model/field/number.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/field/text.php b/libraries/fof/model/field/text.php old mode 100755 new mode 100644 diff --git a/libraries/fof/model/model.php b/libraries/fof/model/model.php old mode 100755 new mode 100644 diff --git a/libraries/fof/platform/filesystem/filesystem.php b/libraries/fof/platform/filesystem/filesystem.php old mode 100755 new mode 100644 diff --git a/libraries/fof/platform/filesystem/interface.php b/libraries/fof/platform/filesystem/interface.php old mode 100755 new mode 100644 diff --git a/libraries/fof/platform/interface.php b/libraries/fof/platform/interface.php old mode 100755 new mode 100644 diff --git a/libraries/fof/platform/platform.php b/libraries/fof/platform/platform.php old mode 100755 new mode 100644 diff --git a/libraries/fof/query/abstract.php b/libraries/fof/query/abstract.php old mode 100755 new mode 100644 diff --git a/libraries/fof/render/abstract.php b/libraries/fof/render/abstract.php old mode 100755 new mode 100644 diff --git a/libraries/fof/render/joomla.php b/libraries/fof/render/joomla.php old mode 100755 new mode 100644 diff --git a/libraries/fof/render/joomla3.php b/libraries/fof/render/joomla3.php old mode 100755 new mode 100644 diff --git a/libraries/fof/render/strapper.php b/libraries/fof/render/strapper.php old mode 100755 new mode 100644 diff --git a/libraries/fof/string/utils.php b/libraries/fof/string/utils.php old mode 100755 new mode 100644 diff --git a/libraries/fof/table/behavior.php b/libraries/fof/table/behavior.php old mode 100755 new mode 100644 diff --git a/libraries/fof/table/behavior/assets.php b/libraries/fof/table/behavior/assets.php old mode 100755 new mode 100644 diff --git a/libraries/fof/table/behavior/contenthistory.php b/libraries/fof/table/behavior/contenthistory.php old mode 100755 new mode 100644 diff --git a/libraries/fof/table/behavior/tags.php b/libraries/fof/table/behavior/tags.php old mode 100755 new mode 100644 diff --git a/libraries/fof/table/dispatcher/behavior.php b/libraries/fof/table/dispatcher/behavior.php old mode 100755 new mode 100644 diff --git a/libraries/fof/table/nested.php b/libraries/fof/table/nested.php old mode 100755 new mode 100644 diff --git a/libraries/fof/table/relations.php b/libraries/fof/table/relations.php old mode 100755 new mode 100644 diff --git a/libraries/fof/table/table.php b/libraries/fof/table/table.php old mode 100755 new mode 100644 diff --git a/libraries/fof/template/utils.php b/libraries/fof/template/utils.php old mode 100755 new mode 100644 diff --git a/libraries/fof/toolbar/toolbar.php b/libraries/fof/toolbar/toolbar.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/array/array.php b/libraries/fof/utils/array/array.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/cache/cleaner.php b/libraries/fof/utils/cache/cleaner.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/filescheck/filescheck.php b/libraries/fof/utils/filescheck/filescheck.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/installscript/installscript.php b/libraries/fof/utils/installscript/installscript.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/ip/ip.php b/libraries/fof/utils/ip/ip.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/object/object.php b/libraries/fof/utils/object/object.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/observable/dispatcher.php b/libraries/fof/utils/observable/dispatcher.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/observable/event.php b/libraries/fof/utils/observable/event.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/timer/timer.php b/libraries/fof/utils/timer/timer.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/update/collection.php b/libraries/fof/utils/update/collection.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/update/extension.php b/libraries/fof/utils/update/extension.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/update/joomla.php b/libraries/fof/utils/update/joomla.php old mode 100755 new mode 100644 diff --git a/libraries/fof/utils/update/update.php b/libraries/fof/utils/update/update.php old mode 100755 new mode 100644 diff --git a/libraries/fof/version.txt b/libraries/fof/version.txt old mode 100755 new mode 100644 diff --git a/libraries/fof/view/csv.php b/libraries/fof/view/csv.php old mode 100755 new mode 100644 diff --git a/libraries/fof/view/form.php b/libraries/fof/view/form.php old mode 100755 new mode 100644 diff --git a/libraries/fof/view/html.php b/libraries/fof/view/html.php old mode 100755 new mode 100644 diff --git a/libraries/fof/view/json.php b/libraries/fof/view/json.php old mode 100755 new mode 100644 diff --git a/libraries/fof/view/raw.php b/libraries/fof/view/raw.php old mode 100755 new mode 100644 diff --git a/libraries/fof/view/view.php b/libraries/fof/view/view.php old mode 100755 new mode 100644 From b5e113433b1ee44db197314cae4cc1ef77db011d Mon Sep 17 00:00:00 2001 From: "Nicholas K. Dionysopoulos" Date: Wed, 11 Mar 2015 13:24:01 +0200 Subject: [PATCH 072/809] Try to make GitHub happy --- .../fof/utils/installscript/installscript.php | 70 ------------------- 1 file changed, 70 deletions(-) diff --git a/libraries/fof/utils/installscript/installscript.php b/libraries/fof/utils/installscript/installscript.php index d97479cef2101..f17f9df91de8f 100644 --- a/libraries/fof/utils/installscript/installscript.php +++ b/libraries/fof/utils/installscript/installscript.php @@ -779,76 +779,6 @@ protected function bugfixCantBuildAdminMenus() } } } - - // Remove #__menu records for good measure! –– I think this is not necessary and causes the menu item to - // disappear on extension update. - /** - $query = $db->getQuery(true); - $query->select('id') - ->from('#__menu') - ->where($db->qn('type') . ' = ' . $db->q('component')) - ->where($db->qn('menutype') . ' = ' . $db->q('main')) - ->where($db->qn('link') . ' LIKE ' . $db->q('index.php?option=' . $this->componentName)); - $db->setQuery($query); - - try - { - $ids1 = $db->loadColumn(); - } - catch (Exception $exc) - { - $ids1 = array(); - } - - if (empty($ids1)) - { - $ids1 = array(); - } - - $query = $db->getQuery(true); - $query->select('id') - ->from('#__menu') - ->where($db->qn('type') . ' = ' . $db->q('component')) - ->where($db->qn('menutype') . ' = ' . $db->q('main')) - ->where($db->qn('link') . ' LIKE ' . $db->q('index.php?option=' . $this->componentName . '&%')); - $db->setQuery($query); - - try - { - $ids2 = $db->loadColumn(); - } - catch (Exception $exc) - { - $ids2 = array(); - } - - if (empty($ids2)) - { - $ids2 = array(); - } - - $ids = array_merge($ids1, $ids2); - - if (!empty($ids)) - { - foreach ($ids as $id) - { - $query = $db->getQuery(true); - $query->delete('#__menu') - ->where($db->qn('id') . ' = ' . $db->q($id)); - $db->setQuery($query); - - try - { - $db->execute(); - } - catch (Exception $exc) - { - // Nothing - } - } - } - /**/ } /** From 4dc7415ff0fe834eb3513ae403a3dbd03335c46d Mon Sep 17 00:00:00 2001 From: MarkRS-UK Date: Wed, 11 Mar 2015 16:32:57 +0000 Subject: [PATCH 073/809] Correct tag matching in truncate String truncate doesn't correctly match closing html tags that contain numbers. This change corrects this. Fixes #6149 --- libraries/cms/html/string.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/cms/html/string.php b/libraries/cms/html/string.php index 7f7653218422f..37c4257bde0da 100644 --- a/libraries/cms/html/string.php +++ b/libraries/cms/html/string.php @@ -97,7 +97,7 @@ public static function truncate($text, $length = 0, $noSplit = true, $allowHtml $openedTags = array_values($openedTags); // Put all closed tags into an array - preg_match_all("##iU", $tmp, $result); + preg_match_all("#]*?)>#iU", $tmp, $result); $closedTags = $result[1]; $numOpened = count($openedTags); From e2a97fd7d7e86b74d8421e36123b8f877e78138f Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Wed, 11 Mar 2015 12:51:01 -0400 Subject: [PATCH 074/809] Remove attempt to translate messages while in debug mode --- libraries/joomla/language/language.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libraries/joomla/language/language.php b/libraries/joomla/language/language.php index 9e86e13ddc84d..14ddd707fdbba 100644 --- a/libraries/joomla/language/language.php +++ b/libraries/joomla/language/language.php @@ -923,14 +923,7 @@ protected function parse($filename) // Check if we encountered any errors. if (count($errors)) { - if (basename($filename) != $this->lang . '.ini') - { - $this->errorfiles[$filename] = $filename . JText::sprintf('JERROR_PARSING_LANGUAGE_FILE', implode(', ', $errors)); - } - else - { - $this->errorfiles[$filename] = $filename . ' : error(s) in line(s) ' . implode(', ', $errors); - } + $this->errorfiles[$filename] = $filename . ' : error(s) in line(s) ' . implode(', ', $errors); } elseif ($php_errormsg) { From 335d31db8cc46f5dbd3582d7092e1ad503f84b09 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Wed, 11 Mar 2015 20:25:51 +0000 Subject: [PATCH 075/809] Update web.config.txt --- web.config.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/web.config.txt b/web.config.txt index 773cdbf75586a..ba448ebc3534c 100644 --- a/web.config.txt +++ b/web.config.txt @@ -27,4 +27,5 @@ + From 0349f4bd89c082973c64e7db839aa45932cab5bf Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 11 Mar 2015 22:25:15 +0100 Subject: [PATCH 076/809] Allow the language to be overriden via a query variable --- .../system/languagefilter/languagefilter.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/plugins/system/languagefilter/languagefilter.php b/plugins/system/languagefilter/languagefilter.php index 883802c6a8a3c..04c5869664277 100644 --- a/plugins/system/languagefilter/languagefilter.php +++ b/plugins/system/languagefilter/languagefilter.php @@ -271,17 +271,14 @@ public function parseRule(&$router, &$uri) } } } - else - { - // We are not in SEF mode - $lang = $uri->getVar('lang'); + // We are not in SEF mode + $lang = $uri->getVar('lang', $lang_code); - if (isset($this->sefs[$lang])) - { - // We found our language - $found = true; - $lang_code = $this->sefs[$lang]->lang_code; - } + if (isset($this->sefs[$lang])) + { + // We found our language + $found = true; + $lang_code = $this->sefs[$lang]->lang_code; } // We are called via POST. We don't care about the language From 8cb1308c8eaafde3b9d87d2bfb5360e9cd2f63d5 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 11 Mar 2015 22:38:07 +0100 Subject: [PATCH 077/809] Checking if the lang_code was already set in POST --- plugins/system/languagefilter/languagefilter.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/system/languagefilter/languagefilter.php b/plugins/system/languagefilter/languagefilter.php index 883802c6a8a3c..453652f1f276f 100644 --- a/plugins/system/languagefilter/languagefilter.php +++ b/plugins/system/languagefilter/languagefilter.php @@ -291,7 +291,11 @@ public function parseRule(&$router, &$uri) || count($this->app->input->files) > 0) { $found = true; - $lang_code = $this->app->input->cookie->getString(JApplicationHelper::getHash('language')); + + if (!$lang_code) + { + $lang_code = $this->app->input->cookie->getString(JApplicationHelper::getHash('language')); + } if ($this->params->get('detect_browser', 1) && !$lang_code) { From 9ebb9f353a5ada6a43f3cf6e2ff7f7cb86e9921f Mon Sep 17 00:00:00 2001 From: zero-24 Date: Thu, 12 Mar 2015 13:42:55 +0100 Subject: [PATCH 078/809] Update script.php --- administrator/components/com_admin/script.php | 219 ++++++++++-------- 1 file changed, 118 insertions(+), 101 deletions(-) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 444d1390b5c0d..d86455fe94d35 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -21,12 +21,13 @@ class JoomlaInstallerScript * * @param JInstallerFile $installer The class calling this method * - * @return void + * @return void */ public function update($installer) { - $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; + $options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}'; $options['text_file'] = 'joomla_update.php'; + JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror')); JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES'), JLog::INFO, 'Update'); @@ -49,14 +50,11 @@ protected function updateDatabase() if (substr($db->name, 0, 5) == 'mysql') { $db->setQuery('SHOW ENGINES'); + $results = $db->loadObjectList(); - try - { - $results = $db->loadObjectList(); - } - catch (Exception $e) + if ($db->getErrorNum()) { - echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '
                  '; + echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()) . '
                  '; return; } @@ -66,14 +64,11 @@ protected function updateDatabase() if ($result->Support == 'DEFAULT') { $db->setQuery('ALTER TABLE #__update_sites_extensions ENGINE = ' . $result->Engine); + $db->execute(); - try + if ($db->getErrorNum()) { - $db->execute(); - } - catch (Exception $e) - { - echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '
                  '; + echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()) . '
                  '; return; } @@ -82,28 +77,6 @@ protected function updateDatabase() } } } - - // Check if the 2.5 EOS plugin is present and uninstall it if so - $id = $db->setQuery( - $db->getQuery(true) - ->select('extension_id') - ->from('#__extensions') - ->where('name = ' . $db->quote('PLG_EOSNOTIFY')) - )->loadResult(); - - if ($id) - { - // We need to unprotect the plugin so we can uninstall it - $db->setQuery( - $db->getQuery(true) - ->update('#__extensions') - ->set('protected = 0') - ->where($db->quoteName('extension_id') . ' = ' . $id) - )->execute(); - - $installer = new JInstaller; - $installer->uninstall('plugin', $id); - } } /** @@ -245,7 +218,6 @@ protected function updateManifestCaches() $extensions[] = array('plugin', 'tags', 'finder', 0); $extensions[] = array('plugin', 'totp', 'twofactorauth', 0); $extensions[] = array('plugin', 'yubikey', 'twofactorauth', 0); - $extensions[] = array('plugin', 'nocaptcha', 'captcha', 0); // Templates $extensions[] = array('template', 'beez3', '', 0); @@ -280,20 +252,17 @@ protected function updateManifestCaches() } $db->setQuery($query); + $extensions = $db->loadObjectList(); + $installer = new JInstaller; - try + // Check for a database error. + if ($db->getErrorNum()) { - $extensions = $db->loadObjectList(); - } - catch (Exception $e) - { - echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '
                  '; + echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()) . '
                  '; return; } - $installer = new JInstaller; - foreach ($extensions as $extension) { if (!$installer->refreshManifestCache($extension->extension_id)) @@ -1055,11 +1024,7 @@ public function deleteUnexistingFiles() '/libraries/joomla/registry/format/php.php', '/libraries/joomla/registry/format/xml.php', // Joomla! 3.4 - '/administrator/components/com_tags/helpers/html/index.html', - '/administrator/components/com_tags/models/fields/index.html', '/administrator/manifests/libraries/phpmailer.xml', - '/administrator/templates/hathor/html/com_finder/filter/index.html', - '/administrator/templates/hathor/html/com_finder/statistics/index.html', '/components/com_contact/helpers/icon.php', '/language/en-GB/en-GB.lib_phpmailer.sys.ini', '/libraries/compat/jsonserializable.php', @@ -1069,29 +1034,6 @@ public function deleteUnexistingFiles() '/libraries/compat/password/index.html', '/libraries/compat/password/LICENSE.md', '/libraries/compat/index.html', - '/libraries/fof/controller.php', - '/libraries/fof/dispatcher.php', - '/libraries/fof/inflector.php', - '/libraries/fof/input.php', - '/libraries/fof/model.php', - '/libraries/fof/query.abstract.php', - '/libraries/fof/query.element.php', - '/libraries/fof/query.mysql.php', - '/libraries/fof/query.mysqli.php', - '/libraries/fof/query.sqlazure.php', - '/libraries/fof/query.sqlsrv.php', - '/libraries/fof/render.abstract.php', - '/libraries/fof/render.joomla.php', - '/libraries/fof/render.joomla3.php', - '/libraries/fof/render.strapper.php', - '/libraries/fof/string.utils.php', - '/libraries/fof/table.php', - '/libraries/fof/template.utils.php', - '/libraries/fof/toolbar.php', - '/libraries/fof/view.csv.php', - '/libraries/fof/view.html.php', - '/libraries/fof/view.json.php', - '/libraries/fof/view.php', '/libraries/framework/Joomla/Application/Cli/Output/Processor/ColorProcessor.php', '/libraries/framework/Joomla/Application/Cli/Output/Processor/ProcessorInterface.php', '/libraries/framework/Joomla/Application/Cli/Output/Stdout.php', @@ -1137,29 +1079,107 @@ public function deleteUnexistingFiles() '/libraries/phpmailer/phpmailer.php', '/libraries/phpmailer/pop.php', '/libraries/phpmailer/smtp.php', - '/media/editors/codemirror/css/ambiance.css', - '/media/editors/codemirror/css/codemirror.css', - '/media/editors/codemirror/css/configuration.css', - '/media/editors/codemirror/css/index.html', - '/media/editors/codemirror/js/brace-fold.js', - '/media/editors/codemirror/js/clike.js', - '/media/editors/codemirror/js/closebrackets.js', - '/media/editors/codemirror/js/closetag.js', - '/media/editors/codemirror/js/codemirror.js', - '/media/editors/codemirror/js/css.js', - '/media/editors/codemirror/js/foldcode.js', - '/media/editors/codemirror/js/foldgutter.js', - '/media/editors/codemirror/js/fullscreen.js', - '/media/editors/codemirror/js/htmlmixed.js', - '/media/editors/codemirror/js/indent-fold.js', - '/media/editors/codemirror/js/index.html', - '/media/editors/codemirror/js/javascript.js', - '/media/editors/codemirror/js/less.js', - '/media/editors/codemirror/js/matchbrackets.js', - '/media/editors/codemirror/js/matchtags.js', - '/media/editors/codemirror/js/php.js', - '/media/editors/codemirror/js/xml-fold.js', - '/media/editors/codemirror/js/xml.js', + '/libraries/joomla/environment/request.php', + '/media/editors/tinymce/templates/template_list.js', + '/administrator/help/en-GB/Components_Banners_Banners.html', + '/administrator/help/en-GB/Components_Banners_Banners_Edit.html', + '/administrator/help/en-GB/Components_Banners_Categories.html', + '/administrator/help/en-GB/Components_Banners_Category_Edit.html', + '/administrator/help/en-GB/Components_Banners_Clients.html', + '/administrator/help/en-GB/Components_Banners_Clients_Edit.html', + '/administrator/help/en-GB/Components_Banners_Tracks.html', + '/administrator/help/en-GB/Components_Contact_Categories.html', + '/administrator/help/en-GB/Components_Contact_Category_Edit.html', + '/administrator/help/en-GB/Components_Contacts_Contacts.html', + '/administrator/help/en-GB/Components_Contacts_Contacts_Edit.html', + '/administrator/help/en-GB/Components_Content_Categories.html', + '/administrator/help/en-GB/Components_Content_Category_Edit.html', + '/administrator/help/en-GB/Components_Messaging_Inbox.html', + '/administrator/help/en-GB/Components_Messaging_Read.html', + '/administrator/help/en-GB/Components_Messaging_Write.html', + '/administrator/help/en-GB/Components_Newsfeeds_Categories.html', + '/administrator/help/en-GB/Components_Newsfeeds_Category_Edit.html', + '/administrator/help/en-GB/Components_Newsfeeds_Feeds.html', + '/administrator/help/en-GB/Components_Newsfeeds_Feeds_Edit.html', + '/administrator/help/en-GB/Components_Redirect_Manager.html', + '/administrator/help/en-GB/Components_Redirect_Manager_Edit.html', + '/administrator/help/en-GB/Components_Search.html', + '/administrator/help/en-GB/Components_Weblinks_Categories.html', + '/administrator/help/en-GB/Components_Weblinks_Category_Edit.html', + '/administrator/help/en-GB/Components_Weblinks_Links.html', + '/administrator/help/en-GB/Components_Weblinks_Links_Edit.html', + '/administrator/help/en-GB/Content_Article_Manager.html', + '/administrator/help/en-GB/Content_Article_Manager_Edit.html', + '/administrator/help/en-GB/Content_Featured_Articles.html', + '/administrator/help/en-GB/Content_Media_Manager.html', + '/administrator/help/en-GB/Extensions_Extension_Manager_Discover.html', + '/administrator/help/en-GB/Extensions_Extension_Manager_Install.html', + '/administrator/help/en-GB/Extensions_Extension_Manager_Manage.html', + '/administrator/help/en-GB/Extensions_Extension_Manager_Update.html', + '/administrator/help/en-GB/Extensions_Extension_Manager_Warnings.html', + '/administrator/help/en-GB/Extensions_Language_Manager_Content.html', + '/administrator/help/en-GB/Extensions_Language_Manager_Edit.html', + '/administrator/help/en-GB/Extensions_Language_Manager_Installed.html', + '/administrator/help/en-GB/Extensions_Module_Manager.html', + '/administrator/help/en-GB/Extensions_Module_Manager_Edit.html', + '/administrator/help/en-GB/Extensions_Plugin_Manager.html', + '/administrator/help/en-GB/Extensions_Plugin_Manager_Edit.html', + '/administrator/help/en-GB/Extensions_Template_Manager_Styles.html', + '/administrator/help/en-GB/Extensions_Template_Manager_Styles_Edit.html', + '/administrator/help/en-GB/Extensions_Template_Manager_Templates.html', + '/administrator/help/en-GB/Extensions_Template_Manager_Templates_Edit.html', + '/administrator/help/en-GB/Extensions_Template_Manager_Templates_Edit_Source.html', + '/administrator/help/en-GB/Glossary.html', + '/administrator/help/en-GB/Menus_Menu_Item_Manager.html', + '/administrator/help/en-GB/Menus_Menu_Item_Manager_Edit.html', + '/administrator/help/en-GB/Menus_Menu_Manager.html', + '/administrator/help/en-GB/Menus_Menu_Manager_Edit.html', + '/administrator/help/en-GB/Site_Global_Configuration.html', + '/administrator/help/en-GB/Site_Maintenance_Clear_Cache.html', + '/administrator/help/en-GB/Site_Maintenance_Global_Check-in.html', + '/administrator/help/en-GB/Site_Maintenance_Purge_Expired_Cache.html', + '/administrator/help/en-GB/Site_System_Information.html', + '/administrator/help/en-GB/Start_Here.html', + '/administrator/help/en-GB/Users_Access_Levels.html', + '/administrator/help/en-GB/Users_Access_Levels_Edit.html', + '/administrator/help/en-GB/Users_Debug_Users.html', + '/administrator/help/en-GB/Users_Groups.html', + '/administrator/help/en-GB/Users_Groups_Edit.html', + '/administrator/help/en-GB/Users_Mass_Mail_Users.html', + '/administrator/help/en-GB/Users_User_Manager.html', + '/administrator/help/en-GB/Users_User_Manager_Edit.html', + '/administrator/components/com_config/views/index.html', + '/administrator/components/com_config/views/application/index.html', + '/administrator/components/com_config/views/application/view.html.php', + '/administrator/components/com_config/views/application/tmpl/default.php', + '/administrator/components/com_config/views/application/tmpl/default_cache.php', + '/administrator/components/com_config/views/application/tmpl/default_cookie.php', + '/administrator/components/com_config/views/application/tmpl/default_database.php', + '/administrator/components/com_config/views/application/tmpl/default_debug.php', + '/administrator/components/com_config/views/application/tmpl/default_filters.php', + '/administrator/components/com_config/views/application/tmpl/default_ftp.php', + '/administrator/components/com_config/views/application/tmpl/default_ftplogin.php', + '/administrator/components/com_config/views/application/tmpl/default_locale.php', + '/administrator/components/com_config/views/application/tmpl/default_mail.php', + '/administrator/components/com_config/views/application/tmpl/default_metadata.php', + '/administrator/components/com_config/views/application/tmpl/default_navigation.php', + '/administrator/components/com_config/views/application/tmpl/default_permissions.php', + '/administrator/components/com_config/views/application/tmpl/default_seo.php', + '/administrator/components/com_config/views/application/tmpl/default_server.php', + '/administrator/components/com_config/views/application/tmpl/default_session.php', + '/administrator/components/com_config/views/application/tmpl/default_site.php', + '/administrator/components/com_config/views/application/tmpl/default_system.php', + '/administrator/components/com_config/views/application/tmpl/index.html', + '/administrator/components/com_config/views/close/index.html', + '/administrator/components/com_config/views/close/view.html.php', + '/administrator/components/com_config/views/component/index.html', + '/administrator/components/com_config/views/component/view.html.php', + '/administrator/components/com_config/views/component/tmpl/default.php', + '/administrator/components/com_config/views/component/tmpl/index.html', + '/administrator/components/com_config/models/fields/filters.php', + '/administrator/components/com_config/models/fields/index.html', + '/administrator/components/com_config/models/forms/application.xml', + '/administrator/components/com_config/models/forms/index.html', ); // TODO There is an issue while deleting folders using the ftp mode @@ -1218,10 +1238,6 @@ public function deleteUnexistingFiles() '/libraries/joomla/registry/format', '/libraries/joomla/registry', // Joomla! 3.4 - '/administrator/components/com_tags/helpers/html', - '/administrator/components/com_tags/models/fields', - '/administrator/templates/hathor/html/com_finder/filter', - '/administrator/templates/hathor/html/com_finder/statistics', '/libraries/compat/password/lib', '/libraries/compat/password', '/libraries/compat', @@ -1239,8 +1255,9 @@ public function deleteUnexistingFiles() '/libraries/framework', '/libraries/phpmailer/language', '/libraries/phpmailer', - '/media/editors/codemirror/css', - '/media/editors/codemirror/js', + '/administrator/components/com_config/views', + '/administrator/components/com_config/models/fields', + '/administrator/components/com_config/models/forms', ); jimport('joomla.filesystem.file'); From 400bb8605f43e21829c351f95f124ed01a085c95 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Thu, 12 Mar 2015 13:48:26 +0100 Subject: [PATCH 079/809] Update script.php --- administrator/components/com_admin/script.php | 114 ++++++++++++++++-- 1 file changed, 102 insertions(+), 12 deletions(-) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index d86455fe94d35..807b67aceeb0c 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -21,7 +21,7 @@ class JoomlaInstallerScript * * @param JInstallerFile $installer The class calling this method * - * @return void + * @return void */ public function update($installer) { @@ -50,11 +50,14 @@ protected function updateDatabase() if (substr($db->name, 0, 5) == 'mysql') { $db->setQuery('SHOW ENGINES'); - $results = $db->loadObjectList(); - if ($db->getErrorNum()) + try + { + $results = $db->loadObjectList(); + } + catch (Exception $e) { - echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()) . '
                  '; + echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '
                  '; return; } @@ -64,11 +67,14 @@ protected function updateDatabase() if ($result->Support == 'DEFAULT') { $db->setQuery('ALTER TABLE #__update_sites_extensions ENGINE = ' . $result->Engine); - $db->execute(); - if ($db->getErrorNum()) + try { - echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()) . '
                  '; + $db->execute(); + } + catch (Exception $e) + { + echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '
                  '; return; } @@ -77,6 +83,28 @@ protected function updateDatabase() } } } + + // Check if the 2.5 EOS plugin is present and uninstall it if so + $id = $db->setQuery( + $db->getQuery(true) + ->select('extension_id') + ->from('#__extensions') + ->where('name = ' . $db->quote('PLG_EOSNOTIFY')) + )->loadResult(); + + if ($id) + { + // We need to unprotect the plugin so we can uninstall it + $db->setQuery( + $db->getQuery(true) + ->update('#__extensions') + ->set('protected = 0') + ->where($db->quoteName('extension_id') . ' = ' . $id) + )->execute(); + + $installer = new JInstaller; + $installer->uninstall('plugin', $id); + } } /** @@ -218,6 +246,7 @@ protected function updateManifestCaches() $extensions[] = array('plugin', 'tags', 'finder', 0); $extensions[] = array('plugin', 'totp', 'twofactorauth', 0); $extensions[] = array('plugin', 'yubikey', 'twofactorauth', 0); + $extensions[] = array('plugin', 'nocaptcha', 'captcha', 0); // Templates $extensions[] = array('template', 'beez3', '', 0); @@ -252,17 +281,20 @@ protected function updateManifestCaches() } $db->setQuery($query); - $extensions = $db->loadObjectList(); - $installer = new JInstaller; - // Check for a database error. - if ($db->getErrorNum()) + try { - echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $db->getErrorNum(), $db->getErrorMsg()) . '
                  '; + $extensions = $db->loadObjectList(); + } + catch (Exception $e) + { + echo JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '
                  '; return; } + $installer = new JInstaller; + foreach ($extensions as $extension) { if (!$installer->refreshManifestCache($extension->extension_id)) @@ -1024,7 +1056,11 @@ public function deleteUnexistingFiles() '/libraries/joomla/registry/format/php.php', '/libraries/joomla/registry/format/xml.php', // Joomla! 3.4 + '/administrator/components/com_tags/helpers/html/index.html', + '/administrator/components/com_tags/models/fields/index.html', '/administrator/manifests/libraries/phpmailer.xml', + '/administrator/templates/hathor/html/com_finder/filter/index.html', + '/administrator/templates/hathor/html/com_finder/statistics/index.html', '/components/com_contact/helpers/icon.php', '/language/en-GB/en-GB.lib_phpmailer.sys.ini', '/libraries/compat/jsonserializable.php', @@ -1034,6 +1070,29 @@ public function deleteUnexistingFiles() '/libraries/compat/password/index.html', '/libraries/compat/password/LICENSE.md', '/libraries/compat/index.html', + '/libraries/fof/controller.php', + '/libraries/fof/dispatcher.php', + '/libraries/fof/inflector.php', + '/libraries/fof/input.php', + '/libraries/fof/model.php', + '/libraries/fof/query.abstract.php', + '/libraries/fof/query.element.php', + '/libraries/fof/query.mysql.php', + '/libraries/fof/query.mysqli.php', + '/libraries/fof/query.sqlazure.php', + '/libraries/fof/query.sqlsrv.php', + '/libraries/fof/render.abstract.php', + '/libraries/fof/render.joomla.php', + '/libraries/fof/render.joomla3.php', + '/libraries/fof/render.strapper.php', + '/libraries/fof/string.utils.php', + '/libraries/fof/table.php', + '/libraries/fof/template.utils.php', + '/libraries/fof/toolbar.php', + '/libraries/fof/view.csv.php', + '/libraries/fof/view.html.php', + '/libraries/fof/view.json.php', + '/libraries/fof/view.php', '/libraries/framework/Joomla/Application/Cli/Output/Processor/ColorProcessor.php', '/libraries/framework/Joomla/Application/Cli/Output/Processor/ProcessorInterface.php', '/libraries/framework/Joomla/Application/Cli/Output/Stdout.php', @@ -1079,6 +1138,30 @@ public function deleteUnexistingFiles() '/libraries/phpmailer/phpmailer.php', '/libraries/phpmailer/pop.php', '/libraries/phpmailer/smtp.php', + '/media/editors/codemirror/css/ambiance.css', + '/media/editors/codemirror/css/codemirror.css', + '/media/editors/codemirror/css/configuration.css', + '/media/editors/codemirror/css/index.html', + '/media/editors/codemirror/js/brace-fold.js', + '/media/editors/codemirror/js/clike.js', + '/media/editors/codemirror/js/closebrackets.js', + '/media/editors/codemirror/js/closetag.js', + '/media/editors/codemirror/js/codemirror.js', + '/media/editors/codemirror/js/css.js', + '/media/editors/codemirror/js/foldcode.js', + '/media/editors/codemirror/js/foldgutter.js', + '/media/editors/codemirror/js/fullscreen.js', + '/media/editors/codemirror/js/htmlmixed.js', + '/media/editors/codemirror/js/indent-fold.js', + '/media/editors/codemirror/js/index.html', + '/media/editors/codemirror/js/javascript.js', + '/media/editors/codemirror/js/less.js', + '/media/editors/codemirror/js/matchbrackets.js', + '/media/editors/codemirror/js/matchtags.js', + '/media/editors/codemirror/js/php.js', + '/media/editors/codemirror/js/xml-fold.js', + '/media/editors/codemirror/js/xml.js', + // Joomla! 3.4.1 '/libraries/joomla/environment/request.php', '/media/editors/tinymce/templates/template_list.js', '/administrator/help/en-GB/Components_Banners_Banners.html', @@ -1238,6 +1321,10 @@ public function deleteUnexistingFiles() '/libraries/joomla/registry/format', '/libraries/joomla/registry', // Joomla! 3.4 + '/administrator/components/com_tags/helpers/html', + '/administrator/components/com_tags/models/fields', + '/administrator/templates/hathor/html/com_finder/filter', + '/administrator/templates/hathor/html/com_finder/statistics', '/libraries/compat/password/lib', '/libraries/compat/password', '/libraries/compat', @@ -1255,6 +1342,9 @@ public function deleteUnexistingFiles() '/libraries/framework', '/libraries/phpmailer/language', '/libraries/phpmailer', + '/media/editors/codemirror/css', + '/media/editors/codemirror/js', + // Joomla! 3.4.1 '/administrator/components/com_config/views', '/administrator/components/com_config/models/fields', '/administrator/components/com_config/models/forms', From 39a388541adb7b99b8fcbe52617454709ed148a6 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Thu, 12 Mar 2015 14:26:28 +0100 Subject: [PATCH 080/809] w3c validation error input type file and value Redo: https://github.com/joomla/joomla-cms/pull/4024 See: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=34008&start=0 and http://www.w3.org/TR/html-markup/input.file.html --- libraries/joomla/form/fields/file.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/joomla/form/fields/file.php b/libraries/joomla/form/fields/file.php index bce031b26e6c1..a5fdd05c77366 100644 --- a/libraries/joomla/form/fields/file.php +++ b/libraries/joomla/form/fields/file.php @@ -132,7 +132,7 @@ protected function getInput() JHtml::_('jquery.framework'); JHtml::_('script', 'system/html5fallback.js', false, true); - return ''; } } From 52b9e06a7cb747a340ceb51c3505ff8a93c3ccd3 Mon Sep 17 00:00:00 2001 From: Mathew Lenning Date: Fri, 13 Mar 2015 00:35:53 +0900 Subject: [PATCH 081/809] Wrong table used to getErrors While working on the com_config MVSC rebuild I noticed that the wrong table is being used on line 148 to get the error messages from if checks fail on the asset table. =^D --- administrator/components/com_config/model/component.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_config/model/component.php b/administrator/components/com_config/model/component.php index fb8c92a7a0052..eb1d3e7f7f635 100644 --- a/administrator/components/com_config/model/component.php +++ b/administrator/components/com_config/model/component.php @@ -145,7 +145,7 @@ public function save($data) if (!$asset->check() || !$asset->store()) { - throw new RuntimeException($table->getError()); + throw new RuntimeException($asset->getError()); } // We don't need this anymore From bc868e6b9c2ee7fecec10224de21e6a20baaf03f Mon Sep 17 00:00:00 2001 From: Constantin Romankiewicz Date: Thu, 12 Mar 2015 10:37:50 +0100 Subject: [PATCH 082/809] Fix sidebar issue with debug console. Fixes #5976. Fixes #6401 Change the order of declarations to fix #5976 + some small code style changes Fixed wrong order, thanks @JoomIIC! Codestyle Coding standards v2 --- administrator/templates/isis/js/template.js | 101 +++++++++++--------- 1 file changed, 54 insertions(+), 47 deletions(-) diff --git a/administrator/templates/isis/js/template.js b/administrator/templates/isis/js/template.js index 2c17c48149c8d..a897e566610f8 100644 --- a/administrator/templates/isis/js/template.js +++ b/administrator/templates/isis/js/template.js @@ -62,70 +62,77 @@ { var context = 'jsidebar'; - var $visible = $('#j-toggle-sidebar').is(":visible"); + var $sidebar = $('#j-sidebar-container'), + $main = $('#j-main-container'), + $message = $('#system-message-container'), + $debug = $('#system-debug'), + $toggleSidebarIcon = $('#j-toggle-sidebar-icon'), + $toggleButtonWrapper = $('#j-toggle-button-wrapper'), + $toggleButton = $('#j-toggle-sidebar-button'), + $sidebarToggle = $('#j-toggle-sidebar'); - var $sidebar = $('#j-sidebar-container'); + var openIcon = 'icon-arrow-left-2', + closedIcon = 'icon-arrow-right-2'; - var open_icon = 'icon-arrow-left-2'; - var closed_icon = 'icon-arrow-right-2'; + var $visible = $sidebarToggle.is(":visible"); if (jQuery(document.querySelector("html")).attr('dir') == 'rtl') { - open_icon = 'icon-arrow-right-2'; - closed_icon = 'icon-arrow-left-2'; + openIcon = 'icon-arrow-right-2'; + closedIcon = 'icon-arrow-left-2'; } - var main_height = $('#j-main-container').outerHeight()+30; - var sidebar_height = $('#j-sidebar-container').outerHeight(); - - var body_width = $('body').outerWidth(); - var sidebar_width = $sidebar.outerWidth(); - var content_width = $('#content').outerWidth(); var isComponent = $('body').hasClass('component'); - var this_content = content_width / body_width * 100; - var this_main = (content_width - sidebar_width) / body_width * 100; - $('#j-sidebar-container').removeClass('span2').addClass('j-sidebar-container'); - $('#system-message-container').addClass('j-toggle-main'); - $('#j-main-container').addClass('j-toggle-main'); + $sidebar.removeClass('span2').addClass('j-sidebar-container'); + $message.addClass('j-toggle-main'); + $main.addClass('j-toggle-main'); if (!isComponent) { - $('#system-debug').addClass('j-toggle-main'); + $debug.addClass('j-toggle-main'); } + var mainHeight = $main.outerHeight()+30, + sidebarHeight = $sidebar.outerHeight(), + bodyWidth = $('body').outerWidth(), + sidebarWidth = $sidebar.outerWidth(), + contentWidth = $('#content').outerWidth(), + contentWidthRelative = contentWidth / bodyWidth * 100, + mainWidthRelative = (contentWidth - sidebarWidth) / bodyWidth * 100; + if (force) { // Load the value from localStorage if (typeof(Storage) !== "undefined") { - var $visible = localStorage.getItem(context); + $visible = localStorage.getItem(context); } // Need to convert the value to a boolean - $visible = ($visible == 'true') ? true : false; + $visible = ($visible == 'true'); } else { - $('#system-message-container').addClass('j-toggle-transition'); - $('#j-sidebar-container').addClass('j-toggle-transition'); - $('#j-toggle-button-wrapper').addClass('j-toggle-transition'); - $('#j-main-container').addClass('j-toggle-transition'); + $message.addClass('j-toggle-transition'); + $sidebar.addClass('j-toggle-transition'); + $toggleButtonWrapper.addClass('j-toggle-transition'); + $main.addClass('j-toggle-transition'); if (!isComponent) { - $('#system-debug').addClass('j-toggle-transition'); + $debug.addClass('j-toggle-transition'); } } if ($visible) { - $('#j-toggle-sidebar').hide(); - $('#j-sidebar-container').removeClass('j-sidebar-visible').addClass('j-sidebar-hidden'); - $('#j-toggle-button-wrapper').removeClass('j-toggle-visible').addClass('j-toggle-hidden'); - $('#j-toggle-sidebar-icon').removeClass('j-toggle-visible').addClass('j-toggle-hidden'); - $('#system-message-container').removeClass('span10').addClass('span12'); - $('#j-main-container').removeClass('span10').addClass('span12 expanded'); - $('#j-toggle-sidebar-icon').removeClass(open_icon).addClass(closed_icon); - $('#j-toggle-sidebar-button').attr('data-original-title', Joomla.JText._('JTOGGLE_SHOW_SIDEBAR')); + $sidebarToggle.hide(); + $sidebar.removeClass('j-sidebar-visible').addClass('j-sidebar-hidden'); + $toggleButtonWrapper.removeClass('j-toggle-visible').addClass('j-toggle-hidden'); + $toggleSidebarIcon.removeClass('j-toggle-visible').addClass('j-toggle-hidden'); + $message.removeClass('span10').addClass('span12'); + $main.removeClass('span10').addClass('span12 expanded'); + $toggleSidebarIcon.removeClass(openIcon).addClass(closedIcon); + $toggleButton.attr( 'data-original-title', Joomla.JText._('JTOGGLE_SHOW_SIDEBAR') ); if (!isComponent) { - $('#system-debug').css('width', this_content + '%'); + $debug.css( 'width', contentWidthRelative + '%' ); } if (typeof(Storage) !== "undefined") @@ -136,28 +143,28 @@ } else { - $('#j-toggle-sidebar').show(); - $('#j-sidebar-container').removeClass('j-sidebar-hidden').addClass('j-sidebar-visible'); - $('#j-toggle-button-wrapper').removeClass('j-toggle-hidden').addClass('j-toggle-visible'); - $('#j-toggle-sidebar-icon').removeClass('j-toggle-hidden').addClass('j-toggle-visible'); - $('#system-message-container').removeClass('span12').addClass('span10'); - $('#j-main-container').removeClass('span12 expanded').addClass('span10'); - $('#j-toggle-sidebar-icon').removeClass(closed_icon).addClass(open_icon); - $('#j-toggle-sidebar-button').attr('data-original-title', Joomla.JText._('JTOGGLE_HIDE_SIDEBAR')); - - if (!isComponent && body_width > 768 && main_height < sidebar_height) + $sidebarToggle.show(); + $sidebar.removeClass('j-sidebar-hidden').addClass('j-sidebar-visible'); + $toggleButtonWrapper.removeClass('j-toggle-hidden').addClass('j-toggle-visible'); + $toggleSidebarIcon.removeClass('j-toggle-hidden').addClass('j-toggle-visible'); + $message.removeClass('span12').addClass('span10'); + $main.removeClass('span12 expanded').addClass('span10'); + $toggleSidebarIcon.removeClass(closedIcon).addClass(openIcon); + $toggleButton.attr( 'data-original-title', Joomla.JText._('JTOGGLE_HIDE_SIDEBAR') ); + + if (!isComponent && bodyWidth > 768 && mainHeight < sidebarHeight) { - $('#system-debug').css('width', this_main+'%'); + $debug.css( 'width', mainWidthRelative + '%' ); } else if (!isComponent) { - $('#system-debug').css('width', this_content+'%'); + $debug.css( 'width', contentWidthRelative + '%' ); } if (typeof(Storage) !== "undefined") { // Set the last selection in localStorage - localStorage.setItem(context, false); + localStorage.setItem( context, false ); } } } From f4ede299068c1b5008f9bfcdb98cd43e9851cc49 Mon Sep 17 00:00:00 2001 From: bertmert Date: Wed, 11 Mar 2015 16:48:53 +0100 Subject: [PATCH 083/809] Language overrides. Search limited to 20 results. Fixes #6390. Fixes #6393 Fixes https://github.com/joomla/joomla-cms/issues/6390 Test instructions: 1) edit file /lanuage/en-GB/en-GB.mod_login.ini Add at least 30 new placeholders: MOD_LOGIN_VALUE_USERNAME1="Username" MOD_LOGIN_VALUE_USERNAME2="Username" MOD_LOGIN_VALUE_USERNAME3="Username" MOD_LOGIN_VALUE_USERNAME4="Username" MOD_LOGIN_VALUE_USERNAME5="Username" MOD_LOGIN_VALUE_USERNAME6="Username" MOD_LOGIN_VALUE_USERNAME7="Username" MOD_LOGIN_VALUE_USERNAME8="Username" MOD_LOGIN_VALUE_USERNAME9="Username" MOD_LOGIN_VALUE_USERNAME10="Username" MOD_LOGIN_VALUE_USERNAME11="Username" MOD_LOGIN_VALUE_USERNAME12="Username" MOD_LOGIN_VALUE_USERNAME13="Username" MOD_LOGIN_VALUE_USERNAME14="Username" MOD_LOGIN_VALUE_USERNAME15="Username" MOD_LOGIN_VALUE_USERNAME16="Username" MOD_LOGIN_VALUE_USERNAME17="Username" MOD_LOGIN_VALUE_USERNAME18="Username" MOD_LOGIN_VALUE_USERNAME19="Username" MOD_LOGIN_VALUE_USERNAME20="Username" MOD_LOGIN_VALUE_USERNAME21="Username" MOD_LOGIN_VALUE_USERNAME22="Username" MOD_LOGIN_VALUE_USERNAME23="Username" MOD_LOGIN_VALUE_USERNAME24="Username" MOD_LOGIN_VALUE_USERNAME25="Username" MOD_LOGIN_VALUE_USERNAME26="Username" MOD_LOGIN_VALUE_USERNAME27="Username" MOD_LOGIN_VALUE_USERNAME28="Username" MOD_LOGIN_VALUE_USERNAME29="Username" MOD_LOGIN_VALUE_USERNAME30="Username" 2) Backend > Extensions > Language Manager > Overrides 3) Filter > English (en-GB) - Site 3) Click New 4) Search word: username. (The overrides cache must be refreshed (message below search field)! If not log out and log in first!) 5) Search for: Constant 6) Click Search 7) Click More Results Result: More Results link disappeares but not all MOD_LOGIN_VALUE_USERNAMExy are shown. Apply patch now and test again. Click More Results until it disappeares. Check if all placeholders are diplayed now. --- administrator/components/com_languages/models/strings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_languages/models/strings.php b/administrator/components/com_languages/models/strings.php index 5c138488cc7cb..083a358128f22 100644 --- a/administrator/components/com_languages/models/strings.php +++ b/administrator/components/com_languages/models/strings.php @@ -147,7 +147,7 @@ public function search() $results['results'] = $this->_db->loadObjectList(); // Check whether there are more results than already loaded. - $query->clear('select') + $query->clear('select')->clear('limit') ->select('COUNT(id)'); $this->_db->setQuery($query); From dcecc3c871306804b01ff07c1afd32c73776c70b Mon Sep 17 00:00:00 2001 From: Niels van der Veer Date: Tue, 10 Mar 2015 20:26:53 +0100 Subject: [PATCH 084/809] Password requirements are ignored when password reset. Fixes #6380. Fixes #6382 --- components/com_users/models/forms/reset_complete.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/components/com_users/models/forms/reset_complete.xml b/components/com_users/models/forms/reset_complete.xml index 8ba1e59cec5e1..b9ed7c6519c79 100644 --- a/components/com_users/models/forms/reset_complete.xml +++ b/components/com_users/models/forms/reset_complete.xml @@ -25,6 +25,7 @@ label="COM_USERS_FIELD_RESET_PASSWORD2_LABEL" required="true" size="30" + validate="password" /> \ No newline at end of file From 5dc14dff97a8fe76a1787e86fccbf2618455efe3 Mon Sep 17 00:00:00 2001 From: Peter van Westen Date: Fri, 6 Mar 2015 10:33:11 +0100 Subject: [PATCH 085/809] Fixed incorrect show_page_heading default. Fixes #6332 --- components/com_content/views/archive/tmpl/default.php | 2 +- components/com_content/views/article/tmpl/default.php | 2 +- components/com_content/views/category/tmpl/blog.php | 2 +- components/com_content/views/form/tmpl/edit.php | 2 +- components/com_search/views/search/tmpl/default.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/com_content/views/archive/tmpl/default.php b/components/com_content/views/archive/tmpl/default.php index cef9197536cb4..3e466931cba05 100644 --- a/components/com_content/views/archive/tmpl/default.php +++ b/components/com_content/views/archive/tmpl/default.php @@ -14,7 +14,7 @@ JHtml::_('behavior.caption'); ?>
                  -params->get('show_page_heading', 1)) : ?> +params->get('show_page_heading')) : ?> ' ); } - else - { + else { jQuery('#system-message-container').prepend( '
                  ' - + updateString - + ' ' - + '
                  ' + + updateString + + ' ' + + '
                  ' ); } var updateString = plg_quickicon_extensionupdate_text.UPDATEFOUND.replace("%s", updateInfoList.length); - jQuery('#plg_quickicon_extensionupdate').find('span').html(updateString); + link.html(updateString); } } else { // An error occured - jQuery('#plg_quickicon_extensionupdate').find('span').html(plg_quickicon_extensionupdate_text.ERROR); + link.html(plg_quickicon_extensionupdate_text.ERROR); } }, error: function(jqXHR, textStatus, errorThrown) { // An error occured - jQuery('#plg_quickicon_extensionupdate').find('span').html(plg_quickicon_extensionupdate_text.ERROR); + jQuery('#plg_quickicon_extensionupdate').find('span.j-links-link').html(plg_quickicon_extensionupdate_text.ERROR); }, url: plg_quickicon_extensionupdate_ajax_url + '&eid=0&skip=700' }; diff --git a/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js b/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js index c58f6285339bc..416fc6eb97a5a 100644 --- a/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js +++ b/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js @@ -5,60 +5,58 @@ var plg_quickicon_jupdatecheck_ajax_structure = {}; -jQuery(document).ready(function() -{ +jQuery(document).ready(function() { plg_quickicon_jupdatecheck_ajax_structure = { - success: function(data, textStatus, jqXHR) - { + success: function(data, textStatus, jqXHR) { + var link = jQuery('#plg_quickicon_joomlaupdate').find('span.j-links-link'); + try { var updateInfoList = jQuery.parseJSON(data); } catch (e) { // An error occured - jQuery('#plg_quickicon_joomlaupdate').find('span').html(plg_quickicon_joomlaupdate_text.ERROR); + link.html(plg_quickicon_joomlaupdate_text.ERROR); } + if (updateInfoList instanceof Array) { if (updateInfoList.length < 1) { // No updates - jQuery('#plg_quickicon_joomlaupdate').find('span').replaceWith(plg_quickicon_joomlaupdate_text.UPTODATE); + link.replaceWith(plg_quickicon_joomlaupdate_text.UPTODATE); } else { var updateInfo = updateInfoList.shift(); if (updateInfo.version != plg_quickicon_jupdatecheck_jversion) { var updateString = plg_quickicon_joomlaupdate_text.UPDATEFOUND.replace("%s", updateInfo.version + ""); jQuery('#plg_quickicon_joomlaupdate').find('span').html(updateString); var updateString = plg_quickicon_joomlaupdate_text.UPDATEFOUND_MESSAGE.replace("%s", updateInfo.version + ""); - if (jQuery('.alert-joomlaupdate').length == 0) - { + if (jQuery('.alert-joomlaupdate').length == 0) { jQuery('#system-message-container').prepend( '
                  ' - + updateString - + ' ' - + '
                  ' + + updateString + + ' ' + + '
' ); } - else - { + else { jQuery('#system-message-container').prepend( '
' - + updateString - + ' ' - + '
' + + updateString + + ' ' + + '
' ); } - } else { - jQuery('#plg_quickicon_joomlaupdate').find('span').html(plg_quickicon_joomlaupdate_text.UPTODATE); + } else { + link.html(plg_quickicon_joomlaupdate_text.UPTODATE); } } } else { // An error occured - jQuery('#plg_quickicon_joomlaupdate').find('span').html(plg_quickicon_joomlaupdate_text.ERROR); + link.html(plg_quickicon_joomlaupdate_text.ERROR); } }, - error: function(jqXHR, textStatus, errorThrown) - { + error: function(jqXHR, textStatus, errorThrown) { // An error occured - jQuery('#plg_quickicon_joomlaupdate').find('span').html(plg_quickicon_joomlaupdate_text.ERROR); + jQuery('#plg_quickicon_joomlaupdate').find('span.j-links-link').html(plg_quickicon_joomlaupdate_text.ERROR); }, url: plg_quickicon_joomlaupdate_ajax_url + '&eid=700&cache_timeout=3600' }; diff --git a/modules/mod_finder/tmpl/default.php b/modules/mod_finder/tmpl/default.php index 3f520d3a505dd..8c0fd11a57c15 100644 --- a/modules/mod_finder/tmpl/default.php +++ b/modules/mod_finder/tmpl/default.php @@ -49,7 +49,7 @@ if ($params->get('show_button')) { - $button = ''; + $button = ''; switch ($params->get('button_pos', 'left')) { diff --git a/plugins/content/pagenavigation/tmpl/default.php b/plugins/content/pagenavigation/tmpl/default.php index a02c6cdea82e6..6b78040222037 100644 --- a/plugins/content/pagenavigation/tmpl/default.php +++ b/plugins/content/pagenavigation/tmpl/default.php @@ -16,7 +16,7 @@ $direction = $lang->isRTL() ? 'right' : 'left'; ?> @@ -24,7 +24,7 @@ $direction = $lang->isRTL() ? 'left' : 'right'; ?> diff --git a/templates/beez3/html/com_weblinks/form/edit.php b/templates/beez3/html/com_weblinks/form/edit.php index 2fe7972741a02..624f3d0b54e7e 100644 --- a/templates/beez3/html/com_weblinks/form/edit.php +++ b/templates/beez3/html/com_weblinks/form/edit.php @@ -36,12 +36,12 @@
diff --git a/templates/protostar/error.php b/templates/protostar/error.php index 49ea4591d2252..2906aa9a993d9 100644 --- a/templates/protostar/error.php +++ b/templates/protostar/error.php @@ -159,7 +159,7 @@ getBuffer('module', 'search'); ?>

-

+


diff --git a/templates/protostar/html/pagination.php b/templates/protostar/html/pagination.php index 7678cebf76dcd..0cd60ca566703 100644 --- a/templates/protostar/html/pagination.php +++ b/templates/protostar/html/pagination.php @@ -152,25 +152,25 @@ function pagination_item_active(&$item) // Check for "Start" item if ($item->text == JText::_('JLIB_HTML_START')) { - $display = ''; + $display = ''; } // Check for "Prev" item if ($item->text == JText::_('JPREV')) { - $display = ''; + $display = ''; } // Check for "Next" item if ($item->text == JText::_('JNEXT')) { - $display = ''; + $display = ''; } // Check for "End" item if ($item->text == JText::_('JLIB_HTML_END')) { - $display = ''; + $display = ''; } // If the display object isn't set already, just render the item with its text @@ -197,25 +197,25 @@ function pagination_item_inactive(&$item) // Check for "Start" item if ($item->text == JText::_('JLIB_HTML_START')) { - return '
  • '; + return '
  • '; } // Check for "Prev" item if ($item->text == JText::_('JPREV')) { - return '
  • '; + return '
  • '; } // Check for "Next" item if ($item->text == JText::_('JNEXT')) { - return '
  • '; + return '
  • '; } // Check for "End" item if ($item->text == JText::_('JLIB_HTML_END')) { - return '
  • '; + return '
  • '; } // Check if the item is the active page diff --git a/tests/unit/suites/libraries/cms/pagination/JPaginationTest.php b/tests/unit/suites/libraries/cms/pagination/JPaginationTest.php index e6c9402dd6aaf..9fa44a8cb3db8 100644 --- a/tests/unit/suites/libraries/cms/pagination/JPaginationTest.php +++ b/tests/unit/suites/libraries/cms/pagination/JPaginationTest.php @@ -529,8 +529,8 @@ public function testGetLimitBox($total, $limitstart, $limit, $admin, $expected) public function dataTestOrderUpIcon() { return array( - array(0, '', true, 'orderup', 'JLIB_HTML_MOVE_UP', true, 'cb'), - array(2, '', true, 'orderup', 'JLIB_HTML_MOVE_UP', true, 'cb'), + array(0, '', true, 'orderup', 'JLIB_HTML_MOVE_UP', true, 'cb'), + array(2, '', true, 'orderup', 'JLIB_HTML_MOVE_UP', true, 'cb'), array(2, ' ', false, 'orderup', 'JLIB_HTML_MOVE_UP', true, 'cb'), ); } @@ -570,8 +570,8 @@ public function testOrderUpIcon($i, $expected, $condition = true, $task = 'order public function dataTestOrderDownIcon() { return array( - array(0, 100, '', true, 'orderup', 'JLIB_HTML_MOVE_DOWN', true, 'cb'), - array(2, 100, '', true, 'orderup', 'JLIB_HTML_MOVE_DOWN', true, 'cb'), + array(0, 100, '', true, 'orderup', 'JLIB_HTML_MOVE_DOWN', true, 'cb'), + array(2, 100, '', true, 'orderup', 'JLIB_HTML_MOVE_DOWN', true, 'cb'), array(2, 100, ' ', false, 'orderup', 'JLIB_HTML_MOVE_DOWN', true, 'cb'), ); } From 45a58f6ae97abfbb91953f08c419d269f3dcdc13 Mon Sep 17 00:00:00 2001 From: Tran Duy Hung Date: Sat, 23 May 2015 02:04:54 +0100 Subject: [PATCH 399/809] Fixed failure to get user resource from Twitter. Fixes #6852 --- libraries/joomla/twitter/users.php | 2 +- .../joomla/twitter/JTwitterUsersTest.php | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libraries/joomla/twitter/users.php b/libraries/joomla/twitter/users.php index b17ce6297fbfc..c667550381f50 100644 --- a/libraries/joomla/twitter/users.php +++ b/libraries/joomla/twitter/users.php @@ -160,7 +160,7 @@ public function searchUsers($query, $page = 0, $count = 0, $entities = null) public function getUser($user, $entities = null) { // Check the rate limit for remaining hits - $this->checkRateLimit('users', 'show'); + $this->checkRateLimit('users', 'show/:id'); // Determine which type of data was passed for $user if (is_numeric($user)) diff --git a/tests/unit/suites/libraries/joomla/twitter/JTwitterUsersTest.php b/tests/unit/suites/libraries/joomla/twitter/JTwitterUsersTest.php index 929f6858dea83..e31dd41c02526 100644 --- a/tests/unit/suites/libraries/joomla/twitter/JTwitterUsersTest.php +++ b/tests/unit/suites/libraries/joomla/twitter/JTwitterUsersTest.php @@ -63,16 +63,16 @@ class JTwitterUsersTest extends TestCase * @var string Sample JSON string. * @since 12.3 */ - protected $rateLimit = '{"resources": {"users": { - "/users/lookup": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, - "/users/profile_banner": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, - "/users/search": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, - "/users/show": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, - "/users/contributees": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, - "/users/contributors": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, - "/users/suggestions": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, - "/users/suggestions/:slug": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"}, - "/users/suggestions/:slug/members": {"remaining":15, "reset":"Mon Jun 25 17:20:53 +0000 2012"} + protected $rateLimit = '{"resources":{"users":{ + "/users/profile_banner":{"limit":180,"remaining":180,"reset":1403602426}, + "/users/suggestions/:slug/members":{"limit":15,"remaining":15,"reset":1403602426}, + "/users/show/:id":{"limit":180,"remaining":180,"reset":1403602426}, + "/users/suggestions":{"limit":15,"remaining":15,"reset":1403602426}, + "/users/lookup":{"limit":180,"remaining":180,"reset":1403602426}, + "/users/search":{"limit":180,"remaining":180,"reset":1403602426}, + "/users/contributors":{"limit":15,"remaining":15,"reset":1403602426}, + "/users/contributees":{"limit":15,"remaining":15,"reset":1403602426}, + "/users/suggestions/:slug":{"limit":15,"remaining":15,"reset":1403602426} }}}'; /** From 52f2767788809adaf15f450db3625faf7178980e Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Sat, 23 May 2015 10:34:16 +0200 Subject: [PATCH 400/809] Correcting comment: do not confuse punycode with percent-encoding --- libraries/cms/router/site.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/cms/router/site.php b/libraries/cms/router/site.php index 32825dcf33719..61c11cfc4e3a2 100644 --- a/libraries/cms/router/site.php +++ b/libraries/cms/router/site.php @@ -78,7 +78,7 @@ public function parse(&$uri) } // Get the path - // Decode URL to convert punycode to unicode so that strings match when routing. + // Decode URL to convert percent-encoding to unicode so that strings match when routing. $path = urldecode($uri->getPath()); // Remove the base URI path. From 8d0d781f3feec20cdf30c427d71ec1ac64baa7b2 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sat, 23 May 2015 14:48:04 -0400 Subject: [PATCH 401/809] Improve extensibility of JUri --- libraries/joomla/uri/uri.php | 56 ++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/libraries/joomla/uri/uri.php b/libraries/joomla/uri/uri.php index ccff0b6619cbd..d42031c3b4b0d 100644 --- a/libraries/joomla/uri/uri.php +++ b/libraries/joomla/uri/uri.php @@ -57,7 +57,7 @@ class JUri extends Uri */ public static function getInstance($uri = 'SERVER') { - if (empty(self::$instances[$uri])) + if (empty(static::$instances[$uri])) { // Are we obtaining the URI from the server? if ($uri == 'SERVER') @@ -111,10 +111,10 @@ public static function getInstance($uri = 'SERVER') $theURI = $uri; } - self::$instances[$uri] = new JUri($theURI); + static::$instances[$uri] = new static($theURI); } - return self::$instances[$uri]; + return static::$instances[$uri]; } /** @@ -129,29 +129,29 @@ public static function getInstance($uri = 'SERVER') public static function base($pathonly = false) { // Get the base request path. - if (empty(self::$base)) + if (empty(static::$base)) { $config = JFactory::getConfig(); - $uri = self::getInstance(); + $uri = static::getInstance(); $live_site = ($uri->isSSL()) ? str_replace("http://", "https://", $config->get('live_site')) : $config->get('live_site'); if (trim($live_site) != '') { - $uri = self::getInstance($live_site); - self::$base['prefix'] = $uri->toString(array('scheme', 'host', 'port')); - self::$base['path'] = rtrim($uri->toString(array('path')), '/\\'); + $uri = static::getInstance($live_site); + static::$base['prefix'] = $uri->toString(array('scheme', 'host', 'port')); + static::$base['path'] = rtrim($uri->toString(array('path')), '/\\'); if (defined('JPATH_BASE') && defined('JPATH_ADMINISTRATOR')) { if (JPATH_BASE == JPATH_ADMINISTRATOR) { - self::$base['path'] .= '/administrator'; + static::$base['path'] .= '/administrator'; } } } else { - self::$base['prefix'] = $uri->toString(array('scheme', 'host', 'port')); + static::$base['prefix'] = $uri->toString(array('scheme', 'host', 'port')); if (strpos(php_sapi_name(), 'cgi') !== false && !ini_get('cgi.fix_pathinfo') && !empty($_SERVER['REQUEST_URI'])) { @@ -167,11 +167,11 @@ public static function base($pathonly = false) $script_name = $_SERVER['SCRIPT_NAME']; } - self::$base['path'] = rtrim(dirname($script_name), '/\\'); + static::$base['path'] = rtrim(dirname($script_name), '/\\'); } } - return $pathonly === false ? self::$base['prefix'] . self::$base['path'] . '/' : self::$base['path']; + return $pathonly === false ? static::$base['prefix'] . static::$base['path'] . '/' : static::$base['path']; } /** @@ -187,20 +187,20 @@ public static function base($pathonly = false) public static function root($pathonly = false, $path = null) { // Get the scheme - if (empty(self::$root)) + if (empty(static::$root)) { - $uri = self::getInstance(self::base()); - self::$root['prefix'] = $uri->toString(array('scheme', 'host', 'port')); - self::$root['path'] = rtrim($uri->toString(array('path')), '/\\'); + $uri = static::getInstance(static::base()); + static::$root['prefix'] = $uri->toString(array('scheme', 'host', 'port')); + static::$root['path'] = rtrim($uri->toString(array('path')), '/\\'); } // Get the scheme if (isset($path)) { - self::$root['path'] = $path; + static::$root['path'] = $path; } - return $pathonly === false ? self::$root['prefix'] . self::$root['path'] . '/' : self::$root['path']; + return $pathonly === false ? static::$root['prefix'] . static::$root['path'] . '/' : static::$root['path']; } /** @@ -213,13 +213,13 @@ public static function root($pathonly = false, $path = null) public static function current() { // Get the current URL. - if (empty(self::$current)) + if (empty(static::$current)) { - $uri = self::getInstance(); - self::$current = $uri->toString(array('scheme', 'host', 'port', 'path')); + $uri = static::getInstance(); + static::$current = $uri->toString(array('scheme', 'host', 'port', 'path')); } - return self::$current; + return static::$current; } /** @@ -231,10 +231,10 @@ public static function current() */ public static function reset() { - self::$instances = array(); - self::$base = array(); - self::$root = array(); - self::$current = ''; + static::$instances = array(); + static::$base = array(); + static::$root = array(); + static::$current = ''; } /** @@ -264,11 +264,11 @@ public function setPath($path) */ public static function isInternal($url) { - $uri = self::getInstance($url); + $uri = static::getInstance($url); $base = $uri->toString(array('scheme', 'host', 'port', 'path')); $host = $uri->toString(array('scheme', 'host', 'port')); - if (stripos($base, self::base()) !== 0 && !empty($host)) + if (stripos($base, static::base()) !== 0 && !empty($host)) { return false; } From 7dd2d4ff222764c92176a0b3f25ada73e04f3655 Mon Sep 17 00:00:00 2001 From: Demis Palma Date: Sun, 24 May 2015 23:40:52 +0100 Subject: [PATCH 402/809] Unterminated statement While line-breaks may be used instead of semicolons to terminate JavaScript statements, some coding styles prefer the semicolon for consistency with the other languages. --- libraries/cms/form/field/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/cms/form/field/media.php b/libraries/cms/form/field/media.php index 2bdbf775580e3..0ca2e91d3c69f 100644 --- a/libraries/cms/form/field/media.php +++ b/libraries/cms/form/field/media.php @@ -232,7 +232,7 @@ protected function getInput() $script[] = ' $("#" + id + "_preview_empty").hide();'; $script[] = ' $("#" + id + "_preview_img").show()'; $script[] = ' } else { '; - $script[] = ' $img.attr("src", "")'; + $script[] = ' $img.attr("src", "");'; $script[] = ' $("#" + id + "_preview_empty").show();'; $script[] = ' $("#" + id + "_preview_img").hide();'; $script[] = ' } '; From 6d09d47894ff193f2ffe20014e7e5a8b90654058 Mon Sep 17 00:00:00 2001 From: Demis Palma Date: Mon, 25 May 2015 01:22:27 +0100 Subject: [PATCH 403/809] Fix error message on installation when SQL File not found. Fixes #6559. --- libraries/cms/installer/installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/cms/installer/installer.php b/libraries/cms/installer/installer.php index 3336274cbc258..eca2c47d8eb3e 100644 --- a/libraries/cms/installer/installer.php +++ b/libraries/cms/installer/installer.php @@ -914,7 +914,7 @@ public function parseSQLFiles($element) // Check that sql files exists before reading. Otherwise raise error for rollback if (!file_exists($sqlfile)) { - JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true)), JLog::WARNING, 'jerror'); + JLog::add(JText::sprintf('JLIB_INSTALLER_ERROR_SQL_FILENOTFOUND', $sqlfile), JLog::WARNING, 'jerror'); return false; } From 550ca2eb6a9929954340b1ba3195d259355dd787 Mon Sep 17 00:00:00 2001 From: bertmert Date: Mon, 25 May 2015 01:26:03 +0100 Subject: [PATCH 404/809] Add support for maxlength attribute in textarea form field. Fixes #6459. Fixes #6460. --- libraries/joomla/form/fields/textarea.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/libraries/joomla/form/fields/textarea.php b/libraries/joomla/form/fields/textarea.php index 1d2079d513b9b..16d3a2091bef1 100644 --- a/libraries/joomla/form/fields/textarea.php +++ b/libraries/joomla/form/fields/textarea.php @@ -42,6 +42,14 @@ class JFormFieldTextarea extends JFormField */ protected $columns; + /** + * The maximum number of characters in textarea. + * + * @var mixed + * @since 3.4 + */ + protected $maxlength; + /** * Method to get certain otherwise inaccessible properties from the form field object. * @@ -57,6 +65,7 @@ public function __get($name) { case 'rows': case 'columns': + case 'maxlength': return $this->$name; } @@ -79,6 +88,7 @@ public function __set($name, $value) { case 'rows': case 'columns': + case 'maxlength': $this->$name = (int) $value; break; @@ -107,8 +117,9 @@ public function setup(SimpleXMLElement $element, $value, $group = null) if ($return) { - $this->rows = isset($this->element['rows']) ? (int) $this->element['rows'] : false; - $this->columns = isset($this->element['cols']) ? (int) $this->element['cols'] : false; + $this->rows = isset($this->element['rows']) ? (int) $this->element['rows'] : false; + $this->columns = isset($this->element['cols']) ? (int) $this->element['cols'] : false; + $this->maxlength = isset($this->element['maxlength']) ? (int) $this->element['maxlength'] : false; } return $return; @@ -139,6 +150,7 @@ protected function getInput() $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; $autofocus = $this->autofocus ? ' autofocus' : ''; $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"'; + $maxlength = $this->maxlength ? ' maxlength="' . $this->maxlength . '"' : ''; // Initialize JavaScript field attributes. $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : ''; @@ -149,7 +161,7 @@ protected function getInput() JHtml::_('script', 'system/html5fallback.js', false, true); return ''; } } From 34024745cbe6af4497d31d7df7d48ea78ce0a464 Mon Sep 17 00:00:00 2001 From: photodude Date: Sun, 24 May 2015 18:59:46 -0600 Subject: [PATCH 405/809] Declare visibility for method _getUserDisplayedGroups Best Practices fix: It is generally recommended to explicitly declare the visibility for methods. Assuming public for method `_getUserDisplayedGroups` --- administrator/components/com_users/models/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_users/models/users.php b/administrator/components/com_users/models/users.php index c6debf274254d..284120fe431f8 100644 --- a/administrator/components/com_users/models/users.php +++ b/administrator/components/com_users/models/users.php @@ -423,7 +423,7 @@ protected function getListQuery() * * @return string Groups titles imploded :$ */ - function _getUserDisplayedGroups($user_id) + public function _getUserDisplayedGroups($user_id) { $db = JFactory::getDbo(); $query = "SELECT title FROM " . $db->quoteName('#__usergroups') . " ug left join " . From 78da7ea7b30b569d3f5183d08dae50ae1852a2f0 Mon Sep 17 00:00:00 2001 From: Sergio Manzi Date: Mon, 25 May 2015 02:01:37 +0100 Subject: [PATCH 406/809] Introduces rel="alternate" for the active language. Fixes #6963. Fixes #6923. --- .../system/languagefilter/languagefilter.php | 162 +++++++----------- 1 file changed, 62 insertions(+), 100 deletions(-) diff --git a/plugins/system/languagefilter/languagefilter.php b/plugins/system/languagefilter/languagefilter.php index a6e77d3a07438..785990a5f068b 100644 --- a/plugins/system/languagefilter/languagefilter.php +++ b/plugins/system/languagefilter/languagefilter.php @@ -606,137 +606,99 @@ public function onUserLogin($user, $options = array()) public function onAfterDispatch() { $doc = JFactory::getDocument(); - $menu = $this->app->getMenu(); - $server = JUri::getInstance()->toString(array('scheme', 'host', 'port')); - $option = $this->app->input->get('option'); - $eName = JString::ucfirst(JString::str_ireplace('com_', '', $option)); if ($this->app->isSite() && $this->params->get('alternate_meta') && $doc->getType() == 'html') { - // Get active menu item. - $active = $menu->getActive(); - - $assocs = array(); - $home = false; + $languages = $this->lang_codes; + $current_language = JFactory::getLanguage()->getTag(); + $default_language = JComponentHelper::getParams('com_languages')->get('site', 'en-GB'); + $homes = MultilangstatusHelper::getHomepages(); + $menu = $this->app->getMenu(); + $active = $menu->getActive(); + $levels = JFactory::getUser()->getAuthorisedViewLevels(); + $remove_default_prefix = $this->params->get('remove_default_prefix', 0); + $server = JUri::getInstance()->toString(array('scheme', 'host', 'port')); + $is_home = false; - // Load menu associations. if ($active) { $active_link = JRoute::_($active->link . '&Itemid=' . $active->id, false); - - // Get current link. $current_link = JUri::getInstance()->toString(array('path', 'query')); - // Check the exact menu item's URL. + // Load menu associations if ($active_link == $current_link) { $associations = MenusHelper::getAssociations($active->id); - unset($associations[$active->language]); - $assocs = array_keys($associations); - - // If the menu item is a home menu item and the URLs are identical, we are on the homepage - $home = true; } + + // Check if we are on the homepage + $is_home = ($active->home + && ($active_link == $current_link || $active_link == $current_link . 'index.php' || $active_link . '/' == $current_link)); } // Load component associations. - $cName = JString::ucfirst($eName . 'HelperAssociation'); + $option = $this->app->input->get('option'); + $cName = JString::ucfirst(JString::str_ireplace('com_', '', $option)) . 'HelperAssociation'; JLoader::register($cName, JPath::clean(JPATH_COMPONENT_SITE . '/helpers/association.php')); if (class_exists($cName) && is_callable(array($cName, 'getAssociations'))) { $cassociations = call_user_func(array($cName, 'getAssociations')); - - $lang_code = $this->app->input->cookie->getString(JApplicationHelper::getHash('language')); - - // No cookie - let's try to detect browser language or use site default. - if (!$lang_code) - { - if ($this->params->get('detect_browser', 1)) - { - $lang_code = JLanguageHelper::detectLanguage(); - } - else - { - $lang_code = JComponentHelper::getParams('com_languages')->get('site', 'en-GB'); - } - } - - unset($cassociations[$lang_code]); - $assocs = array_merge(array_keys($cassociations), $assocs); } - // Create alternate for home pages - if ($active && $active->home && $home) + // For each language... + foreach ($languages as $i => &$language) { - foreach (JLanguageHelper::getLanguages() as $language) + switch (true) { - if (!JLanguage::exists($language->lang_code)) - { - continue; - } - - $item = $menu->getDefault($language->lang_code); - - if ($item && $item->language != $active->language && $item->language != '*') - { - if ($this->mode_sef) - { - $link = JRoute::_('index.php?Itemid=' . $item->id . '&lang=' . $language->sef); - - // Check if language is the default site language and remove url language code is on - if ($language->sef == $this->lang_codes[JComponentHelper::getParams('com_languages')->get('site', 'en-GB')]->sef - && $this->params->get('remove_default_prefix', 0)) - { - $link = preg_replace('|/' . $language->sef . '/|', '/', $link, 1); - } - } - else - { - $link = JRoute::_($item->link . '&Itemid=' . $item->id . '&lang=' . $language->sef); - } - - $doc->addHeadLink($server . $link, 'alternate', 'rel', array('hreflang' => $language->lang_code)); - } + // Language without frontend UI || Language without specific home menu || Language without authorized access level + case (!array_key_exists($i, MultilangstatusHelper::getSitelangs())): + case (!isset($homes[$i])): + case (isset($language->access) && $language->access && !in_array($language->access, $levels)): + unset($languages[$i]); + break; + + // Home page + case ($is_home): + $language->link = JRoute::_('index.php?lang=' . $language->sef . '&Itemid=' . $homes[$i]->id); + break; + + // Current language link + case ($i == $current_language): + $language->link = JUri::getInstance()->toString(array('path', 'query')); + break; + + // Component association + case (isset($cassociations[$i])): + $language->link = JRoute::_($cassociations[$i] . '&lang=' . $language->sef); + break; + + // Menu items association + // Heads up! "$item = $menu" here below is an assignment, *NOT* comparison + case (isset($associations[$i]) && ($item = $menu->getItem($associations[$i]))): + $language->link = JRoute::_($item->link . '&Itemid=' . $item->id . '&lang=' . $language->sef); + break; + + // Too bad... + default: + unset($languages[$i]); } } - // Handle the default associations. - elseif ($this->params->get('item_associations')) + + // If there are at least 2 of them, add the rel="alternate" links to the + if (count($languages) > 1) { - $languages = JLanguageHelper::getLanguages('lang_code'); - foreach ($assocs as $language) + // Remove the sef from the default language if "Remove URL Language Code" is on + if (isset($languages[$default_language]) && $remove_default_prefix) { - if (!JLanguage::exists($language)) - { - continue; - } - $lang = $languages[$language]; - - if (isset($cassociations[$language])) - { - $link = JRoute::_($cassociations[$language] . '&lang=' . $lang->sef); - - // Check if language is the default site language and remove url language code is on - if ($lang->sef == $this->lang_codes[JComponentHelper::getParams('com_languages')->get('site', 'en-GB')]->sef - && $this->params->get('remove_default_prefix', 0)) - { - $link = preg_replace('|/' . $lang->sef . '/|', '/', $link, 1); - } - - $doc->addHeadLink($server . $link, 'alternate', 'rel', array('hreflang' => $language)); - } - elseif (isset($associations[$language])) - { - $item = $menu->getItem($associations[$language]); - - if ($item) - { - $link = JRoute::_($item->link . '&Itemid=' . $item->id . '&lang=' . $lang->sef); + $languages[$default_language]->link + = preg_replace('|/' . $languages[$default_language]->sef . '/|', '/', $languages[$default_language]->link, 1); + } - $doc->addHeadLink($server . $link, 'alternate', 'rel', array('hreflang' => $language)); - } - } + foreach ($languages as $i => &$language) + { + $doc->addHeadLink($server . $language->link, 'alternate', 'rel', array('hreflang' => $i)); } } } From 126c7d18d6eded4479ae693b41e2131036740991 Mon Sep 17 00:00:00 2001 From: photodude Date: Sun, 24 May 2015 19:08:03 -0600 Subject: [PATCH 407/809] Use protected method --- administrator/components/com_users/models/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_users/models/users.php b/administrator/components/com_users/models/users.php index 284120fe431f8..0c77001c39f28 100644 --- a/administrator/components/com_users/models/users.php +++ b/administrator/components/com_users/models/users.php @@ -423,7 +423,7 @@ protected function getListQuery() * * @return string Groups titles imploded :$ */ - public function _getUserDisplayedGroups($user_id) + protected function _getUserDisplayedGroups($user_id) { $db = JFactory::getDbo(); $query = "SELECT title FROM " . $db->quoteName('#__usergroups') . " ug left join " . From 7b07e18e1c71fbe6c8a160ea00926c6cb7a0fe1b Mon Sep 17 00:00:00 2001 From: vinespie Date: Mon, 25 May 2015 13:56:26 +0100 Subject: [PATCH 408/809] Accessibility fixes for ISIS sidebar and form field labels Fixes #6758 --- administrator/templates/isis/js/template.js | 7 +++++++ media/system/js/html5fallback-uncompressed.js | 2 -- media/system/js/html5fallback.js | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/administrator/templates/isis/js/template.js b/administrator/templates/isis/js/template.js index a897e566610f8..37be9cbce327c 100644 --- a/administrator/templates/isis/js/template.js +++ b/administrator/templates/isis/js/template.js @@ -131,6 +131,10 @@ $main.removeClass('span10').addClass('span12 expanded'); $toggleSidebarIcon.removeClass(openIcon).addClass(closedIcon); $toggleButton.attr( 'data-original-title', Joomla.JText._('JTOGGLE_SHOW_SIDEBAR') ); + $sidebar.attr('aria-hidden', true); + $sidebar.find('a').attr('tabindex', '-1'); + $sidebar.find(':input').attr('tabindex', '-1'); + if (!isComponent) { $debug.css( 'width', contentWidthRelative + '%' ); } @@ -151,6 +155,9 @@ $main.removeClass('span12 expanded').addClass('span10'); $toggleSidebarIcon.removeClass(closedIcon).addClass(openIcon); $toggleButton.attr( 'data-original-title', Joomla.JText._('JTOGGLE_HIDE_SIDEBAR') ); + $sidebar.removeAttr('aria-hidden'); + $sidebar.find('a').removeAttr('tabindex'); + $sidebar.find(':input').removeAttr('tabindex'); if (!isComponent && bodyWidth > 768 && mainHeight < sidebarHeight) { diff --git a/media/system/js/html5fallback-uncompressed.js b/media/system/js/html5fallback-uncompressed.js index 94cd85d17642d..37e6ded75d022 100644 --- a/media/system/js/html5fallback-uncompressed.js +++ b/media/system/js/html5fallback-uncompressed.js @@ -179,13 +179,11 @@ $elem.addClass(self.options.invalidClass); var $labelref = self.findLabel($elem); $labelref.addClass(self.options.invalidClass); - $labelref.attr('aria-invalid', 'true'); } else{ $elem.removeClass(self.options.invalidClass); var $labelref = self.findLabel($elem); $labelref.removeClass(self.options.invalidClass) - $labelref.attr('aria-invalid', 'false'); } return elem.validityState.valid; }, diff --git a/media/system/js/html5fallback.js b/media/system/js/html5fallback.js index b0356c388fd09..d1ef58653fef1 100644 --- a/media/system/js/html5fallback.js +++ b/media/system/js/html5fallback.js @@ -1 +1 @@ -(function(c,a,d){if(typeof Object.create!=="function"){Object.create=function(f){function e(){}e.prototype=f;return new e()}}var b={init:function(f,g){var e=this;e.elem=g;e.$elem=c(g);g.H5Form=e;e.options=c.extend({},c.fn.h5f.options,f);e.field=a.createElement("input");e.checkSupport(e);if(g.nodeName.toLowerCase()==="form"){e.bindWithForm(e.elem,e.$elem)}},bindWithForm:function(k,i){var h=this,e=!!i.attr("novalidate"),l=k.elements,g=l.length;if(h.options.formValidationEvent==="onSubmit"){i.on("submit",function(m){var f=this.H5Form.donotValidate!=d?this.H5Form.donotValidate:false;if(!f&&!e&&!h.validateForm(h)){m.preventDefault();this.donotValidate=false}else{i.find(":input").each(function(){h.placeholder(h,this,"submit")})}})}i.on("focusout focusin",function(f){h.placeholder(h,f.target,f.type)});i.on("focusout change",h.validateField);i.find("fieldset").on("change",function(){h.validateField(this)});if(!h.browser.isFormnovalidateNative){i.find(":submit[formnovalidate]").on("click",function(){h.donotValidate=true})}while(g--){var j=l[g];h.polyfill(j);h.autofocus(h,j)}},polyfill:function(f){if(f.nodeName.toLowerCase()==="form"){return true}var e=f.form.H5Form;e.placeholder(e,f);e.numberType(e,f)},checkSupport:function(e){e.browser={};e.browser.isRequiredNative=!!("required" in e.field);e.browser.isPatternNative=!!("pattern" in e.field);e.browser.isPlaceholderNative=!!("placeholder" in e.field);e.browser.isAutofocusNative=!!("autofocus" in e.field);e.browser.isFormnovalidateNative=!!("formnovalidate" in e.field);e.field.setAttribute("type","email");e.browser.isEmailNative=(e.field.type=="email");e.field.setAttribute("type","url");e.browser.isUrlNative=(e.field.type=="url");e.field.setAttribute("type","number");e.browser.isNumberNative=(e.field.type=="number");e.field.setAttribute("type","range");e.browser.isRangeNative=(e.field.type=="range")},validateForm:function(){var g=this,l=g.elem,m=l.elements,e=m.length,h=true;l.isValid=true;for(var j=0;j"),e;k=isNaN(k)?-100:k;for(var m=k;m<=n;m+=g){e=c("
    ",{bottom:!0,duration:5e3}):alert(t)}function Kt(e,t){var r="";return e&&(r+=''+e+""),r+=' ',t&&(r+='',r+=t,r+=""),r}function Pt(e,t){var r=(t.prefix||"")+" "+(t.desc||""),n=Kt(t.prefix,t.desc);bt(e,n,r,t.onClose,t)}function Nt(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var r=["global","multiline","ignoreCase","source"],n=0;ns;s++){var l=a.find(t);if(0==s&&l&&V(a.from(),i)&&(l=a.find(t)),!l&&(a=e.getSearchCursor(n,t?r(e.lastLine()):r(e.firstLine(),0)),!a.find(t)))return}return a.from()})}function Wt(e){var t=At(e);e.removeOverlay(At(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Vt(e,t,r){return"number"!=typeof e&&(e=e.line),t instanceof Array?v(e,t):r?e>=t&&r>=e:e==t}function _t(e){var t=e.getScrollInfo(),r=6,n=10,o=e.coordsChar({left:0,top:r+t.top},"local"),i=t.clientHeight-n+t.top,a=e.coordsChar({left:0,top:i},"local");return{top:o.line,bottom:a.line}}function Jt(t,r,n,o,i,a,s,l,c){function u(){t.operation(function(){for(;!m;)h(),p();d()})}function h(){var e=t.getRange(a.from(),a.to()),r=e.replace(s,l);a.replace(r)}function p(){for(var e;e=a.findNext()&&Vt(a.from(),o,i);)if(n||!g||a.from().line!=g.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),g=a.from(),void(m=!1);m=!0}function d(e){if(e&&e(),t.focus(),g){t.setCursor(g);var r=t.state.vim;r.exMode=!1,r.lastHPos=r.lastHSPos=g.ch}c&&c()}function f(r,n,o){e.e_stop(r);var i=e.keyName(r);switch(i){case"Y":h(),p();break;case"N":p();break;case"A":var a=c;c=void 0,t.operation(u),c=a;break;case"L":h();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":d(o)}return m&&d(o),!0}t.state.vim.exMode=!0;var m=!1,g=a.from();return p(),m?void Ot(t,"No matches for "+s.source):r?void Pt(t,{prefix:"replace with "+l+" (y/n/a/q/l)",onKeyDown:f}):(u(),void(c&&c()))}function Ut(t){var r=t.state.vim,n=kr.macroModeState,o=kr.registerController.getRegister("."),i=n.isPlaying,a=n.lastInsertModeChanges,s=[];if(!i){for(var l=a.inVisualBlock?r.lastSelection.visualBlock.height:1,c=a.changes,s=[],u=0;u1&&(or(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),o.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),n.isRecording&&Zt(n)}function $t(e){t.push(e)}function qt(e,t,r,n,o){var i={keys:e,type:t};i[t]=r,i[t+"Args"]=n;for(var a in o)i[a]=o[a];$t(i)}function Qt(t,r,n,o){var i=kr.registerController.getRegister(o),a=i.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var l=0;l|<\w+>|./.exec(h),u=c[0],h=h.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"),r.insertMode){var p=i.insertModeChanges[s++].changes;kr.macroModeState.lastInsertModeChanges.changes=p,ir(t,p,1),Ut(t)}n.isPlaying=!1}function zt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=kr.registerController.getRegister(r);n&&n.pushText(t)}}function Zt(e){if(!e.isPlaying){var t=e.latestRegister,r=kr.registerController.getRegister(t);r&&r.pushInsertModeChanges(e.lastInsertModeChanges)}}function Gt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=kr.registerController.getRegister(r);n&&n.pushSearchQuery(t)}}function Yt(e,t){var r=kr.macroModeState,n=r.lastInsertModeChanges;if(!r.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var o=t.text.join("\n");n.changes.push(o)}t=t.next}}function Xt(e){var t=e.state.vim;if(t.insertMode){var r=kr.macroModeState;if(r.isPlaying)return;var n=r.lastInsertModeChanges;n.expectCursorActivityForChange?n.expectCursorActivityForChange=!1:n.changes=[]}else e.curOp.isVimOp||tr(e,t);t.visualMode&&er(e)}function er(e){var t=e.state.vim,r=W(t.sel.head),n=P(r,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(r,n,{className:"cm-animate-fat-cursor"})}function tr(t,r){var n=t.getCursor("anchor"),o=t.getCursor("head");if(r.visualMode&&V(o,n)&&q(t,o.line)>o.ch?st(t,!1):r.visualMode||r.insertMode||!t.somethingSelected()||(r.visualMode=!0,r.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"})),r.visualMode){var i=_(o,n)?0:-1,a=_(o,n)?-1:0; +-o=P(o,0,i),n=P(n,0,a),r.sel={anchor:n,head:o},kt(t,r,"<",J(o,n)),kt(t,r,">",U(o,n))}else r.insertMode||(r.lastHPos=t.getCursor().ch)}function rr(e){this.keyName=e}function nr(t){function r(){return o.changes.push(new rr(i)),!0}var n=kr.macroModeState,o=n.lastInsertModeChanges,i=e.keyName(t);i&&(-1!=i.indexOf("Delete")||-1!=i.indexOf("Backspace"))&&e.lookupKey(i,"vim-insert",r)}function or(e,t,r,n){function o(){s?xr.processAction(e,t,t.lastEditActionCommand):xr.evalInput(e,t)}function i(r){if(a.lastInsertModeChanges.changes.length>0){r=t.lastEditActionCommand?r:1;var n=a.lastInsertModeChanges;ir(e,n.changes,r)}}var a=kr.macroModeState;a.isPlaying=!0;var s=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;r>c;c++)o(),i(1);else n||o(),i(r);t.inputState=l,t.insertMode&&!n&&Ut(e),a.isPlaying=!1}function ir(t,r,n){function o(r){return"string"==typeof r?e.commands[r](t):r(t),!0}var i=t.getCursor("head"),a=kr.macroModeState.lastInsertModeChanges.inVisualBlock;if(a){var s=t.state.vim,l=s.lastSelection,c=N(l.anchor,l.head);X(t,i,c.line+1),n=t.listSelections().length,t.setCursor(i)}for(var u=0;n>u;u++){a&&t.setCursor(P(i,u,0));for(var h=0;h"]),mr=[].concat(hr,pr,dr,["-",'"',".",":","/"]),gr={},vr=function(){function e(e,t,s){function l(t){var o=++n%r,i=a[o];i&&i.clear(),a[o]=e.setBookmark(t)}var c=n%r,u=a[c];if(u){var h=u.find();h&&!V(h,t)&&l(t)}else l(t);l(s),o=n,i=n-r+1,0>i&&(i=0)}function t(e,t){n+=t,n>o?n=o:i>n&&(n=i);var s=a[(r+n)%r];if(s&&!s.find()){var l,c=t>0?1:-1,u=e.getCursor();do if(n+=c,s=a[(r+n)%r],s&&(l=s.find())&&!V(u,l))break;while(o>n&&n>i)}return s}var r=100,n=-1,o=0,i=0,a=new Array(r);return{cachedCursor:void 0,add:e,move:t}},yr=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var e=kr.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var r=kr.registerController.getRegister(t);r&&(r.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var kr,Cr,wr={buildKeyMap:function(){},getRegisterController:function(){return kr.registerController},resetVimGlobalState_:M,getVimGlobalState_:function(){return kr},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:rr,map:function(e,t,r){Ir.map(e,t,r)},setOption:k,getOption:C,defineOption:y,defineEx:function(e,t,r){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered');Br[e]=r,Ir.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,r){var n=this.findKey(e,t,r);return"function"==typeof n?n():void 0},findKey:function(r,n,o){function i(){var e=kr.macroModeState;if(e.isRecording){if("q"==n)return e.exitMacroRecordMode(),A(r),!0;"mapping"!=o&&zt(e,n)}}function a(){return""==n?(A(r),h.visualMode?st(r):h.insertMode&&Ut(r),!0):void 0}function s(t){for(var o;t;)o=/<\w+-.+?>|<\w+>|./.exec(t),n=o[0],t=t.substring(o.index+n.length),e.Vim.handleKey(r,n,"mapping")}function l(){if(a())return!0;for(var e=h.inputState.keyBuffer=h.inputState.keyBuffer+n,o=1==n.length,i=xr.matchCommand(e,t,h.inputState,"insert");e.length>1&&"full"!=i.type;){var e=h.inputState.keyBuffer=e.slice(1),s=xr.matchCommand(e,t,h.inputState,"insert");"none"!=s.type&&(i=s)}if("none"==i.type)return A(r),!1;if("partial"==i.type)return Cr&&window.clearTimeout(Cr),Cr=window.setTimeout(function(){h.insertMode&&h.inputState.keyBuffer&&A(r)},C("insertModeEscKeysTimeout")),!o;if(Cr&&window.clearTimeout(Cr),o){var l=r.getCursor();r.replaceRange("",P(l,0,-(e.length-1)),l,"+input")}return A(r),i.command}function c(){if(i()||a())return!0;var e=h.inputState.keyBuffer=h.inputState.keyBuffer+n;if(/^[1-9]\d*$/.test(e))return!0;var o=/^(\d*)(.*)$/.exec(e);if(!o)return A(r),!1;var s=h.visualMode?"visual":"normal",l=xr.matchCommand(o[2]||o[1],t,h.inputState,s);if("none"==l.type)return A(r),!1;if("partial"==l.type)return!0;h.inputState.keyBuffer="";var o=/^(\d*)(.*)$/.exec(e);return o[1]&&"0"!=o[1]&&h.inputState.pushRepeatDigit(o[1]),l.command}var u,h=x(r);return u=h.insertMode?l():c(),u===!1?void 0:u===!0?function(){}:function(){return r.operation(function(){r.curOp.isVimOp=!0;try{"keyToKey"==u.type?s(u.toKeys):xr.processCommand(r,h,u)}catch(t){throw r.state.vim=void 0,x(r),e.Vim.suppressErrorLogging||console.log(t),t}return!0})}},handleEx:function(e,t){Ir.processCommand(e,t)},defineMotion:R,defineAction:I,defineOperator:B,mapCommand:qt,_mapCommand:$t,exitVisualMode:st,exitInsertMode:Ut};S.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},S.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},b.prototype={setText:function(e,t,r){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!r},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(yr(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},L.prototype={pushText:function(e,t,r,n,o){n&&"\n"==r.charAt(0)&&(r=r.slice(1)+"\n"),n&&"\n"!==r.charAt(r.length-1)&&(r+="\n");var i=this.isValidRegister(e)?this.getRegister(e):null;if(!i){switch(t){case"yank":this.registers[0]=new b(r,n,o);break;case"delete":case"change":-1==r.indexOf("\n")?this.registers["-"]=new b(r,n):(this.shiftNumericRegisters_(),this.registers[1]=new b(r,n))}return void this.unnamedRegister.setText(r,n,o)}var a=m(e);a?i.pushText(r,n):i.setText(r,n,o),this.unnamedRegister.setText(i.toString(),n)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new b),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&v(e,mr)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},T.prototype={nextMatch:function(e,t){var r=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+n;t?o>=0:o=r.length?(this.iterator=r.length,this.initialPrefix):0>o?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var xr={matchCommand:function(e,t,r,n){var o=j(e,t,n,r);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var i,a=0;a"==i.keys.slice(-11)&&(r.selectedCharacter=F(e)),{type:"full",command:i}},processCommand:function(e,t,r){switch(t.inputState.repeatOverride=r.repeatOverride,r.type){case"motion":this.processMotion(e,t,r);break;case"operator":this.processOperator(e,t,r);break;case"operatorMotion":this.processOperatorMotion(e,t,r);break;case"action":this.processAction(e,t,r);break;case"search":this.processSearch(e,t,r),A(e);break;case"ex":case"keyToEx":this.processEx(e,t,r),A(e)}},processMotion:function(e,t,r){t.inputState.motion=r.motion,t.inputState.motionArgs=K(r.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,r){var n=t.inputState;if(n.operator){if(n.operator==r.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);A(e)}n.operator=r.operator,n.operatorArgs=K(r.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,r){var n=t.visualMode,o=K(r.operatorMotionArgs);o&&n&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,r),n||this.processMotion(e,t,r)},processAction:function(e,t,r){var n=t.inputState,o=n.getRepeat(),i=!!o,a=K(r.actionArgs)||{};n.selectedCharacter&&(a.selectedCharacter=n.selectedCharacter),r.operator&&this.processOperator(e,t,r),r.motion&&this.processMotion(e,t,r),(r.motion||r.operator)&&this.evalInput(e,t),a.repeat=o||1,a.repeatIsExplicit=i,a.registerName=n.registerName,A(e),t.lastMotion=null,r.isEdit&&this.recordLastEdit(t,n,r),Ar[r.action](e,a,t)},processSearch:function(t,r,n){function o(e,o,i){kr.searchHistoryController.pushInput(e),kr.searchHistoryController.reset();try{jt(t,e,o,i)}catch(a){return void Ot(t,"Invalid regex: "+e)}xr.processMotion(t,r,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}function i(e){t.scrollTo(p.left,p.top),o(e,!0,!0);var r=kr.macroModeState;r.isRecording&&Gt(r,e)}function a(r,n,o){var i,a=e.keyName(r);"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=kr.searchHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kr.searchHistoryController.reset();var s;try{s=jt(t,n,!0,!0)}catch(r){}s?t.scrollIntoView(Dt(t,!l,s),30):(Wt(t),t.scrollTo(p.left,p.top))}function s(r,n,o){var i=e.keyName(r);("Esc"==i||"Ctrl-C"==i||"Ctrl-["==i)&&(kr.searchHistoryController.pushInput(n),kr.searchHistoryController.reset(),jt(t,h),Wt(t),t.scrollTo(p.left,p.top),e.e_stop(r),o(),t.focus())}if(t.getSearchCursor){var l=n.searchArgs.forward,c=n.searchArgs.wholeWordOnly;At(t).setReversed(!l);var u=l?"/":"?",h=At(t).getQuery(),p=t.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var d=kr.macroModeState;if(d.isPlaying){var f=d.replaySearchQueries.shift();o(f,!0,!1)}else Pt(t,{onClose:i,prefix:u,desc:Tr,onKeyUp:a,onKeyDown:s});break;case"wordUnderCursor":var m=ht(t,!1,!0,!1,!0),g=!0;if(m||(m=ht(t,!1,!0,!1,!1),g=!1),!m)return;var f=t.getLine(m.start.line).substring(m.start.ch,m.end.ch);f=g&&c?"\\b"+f+"\\b":Z(f),kr.jumpList.cachedCursor=t.getCursor(),t.setCursor(m.start),o(f,!0,!1)}}},processEx:function(t,r,n){function o(e){kr.exCommandHistoryController.pushInput(e),kr.exCommandHistoryController.reset(),Ir.processCommand(t,e)}function i(r,n,o){var i,a=e.keyName(r);("Esc"==a||"Ctrl-C"==a||"Ctrl-["==a)&&(kr.exCommandHistoryController.pushInput(n),kr.exCommandHistoryController.reset(),e.e_stop(r),o(),t.focus()),"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=kr.exCommandHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kr.exCommandHistoryController.reset()}"keyToEx"==n.type?Ir.processCommand(t,n.exArgs.input):r.visualMode?Pt(t,{onClose:o,prefix:":",value:"'<,'>",onKeyDown:i}):Pt(t,{onClose:o,prefix:":",onKeyDown:i})},evalInput:function(e,t){var n,o,i,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},h=a.registerName,p=t.sel,d=W(t.visualMode?p.head:e.getCursor("head")),f=W(t.visualMode?p.anchor:e.getCursor("anchor")),m=W(d),g=W(f);if(c&&this.recordLastEdit(t,a),i=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat(),i>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===i)&&(i=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=i,A(e),s){var v=Mr[s](e,d,l,t);if(t.lastMotion=Mr[s],!v)return;if(l.toJumplist){var y=kr.jumpList,k=y.cachedCursor;k?(pt(e,k,v),delete y.cachedCursor):pt(e,d,v)}v instanceof Array?(o=v[0],n=v[1]):n=v,n||(n=W(d)),t.visualMode?(t.visualBlock&&1/0===n.ch||(n=O(e,n,t.visualBlock)),o&&(o=O(e,o,!0)),o=o||g,p.anchor=o,p.head=n,ot(e),kt(e,t,"<",_(o,n)?o:n),kt(e,t,">",_(o,n)?n:o)):c||(n=O(e,n),e.setCursor(n.line,n.ch))}if(c){if(u.lastSel){o=g;var C=u.lastSel,w=Math.abs(C.head.line-C.anchor.line),x=Math.abs(C.head.ch-C.anchor.ch);n=C.visualLine?r(g.line+w,g.ch):C.visualBlock?r(g.line+w,g.ch+x):C.head.line==C.anchor.line?r(g.line,g.ch+x):r(g.line+w,g.ch),t.visualMode=!0,t.visualLine=C.visualLine,t.visualBlock=C.visualBlock,p=t.sel={anchor:o,head:n},ot(e)}else t.visualMode&&(u.lastSel={anchor:W(p.anchor),head:W(p.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var M,S,b,L,T;if(t.visualMode){if(M=J(p.head,p.anchor),S=U(p.head,p.anchor),b=t.visualLine||u.linewise,L=t.visualBlock?"block":b?"line":"char",T=it(e,{anchor:M,head:S},L),b){var R=T.ranges;if("block"==L)for(var E=0;El&&i.line==c||l>u&&i.line==u?void 0:(n.toFirstChar&&(a=ut(e.getLine(l)),o.lastHPos=a),o.lastHSPos=e.charCoords(r(l,a),"div").left,r(l,a))},moveByDisplayLines:function(e,t,n,o){var i=t;switch(o.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:o.lastHSPos=e.charCoords(i,"div").left}var a=n.repeat,s=e.findPosV(i,n.forward?a:-a,"line",o.lastHSPos);if(s.hitSide)if(n.forward)var l=e.charCoords(s,"div"),c={top:l.top+8,left:o.lastHSPos},s=e.coordsChar(c,"div");else{var u=e.charCoords(r(e.firstLine(),0),"div");u.left=o.lastHSPos,s=e.coordsChar(u,"div")}return o.lastHPos=s.ch,s},moveByPage:function(e,t,r){var n=t,o=r.repeat;return e.findPosV(n,r.forward?o:-o,"page")},moveByParagraph:function(e,t,r){var n=r.forward?1:-1;return wt(e,t,r.repeat,n)},moveByScroll:function(e,t,r,n){var o=e.getScrollInfo(),i=null,a=r.repeat;a||(a=o.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");r.repeat=a;var i=Mr.moveByDisplayLines(e,t,r,n);if(!i)return null;var l=e.charCoords(i,"local");return e.scrollTo(null,o.top+l.top-s.top),i},moveByWords:function(e,t,r){return gt(e,t,r.repeat,!!r.forward,!!r.wordEnd,!!r.bigWord)},moveTillCharacter:function(e,t,r){var n=r.repeat,o=vt(e,n,r.forward,r.selectedCharacter),i=r.forward?-1:1;return dt(i,r),o?(o.ch+=i,o):null},moveToCharacter:function(e,t,r){var n=r.repeat;return dt(0,r),vt(e,n,r.forward,r.selectedCharacter)||t},moveToSymbol:function(e,t,r){var n=r.repeat;return ft(e,n,r.forward,r.selectedCharacter)||t},moveToColumn:function(e,t,r,n){var o=r.repeat;return n.lastHPos=o-1,n.lastHSPos=e.charCoords(t,"div").left,yt(e,o)},moveToEol:function(e,t,n,o){var i=t;o.lastHPos=1/0;var a=r(i.line+n.repeat-1,1/0),s=e.clipPos(a);return s.ch--,o.lastHSPos=e.charCoords(s,"div").left,a},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return r(n.line,ut(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n,o=t,i=o.line,a=o.ch,s=e.getLine(i);do if(n=s.charAt(a++),n&&d(n)){var l=e.getTokenTypeAt(r(i,a));if("string"!==l&&"comment"!==l)break}while(n);if(n){var c=e.findMatchingBracket(r(i,a));return c.to}return o},moveToStartOfLine:function(e,t){return r(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var o=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(o=n.repeat-e.getOption("firstLineNumber")),r(o,ut(e.getLine(o)))},textObjectManipulation:function(e,t,r,n){var o={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},i={"'":!0,'"':!0},a=r.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!r.textObjectInner;if(o[a])s=xt(e,t,a,l);else if(i[a])s=Mt(e,t,a,l);else if("W"===a)s=ht(e,l,!0,!0);else if("w"===a)s=ht(e,l,!0,!1);else{if("p"!==a)return null;if(s=wt(e,t,r.repeat,0,l),r.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var c=n.inputState.operatorArgs;c&&(c.linewise=!0),s.end.line--}}return e.state.vim.visualMode?nt(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,r){var n=kr.lastChararacterSearch,o=r.repeat,i=r.forward===n.forward,a=(n.increment?1:0)*(i?-1:1);e.moveH(-a,"char"),r.inclusive=i?!0:!1;var s=vt(e,o,i,n.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}},Sr={change:function(t,r,n){var o,i,a=t.state.vim;if(kr.macroModeState.lastInsertModeChanges.inVisualBlock=a.visualBlock,a.visualMode){i=t.getSelection();var s=E("",n.length);t.replaceSelections(s),o=J(n[0].head,n[0].anchor)}else{var l=n[0].anchor,c=n[0].head;if(i=t.getRange(l,c),!g(i)){var u=/\s+$/.exec(i);u&&(c=P(c,0,-u[0].length),i=i.slice(0,-u[0].length))}var h=c.line-1==t.lastLine();t.replaceRange("",l,c),r.linewise&&!h&&(e.commands.newlineAndIndent(t),l.ch=null),o=l}kr.registerController.pushText(r.registerName,"change",i,r.linewise,n.length>1),Ar.enterInsertMode(t,{head:o},t.state.vim)},"delete":function(e,t,n){var o,i,a=e.state.vim;if(a.visualBlock){i=e.getSelection();var s=E("",n.length);e.replaceSelections(s),o=n[0].anchor}else{var l=n[0].anchor,c=n[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=r(l.line-1,q(e,l.line-1))),i=e.getRange(l,c),e.replaceRange("",l,c),o=l,t.linewise&&(o=Mr.moveToFirstNonWhiteSpaceCharacter(e,l))}return kr.registerController.pushText(t.registerName,"delete",i,t.linewise,a.visualBlock),O(e,o)},indent:function(e,t,r){var n=e.state.vim,o=r[0].anchor.line,i=n.visualBlock?r[r.length-1].anchor.line:r[0].head.line,a=n.visualMode?t.repeat:1;t.linewise&&i--;for(var s=o;i>=s;s++)for(var l=0;a>l;l++)e.indentLine(s,t.indentRight);return Mr.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},changeCase:function(e,t,r,n,o){for(var i=e.getSelections(),a=[],s=t.toLower,l=0;lc.top?(l.line+=(s-c.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u=a.anchor.line?P(a.head,0,1):r(a.anchor.line,0);else if("inplace"==i&&o.visualMode)return;t.setOption("keyMap","vim-insert"),t.setOption("disableInput",!1),n&&n.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})),kr.macroModeState.isPlaying||(t.on("change",Yt),e.on(t.getInputField(),"keydown",nr)),o.visualMode&&st(t),X(t,s,l)}},toggleVisualMode:function(t,n,o){var i,a=n.repeat,s=t.getCursor();o.visualMode?o.visualLine^n.linewise||o.visualBlock^n.blockwise?(o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t)):st(t):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,i=O(t,r(s.line,s.ch+a-1),!0),o.sel={anchor:s,head:i},e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t),kt(t,o,"<",J(s,i)),kt(t,o,">",U(s,i)))},reselectLastSelection:function(t,r,n){var o=n.lastSelection;if(n.visualMode&&rt(t,n),o){var i=o.anchorMark.find(),a=o.headMark.find();if(!i||!a)return;n.sel={anchor:i,head:a},n.visualMode=!0,n.visualLine=o.visualLine,n.visualBlock=o.visualBlock,ot(t),kt(t,n,"<",J(i,a)),kt(t,n,">",U(i,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var o,i;if(n.visualMode){if(o=e.getCursor("anchor"),i=e.getCursor("head"),_(i,o)){var a=i;i=o,o=a}i.ch=q(e,i.line)-1}else{var s=Math.max(t.repeat,2);o=e.getCursor(),i=O(e,r(o.line+s-1,1/0))}for(var l=0,c=o.line;cr)return"";if(e.getOption("indentWithTabs")){var n=Math.floor(r/s);return Array(n+1).join(" ")}return Array(r+1).join(" ")});a+=p?"\n":""}if(t.repeat>1)var a=Array(t.repeat+1).join(a);var f=i.linewise,m=i.blockwise;if(f)n.visualMode?a=n.visualLine?a.slice(0,-1):"\n"+a.slice(0,a.length-1)+"\n":t.after?(a="\n"+a.slice(0,a.length-1),o.ch=q(e,o.line)):o.ch=0;else{if(m){a=a.split("\n");for(var g=0;ge.lastLine()&&e.replaceRange("\n",r(b,0));var L=q(e,b);Lu.length&&(i=u.length),a=r(l.line,i)}if("\n"==s)o.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var h=t.getRange(l,a);if(h=h.replace(/[^\n]/g,s),o.visualBlock){var p=new Array(t.getOption("tabSize")+1).join(" ");h=t.getSelection(),h=h.replace(/\t/g,p).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(h)}else t.replaceRange(h,l,a);o.visualMode?(l=_(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),st(t,!1)):t.setCursor(P(a,0,-1))}},incrementNumberToken:function(e,t){for(var n,o,i,a,s,l=e.getCursor(),c=e.getLine(l.line),u=/-?\d+/g;null!==(n=u.exec(c))&&(s=n[0],o=n.index,i=o+s.length,!(l.ch=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb?!0:!1}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};y("pcre",!0,"boolean"),St.prototype={getQuery:function(){return kr.query},setQuery:function(e){kr.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return kr.isReversed},setReversed:function(e){kr.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Tr="(Javascript regexp)",Rr=[{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:"set"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],Er=function(){this.buildCommandMap_()};Er.prototype={processCommand:function(t,r,n){var o=t.state.vim,i=kr.registerController.getRegister(":"),a=i.toString();o.visualMode&&st(t);var s=new e.StringStream(r);i.setText(r);var l=n||{};l.input=r;try{this.parseInput_(t,s,l)}catch(c){throw Ot(t,c),c}var u,h;if(l.commandName){if(u=this.matchCommand_(l.commandName)){if(h=u.name,u.excludeFromCommandHistory&&i.setText(a),this.parseCommandArgs_(s,l,u),"exToKey"==u.type){for(var p=0;p0;t--){var r=e.substring(0,t);if(this.commandMap_[r]){var n=this.commandMap_[r];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={}; +-for(var e=0;e
    ";if(r){var i;r=r.join("");for(var a=0;a"}}else for(var i in n){var l=n[i].toString();l.length&&(o+='"'+i+" "+l+"
    ")}Ot(e,o)},sort:function(t,n){function o(){if(n.argString){var t=new e.StringStream(n.argString);if(t.eat("!")&&(a=!0),t.eol())return;if(!t.eatSpace())return"Invalid arguments";var r=t.match(/[a-z]+/);if(r){r=r[0],s=-1!=r.indexOf("i"),l=-1!=r.indexOf("u");var o=-1!=r.indexOf("d")&&1,i=-1!=r.indexOf("x")&&1,u=-1!=r.indexOf("o")&&1;if(o+i+u>1)return"Invalid arguments";c=o&&"decimal"||i&&"hex"||u&&"octal"}t.eatSpace()&&t.match(/\/.*\//)}}function i(e,t){if(a){var r;r=e,e=t,t=r}s&&(e=e.toLowerCase(),t=t.toLowerCase());var n=c&&g.exec(e),o=c&&g.exec(t);return n?(n=parseInt((n[1]+n[2]).toLowerCase(),v),o=parseInt((o[1]+o[2]).toLowerCase(),v),n-o):t>e?-1:1}var a,s,l,c,u=o();if(u)return void Ot(t,u+": "+n.argString);var h=n.line||t.firstLine(),p=n.lineEnd||n.line||t.lastLine();if(h!=p){var d=r(h,0),f=r(p,q(t,p)),m=t.getRange(d,f).split("\n"),g="decimal"==c?/(-?)([\d]+)/:"hex"==c?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==c?/([0-7]+)/:null,v="decimal"==c?10:"hex"==c?16:"octal"==c?8:null,y=[],k=[];if(c)for(var C=0;C=p;p++){var d=c.test(e.getLine(p));d&&(u.push(p+1),h+=e.getLine(p)+"
    ")}if(!n)return void Ot(e,h);var f=0,m=function(){if(f=u)return void Ot(t,"Invalid argument: "+r.argString.substring(i));for(var h=0;u-c>=h;h++){var d=String.fromCharCode(c+h);delete n.marks[d]}}else delete n.marks[a]}}},Ir=new Er;return e.keyMap.vim={attach:a,detach:i,call:s},y("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(t){var r=e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent;r(t)},fallthrough:["default"],attach:a,detach:i,call:s},e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:a,detach:i,call:s},M(),wr};e.Vim=n()}); +\ 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:"xi",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",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:"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:"moveToEol",motionArgs:{inclusive:!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:"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:"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:"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",_a),x(b),a.on(b.getInputField(),"paste",k(b))}function f(b){b.setOption("disableInput",!1),b.off("cursorActivity",_a),a.off(b.getInputField(),"paste",k(b)),b.state.vim=null}function g(b,c){this==a.keyMap.vim&&a.rmClass(b.getWrapperElement(),"cm-fat-cursor"),c&&c.attach==h||f(b,!1)}function h(b,c){this==a.keyMap.vim&&a.addClass(b.getWrapperElement(),"cm-fat-cursor"),c&&c.attach==h||e(b)}function i(b,c){if(!c)return void 0;var d=j(b);if(!d)return!1;var e=a.Vim.findKey(c,d);return"function"==typeof e&&a.signal(c,"vim-keypress",d),e}function j(a){if("'"==a.charAt(0))return a.charAt(1);var b=a.split("-");/-$/.test(a)&&b.splice(-2,2,"-");var c=b[b.length-1];if(1==b.length&&1==b[0].length)return!1;if(2==b.length&&"Shift"==b[0]&&1==c.length)return!1;for(var d=!1,e=0;e"):!1}function k(a){var b=a.state.vim;return b.onPasteFn||(b.onPasteFn=function(){b.insertMode||(a.setCursor(K(a.getCursor(),0,1)),zb.enterInsertMode(a,{},b))}),b.onPasteFn}function l(a,b){for(var c=[],d=a;a+b>d;d++)c.push(String.fromCharCode(d));return c}function m(a,b){return b>=a.firstLine()&&b<=a.lastLine()}function n(a){return/^[a-z]$/.test(a)}function o(a){return-1!="()[]{}".indexOf(a)}function p(a){return ib.test(a)}function q(a){return/^[A-Z]$/.test(a)}function r(a){return/^\s*$/.test(a)}function s(a,b){for(var c=0;cd;d++)c.push(a);return c}function G(a,b){yb[a]=b}function H(a,b){zb[a]=b}function I(a,b,c){var e=Math.min(Math.max(a.firstLine(),b.line),a.lastLine()),f=W(a,e)-1;f=c?f+1:f;var g=Math.min(Math.max(0,b.ch),f);return d(e,g)}function J(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function K(a,b,c){return"object"==typeof b&&(c=b.ch,b=b.line),d(a.line+b,a.ch+c)}function L(a,b){return{line:b.line-a.line,ch:b.line-a.line}}function M(a,b,c,d){for(var e,f=[],g=[],h=0;h"==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":!1}return a==b?"full":0==b.indexOf(a)?"partial":!1}function O(a){var b=/^.*(<[\w\-]+>)$/.exec(a),c=b?b[1]:a.slice(-1);if(c.length>1)switch(c){case"":c="\n";break;case"":c=" "}return c}function P(a,b,c){return function(){for(var d=0;c>d;d++)b(a)}}function Q(a){return d(a.line,a.ch)}function R(a,b){return a.ch==b.ch&&a.line==b.line}function S(a,b){return a.line2&&(b=T.apply(void 0,Array.prototype.slice.call(arguments,1))),S(a,b)?a:b}function U(a,b){return arguments.length>2&&(b=U.apply(void 0,Array.prototype.slice.call(arguments,1))),S(a,b)?b:a}function V(a,b,c){var d=S(a,b),e=S(b,c);return d&&e}function W(a,b){return a.getLine(b).length}function X(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Y(a){return a.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Z(a,b,c){var e=W(a,b),f=new Array(c-e+1).join(" ");a.setCursor(d(b,e)),a.replaceRange(f,a.getCursor())}function $(a,b){var c=[],e=a.listSelections(),f=Q(a.clipPos(b)),g=!R(b,f),h=a.getCursor("head"),i=aa(e,h),j=R(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&&0>=s?(p++,g||q--):0>r&&s>=0?(p--,j||q++):0>r&&-1==s&&(p--,q++);for(var t=n;o>=t;t++){var u={anchor:new d(t,p),head:new d(t,q)};c.push(u)}return i=f.line==o?c.length-1:0,a.setSelections(c),b.ch=q,m.ch=p,m}function _(a,b,c){for(var d=[],e=0;c>e;e++){var f=K(b,e,0);d.push({anchor:f,head:f})}a.setSelections(d,0)}function aa(a,b,c){for(var d=0;dj&&(f.line=j),f.ch=W(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;o>r;r++)q.push({anchor:d(k+r,l),head:d(k+r,n)});return{ranges:q,primary:p}}}function ga(a){var b=a.getCursor("head");return 1==a.getSelection().length&&(b=T(b,a.getCursor("anchor"))),b}function ha(b,c){var d=b.state.vim;c!==!1&&b.setCursor(I(b,d.sel.head)),ca(b,d),d.visualMode=!1,d.visualLine=!1,d.visualBlock=!1,a.signal(b,"vim-mode-change",{mode:"normal"}),d.fakeCursor&&d.fakeCursor.clear()}function ia(a,b,c){var d=a.getRange(b,c);if(/\n\s*$/.test(d)){var e=d.split("\n");e.pop();for(var f,f=e.pop();e.length>0&&f&&r(f);f=e.pop())c.line--,c.ch=0;f?(c.line--,c.ch=W(a,c.line)):c.ch=0}}function ja(a,b,c){b.ch=0,c.ch=0,c.line++}function ka(a){if(!a)return 0;var b=a.search(/\S/);return-1==b?a.length:b}function la(a,b,c,e,f){for(var g=ga(a),h=a.getLine(g.line),i=g.ch,j=f?jb[0]:kb[0];!j(h.charAt(i));)if(i++,i>=h.length)return null;e?j=kb[0]:(j=jb[0],j(h.charAt(i))||(j=jb[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 ma(a,b,c){R(b,c)||tb.jumpList.add(a,b,c)}function na(a,b){tb.lastChararacterSearch.increment=a,tb.lastChararacterSearch.forward=b.forward,tb.lastChararacterSearch.selectedCharacter=b.selectedCharacter}function oa(a,b,c,e){var f=Q(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=Ab[e];if(!m)return f;var n=Bb[m].init,o=Bb[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 pa(a,b,c,d,e){var f=b.line,g=b.ch,h=a.getLine(f),i=c?1:-1,j=d?kb:jb;if(e&&""==h){if(f+=i,h=a.getLine(f),!m(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,n=k;g!=k;){for(var o=!1,p=0;p0?0:h.length}throw new Error("The impossible happened.")}function qa(a,b,c,e,f,g){var h=Q(b),i=[];(e&&!f||!e&&f)&&c++;for(var j=!(e&&f),k=0;c>k;k++){var l=pa(a,b,e,g,j);if(!l){var m=W(a,a.lastLine());i.push(e?{line:a.lastLine(),from:m,to:m}:{line:0,from:0,to:0});break}i.push(l),b=d(l.line,e?l.to-1:l.from)}var n=i.length!=c,o=i[0],p=i.pop();return e&&!f?(n||o.from==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.from)):e&&f?d(p.line,p.to-1):!e&&f?(n||o.to==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.to)):d(p.line,p.from)}function ra(a,b,c,e){for(var f,g=a.getCursor(),h=g.ch,i=0;b>i;i++){var j=a.getLine(g.line);if(f=ua(h,j,e,c,!0),-1==f)return null;h=f}return d(a.getCursor().line,f)}function sa(a,b){var c=a.getCursor().line;return I(a,d(c,b-1))}function ta(a,b,c,d){s(c,ob)&&(b.marks[c]&&b.marks[c].clear(),b.marks[c]=a.setBookmark(d))}function ua(a,b,c,d,e){var f;return d?(f=b.indexOf(c,a+1),-1==f||e||(f-=1)):(f=b.lastIndexOf(c,a-1),-1==f||e||(f+=1)),f}function va(a,b,c,e,f){function g(b){return!a.getLine(b)}function h(a,b,c){return c?g(a)!=g(a+b):!g(a)&&g(a+b)}var i,j,k=b.line,l=a.firstLine(),m=a.lastLine(),n=k;if(e){for(;n>=l&&m>=n&&c>0;)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;m>=n&&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 wa(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 xa(a,b,c,e){var f,g,h,i,j=Q(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;i>h&&!g;h++)l[h]==c&&(g=h);return f&&g?(e&&(--f,++g),{start:d(j.line,f),end:d(j.line,g)}):{start:j,end:j}}function ya(){}function za(a){var b=a.state.vim;return b.searchState_||(b.searchState_=new ya)}function Aa(a,b,c,d,e){a.openDialog?a.openDialog(b,d,{bottom:!0,value:e.value,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,selectValueOnOpen:!1}):d(prompt(c,""))}function Ba(a){var b=Ca(a)||[];if(!b.length)return[];var c=[];if(0===b[0]){for(var d=0;d'+b+"
    ",{bottom:!0,duration:5e3}):alert(b)}function Ia(a,b){var c="";return a&&(c+=''+a+""),c+=' ',b&&(c+='',c+=b,c+=""),c}function Ja(a,b){var c=(b.prefix||"")+" "+(b.desc||""),d=Ia(b.prefix,b.desc);Aa(a,d,c,b.onClose,b)}function Ka(a,b){if(a instanceof RegExp&&b instanceof RegExp){for(var c=["global","multiline","ignoreCase","source"],d=0;dh;h++){var i=g.find(b);if(0==h&&i&&R(g.from(),f)&&(i=g.find(b)),!i&&(g=a.getSearchCursor(c,b?d(a.lastLine()):d(a.firstLine(),0)),!g.find(b)))return}return g.from()})}function Pa(a){var b=za(a);a.removeOverlay(za(a).getOverlay()),b.setOverlay(null),b.getScrollbarAnnotate()&&(b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(null))}function Qa(a,b,c){return"number"!=typeof a&&(a=a.line),b instanceof Array?s(a,b):c?a>=b&&c>=a:a==b}function Ra(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 Sa(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()&&Qa(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 Ha(b,"No matches for "+h.source):c?void Ja(b,{prefix:"replace with "+i+" (y/n/a/q/l)",onKeyDown:o}):(k(),void(j&&j()))}function Ta(b){var c=b.state.vim,d=tb.macroModeState,e=tb.registerController.getRegister("."),f=d.isPlaying,g=d.lastInsertModeChanges,h=[];if(!f){for(var i=g.inVisualBlock?c.lastSelection.visualBlock.height:1,j=g.changes,h=[],k=0;k1&&(eb(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&&Ya(d)}function Ua(a){b.push(a)}function Va(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];Ua(f)}function Wa(b,c,d,e){var f=tb.registerController.getRegister(e);if(":"==e)return f.keyBuffer[0]&&Hb.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;tb.macroModeState.lastInsertModeChanges.changes=m,fb(b,m,1),Ta(b)}d.isPlaying=!1}function Xa(a,b){if(!a.isPlaying){var c=a.latestRegister,d=tb.registerController.getRegister(c);d&&d.pushText(b)}}function Ya(a){if(!a.isPlaying){ ++var b=a.latestRegister,c=tb.registerController.getRegister(b);c&&c.pushInsertModeChanges(a.lastInsertModeChanges)}}function Za(a,b){if(!a.isPlaying){var c=a.latestRegister,d=tb.registerController.getRegister(c);d&&d.pushSearchQuery(b)}}function $a(a,b){var c=tb.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.changes.push(e)}b=b.next}}function _a(a){var b=a.state.vim;if(b.insertMode){var c=tb.macroModeState;if(c.isPlaying)return;var d=c.lastInsertModeChanges;d.expectCursorActivityForChange?d.expectCursorActivityForChange=!1:d.changes=[]}else a.curOp.isVimOp||bb(a,b);b.visualMode&&ab(a)}function ab(a){var b=a.state.vim,c=I(a,Q(b.sel.head)),d=K(c,0,1);b.fakeCursor&&b.fakeCursor.clear(),b.fakeCursor=a.markText(c,d,{className:"cm-animate-fat-cursor"})}function bb(b,c){var d=b.getCursor("anchor"),e=b.getCursor("head");if(c.visualMode&&!b.somethingSelected()?ha(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=S(e,d)?0:-1,g=S(e,d)?-1:0;e=K(e,0,f),d=K(d,0,g),c.sel={anchor:d,head:e},ta(b,c,"<",T(e,d)),ta(b,c,">",U(e,d))}else c.insertMode||(c.lastHPos=b.getCursor().ch)}function cb(a){this.keyName=a}function db(b){function c(){return e.changes.push(new cb(f)),!0}var d=tb.macroModeState,e=d.lastInsertModeChanges,f=a.keyName(b);f&&(-1!=f.indexOf("Delete")||-1!=f.indexOf("Backspace"))&&a.lookupKey(f,"vim-insert",c)}function eb(a,b,c,d){function e(){h?wb.processAction(a,b,b.lastEditActionCommand):wb.evalInput(a,b)}function f(c){if(g.lastInsertModeChanges.changes.length>0){c=b.lastEditActionCommand?c:1;var d=g.lastInsertModeChanges;fb(a,d.changes,c)}}var g=tb.macroModeState;g.isPlaying=!0;var h=!!b.lastEditActionCommand,i=b.inputState;if(b.inputState=b.lastEditInputState,h&&b.lastEditActionCommand.interlaceInsertRepeat)for(var j=0;c>j;j++)e(),f(1);else d||e(),f(c);b.inputState=i,b.insertMode&&!d&&Ta(a),g.isPlaying=!1}function fb(b,c,d){function e(c){return"string"==typeof c?a.commands[c](b):c(b),!0}var f=b.getCursor("head"),g=tb.macroModeState.lastInsertModeChanges.inVisualBlock;if(g){var h=b.state.vim,i=h.lastSelection,j=L(i.anchor,i.head);_(b,f,j.line+1),d=b.listSelections().length,b.setCursor(f)}for(var k=0;d>k;k++){g&&b.setCursor(K(f,k,0));for(var l=0;l"]),pb=[].concat(lb,mb,nb,["-",'"',".",":","/"]),qb={};t("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 rb=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&&!R(l,b)&&i(b)}else i(b);i(h),e=d,f=d-c+1,0>f&&(f=0)}function b(a,b){d+=b,d>e?d=e:f>d&&(d=f);var h=g[(c+d)%c];if(h&&!h.find()){var i,j=b>0?1:-1,k=a.getCursor();do if(d+=j,h=g[(c+d)%c],h&&(i=h.find())&&!R(k,i))break;while(e>d&&d>f)}return h}var c=100,d=-1,e=0,f=0,g=new Array(c);return{cachedCursor:void 0,add:a,move:b}},sb=function(a){return a?{changes:a.changes,expectCursorActivityForChange:a.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var a=tb.macroModeState;a.onRecordingDone&&a.onRecordingDone(),a.onRecordingDone=void 0,a.isRecording=!1},enterMacroRecordMode:function(a,b){var c=tb.registerController.getRegister(b);c&&(c.clear(),this.latestRegister=b,a.openDialog&&(this.onRecordingDone=a.openDialog("(recording)["+b+"]",null,{bottom:!0})),this.isRecording=!0)}};var tb,ub,vb={buildKeyMap:function(){},getRegisterController:function(){return tb.registerController},resetVimGlobalState_:y,getVimGlobalState_:function(){return tb},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:cb,map:function(a,b,c){Hb.map(a,b,c)},setOption:u,getOption:v,defineOption:t,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;Gb[a]=c,Hb.commandMap_[b]={name:a,shortName:b,type:"api"}},handleKey:function(a,b,c){var d=this.findKey(a,b,c);return"function"==typeof d?d():void 0},findKey:function(c,d,e){function f(){var a=tb.macroModeState;if(a.isRecording){if("q"==d)return a.exitMacroRecordMode(),A(c),!0;"mapping"!=e&&Xa(a,d)}}function g(){return""==d?(A(c),l.visualMode?ha(c):l.insertMode&&Ta(c),!0):void 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=wb.matchCommand(a,b,l.inputState,"insert");a.length>1&&"full"!=f.type;){var a=l.inputState.keyBuffer=a.slice(1),h=wb.matchCommand(a,b,l.inputState,"insert");"none"!=h.type&&(f=h)}if("none"==f.type)return A(c),!1;if("partial"==f.type)return ub&&window.clearTimeout(ub),ub=window.setTimeout(function(){l.insertMode&&l.inputState.keyBuffer&&A(c)},v("insertModeEscKeysTimeout")),!e;if(ub&&window.clearTimeout(ub),e){var i=c.getCursor();c.replaceRange("",K(i,0,-(a.length-1)),i,"+input")}return A(c),f.command}function j(){if(f()||g())return!0;var a=l.inputState.keyBuffer=l.inputState.keyBuffer+d;if(/^[1-9]\d*$/.test(a))return!0;var e=/^(\d*)(.*)$/.exec(a);if(!e)return A(c),!1;var h=l.visualMode?"visual":"normal",i=wb.matchCommand(e[2]||e[1],b,l.inputState,h);if("none"==i.type)return A(c),!1;if("partial"==i.type)return!0;l.inputState.keyBuffer="";var e=/^(\d*)(.*)$/.exec(a);return e[1]&&"0"!=e[1]&&l.inputState.pushRepeatDigit(e[1]),i.command}var k,l=x(c);return k=l.insertMode?i():j(),k===!1?void 0:k===!0?function(){}:function(){return c.operation(function(){c.curOp.isVimOp=!0;try{"keyToKey"==k.type?h(k.toKeys):wb.processCommand(c,l,k)}catch(b){throw c.state.vim=void 0,x(c),a.Vim.suppressErrorLogging||console.log(b),b}return!0})}},handleEx:function(a,b){Hb.processCommand(a,b)},defineMotion:E,defineAction:H,defineOperator:G,mapCommand:Va,_mapCommand:Ua,exitVisualMode:ha,exitInsertMode:Ta};z.prototype.pushRepeatDigit=function(a){this.operator?this.motionRepeat=this.motionRepeat.concat(a):this.prefixRepeat=this.prefixRepeat.concat(a)},z.prototype.getRepeat=function(){var a=0;return(this.prefixRepeat.length>0||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},B.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(sb(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("")}},C.prototype={pushText:function(a,b,c,d,e){d&&"\n"==c.charAt(0)&&(c=c.slice(1)+"\n"),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 B(c,d,e);break;case"delete":case"change":-1==c.indexOf("\n")?this.registers["-"]=new B(c,d):(this.shiftNumericRegisters_(),this.registers[1]=new B(c,d))}return void this.unnamedRegister.setText(c,d,e)}var g=q(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 B),this.registers[a]):this.unnamedRegister},isValidRegister:function(a){return a&&s(a,pb)},shiftNumericRegisters_:function(){for(var a=9;a>=2;a--)this.registers[a]=this.getRegister(""+(a-1))}},D.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):0>e?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 wb={matchCommand:function(a,b,c,d){var e=M(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)&&(c.selectedCharacter=O(a)),{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=J(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);A(a)}d.operator=c.operator,d.operatorArgs=J(c.operatorArgs),b.visualMode&&this.evalInput(a,b)},processOperatorMotion:function(a,b,c){var d=b.visualMode,e=J(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=J(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,A(a),b.lastMotion=null,c.isEdit&&this.recordLastEdit(b,d,c),zb[c.action](a,g,b)},processSearch:function(b,c,d){function e(a,e,f){tb.searchHistoryController.pushInput(a),tb.searchHistoryController.reset();try{La(b,a,e,f)}catch(g){return Ha(b,"Invalid regex: "+a),void A(b)}wb.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=tb.macroModeState;c.isRecording&&Za(c,a)}function g(c,d,e){var f,g=a.keyName(c);"Up"==g||"Down"==g?(f="Up"==g?!0:!1,d=tb.searchHistoryController.nextMatch(d,f)||"",e(d)):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&tb.searchHistoryController.reset();var h;try{h=La(b,d,!0,!0)}catch(c){}h?b.scrollIntoView(Oa(b,!i,h),30):(Pa(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?(tb.searchHistoryController.pushInput(d),tb.searchHistoryController.reset(),La(b,l),Pa(b),b.scrollTo(m.left,m.top),a.e_stop(c),A(b),e(),b.focus()):"Ctrl-U"==f&&(a.e_stop(c),e(""))}if(b.getSearchCursor){var i=d.searchArgs.forward,j=d.searchArgs.wholeWordOnly;za(b).setReversed(!i);var k=i?"/":"?",l=za(b).getQuery(),m=b.getScrollInfo();switch(d.searchArgs.querySrc){case"prompt":var n=tb.macroModeState;if(n.isPlaying){var o=n.replaySearchQueries.shift();e(o,!0,!1)}else Ja(b,{onClose:f,prefix:k,desc:Eb,onKeyUp:g,onKeyDown:h});break;case"wordUnderCursor":var p=la(b,!1,!0,!1,!0),q=!0;if(p||(p=la(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":Y(o),tb.jumpList.cachedCursor=b.getCursor(),b.setCursor(p.start),e(o,!0,!1)}}},processEx:function(b,c,d){function e(a){tb.exCommandHistoryController.pushInput(a),tb.exCommandHistoryController.reset(),Hb.processCommand(b,a)}function f(c,d,e){var f,g=a.keyName(c);("Esc"==g||"Ctrl-C"==g||"Ctrl-["==g||"Backspace"==g&&""==d)&&(tb.exCommandHistoryController.pushInput(d),tb.exCommandHistoryController.reset(),a.e_stop(c),A(b),e(),b.focus()),"Up"==g||"Down"==g?(f="Up"==g?!0:!1,d=tb.exCommandHistoryController.nextMatch(d,f)||"",e(d)):"Ctrl-U"==g?(a.e_stop(c),e("")):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&tb.exCommandHistoryController.reset()}"keyToEx"==d.type?Hb.processCommand(b,d.exArgs.input):c.visualMode?Ja(b,{onClose:e,prefix:":",value:"'<,'>",onKeyDown:f}):Ja(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=Q(b.visualMode?I(a,m.head):a.getCursor("head")),o=Q(b.visualMode?I(a,m.anchor):a.getCursor("anchor")),p=Q(n),q=Q(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,A(a),h){var r=xb[h](a,n,i,b);if(b.lastMotion=xb[h],!r)return;if(i.toJumplist){var s=tb.jumpList,t=s.cachedCursor;t?(ma(a,t,r),delete s.cachedCursor):ma(a,n,r)}r instanceof Array?(e=r[0],c=r[1]):c=r,c||(c=Q(n)),b.visualMode?(b.visualBlock&&c.ch===1/0||(c=I(a,c,b.visualBlock)),e&&(e=I(a,e,!0)),e=e||q,m.anchor=e,m.head=c,ea(a),ta(a,b,"<",S(e,c)?e:c),ta(a,b,">",S(e,c)?c:e)):j||(c=I(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},ea(a)}else b.visualMode&&(k.lastSel={anchor:Q(m.anchor),head:Q(m.head),visualBlock:b.visualBlock,visualLine:b.visualLine});var x,y,z,B,C;if(b.visualMode){if(x=T(m.head,m.anchor),y=U(m.head,m.anchor),z=b.visualLine||k.linewise,B=b.visualBlock?"block":z?"line":"char",C=fa(a,{anchor:x,head:y},B),z){var D=C.ranges;if("block"==B)for(var E=0;Ei&&f.line==j||i>k&&f.line==k?void 0:(c.toFirstChar&&(g=ka(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 va(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=xb.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 qa(a,b,c.repeat,!!c.forward,!!c.wordEnd,!!c.bigWord)},moveTillCharacter:function(a,b,c){var d=c.repeat,e=ra(a,d,c.forward,c.selectedCharacter),f=c.forward?-1:1;return na(f,c),e?(e.ch+=f,e):null},moveToCharacter:function(a,b,c){var d=c.repeat;return na(0,c),ra(a,d,c.forward,c.selectedCharacter)||b},moveToSymbol:function(a,b,c){var d=c.repeat;return oa(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,sa(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,ka(a.getLine(c.line)))},moveToMatchedSymbol:function(a,b){var c,e=b,f=e.line,g=e.ch,h=a.getLine(f);do if(c=h.charAt(g++),c&&o(c)){var i=a.getTokenTypeAt(d(f,g));if("string"!==i&&"comment"!==i)break}while(c);if(c){var j=a.findMatchingBracket(d(f,g));return j.to}return e},moveToStartOfLine:function(a,b){return d(b.line,0)},moveToLineOrEdgeOfDocument:function(a,b,c){var e=c.forward?a.lastLine():a.firstLine();return c.repeatIsExplicit&&(e=c.repeat-a.getOption("firstLineNumber")),d(e,ka(a.getLine(e)))},textObjectManipulation:function(a,b,c,d){var e={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},f={"'":!0,'"':!0},g=c.selectedCharacter;"b"==g?g="(":"B"==g&&(g="{");var h,i=!c.textObjectInner;if(e[g])h=wa(a,b,g,i);else if(f[g])h=xa(a,b,g,i);else if("W"===g)h=la(a,i,!0,!0);else if("w"===g)h=la(a,i,!0,!1);else{if("p"!==g)return null;if(h=va(a,b,c.repeat,0,i),c.linewise=!0,d.visualMode)d.visualLine||(d.visualLine=!0);else{var j=d.inputState.operatorArgs;j&&(j.linewise=!0),h.end.line--}}return a.state.vim.visualMode?da(a,h.start,h.end):[h.start,h.end]},repeatLastCharacterSearch:function(a,b,c){var d=tb.lastChararacterSearch,e=c.repeat,f=c.forward===d.forward,g=(d.increment?1:0)*(f?-1:1);a.moveH(-g,"char"),c.inclusive=f?!0:!1;var h=ra(a,e,f,d.selectedCharacter);return h?(h.ch+=g,h):(a.moveH(g,"char"),b)}},yb={change:function(b,c,d){var e,f,g=b.state.vim;if(tb.macroModeState.lastInsertModeChanges.inVisualBlock=g.visualBlock,g.visualMode){f=b.getSelection();var h=F("",d.length);b.replaceSelections(h),e=T(d[0].head,d[0].anchor)}else{var i=d[0].anchor,j=d[0].head;f=b.getRange(i,j);var k=g.lastEditInputState||{};if("moveByWords"==k.motion&&!r(f)){var l=/\s+$/.exec(f);l&&k.motionArgs&&k.motionArgs.forward&&(j=K(j,0,-l[0].length),f=f.slice(0,-l[0].length))}var m=j.line-1==b.lastLine();b.replaceRange("",i,j),c.linewise&&!m&&(a.commands.newlineAndIndent(b),i.ch=null),e=i}tb.registerController.pushText(c.registerName,"change",f,c.linewise,d.length>1),zb.enterInsertMode(b,{head:e},b.state.vim)},"delete":function(a,b,c){var e,f,g=a.state.vim;if(g.visualBlock){f=a.getSelection();var h=F("",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,W(a,i.line-1))),f=a.getRange(i,j),a.replaceRange("",i,j),e=i,b.linewise&&(e=xb.moveToFirstNonWhiteSpaceCharacter(a,i))}return tb.registerController.pushText(b.registerName,"delete",f,b.linewise,g.visualBlock),I(a,e)},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;f>=h;h++)for(var i=0;g>i;i++)a.indentLine(h,b.indentRight);return xb.moveToFirstNonWhiteSpaceCharacter(a,c[0].anchor)},changeCase:function(a,b,c,d,e){for(var f=a.getSelections(),g=[],h=b.toLower,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?K(g.head,0,1):d(g.anchor.line,0);else if("inplace"==f&&e.visualMode)return;b.setOption("keyMap","vim-insert"),b.setOption("disableInput",!1),c&&c.replace?(b.toggleOverwrite(!0),b.setOption("keyMap","vim-replace"),a.signal(b,"vim-mode-change",{mode:"replace"})):(b.setOption("keyMap","vim-insert"),a.signal(b,"vim-mode-change",{mode:"insert"})),tb.macroModeState.isPlaying||(b.on("change",$a),a.on(b.getInputField(),"keydown",db)),e.visualMode&&ha(b),_(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":""}),ea(b)):ha(b):(e.visualMode=!0,e.visualLine=!!c.linewise,e.visualBlock=!!c.blockwise,f=I(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":""}),ea(b),ta(b,e,"<",T(h,f)),ta(b,e,">",U(h,f)))},reselectLastSelection:function(b,c,d){var e=d.lastSelection;if(d.visualMode&&ca(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,ea(b),ta(b,d,"<",T(f,g)),ta(b,d,">",U(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"),S(f,e)){var g=f;f=e,e=g}f.ch=W(a,f.line)-1}else{var h=Math.max(b.repeat,2);e=a.getCursor(),f=I(a,d(e.line+h-1,1/0))}for(var i=0,j=e.line;jc)return"";if(a.getOption("indentWithTabs")){var d=Math.floor(c/h);return Array(d+1).join(" ")}return Array(c+1).join(" ")});g+=m?"\n":""}if(b.repeat>1)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=W(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=W(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=S(j[0].anchor,j[0].head)?j[0].anchor:j[0].head,b.setCursor(i),ha(b,!1)):b.setCursor(K(g,0,-1))}},incrementNumberToken:function(a,b){for(var c,e,f,g,h,i=a.getCursor(),j=a.getLine(i.line),k=/-?\d+/g;null!==(c=k.exec(j))&&(h=c[0],e=c.index,f=e+h.length,!(i.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?!0:!1}},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}}};t("pcre",!0,"boolean"),ya.prototype={getQuery:function(){return tb.query},setQuery:function(a){tb.query=a},getOverlay:function(){return this.searchOverlay},setOverlay:function(a){this.searchOverlay=a},isReversed:function(){return tb.isReversed},setReversed:function(a){tb.isReversed=a},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(a){this.annotate=a}};var Cb={"\\n":"\n","\\r":"\r","\\t":" "},Db={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":" "},Eb="(Javascript regexp)",Fb=function(){this.buildCommandMap_()};Fb.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=tb.registerController.getRegister(":"),g=f.toString();e.visualMode&&ha(b);var h=new a.StringStream(c);f.setText(c);var i=d||{};i.input=c;try{this.parseInput_(b,h,i)}catch(j){throw Ha(b,j),j}var k,l;if(i.commandName){if(k=this.matchCommand_(i.commandName)){ ++if(l=k.name,k.excludeFromCommandHistory&&f.setText(g),this.parseCommandArgs_(h,i,k),"exToKey"==k.type){for(var m=0;m0;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+"
    ")}Ha(a,e)},sort:function(b,c){function e(){if(c.argString){var b=new a.StringStream(c.argString);if(b.eat("!")&&(g=!0),b.eol())return;if(!b.eatSpace())return"Invalid arguments";var d=b.match(/[a-z]+/);if(d){d=d[0],h=-1!=d.indexOf("i"),i=-1!=d.indexOf("u");var e=-1!=d.indexOf("d")&&1,f=-1!=d.indexOf("x")&&1,k=-1!=d.indexOf("o")&&1;if(e+f+k>1)return"Invalid arguments";j=e&&"decimal"||f&&"hex"||k&&"octal"}b.eatSpace()&&b.match(/\/.*\//)}}function f(a,b){if(g){var c;c=a,a=b,b=c}h&&(a=a.toLowerCase(),b=b.toLowerCase());var d=j&&q.exec(a),e=j&&q.exec(b);return d?(d=parseInt((d[1]+d[2]).toLowerCase(),r),e=parseInt((e[1]+e[2]).toLowerCase(),r),d-e):b>a?-1:1}var g,h,i,j,k=e();if(k)return void Ha(b,k+": "+c.argString);var l=c.line||b.firstLine(),m=c.lineEnd||c.line||b.lastLine();if(l!=m){var n=d(l,0),o=d(m,W(b,m)),p=b.getRange(n,o).split("\n"),q="decimal"==j?/(-?)([\d]+)/:"hex"==j?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==j?/([0-7]+)/:null,r="decimal"==j?10:"hex"==j?16:"octal"==j?8:null,s=[],t=[];if(j)for(var u=0;u=m;m++){var n=j.test(a.getLine(m));n&&(k.push(m+1),l+=a.getLine(m)+"
    ")}if(!d)return void Ha(a,l);var o=0,p=function(){if(o=k)return void Ha(b,"Invalid argument: "+c.argString.substring(f));for(var l=0;k-j>=l;l++){var m=String.fromCharCode(j+l);delete d.marks[m]}}else delete d.marks[g]}}},Hb=new Fb;return a.keyMap.vim={attach:h,detach:g,call:i},t("insertModeEscKeysTimeout",200,"number"),a.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(b){var c=a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent;c(b)},fallthrough:["default"],attach:h,detach:g,call:i},a.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:h,detach:g,call:i},y(),vb};a.Vim=e()}); +\ No newline at end of file +diff --git a/media/editors/codemirror/lib/addons.css b/media/editors/codemirror/lib/addons.css +new file mode 100644 +index 0000000..5c73dea +--- /dev/null ++++ b/media/editors/codemirror/lib/addons.css +@@ -0,0 +1,94 @@ ++.CodeMirror-fullscreen { ++ position: fixed; ++ top: 0; left: 0; right: 0; bottom: 0; ++ height: auto; ++ z-index: 9; ++} ++ ++.CodeMirror-foldmarker { ++ color: blue; ++ text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; ++ font-family: arial; ++ line-height: .3; ++ cursor: pointer; ++} ++.CodeMirror-foldgutter { ++ width: .7em; ++} ++.CodeMirror-foldgutter-open, ++.CodeMirror-foldgutter-folded { ++ cursor: pointer; ++} ++.CodeMirror-foldgutter-open:after { ++ content: "\25BE"; ++} ++.CodeMirror-foldgutter-folded:after { ++ content: "\25B8"; ++} ++ ++.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { ++ position: absolute; ++ background: #ccc; ++ -moz-box-sizing: border-box; ++ box-sizing: border-box; ++ border: 1px solid #bbb; ++ border-radius: 2px; ++} ++ ++.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { ++ position: absolute; ++ z-index: 6; ++ background: #eee; ++} ++ ++.CodeMirror-simplescroll-horizontal { ++ bottom: 0; left: 0; ++ height: 8px; ++} ++.CodeMirror-simplescroll-horizontal div { ++ bottom: 0; ++ height: 100%; ++} ++ ++.CodeMirror-simplescroll-vertical { ++ right: 0; top: 0; ++ width: 8px; ++} ++.CodeMirror-simplescroll-vertical div { ++ right: 0; ++ width: 100%; ++} ++ ++ ++.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { ++ display: none; ++} ++ ++.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { ++ position: absolute; ++ background: #bcd; ++ border-radius: 3px; ++} ++ ++.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { ++ position: absolute; ++ z-index: 6; ++} ++ ++.CodeMirror-overlayscroll-horizontal { ++ bottom: 0; left: 0; ++ height: 6px; ++} ++.CodeMirror-overlayscroll-horizontal div { ++ bottom: 0; ++ height: 100%; ++} ++ ++.CodeMirror-overlayscroll-vertical { ++ right: 0; top: 0; ++ width: 6px; ++} ++.CodeMirror-overlayscroll-vertical div { ++ right: 0; ++ width: 100%; ++} +diff --git a/media/editors/codemirror/lib/addons.js b/media/editors/codemirror/lib/addons.js +index ac63cd9..482dab6 100644 +--- a/media/editors/codemirror/lib/addons.js ++++ b/media/editors/codemirror/lib/addons.js +@@ -1,20 +1,3 @@ +-/** +- * addon/display/fullscreen.js +- * addon/display/panel.js +- * addon/edit/closebrackets.js +- * addon/edit/closetag.js +- * addon/edit/matchbrackets.js +- * addon/edit/matchtags.js +- * addon/fold/brace-fold.js +- * addon/fold/foldcode.js +- * addon/fold/foldgutter.js +- * addon/fold/xml-fold.js +- * addon/mode/loadmode.js +- * addon/mode/multiplex.js +- * addon/scroll/simplescrollbars.js +- * addon/selection/active-line.js +- * keymap/vim.js +-**/ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -56,6 +39,7 @@ + cm.refresh(); + } + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -68,13 +52,31 @@ + mod(CodeMirror); + })(function(CodeMirror) { + CodeMirror.defineExtension("addPanel", function(node, options) { ++ options = options || {}; ++ + if (!this.state.panels) initPanels(this); + + var info = this.state.panels; +- if (options && options.position == "bottom") +- info.wrapper.appendChild(node); +- else +- info.wrapper.insertBefore(node, info.wrapper.firstChild); ++ var wrapper = info.wrapper; ++ var cmWrapper = this.getWrapperElement(); ++ ++ if (options.after instanceof Panel && !options.after.cleared) { ++ wrapper.insertBefore(node, options.before.node.nextSibling); ++ } else if (options.before instanceof Panel && !options.before.cleared) { ++ wrapper.insertBefore(node, options.before.node); ++ } else if (options.replace instanceof Panel && !options.replace.cleared) { ++ wrapper.insertBefore(node, options.replace.node); ++ options.replace.clear(); ++ } else if (options.position == "bottom") { ++ wrapper.appendChild(node); ++ } else if (options.position == "before-bottom") { ++ wrapper.insertBefore(node, cmWrapper.nextSibling); ++ } else if (options.position == "after-top") { ++ wrapper.insertBefore(node, cmWrapper); ++ } else { ++ wrapper.insertBefore(node, wrapper.firstChild); ++ } ++ + var height = (options && options.height) || node.offsetHeight; + this._setSize(null, info.heightLeft -= height); + info.panels++; +@@ -150,6 +152,7 @@ + cm.setSize(); + } + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -161,29 +164,158 @@ + else // Plain browser env + mod(CodeMirror); + })(function(CodeMirror) { +- var DEFAULT_BRACKETS = "()[]{}''\"\""; +- var DEFAULT_TRIPLES = "'\""; +- var DEFAULT_EXPLODE_ON_ENTER = "[]{}"; +- var SPACE_CHAR_REGEX = /\s/; ++ var defaults = { ++ pairs: "()[]{}''\"\"", ++ triples: "", ++ explode: "[]{}" ++ }; + + var Pos = CodeMirror.Pos; + + CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) { +- if (old != CodeMirror.Init && old) +- cm.removeKeyMap("autoCloseBrackets"); +- if (!val) return; +- var pairs = DEFAULT_BRACKETS, triples = DEFAULT_TRIPLES, explode = DEFAULT_EXPLODE_ON_ENTER; +- if (typeof val == "string") pairs = val; +- else if (typeof val == "object") { +- if (val.pairs != null) pairs = val.pairs; +- if (val.triples != null) triples = val.triples; +- if (val.explode != null) explode = val.explode; +- } +- var map = buildKeymap(pairs, triples); +- if (explode) map.Enter = buildExplodeHandler(explode); +- cm.addKeyMap(map); ++ if (old && old != CodeMirror.Init) { ++ cm.removeKeyMap(keyMap); ++ cm.state.closeBrackets = null; ++ } ++ if (val) { ++ cm.state.closeBrackets = val; ++ cm.addKeyMap(keyMap); ++ } + }); + ++ function getOption(conf, name) { ++ if (name == "pairs" && typeof conf == "string") return conf; ++ if (typeof conf == "object" && conf[name] != null) return conf[name]; ++ return defaults[name]; ++ } ++ ++ var bind = defaults.pairs + "`"; ++ var keyMap = {Backspace: handleBackspace, Enter: handleEnter}; ++ for (var i = 0; i < bind.length; i++) ++ keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i)); ++ ++ function handler(ch) { ++ return function(cm) { return handleChar(cm, ch); }; ++ } ++ ++ function getConfig(cm) { ++ var deflt = cm.state.closeBrackets; ++ if (!deflt) return null; ++ var mode = cm.getModeAt(cm.getCursor()); ++ return mode.closeBrackets || deflt; ++ } ++ ++ function handleBackspace(cm) { ++ var conf = getConfig(cm); ++ if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; ++ ++ var pairs = getOption(conf, "pairs"); ++ var ranges = cm.listSelections(); ++ for (var i = 0; i < ranges.length; i++) { ++ if (!ranges[i].empty()) return CodeMirror.Pass; ++ var around = charsAround(cm, ranges[i].head); ++ if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; ++ } ++ for (var i = ranges.length - 1; i >= 0; i--) { ++ var cur = ranges[i].head; ++ cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); ++ } ++ } ++ ++ function handleEnter(cm) { ++ var conf = getConfig(cm); ++ var explode = conf && getOption(conf, "explode"); ++ if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass; ++ ++ var ranges = cm.listSelections(); ++ for (var i = 0; i < ranges.length; i++) { ++ if (!ranges[i].empty()) return CodeMirror.Pass; ++ var around = charsAround(cm, ranges[i].head); ++ if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass; ++ } ++ cm.operation(function() { ++ cm.replaceSelection("\n\n", null); ++ cm.execCommand("goCharLeft"); ++ ranges = cm.listSelections(); ++ for (var i = 0; i < ranges.length; i++) { ++ var line = ranges[i].head.line; ++ cm.indentLine(line, null, true); ++ cm.indentLine(line + 1, null, true); ++ } ++ }); ++ } ++ ++ function handleChar(cm, ch) { ++ var conf = getConfig(cm); ++ if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; ++ ++ var pairs = getOption(conf, "pairs"); ++ var pos = pairs.indexOf(ch); ++ if (pos == -1) return CodeMirror.Pass; ++ var triples = getOption(conf, "triples"); ++ ++ var identical = pairs.charAt(pos + 1) == ch; ++ var ranges = cm.listSelections(); ++ var opening = pos % 2 == 0; ++ ++ var type, next; ++ for (var i = 0; i < ranges.length; i++) { ++ var range = ranges[i], cur = range.head, curType; ++ var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); ++ if (opening && !range.empty()) { ++ curType = "surround"; ++ } else if ((identical || !opening) && next == ch) { ++ if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch) ++ curType = "skipThree"; ++ else ++ curType = "skip"; ++ } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && ++ cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch && ++ (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) { ++ curType = "addFour"; ++ } else if (identical) { ++ if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both"; ++ else return CodeMirror.Pass; ++ } else if (opening && (cm.getLine(cur.line).length == cur.ch || ++ isClosingBracket(next, pairs) || ++ /\s/.test(next))) { ++ curType = "both"; ++ } else { ++ return CodeMirror.Pass; ++ } ++ if (!type) type = curType; ++ else if (type != curType) return CodeMirror.Pass; ++ } ++ ++ var left = pos % 2 ? pairs.charAt(pos - 1) : ch; ++ var right = pos % 2 ? ch : pairs.charAt(pos + 1); ++ cm.operation(function() { ++ if (type == "skip") { ++ cm.execCommand("goCharRight"); ++ } else if (type == "skipThree") { ++ for (var i = 0; i < 3; i++) ++ cm.execCommand("goCharRight"); ++ } else if (type == "surround") { ++ var sels = cm.getSelections(); ++ for (var i = 0; i < sels.length; i++) ++ sels[i] = left + sels[i] + right; ++ cm.replaceSelections(sels, "around"); ++ } else if (type == "both") { ++ cm.replaceSelection(left + right, null); ++ cm.triggerElectric(left + right); ++ cm.execCommand("goCharLeft"); ++ } else if (type == "addFour") { ++ cm.replaceSelection(left + left + left + left, "before"); ++ cm.execCommand("goCharRight"); ++ } ++ }); ++ } ++ ++ function isClosingBracket(ch, pairs) { ++ var pos = pairs.lastIndexOf(ch); ++ return pos > -1 && pos % 2 == 1; ++ } ++ + function charsAround(cm, pos) { + var str = cm.getRange(Pos(pos.line, pos.ch - 1), + Pos(pos.line, pos.ch + 1)); +@@ -205,112 +337,8 @@ + stream.start = stream.pos; + } + } +- +- function buildKeymap(pairs, triples) { +- var map = { +- name : "autoCloseBrackets", +- Backspace: function(cm) { +- if (cm.getOption("disableInput")) return CodeMirror.Pass; +- var ranges = cm.listSelections(); +- for (var i = 0; i < ranges.length; i++) { +- if (!ranges[i].empty()) return CodeMirror.Pass; +- var around = charsAround(cm, ranges[i].head); +- if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; +- } +- for (var i = ranges.length - 1; i >= 0; i--) { +- var cur = ranges[i].head; +- cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); +- } +- } +- }; +- var closingBrackets = ""; +- for (var i = 0; i < pairs.length; i += 2) (function(left, right) { +- closingBrackets += right; +- map["'" + left + "'"] = function(cm) { +- if (cm.getOption("disableInput")) return CodeMirror.Pass; +- var ranges = cm.listSelections(), type, next; +- for (var i = 0; i < ranges.length; i++) { +- var range = ranges[i], cur = range.head, curType; +- var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); +- if (!range.empty()) { +- curType = "surround"; +- } else if (left == right && next == right) { +- if (cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == left + left + left) +- curType = "skipThree"; +- else +- curType = "skip"; +- } else if (left == right && cur.ch > 1 && triples.indexOf(left) >= 0 && +- cm.getRange(Pos(cur.line, cur.ch - 2), cur) == left + left && +- (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != left)) { +- curType = "addFour"; +- } else if (left == '"' || left == "'") { +- if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, left)) curType = "both"; +- else return CodeMirror.Pass; +- } else if (cm.getLine(cur.line).length == cur.ch || closingBrackets.indexOf(next) >= 0 || SPACE_CHAR_REGEX.test(next)) { +- curType = "both"; +- } else { +- return CodeMirror.Pass; +- } +- if (!type) type = curType; +- else if (type != curType) return CodeMirror.Pass; +- } +- +- cm.operation(function() { +- if (type == "skip") { +- cm.execCommand("goCharRight"); +- } else if (type == "skipThree") { +- for (var i = 0; i < 3; i++) +- cm.execCommand("goCharRight"); +- } else if (type == "surround") { +- var sels = cm.getSelections(); +- for (var i = 0; i < sels.length; i++) +- sels[i] = left + sels[i] + right; +- cm.replaceSelections(sels, "around"); +- } else if (type == "both") { +- cm.replaceSelection(left + right, null); +- cm.execCommand("goCharLeft"); +- } else if (type == "addFour") { +- cm.replaceSelection(left + left + left + left, "before"); +- cm.execCommand("goCharRight"); +- } +- }); +- }; +- if (left != right) map["'" + right + "'"] = function(cm) { +- var ranges = cm.listSelections(); +- for (var i = 0; i < ranges.length; i++) { +- var range = ranges[i]; +- if (!range.empty() || +- cm.getRange(range.head, Pos(range.head.line, range.head.ch + 1)) != right) +- return CodeMirror.Pass; +- } +- cm.execCommand("goCharRight"); +- }; +- })(pairs.charAt(i), pairs.charAt(i + 1)); +- return map; +- } +- +- function buildExplodeHandler(pairs) { +- return function(cm) { +- if (cm.getOption("disableInput")) return CodeMirror.Pass; +- var ranges = cm.listSelections(); +- for (var i = 0; i < ranges.length; i++) { +- if (!ranges[i].empty()) return CodeMirror.Pass; +- var around = charsAround(cm, ranges[i].head); +- if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; +- } +- cm.operation(function() { +- cm.replaceSelection("\n\n", null); +- cm.execCommand("goCharLeft"); +- ranges = cm.listSelections(); +- for (var i = 0; i < ranges.length; i++) { +- var line = ranges[i].head.line; +- cm.indentLine(line, null, true); +- cm.indentLine(line + 1, null, true); +- } +- }); +- }; +- } + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -477,6 +505,7 @@ + return true; + } + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -597,6 +626,7 @@ + return scanForBracket(this, pos, dir, style, config); + }); + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -663,6 +693,7 @@ + } + }; + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -768,6 +799,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { + }); + + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -917,6 +949,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { + return getOption(this, options, name); + }); + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -971,7 +1004,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { + function isFolded(cm, line) { + var marks = cm.findMarksAt(Pos(line)); + for (var i = 0; i < marks.length; ++i) +- if (marks[i].__isFold && marks[i].find().from.line == line) return true; ++ if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i]; + } + + function marker(spec) { +@@ -1017,7 +1050,9 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { + if (!state) return; + var opts = state.options; + if (gutter != opts.gutter) return; +- cm.foldCode(Pos(line, 0), opts.rangeFinder); ++ var folded = isFolded(cm, line); ++ if (folded) folded.clear(); ++ else cm.foldCode(Pos(line, 0), opts.rangeFinder); + } + + function onChange(cm) { +@@ -1061,6 +1096,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { + updateFoldInfo(cm, line, line + 1); + } + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -1243,6 +1279,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { + return findMatchingClose(iter, name); + }; + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -1307,6 +1344,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { + }); + }; + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -1323,12 +1361,14 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { + CodeMirror.multiplexingMode = function(outer /*, others */) { + // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects + var others = Array.prototype.slice.call(arguments, 1); +- var n_others = others.length; + +- function indexOf(string, pattern, from) { +- if (typeof pattern == "string") return string.indexOf(pattern, from); ++ function indexOf(string, pattern, from, returnEnd) { ++ if (typeof pattern == "string") { ++ var found = string.indexOf(pattern, from); ++ return returnEnd && found > -1 ? found + pattern.length : found; ++ } + var m = pattern.exec(from ? string.slice(from) : string); +- return m ? m.index + from : -1; ++ return m ? m.index + from + (returnEnd ? m[0].length : 0) : -1; + } + + return { +@@ -1351,11 +1391,11 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + token: function(stream, state) { + if (!state.innerActive) { + var cutOff = Infinity, oldContent = stream.string; +- for (var i = 0; i < n_others; ++i) { ++ for (var i = 0; i < others.length; ++i) { + var other = others[i]; + var found = indexOf(oldContent, other.open, stream.pos); + if (found == stream.pos) { +- stream.match(other.open); ++ if (!other.parseDelimiters) stream.match(other.open); + state.innerActive = other; + state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); + return other.delimStyle; +@@ -1373,8 +1413,8 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + state.innerActive = state.inner = null; + return this.token(stream, state); + } +- var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos) : -1; +- if (found == stream.pos) { ++ var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos, curInner.parseDelimiters) : -1; ++ if (found == stream.pos && !curInner.parseDelimiters) { + stream.match(curInner.close); + state.innerActive = state.inner = null; + return curInner.delimStyle; +@@ -1383,6 +1423,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + var innerToken = curInner.mode.token(stream, state.inner); + if (found > -1) stream.string = oldContent; + ++ if (found == stream.pos && curInner.parseDelimiters) ++ state.innerActive = state.inner = null; ++ + if (curInner.innerStyle) { + if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle; + else innerToken = curInner.innerStyle; +@@ -1404,7 +1447,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + mode.blankLine(state.innerActive ? state.inner : state.outer); + } + if (!state.innerActive) { +- for (var i = 0; i < n_others; ++i) { ++ for (var i = 0; i < others.length; ++i) { + var other = others[i]; + if (other.open === "\n") { + state.innerActive = other; +@@ -1425,6 +1468,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + }; + + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -1496,14 +1540,20 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + if (update !== false) this.scroll(pos, this.orientation); + }; + ++ var minButtonSize = 10; ++ + Bar.prototype.update = function(scrollSize, clientSize, barSize) { + this.screen = clientSize; + this.total = scrollSize; + this.size = barSize; + +- // FIXME clip to min size? ++ var buttonSize = this.screen * (this.size / this.total); ++ if (buttonSize < minButtonSize) { ++ this.size -= minButtonSize - buttonSize; ++ buttonSize = minButtonSize; ++ } + this.inner.style[this.orientation == "horizontal" ? "width" : "height"] = +- this.screen * (this.size / this.total) + "px"; ++ buttonSize + "px"; + this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = + this.pos * (this.size / this.total) + "px"; + }; +@@ -1566,6 +1616,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + return new SimpleScrollbars("CodeMirror-overlayscroll", place, scroll); + }; + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + +@@ -1637,47 +1688,22 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + updateActiveLines(cm, sel.ranges); + } + }); ++ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + + /** + * Supported keybindings: ++ * Too many to list. Refer to defaultKeyMap below. + * +- * Motion: +- * h, j, k, l +- * gj, gk +- * e, E, w, W, b, B, ge, gE +- * f, F, t, T +- * $, ^, 0, -, +, _ +- * gg, G +- * % +- * ', ` +- * +- * Operator: +- * d, y, c +- * dd, yy, cc +- * g~, g~g~ +- * >, <, >>, << +- * +- * Operator-Motion: +- * x, X, D, Y, C, ~ +- * +- * Action: +- * a, i, s, A, I, S, o, O +- * zz, z., z, zt, zb, z- +- * J +- * u, Ctrl-r +- * m +- * r +- * +- * Modes: +- * ESC - leave insert mode, visual mode, and clear input state. +- * Ctrl-[, Ctrl-c - same as ESC. ++ * Supported Ex commands: ++ * Refer to defaultExCommandMap below. + * + * Registers: unnamed, -, a-z, A-Z, 0-9 + * (Does not respect the special case for number registers when delete + * operator is made with these commands: %, (, ), , /, ?, n, N, {, } ) + * TODO: Implement the remaining registers. ++ * + * Marks: a-z, A-Z, and 0-9 + * TODO: Implement the remaining special marks. They have more complex + * behavior. +@@ -1696,6 +1722,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + * 6. Motion, operator, and action implementations + * 7. Helper functions for the key handler, motions, operators, and actions + * 8. Set up Vim to work as a keymap for CodeMirror. ++ * 9. Ex command implementations. + */ + + (function(mod) { +@@ -1866,6 +1893,34 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + { keys: ':', type: 'ex' } + ]; + ++ /** ++ * Ex commands ++ * Care must be taken when adding to the default Ex command map. For any ++ * pair of commands that have a shared prefix, at least one of their ++ * shortNames must not match the prefix of the other command. ++ */ ++ var defaultExCommandMap = [ ++ { 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: true }, ++ { name: 'nohlsearch', shortName: 'noh' }, ++ { name: 'delmarks', shortName: 'delm' }, ++ { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, ++ { name: 'global', shortName: 'g' } ++ ]; ++ + var Pos = CodeMirror.Pos; + + var Vim = function() { +@@ -1975,7 +2030,11 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + } + + var numberRegex = /[\d]/; +- var wordRegexp = [(/\w/), (/[^\w\s]/)], bigWordRegexp = [(/\S/)]; ++ var wordCharTest = [CodeMirror.isWordChar, function(ch) { ++ return ch && !CodeMirror.isWordChar(ch) && !/\s/.test(ch); ++ }], bigWordCharTest = [function(ch) { ++ return /\S/.test(ch); ++ }]; + function makeKeyRange(start, size) { + var keys = []; + for (var i = start; i < start + size; i++) { +@@ -2017,18 +2076,30 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + } + + var options = {}; +- function defineOption(name, defaultValue, type) { +- if (defaultValue === undefined) { throw Error('defaultValue is required'); } ++ function defineOption(name, defaultValue, type, aliases, callback) { ++ if (defaultValue === undefined && !callback) { ++ throw Error('defaultValue is required unless callback is provided'); ++ } + if (!type) { type = 'string'; } + options[name] = { + type: type, +- defaultValue: defaultValue ++ defaultValue: defaultValue, ++ callback: callback + }; +- setOption(name, defaultValue); ++ if (aliases) { ++ for (var i = 0; i < aliases.length; i++) { ++ options[aliases[i]] = options[name]; ++ } ++ } ++ if (defaultValue) { ++ setOption(name, defaultValue); ++ } + } + +- function setOption(name, value) { ++ function setOption(name, value, cm, cfg) { + var option = options[name]; ++ cfg = cfg || {}; ++ var scope = cfg.scope; + if (!option) { + throw Error('Unknown option: ' + name); + } +@@ -2040,17 +2111,60 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + value = true; + } + } +- option.value = option.type == 'boolean' ? !!value : value; ++ if (option.callback) { ++ if (scope !== 'local') { ++ option.callback(value, undefined); ++ } ++ if (scope !== 'global' && cm) { ++ option.callback(value, cm); ++ } ++ } else { ++ if (scope !== 'local') { ++ option.value = option.type == 'boolean' ? !!value : value; ++ } ++ if (scope !== 'global' && cm) { ++ cm.state.vim.options[name] = {value: value}; ++ } ++ } + } + +- function getOption(name) { ++ function getOption(name, cm, cfg) { + var option = options[name]; ++ cfg = cfg || {}; ++ var scope = cfg.scope; + if (!option) { + throw Error('Unknown option: ' + name); + } +- return option.value; ++ if (option.callback) { ++ var local = cm && option.callback(undefined, cm); ++ if (scope !== 'global' && local !== undefined) { ++ return local; ++ } ++ if (scope !== 'local') { ++ return option.callback(); ++ } ++ return; ++ } else { ++ var local = (scope !== 'global') && (cm && cm.state.vim.options[name]); ++ return (local || (scope !== 'local') && option || {}).value; ++ } + } + ++ defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) { ++ // Option is local. Do nothing for global. ++ if (cm === undefined) { ++ return; ++ } ++ // The 'filetype' option proxies to the CodeMirror 'mode' option. ++ if (name === undefined) { ++ var mode = cm.getOption('mode'); ++ return mode == 'null' ? '' : mode; ++ } else { ++ var mode = name == '' ? 'null' : name; ++ cm.setOption('mode', mode); ++ } ++ }); ++ + var createCircularJumpList = function() { + var size = 100; + var pointer = -1; +@@ -2203,8 +2317,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + visualBlock: false, + lastSelection: null, + lastPastedText: null, +- sel: { +- } ++ sel: {}, ++ // Buffer-local/window-local values of vim options. ++ options: {} + }; + } + return cm.state.vim; +@@ -2262,11 +2377,15 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + // Add user defined key bindings. + exCommandDispatcher.map(lhs, rhs, ctx); + }, ++ // TODO: Expose setOption and getOption as instance methods. Need to decide how to namespace ++ // them, or somehow make them work with the existing CodeMirror setOption/getOption API. + setOption: setOption, + getOption: getOption, + defineOption: defineOption, + defineEx: function(name, prefix, func){ +- if (name.indexOf(prefix) !== 0) { ++ if (!prefix) { ++ prefix = name; ++ } else if (name.indexOf(prefix) !== 0) { + throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered'); + } + exCommands[name]=func; +@@ -2674,12 +2793,10 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + break; + case 'search': + this.processSearch(cm, vim, command); +- clearInputState(cm); + break; + case 'ex': + case 'keyToEx': + this.processEx(cm, vim, command); +- clearInputState(cm); + break; + default: + break; +@@ -2772,6 +2889,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + updateSearchQuery(cm, query, ignoreCase, smartCase); + } catch (e) { + showConfirm(cm, 'Invalid regex: ' + query); ++ clearInputState(cm); + return; + } + commandDispatcher.processMotion(cm, vim, { +@@ -2814,15 +2932,21 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + } + function onPromptKeyDown(e, query, close) { + var keyName = CodeMirror.keyName(e); +- if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { ++ if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || ++ (keyName == 'Backspace' && query == '')) { + vimGlobalState.searchHistoryController.pushInput(query); + vimGlobalState.searchHistoryController.reset(); + updateSearchQuery(cm, originalQuery); + clearSearchHighlight(cm); + cm.scrollTo(originalScrollPos.left, originalScrollPos.top); + CodeMirror.e_stop(e); ++ clearInputState(cm); + close(); + cm.focus(); ++ } else if (keyName == 'Ctrl-U') { ++ // Ctrl-U clears input. ++ CodeMirror.e_stop(e); ++ close(''); + } + } + switch (command.searchArgs.querySrc) { +@@ -2883,10 +3007,12 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + } + function onPromptKeyDown(e, input, close) { + var keyName = CodeMirror.keyName(e), up; +- if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { ++ if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || ++ (keyName == 'Backspace' && input == '')) { + vimGlobalState.exCommandHistoryController.pushInput(input); + vimGlobalState.exCommandHistoryController.reset(); + CodeMirror.e_stop(e); ++ clearInputState(cm); + close(); + cm.focus(); + } +@@ -2894,6 +3020,10 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + up = keyName == 'Up' ? true : false; + input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || ''; + close(input); ++ } else if (keyName == 'Ctrl-U') { ++ // Ctrl-U clears input. ++ CodeMirror.e_stop(e); ++ close(''); + } else { + if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') + vimGlobalState.exCommandHistoryController.reset(); +@@ -2923,8 +3053,8 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + var registerName = inputState.registerName; + var sel = vim.sel; + // TODO: Make sure cm and vim selections are identical outside visual mode. +- var origHead = copyCursor(vim.visualMode ? sel.head: cm.getCursor('head')); +- var origAnchor = copyCursor(vim.visualMode ? sel.anchor : cm.getCursor('anchor')); ++ var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head): cm.getCursor('head')); ++ var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor')); + var oldHead = copyCursor(origHead); + var oldAnchor = copyCursor(origAnchor); + var newHead, newAnchor; +@@ -3490,10 +3620,11 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + var anchor = ranges[0].anchor, + head = ranges[0].head; + text = cm.getRange(anchor, head); +- if (!isWhiteSpaceString(text)) { ++ var lastState = vim.lastEditInputState || {}; ++ if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) { + // Exclude trailing whitespace if the range is not all whitespace. + var match = (/\s+$/).exec(text); +- if (match) { ++ if (match && lastState.motionArgs && lastState.motionArgs.forward) { + head = offsetCursor(head, 0, - match[0].length); + text = text.slice(0, - match[0].length); + } +@@ -4267,9 +4398,6 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + function lineLength(cm, lineNum) { + return cm.getLine(lineNum).length; + } +- function reverse(s){ +- return s.split('').reverse().join(''); +- } + function trim(s) { + if (s.trim) { + return s.trim(); +@@ -4583,59 +4711,38 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + + // Seek to first word or non-whitespace character, depending on if + // noSymbol is true. +- var textAfterIdx = line.substring(idx); +- var firstMatchedChar; +- if (noSymbol) { +- firstMatchedChar = textAfterIdx.search(/\w/); +- } else { +- firstMatchedChar = textAfterIdx.search(/\S/); ++ var test = noSymbol ? wordCharTest[0] : bigWordCharTest [0]; ++ while (!test(line.charAt(idx))) { ++ idx++; ++ if (idx >= line.length) { return null; } + } +- if (firstMatchedChar == -1) { +- return null; +- } +- idx += firstMatchedChar; +- textAfterIdx = line.substring(idx); +- var textBeforeIdx = line.substring(0, idx); + +- var matchRegex; +- // Greedy matchers for the "word" we are trying to expand. + if (bigWord) { +- matchRegex = /^\S+/; ++ test = bigWordCharTest[0]; + } else { +- if ((/\w/).test(line.charAt(idx))) { +- matchRegex = /^\w+/; +- } else { +- matchRegex = /^[^\w\s]+/; ++ test = wordCharTest[0]; ++ if (!test(line.charAt(idx))) { ++ test = wordCharTest[1]; + } + } + +- var wordAfterRegex = matchRegex.exec(textAfterIdx); +- var wordStart = idx; +- var wordEnd = idx + wordAfterRegex[0].length; +- // TODO: Find a better way to do this. It will be slow on very long lines. +- var revTextBeforeIdx = reverse(textBeforeIdx); +- var wordBeforeRegex = matchRegex.exec(revTextBeforeIdx); +- if (wordBeforeRegex) { +- wordStart -= wordBeforeRegex[0].length; +- } ++ var end = idx, start = idx; ++ while (test(line.charAt(end)) && end < line.length) { end++; } ++ while (test(line.charAt(start)) && start >= 0) { start--; } ++ start++; + + if (inclusive) { +- // If present, trim all whitespace after word. +- // Otherwise, trim all whitespace before word. +- var textAfterWordEnd = line.substring(wordEnd); +- var whitespacesAfterWord = textAfterWordEnd.match(/^\s*/)[0].length; +- if (whitespacesAfterWord > 0) { +- wordEnd += whitespacesAfterWord; +- } else { +- var revTrim = revTextBeforeIdx.length - wordStart; +- var textBeforeWordStart = revTextBeforeIdx.substring(revTrim); +- var whitespacesBeforeWord = textBeforeWordStart.match(/^\s*/)[0].length; +- wordStart -= whitespacesBeforeWord; ++ // If present, include all whitespace after word. ++ // Otherwise, include all whitespace before word, except indentation. ++ var wordEnd = end; ++ while (/\s/.test(line.charAt(end)) && end < line.length) { end++; } ++ if (wordEnd == end) { ++ var wordStart = start; ++ while (/\s/.test(line.charAt(start - 1)) && start > 0) { start--; } ++ if (!start) { start = wordStart; } + } + } +- +- return { start: Pos(cur.line, wordStart), +- end: Pos(cur.line, wordEnd) }; ++ return { start: Pos(cur.line, start), end: Pos(cur.line, end) }; + } + + function recordJumpPosition(cm, oldCur, newCur) { +@@ -4793,7 +4900,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + var pos = cur.ch; + var line = cm.getLine(lineNum); + var dir = forward ? 1 : -1; +- var regexps = bigWord ? bigWordRegexp : wordRegexp; ++ var charTests = bigWord ? bigWordCharTest: wordCharTest; + + if (emptyLineIsWord && line == '') { + lineNum += dir; +@@ -4813,11 +4920,11 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + // Find bounds of next word. + while (pos != stop) { + var foundWord = false; +- for (var i = 0; i < regexps.length && !foundWord; ++i) { +- if (regexps[i].test(line.charAt(pos))) { ++ for (var i = 0; i < charTests.length && !foundWord; ++i) { ++ if (charTests[i](line.charAt(pos))) { + wordStart = pos; + // Advance to end of word. +- while (pos != stop && regexps[i].test(line.charAt(pos))) { ++ while (pos != stop && charTests[i](line.charAt(pos))) { + pos += dir; + } + wordEnd = pos; +@@ -5149,7 +5256,8 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + function dialog(cm, template, shortText, onClose, options) { + if (cm.openDialog) { + cm.openDialog(template, onClose, { bottom: true, value: options.value, +- onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp }); ++ onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp, ++ selectValueOnOpen: false}); + } + else { + onClose(prompt(shortText, '')); +@@ -5223,13 +5331,17 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + // Translates the replace part of a search and replace from ex (vim) syntax into + // javascript form. Similar to translateRegex, but additionally fixes back references + // (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'. ++ var charUnescapes = {'\\n': '\n', '\\r': '\r', '\\t': '\t'}; + function translateRegexReplace(str) { + var escapeNextChar = false; + var out = []; + for (var i = -1; i < str.length; i++) { + var c = str.charAt(i) || ''; + var n = str.charAt(i+1) || ''; +- if (escapeNextChar) { ++ if (charUnescapes[c + n]) { ++ out.push(charUnescapes[c+n]); ++ i++; ++ } else if (escapeNextChar) { + // At any point in the loop, escapeNextChar is true if the previous + // character was a '\' and was not escaped. + out.push(c); +@@ -5257,6 +5369,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + } + + // Unescape \ and / in the replace part, for PCRE mode. ++ var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t'}; + function unescapeRegexReplace(str) { + var stream = new CodeMirror.StringStream(str); + var output = []; +@@ -5265,13 +5378,15 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + while (stream.peek() && stream.peek() != '\\') { + output.push(stream.next()); + } +- if (stream.match('\\/', true)) { +- // \/ => / +- output.push('/'); +- } else if (stream.match('\\\\', true)) { +- // \\ => \ +- output.push('\\'); +- } else { ++ var matched = false; ++ for (var matcher in unescapes) { ++ if (stream.match(matcher, true)) { ++ matched = true; ++ output.push(unescapes[matcher]); ++ break; ++ } ++ } ++ if (!matched) { + // Don't change anything + output.push(stream.next()); + } +@@ -5501,32 +5616,18 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + return {top: from.line, bottom: to.line}; + } + +- // Ex command handling +- // Care must be taken when adding to the default Ex command map. For any +- // pair of commands that have a shared prefix, at least one of their +- // shortNames must not match the prefix of the other command. +- var defaultExCommandMap = [ +- { 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: 'set' }, +- { name: 'sort', shortName: 'sor' }, +- { name: 'substitute', shortName: 's', possiblyAsync: true }, +- { name: 'nohlsearch', shortName: 'noh' }, +- { name: 'delmarks', shortName: 'delm' }, +- { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, +- { name: 'global', shortName: 'g' } +- ]; + var ExCommandDispatcher = function() { + this.buildCommandMap_(); + }; + ExCommandDispatcher.prototype = { + processCommand: function(cm, input, opt_params) { ++ var that = this; ++ cm.operation(function () { ++ cm.curOp.isVimOp = true; ++ that._processCommand(cm, input, opt_params); ++ }); ++ }, ++ _processCommand: function(cm, input, opt_params) { + var vim = cm.state.vim; + var commandHistoryRegister = vimGlobalState.registerController.getRegister(':'); + var previousCommand = commandHistoryRegister.toString(); +@@ -5739,6 +5840,13 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + }; + + var exCommands = { ++ colorscheme: function(cm, params) { ++ if (!params.args || params.args.length < 1) { ++ showConfirm(cm, cm.getOption('theme')); ++ return; ++ } ++ cm.setOption('theme', params.args[0]); ++ }, + map: function(cm, params, ctx) { + var mapArgs = params.args; + if (!mapArgs || mapArgs.length < 2) { +@@ -5772,6 +5880,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + }, + set: function(cm, params) { + var setArgs = params.args; ++ // Options passed through to the setOption/getOption calls. May be passed in by the ++ // local/global versions of the set command ++ var setCfg = params.setCfg || {}; + if (!setArgs || setArgs.length < 1) { + if (cm) { + showConfirm(cm, 'Invalid mapping: ' + params.input); +@@ -5795,24 +5906,35 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + optionName = optionName.substring(2); + value = false; + } ++ + var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean'; + if (optionIsBoolean && value == undefined) { + // Calling set with a boolean option sets it to true. + value = true; + } +- if (!optionIsBoolean && !value || forceGet) { +- var oldValue = getOption(optionName); +- // If no value is provided, then we assume this is a get. ++ // If no value is provided, then we assume this is a get. ++ if (!optionIsBoolean && value === undefined || forceGet) { ++ var oldValue = getOption(optionName, cm, setCfg); + if (oldValue === true || oldValue === false) { + showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName); + } else { + showConfirm(cm, ' ' + optionName + '=' + oldValue); + } + } else { +- setOption(optionName, value); ++ setOption(optionName, value, cm, setCfg); + } + }, +- registers: function(cm,params) { ++ setlocal: function (cm, params) { ++ // setCfg is passed through to setOption ++ params.setCfg = {scope: 'local'}; ++ this.set(cm, params); ++ }, ++ setglobal: function (cm, params) { ++ // setCfg is passed through to setOption ++ params.setCfg = {scope: 'global'}; ++ this.set(cm, params); ++ }, ++ registers: function(cm, params) { + var regArgs = params.args; + var registers = vimGlobalState.registerController.registers; + var regInfo = '----------Registers----------

    '; +@@ -6039,6 +6161,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + var query = state.getQuery(); + var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line; + var lineEnd = params.lineEnd || lineStart; ++ if (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) { ++ lineEnd = Infinity; ++ } + if (count) { + lineStart = lineEnd; + lineEnd = lineStart + count - 1; +@@ -6157,10 +6282,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + searchCursor.replace(newText); + } + function next() { +- var found; + // The below only loops to skip over multiple occurrences on the same + // line when 'global' is not true. +- while(found = searchCursor.findNext() && ++ while(searchCursor.findNext() && + isInRange(searchCursor.from(), lineStart, lineEnd)) { + if (!global && lastPos && searchCursor.from().line == lastPos.line) { + continue; +@@ -6335,6 +6459,14 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + + function executeMacroRegister(cm, vim, macroModeState, registerName) { + var register = vimGlobalState.registerController.getRegister(registerName); ++ if (registerName == ':') { ++ // Read-only register containing last Ex command. ++ if (register.keyBuffer[0]) { ++ exCommandDispatcher.processCommand(cm, register.keyBuffer[0]); ++ } ++ macroModeState.isPlaying = false; ++ return; ++ } + var keyBuffer = register.keyBuffer; + var imc = 0; + macroModeState.isPlaying = true; +@@ -6434,7 +6566,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + } + function updateFakeCursor(cm) { + var vim = cm.state.vim; +- var from = copyCursor(vim.sel.head); ++ var from = clipCursorToContent(cm, copyCursor(vim.sel.head)); + var to = offsetCursor(from, 0, 1); + if (vim.fakeCursor) { + vim.fakeCursor.clear(); +@@ -6445,7 +6577,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { + var anchor = cm.getCursor('anchor'); + var head = cm.getCursor('head'); + // Enter or exit visual mode to match mouse selection. +- if (vim.visualMode && cursorEqual(head, anchor) && lineLength(cm, head.line) > head.ch) { ++ if (vim.visualMode && !cm.somethingSelected()) { + exitVisualMode(cm, false); + } else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) { + vim.visualMode = true; +diff --git a/media/editors/codemirror/lib/addons.min.css b/media/editors/codemirror/lib/addons.min.css +new file mode 100644 +index 0000000..e81039a +--- /dev/null ++++ b/media/editors/codemirror/lib/addons.min.css +@@ -0,0 +1 @@ ++.CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-gutter-filler,.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%} +\ No newline at end of file +diff --git a/media/editors/codemirror/lib/addons.min.js b/media/editors/codemirror/lib/addons.min.js +index 362005d..f789dcf 100644 +--- a/media/editors/codemirror/lib/addons.min.js ++++ b/media/editors/codemirror/lib/addons.min.js +@@ -1,3 +1,4 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function r(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var r=e.state.fullScreenRestore;t.style.width=r.width,t.style.height=r.height,window.scrollTo(r.scrollLeft,r.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(n,o,i){i==e.Init&&(i=!1),!i!=!o&&(o?t(n):r(n))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r,n){this.cm=e,this.node=t,this.options=r,this.height=n,this.cleared=!1}function r(e){var t=e.getWrapperElement(),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n=parseInt(r.height),o=e.state.panels={setHeight:t.style.height,heightLeft:n,panels:0,wrapper:document.createElement("div")};t.parentNode.insertBefore(o.wrapper,t);var i=e.hasFocus();o.wrapper.appendChild(t),i&&e.focus(),e._setSize=e.setSize,null!=n&&(e.setSize=function(t,r){if(null==r)return this._setSize(t,r);if(o.setHeight=r,"number"!=typeof r){var i=/^(\d+\.?\d*)px$/.exec(r);i?r=Number(i[1]):(o.wrapper.style.height=r,r=o.wrapper.offsetHeight,o.wrapper.style.height="")}e._setSize(t,o.heightLeft+=r-n),n=r})}function n(e){var t=e.state.panels;e.state.panels=null;var r=e.getWrapperElement();t.wrapper.parentNode.replaceChild(r,t.wrapper),r.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}e.defineExtension("addPanel",function(e,n){this.state.panels||r(this);var o=this.state.panels;n&&"bottom"==n.position?o.wrapper.appendChild(e):o.wrapper.insertBefore(e,o.wrapper.firstChild);var i=n&&n.height||e.offsetHeight;return this._setSize(null,o.heightLeft-=i),o.panels++,new t(this,e,n,i)}),t.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var e=this.cm.state.panels;this.cm._setSize(null,e.heightLeft+=this.height),e.wrapper.removeChild(this.node),0==--e.panels&&n(this.cm)}},t.prototype.changed=function(e){var t=null==e?this.node.offsetHeight:e,r=this.cm.state.panels;this.cm._setSize(null,r.height+=t-this.height),this.height=t}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){var r=e.getRange(c(t.line,t.ch-1),c(t.line,t.ch+1));return 2==r.length?r:null}function r(t,r,n){var o=t.getLine(r.line),i=t.getTokenAt(r);if(/\bstring2?\b/.test(i.type))return!1;var a=new e.StringStream(o.slice(0,r.ch)+n+o.slice(r.ch),4);for(a.pos=a.start=i.start;;){var s=t.getMode().token(a,i.state);if(a.pos>=r.ch+1)return/\bstring2?\b/.test(s);a.start=a.pos}}function n(n,o){for(var i={name:"autoCloseBrackets",Backspace:function(r){if(r.getOption("disableInput"))return e.Pass;for(var o=r.listSelections(),i=0;i=0;i--){var s=o[i].head;r.replaceRange("",c(s.line,s.ch-1),c(s.line,s.ch+1))}}},a="",s=0;s1&&o.indexOf(t)>=0&&i.getRange(c(m.line,m.ch-2),m)==t+t&&(m.ch<=2||i.getRange(c(m.line,m.ch-3),c(m.line,m.ch-2))!=t))d="addFour";else if('"'==t||"'"==t){if(e.isWordChar(u)||!r(i,m,t))return e.Pass;d="both"}else{if(!(i.getLine(m.line).length==m.ch||a.indexOf(u)>=0||l.test(u)))return e.Pass;d="both"}else d="surround";if(s){if(s!=d)return e.Pass}else s=d}i.operation(function(){if("skip"==s)i.execCommand("goCharRight");else if("skipThree"==s)for(var e=0;3>e;e++)i.execCommand("goCharRight");else if("surround"==s){for(var r=i.getSelections(),e=0;ec.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==h.type||u.string.indexOf("/")==u.string.length-1||m&&o(m,y)>-1||i(t,v,c,h,!0))return e.Pass;var C=g&&o(g,y)>-1;n[l]={indent:C,text:">"+(C?"\n\n":"")+"",newPos:C?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=r.length-1;l>=0;l--){var k=n[l];t.replaceRange(k.text,r[l].head,r[l].anchor,"+insert");var w=t.listSelections().slice(0);w[l]={head:k.newPos,anchor:k.newPos},t.setSelections(w),k.indent&&(t.indentLine(k.newPos.line,null,!0),t.indentLine(k.newPos.line+1,null,!0))}}function r(t,r){for(var n=t.listSelections(),o=[],a=r?"/":"";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;o[s]=a+"style>"}else{if(!f.context||!f.context.tagName||i(t,f.context.tagName,l,f))return e.Pass;o[s]=a+f.context.tagName+">"}}t.replaceSelections(o),n=t.listSelections();for(var s=0;sr;++r)if(e[r]==t)return r;return-1}function i(t,r,n,o,i){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,n.line+500),s=e.scanForClosingTag(t,n,null,a);if(!s||s.tag!=r)return!1;for(var l=o.context,c=i?1:0;l&&l.tagName==r;l=l.prev)++c;n=s.to;for(var u=1;c>u;u++){var f=e.scanForClosingTag(t,n,null,a);if(!f||f.tag!=r)return!1;n=f.to}return!0}e.defineOption("autoCloseTags",!1,function(r,o,i){if(i!=e.Init&&i&&r.removeKeyMap("autoCloseTags"),o){var a={name:"autoCloseTags"};("object"!=typeof o||o.whenClosing)&&(a["'/'"]=function(e){return n(e)}),("object"!=typeof o||o.whenOpening)&&(a["'>'"]=function(e){return t(e)}),r.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],s=["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"];e.commands.closeTag=function(e){return r(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n,o){var i=e.getLineHandle(t.line),l=t.ch-1,c=l>=0&&s[i.text.charAt(l)]||s[i.text.charAt(++l)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(n&&u>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(a(t.line,l+1)),h=r(e,a(t.line,l+(u>0?1:0)),u,f||null,o);return null==h?null:{from:a(t.line,l),to:h&&h.pos,match:h&&h.ch==c.charAt(0),forward:u>0}}function r(e,t,r,n,o){for(var i=o&&o.maxScanLineLength||1e4,l=o&&o.maxScanLines||1e3,c=[],u=o&&o.bracketRegex?o.bracketRegex:/[(){}[\]]/,f=r>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),h=t.line;h!=f;h+=r){var d=e.getLine(h);if(d){var p=r>0?0:d.length-1,m=r>0?d.length:-1;if(!(d.length>i))for(h==t.line&&(p=t.ch-(0>r?1:0));p!=m;p+=r){var g=d.charAt(p);if(u.test(g)&&(void 0===n||e.getTokenTypeAt(a(h,p+1))==n)){var v=s[g];if(">"==v.charAt(1)==r>0)c.push(g);else{if(!c.length)return{pos:a(h,p),ch:g};c.pop()}}}}}return h-r==(r>0?e.lastLine():e.firstLine())?!1:null}function n(e,r,n){for(var o=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),c=0;c",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,r,n){n&&n!=e.Init&&t.off("cursorActivity",o),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",o))}),e.defineExtension("matchBrackets",function(){n(this,!0)}),e.defineExtension("findMatchingBracket",function(e,r,n){return t(this,e,r,n)}),e.defineExtension("scanForBracket",function(e,t,n,o){return r(this,e,t,n,o)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function r(r){r.state.failedTagMatch=!1,r.operation(function(){if(t(r),!r.somethingSelected()){var n=r.getCursor(),o=r.getViewport();o.from=Math.min(o.from,n.line),o.to=Math.max(n.line+1,o.to);var i=e.findMatchingTag(r,n,o);if(i){if(r.state.matchBothTags){var a="open"==i.at?i.open:i.close;a&&(r.state.tagHit=r.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var s="close"==i.at?i.open:i.close;s?r.state.tagOther=r.markText(s.from,s.to,{className:"CodeMirror-matchingtag"}):r.state.failedTagMatch=!0}}})}function n(e){e.state.failedTagMatch&&r(e)}e.defineOption("matchTags",!1,function(o,i,a){a&&a!=e.Init&&(o.off("cursorActivity",r),o.off("viewportChange",n),t(o)),i&&(o.state.matchBothTags="object"==typeof i&&i.bothTags,o.on("cursorActivity",r),o.on("viewportChange",n),r(o))}),e.commands.toMatchingTag=function(t){var r=e.findMatchingTag(t,t.getCursor());if(r){var n="close"==r.at?r.open:r.close;n&&t.extendSelection(n.to,n.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(t,r){function n(n){for(var o=r.ch,l=0;;){var c=0>=o?-1:s.lastIndexOf(n,o-1);if(-1!=c){if(1==l&&c=p;++p)for(var m=t.getLine(p),g=p==a?o:0;;){var v=m.indexOf(l,g),y=m.indexOf(c,g);if(0>v&&(v=m.length),0>y&&(y=m.length),g=Math.min(v,y),g==m.length)break;if(t.getTokenTypeAt(e.Pos(p,g+1))==i)if(g==v)++h;else if(!--h){u=p,f=g;break e}++g}if(null!=u&&(a!=u||f!=o))return{from:e.Pos(a,o),to:e.Pos(u,f)}}}),e.registerHelper("fold","import",function(t,r){function n(r){if(rt.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));if(/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"keyword"!=n.type||"import"!=n.string)return null;for(var o=r,i=Math.min(t.lastLine(),r+10);i>=o;++o){var a=t.getLine(o),s=a.indexOf(";");if(-1!=s)return{startCh:n.end,end:e.Pos(o,s)}}}var o,r=r.line,i=n(r);if(!i||n(r-1)||(o=n(r-2))&&o.end.line==r-1)return null;for(var a=i.end;;){var s=n(a.line+1);if(null==s)break;a=s.end}return{from:t.clipPos(e.Pos(r,i.startCh+1)),to:a}}),e.registerHelper("fold","include",function(t,r){function n(r){if(rt.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));return/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"meta"==n.type&&"#include"==n.string.slice(0,8)?n.start+8:void 0}var r=r.line,o=n(r);if(null==o||null!=n(r-1))return null;for(var i=r;;){var a=n(i+1);if(null==a)break;++i}return{from:e.Pos(r,o+1),to:t.clipPos(e.Pos(i))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,o,i,a){function s(e){var r=l(t,o);if(!r||r.to.line-r.from.linet.firstLine();)o=e.Pos(o.line-1,0),u=s(!1);if(u&&!u.cleared&&"unfold"!==a){var f=r(t,i);e.on(f,"mousedown",function(t){h.clear(),e.e_preventDefault(t)});var h=t.markText(u.from,u.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});h.on("clear",function(r,n){e.signal(t,"unfold",t,r,n)}),e.signal(t,"fold",t,u.from,u.to)}}function r(e,t){var r=n(e,t,"widget");if("string"==typeof r){var o=document.createTextNode(r);r=document.createElement("span"),r.appendChild(o),r.className="CodeMirror-foldmarker"}return r}function n(e,t,r){if(t&&void 0!==t[r])return t[r];var n=e.options.foldOptions;return n&&void 0!==n[r]?n[r]:o[r]}e.newFoldFunction=function(e,r){return function(n,o){t(n,o,{rangeFinder:e,widget:r})}},e.defineExtension("foldCode",function(e,r,n){t(this,e,r,n)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),r=0;r=r;r++)t.foldCode(e.Pos(r,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var r=t.firstLine(),n=t.lastLine();n>=r;r++)t.foldCode(e.Pos(r,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,r){for(var n=0;n=s&&(r=o(i.indicatorOpen))}e.setGutterMarker(t,i.gutter,r),++a})}function a(e){var t=e.getViewport(),r=e.state.foldGutter;r&&(e.operation(function(){i(e,t.from,t.to)}),r.from=t.from,r.to=t.to)}function s(e,t,r){var n=e.state.foldGutter;if(n){var o=n.options;r==o.gutter&&e.foldCode(f(t,0),o.rangeFinder)}}function l(e){var t=e.state.foldGutter;if(t){var r=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},r.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var r=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var r=e.getViewport();t.from==t.to||r.from-t.to>20||t.from-r.to>20?a(e):e.operation(function(){r.fromt.to&&(i(e,t.to,r.to),t.to=r.to)})},r.updateViewportTimeSpan||400)}}function u(e,t){var r=e.state.foldGutter;if(r){var n=t.line;n>=r.from&&n=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function i(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(o(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}}function s(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(i(e))continue;return}if(n(e,t+1)){m.lastIndex=t,e.ch=t;var r=m.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function l(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(o(e))continue;return}{if(n(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(i(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),o=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var r=[];;){var n,o=l(e),i=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(n=a(e)))return;if("selfClose"!=n)if(o[1]){for(var c=r.length-1;c>=0;--c)if(r[c]==o[2]){r.length=c;break}if(0>c&&(!t||t==o[2]))return{tag:o[2],from:h(i,s),to:h(e.line,e.ch)}}else r.push(o[2])}}function f(e,t){for(var r=[];;){var n=c(e);if(!n)return;if("selfClose"!=n){var o=e.line,i=e.ch,a=s(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var l=r.length-1;l>=0;--l)if(r[l]==a[2]){r.length=l;break}if(0>l&&(!t||t==a[2]))return{tag:a[2],from:h(e.line,e.ch),to:h(o,i)}}}else s(e)}}var h=e.Pos,d="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",p=d+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+d+"]["+p+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var n=new r(e,t.line,0);;){var o,i=l(n);if(!i||n.line!=t.line||!(o=a(n)))return;if(!i[1]&&"selfClose"!=o){var t=h(n.line,n.ch),s=u(n,i[2]);return s&&{from:t,to:s.from}}}}),e.findMatchingTag=function(e,n,o){var i=new r(e,n.line,n.ch,o);if(-1!=i.text.indexOf(">")||-1!=i.text.indexOf("<")){var l=a(i),c=l&&h(i.line,i.ch),d=l&&s(i);if(l&&d&&!(t(i,n)>0)){var p={from:h(i.line,i.ch),to:c,tag:d[2]};return"selfClose"==l?{open:p,close:null,at:"open"}:d[1]?{open:f(i,d[2]),close:p,at:"close"}:(i=new r(e,c.line,c.ch,o),{open:p,close:u(i,d[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,n){for(var o=new r(e,t.line,t.ch,n);;){var i=f(o);if(!i)break;var a=new r(e,t.line,t.ch,n),s=u(a,i.tag);if(s)return{open:i,close:s}}},e.scanForClosingTag=function(e,t,n,o){var i=new r(e,t.line,t.ch,o?{from:0,to:o}:null);return u(i,n)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],function(t){e(t,"amd")}):e(CodeMirror,"plain")}(function(e,t){function r(e,t){var r=t;return function(){0==--r&&e()}}function n(t,n){var o=e.modes[t].dependencies;if(!o)return n();for(var i=[],a=0;a-1&&(i.string=l.slice(0,c));var u=s.mode.token(i,a.inner);return c>-1&&(i.string=l),s.innerStyle&&(u=u?u+" "+s.innerStyle:s.innerStyle),u}for(var f=1/0,l=i.string,h=0;o>h;++h){var d=n[h],c=r(l,d.open,i.pos);if(c==i.pos)return i.match(d.open),a.innerActive=d,a.inner=e.startState(d.mode,t.indent?t.indent(a.outer,""):0),d.delimStyle;-1!=c&&f>c&&(f=c)}1/0!=f&&(i.string=l.slice(0,f));var p=t.token(i,a.outer);return 1/0!=f&&(i.string=l),p},indent:function(r,n){var o=r.innerActive?r.innerActive.mode:t;return o.indent?o.indent(r.innerActive?r.inner:r.outer,n):e.Pass},blankLine:function(r){var i=r.innerActive?r.innerActive.mode:t;if(i.blankLine&&i.blankLine(r.innerActive?r.inner:r.outer),r.innerActive)"\n"===r.innerActive.close&&(r.innerActive=r.inner=null);else for(var a=0;o>a;++a){var s=n[a];"\n"===s.open&&(r.innerActive=s,r.inner=e.startState(s.mode,i.indent?i.indent(r.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,r,n){function o(t){var r=e.wheelEventPixels(t)["horizontal"==i.orientation?"x":"y"],n=i.pos;i.moveTo(i.pos+r),i.pos!=n&&e.e_preventDefault(t)}this.orientation=r,this.scroll=n,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=t+"-"+r,this.inner=this.node.appendChild(document.createElement("div"));var i=this;e.on(this.inner,"mousedown",function(t){function r(){e.off(document,"mousemove",n),e.off(document,"mouseup",r)}function n(e){return 1!=e.which?r():void i.moveTo(s+(e[o]-a)*(i.total/i.size))}if(1==t.which){e.e_preventDefault(t);var o="horizontal"==i.orientation?"pageX":"pageY",a=t[o],s=i.pos;e.on(document,"mousemove",n),e.on(document,"mouseup",r)}}),e.on(this.node,"click",function(t){e.e_preventDefault(t);var r,n=i.inner.getBoundingClientRect();r="horizontal"==i.orientation?t.clientXn.right?1:0:t.clientYn.bottom?1:0,i.moveTo(i.pos+r*i.screen)}),e.on(this.node,"mousewheel",o),e.on(this.node,"DOMMouseScroll",o)}function r(e,r,n){this.addClass=e,this.horiz=new t(e,"horizontal",n),r(this.horiz.node),this.vert=new t(e,"vertical",n),r(this.vert.node),this.width=null}t.prototype.moveTo=function(e,t){0>e&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),e!=this.pos&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",t!==!1&&this.scroll(e,this.orientation))},t.prototype.update=function(e,t,r){this.screen=t,this.total=e,this.size=r,this.inner.style["horizontal"==this.orientation?"width":"height"]=this.screen*(this.size/this.total)+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},r.prototype.update=function(e){if(null==this.width){var t=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;t&&(this.width=parseInt(t.height))}var r=this.width||0,n=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=o?"block":"none",this.horiz.node.style.display=n?"block":"none",o&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(n?r:0)),this.vert.node.style.display="block",this.vert.node.style.bottom=n?r+"px":"0"),n&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(o?r:0)-e.barLeft),this.horiz.node.style.right=o?r+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:o?r:0,bottom:n?r:0}},r.prototype.setScrollTop=function(e){this.vert.moveTo(e,!1)},r.prototype.setScrollLeft=function(e){this.horiz.moveTo(e,!1)},r.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new r("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new r("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t",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:"xi",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",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:"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:"moveToEol",motionArgs:{inclusive:!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:"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:"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"}],r=e.Pos,n=function(){function n(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",Zt),x(t),e.on(t.getInputField(),"paste",c(t)) +-}function o(t){t.setOption("disableInput",!1),t.off("cursorActivity",Zt),e.off(t.getInputField(),"paste",c(t)),t.state.vim=null}function i(t,r){this==e.keyMap.vim&&e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),r&&r.attach==a||o(t,!1)}function a(t,r){this==e.keyMap.vim&&e.addClass(t.getWrapperElement(),"cm-fat-cursor"),r&&r.attach==a||n(t)}function s(t,r){if(!r)return void 0;var n=l(t);if(!n)return!1;var o=e.Vim.findKey(r,n);return"function"==typeof o&&e.signal(r,"vim-keypress",n),o}function l(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split("-");/-$/.test(e)&&t.splice(-2,2,"-");var r=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==r.length)return!1;for(var n=!1,o=0;o"):!1}function c(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(N(e.getCursor(),0,1)),br.enterInsertMode(e,{},t))}),t.onPasteFn}function u(e,t){for(var r=[],n=e;e+t>n;n++)r.push(String.fromCharCode(n));return r}function f(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function h(e){return/^[a-z]$/.test(e)}function d(e){return-1!="()[]{}".indexOf(e)}function p(e){return lr.test(e)}function m(e){return/^[A-Z]$/.test(e)}function g(e){return/^\s*$/.test(e)}function v(e,t){for(var r=0;rn;n++)r.push(e);return r}function E(e,t){Sr[e]=t}function I(e,t){br[e]=t}function B(e,t,n){var o=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),i=J(e,o)-1;i=n?i+1:i;var a=Math.min(Math.max(0,t.ch),i);return r(o,a)}function P(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function N(e,t,n){return"object"==typeof t&&(n=t.ch,t=t.line),r(e.line+t,e.ch+n)}function j(e,t){return{line:t.line-e.line,ch:t.line-e.line}}function F(e,t,r,n){for(var o,i=[],a=[],s=0;s"==t.slice(-11)){var r=t.length-11,n=e.slice(0,r),o=t.slice(0,r);return n==o&&e.length>r?"full":0==o.indexOf(n)?"partial":!1}return e==t?"full":0==t.indexOf(e)?"partial":!1}function H(e){var t=/^.*(<[\w\-]+>)$/.exec(e),r=t?t[1]:e.slice(-1);if(r.length>1)switch(r){case"":r="\n";break;case"":r=" "}return r}function D(e,t,r){return function(){for(var n=0;r>n;n++)t(e)}}function z(e){return r(e.line,e.ch)}function _(e,t){return e.ch==t.ch&&e.line==t.line}function W(e,t){return e.line2&&(t=q.apply(void 0,Array.prototype.slice.call(arguments,1))),W(e,t)?e:t}function V(e,t){return arguments.length>2&&(t=V.apply(void 0,Array.prototype.slice.call(arguments,1))),W(e,t)?t:e}function U(e,t,r){var n=W(e,t),o=W(t,r);return n&&o}function J(e,t){return e.getLine(t).length}function $(e){return e.split("").reverse().join("")}function Q(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function G(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Y(e,t,n){var o=J(e,t),i=new Array(n-o+1).join(" ");e.setCursor(r(t,o)),e.replaceRange(i,e.getCursor())}function X(e,t){var n=[],o=e.listSelections(),i=z(e.clipPos(t)),a=!_(t,i),s=e.getCursor("head"),l=et(o,s),c=_(o[l].head,o[l].anchor),u=o.length-1,f=u-l>l?u:0,h=o[f].anchor,d=Math.min(h.line,i.line),p=Math.max(h.line,i.line),m=h.ch,g=i.ch,v=o[f].head.ch-m,y=g-m;v>0&&0>=y?(m++,a||g--):0>v&&y>=0?(m--,c||g++):0>v&&-1==y&&(m--,g++);for(var C=d;p>=C;C++){var k={anchor:new r(C,m),head:new r(C,g)};n.push(k)}return l=i.line==p?n.length-1:0,e.setSelections(n),t.ch=g,h.ch=m,h}function Z(e,t,r){for(var n=[],o=0;r>o;o++){var i=N(t,o,0);n.push({anchor:i,head:i})}e.setSelections(n,0)}function et(e,t,r){for(var n=0;nc&&(i.line=c),i.ch=J(e,i.line)}return{ranges:[{anchor:a,head:i}],primary:0}}if("block"==n){for(var u=Math.min(a.line,i.line),f=Math.min(a.ch,i.ch),h=Math.max(a.line,i.line),d=Math.max(a.ch,i.ch)+1,p=h-u+1,m=i.line==u?0:p-1,g=[],v=0;p>v;v++)g.push({anchor:r(u+v,f),head:r(u+v,d)});return{ranges:g,primary:m}}}function at(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=q(t,e.getCursor("anchor"))),t}function st(t,r){var n=t.state.vim;r!==!1&&t.setCursor(B(t,n.sel.head)),rt(t,n),n.visualMode=!1,n.visualLine=!1,n.visualBlock=!1,e.signal(t,"vim-mode-change",{mode:"normal"}),n.fakeCursor&&n.fakeCursor.clear()}function lt(e,t,r){var n=e.getRange(t,r);if(/\n\s*$/.test(n)){var o=n.split("\n");o.pop();for(var i,i=o.pop();o.length>0&&i&&g(i);i=o.pop())r.line--,r.ch=0;i?(r.line--,r.ch=J(e,r.line)):r.ch=0}}function ct(e,t,r){t.ch=0,r.ch=0,r.line++}function ut(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function ft(e,t,n,o,i){var a,s=at(e),l=e.getLine(s.line),c=s.ch,u=l.substring(c);if(a=u.search(i?/\w/:/\S/),-1==a)return null;c+=a,u=l.substring(c);var f,h=l.substring(0,c);f=o?/^\S+/:/\w/.test(l.charAt(c))?/^\w+/:/^[^\w\s]+/;var d=f.exec(u),p=c,m=c+d[0].length,g=$(h),v=f.exec(g);if(v&&(p-=v[0].length),t){var y=l.substring(m),C=y.match(/^\s*/)[0].length;if(C>0)m+=C;else{var k=g.length-p,w=g.substring(k),x=w.match(/^\s*/)[0].length;p-=x}}return{start:r(s.line,p),end:r(s.line,m)}}function ht(e,t,r){_(t,r)||Cr.jumpList.add(e,t,r)}function dt(e,t){Cr.lastChararacterSearch.increment=e,Cr.lastChararacterSearch.forward=t.forward,Cr.lastChararacterSearch.selectedCharacter=t.selectedCharacter}function pt(e,t,n,o){var i=z(e.getCursor()),a=n?1:-1,s=n?e.lineCount():-1,l=i.ch,c=i.line,u=e.getLine(c),f={lineText:u,nextCh:u.charAt(l),lastCh:null,index:l,symb:o,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[o],forward:n,depth:0,curMoveThrough:!1},h=Ar[o];if(!h)return i;var d=Lr[h].init,p=Lr[h].isComplete;for(d&&d(f);c!==s&&t;){if(f.index+=a,f.nextCh=f.lineText.charAt(f.index),!f.nextCh){if(c+=a,f.lineText=e.getLine(c)||"",a>0)f.index=0;else{var m=f.lineText.length;f.index=m>0?m-1:0}f.nextCh=f.lineText.charAt(f.index)}p(f)&&(i.line=c,i.ch=f.index,t--)}return f.nextCh||f.curMoveThrough?r(c,f.index):i}function mt(e,t,r,n,o){var i=t.line,a=t.ch,s=e.getLine(i),l=r?1:-1,c=n?ur:cr;if(o&&""==s){if(i+=l,s=e.getLine(i),!f(e,i))return null;a=r?0:s.length}for(;;){if(o&&""==s)return{from:0,to:0,line:i};for(var u=l>0?s.length:-1,h=u,d=u;a!=u;){for(var p=!1,m=0;m0?0:s.length}throw new Error("The impossible happened.")}function gt(e,t,n,o,i,a){var s=z(t),l=[];(o&&!i||!o&&i)&&n++;for(var c=!(o&&i),u=0;n>u;u++){var f=mt(e,t,o,a,c);if(!f){var h=J(e,e.lastLine());l.push(o?{line:e.lastLine(),from:h,to:h}:{line:0,from:0,to:0});break}l.push(f),t=r(f.line,o?f.to-1:f.from)}var d=l.length!=n,p=l[0],m=l.pop();return o&&!i?(d||p.from==s.ch&&p.line==s.line||(m=l.pop()),r(m.line,m.from)):o&&i?r(m.line,m.to-1):!o&&i?(d||p.to==s.ch&&p.line==s.line||(m=l.pop()),r(m.line,m.to)):r(m.line,m.from)}function vt(e,t,n,o){for(var i,a=e.getCursor(),s=a.ch,l=0;t>l;l++){var c=e.getLine(a.line);if(i=kt(s,c,o,n,!0),-1==i)return null;s=i}return r(e.getCursor().line,i)}function yt(e,t){var n=e.getCursor().line;return B(e,r(n,t-1))}function Ct(e,t,r,n){v(r,pr)&&(t.marks[r]&&t.marks[r].clear(),t.marks[r]=e.setBookmark(n))}function kt(e,t,r,n,o){var i;return n?(i=t.indexOf(r,e+1),-1==i||o||(i-=1)):(i=t.lastIndexOf(r,e-1),-1==i||o||(i+=1)),i}function wt(e,t,n,o,i){function a(t){return!e.getLine(t)}function s(e,t,r){return r?a(e)!=a(e+t):!a(e)&&a(e+t)}var l,c,u=t.line,f=e.firstLine(),h=e.lastLine(),d=u;if(o){for(;d>=f&&h>=d&&n>0;)s(d,o)&&n--,d+=o;return new r(d,0)}var p=e.state.vim;if(p.visualLine&&s(u,1,!0)){var m=p.sel.anchor;s(m.line,-1,!0)&&(i&&m.line==u||(u+=1))}var g=a(u);for(d=u;h>=d&&n;d++)s(d,1,!0)&&(i&&a(d)==g||n--);for(c=new r(d,0),d>h&&!g?g=!0:i=!1,d=u;d>f&&(i&&a(d)!=g&&d!=u||!s(d,-1,!0));d--);return l=new r(d,0),{start:l,end:c}}function xt(e,t,n,o){var i,a,s=t,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],c={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],u=e.getLine(s.line).charAt(s.ch),f=u===c?1:0;if(i=e.scanForBracket(r(s.line,s.ch+f),-1,null,{bracketRegex:l}),a=e.scanForBracket(r(s.line,s.ch+f),1,null,{bracketRegex:l}),!i||!a)return{start:s,end:s};if(i=i.pos,a=a.pos,i.line==a.line&&i.ch>a.ch||i.line>a.line){var h=i;i=a,a=h}return o?a.ch+=1:i.ch+=1,{start:i,end:a}}function Mt(e,t,n,o){var i,a,s,l,c=z(t),u=e.getLine(c.line),f=u.split(""),h=f.indexOf(n);if(c.ch-1&&!i;s--)f[s]==n&&(i=s+1);else i=c.ch+1;if(i&&!a)for(s=i,l=f.length;l>s&&!a;s++)f[s]==n&&(a=s);return i&&a?(o&&(--i,++a),{start:r(c.line,i),end:r(c.line,a)}):{start:c,end:c}}function St(){}function bt(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new St)}function At(e,t,r,n,o){e.openDialog?e.openDialog(t,n,{bottom:!0,value:o.value,onKeyDown:o.onKeyDown,onKeyUp:o.onKeyUp}):n(prompt(r,""))}function Lt(e){var t=Tt(e)||[];if(!t.length)return[];var r=[];if(0===t[0]){for(var n=0;n'+t+"
    ",{bottom:!0,duration:5e3}):alert(t)}function Pt(e,t){var r="";return e&&(r+=''+e+""),r+=' ',t&&(r+='',r+=t,r+=""),r}function Nt(e,t){var r=(t.prefix||"")+" "+(t.desc||""),n=Pt(t.prefix,t.desc);At(e,n,r,t.onClose,t)}function jt(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var r=["global","multiline","ignoreCase","source"],n=0;ns;s++){var l=a.find(t);if(0==s&&l&&_(a.from(),i)&&(l=a.find(t)),!l&&(a=e.getSearchCursor(n,t?r(e.lastLine()):r(e.firstLine(),0)),!a.find(t)))return}return a.from()})}function zt(e){var t=bt(e);e.removeOverlay(bt(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function _t(e,t,r){return"number"!=typeof e&&(e=e.line),t instanceof Array?v(e,t):r?e>=t&&r>=e:e==t}function Wt(e){var t=e.getScrollInfo(),r=6,n=10,o=e.coordsChar({left:0,top:r+t.top},"local"),i=t.clientHeight-n+t.top,a=e.coordsChar({left:0,top:i},"local");return{top:o.line,bottom:a.line}}function qt(t,r,n,o,i,a,s,l,c){function u(){t.operation(function(){for(;!m;)f(),h();d()})}function f(){var e=t.getRange(a.from(),a.to()),r=e.replace(s,l);a.replace(r)}function h(){for(var e;e=a.findNext()&&_t(a.from(),o,i);)if(n||!g||a.from().line!=g.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),g=a.from(),void(m=!1);m=!0}function d(e){if(e&&e(),t.focus(),g){t.setCursor(g);var r=t.state.vim;r.exMode=!1,r.lastHPos=r.lastHSPos=g.ch}c&&c()}function p(r,n,o){e.e_stop(r);var i=e.keyName(r);switch(i){case"Y":f(),h();break;case"N":h();break;case"A":var a=c;c=void 0,t.operation(u),c=a;break;case"L":f();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":d(o)}return m&&d(o),!0}t.state.vim.exMode=!0;var m=!1,g=a.from();return h(),m?void Bt(t,"No matches for "+s.source):r?void Nt(t,{prefix:"replace with "+l+" (y/n/a/q/l)",onKeyDown:p}):(u(),void(c&&c()))}function Vt(t){var r=t.state.vim,n=Cr.macroModeState,o=Cr.registerController.getRegister("."),i=n.isPlaying,a=n.lastInsertModeChanges,s=[];if(!i){for(var l=a.inVisualBlock?r.lastSelection.visualBlock.height:1,c=a.changes,s=[],u=0;u1&&(or(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),o.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),n.isRecording&&Gt(n)}function Ut(e){t.push(e)}function Jt(e,t,r,n,o){var i={keys:e,type:t};i[t]=r,i[t+"Args"]=n;for(var a in o)i[a]=o[a];Ut(i)}function $t(t,r,n,o){var i=Cr.registerController.getRegister(o),a=i.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var l=0;l|<\w+>|./.exec(f),u=c[0],f=f.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"),r.insertMode){var h=i.insertModeChanges[s++].changes;Cr.macroModeState.lastInsertModeChanges.changes=h,ir(t,h,1),Vt(t)}n.isPlaying=!1}function Qt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=Cr.registerController.getRegister(r);n&&n.pushText(t)}}function Gt(e){if(!e.isPlaying){var t=e.latestRegister,r=Cr.registerController.getRegister(t);r&&r.pushInsertModeChanges(e.lastInsertModeChanges)}}function Yt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=Cr.registerController.getRegister(r);n&&n.pushSearchQuery(t)}}function Xt(e,t){var r=Cr.macroModeState,n=r.lastInsertModeChanges;if(!r.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var o=t.text.join("\n");n.changes.push(o)}t=t.next}}function Zt(e){var t=e.state.vim;if(t.insertMode){var r=Cr.macroModeState;if(r.isPlaying)return;var n=r.lastInsertModeChanges;n.expectCursorActivityForChange?n.expectCursorActivityForChange=!1:n.changes=[]}else e.curOp.isVimOp||tr(e,t);t.visualMode&&er(e)}function er(e){var t=e.state.vim,r=z(t.sel.head),n=N(r,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(r,n,{className:"cm-animate-fat-cursor"})}function tr(t,r){var n=t.getCursor("anchor"),o=t.getCursor("head");if(r.visualMode&&_(o,n)&&J(t,o.line)>o.ch?st(t,!1):r.visualMode||r.insertMode||!t.somethingSelected()||(r.visualMode=!0,r.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"})),r.visualMode){var i=W(o,n)?0:-1,a=W(o,n)?-1:0;o=N(o,0,i),n=N(n,0,a),r.sel={anchor:n,head:o},Ct(t,r,"<",q(o,n)),Ct(t,r,">",V(o,n))}else r.insertMode||(r.lastHPos=t.getCursor().ch)}function rr(e){this.keyName=e}function nr(t){function r(){return o.changes.push(new rr(i)),!0}var n=Cr.macroModeState,o=n.lastInsertModeChanges,i=e.keyName(t);i&&(-1!=i.indexOf("Delete")||-1!=i.indexOf("Backspace"))&&e.lookupKey(i,"vim-insert",r)}function or(e,t,r,n){function o(){s?xr.processAction(e,t,t.lastEditActionCommand):xr.evalInput(e,t)}function i(r){if(a.lastInsertModeChanges.changes.length>0){r=t.lastEditActionCommand?r:1;var n=a.lastInsertModeChanges;ir(e,n.changes,r)}}var a=Cr.macroModeState;a.isPlaying=!0;var s=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;r>c;c++)o(),i(1);else n||o(),i(r);t.inputState=l,t.insertMode&&!n&&Vt(e),a.isPlaying=!1}function ir(t,r,n){function o(r){return"string"==typeof r?e.commands[r](t):r(t),!0}var i=t.getCursor("head"),a=Cr.macroModeState.lastInsertModeChanges.inVisualBlock;if(a){var s=t.state.vim,l=s.lastSelection,c=j(l.anchor,l.head);Z(t,i,c.line+1),n=t.listSelections().length,t.setCursor(i)}for(var u=0;n>u;u++){a&&t.setCursor(N(i,u,0));for(var f=0;f"]),mr=[].concat(fr,hr,dr,["-",'"',".",":","/"]),gr={},vr=function(){function e(e,t,s){function l(t){var o=++n%r,i=a[o];i&&i.clear(),a[o]=e.setBookmark(t)}var c=n%r,u=a[c];if(u){var f=u.find();f&&!_(f,t)&&l(t)}else l(t);l(s),o=n,i=n-r+1,0>i&&(i=0)}function t(e,t){n+=t,n>o?n=o:i>n&&(n=i);var s=a[(r+n)%r];if(s&&!s.find()){var l,c=t>0?1:-1,u=e.getCursor();do if(n+=c,s=a[(r+n)%r],s&&(l=s.find())&&!_(u,l))break;while(o>n&&n>i)}return s}var r=100,n=-1,o=0,i=0,a=new Array(r);return{cachedCursor:void 0,add:e,move:t}},yr=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var e=Cr.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var r=Cr.registerController.getRegister(t);r&&(r.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var Cr,kr,wr={buildKeyMap:function(){},getRegisterController:function(){return Cr.registerController},resetVimGlobalState_:M,getVimGlobalState_:function(){return Cr},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:rr,map:function(e,t,r){Ir.map(e,t,r)},setOption:C,getOption:k,defineOption:y,defineEx:function(e,t,r){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered');Er[e]=r,Ir.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,r){var n=this.findKey(e,t,r);return"function"==typeof n?n():void 0},findKey:function(r,n,o){function i(){var e=Cr.macroModeState;if(e.isRecording){if("q"==n)return e.exitMacroRecordMode(),b(r),!0;"mapping"!=o&&Qt(e,n)}}function a(){return""==n?(b(r),f.visualMode?st(r):f.insertMode&&Vt(r),!0):void 0}function s(t){for(var o;t;)o=/<\w+-.+?>|<\w+>|./.exec(t),n=o[0],t=t.substring(o.index+n.length),e.Vim.handleKey(r,n,"mapping")}function l(){if(a())return!0;for(var e=f.inputState.keyBuffer=f.inputState.keyBuffer+n,o=1==n.length,i=xr.matchCommand(e,t,f.inputState,"insert");e.length>1&&"full"!=i.type;){var e=f.inputState.keyBuffer=e.slice(1),s=xr.matchCommand(e,t,f.inputState,"insert");"none"!=s.type&&(i=s)}if("none"==i.type)return b(r),!1;if("partial"==i.type)return kr&&window.clearTimeout(kr),kr=window.setTimeout(function(){f.insertMode&&f.inputState.keyBuffer&&b(r)},k("insertModeEscKeysTimeout")),!o;if(kr&&window.clearTimeout(kr),o){var l=r.getCursor();r.replaceRange("",N(l,0,-(e.length-1)),l,"+input")}return b(r),i.command}function c(){if(i()||a())return!0;var e=f.inputState.keyBuffer=f.inputState.keyBuffer+n;if(/^[1-9]\d*$/.test(e))return!0;var o=/^(\d*)(.*)$/.exec(e);if(!o)return b(r),!1;var s=f.visualMode?"visual":"normal",l=xr.matchCommand(o[2]||o[1],t,f.inputState,s);if("none"==l.type)return b(r),!1;if("partial"==l.type)return!0;f.inputState.keyBuffer="";var o=/^(\d*)(.*)$/.exec(e);return o[1]&&"0"!=o[1]&&f.inputState.pushRepeatDigit(o[1]),l.command}var u,f=x(r);return u=f.insertMode?l():c(),u===!1?void 0:u===!0?function(){}:function(){return r.operation(function(){r.curOp.isVimOp=!0;try{"keyToKey"==u.type?s(u.toKeys):xr.processCommand(r,f,u)}catch(t){throw r.state.vim=void 0,x(r),e.Vim.suppressErrorLogging||console.log(t),t}return!0})}},handleEx:function(e,t){Ir.processCommand(e,t)},defineMotion:O,defineAction:I,defineOperator:E,mapCommand:Jt,_mapCommand:Ut,exitVisualMode:st,exitInsertMode:Vt};S.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},S.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},A.prototype={setText:function(e,t,r){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!r},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(yr(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},L.prototype={pushText:function(e,t,r,n,o){n&&"\n"==r.charAt(0)&&(r=r.slice(1)+"\n"),n&&"\n"!==r.charAt(r.length-1)&&(r+="\n");var i=this.isValidRegister(e)?this.getRegister(e):null;if(!i){switch(t){case"yank":this.registers[0]=new A(r,n,o);break;case"delete":case"change":-1==r.indexOf("\n")?this.registers["-"]=new A(r,n):(this.shiftNumericRegisters_(),this.registers[1]=new A(r,n))}return void this.unnamedRegister.setText(r,n,o)}var a=m(e);a?i.pushText(r,n):i.setText(r,n,o),this.unnamedRegister.setText(i.toString(),n)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new A),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&v(e,mr)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},T.prototype={nextMatch:function(e,t){var r=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+n;t?o>=0:o=r.length?(this.iterator=r.length,this.initialPrefix):0>o?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var xr={matchCommand:function(e,t,r,n){var o=F(e,t,n,r);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var i,a=0;a"==i.keys.slice(-11)&&(r.selectedCharacter=H(e)),{type:"full",command:i}},processCommand:function(e,t,r){switch(t.inputState.repeatOverride=r.repeatOverride,r.type){case"motion":this.processMotion(e,t,r);break;case"operator":this.processOperator(e,t,r);break;case"operatorMotion":this.processOperatorMotion(e,t,r);break;case"action":this.processAction(e,t,r);break;case"search":this.processSearch(e,t,r),b(e);break;case"ex":case"keyToEx":this.processEx(e,t,r),b(e)}},processMotion:function(e,t,r){t.inputState.motion=r.motion,t.inputState.motionArgs=P(r.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,r){var n=t.inputState;if(n.operator){if(n.operator==r.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);b(e)}n.operator=r.operator,n.operatorArgs=P(r.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,r){var n=t.visualMode,o=P(r.operatorMotionArgs);o&&n&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,r),n||this.processMotion(e,t,r)},processAction:function(e,t,r){var n=t.inputState,o=n.getRepeat(),i=!!o,a=P(r.actionArgs)||{};n.selectedCharacter&&(a.selectedCharacter=n.selectedCharacter),r.operator&&this.processOperator(e,t,r),r.motion&&this.processMotion(e,t,r),(r.motion||r.operator)&&this.evalInput(e,t),a.repeat=o||1,a.repeatIsExplicit=i,a.registerName=n.registerName,b(e),t.lastMotion=null,r.isEdit&&this.recordLastEdit(t,n,r),br[r.action](e,a,t)},processSearch:function(t,r,n){function o(e,o,i){Cr.searchHistoryController.pushInput(e),Cr.searchHistoryController.reset();try{Ft(t,e,o,i)}catch(a){return void Bt(t,"Invalid regex: "+e)}xr.processMotion(t,r,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}function i(e){t.scrollTo(h.left,h.top),o(e,!0,!0);var r=Cr.macroModeState;r.isRecording&&Yt(r,e)}function a(r,n,o){var i,a=e.keyName(r);"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=Cr.searchHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&Cr.searchHistoryController.reset();var s;try{s=Ft(t,n,!0,!0)}catch(r){}s?t.scrollIntoView(Dt(t,!l,s),30):(zt(t),t.scrollTo(h.left,h.top))}function s(r,n,o){var i=e.keyName(r);("Esc"==i||"Ctrl-C"==i||"Ctrl-["==i)&&(Cr.searchHistoryController.pushInput(n),Cr.searchHistoryController.reset(),Ft(t,f),zt(t),t.scrollTo(h.left,h.top),e.e_stop(r),o(),t.focus())}if(t.getSearchCursor){var l=n.searchArgs.forward,c=n.searchArgs.wholeWordOnly;bt(t).setReversed(!l);var u=l?"/":"?",f=bt(t).getQuery(),h=t.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var d=Cr.macroModeState;if(d.isPlaying){var p=d.replaySearchQueries.shift();o(p,!0,!1)}else Nt(t,{onClose:i,prefix:u,desc:Tr,onKeyUp:a,onKeyDown:s});break;case"wordUnderCursor":var m=ft(t,!1,!0,!1,!0),g=!0;if(m||(m=ft(t,!1,!0,!1,!1),g=!1),!m)return;var p=t.getLine(m.start.line).substring(m.start.ch,m.end.ch);p=g&&c?"\\b"+p+"\\b":G(p),Cr.jumpList.cachedCursor=t.getCursor(),t.setCursor(m.start),o(p,!0,!1)}}},processEx:function(t,r,n){function o(e){Cr.exCommandHistoryController.pushInput(e),Cr.exCommandHistoryController.reset(),Ir.processCommand(t,e)}function i(r,n,o){var i,a=e.keyName(r);("Esc"==a||"Ctrl-C"==a||"Ctrl-["==a)&&(Cr.exCommandHistoryController.pushInput(n),Cr.exCommandHistoryController.reset(),e.e_stop(r),o(),t.focus()),"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=Cr.exCommandHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&Cr.exCommandHistoryController.reset()}"keyToEx"==n.type?Ir.processCommand(t,n.exArgs.input):r.visualMode?Nt(t,{onClose:o,prefix:":",value:"'<,'>",onKeyDown:i}):Nt(t,{onClose:o,prefix:":",onKeyDown:i})},evalInput:function(e,t){var n,o,i,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},f=a.registerName,h=t.sel,d=z(t.visualMode?h.head:e.getCursor("head")),p=z(t.visualMode?h.anchor:e.getCursor("anchor")),m=z(d),g=z(p);if(c&&this.recordLastEdit(t,a),i=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat(),i>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===i)&&(i=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=i,b(e),s){var v=Mr[s](e,d,l,t);if(t.lastMotion=Mr[s],!v)return;if(l.toJumplist){var y=Cr.jumpList,C=y.cachedCursor;C?(ht(e,C,v),delete y.cachedCursor):ht(e,d,v)}v instanceof Array?(o=v[0],n=v[1]):n=v,n||(n=z(d)),t.visualMode?(t.visualBlock&&1/0===n.ch||(n=B(e,n,t.visualBlock)),o&&(o=B(e,o,!0)),o=o||g,h.anchor=o,h.head=n,ot(e),Ct(e,t,"<",W(o,n)?o:n),Ct(e,t,">",W(o,n)?n:o)):c||(n=B(e,n),e.setCursor(n.line,n.ch)) +-}if(c){if(u.lastSel){o=g;var k=u.lastSel,w=Math.abs(k.head.line-k.anchor.line),x=Math.abs(k.head.ch-k.anchor.ch);n=k.visualLine?r(g.line+w,g.ch):k.visualBlock?r(g.line+w,g.ch+x):k.head.line==k.anchor.line?r(g.line,g.ch+x):r(g.line+w,g.ch),t.visualMode=!0,t.visualLine=k.visualLine,t.visualBlock=k.visualBlock,h=t.sel={anchor:o,head:n},ot(e)}else t.visualMode&&(u.lastSel={anchor:z(h.anchor),head:z(h.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var M,S,A,L,T;if(t.visualMode){if(M=q(h.head,h.anchor),S=V(h.head,h.anchor),A=t.visualLine||u.linewise,L=t.visualBlock?"block":A?"line":"char",T=it(e,{anchor:M,head:S},L),A){var O=T.ranges;if("block"==L)for(var R=0;Rl&&i.line==c||l>u&&i.line==u?void 0:(n.toFirstChar&&(a=ut(e.getLine(l)),o.lastHPos=a),o.lastHSPos=e.charCoords(r(l,a),"div").left,r(l,a))},moveByDisplayLines:function(e,t,n,o){var i=t;switch(o.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:o.lastHSPos=e.charCoords(i,"div").left}var a=n.repeat,s=e.findPosV(i,n.forward?a:-a,"line",o.lastHSPos);if(s.hitSide)if(n.forward)var l=e.charCoords(s,"div"),c={top:l.top+8,left:o.lastHSPos},s=e.coordsChar(c,"div");else{var u=e.charCoords(r(e.firstLine(),0),"div");u.left=o.lastHSPos,s=e.coordsChar(u,"div")}return o.lastHPos=s.ch,s},moveByPage:function(e,t,r){var n=t,o=r.repeat;return e.findPosV(n,r.forward?o:-o,"page")},moveByParagraph:function(e,t,r){var n=r.forward?1:-1;return wt(e,t,r.repeat,n)},moveByScroll:function(e,t,r,n){var o=e.getScrollInfo(),i=null,a=r.repeat;a||(a=o.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");r.repeat=a;var i=Mr.moveByDisplayLines(e,t,r,n);if(!i)return null;var l=e.charCoords(i,"local");return e.scrollTo(null,o.top+l.top-s.top),i},moveByWords:function(e,t,r){return gt(e,t,r.repeat,!!r.forward,!!r.wordEnd,!!r.bigWord)},moveTillCharacter:function(e,t,r){var n=r.repeat,o=vt(e,n,r.forward,r.selectedCharacter),i=r.forward?-1:1;return dt(i,r),o?(o.ch+=i,o):null},moveToCharacter:function(e,t,r){var n=r.repeat;return dt(0,r),vt(e,n,r.forward,r.selectedCharacter)||t},moveToSymbol:function(e,t,r){var n=r.repeat;return pt(e,n,r.forward,r.selectedCharacter)||t},moveToColumn:function(e,t,r,n){var o=r.repeat;return n.lastHPos=o-1,n.lastHSPos=e.charCoords(t,"div").left,yt(e,o)},moveToEol:function(e,t,n,o){var i=t;o.lastHPos=1/0;var a=r(i.line+n.repeat-1,1/0),s=e.clipPos(a);return s.ch--,o.lastHSPos=e.charCoords(s,"div").left,a},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return r(n.line,ut(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n,o=t,i=o.line,a=o.ch,s=e.getLine(i);do if(n=s.charAt(a++),n&&d(n)){var l=e.getTokenTypeAt(r(i,a));if("string"!==l&&"comment"!==l)break}while(n);if(n){var c=e.findMatchingBracket(r(i,a));return c.to}return o},moveToStartOfLine:function(e,t){return r(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var o=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(o=n.repeat-e.getOption("firstLineNumber")),r(o,ut(e.getLine(o)))},textObjectManipulation:function(e,t,r,n){var o={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},i={"'":!0,'"':!0},a=r.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!r.textObjectInner;if(o[a])s=xt(e,t,a,l);else if(i[a])s=Mt(e,t,a,l);else if("W"===a)s=ft(e,l,!0,!0);else if("w"===a)s=ft(e,l,!0,!1);else{if("p"!==a)return null;if(s=wt(e,t,r.repeat,0,l),r.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var c=n.inputState.operatorArgs;c&&(c.linewise=!0),s.end.line--}}return e.state.vim.visualMode?nt(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,r){var n=Cr.lastChararacterSearch,o=r.repeat,i=r.forward===n.forward,a=(n.increment?1:0)*(i?-1:1);e.moveH(-a,"char"),r.inclusive=i?!0:!1;var s=vt(e,o,i,n.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}},Sr={change:function(t,r,n){var o,i,a=t.state.vim;if(Cr.macroModeState.lastInsertModeChanges.inVisualBlock=a.visualBlock,a.visualMode){i=t.getSelection();var s=R("",n.length);t.replaceSelections(s),o=q(n[0].head,n[0].anchor)}else{var l=n[0].anchor,c=n[0].head;if(i=t.getRange(l,c),!g(i)){var u=/\s+$/.exec(i);u&&(c=N(c,0,-u[0].length),i=i.slice(0,-u[0].length))}var f=c.line-1==t.lastLine();t.replaceRange("",l,c),r.linewise&&!f&&(e.commands.newlineAndIndent(t),l.ch=null),o=l}Cr.registerController.pushText(r.registerName,"change",i,r.linewise,n.length>1),br.enterInsertMode(t,{head:o},t.state.vim)},"delete":function(e,t,n){var o,i,a=e.state.vim;if(a.visualBlock){i=e.getSelection();var s=R("",n.length);e.replaceSelections(s),o=n[0].anchor}else{var l=n[0].anchor,c=n[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=r(l.line-1,J(e,l.line-1))),i=e.getRange(l,c),e.replaceRange("",l,c),o=l,t.linewise&&(o=Mr.moveToFirstNonWhiteSpaceCharacter(e,l))}return Cr.registerController.pushText(t.registerName,"delete",i,t.linewise,a.visualBlock),B(e,o)},indent:function(e,t,r){var n=e.state.vim,o=r[0].anchor.line,i=n.visualBlock?r[r.length-1].anchor.line:r[0].head.line,a=n.visualMode?t.repeat:1;t.linewise&&i--;for(var s=o;i>=s;s++)for(var l=0;a>l;l++)e.indentLine(s,t.indentRight);return Mr.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},changeCase:function(e,t,r,n,o){for(var i=e.getSelections(),a=[],s=t.toLower,l=0;lc.top?(l.line+=(s-c.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u=a.anchor.line?N(a.head,0,1):r(a.anchor.line,0);else if("inplace"==i&&o.visualMode)return;t.setOption("keyMap","vim-insert"),t.setOption("disableInput",!1),n&&n.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})),Cr.macroModeState.isPlaying||(t.on("change",Xt),e.on(t.getInputField(),"keydown",nr)),o.visualMode&&st(t),Z(t,s,l)}},toggleVisualMode:function(t,n,o){var i,a=n.repeat,s=t.getCursor();o.visualMode?o.visualLine^n.linewise||o.visualBlock^n.blockwise?(o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t)):st(t):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,i=B(t,r(s.line,s.ch+a-1),!0),o.sel={anchor:s,head:i},e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t),Ct(t,o,"<",q(s,i)),Ct(t,o,">",V(s,i)))},reselectLastSelection:function(t,r,n){var o=n.lastSelection;if(n.visualMode&&rt(t,n),o){var i=o.anchorMark.find(),a=o.headMark.find();if(!i||!a)return;n.sel={anchor:i,head:a},n.visualMode=!0,n.visualLine=o.visualLine,n.visualBlock=o.visualBlock,ot(t),Ct(t,n,"<",q(i,a)),Ct(t,n,">",V(i,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var o,i;if(n.visualMode){if(o=e.getCursor("anchor"),i=e.getCursor("head"),W(i,o)){var a=i;i=o,o=a}i.ch=J(e,i.line)-1}else{var s=Math.max(t.repeat,2);o=e.getCursor(),i=B(e,r(o.line+s-1,1/0))}for(var l=0,c=o.line;cr)return"";if(e.getOption("indentWithTabs")){var n=Math.floor(r/s);return Array(n+1).join(" ")}return Array(r+1).join(" ")});a+=h?"\n":""}if(t.repeat>1)var a=Array(t.repeat+1).join(a);var p=i.linewise,m=i.blockwise;if(p)n.visualMode?a=n.visualLine?a.slice(0,-1):"\n"+a.slice(0,a.length-1)+"\n":t.after?(a="\n"+a.slice(0,a.length-1),o.ch=J(e,o.line)):o.ch=0;else{if(m){a=a.split("\n");for(var g=0;ge.lastLine()&&e.replaceRange("\n",r(A,0));var L=J(e,A);Lu.length&&(i=u.length),a=r(l.line,i)}if("\n"==s)o.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var f=t.getRange(l,a);if(f=f.replace(/[^\n]/g,s),o.visualBlock){var h=new Array(t.getOption("tabSize")+1).join(" ");f=t.getSelection(),f=f.replace(/\t/g,h).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(f)}else t.replaceRange(f,l,a);o.visualMode?(l=W(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),st(t,!1)):t.setCursor(N(a,0,-1))}},incrementNumberToken:function(e,t){for(var n,o,i,a,s,l=e.getCursor(),c=e.getLine(l.line),u=/-?\d+/g;null!==(n=u.exec(c))&&(s=n[0],o=n.index,i=o+s.length,!(l.ch=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb?!0:!1}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};y("pcre",!0,"boolean"),St.prototype={getQuery:function(){return Cr.query},setQuery:function(e){Cr.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return Cr.isReversed},setReversed:function(e){Cr.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Tr="(Javascript regexp)",Or=[{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:"set"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],Rr=function(){this.buildCommandMap_()};Rr.prototype={processCommand:function(t,r,n){var o=t.state.vim,i=Cr.registerController.getRegister(":"),a=i.toString();o.visualMode&&st(t);var s=new e.StringStream(r);i.setText(r);var l=n||{};l.input=r;try{this.parseInput_(t,s,l)}catch(c){throw Bt(t,c),c}var u,f;if(l.commandName){if(u=this.matchCommand_(l.commandName)){if(f=u.name,u.excludeFromCommandHistory&&i.setText(a),this.parseCommandArgs_(s,l,u),"exToKey"==u.type){for(var h=0;h0;t--){var r=e.substring(0,t);if(this.commandMap_[r]){var n=this.commandMap_[r];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e
    ";if(r){var i;r=r.join("");for(var a=0;a"}}else for(var i in n){var l=n[i].toString();l.length&&(o+='"'+i+" "+l+"
    ")}Bt(e,o)},sort:function(t,n){function o(){if(n.argString){var t=new e.StringStream(n.argString);if(t.eat("!")&&(a=!0),t.eol())return;if(!t.eatSpace())return"Invalid arguments";var r=t.match(/[a-z]+/);if(r){r=r[0],s=-1!=r.indexOf("i"),l=-1!=r.indexOf("u");var o=-1!=r.indexOf("d")&&1,i=-1!=r.indexOf("x")&&1,u=-1!=r.indexOf("o")&&1;if(o+i+u>1)return"Invalid arguments";c=o&&"decimal"||i&&"hex"||u&&"octal"}t.eatSpace()&&t.match(/\/.*\//)}}function i(e,t){if(a){var r;r=e,e=t,t=r}s&&(e=e.toLowerCase(),t=t.toLowerCase());var n=c&&g.exec(e),o=c&&g.exec(t);return n?(n=parseInt((n[1]+n[2]).toLowerCase(),v),o=parseInt((o[1]+o[2]).toLowerCase(),v),n-o):t>e?-1:1}var a,s,l,c,u=o();if(u)return void Bt(t,u+": "+n.argString);var f=n.line||t.firstLine(),h=n.lineEnd||n.line||t.lastLine();if(f!=h){var d=r(f,0),p=r(h,J(t,h)),m=t.getRange(d,p).split("\n"),g="decimal"==c?/(-?)([\d]+)/:"hex"==c?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==c?/([0-7]+)/:null,v="decimal"==c?10:"hex"==c?16:"octal"==c?8:null,y=[],C=[];if(c)for(var k=0;k=h;h++){var d=c.test(e.getLine(h));d&&(u.push(h+1),f+=e.getLine(h)+"
    ")}if(!n)return void Bt(e,f);var p=0,m=function(){if(p=u)return void Bt(t,"Invalid argument: "+r.argString.substring(i));for(var f=0;u-c>=f;f++){var d=String.fromCharCode(c+f);delete n.marks[d]}}else delete n.marks[a]}}},Ir=new Rr;return e.keyMap.vim={attach:a,detach:i,call:s},y("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(t){var r=e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent;r(t)},fallthrough:["default"],attach:a,detach:i,call:s},e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:a,detach:i,call:s},M(),wr};e.Vim=n()}); +\ 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){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()}a.defineExtension("addPanel",function(a,d){d=d||{},this.state.panels||c(this);var e=this.state.panels,f=e.wrapper,g=this.getWrapperElement();d.after instanceof b&&!d.after.cleared?f.insertBefore(a,d.before.node.nextSibling):d.before instanceof b&&!d.before.cleared?f.insertBefore(a,d.before.node):d.replace instanceof b&&!d.replace.cleared?(f.insertBefore(a,d.replace.node),d.replace.clear()):"bottom"==d.position?f.appendChild(a):"before-bottom"==d.position?f.insertBefore(a,g.nextSibling):"after-top"==d.position?f.insertBefore(a,g):f.insertBefore(a,f.firstChild);var h=d&&d.height||a.offsetHeight;return this._setSize(null,e.heightLeft-=h),e.panels++,new b(this,a,d,h)}),b.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var a=this.cm.state.panels;this.cm._setSize(null,a.heightLeft+=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.height+=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]:k[b]}function c(a){return function(b){return g(b,a)}}function d(a){var b=a.state.closeBrackets;if(!b)return null;var c=a.getModeAt(a.getCursor());return c.closeBrackets||b}function e(c){var e=d(c);if(!e||c.getOption("disableInput"))return a.Pass;for(var f=b(e,"pairs"),g=c.listSelections(),h=0;h=0;h--){var k=g[h].head;c.replaceRange("",l(k.line,k.ch-1),l(k.line,k.ch+1))}}function f(c){var e=d(c),f=e&&b(e,"explode");if(!f||c.getOption("disableInput"))return a.Pass;for(var g=c.listSelections(),h=0;h1&&n.indexOf(e)>=0&&c.getRange(l(u.line,u.ch-2),u)==e+e&&(u.ch<=2||c.getRange(l(u.line,u.ch-3),l(u.line,u.ch-2))!=e))s="addFour";else if(o){if(a.isWordChar(m)||!j(c,u,e))return a.Pass;s="both"}else{if(!q||c.getLine(u.line).length!=u.ch&&!h(m,g)&&!/\s/.test(m))return a.Pass;s="both"}else s=n.indexOf(e)>=0&&c.getRange(u,l(u.line,u.ch+3))==e+e+e?"skipThree":"skip";if(k){if(k!=s)return a.Pass}else k=s}var v=i%2?g.charAt(i-1):e,w=i%2?e:g.charAt(i+1);c.operation(function(){if("skip"==k)c.execCommand("goCharRight");else if("skipThree"==k)for(var a=0;3>a;a++)c.execCommand("goCharRight");else if("surround"==k){for(var b=c.getSelections(),a=0;a-1&&c%2==1}function i(a,b){var c=a.getRange(l(b.line,b.ch-1),l(b.line,b.ch+1));return 2==c.length?c:null}function j(b,c,d){var e=b.getLine(c.line),f=b.getTokenAt(c);if(/\bstring2?\b/.test(f.type))return!1;var g=new a.StringStream(e.slice(0,c.ch)+d+e.slice(c.ch),4);for(g.pos=g.start=f.start;;){var h=b.getMode().token(g,f.state);if(g.pos>=c.ch+1)return/\bstring2?\b/.test(h);g.start=g.pos}}var k={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},l=a.Pos;a.defineOption("autoCloseBrackets",!1,function(b,c,d){d&&d!=a.Init&&(b.removeKeyMap(n),b.state.closeBrackets=null),c&&(b.state.closeBrackets=c,b.addKeyMap(n))});for(var m=k.pairs+"`",n={Backspace:e,Enter:f},o=0;oj.ch&&(r=r.slice(0,r.length-k.end+j.ch));var s=r.toLowerCase();if(!r||"string"==k.type&&(k.end!=j.ch||!/[\"\']/.test(k.string.charAt(k.string.length-1))||1==k.string.length)||"tag"==k.type&&"closeTag"==m.type||k.string.indexOf("/")==k.string.length-1||p&&e(p,s)>-1||f(b,r,j,m,!0))return a.Pass;var t=q&&e(q,s)>-1;d[i]={indent:t,text:">"+(t?"\n\n":"")+"",newPos:t?a.Pos(j.line+1,0):a.Pos(j.line,j.ch+1)}}for(var i=c.length-1;i>=0;i--){var u=d[i];b.replaceRange(u.text,c[i].head,c[i].anchor,"+insert");var v=b.listSelections().slice(0);v[i]={head:u.newPos,anchor:u.newPos},b.setSelections(v),u.indent&&(b.indentLine(u.newPos.line,null,!0),b.indentLine(u.newPos.line+1,null,!0))}}function c(b,c){for(var d=b.listSelections(),e=[],g=c?"/":"";else{if("htmlmixed"!=b.getMode().name||"css"!=k.mode.name)return a.Pass;e[h]=g+"style>"}else{if(!l.context||!l.context.tagName||f(b,l.context.tagName,i,l))return a.Pass;e[h]=g+l.context.tagName+">"}}b.replaceSelections(e),d=b.listSelections();for(var h=0;hc;++c)if(a[c]==b)return c;return-1}function f(b,c,d,e,f){if(!a.scanForClosingTag)return!1;var g=Math.min(b.lastLine()+1,d.line+500),h=a.scanForClosingTag(b,d,null,g);if(!h||h.tag!=c)return!1;for(var i=e.context,j=f?1:0;i&&i.tagName==c;i=i.prev)++j;d=h.to;for(var k=1;j>k;k++){var l=a.scanForClosingTag(b,d,null,g);if(!l||l.tag!=c)return!1;d=l.to}return!0}a.defineOption("autoCloseTags",!1,function(c,e,f){if(f!=a.Init&&f&&c.removeKeyMap("autoCloseTags"),e){var g={name:"autoCloseTags"};("object"!=typeof e||e.whenClosing)&&(g["'/'"]=function(a){return d(a)}),("object"!=typeof e||e.whenOpening)&&(g["'>'"]=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,e){var f=a.getLineHandle(b.line),i=b.ch-1,j=i>=0&&h[f.text.charAt(i)]||h[f.text.charAt(++i)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(d&&k>0!=(i==b.ch))return null;var l=a.getTokenTypeAt(g(b.line,i+1)),m=c(a,g(b.line,i+(k>0?1:0)),k,l||null,e);return null==m?null:{from:g(b.line,i),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-(0>c?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())?!1:null}function d(a,c,d){for(var e=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},i=null;a.defineOption("matchBrackets",!1,function(b,c,d){d&&d!=a.Init&&b.off("cursorActivity",e),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 b(this,a,c,d)}),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 e=c.ch,i=0;;){var j=0>=e?-1:h.lastIndexOf(d,e-1);if(-1!=j){if(1==i&&j=o;++o)for(var p=b.getLine(o),q=o==g?e:0;;){var r=p.indexOf(i,q),s=p.indexOf(j,q);if(0>r&&(r=p.length),0>s&&(s=p.length),q=Math.min(r,s),q==p.length)break;if(b.getTokenTypeAt(a.Pos(o,q+1))==f)if(q==r)++m;else if(!--m){k=o,l=q;break a}++q}if(null!=k&&(g!=k||l!=e))return{from:a.Pos(g,e),to:a.Pos(k,l)}}}),a.registerHelper("fold","import",function(b,c){function d(c){if(cb.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);f>=e;++e){var g=b.getLine(e),h=g.indexOf(";");if(-1!=h)return{startCh:d.end,end:a.Pos(e,h)}}}var e,c=c.line,f=d(c);if(!f||d(c-1)||(e=d(c-2))&&e.end.line==c-1)return null;for(var g=f.end;;){var h=d(g.line+1);if(null==h)break;g=h.end}return{from:b.clipPos(a.Pos(c,f.startCh+1)),to:g}}),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 c=c.line,e=d(c);if(null==e||null!=d(c-1))return null;for(var f=c;;){var g=d(f+1);if(null==g)break;++f}return{from:a.Pos(c,e+1),to:b.clipPos(a.Pos(f))}})}),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:!0,__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"}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=c;c++)b.foldCode(a.Pos(c,0),null,"fold")})},a.commands.unfoldAll=function(b){b.operation(function(){for(var c=b.firstLine(),d=b.lastLine();d>=c;c++)b.foldCode(a.Pos(c,0),null,"unfold")})},a.registerHelper("fold","combine",function(){var a=Array.prototype.slice.call(arguments,0);return function(b,c){for(var d=0;d=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?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function f(a){return a.line<=a.min?void 0:(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(-1==b){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(-1==b){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(-1==b){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(0>j&&(!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(0>i&&(!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||d.line!=b.line||!(e=g(d)))return;if(!f[1]&&"selfClose"!=e){var b=m(d.line,d.ch),h=k(d,f[2]);return h&&{from:b,to:h.from}}}}),a.findMatchingTag=function(a,d,e){var f=new c(a,d.line,d.ch,e);if(-1!=f.text.indexOf(">")||-1!=f.text.indexOf("<")){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){for(var e=new c(a,b.line,b.ch,d);;){var f=l(e);if(!f)break;var g=new c(a,b.line,b.ch,d),h=k(g,f.tag);if(h)return{open:f,close:h}}},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;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;li&&(k=i)}k!=1/0&&(e.string=h.slice(0,k));var n=b.token(e,f.outer);return k!=1/0&&(e.string=h),n},indent:function(c,d){var e=c.innerActive?c.innerActive.mode:b;return e.indent?e.indent(c.innerActive?c.inner:c.outer,d):a.Pass},blankLine:function(c){var e=c.innerActive?c.innerActive.mode:b;if(e.blankLine&&e.blankLine(c.innerActive?c.inner:c.outer),c.innerActive)"\n"===c.innerActive.close&&(c.innerActive=c.inner=null);else for(var f=0;fd.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.moveTo=function(a,b){0>a&&(a=0),a>this.total-this.screen&&(a=this.total-this.screen),a!=this.pos&&(this.pos=a,this.inner.style["horizontal"==this.orientation?"left":"top"]=a*(this.size/this.total)+"px",b!==!1&&this.scroll(a,this.orientation))};var d=10;b.prototype.update=function(a,b,c){this.screen=b,this.total=a,this.size=c;var e=this.screen*(this.size/this.total);d>e&&(this.size-=d-e,e=d),this.inner.style["horizontal"==this.orientation?"width":"height"]=e+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},c.prototype.update=function(a){if(null==this.width){var b=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;b&&(this.width=parseInt(b.height))}var c=this.width||0,d=a.scrollWidth>a.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.display="block",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.moveTo(a,!1)},c.prototype.setScrollLeft=function(a){this.horiz.moveTo(a,!1)},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")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b=0;b",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:"xi",context:"visual" ++},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",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:"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:"moveToEol",motionArgs:{inclusive:!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:"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:"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:"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",_a),x(b),a.on(b.getInputField(),"paste",k(b))}function f(b){b.setOption("disableInput",!1),b.off("cursorActivity",_a),a.off(b.getInputField(),"paste",k(b)),b.state.vim=null}function g(b,c){this==a.keyMap.vim&&a.rmClass(b.getWrapperElement(),"cm-fat-cursor"),c&&c.attach==h||f(b,!1)}function h(b,c){this==a.keyMap.vim&&a.addClass(b.getWrapperElement(),"cm-fat-cursor"),c&&c.attach==h||e(b)}function i(b,c){if(!c)return void 0;var d=j(b);if(!d)return!1;var e=a.Vim.findKey(c,d);return"function"==typeof e&&a.signal(c,"vim-keypress",d),e}function j(a){if("'"==a.charAt(0))return a.charAt(1);var b=a.split("-");/-$/.test(a)&&b.splice(-2,2,"-");var c=b[b.length-1];if(1==b.length&&1==b[0].length)return!1;if(2==b.length&&"Shift"==b[0]&&1==c.length)return!1;for(var d=!1,e=0;e"):!1}function k(a){var b=a.state.vim;return b.onPasteFn||(b.onPasteFn=function(){b.insertMode||(a.setCursor(K(a.getCursor(),0,1)),zb.enterInsertMode(a,{},b))}),b.onPasteFn}function l(a,b){for(var c=[],d=a;a+b>d;d++)c.push(String.fromCharCode(d));return c}function m(a,b){return b>=a.firstLine()&&b<=a.lastLine()}function n(a){return/^[a-z]$/.test(a)}function o(a){return-1!="()[]{}".indexOf(a)}function p(a){return ib.test(a)}function q(a){return/^[A-Z]$/.test(a)}function r(a){return/^\s*$/.test(a)}function s(a,b){for(var c=0;cd;d++)c.push(a);return c}function G(a,b){yb[a]=b}function H(a,b){zb[a]=b}function I(a,b,c){var e=Math.min(Math.max(a.firstLine(),b.line),a.lastLine()),f=W(a,e)-1;f=c?f+1:f;var g=Math.min(Math.max(0,b.ch),f);return d(e,g)}function J(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function K(a,b,c){return"object"==typeof b&&(c=b.ch,b=b.line),d(a.line+b,a.ch+c)}function L(a,b){return{line:b.line-a.line,ch:b.line-a.line}}function M(a,b,c,d){for(var e,f=[],g=[],h=0;h"==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":!1}return a==b?"full":0==b.indexOf(a)?"partial":!1}function O(a){var b=/^.*(<[\w\-]+>)$/.exec(a),c=b?b[1]:a.slice(-1);if(c.length>1)switch(c){case"":c="\n";break;case"":c=" "}return c}function P(a,b,c){return function(){for(var d=0;c>d;d++)b(a)}}function Q(a){return d(a.line,a.ch)}function R(a,b){return a.ch==b.ch&&a.line==b.line}function S(a,b){return a.line2&&(b=T.apply(void 0,Array.prototype.slice.call(arguments,1))),S(a,b)?a:b}function U(a,b){return arguments.length>2&&(b=U.apply(void 0,Array.prototype.slice.call(arguments,1))),S(a,b)?b:a}function V(a,b,c){var d=S(a,b),e=S(b,c);return d&&e}function W(a,b){return a.getLine(b).length}function X(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Y(a){return a.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Z(a,b,c){var e=W(a,b),f=new Array(c-e+1).join(" ");a.setCursor(d(b,e)),a.replaceRange(f,a.getCursor())}function $(a,b){var c=[],e=a.listSelections(),f=Q(a.clipPos(b)),g=!R(b,f),h=a.getCursor("head"),i=aa(e,h),j=R(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&&0>=s?(p++,g||q--):0>r&&s>=0?(p--,j||q++):0>r&&-1==s&&(p--,q++);for(var t=n;o>=t;t++){var u={anchor:new d(t,p),head:new d(t,q)};c.push(u)}return i=f.line==o?c.length-1:0,a.setSelections(c),b.ch=q,m.ch=p,m}function _(a,b,c){for(var d=[],e=0;c>e;e++){var f=K(b,e,0);d.push({anchor:f,head:f})}a.setSelections(d,0)}function aa(a,b,c){for(var d=0;dj&&(f.line=j),f.ch=W(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;o>r;r++)q.push({anchor:d(k+r,l),head:d(k+r,n)});return{ranges:q,primary:p}}}function ga(a){var b=a.getCursor("head");return 1==a.getSelection().length&&(b=T(b,a.getCursor("anchor"))),b}function ha(b,c){var d=b.state.vim;c!==!1&&b.setCursor(I(b,d.sel.head)),ca(b,d),d.visualMode=!1,d.visualLine=!1,d.visualBlock=!1,a.signal(b,"vim-mode-change",{mode:"normal"}),d.fakeCursor&&d.fakeCursor.clear()}function ia(a,b,c){var d=a.getRange(b,c);if(/\n\s*$/.test(d)){var e=d.split("\n");e.pop();for(var f,f=e.pop();e.length>0&&f&&r(f);f=e.pop())c.line--,c.ch=0;f?(c.line--,c.ch=W(a,c.line)):c.ch=0}}function ja(a,b,c){b.ch=0,c.ch=0,c.line++}function ka(a){if(!a)return 0;var b=a.search(/\S/);return-1==b?a.length:b}function la(a,b,c,e,f){for(var g=ga(a),h=a.getLine(g.line),i=g.ch,j=f?jb[0]:kb[0];!j(h.charAt(i));)if(i++,i>=h.length)return null;e?j=kb[0]:(j=jb[0],j(h.charAt(i))||(j=jb[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 ma(a,b,c){R(b,c)||tb.jumpList.add(a,b,c)}function na(a,b){tb.lastChararacterSearch.increment=a,tb.lastChararacterSearch.forward=b.forward,tb.lastChararacterSearch.selectedCharacter=b.selectedCharacter}function oa(a,b,c,e){var f=Q(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=Ab[e];if(!m)return f;var n=Bb[m].init,o=Bb[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 pa(a,b,c,d,e){var f=b.line,g=b.ch,h=a.getLine(f),i=c?1:-1,j=d?kb:jb;if(e&&""==h){if(f+=i,h=a.getLine(f),!m(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,n=k;g!=k;){for(var o=!1,p=0;p0?0:h.length}throw new Error("The impossible happened.")}function qa(a,b,c,e,f,g){var h=Q(b),i=[];(e&&!f||!e&&f)&&c++;for(var j=!(e&&f),k=0;c>k;k++){var l=pa(a,b,e,g,j);if(!l){var m=W(a,a.lastLine());i.push(e?{line:a.lastLine(),from:m,to:m}:{line:0,from:0,to:0});break}i.push(l),b=d(l.line,e?l.to-1:l.from)}var n=i.length!=c,o=i[0],p=i.pop();return e&&!f?(n||o.from==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.from)):e&&f?d(p.line,p.to-1):!e&&f?(n||o.to==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.to)):d(p.line,p.from)}function ra(a,b,c,e){for(var f,g=a.getCursor(),h=g.ch,i=0;b>i;i++){var j=a.getLine(g.line);if(f=ua(h,j,e,c,!0),-1==f)return null;h=f}return d(a.getCursor().line,f)}function sa(a,b){var c=a.getCursor().line;return I(a,d(c,b-1))}function ta(a,b,c,d){s(c,ob)&&(b.marks[c]&&b.marks[c].clear(),b.marks[c]=a.setBookmark(d))}function ua(a,b,c,d,e){var f;return d?(f=b.indexOf(c,a+1),-1==f||e||(f-=1)):(f=b.lastIndexOf(c,a-1),-1==f||e||(f+=1)),f}function va(a,b,c,e,f){function g(b){return!a.getLine(b)}function h(a,b,c){return c?g(a)!=g(a+b):!g(a)&&g(a+b)}var i,j,k=b.line,l=a.firstLine(),m=a.lastLine(),n=k;if(e){for(;n>=l&&m>=n&&c>0;)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;m>=n&&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 wa(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 xa(a,b,c,e){var f,g,h,i,j=Q(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;i>h&&!g;h++)l[h]==c&&(g=h);return f&&g?(e&&(--f,++g),{start:d(j.line,f),end:d(j.line,g)}):{start:j,end:j}}function ya(){}function za(a){var b=a.state.vim;return b.searchState_||(b.searchState_=new ya)}function Aa(a,b,c,d,e){a.openDialog?a.openDialog(b,d,{bottom:!0,value:e.value,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,selectValueOnOpen:!1}):d(prompt(c,""))}function Ba(a){var b=Ca(a)||[];if(!b.length)return[];var c=[];if(0===b[0]){for(var d=0;d'+b+"
    ",{bottom:!0,duration:5e3}):alert(b)}function Ia(a,b){var c="";return a&&(c+=''+a+""),c+=' ',b&&(c+='',c+=b,c+=""),c}function Ja(a,b){var c=(b.prefix||"")+" "+(b.desc||""),d=Ia(b.prefix,b.desc);Aa(a,d,c,b.onClose,b)}function Ka(a,b){if(a instanceof RegExp&&b instanceof RegExp){for(var c=["global","multiline","ignoreCase","source"],d=0;dh;h++){var i=g.find(b);if(0==h&&i&&R(g.from(),f)&&(i=g.find(b)),!i&&(g=a.getSearchCursor(c,b?d(a.lastLine()):d(a.firstLine(),0)),!g.find(b)))return}return g.from()})}function Pa(a){var b=za(a);a.removeOverlay(za(a).getOverlay()),b.setOverlay(null),b.getScrollbarAnnotate()&&(b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(null))}function Qa(a,b,c){return"number"!=typeof a&&(a=a.line),b instanceof Array?s(a,b):c?a>=b&&c>=a:a==b}function Ra(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 Sa(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()&&Qa(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 Ha(b,"No matches for "+h.source):c?void Ja(b,{prefix:"replace with "+i+" (y/n/a/q/l)",onKeyDown:o}):(k(),void(j&&j()))}function Ta(b){var c=b.state.vim,d=tb.macroModeState,e=tb.registerController.getRegister("."),f=d.isPlaying,g=d.lastInsertModeChanges,h=[];if(!f){for(var i=g.inVisualBlock?c.lastSelection.visualBlock.height:1,j=g.changes,h=[],k=0;k1&&(eb(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&&Ya(d)}function Ua(a){b.push(a)}function Va(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];Ua(f)}function Wa(b,c,d,e){var f=tb.registerController.getRegister(e);if(":"==e)return f.keyBuffer[0]&&Hb.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;tb.macroModeState.lastInsertModeChanges.changes=m,fb(b,m,1),Ta(b)}d.isPlaying=!1}function Xa(a,b){if(!a.isPlaying){var c=a.latestRegister,d=tb.registerController.getRegister(c);d&&d.pushText(b)}}function Ya(a){if(!a.isPlaying){var b=a.latestRegister,c=tb.registerController.getRegister(b);c&&c.pushInsertModeChanges(a.lastInsertModeChanges)}}function Za(a,b){if(!a.isPlaying){var c=a.latestRegister,d=tb.registerController.getRegister(c);d&&d.pushSearchQuery(b)}}function $a(a,b){var c=tb.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.changes.push(e)}b=b.next}}function _a(a){var b=a.state.vim;if(b.insertMode){var c=tb.macroModeState;if(c.isPlaying)return;var d=c.lastInsertModeChanges;d.expectCursorActivityForChange?d.expectCursorActivityForChange=!1:d.changes=[]}else a.curOp.isVimOp||bb(a,b);b.visualMode&&ab(a)}function ab(a){var b=a.state.vim,c=I(a,Q(b.sel.head)),d=K(c,0,1);b.fakeCursor&&b.fakeCursor.clear(),b.fakeCursor=a.markText(c,d,{className:"cm-animate-fat-cursor"})}function bb(b,c){var d=b.getCursor("anchor"),e=b.getCursor("head");if(c.visualMode&&!b.somethingSelected()?ha(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=S(e,d)?0:-1,g=S(e,d)?-1:0;e=K(e,0,f),d=K(d,0,g),c.sel={anchor:d,head:e},ta(b,c,"<",T(e,d)),ta(b,c,">",U(e,d))}else c.insertMode||(c.lastHPos=b.getCursor().ch); ++}function cb(a){this.keyName=a}function db(b){function c(){return e.changes.push(new cb(f)),!0}var d=tb.macroModeState,e=d.lastInsertModeChanges,f=a.keyName(b);f&&(-1!=f.indexOf("Delete")||-1!=f.indexOf("Backspace"))&&a.lookupKey(f,"vim-insert",c)}function eb(a,b,c,d){function e(){h?wb.processAction(a,b,b.lastEditActionCommand):wb.evalInput(a,b)}function f(c){if(g.lastInsertModeChanges.changes.length>0){c=b.lastEditActionCommand?c:1;var d=g.lastInsertModeChanges;fb(a,d.changes,c)}}var g=tb.macroModeState;g.isPlaying=!0;var h=!!b.lastEditActionCommand,i=b.inputState;if(b.inputState=b.lastEditInputState,h&&b.lastEditActionCommand.interlaceInsertRepeat)for(var j=0;c>j;j++)e(),f(1);else d||e(),f(c);b.inputState=i,b.insertMode&&!d&&Ta(a),g.isPlaying=!1}function fb(b,c,d){function e(c){return"string"==typeof c?a.commands[c](b):c(b),!0}var f=b.getCursor("head"),g=tb.macroModeState.lastInsertModeChanges.inVisualBlock;if(g){var h=b.state.vim,i=h.lastSelection,j=L(i.anchor,i.head);_(b,f,j.line+1),d=b.listSelections().length,b.setCursor(f)}for(var k=0;d>k;k++){g&&b.setCursor(K(f,k,0));for(var l=0;l"]),pb=[].concat(lb,mb,nb,["-",'"',".",":","/"]),qb={};t("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 rb=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&&!R(l,b)&&i(b)}else i(b);i(h),e=d,f=d-c+1,0>f&&(f=0)}function b(a,b){d+=b,d>e?d=e:f>d&&(d=f);var h=g[(c+d)%c];if(h&&!h.find()){var i,j=b>0?1:-1,k=a.getCursor();do if(d+=j,h=g[(c+d)%c],h&&(i=h.find())&&!R(k,i))break;while(e>d&&d>f)}return h}var c=100,d=-1,e=0,f=0,g=new Array(c);return{cachedCursor:void 0,add:a,move:b}},sb=function(a){return a?{changes:a.changes,expectCursorActivityForChange:a.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var a=tb.macroModeState;a.onRecordingDone&&a.onRecordingDone(),a.onRecordingDone=void 0,a.isRecording=!1},enterMacroRecordMode:function(a,b){var c=tb.registerController.getRegister(b);c&&(c.clear(),this.latestRegister=b,a.openDialog&&(this.onRecordingDone=a.openDialog("(recording)["+b+"]",null,{bottom:!0})),this.isRecording=!0)}};var tb,ub,vb={buildKeyMap:function(){},getRegisterController:function(){return tb.registerController},resetVimGlobalState_:y,getVimGlobalState_:function(){return tb},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:cb,map:function(a,b,c){Hb.map(a,b,c)},setOption:u,getOption:v,defineOption:t,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;Gb[a]=c,Hb.commandMap_[b]={name:a,shortName:b,type:"api"}},handleKey:function(a,b,c){var d=this.findKey(a,b,c);return"function"==typeof d?d():void 0},findKey:function(c,d,e){function f(){var a=tb.macroModeState;if(a.isRecording){if("q"==d)return a.exitMacroRecordMode(),A(c),!0;"mapping"!=e&&Xa(a,d)}}function g(){return""==d?(A(c),l.visualMode?ha(c):l.insertMode&&Ta(c),!0):void 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=wb.matchCommand(a,b,l.inputState,"insert");a.length>1&&"full"!=f.type;){var a=l.inputState.keyBuffer=a.slice(1),h=wb.matchCommand(a,b,l.inputState,"insert");"none"!=h.type&&(f=h)}if("none"==f.type)return A(c),!1;if("partial"==f.type)return ub&&window.clearTimeout(ub),ub=window.setTimeout(function(){l.insertMode&&l.inputState.keyBuffer&&A(c)},v("insertModeEscKeysTimeout")),!e;if(ub&&window.clearTimeout(ub),e){var i=c.getCursor();c.replaceRange("",K(i,0,-(a.length-1)),i,"+input")}return A(c),f.command}function j(){if(f()||g())return!0;var a=l.inputState.keyBuffer=l.inputState.keyBuffer+d;if(/^[1-9]\d*$/.test(a))return!0;var e=/^(\d*)(.*)$/.exec(a);if(!e)return A(c),!1;var h=l.visualMode?"visual":"normal",i=wb.matchCommand(e[2]||e[1],b,l.inputState,h);if("none"==i.type)return A(c),!1;if("partial"==i.type)return!0;l.inputState.keyBuffer="";var e=/^(\d*)(.*)$/.exec(a);return e[1]&&"0"!=e[1]&&l.inputState.pushRepeatDigit(e[1]),i.command}var k,l=x(c);return k=l.insertMode?i():j(),k===!1?void 0:k===!0?function(){}:function(){return c.operation(function(){c.curOp.isVimOp=!0;try{"keyToKey"==k.type?h(k.toKeys):wb.processCommand(c,l,k)}catch(b){throw c.state.vim=void 0,x(c),a.Vim.suppressErrorLogging||console.log(b),b}return!0})}},handleEx:function(a,b){Hb.processCommand(a,b)},defineMotion:E,defineAction:H,defineOperator:G,mapCommand:Va,_mapCommand:Ua,exitVisualMode:ha,exitInsertMode:Ta};z.prototype.pushRepeatDigit=function(a){this.operator?this.motionRepeat=this.motionRepeat.concat(a):this.prefixRepeat=this.prefixRepeat.concat(a)},z.prototype.getRepeat=function(){var a=0;return(this.prefixRepeat.length>0||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},B.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(sb(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("")}},C.prototype={pushText:function(a,b,c,d,e){d&&"\n"==c.charAt(0)&&(c=c.slice(1)+"\n"),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 B(c,d,e);break;case"delete":case"change":-1==c.indexOf("\n")?this.registers["-"]=new B(c,d):(this.shiftNumericRegisters_(),this.registers[1]=new B(c,d))}return void this.unnamedRegister.setText(c,d,e)}var g=q(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 B),this.registers[a]):this.unnamedRegister},isValidRegister:function(a){return a&&s(a,pb)},shiftNumericRegisters_:function(){for(var a=9;a>=2;a--)this.registers[a]=this.getRegister(""+(a-1))}},D.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):0>e?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 wb={matchCommand:function(a,b,c,d){var e=M(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)&&(c.selectedCharacter=O(a)),{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=J(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);A(a)}d.operator=c.operator,d.operatorArgs=J(c.operatorArgs),b.visualMode&&this.evalInput(a,b)},processOperatorMotion:function(a,b,c){var d=b.visualMode,e=J(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=J(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,A(a),b.lastMotion=null,c.isEdit&&this.recordLastEdit(b,d,c),zb[c.action](a,g,b)},processSearch:function(b,c,d){function e(a,e,f){tb.searchHistoryController.pushInput(a),tb.searchHistoryController.reset();try{La(b,a,e,f)}catch(g){return Ha(b,"Invalid regex: "+a),void A(b)}wb.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=tb.macroModeState;c.isRecording&&Za(c,a)}function g(c,d,e){var f,g=a.keyName(c);"Up"==g||"Down"==g?(f="Up"==g?!0:!1,d=tb.searchHistoryController.nextMatch(d,f)||"",e(d)):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&tb.searchHistoryController.reset();var h;try{h=La(b,d,!0,!0)}catch(c){}h?b.scrollIntoView(Oa(b,!i,h),30):(Pa(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?(tb.searchHistoryController.pushInput(d),tb.searchHistoryController.reset(),La(b,l),Pa(b),b.scrollTo(m.left,m.top),a.e_stop(c),A(b),e(),b.focus()):"Ctrl-U"==f&&(a.e_stop(c),e(""))}if(b.getSearchCursor){var i=d.searchArgs.forward,j=d.searchArgs.wholeWordOnly;za(b).setReversed(!i);var k=i?"/":"?",l=za(b).getQuery(),m=b.getScrollInfo();switch(d.searchArgs.querySrc){case"prompt":var n=tb.macroModeState;if(n.isPlaying){var o=n.replaySearchQueries.shift();e(o,!0,!1)}else Ja(b,{onClose:f,prefix:k,desc:Eb,onKeyUp:g,onKeyDown:h});break;case"wordUnderCursor":var p=la(b,!1,!0,!1,!0),q=!0;if(p||(p=la(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":Y(o),tb.jumpList.cachedCursor=b.getCursor(),b.setCursor(p.start),e(o,!0,!1)}}},processEx:function(b,c,d){function e(a){tb.exCommandHistoryController.pushInput(a),tb.exCommandHistoryController.reset(),Hb.processCommand(b,a)}function f(c,d,e){var f,g=a.keyName(c);("Esc"==g||"Ctrl-C"==g||"Ctrl-["==g||"Backspace"==g&&""==d)&&(tb.exCommandHistoryController.pushInput(d),tb.exCommandHistoryController.reset(),a.e_stop(c),A(b),e(),b.focus()),"Up"==g||"Down"==g?(f="Up"==g?!0:!1,d=tb.exCommandHistoryController.nextMatch(d,f)||"",e(d)):"Ctrl-U"==g?(a.e_stop(c),e("")):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&tb.exCommandHistoryController.reset()}"keyToEx"==d.type?Hb.processCommand(b,d.exArgs.input):c.visualMode?Ja(b,{onClose:e,prefix:":",value:"'<,'>",onKeyDown:f}):Ja(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=Q(b.visualMode?I(a,m.head):a.getCursor("head")),o=Q(b.visualMode?I(a,m.anchor):a.getCursor("anchor")),p=Q(n),q=Q(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,A(a),h){var r=xb[h](a,n,i,b);if(b.lastMotion=xb[h],!r)return;if(i.toJumplist){var s=tb.jumpList,t=s.cachedCursor;t?(ma(a,t,r),delete s.cachedCursor):ma(a,n,r)}r instanceof Array?(e=r[0],c=r[1]):c=r,c||(c=Q(n)),b.visualMode?(b.visualBlock&&c.ch===1/0||(c=I(a,c,b.visualBlock)),e&&(e=I(a,e,!0)),e=e||q,m.anchor=e,m.head=c,ea(a),ta(a,b,"<",S(e,c)?e:c),ta(a,b,">",S(e,c)?c:e)):j||(c=I(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},ea(a)}else b.visualMode&&(k.lastSel={anchor:Q(m.anchor),head:Q(m.head),visualBlock:b.visualBlock,visualLine:b.visualLine});var x,y,z,B,C;if(b.visualMode){if(x=T(m.head,m.anchor),y=U(m.head,m.anchor),z=b.visualLine||k.linewise,B=b.visualBlock?"block":z?"line":"char",C=fa(a,{anchor:x,head:y},B),z){var D=C.ranges;if("block"==B)for(var E=0;Ei&&f.line==j||i>k&&f.line==k?void 0:(c.toFirstChar&&(g=ka(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 va(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=xb.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 qa(a,b,c.repeat,!!c.forward,!!c.wordEnd,!!c.bigWord)},moveTillCharacter:function(a,b,c){var d=c.repeat,e=ra(a,d,c.forward,c.selectedCharacter),f=c.forward?-1:1;return na(f,c),e?(e.ch+=f,e):null},moveToCharacter:function(a,b,c){var d=c.repeat;return na(0,c),ra(a,d,c.forward,c.selectedCharacter)||b},moveToSymbol:function(a,b,c){var d=c.repeat;return oa(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,sa(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,ka(a.getLine(c.line)))},moveToMatchedSymbol:function(a,b){var c,e=b,f=e.line,g=e.ch,h=a.getLine(f);do if(c=h.charAt(g++),c&&o(c)){var i=a.getTokenTypeAt(d(f,g));if("string"!==i&&"comment"!==i)break}while(c);if(c){var j=a.findMatchingBracket(d(f,g));return j.to}return e},moveToStartOfLine:function(a,b){return d(b.line,0)},moveToLineOrEdgeOfDocument:function(a,b,c){var e=c.forward?a.lastLine():a.firstLine();return c.repeatIsExplicit&&(e=c.repeat-a.getOption("firstLineNumber")),d(e,ka(a.getLine(e)))},textObjectManipulation:function(a,b,c,d){var e={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},f={"'":!0,'"':!0},g=c.selectedCharacter;"b"==g?g="(":"B"==g&&(g="{");var h,i=!c.textObjectInner;if(e[g])h=wa(a,b,g,i);else if(f[g])h=xa(a,b,g,i);else if("W"===g)h=la(a,i,!0,!0);else if("w"===g)h=la(a,i,!0,!1);else{if("p"!==g)return null;if(h=va(a,b,c.repeat,0,i),c.linewise=!0,d.visualMode)d.visualLine||(d.visualLine=!0);else{var j=d.inputState.operatorArgs;j&&(j.linewise=!0),h.end.line--}}return a.state.vim.visualMode?da(a,h.start,h.end):[h.start,h.end]},repeatLastCharacterSearch:function(a,b,c){var d=tb.lastChararacterSearch,e=c.repeat,f=c.forward===d.forward,g=(d.increment?1:0)*(f?-1:1);a.moveH(-g,"char"),c.inclusive=f?!0:!1;var h=ra(a,e,f,d.selectedCharacter);return h?(h.ch+=g,h):(a.moveH(g,"char"),b)}},yb={change:function(b,c,d){var e,f,g=b.state.vim;if(tb.macroModeState.lastInsertModeChanges.inVisualBlock=g.visualBlock,g.visualMode){f=b.getSelection();var h=F("",d.length);b.replaceSelections(h),e=T(d[0].head,d[0].anchor)}else{var i=d[0].anchor,j=d[0].head;f=b.getRange(i,j);var k=g.lastEditInputState||{};if("moveByWords"==k.motion&&!r(f)){var l=/\s+$/.exec(f);l&&k.motionArgs&&k.motionArgs.forward&&(j=K(j,0,-l[0].length),f=f.slice(0,-l[0].length))}var m=j.line-1==b.lastLine();b.replaceRange("",i,j),c.linewise&&!m&&(a.commands.newlineAndIndent(b),i.ch=null),e=i}tb.registerController.pushText(c.registerName,"change",f,c.linewise,d.length>1),zb.enterInsertMode(b,{head:e},b.state.vim)},"delete":function(a,b,c){var e,f,g=a.state.vim;if(g.visualBlock){f=a.getSelection();var h=F("",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,W(a,i.line-1))),f=a.getRange(i,j),a.replaceRange("",i,j),e=i,b.linewise&&(e=xb.moveToFirstNonWhiteSpaceCharacter(a,i))}return tb.registerController.pushText(b.registerName,"delete",f,b.linewise,g.visualBlock),I(a,e)},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;f>=h;h++)for(var i=0;g>i;i++)a.indentLine(h,b.indentRight);return xb.moveToFirstNonWhiteSpaceCharacter(a,c[0].anchor)},changeCase:function(a,b,c,d,e){for(var f=a.getSelections(),g=[],h=b.toLower,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?K(g.head,0,1):d(g.anchor.line,0);else if("inplace"==f&&e.visualMode)return;b.setOption("keyMap","vim-insert"),b.setOption("disableInput",!1),c&&c.replace?(b.toggleOverwrite(!0),b.setOption("keyMap","vim-replace"),a.signal(b,"vim-mode-change",{mode:"replace"})):(b.setOption("keyMap","vim-insert"),a.signal(b,"vim-mode-change",{mode:"insert"})),tb.macroModeState.isPlaying||(b.on("change",$a),a.on(b.getInputField(),"keydown",db)),e.visualMode&&ha(b),_(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":""}),ea(b)):ha(b):(e.visualMode=!0,e.visualLine=!!c.linewise,e.visualBlock=!!c.blockwise,f=I(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":""}),ea(b),ta(b,e,"<",T(h,f)),ta(b,e,">",U(h,f)))},reselectLastSelection:function(b,c,d){var e=d.lastSelection;if(d.visualMode&&ca(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,ea(b),ta(b,d,"<",T(f,g)),ta(b,d,">",U(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"),S(f,e)){var g=f;f=e,e=g}f.ch=W(a,f.line)-1}else{var h=Math.max(b.repeat,2);e=a.getCursor(),f=I(a,d(e.line+h-1,1/0))}for(var i=0,j=e.line;jc)return"";if(a.getOption("indentWithTabs")){var d=Math.floor(c/h);return Array(d+1).join(" ")}return Array(c+1).join(" ")});g+=m?"\n":""}if(b.repeat>1)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=W(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=W(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=S(j[0].anchor,j[0].head)?j[0].anchor:j[0].head,b.setCursor(i),ha(b,!1)):b.setCursor(K(g,0,-1))}},incrementNumberToken:function(a,b){for(var c,e,f,g,h,i=a.getCursor(),j=a.getLine(i.line),k=/-?\d+/g;null!==(c=k.exec(j))&&(h=c[0],e=c.index,f=e+h.length,!(i.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?!0:!1}},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}}};t("pcre",!0,"boolean"),ya.prototype={getQuery:function(){return tb.query},setQuery:function(a){tb.query=a},getOverlay:function(){return this.searchOverlay},setOverlay:function(a){this.searchOverlay=a},isReversed:function(){return tb.isReversed},setReversed:function(a){tb.isReversed=a},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(a){this.annotate=a}};var Cb={"\\n":"\n","\\r":"\r","\\t":" "},Db={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":" "},Eb="(Javascript regexp)",Fb=function(){this.buildCommandMap_()};Fb.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=tb.registerController.getRegister(":"),g=f.toString();e.visualMode&&ha(b);var h=new a.StringStream(c);f.setText(c);var i=d||{};i.input=c;try{this.parseInput_(b,h,i)}catch(j){throw Ha(b,j),j}var k,l;if(i.commandName){if(k=this.matchCommand_(i.commandName)){if(l=k.name,k.excludeFromCommandHistory&&f.setText(g),this.parseCommandArgs_(h,i,k),"exToKey"==k.type){for(var m=0;m0;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+"
    ")}Ha(a,e)},sort:function(b,c){function e(){if(c.argString){var b=new a.StringStream(c.argString);if(b.eat("!")&&(g=!0),b.eol())return;if(!b.eatSpace())return"Invalid arguments";var d=b.match(/[a-z]+/);if(d){d=d[0],h=-1!=d.indexOf("i"),i=-1!=d.indexOf("u");var e=-1!=d.indexOf("d")&&1,f=-1!=d.indexOf("x")&&1,k=-1!=d.indexOf("o")&&1;if(e+f+k>1)return"Invalid arguments";j=e&&"decimal"||f&&"hex"||k&&"octal"}b.eatSpace()&&b.match(/\/.*\//)}}function f(a,b){if(g){var c;c=a,a=b,b=c}h&&(a=a.toLowerCase(),b=b.toLowerCase());var d=j&&q.exec(a),e=j&&q.exec(b);return d?(d=parseInt((d[1]+d[2]).toLowerCase(),r),e=parseInt((e[1]+e[2]).toLowerCase(),r),d-e):b>a?-1:1}var g,h,i,j,k=e();if(k)return void Ha(b,k+": "+c.argString);var l=c.line||b.firstLine(),m=c.lineEnd||c.line||b.lastLine();if(l!=m){var n=d(l,0),o=d(m,W(b,m)),p=b.getRange(n,o).split("\n"),q="decimal"==j?/(-?)([\d]+)/:"hex"==j?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==j?/([0-7]+)/:null,r="decimal"==j?10:"hex"==j?16:"octal"==j?8:null,s=[],t=[];if(j)for(var u=0;u=m;m++){var n=j.test(a.getLine(m));n&&(k.push(m+1),l+=a.getLine(m)+"
    ")}if(!d)return void Ha(a,l);var o=0,p=function(){if(o=k)return void Ha(b,"Invalid argument: "+c.argString.substring(f));for(var l=0;k-j>=l;l++){var m=String.fromCharCode(j+l);delete d.marks[m]}}else delete d.marks[g]}}},Hb=new Fb;return a.keyMap.vim={attach:h,detach:g,call:i},t("insertModeEscKeysTimeout",200,"number"),a.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(b){var c=a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent;c(b)},fallthrough:["default"],attach:h,detach:g,call:i},a.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:h,detach:g,call:i},y(),vb};a.Vim=e()}); +\ No newline at end of file +diff --git a/media/editors/codemirror/lib/codemirror.css b/media/editors/codemirror/lib/codemirror.css +index bf4bb94..ceacd13 100644 +--- a/media/editors/codemirror/lib/codemirror.css ++++ b/media/editors/codemirror/lib/codemirror.css +@@ -33,8 +33,7 @@ + min-width: 20px; + text-align: right; + color: #999; +- -moz-box-sizing: content-box; +- box-sizing: content-box; ++ white-space: nowrap; + } + + .CodeMirror-guttermarker { color: black; } +@@ -127,6 +126,8 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} + .cm-s-default .cm-error {color: #f00;} + .cm-invalidchar {color: #f00;} + ++.CodeMirror-composing { border-bottom: 2px solid; } ++ + /* Default styles for common addons */ + + div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} +@@ -154,14 +155,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; +- -moz-box-sizing: content-box; +- box-sizing: content-box; + } + .CodeMirror-sizer { + position: relative; + border-right: 30px solid transparent; +- -moz-box-sizing: content-box; +- box-sizing: content-box; + } + + /* The fake, visible scrollbars. Used to force redraw during scrolling +@@ -196,8 +193,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} + .CodeMirror-gutter { + white-space: normal; + height: 100%; +- -moz-box-sizing: content-box; +- box-sizing: content-box; + display: inline-block; + margin-bottom: -30px; + /* Hack to make IE7 behave */ +@@ -265,6 +260,16 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} + outline: none; + } + ++/* Force content-box sizing for the elements where we expect it */ ++.CodeMirror-scroll, ++.CodeMirror-sizer, ++.CodeMirror-gutter, ++.CodeMirror-gutters, ++.CodeMirror-linenumber { ++ -moz-box-sizing: content-box; ++ box-sizing: content-box; ++} ++ + .CodeMirror-measure { + position: absolute; + width: 100%; +@@ -318,100 +323,3 @@ div.CodeMirror-cursors { + + /* Help users use markselection to safely style text background */ + span.CodeMirror-selectedtext { background: none; } +-/** +- * addon/display/fullscreen.css +- * addon/fold/foldgutter.css +- * addon/scroll/simplescrollbars.css +-**/ +-.CodeMirror-fullscreen { +- position: fixed; +- top: 0; left: 0; right: 0; bottom: 0; +- height: auto; +- z-index: 9; +-} +-.CodeMirror-foldmarker { +- color: blue; +- text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; +- font-family: arial; +- line-height: .3; +- cursor: pointer; +-} +-.CodeMirror-foldgutter { +- width: .7em; +-} +-.CodeMirror-foldgutter-open, +-.CodeMirror-foldgutter-folded { +- cursor: pointer; +-} +-.CodeMirror-foldgutter-open:after { +- content: "\25BE"; +-} +-.CodeMirror-foldgutter-folded:after { +- content: "\25B8"; +-} +-.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { +- position: absolute; +- background: #ccc; +- -moz-box-sizing: border-box; +- box-sizing: border-box; +- border: 1px solid #bbb; +- border-radius: 2px; +-} +- +-.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { +- position: absolute; +- z-index: 6; +- background: #eee; +-} +- +-.CodeMirror-simplescroll-horizontal { +- bottom: 0; left: 0; +- height: 8px; +-} +-.CodeMirror-simplescroll-horizontal div { +- bottom: 0; +- height: 100%; +-} +- +-.CodeMirror-simplescroll-vertical { +- right: 0; top: 0; +- width: 8px; +-} +-.CodeMirror-simplescroll-vertical div { +- right: 0; +- width: 100%; +-} +- +- +-.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { +- display: none; +-} +- +-.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { +- position: absolute; +- background: #bcd; +- border-radius: 3px; +-} +- +-.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { +- position: absolute; +- z-index: 6; +-} +- +-.CodeMirror-overlayscroll-horizontal { +- bottom: 0; left: 0; +- height: 6px; +-} +-.CodeMirror-overlayscroll-horizontal div { +- bottom: 0; +- height: 100%; +-} +- +-.CodeMirror-overlayscroll-vertical { +- right: 0; top: 0; +- width: 6px; +-} +-.CodeMirror-overlayscroll-vertical div { +- right: 0; +- width: 100%; +-} +diff --git a/media/editors/codemirror/lib/codemirror.js b/media/editors/codemirror/lib/codemirror.js +index 98a45c6..a1dfd0f 100644 +--- a/media/editors/codemirror/lib/codemirror.js ++++ b/media/editors/codemirror/lib/codemirror.js +@@ -82,12 +82,15 @@ + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info +- overwrite: false, focused: false, ++ overwrite: false, ++ delayingBlurEvent: false, ++ focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll + draggingText: false, + highlight: new Delayed(), // stores highlight worker timeout +- keySeq: null // Unfinished key sequence ++ keySeq: null, // Unfinished key sequence ++ specialChars: null + }; + + var cm = this; +@@ -591,7 +594,7 @@ + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; +- display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding); ++ display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; +@@ -725,12 +728,9 @@ + } + + function postUpdateDisplay(cm, update) { +- var force = update.force, viewport = update.viewport; ++ var viewport = update.viewport; + for (var first = true;; first = false) { +- if (first && cm.options.lineWrapping && update.oldDisplayWidth != displayWidth(cm)) { +- force = true; +- } else { +- force = false; ++ if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; +@@ -1076,7 +1076,7 @@ + // was made out of. + var lastCopied = null; + +- function applyTextInput(cm, inserted, deleted, sel) { ++ function applyTextInput(cm, inserted, deleted, sel, origin) { + var doc = cm.doc; + cm.display.shift = false; + if (!sel) sel = doc.sel; +@@ -1102,33 +1102,43 @@ + } + var updateInput = cm.curOp.updateInput; + var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, +- origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"}; ++ origin: origin || (cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); +- // When an 'electric' character is inserted, immediately trigger a reindent +- if (inserted && !cm.state.pasteIncoming && cm.options.electricChars && +- cm.options.smartIndent && range.head.ch < 100 && +- (!i || sel.ranges[i - 1].head.line != range.head.line)) { +- var mode = cm.getModeAt(range.head); +- var end = changeEnd(changeEvent); +- if (mode.electricChars) { +- for (var j = 0; j < mode.electricChars.length; j++) +- if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { +- indentLine(cm, end.line, "smart"); +- break; +- } +- } else if (mode.electricInput) { +- if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch))) +- indentLine(cm, end.line, "smart"); +- } +- } + } ++ if (inserted && !cm.state.pasteIncoming) ++ triggerElectric(cm, inserted); ++ + ensureCursorVisible(cm); + cm.curOp.updateInput = updateInput; + cm.curOp.typing = true; + cm.state.pasteIncoming = cm.state.cutIncoming = false; + } + ++ function triggerElectric(cm, inserted) { ++ // When an 'electric' character is inserted, immediately trigger a reindent ++ if (!cm.options.electricChars || !cm.options.smartIndent) return; ++ var sel = cm.doc.sel; ++ ++ for (var i = sel.ranges.length - 1; i >= 0; i--) { ++ var range = sel.ranges[i]; ++ if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue; ++ var mode = cm.getModeAt(range.head); ++ var indented = false; ++ if (mode.electricChars) { ++ for (var j = 0; j < mode.electricChars.length; j++) ++ if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { ++ indented = indentLine(cm, range.head.line, "smart"); ++ break; ++ } ++ } else if (mode.electricInput) { ++ if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) ++ indented = indentLine(cm, range.head.line, "smart"); ++ } ++ if (indented) signalLater(cm, "electricInput", cm, range.head.line); ++ } ++ } ++ + function copyableRanges(cm) { + var text = [], ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { +@@ -1164,6 +1174,7 @@ + this.inaccurateSelection = false; + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false; ++ this.composing = null; + }; + + function hiddenTextarea() { +@@ -1228,6 +1239,8 @@ + te.value = lastCopied.join("\n"); + selectInput(te); + } ++ } else if (!cm.options.lineWiseCopyCut) { ++ return; + } else { + var ranges = copyableRanges(cm); + lastCopied = ranges.text; +@@ -1254,6 +1267,21 @@ + on(display.lineSpace, "selectstart", function(e) { + if (!eventInWidget(display, e)) e_preventDefault(e); + }); ++ ++ on(te, "compositionstart", function() { ++ var start = cm.getCursor("from"); ++ input.composing = { ++ start: start, ++ range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) ++ }; ++ }); ++ on(te, "compositionend", function() { ++ if (input.composing) { ++ input.poll(); ++ input.composing.range.clear(); ++ input.composing = null; ++ } ++ }); + }, + + prepareSelection: function() { +@@ -1381,19 +1409,29 @@ + return false; + } + +- if (text.charCodeAt(0) == 0x200b && cm.doc.sel == cm.display.selForContextMenu && !prevInput) +- prevInput = "\u200b"; ++ if (cm.doc.sel == cm.display.selForContextMenu) { ++ var first = text.charCodeAt(0); ++ if (first == 0x200b && !prevInput) prevInput = "\u200b"; ++ if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo"); } ++ } + // Find the part of the input that is actually new + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; + + var self = this; + runInOp(cm, function() { +- applyTextInput(cm, text.slice(same), prevInput.length - same); ++ applyTextInput(cm, text.slice(same), prevInput.length - same, ++ null, self.composing ? "*compose" : null); + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) input.value = self.prevInput = ""; + else self.prevInput = text; ++ ++ if (self.composing) { ++ self.composing.range.clear(); ++ self.composing.range = cm.markText(self.composing.start, cm.getCursor("to"), ++ {className: "CodeMirror-composing"}); ++ } + }); + return true; + }, +@@ -1440,7 +1478,9 @@ + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected(); +- var extval = te.value = "\u200b" + (selected ? te.value : ""); ++ var extval = "\u200b" + (selected ? te.value : ""); ++ te.value = "\u21da"; // Used to catch context-menu undo ++ te.value = extval; + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; te.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the +@@ -1458,7 +1498,8 @@ + if (te.selectionStart != null) { + if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); + var i = 0, poll = function() { +- if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0) ++ if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && ++ te.selectionEnd > 0 && input.prevInput == "\u200b") + operation(cm, commands.selectAll)(cm); + else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); + else display.input.reset(); +@@ -1491,6 +1532,7 @@ + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); ++ this.gracePeriod = false; + } + + ContentEditableInput.prototype = copyObj({ +@@ -1552,6 +1594,8 @@ + if (cm.somethingSelected()) { + lastCopied = cm.getSelections(); + if (e.type == "cut") cm.replaceSelection("", null, "cut"); ++ } else if (!cm.options.lineWiseCopyCut) { ++ return; + } else { + var ranges = copyableRanges(cm); + lastCopied = ranges.text; +@@ -1625,10 +1669,21 @@ + sel.removeAllRanges(); + sel.addRange(rng); + if (old && sel.anchorNode == null) sel.addRange(old); ++ else if (gecko) this.startGracePeriod(); + } + this.rememberSelection(); + }, + ++ startGracePeriod: function() { ++ var input = this; ++ clearTimeout(this.gracePeriod); ++ this.gracePeriod = setTimeout(function() { ++ input.gracePeriod = false; ++ if (input.selectionChanged()) ++ input.cm.operation(function() { input.cm.curOp.selectionChanged = true; }); ++ }, 20); ++ }, ++ + showMultipleSelections: function(info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); +@@ -1671,12 +1726,15 @@ + this.polling.set(this.cm.options.pollInterval, poll); + }, + +- pollSelection: function() { +- if (this.composing) return; ++ selectionChanged: function() { ++ var sel = window.getSelection(); ++ return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || ++ sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; ++ }, + +- var sel = window.getSelection(), cm = this.cm; +- if (sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || +- sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset) { ++ pollSelection: function() { ++ if (!this.composing && !this.gracePeriod && this.selectionChanged()) { ++ var sel = window.getSelection(), cm = this.cm; + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); +@@ -1783,7 +1841,7 @@ + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; + } +- var result = nodeAndOffsetInLineMap(info.map, pos.ch, "left"); ++ var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); + result.offset = result.collapse == "right" ? result.end : result.start; + return result; + } +@@ -2895,6 +2953,7 @@ + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position ++ focus: false, + id: ++nextOpId // Unique ID + }; + if (operationGroup) { +@@ -3012,6 +3071,7 @@ + + if (cm.state.focused && op.updateInput) + cm.display.input.reset(op.typing); ++ if (op.focus && op.focus == activeElt()) ensureFocus(op.cm); + } + + function endOperation_finish(op) { +@@ -3376,15 +3436,11 @@ + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); + +- function drag_(e) { +- if (!signalDOMEvent(cm, e)) e_stop(e); +- } +- if (cm.options.dragDrop) { +- on(d.scroller, "dragstart", function(e){onDragStart(cm, e);}); +- on(d.scroller, "dragenter", drag_); +- on(d.scroller, "dragover", drag_); +- on(d.scroller, "drop", operation(cm, onDrop)); +- } ++ d.dragFunctions = { ++ simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);}, ++ start: function(e){onDragStart(cm, e);}, ++ drop: operation(cm, onDrop) ++ }; + + var inp = d.input.getField(); + on(inp, "keyup", function(e) { onKeyUp.call(cm, e); }); +@@ -3394,6 +3450,18 @@ + on(inp, "blur", bind(onBlur, cm)); + } + ++ function dragDropChanged(cm, value, old) { ++ var wasOn = old && old != CodeMirror.Init; ++ if (!value != !wasOn) { ++ var funcs = cm.display.dragFunctions; ++ var toggle = value ? on : off; ++ toggle(cm.display.scroller, "dragstart", funcs.start); ++ toggle(cm.display.scroller, "dragenter", funcs.simple); ++ toggle(cm.display.scroller, "dragover", funcs.simple); ++ toggle(cm.display.scroller, "drop", funcs.drop); ++ } ++ } ++ + // Called when the window resizes + function onResize(cm) { + var d = cm.display; +@@ -3475,6 +3543,7 @@ + break; + case 3: + if (captureRightClick) onContextMenu(cm, e); ++ else delayBlurEvent(cm); + break; + } + } +@@ -3482,7 +3551,7 @@ + var lastClick, lastDoubleClick; + function leftButtonDown(cm, e, start) { + if (ie) setTimeout(bind(ensureFocus, cm), 0); +- else ensureFocus(cm); ++ else cm.curOp.focus = activeElt(); + + var now = +new Date, type; + if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { +@@ -3507,7 +3576,7 @@ + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. + function leftButtonStartDrag(cm, e, start, modifier) { +- var display = cm.display; ++ var display = cm.display, startTime = +new Date; + var dragEnd = operation(cm, function(e2) { + if (webkit) display.scroller.draggable = false; + cm.state.draggingText = false; +@@ -3515,12 +3584,13 @@ + off(display.scroller, "drop", dragEnd); + if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { + e_preventDefault(e2); +- if (!modifier) ++ if (!modifier && +new Date - 200 < startTime) + extendSelection(cm.doc, start); +- display.input.focus(); +- // Work around unexplainable focus problem in IE9 (#2127) +- if (ie && ie_version == 9) ++ // 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); ++ else ++ display.input.focus(); + } + }); + // Let the drag handler handle this. +@@ -3546,6 +3616,7 @@ + ourRange = new Range(start, start); + } else { + ourRange = doc.sel.primary(); ++ ourIndex = doc.sel.primIndex; + } + + if (e.altKey) { +@@ -3577,7 +3648,7 @@ + ourIndex = ranges.length; + setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}); +- } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single") { ++ } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) { + setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0)); + startSel = doc.sel; + } else { +@@ -3640,7 +3711,7 @@ + var cur = posFromMouse(cm, e, true, type == "rect"); + if (!cur) return; + if (cmp(cur, lastPos) != 0) { +- ensureFocus(cm); ++ cm.curOp.focus = activeElt(); + extendTo(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) +@@ -3743,7 +3814,7 @@ + try { + var text = e.dataTransfer.getData("Text"); + if (text) { +- if (cm.state.draggingText && !(mac ? e.metaKey : e.ctrlKey)) ++ if (cm.state.draggingText && !(mac ? e.altKey : e.ctrlKey)) + var selected = cm.listSelections(); + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); + if (selected) for (var i = 0; i < selected.length; ++i) +@@ -3998,7 +4069,7 @@ + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; +- ensureFocus(cm); ++ cm.curOp.focus = activeElt(); + if (signalDOMEvent(cm, e)) return; + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; +@@ -4050,7 +4121,19 @@ + + // FOCUS/BLUR EVENTS + ++ function delayBlurEvent(cm) { ++ cm.state.delayingBlurEvent = true; ++ setTimeout(function() { ++ if (cm.state.delayingBlurEvent) { ++ cm.state.delayingBlurEvent = false; ++ onBlur(cm); ++ } ++ }, 100); ++ } ++ + function onFocus(cm) { ++ if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false; ++ + if (cm.options.readOnly == "nocursor") return; + if (!cm.state.focused) { + signal(cm, "focus", cm); +@@ -4068,6 +4151,8 @@ + restartBlink(cm); + } + function onBlur(cm) { ++ if (cm.state.delayingBlurEvent) return; ++ + if (cm.state.focused) { + signal(cm, "blur", cm); + cm.state.focused = false; +@@ -4572,6 +4657,8 @@ + + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); ++ line.stateAfter = null; ++ return true; + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. +@@ -4584,7 +4671,6 @@ + } + } + } +- line.stateAfter = null; + } + + // Utility for applying a change to a line by handle or number, +@@ -4824,7 +4910,7 @@ + + getHelpers: function(pos, type) { + var found = []; +- if (!helpers.hasOwnProperty(type)) return helpers; ++ if (!helpers.hasOwnProperty(type)) return found; + var help = helpers[type], mode = this.getModeAt(pos); + if (typeof mode[type] == "string") { + if (help[mode[type]]) found.push(help[mode[type]]); +@@ -4874,10 +4960,15 @@ + return lineAtHeight(this.doc, height + this.display.viewOffset); + }, + heightAtLine: function(line, mode) { +- var end = false, last = this.doc.first + this.doc.size - 1; +- if (line < this.doc.first) line = this.doc.first; +- else if (line > last) { line = last; end = true; } +- var lineObj = getLine(this.doc, line); ++ var end = false, lineObj; ++ if (typeof line == "number") { ++ var last = this.doc.first + this.doc.size - 1; ++ if (line < this.doc.first) line = this.doc.first; ++ else if (line > last) { line = last; end = true; } ++ lineObj = getLine(this.doc, line); ++ } else { ++ lineObj = line; ++ } + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + + (end ? this.doc.height - heightAtLine(lineObj) : 0); + }, +@@ -4906,12 +4997,6 @@ + }); + }), + +- addLineWidget: methodOp(function(handle, node, options) { +- return addLineWidget(this, handle, node, options); +- }), +- +- removeLineWidget: function(widget) { widget.clear(); }, +- + lineInfo: function(line) { + if (typeof line == "number") { + if (!isLine(this.doc, line)) return null; +@@ -4973,6 +5058,8 @@ + return commands[cmd](this); + }, + ++ triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), ++ + findPosH: function(from, amount, unit, visually) { + var dir = 1; + if (amount < 0) { dir = -1; amount = -amount; } +@@ -5186,10 +5273,10 @@ + clearCaches(cm); + regChange(cm); + }, true); +- option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val) { +- cm.options.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); +- cm.refresh(); +- }, true); ++ option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) { ++ cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); ++ if (old != CodeMirror.Init) cm.refresh(); ++ }); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true); + option("electricChars", true); + option("inputStyle", mobile ? "contenteditable" : "textarea", function() { +@@ -5235,6 +5322,7 @@ + option("showCursorWhenSelecting", false, updateSelection, true); + + option("resetSelectionOnContextMenu", true); ++ option("lineWiseCopyCut", true); + + option("readOnly", false, function(cm, val) { + if (val == "nocursor") { +@@ -5247,7 +5335,7 @@ + } + }); + option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true); +- option("dragDrop", true); ++ option("dragDrop", true, dragDropChanged); + + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); +@@ -5639,7 +5727,7 @@ + for (var i = 0; i < keys.length; i++) { + var val, name; + if (i == keys.length - 1) { +- name = keyname; ++ name = keys.join(" "); + val = value; + } else { + name = keys.slice(0, i + 1).join(" "); +@@ -6431,10 +6519,10 @@ + + // Line widgets are block elements displayed above or below a line. + +- var LineWidget = CodeMirror.LineWidget = function(cm, node, options) { ++ var LineWidget = CodeMirror.LineWidget = function(doc, node, options) { + if (options) for (var opt in options) if (options.hasOwnProperty(opt)) + this[opt] = options[opt]; +- this.cm = cm; ++ this.doc = doc; + this.node = node; + }; + eventMixin(LineWidget); +@@ -6445,52 +6533,55 @@ + } + + LineWidget.prototype.clear = function() { +- var cm = this.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); ++ var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); + if (no == null || !ws) return; + for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); + if (!ws.length) line.widgets = null; + var height = widgetHeight(this); +- runInOp(cm, function() { ++ updateLineHeight(line, Math.max(0, line.height - height)); ++ if (cm) runInOp(cm, function() { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); +- updateLineHeight(line, Math.max(0, line.height - height)); + }); + }; + LineWidget.prototype.changed = function() { +- var oldH = this.height, cm = this.cm, line = this.line; ++ var oldH = this.height, cm = this.doc.cm, line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) return; +- runInOp(cm, function() { ++ updateLineHeight(line, line.height + diff); ++ if (cm) runInOp(cm, function() { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); +- updateLineHeight(line, line.height + diff); + }); + }; + + function widgetHeight(widget) { + if (widget.height != null) return widget.height; ++ var cm = widget.doc.cm; ++ if (!cm) return 0; + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) +- parentStyle += "margin-left: -" + widget.cm.display.gutters.offsetWidth + "px;"; ++ parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; + if (widget.noHScroll) +- parentStyle += "width: " + widget.cm.display.wrapper.clientWidth + "px;"; +- removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, parentStyle)); ++ parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; ++ removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.offsetHeight; + } + +- function addLineWidget(cm, handle, node, options) { +- var widget = new LineWidget(cm, node, options); +- if (widget.noHScroll) cm.display.alignWidgets = true; +- changeLine(cm.doc, handle, "widget", function(line) { ++ function addLineWidget(doc, handle, node, options) { ++ var widget = new LineWidget(doc, node, options); ++ var cm = doc.cm; ++ if (cm && widget.noHScroll) cm.display.alignWidgets = true; ++ changeLine(doc, handle, "widget", function(line) { + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) widgets.push(widget); + else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); + widget.line = line; +- if (!lineIsHidden(cm.doc, line)) { +- var aboveVisible = heightAtLine(line) < cm.doc.scrollTop; ++ if (cm && !lineIsHidden(doc, line)) { ++ var aboveVisible = heightAtLine(line) < doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) addToScrollPos(cm, null, widget.height); + cm.curOp.forceUpdate = true; +@@ -6710,7 +6801,9 @@ + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); +- var builder = {pre: elt("pre", [content]), content: content, col: 0, pos: 0, cm: cm}; ++ var builder = {pre: elt("pre", [content]), content: content, ++ col: 0, pos: 0, cm: cm, ++ splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. +@@ -6720,8 +6813,6 @@ + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. +- if ((ie || webkit) && cm.getOption("lineWrapping")) +- builder.addToken = buildTokenSplitSpaces(builder.addToken); + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) + builder.addToken = buildTokenBadBidi(builder.addToken, order); + builder.map = []; +@@ -6770,10 +6861,11 @@ + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, title, css) { + if (!text) return; +- var special = builder.cm.options.specialChars, mustWrap = false; ++ var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text; ++ var special = builder.cm.state.specialChars, mustWrap = false; + if (!special.test(text)) { + builder.col += text.length; +- var content = document.createTextNode(text); ++ var content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) mustWrap = true; + builder.pos += text.length; +@@ -6784,7 +6876,7 @@ + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { +- var txt = document.createTextNode(text.slice(pos, pos + skipped)); ++ var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); + else content.appendChild(txt); + builder.map.push(builder.pos, builder.pos + skipped, txt); +@@ -6821,22 +6913,17 @@ + builder.content.appendChild(content); + } + +- function buildTokenSplitSpaces(inner) { +- function split(old) { +- var out = " "; +- for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; +- out += " "; +- return out; +- } +- return function(builder, text, style, startStyle, endStyle, title) { +- inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title); +- }; ++ function splitSpaces(old) { ++ var out = " "; ++ for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; ++ out += " "; ++ return out; + } + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { +- return function(builder, text, style, startStyle, endStyle, title) { ++ return function(builder, text, style, startStyle, endStyle, title, css) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, end = start + text.length; + for (;;) { +@@ -6845,8 +6932,8 @@ + var part = order[i]; + if (part.to > start && part.from <= start) break; + } +- if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title); +- inner(builder, text.slice(0, part.to - start), style, startStyle, null, title); ++ if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title, css); ++ inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; +@@ -6888,8 +6975,13 @@ + var foundBookmarks = []; + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker; +- if (sp.from <= pos && (sp.to == null || sp.to > pos)) { +- if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; } ++ if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { ++ foundBookmarks.push(m); ++ } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { ++ if (sp.to != null && sp.to != pos && nextChange > sp.to) { ++ nextChange = sp.to; ++ spanEndStyle = ""; ++ } + if (m.className) spanStyle += " " + m.className; + if (m.css) css = m.css; + if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; +@@ -6900,12 +6992,12 @@ + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } +- if (m.type == "bookmark" && sp.from == pos && m.widgetNode) foundBookmarks.push(m); + } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, + collapsed.marker, collapsed.from == null); + if (collapsed.to == null) return; ++ if (collapsed.to == pos) collapsed = false; + } + if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) + buildCollapsedSpan(builder, 0, foundBookmarks[j]); +@@ -7368,13 +7460,19 @@ + }); + }), + ++ addLineWidget: docMethodOp(function(handle, node, options) { ++ return addLineWidget(this, handle, node, options); ++ }), ++ removeLineWidget: function(widget) { widget.clear(); }, ++ + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, +- clearWhenEmpty: false, shared: options && options.shared}; ++ clearWhenEmpty: false, shared: options && options.shared, ++ handleMouseEvents: options && options.handleMouseEvents}; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark"); + }, +@@ -8108,7 +8206,7 @@ + return function(){return f.apply(null, args);}; + } + +- var nonASCIISingleCaseWordChar = /[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; ++ var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + var isWordCharBasic = CodeMirror.isWordChar = function(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); +@@ -8630,6 +8728,8 @@ + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } ++ if (order[0].level == 2) ++ order.unshift(new BidiSpan(1, order[0].to, order[0].to)); + if (order[0].level != lst(order).level) + order.push(new BidiSpan(order[0].level, len, len)); + +@@ -8639,7 +8739,7 @@ + + // THE END + +- CodeMirror.version = "5.0.1"; ++ CodeMirror.version = "5.3.0"; + + return CodeMirror; + }); +diff --git a/media/editors/codemirror/lib/codemirror.min.css b/media/editors/codemirror/lib/codemirror.min.css +index 59b6677..5cd3f69 100644 +--- a/media/editors/codemirror/lib/codemirror.min.css ++++ b/media/editors/codemirror/lib/codemirror.min.css +@@ -1 +1 @@ +-.CodeMirror{font-family:monospace;height:300px;color:black}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid black}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.CodeMirror.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}@-moz-keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}@-webkit-keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}@keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;display:inline-block;margin-bottom:-30px;*zoom:1;*display:inline}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;height:100%}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;border-right:0;width:0}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror ::selection{background:#d7d4f0}.CodeMirror ::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0}.CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler,.CodeMirror-overlayscroll .CodeMirror-gutter-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%} +\ No newline at end of file ++.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.CodeMirror.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1)infinite;-moz-animation:blink 1.06s steps(1)infinite;animation:blink 1.06s steps(1)infinite}@-moz-keyframes blink{0%,100%{background:#7e7}50%{background:0 0}}@-webkit-keyframes blink{0%,100%{background:#7e7}50%{background:0 0}}@keyframes blink{0%,100%{background:#7e7}50%{background:0 0}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;border-right:none;width:0}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror ::selection,.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror ::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0} +\ No newline at end of file +diff --git a/media/editors/codemirror/lib/codemirror.min.js b/media/editors/codemirror/lib/codemirror.min.js +index cae56ba..4e56fe1 100644 +--- a/media/editors/codemirror/lib/codemirror.min.js ++++ b/media/editors/codemirror/lib/codemirror.min.js +@@ -1,5 +1,5 @@ +-!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);this.CodeMirror=e()}}(function(){"use strict";function e(r,n){if(!(this instanceof e))return new e(r,n);this.options=n=n?Oo(n):{},Oo(Kl,n,!1),d(n);var i=n.value;"string"==typeof i&&(i=new ps(i,n.mode)),this.doc=i;var o=new e.inputStyles[n.inputStyle](this),l=this.display=new t(r,i,o);l.wrapper.CodeMirror=this,u(this),s(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),n.autofocus&&!wl&&l.input.focus(),m(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new So,keySeq:null};var a=this;cl&&11>fl&&setTimeout(function(){a.display.input.reset(!0)},20),Rr(this),Vo(),mr(this),this.curOp.forceUpdate=!0,Vi(this,i),n.autofocus&&!wl||a.hasFocus()?setTimeout(Do(cn,this),20):fn(this);for(var c in jl)jl.hasOwnProperty(c)&&jl[c](this,n[c],Xl);C(this),n.finishInit&&n.finishInit(this);for(var f=0;ffl&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),hl||sl&&wl||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),n(t)}function n(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,zt(e,100),e.state.modeGen++,e.curOp&&Dr(e)}function i(e){e.options.lineWrapping?(Bs(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Rs(e.display.wrapper,"CodeMirror-wrap"),h(e)),l(e),Dr(e),ir(e),setTimeout(function(){y(e)},100)}function o(e){var t=gr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/vr(e.display)-3);return function(i){if(gi(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;lt.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function d(e){var t=Mo(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Gt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Vt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function g(e,t,r){this.cm=r;var n=this.vert=zo("div",[zo("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=zo("div",[zo("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),ws(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ws(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedOverlay=!1,cl&&8>fl&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function v(){}function m(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Rs(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ws(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,r){"horizontal"==r?Qr(t,e):Zr(t,e)},t),t.display.scrollbars.addClass&&Bs(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var r=e.display.barWidth,n=e.display.barHeight;b(e,t);for(var i=0;4>i&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&O(e),b(e,p(e)),r=e.display.barWidth,n=e.display.barHeight}function b(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function w(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Bt(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=$i(t,n),l=$i(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;o>s?(o=s,l=$i(t,qi(Ki(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=$i(t,qi(Ki(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function x(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=L(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Fr(e))return!1;C(e)&&(Ir(e),t.dims=H(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroml&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Ml&&(o=di(e.doc,o),l=pi(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Er(e,o,l),r.viewOffset=qi(Ki(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var a=Fr(e);if(!s&&0==a&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Ro();return a>4&&(r.lineDiv.style.display="none"),I(e,r.updateLineNumbers,t.dims),a>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,u&&Ro()!=u&&u.offsetHeight&&u.focus(),Eo(r.cursorDiv),Eo(r.selectionDiv),r.gutters.style.height=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,zt(e,400)),r.updateLineNumbers=null,!0}function A(e,t){for(var r=t.force,n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Kt(e))r=!0;else if(r=!1,n&&null!=n.top&&(n={top:Math.min(e.doc.height+Gt(e.display)-jt(e),n.top)}),t.visible=w(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!M(e,t))break;O(e);var o=p(e);Ot(e),W(e,o),y(e,o)}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function N(e,t){var r=new k(e,t);if(M(e,r)){O(e),A(e,r);var n=p(e);Ot(e),W(e,n),y(e,n),r.finish()}}function W(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var r=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=r+"px",e.display.gutters.style.height=Math.max(r+Vt(e),t.clientHeight)+"px"}function O(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;nfl){var l=o.node.offsetTop+o.node.offsetHeight;i=l-r,r=l}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var a=o.line.height-i;if(2>i&&(i=gr(t)),(a>.001||-.001>a)&&(_i(o.line,i),D(o.line),o.rest))for(var u=0;u=t&&f.lineNumber;f.changes&&(Mo(f.changes,"gutter")>-1&&(h=!1),P(e,f,u,r)),h&&(Eo(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(S(e.options,u)))),s=f.node.nextSibling}else{var d=V(e,f,u,r);l.insertBefore(d,s)}u+=f.size}for(;s;)s=n(s)}function P(e,t,r,n){for(var i=0;ifl&&(e.node.style.zIndex=2)),e.node}function E(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=z(e);e.background=r.insertBefore(zo("div",null,t),r.firstChild)}}function F(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Oi(e,t)}function R(e,t){var r=t.text.className,n=F(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,B(t)):r&&(t.text.className=r)}function B(e){E(e),e.line.wrapClass?z(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function G(e,t,r,n){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=z(t),l=t.gutter=zo("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px");if(e.display.input.setUneditable(l),o.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(zo("div",S(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var s=0;s1&&(Wl&&Wl.join("\n")==t?l=n.ranges.length%Wl.length==0&&Ao(Wl,Vs):o.length==n.ranges.length&&(l=Ao(o,function(e){return[e]})));for(var s=n.ranges.length-1;s>=0;s--){var a=n.ranges[s],u=a.from(),c=a.to();a.empty()&&(r&&r>0?u=Al(u.line,u.ch-r):e.state.overwrite&&!e.state.pasteIncoming&&(c=Al(c.line,Math.min(Ki(i,c.line).text.length,c.ch+To(o).length))));var f=e.curOp.updateInput,h={from:u,to:c,text:l?l[s%l.length]:o,origin:e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input"};if(bn(e.doc,h),mo(e,"inputRead",e,h),t&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&a.head.ch<100&&(!s||n.ranges[s-1].head.line!=a.head.line)){var d=e.getModeAt(a.head),p=Vl(h);if(d.electricChars){for(var g=0;g-1){Hn(e,p.line,"smart");break}}else d.electricInput&&d.electricInput.test(Ki(i,p.line).text.slice(0,p.ch))&&Hn(e,p.line,"smart")}}On(e),e.curOp.updateInput=f,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e){for(var t=[],r=[],n=0;ni?u.map:c[i],l=0;li?e.line:e.rest[i]),f=o[l]+n;return(0>n||s!=t)&&(f=o[l+(n?1:0)]),Al(a,f)}}}var i=e.text.firstChild,o=!1;if(!t||!zs(i,t))return ot(Al(Yi(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?To(e.rest):e.line;return ot(Al(Yi(l),l.text.length),o)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var u=e.measure,c=u.maps,f=n(s,a,r);if(f)return ot(f,o);for(var h=a.nextSibling,d=s?s.nodeValue.length-r:0;h;h=h.nextSibling){if(f=n(h,h.firstChild,0))return ot(Al(f.line,f.ch-d),o);d+=h.textContent.length}for(var p=a.previousSibling,d=r;p;p=p.previousSibling){if(f=n(p,p.firstChild,-1))return ot(Al(f.line,f.ch+d),o);d+=h.textContent.length}}function at(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function l(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return""==r&&(r=t.textContent.replace(/\u200b/g,"")),void(s+=r);var u,c=t.getAttribute("cm-marker");if(c){var f=e.findMarks(Al(n,0),Al(i+1,0),o(+c));return void(f.length&&(u=f[0].find())&&(s+=ji(e.doc,u.from,u.to).join("\n")))}if("false"==t.getAttribute("contenteditable"))return;for(var h=0;h=0){var l=$(o.from(),i.from()),s=Y(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;t>=n&&--t,e.splice(--n,2,new ct(a?s:l,a?l:s))}}return new ut(e,t)}function ht(e,t){return new ut([new ct(e,t||e)],0)}function dt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function pt(e,t){if(t.liner?Al(r,Ki(e,r).text.length):gt(t,Ki(e,t.line).text.length)}function gt(e,t){var r=e.ch;return null==r||r>t?Al(e.line,t):0>r?Al(e.line,0):e}function vt(e,t){return t>=e.first&&t=o.ch:u.to>o.ch))){if(n&&(Cs(c,"beforeCursorEnter"),c.explicitlyCleared)){if(s.markedSpans){--a;continue}break}if(!c.atomic)continue;var f=c.find(0>l?-1:1);if(0==Nl(f,o)&&(f.ch+=l,f.ch<0?f=f.line>e.first?pt(e,Al(f.line-1)):null:f.ch>s.text.length&&(f=f.linet&&(t=0),t=Math.round(t),n=Math.round(n),s.appendChild(zo("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?c-e:r)+"px; height: "+(n-t)+"px"))}function i(t,r,i){function o(r,n){return ur(e,Al(t,r),"div",f,n)}var s,a,f=Ki(l,t),h=f.text.length;return Yo(Zi(f),r||0,null==i?h:i,function(e,t,l){var f,d,p,g=o(e,"left");if(e==t)f=g,d=p=g.left;else{if(f=o(t-1,"right"),"rtl"==l){var v=g;g=f,f=v}d=g.left,p=f.right}null==r&&0==e&&(d=u),f.top-g.top>3&&(n(d,g.top,null,g.bottom),d=u,g.bottoma.bottom||f.bottom==a.bottom&&f.right>a.right)&&(a=f),u+1>d&&(d=u),n(d,f.top,p-d,f.bottom)}),{start:s,end:a}}var o=e.display,l=e.doc,s=document.createDocumentFragment(),a=Ut(e.display),u=a.left,c=Math.max(o.sizerWidth,Kt(e)-o.sizer.offsetLeft)-a.right,f=t.from(),h=t.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Ki(l,f.line),p=Ki(l,h.line),g=fi(d)==fi(p),v=i(f.line,f.ch,g?d.text.length+1:null).end,m=i(h.line,g?0:null,h.ch).start;g&&(v.top0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function zt(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Ql(t.mode,Rt(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,s=Mi(e,o,n,!0);o.styles=s.styles;var a=o.styleClasses,u=s.classes;u?o.styleClasses=u:a&&(o.styleClasses=null);for(var c=!l||l.length!=o.styles.length||a!=u&&(!a||!u||a.bgClass!=u.bgClass||a.textClass!=u.textClass),f=0;!c&&fr?(zt(e,e.options.workDelay),!0):void 0}),i.length&&Tr(e,function(){for(var t=0;tl;--s){if(s<=o.first)return o.first;var a=Ki(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=Ns(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function Rt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=Ft(e,t,r),l=o>n.first&&Ki(n,o-1).stateAfter;return l=l?Ql(n.mode,l):Jl(n.mode),n.iter(o,t,function(r){Ni(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&o2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function _t(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Yt(e,t){t=fi(t);var r=Yi(t),n=e.display.externalMeasured=new Wr(e.doc,t,r);n.lineN=r;var i=n.built=Oi(e,n);return n.text=i.pre,Fo(e.display.lineMeasure,i.pre),n}function $t(e,t,r,n){return Qt(e,Zt(e,t),r,n)}function qt(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt?(i=0,o=1,l="left"):u>t?(i=t-a,o=i+1):(s==e.length-3||t==u&&e[s+3]>t)&&(o=u-a,i=o-1,t>=u&&(l="right")),null!=i){if(n=e[s+2],a==u&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)n=e[(s-=3)+2],l="left";if("right"==r&&i==u-a)for(;sc;c++){for(;s&&Po(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+afl&&0==s&&a==o.coverEnd-o.coverStart)i=l.parentNode.getBoundingClientRect();else if(cl&&e.options.lineWrapping){var f=Ds(l,s,a).getClientRects();i=f.length?f["right"==n?f.length-1:0]:Il}else i=Ds(l,s,a).getBoundingClientRect()||Il;if(i.left||i.right||0==s)break;a=s,s-=1,u="right"}cl&&11>fl&&(i=tr(e.display.measure,i))}else{s>0&&(u=n="right");var f;i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==n?f.length-1:0]:l.getBoundingClientRect()}if(cl&&9>fl&&!s&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+vr(e.display),top:h.top,bottom:h.bottom}:Il}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,c=0;cr.from?l(e-1):l(e,n)}n=n||Ki(e.doc,t.line),i||(i=Zt(e,n));var a=Zi(n),u=t.ch;if(!a)return l(u);var c=nl(a,u),f=s(u,c);return null!=Ys&&(f.other=s(u,Ys)),f}function fr(e,t){var r=0,t=pt(e.doc,t);e.options.lineWrapping||(r=vr(e.display)*t.ch);var n=Ki(e.doc,t.line),i=qi(n)+Bt(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function hr(e,t,r,n){var i=Al(e,t);return i.xRel=n,r&&(i.outside=!0),i}function dr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,0>r)return hr(n.first,0,!0,-1);var i=$i(n,r),o=n.first+n.size-1;if(i>o)return hr(n.first+n.size-1,Ki(n,o).text.length,!0,1);0>t&&(t=0);for(var l=Ki(n,i);;){var s=pr(e,l,i,t,r),a=ui(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=Yi(l=u.to.line)}}function pr(e,t,r,n,i){function o(n){var i=cr(e,Al(r,n),"line",t,u);return s=!0,l>i.bottom?i.left-a:lv)return hr(r,d,m,1);for(;;){if(c?d==h||d==ol(t,h,1):1>=d-h){for(var y=p>n||v-n>=n-p?h:d,b=n-(y==h?p:v);Po(t.text.charAt(y));)++y;var w=hr(r,y,y==h?g:m,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(f/2),C=h+x;if(c){C=h;for(var S=0;x>S;++S)C=ol(t,C,1)}var L=o(C);L>n?(d=C,v=L,(m=s)&&(v+=1e3),f=x):(h=C,p=L,g=s,f-=x)}}function gr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ol){Ol=zo("pre");for(var t=0;49>t;++t)Ol.appendChild(document.createTextNode("x")),Ol.appendChild(zo("br"));Ol.appendChild(document.createTextNode("x"))}Fo(e.measure,Ol);var r=Ol.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Eo(e.measure),r||1}function vr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=zo("span","xxxxxxxxxx"),r=zo("pre",[t]);Fo(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function mr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++zl},Pl?Pl.ops.push(e.curOp):e.curOp.ownsGroup=Pl={ops:[e.curOp],delayedCallbacks:[]}}function yr(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new k(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Cr(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function Sr(e){var t=e.cm,r=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$t(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Vt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Kt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Lr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLefto;o=n){var l=new Wr(e.doc,Ki(e.doc,o),o);n=o+l.size,i.push(l)}return i}function Dr(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ml&&di(e.doc,t)i.viewFrom?Ir(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Ir(e);else if(t<=i.viewFrom){var o=zr(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Ir(e)}else if(r>=i.viewTo){var o=zr(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Ir(e)}else{var l=zr(e,t,t,-1),s=zr(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Or(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):Ir(e)}var a=i.externalMeasured;a&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Pr(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==Mo(l,r)&&l.push(r)}}}function Ir(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Pr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,n=0;nt)return n}function zr(e,t,r,n){var i,o=Pr(e,t),l=e.display.view;if(!Ml||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=0,a=e.display.viewFrom;o>s;s++)a+=l[s].size;if(a!=t){if(n>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}for(;di(e.doc,r)!=r;){if(o==(0>n?0:l.length-1))return null;r+=n*l[o-(0>n?1:0)].size,o+=n}return{index:o,lineN:r}}function Er(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=Or(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Or(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Pr(e,r)))),n.viewTo=r}function Fr(e){for(var t=e.display.view,r=0,n=0;n400}function i(t){bo(e,t)||bs(t)}var o=e.display;ws(o.scroller,"mousedown",Mr(e,Vr)),cl&&11>fl?ws(o.scroller,"dblclick",Mr(e,function(t){if(!bo(e,t)){var r=Ur(e,t);if(r&&!Yr(e,t)&&!Gr(e.display,t)){ms(t);var n=e.findWordAt(r);bt(e.doc,n.anchor,n.head)}}})):ws(o.scroller,"dblclick",function(t){bo(e,t)||ms(t)}),kl||ws(o.scroller,"contextmenu",function(t){hn(e,t)});var l,s={end:0};ws(o.scroller,"touchstart",function(e){if(!r(e)){clearTimeout(l);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-s.end<=300?s:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),ws(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),ws(o.scroller,"touchend",function(r){var i=o.activeTouch;if(i&&!Gr(o,r)&&null!=i.left&&!i.moved&&new Date-i.start<300){var l,s=e.coordsChar(o.activeTouch,"page");l=!i.prev||n(i,i.prev)?new ct(s,s):!i.prev.prev||n(i,i.prev.prev)?e.findWordAt(s):new ct(Al(s.line,0),pt(e.doc,Al(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),ms(r)}t()}),ws(o.scroller,"touchcancel",t),ws(o.scroller,"scroll",function(){o.scroller.clientHeight&&(Zr(e,o.scroller.scrollTop),Qr(e,o.scroller.scrollLeft,!0),Cs(e,"scroll",e))}),ws(o.scroller,"mousewheel",function(t){Jr(e,t)}),ws(o.scroller,"DOMMouseScroll",function(t){Jr(e,t)}),ws(o.wrapper,"scroll",function(){o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),e.options.dragDrop&&(ws(o.scroller,"dragstart",function(t){qr(e,t)}),ws(o.scroller,"dragenter",i),ws(o.scroller,"dragover",i),ws(o.scroller,"drop",Mr(e,$r)));var a=o.input.getField();ws(a,"keyup",function(t){an.call(e,t)}),ws(a,"keydown",Mr(e,ln)),ws(a,"keypress",Mr(e,un)),ws(a,"focus",Do(cn,e)),ws(a,"blur",Do(fn,e))}function Br(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Gr(e,t){for(var r=go(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Ur(e,t,r,n){var i=e.display;if(!r&&"true"==go(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=dr(e,o,l);if(n&&1==u.xRel&&(a=Ki(e.doc,u.line).text).length==u.ch){var c=Ns(a,a.length,e.options.tabSize)-a.length;u=Al(u.line,Math.max(0,Math.round((o-Ut(e.display).left)/vr(e.display))-c))}return u}function Vr(e){var t=this,r=t.display;if(!(r.activeTouch&&r.input.supportsTouch()||bo(t,e))){if(r.shift=e.shiftKey,Gr(r,e))return void(hl||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!Yr(t,e)){var n=Ur(t,e);switch(window.focus(),vo(e)){case 1:n?Kr(t,e,n):go(e)==r.scroller&&ms(e);break;case 2:hl&&(t.state.lastMiddleDown=+new Date),n&&bt(t.doc,n),setTimeout(function(){r.input.focus()},20),ms(e);break;case 3:kl&&hn(t,e)}}}}function Kr(e,t,r){cl?setTimeout(Do(q,e),0):q(e);var n,i=+new Date;Hl&&Hl.time>i-400&&0==Nl(Hl.pos,r)?n="triple":Dl&&Dl.time>i-400&&0==Nl(Dl.pos,r)?(n="double",Hl={time:i,pos:r}):(n="single",Dl={time:i,pos:r});var o,l=e.doc.sel,s=xl?t.metaKey:t.ctrlKey;e.options.dragDrop&&Us&&!Z(e)&&"single"==n&&(o=l.contains(r))>-1&&!l.ranges[o].empty()?jr(e,t,r,s):Xr(e,t,r,n,s)}function jr(e,t,r,n){var i=e.display,o=Mr(e,function(l){hl&&(i.scroller.draggable=!1),e.state.draggingText=!1,xs(document,"mouseup",o),xs(i.scroller,"drop",o),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(ms(l),n||bt(e.doc,r),i.input.focus(),cl&&9==fl&&setTimeout(function(){document.body.focus(),i.input.focus()},20))});hl&&(i.scroller.draggable=!0),e.state.draggingText=o,i.scroller.dragDrop&&i.scroller.dragDrop(),ws(document,"mouseup",o),ws(i.scroller,"drop",o)}function Xr(e,t,r,n,i){function o(t){if(0!=Nl(v,t))if(v=t,"rect"==n){for(var i=[],o=e.options.tabSize,l=Ns(Ki(u,r.line).text,r.ch,o),s=Ns(Ki(u,t.line).text,t.ch,o),a=Math.min(l,s),d=Math.max(l,s),p=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));g>=p;p++){var m=Ki(u,p).text,y=Lo(m,a,o);a==d?i.push(new ct(Al(p,y),Al(p,y))):m.length>y&&i.push(new ct(Al(p,y),Al(p,Lo(m,d,o))))}i.length||i.push(new ct(r,r)),kt(u,ft(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,w=b.anchor,x=t;if("single"!=n){if("double"==n)var C=e.findWordAt(t);else var C=new ct(Al(t.line,0),pt(u,Al(t.line+1,0)));Nl(C.anchor,w)>0?(x=C.head,w=$(b.from(),C.anchor)):(x=C.anchor,w=Y(b.to(),C.head))}var i=h.ranges.slice(0);i[f]=new ct(pt(u,w),x),kt(u,ft(i,f),Ms)}}function l(t){var r=++y,i=Ur(e,t,!0,"rect"==n);if(i)if(0!=Nl(i,v)){q(e),o(i);var s=w(a,u);(i.line>=s.to||i.linem.bottom?20:0;c&&setTimeout(Mr(e,function(){y==r&&(a.scroller.scrollTop+=c,l(t))}),50)}}function s(e){y=1/0,ms(e),a.input.focus(),xs(document,"mousemove",b),xs(document,"mouseup",x),u.history.lastSelOrigin=null}var a=e.display,u=e.doc;ms(t);var c,f,h=u.sel,d=h.ranges;if(i&&!t.shiftKey?(f=u.sel.contains(r),c=f>-1?d[f]:new ct(r,r)):c=u.sel.primary(),t.altKey)n="rect",i||(c=new ct(r,r)),r=Ur(e,t,!0,!0),f=-1;else if("double"==n){var p=e.findWordAt(r);c=e.display.shift||u.extend?yt(u,c,p.anchor,p.head):p}else if("triple"==n){var g=new ct(Al(r.line,0),pt(u,Al(r.line+1,0)));c=e.display.shift||u.extend?yt(u,c,g.anchor,g.head):g}else c=yt(u,c,r);i?-1==f?(f=d.length,kt(u,ft(d.concat([c]),f),{scroll:!1,origin:"*mouse"})):d.length>1&&d[f].empty()&&"single"==n?(kt(u,ft(d.slice(0,f).concat(d.slice(f+1)),0)),h=u.sel):xt(u,f,c,Ms):(f=0,kt(u,new ut([c],0),Ms),h=u.sel);var v=r,m=a.wrapper.getBoundingClientRect(),y=0,b=Mr(e,function(e){vo(e)?l(e):s(e)}),x=Mr(e,s);ws(document,"mousemove",b),ws(document,"mouseup",x)}function _r(e,t,r,n,i){try{var o=t.clientX,l=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ms(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(l>a.bottom||!xo(e,r))return po(t);l-=a.top-s.viewOffset;for(var u=0;u=o){var f=$i(e.doc,l),h=e.options.gutters[u];return i(e,r,e,f,h,t),po(t)}}}function Yr(e,t){return _r(e,t,"gutterClick",!0,mo)}function $r(e){var t=this;if(!bo(t,e)&&!Gr(t.display,e)){ms(e),cl&&(El=+new Date);var r=Ur(t,e,!0),n=e.dataTransfer.files;if(r&&!Z(t))if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){var s=new FileReader;s.onload=Mr(t,function(){if(o[n]=s.result,++l==i){r=pt(t.doc,r);var e={from:r,to:r,text:Vs(o.join("\n")),origin:"paste"};bn(t.doc,e),Lt(t.doc,ht(r,Vl(e)))}}),s.readAsText(e)},a=0;i>a;++a)s(n[a],a);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(xl?e.metaKey:e.ctrlKey))var u=t.listSelections();if(Tt(t.doc,ht(r,r)),u)for(var a=0;al.clientWidth||i&&l.scrollHeight>l.clientHeight){if(i&&xl&&hl)e:for(var s=t.target,a=o.view;s!=l;s=s.parentNode)for(var u=0;uc?f=Math.max(0,f+c-50):h=Math.min(e.doc.height,h+c+50),N(e,{top:f,bottom:h})}20>Fl&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Rl=(Rl*Fl+r)/(Fl+1),++Fl)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function en(e,t,r){if("string"==typeof t&&(t=es[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{Z(e)&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=ks}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function tn(e,t,r){for(var n=0;nfl&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=nn(t,e);gl&&(Ul=n?r:null,!n&&88==r&&!js&&(xl?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||sn(t)}}function sn(e){function t(e){18!=e.keyCode&&e.altKey||(Rs(r,"CodeMirror-crosshair"),xs(document,"keyup",t),xs(document,"mouseover",t))}var r=e.display.lineDiv;Bs(r,"CodeMirror-crosshair"),ws(document,"keyup",t),ws(document,"mouseover",t)}function an(e){16==e.keyCode&&(this.doc.sel.shift=!1),bo(this,e)}function un(e){var t=this;if(!(Gr(t.display,e)||bo(t,e)||e.ctrlKey&&!e.altKey||xl&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(gl&&r==Ul)return Ul=null,void ms(e);if(!gl||e.which&&!(e.which<10)||!nn(t,e)){var i=String.fromCharCode(null==n?r:n);on(t,e,i)||t.display.input.onKeyPress(e)}}}function cn(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(Cs(e,"focus",e),e.state.focused=!0,Bs(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),hl&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Pt(e))}function fn(e){e.state.focused&&(Cs(e,"blur",e),e.state.focused=!1,Rs(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function hn(e,t){Gr(e.display,t)||dn(e,t)||e.display.input.onContextMenu(t)}function dn(e,t){return xo(e,"gutterContextMenu")?_r(e,t,"gutterContextMenu",!1,Cs):!1}function pn(e,t){if(Nl(e,t.from)<0)return e;if(Nl(e,t.to)<=0)return Vl(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Vl(t).ch-t.to.ch),Al(r,n)}function gn(e,t){for(var r=[],n=0;n=0;--i)wn(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else wn(e,t)}}function wn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Nl(t.from,t.to)){var r=gn(e,t);ro(e,t,r,e.cm?e.cm.curOp.id:0/0),Sn(e,t,r,Qn(e,t));var n=[];Ui(e,function(e,r){r||-1!=Mo(n,e.history)||(ho(e.history,t),n.push(e.history)),Sn(e,t,null,Qn(e,t))})}}function xn(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a=0;--a){var f=n.changes[a];if(f.origin=t,c&&!yn(e,f,!1))return void(l.length=0);u.push(Ji(e,f));var h=a?gn(e,f):To(l);Sn(e,f,h,ei(e,f)),!a&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Vl(f)});var d=[];Ui(e,function(e,t){t||-1!=Mo(d,e.history)||(ho(e.history,f),d.push(e.history)),Sn(e,f,null,ei(e,f))})}}}}function Cn(e,t){if(0!=t&&(e.first+=t,e.sel=new ut(Ao(e.sel.ranges,function(e){return new ct(Al(e.anchor.line+t,e.anchor.ch),Al(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Dr(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:Al(o,Ki(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ji(e,t.from,t.to),r||(r=gn(e,t)),e.cm?Ln(e.cm,t,n):Ri(e,t,n),Tt(e,r,Ts)}}function Ln(e,t,r){var n=e.doc,i=e.display,l=t.from,s=t.to,a=!1,u=l.line;e.options.lineWrapping||(u=Yi(fi(Ki(n,l.line))),n.iter(u,s.line+1,function(e){return e==i.maxLine?(a=!0,!0):void 0})),n.sel.contains(t.from,t.to)>-1&&wo(e),Ri(n,t,r,o(e)),e.options.lineWrapping||(n.iter(u,l.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,l.line),zt(e,400);var c=t.text.length-(s.line-l.line)-1;t.full?Dr(e):l.line!=s.line||1!=t.text.length||Fi(e.doc,t)?Dr(e,l.line,s.line+1,c):Hr(e,l.line,"text");var h=xo(e,"changes"),d=xo(e,"change");if(d||h){var p={from:l,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&mo(e,"change",e,p),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function kn(e,t,r,n,i){if(n||(n=r),Nl(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=Vs(t)),bn(e,{from:r,to:n,text:t,origin:i})}function Tn(e,t){if(!bo(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!yl){var o=zo("div","​",null,"position: absolute; top: "+(t.top-r.viewOffset-Bt(e.display))+"px; height: "+(t.bottom-t.top+Vt(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Mn(e,t,r,n){null==n&&(n=0);for(var i=0;5>i;i++){var o=!1,l=cr(e,t),s=r&&r!=t?cr(e,r):l,a=Nn(e,Math.min(l.left,s.left),Math.min(l.top,s.top)-n,Math.max(l.left,s.left),Math.max(l.bottom,s.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=a.scrollTop&&(Zr(e,a.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=a.scrollLeft&&(Qr(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return l}function An(e,t,r,n,i){var o=Nn(e,t,r,n,i);null!=o.scrollTop&&Zr(e,o.scrollTop),null!=o.scrollLeft&&Qr(e,o.scrollLeft)}function Nn(e,t,r,n,i){var o=e.display,l=gr(e.display);0>r&&(r=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,a=jt(e),u={};i-r>a&&(i=r+a);var c=e.doc.height+Gt(o),f=l>r,h=i>c-l;if(s>r)u.scrollTop=f?0:r;else if(i>s+a){var d=Math.min(r,(h?c:i)-a);d!=s&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Kt(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),10>t?u.scrollLeft=0:p>t?u.scrollLeft=Math.max(0,t-(v?0:10)):n>g+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Wn(e,t,r){(null!=t||null!=r)&&Dn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function On(e){Dn(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?Al(t.line,t.ch-1):t,n=Al(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Dn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=fr(e,t.from),n=fr(e,t.to),i=Nn(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Hn(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Rt(e,t):r="prev");var l=e.options.tabSize,s=Ki(o,t),a=Ns(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=o.mode.indent(i,s.text.slice(c.length),s.text),u==ks||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?Ns(Ki(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)h+=l,f+=" ";if(u>h&&(f+=ko(u-h)),f!=c)kn(o,f,Al(t,0),Al(t,c.length),"+input");else for(var d=0;d=0;t--)kn(e.doc,"",n[t].from,n[t].to,"+delete");On(e)})}function zn(e,t,r,n,i){function o(){var t=s+r;return t=e.first+e.size?f=!1:(s=t,c=Ki(e,t))}function l(e){var t=(i?ol:ll)(c,a,r,!0);if(null==t){if(e||!o())return f=!1;a=i?(0>r?Qo:Zo)(c):0>r?c.text.length:0}else a=t;return!0}var s=t.line,a=t.ch,u=r,c=Ki(e,s),f=!0;if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var h=null,d="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),g=!0;!(0>r)||l(!g);g=!1){var v=c.text.charAt(a)||"\n",m=Ho(v,p)?"w":d&&"\n"==v?"n":!d||/\s/.test(v)?null:"p";if(!d||g||m||(m="s"),h&&h!=m){0>r&&(r=1,l());break}if(m&&(h=m),r>0&&!l(!g))break}var y=Wt(e,Al(s,a),u,!0);return f||(y.hitSide=!0),y}function En(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(s-(0>r?1.5:.5)*gr(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var a=dr(e,l,i);if(!a.outside)break;if(0>r?0>=i:i>=o.height){a.hitSide=!0;break}i+=5*r}return a}function Fn(t,r,n,i){e.defaults[t]=r,n&&(jl[t]=i?function(e,t,r){r!=Xl&&n(e,t,r)}:n)}function Rn(e){for(var t,r,n,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l0||0==l&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=zo("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(ci(e,t.line,t,r,o)||t.line!=r.line&&ci(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ml=!0}o.addToHistory&&ro(e,{from:t,to:r,origin:"markText"},e.sel,0/0);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&fi(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&_i(e,0),$n(e,new Xn(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a}),o.collapsed&&e.iter(t.line,r.line+1,function(t){gi(e,t)&&_i(t,0)}),o.clearOnEnter&&ws(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Tl=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ls,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Dr(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)Hr(u,c,"text");o.atomic&&At(u.doc),mo(u,"markerAdded",u,o)}return o}function Un(e,t,r,n,i){n=Oo(n),n.shared=!1;var o=[Gn(e,t,r,n,i)],l=o[0],s=n.widgetNode;return Ui(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Gn(e,pt(e,t),pt(e,r),n,i));for(var a=0;a=t:o.to>t);(n||(n=[])).push(new Xn(l,o.from,a?null:o.to))}}return n}function Zn(e,t,r){if(e)for(var n,i=0;i=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from0&&s)for(var f=0;ff;++f)p.push(g);p.push(a)}return p}function Jn(e){for(var t=0;t0)){var c=[a,1],f=Nl(u.from,s.from),h=Nl(u.to,s.to);(0>f||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from}),(h>0||!l.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-1}}return i}function ri(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(Nl(u.to,r)>0||a.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Nl(u.from,n)<0||a.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function fi(e){for(var t;t=ai(e);)e=t.find(-1,!0).line;return e}function hi(e){for(var t,r;t=ui(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function di(e,t){var r=Ki(e,t),n=fi(r);return r==n?t:Yi(n)}function pi(e,t){if(t>e.lastLine())return t;var r,n=Ki(e,t);if(!gi(e,n))return t;for(;r=ui(n);)n=r.find(1,!0).line;return Yi(n)+1}function gi(e,t){var r=Ml&&t.markedSpans;if(r)for(var n,i=0;io;o++){i&&(i[0]=e.innerMode(t,n).mode);var l=t.token(r,n);if(r.pos>r.start)return l}throw new Error("Mode "+t.name+" failed to advance stream.")}function ki(e,t,r,n){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?Ql(l.mode,c):c}}var o,l=e.doc,s=l.mode;t=pt(l,t);var a,u=Ki(l,t.line),c=Rt(e,t.line,r),f=new os(u.text,e.options.tabSize);for(n&&(a=[]);(n||f.pose.options.maxHighlightLength?(s=!1,l&&Ni(e,t,n,f.pos),f.pos=t.length,a=null):a=Ci(Li(r,f,n,h),o),h){var d=h[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;uu;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"cm-overlay "+t),a=r+2;else for(;a>r;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ai(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Mi(e,t,t.stateAfter=Rt(e,Yi(t)));t.styles=n.styles,n.classes?t.styleClasses=n.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Ni(e,t,r,n){var i=e.doc.mode,o=new os(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&Si(i,r);!o.eol()&&o.pos<=e.options.maxHighlightLength;)Li(i,o,r),o.start=o.pos}function Wi(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?hs:fs;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Oi(e,t){var r=zo("span",null,null,hl?"padding-right: .1px":null),n={pre:zo("pre",[r]),content:r,col:0,pos:0,cm:e};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=Hi,(cl||hl)&&e.getOption("lineWrapping")&&(n.addToken=Ii(n.addToken)),Xo(e.display.measure)&&(o=Zi(l))&&(n.addToken=Pi(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&Yi(l);Ei(l,n,Ai(e,l,s)),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=Go(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=Go(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(jo(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return hl&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),Cs(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=Go(n.pre.className,n.textClass||"")),n}function Di(e){var t=zo("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Hi(e,t,r,n,i,o,l){if(t){var s=e.cm.options.specialChars,a=!1;if(s.test(t))for(var u=document.createDocumentFragment(),c=0;;){s.lastIndex=c;var f=s.exec(t),h=f?f.index-c:t.length-c;if(h){var d=document.createTextNode(t.slice(c,c+h));u.appendChild(cl&&9>fl?zo("span",[d]):d),e.map.push(e.pos,e.pos+h,d),e.col+=h,e.pos+=h}if(!f)break;if(c+=h+1," "==f[0]){var p=e.cm.options.tabSize,g=p-e.col%p,d=u.appendChild(zo("span",ko(g),"cm-tab"));d.setAttribute("role","presentation"),d.setAttribute("cm-text"," "),e.col+=g}else{var d=e.cm.options.specialCharPlaceholder(f[0]);d.setAttribute("cm-text",f[0]),u.appendChild(cl&&9>fl?zo("span",[d]):d),e.col+=1}e.map.push(e.pos,e.pos+1,d),e.pos++}else{e.col+=t.length;var u=document.createTextNode(t);e.map.push(e.pos,e.pos+t.length,u),cl&&9>fl&&(a=!0),e.pos+=t.length}if(r||n||i||a||l){var v=r||"";n&&(v+=n),i&&(v+=i);var m=zo("span",[u],v,l);return o&&(m.title=o),e.content.appendChild(m)}e.content.appendChild(u)}}function Ii(e){function t(e){for(var t=" ",r=0;ra&&f.from<=a)break}if(f.to>=u)return e(r,n,i,o,l,s);e(r,n.slice(0,f.to-a),i,o,null,s),o=null,n=n.slice(f.to-a),a=f.to}}}function zi(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Ei(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=f=s="",h=null,m=1/0;for(var y=[],b=0;bp)?(null!=w.to&&m>w.to&&(m=w.to,u=""),x.className&&(a+=" "+x.className),x.css&&(s=x.css),x.startStyle&&w.from==p&&(c+=" "+x.startStyle),x.endStyle&&w.to==m&&(u+=" "+x.endStyle),x.title&&!f&&(f=x.title),x.collapsed&&(!h||li(h.marker,x)<0)&&(h=w)):w.from>p&&m>w.from&&(m=w.from),"bookmark"==x.type&&w.from==p&&x.widgetNode&&y.push(x)}if(h&&(h.from||0)==p&&(zi(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to))return;if(!h&&y.length)for(var b=0;b=d)break;for(var C=Math.min(d,m);;){if(v){var S=p+v.length;if(!h){var L=S>C?v.slice(0,C-p):v;t.addToken(t,L,l?l+a:a,c,p+L.length==m?u:"",f,s)}if(S>=C){v=v.slice(C-p),p=C;break}p=S,c=""}v=i.slice(o,o=r[g++]),l=Wi(r[g++],t.cm.options)}}else for(var g=1;gr;++r)o.push(new cs(u[r],i(r),n));return o}var s=t.from,a=t.to,u=t.text,c=Ki(e,s.line),f=Ki(e,a.line),h=To(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Fi(e,t)){var g=l(0,u.length-1);o(f,f.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(a.ch),d);else{var g=l(1,u.length-1);g.push(new cs(h+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(f,h+f.text.slice(a.ch),d);var g=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,g)}mo(e,"change",e,t)}function Bi(e){this.lines=e,this.parent=null;for(var t=0,r=0;tt||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(o>t){r=i;break}t-=o}return r.lines[t]}function ji(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function Xi(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function _i(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Yi(e){if(null==e.parent)return null;for(var t=e.parent,r=Mo(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function $i(e,t){var r=e.first;e:do{for(var n=0;nt){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var n=0;nt)break;t-=s}return r+n}function qi(e){e=fi(e);for(var t=0,r=e.parent,n=0;n1&&!e.done[e.done.length-2].ranges?(e.done.pop(),To(e.done)):void 0}function ro(e,t,r,n){var i=e.history;i.undone.length=0;var o,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=to(i,i.lastOp==n))){var s=To(o.changes);0==Nl(t.from,t.to)&&0==Nl(t.from,s.to)?s.to=Vl(t):o.changes.push(Ji(e,t))}else{var a=To(i.done);for(a&&a.ranges||oo(e.sel,i.done),o={changes:[Ji(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||Cs(e,"historyAdded")}function no(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function io(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||no(e,o,To(i.done),t))?i.done[i.done.length-1]=t:oo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&eo(i.undone)}function oo(e,t){var r=To(t);r&&r.ranges&&r.equals(e)||t.push(e)}function lo(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function so(e){if(!e)return null;for(var t,r=0;r-1&&(To(s)[f]=c[f],delete c[f])}}}return i}function co(e,t,r,n){r0}function Co(e){e.prototype.on=function(e,t){ws(this,e,t)},e.prototype.off=function(e,t){xs(this,e,t)}}function So(){this.id=null}function Lo(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function ko(e){for(;Ws.length<=e;)Ws.push(To(Ws)+" ");return Ws[e]}function To(e){return e[e.length-1]}function Mo(e,t){for(var r=0;r-1&&Is(e)?!0:t.test(e):Is(e)}function Io(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Po(e){return e.charCodeAt(0)>=768&&Ps.test(e)}function zo(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild);return e}function Fo(e,t){return Eo(e).appendChild(t)}function Ro(){return document.activeElement}function Bo(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Go(e,t){for(var r=e.split(" "),n=0;n2&&!(cl&&8>fl))}var r=Es?zo("span","​"):zo("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Xo(e){if(null!=Fs)return Fs;var t=Fo(e,document.createTextNode("AخA")),r=Ds(t,0,1).getBoundingClientRect();if(!r||r.left==r.right)return!1;var n=Ds(t,1,2).getBoundingClientRect();return Fs=n.right-r.right<3}function _o(e){if(null!=Xs)return Xs;var t=Fo(e,zo("span","x")),r=t.getBoundingClientRect(),n=Ds(t,0,1).getBoundingClientRect();return Xs=Math.abs(r.left-n.left)>1}function Yo(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function $o(e){return e.level%2?e.to:e.from}function qo(e){return e.level%2?e.from:e.to}function Zo(e){var t=Zi(e);return t?$o(t[0]):0}function Qo(e){var t=Zi(e);return t?qo(To(t)):e.text.length}function Jo(e,t){var r=Ki(e.doc,t),n=fi(r);n!=r&&(t=Yi(n));var i=Zi(n),o=i?i[0].level%2?Qo(n):Zo(n):0;return Al(t,o)}function el(e,t){for(var r,n=Ki(e.doc,t);r=ui(n);)n=r.find(1,!0).line,t=null;var i=Zi(n),o=i?i[0].level%2?Zo(n):Qo(n):n.text.length;return Al(null==t?Yi(n):t,o)}function tl(e,t){var r=Jo(e,t.line),n=Ki(e.doc,r.line),i=Zi(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return Al(r.line,l?0:o)}return r}function rl(e,t,r){var n=e[0].level;return t==n?!0:r==n?!1:r>t}function nl(e,t){Ys=null;for(var r,n=0;nt)return n;if(i.from==t||i.to==t){if(null!=r)return rl(e,i.level,e[r].level)?(i.from!=i.to&&(Ys=r),n):(i.from!=i.to&&(Ys=n),r);r=n}}return r}function il(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&Po(e.text.charAt(t)));return t}function ol(e,t,r,n){var i=Zi(e);if(!i)return ll(e,t,r,n);for(var o=nl(i,t),l=i[o],s=il(e,t,l.level%2?-r:r,n);;){if(s>l.from&&s0==l.level%2?l.to:l.from);if(l=i[o+=r],!l)return null;s=r>0==l.level%2?il(e,l.to,-1,n):il(e,l.from,1,n)}}function ll(e,t,r,n){var i=t+r;if(n)for(;i>0&&Po(e.text.charAt(i));)i+=r;return 0>i||i>e.text.length?null:i}var sl=/gecko\/\d/i.test(navigator.userAgent),al=/MSIE \d/.test(navigator.userAgent),ul=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),cl=al||ul,fl=cl&&(al?document.documentMode||6:ul[1]),hl=/WebKit\//.test(navigator.userAgent),dl=hl&&/Qt\/\d+\.\d+/.test(navigator.userAgent),pl=/Chrome\//.test(navigator.userAgent),gl=/Opera\//.test(navigator.userAgent),vl=/Apple Computer/.test(navigator.vendor),ml=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),yl=/PhantomJS/.test(navigator.userAgent),bl=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),wl=bl||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),xl=bl||/Mac/.test(navigator.platform),Cl=/win/i.test(navigator.platform),Sl=gl&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Sl&&(Sl=Number(Sl[1])),Sl&&Sl>=15&&(gl=!1,hl=!0);var Ll=xl&&(dl||gl&&(null==Sl||12.11>Sl)),kl=sl||cl&&fl>=9,Tl=!1,Ml=!1;g.prototype=Oo({update:function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&e.clientHeight>0&&(0==n&&this.overlayHack(),this.checkedOverlay=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},overlayHack:function(){var e=xl&&!ml?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;var t=this,r=function(e){go(e)!=t.vert&&go(e)!=t.horiz&&Mr(t.cm,Vr)(e)};ws(this.vert,"mousedown",r),ws(this.horiz,"mousedown",r)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},g.prototype),v.prototype=Oo({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},v.prototype),e.scrollbarModel={"native":g,"null":v},k.prototype.signal=function(e,t){xo(e,t)&&this.events.push(arguments)},k.prototype.finish=function(){for(var e=0;e=9&&r.hasSelection&&(r.hasSelection=null),r.poll()}),ws(o,"paste",function(){if(hl&&!n.state.fakedLastChar&&!(new Date-n.state.lastMiddleDown<200)){var e=o.selectionStart,t=o.selectionEnd;o.value+="$",o.selectionEnd=t,o.selectionStart=e,n.state.fakedLastChar=!0}n.state.pasteIncoming=!0,r.fastPoll()}),ws(o,"cut",t),ws(o,"copy",t),ws(e.scroller,"paste",function(t){Gr(e,t)||(n.state.pasteIncoming=!0,r.focus())}),ws(e.lineSpace,"selectstart",function(t){Gr(e,t)||ms(t)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Dt(e);if(e.options.moveInputWithCursor){var i=cr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},showSelection:function(e){var t=this.cm,r=t.display;Fo(r.cursorDiv,e.cursors),Fo(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=js&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var l=t?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&Os(this.textarea),cl&&fl>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",cl&&fl>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!wl||Ro()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(!e.state.focused||Ks(t)&&!r||Z(e)||e.options.disableInput||e.state.keySeq)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(cl&&fl>=9&&this.hasSelection===n||xl&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;8203!=n.charCodeAt(0)||e.doc.sel!=e.display.selForContextMenu||r||(r="​");for(var i=0,o=Math.min(r.length,n.length);o>i&&r.charCodeAt(i)==n.charCodeAt(i);)++i;var l=this;return Tr(e,function(){Q(e,n.slice(i),r.length-i),n.length>1e3||n.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=n +-}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){cl&&fl>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t=l.value="​"+(e?l.value:"");n.prevInput=e?"":"​",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.position="relative",l.style.cssText=c,cl&&9>fl&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!cl||cl&&9>fl)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart?Mr(i,es.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset()};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,l=n.textarea,s=Ur(i,e),a=o.scroller.scrollTop;if(s&&!gl){var u=i.options.resetSelectionOnContextMenu;u&&-1==i.doc.sel.contains(s)&&Mr(i,kt)(i.doc,ht(s),Ts);var c=l.style.cssText;if(n.wrapper.style.position="absolute",l.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(cl?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",hl)var f=window.scrollY;if(o.input.focus(),hl&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),cl&&fl>=9&&t(),kl){bs(e);var h=function(){xs(window,"mouseup",h),setTimeout(r,20)};ws(window,"mouseup",h)}else setTimeout(r,50)}},setUneditable:No,needsContentAttribute:!1},tt.prototype),nt.prototype=Oo({init:function(e){function t(e){if(n.somethingSelected())Wl=n.getSelections(),"cut"==e.type&&n.replaceSelection("",null,"cut");else{var t=J(n);Wl=t.text,"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Ts),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!bl)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Wl.join("\n"));else{var r=rt(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=Wl.join("\n");var o=document.activeElement;Os(i),setTimeout(function(){n.display.lineSpace.removeChild(r),o.focus()},50)}}var r=this,n=r.cm,i=r.div=e.lineDiv;i.contentEditable="true",et(i),ws(i,"paste",function(e){var t=e.clipboardData&&e.clipboardData.getData("text/plain");t&&(e.preventDefault(),n.replaceSelection(t,null,"paste"))}),ws(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),l=o.indexOf(t,Math.max(0,i.head.ch-t.length));l>-1&&l<=i.head.ch&&(r.composing.sel=ht(Al(i.head.line,l),Al(i.head.line,l+t.length)))}}),ws(i,"compositionupdate",function(e){r.composing.data=e.data}),ws(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),ws(i,"touchstart",function(){r.forceCompositionEnd()}),ws(i,"input",function(){r.composing||r.pollContent()||Tr(r.cm,function(){Dr(n)})}),ws(i,"copy",t),ws(i,"cut",t)},prepareSelection:function(){var e=Dt(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=lt(this.cm,e.anchorNode,e.anchorOffset),n=lt(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=Nl($(r,n),t.from())||0!=Nl(Y(r,n),t.to())){var i=it(this.cm,t.from()),o=it(this.cm,t.to());if(i||o){var l=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var a=l[l.length-1].measure,u=a.maps?a.maps[a.maps.length-1]:a.map;o={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}}else i={node:l[0].measure.map[2],offset:0};try{var c=Ds(i.node,i.offset,o.offset,o.node)}catch(f){}c&&(e.removeAllRanges(),e.addRange(c),s&&null==e.anchorNode&&e.addRange(s)),this.rememberSelection()}}},showMultipleSelections:function(e){Fo(this.cm.display.cursorDiv,e.cursors),Fo(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return zs(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Tr(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},pollSelection:function(){if(!this.composing){var e=window.getSelection(),t=this.cm;if(e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset){this.rememberSelection();var r=lt(t,e.anchorNode,e.anchorOffset),n=lt(t,e.focusNode,e.focusOffset);r&&n&&Tr(t,function(){kt(t.doc,ht(r,n),Ts),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.linet.viewTo-1)return!1;var o;if(n.line==t.viewFrom||0==(o=Pr(e,n.line)))var l=Yi(t.view[0].line),s=t.view[0].node;else var l=Yi(t.view[o].line),s=t.view[o-1].node.nextSibling;var a=Pr(e,i.line);if(a==t.view.length-1)var u=t.viewTo-1,c=t.view[a].node;else var u=Yi(t.view[a+1].line)-1,c=t.view[a+1].node.previousSibling;for(var f=Vs(at(e,s,c,l,u)),h=ji(e.doc,Al(l,0),Al(u,Ki(e.doc,u).text.length));f.length>1&&h.length>1;)if(To(f)==To(h))f.pop(),h.pop(),u--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),l++}for(var d=0,p=0,g=f[0],v=h[0],m=Math.min(g.length,v.length);m>d&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=To(f),b=To(h),w=Math.min(y.length-(1==f.length?d:0),b.length-(1==h.length?d:0));w>p&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;f[f.length-1]=y.slice(0,y.length-p),f[0]=f[0].slice(d);var x=Al(l,d),C=Al(u,h.length?To(h).length-p:0);return f.length>1||f[0]||Nl(x,C)?(kn(e.doc,f,x,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){e.data&&e.data!=e.startData&&Mr(this.cm,Q)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.setAttribute("contenteditable","false")},onKeyPress:function(e){e.preventDefault(),Mr(this.cm,Q)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},onContextMenu:No,resetPosition:No,needsContentAttribute:!0},nt.prototype),e.inputStyles={textarea:tt,contenteditable:nt},ut.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&Nl(e,n.to())<=0)return r}return-1}},ct.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return Y(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Ol,Dl,Hl,Il={left:0,right:0,top:0,bottom:0},Pl=null,zl=0,El=0,Fl=0,Rl=null;cl?Rl=-.53:sl?Rl=15:pl?Rl=-.7:vl&&(Rl=-1/3);var Bl=function(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}};e.wheelEventPixels=function(e){var t=Bl(e);return t.x*=Rl,t.y*=Rl,t};var Gl=new So,Ul=null,Vl=e.changeEnd=function(e){return e.text?Al(e.from.line+e.text.length-1,To(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];(r[e]!=t||"mode"==e)&&(r[e]=t,jl.hasOwnProperty(e)&&Mr(this,jl[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Bn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(Hn(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&On(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;r>a;++a)Hn(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&xt(this.doc,n,new ct(o,u[n].to()),Ts)}}}),getTokenAt:function(e,t){return ki(this,e,t)},getLineTokens:function(e,t){return ki(this,Al(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,r=Ai(this,Ki(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]s?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Zl.hasOwnProperty(t))return Zl;var n=Zl[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;on&&(e=n,r=!0);var i=Ki(this.doc,e);return sr(this,i,{top:0,left:0},t||"page").top+(r?this.doc.height-qi(i):0)},defaultTextHeight:function(){return gr(this.display)},defaultCharWidth:function(){return vr(this.display)},setGutterMarker:Ar(function(e,t,r){return In(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&Io(n)&&(e.gutterMarkers=null),!0})}),clearGutter:Ar(function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,Hr(t,n,"gutter"),Io(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),addLineWidget:Ar(function(e,t,r){return bi(this,e,t,r)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!vt(this.doc,e))return null;var t=e;if(e=Ki(this.doc,e),!e)return null}else{var t=Yi(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=cr(this,pt(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&An(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:Ar(ln),triggerOnKeyPress:Ar(un),triggerOnKeyUp:an,execCommand:function(e){return es.hasOwnProperty(e)?es[e](this):void 0},findPosH:function(e,t,r,n){var i=1;0>t&&(i=-1,t=-t);for(var o=0,l=pt(this.doc,e);t>o&&(l=zn(this.doc,l,i,r,n),!l.hitSide);++o);return l},moveH:Ar(function(e,t){var r=this;r.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?zn(r.doc,n.head,e,t,r.options.rtlMoveVisually):0>e?n.from():n.to()},As)}),deleteH:Ar(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Pn(this,function(r){var i=zn(n,r.head,e,t,!1);return 0>e?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;0>t&&(i=-1,t=-t);for(var l=0,s=pt(this.doc,e);t>l;++l){var a=cr(this,s,"div");if(null==o?o=a.left:a.left=o,s=En(this,a,i,r),s.hitSide)break}return s},moveV:Ar(function(e,t){var r=this,n=this.doc,i=[],o=!r.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return 0>e?l.from():l.to();var s=cr(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=En(r,s,e,t);return"page"==t&&l==n.sel.primary()&&Wn(r,null,ur(r,a,"div").top-s.top),a},As),i.length)for(var l=0;l0&&s(r.charAt(n-1));)--n;for(;i.5)&&l(this),Cs(this,"refresh",this)}),swapDoc:Ar(function(e){var t=this.doc;return t.cm=null,Vi(this,e),ir(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,mo(this,"swapDoc",this,t),t}),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}},Co(e);var Kl=e.defaults={},jl=e.optionHandlers={},Xl=e.Init={toString:function(){return"CodeMirror.Init"}};Fn("value","",function(e,t){e.setValue(t)},!0),Fn("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Fn("indentUnit",2,r,!0),Fn("indentWithTabs",!1),Fn("smartIndent",!0),Fn("tabSize",4,function(e){n(e),ir(e),Dr(e)},!0),Fn("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t){e.options.specialChars=new RegExp(t.source+(t.test(" ")?"":"| "),"g"),e.refresh()},!0),Fn("specialCharPlaceholder",Di,function(e){e.refresh()},!0),Fn("electricChars",!0),Fn("inputStyle",wl?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Fn("rtlMoveVisually",!Cl),Fn("wholeLineUpdateBefore",!0),Fn("theme","default",function(e){s(e),a(e)},!0),Fn("keyMap","default",function(t,r,n){var i=Bn(r),o=n!=e.Init&&Bn(n);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Fn("extraKeys",null),Fn("lineWrapping",!1,i,!0),Fn("gutters",[],function(e){d(e.options),a(e)},!0),Fn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?L(e.display)+"px":"0",e.refresh()},!0),Fn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Fn("scrollbarStyle","native",function(e){m(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Fn("lineNumbers",!1,function(e){d(e.options),a(e)},!0),Fn("firstLineNumber",1,a,!0),Fn("lineNumberFormatter",function(e){return e},a,!0),Fn("showCursorWhenSelecting",!1,Ot,!0),Fn("resetSelectionOnContextMenu",!0),Fn("readOnly",!1,function(e,t){"nocursor"==t?(fn(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||e.display.input.reset())}),Fn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Fn("dragDrop",!0),Fn("cursorBlinkRate",530),Fn("cursorScrollMargin",0),Fn("cursorHeight",1,Ot,!0),Fn("singleCursorHeightPerLine",!0,Ot,!0),Fn("workTime",100),Fn("workDelay",100),Fn("flattenSpans",!0,n,!0),Fn("addModeClass",!1,n,!0),Fn("pollInterval",100),Fn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Fn("historyEventDelay",1250),Fn("viewportMargin",10,function(e){e.refresh()},!0),Fn("maxHighlightLength",1e4,n,!0),Fn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Fn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Fn("autofocus",null);var _l=e.modes={},Yl=e.mimeModes={};e.defineMode=function(t,r){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),_l[t]=r},e.defineMIME=function(e,t){Yl[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Yl.hasOwnProperty(t))t=Yl[t];else if(t&&"string"==typeof t.name&&Yl.hasOwnProperty(t.name)){var r=Yl[t.name];"string"==typeof r&&(r={name:r}),t=Wo(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),n=_l[r.name];if(!n)return e.getMode(t,"text/plain");var i=n(t,r);if($l.hasOwnProperty(r.name)){var o=$l[r.name];for(var l in o)o.hasOwnProperty(l)&&(i.hasOwnProperty(l)&&(i["_"+l]=i[l]),i[l]=o[l])}if(i.name=r.name,r.helperType&&(i.helperType=r.helperType),r.modeProps)for(var l in r.modeProps)i[l]=r.modeProps[l];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var $l=e.modeExtensions={};e.extendMode=function(e,t){var r=$l.hasOwnProperty(e)?$l[e]:$l[e]={};Oo(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){ps.prototype[e]=t},e.defineOption=Fn;var ql=[];e.defineInitHook=function(e){ql.push(e)};var Zl=e.helpers={};e.registerHelper=function(t,r,n){Zl.hasOwnProperty(t)||(Zl[t]=e[t]={_global:[]}),Zl[t][r]=n},e.registerGlobalHelper=function(t,r,n,i){e.registerHelper(t,r,i),Zl[t]._global.push({pred:n,val:i})};var Ql=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},Jl=e.startState=function(e,t,r){return e.startState?e.startState(t,r):!0};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var es=e.commands={selectAll:function(e){e.setSelection(Al(e.firstLine(),0),Al(e.lastLine()),Ts)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ts)},killLine:function(e){Pn(e,function(t){if(t.empty()){var r=Ki(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new Al(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Al(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Ki(e.doc,i.line-1).text;l&&e.replaceRange(o.charAt(0)+"\n"+l.charAt(l.length-1),Al(i.line-1,l.length-1),Al(i.line,1),"+transpose")}r.push(new ct(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){Tr(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var n=e.listSelections()[r];e.replaceRange("\n",n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0),On(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},ts=e.keyMap={};ts.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ts.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ts.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},ts.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ts["default"]=xl?ts.macDefault:ts.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Ao(r.split(" "),Rn),o=0;o=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ls=0,ss=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ls};Co(ss),ss.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&mr(e),xo(this,"clear")){var r=this.find();r&&mo(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Dr(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&At(e.doc)),e&&mo(e,"markerCleared",e,this),t&&br(e),this.parent&&this.parent.clear()}},ss.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;ir;++r){var i=this.lines[r];this.height-=i.height,xi(i),mo(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;ne;++e)if(r(this.lines[e]))return!0}},Gi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;re){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Bi))){var s=[];this.collapse(s),this.children=[new Bi(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t=e){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var l=i.lines.splice(i.lines.length-25,25),s=new Bi(l);i.height-=s.height,this.children.splice(n+1,0,s),s.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Gi(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=Mo(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new Gi(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;ne){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var ds=0,ps=e.Doc=function(e,t,r){if(!(this instanceof ps))return new ps(e,t,r);null==r&&(r=0),Gi.call(this,[new Bi([new cs("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var n=Al(r,0);this.sel=ht(n),this.history=new Qi(null),this.id=++ds,this.modeOption=t,"string"==typeof e&&(e=Vs(e)),Ri(this,{from:n,to:n,text:e}),kt(this,ht(n),Ts)};ps.prototype=Wo(Gi.prototype,{constructor:ps,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n=0;o--)bn(this,n[o]);s?Lt(this,s):this.cm&&On(this.cm)}),undo:Nr(function(){xn(this,"undo")}),redo:Nr(function(){xn(this,"redo")}),undoSelection:Nr(function(){xn(this,"undo",!0)}),redoSelection:Nr(function(){xn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=pt(this,e),t=pt(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;sa.to||null==a.from&&i!=e.line||i==t.line&&a.from>t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=i,void++r)}),pt(this,Al(r,t))},indexFromPos:function(e){e=pt(this,e);var t=e.ch;return e.linet&&(t=e.from),null!=e.to&&e.tos||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}},Ws=[""],Os=function(e){e.select()};bl?Os=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:cl&&(Os=function(e){try{e.select()}catch(t){}});var Ds,Hs=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Is=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Hs.test(e))},Ps=/[\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]/;Ds=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var zs=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};cl&&11>fl&&(Ro=function(){try{return document.activeElement}catch(e){return document.body}});var Es,Fs,Rs=e.rmClass=function(e,t){var r=e.className,n=Bo(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Bs=e.addClass=function(e,t){var r=e.className;Bo(t).test(r)||(e.className+=(r?" ":"")+t)},Gs=!1,Us=function(){if(cl&&9>fl)return!1;var e=zo("div");return"draggable"in e||"dragDrop"in e}(),Vs=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;n>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Ks=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},js=function(){var e=zo("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Xs=null,_s={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=_s,function(){for(var e=0;10>e;e++)_s[e+48]=_s[e+96]=String(e);for(var e=65;90>=e;e++)_s[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)_s[e+111]=_s[e+63235]="F"+e}();var Ys,$s=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?n.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,s=/[Lb1n]/,a=/[1n]/,u="L";return function(r){if(!i.test(r))return!1;for(var n,c=r.length,f=[],h=0;c>h;++h)f.push(n=e(r.charCodeAt(h)));for(var h=0,d=u;c>h;++h){var n=f[h];"m"==n?f[h]=d:d=n}for(var h=0,p=u;c>h;++h){var n=f[h];"1"==n&&"r"==p?f[h]="n":l.test(n)&&(p=n,"r"==n&&(f[h]="R"))}for(var h=1,d=f[0];c-1>h;++h){var n=f[h];"+"==n&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=n||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d),d=n}for(var h=0;c>h;++h){var n=f[h];if(","==n)f[h]="N";else if("%"==n){for(var g=h+1;c>g&&"%"==f[g];++g);for(var v=h&&"!"==f[h-1]||c>g&&"1"==f[g]?"1":"N",m=h;g>m;++m)f[m]=v;h=g-1}}for(var h=0,p=u;c>h;++h){var n=f[h];"L"==p&&"1"==n?f[h]="L":l.test(n)&&(p=n)}for(var h=0;c>h;++h)if(o.test(f[h])){for(var g=h+1;c>g&&o.test(f[g]);++g);for(var y="L"==(h?f[h-1]:u),b="L"==(c>g?f[g]:u),v=y||b?"L":"R",m=h;g>m;++m)f[m]=v;h=g-1}for(var w,x=[],h=0;c>h;)if(s.test(f[h])){var C=h;for(++h;c>h&&s.test(f[h]);++h);x.push(new t(0,C,h))}else{var S=h,L=x.length;for(++h;c>h&&"L"!=f[h];++h);for(var m=S;h>m;)if(a.test(f[m])){m>S&&x.splice(L,0,new t(1,S,m));var k=m;for(++m;h>m&&a.test(f[m]);++m);x.splice(L,0,new t(2,k,m)),S=m}else++m;h>S&&x.splice(L,0,new t(1,S,h))}return 1==x[0].level&&(w=r.match(/^\s+/))&&(x[0].from=w[0].length,x.unshift(new t(0,0,w[0].length))),1==To(x).level&&(w=r.match(/\s+$/))&&(To(x).to-=w[0].length,x.push(new t(0,c-w[0].length,c))),x[0].level!=To(x).level&&x.push(new t(x[0].level,c,c)),x}}();return e.version="5.0.1",e}); +\ No newline at end of file ++!function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);this.CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d?Ge(d):{},Ge(Uf,d,!1),n(d);var e=d.value;"string"==typeof e&&(e=new qg(e,d.mode)),this.doc=e;var f=new a.inputStyles[d.inputStyle](this),g=this.display=new b(c,e,f);g.wrapper.CodeMirror=this,j(this),h(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!wf&&g.input.focus(),r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new ye,keySeq:null,specialChars:null};var i=this;mf&&11>nf&&setTimeout(function(){i.display.input.reset(!0)},20),Ob(this),Se(),sb(this),this.curOp.forceUpdate=!0,Td(this,e),d.autofocus&&!wf||i.hasFocus()?setTimeout(He(mc,this),20):nc(this);for(var k in Vf)Vf.hasOwnProperty(k)&&Vf[k](this,d[k],Wf);w(this),d.finishInit&&d.finishInit(this);for(var l=0;l<$f.length;++l)$f[l](this);ub(this),of&&d.lineWrapping&&"optimizelegibility"==getComputedStyle(g.lineDiv).textRendering&&(g.lineDiv.style.textRendering="auto")}function b(a,b,c){var d=this;this.input=c,d.scrollbarFiller=Le("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=Le("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=Le("div",null,"CodeMirror-code"),d.selectionDiv=Le("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=Le("div",null,"CodeMirror-cursors"),d.measure=Le("div",null,"CodeMirror-measure"),d.lineMeasure=Le("div",null,"CodeMirror-measure"),d.lineSpace=Le("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none"),d.mover=Le("div",[Le("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=Le("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=Le("div",null,null,"position: absolute; height: "+Ag+"px; width: 1px;"),d.gutters=Le("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=Le("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=Le("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),mf&&8>nf&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),of||jf&&wf||(d.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(d.wrapper):a(d.wrapper)),d.viewFrom=d.viewTo=b.first,d.reportedViewFrom=d.reportedViewTo=b.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,c.init(d)}function c(b){b.doc.mode=a.getMode(b.options,b.doc.modeOption),d(b)}function d(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,La(a,100),a.state.modeGen++,a.curOp&&Hb(a)}function e(a){a.options.lineWrapping?(Qg(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Pg(a.display.wrapper,"CodeMirror-wrap"),m(a)),g(a),Hb(a),fb(a),setTimeout(function(){s(a)},100)}function f(a){var b=qb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/rb(a.display)-3);return function(e){if(rd(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;gb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=Ce(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Qa(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+Sa(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function p(a,b,c){this.cm=c;var d=this.vert=Le("div",[Le("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=Le("div",[Le("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d),a(e),wg(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")}),wg(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")}),this.checkedOverlay=!1,mf&&8>nf&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function q(){}function r(b){b.display.scrollbars&&(b.display.scrollbars.clear(),b.display.scrollbars.addClass&&Pg(b.display.wrapper,b.display.scrollbars.addClass)),b.display.scrollbars=new a.scrollbarModel[b.options.scrollbarStyle](function(a){b.display.wrapper.insertBefore(a,b.display.scrollbarFiller),wg(a,"mousedown",function(){b.state.focused&&setTimeout(function(){b.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,c){"horizontal"==c?ac(b,a):_b(b,a)},b),b.display.scrollbars.addClass&&Qg(b.display.wrapper,b.display.scrollbars.addClass)}function s(a,b){b||(b=o(a));var c=a.display.barWidth,d=a.display.barHeight;t(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&F(a),t(a,o(a)),c=a.display.barWidth,d=a.display.barHeight}function t(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",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 u(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Pa(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=Zd(b,d),g=Zd(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;f>h?(f=h,g=Zd(b,$d(Ud(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=Zd(b,$d(Ud(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function v(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=y(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Nb(a))return!1;w(a)&&(Jb(a),b.dims=H(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFromg&&c.viewTo-g<20&&(g=Math.min(e,c.viewTo)),Df&&(f=pd(a.doc,f),g=qd(a.doc,g));var h=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;Mb(a,f,g),c.viewOffset=$d(Ud(a.doc,c.viewFrom)),a.display.mover.style.top=c.viewOffset+"px";var i=Nb(a);if(!h&&0==i&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;var j=Oe();return i>4&&(c.lineDiv.style.display="none"),I(a,c.updateLineNumbers,b.dims),i>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,j&&Oe()!=j&&j.offsetHeight&&j.focus(),Me(c.cursorDiv),Me(c.selectionDiv),c.gutters.style.height=0,h&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,La(a,400)),c.updateLineNumbers=null,!0}function C(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Ta(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Qa(a.display)-Ua(a),c.top)}),b.visible=u(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&B(a,b);d=!1){F(a);var e=o(a);Ga(a),E(a,e),s(a,e)}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 D(a,b){var c=new z(a,b);if(B(a,c)){F(a),C(a,c);var d=o(a);Ga(a),E(a,d),s(a,d),c.finish()}}function E(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";var c=b.docHeight+a.display.barHeight;a.display.heightForcer.style.top=c+"px",a.display.gutters.style.height=Math.max(c+Sa(a),b.clientHeight)+"px"}function F(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;dnf){var g=f.node.offsetTop+f.node.offsetHeight;e=g-c,c=g}else{var h=f.node.getBoundingClientRect();e=h.bottom-h.top}var i=f.line.height-e;if(2>e&&(e=qb(b)),(i>.001||-.001>i)&&(Xd(f.line,e),G(f.line),f.rest))for(var j=0;j=b&&l.lineNumber;l.changes&&(Ce(l.changes,"gutter")>-1&&(m=!1),J(a,l,j,c)),m&&(Me(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(x(a.options,j)))),h=l.node.nextSibling}else{var n=R(a,l,j,c);g.insertBefore(n,h)}j+=l.size}for(;h;)h=d(h)}function J(a,b,c,d){for(var e=0;enf&&(a.node.style.zIndex=2)),a.node}function L(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=K(a);a.background=c.insertBefore(Le("div",null,b),c.firstChild)}}function M(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Hd(a,b)}function N(a,b){var c=b.text.className,d=M(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,O(b)):c&&(b.text.className=c)}function O(a){L(a),a.line.wrapClass?K(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var b=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=b||""}function P(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);var e=b.line.gutterMarkers;if(a.options.lineNumbers||e){var f=K(b),g=b.gutter=Le("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px");if(a.display.input.setUneditable(g),f.insertBefore(g,b.text),b.line.gutterClass&&(g.className+=" "+b.line.gutterClass),!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(Le("div",x(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),e)for(var h=0;h1&&(Gf&&Gf.join("\n")==b?h=d.ranges.length%Gf.length==0&&De(Gf,Tg):g.length==d.ranges.length&&(h=De(g,function(a){return[a]})));for(var i=d.ranges.length-1;i>=0;i--){var j=d.ranges[i],k=j.from(),l=j.to();j.empty()&&(c&&c>0?k=Ef(k.line,k.ch-c):a.state.overwrite&&!a.state.pasteIncoming&&(l=Ef(l.line,Math.min(Ud(f,l.line).text.length,l.ch+Be(g).length))));var m=a.curOp.updateInput,n={from:k,to:l,text:h?h[i%h.length]:g,origin:e||(a.state.pasteIncoming?"paste":a.state.cutIncoming?"cut":"+input")};vc(a.doc,n),se(a,"inputRead",a,n)}b&&!a.state.pasteIncoming&&_(a,b),Hc(a),a.curOp.updateInput=m,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function _(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=Jc(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(Ud(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Jc(a,e.head.line,"smart"));g&&se(a,"electricInput",a,e.head.line)}}}function aa(a){for(var b=[],c=[],d=0;de?j.map:k[e],g=0;ge?a.line:a.rest[e]),l=f[g]+d;return(0>d||h!=b)&&(l=f[g+(d?1:0)]),Ef(i,l)}}}var e=a.text.firstChild,f=!1;if(!b||!Mg(e,b))return ga(Ef(Yd(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b)){var g=a.rest?Be(a.rest):a.line;return ga(Ef(Yd(g),g.text.length),f)}var h=3==b.nodeType?b:null,i=b;for(h||1!=b.childNodes.length||3!=b.firstChild.nodeType||(h=b.firstChild,c&&(c=h.nodeValue.length));i.parentNode!=e;)i=i.parentNode;var j=a.measure,k=j.maps,l=d(h,i,c);if(l)return ga(l,f);for(var m=i.nextSibling,n=h?h.nodeValue.length-c:0;m;m=m.nextSibling){if(l=d(m,m.firstChild,0))return ga(Ef(l.line,l.ch-n),f);n+=m.textContent.length}for(var o=i.previousSibling,n=c;o;o=o.previousSibling){if(l=d(o,o.firstChild,-1))return ga(Ef(l.line,l.ch+n),f);n+=m.textContent.length}}function ja(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return""==c&&(c=b.textContent.replace(/\u200b/g,"")),void(h+=c);var j,k=b.getAttribute("cm-marker");if(k){var l=a.findMarks(Ef(d,0),Ef(e+1,0),f(+k));return void(l.length&&(j=l[0].find())&&(h+=Vd(a.doc,j.from,j.to).join("\n")))}if("false"==b.getAttribute("contenteditable"))return;for(var m=0;m=0){var g=X(f.from(),e.from()),h=W(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new la(i?h:g,i?g:h))}}return new ka(a,b)}function na(a,b){return new ka([new la(a,b||a)],0)}function oa(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function pa(a,b){if(b.linec?Ef(c,Ud(a,c).text.length):qa(b,Ud(a,b.line).text.length)}function qa(a,b){var c=a.ch;return null==c||c>b?Ef(a.line,b):0>c?Ef(a.line,0):a}function ra(a,b){return b>=a.first&&b=f.ch:j.to>f.ch))){if(d&&(yg(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find(0>g?-1:1);if(0==Ff(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?pa(a,Ef(l.line-1)):null:l.ch>h.text.length&&(l=l.lineb&&(b=0),b=Math.round(b),d=Math.round(d),h.appendChild(Le("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?k-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){function f(c,d){return kb(a,Ef(b,c),"div",l,d)}var h,i,l=Ud(g,b),m=l.text.length;return Xe(_d(l),c||0,null==e?m:e,function(a,b,g){var l,n,o,p=f(a,"left");if(a==b)l=p,n=o=p.left;else{if(l=f(b-1,"right"),"rtl"==g){var q=p;p=l,l=q}n=p.left,o=l.right}null==c&&0==a&&(n=j),l.top-p.top>3&&(d(n,p.top,null,p.bottom),n=j,p.bottomi.bottom||l.bottom==i.bottom&&l.right>i.right)&&(i=l),j+1>n&&(n=j),d(n,l.top,o-n,l.bottom)}),{start:h,end:i}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),i=Ra(a.display),j=i.left,k=Math.max(f.sizerWidth,Ta(a)-f.sizer.offsetLeft)-i.right,l=b.from(),m=b.to();if(l.line==m.line)e(l.line,l.ch,m.ch);else{var n=Ud(g,l.line),o=Ud(g,m.line),p=nd(n)==nd(o),q=e(l.line,l.ch,p?n.text.length+1:null).end,r=e(m.line,p?0:null,m.ch).start;p&&(q.top0?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function La(a,b){a.doc.mode.startState&&a.doc.frontier=a.display.viewTo)){var c=+new Date+a.options.workTime,d=ag(b.mode,Oa(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=Dd(a,f,d,!0);f.styles=h.styles;var i=f.styleClasses,j=h.classes;j?f.styleClasses=j:i&&(f.styleClasses=null);for(var k=!g||g.length!=f.styles.length||i!=j&&(!i||!j||i.bgClass!=j.bgClass||i.textClass!=j.textClass),l=0;!k&&lc?(La(a,a.options.workDelay),!0):void 0}),e.length&&Bb(a,function(){for(var b=0;bg;--h){if(h<=f.first)return f.first;var i=Ud(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Fg(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Oa(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Na(a,b,c),g=f>d.first&&Ud(d,f-1).stateAfter;return g=g?ag(d.mode,g):bg(d.mode),d.iter(f,b,function(c){Fd(a,c.text,g);var h=f==b-1||f%5==0||f>=e.viewFrom&&f2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Wa(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[d],cache:a.measure.caches[d],before:!0}}function Xa(a,b){b=nd(b);var c=Yd(b),d=a.display.externalMeasured=new Fb(a.doc,b,c);d.lineN=c;var e=d.built=Hd(a,d);return d.text=e.pre,Ne(a.display.lineMeasure,e.pre),d}function Ya(a,b,c,d){return _a(a,$a(a,b),c,d)}function Za(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bb?(e=0,f=1,g="left"):j>b?(e=b-i,f=e+1):(h==a.length-3||b==j&&a[h+3]>b)&&(f=j-i,e=f-1,b>=j&&(g="right")),null!=e){if(d=a[h+2],i==j&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;h&&a[h-2]==a[h-3]&&a[h-1].insertLeft;)d=a[(h-=3)+2],g="left";if("right"==c&&e==j-i)for(;hk;k++){for(;h&&Ke(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+inf&&0==h&&i==f.coverEnd-f.coverStart)e=g.parentNode.getBoundingClientRect();else if(mf&&a.options.lineWrapping){var l=Ig(g,h,i).getClientRects();e=l.length?l["right"==d?l.length-1:0]:Kf}else e=Ig(g,h,i).getBoundingClientRect()||Kf;if(e.left||e.right||0==h)break;i=h,h-=1,j="right"}mf&&11>nf&&(e=cb(a.display.measure,e))}else{h>0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(mf&&9>nf&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+rb(a.display),top:m.top,bottom:m.bottom}:Kf}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,k=0;kc.from?g(a-1):g(a,d)}d=d||Ud(a.doc,b.line),e||(e=$a(a,d));var i=_d(d),j=b.ch;if(!i)return g(j);var k=ef(i,j),l=h(j,k);return null!=Yg&&(l.other=h(j,Yg)),l}function mb(a,b){var c=0,b=pa(a.doc,b);a.options.lineWrapping||(c=rb(a.display)*b.ch);var d=Ud(a.doc,b.line),e=$d(d)+Pa(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function nb(a,b,c,d){var e=Ef(a,b);return e.xRel=d,c&&(e.outside=!0),e}function ob(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return nb(d.first,0,!0,-1);var e=Zd(d,c),f=d.first+d.size-1;if(e>f)return nb(d.first+d.size-1,Ud(d,f).text.length,!0,1);0>b&&(b=0);for(var g=Ud(d,e);;){var h=pb(a,g,e,b,c),i=ld(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=Yd(g=j.to.line)}}function pb(a,b,c,d,e){function f(d){var e=lb(a,Ef(c,d),"line",b,j);return h=!0,g>e.bottom?e.left-i:gq)return nb(c,n,r,1);for(;;){if(k?n==m||n==gf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Ke(b.text.charAt(s));)++s;var u=nb(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=gf(b,w,1)}var y=f(w);y>d?(n=w,q=y,(r=h)&&(q+=1e3),l=v):(m=w,o=y,p=h,l-=v)}}function qb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Hf){Hf=Le("pre");for(var b=0;49>b;++b)Hf.appendChild(document.createTextNode("x")),Hf.appendChild(Le("br"));Hf.appendChild(document.createTextNode("x"))}Ne(a.measure,Hf);var c=Hf.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Me(a.measure),c||1}function rb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Le("span","xxxxxxxxxx"),c=Le("pre",[b]);Ne(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function sb(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:++Mf},Lf?Lf.ops.push(a.curOp):a.curOp.ownsGroup=Lf={ops:[a.curOp],delayedCallbacks:[]}}function tb(a){var b=a.delayedCallbacks,c=0;do{for(;c=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new z(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function xb(a){a.updatedDisplay=a.mustUpdate&&B(a.cm,a.update)}function yb(a){var b=a.cm,c=b.display;a.updatedDisplay&&F(b),a.barMeasure=o(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=Ya(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+Sa(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Ta(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection())}function zb(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeftf;f=d){var g=new Fb(a.doc,Ud(a.doc,f),f);d=f+g.size,e.push(g)}return e}function Hb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&cb)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Df&&pd(a.doc,b)e.viewFrom?Jb(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Jb(a);else if(b<=e.viewFrom){var f=Lb(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Jb(a)}else if(c>=e.viewTo){var f=Lb(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Jb(a)}else{var g=Lb(a,b,b,-1),h=Lb(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Gb(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Jb(a)}var i=e.externalMeasured;i&&(c=e.lineN&&b=d.viewTo)){var f=d.view[Kb(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==Ce(g,c)&&g.push(c)}}}function Jb(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Kb(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;db)return d}function Lb(a,b,c,d){var e,f=Kb(a,b),g=a.display.view;if(!Df||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=0,i=a.display.viewFrom;f>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(f==g.length-1)return null;e=i+g[f].size-b,f++}else e=i-b;b+=e,c+=e}for(;pd(a.doc,c)!=c;){if(f==(0>d?0:g.length-1))return null;c+=d*g[f-(0>d?1:0)].size,f+=d}return{index:f,lineN:c}}function Mb(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Gb(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Gb(a,b,d.viewFrom).concat(d.view):d.viewFromc&&(d.view=d.view.slice(0,Kb(a,c)))),d.viewTo=c}function Nb(a){for(var b=a.display.view,c=0,d=0;d400}var e=a.display;wg(e.scroller,"mousedown",Cb(a,Tb)),mf&&11>nf?wg(e.scroller,"dblclick",Cb(a,function(b){if(!ue(a,b)){var c=Sb(a,b);if(c&&!Yb(a,b)&&!Rb(a.display,b)){tg(b);var d=a.findWordAt(c);ua(a.doc,d.anchor,d.head)}}})):wg(e.scroller,"dblclick",function(b){ue(a,b)||tg(b)}),Bf||wg(e.scroller,"contextmenu",function(b){oc(a,b)});var f,g={end:0};wg(e.scroller,"touchstart",function(a){if(!c(a)){clearTimeout(f);var b=+new Date;e.activeTouch={start:b,moved:!1,prev:b-g.end<=300?g:null},1==a.touches.length&&(e.activeTouch.left=a.touches[0].pageX,e.activeTouch.top=a.touches[0].pageY)}}),wg(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),wg(e.scroller,"touchend",function(c){var f=e.activeTouch;if(f&&!Rb(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 la(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new la(Ef(h.line,0),pa(a.doc,Ef(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),tg(c)}b()}),wg(e.scroller,"touchcancel",b),wg(e.scroller,"scroll",function(){e.scroller.clientHeight&&(_b(a,e.scroller.scrollTop),ac(a,e.scroller.scrollLeft,!0),yg(a,"scroll",a))}),wg(e.scroller,"mousewheel",function(b){bc(a,b)}),wg(e.scroller,"DOMMouseScroll",function(b){bc(a,b)}),wg(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={simple:function(b){ue(a,b)||vg(b)},start:function(b){$b(a,b)},drop:Cb(a,Zb)};var h=e.input.getField();wg(h,"keyup",function(b){jc.call(a,b)}),wg(h,"keydown",Cb(a,hc)),wg(h,"keypress",Cb(a,kc)),wg(h,"focus",He(mc,a)),wg(h,"blur",He(nc,a))}function Pb(b,c,d){var e=d&&d!=a.Init;if(!c!=!e){var f=b.display.dragFunctions,g=c?wg:xg;g(b.display.scroller,"dragstart",f.start),g(b.display.scroller,"dragenter",f.simple),g(b.display.scroller,"dragover",f.simple),g(b.display.scroller,"drop",f.drop)}}function Qb(a){var b=a.display;(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)&&(b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize())}function Rb(a,b){for(var c=qe(b);c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function Sb(a,b,c,d){var e=a.display;if(!c&&"true"==qe(b).getAttribute("cm-not-content"))return null;var f,g,h=e.lineSpace.getBoundingClientRect();try{f=b.clientX-h.left,g=b.clientY-h.top}catch(b){return null}var i,j=ob(a,f,g);if(d&&1==j.xRel&&(i=Ud(a.doc,j.line).text).length==j.ch){var k=Fg(i,i.length,a.options.tabSize)-i.length;j=Ef(j.line,Math.max(0,Math.round((f-Ra(a.display).left)/rb(a.display))-k))}return j}function Tb(a){var b=this,c=b.display;if(!(c.activeTouch&&c.input.supportsTouch()||ue(b,a))){if(c.shift=a.shiftKey,Rb(c,a))return void(of||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)));if(!Yb(b,a)){var d=Sb(b,a);switch(window.focus(),re(a)){case 1:d?Ub(b,a,d):qe(a)==c.scroller&&tg(a);break;case 2:of&&(b.state.lastMiddleDown=+new Date),d&&ua(b.doc,d),setTimeout(function(){c.input.focus()},20),tg(a);break;case 3:Bf?oc(b,a):lc(b)}}}}function Ub(a,b,c){mf?setTimeout(He(Y,a),0):a.curOp.focus=Oe();var d,e=+new Date;Jf&&Jf.time>e-400&&0==Ff(Jf.pos,c)?d="triple":If&&If.time>e-400&&0==Ff(If.pos,c)?(d="double",Jf={time:e,pos:c}):(d="single",If={time:e,pos:c});var f,g=a.doc.sel,h=xf?b.metaKey:b.ctrlKey;a.options.dragDrop&&Sg&&!Z(a)&&"single"==d&&(f=g.contains(c))>-1&&!g.ranges[f].empty()?Vb(a,b,c,h):Wb(a,b,c,d,h)}function Vb(a,b,c,d){var e=a.display,f=+new Date,g=Cb(a,function(h){of&&(e.scroller.draggable=!1),a.state.draggingText=!1,xg(document,"mouseup",g),xg(e.scroller,"drop",g),Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)<10&&(tg(h),!d&&+new Date-200=o;o++){var r=Ud(j,o).text,s=ze(r,i,f);i==n?e.push(new la(Ef(o,s),Ef(o,s))):r.length>s&&e.push(new la(Ef(o,s),Ef(o,ze(r,n,f))))}e.length||e.push(new la(c,c)),Aa(j,ma(m.ranges.slice(0,l).concat(e),l),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var t=k,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=a.findWordAt(b);else var w=new la(Ef(b.line,0),pa(j,Ef(b.line+1,0)));Ff(w.anchor,u)>0?(v=w.head,u=X(t.from(),w.anchor)):(v=w.anchor,u=W(t.to(),w.head))}var e=m.ranges.slice(0);e[l]=new la(pa(j,u),v),Aa(j,ma(e,l),Dg)}}function g(b){var c=++s,e=Sb(a,b,!0,"rect"==d);if(e)if(0!=Ff(e,q)){a.curOp.focus=Oe(),f(e);var h=u(i,j);(e.line>=h.to||e.liner.bottom?20:0;k&&setTimeout(Cb(a,function(){s==c&&(i.scroller.scrollTop+=k,g(b))}),50)}}function h(a){s=1/0,tg(a),i.input.focus(),xg(document,"mousemove",t),xg(document,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;tg(b);var k,l,m=j.sel,n=m.ranges;if(e&&!b.shiftKey?(l=j.sel.contains(c),k=l>-1?n[l]:new la(c,c)):(k=j.sel.primary(),l=j.sel.primIndex),b.altKey)d="rect",e||(k=new la(c,c)),c=Sb(a,b,!0,!0),l=-1;else if("double"==d){var o=a.findWordAt(c);k=a.display.shift||j.extend?ta(j,k,o.anchor,o.head):o}else if("triple"==d){var p=new la(Ef(c.line,0),pa(j,Ef(c.line+1,0)));k=a.display.shift||j.extend?ta(j,k,p.anchor,p.head):p}else k=ta(j,k,c);e?-1==l?(l=n.length,Aa(j,ma(n.concat([k]),l),{scroll:!1,origin:"*mouse"})):n.length>1&&n[l].empty()&&"single"==d&&!b.shiftKey?(Aa(j,ma(n.slice(0,l).concat(n.slice(l+1)),0)),m=j.sel):wa(j,l,k,Dg):(l=0,Aa(j,new ka([k],0),Dg),m=j.sel);var q=c,r=i.wrapper.getBoundingClientRect(),s=0,t=Cb(a,function(a){re(a)?g(a):h(a)}),v=Cb(a,h);wg(document,"mousemove",t),wg(document,"mouseup",v)}function Xb(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&tg(b);var h=a.display,i=h.lineDiv.getBoundingClientRect();if(g>i.bottom||!we(a,c))return pe(b);g-=i.top-h.viewOffset;for(var j=0;j=f){var l=Zd(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),pe(b)}}}function Yb(a,b){return Xb(a,b,"gutterClick",!0,se)}function Zb(a){var b=this;if(!ue(b,a)&&!Rb(b.display,a)){tg(a),mf&&(Nf=+new Date);var c=Sb(b,a,!0),d=a.dataTransfer.files;if(c&&!Z(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){var h=new FileReader;h.onload=Cb(b,function(){if(f[d]=h.result,++g==e){c=pa(b.doc,c);var a={from:c,to:c,text:Tg(f.join("\n")),origin:"paste"};vc(b.doc,a),za(b.doc,na(c,Tf(a)))}}),h.readAsText(a)},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(function(){b.display.input.focus()},20);try{var f=a.dataTransfer.getData("Text");if(f){if(b.state.draggingText&&!(xf?a.altKey:a.ctrlKey))var j=b.listSelections();if(Ba(b.doc,na(c,c)),j)for(var i=0;ig.clientWidth||e&&g.scrollHeight>g.clientHeight){if(e&&xf&&of)a:for(var h=b.target,i=f.view;h!=g;h=h.parentNode)for(var j=0;jk?l=Math.max(0,l+k-50):m=Math.min(a.doc.height,m+k+50),D(a,{top:l,bottom:m})}20>Of&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(Pf=(Pf*Of+c)/(Of+1),++Of)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function cc(a,b,c){if("string"==typeof b&&(b=cg[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{Z(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Bg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function dc(a,b,c){for(var d=0;dnf&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=fc(b,a);rf&&(Sf=d?c:null,!d&&88==c&&!Vg&&(xf?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||ic(b)}}function ic(a){function b(a){18!=a.keyCode&&a.altKey||(Pg(c,"CodeMirror-crosshair"),xg(document,"keyup",b),xg(document,"mouseover",b))}var c=a.display.lineDiv;Qg(c,"CodeMirror-crosshair"),wg(document,"keyup",b),wg(document,"mouseover",b)}function jc(a){16==a.keyCode&&(this.doc.sel.shift=!1),ue(this,a)}function kc(a){var b=this;if(!(Rb(b.display,a)||ue(b,a)||a.ctrlKey&&!a.altKey||xf&&a.metaKey)){var c=a.keyCode,d=a.charCode;if(rf&&c==Sf)return Sf=null,void tg(a);if(!rf||a.which&&!(a.which<10)||!fc(b,a)){var e=String.fromCharCode(null==d?c:d);gc(b,a,e)||b.display.input.onKeyPress(a)}}}function lc(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,nc(a))},100)}function mc(a){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(yg(a,"focus",a),a.state.focused=!0,Qg(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),of&&setTimeout(function(){a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Ka(a))}function nc(a){a.state.delayingBlurEvent||(a.state.focused&&(yg(a,"blur",a),a.state.focused=!1,Pg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function oc(a,b){Rb(a.display,b)||pc(a,b)||a.display.input.onContextMenu(b)}function pc(a,b){return we(a,"gutterContextMenu")?Xb(a,b,"gutterContextMenu",!1,yg):!1}function qc(a,b){if(Ff(a,b.from)<0)return a;if(Ff(a,b.to)<=0)return Tf(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+=Tf(b).ch-b.to.ch),Ef(c,d)}function rc(a,b){for(var c=[],d=0;d=0;--e)wc(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else wc(a,b)}}function wc(a,b){if(1!=b.text.length||""!=b.text[0]||0!=Ff(b.from,b.to)){var c=rc(a,b);ee(a,b,c,a.cm?a.cm.curOp.id:NaN),zc(a,b,c,ad(a,b));var d=[];Sd(a,function(a,c){c||-1!=Ce(d,a.history)||(oe(a.history,b),d.push(a.history)),zc(a,b,null,ad(a,b))})}}function xc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i=0;--i){var l=d.changes[i];if(l.origin=b,k&&!uc(a,l,!1))return void(g.length=0);j.push(be(a,l));var m=i?rc(a,l):Be(g);zc(a,l,m,cd(a,l)),!i&&a.cm&&a.cm.scrollIntoView({from:l.from,to:Tf(l)});var n=[];Sd(a,function(a,b){b||-1!=Ce(n,a.history)||(oe(a.history,l),n.push(a.history)),zc(a,l,null,cd(a,l))})}}}}function yc(a,b){if(0!=b&&(a.first+=b,a.sel=new ka(De(a.sel.ranges,function(a){return new la(Ef(a.anchor.line+b,a.anchor.ch),Ef(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Hb(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:Ef(f,Ud(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=Vd(a,b.from,b.to),c||(c=rc(a,b)),a.cm?Ac(a.cm,b,d):Pd(a,b,d),Ba(a,c,Cg)}}function Ac(a,b,c){var d=a.doc,e=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=Yd(nd(Ud(d,g.line))),d.iter(j,h.line+1,function(a){return a==e.maxLine?(i=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&ve(a),Pd(d,b,c,f(a)),a.options.lineWrapping||(d.iter(j,g.line+b.text.length,function(a){var b=l(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,g.line),La(a,400);var k=b.text.length-(h.line-g.line)-1;b.full?Hb(a):g.line!=h.line||1!=b.text.length||Od(a.doc,b)?Hb(a,g.line,h.line+1,k):Ib(a,g.line,"text");var m=we(a,"changes"),n=we(a,"change");if(n||m){var o={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};n&&se(a,"change",a,o),m&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(o)}a.display.selForContextMenu=null}function Bc(a,b,c,d,e){if(d||(d=c),Ff(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=Tg(b)),vc(a,{from:c,to:d,text:b,origin:e})}function Cc(a,b){if(!ue(a,"scrollCursorIntoView")){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!uf){var f=Le("div","​",null,"position: absolute; top: "+(b.top-c.viewOffset-Pa(a.display))+"px; height: "+(b.bottom-b.top+Sa(a)+c.barHeight)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}}function Dc(a,b,c,d){null==d&&(d=0);for(var e=0;5>e;e++){var f=!1,g=lb(a,b),h=c&&c!=b?lb(a,c):g,i=Fc(a,Math.min(g.left,h.left),Math.min(g.top,h.top)-d,Math.max(g.left,h.left),Math.max(g.bottom,h.bottom)+d),j=a.doc.scrollTop,k=a.doc.scrollLeft;if(null!=i.scrollTop&&(_b(a,i.scrollTop),Math.abs(a.doc.scrollTop-j)>1&&(f=!0)),null!=i.scrollLeft&&(ac(a,i.scrollLeft),Math.abs(a.doc.scrollLeft-k)>1&&(f=!0)),!f)break}return g}function Ec(a,b,c,d,e){var f=Fc(a,b,c,d,e);null!=f.scrollTop&&_b(a,f.scrollTop),null!=f.scrollLeft&&ac(a,f.scrollLeft)}function Fc(a,b,c,d,e){var f=a.display,g=qb(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=Ua(a),j={};e-c>i&&(e=c+i);var k=a.doc.height+Qa(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=Ta(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0),q=d-b>p;return q&&(d=b+p),10>b?j.scrollLeft=0:o>b?j.scrollLeft=Math.max(0,b-(q?0:10)):d>p+o-3&&(j.scrollLeft=d+(q?0:10)-p),j}function Gc(a,b,c){(null!=b||null!=c)&&Ic(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Hc(a){Ic(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?Ef(b.line,b.ch-1):b,d=Ef(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Ic(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=mb(a,b.from),d=mb(a,b.to),e=Fc(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function Jc(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Oa(a,b):c="prev");var g=a.options.tabSize,h=Ud(f,b),i=Fg(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==Bg||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?Fg(Ud(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 l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(j/g);n;--n)m+=g,l+=" ";if(j>m&&(l+=Ae(j-m)),l!=k)return Bc(f,l,Ef(b,0),Ef(b,k.length),"+input"),h.stateAfter=null,!0;for(var n=0;n=0;b--)Bc(a.doc,"",d[b].from,d[b].to,"+delete");Hc(a)})}function Mc(a,b,c,d,e){function f(){var b=h+c;return b=a.first+a.size?l=!1:(h=b,k=Ud(a,b))}function g(a){var b=(e?gf:hf)(k,i,c,!0);if(null==b){if(a||!f())return l=!1;i=e?(0>c?_e:$e)(k):0>c?k.text.length:0}else i=b;return!0}var h=b.line,i=b.ch,j=c,k=Ud(a,h),l=!0;if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=a.cm&&a.cm.getHelper(b,"wordChars"),p=!0;!(0>c)||g(!p);p=!1){var q=k.text.charAt(i)||"\n",r=Ie(q,o)?"w":n&&"\n"==q?"n":!n||/\s/.test(q)?null:"p";if(!n||p||r||(r="s"),m&&m!=r){0>c&&(c=1,g());break}if(r&&(m=r),c>0&&!g(!p))break}var s=Fa(a,Ef(h,i),j,!0);return l||(s.hitSide=!0),s}function Nc(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); ++e=b.top+c*(h-(0>c?1.5:.5)*qb(a.display))}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(;;){var i=ob(a,g,e);if(!i.outside)break;if(0>c?0>=e:e>=f.height){i.hitSide=!0;break}e+=5*c}return i}function Oc(b,c,d,e){a.defaults[b]=c,d&&(Vf[b]=e?function(a,b,c){c!=Wf&&d(a,b,c)}:d)}function Pc(a){for(var b,c,d,e,f=a.split(/-(?!$)/),a=f[f.length-1],g=0;g0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Le("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(md(a,b.line,b,c,f)||b.line!=c.line&&md(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");Df=!0}f.addToHistory&&ee(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var h,i=b.line,j=a.cm;if(a.iter(i,c.line+1,function(a){j&&f.collapsed&&!j.options.lineWrapping&&nd(a)==j.display.maxLine&&(h=!0),f.collapsed&&i!=b.line&&Xd(a,0),Zc(a,new Wc(f,i==b.line?b.ch:null,i==c.line?c.ch:null)),++i}),f.collapsed&&a.iter(b.line,c.line+1,function(b){rd(a,b)&&Xd(b,0)}),f.clearOnEnter&&wg(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(Cf=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++ig,f.atomic=!0),j){if(h&&(j.curOp.updateMaxLine=!0),f.collapsed)Hb(j,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(var k=b.line;k<=c.line;k++)Ib(j,k,"text");f.atomic&&Da(j.doc),se(j,"markerAdded",j,f)}return f}function Sc(a,b,c,d,e){d=Ge(d),d.shared=!1;var f=[Rc(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Sd(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Rc(a,pa(a,b),pa(a,c),d,e));for(var i=0;i=b:f.to>b);(d||(d=[])).push(new Wc(g,f.from,i?null:f.to))}}return d}function _c(a,b,c){if(a)for(var d,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 l=0;ll;++l)o.push(p);o.push(i)}return o}function bd(a){for(var b=0;b0)){var k=[i,1],l=Ff(j.from,h.from),m=Ff(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function ed(a){var b=a.markedSpans;if(b){for(var c=0;c=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(Ff(j.to,c)>0||i.marker.inclusiveRight&&e.inclusiveLeft)||k>=0&&(Ff(j.from,d)<0||i.marker.inclusiveLeft&&e.inclusiveRight)))return!0}}}function nd(a){for(var b;b=kd(a);)a=b.find(-1,!0).line;return a}function od(a){for(var b,c;b=ld(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function pd(a,b){var c=Ud(a,b),d=nd(c);return c==d?b:Yd(d)}function qd(a,b){if(b>a.lastLine())return b;var c,d=Ud(a,b);if(!rd(a,d))return b;for(;c=ld(d);)d=c.find(1,!0).line;return Yd(d)+1}function rd(a,b){var c=Df&&b.markedSpans;if(c)for(var d,e=0;ef;f++){e&&(e[0]=a.innerMode(b,d).mode);var g=b.token(c,d);if(c.pos>c.start)return g}throw new Error("Mode "+b.name+" failed to advance stream.")}function Bd(a,b,c,d){function e(a){return{start:l.start,end:l.pos,string:l.current(),type:f||null,state:a?ag(g.mode,k):k}}var f,g=a.doc,h=g.mode;b=pa(g,b);var i,j=Ud(g,b.line),k=Oa(a,b.line,c),l=new hg(j.text,a.options.tabSize);for(d&&(i=[]);(d||l.posa.options.maxHighlightLength?(h=!1,g&&Fd(a,b,d,l.pos),l.pos=b.length,i=null):i=yd(Ad(c,l,d,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;jj;){var d=e[i];d>a&&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,"cm-overlay "+b),i=c+2;else for(;i>c;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"cm-overlay "+b}},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Ed(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=Dd(a,b,b.stateAfter=Oa(a,Yd(b)));b.styles=d.styles,d.classes?b.styleClasses=d.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.frontier&&a.doc.frontier++}return b.styles}function Fd(a,b,c,d){var e=a.doc.mode,f=new hg(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&zd(e,c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)Ad(e,f,c),f.start=f.pos}function Gd(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?og:ng;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Hd(a,b){var c=Le("span",null,null,of?"padding-right: .1px":null),d={pre:Le("pre",[c]),content:c,col:0,pos:0,cm:a,splitSpaces:(mf||of)&&a.getOption("lineWrapping")};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var f,g=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=Jd,Ve(a.display.measure)&&(f=_d(g))&&(d.addToken=Ld(d.addToken,f)),d.map=[];var h=b!=a.display.externalMeasured&&Yd(g);Nd(g,d,Ed(a,g,h)),g.styleClasses&&(g.styleClasses.bgClass&&(d.bgClass=Qe(g.styleClasses.bgClass,d.bgClass||"")),g.styleClasses.textClass&&(d.textClass=Qe(g.styleClasses.textClass,d.textClass||""))),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Ue(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return of&&/\bcm-tab\b/.test(d.content.lastChild.className)&&(d.content.className="cm-tab-wrap-hack"),yg(a,"renderLine",a,b.line,d.pre),d.pre.className&&(d.textClass=Qe(d.pre.className,d.textClass||"")),d}function Id(a){var b=Le("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b.setAttribute("aria-label",b.title),b}function Jd(a,b,c,d,e,f,g){if(b){var h=a.splitSpaces?b.replace(/ {3,}/g,Kd):b,i=a.cm.state.specialChars,j=!1;if(i.test(b))for(var k=document.createDocumentFragment(),l=0;;){i.lastIndex=l;var m=i.exec(b),n=m?m.index-l:b.length-l;if(n){var o=document.createTextNode(h.slice(l,l+n));mf&&9>nf?k.appendChild(Le("span",[o])):k.appendChild(o),a.map.push(a.pos,a.pos+n,o),a.col+=n,a.pos+=n}if(!m)break;if(l+=n+1," "==m[0]){var p=a.cm.options.tabSize,q=p-a.col%p,o=k.appendChild(Le("span",Ae(q),"cm-tab"));o.setAttribute("role","presentation"),o.setAttribute("cm-text"," "),a.col+=q}else{var o=a.cm.options.specialCharPlaceholder(m[0]);o.setAttribute("cm-text",m[0]),mf&&9>nf?k.appendChild(Le("span",[o])):k.appendChild(o),a.col+=1}a.map.push(a.pos,a.pos+1,o),a.pos++}else{a.col+=b.length;var k=document.createTextNode(h);a.map.push(a.pos,a.pos+b.length,k),mf&&9>nf&&(j=!0),a.pos+=b.length}if(c||d||e||j||g){var r=c||"";d&&(r+=d),e&&(r+=e);var s=Le("span",[k],r,g);return f&&(s.title=f),a.content.appendChild(s)}a.content.appendChild(k)}}function Kd(a){for(var b=" ",c=0;cj&&m.from<=j)break}if(m.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,m.to-j),e,f,null,h,i),f=null,d=d.slice(m.to-j),j=m.to}}}function Md(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}function Nd(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=0;to||v.collapsed&&u.to==o&&u.from==o)?(null!=u.to&&u.to!=o&&r>u.to&&(r=u.to,j=""),v.className&&(i+=" "+v.className),v.css&&(h=v.css),v.startStyle&&u.from==o&&(k+=" "+v.startStyle),v.endStyle&&u.to==r&&(j+=" "+v.endStyle),v.title&&!l&&(l=v.title),v.collapsed&&(!m||id(m.marker,v)<0)&&(m=u)):u.from>o&&r>u.from&&(r=u.from)}if(m&&(m.from||0)==o){if(Md(b,(null==m.to?n+1:m.to)-o,m.marker,null==m.from),null==m.to)return;m.to==o&&(m=!1)}if(!m&&s.length)for(var t=0;t=n)break;for(var w=Math.min(n,r);;){if(q){var x=o+q.length;if(!m){var y=x>w?q.slice(0,w-o):q;b.addToken(b,y,g?g+i:i,k,o+y.length==r?j:"",l,h)}if(x>=w){q=q.slice(w-o),o=w;break}o=x,k=""}q=e.slice(f,f=c[p++]),g=Gd(c[p++],b.cm.options)}}else for(var p=1;pc;++c)f.push(new mg(j[c],e(c),d));return f}var h=b.from,i=b.to,j=b.text,k=Ud(a,h.line),l=Ud(a,i.line),m=Be(j),n=e(j.length-1),o=i.line-h.line;if(b.full)a.insert(0,g(0,j.length)),a.remove(j.length,a.size-j.length);else if(Od(a,b)){var p=g(0,j.length-1);f(l,l.text,n),o&&a.remove(h.line,o),p.length&&a.insert(h.line,p)}else if(k==l)if(1==j.length)f(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{var p=g(1,j.length-1);p.push(new mg(m+k.text.slice(i.ch),n,d)),f(k,k.text.slice(0,h.ch)+j[0],e(0)),a.insert(h.line+1,p)}else if(1==j.length)f(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),e(0)),a.remove(h.line+1,o);else{f(k,k.text.slice(0,h.ch)+j[0],e(0)),f(l,m+l.text.slice(i.ch),n);var p=g(1,j.length-1);o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,p)}se(a,"change",a,b)}function Qd(a){this.lines=a,this.parent=null;for(var b=0,c=0;bb||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(f>b){c=e;break}b-=f}return c.lines[b]}function Vd(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function Wd(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function Xd(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function Yd(a){if(null==a.parent)return null;for(var b=a.parent,c=Ce(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function Zd(a,b){var c=a.first;a:do{for(var d=0;db){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;db)break;b-=h}return c+d}function $d(a){a=nd(a);for(var b=0,c=a.parent,d=0;d1&&!a.done[a.done.length-2].ranges?(a.done.pop(),Be(a.done)):void 0}function ee(a,b,c,d){var e=a.history;e.undone.length=0;var f,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=de(e,e.lastOp==d))){var h=Be(f.changes);0==Ff(b.from,b.to)&&0==Ff(b.from,h.to)?h.to=Tf(b):f.changes.push(be(a,b))}else{var i=Be(e.done);for(i&&i.ranges||he(a.sel,e.done),f={changes:[be(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=g,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||yg(a,"historyAdded")}function fe(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 ge(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||fe(a,f,Be(e.done),b))?e.done[e.done.length-1]=b:he(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&ce(e.undone)}function he(a,b){var c=Be(b);c&&c.ranges&&c.equals(a)||b.push(a)}function ie(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 je(a){if(!a)return null;for(var b,c=0;c-1&&(Be(h)[l]=k[l],delete k[l])}}}return e}function me(a,b,c,d){c0}function xe(a){a.prototype.on=function(a,b){wg(this,a,b)},a.prototype.off=function(a,b){xg(this,a,b)}}function ye(){this.id=null}function ze(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function Ae(a){for(;Gg.length<=a;)Gg.push(Be(Gg)+" ");return Gg[a]}function Be(a){return a[a.length-1]}function Ce(a,b){for(var c=0;c-1&&Kg(a)?!0:b.test(a):Kg(a)}function Je(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Ke(a){return a.charCodeAt(0)>=768&&Lg.test(a)}function Le(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);return a}function Ne(a,b){return Me(a).appendChild(b)}function Oe(){return document.activeElement}function Pe(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function Qe(a,b){for(var c=a.split(" "),d=0;d2&&!(mf&&8>nf))}var c=Ng?Le("span","​"):Le("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}function Ve(a){if(null!=Og)return Og;var b=Ne(a,document.createTextNode("AخA")),c=Ig(b,0,1).getBoundingClientRect();if(!c||c.left==c.right)return!1;var d=Ig(b,1,2).getBoundingClientRect();return Og=d.right-c.right<3}function We(a){if(null!=Wg)return Wg;var b=Ne(a,Le("span","x")),c=b.getBoundingClientRect(),d=Ig(b,0,1).getBoundingClientRect();return Wg=Math.abs(c.left-d.left)>1}function Xe(a,b,c,d){if(!a)return d(b,c,"ltr");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"),e=!0)}e||d(b,c,"ltr")}function Ye(a){return a.level%2?a.to:a.from}function Ze(a){return a.level%2?a.from:a.to}function $e(a){var b=_d(a);return b?Ye(b[0]):0}function _e(a){var b=_d(a);return b?Ze(Be(b)):a.text.length}function af(a,b){var c=Ud(a.doc,b),d=nd(c);d!=c&&(b=Yd(d));var e=_d(d),f=e?e[0].level%2?_e(d):$e(d):0;return Ef(b,f)}function bf(a,b){for(var c,d=Ud(a.doc,b);c=ld(d);)d=c.find(1,!0).line,b=null;var e=_d(d),f=e?e[0].level%2?$e(d):_e(d):d.text.length;return Ef(null==b?Yd(d):b,f)}function cf(a,b){var c=af(a,b.line),d=Ud(a.doc,c.line),e=_d(d);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 Ef(c.line,g?0:f)}return c}function df(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function ef(a,b){Yg=null;for(var c,d=0;db)return d;if(e.from==b||e.to==b){if(null!=c)return df(a,e.level,a[c].level)?(e.from!=e.to&&(Yg=c),d):(e.from!=e.to&&(Yg=d),c);c=d}}return c}function ff(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Ke(a.text.charAt(b)));return b}function gf(a,b,c,d){var e=_d(a);if(!e)return hf(a,b,c,d);for(var f=ef(e,b),g=e[f],h=ff(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?ff(a,g.to,-1,d):ff(a,g.from,1,d)}}function hf(a,b,c,d){var e=b+c;if(d)for(;e>0&&Ke(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var jf=/gecko\/\d/i.test(navigator.userAgent),kf=/MSIE \d/.test(navigator.userAgent),lf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mf=kf||lf,nf=mf&&(kf?document.documentMode||6:lf[1]),of=/WebKit\//.test(navigator.userAgent),pf=of&&/Qt\/\d+\.\d+/.test(navigator.userAgent),qf=/Chrome\//.test(navigator.userAgent),rf=/Opera\//.test(navigator.userAgent),sf=/Apple Computer/.test(navigator.vendor),tf=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),uf=/PhantomJS/.test(navigator.userAgent),vf=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),wf=vf||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),xf=vf||/Mac/.test(navigator.platform),yf=/win/i.test(navigator.platform),zf=rf&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);zf&&(zf=Number(zf[1])),zf&&zf>=15&&(rf=!1,of=!0);var Af=xf&&(pf||rf&&(null==zf||12.11>zf)),Bf=jf||mf&&nf>=9,Cf=!1,Df=!1;p.prototype=Ge({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=a.scrollWidth-a.clientWidth+f+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&a.clientHeight>0&&(0==d&&this.overlayHack(),this.checkedOverlay=!0),{right:c?d:0,bottom:b?d:0}},setScrollLeft:function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a)},setScrollTop:function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a)},overlayHack:function(){var a=xf&&!tf?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=a;var b=this,c=function(a){qe(a)!=b.vert&&qe(a)!=b.horiz&&Cb(b.cm,Tb)(a)};wg(this.vert,"mousedown",c),wg(this.horiz,"mousedown",c)},clear:function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)}},p.prototype),q.prototype=Ge({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},q.prototype),a.scrollbarModel={"native":p,"null":q},z.prototype.signal=function(a,b){we(a,b)&&this.events.push(arguments)},z.prototype.finish=function(){for(var a=0;a=9&&c.hasSelection&&(c.hasSelection=null),c.poll()}),wg(f,"paste",function(){if(of&&!d.state.fakedLastChar&&!(new Date-d.state.lastMiddleDown<200)){var a=f.selectionStart,b=f.selectionEnd;f.value+="$",f.selectionEnd=b,f.selectionStart=a,d.state.fakedLastChar=!0}d.state.pasteIncoming=!0,c.fastPoll()}),wg(f,"cut",b),wg(f,"copy",b),wg(a.scroller,"paste",function(b){Rb(a,b)||(d.state.pasteIncoming=!0,c.focus())}),wg(a.lineSpace,"selectstart",function(b){Rb(a,b)||tg(b)}),wg(f,"compositionstart",function(){var a=d.getCursor("from");c.composing={start:a,range:d.markText(a,d.getCursor("to"),{className:"CodeMirror-composing"})}}),wg(f,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},prepareSelection:function(){var a=this.cm,b=a.display,c=a.doc,d=Ha(a);if(a.options.moveInputWithCursor){var e=lb(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},showSelection:function(a){var b=this.cm,c=b.display;Ne(c.cursorDiv,a.cursors),Ne(c.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},reset:function(a){if(!this.contextMenuPending){var b,c,d=this.cm,e=d.doc;if(d.somethingSelected()){this.prevInput="";var f=e.sel.primary();b=Vg&&(f.to().line-f.from().line>100||(c=d.getSelection()).length>1e3);var g=b?"-":c||d.getSelection();this.textarea.value=g,d.state.focused&&Hg(this.textarea),mf&&nf>=9&&(this.hasSelection=g)}else a||(this.prevInput=this.textarea.value="",mf&&nf>=9&&(this.hasSelection=null));this.inaccurateSelection=b}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!wf||Oe()!=this.textarea))try{this.textarea.focus()}catch(a){}},blur:function(){this.textarea.blur(); ++},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var a=this;a.pollingFast||a.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},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)},poll:function(){var a=this.cm,b=this.textarea,c=this.prevInput;if(!a.state.focused||Ug(b)&&!c||Z(a)||a.options.disableInput||a.state.keySeq)return!1;a.state.pasteIncoming&&a.state.fakedLastChar&&(b.value=b.value.substring(0,b.value.length-1),a.state.fakedLastChar=!1);var d=b.value;if(d==c&&!a.somethingSelected())return!1;if(mf&&nf>=9&&this.hasSelection===d||xf&&/[\uf700-\uf7ff]/.test(d))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var e=d.charCodeAt(0);if(8203!=e||c||(c="​"),8666==e)return this.reset(),this.cm.execCommand("undo")}for(var f=0,g=Math.min(c.length,d.length);g>f&&c.charCodeAt(f)==d.charCodeAt(f);)++f;var h=this;return Bb(a,function(){$(a,d.slice(f),c.length-f,null,h.composing?"*compose":null),d.length>1e3||d.indexOf("\n")>-1?b.value=h.prevInput="":h.prevInput=d,h.composing&&(h.composing.range.clear(),h.composing.range=a.markText(h.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){mf&&nf>=9&&(this.hasSelection=null),this.fastPoll()},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.position="relative",g.style.cssText=k,mf&&9>nf&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!mf||mf&&9>nf)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&"​"==d.prevInput?Cb(e,cg.selectAll)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):f.input.reset()};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=Sb(e,a),i=f.scroller.scrollTop;if(h&&!rf){var j=e.options.resetSelectionOnContextMenu;j&&-1==e.doc.sel.contains(h)&&Cb(e,Aa)(e.doc,na(h),Cg);var k=g.style.cssText;if(d.wrapper.style.position="absolute",g.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: "+(mf?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",of)var l=window.scrollY;if(f.input.focus(),of&&window.scrollTo(null,l),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),mf&&nf>=9&&b(),Bf){vg(a);var m=function(){xg(window,"mouseup",m),setTimeout(c,20)};wg(window,"mouseup",m)}else setTimeout(c,50)}},setUneditable:Ee,needsContentAttribute:!1},ca.prototype),ea.prototype=Ge({init:function(a){function b(a){if(d.somethingSelected())Gf=d.getSelections(),"cut"==a.type&&d.replaceSelection("",null,"cut");else{if(!d.options.lineWiseCopyCut)return;var b=aa(d);Gf=b.text,"cut"==a.type&&d.operation(function(){d.setSelections(b.ranges,0,Cg),d.replaceSelection("",null,"cut")})}if(a.clipboardData&&!vf)a.preventDefault(),a.clipboardData.clearData(),a.clipboardData.setData("text/plain",Gf.join("\n"));else{var c=da(),e=c.firstChild;d.display.lineSpace.insertBefore(c,d.display.lineSpace.firstChild),e.value=Gf.join("\n");var f=document.activeElement;Hg(e),setTimeout(function(){d.display.lineSpace.removeChild(c),f.focus()},50)}}var c=this,d=c.cm,e=c.div=a.lineDiv;e.contentEditable="true",ba(e),wg(e,"paste",function(a){var b=a.clipboardData&&a.clipboardData.getData("text/plain");b&&(a.preventDefault(),d.replaceSelection(b,null,"paste"))}),wg(e,"compositionstart",function(a){var b=a.data;if(c.composing={sel:d.doc.sel,data:b,startData:b},b){var e=d.doc.sel.primary(),f=d.getLine(e.head.line),g=f.indexOf(b,Math.max(0,e.head.ch-b.length));g>-1&&g<=e.head.ch&&(c.composing.sel=na(Ef(e.head.line,g),Ef(e.head.line,g+b.length)))}}),wg(e,"compositionupdate",function(a){c.composing.data=a.data}),wg(e,"compositionend",function(a){var b=c.composing;b&&(a.data==b.startData||/\u200b/.test(a.data)||(b.data=a.data),setTimeout(function(){b.handled||c.applyComposition(b),c.composing==b&&(c.composing=null)},50))}),wg(e,"touchstart",function(){c.forceCompositionEnd()}),wg(e,"input",function(){c.composing||c.pollContent()||Bb(c.cm,function(){Hb(d)})}),wg(e,"copy",b),wg(e,"cut",b)},prepareSelection:function(){var a=Ha(this.cm,!1);return a.focus=this.cm.state.focused,a},showSelection:function(a){a&&this.cm.display.view.length&&(a.focus&&this.showPrimarySelection(),this.showMultipleSelections(a))},showPrimarySelection:function(){var a=window.getSelection(),b=this.cm.doc.sel.primary(),c=ha(this.cm,a.anchorNode,a.anchorOffset),d=ha(this.cm,a.focusNode,a.focusOffset);if(!c||c.bad||!d||d.bad||0!=Ff(X(c,d),b.from())||0!=Ff(W(c,d),b.to())){var e=fa(this.cm,b.from()),f=fa(this.cm,b.to());if(e||f){var g=this.cm.display.view,h=a.rangeCount&&a.getRangeAt(0);if(e){if(!f){var i=g[g.length-1].measure,j=i.maps?i.maps[i.maps.length-1]:i.map;f={node:j[j.length-1],offset:j[j.length-2]-j[j.length-3]}}}else e={node:g[0].measure.map[2],offset:0};try{var k=Ig(e.node,e.offset,f.offset,f.node)}catch(l){}k&&(a.removeAllRanges(),a.addRange(k),h&&null==a.anchorNode?a.addRange(h):jf&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var a=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){a.gracePeriod=!1,a.selectionChanged()&&a.cm.operation(function(){a.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(a){Ne(this.cm.display.cursorDiv,a.cursors),Ne(this.cm.display.selectionDiv,a.selection)},rememberSelection:function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode,this.lastAnchorOffset=a.anchorOffset,this.lastFocusNode=a.focusNode,this.lastFocusOffset=a.focusOffset},selectionInEditor:function(){var a=window.getSelection();if(!a.rangeCount)return!1;var b=a.getRangeAt(0).commonAncestorContainer;return Mg(this.div,b)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():Bb(this.cm,function(){b.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,a)},selectionChanged:function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;this.rememberSelection();var c=ha(b,a.anchorNode,a.anchorOffset),d=ha(b,a.focusNode,a.focusOffset);c&&d&&Bb(b,function(){Aa(b.doc,na(c,d),Cg),(c.bad||d.bad)&&(b.curOp.selectionChanged=!0)})}},pollContent:function(){var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),e=c.to();if(d.lineb.viewTo-1)return!1;var f;if(d.line==b.viewFrom||0==(f=Kb(a,d.line)))var g=Yd(b.view[0].line),h=b.view[0].node;else var g=Yd(b.view[f].line),h=b.view[f-1].node.nextSibling;var i=Kb(a,e.line);if(i==b.view.length-1)var j=b.viewTo-1,k=b.view[i].node;else var j=Yd(b.view[i+1].line)-1,k=b.view[i+1].node.previousSibling;for(var l=Tg(ja(a,h,k,g,j)),m=Vd(a.doc,Ef(g,0),Ef(j,Ud(a.doc,j).text.length));l.length>1&&m.length>1;)if(Be(l)==Be(m))l.pop(),m.pop(),j--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,p=l[0],q=m[0],r=Math.min(p.length,q.length);r>n&&p.charCodeAt(n)==q.charCodeAt(n);)++n;for(var s=Be(l),t=Be(m),u=Math.min(s.length-(1==l.length?n:0),t.length-(1==m.length?n:0));u>o&&s.charCodeAt(s.length-o-1)==t.charCodeAt(t.length-o-1);)++o;l[l.length-1]=s.slice(0,s.length-o),l[0]=l[0].slice(n);var v=Ef(g,n),w=Ef(j,m.length?Be(m).length-o:0);return l.length>1||l[0]||Ff(v,w)?(Bc(a.doc,l,v,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(a){a.data&&a.data!=a.startData&&Cb(this.cm,$)(this.cm,a.data,0,a.sel)},setUneditable:function(a){a.setAttribute("contenteditable","false")},onKeyPress:function(a){a.preventDefault(),Cb(this.cm,$)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0)},onContextMenu:Ee,resetPosition:Ee,needsContentAttribute:!0},ea.prototype),a.inputStyles={textarea:ca,contenteditable:ea},ka.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b=0&&Ff(a,d.to())<=0)return c}return-1}},la.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return W(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Hf,If,Jf,Kf={left:0,right:0,top:0,bottom:0},Lf=null,Mf=0,Nf=0,Of=0,Pf=null;mf?Pf=-.53:jf?Pf=15:qf?Pf=-.7:sf&&(Pf=-1/3);var Qf=function(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}};a.wheelEventPixels=function(a){var b=Qf(a);return b.x*=Pf,b.y*=Pf,b};var Rf=new ye,Sf=null,Tf=a.changeEnd=function(a){return a.text?Ef(a.from.line+a.text.length-1,Be(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Vf.hasOwnProperty(a)&&Cb(this,Vf[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](Qc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cc&&(Jc(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Hc(this));else{var f=e.from(),g=e.to(),h=Math.max(c,f.line);c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var i=h;c>i;++i)Jc(this,i,a);var j=this.doc.sel.ranges;0==f.ch&&b.length==j.length&&j[d].from().ch>0&&wa(this.doc,d,new la(f,j[d].to()),Cg)}}}),getTokenAt:function(a,b){return Bd(this,a,b)},getLineTokens:function(a,b){return Bd(this,Ef(a),b,!0)},getTokenTypeAt:function(a){a=pa(this.doc,a);var b,c=Ed(this,Ud(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]h?b:0==h?null:b.slice(0,h-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!_f.hasOwnProperty(b))return c;var d=_f[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;fe&&(a=e,d=!0),c=Ud(this.doc,a)}else c=a;return ib(this,c,{top:0,left:0},b||"page").top+(d?this.doc.height-$d(c):0)},defaultTextHeight:function(){return qb(this.display)},defaultCharWidth:function(){return rb(this.display)},setGutterMarker:Db(function(a,b,c){return Kc(this.doc,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Je(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Db(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Ib(b,d,"gutter"),Je(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),lineInfo:function(a){if("number"==typeof a){if(!ra(this.doc,a))return null;var b=a;if(a=Ud(this.doc,a),!a)return null}else{var b=Yd(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=lb(this,pa(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&&Ec(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Db(hc),triggerOnKeyPress:Db(kc),triggerOnKeyUp:jc,execCommand:function(a){return cg.hasOwnProperty(a)?cg[a](this):void 0},triggerElectric:Db(function(a){_(this,a)}),findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=pa(this.doc,a);b>f&&(g=Mc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Db(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Mc(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Eg)}),deleteH:Db(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Lc(this,function(c){var e=Mc(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=pa(this.doc,a);b>g;++g){var i=lb(this,h,"div");if(null==f?f=i.left:i.left=f,h=Nc(this,i,e,c),h.hitSide)break}return h},moveV:Db(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=lb(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Nc(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Gc(c,null,kb(c,i,"div").top-h.top),i},Eg),e.length)for(var g=0;g0&&h(c.charAt(d-1));)--d;for(;e.5)&&g(this),yg(this,"refresh",this)}),swapDoc:Db(function(a){var b=this.doc;return b.cm=null,Td(this,a),fb(this),this.display.input.reset(),this.scrollTo(a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,se(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}},xe(a);var Uf=a.defaults={},Vf=a.optionHandlers={},Wf=a.Init={toString:function(){return"CodeMirror.Init"}};Oc("value","",function(a,b){a.setValue(b)},!0),Oc("mode",null,function(a,b){a.doc.modeOption=b,c(a)},!0),Oc("indentUnit",2,c,!0),Oc("indentWithTabs",!1),Oc("smartIndent",!0),Oc("tabSize",4,function(a){d(a),fb(a),Hb(a)},!0),Oc("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(b,c,d){b.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),d!=a.Init&&b.refresh()}),Oc("specialCharPlaceholder",Id,function(a){a.refresh()},!0),Oc("electricChars",!0),Oc("inputStyle",wf?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Oc("rtlMoveVisually",!yf),Oc("wholeLineUpdateBefore",!0),Oc("theme","default",function(a){h(a),i(a)},!0),Oc("keyMap","default",function(b,c,d){var e=Qc(c),f=d!=a.Init&&Qc(d);f&&f.detach&&f.detach(b,e),e.attach&&e.attach(b,f||null)}),Oc("extraKeys",null),Oc("lineWrapping",!1,e,!0),Oc("gutters",[],function(a){n(a.options),i(a)},!0),Oc("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?y(a.display)+"px":"0",a.refresh()},!0),Oc("coverGutterNextToScrollbar",!1,function(a){s(a)},!0),Oc("scrollbarStyle","native",function(a){r(a),s(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),Oc("lineNumbers",!1,function(a){n(a.options),i(a)},!0),Oc("firstLineNumber",1,i,!0),Oc("lineNumberFormatter",function(a){return a},i,!0),Oc("showCursorWhenSelecting",!1,Ga,!0),Oc("resetSelectionOnContextMenu",!0),Oc("lineWiseCopyCut",!0),Oc("readOnly",!1,function(a,b){"nocursor"==b?(nc(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||a.display.input.reset())}),Oc("disableInput",!1,function(a,b){b||a.display.input.reset()},!0),Oc("dragDrop",!0,Pb),Oc("cursorBlinkRate",530),Oc("cursorScrollMargin",0),Oc("cursorHeight",1,Ga,!0),Oc("singleCursorHeightPerLine",!0,Ga,!0),Oc("workTime",100),Oc("workDelay",100),Oc("flattenSpans",!0,d,!0),Oc("addModeClass",!1,d,!0),Oc("pollInterval",100),Oc("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),Oc("historyEventDelay",1250),Oc("viewportMargin",10,function(a){a.refresh()},!0),Oc("maxHighlightLength",1e4,d,!0),Oc("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()}),Oc("tabindex",null,function(a,b){a.display.input.getField().tabIndex=b||""}),Oc("autofocus",null);var Xf=a.modes={},Yf=a.mimeModes={};a.defineMode=function(b,c){a.defaults.mode||"null"==b||(a.defaults.mode=b),arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),Xf[b]=c},a.defineMIME=function(a,b){Yf[a]=b},a.resolveMode=function(b){if("string"==typeof b&&Yf.hasOwnProperty(b))b=Yf[b];else if(b&&"string"==typeof b.name&&Yf.hasOwnProperty(b.name)){var c=Yf[b.name];"string"==typeof c&&(c={name:c}),b=Fe(c,b),b.name=c.name}else if("string"==typeof b&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return"string"==typeof b?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=Xf[c.name];if(!d)return a.getMode(b,"text/plain");var e=d(b,c);if(Zf.hasOwnProperty(c.name)){var f=Zf[c.name];for(var g in f)f.hasOwnProperty(g)&&(e.hasOwnProperty(g)&&(e["_"+g]=e[g]),e[g]=f[g])}if(e.name=c.name,c.helperType&&(e.helperType=c.helperType),c.modeProps)for(var g in c.modeProps)e[g]=c.modeProps[g];return e},a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var Zf=a.modeExtensions={};a.extendMode=function(a,b){var c=Zf.hasOwnProperty(a)?Zf[a]:Zf[a]={};Ge(b,c)},a.defineExtension=function(b,c){a.prototype[b]=c},a.defineDocExtension=function(a,b){qg.prototype[a]=b},a.defineOption=Oc;var $f=[];a.defineInitHook=function(a){$f.push(a)};var _f=a.helpers={};a.registerHelper=function(b,c,d){_f.hasOwnProperty(b)||(_f[b]=a[b]={_global:[]}),_f[b][c]=d},a.registerGlobalHelper=function(b,c,d,e){a.registerHelper(b,c,e),_f[b]._global.push({pred:d,val:e})};var ag=a.copyState=function(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},bg=a.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};a.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var cg=a.commands={selectAll:function(a){a.setSelection(Ef(a.firstLine(),0),Ef(a.lastLine()),Cg)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Cg)},killLine:function(a){Lc(a,function(b){if(b.empty()){var c=Ud(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line0)e=new Ef(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),Ef(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=Ud(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+"\n"+g.charAt(g.length-1),Ef(e.line-1,g.length-1),Ef(e.line,1),"+transpose")}c.push(new la(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){Bb(a,function(){for(var b=a.listSelections().length,c=0;b>c;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0),Hc(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},dg=a.keyMap={};dg.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},dg.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},dg.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},dg.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},dg["default"]=xf?dg.macDefault:dg.pcDefault,a.normalizeKeyMap=function(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if("..."==d){delete a[c];continue}for(var e=De(c.split(" "),Pc),f=0;f=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},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);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var ig=0,jg=a.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a,this.id=++ig};xe(jg),jg.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&sb(a),we(this,"clear")){var c=this.find();c&&se(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;fa.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&Hb(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Da(a.doc)),a&&se(a,"markerCleared",a,this),b&&ub(a),this.parent&&this.parent.clear()}},jg.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;ec;++c){var e=this.lines[c];this.height-=e.height,xd(e),se(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;da;++a)if(c(this.lines[a]))return!0}},Rd.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;ca){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Qd))){var h=[];this.collapse(h),this.children=[new Qd(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new Qd(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Rd(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=Ce(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new Rd(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;da){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var pg=0,qg=a.Doc=function(a,b,c){if(!(this instanceof qg))return new qg(a,b,c);null==c&&(c=0),Rd.call(this,[new Qd([new mg("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var d=Ef(c,0);this.sel=na(d),this.history=new ae(null),this.id=++pg,this.modeOption=b,"string"==typeof a&&(a=Tg(a)),Pd(this,{from:d,to:d,text:a}),Aa(this,na(d),Cg)};qg.prototype=Fe(Rd.prototype,{constructor:qg,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d=0;f--)vc(this,d[f]);h?za(this,h):this.cm&&Hc(this.cm)}),undo:Eb(function(){xc(this,"undo")}),redo:Eb(function(){xc(this,"redo")}),undoSelection:Eb(function(){xc(this,"undo",!0)}),redoSelection:Eb(function(){xc(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=pa(this,a),b=pa(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;hi.to||null==i.from&&e!=a.line||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-=e,void++c)}),pa(this,Ef(c,b))},indexFromPos:function(a){a=pa(this,a);var b=a.ch;return a.lineb&&(b=a.from),null!=a.to&&a.toh||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},Gg=[""],Hg=function(a){a.select()};vf?Hg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:mf&&(Hg=function(a){try{a.select()}catch(b){}});var Ig,Jg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Kg=a.isWordChar=function(a){return/\w/.test(a)||a>"€"&&(a.toUpperCase()!=a.toLowerCase()||Jg.test(a))},Lg=/[\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]/;Ig=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(e){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Mg=a.contains=function(a,b){if(3==b.nodeType&&(b=b.parentNode),a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)};mf&&11>nf&&(Oe=function(){try{return document.activeElement}catch(a){return document.body}});var Ng,Og,Pg=a.rmClass=function(a,b){var c=a.className,d=Pe(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+(e?d[1]+e:"")}},Qg=a.addClass=function(a,b){var c=a.className;Pe(b).test(c)||(a.className+=(c?" ":"")+b)},Rg=!1,Sg=function(){if(mf&&9>nf)return!1;var a=Le("div");return"draggable"in a||"dragDrop"in a}(),Tg=a.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},Ug=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},Vg=function(){var a=Le("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),Wg=null,Xg={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};a.keyNames=Xg,function(){for(var a=0;10>a;a++)Xg[a+48]=Xg[a+96]=String(a);for(var a=65;90>=a;a++)Xg[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)Xg[a+111]=Xg[a+63235]="F"+a}();var Yg,Zg=function(){function a(a){return 247>=a?c.charAt(a):a>=1424&&1524>=a?"R":a>=1536&&1773>=a?d.charAt(a-1536):a>=1774&&2220>=a?"r":a>=8192&&8203>=a?"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="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/,j="L";return function(c){if(!e.test(c))return!1;for(var d,k=c.length,l=[],m=0;k>m;++m)l.push(d=a(c.charCodeAt(m)));for(var m=0,n=j;k>m;++m){var d=l[m];"m"==d?l[m]=n:n=d}for(var m=0,o=j;k>m;++m){var d=l[m];"1"==d&&"r"==o?l[m]="n":g.test(d)&&(o=d,"r"==d&&(l[m]="R"))}for(var m=1,n=l[0];k-1>m;++m){var d=l[m];"+"==d&&"1"==n&&"1"==l[m+1]?l[m]="1":","!=d||n!=l[m+1]||"1"!=n&&"n"!=n||(l[m]=n),n=d}for(var m=0;k>m;++m){var d=l[m];if(","==d)l[m]="N";else if("%"==d){for(var p=m+1;k>p&&"%"==l[p];++p);for(var q=m&&"!"==l[m-1]||k>p&&"1"==l[p]?"1":"N",r=m;p>r;++r)l[r]=q;m=p-1}}for(var m=0,o=j;k>m;++m){var d=l[m];"L"==o&&"1"==d?l[m]="L":g.test(d)&&(o=d)}for(var m=0;k>m;++m)if(f.test(l[m])){for(var p=m+1;k>p&&f.test(l[p]);++p);for(var s="L"==(m?l[m-1]:j),t="L"==(k>p?l[p]:j),q=s||t?"L":"R",r=m;p>r;++r)l[r]=q;m=p-1}for(var u,v=[],m=0;k>m;)if(h.test(l[m])){var w=m;for(++m;k>m&&h.test(l[m]);++m);v.push(new b(0,w,m))}else{var x=m,y=v.length;for(++m;k>m&&"L"!=l[m];++m);for(var r=x;m>r;)if(i.test(l[r])){r>x&&v.splice(y,0,new b(1,x,r));var z=r;for(++r;m>r&&i.test(l[r]);++r);v.splice(y,0,new b(2,z,r)),x=r}else++r;m>x&&v.splice(y,0,new b(1,x,m))}return 1==v[0].level&&(u=c.match(/^\s+/))&&(v[0].from=u[0].length,v.unshift(new b(0,0,u[0].length))),1==Be(v).level&&(u=c.match(/\s+$/))&&(Be(v).to-=u[0].length,v.push(new b(0,k-u[0].length,k))),2==v[0].level&&v.unshift(new b(1,v[0].to,v[0].to)),v[0].level!=Be(v).level&&v.push(new b(v[0].level,k,k)),v}}();return a.version="5.3.0",a}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/apl/apl.js b/media/editors/codemirror/mode/apl/apl.js +index 4357bed..caafe4e 100644 +--- a/media/editors/codemirror/mode/apl/apl.js ++++ b/media/editors/codemirror/mode/apl/apl.js +@@ -102,7 +102,7 @@ CodeMirror.defineMode("apl", function() { + }; + }, + token: function(stream, state) { +- var ch, funcName, word; ++ var ch, funcName; + if (stream.eatSpace()) { + return null; + } +@@ -163,7 +163,6 @@ CodeMirror.defineMode("apl", function() { + return "function jot-dot"; + } + stream.eatWhile(/[\w\$_]/); +- word = stream.current(); + state.prev = true; + return "keyword"; + } +diff --git a/media/editors/codemirror/mode/apl/apl.min.js b/media/editors/codemirror/mode/apl/apl.min.js +index 985701d..66fbd5a 100644 +--- a/media/editors/codemirror/mode/apl/apl.min.js ++++ b/media/editors/codemirror/mode/apl/apl.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("apl",function(){var e={".":"innerProduct","\\":"scan","/":"reduce","⌿":"reduce1Axis","⍀":"scan1Axis","¨":"each","⍣":"power"},n={"+":["conjugate","add"],"−":["negate","subtract"],"×":["signOf","multiply"],"÷":["reciprocal","divide"],"⌈":["ceiling","greaterOf"],"⌊":["floor","lesserOf"],"∣":["absolute","residue"],"⍳":["indexGenerate","indexOf"],"?":["roll","deal"],"⋆":["exponentiate","toThePowerOf"],"⍟":["naturalLog","logToTheBase"],"○":["piTimes","circularFuncs"],"!":["factorial","binomial"],"⌹":["matrixInverse","matrixDivide"],"<":[null,"lessThan"],"≤":[null,"lessThanOrEqual"],"=":[null,"equals"],">":[null,"greaterThan"],"≥":[null,"greaterThanOrEqual"],"≠":[null,"notEqual"],"≡":["depth","match"],"≢":[null,"notMatch"],"∈":["enlist","membership"],"⍷":[null,"find"],"∪":["unique","union"],"∩":[null,"intersection"],"∼":["not","without"],"∨":[null,"or"],"∧":[null,"and"],"⍱":[null,"nor"],"⍲":[null,"nand"],"⍴":["shapeOf","reshape"],",":["ravel","catenate"],"⍪":[null,"firstAxisCatenate"],"⌽":["reverse","rotate"],"⊖":["axis1Reverse","axis1Rotate"],"⍉":["transpose",null],"↑":["first","take"],"↓":[null,"drop"],"⊂":["enclose","partitionWithAxis"],"⊃":["diclose","pick"],"⌷":[null,"index"],"⍋":["gradeUp",null],"⍒":["gradeDown",null],"⊤":["encode",null],"⊥":["decode",null],"⍕":["format","formatByExample"],"⍎":["execute",null],"⊣":["stop","left"],"⊢":["pass","right"]},t=/[\.\/⌿⍀¨⍣]/,r=/⍬/,l=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,a=/←/,i=/[⍝#].*$/,o=function(e){var n;return n=!1,function(t){return n=t,t===e?"\\"===n:!0}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(u,s){var c,p,d;return u.eatSpace()?null:(c=u.next(),'"'===c||"'"===c?(u.eatWhile(o(c)),u.next(),s.prev=!0,"string"):/[\[{\(]/.test(c)?(s.prev=!1,null):/[\]}\)]/.test(c)?(s.prev=!0,null):r.test(c)?(s.prev=!1,"niladic"):/[¯\d]/.test(c)?(s.func?(s.func=!1,s.prev=!1):s.prev=!0,u.eatWhile(/[\w\.]/),"number"):t.test(c)?"operator apl-"+e[c]:a.test(c)?"apl-arrow":l.test(c)?(p="apl-",null!=n[c]&&(p+=s.prev?n[c][1]:n[c][0]),s.func=!0,s.prev=!1,"function "+p):i.test(c)?(u.skipToEnd(),"comment"):"∘"===c&&"."===u.peek()?(u.next(),"function jot-dot"):(u.eatWhile(/[\w\$_]/),d=u.current(),s.prev=!0,"keyword"))}}}),e.defineMIME("text/apl","apl")}); +\ 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("apl",function(){var a={".":"innerProduct","\\":"scan","/":"reduce","⌿":"reduce1Axis","⍀":"scan1Axis","¨":"each","⍣":"power"},b={"+":["conjugate","add"],"−":["negate","subtract"],"×":["signOf","multiply"],"÷":["reciprocal","divide"],"⌈":["ceiling","greaterOf"],"⌊":["floor","lesserOf"],"∣":["absolute","residue"],"⍳":["indexGenerate","indexOf"],"?":["roll","deal"],"⋆":["exponentiate","toThePowerOf"],"⍟":["naturalLog","logToTheBase"],"○":["piTimes","circularFuncs"],"!":["factorial","binomial"],"⌹":["matrixInverse","matrixDivide"],"<":[null,"lessThan"],"≤":[null,"lessThanOrEqual"],"=":[null,"equals"],">":[null,"greaterThan"],"≥":[null,"greaterThanOrEqual"],"≠":[null,"notEqual"],"≡":["depth","match"],"≢":[null,"notMatch"],"∈":["enlist","membership"],"⍷":[null,"find"],"∪":["unique","union"],"∩":[null,"intersection"],"∼":["not","without"],"∨":[null,"or"],"∧":[null,"and"],"⍱":[null,"nor"],"⍲":[null,"nand"],"⍴":["shapeOf","reshape"],",":["ravel","catenate"],"⍪":[null,"firstAxisCatenate"],"⌽":["reverse","rotate"],"⊖":["axis1Reverse","axis1Rotate"],"⍉":["transpose",null],"↑":["first","take"],"↓":[null,"drop"],"⊂":["enclose","partitionWithAxis"],"⊃":["diclose","pick"],"⌷":[null,"index"],"⍋":["gradeUp",null],"⍒":["gradeDown",null],"⊤":["encode",null],"⊥":["decode",null],"⍕":["format","formatByExample"],"⍎":["execute",null],"⊣":["stop","left"],"⊢":["pass","right"]},c=/[\.\/⌿⍀¨⍣]/,d=/⍬/,e=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,f=/←/,g=/[⍝#].*$/,h=function(a){var b;return b=!1,function(c){return b=c,c===a?"\\"===b:!0}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(i,j){var k,l;return i.eatSpace()?null:(k=i.next(),'"'===k||"'"===k?(i.eatWhile(h(k)),i.next(),j.prev=!0,"string"):/[\[{\(]/.test(k)?(j.prev=!1,null):/[\]}\)]/.test(k)?(j.prev=!0,null):d.test(k)?(j.prev=!1,"niladic"):/[¯\d]/.test(k)?(j.func?(j.func=!1,j.prev=!1):j.prev=!0,i.eatWhile(/[\w\.]/),"number"):c.test(k)?"operator apl-"+a[k]:f.test(k)?"apl-arrow":e.test(k)?(l="apl-",null!=b[k]&&(l+=j.prev?b[k][1]:b[k][0]),j.func=!0,j.prev=!1,"function "+l):g.test(k)?(i.skipToEnd(),"comment"):"∘"===k&&"."===i.peek()?(i.next(),"function jot-dot"):(i.eatWhile(/[\w\$_]/),j.prev=!0,"keyword"))}}}),a.defineMIME("text/apl","apl")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/asciiarmor/asciiarmor.js b/media/editors/codemirror/mode/asciiarmor/asciiarmor.js +new file mode 100644 +index 0000000..d830903 +--- /dev/null ++++ b/media/editors/codemirror/mode/asciiarmor/asciiarmor.js +@@ -0,0 +1,73 @@ ++// CodeMirror, copyright (c) by Marijn Haverbeke and others ++// Distributed under an MIT license: http://codemirror.net/LICENSE ++ ++(function(mod) { ++ if (typeof exports == "object" && typeof module == "object") // CommonJS ++ mod(require("../../lib/codemirror")); ++ else if (typeof define == "function" && define.amd) // AMD ++ define(["../../lib/codemirror"], mod); ++ else // Plain browser env ++ mod(CodeMirror); ++})(function(CodeMirror) { ++ "use strict"; ++ ++ function errorIfNotEmpty(stream) { ++ var nonWS = stream.match(/^\s*\S/); ++ stream.skipToEnd(); ++ return nonWS ? "error" : null; ++ } ++ ++ CodeMirror.defineMode("asciiarmor", function() { ++ return { ++ token: function(stream, state) { ++ var m; ++ if (state.state == "top") { ++ if (stream.sol() && (m = stream.match(/^-----BEGIN (.*)?-----\s*$/))) { ++ state.state = "headers"; ++ state.type = m[1]; ++ return "tag"; ++ } ++ return errorIfNotEmpty(stream); ++ } else if (state.state == "headers") { ++ if (stream.sol() && stream.match(/^\w+:/)) { ++ state.state = "header"; ++ return "atom"; ++ } else { ++ var result = errorIfNotEmpty(stream); ++ if (result) state.state = "body"; ++ return result; ++ } ++ } else if (state.state == "header") { ++ stream.skipToEnd(); ++ state.state = "headers"; ++ return "string"; ++ } else if (state.state == "body") { ++ if (stream.sol() && (m = stream.match(/^-----END (.*)?-----\s*$/))) { ++ if (m[1] != state.type) return "error"; ++ state.state = "end"; ++ return "tag"; ++ } else { ++ if (stream.eatWhile(/[A-Za-z0-9+\/=]/)) { ++ return null; ++ } else { ++ stream.next(); ++ return "error"; ++ } ++ } ++ } else if (state.state == "end") { ++ return errorIfNotEmpty(stream); ++ } ++ }, ++ blankLine: function(state) { ++ if (state.state == "headers") state.state = "body"; ++ }, ++ startState: function() { ++ return {state: "top", type: null}; ++ } ++ }; ++ }); ++ ++ CodeMirror.defineMIME("application/pgp", "asciiarmor"); ++ CodeMirror.defineMIME("application/pgp-keys", "asciiarmor"); ++ CodeMirror.defineMIME("application/pgp-signature", "asciiarmor"); ++}); +diff --git a/media/editors/codemirror/mode/asciiarmor/asciiarmor.min.js b/media/editors/codemirror/mode/asciiarmor/asciiarmor.min.js +new file mode 100644 +index 0000000..bbddf5d +--- /dev/null ++++ b/media/editors/codemirror/mode/asciiarmor/asciiarmor.min.js +@@ -0,0 +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){var b=a.match(/^\s*\S/);return a.skipToEnd(),b?"error":null}a.defineMode("asciiarmor",function(){return{token:function(a,c){var d;if("top"==c.state)return a.sol()&&(d=a.match(/^-----BEGIN (.*)?-----\s*$/))?(c.state="headers",c.type=d[1],"tag"):b(a);if("headers"==c.state){if(a.sol()&&a.match(/^\w+:/))return c.state="header","atom";var e=b(a);return e&&(c.state="body"),e}return"header"==c.state?(a.skipToEnd(),c.state="headers","string"):"body"==c.state?a.sol()&&(d=a.match(/^-----END (.*)?-----\s*$/))?d[1]!=c.type?"error":(c.state="end","tag"):a.eatWhile(/[A-Za-z0-9+\/=]/)?null:(a.next(),"error"):"end"==c.state?b(a):void 0},blankLine:function(a){"headers"==a.state&&(a.state="body")},startState:function(){return{state:"top",type:null}}}}),a.defineMIME("application/pgp","asciiarmor"),a.defineMIME("application/pgp-keys","asciiarmor"),a.defineMIME("application/pgp-signature","asciiarmor")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/asn.1/asn.1.js b/media/editors/codemirror/mode/asn.1/asn.1.js +new file mode 100644 +index 0000000..9600247 +--- /dev/null ++++ b/media/editors/codemirror/mode/asn.1/asn.1.js +@@ -0,0 +1,204 @@ ++// CodeMirror, copyright (c) by Marijn Haverbeke and others ++// Distributed under an MIT license: http://codemirror.net/LICENSE ++ ++(function(mod) { ++ if (typeof exports == "object" && typeof module == "object") // CommonJS ++ mod(require("../../lib/codemirror")); ++ else if (typeof define == "function" && define.amd) // AMD ++ define(["../../lib/codemirror"], mod); ++ else // Plain browser env ++ mod(CodeMirror); ++})(function(CodeMirror) { ++ "use strict"; ++ ++ CodeMirror.defineMode("asn.1", function(config, parserConfig) { ++ var indentUnit = config.indentUnit, ++ keywords = parserConfig.keywords || {}, ++ cmipVerbs = parserConfig.cmipVerbs || {}, ++ compareTypes = parserConfig.compareTypes || {}, ++ status = parserConfig.status || {}, ++ tags = parserConfig.tags || {}, ++ storage = parserConfig.storage || {}, ++ modifier = parserConfig.modifier || {}, ++ accessTypes = parserConfig.accessTypes|| {}, ++ multiLineStrings = parserConfig.multiLineStrings, ++ indentStatements = parserConfig.indentStatements !== false; ++ var isOperatorChar = /[\|\^]/; ++ var curPunc; ++ ++ function tokenBase(stream, state) { ++ var ch = stream.next(); ++ if (ch == '"' || ch == "'") { ++ state.tokenize = tokenString(ch); ++ return state.tokenize(stream, state); ++ } ++ if (/[\[\]\(\){}:=,;]/.test(ch)) { ++ curPunc = ch; ++ return "punctuation"; ++ } ++ if (ch == "-"){ ++ if (stream.eat("-")) { ++ stream.skipToEnd(); ++ return "comment"; ++ } ++ } ++ if (/\d/.test(ch)) { ++ stream.eatWhile(/[\w\.]/); ++ return "number"; ++ } ++ if (isOperatorChar.test(ch)) { ++ stream.eatWhile(isOperatorChar); ++ return "operator"; ++ } ++ ++ stream.eatWhile(/[\w\-]/); ++ var cur = stream.current(); ++ if (keywords.propertyIsEnumerable(cur)) return "keyword"; ++ if (cmipVerbs.propertyIsEnumerable(cur)) return "variable cmipVerbs"; ++ if (compareTypes.propertyIsEnumerable(cur)) return "atom compareTypes"; ++ if (status.propertyIsEnumerable(cur)) return "comment status"; ++ if (tags.propertyIsEnumerable(cur)) return "variable-3 tags"; ++ if (storage.propertyIsEnumerable(cur)) return "builtin storage"; ++ if (modifier.propertyIsEnumerable(cur)) return "string-2 modifier"; ++ if (accessTypes.propertyIsEnumerable(cur)) return "atom accessTypes"; ++ ++ return "variable"; ++ } ++ ++ function tokenString(quote) { ++ return function(stream, state) { ++ var escaped = false, next, end = false; ++ while ((next = stream.next()) != null) { ++ if (next == quote && !escaped){ ++ var afterNext = stream.peek(); ++ //look if the character if the quote is like the B in '10100010'B ++ if (afterNext){ ++ afterNext = afterNext.toLowerCase(); ++ if(afterNext == "b" || afterNext == "h" || afterNext == "o") ++ stream.next(); ++ } ++ end = true; break; ++ } ++ escaped = !escaped && next == "\\"; ++ } ++ if (end || !(escaped || multiLineStrings)) ++ state.tokenize = null; ++ return "string"; ++ }; ++ } ++ ++ function Context(indented, column, type, align, prev) { ++ this.indented = indented; ++ this.column = column; ++ this.type = type; ++ this.align = align; ++ this.prev = prev; ++ } ++ function pushContext(state, col, type) { ++ var indent = state.indented; ++ if (state.context && state.context.type == "statement") ++ indent = state.context.indented; ++ return state.context = new Context(indent, col, type, null, state.context); ++ } ++ function popContext(state) { ++ var t = state.context.type; ++ if (t == ")" || t == "]" || t == "}") ++ state.indented = state.context.indented; ++ return state.context = state.context.prev; ++ } ++ ++ //Interface ++ return { ++ startState: function(basecolumn) { ++ return { ++ tokenize: null, ++ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), ++ indented: 0, ++ startOfLine: true ++ }; ++ }, ++ ++ token: function(stream, state) { ++ var ctx = state.context; ++ if (stream.sol()) { ++ if (ctx.align == null) ctx.align = false; ++ state.indented = stream.indentation(); ++ state.startOfLine = true; ++ } ++ if (stream.eatSpace()) return null; ++ curPunc = null; ++ var style = (state.tokenize || tokenBase)(stream, state); ++ if (style == "comment") return style; ++ if (ctx.align == null) ctx.align = true; ++ ++ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") ++ && ctx.type == "statement"){ ++ popContext(state); ++ } ++ else if (curPunc == "{") pushContext(state, stream.column(), "}"); ++ else if (curPunc == "[") pushContext(state, stream.column(), "]"); ++ else if (curPunc == "(") pushContext(state, stream.column(), ")"); ++ else if (curPunc == "}") { ++ while (ctx.type == "statement") ctx = popContext(state); ++ if (ctx.type == "}") ctx = popContext(state); ++ while (ctx.type == "statement") ctx = popContext(state); ++ } ++ else if (curPunc == ctx.type) popContext(state); ++ else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") ++ && curPunc != ';') || (ctx.type == "statement" ++ && curPunc == "newstatement"))) ++ pushContext(state, stream.column(), "statement"); ++ ++ state.startOfLine = false; ++ return style; ++ }, ++ ++ electricChars: "{}", ++ lineComment: "--", ++ fold: "brace" ++ }; ++ }); ++ ++ function words(str) { ++ var obj = {}, words = str.split(" "); ++ for (var i = 0; i < words.length; ++i) obj[words[i]] = true; ++ return obj; ++ } ++ ++ CodeMirror.defineMIME("text/x-ttcn-asn", { ++ name: "asn.1", ++ keywords: words("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION" + ++ " REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED" + ++ " WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN" + ++ " IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS" + ++ " MINACCESS MAXACCESS REVISION STATUS DESCRIPTION" + ++ " SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName" + ++ " ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY" + ++ " IMPLIED EXPORTS"), ++ cmipVerbs: words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"), ++ compareTypes: words("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY" + ++ " MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY" + ++ " OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL" + ++ " SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL" + ++ " TEXTUAL-CONVENTION"), ++ status: words("current deprecated mandatory obsolete"), ++ tags: words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS" + ++ " UNIVERSAL"), ++ storage: words("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING" + ++ " UTCTime InterfaceIndex IANAifType CMIP-Attribute" + ++ " REAL PACKAGE PACKAGES IpAddress PhysAddress" + ++ " NetworkAddress BITS BMPString TimeStamp TimeTicks" + ++ " TruthValue RowStatus DisplayString GeneralString" + ++ " GraphicString IA5String NumericString" + ++ " PrintableString SnmpAdminAtring TeletexString" + ++ " UTF8String VideotexString VisibleString StringStore" + ++ " ISO646String T61String UniversalString Unsigned32" + ++ " Integer32 Gauge Gauge32 Counter Counter32 Counter64"), ++ modifier: words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS" + ++ " GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS" + ++ " DEFINED"), ++ accessTypes: words("not-accessible accessible-for-notify read-only" + ++ " read-create read-write"), ++ multiLineStrings: true ++ }); ++}); +diff --git a/media/editors/codemirror/mode/asn.1/asn.min.js b/media/editors/codemirror/mode/asn.1/asn.min.js +new file mode 100644 +index 0000000..7d682f7 +--- /dev/null ++++ b/media/editors/codemirror/mode/asn.1/asn.min.js +@@ -0,0 +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){for(var b={},c=a.split(" "),d=0;d?$/.test(a)?(i.extenExten=!0,i.extenStart=!1,"strong"):(i.extenStart=!1,t.skipToEnd(),"error")):i.extenExten?(i.extenExten=!1,i.extenPriority=!0,t.eatWhile(/[^,]/),i.extenInclude&&(t.skipToEnd(),i.extenPriority=!1,i.extenInclude=!1),i.extenSame&&(i.extenPriority=!1,i.extenSame=!1,i.extenApplication=!0),"tag"):i.extenPriority?(i.extenPriority=!1,i.extenApplication=!0,r=t.next(),i.extenSame?null:(t.eatWhile(/[^,]/),"number")):i.extenApplication?(t.eatWhile(/,/),a=t.current(),","===a?null:(t.eatWhile(/\w/),a=t.current().toLowerCase(),i.extenApplication=!1,-1!==n.indexOf(a)?"def strong":null)):e(t,i)}}}),e.defineMIME("text/x-asterisk","asterisk")}); +\ 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("asterisk",function(){function a(a,d){var e="",f=a.next();if(";"==f)return a.skipToEnd(),"comment";if("["==f)return a.skipTo("]"),a.eat("]"),"header";if('"'==f)return a.skipTo('"'),"string";if("'"==f)return a.skipTo("'"),"string-2";if("#"==f&&(a.eatWhile(/\w/),e=a.current(),-1!==c.indexOf(e)))return a.skipToEnd(),"strong";if("$"==f){var g=a.peek();if("{"==g)return a.skipTo("}"),a.eat("}"),"variable-3"}if(a.eatWhile(/\w/),e=a.current(),-1!==b.indexOf(e)){switch(d.extenStart=!0,e){case"same":d.extenSame=!0;break;case"include":case"switch":case"ignorepat":d.extenInclude=!0}return"atom"}}var b=["exten","same","include","ignorepat","switch"],c=["#include","#exec"],d=["addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi","alarmreceiver","amd","answer","authenticate","background","backgrounddetect","bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent","changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge","congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge","dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility","datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa","dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy","externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif","goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete","ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus","jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme","meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete","minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode","mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish","originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce","parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones","privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten","readfile","receivefax","receivefax","receivefax","record","removequeuemember","resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun","saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax","sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags","setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel","slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground","speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound","speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor","stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec","trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate","vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring","waitforsilence","waitmusiconhold","waituntil","while","zapateller"];return{startState:function(){return{extenStart:!1,extenSame:!1,extenInclude:!1,extenExten:!1,extenPriority:!1,extenApplication:!1}},token:function(b,c){var e="";return b.eatSpace()?null:c.extenStart?(b.eatWhile(/[^\s]/),e=b.current(),/^=>?$/.test(e)?(c.extenExten=!0,c.extenStart=!1,"strong"):(c.extenStart=!1,b.skipToEnd(),"error")):c.extenExten?(c.extenExten=!1,c.extenPriority=!0,b.eatWhile(/[^,]/),c.extenInclude&&(b.skipToEnd(),c.extenPriority=!1,c.extenInclude=!1),c.extenSame&&(c.extenPriority=!1,c.extenSame=!1,c.extenApplication=!0),"tag"):c.extenPriority?(c.extenPriority=!1,c.extenApplication=!0,b.next(),c.extenSame?null:(b.eatWhile(/[^,]/),"number")):c.extenApplication?(b.eatWhile(/,/),e=b.current(),","===e?null:(b.eatWhile(/\w/),e=b.current().toLowerCase(),c.extenApplication=!1,-1!==d.indexOf(e)?"def strong":null)):a(b,c)}}}),a.defineMIME("text/x-asterisk","asterisk")}); +\ 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 e2223cc..c5469eb 100644 +--- a/media/editors/codemirror/mode/clike/clike.js ++++ b/media/editors/codemirror/mode/clike/clike.js +@@ -16,15 +16,18 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, + dontAlignCalls = parserConfig.dontAlignCalls, + keywords = parserConfig.keywords || {}, ++ types = parserConfig.types || {}, + builtin = parserConfig.builtin || {}, + blockKeywords = parserConfig.blockKeywords || {}, ++ defKeywords = parserConfig.defKeywords || {}, + atoms = parserConfig.atoms || {}, + hooks = parserConfig.hooks || {}, + multiLineStrings = parserConfig.multiLineStrings, +- indentStatements = parserConfig.indentStatements !== false; ++ indentStatements = parserConfig.indentStatements !== false, ++ indentSwitch = parserConfig.indentSwitch !== false; + var isOperatorChar = /[+\-*&%=<>!?|\/]/; + +- var curPunc; ++ var curPunc, isDefKeyword; + + function tokenBase(stream, state) { + var ch = stream.next(); +@@ -62,8 +65,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; ++ if (defKeywords.propertyIsEnumerable(cur)) isDefKeyword = true; + return "keyword"; + } ++ if (types.propertyIsEnumerable(cur)) return "variable-3"; + if (builtin.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "builtin"; +@@ -104,9 +109,12 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + this.align = align; + this.prev = prev; + } ++ function isStatement(context) { ++ return context.type == "statement" || context.type == "switchstatement"; ++ } + function pushContext(state, col, type) { + var indent = state.indented; +- if (state.context && state.context.type == "statement") ++ if (state.context && isStatement(state.context)) + indent = state.context.indented; + return state.context = new Context(indent, col, type, null, state.context); + } +@@ -117,6 +125,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + return state.context = state.context.prev; + } + ++ function typeBefore(stream, state) { ++ if (state.prevToken == "variable" || state.prevToken == "variable-3") return true; ++ if (/\S[>*\]]\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true; ++ } ++ + // Interface + + return { +@@ -125,7 +138,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, +- startOfLine: true ++ startOfLine: true, ++ prevToken: null + }; + }, + +@@ -137,41 +151,59 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + state.startOfLine = true; + } + if (stream.eatSpace()) return null; +- curPunc = null; ++ curPunc = isDefKeyword = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + if (ctx.align == null) ctx.align = true; + +- if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state); ++ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && isStatement(ctx)) popContext(state); + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { +- while (ctx.type == "statement") ctx = popContext(state); ++ while (isStatement(ctx)) ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); +- while (ctx.type == "statement") ctx = popContext(state); ++ while (isStatement(ctx)) ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (indentStatements && + (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || +- (ctx.type == "statement" && curPunc == "newstatement"))) +- pushContext(state, stream.column(), "statement"); ++ (isStatement(ctx) && curPunc == "newstatement"))) { ++ var type = "statement" ++ if (curPunc == "newstatement" && indentSwitch && stream.current() == "switch") ++ type = "switchstatement" ++ pushContext(state, stream.column(), type); ++ } ++ ++ if (style == "variable" && ++ ((state.prevToken == "def" || ++ (parserConfig.typeFirstDefinitions && typeBefore(stream, state) && ++ stream.match(/^\s*\(/, false))))) ++ style = "def"; ++ + state.startOfLine = false; ++ state.prevToken = isDefKeyword ? "def" : style; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); +- if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; ++ if (isStatement(ctx) && firstChar == "}") ctx = ctx.prev; + var closing = firstChar == ctx.type; +- if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); +- else if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1); +- else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; +- else return ctx.indented + (closing ? 0 : indentUnit); ++ var switchBlock = ctx.prev && ctx.prev.type == "switchstatement"; ++ if (isStatement(ctx)) ++ return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); ++ if (ctx.align && (!dontAlignCalls || ctx.type != ")")) ++ return ctx.column + (closing ? 0 : 1); ++ if (ctx.type == ")" && !closing) ++ return ctx.indented + statementIndentUnit; ++ ++ return ctx.indented + (closing ? 0 : indentUnit) + ++ (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0); + }, + +- electricChars: "{}", ++ electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{|\})$/ : /^\s*[{}]$/, + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//", +@@ -184,9 +216,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } +- var cKeywords = "auto if break int case long char register continue return default short do sizeof " + +- "double static else struct entry switch extern typedef float union for unsigned " + +- "goto while enum void const signed volatile"; ++ var cKeywords = "auto if break case register continue return default do sizeof " + ++ "static else struct switch extern typedef float union for " + ++ "goto while enum const volatile true false"; ++ var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t"; + + function cppHook(stream, state) { + if (!state.startOfLine) return false; +@@ -206,6 +239,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + return "meta"; + } + ++ function pointerHook(_stream, state) { ++ if (state.prevToken == "variable-3") return "variable-3"; ++ return false; ++ } ++ + function cpp11StringHook(stream, state) { + stream.backUp(1); + // Raw strings. +@@ -263,6 +301,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + words.push(prop); + } + add(mode.keywords); ++ add(mode.types); + add(mode.builtin); + add(mode.atoms); + if (words.length) { +@@ -277,9 +316,14 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + def(["text/x-csrc", "text/x-c", "text/x-chdr"], { + name: "clike", + keywords: words(cKeywords), ++ types: words(cTypes + " 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: words("case do else for if switch while struct"), ++ defKeywords: words("struct"), ++ typeFirstDefinitions: true, + atoms: words("null"), +- hooks: {"#": cppHook}, ++ hooks: {"#": cppHook, "*": pointerHook}, + modeProps: {fold: ["brace", "include"]} + }); + +@@ -290,10 +334,14 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + "this using const_cast inline public throw virtual delete mutable protected " + + "wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final " + + "static_assert override"), ++ types: words(cTypes + "bool wchar_t"), + blockKeywords: words("catch class do else finally for if struct switch try while"), ++ defKeywords: words("class namespace struct enum union"), ++ typeFirstDefinitions: true, + atoms: words("true false null"), + hooks: { + "#": cppHook, ++ "*": pointerHook, + "u": cpp11StringHook, + "U": cpp11StringHook, + "L": cpp11StringHook, +@@ -304,12 +352,16 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + + def("text/x-java", { + name: "clike", +- keywords: words("abstract assert boolean break byte case catch char class const continue default " + +- "do double else enum extends final finally float for goto if implements import " + +- "instanceof int interface long native new package private protected public " + +- "return short static strictfp super switch synchronized this throw throws transient " + +- "try void volatile while"), ++ keywords: words("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"), ++ types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " + ++ "Integer Long Number Object Short String StringBuffer StringBuilder Void"), + blockKeywords: words("catch class do else finally for if switch try while"), ++ defKeywords: words("class interface package enum"), ++ typeFirstDefinitions: true, + atoms: words("true false null"), + hooks: { + "@": function(stream) { +@@ -322,18 +374,20 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + + def("text/x-csharp", { + name: "clike", +- keywords: words("abstract as base break case catch checked class const continue" + ++ keywords: words("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: words("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: words("catch class do else finally for foreach if struct switch try while"), +- builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" + +- " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" + +- " UInt64 bool byte char decimal double short int long object" + +- " sbyte float string ushort uint ulong"), ++ defKeywords: words("class interface namespace struct var"), ++ typeFirstDefinitions: true, + atoms: words("true false null"), + hooks: { + "@": function(stream, state) { +@@ -366,18 +420,21 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + /* scala */ + "abstract case catch class def do else extends false final finally for forSome if " + + "implicit import lazy match new null object override package private protected return " + +- "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " + ++ "sealed super this throw trait try type val var while with yield _ : = => <- <: " + + "<% >: # @ " + + + /* package scala */ + "assert assume require print println printf readLine readBoolean readByte readShort " + + "readChar readInt readLong readFloat readDouble " + + ++ ":: #:: " ++ ), ++ types: words( + "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " + + "Enumeration Equiv Error Exception Fractional Function IndexedSeq 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 :: #:: " + ++ "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " + + + /* package java.lang */ + "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + +@@ -387,8 +444,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + ), + multiLineStrings: true, + blockKeywords: words("catch class do else finally for forSome if match switch try while"), ++ defKeywords: words("class def object package trait type val var"), + atoms: words("true false null"), + indentStatements: false, ++ indentSwitch: false, + hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$_]/); +@@ -403,20 +462,21 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + return "atom"; + } +- } ++ }, ++ modeProps: {closeBrackets: {triples: '"'}} + }); + + def(["x-shader/x-vertex", "x-shader/x-fragment"], { + name: "clike", +- keywords: words("float int bool void " + +- "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " + +- "mat2 mat3 mat4 " + +- "sampler1D sampler2D sampler3D samplerCube " + ++ keywords: words("sampler1D sampler2D sampler3D samplerCube " + + "sampler1DShadow sampler2DShadow " + + "const attribute uniform varying " + + "break continue discard return " + + "for while do if else struct " + + "in out inout"), ++ types: words("float int bool void " + ++ "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " + ++ "mat2 mat3 mat4"), + blockKeywords: words("for while do if else struct"), + builtin: words("radians degrees sin cos tan asin acos atan " + + "pow exp log exp2 sqrt inversesqrt " + +@@ -460,6 +520,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " + + "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " + + "gl_MaxDrawBuffers"), ++ indentSwitch: false, + hooks: {"#": cppHook}, + modeProps: {fold: ["brace", "include"]} + }); +@@ -469,6 +530,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + keywords: words(cKeywords + "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: words(cTypes), + blockKeywords: words("case do else for if switch while struct"), + atoms: words("null"), + hooks: {"#": cppHook}, +@@ -479,6 +541,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { + name: "clike", + keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in " + + "inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"), ++ types: words(cTypes), + atoms: words("YES NO NULL NILL ON OFF"), + hooks: { + "@": function(stream) { +diff --git a/media/editors/codemirror/mode/clike/clike.min.js b/media/editors/codemirror/mode/clike/clike.min.js +index be18619..548e89e 100644 +--- a/media/editors/codemirror/mode/clike/clike.min.js ++++ b/media/editors/codemirror/mode/clike/clike.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=e.split(" "),n=0;n!?|\/]/;return{startState:function(e){return{tokenize:null,context:new i((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;c=null;var o=(t.tokenize||n)(e,t);if("comment"==o||"meta"==o)return o;if(null==r.align&&(r.align=!0),";"!=c&&":"!=c&&","!=c||"statement"!=r.type)if("{"==c)l(t,e.column(),"}");else if("["==c)l(t,e.column(),"]");else if("("==c)l(t,e.column(),")");else if("}"==c){for(;"statement"==r.type;)r=s(t);for("}"==r.type&&(r=s(t));"statement"==r.type;)r=s(t)}else c==r.type?s(t):b&&(("}"==r.type||"top"==r.type)&&";"!=c||"statement"==r.type&&"newstatement"==c)&&l(t,e.column(),"statement");else s(t);return t.startOfLine=!1,o},indent:function(t,r){if(t.tokenize!=n&&null!=t.tokenize)return e.Pass;var o=t.context,a=r&&r.charAt(0);"statement"==o.type&&"}"==a&&(o=o.prev);var i=a==o.type;return"statement"==o.type?o.indented+("{"==a?0:d):!o.align||f&&")"==o.type?")"!=o.type||i?o.indented+(i?0:u):o.indented+d:o.column+(i?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var s="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";i(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:t(s),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),i(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:t(s+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),blockKeywords:t("catch class do else finally for if struct switch try while"),atoms:t("true false null"),hooks:{"#":r,u:n,U:n,L:n,R:n},modeProps:{fold:["brace","include"]}}),i("text/x-java",{name:"clike",keywords:t("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:t("catch class do else finally for if switch try while"),atoms:t("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),i("text/x-csharp",{name:"clike",keywords:t("abstract as 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"),blockKeywords:t("catch class do else finally for foreach if struct switch try while"),builtin:t("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:t("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=o,o(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),i("text/x-scala",{name:"clike",keywords:t("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq 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:t("catch class do else finally for forSome if match switch try while"),atoms:t("true false null"),indentStatements:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return e.match('""')?(t.tokenize=l,t.tokenize(e,t)):!1},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}}}),i(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:t("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:t("for while do if else struct"),builtin:t("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:t("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"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),i("text/x-nesc",{name:"clike",keywords:t(s+"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"),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),i("text/x-objectivec",{name:"clike",keywords:t(s+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),atoms:t("YES NO NULL NILL ON OFF"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":r},modeProps:{fold:"brace"}})}); +\ 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){for(var b={},c=a.split(" "),d=0;d*\]]\s*$|\*$/.test(a.string.slice(0,a.start))?!0:void 0}var l,m,n=b.indentUnit,o=c.statementIndentUnit||n,p=c.dontAlignCalls,q=c.keywords||{},r=c.types||{},s=c.builtin||{},t=c.blockKeywords||{},u=c.defKeywords||{},v=c.atoms||{},w=c.hooks||{},x=c.multiLineStrings,y=c.indentStatements!==!1,z=c.indentSwitch!==!1,A=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new g((a||0)-n,0,"top",!1),indented:0,startOfLine:!0,prevToken:null}},token:function(a,b){var e=b.context;if(a.sol()&&(null==e.align&&(e.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;l=m=null;var f=(b.tokenize||d)(a,b);if("comment"==f||"meta"==f)return f;if(null==e.align&&(e.align=!0),";"!=l&&":"!=l&&","!=l||!h(e)){if("{"==l)i(b,a.column(),"}");else if("["==l)i(b,a.column(),"]");else if("("==l)i(b,a.column(),")");else if("}"==l){for(;h(e);)e=j(b);for("}"==e.type&&(e=j(b));h(e);)e=j(b)}else if(l==e.type)j(b);else if(y&&(("}"==e.type||"top"==e.type)&&";"!=l||h(e)&&"newstatement"==l)){var g="statement";"newstatement"==l&&z&&"switch"==a.current()&&(g="switchstatement"),i(b,a.column(),g)}}else j(b);return"variable"==f&&("def"==b.prevToken||c.typeFirstDefinitions&&k(a,b)&&a.match(/^\s*\(/,!1))&&(f="def"),b.startOfLine=!1,b.prevToken=m?"def":f,f},indent:function(b,c){if(b.tokenize!=d&&null!=b.tokenize)return a.Pass;var e=b.context,f=c&&c.charAt(0);h(e)&&"}"==f&&(e=e.prev);var g=f==e.type,i=e.prev&&"switchstatement"==e.prev.type;return h(e)?e.indented+("{"==f?0:o):!e.align||p&&")"==e.type?")"!=e.type||g?e.indented+(g?0:n)+(g||!i||/^(?:case|default)\b/.test(c)?0:n):e.indented+o:e.column+(g?0:1)},electricInput:z?/^\s*(?:case .*?:|default:|\{|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var j="auto if break case register continue return default do sizeof static else struct switch extern typedef float union for goto while enum const volatile true false",k="int long char short double float unsigned signed void size_t ptrdiff_t";h(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:b(j),types:b(k+" 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:b("case do else for if switch while struct"),defKeywords:b("struct"),typeFirstDefinitions:!0,atoms:b("null"),hooks:{"#":c,"*":d},modeProps:{fold:["brace","include"]}}),h(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:b(j+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:b(k+"bool wchar_t"),blockKeywords:b("catch class do else finally for if struct switch try while"),defKeywords:b("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":c,"*":d,u:e,U:e,L:e,R:e},modeProps:{fold:["brace","include"]}}),h("text/x-java",{name:"clike",keywords:b("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"),types:b("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:b("catch class do else finally for if switch try while"),defKeywords:b("class interface package enum"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),h("text/x-csharp",{name:"clike",keywords:b("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:b("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:b("catch class do else finally for foreach if struct switch try while"),defKeywords:b("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=f,f(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),h("text/x-scala",{name:"clike",keywords:b("abstract case catch class def do else extends false 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:b("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq 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:b("catch class do else finally for forSome if match switch try while"),defKeywords:b("class def object package trait type val var"),atoms:b("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return a.match('""')?(b.tokenize=i,b.tokenize(a,b)):!1},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),h(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:b("for while do if else struct"),builtin:b("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:b("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:{"#":c},modeProps:{fold:["brace","include"]}}),h("text/x-nesc",{name:"clike",keywords:b(j+"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:b(k),blockKeywords:b("case do else for if switch while struct"),atoms:b("null"),hooks:{"#":c},modeProps:{fold:["brace","include"]}}),h("text/x-objectivec",{name:"clike",keywords:b(j+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:b(k),atoms:b("YES NO NULL NILL ON OFF"),hooks:{"@":function(a){return a.eatWhile(/[\w\$]/),"keyword"},"#":c},modeProps:{fold:"brace"}})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/clike/scala.html b/media/editors/codemirror/mode/clike/scala.html +deleted file mode 100644 +index aa04cf0..0000000 +--- a/media/editors/codemirror/mode/clike/scala.html ++++ /dev/null +@@ -1,767 +0,0 @@ +- +- +-CodeMirror: Scala mode +- +- +- +- +- +- +- +- +- +- +-
    +-

    Scala mode

    +-
    +- +-
    +- +- +-
    +diff --git a/media/editors/codemirror/mode/clojure/clojure.js b/media/editors/codemirror/mode/clojure/clojure.js +index c334de7..d531022 100644 +--- a/media/editors/codemirror/mode/clojure/clojure.js ++++ b/media/editors/codemirror/mode/clojure/clojure.js +@@ -234,6 +234,7 @@ CodeMirror.defineMode("clojure", function (options) { + return state.indentStack.indent; + }, + ++ closeBrackets: {pairs: "()[]{}\"\""}, + lineComment: ";;" + }; + }); +diff --git a/media/editors/codemirror/mode/clojure/clojure.min.js b/media/editors/codemirror/mode/clojure/clojure.min.js +index b4be817..5342660 100644 +--- a/media/editors/codemirror/mode/clojure/clojure.min.js ++++ b/media/editors/codemirror/mode/clojure/clojure.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("clojure",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),v=t("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),w=t("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),x={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var q,j=!1;null!=(q=e.next());){if('"'==q&&!j){t.mode=!1;break}j=!j&&"\\"==q}n=c;break;default:var S=e.next();if('"'==S)t.mode="string",n=c;else if("\\"==S)i(e),n=l;else if("'"!=S||x.digit_or_colon.test(e.peek()))if(";"==S)e.skipToEnd(),n=d;else if(o(S,e))n=u;else if("("==S||"["==S||"{"==S){var z,E="",_=e.column();if("("==S)for(;null!=(z=e.eat(x.keyword_char));)E+=z;E.length>0&&(w.propertyIsEnumerable(E)||/^(?:def|with)/.test(E))?r(t,_+y,S):(e.eatSpace(),e.eol()||";"==e.peek()?r(t,_+b,S):r(t,_+e.current().length,S)),e.backUp(e.current().length-1),n=p}else if(")"==S||"]"==S||"}"==S)n=p,null!=t.indentStack&&t.indentStack.type==(")"==S?"(":"]"==S?"[":"{")&&a(t);else{if(":"==S)return e.eatWhile(x.symbol),f;e.eatWhile(x.symbol),n=k&&k.propertyIsEnumerable(e.current())?h:v&&v.propertyIsEnumerable(e.current())?s:g&&g.propertyIsEnumerable(e.current())?f:m}else n=f}return n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},lineComment:";;"}}),e.defineMIME("text/x-clojure","clojure")}); +\ 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("clojure",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),u=b("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),v=b("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),w={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(a,b){if(null==b.indentStack&&a.sol()&&(b.indentation=a.indentation()),a.eatSpace())return null;var c=null;switch(b.mode){case"string":for(var x,y=!1;null!=(x=a.next());){if('"'==x&&!y){b.mode=!1;break}y=!y&&"\\"==x}c=j;break;default:var z=a.next();if('"'==z)b.mode="string",c=j;else if("\\"==z)g(a),c=k;else if("'"!=z||w.digit_or_colon.test(a.peek()))if(";"==z)a.skipToEnd(),c=i;else if(f(z,a))c=m;else if("("==z||"["==z||"{"==z){var A,B="",C=a.column();if("("==z)for(;null!=(A=a.eat(w.keyword_char));)B+=A;B.length>0&&(v.propertyIsEnumerable(B)||/^(?:def|with)/.test(B))?d(b,C+q,z):(a.eatSpace(),a.eol()||";"==a.peek()?d(b,C+r,z):d(b,C+a.current().length,z)),a.backUp(a.current().length-1),c=n}else if(")"==z||"]"==z||"}"==z)c=n,null!=b.indentStack&&b.indentStack.type==(")"==z?"(":"]"==z?"[":"{")&&e(b);else{if(":"==z)return a.eatWhile(w.symbol),l;a.eatWhile(w.symbol),c=t&&t.propertyIsEnumerable(a.current())?o:u&&u.propertyIsEnumerable(a.current())?h:s&&s.propertyIsEnumerable(a.current())?l:p}else c=l}return c},indent:function(a){return null==a.indentStack?a.indentation:a.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:";;"}}),a.defineMIME("text/x-clojure","clojure")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/cmake/cmake.js b/media/editors/codemirror/mode/cmake/cmake.js +new file mode 100644 +index 0000000..9f9eda5 +--- /dev/null ++++ b/media/editors/codemirror/mode/cmake/cmake.js +@@ -0,0 +1,97 @@ ++// CodeMirror, copyright (c) by Marijn Haverbeke and others ++// Distributed under an MIT license: http://codemirror.net/LICENSE ++ ++(function(mod) { ++ if (typeof exports == "object" && typeof module == "object") ++ mod(require("../../lib/codemirror")); ++ else if (typeof define == "function" && define.amd) ++ define(["../../lib/codemirror"], mod); ++ else ++ mod(CodeMirror); ++})(function(CodeMirror) { ++"use strict"; ++ ++CodeMirror.defineMode("cmake", function () { ++ var variable_regex = /({)?[a-zA-Z0-9_]+(})?/; ++ ++ function tokenString(stream, state) { ++ var current, prev, found_var = false; ++ while (!stream.eol() && (current = stream.next()) != state.pending) { ++ if (current === '$' && prev != '\\' && state.pending == '"') { ++ found_var = true; ++ break; ++ } ++ prev = current; ++ } ++ if (found_var) { ++ stream.backUp(1); ++ } ++ if (current == state.pending) { ++ state.continueString = false; ++ } else { ++ state.continueString = true; ++ } ++ return "string"; ++ } ++ ++ function tokenize(stream, state) { ++ var ch = stream.next(); ++ ++ // Have we found a variable? ++ if (ch === '$') { ++ if (stream.match(variable_regex)) { ++ return 'variable-2'; ++ } ++ return 'variable'; ++ } ++ // Should we still be looking for the end of a string? ++ if (state.continueString) { ++ // If so, go through the loop again ++ stream.backUp(1); ++ return tokenString(stream, state); ++ } ++ // Do we just have a function on our hands? ++ // In 'cmake_minimum_required (VERSION 2.8.8)', 'cmake_minimum_required' is matched ++ if (stream.match(/(\s+)?\w+\(/) || stream.match(/(\s+)?\w+\ \(/)) { ++ stream.backUp(1); ++ return 'def'; ++ } ++ if (ch == "#") { ++ stream.skipToEnd(); ++ return "comment"; ++ } ++ // Have we found a string? ++ if (ch == "'" || ch == '"') { ++ // Store the type (single or double) ++ state.pending = ch; ++ // Perform the looping function to find the end ++ return tokenString(stream, state); ++ } ++ if (ch == '(' || ch == ')') { ++ return 'bracket'; ++ } ++ if (ch.match(/[0-9]/)) { ++ return 'number'; ++ } ++ stream.eatWhile(/[\w-]/); ++ return null; ++ } ++ return { ++ startState: function () { ++ var state = {}; ++ state.inDefinition = false; ++ state.inInclude = false; ++ state.continueString = false; ++ state.pending = false; ++ return state; ++ }, ++ token: function (stream, state) { ++ if (stream.eatSpace()) return null; ++ return tokenize(stream, state); ++ } ++ }; ++}); ++ ++CodeMirror.defineMIME("text/x-cmake", "cmake"); ++ ++}); +diff --git a/media/editors/codemirror/mode/cmake/cmake.min.js b/media/editors/codemirror/mode/cmake/cmake.min.js +new file mode 100644 +index 0000000..6d08346 +--- /dev/null ++++ b/media/editors/codemirror/mode/cmake/cmake.min.js +@@ -0,0 +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("cmake",function(){function a(a,b){for(var c,d,e=!1;!a.eol()&&(c=a.next())!=b.pending;){if("$"===c&&"\\"!=d&&'"'==b.pending){e=!0;break}d=c}return e&&a.backUp(1),c==b.pending?b.continueString=!1:b.continueString=!0,"string"}function b(b,d){var e=b.next();return"$"===e?b.match(c)?"variable-2":"variable":d.continueString?(b.backUp(1),a(b,d)):b.match(/(\s+)?\w+\(/)||b.match(/(\s+)?\w+\ \(/)?(b.backUp(1),"def"):"#"==e?(b.skipToEnd(),"comment"):"'"==e||'"'==e?(d.pending=e,a(b,d)):"("==e||")"==e?"bracket":e.match(/[0-9]/)?"number":(b.eatWhile(/[\w-]/),null)}var c=/({)?[a-zA-Z0-9_]+(})?/;return{startState:function(){var a={};return a.inDefinition=!1,a.inInclude=!1,a.continueString=!1,a.pending=!1,a},token:function(a,c){return a.eatSpace()?null:b(a,c)}}}),a.defineMIME("text/x-cmake","cmake")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/cobol/cobol.min.js b/media/editors/codemirror/mode/cobol/cobol.min.js +index 9283fc5..0e2014f 100644 +--- a/media/editors/codemirror/mode/cobol/cobol.min.js ++++ b/media/editors/codemirror/mode/cobol/cobol.min.js +@@ -1 +1 @@ +-!function(E){"object"==typeof exports&&"object"==typeof module?E(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],E):E(CodeMirror)}(function(E){"use strict";E.defineMode("cobol",function(){function E(E){for(var T={},I=E.split(" "),N=0;N >= "),M={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(E,t){if(null==t.indentStack&&E.sol()&&(t.indentation=6),E.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var G=!1;null!=(G=E.next());)if('"'==G||"'"==G){t.mode=!1;break}n=R;break;default:var i=E.next(),B=E.column();if(B>=0&&5>=B)n=D;else if(B>=72&&79>=B)E.skipToEnd(),n=L;else if("*"==i&&6==B)E.skipToEnd(),n=N;else if('"'==i||"'"==i)t.mode="string",n=R;else if("'"!=i||M.digit_or_colon.test(E.peek()))if("."==i)n=S;else if(T(i,E))n=O;else{if(E.current().match(M.symbol))for(;71>B&&void 0!==E.eat(M.symbol);)B++;n=P&&P.propertyIsEnumerable(E.current().toUpperCase())?C:e&&e.propertyIsEnumerable(E.current().toUpperCase())?I:U&&U.propertyIsEnumerable(E.current().toUpperCase())?A:null}else n=A}return n},indent:function(E){return null==E.indentStack?E.indentation:E.indentStack.indent}}}),E.defineMIME("text/x-cobol","cobol")}); +\ 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("cobol",function(){function a(a){for(var b={},c=a.split(" "),d=0;d >= "),o={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(a,p){if(null==p.indentStack&&a.sol()&&(p.indentation=6),a.eatSpace())return null;var q=null;switch(p.mode){case"string":for(var r=!1;null!=(r=a.next());)if('"'==r||"'"==r){p.mode=!1;break}q=e;break;default:var s=a.next(),t=a.column();if(t>=0&&5>=t)q=j;else if(t>=72&&79>=t)a.skipToEnd(),q=i;else if("*"==s&&6==t)a.skipToEnd(),q=d;else if('"'==s||"'"==s)p.mode="string",q=e;else if("'"!=s||o.digit_or_colon.test(a.peek()))if("."==s)q=k;else if(b(s,a))q=g;else{if(a.current().match(o.symbol))for(;71>t&&void 0!==a.eat(o.symbol);)t++;q=m&&m.propertyIsEnumerable(a.current().toUpperCase())?h:n&&n.propertyIsEnumerable(a.current().toUpperCase())?c:l&&l.propertyIsEnumerable(a.current().toUpperCase())?f:null}else q=f}return q},indent:function(a){return null==a.indentStack?a.indentation:a.indentStack.indent}}}),a.defineMIME("text/x-cobol","cobol")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/coffeescript/coffeescript.min.js b/media/editors/codemirror/mode/coffeescript/coffeescript.min.js +index 6023522..b463469 100644 +--- a/media/editors/codemirror/mode/coffeescript/coffeescript.min.js ++++ b/media/editors/codemirror/mode/coffeescript/coffeescript.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("coffeescript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var n=t.scope.offset;if(e.eatSpace()){var r=e.indentation();return r>n&&"coffee"==t.scope.type?"indent":n>r?"dedent":null}n>0&&f(e,t)}if(e.eatSpace())return null;var c=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=i,t.tokenize(e,t);if("#"===c)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var a=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(a=!0),e.match(/^-?\d+\.\d*/)&&(a=!0),e.match(/^-?\.\d+/)&&(a=!0),a)return"."==e.peek()&&e.backUp(1),"number";var h=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(h=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(h=!0),e.match(/^-?0(?![\dx])/i)&&(h=!0),h)return"number"}if(e.match(y))return t.tokenize=o(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=o(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(s)||e.match(m)?"operator":e.match(u)?"punctuation":e.match(z)?"atom":e.match(k)?"keyword":e.match(l)?"variable":e.match(d)?"property":(e.next(),p)}function o(e,n,o){return function(i,c){for(;!i.eol();)if(i.eatWhile(/[^'"\/\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return o}else{if(i.match(e))return c.tokenize=r,o;i.eat(/['"\/]/)}return n&&(t.singleLineStringErrors?o=p:c.tokenize=r),o}}function i(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=r;break}e.eatWhile("#")}return"comment"}function c(t,n,r){r=r||"coffee";for(var o=0,i=!1,c=null,f=n.scope;f;f=f.prev)if("coffee"===f.type||"}"==f.type){o=f.offset+e.indentUnit;break}"coffee"!==r?(i=null,c=t.column()+t.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:o,type:r,prev:n.scope,align:i,alignOffset:c}}function f(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var n=e.indentation(),r=!1,o=t.scope;o;o=o.prev)if(n===o.offset){r=!0;break}if(!r)return!0;for(;t.scope.prev&&t.scope.offset!==n;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function a(e,t){var n=t.tokenize(e,t),r=e.current();if("."===r)return n=t.tokenize(e,t),r=e.current(),/^\.[\w$]+$/.test(r)?"variable":p;"return"===r&&(t.dedent=!0),("->"!==r&&"=>"!==r||t.lambda||e.peek())&&"indent"!==n||c(e,t);var o="[({".indexOf(r);if(-1!==o&&c(e,t,"])}".slice(o,o+1)),h.exec(r)&&c(e,t),"then"==r&&f(e,t),"dedent"===n&&f(e,t))return p;if(o="])}".indexOf(r),-1!==o){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==r&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),n}var p="error",s=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,u=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,l=/^[_A-Za-z$][_A-Za-z$0-9]*/,d=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,m=n(["and","or","not","is","isnt","in","instanceof","typeof"]),h=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],v=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],k=n(h.concat(v));h=n(h);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,g=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],z=n(g),x={startState:function(e){return{tokenize:r,scope:{offset:e||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=null===t.scope.align&&t.scope;n&&e.sol()&&(n.align=!1);var r=a(e,t);return n&&r&&"comment"!=r&&(n.align=!0),t.lastToken={style:r,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),r},indent:function(e,t){if(e.tokenize!=r)return 0;var n=e.scope,o=t&&"])}".indexOf(t.charAt(0))>-1;if(o)for(;"coffee"==n.type&&n.prev;)n=n.prev;var i=o&&n.type===t.charAt(0);return n.align?n.alignOffset-(i?1:0):(i?n.prev:n).offset},lineComment:"#",fold:"indent"};return x}),e.defineMIME("text/x-coffeescript","coffeescript")}); +\ 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("coffeescript",function(a,b){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function d(a,b){if(a.sol()){null===b.scope.align&&(b.scope.align=!1);var c=b.scope.offset;if(a.eatSpace()){var d=a.indentation();return d>c&&"coffee"==b.scope.type?"indent":c>d?"dedent":null}c>0&&h(a,b)}if(a.eatSpace())return null;var g=a.peek();if(a.match("####"))return a.skipToEnd(),"comment";if(a.match("###"))return b.tokenize=f,b.tokenize(a,b);if("#"===g)return a.skipToEnd(),"comment";if(a.match(/^-?[0-9\.]/,!1)){var i=!1;if(a.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),a.match(/^-?\d+\.\d*/)&&(i=!0),a.match(/^-?\.\d+/)&&(i=!0),i)return"."==a.peek()&&a.backUp(1),"number";var p=!1;if(a.match(/^-?0x[0-9a-f]+/i)&&(p=!0),a.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(p=!0),a.match(/^-?0(?![\dx])/i)&&(p=!0),p)return"number"}if(a.match(s))return b.tokenize=e(a.current(),!1,"string"),b.tokenize(a,b);if(a.match(t)){if("/"!=a.current()||a.match(/^.*\//,!1))return b.tokenize=e(a.current(),!0,"string-2"),b.tokenize(a,b);a.backUp(1)}return a.match(k)||a.match(o)?"operator":a.match(l)?"punctuation":a.match(v)?"atom":a.match(r)?"keyword":a.match(m)?"variable":a.match(n)?"property":(a.next(),j)}function e(a,c,e){return function(f,g){for(;!f.eol();)if(f.eatWhile(/[^'"\/\\]/),f.eat("\\")){if(f.next(),c&&f.eol())return e}else{if(f.match(a))return g.tokenize=d,e;f.eat(/['"\/]/)}return c&&(b.singleLineStringErrors?e=j:g.tokenize=d),e}}function f(a,b){for(;!a.eol();){if(a.eatWhile(/[^#]/),a.match("###")){b.tokenize=d;break}a.eatWhile("#")}return"comment"}function g(b,c,d){d=d||"coffee";for(var e=0,f=!1,g=null,h=c.scope;h;h=h.prev)if("coffee"===h.type||"}"==h.type){e=h.offset+a.indentUnit;break}"coffee"!==d?(f=null,g=b.column()+b.current().length):c.scope.align&&(c.scope.align=!1),c.scope={offset:e,type:d,prev:c.scope,align:f,alignOffset:g}}function h(a,b){if(b.scope.prev){if("coffee"===b.scope.type){for(var c=a.indentation(),d=!1,e=b.scope;e;e=e.prev)if(c===e.offset){d=!0;break}if(!d)return!0;for(;b.scope.prev&&b.scope.offset!==c;)b.scope=b.scope.prev;return!1}return b.scope=b.scope.prev,!1}}function i(a,b){var c=b.tokenize(a,b),d=a.current();if("."===d)return c=b.tokenize(a,b),d=a.current(),/^\.[\w$]+$/.test(d)?"variable":j;"return"===d&&(b.dedent=!0),("->"!==d&&"=>"!==d||b.lambda||a.peek())&&"indent"!==c||g(a,b);var e="[({".indexOf(d);if(-1!==e&&g(a,b,"])}".slice(e,e+1)),p.exec(d)&&g(a,b),"then"==d&&h(a,b),"dedent"===c&&h(a,b))return j;if(e="])}".indexOf(d),-1!==e){for(;"coffee"==b.scope.type&&b.scope.prev;)b.scope=b.scope.prev;b.scope.type==d&&(b.scope=b.scope.prev)}return b.dedent&&a.eol()&&("coffee"==b.scope.type&&b.scope.prev&&(b.scope=b.scope.prev),b.dedent=!1),c}var j="error",k=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,l=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,m=/^[_A-Za-z$][_A-Za-z$0-9]*/,n=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,o=c(["and","or","not","is","isnt","in","instanceof","typeof"]),p=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],q=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],r=c(p.concat(q));p=c(p);var s=/^('{3}|\"{3}|['\"])/,t=/^(\/{3}|\/)/,u=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],v=c(u),w={startState:function(a){return{tokenize:d,scope:{offset:a||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=null===b.scope.align&&b.scope;c&&a.sol()&&(c.align=!1);var d=i(a,b);return c&&d&&"comment"!=d&&(c.align=!0),b.lastToken={style:d,content:a.current()},a.eol()&&a.lambda&&(b.lambda=!1),d},indent:function(a,b){if(a.tokenize!=d)return 0;var c=a.scope,e=b&&"])}".indexOf(b.charAt(0))>-1;if(e)for(;"coffee"==c.type&&c.prev;)c=c.prev;var f=e&&c.type===b.charAt(0);return c.align?c.alignOffset-(f?1:0):(f?c.prev:c).offset},lineComment:"#",fold:"indent"};return w}),a.defineMIME("text/x-coffeescript","coffeescript")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/commonlisp/commonlisp.js b/media/editors/codemirror/mode/commonlisp/commonlisp.js +index 5f50b35..fb1f99c 100644 +--- a/media/editors/codemirror/mode/commonlisp/commonlisp.js ++++ b/media/editors/codemirror/mode/commonlisp/commonlisp.js +@@ -111,6 +111,7 @@ CodeMirror.defineMode("commonlisp", function (config) { + return typeof i == "number" ? i : state.ctx.start + 1; + }, + ++ closeBrackets: {pairs: "()[]{}\"\""}, + lineComment: ";;", + blockCommentStart: "#|", + blockCommentEnd: "|#" +diff --git a/media/editors/codemirror/mode/commonlisp/commonlisp.min.js b/media/editors/codemirror/mode/commonlisp/commonlisp.min.js +index a3cea6f..3e2e47d 100644 +--- a/media/editors/codemirror/mode/commonlisp/commonlisp.min.js ++++ b/media/editors/codemirror/mode/commonlisp/commonlisp.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("commonlisp",function(t){function e(t){for(var e;e=t.next();)if("\\"==e)t.next();else if(!a.test(e)){t.backUp(1);break}return t.current()}function n(t,n){if(t.eatSpace())return i="ws",null;if(t.match(u))return"number";var a=t.next();if("\\"==a&&(a=t.next()),'"'==a)return(n.tokenize=r)(t,n);if("("==a)return i="open","bracket";if(")"==a||"]"==a)return i="close","bracket";if(";"==a)return t.skipToEnd(),i="ws","comment";if(/['`,@]/.test(a))return null;if("|"==a)return t.skipTo("|")?(t.next(),"symbol"):(t.skipToEnd(),"error");if("#"==a){var a=t.next();return"["==a?(i="open","bracket"):/[+\-=\.']/.test(a)?null:/\d/.test(a)&&t.match(/^\d*#/)?null:"|"==a?(n.tokenize=o)(t,n):":"==a?(e(t),"meta"):"error"}var f=e(t);return"."==f?null:(i="symbol","nil"==f||"t"==f||":"==f.charAt(0)?"atom":"open"==n.lastType&&(l.test(f)||c.test(f))?"keyword":"&"==f.charAt(0)?"variable-2":"variable")}function r(t,e){for(var r,o=!1;r=t.next();){if('"'==r&&!o){e.tokenize=n;break}o=!o&&"\\"==r}return"string"}function o(t,e){for(var r,o;r=t.next();){if("#"==r&&"|"==o){e.tokenize=n;break}o=r}return i="ws","comment"}var i,l=/^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/,c=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,u=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,a=/[^\s'`,@()\[\]";]/;return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastType:null,tokenize:n}},token:function(e,n){e.sol()&&"number"!=typeof n.ctx.indentTo&&(n.ctx.indentTo=n.ctx.start+1),i=null;var r=n.tokenize(e,n);return"ws"!=i&&(null==n.ctx.indentTo?n.ctx.indentTo="symbol"==i&&c.test(e.current())?n.ctx.start+t.indentUnit:"next":"next"==n.ctx.indentTo&&(n.ctx.indentTo=e.column()),n.lastType=i),"open"==i?n.ctx={prev:n.ctx,start:e.column(),indentTo:null}:"close"==i&&(n.ctx=n.ctx.prev||n.ctx),r},indent:function(t){var e=t.ctx.indentTo;return"number"==typeof e?e:t.ctx.start+1},lineComment:";;",blockCommentStart:"#|",blockCommentEnd:"|#"}}),t.defineMIME("text/x-common-lisp","commonlisp")}); +\ 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("commonlisp",function(a){function b(a){for(var b;b=a.next();)if("\\"==b)a.next();else if(!j.test(b)){a.backUp(1);break}return a.current()}function c(a,c){if(a.eatSpace())return f="ws",null;if(a.match(i))return"number";var j=a.next();if("\\"==j&&(j=a.next()),'"'==j)return(c.tokenize=d)(a,c);if("("==j)return f="open","bracket";if(")"==j||"]"==j)return f="close","bracket";if(";"==j)return a.skipToEnd(),f="ws","comment";if(/['`,@]/.test(j))return null;if("|"==j)return a.skipTo("|")?(a.next(),"symbol"):(a.skipToEnd(),"error");if("#"==j){var j=a.next();return"["==j?(f="open","bracket"):/[+\-=\.']/.test(j)?null:/\d/.test(j)&&a.match(/^\d*#/)?null:"|"==j?(c.tokenize=e)(a,c):":"==j?(b(a),"meta"):"error"}var k=b(a);return"."==k?null:(f="symbol","nil"==k||"t"==k||":"==k.charAt(0)?"atom":"open"==c.lastType&&(g.test(k)||h.test(k))?"keyword":"&"==k.charAt(0)?"variable-2":"variable")}function d(a,b){for(var d,e=!1;d=a.next();){if('"'==d&&!e){b.tokenize=c;break}e=!e&&"\\"==d}return"string"}function e(a,b){for(var d,e;d=a.next();){if("#"==d&&"|"==e){b.tokenize=c;break}e=d}return f="ws","comment"}var f,g=/^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/,h=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,i=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,j=/[^\s'`,@()\[\]";]/;return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastType:null,tokenize:c}},token:function(b,c){b.sol()&&"number"!=typeof c.ctx.indentTo&&(c.ctx.indentTo=c.ctx.start+1),f=null;var d=c.tokenize(b,c);return"ws"!=f&&(null==c.ctx.indentTo?"symbol"==f&&h.test(b.current())?c.ctx.indentTo=c.ctx.start+a.indentUnit:c.ctx.indentTo="next":"next"==c.ctx.indentTo&&(c.ctx.indentTo=b.column()),c.lastType=f),"open"==f?c.ctx={prev:c.ctx,start:b.column(),indentTo:null}:"close"==f&&(c.ctx=c.ctx.prev||c.ctx),d},indent:function(a,b){var c=a.ctx.indentTo;return"number"==typeof c?c:a.ctx.start+1},closeBrackets:{pairs:'()[]{}""'},lineComment:";;",blockCommentStart:"#|",blockCommentEnd:"|#"}}),a.defineMIME("text/x-common-lisp","commonlisp")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/css/css.js b/media/editors/codemirror/mode/css/css.js +index 34355aa..1e6d2dd 100644 +--- a/media/editors/codemirror/mode/css/css.js ++++ b/media/editors/codemirror/mode/css/css.js +@@ -239,6 +239,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { + if (type == "{" || type == "}") return popAndPass(type, stream, state); + if (type == ")") return popContext(state); + if (type == "(") return pushContext(state, stream, "parens"); ++ if (type == "interpolation") return pushContext(state, stream, "interpolation"); + if (type == "word") wordAsValue(stream); + return "parens"; + }; +@@ -327,7 +328,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) { + states.interpolation = function(type, stream, state) { + if (type == "}") return popContext(state); + if (type == "{" || type == ";") return popAndPass(type, stream, state); +- if (type != "variable") override = "error"; ++ if (type == "word") override = "variable"; ++ else if (type != "variable" && type != "(" && type != ")") override = "error"; + return "interpolation"; + }; + +@@ -651,16 +653,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) { + return ["comment", "comment"]; + } + +- function tokenSGMLComment(stream, state) { +- if (stream.skipTo("-->")) { +- stream.match("-->"); +- state.tokenize = null; +- } else { +- stream.skipToEnd(); +- } +- return ["comment", "comment"]; +- } +- + CodeMirror.defineMIME("text/css", { + documentTypes: documentTypes, + mediaTypes: mediaTypes, +@@ -672,11 +664,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) { + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + tokenHooks: { +- "<": function(stream, state) { +- if (!stream.match("!--")) return false; +- state.tokenize = tokenSGMLComment; +- return tokenSGMLComment(stream, state); +- }, + "/": function(stream, state) { + if (!stream.eat("*")) return false; + state.tokenize = tokenCComment; +@@ -749,6 +736,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { + } + }, + "@": function(stream) { ++ if (stream.eat("{")) return [null, "interpolation"]; + if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false; + stream.eatWhile(/[\w\\\-]/); + if (stream.match(/^\s*:/, false)) +diff --git a/media/editors/codemirror/mode/css/css.min.js b/media/editors/codemirror/mode/css/css.min.js +index e819816..7257db3 100644 +--- a/media/editors/codemirror/mode/css/css.min.js ++++ b/media/editors/codemirror/mode/css/css.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r")?(e.match("-->"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}e.defineMode("css",function(t,r){function o(e,t){return m=t,e}function a(e,t){var r=e.next();if(b[r]){var a=b[r](e,t);if(a!==!1)return a}return"@"==r?(e.eatWhile(/[\w\\\-]/),o("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?o(null,"compare"):'"'==r||"'"==r?(t.tokenize=i(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),o("atom","hash")):"!"==r?(e.match(/^\s*\w*/),o("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),o("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?o(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?o(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=n,o("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),o("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?o("variable-2","variable-definition"):o("variable-2","variable")):e.match(/^\w+-/)?o("meta","meta"):void 0}function i(e){return function(t,r){for(var a,i=!1;null!=(a=t.next());){if(a==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==a}return(a==e||!i&&")"!=e)&&(r.tokenize=null),o("string","string")}}function n(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:i(")"),o(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r){return e.context=new l(r,t.indentation()+g,e.context),r}function c(e){return e.context=e.context.prev,e.context.type}function d(e,t,r){return K[r.context.type](e,t,r)}function u(e,t,r,o){for(var a=o||1;a>0;a--)r.context=r.context.prev;return d(e,t,r)}function p(e){var t=e.current().toLowerCase();h=j.hasOwnProperty(t)?"atom":q.hasOwnProperty(t)?"keyword":"variable"}r.propertyKeywords||(r=e.resolveMode("text/css"));var m,h,g=t.indentUnit,b=r.tokenHooks,f=r.documentTypes||{},k=r.mediaTypes||{},y=r.mediaFeatures||{},w=r.propertyKeywords||{},v=r.nonStandardPropertyKeywords||{},x=r.fontProperties||{},z=r.counterDescriptors||{},q=r.colorKeywords||{},j=r.valueKeywords||{},P=r.allowNested,K={};return K.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(/@(media|supports|(-moz-)?document)/.test(e))return s(r,t,"atBlock");if(/@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(P&&"("==e)return s(r,t,"parens")}return r.context.type},K.block=function(e,t,r){if("word"==e){var o=t.current().toLowerCase();return w.hasOwnProperty(o)?(h="property","maybeprop"):v.hasOwnProperty(o)?(h="string-2","maybeprop"):P?(h=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(h+=" error","maybeprop")}return"meta"==e?"block":P||"hash"!=e&&"qualifier"!=e?K.top(e,t,r):(h="error","block")},K.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):d(e,t,r)},K.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&P)return s(r,t,"propBlock");if("}"==e||"{"==e)return u(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)p(t);else if("interpolation"==e)return s(r,t,"interpolation")}else h+=" error";return"prop"},K.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(h="property","maybeprop"):r.context.type},K.parens=function(e,t,r){return"{"==e||"}"==e?u(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):("word"==e&&p(t),"parens")},K.pseudo=function(e,t,r){return"word"==e?(h="variable-3",r.context.type):d(e,t,r)},K.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e)return u(e,t,r);if("{"==e)return c(r)&&s(r,t,P?"block":"top");if("word"==e){var o=t.current().toLowerCase();h="only"==o||"not"==o||"and"==o||"or"==o?"keyword":f.hasOwnProperty(o)?"tag":k.hasOwnProperty(o)?"attribute":y.hasOwnProperty(o)?"property":w.hasOwnProperty(o)?"property":v.hasOwnProperty(o)?"string-2":j.hasOwnProperty(o)?"atom":"error"}return r.context.type},K.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?u(e,t,r,2):K.atBlock(e,t,r)},K.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(h="variable","restricted_atBlock_before"):d(e,t,r)},K.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(h="@font-face"==r.stateArg&&!x.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!z.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},K.keyframes=function(e,t,r){return"word"==e?(h="variable","keyframes"):"{"==e?s(r,t,"top"):d(e,t,r)},K.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?u(e,t,r):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},K.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?u(e,t,r):("variable"!=e&&(h="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:"top",stateArg:null,context:new l("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||a)(e,t);return r&&"object"==typeof r&&(m=r[1],r=r[0]),h=r,t.state=K[t.state](m,e,t),h},indent:function(e,t){var r=e.context,o=t&&t.charAt(0),a=r.indent;return"prop"!=r.type||"}"!=o&&")"!=o||(r=r.prev),!r.prev||("}"!=o||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type)&&(")"!=o||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=o||"at"!=r.type&&"atBlock"!=r.type)||(a=r.indent-g,r=r.prev),a},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var a=["domain","regexp","url","url-prefix"],i=t(a),n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],l=t(n),s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],c=t(s),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=t(d),p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],m=t(p),h=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(h),b=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],f=t(b),k=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(k),w=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],v=t(w),x=a.concat(n).concat(s).concat(d).concat(p).concat(k).concat(w);e.registerHelper("hintWords","css",x),e.defineMIME("text/css",{documentTypes:i,mediaTypes:l,mediaFeatures:c,propertyKeywords:u,nonStandardPropertyKeywords:m,fontProperties:g,counterDescriptors:f,colorKeywords:y,valueKeywords:v,tokenHooks:{"<":function(e,t){return e.match("!--")?(t.tokenize=o,o(e,t)):!1},"/":function(e,t){return e.eat("*")?(t.tokenize=r,r(e,t)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:l,mediaFeatures:c,propertyKeywords:u,nonStandardPropertyKeywords:m,colorKeywords:y,valueKeywords:v,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/)?[null,"{"]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:l,mediaFeatures:c,propertyKeywords:u,nonStandardPropertyKeywords:m,colorKeywords:y,valueKeywords:v,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}); +\ 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){for(var b={},c=0;c*\/]/.test(c)?d(null,"select-op"):"."==c&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?d("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(c)?d(null,c):"u"==c&&a.match(/rl(-prefix)?\(/)||"d"==c&&a.match("omain(")||"r"==c&&a.match("egexp(")?(a.backUp(1),b.tokenize=g,d("property","word")):/[\w\\\-]/.test(c)?(a.eatWhile(/[\w\\\-]/),d("property","word")):d(null,null):/[\d.]/.test(a.peek())?(a.eatWhile(/[\w.%]/),d("number","unit")):a.match(/^-[\w\\\-]+/)?(a.eatWhile(/[\w\\\-]/),a.match(/^\s*:/,!1)?d("variable-2","variable-definition"):d("variable-2","variable")):a.match(/^\w+-/)?d("meta","meta"):void 0}function f(a){return function(b,c){for(var e,f=!1;null!=(e=b.next());){if(e==a&&!f){")"==a&&b.backUp(1);break}f=!f&&"\\"==e}return(e==a||!f&&")"!=a)&&(c.tokenize=null),d("string","string")}}function g(a,b){return a.next(),a.match(/\s*[\"\')]/,!1)?b.tokenize=null:b.tokenize=f(")"),d(null,"(")}function h(a,b,c){this.type=a,this.indent=b,this.prev=c}function i(a,b,c){return a.context=new h(c,b.indentation()+p,a.context),c}function j(a){return a.context=a.context.prev,a.context.type}function k(a,b,c){return B[c.context.type](a,b,c)}function l(a,b,c,d){for(var e=d||1;e>0;e--)c.context=c.context.prev;return k(a,b,c)}function m(a){var b=a.current().toLowerCase();o=z.hasOwnProperty(b)?"atom":y.hasOwnProperty(b)?"keyword":"variable"}c.propertyKeywords||(c=a.resolveMode("text/css"));var n,o,p=b.indentUnit,q=c.tokenHooks,r=c.documentTypes||{},s=c.mediaTypes||{},t=c.mediaFeatures||{},u=c.propertyKeywords||{},v=c.nonStandardPropertyKeywords||{},w=c.fontProperties||{},x=c.counterDescriptors||{},y=c.colorKeywords||{},z=c.valueKeywords||{},A=c.allowNested,B={};return B.top=function(a,b,c){if("{"==a)return i(c,b,"block");if("}"==a&&c.context.prev)return j(c);if(/@(media|supports|(-moz-)?document)/.test(a))return i(c,b,"atBlock");if(/@(font-face|counter-style)/.test(a))return c.stateArg=a,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(a))return"keyframes";if(a&&"@"==a.charAt(0))return i(c,b,"at");if("hash"==a)o="builtin";else if("word"==a)o="tag";else{if("variable-definition"==a)return"maybeprop";if("interpolation"==a)return i(c,b,"interpolation");if(":"==a)return"pseudo";if(A&&"("==a)return i(c,b,"parens")}return c.context.type},B.block=function(a,b,c){if("word"==a){var d=b.current().toLowerCase();return u.hasOwnProperty(d)?(o="property","maybeprop"):v.hasOwnProperty(d)?(o="string-2","maybeprop"):A?(o=b.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==a?"block":A||"hash"!=a&&"qualifier"!=a?B.top(a,b,c):(o="error","block")},B.maybeprop=function(a,b,c){return":"==a?i(c,b,"prop"):k(a,b,c)},B.prop=function(a,b,c){if(";"==a)return j(c);if("{"==a&&A)return i(c,b,"propBlock");if("}"==a||"{"==a)return l(a,b,c);if("("==a)return i(c,b,"parens");if("hash"!=a||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(b.current())){if("word"==a)m(b);else if("interpolation"==a)return i(c,b,"interpolation")}else o+=" error";return"prop"},B.propBlock=function(a,b,c){return"}"==a?j(c):"word"==a?(o="property","maybeprop"):c.context.type},B.parens=function(a,b,c){return"{"==a||"}"==a?l(a,b,c):")"==a?j(c):"("==a?i(c,b,"parens"):"interpolation"==a?i(c,b,"interpolation"):("word"==a&&m(b),"parens")},B.pseudo=function(a,b,c){return"word"==a?(o="variable-3",c.context.type):k(a,b,c)},B.atBlock=function(a,b,c){if("("==a)return i(c,b,"atBlock_parens");if("}"==a)return l(a,b,c);if("{"==a)return j(c)&&i(c,b,A?"block":"top");if("word"==a){var d=b.current().toLowerCase();o="only"==d||"not"==d||"and"==d||"or"==d?"keyword":r.hasOwnProperty(d)?"tag":s.hasOwnProperty(d)?"attribute":t.hasOwnProperty(d)?"property":u.hasOwnProperty(d)?"property":v.hasOwnProperty(d)?"string-2":z.hasOwnProperty(d)?"atom":"error"}return c.context.type},B.atBlock_parens=function(a,b,c){return")"==a?j(c):"{"==a||"}"==a?l(a,b,c,2):B.atBlock(a,b,c)},B.restricted_atBlock_before=function(a,b,c){return"{"==a?i(c,b,"restricted_atBlock"):"word"==a&&"@counter-style"==c.stateArg?(o="variable","restricted_atBlock_before"):k(a,b,c)},B.restricted_atBlock=function(a,b,c){return"}"==a?(c.stateArg=null,j(c)):"word"==a?(o="@font-face"==c.stateArg&&!w.hasOwnProperty(b.current().toLowerCase())||"@counter-style"==c.stateArg&&!x.hasOwnProperty(b.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},B.keyframes=function(a,b,c){return"word"==a?(o="variable","keyframes"):"{"==a?i(c,b,"top"):k(a,b,c)},B.at=function(a,b,c){return";"==a?j(c):"{"==a||"}"==a?l(a,b,c):("word"==a?o="tag":"hash"==a&&(o="builtin"),"at")},B.interpolation=function(a,b,c){return"}"==a?j(c):"{"==a||";"==a?l(a,b,c):("word"==a?o="variable":"variable"!=a&&"("!=a&&")"!=a&&(o="error"),"interpolation")},{startState:function(a){return{tokenize:null,state:"top",stateArg:null,context:new h("top",a||0,null)}},token:function(a,b){if(!b.tokenize&&a.eatSpace())return null;var c=(b.tokenize||e)(a,b);return c&&"object"==typeof c&&(n=c[1],c=c[0]),o=c,b.state=B[b.state](n,a,b),o},indent:function(a,b){var c=a.context,d=b&&b.charAt(0),e=c.indent;return"prop"!=c.type||"}"!=d&&")"!=d||(c=c.prev),!c.prev||("}"!=d||"block"!=c.type&&"top"!=c.type&&"interpolation"!=c.type&&"restricted_atBlock"!=c.type)&&(")"!=d||"parens"!=c.type&&"atBlock_parens"!=c.type)&&("{"!=d||"at"!=c.type&&"atBlock"!=c.type)||(e=c.indent-p,c=c.prev),e},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var d=["domain","regexp","url","url-prefix"],e=b(d),f=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],g=b(f),h=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],i=b(h),j=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],k=b(j),l=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],m=b(l),n=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],o=b(n),p=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],q=b(p),r=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],s=b(r),t=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],u=b(t),v=d.concat(f).concat(h).concat(j).concat(l).concat(r).concat(t);a.registerHelper("hintWords","css",v),a.defineMIME("text/css",{documentTypes:e,mediaTypes:g,mediaFeatures:i,propertyKeywords:k,nonStandardPropertyKeywords:m,fontProperties:o,counterDescriptors:q,colorKeywords:s,valueKeywords:u,tokenHooks:{"/":function(a,b){return a.eat("*")?(b.tokenize=c,c(a,b)):!1}},name:"css"}),a.defineMIME("text/x-scss",{mediaTypes:g,mediaFeatures:i,propertyKeywords:k,nonStandardPropertyKeywords:m,colorKeywords:s,valueKeywords:u,fontProperties:o,allowNested:!0,tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=c,c(a,b)):["operator","operator"]},":":function(a){return a.match(/\s*\{/)?[null,"{"]:!1},$:function(a){return a.match(/^[\w-]+/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(a){return a.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),a.defineMIME("text/x-less",{mediaTypes:g,mediaFeatures:i,propertyKeywords:k,nonStandardPropertyKeywords:m,colorKeywords:s,valueKeywords:u,fontProperties:o,allowNested:!0,tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=c,c(a,b)):["operator","operator"]},"@":function(a){return a.eat("{")?[null,"interpolation"]:a.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(a.eatWhile(/[\w\\\-]/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/css/less.html b/media/editors/codemirror/mode/css/less.html +deleted file mode 100644 +index 6ccb721..0000000 +--- a/media/editors/codemirror/mode/css/less.html ++++ /dev/null +@@ -1,152 +0,0 @@ +- +- +-CodeMirror: LESS mode +- +- +- +- +- +- +- +- +- +- +-
    +-

    LESS mode

    +-
    +- +- +-

    The LESS mode is a sub-mode of the CSS mode (defined in css.js.

    +- +-

    Parsing/Highlighting Tests: normal, verbose.

    +-
    +diff --git a/media/editors/codemirror/mode/css/less_test.js b/media/editors/codemirror/mode/css/less_test.js +deleted file mode 100644 +index 2ba6998..0000000 +--- a/media/editors/codemirror/mode/css/less_test.js ++++ /dev/null +@@ -1,51 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- "use strict"; +- +- var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); } +- +- MT("variable", +- "[variable-2 @base]: [atom #f04615];", +- "[qualifier .class] {", +- " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]", +- " [property color]: [variable saturate]([variable-2 @base], [number 5%]);", +- "}"); +- +- MT("amp", +- "[qualifier .child], [qualifier .sibling] {", +- " [qualifier .parent] [atom &] {", +- " [property color]: [keyword black];", +- " }", +- " [atom &] + [atom &] {", +- " [property color]: [keyword red];", +- " }", +- "}"); +- +- MT("mixin", +- "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {", +- " [property color]: [variable darken]([variable-2 @color], [number 10%]);", +- "}", +- "[qualifier .mixin] ([variable light]; [variable-2 @color]) {", +- " [property color]: [variable lighten]([variable-2 @color], [number 10%]);", +- "}", +- "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {", +- " [property display]: [atom block];", +- "}", +- "[variable-2 @switch]: [variable light];", +- "[qualifier .class] {", +- " [qualifier .mixin]([variable-2 @switch]; [atom #888]);", +- "}"); +- +- MT("nest", +- "[qualifier .one] {", +- " [def @media] ([property width]: [number 400px]) {", +- " [property font-size]: [number 1.2em];", +- " [def @media] [attribute print] [keyword and] [property color] {", +- " [property color]: [keyword blue];", +- " }", +- " }", +- "}"); +-})(); +diff --git a/media/editors/codemirror/mode/css/less_test.min.js b/media/editors/codemirror/mode/css/less_test.min.js +deleted file mode 100644 +index 8e8ca99..0000000 +--- a/media/editors/codemirror/mode/css/less_test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){"use strict";function r(r){test.mode(r,e,Array.prototype.slice.call(arguments,1),"less")}var e=CodeMirror.getMode({indentUnit:2},"text/x-less");r("variable","[variable-2 @base]: [atom #f04615];","[qualifier .class] {"," [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]"," [property color]: [variable saturate]([variable-2 @base], [number 5%]);","}"),r("amp","[qualifier .child], [qualifier .sibling] {"," [qualifier .parent] [atom &] {"," [property color]: [keyword black];"," }"," [atom &] + [atom &] {"," [property color]: [keyword red];"," }","}"),r("mixin","[qualifier .mixin] ([variable dark]; [variable-2 @color]) {"," [property color]: [variable darken]([variable-2 @color], [number 10%]);","}","[qualifier .mixin] ([variable light]; [variable-2 @color]) {"," [property color]: [variable lighten]([variable-2 @color], [number 10%]);","}","[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {"," [property display]: [atom block];","}","[variable-2 @switch]: [variable light];","[qualifier .class] {"," [qualifier .mixin]([variable-2 @switch]; [atom #888]);","}"),r("nest","[qualifier .one] {"," [def @media] ([property width]: [number 400px]) {"," [property font-size]: [number 1.2em];"," [def @media] [attribute print] [keyword and] [property color] {"," [property color]: [keyword blue];"," }"," }","}")}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/css/scss.html b/media/editors/codemirror/mode/css/scss.html +deleted file mode 100644 +index 21f20e0..0000000 +--- a/media/editors/codemirror/mode/css/scss.html ++++ /dev/null +@@ -1,157 +0,0 @@ +- +- +-CodeMirror: SCSS mode +- +- +- +- +- +- +- +- +- +-
    +-

    SCSS mode

    +-
    +- +- +-

    The SCSS mode is a sub-mode of the CSS mode (defined in css.js.

    +- +-

    Parsing/Highlighting Tests: normal, verbose.

    +- +-
    +diff --git a/media/editors/codemirror/mode/css/scss_test.js b/media/editors/codemirror/mode/css/scss_test.js +deleted file mode 100644 +index 8dcea9e..0000000 +--- a/media/editors/codemirror/mode/css/scss_test.js ++++ /dev/null +@@ -1,110 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); } +- +- MT('url_with_quotation', +- "[tag foo] { [property background]:[atom url]([string test.jpg]) }"); +- +- MT('url_with_double_quotes', +- "[tag foo] { [property background]:[atom url]([string \"test.jpg\"]) }"); +- +- MT('url_with_single_quotes', +- "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) }"); +- +- MT('string', +- "[def @import] [string \"compass/css3\"]"); +- +- MT('important_keyword', +- "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) [keyword !important] }"); +- +- MT('variable', +- "[variable-2 $blue]:[atom #333]"); +- +- MT('variable_as_attribute', +- "[tag foo] { [property color]:[variable-2 $blue] }"); +- +- MT('numbers', +- "[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }"); +- +- MT('number_percentage', +- "[tag foo] { [property width]:[number 80%] }"); +- +- MT('selector', +- "[builtin #hello][qualifier .world]{}"); +- +- MT('singleline_comment', +- "[comment // this is a comment]"); +- +- MT('multiline_comment', +- "[comment /*foobar*/]"); +- +- MT('attribute_with_hyphen', +- "[tag foo] { [property font-size]:[number 10px] }"); +- +- MT('string_after_attribute', +- "[tag foo] { [property content]:[string \"::\"] }"); +- +- MT('directives', +- "[def @include] [qualifier .mixin]"); +- +- MT('basic_structure', +- "[tag p] { [property background]:[keyword red]; }"); +- +- MT('nested_structure', +- "[tag p] { [tag a] { [property color]:[keyword red]; } }"); +- +- MT('mixin', +- "[def @mixin] [tag table-base] {}"); +- +- MT('number_without_semicolon', +- "[tag p] {[property width]:[number 12]}", +- "[tag a] {[property color]:[keyword red];}"); +- +- MT('atom_in_nested_block', +- "[tag p] { [tag a] { [property color]:[atom #000]; } }"); +- +- MT('interpolation_in_property', +- "[tag foo] { #{[variable-2 $hello]}:[number 2]; }"); +- +- MT('interpolation_in_selector', +- "[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }"); +- +- MT('interpolation_error', +- "[tag foo]#{[error foo]} { [property color]:[atom #000]; }"); +- +- MT("divide_operator", +- "[tag foo] { [property width]:[number 4] [operator /] [number 2] }"); +- +- MT('nested_structure_with_id_selector', +- "[tag p] { [builtin #hello] { [property color]:[keyword red]; } }"); +- +- MT('indent_mixin', +- "[def @mixin] [tag container] (", +- " [variable-2 $a]: [number 10],", +- " [variable-2 $b]: [number 10])", +- "{}"); +- +- MT('indent_nested', +- "[tag foo] {", +- " [tag bar] {", +- " }", +- "}"); +- +- MT('indent_parentheses', +- "[tag foo] {", +- " [property color]: [variable darken]([variable-2 $blue],", +- " [number 9%]);", +- "}"); +- +- MT('indent_vardef', +- "[variable-2 $name]:", +- " [string 'val'];", +- "[tag tag] {", +- " [tag inner] {", +- " [property margin]: [number 3px];", +- " }", +- "}"); +-})(); +diff --git a/media/editors/codemirror/mode/css/scss_test.min.js b/media/editors/codemirror/mode/css/scss_test.min.js +deleted file mode 100644 +index f81e79a..0000000 +--- a/media/editors/codemirror/mode/css/scss_test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function r(r){test.mode(r,t,Array.prototype.slice.call(arguments,1),"scss")}var t=CodeMirror.getMode({indentUnit:2},"text/x-scss");r("url_with_quotation","[tag foo] { [property background]:[atom url]([string test.jpg]) }"),r("url_with_double_quotes",'[tag foo] { [property background]:[atom url]([string "test.jpg"]) }'),r("url_with_single_quotes","[tag foo] { [property background]:[atom url]([string 'test.jpg']) }"),r("string",'[def @import] [string "compass/css3"]'),r("important_keyword","[tag foo] { [property background]:[atom url]([string 'test.jpg']) [keyword !important] }"),r("variable","[variable-2 $blue]:[atom #333]"),r("variable_as_attribute","[tag foo] { [property color]:[variable-2 $blue] }"),r("numbers","[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }"),r("number_percentage","[tag foo] { [property width]:[number 80%] }"),r("selector","[builtin #hello][qualifier .world]{}"),r("singleline_comment","[comment // this is a comment]"),r("multiline_comment","[comment /*foobar*/]"),r("attribute_with_hyphen","[tag foo] { [property font-size]:[number 10px] }"),r("string_after_attribute",'[tag foo] { [property content]:[string "::"] }'),r("directives","[def @include] [qualifier .mixin]"),r("basic_structure","[tag p] { [property background]:[keyword red]; }"),r("nested_structure","[tag p] { [tag a] { [property color]:[keyword red]; } }"),r("mixin","[def @mixin] [tag table-base] {}"),r("number_without_semicolon","[tag p] {[property width]:[number 12]}","[tag a] {[property color]:[keyword red];}"),r("atom_in_nested_block","[tag p] { [tag a] { [property color]:[atom #000]; } }"),r("interpolation_in_property","[tag foo] { #{[variable-2 $hello]}:[number 2]; }"),r("interpolation_in_selector","[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }"),r("interpolation_error","[tag foo]#{[error foo]} { [property color]:[atom #000]; }"),r("divide_operator","[tag foo] { [property width]:[number 4] [operator /] [number 2] }"),r("nested_structure_with_id_selector","[tag p] { [builtin #hello] { [property color]:[keyword red]; } }"),r("indent_mixin","[def @mixin] [tag container] ("," [variable-2 $a]: [number 10],"," [variable-2 $b]: [number 10])","{}"),r("indent_nested","[tag foo] {"," [tag bar] {"," }","}"),r("indent_parentheses","[tag foo] {"," [property color]: [variable darken]([variable-2 $blue],"," [number 9%]);","}"),r("indent_vardef","[variable-2 $name]:"," [string 'val'];","[tag tag] {"," [tag inner] {"," [property margin]: [number 3px];"," }","}")}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/css/test.js b/media/editors/codemirror/mode/css/test.js +deleted file mode 100644 +index bef7156..0000000 +--- a/media/editors/codemirror/mode/css/test.js ++++ /dev/null +@@ -1,195 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({indentUnit: 2}, "css"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- +- // Error, because "foobarhello" is neither a known type or property, but +- // property was expected (after "and"), and it should be in parenthese. +- MT("atMediaUnknownType", +- "[def @media] [attribute screen] [keyword and] [error foobarhello] { }"); +- +- // Soft error, because "foobarhello" is not a known property or type. +- MT("atMediaUnknownProperty", +- "[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }"); +- +- // Make sure nesting works with media queries +- MT("atMediaMaxWidthNested", +- "[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"); +- +- MT("tagSelector", +- "[tag foo] { }"); +- +- MT("classSelector", +- "[qualifier .foo-bar_hello] { }"); +- +- MT("idSelector", +- "[builtin #foo] { [error #foo] }"); +- +- MT("tagSelectorUnclosed", +- "[tag foo] { [property margin]: [number 0] } [tag bar] { }"); +- +- MT("tagStringNoQuotes", +- "[tag foo] { [property font-family]: [variable hello] [variable world]; }"); +- +- MT("tagStringDouble", +- "[tag foo] { [property font-family]: [string \"hello world\"]; }"); +- +- MT("tagStringSingle", +- "[tag foo] { [property font-family]: [string 'hello world']; }"); +- +- MT("tagColorKeyword", +- "[tag foo] {", +- " [property color]: [keyword black];", +- " [property color]: [keyword navy];", +- " [property color]: [keyword yellow];", +- "}"); +- +- MT("tagColorHex3", +- "[tag foo] { [property background]: [atom #fff]; }"); +- +- MT("tagColorHex6", +- "[tag foo] { [property background]: [atom #ffffff]; }"); +- +- MT("tagColorHex4", +- "[tag foo] { [property background]: [atom&error #ffff]; }"); +- +- MT("tagColorHexInvalid", +- "[tag foo] { [property background]: [atom&error #ffg]; }"); +- +- MT("tagNegativeNumber", +- "[tag foo] { [property margin]: [number -5px]; }"); +- +- MT("tagPositiveNumber", +- "[tag foo] { [property padding]: [number 5px]; }"); +- +- MT("tagVendor", +- "[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }"); +- +- MT("tagBogusProperty", +- "[tag foo] { [property&error barhelloworld]: [number 0]; }"); +- +- MT("tagTwoProperties", +- "[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }"); +- +- MT("tagTwoPropertiesURL", +- "[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }"); +- +- MT("commentSGML", +- "[comment ]"); +- +- MT("commentSGML2", +- "[comment ] [tag div] {}"); +- +- MT("indent_tagSelector", +- "[tag strong], [tag em] {", +- " [property background]: [atom rgba](", +- " [number 255], [number 255], [number 0], [number .2]", +- " );", +- "}"); +- +- MT("indent_atMedia", +- "[def @media] {", +- " [tag foo] {", +- " [property color]:", +- " [keyword yellow];", +- " }", +- "}"); +- +- MT("indent_comma", +- "[tag foo] {", +- " [property font-family]: [variable verdana],", +- " [atom sans-serif];", +- "}"); +- +- MT("indent_parentheses", +- "[tag foo]:[variable-3 before] {", +- " [property background]: [atom url](", +- "[string blahblah]", +- "[string etc]", +- "[string ]) [keyword !important];", +- "}"); +- +- MT("font_face", +- "[def @font-face] {", +- " [property font-family]: [string 'myfont'];", +- " [error nonsense]: [string 'abc'];", +- " [property src]: [atom url]([string http://blah]),", +- " [atom url]([string http://foo]);", +- "}"); +- +- MT("empty_url", +- "[def @import] [tag url]() [tag screen];"); +- +- MT("parens", +- "[qualifier .foo] {", +- " [property background-image]: [variable fade]([atom #000], [number 20%]);", +- " [property border-image]: [atom linear-gradient](", +- " [atom to] [atom bottom],", +- " [variable fade]([atom #000], [number 20%]) [number 0%],", +- " [variable fade]([atom #000], [number 20%]) [number 100%]", +- " );", +- "}"); +- +- MT("css_variable", +- ":[variable-3 root] {", +- " [variable-2 --main-color]: [atom #06c];", +- "}", +- "[tag h1][builtin #foo] {", +- " [property color]: [atom var]([variable-2 --main-color]);", +- "}"); +- +- MT("supports", +- "[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {", +- " [property text-align-last]: [atom justify];", +- "}"); +- +- MT("document", +- "[def @document] [tag url]([string http://blah]),", +- " [tag url-prefix]([string https://]),", +- " [tag domain]([string blah.com]),", +- " [tag regexp]([string \".*blah.+\"]) {", +- " [builtin #id] {", +- " [property background-color]: [keyword white];", +- " }", +- " [tag foo] {", +- " [property font-family]: [variable Verdana], [atom sans-serif];", +- " }", +- " }"); +- +- MT("document_url", +- "[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }"); +- +- MT("document_urlPrefix", +- "[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }"); +- +- MT("document_domain", +- "[def @document] [tag domain]([string blah.com]) { [tag foo] { } }"); +- +- MT("document_regexp", +- "[def @document] [tag regexp]([string \".*blah.+\"]) { [builtin #id] { } }"); +- +- MT("counter-style", +- "[def @counter-style] [variable binary] {", +- " [property system]: [atom numeric];", +- " [property symbols]: [number 0] [number 1];", +- " [property suffix]: [string \".\"];", +- " [property range]: [atom infinite];", +- " [property speak-as]: [atom numeric];", +- "}"); +- +- MT("counter-style-additive-symbols", +- "[def @counter-style] [variable simple-roman] {", +- " [property system]: [atom additive];", +- " [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];", +- " [property range]: [number 1] [number 49];", +- "}"); +- +- MT("counter-style-use", +- "[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }"); +- +- MT("counter-style-symbols", +- "[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }"); +-})(); +diff --git a/media/editors/codemirror/mode/css/test.min.js b/media/editors/codemirror/mode/css/test.min.js +deleted file mode 100644 +index c9cff95..0000000 +--- a/media/editors/codemirror/mode/css/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function r(r){test.mode(r,o,Array.prototype.slice.call(arguments,1))}var o=CodeMirror.getMode({indentUnit:2},"css");r("atMediaUnknownType","[def @media] [attribute screen] [keyword and] [error foobarhello] { }"),r("atMediaUnknownProperty","[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }"),r("atMediaMaxWidthNested","[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"),r("tagSelector","[tag foo] { }"),r("classSelector","[qualifier .foo-bar_hello] { }"),r("idSelector","[builtin #foo] { [error #foo] }"),r("tagSelectorUnclosed","[tag foo] { [property margin]: [number 0] } [tag bar] { }"),r("tagStringNoQuotes","[tag foo] { [property font-family]: [variable hello] [variable world]; }"),r("tagStringDouble",'[tag foo] { [property font-family]: [string "hello world"]; }'),r("tagStringSingle","[tag foo] { [property font-family]: [string 'hello world']; }"),r("tagColorKeyword","[tag foo] {"," [property color]: [keyword black];"," [property color]: [keyword navy];"," [property color]: [keyword yellow];","}"),r("tagColorHex3","[tag foo] { [property background]: [atom #fff]; }"),r("tagColorHex6","[tag foo] { [property background]: [atom #ffffff]; }"),r("tagColorHex4","[tag foo] { [property background]: [atom&error #ffff]; }"),r("tagColorHexInvalid","[tag foo] { [property background]: [atom&error #ffg]; }"),r("tagNegativeNumber","[tag foo] { [property margin]: [number -5px]; }"),r("tagPositiveNumber","[tag foo] { [property padding]: [number 5px]; }"),r("tagVendor","[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }"),r("tagBogusProperty","[tag foo] { [property&error barhelloworld]: [number 0]; }"),r("tagTwoProperties","[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }"),r("tagTwoPropertiesURL","[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }"),r("commentSGML","[comment ]"),r("commentSGML2","[comment ] [tag div] {}"),r("indent_tagSelector","[tag strong], [tag em] {"," [property background]: [atom rgba]("," [number 255], [number 255], [number 0], [number .2]"," );","}"),r("indent_atMedia","[def @media] {"," [tag foo] {"," [property color]:"," [keyword yellow];"," }","}"),r("indent_comma","[tag foo] {"," [property font-family]: [variable verdana],"," [atom sans-serif];","}"),r("indent_parentheses","[tag foo]:[variable-3 before] {"," [property background]: [atom url](","[string blahblah]","[string etc]","[string ]) [keyword !important];","}"),r("font_face","[def @font-face] {"," [property font-family]: [string 'myfont'];"," [error nonsense]: [string 'abc'];"," [property src]: [atom url]([string http://blah]),"," [atom url]([string http://foo]);","}"),r("empty_url","[def @import] [tag url]() [tag screen];"),r("parens","[qualifier .foo] {"," [property background-image]: [variable fade]([atom #000], [number 20%]);"," [property border-image]: [atom linear-gradient]("," [atom to] [atom bottom],"," [variable fade]([atom #000], [number 20%]) [number 0%],"," [variable fade]([atom #000], [number 20%]) [number 100%]"," );","}"),r("css_variable",":[variable-3 root] {"," [variable-2 --main-color]: [atom #06c];","}","[tag h1][builtin #foo] {"," [property color]: [atom var]([variable-2 --main-color]);","}"),r("supports","[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {"," [property text-align-last]: [atom justify];","}"),r("document","[def @document] [tag url]([string http://blah]),"," [tag url-prefix]([string https://]),"," [tag domain]([string blah.com]),",' [tag regexp]([string ".*blah.+"]) {'," [builtin #id] {"," [property background-color]: [keyword white];"," }"," [tag foo] {"," [property font-family]: [variable Verdana], [atom sans-serif];"," }"," }"),r("document_url","[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }"),r("document_urlPrefix","[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }"),r("document_domain","[def @document] [tag domain]([string blah.com]) { [tag foo] { } }"),r("document_regexp",'[def @document] [tag regexp]([string ".*blah.+"]) { [builtin #id] { } }'),r("counter-style","[def @counter-style] [variable binary] {"," [property system]: [atom numeric];"," [property symbols]: [number 0] [number 1];",' [property suffix]: [string "."];'," [property range]: [atom infinite];"," [property speak-as]: [atom numeric];","}"),r("counter-style-additive-symbols","[def @counter-style] [variable simple-roman] {"," [property system]: [atom additive];"," [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];"," [property range]: [number 1] [number 49];","}"),r("counter-style-use","[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }"),r("counter-style-symbols",'[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string "*"] [string "\\2020"] [string "\\2021"] [string "\\A7"]); }')}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/cypher/cypher.js b/media/editors/codemirror/mode/cypher/cypher.js +index 9decf30..e218d47 100644 +--- a/media/editors/codemirror/mode/cypher/cypher.js ++++ b/media/editors/codemirror/mode/cypher/cypher.js +@@ -19,7 +19,7 @@ + + CodeMirror.defineMode("cypher", function(config) { + var tokenBase = function(stream/*, state*/) { +- var ch = stream.next(), curPunc = null; ++ var ch = stream.next(); + if (ch === "\"" || ch === "'") { + stream.match(/.+?["']/); + return "string"; +diff --git a/media/editors/codemirror/mode/cypher/cypher.min.js b/media/editors/codemirror/mode/cypher/cypher.min.js +index ec5b3cd..ec9c8ea 100644 +--- a/media/editors/codemirror/mode/cypher/cypher.min.js ++++ b/media/editors/codemirror/mode/cypher/cypher.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=function(e){return new RegExp("^(?:"+e.join("|")+")$","i")};e.defineMode("cypher",function(n){var r,i=function(e){var t=e.next(),n=null;if('"'===t||"'"===t)return e.match(/.+?["']/),"string";if(/[{}\(\),\.;\[\]]/.test(t))return n=t,"node";if("/"===t&&e.eat("/"))return e.skipToEnd(),"comment";if(u.test(t))return e.eatWhile(u),null;if(e.eatWhile(/[_\w\d]/),e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var r=e.current();return l.test(r)?"builtin":s.test(r)?"def":d.test(r)?"keyword":"variable"},o=function(e,t,n){return e.context={prev:e.context,indent:e.indent,col:n,type:t}},a=function(e){return e.indent=e.context.indent,e.context=e.context.prev},c=n.indentUnit,l=t(["abs","acos","allShortestPaths","asin","atan","atan2","avg","ceil","coalesce","collect","cos","cot","count","degrees","e","endnode","exp","extract","filter","floor","haversin","head","id","keys","labels","last","left","length","log","log10","lower","ltrim","max","min","node","nodes","percentileCont","percentileDisc","pi","radians","rand","range","reduce","rel","relationship","relationships","replace","right","round","rtrim","shortestPath","sign","sin","split","sqrt","startnode","stdev","stdevp","str","substring","sum","tail","tan","timestamp","toFloat","toInt","trim","type","upper"]),s=t(["all","and","any","has","in","none","not","or","single","xor"]),d=t(["as","asc","ascending","assert","by","case","commit","constraint","create","csv","cypher","delete","desc","descending","distinct","drop","else","end","explain","false","fieldterminator","foreach","from","headers","in","index","is","limit","load","match","merge","null","on","optional","order","periodic","profile","remove","return","scan","set","skip","start","then","true","union","unique","unwind","using","when","where","with"]),u=/[*+\-<>=&|~%^]/;return{startState:function(){return{tokenize:i,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"!==n&&t.context&&null==t.context.align&&"pattern"!==t.context.type&&(t.context.align=!0),"("===r)o(t,")",e.column());else if("["===r)o(t,"]",e.column());else if("{"===r)o(t,"}",e.column());else if(/[\]\}\)]/.test(r)){for(;t.context&&"pattern"===t.context.type;)a(t);t.context&&r===t.context.type&&a(t)}else"."===r&&t.context&&"pattern"===t.context.type?a(t):/atom|string|variable/.test(n)&&t.context&&(/[\}\]]/.test(t.context.type)?o(t,"pattern",e.column()):"pattern"!==t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return n},indent:function(t,n){var r=n&&n.charAt(0),i=t.context;if(/[\]\}]/.test(r))for(;i&&"pattern"===i.type;)i=i.prev;var o=i&&r===i.type;return i?"keywords"===i.type?e.commands.newlineAndIndent:i.align?i.col+(o?0:1):i.indent+(o?0:c):0}}}),e.modeExtensions.cypher={autoFormatLineBreaks:function(e){for(var t,n,r,n=e.split("\n"),r=/\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g,t=0;t=&|~%^]/;return{startState:function(){return{tokenize:e,context:null,indent:0,col:0}},token:function(a,b){if(a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);if("comment"!==c&&b.context&&null==b.context.align&&"pattern"!==b.context.type&&(b.context.align=!0),"("===d)f(b,")",a.column());else if("["===d)f(b,"]",a.column());else if("{"===d)f(b,"}",a.column());else if(/[\]\}\)]/.test(d)){for(;b.context&&"pattern"===b.context.type;)g(b);b.context&&d===b.context.type&&g(b)}else"."===d&&b.context&&"pattern"===b.context.type?g(b):/atom|string|variable/.test(c)&&b.context&&(/[\}\]]/.test(b.context.type)?f(b,"pattern",a.column()):"pattern"!==b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return c},indent:function(b,c){var d=c&&c.charAt(0),e=b.context;if(/[\]\}]/.test(d))for(;e&&"pattern"===e.type;)e=e.prev;var f=e&&d===e.type;return e?"keywords"===e.type?a.commands.newlineAndIndent:e.align?e.col+(f?0:1):e.indent+(f?0:h):0}}}),a.modeExtensions.cypher={autoFormatLineBreaks:function(a){for(var b,c,d,c=a.split("\n"),d=/\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g,b=0;b!?|\/]/;return{startState:function(e){return{tokenize:null,context:new u((e||0)-f,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;c=null;var i=(t.tokenize||r)(e,t);if("comment"==i||"meta"==i)return i;if(null==n.align&&(n.align=!0),";"!=c&&":"!=c&&","!=c||"statement"!=n.type)if("{"==c)l(t,e.column(),"}");else if("["==c)l(t,e.column(),"]");else if("("==c)l(t,e.column(),")");else if("}"==c){for(;"statement"==n.type;)n=s(t);for("}"==n.type&&(n=s(t));"statement"==n.type;)n=s(t)}else c==n.type?s(t):(("}"==n.type||"top"==n.type)&&";"!=c||"statement"==n.type&&"newstatement"==c)&&l(t,e.column(),"statement");else s(t);return t.startOfLine=!1,i},indent:function(t,n){if(t.tokenize!=r&&null!=t.tokenize)return e.Pass;var i=t.context,o=n&&n.charAt(0);"statement"==i.type&&"}"==o&&(i=i.prev);var a=o==i.type;return"statement"==i.type?i.indented+("{"==o?0:d):i.align?i.column+(a?0:1):i.indented+(a?0:f)},electricChars:"{}"}});var n="body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with";e.defineMIME("text/x-d",{name:"d",keywords:t("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters "+n),blockKeywords:t(n),builtin:t("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t"),atoms:t("exit failure success true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}}})}); +\ 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){for(var b={},c=a.split(" "),d=0;d!?|\/]/;return{startState:function(a){return{tokenize:null,context:new h((a||0)-l,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;k=null;var e=(b.tokenize||d)(a,b);if("comment"==e||"meta"==e)return e;if(null==c.align&&(c.align=!0),";"!=k&&":"!=k&&","!=k||"statement"!=c.type)if("{"==k)i(b,a.column(),"}");else if("["==k)i(b,a.column(),"]");else if("("==k)i(b,a.column(),")");else if("}"==k){for(;"statement"==c.type;)c=j(b);for("}"==c.type&&(c=j(b));"statement"==c.type;)c=j(b)}else k==c.type?j(b):(("}"==c.type||"top"==c.type)&&";"!=k||"statement"==c.type&&"newstatement"==k)&&i(b,a.column(),"statement");else j(b);return b.startOfLine=!1,e},indent:function(b,c){if(b.tokenize!=d&&null!=b.tokenize)return a.Pass;var e=b.context,f=c&&c.charAt(0);"statement"==e.type&&"}"==f&&(e=e.prev);var g=f==e.type;return"statement"==e.type?e.indented+("{"==f?0:m):e.align?e.column+(g?0:1):e.indented+(g?0:l)},electricChars:"{}"}});var c="body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with";a.defineMIME("text/x-d",{name:"d",keywords:b("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters "+c),blockKeywords:b(c),builtin:b("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t"),atoms:b("exit failure success true false null"),hooks:{"@":function(a,b){return a.eatWhile(/[\w\$_]/),"meta"}}})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/dart/dart.min.js b/media/editors/codemirror/mode/dart/dart.min.js +index dc9c335..5e5f1ed 100644 +--- a/media/editors/codemirror/mode/dart/dart.min.js ++++ b/media/editors/codemirror/mode/dart/dart.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},i=0;i", "<=", ">=", "in", "not", "or", "and"]; + ++ keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b"); ++ filters = new RegExp("^\\b(" + filters.join("|") + ")\\b"); ++ operators = new RegExp("^\\b(" + operators.join("|") + ")\\b"); ++ ++ // We have to return "null" instead of null, in order to avoid string ++ // styling as the default, when using Django templates inside HTML ++ // element attributes + function tokenBase (stream, state) { +- stream.eatWhile(/[^\{]/); +- var ch = stream.next(); +- if (ch == "{") { +- if (ch = stream.eat(/\{|%|#/)) { +- state.tokenize = inTag(ch); +- return "tag"; ++ // Attempt to identify a variable, template or comment tag respectively ++ if (stream.match("{{")) { ++ state.tokenize = inVariable; ++ return "tag"; ++ } else if (stream.match("{%")) { ++ state.tokenize = inTag; ++ return "tag"; ++ } else if (stream.match("{#")) { ++ state.tokenize = inComment; ++ return "comment"; ++ } ++ ++ // Ignore completely any stream series that do not match the ++ // Django template opening tags. ++ while (stream.next() != null && !stream.match("{{", false) && !stream.match("{%", false)) {} ++ return null; ++ } ++ ++ // A string can be included in either single or double quotes (this is ++ // the delimeter). Mark everything as a string until the start delimeter ++ // occurs again. ++ function inString (delimeter, previousTokenizer) { ++ return function (stream, state) { ++ if (!state.escapeNext && stream.eat(delimeter)) { ++ state.tokenize = previousTokenizer; ++ } else { ++ if (state.escapeNext) { ++ state.escapeNext = false; ++ } ++ ++ var ch = stream.next(); ++ ++ // Take into account the backslash for escaping characters, such as ++ // the string delimeter. ++ if (ch == "\\") { ++ state.escapeNext = true; ++ } ++ } ++ ++ return "string"; ++ }; ++ } ++ ++ // Apply Django template variable syntax highlighting ++ function inVariable (stream, state) { ++ // Attempt to match a dot that precedes a property ++ if (state.waitDot) { ++ state.waitDot = false; ++ ++ if (stream.peek() != ".") { ++ return "null"; ++ } ++ ++ // Dot folowed by a non-word character should be considered an error. ++ if (stream.match(/\.\W+/)) { ++ return "error"; ++ } else if (stream.eat(".")) { ++ state.waitProperty = true; ++ return "null"; ++ } else { ++ throw Error ("Unexpected error while waiting for property."); ++ } ++ } ++ ++ // Attempt to match a pipe that precedes a filter ++ if (state.waitPipe) { ++ state.waitPipe = false; ++ ++ if (stream.peek() != "|") { ++ return "null"; ++ } ++ ++ // Pipe folowed by a non-word character should be considered an error. ++ if (stream.match(/\.\W+/)) { ++ return "error"; ++ } else if (stream.eat("|")) { ++ state.waitFilter = true; ++ return "null"; ++ } else { ++ throw Error ("Unexpected error while waiting for filter."); ++ } ++ } ++ ++ // Highlight properties ++ if (state.waitProperty) { ++ state.waitProperty = false; ++ if (stream.match(/\b(\w+)\b/)) { ++ state.waitDot = true; // A property can be followed by another property ++ state.waitPipe = true; // A property can be followed by a filter ++ return "property"; + } + } ++ ++ // Highlight filters ++ if (state.waitFilter) { ++ state.waitFilter = false; ++ if (stream.match(filters)) { ++ return "variable-2"; ++ } ++ } ++ ++ // Ignore all white spaces ++ if (stream.eatSpace()) { ++ state.waitProperty = false; ++ return "null"; ++ } ++ ++ // Identify numbers ++ if (stream.match(/\b\d+(\.\d+)?\b/)) { ++ return "number"; ++ } ++ ++ // Identify strings ++ if (stream.match("'")) { ++ state.tokenize = inString("'", state.tokenize); ++ return "string"; ++ } else if (stream.match('"')) { ++ state.tokenize = inString('"', state.tokenize); ++ return "string"; ++ } ++ ++ // Attempt to find the variable ++ if (stream.match(/\b(\w+)\b/) && !state.foundVariable) { ++ state.waitDot = true; ++ state.waitPipe = true; // A property can be followed by a filter ++ return "variable"; ++ } ++ ++ // If found closing tag reset ++ if (stream.match("}}")) { ++ state.waitProperty = null; ++ state.waitFilter = null; ++ state.waitDot = null; ++ state.waitPipe = null; ++ state.tokenize = tokenBase; ++ return "tag"; ++ } ++ ++ // If nothing was found, advance to the next character ++ stream.next(); ++ return "null"; + } +- function inTag (close) { +- if (close == "{") { +- close = "}"; ++ ++ function inTag (stream, state) { ++ // Attempt to match a dot that precedes a property ++ if (state.waitDot) { ++ state.waitDot = false; ++ ++ if (stream.peek() != ".") { ++ return "null"; ++ } ++ ++ // Dot folowed by a non-word character should be considered an error. ++ if (stream.match(/\.\W+/)) { ++ return "error"; ++ } else if (stream.eat(".")) { ++ state.waitProperty = true; ++ return "null"; ++ } else { ++ throw Error ("Unexpected error while waiting for property."); ++ } + } +- return function (stream, state) { +- var ch = stream.next(); +- if ((ch == close) && stream.eat("}")) { +- state.tokenize = tokenBase; +- return "tag"; ++ ++ // Attempt to match a pipe that precedes a filter ++ if (state.waitPipe) { ++ state.waitPipe = false; ++ ++ if (stream.peek() != "|") { ++ return "null"; + } +- if (stream.match(keywords)) { +- return "keyword"; ++ ++ // Pipe folowed by a non-word character should be considered an error. ++ if (stream.match(/\.\W+/)) { ++ return "error"; ++ } else if (stream.eat("|")) { ++ state.waitFilter = true; ++ return "null"; ++ } else { ++ throw Error ("Unexpected error while waiting for filter."); + } +- return close == "#" ? "comment" : "string"; +- }; ++ } ++ ++ // Highlight properties ++ if (state.waitProperty) { ++ state.waitProperty = false; ++ if (stream.match(/\b(\w+)\b/)) { ++ state.waitDot = true; // A property can be followed by another property ++ state.waitPipe = true; // A property can be followed by a filter ++ return "property"; ++ } ++ } ++ ++ // Highlight filters ++ if (state.waitFilter) { ++ state.waitFilter = false; ++ if (stream.match(filters)) { ++ return "variable-2"; ++ } ++ } ++ ++ // Ignore all white spaces ++ if (stream.eatSpace()) { ++ state.waitProperty = false; ++ return "null"; ++ } ++ ++ // Identify numbers ++ if (stream.match(/\b\d+(\.\d+)?\b/)) { ++ return "number"; ++ } ++ ++ // Identify strings ++ if (stream.match("'")) { ++ state.tokenize = inString("'", state.tokenize); ++ return "string"; ++ } else if (stream.match('"')) { ++ state.tokenize = inString('"', state.tokenize); ++ return "string"; ++ } ++ ++ // Attempt to match an operator ++ if (stream.match(operators)) { ++ return "operator"; ++ } ++ ++ // Attempt to match a keyword ++ var keywordMatch = stream.match(keywords); ++ if (keywordMatch) { ++ if (keywordMatch[0] == "comment") { ++ state.blockCommentTag = true; ++ } ++ return "keyword"; ++ } ++ ++ // Attempt to match a variable ++ if (stream.match(/\b(\w+)\b/)) { ++ state.waitDot = true; ++ state.waitPipe = true; // A property can be followed by a filter ++ return "variable"; ++ } ++ ++ // If found closing tag reset ++ if (stream.match("%}")) { ++ state.waitProperty = null; ++ state.waitFilter = null; ++ state.waitDot = null; ++ state.waitPipe = null; ++ // If the tag that closes is a block comment tag, we want to mark the ++ // following code as comment, until the tag closes. ++ if (state.blockCommentTag) { ++ state.blockCommentTag = false; // Release the "lock" ++ state.tokenize = inBlockComment; ++ } else { ++ state.tokenize = tokenBase; ++ } ++ return "tag"; ++ } ++ ++ // If nothing was found, advance to the next character ++ stream.next(); ++ return "null"; ++ } ++ ++ // Mark everything as comment inside the tag and the tag itself. ++ function inComment (stream, state) { ++ if (stream.match("#}")) { ++ state.tokenize = tokenBase; ++ } ++ return "comment"; ++ } ++ ++ // Mark everything as a comment until the `blockcomment` tag closes. ++ function inBlockComment (stream, state) { ++ if (stream.match(/\{%\s*endcomment\s*%\}/, false)) { ++ state.tokenize = inTag; ++ stream.match("{%"); ++ return "tag"; ++ } else { ++ stream.next(); ++ return "comment"; ++ } + } ++ + return { + startState: function () { + return {tokenize: tokenBase}; + }, + token: function (stream, state) { + return state.tokenize(stream, state); +- } ++ }, ++ blockCommentStart: "{% comment %}", ++ blockCommentEnd: "{% endcomment %}" + }; + }); + +diff --git a/media/editors/codemirror/mode/django/django.min.js b/media/editors/codemirror/mode/django/django.min.js +index 6d6aa79..9f0ba66 100644 +--- a/media/editors/codemirror/mode/django/django.min.js ++++ b/media/editors/codemirror/mode/django/django.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("django:inner",function(){function e(e,t){e.eatWhile(/[^\{]/);var o=e.next();return"{"==o&&(o=e.eat(/\{|%|#/))?(t.tokenize=n(o),"tag"):void 0}function n(n){return"{"==n&&(n="}"),function(o,i){var r=o.next();return r==n&&o.eat("}")?(i.tokenize=e,"tag"):o.match(t)?"keyword":"#"==n?"comment":"string"}}var t=["block","endblock","for","endfor","in","true","false","loop","none","self","super","if","endif","as","not","and","else","import","with","endwith","without","context","ifequal","endifequal","ifnotequal","endifnotequal","extends","include","load","length","comment","endcomment","empty"];return t=new RegExp("^(("+t.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,n){return n.tokenize(e,n)}}}),e.defineMode("django",function(n){var t=e.getMode(n,"text/html"),o=e.getMode(n,"django:inner");return e.overlayMode(t,o)}),e.defineMIME("text/x-django","django")}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("django:inner",function(){function a(a,b){if(a.match("{{"))return b.tokenize=c,"tag";if(a.match("{%"))return b.tokenize=d,"tag";if(a.match("{#"))return b.tokenize=e,"comment";for(;null!=a.next()&&!a.match("{{",!1)&&!a.match("{%",!1););return null}function b(a,b){return function(c,d){if(!d.escapeNext&&c.eat(a))d.tokenize=b;else{d.escapeNext&&(d.escapeNext=!1);var e=c.next();"\\"==e&&(d.escapeNext=!0)}return"string"}}function c(c,d){if(d.waitDot){if(d.waitDot=!1,"."!=c.peek())return"null";if(c.match(/\.\W+/))return"error";if(c.eat("."))return d.waitProperty=!0,"null";throw Error("Unexpected error while waiting for property.")}if(d.waitPipe){if(d.waitPipe=!1,"|"!=c.peek())return"null";if(c.match(/\.\W+/))return"error";if(c.eat("|"))return d.waitFilter=!0,"null";throw Error("Unexpected error while waiting for filter.")}return d.waitProperty&&(d.waitProperty=!1,c.match(/\b(\w+)\b/))?(d.waitDot=!0,d.waitPipe=!0,"property"):d.waitFilter&&(d.waitFilter=!1,c.match(h))?"variable-2":c.eatSpace()?(d.waitProperty=!1,"null"):c.match(/\b\d+(\.\d+)?\b/)?"number":c.match("'")?(d.tokenize=b("'",d.tokenize),"string"):c.match('"')?(d.tokenize=b('"',d.tokenize),"string"):c.match(/\b(\w+)\b/)&&!d.foundVariable?(d.waitDot=!0,d.waitPipe=!0,"variable"):c.match("}}")?(d.waitProperty=null,d.waitFilter=null,d.waitDot=null,d.waitPipe=null,d.tokenize=a,"tag"):(c.next(),"null")}function d(c,d){if(d.waitDot){if(d.waitDot=!1,"."!=c.peek())return"null";if(c.match(/\.\W+/))return"error";if(c.eat("."))return d.waitProperty=!0,"null";throw Error("Unexpected error while waiting for property.")}if(d.waitPipe){if(d.waitPipe=!1,"|"!=c.peek())return"null";if(c.match(/\.\W+/))return"error";if(c.eat("|"))return d.waitFilter=!0,"null";throw Error("Unexpected error while waiting for filter.")}if(d.waitProperty&&(d.waitProperty=!1,c.match(/\b(\w+)\b/)))return d.waitDot=!0,d.waitPipe=!0,"property";if(d.waitFilter&&(d.waitFilter=!1,c.match(h)))return"variable-2";if(c.eatSpace())return d.waitProperty=!1,"null";if(c.match(/\b\d+(\.\d+)?\b/))return"number";if(c.match("'"))return d.tokenize=b("'",d.tokenize),"string";if(c.match('"'))return d.tokenize=b('"',d.tokenize),"string";if(c.match(i))return"operator";var e=c.match(g);return e?("comment"==e[0]&&(d.blockCommentTag=!0),"keyword"):c.match(/\b(\w+)\b/)?(d.waitDot=!0,d.waitPipe=!0,"variable"):c.match("%}")?(d.waitProperty=null,d.waitFilter=null,d.waitDot=null,d.waitPipe=null,d.blockCommentTag?(d.blockCommentTag=!1,d.tokenize=f):d.tokenize=a,"tag"):(c.next(),"null")}function e(b,c){return b.match("#}")&&(c.tokenize=a),"comment"}function f(a,b){return a.match(/\{%\s*endcomment\s*%\}/,!1)?(b.tokenize=d,a.match("{%"),"tag"):(a.next(),"comment")}var g=["block","endblock","for","endfor","true","false","loop","none","self","super","if","endif","as","else","import","with","endwith","without","context","ifequal","endifequal","ifnotequal","endifnotequal","extends","include","load","comment","endcomment","empty","url","static","trans","blocktrans","now","regroup","lorem","ifchanged","endifchanged","firstof","debug","cycle","csrf_token","autoescape","endautoescape","spaceless","ssi","templatetag","verbatim","endverbatim","widthratio"],h=["add","addslashes","capfirst","center","cut","date","default","default_if_none","dictsort","dictsortreversed","divisibleby","escape","escapejs","filesizeformat","first","floatformat","force_escape","get_digit","iriencode","join","last","length","length_is","linebreaks","linebreaksbr","linenumbers","ljust","lower","make_list","phone2numeric","pluralize","pprint","random","removetags","rjust","safe","safeseq","slice","slugify","stringformat","striptags","time","timesince","timeuntil","title","truncatechars","truncatechars_html","truncatewords","truncatewords_html","unordered_list","upper","urlencode","urlize","urlizetrunc","wordcount","wordwrap","yesno"],i=["==","!=","<",">","<=",">=","in","not","or","and"];return g=new RegExp("^\\b("+g.join("|")+")\\b"),h=new RegExp("^\\b("+h.join("|")+")\\b"),i=new RegExp("^\\b("+i.join("|")+")\\b"),{startState:function(){return{tokenize:a}},token:function(a,b){return b.tokenize(a,b)},blockCommentStart:"{% comment %}",blockCommentEnd:"{% endcomment %}"}}),a.defineMode("django",function(b){var c=a.getMode(b,"text/html"),d=a.getMode(b,"django:inner");return a.overlayMode(c,d)}),a.defineMIME("text/x-django","django")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/dockerfile/dockerfile.min.js b/media/editors/codemirror/mode/dockerfile/dockerfile.min.js +index 609af6f..13ef61e 100644 +--- a/media/editors/codemirror/mode/dockerfile/dockerfile.min.js ++++ b/media/editors/codemirror/mode/dockerfile/dockerfile.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],e):e(CodeMirror)}(function(e){"use strict";var n=["from","maintainer","run","cmd","expose","env","add","copy","entrypoint","volume","user","workdir","onbuild"],r="("+n.join("|")+")",o=new RegExp(r+"\\s*$","i"),t=new RegExp(r+"(\\s+)","i");e.defineSimpleMode("dockerfile",{start:[{regex:/#.*$/,token:"comment"},{regex:o,token:"variable-2"},{regex:t,token:["variable-2",null],next:"arguments"},{regex:/./,token:null}],arguments:[{regex:/#.*$/,token:"error",next:"start"},{regex:/[^#]+\\$/,token:null},{regex:/[^#]+/,token:null,next:"start"},{regex:/$/,token:null,next:"start"},{token:null,next:"start"}]}),e.defineMIME("text/x-dockerfile","dockerfile")}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],a):a(CodeMirror)}(function(a){"use strict";var b=["from","maintainer","run","cmd","expose","env","add","copy","entrypoint","volume","user","workdir","onbuild"],c="("+b.join("|")+")",d=new RegExp(c+"\\s*$","i"),e=new RegExp(c+"(\\s+)","i");a.defineSimpleMode("dockerfile",{start:[{regex:/#.*$/,token:"comment"},{regex:d,token:"variable-2"},{regex:e,token:["variable-2",null],next:"arguments"},{regex:/./,token:null}],arguments:[{regex:/#.*$/,token:"error",next:"start"},{regex:/[^#]+\\$/,token:null},{regex:/[^#]+/,token:null,next:"start"},{regex:/$/,token:null,next:"start"},{token:null,next:"start"}]}),a.defineMIME("text/x-dockerfile","dockerfile")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/dtd/dtd.min.js b/media/editors/codemirror/mode/dtd/dtd.min.js +index 5ebf52c..4197455 100644 +--- a/media/editors/codemirror/mode/dtd/dtd.min.js ++++ b/media/editors/codemirror/mode/dtd/dtd.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("dtd",function(t){function e(t,e){return a=e,t}function n(t,n){var a=t.next();if("<"!=a||!t.eat("!")){if("<"==a&&t.eat("?"))return n.tokenize=u("meta","?>"),e("meta",a);if("#"==a&&t.eatWhile(/[\w]/))return e("atom","tag");if("|"==a)return e("keyword","seperator");if(a.match(/[\(\)\[\]\-\.,\+\?>]/))return e(null,a);if(a.match(/[\[\]]/))return e("rule",a);if('"'==a||"'"==a)return n.tokenize=i(a),n.tokenize(t,n);if(t.eatWhile(/[a-zA-Z\?\+\d]/)){var o=t.current();return null!==o.substr(o.length-1,o.length).match(/\?|\+/)&&t.backUp(1),e("tag","tag")}return"%"==a||"*"==a?e("number","number"):(t.eatWhile(/[\w\\\-_%.{,]/),e(null,null))}return t.eatWhile(/[\-]/)?(n.tokenize=r,r(t,n)):t.eatWhile(/[\w]/)?e("keyword","doindent"):void 0}function r(t,r){for(var i,u=0;null!=(i=t.next());){if(u>=2&&">"==i){r.tokenize=n;break}u="-"==i?u+1:0}return e("comment","comment")}function i(t){return function(r,i){for(var u,a=!1;null!=(u=r.next());){if(u==t&&!a){i.tokenize=n;break}a=!a&&"\\"==u}return e("string","tag")}}function u(t,e){return function(r,i){for(;!r.eol();){if(r.match(e)){i.tokenize=n;break}r.next()}return t}}var a,o=t.indentUnit;return{startState:function(t){return{tokenize:n,baseIndent:t||0,stack:[]}},token:function(t,e){if(t.eatSpace())return null;var n=e.tokenize(t,e),r=e.stack[e.stack.length-1];return"["==t.current()||"doindent"===a||"["==a?e.stack.push("rule"):"endtag"===a?e.stack[e.stack.length-1]="endtag":"]"==t.current()||"]"==a||">"==a&&"rule"==r?e.stack.pop():"["==a&&e.stack.push("["),n},indent:function(t,e){var n=t.stack.length;return e.match(/\]\s+|\]/)?n-=1:">"===e.substr(e.length-1,e.length)&&("<"===e.substr(0,1)||"doindent"==a&&e.length>1||("doindent"==a?n--:">"==a&&e.length>1||"tag"==a&&">"!==e||("tag"==a&&"rule"==t.stack[t.stack.length-1]?n--:"tag"==a?n++:">"===e&&"rule"==t.stack[t.stack.length-1]&&">"===a?n--:">"===e&&"rule"==t.stack[t.stack.length-1]||("<"!==e.substr(0,1)&&">"===e.substr(0,1)?n-=1:">"===e||(n-=1)))),(null==a||"]"==a)&&n--),t.baseIndent+n*o},electricChars:"]>"}}),t.defineMIME("application/xml-dtd","dtd")}); +\ 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("dtd",function(a){function b(a,b){return g=b,a}function c(a,c){var g=a.next();if("<"!=g||!a.eat("!")){if("<"==g&&a.eat("?"))return c.tokenize=f("meta","?>"),b("meta",g);if("#"==g&&a.eatWhile(/[\w]/))return b("atom","tag");if("|"==g)return b("keyword","seperator");if(g.match(/[\(\)\[\]\-\.,\+\?>]/))return b(null,g);if(g.match(/[\[\]]/))return b("rule",g);if('"'==g||"'"==g)return c.tokenize=e(g),c.tokenize(a,c);if(a.eatWhile(/[a-zA-Z\?\+\d]/)){var h=a.current();return null!==h.substr(h.length-1,h.length).match(/\?|\+/)&&a.backUp(1),b("tag","tag")}return"%"==g||"*"==g?b("number","number"):(a.eatWhile(/[\w\\\-_%.{,]/),b(null,null))}return a.eatWhile(/[\-]/)?(c.tokenize=d,d(a,c)):a.eatWhile(/[\w]/)?b("keyword","doindent"):void 0}function d(a,d){for(var e,f=0;null!=(e=a.next());){if(f>=2&&">"==e){d.tokenize=c;break}f="-"==e?f+1:0}return b("comment","comment")}function e(a){return function(d,e){for(var f,g=!1;null!=(f=d.next());){if(f==a&&!g){e.tokenize=c;break}g=!g&&"\\"==f}return b("string","tag")}}function f(a,b){return function(d,e){for(;!d.eol();){if(d.match(b)){e.tokenize=c;break}d.next()}return a}}var g,h=a.indentUnit;return{startState:function(a){return{tokenize:c,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b),d=b.stack[b.stack.length-1];return"["==a.current()||"doindent"===g||"["==g?b.stack.push("rule"):"endtag"===g?b.stack[b.stack.length-1]="endtag":"]"==a.current()||"]"==g||">"==g&&"rule"==d?b.stack.pop():"["==g&&b.stack.push("["),c},indent:function(a,b){var c=a.stack.length;return b.match(/\]\s+|\]/)?c-=1:">"===b.substr(b.length-1,b.length)&&("<"===b.substr(0,1)||"doindent"==g&&b.length>1||("doindent"==g?c--:">"==g&&b.length>1||"tag"==g&&">"!==b||("tag"==g&&"rule"==a.stack[a.stack.length-1]?c--:"tag"==g?c++:">"===b&&"rule"==a.stack[a.stack.length-1]&&">"===g?c--:">"===b&&"rule"==a.stack[a.stack.length-1]||("<"!==b.substr(0,1)&&">"===b.substr(0,1)?c-=1:">"===b||(c-=1)))),(null==g||"]"==g)&&c--),a.baseIndent+c*h},electricChars:"]>"}}),a.defineMIME("application/xml-dtd","dtd")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/dylan/dylan.js b/media/editors/codemirror/mode/dylan/dylan.js +index be2986a..85f0166 100644 +--- a/media/editors/codemirror/mode/dylan/dylan.js ++++ b/media/editors/codemirror/mode/dylan/dylan.js +@@ -154,20 +154,12 @@ CodeMirror.defineMode("dylan", function(_config) { + return f(stream, state); + } + +- var type, content; +- +- function ret(_type, style, _content) { +- type = _type; +- content = _content; +- return style; +- } +- + function tokenBase(stream, state) { + // String + var ch = stream.peek(); + if (ch == "'" || ch == '"') { + stream.next(); +- return chain(stream, state, tokenString(ch, "string", "string")); ++ return chain(stream, state, tokenString(ch, "string")); + } + // Comment + else if (ch == "/") { +@@ -176,16 +168,16 @@ CodeMirror.defineMode("dylan", function(_config) { + return chain(stream, state, tokenComment); + } else if (stream.eat("/")) { + stream.skipToEnd(); +- return ret("comment", "comment"); ++ return "comment"; + } else { + stream.skipTo(" "); +- return ret("operator", "operator"); ++ return "operator"; + } + } + // Decimal + else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/); +- return ret("number", "number"); ++ return "number"; + } + // Hash + else if (ch == "#") { +@@ -194,33 +186,33 @@ CodeMirror.defineMode("dylan", function(_config) { + ch = stream.peek(); + if (ch == '"') { + stream.next(); +- return chain(stream, state, tokenString('"', "symbol", "string-2")); ++ return chain(stream, state, tokenString('"', "string-2")); + } + // Binary number + else if (ch == "b") { + stream.next(); + stream.eatWhile(/[01]/); +- return ret("number", "number"); ++ return "number"; + } + // Hex number + else if (ch == "x") { + stream.next(); + stream.eatWhile(/[\da-f]/i); +- return ret("number", "number"); ++ return "number"; + } + // Octal number + else if (ch == "o") { + stream.next(); + stream.eatWhile(/[0-7]/); +- return ret("number", "number"); ++ return "number"; + } + // Hash symbol + else { + stream.eatWhile(/[-a-zA-Z]/); +- return ret("hash", "keyword"); ++ return "keyword"; + } + } else if (stream.match("end")) { +- return ret("end", "keyword"); ++ return "keyword"; + } + for (var name in patterns) { + if (patterns.hasOwnProperty(name)) { +@@ -228,21 +220,21 @@ CodeMirror.defineMode("dylan", function(_config) { + if ((pattern instanceof Array && pattern.some(function(p) { + return stream.match(p); + })) || stream.match(pattern)) +- return ret(name, patternStyles[name], stream.current()); ++ return patternStyles[name]; + } + } + if (stream.match("define")) { +- return ret("definition", "def"); ++ return "def"; + } else { + stream.eatWhile(/[\w\-]/); + // Keyword + if (wordLookup[stream.current()]) { +- return ret(wordLookup[stream.current()], styleLookup[stream.current()], stream.current()); ++ return styleLookup[stream.current()]; + } else if (stream.current().match(symbol)) { +- return ret("variable", "variable"); ++ return "variable"; + } else { + stream.next(); +- return ret("other", "variable-2"); ++ return "variable-2"; + } + } + } +@@ -257,10 +249,10 @@ CodeMirror.defineMode("dylan", function(_config) { + } + maybeEnd = (ch == "*"); + } +- return ret("comment", "comment"); ++ return "comment"; + } + +- function tokenString(quote, type, style) { ++ function tokenString(quote, style) { + return function(stream, state) { + var next, end = false; + while ((next = stream.next()) != null) { +@@ -271,7 +263,7 @@ CodeMirror.defineMode("dylan", function(_config) { + } + if (end) + state.tokenize = tokenBase; +- return ret(type, style); ++ return style; + }; + } + +diff --git a/media/editors/codemirror/mode/dylan/dylan.min.js b/media/editors/codemirror/mode/dylan/dylan.min.js +index 2abfa10..550880b 100644 +--- a/media/editors/codemirror/mode/dylan/dylan.min.js ++++ b/media/editors/codemirror/mode/dylan/dylan.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("dylan",function(){function e(e,n,t){return n.tokenize=t,t(e,n)}function n(e,n,t){return b=e,p=t,n}function t(t,o){var a=t.peek();if("'"==a||'"'==a)return t.next(),e(t,o,r(a,"string","string"));if("/"==a)return t.next(),t.eat("*")?e(t,o,i):t.eat("/")?(t.skipToEnd(),n("comment","comment")):(t.skipTo(" "),n("operator","operator"));if(/\d/.test(a))return t.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/),n("number","number");if("#"==a)return t.next(),a=t.peek(),'"'==a?(t.next(),e(t,o,r('"',"symbol","string-2"))):"b"==a?(t.next(),t.eatWhile(/[01]/),n("number","number")):"x"==a?(t.next(),t.eatWhile(/[\da-f]/i),n("number","number")):"o"==a?(t.next(),t.eatWhile(/[0-7]/),n("number","number")):(t.eatWhile(/[-a-zA-Z]/),n("hash","keyword"));if(t.match("end"))return n("end","keyword");for(var m in c)if(c.hasOwnProperty(m)){var u=c[m];if(u instanceof Array&&u.some(function(e){return t.match(e)})||t.match(u))return n(m,f[m],t.current())}return t.match("define")?n("definition","def"):(t.eatWhile(/[\w\-]/),s[t.current()]?n(s[t.current()],d[t.current()],t.current()):t.current().match(l)?n("variable","variable"):(t.next(),n("other","variable-2")))}function i(e,i){for(var r,o=!1;r=e.next();){if("/"==r&&o){i.tokenize=t;break}o="*"==r}return n("comment","comment")}function r(e,i,r){return function(o,a){for(var l,c=!1;null!=(l=o.next());)if(l==e){c=!0;break}return c&&(a.tokenize=t),n(i,r)}}var o={unnamedDefinition:["interface"],namedDefinition:["module","library","macro","C-struct","C-union","C-function","C-callable-wrapper"],typeParameterizedDefinition:["class","C-subtype","C-mapped-subtype"],otherParameterizedDefinition:["method","function","C-variable","C-address"],constantSimpleDefinition:["constant"],variableSimpleDefinition:["variable"],otherSimpleDefinition:["generic","domain","C-pointer-type","table"],statement:["if","block","begin","method","case","for","select","when","unless","until","while","iterate","profiling","dynamic-bind"],separator:["finally","exception","cleanup","else","elseif","afterwards"],other:["above","below","by","from","handler","in","instance","let","local","otherwise","slot","subclass","then","to","keyed-by","virtual"],signalingCalls:["signal","error","cerror","break","check-type","abort"]};o.otherDefinition=o.unnamedDefinition.concat(o.namedDefinition).concat(o.otherParameterizedDefinition),o.definition=o.typeParameterizedDefinition.concat(o.otherDefinition),o.parameterizedDefinition=o.typeParameterizedDefinition.concat(o.otherParameterizedDefinition),o.simpleDefinition=o.constantSimpleDefinition.concat(o.variableSimpleDefinition).concat(o.otherSimpleDefinition),o.keyword=o.statement.concat(o.separator).concat(o.other);var a="[-_a-zA-Z?!*@<>$%]+",l=new RegExp("^"+a),c={symbolKeyword:a+":",symbolClass:"<"+a+">",symbolGlobal:"\\*"+a+"\\*",symbolConstant:"\\$"+a},f={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variable-2",symbolConstant:"variable-3"};for(var m in c)c.hasOwnProperty(m)&&(c[m]=new RegExp("^"+c[m]));c.keyword=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var u={};u.keyword="keyword",u.definition="def",u.simpleDefinition="def",u.signalingCalls="builtin";var s={},d={};["keyword","definition","simpleDefinition","signalingCalls"].forEach(function(e){o[e].forEach(function(n){s[n]=e,d[n]=u[e]})});var b,p;return{startState:function(){return{tokenize:t,currentIndent:0}},token:function(e,n){if(e.eatSpace())return null;var t=n.tokenize(e,n);return t},blockCommentStart:"/*",blockCommentEnd:"*/"}}),e.defineMIME("text/x-dylan","dylan")}); +\ 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("dylan",function(a){function b(a,b,c){return b.tokenize=c,c(a,b)}function c(a,c){var f=a.peek();if("'"==f||'"'==f)return a.next(),b(a,c,e(f,"string"));if("/"==f)return a.next(),a.eat("*")?b(a,c,d):a.eat("/")?(a.skipToEnd(),"comment"):(a.skipTo(" "),"operator");if(/\d/.test(f))return a.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/),"number";if("#"==f)return a.next(),f=a.peek(),'"'==f?(a.next(),b(a,c,e('"',"string-2"))):"b"==f?(a.next(),a.eatWhile(/[01]/),"number"):"x"==f?(a.next(),a.eatWhile(/[\da-f]/i),"number"):"o"==f?(a.next(),a.eatWhile(/[0-7]/),"number"):(a.eatWhile(/[-a-zA-Z]/),"keyword");if(a.match("end"))return"keyword";for(var g in i)if(i.hasOwnProperty(g)){var k=i[g];if(k instanceof Array&&k.some(function(b){return a.match(b)})||a.match(k))return j[g]}return a.match("define")?"def":(a.eatWhile(/[\w\-]/),m[a.current()]?n[a.current()]:a.current().match(h)?"variable":(a.next(),"variable-2"))}function d(a,b){for(var d,e=!1;d=a.next();){if("/"==d&&e){b.tokenize=c;break}e="*"==d}return"comment"}function e(a,b){return function(d,e){for(var f,g=!1;null!=(f=d.next());)if(f==a){g=!0;break}return g&&(e.tokenize=c),b}}var f={unnamedDefinition:["interface"],namedDefinition:["module","library","macro","C-struct","C-union","C-function","C-callable-wrapper"],typeParameterizedDefinition:["class","C-subtype","C-mapped-subtype"],otherParameterizedDefinition:["method","function","C-variable","C-address"],constantSimpleDefinition:["constant"],variableSimpleDefinition:["variable"],otherSimpleDefinition:["generic","domain","C-pointer-type","table"],statement:["if","block","begin","method","case","for","select","when","unless","until","while","iterate","profiling","dynamic-bind"],separator:["finally","exception","cleanup","else","elseif","afterwards"],other:["above","below","by","from","handler","in","instance","let","local","otherwise","slot","subclass","then","to","keyed-by","virtual"],signalingCalls:["signal","error","cerror","break","check-type","abort"]};f.otherDefinition=f.unnamedDefinition.concat(f.namedDefinition).concat(f.otherParameterizedDefinition),f.definition=f.typeParameterizedDefinition.concat(f.otherDefinition),f.parameterizedDefinition=f.typeParameterizedDefinition.concat(f.otherParameterizedDefinition),f.simpleDefinition=f.constantSimpleDefinition.concat(f.variableSimpleDefinition).concat(f.otherSimpleDefinition),f.keyword=f.statement.concat(f.separator).concat(f.other);var g="[-_a-zA-Z?!*@<>$%]+",h=new RegExp("^"+g),i={symbolKeyword:g+":",symbolClass:"<"+g+">",symbolGlobal:"\\*"+g+"\\*",symbolConstant:"\\$"+g},j={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variable-2",symbolConstant:"variable-3"};for(var k in i)i.hasOwnProperty(k)&&(i[k]=new RegExp("^"+i[k]));i.keyword=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var l={};l.keyword="keyword",l.definition="def",l.simpleDefinition="def",l.signalingCalls="builtin";var m={},n={};return["keyword","definition","simpleDefinition","signalingCalls"].forEach(function(a){f[a].forEach(function(b){m[b]=a,n[b]=l[a]})}),{startState:function(){return{tokenize:c,currentIndent:0}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c},blockCommentStart:"/*",blockCommentEnd:"*/"}}),a.defineMIME("text/x-dylan","dylan")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/ebnf/ebnf.min.js b/media/editors/codemirror/mode/ebnf/ebnf.min.js +index 01bf41b..8c0cfbb 100644 +--- a/media/editors/codemirror/mode/ebnf/ebnf.min.js ++++ b/media/editors/codemirror/mode/ebnf/ebnf.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ebnf",function(t){var a={slash:0,parenthesis:1},r={comment:0,_string:1,characterClass:2},c=null;return t.bracesMode&&(c=e.getMode(t,t.bracesMode)),{startState:function(){return{stringType:null,commentType:null,braced:0,lhs:!0,localState:null,stack:[],inDefinition:!1}},token:function(e,t){if(e){switch(0===t.stack.length&&('"'==e.peek()||"'"==e.peek()?(t.stringType=e.peek(),e.next(),t.stack.unshift(r._string)):e.match(/^\/\*/)?(t.stack.unshift(r.comment),t.commentType=a.slash):e.match(/^\(\*/)&&(t.stack.unshift(r.comment),t.commentType=a.parenthesis)),t.stack[0]){case r._string:for(;t.stack[0]===r._string&&!e.eol();)e.peek()===t.stringType?(e.next(),t.stack.shift()):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string";case r.comment:for(;t.stack[0]===r.comment&&!e.eol();)t.commentType===a.slash&&e.match(/\*\//)?(t.stack.shift(),t.commentType=null):t.commentType===a.parenthesis&&e.match(/\*\)/)?(t.stack.shift(),t.commentType=null):e.match(/^.[^\*]*/);return"comment";case r.characterClass:for(;t.stack[0]===r.characterClass&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(/^\\./)||t.stack.shift();return"operator"}var n=e.peek();if(null!==c&&(t.braced||"{"===n)){null===t.localState&&(t.localState=c.startState());var s=c.token(e,t.localState),i=e.current();if(!s)for(var o=0;o>/))return"builtin"}return e.match(/^\/\//)?(e.skipToEnd(),"comment"):e.match(/return/)?"operator":e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)?e.match(/(?=[\(.])/)?"variable":e.match(/(?=[\s\n]*[:=])/)?"def":"variable-2":-1!=["[","]","(",")"].indexOf(e.peek())?(e.next(),"bracket"):(e.eatSpace()||e.next(),null)}}}}),e.defineMIME("text/x-ebnf","ebnf")}); +\ 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("ebnf",function(b){var c={slash:0,parenthesis:1},d={comment:0,_string:1,characterClass:2},e=null;return b.bracesMode&&(e=a.getMode(b,b.bracesMode)),{startState:function(){return{stringType:null,commentType:null,braced:0,lhs:!0,localState:null,stack:[],inDefinition:!1}},token:function(a,b){if(a){switch(0===b.stack.length&&('"'==a.peek()||"'"==a.peek()?(b.stringType=a.peek(),a.next(),b.stack.unshift(d._string)):a.match(/^\/\*/)?(b.stack.unshift(d.comment),b.commentType=c.slash):a.match(/^\(\*/)&&(b.stack.unshift(d.comment),b.commentType=c.parenthesis)),b.stack[0]){case d._string:for(;b.stack[0]===d._string&&!a.eol();)a.peek()===b.stringType?(a.next(),b.stack.shift()):"\\"===a.peek()?(a.next(),a.next()):a.match(/^.[^\\\"\']*/);return b.lhs?"property string":"string";case d.comment:for(;b.stack[0]===d.comment&&!a.eol();)b.commentType===c.slash&&a.match(/\*\//)?(b.stack.shift(),b.commentType=null):b.commentType===c.parenthesis&&a.match(/\*\)/)?(b.stack.shift(),b.commentType=null):a.match(/^.[^\*]*/);return"comment";case d.characterClass:for(;b.stack[0]===d.characterClass&&!a.eol();)a.match(/^[^\]\\]+/)||a.match(/^\\./)||b.stack.shift();return"operator"}var f=a.peek();if(null!==e&&(b.braced||"{"===f)){null===b.localState&&(b.localState=e.startState());var g=e.token(a,b.localState),h=a.current();if(!g)for(var i=0;i>/))return"builtin"}return a.match(/^\/\//)?(a.skipToEnd(),"comment"):a.match(/return/)?"operator":a.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)?a.match(/(?=[\(.])/)?"variable":a.match(/(?=[\s\n]*[:=])/)?"def":"variable-2":-1!=["[","]","(",")"].indexOf(a.peek())?(a.next(),"bracket"):(a.eatSpace()||a.next(),null)}}}}),a.defineMIME("text/x-ebnf","ebnf")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/ecl/ecl.js b/media/editors/codemirror/mode/ecl/ecl.js +index 18778f1..8df7ebe 100644 +--- a/media/editors/codemirror/mode/ecl/ecl.js ++++ b/media/editors/codemirror/mode/ecl/ecl.js +@@ -34,7 +34,6 @@ CodeMirror.defineMode("ecl", function(config) { + var blockKeywords = words("catch class do else finally for if switch try while"); + var atoms = words("true false null"); + var hooks = {"#": metaHook}; +- var multiLineStrings; + var isOperatorChar = /[+\-*&%=<>!?|\/]/; + + var curPunc; +@@ -112,7 +111,7 @@ CodeMirror.defineMode("ecl", function(config) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } +- if (end || !(escaped || multiLineStrings)) ++ if (end || !escaped) + state.tokenize = tokenBase; + return "string"; + }; +diff --git a/media/editors/codemirror/mode/ecl/ecl.min.js b/media/editors/codemirror/mode/ecl/ecl.min.js +index 31a372f..1858461 100644 +--- a/media/editors/codemirror/mode/ecl/ecl.min.js ++++ b/media/editors/codemirror/mode/ecl/ecl.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ecl",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r=0&&(!isNaN(a[l])||"_"==a[l]);)--l;if(l>0){var s=a.substr(0,l+1);if(h.propertyIsEnumerable(s))return b.propertyIsEnumerable(s)&&(u="newstatement"),"variable-3"}return g.propertyIsEnumerable(a)?"atom":null}function o(e){return function(t,n){for(var o,i=!1,a=!1;null!=(o=t.next());){if(o==e&&!i){a=!0;break}i=!i&&"\\"==o}return(a||!i&&!c)&&(n.tokenize=r),"string"}}function i(e,t){for(var n,o=!1;n=e.next();){if("/"==n&&o){t.tokenize=r;break}o="*"==n}return"comment"}function a(e,t,n,r,o){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=o}function l(e,t,n){return e.context=new a(e.indented,t,n,null,e.context)}function s(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var c,u,d=e.indentUnit,p=t("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"),f=t("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"),m=t("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"),h=t("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"),y=t("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"),b=t("catch class do else finally for if switch try while"),g=t("true false null"),v={"#":n},x=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new a((e||0)-d,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;u=null;var o=(t.tokenize||r)(e,t);if("comment"==o||"meta"==o)return o;if(null==n.align&&(n.align=!0),";"!=u&&":"!=u||"statement"!=n.type)if("{"==u)l(t,e.column(),"}");else if("["==u)l(t,e.column(),"]");else if("("==u)l(t,e.column(),")");else if("}"==u){for(;"statement"==n.type;)n=s(t);for("}"==n.type&&(n=s(t));"statement"==n.type;)n=s(t)}else u==n.type?s(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==u)&&l(t,e.column(),"statement");else s(t);return t.startOfLine=!1,o},indent:function(e,t){if(e.tokenize!=r&&null!=e.tokenize)return 0;var n=e.context,o=t&&t.charAt(0);"statement"==n.type&&"}"==o&&(n=n.prev);var i=o==n.type;return"statement"==n.type?n.indented+("{"==o?0:d):n.align?n.column+(i?0:1):n.indented+(i?0:d)},electricChars:"{}"}}),e.defineMIME("text/x-ecl","ecl")}); +\ 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("ecl",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d=0&&(!isNaN(g[h])||"_"==g[h]);)--h;if(h>0){var i=g.substr(0,h+1);if(o.propertyIsEnumerable(i))return q.propertyIsEnumerable(i)&&(j="newstatement"),"variable-3"}return r.propertyIsEnumerable(g)?"atom":null}function e(a){return function(b,c){for(var e,f=!1,g=!1;null!=(e=b.next());){if(e==a&&!f){g=!0;break}f=!f&&"\\"==e}return(g||!f)&&(c.tokenize=d),"string"}}function f(a,b){for(var c,e=!1;c=a.next();){if("/"==c&&e){b.tokenize=d;break}e="*"==c}return"comment"}function g(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function h(a,b,c){return a.context=new g(a.indented,b,c,null,a.context)}function i(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var j,k=a.indentUnit,l=b("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"),m=b("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"),n=b("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"),o=b("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"),p=b("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"),q=b("catch class do else finally for if switch try while"),r=b("true false null"),s={"#":c},t=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new g((a||0)-k,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;j=null;var e=(b.tokenize||d)(a,b);if("comment"==e||"meta"==e)return e;if(null==c.align&&(c.align=!0),";"!=j&&":"!=j||"statement"!=c.type)if("{"==j)h(b,a.column(),"}");else if("["==j)h(b,a.column(),"]");else if("("==j)h(b,a.column(),")");else if("}"==j){for(;"statement"==c.type;)c=i(b);for("}"==c.type&&(c=i(b));"statement"==c.type;)c=i(b)}else j==c.type?i(b):("}"==c.type||"top"==c.type||"statement"==c.type&&"newstatement"==j)&&h(b,a.column(),"statement");else i(b);return b.startOfLine=!1,e},indent:function(a,b){if(a.tokenize!=d&&null!=a.tokenize)return 0;var c=a.context,e=b&&b.charAt(0);"statement"==c.type&&"}"==e&&(c=c.prev);var f=e==c.type;return"statement"==c.type?c.indented+("{"==e?0:k):c.align?c.column+(f?0:1):c.indented+(f?0:k)},electricChars:"{}"}}),a.defineMIME("text/x-ecl","ecl")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/eiffel/eiffel.js b/media/editors/codemirror/mode/eiffel/eiffel.js +index fcdf295..b8b70e36 100644 +--- a/media/editors/codemirror/mode/eiffel/eiffel.js ++++ b/media/editors/codemirror/mode/eiffel/eiffel.js +@@ -84,7 +84,6 @@ CodeMirror.defineMode("eiffel", function() { + 'or' + ]); + var operators = wordObj([":=", "and then","and", "or","<<",">>"]); +- var curPunc; + + function chain(newtok, stream, state) { + state.tokenize.push(newtok); +@@ -92,7 +91,6 @@ CodeMirror.defineMode("eiffel", function() { + } + + function tokenBase(stream, state) { +- curPunc = null; + if (stream.eatSpace()) return null; + var ch = stream.next(); + if (ch == '"'||ch == "'") { +diff --git a/media/editors/codemirror/mode/eiffel/eiffel.min.js b/media/editors/codemirror/mode/eiffel/eiffel.min.js +index 7d8843e..59d7d0a 100644 +--- a/media/editors/codemirror/mode/eiffel/eiffel.min.js ++++ b/media/editors/codemirror/mode/eiffel/eiffel.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("eiffel",function(){function e(e){for(var t={},r=0,n=e.length;n>r;++r)t[e[r]]=!0;return t}function t(e,t,r){return r.tokenize.push(e),e(t,r)}function r(e,r){if(i=null,e.eatSpace())return null;var o=e.next();return'"'==o||"'"==o?t(n(o,"string"),e,r):"-"==o&&e.eat("-")?(e.skipToEnd(),"comment"):":"==o&&e.eat("=")?"operator":/[0-9]/.test(o)?(e.eatWhile(/[xXbBCc0-9\.]/),e.eat(/[\?\!]/),"ident"):/[a-zA-Z_0-9]/.test(o)?(e.eatWhile(/[a-zA-Z_0-9]/),e.eat(/[\?\!]/),"ident"):/[=+\-\/*^%<>~]/.test(o)?(e.eatWhile(/[=+\-\/*^%<>~]/),"operator"):null}function n(e,t,r){return function(n,i){for(var o,a=!1;null!=(o=n.next());){if(o==e&&(r||!a)){i.tokenize.pop();break}a=!a&&"%"==o}return t}}var i,o=e(["note","across","when","variant","until","unique","undefine","then","strip","select","retry","rescue","require","rename","reference","redefine","prefix","once","old","obsolete","loop","local","like","is","inspect","infix","include","if","frozen","from","external","export","ensure","end","elseif","else","do","creation","create","check","alias","agent","separate","invariant","inherit","indexing","feature","expanded","deferred","class","Void","True","Result","Precursor","False","Current","create","attached","detachable","as","and","implies","not","or"]),a=e([":=","and then","and","or","<<",">>"]);return{startState:function(){return{tokenize:[r]}},token:function(e,t){var r=t.tokenize[t.tokenize.length-1](e,t);if("ident"==r){var n=e.current();r=o.propertyIsEnumerable(e.current())?"keyword":a.propertyIsEnumerable(e.current())?"operator":/^[A-Z][A-Z_0-9]*$/g.test(n)?"tag":/^0[bB][0-1]+$/g.test(n)?"number":/^0[cC][0-7]+$/g.test(n)?"number":/^0[xX][a-fA-F0-9]+$/g.test(n)?"number":/^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(n)?"number":/^[0-9]+$/g.test(n)?"number":"variable"}return r},lineComment:"--"}}),e.defineMIME("text/x-eiffel","eiffel")}); +\ 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("eiffel",function(){function a(a){for(var b={},c=0,d=a.length;d>c;++c)b[a[c]]=!0;return b}function b(a,b,c){return c.tokenize.push(a),a(b,c)}function c(a,c){if(a.eatSpace())return null;var e=a.next();return'"'==e||"'"==e?b(d(e,"string"),a,c):"-"==e&&a.eat("-")?(a.skipToEnd(),"comment"):":"==e&&a.eat("=")?"operator":/[0-9]/.test(e)?(a.eatWhile(/[xXbBCc0-9\.]/),a.eat(/[\?\!]/),"ident"):/[a-zA-Z_0-9]/.test(e)?(a.eatWhile(/[a-zA-Z_0-9]/),a.eat(/[\?\!]/),"ident"):/[=+\-\/*^%<>~]/.test(e)?(a.eatWhile(/[=+\-\/*^%<>~]/),"operator"):null}function d(a,b,c){return function(d,e){for(var f,g=!1;null!=(f=d.next());){if(f==a&&(c||!g)){e.tokenize.pop();break}g=!g&&"%"==f}return b}}var e=a(["note","across","when","variant","until","unique","undefine","then","strip","select","retry","rescue","require","rename","reference","redefine","prefix","once","old","obsolete","loop","local","like","is","inspect","infix","include","if","frozen","from","external","export","ensure","end","elseif","else","do","creation","create","check","alias","agent","separate","invariant","inherit","indexing","feature","expanded","deferred","class","Void","True","Result","Precursor","False","Current","create","attached","detachable","as","and","implies","not","or"]),f=a([":=","and then","and","or","<<",">>"]);return{startState:function(){return{tokenize:[c]}},token:function(a,b){var c=b.tokenize[b.tokenize.length-1](a,b);if("ident"==c){var d=a.current();c=e.propertyIsEnumerable(a.current())?"keyword":f.propertyIsEnumerable(a.current())?"operator":/^[A-Z][A-Z_0-9]*$/g.test(d)?"tag":/^0[bB][0-1]+$/g.test(d)?"number":/^0[cC][0-7]+$/g.test(d)?"number":/^0[xX][a-fA-F0-9]+$/g.test(d)?"number":/^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(d)?"number":/^[0-9]+$/g.test(d)?"number":"variable"}return c},lineComment:"--"}}),a.defineMIME("text/x-eiffel","eiffel")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/erlang/erlang.min.js b/media/editors/codemirror/mode/erlang/erlang.min.js +index 40744bd..963bd25 100644 +--- a/media/editors/codemirror/mode/erlang/erlang.min.js ++++ b/media/editors/codemirror/mode/erlang/erlang.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMIME("text/x-erlang","erlang"),e.defineMode("erlang",function(t){function n(e,t){if(t.in_string)return t.in_string=!i(e),l(t,e,"string");if(t.in_atom)return t.in_atom=!a(e),l(t,e,"atom");if(e.eatSpace())return l(t,e,"whitespace");if(!m(t)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return s(e.current(),W)?l(t,e,"type"):l(t,e,"attribute");var n=e.next();if("%"==n)return e.skipToEnd(),l(t,e,"comment");if(":"==n)return l(t,e,"colon");if("?"==n)return e.eatSpace(),e.eatWhile($),l(t,e,"macro");if("#"==n)return e.eatSpace(),e.eatWhile($),l(t,e,"record");if("$"==n)return"\\"!=e.next()||e.match(B)?l(t,e,"number"):l(t,e,"error");if("."==n)return l(t,e,"dot");if("'"==n){if(!(t.in_atom=!a(e))){if(e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),l(t,e,"fun");if(e.match(/\s*\(/,!1)||e.match(/\s*:/,!1))return l(t,e,"function")}return l(t,e,"atom")}if('"'==n)return t.in_string=!i(e),l(t,e,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(n))return e.eatWhile($),l(t,e,"variable");if(/[a-z_ß-öø-ÿ]/.test(n)){if(e.eatWhile($),e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),l(t,e,"fun");var c=e.current();return s(c,U)?l(t,e,"keyword"):s(c,Z)?l(t,e,"operator"):e.match(/\s*\(/,!1)?!s(c,T)||":"==m(t).token&&"erlang"!=m(t,2).token?s(c,O)?l(t,e,"guard"):l(t,e,"function"):l(t,e,"builtin"):s(c,Z)?l(t,e,"operator"):":"==u(e)?"erlang"==c?l(t,e,"builtin"):l(t,e,"function"):s(c,["true","false"])?l(t,e,"boolean"):s(c,["true","false"])?l(t,e,"boolean"):l(t,e,"atom")}var _=/[0-9]/,f=/[0-9a-zA-Z]/;return _.test(n)?(e.eatWhile(_),e.eat("#")?e.eatWhile(f)||e.backUp(1):e.eat(".")&&(e.eatWhile(_)?e.eat(/[eE]/)&&(e.eat(/[-+]/)?e.eatWhile(_)||e.backUp(2):e.eatWhile(_)||e.backUp(1)):e.backUp(1)),l(t,e,"number")):r(e,P,j)?l(t,e,"open_paren"):r(e,C,I)?l(t,e,"close_paren"):o(e,E,A)?l(t,e,"separator"):o(e,M,q)?l(t,e,"operator"):l(t,e,null)}function r(e,t,n){if(1==e.current().length&&t.test(e.current())){for(e.backUp(1);t.test(e.peek());)if(e.next(),s(e.current(),n))return!0;e.backUp(e.current().length-1)}return!1}function o(e,t,n){if(1==e.current().length&&t.test(e.current())){for(;t.test(e.peek());)e.next();for(;0n?!1:e.tokenStack[n-r]}function d(e,t){"comment"!=t.type&&"whitespace"!=t.type&&(e.tokenStack=b(e.tokenStack,t),e.tokenStack=g(e.tokenStack))}function b(e,t){var n=e.length-1;return n>0&&"record"===e[n].type&&"dot"===t.type?e.pop():n>0&&"group"===e[n].type?(e.pop(),e.push(t)):e.push(t),e}function g(e){var t=e.length-1;if("dot"===e[t].type)return[];if("fun"===e[t].type&&"fun"===e[t-1].token)return e.slice(0,t-1);switch(e[e.length-1].token){case"}":return k(e,{g:["{"]});case"]":return k(e,{i:["["]});case")":return k(e,{i:["("]});case">>":return k(e,{i:["<<"]});case"end":return k(e,{i:["begin","case","fun","if","receive","try"]});case",":return k(e,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return k(e,{r:["when"],m:["try","if","case","receive"]});case";":return k(e,{E:["case","fun","if","receive","try","when"]});case"catch":return k(e,{e:["try"]});case"of":return k(e,{e:["case"]});case"after":return k(e,{e:["receive","try"]});default:return e}}function k(e,t){for(var n in t)for(var r=e.length-1,o=t[n],i=r-1;i>-1;i--)if(s(e[i].token,o)){var a=e.slice(0,i);switch(n){case"m":return a.concat(e[i]).concat(e[r]);case"r":return a.concat(e[r]);case"i":return a;case"g":return a.concat(p("group"));case"E":return a.concat(e[i]);case"e":return a.concat(e[i])}}return"E"==n?[]:e}function h(n,r){var o,i=t.indentUnit,a=y(r),c=m(n,1),u=m(n,2);return n.in_string||n.in_atom?e.Pass:u?"when"==c.token?c.column+i:"when"===a&&"function"===u.type?u.indent+i:"("===a&&"fun"===c.token?c.column+3:"catch"===a&&(o=x(n,["try"]))?o.column:s(a,["end","after","of"])?(o=x(n,["begin","case","fun","if","receive","try"]),o?o.column:e.Pass):s(a,I)?(o=x(n,j),o?o.column:e.Pass):s(c.token,[",","|","||"])||s(a,[",","|","||"])?(o=v(n),o?o.column+o.token.length:i):"->"==c.token?s(u.token,["receive","case","if","try"])?u.column+i+i:u.column+i:s(c.token,j)?c.column+c.token.length:(o=w(n),z(o)?o.column+i:0):0}function y(e){var t=e.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return z(t)&&0===t.index?t[0]:""}function v(e){var t=e.tokenStack.slice(0,-1),n=S(t,"type",["open_paren"]);return z(t[n])?t[n]:!1}function w(e){var t=e.tokenStack,n=S(t,"type",["open_paren","separator","keyword"]),r=S(t,"type",["operator"]);return z(n)&&z(r)&&r>n?t[n+1]:z(n)?t[n]:!1}function x(e,t){var n=e.tokenStack,r=S(n,"token",t);return z(n[r])?n[r]:!1}function S(e,t,n){for(var r=e.length-1;r>-1;r--)if(s(e[r][t],n))return r;return!1}function z(e){return e!==!1&&null!=e}var W=["-type","-spec","-export_type","-opaque"],U=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],E=/[\->,;]/,A=["->",";",","],Z=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],M=/[\+\-\*\/<>=\|:!]/,q=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],P=/[<\(\[\{]/,j=["<<","(","[","{"],C=/[>\)\]\}]/,I=["}","]",")",">>"],O=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],T=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],$=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,B=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(e,t){return n(e,t)},indent:function(e,t){return h(e,t)},lineComment:"%"}})}); +\ 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.defineMIME("text/x-erlang","erlang"),a.defineMode("erlang",function(b){function c(a,b){if(b.in_string)return b.in_string=!f(a),k(b,a,"string");if(b.in_atom)return b.in_atom=!g(a),k(b,a,"atom");if(a.eatSpace())return k(b,a,"whitespace");if(!o(b)&&a.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return j(a.current(),A)?k(b,a,"type"):k(b,a,"attribute");var c=a.next();if("%"==c)return a.skipToEnd(),k(b,a,"comment");if(":"==c)return k(b,a,"colon");if("?"==c)return a.eatSpace(),a.eatWhile(N),k(b,a,"macro");if("#"==c)return a.eatSpace(),a.eatWhile(N),k(b,a,"record");if("$"==c)return"\\"!=a.next()||a.match(O)?k(b,a,"number"):k(b,a,"error");if("."==c)return k(b,a,"dot");if("'"==c){if(!(b.in_atom=!g(a))){if(a.match(/\s*\/\s*[0-9]/,!1))return a.match(/\s*\/\s*[0-9]/,!0),k(b,a,"fun");if(a.match(/\s*\(/,!1)||a.match(/\s*:/,!1))return k(b,a,"function")}return k(b,a,"atom")}if('"'==c)return b.in_string=!f(a),k(b,a,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(c))return a.eatWhile(N),k(b,a,"variable");if(/[a-z_ß-öø-ÿ]/.test(c)){if(a.eatWhile(N),a.match(/\s*\/\s*[0-9]/,!1))return a.match(/\s*\/\s*[0-9]/,!0),k(b,a,"fun");var h=a.current();return j(h,B)?k(b,a,"keyword"):j(h,E)?k(b,a,"operator"):a.match(/\s*\(/,!1)?!j(h,M)||":"==o(b).token&&"erlang"!=o(b,2).token?j(h,L)?k(b,a,"guard"):k(b,a,"function"):k(b,a,"builtin"):j(h,E)?k(b,a,"operator"):":"==i(a)?"erlang"==h?k(b,a,"builtin"):k(b,a,"function"):j(h,["true","false"])?k(b,a,"boolean"):j(h,["true","false"])?k(b,a,"boolean"):k(b,a,"atom")}var l=/[0-9]/,m=/[0-9a-zA-Z]/;return l.test(c)?(a.eatWhile(l),a.eat("#")?a.eatWhile(m)||a.backUp(1):a.eat(".")&&(a.eatWhile(l)?a.eat(/[eE]/)&&(a.eat(/[-+]/)?a.eatWhile(l)||a.backUp(2):a.eatWhile(l)||a.backUp(1)):a.backUp(1)),k(b,a,"number")):d(a,H,I)?k(b,a,"open_paren"):d(a,J,K)?k(b,a,"close_paren"):e(a,C,D)?k(b,a,"separator"):e(a,F,G)?k(b,a,"operator"):k(b,a,null)}function d(a,b,c){if(1==a.current().length&&b.test(a.current())){for(a.backUp(1);b.test(a.peek());)if(a.next(),j(a.current(),c))return!0;a.backUp(a.current().length-1)}return!1}function e(a,b,c){if(1==a.current().length&&b.test(a.current())){for(;b.test(a.peek());)a.next();for(;0c?!1:a.tokenStack[c-d]}function p(a,b){"comment"!=b.type&&"whitespace"!=b.type&&(a.tokenStack=q(a.tokenStack,b),a.tokenStack=r(a.tokenStack))}function q(a,b){var c=a.length-1;return c>0&&"record"===a[c].type&&"dot"===b.type?a.pop():c>0&&"group"===a[c].type?(a.pop(),a.push(b)):a.push(b),a}function r(a){var b=a.length-1;if("dot"===a[b].type)return[];if("fun"===a[b].type&&"fun"===a[b-1].token)return a.slice(0,b-1);switch(a[a.length-1].token){case"}":return s(a,{g:["{"]});case"]":return s(a,{i:["["]});case")":return s(a,{i:["("]});case">>":return s(a,{i:["<<"]});case"end":return s(a,{i:["begin","case","fun","if","receive","try"]});case",":return s(a,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return s(a,{r:["when"],m:["try","if","case","receive"]});case";":return s(a,{E:["case","fun","if","receive","try","when"]});case"catch":return s(a,{e:["try"]});case"of":return s(a,{e:["case"]});case"after":return s(a,{e:["receive","try"]});default:return a}}function s(a,b){for(var c in b)for(var d=a.length-1,e=b[c],f=d-1;f>-1;f--)if(j(a[f].token,e)){var g=a.slice(0,f);switch(c){case"m":return g.concat(a[f]).concat(a[d]);case"r":return g.concat(a[d]);case"i":return g;case"g":return g.concat(n("group"));case"E":return g.concat(a[f]);case"e":return g.concat(a[f])}}return"E"==c?[]:a}function t(c,d){var e,f=b.indentUnit,g=u(d),h=o(c,1),i=o(c,2);return c.in_string||c.in_atom?a.Pass:i?"when"==h.token?h.column+f:"when"===g&&"function"===i.type?i.indent+f:"("===g&&"fun"===h.token?h.column+3:"catch"===g&&(e=x(c,["try"]))?e.column:j(g,["end","after","of"])?(e=x(c,["begin","case","fun","if","receive","try"]),e?e.column:a.Pass):j(g,K)?(e=x(c,I),e?e.column:a.Pass):j(h.token,[",","|","||"])||j(g,[",","|","||"])?(e=v(c),e?e.column+e.token.length:f):"->"==h.token?j(i.token,["receive","case","if","try"])?i.column+f+f:i.column+f:j(h.token,I)?h.column+h.token.length:(e=w(c),z(e)?e.column+f:0):0}function u(a){var b=a.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return z(b)&&0===b.index?b[0]:""}function v(a){var b=a.tokenStack.slice(0,-1),c=y(b,"type",["open_paren"]);return z(b[c])?b[c]:!1}function w(a){var b=a.tokenStack,c=y(b,"type",["open_paren","separator","keyword"]),d=y(b,"type",["operator"]);return z(c)&&z(d)&&d>c?b[c+1]:z(c)?b[c]:!1}function x(a,b){var c=a.tokenStack,d=y(c,"token",b);return z(c[d])?c[d]:!1}function y(a,b,c){for(var d=a.length-1;d>-1;d--)if(j(a[d][b],c))return d;return!1}function z(a){return a!==!1&&null!=a}var A=["-type","-spec","-export_type","-opaque"],B=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],C=/[\->,;]/,D=["->",";",","],E=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],F=/[\+\-\*\/<>=\|:!]/,G=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],H=/[<\(\[\{]/,I=["<<","(","[","{"],J=/[>\)\]\}]/,K=["}","]",")",">>"],L=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],M=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],N=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,O=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(a,b){return c(a,b)},indent:function(a,b){return t(a,b)},lineComment:"%"}})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/forth/forth.min.js b/media/editors/codemirror/mode/forth/forth.min.js +index cbc6ae1..3afd7ae 100644 +--- a/media/editors/codemirror/mode/forth/forth.min.js ++++ b/media/editors/codemirror/mode/forth/forth.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t){var e=[];return t.split(" ").forEach(function(t){e.push({name:t})}),e}var E=e("INVERT AND OR XOR 2* 2/ LSHIFT RSHIFT 0= = 0< < > U< MIN MAX 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP >R R> R@ + - 1+ 1- ABS NEGATE S>D * M* UM* FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2! ALIGN ALIGNED +! ALLOT CHAR [CHAR] [ ] BL FIND EXECUTE IMMEDIATE COUNT LITERAL STATE ; DOES> >BODY EVALUATE SOURCE >IN <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL FILL MOVE . CR EMIT SPACE SPACES TYPE U. .R U.R ACCEPT TRUE FALSE <> U> 0<> 0> NIP TUCK ROLL PICK 2>R 2R@ 2R> WITHIN UNUSED MARKER I J TO COMPILE, [COMPILE] SAVE-INPUT RESTORE-INPUT PAD ERASE 2LITERAL DNEGATE D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS M+ M*/ D. D.R 2ROT DU< CATCH THROW FREE RESIZE ALLOCATE CS-PICK CS-ROLL GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL"),i=e("IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE");t.defineMode("forth",function(){function t(t,e){var E;for(E=t.length-1;E>=0;E--)if(t[E].name===e.toUpperCase())return t[E];return void 0}return{startState:function(){return{state:"",base:10,coreWordList:E,immediateWordList:i,wordList:[]}},token:function(e,E){var i;if(e.eatSpace())return null;if(""===E.state){if(e.match(/^(\]|:NONAME)(\s|$)/i))return E.state=" compilation","builtin compilation";if(i=e.match(/^(\:)\s+(\S+)(\s|$)+/))return E.wordList.push({name:i[2].toUpperCase()}),E.state=" compilation","def"+E.state;if(i=e.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i))return E.wordList.push({name:i[2].toUpperCase()}),"def"+E.state;if(i=e.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/))return"builtin"+E.state}else{if(e.match(/^(\;|\[)(\s)/))return E.state="",e.backUp(1),"builtin compilation";if(e.match(/^(\;|\[)($)/))return E.state="","builtin compilation";if(e.match(/^(POSTPONE)\s+\S+(\s|$)+/))return"builtin"}return i=e.match(/^(\S+)(\s+|$)/),i?void 0!==t(E.wordList,i[1])?"variable"+E.state:"\\"===i[1]?(e.skipToEnd(),"comment"+E.state):void 0!==t(E.coreWordList,i[1])?"builtin"+E.state:void 0!==t(E.immediateWordList,i[1])?"keyword"+E.state:"("===i[1]?(e.eatWhile(function(t){return")"!==t}),e.eat(")"),"comment"+E.state):".("===i[1]?(e.eatWhile(function(t){return")"!==t}),e.eat(")"),"string"+E.state):'S"'===i[1]||'."'===i[1]||'C"'===i[1]?(e.eatWhile(function(t){return'"'!==t}),e.eat('"'),"string"+E.state):i[1]-68719476735?"number"+E.state:"atom"+E.state:void 0}}}),t.defineMIME("text/x-forth","forth")}); +\ 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){var b=[];return a.split(" ").forEach(function(a){b.push({name:a})}),b}var c=b("INVERT AND OR XOR 2* 2/ LSHIFT RSHIFT 0= = 0< < > U< MIN MAX 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP >R R> R@ + - 1+ 1- ABS NEGATE S>D * M* UM* FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2! ALIGN ALIGNED +! ALLOT CHAR [CHAR] [ ] BL FIND EXECUTE IMMEDIATE COUNT LITERAL STATE ; DOES> >BODY EVALUATE SOURCE >IN <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL FILL MOVE . CR EMIT SPACE SPACES TYPE U. .R U.R ACCEPT TRUE FALSE <> U> 0<> 0> NIP TUCK ROLL PICK 2>R 2R@ 2R> WITHIN UNUSED MARKER I J TO COMPILE, [COMPILE] SAVE-INPUT RESTORE-INPUT PAD ERASE 2LITERAL DNEGATE D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS M+ M*/ D. D.R 2ROT DU< CATCH THROW FREE RESIZE ALLOCATE CS-PICK CS-ROLL GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL"),d=b("IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE");a.defineMode("forth",function(){function a(a,b){var c;for(c=a.length-1;c>=0;c--)if(a[c].name===b.toUpperCase())return a[c];return void 0}return{startState:function(){return{state:"",base:10,coreWordList:c,immediateWordList:d,wordList:[]}},token:function(b,c){var d;if(b.eatSpace())return null;if(""===c.state){if(b.match(/^(\]|:NONAME)(\s|$)/i))return c.state=" compilation","builtin compilation";if(d=b.match(/^(\:)\s+(\S+)(\s|$)+/))return c.wordList.push({name:d[2].toUpperCase()}),c.state=" compilation","def"+c.state;if(d=b.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i))return c.wordList.push({name:d[2].toUpperCase()}),"def"+c.state;if(d=b.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/))return"builtin"+c.state}else{if(b.match(/^(\;|\[)(\s)/))return c.state="",b.backUp(1),"builtin compilation";if(b.match(/^(\;|\[)($)/))return c.state="","builtin compilation";if(b.match(/^(POSTPONE)\s+\S+(\s|$)+/))return"builtin"}return d=b.match(/^(\S+)(\s+|$)/),d?void 0!==a(c.wordList,d[1])?"variable"+c.state:"\\"===d[1]?(b.skipToEnd(),"comment"+c.state):void 0!==a(c.coreWordList,d[1])?"builtin"+c.state:void 0!==a(c.immediateWordList,d[1])?"keyword"+c.state:"("===d[1]?(b.eatWhile(function(a){return")"!==a}),b.eat(")"),"comment"+c.state):".("===d[1]?(b.eatWhile(function(a){return")"!==a}),b.eat(")"),"string"+c.state):'S"'===d[1]||'."'===d[1]||'C"'===d[1]?(b.eatWhile(function(a){return'"'!==a}),b.eat('"'),"string"+c.state):d[1]-68719476735?"number"+c.state:"atom"+c.state:void 0}}}),a.defineMIME("text/x-forth","forth")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/fortran/fortran.min.js b/media/editors/codemirror/mode/fortran/fortran.min.js +index 33cfbbc..dfc2098 100644 +--- a/media/editors/codemirror/mode/fortran/fortran.min.js ++++ b/media/editors/codemirror/mode/fortran/fortran.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("fortran",function(){function e(e){for(var t={},n=0;n\/\:]/,c=new RegExp("(.and.|.or.|.eq.|.lt.|.le.|.gt.|.ge.|.ne.|.not.|.eqv.|.neqv.)","i");return{startState:function(){return{tokenize:null}},token:function(e,n){if(e.eatSpace())return null;var i=(n.tokenize||t)(e,n);return"comment"==i||"meta"==i?i:i}}}),e.defineMIME("text/x-fortran","fortran")}); +\ 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("fortran",function(){function a(a){for(var b={},c=0;c\/\:]/,h=new RegExp("(.and.|.or.|.eq.|.lt.|.le.|.gt.|.ge.|.ne.|.not.|.eqv.|.neqv.)","i");return{startState:function(){return{tokenize:null}},token:function(a,c){if(a.eatSpace())return null;var d=(c.tokenize||b)(a,c);return"comment"==d||"meta"==d?d:d}}}),a.defineMIME("text/x-fortran","fortran")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/gas/gas.min.js b/media/editors/codemirror/mode/gas/gas.min.js +index c39035a..e4890ca 100644 +--- a/media/editors/codemirror/mode/gas/gas.min.js ++++ b/media/editors/codemirror/mode/gas/gas.min.js +@@ -1 +1 @@ +-!function(i){"object"==typeof exports&&"object"==typeof module?i(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],i):i(CodeMirror)}(function(i){"use strict";i.defineMode("gas",function(i,t){function l(){u="#",o.ax="variable",o.eax="variable-2",o.rax="variable-3",o.bx="variable",o.ebx="variable-2",o.rbx="variable-3",o.cx="variable",o.ecx="variable-2",o.rcx="variable-3",o.dx="variable",o.edx="variable-2",o.rdx="variable-3",o.si="variable",o.esi="variable-2",o.rsi="variable-3",o.di="variable",o.edi="variable-2",o.rdi="variable-3",o.sp="variable",o.esp="variable-2",o.rsp="variable-3",o.bp="variable",o.ebp="variable-2",o.rbp="variable-3",o.ip="variable",o.eip="variable-2",o.rip="variable-3",o.cs="keyword",o.ds="keyword",o.ss="keyword",o.es="keyword",o.fs="keyword",o.gs="keyword"}function n(){u="@",a.syntax="builtin",o.r0="variable",o.r1="variable",o.r2="variable",o.r3="variable",o.r4="variable",o.r5="variable",o.r6="variable",o.r7="variable",o.r8="variable",o.r9="variable",o.r10="variable",o.r11="variable",o.r12="variable",o.sp="variable-2",o.lr="variable-2",o.pc="variable-2",o.r13=o.sp,o.r14=o.lr,o.r15=o.pc,b.push(function(i,t){return"#"===i?(t.eatWhile(/\w/),"number"):void 0})}function e(i,t){for(var l,n=!1;null!=(l=i.next());){if(l===t&&!n)return!1;n=!n&&"\\"===l}return n}function r(i,t){for(var l,n=!1;null!=(l=i.next());){if("/"===l&&n){t.tokenize=null;break}n="*"===l}return"comment"}var b=[],u="",a={".abort":"builtin",".align":"builtin",".altmacro":"builtin",".ascii":"builtin",".asciz":"builtin",".balign":"builtin",".balignw":"builtin",".balignl":"builtin",".bundle_align_mode":"builtin",".bundle_lock":"builtin",".bundle_unlock":"builtin",".byte":"builtin",".cfi_startproc":"builtin",".comm":"builtin",".data":"builtin",".def":"builtin",".desc":"builtin",".dim":"builtin",".double":"builtin",".eject":"builtin",".else":"builtin",".elseif":"builtin",".end":"builtin",".endef":"builtin",".endfunc":"builtin",".endif":"builtin",".equ":"builtin",".equiv":"builtin",".eqv":"builtin",".err":"builtin",".error":"builtin",".exitm":"builtin",".extern":"builtin",".fail":"builtin",".file":"builtin",".fill":"builtin",".float":"builtin",".func":"builtin",".global":"builtin",".gnu_attribute":"builtin",".hidden":"builtin",".hword":"builtin",".ident":"builtin",".if":"builtin",".incbin":"builtin",".include":"builtin",".int":"builtin",".internal":"builtin",".irp":"builtin",".irpc":"builtin",".lcomm":"builtin",".lflags":"builtin",".line":"builtin",".linkonce":"builtin",".list":"builtin",".ln":"builtin",".loc":"builtin",".loc_mark_labels":"builtin",".local":"builtin",".long":"builtin",".macro":"builtin",".mri":"builtin",".noaltmacro":"builtin",".nolist":"builtin",".octa":"builtin",".offset":"builtin",".org":"builtin",".p2align":"builtin",".popsection":"builtin",".previous":"builtin",".print":"builtin",".protected":"builtin",".psize":"builtin",".purgem":"builtin",".pushsection":"builtin",".quad":"builtin",".reloc":"builtin",".rept":"builtin",".sbttl":"builtin",".scl":"builtin",".section":"builtin",".set":"builtin",".short":"builtin",".single":"builtin",".size":"builtin",".skip":"builtin",".sleb128":"builtin",".space":"builtin",".stab":"builtin",".string":"builtin",".struct":"builtin",".subsection":"builtin",".symver":"builtin",".tag":"builtin",".text":"builtin",".title":"builtin",".type":"builtin",".uleb128":"builtin",".val":"builtin",".version":"builtin",".vtable_entry":"builtin",".vtable_inherit":"builtin",".warning":"builtin",".weak":"builtin",".weakref":"builtin",".word":"builtin"},o={},c=(t.architecture||"x86").toLowerCase();return"x86"===c?l(t):("arm"===c||"armv6"===c)&&n(t),{startState:function(){return{tokenize:null}},token:function(i,t){if(t.tokenize)return t.tokenize(i,t);if(i.eatSpace())return null;var l,n,c=i.next();if("/"===c&&i.eat("*"))return t.tokenize=r,r(i,t);if(c===u)return i.skipToEnd(),"comment";if('"'===c)return e(i,'"'),"string";if("."===c)return i.eatWhile(/\w/),n=i.current().toLowerCase(),l=a[n],l||null;if("="===c)return i.eatWhile(/\w/),"tag";if("{"===c)return"braket";if("}"===c)return"braket";if(/\d/.test(c))return"0"===c&&i.eat("x")?(i.eatWhile(/[0-9a-fA-F]/),"number"):(i.eatWhile(/\d/),"number");if(/\w/.test(c))return i.eatWhile(/\w/),i.eat(":")?"tag":(n=i.current().toLowerCase(),l=o[n],l||null);for(var s=0;s]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(o.combineTokens=!0,"link"):(e.next(),null)},blankLine:r},c={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var d in n)c[d]=n[d];return c.name="markdown",e.defineMIME("gfmBase",c),e.overlayMode(e.getMode(o,"gfmBase"),a)},"markdown")}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("gfm",function(b,c){function d(a){return a.code=!1,null}var e=0,f={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(a){return{code:a.code,codeBlock:a.codeBlock,ateSpace:a.ateSpace}},token:function(a,b){if(b.combineTokens=null,b.codeBlock)return a.match(/^```/)?(b.codeBlock=!1,null):(a.skipToEnd(),null);if(a.sol()&&(b.code=!1),a.sol()&&a.match(/^```/))return a.skipToEnd(),b.codeBlock=!0,null;if("`"===a.peek()){a.next();var c=a.pos;a.eatWhile("`");var d=1+a.pos-c;return b.code?d===e&&(b.code=!1):(e=d,b.code=!0),null}if(b.code)return a.next(),null;if(a.eatSpace())return b.ateSpace=!0,null;if(a.sol()||b.ateSpace){if(b.ateSpace=!1,a.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return b.combineTokens=!0,"link";if(a.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return b.combineTokens=!0,"link"}return a.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=a.string.slice(a.start-2,a.start)?(b.combineTokens=!0,"link"):(a.next(),null)},blankLine:d},g={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var h in c)g[h]=c[h];return g.name="markdown",a.defineMIME("gfmBase",g),a.overlayMode(a.getMode(b,"gfmBase"),f)},"markdown")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/gfm/test.js b/media/editors/codemirror/mode/gfm/test.js +deleted file mode 100644 +index c2bc38f..0000000 +--- a/media/editors/codemirror/mode/gfm/test.js ++++ /dev/null +@@ -1,213 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({tabSize: 4}, "gfm"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "gfm", highlightFormatting: true}); +- function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } +- +- FT("codeBackticks", +- "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); +- +- FT("doubleBackticks", +- "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); +- +- FT("codeBlock", +- "[comment&formatting&formatting-code-block ```css]", +- "[tag foo]", +- "[comment&formatting&formatting-code-block ```]"); +- +- FT("taskList", +- "[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]", +- "[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]"); +- +- FT("formatting_strikethrough", +- "[strikethrough&formatting&formatting-strikethrough ~~][strikethrough foo][strikethrough&formatting&formatting-strikethrough ~~]"); +- +- FT("formatting_strikethrough", +- "foo [strikethrough&formatting&formatting-strikethrough ~~][strikethrough bar][strikethrough&formatting&formatting-strikethrough ~~]"); +- +- MT("emInWordAsterisk", +- "foo[em *bar*]hello"); +- +- MT("emInWordUnderscore", +- "foo_bar_hello"); +- +- MT("emStrongUnderscore", +- "[strong __][em&strong _foo__][em _] bar"); +- +- MT("fencedCodeBlocks", +- "[comment ```]", +- "[comment foo]", +- "", +- "[comment ```]", +- "bar"); +- +- MT("fencedCodeBlockModeSwitching", +- "[comment ```javascript]", +- "[variable foo]", +- "", +- "[comment ```]", +- "bar"); +- +- MT("taskListAsterisk", +- "[variable-2 * []] foo]", // Invalid; must have space or x between [] +- "[variable-2 * [ ]]bar]", // Invalid; must have space after ] +- "[variable-2 * [x]]hello]", // Invalid; must have space after ] +- "[variable-2 * ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links +- " [variable-3 * ][property [x]]][variable-3 foo]"); // Valid; can be nested +- +- MT("taskListPlus", +- "[variable-2 + []] foo]", // Invalid; must have space or x between [] +- "[variable-2 + [ ]]bar]", // Invalid; must have space after ] +- "[variable-2 + [x]]hello]", // Invalid; must have space after ] +- "[variable-2 + ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links +- " [variable-3 + ][property [x]]][variable-3 foo]"); // Valid; can be nested +- +- MT("taskListDash", +- "[variable-2 - []] foo]", // Invalid; must have space or x between [] +- "[variable-2 - [ ]]bar]", // Invalid; must have space after ] +- "[variable-2 - [x]]hello]", // Invalid; must have space after ] +- "[variable-2 - ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links +- " [variable-3 - ][property [x]]][variable-3 foo]"); // Valid; can be nested +- +- MT("taskListNumber", +- "[variable-2 1. []] foo]", // Invalid; must have space or x between [] +- "[variable-2 2. [ ]]bar]", // Invalid; must have space after ] +- "[variable-2 3. [x]]hello]", // Invalid; must have space after ] +- "[variable-2 4. ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links +- " [variable-3 1. ][property [x]]][variable-3 foo]"); // Valid; can be nested +- +- MT("SHA", +- "foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar"); +- +- MT("SHAEmphasis", +- "[em *foo ][em&link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); +- +- MT("shortSHA", +- "foo [link be6a8cc] bar"); +- +- MT("tooShortSHA", +- "foo be6a8c bar"); +- +- MT("longSHA", +- "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar"); +- +- MT("badSHA", +- "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar"); +- +- MT("userSHA", +- "foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello"); +- +- MT("userSHAEmphasis", +- "[em *foo ][em&link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); +- +- MT("userProjectSHA", +- "foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world"); +- +- MT("userProjectSHAEmphasis", +- "[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); +- +- MT("num", +- "foo [link #1] bar"); +- +- MT("numEmphasis", +- "[em *foo ][em&link #1][em *]"); +- +- MT("badNum", +- "foo #1bar hello"); +- +- MT("userNum", +- "foo [link bar#1] hello"); +- +- MT("userNumEmphasis", +- "[em *foo ][em&link bar#1][em *]"); +- +- MT("userProjectNum", +- "foo [link bar/hello#1] world"); +- +- MT("userProjectNumEmphasis", +- "[em *foo ][em&link bar/hello#1][em *]"); +- +- MT("vanillaLink", +- "foo [link http://www.example.com/] bar"); +- +- MT("vanillaLinkPunctuation", +- "foo [link http://www.example.com/]. bar"); +- +- MT("vanillaLinkExtension", +- "foo [link http://www.example.com/index.html] bar"); +- +- MT("vanillaLinkEmphasis", +- "foo [em *][em&link http://www.example.com/index.html][em *] bar"); +- +- MT("notALink", +- "[comment ```css]", +- "[tag foo] {[property color]:[keyword black];}", +- "[comment ```][link http://www.example.com/]"); +- +- MT("notALink", +- "[comment ``foo `bar` http://www.example.com/``] hello"); +- +- MT("notALink", +- "[comment `foo]", +- "[link http://www.example.com/]", +- "[comment `foo]", +- "", +- "[link http://www.example.com/]"); +- +- MT("headerCodeBlockGithub", +- "[header&header-1 # heading]", +- "", +- "[comment ```]", +- "[comment code]", +- "[comment ```]", +- "", +- "Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]", +- "Issue: [link #1]", +- "Link: [link http://www.example.com/]"); +- +- MT("strikethrough", +- "[strikethrough ~~foo~~]"); +- +- MT("strikethroughWithStartingSpace", +- "~~ foo~~"); +- +- MT("strikethroughUnclosedStrayTildes", +- "[strikethrough ~~foo~~~]"); +- +- MT("strikethroughUnclosedStrayTildes", +- "[strikethrough ~~foo ~~]"); +- +- MT("strikethroughUnclosedStrayTildes", +- "[strikethrough ~~foo ~~ bar]"); +- +- MT("strikethroughUnclosedStrayTildes", +- "[strikethrough ~~foo ~~ bar~~]hello"); +- +- MT("strikethroughOneLetter", +- "[strikethrough ~~a~~]"); +- +- MT("strikethroughWrapped", +- "[strikethrough ~~foo]", +- "[strikethrough foo~~]"); +- +- MT("strikethroughParagraph", +- "[strikethrough ~~foo]", +- "", +- "foo[strikethrough ~~bar]"); +- +- MT("strikethroughEm", +- "[strikethrough ~~foo][em&strikethrough *bar*][strikethrough ~~]"); +- +- MT("strikethroughEm", +- "[em *][em&strikethrough ~~foo~~][em *]"); +- +- MT("strikethroughStrong", +- "[strikethrough ~~][strong&strikethrough **foo**][strikethrough ~~]"); +- +- MT("strikethroughStrong", +- "[strong **][strong&strikethrough ~~foo~~][strong **]"); +- +-})(); +diff --git a/media/editors/codemirror/mode/gfm/test.min.js b/media/editors/codemirror/mode/gfm/test.min.js +deleted file mode 100644 +index d229c46..0000000 +--- a/media/editors/codemirror/mode/gfm/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function o(o){test.mode(o,t,Array.prototype.slice.call(arguments,1))}function e(o){test.mode(o,r,Array.prototype.slice.call(arguments,1))}var t=CodeMirror.getMode({tabSize:4},"gfm"),r=CodeMirror.getMode({tabSize:4},{name:"gfm",highlightFormatting:!0});e("codeBackticks","[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"),e("doubleBackticks","[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"),e("codeBlock","[comment&formatting&formatting-code-block ```css]","[tag foo]","[comment&formatting&formatting-code-block ```]"),e("taskList","[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]","[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]"),e("formatting_strikethrough","[strikethrough&formatting&formatting-strikethrough ~~][strikethrough foo][strikethrough&formatting&formatting-strikethrough ~~]"),e("formatting_strikethrough","foo [strikethrough&formatting&formatting-strikethrough ~~][strikethrough bar][strikethrough&formatting&formatting-strikethrough ~~]"),o("emInWordAsterisk","foo[em *bar*]hello"),o("emInWordUnderscore","foo_bar_hello"),o("emStrongUnderscore","[strong __][em&strong _foo__][em _] bar"),o("fencedCodeBlocks","[comment ```]","[comment foo]","","[comment ```]","bar"),o("fencedCodeBlockModeSwitching","[comment ```javascript]","[variable foo]","","[comment ```]","bar"),o("taskListAsterisk","[variable-2 * []] foo]","[variable-2 * [ ]]bar]","[variable-2 * [x]]hello]","[variable-2 * ][meta [ ]]][variable-2 [world]]]"," [variable-3 * ][property [x]]][variable-3 foo]"),o("taskListPlus","[variable-2 + []] foo]","[variable-2 + [ ]]bar]","[variable-2 + [x]]hello]","[variable-2 + ][meta [ ]]][variable-2 [world]]]"," [variable-3 + ][property [x]]][variable-3 foo]"),o("taskListDash","[variable-2 - []] foo]","[variable-2 - [ ]]bar]","[variable-2 - [x]]hello]","[variable-2 - ][meta [ ]]][variable-2 [world]]]"," [variable-3 - ][property [x]]][variable-3 foo]"),o("taskListNumber","[variable-2 1. []] foo]","[variable-2 2. [ ]]bar]","[variable-2 3. [x]]hello]","[variable-2 4. ][meta [ ]]][variable-2 [world]]]"," [variable-3 1. ][property [x]]][variable-3 foo]"),o("SHA","foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar"),o("SHAEmphasis","[em *foo ][em&link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"),o("shortSHA","foo [link be6a8cc] bar"),o("tooShortSHA","foo be6a8c bar"),o("longSHA","foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar"),o("badSHA","foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar"),o("userSHA","foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello"),o("userSHAEmphasis","[em *foo ][em&link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"),o("userProjectSHA","foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world"),o("userProjectSHAEmphasis","[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"),o("num","foo [link #1] bar"),o("numEmphasis","[em *foo ][em&link #1][em *]"),o("badNum","foo #1bar hello"),o("userNum","foo [link bar#1] hello"),o("userNumEmphasis","[em *foo ][em&link bar#1][em *]"),o("userProjectNum","foo [link bar/hello#1] world"),o("userProjectNumEmphasis","[em *foo ][em&link bar/hello#1][em *]"),o("vanillaLink","foo [link http://www.example.com/] bar"),o("vanillaLinkPunctuation","foo [link http://www.example.com/]. bar"),o("vanillaLinkExtension","foo [link http://www.example.com/index.html] bar"),o("vanillaLinkEmphasis","foo [em *][em&link http://www.example.com/index.html][em *] bar"),o("notALink","[comment ```css]","[tag foo] {[property color]:[keyword black];}","[comment ```][link http://www.example.com/]"),o("notALink","[comment ``foo `bar` http://www.example.com/``] hello"),o("notALink","[comment `foo]","[link http://www.example.com/]","[comment `foo]","","[link http://www.example.com/]"),o("headerCodeBlockGithub","[header&header-1 # heading]","","[comment ```]","[comment code]","[comment ```]","","Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]","Issue: [link #1]","Link: [link http://www.example.com/]"),o("strikethrough","[strikethrough ~~foo~~]"),o("strikethroughWithStartingSpace","~~ foo~~"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo~~~]"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo ~~]"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo ~~ bar]"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo ~~ bar~~]hello"),o("strikethroughOneLetter","[strikethrough ~~a~~]"),o("strikethroughWrapped","[strikethrough ~~foo]","[strikethrough foo~~]"),o("strikethroughParagraph","[strikethrough ~~foo]","","foo[strikethrough ~~bar]"),o("strikethroughEm","[strikethrough ~~foo][em&strikethrough *bar*][strikethrough ~~]"),o("strikethroughEm","[em *][em&strikethrough ~~foo~~][em *]"),o("strikethroughStrong","[strikethrough ~~][strong&strikethrough **foo**][strikethrough ~~]"),o("strikethroughStrong","[strong **][strong&strikethrough ~~foo~~][strong **]")}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/gherkin/gherkin.min.js b/media/editors/codemirror/mode/gherkin/gherkin.min.js +index 873b25c..4033dda 100644 +--- a/media/editors/codemirror/mode/gherkin/gherkin.min.js ++++ b/media/editors/codemirror/mode/gherkin/gherkin.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("gherkin",function(){return{startState:function(){return{lineNumber:0,tableHeaderLine:!1,allowFeature:!0,allowBackground:!1,allowScenario:!1,allowSteps:!1,allowPlaceholders:!1,allowMultilineArgument:!1,inMultilineString:!1,inMultilineTable:!1,inKeywordLine:!1}},token:function(e,a){if(e.sol()&&(a.lineNumber++,a.inKeywordLine=!1,a.inMultilineTable&&(a.tableHeaderLine=!1,e.match(/\s*\|/,!1)||(a.allowMultilineArgument=!1,a.inMultilineTable=!1))),e.eatSpace(),a.allowMultilineArgument){if(a.inMultilineString)return e.match('"""')?(a.inMultilineString=!1,a.allowMultilineArgument=!1):e.match(/.*/),"string";if(a.inMultilineTable)return e.match(/\|\s*/)?"bracket":(e.match(/[^\|]*/),a.tableHeaderLine?"header":"string");if(e.match('"""'))return a.inMultilineString=!0,"string";if(e.match("|"))return a.inMultilineTable=!0,a.tableHeaderLine=!0,"bracket"}return e.match(/#.*/)?"comment":!a.inKeywordLine&&e.match(/@\S+/)?"tag":!a.inKeywordLine&&a.allowFeature&&e.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)?(a.allowScenario=!0,a.allowBackground=!0,a.allowPlaceholders=!1,a.allowSteps=!1,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):!a.inKeywordLine&&a.allowBackground&&e.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)?(a.allowPlaceholders=!1,a.allowSteps=!0,a.allowBackground=!1,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):!a.inKeywordLine&&a.allowScenario&&e.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)?(a.allowPlaceholders=!0,a.allowSteps=!0,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):a.allowScenario&&e.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)?(a.allowPlaceholders=!1,a.allowSteps=!0,a.allowBackground=!1,a.allowMultilineArgument=!0,"keyword"):!a.inKeywordLine&&a.allowScenario&&e.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)?(a.allowPlaceholders=!1,a.allowSteps=!0,a.allowBackground=!1,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):!a.inKeywordLine&&a.allowSteps&&e.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)?(a.inStep=!0,a.allowPlaceholders=!0,a.allowMultilineArgument=!0,a.inKeywordLine=!0,"keyword"):e.match(/"[^"]*"?/)?"string":a.allowPlaceholders&&e.match(/<[^>]*>?/)?"variable":(e.next(),e.eatWhile(/[^@"<#]/),null)}}}),e.defineMIME("text/x-feature","gherkin")}); +\ 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("gherkin",function(){return{startState:function(){return{lineNumber:0,tableHeaderLine:!1,allowFeature:!0,allowBackground:!1,allowScenario:!1,allowSteps:!1,allowPlaceholders:!1,allowMultilineArgument:!1,inMultilineString:!1,inMultilineTable:!1,inKeywordLine:!1}},token:function(a,b){if(a.sol()&&(b.lineNumber++,b.inKeywordLine=!1,b.inMultilineTable&&(b.tableHeaderLine=!1,a.match(/\s*\|/,!1)||(b.allowMultilineArgument=!1,b.inMultilineTable=!1))),a.eatSpace(),b.allowMultilineArgument){if(b.inMultilineString)return a.match('"""')?(b.inMultilineString=!1,b.allowMultilineArgument=!1):a.match(/.*/),"string";if(b.inMultilineTable)return a.match(/\|\s*/)?"bracket":(a.match(/[^\|]*/),b.tableHeaderLine?"header":"string");if(a.match('"""'))return b.inMultilineString=!0,"string";if(a.match("|"))return b.inMultilineTable=!0,b.tableHeaderLine=!0,"bracket"}return a.match(/#.*/)?"comment":!b.inKeywordLine&&a.match(/@\S+/)?"tag":!b.inKeywordLine&&b.allowFeature&&a.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)?(b.allowScenario=!0,b.allowBackground=!0,b.allowPlaceholders=!1,b.allowSteps=!1,b.allowMultilineArgument=!1,b.inKeywordLine=!0,"keyword"):!b.inKeywordLine&&b.allowBackground&&a.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)?(b.allowPlaceholders=!1,b.allowSteps=!0,b.allowBackground=!1,b.allowMultilineArgument=!1,b.inKeywordLine=!0,"keyword"):!b.inKeywordLine&&b.allowScenario&&a.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)?(b.allowPlaceholders=!0,b.allowSteps=!0,b.allowMultilineArgument=!1,b.inKeywordLine=!0,"keyword"):b.allowScenario&&a.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)?(b.allowPlaceholders=!1,b.allowSteps=!0,b.allowBackground=!1,b.allowMultilineArgument=!0,"keyword"):!b.inKeywordLine&&b.allowScenario&&a.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)?(b.allowPlaceholders=!1,b.allowSteps=!0,b.allowBackground=!1,b.allowMultilineArgument=!1,b.inKeywordLine=!0,"keyword"):!b.inKeywordLine&&b.allowSteps&&a.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)?(b.inStep=!0,b.allowPlaceholders=!0,b.allowMultilineArgument=!0,b.inKeywordLine=!0,"keyword"):a.match(/"[^"]*"?/)?"string":b.allowPlaceholders&&a.match(/<[^>]*>?/)?"variable":(a.next(),a.eatWhile(/[^@"<#]/),null)}}}),a.defineMIME("text/x-feature","gherkin")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/go/go.min.js b/media/editors/codemirror/mode/go/go.min.js +index c52396e..88a7335 100644 +--- a/media/editors/codemirror/mode/go/go.min.js ++++ b/media/editors/codemirror/mode/go/go.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("go",function(e){function t(e,t){var i=e.next();if('"'==i||"'"==i||"`"==i)return t.tokenize=n(i),t.tokenize(e,t);if(/[\d\.]/.test(i))return"."==i?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==i?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(i))return c=i,null;if("/"==i){if(e.eat("*"))return t.tokenize=r,r(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(d.test(i))return e.eatWhile(d),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var o=e.current();return l.propertyIsEnumerable(o)?(("case"==o||"default"==o)&&(c="case"),"keyword"):f.propertyIsEnumerable(o)?"atom":"variable"}function n(e){return function(n,r){for(var i,o=!1,a=!1;null!=(i=n.next());){if(i==e&&!o){a=!0;break}o=!o&&"\\"==i}return(a||!o&&"`"!=e)&&(r.tokenize=t),"string"}}function r(e,n){for(var r,i=!1;r=e.next();){if("/"==r&&i){n.tokenize=t;break}i="*"==r}return"comment"}function i(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function o(e,t,n){return e.context=new i(e.indented,t,n,null,e.context)}function a(e){if(e.context.prev){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}}var c,u=e.indentUnit,l={"break":!0,"case":!0,chan:!0,"const":!0,"continue":!0,"default":!0,defer:!0,"else":!0,fallthrough:!0,"for":!0,func:!0,go:!0,"goto":!0,"if":!0,"import":!0,"interface":!0,map:!0,"package":!0,range:!0,"return":!0,select:!0,struct:!0,"switch":!0,type:!0,"var":!0,bool:!0,"byte":!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,"int":!0,uint:!0,uintptr:!0},f={"true":!0,"false":!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,"new":!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},d=/[+\-*&^%:=<>!|\/]/;return{startState:function(e){return{tokenize:null,context:new i((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,n){var r=n.context;if(e.sol()&&(null==r.align&&(r.align=!1),n.indented=e.indentation(),n.startOfLine=!0,"case"==r.type&&(r.type="}")),e.eatSpace())return null;c=null;var i=(n.tokenize||t)(e,n);return"comment"==i?i:(null==r.align&&(r.align=!0),"{"==c?o(n,e.column(),"}"):"["==c?o(n,e.column(),"]"):"("==c?o(n,e.column(),")"):"case"==c?r.type="case":"}"==c&&"}"==r.type?r=a(n):c==r.type&&a(n),n.startOfLine=!1,i)},indent:function(e,n){if(e.tokenize!=t&&null!=e.tokenize)return 0;var r=e.context,i=n&&n.charAt(0);if("case"==r.type&&/^(?:case|default)\b/.test(n))return e.context.type="}",r.indented;var o=i==r.type;return r.align?r.column+(o?0:1):r.indented+(o?0:u)},electricChars:"{}):",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-go","go")}); +\ 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("go",function(a){function b(a,b){var e=a.next();if('"'==e||"'"==e||"`"==e)return b.tokenize=c(e),b.tokenize(a,b);if(/[\d\.]/.test(e))return"."==e?a.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==e?a.match(/^[xX][0-9a-fA-F]+/)||a.match(/^0[0-7]+/):a.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(e))return h=e,null;if("/"==e){if(a.eat("*"))return b.tokenize=d,d(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(l.test(e))return a.eatWhile(l),"operator";a.eatWhile(/[\w\$_\xa1-\uffff]/);var f=a.current();return j.propertyIsEnumerable(f)?(("case"==f||"default"==f)&&(h="case"),"keyword"):k.propertyIsEnumerable(f)?"atom":"variable"}function c(a){return function(c,d){for(var e,f=!1,g=!1;null!=(e=c.next());){if(e==a&&!f){g=!0;break}f=!f&&"\\"==e}return(g||!f&&"`"!=a)&&(d.tokenize=b),"string"}}function d(a,c){for(var d,e=!1;d=a.next();){if("/"==d&&e){c.tokenize=b;break}e="*"==d}return"comment"}function e(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function f(a,b,c){return a.context=new e(a.indented,b,c,null,a.context)}function g(a){if(a.context.prev){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}}var h,i=a.indentUnit,j={"break":!0,"case":!0,chan:!0,"const":!0,"continue":!0,"default":!0,defer:!0,"else":!0,fallthrough:!0,"for":!0,func:!0,go:!0,"goto":!0,"if":!0,"import":!0,"interface":!0,map:!0,"package":!0,range:!0,"return":!0,select:!0,struct:!0,"switch":!0,type:!0,"var":!0,bool:!0,"byte":!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,"int":!0,uint:!0,uintptr:!0},k={"true":!0,"false":!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,"new":!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},l=/[+\-*&^%:=<>!|\/]/;return{startState:function(a){return{tokenize:null,context:new e((a||0)-i,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,c){var d=c.context;if(a.sol()&&(null==d.align&&(d.align=!1),c.indented=a.indentation(),c.startOfLine=!0,"case"==d.type&&(d.type="}")),a.eatSpace())return null;h=null;var e=(c.tokenize||b)(a,c);return"comment"==e?e:(null==d.align&&(d.align=!0),"{"==h?f(c,a.column(),"}"):"["==h?f(c,a.column(),"]"):"("==h?f(c,a.column(),")"):"case"==h?d.type="case":"}"==h&&"}"==d.type?d=g(c):h==d.type&&g(c),c.startOfLine=!1,e)},indent:function(a,c){if(a.tokenize!=b&&null!=a.tokenize)return 0;var d=a.context,e=c&&c.charAt(0);if("case"==d.type&&/^(?:case|default)\b/.test(c))return a.context.type="}",d.indented;var f=e==d.type;return d.align?d.column+(f?0:1):d.indented+(f?0:i)},electricChars:"{}):",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),a.defineMIME("text/x-go","go")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/groovy/groovy.js b/media/editors/codemirror/mode/groovy/groovy.js +index 89b8224..e3a1db8 100644 +--- a/media/editors/codemirror/mode/groovy/groovy.js ++++ b/media/editors/codemirror/mode/groovy/groovy.js +@@ -217,6 +217,7 @@ CodeMirror.defineMode("groovy", function(config) { + }, + + electricChars: "{}", ++ closeBrackets: {triples: "'\""}, + fold: "brace" + }; + }); +diff --git a/media/editors/codemirror/mode/groovy/groovy.min.js b/media/editors/codemirror/mode/groovy/groovy.min.js +index a251b5e..8d9e7cd 100644 +--- a/media/editors/codemirror/mode/groovy/groovy.min.js ++++ b/media/editors/codemirror/mode/groovy/groovy.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("groovy",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r"))return f="->",null;if(/[+\-*&%=<>!?|\/~]/.test(n))return e.eatWhile(/[+\-*&%=<>|~]/),"operator";if(e.eatWhile(/[\w\$_]/),"@"==n)return e.eatWhile(/[\w\$_\.]/),"meta";if("."==t.lastToken)return"property";if(e.eat(":"))return f="proplabel","property";var i=e.current();return d.propertyIsEnumerable(i)?"atom":c.propertyIsEnumerable(i)?(p.propertyIsEnumerable(i)&&(f="newstatement"),"keyword"):"variable"}function r(e,t,n){function r(t,n){for(var r,a=!1,l=!o;null!=(r=t.next());){if(r==e&&!a){if(!o)break;if(t.match(e+e)){l=!0;break}}if('"'==e&&"$"==r&&!a&&t.eat("{"))return n.tokenize.push(i()),"string";a=!a&&"\\"==r}return l&&n.tokenize.pop(),"string"}var o=!1;if("/"!=e&&t.eat(e)){if(!t.eat(e))return"string";o=!0}return n.tokenize.push(r),r(t,n)}function i(){function e(e,r){if("}"==e.peek()){if(t--,0==t)return r.tokenize.pop(),r.tokenize[r.tokenize.length-1](e,r)}else"{"==e.peek()&&t++;return n(e,r)}var t=1;return e.isBase=!0,e}function o(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize.pop();break}r="*"==n}return"comment"}function a(e){return!e||"operator"==e||"->"==e||/[\.\[\{\(,;:]/.test(e)||"newstatement"==e||"keyword"==e||"proplabel"==e}function l(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function s(e,t,n){return e.context=new l(e.indented,t,n,null,e.context)}function u(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var f,c=t("abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws transient try void volatile while"),p=t("catch class do else finally for if switch try while enum interface def"),d=t("null true false this");return n.isBase=!0,{startState:function(t){return{tokenize:[n],context:new l((t||0)-e.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"statement"!=n.type||a(t.lastToken)||(u(t),n=t.context)),e.eatSpace())return null;f=null;var r=t.tokenize[t.tokenize.length-1](e,t);if("comment"==r)return r;if(null==n.align&&(n.align=!0),";"!=f&&":"!=f||"statement"!=n.type)if("->"==f&&"statement"==n.type&&"}"==n.prev.type)u(t),t.context.align=!1;else if("{"==f)s(t,e.column(),"}");else if("["==f)s(t,e.column(),"]");else if("("==f)s(t,e.column(),")");else if("}"==f){for(;"statement"==n.type;)n=u(t);for("}"==n.type&&(n=u(t));"statement"==n.type;)n=u(t)}else f==n.type?u(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==f)&&s(t,e.column(),"statement");else u(t);return t.startOfLine=!1,t.lastToken=f||r,r},indent:function(t,n){if(!t.tokenize[t.tokenize.length-1].isBase)return 0;var r=n&&n.charAt(0),i=t.context;"statement"!=i.type||a(t.lastToken)||(i=i.prev);var o=r==i.type;return"statement"==i.type?i.indented+("{"==r?0:e.indentUnit):i.align?i.column+(o?0:1):i.indented+(o?0:e.indentUnit)},electricChars:"{}",fold:"brace"}}),e.defineMIME("text/x-groovy","groovy")}); +\ 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("groovy",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d"))return k="->",null;if(/[+\-*&%=<>!?|\/~]/.test(c))return a.eatWhile(/[+\-*&%=<>|~]/),"operator";if(a.eatWhile(/[\w\$_]/),"@"==c)return a.eatWhile(/[\w\$_\.]/),"meta";if("."==b.lastToken)return"property";if(a.eat(":"))return k="proplabel","property";var e=a.current();return n.propertyIsEnumerable(e)?"atom":l.propertyIsEnumerable(e)?(m.propertyIsEnumerable(e)&&(k="newstatement"),"keyword"):"variable"}function d(a,b,c){function d(b,c){for(var d,g=!1,h=!f;null!=(d=b.next());){if(d==a&&!g){if(!f)break;if(b.match(a+a)){h=!0;break}}if('"'==a&&"$"==d&&!g&&b.eat("{"))return c.tokenize.push(e()),"string";g=!g&&"\\"==d}return h&&c.tokenize.pop(),"string"}var f=!1;if("/"!=a&&b.eat(a)){if(!b.eat(a))return"string";f=!0}return c.tokenize.push(d),d(b,c)}function e(){function a(a,d){if("}"==a.peek()){if(b--,0==b)return d.tokenize.pop(),d.tokenize[d.tokenize.length-1](a,d)}else"{"==a.peek()&&b++;return c(a,d)}var b=1;return a.isBase=!0,a}function f(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize.pop();break}d="*"==c}return"comment"}function g(a){return!a||"operator"==a||"->"==a||/[\.\[\{\(,;:]/.test(a)||"newstatement"==a||"keyword"==a||"proplabel"==a}function h(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function i(a,b,c){return a.context=new h(a.indented,b,c,null,a.context)}function j(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var k,l=b("abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws transient try void volatile while"),m=b("catch class do else finally for if switch try while enum interface def"),n=b("null true false this");return c.isBase=!0,{startState:function(b){return{tokenize:[c],context:new h((b||0)-a.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0,"statement"!=c.type||g(b.lastToken)||(j(b),c=b.context)),a.eatSpace())return null;k=null;var d=b.tokenize[b.tokenize.length-1](a,b);if("comment"==d)return d;if(null==c.align&&(c.align=!0),";"!=k&&":"!=k||"statement"!=c.type)if("->"==k&&"statement"==c.type&&"}"==c.prev.type)j(b),b.context.align=!1;else if("{"==k)i(b,a.column(),"}");else if("["==k)i(b,a.column(),"]");else if("("==k)i(b,a.column(),")");else if("}"==k){for(;"statement"==c.type;)c=j(b);for("}"==c.type&&(c=j(b));"statement"==c.type;)c=j(b)}else k==c.type?j(b):("}"==c.type||"top"==c.type||"statement"==c.type&&"newstatement"==k)&&i(b,a.column(),"statement");else j(b);return b.startOfLine=!1,b.lastToken=k||d,d},indent:function(b,c){if(!b.tokenize[b.tokenize.length-1].isBase)return 0;var d=c&&c.charAt(0),e=b.context;"statement"!=e.type||g(b.lastToken)||(e=e.prev);var f=d==e.type;return"statement"==e.type?e.indented+("{"==d?0:a.indentUnit):e.align?e.column+(f?0:1):e.indented+(f?0:a.indentUnit)},electricChars:"{}",closeBrackets:{triples:"'\""},fold:"brace"}}),a.defineMIME("text/x-groovy","groovy")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/haml/haml.min.js b/media/editors/codemirror/mode/haml/haml.min.js +index 8fe9598..7ae4029 100644 +--- a/media/editors/codemirror/mode/haml/haml.min.js ++++ b/media/editors/codemirror/mode/haml/haml.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("haml",function(t){function n(e){return function(t,n){var o=t.peek();return o==e&&1==n.rubyState.tokenize.length?(t.next(),n.tokenize=r,"closeAttributeTag"):i(t,n)}}function i(e,t){return e.match("-#")?(e.skipToEnd(),"comment"):u.token(e,t.rubyState)}function r(e,t){var r=e.peek();if("comment"==t.previousToken.style&&t.indented>t.previousToken.indented)return e.skipToEnd(),"commentLine";if(t.startOfLine){if("!"==r&&e.match("!!"))return e.skipToEnd(),"tag";if(e.match(/^%[\w:#\.]+=/))return t.tokenize=i,"hamlTag";if(e.match(/^%[\w:]+/))return"hamlTag";if("/"==r)return e.skipToEnd(),"comment"}if((t.startOfLine||"hamlTag"==t.previousToken.style)&&("#"==r||"."==r))return e.match(/[\w-#\.]*/),"hamlAttribute";if(t.startOfLine&&!e.match("-->",!1)&&("="==r||"-"==r))return t.tokenize=i,t.tokenize(e,t);if("hamlTag"==t.previousToken.style||"closeAttributeTag"==t.previousToken.style||"hamlAttribute"==t.previousToken.style){if("("==r)return t.tokenize=n(")"),t.tokenize(e,t);if("{"==r)return t.tokenize=n("}"),t.tokenize(e,t)}return o.token(e,t.htmlState)}var o=e.getMode(t,{name:"htmlmixed"}),u=e.getMode(t,"ruby");return{startState:function(){var e=o.startState(),t=u.startState();return{htmlState:e,rubyState:t,indented:0,previousToken:{style:null,indented:0},tokenize:r}},copyState:function(t){return{htmlState:e.copyState(o,t.htmlState),rubyState:e.copyState(u,t.rubyState),indented:t.indented,previousToken:t.previousToken,tokenize:t.tokenize}},token:function(e,t){if(e.sol()&&(t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;var n=t.tokenize(e,t);if(t.startOfLine=!1,n&&"commentLine"!=n&&(t.previousToken={style:n,indented:t.indented}),e.eol()&&t.tokenize==i){e.backUp(1);var o=e.peek();e.next(),o&&","!=o&&(t.tokenize=r)}return"hamlTag"==n?n="tag":"commentLine"==n?n="comment":"hamlAttribute"==n?n="attribute":"closeAttributeTag"==n&&(n=null),n}}},"htmlmixed","ruby"),e.defineMIME("text/x-haml","haml")}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("haml",function(b){function c(a){return function(b,c){var f=b.peek();return f==a&&1==c.rubyState.tokenize.length?(b.next(),c.tokenize=e,"closeAttributeTag"):d(b,c)}}function d(a,b){return a.match("-#")?(a.skipToEnd(),"comment"):g.token(a,b.rubyState)}function e(a,b){var e=a.peek();if("comment"==b.previousToken.style&&b.indented>b.previousToken.indented)return a.skipToEnd(),"commentLine";if(b.startOfLine){if("!"==e&&a.match("!!"))return a.skipToEnd(),"tag";if(a.match(/^%[\w:#\.]+=/))return b.tokenize=d,"hamlTag";if(a.match(/^%[\w:]+/))return"hamlTag";if("/"==e)return a.skipToEnd(),"comment"}if((b.startOfLine||"hamlTag"==b.previousToken.style)&&("#"==e||"."==e))return a.match(/[\w-#\.]*/),"hamlAttribute";if(b.startOfLine&&!a.match("-->",!1)&&("="==e||"-"==e))return b.tokenize=d,b.tokenize(a,b);if("hamlTag"==b.previousToken.style||"closeAttributeTag"==b.previousToken.style||"hamlAttribute"==b.previousToken.style){if("("==e)return b.tokenize=c(")"),b.tokenize(a,b);if("{"==e)return b.tokenize=c("}"),b.tokenize(a,b)}return f.token(a,b.htmlState)}var f=a.getMode(b,{name:"htmlmixed"}),g=a.getMode(b,"ruby");return{startState:function(){var a=f.startState(),b=g.startState();return{htmlState:a,rubyState:b,indented:0,previousToken:{style:null,indented:0},tokenize:e}},copyState:function(b){return{htmlState:a.copyState(f,b.htmlState),rubyState:a.copyState(g,b.rubyState),indented:b.indented,previousToken:b.previousToken,tokenize:b.tokenize}},token:function(a,b){if(a.sol()&&(b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;var c=b.tokenize(a,b);if(b.startOfLine=!1,c&&"commentLine"!=c&&(b.previousToken={style:c,indented:b.indented}),a.eol()&&b.tokenize==d){a.backUp(1);var f=a.peek();a.next(),f&&","!=f&&(b.tokenize=e)}return"hamlTag"==c?c="tag":"commentLine"==c?c="comment":"hamlAttribute"==c?c="attribute":"closeAttributeTag"==c&&(c=null),c}}},"htmlmixed","ruby"),a.defineMIME("text/x-haml","haml")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/haml/test.js b/media/editors/codemirror/mode/haml/test.js +deleted file mode 100644 +index 508458a..0000000 +--- a/media/editors/codemirror/mode/haml/test.js ++++ /dev/null +@@ -1,97 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "haml"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- +- // Requires at least one media query +- MT("elementName", +- "[tag %h1] Hey There"); +- +- MT("oneElementPerLine", +- "[tag %h1] Hey There %h2"); +- +- MT("idSelector", +- "[tag %h1][attribute #test] Hey There"); +- +- MT("classSelector", +- "[tag %h1][attribute .hello] Hey There"); +- +- MT("docType", +- "[tag !!! XML]"); +- +- MT("comment", +- "[comment / Hello WORLD]"); +- +- MT("notComment", +- "[tag %h1] This is not a / comment "); +- +- MT("attributes", +- "[tag %a]([variable title][operator =][string \"test\"]){[atom :title] [operator =>] [string \"test\"]}"); +- +- MT("htmlCode", +- "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"); +- +- MT("rubyBlock", +- "[operator =][variable-2 @item]"); +- +- MT("selectorRubyBlock", +- "[tag %a.selector=] [variable-2 @item]"); +- +- MT("nestedRubyBlock", +- "[tag %a]", +- " [operator =][variable puts] [string \"test\"]"); +- +- MT("multilinePlaintext", +- "[tag %p]", +- " Hello,", +- " World"); +- +- MT("multilineRuby", +- "[tag %p]", +- " [comment -# this is a comment]", +- " [comment and this is a comment too]", +- " Date/Time", +- " [operator -] [variable now] [operator =] [tag DateTime][operator .][property now]", +- " [tag %strong=] [variable now]", +- " [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])", +- " [operator =][string \"Happy\"]", +- " [operator =][string \"Belated\"]", +- " [operator =][string \"Birthday\"]"); +- +- MT("multilineComment", +- "[comment /]", +- " [comment Multiline]", +- " [comment Comment]"); +- +- MT("hamlComment", +- "[comment -# this is a comment]"); +- +- MT("multilineHamlComment", +- "[comment -# this is a comment]", +- " [comment and this is a comment too]"); +- +- MT("multilineHTMLComment", +- "[comment ]"); +- +- MT("hamlAfterRubyTag", +- "[attribute .block]", +- " [tag %strong=] [variable now]", +- " [attribute .test]", +- " [operator =][variable now]", +- " [attribute .right]"); +- +- MT("stretchedRuby", +- "[operator =] [variable puts] [string \"Hello\"],", +- " [string \"World\"]"); +- +- MT("interpolationInHashAttribute", +- //"[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); +- "[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); +- +- MT("interpolationInHTMLAttribute", +- "[tag %div]([variable title][operator =][string \"#{][variable test][string }_#{][variable ting]()[string }\"]) Test"); +-})(); +diff --git a/media/editors/codemirror/mode/haml/test.min.js b/media/editors/codemirror/mode/haml/test.min.js +deleted file mode 100644 +index 281a376..0000000 +--- a/media/editors/codemirror/mode/haml/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4,indentUnit:2},"haml");t("elementName","[tag %h1] Hey There"),t("oneElementPerLine","[tag %h1] Hey There %h2"),t("idSelector","[tag %h1][attribute #test] Hey There"),t("classSelector","[tag %h1][attribute .hello] Hey There"),t("docType","[tag !!! XML]"),t("comment","[comment / Hello WORLD]"),t("notComment","[tag %h1] This is not a / comment "),t("attributes",'[tag %a]([variable title][operator =][string "test"]){[atom :title] [operator =>] [string "test"]}'),t("htmlCode","[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"),t("rubyBlock","[operator =][variable-2 @item]"),t("selectorRubyBlock","[tag %a.selector=] [variable-2 @item]"),t("nestedRubyBlock","[tag %a]",' [operator =][variable puts] [string "test"]'),t("multilinePlaintext","[tag %p]"," Hello,"," World"),t("multilineRuby","[tag %p]"," [comment -# this is a comment]"," [comment and this is a comment too]"," Date/Time"," [operator -] [variable now] [operator =] [tag DateTime][operator .][property now]"," [tag %strong=] [variable now]",' [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string "December 31, 2006"])',' [operator =][string "Happy"]',' [operator =][string "Belated"]',' [operator =][string "Birthday"]'),t("multilineComment","[comment /]"," [comment Multiline]"," [comment Comment]"),t("hamlComment","[comment -# this is a comment]"),t("multilineHamlComment","[comment -# this is a comment]"," [comment and this is a comment too]"),t("multilineHTMLComment","[comment ]"),t("hamlAfterRubyTag","[attribute .block]"," [tag %strong=] [variable now]"," [attribute .test]"," [operator =][variable now]"," [attribute .right]"),t("stretchedRuby",'[operator =] [variable puts] [string "Hello"],',' [string "World"]'),t("interpolationInHashAttribute",'[tag %div]{[atom :id] [operator =>] [string "#{][variable test][string }_#{][variable ting][string }"]} test'),t("interpolationInHTMLAttribute",'[tag %div]([variable title][operator =][string "#{][variable test][string }_#{][variable ting]()[string }"]) Test')}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/handlebars/handlebars.js b/media/editors/codemirror/mode/handlebars/handlebars.js +new file mode 100644 +index 0000000..40dfea4 +--- /dev/null ++++ b/media/editors/codemirror/mode/handlebars/handlebars.js +@@ -0,0 +1,53 @@ ++// CodeMirror, copyright (c) by Marijn Haverbeke and others ++// Distributed under an MIT license: http://codemirror.net/LICENSE ++ ++(function(mod) { ++ if (typeof exports == "object" && typeof module == "object") // CommonJS ++ mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); ++ else if (typeof define == "function" && define.amd) // AMD ++ define(["../../lib/codemirror", "../../addon/mode/simple"], mod); ++ else // Plain browser env ++ mod(CodeMirror); ++})(function(CodeMirror) { ++ "use strict"; ++ ++ CodeMirror.defineSimpleMode("handlebars", { ++ start: [ ++ { regex: /\{\{!--/, push: "dash_comment", token: "comment" }, ++ { regex: /\{\{!/, push: "comment", token: "comment" }, ++ { regex: /\{\{/, push: "handlebars", token: "tag" } ++ ], ++ handlebars: [ ++ { regex: /\}\}/, pop: true, token: "tag" }, ++ ++ // Double and single quotes ++ { regex: /"(?:[^\\]|\\.)*?"/, token: "string" }, ++ { regex: /'(?:[^\\]|\\.)*?'/, token: "string" }, ++ ++ // Handlebars keywords ++ { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" }, ++ { regex: /(?:else|this)\b/, token: "keyword" }, ++ ++ // Numeral ++ { regex: /\d+/i, token: "number" }, ++ ++ // Atoms like = and . ++ { regex: /=|~|@|true|false/, token: "atom" }, ++ ++ // Paths ++ { regex: /(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/, token: "variable-2" } ++ ], ++ dash_comment: [ ++ { regex: /--\}\}/, pop: true, token: "comment" }, ++ ++ // Commented code ++ { regex: /./, token: "comment"} ++ ], ++ comment: [ ++ { regex: /\}\}/, pop: true, token: "comment" }, ++ { regex: /./, token: "comment" } ++ ] ++ }); ++ ++ CodeMirror.defineMIME("text/x-handlebars-template", "handlebars"); ++}); +diff --git a/media/editors/codemirror/mode/handlebars/handlebars.min.js b/media/editors/codemirror/mode/handlebars/handlebars.min.js +new file mode 100644 +index 0000000..11ce1cb +--- /dev/null ++++ b/media/editors/codemirror/mode/handlebars/handlebars.min.js +@@ -0,0 +1 @@ ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],a):a(CodeMirror)}(function(a){"use strict";a.defineSimpleMode("handlebars",{start:[{regex:/\{\{!--/,push:"dash_comment",token:"comment"},{regex:/\{\{!/,push:"comment",token:"comment"},{regex:/\{\{/,push:"handlebars",token:"tag"}],handlebars:[{regex:/\}\}/,pop:!0,token:"tag"},{regex:/"(?:[^\\]|\\.)*?"/,token:"string"},{regex:/'(?:[^\\]|\\.)*?'/,token:"string"},{regex:/>|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}]}),a.defineMIME("text/x-handlebars-template","handlebars")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/haskell/haskell.min.js b/media/editors/codemirror/mode/haskell/haskell.min.js +index dae7756..c44c3d6 100644 +--- a/media/editors/codemirror/mode/haskell/haskell.min.js ++++ b/media/editors/codemirror/mode/haskell/haskell.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("haskell",function(e,r){function t(e,r,t){return r(t),t(e,r)}function n(e,r){if(e.eatWhile(p))return null;var n=e.next();if(h.test(n)){if("{"==n&&e.eat("-")){var o="comment";return e.eat("#")&&(o="meta"),t(e,r,a(o,1))}return null}if("'"==n)return e.eat("\\"),e.next(),e.eat("'")?"string":"error";if('"'==n)return t(e,r,i);if(l.test(n))return e.eatWhile(d),e.eat(".")?"qualifier":"variable-2";if(u.test(n))return e.eatWhile(d),"variable";if(f.test(n)){if("0"==n){if(e.eat(/[xX]/))return e.eatWhile(s),"integer";if(e.eat(/[oO]/))return e.eatWhile(c),"number"}e.eatWhile(f);var o="number";return e.match(/^\.\d+/)&&(o="number"),e.eat(/[eE]/)&&(o="number",e.eat(/[-+]/),e.eatWhile(f)),o}if("."==n&&e.eat("."))return"keyword";if(m.test(n)){if("-"==n&&e.eat(/-/)&&(e.eatWhile(/-/),!e.eat(m)))return e.skipToEnd(),"comment";var o="variable";return":"==n&&(o="variable-2"),e.eatWhile(m),o}return"error"}function a(e,r){return 0==r?n:function(t,i){for(var o=r;!t.eol();){var u=t.next();if("{"==u&&t.eat("-"))++o;else if("-"==u&&t.eat("}")&&(--o,0==o))return i(n),e}return i(a(e,o)),e}}function i(e,r){for(;!e.eol();){var t=e.next();if('"'==t)return r(n),"string";if("\\"==t){if(e.eol()||e.eat(p))return r(o),"string";e.eat("&")||e.next()}}return r(n),"error"}function o(e,r){return e.eat("\\")?t(e,r,i):(e.next(),r(n),"error")}var u=/[a-z_]/,l=/[A-Z]/,f=/\d/,s=/[0-9A-Fa-f]/,c=/[0-7]/,d=/[a-z_A-Z0-9'\xa1-\uffff]/,m=/[-!#$%&*+.\/<=>?@\\^|~:]/,h=/[(),;[\]`{}]/,p=/[ \t\v\f]/,g=function(){function e(e){return function(){for(var r=0;r","@","~","=>"),e("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**"),e("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),e("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3");var n=r.overrideKeywords;if(n)for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return t}();return{startState:function(){return{f:n}},copyState:function(e){return{f:e.f}},token:function(e,r){var t=r.f(e,function(e){r.f=e}),n=e.current();return g.hasOwnProperty(n)?g[n]:t},blockCommentStart:"{-",blockCommentEnd:"-}",lineComment:"--"}}),e.defineMIME("text/x-haskell","haskell")}); +\ 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("haskell",function(a,b){function c(a,b,c){return b(c),c(a,b)}function d(a,b){if(a.eatWhile(p))return null;var d=a.next();if(o.test(d)){if("{"==d&&a.eat("-")){var g="comment";return a.eat("#")&&(g="meta"),c(a,b,e(g,1))}return null}if("'"==d)return a.eat("\\")?a.next():a.next(),a.eat("'")?"string":"error";if('"'==d)return c(a,b,f);if(i.test(d))return a.eatWhile(m),a.eat(".")?"qualifier":"variable-2";if(h.test(d))return a.eatWhile(m),"variable";if(j.test(d)){if("0"==d){if(a.eat(/[xX]/))return a.eatWhile(k),"integer";if(a.eat(/[oO]/))return a.eatWhile(l),"number"}a.eatWhile(j);var g="number";return a.match(/^\.\d+/)&&(g="number"),a.eat(/[eE]/)&&(g="number",a.eat(/[-+]/),a.eatWhile(j)),g}if("."==d&&a.eat("."))return"keyword";if(n.test(d)){if("-"==d&&a.eat(/-/)&&(a.eatWhile(/-/),!a.eat(n)))return a.skipToEnd(),"comment";var g="variable";return":"==d&&(g="variable-2"),a.eatWhile(n),g}return"error"}function e(a,b){return 0==b?d:function(c,f){for(var g=b;!c.eol();){var h=c.next();if("{"==h&&c.eat("-"))++g;else if("-"==h&&c.eat("}")&&(--g,0==g))return f(d),a}return f(e(a,g)),a}}function f(a,b){for(;!a.eol();){var c=a.next();if('"'==c)return b(d),"string";if("\\"==c){if(a.eol()||a.eat(p))return b(g),"string";a.eat("&")||a.next()}}return b(d),"error"}function g(a,b){return a.eat("\\")?c(a,b,f):(a.next(),b(d),"error")}var h=/[a-z_]/,i=/[A-Z]/,j=/\d/,k=/[0-9A-Fa-f]/,l=/[0-7]/,m=/[a-z_A-Z0-9'\xa1-\uffff]/,n=/[-!#$%&*+.\/<=>?@\\^|~:]/,o=/[(),;[\]`{}]/,p=/[ \t\v\f]/,q=function(){function a(a){return function(){for(var b=0;b","@","~","=>"),a("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**"),a("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),a("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3");var d=b.overrideKeywords;if(d)for(var e in d)d.hasOwnProperty(e)&&(c[e]=d[e]);return c}();return{startState:function(){return{f:d}},copyState:function(a){return{f:a.f}},token:function(a,b){var c=b.f(a,function(a){b.f=a}),d=a.current();return q.hasOwnProperty(d)?q[d]:c},blockCommentStart:"{-",blockCommentEnd:"-}",lineComment:"--"}}),a.defineMIME("text/x-haskell","haskell")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/haxe/haxe.min.js b/media/editors/codemirror/mode/haxe/haxe.min.js +index 6474056..7bdf741 100644 +--- a/media/editors/codemirror/mode/haxe/haxe.min.js ++++ b/media/editors/codemirror/mode/haxe/haxe.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("haxe",function(e,t){function n(e,t,n){return t.tokenize=n,n(e,t)}function r(e,t){for(var n,r=!1;null!=(n=e.next());){if(n==t&&!r)return!1;r=!r&&"\\"==n}return r}function i(e,t,n){return G=e,H=n,t}function a(e,t){var a=e.next();if('"'==a||"'"==a)return n(e,t,o(a));if(/[\[\]{}\(\),;\:\.]/.test(a))return i(a);if("0"==a&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(a)||"-"==a&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if(t.reAllowed&&"~"==a&&e.eat(/\//))return r(e,"/"),e.eatWhile(/[gimsu]/),i("regexp","string-2");if("/"==a)return e.eat("*")?n(e,t,u):e.eat("/")?(e.skipToEnd(),i("comment","comment")):(e.eatWhile(L),i("operator",null,e.current()));if("#"==a)return e.skipToEnd(),i("conditional","meta");if("@"==a)return e.eat(/:/),e.eatWhile(/[\w_]/),i("metadata","meta");if(L.test(a))return e.eatWhile(L),i("operator",null,e.current());var c;if(/[A-Z]/.test(a))return e.eatWhile(/[\w_<>]/),c=e.current(),i("type","variable-3",c);e.eatWhile(/[\w_]/);var c=e.current(),l=K.propertyIsEnumerable(c)&&K[c];return l&&t.kwAllowed?i(l.type,l.style,c):i("variable","variable",c)}function o(e){return function(t,n){return r(t,e)||(n.tokenize=a),i("string","string")}}function u(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=a;break}r="*"==n}return i("comment","comment")}function c(e,t,n,r,i,a){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=a,null!=r&&(this.align=r)}function l(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function f(e,t,n,r,i){var a=e.cc;for(Q.state=e,Q.stream=i,Q.marked=null,Q.cc=a,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=a.length?a.pop():w;if(o(n,r)){for(;a.length&&a[a.length-1].lex;)a.pop()();return Q.marked?Q.marked:"variable"==n&&l(e,r)?"variable-2":"variable"==n&&d(e,r)?"variable-3":t}}}function d(e,t){if(/[a-z]/.test(t.charAt(0)))return!1;for(var n=e.importedtypes.length,r=0;n>r;r++)if(e.importedtypes[r]==t)return!0}function s(e){for(var t=Q.state,n=t.importedtypes;n;n=n.next)if(n.name==e)return;t.importedtypes={name:e,next:t.importedtypes}}function m(){for(var e=arguments.length-1;e>=0;e--)Q.cc.push(arguments[e])}function p(){return m.apply(null,arguments),!0}function v(e){var t=Q.state;if(t.context){Q.marked="def";for(var n=t.localVars;n;n=n.next)if(n.name==e)return;t.localVars={name:e,next:t.localVars}}}function y(){Q.state.context||(Q.state.localVars=R),Q.state.context={prev:Q.state.context,vars:Q.state.localVars}}function x(){Q.state.localVars=Q.state.context.vars,Q.state.context=Q.state.context.prev}function h(e,t){var n=function(){var n=Q.state;n.lexical=new c(n.indented,Q.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function b(){var e=Q.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function k(e){function t(n){return n==e?p():";"==e?m():p(t)}return t}function w(e){return"@"==e?p(E):"var"==e?p(h("vardef"),P,k(";"),b):"keyword a"==e?p(h("form"),g,w,b):"keyword b"==e?p(h("form"),w,b):"{"==e?p(h("}"),y,O,b,x):";"==e?p():"attribute"==e?p(S):"function"==e?p(q):"for"==e?p(h("form"),k("("),h(")"),D,k(")"),b,w,b):"variable"==e?p(h("stat"),C):"switch"==e?p(h("form"),g,h("}","switch"),k("{"),O,b,b):"case"==e?p(g,k(":")):"default"==e?p(k(":")):"catch"==e?p(h("form"),y,k("("),$,k(")"),w,b,x):"import"==e?p(z,k(";")):"typedef"==e?p(M):m(h("stat"),g,k(";"),b)}function g(e){return N.hasOwnProperty(e)?p(V):"function"==e?p(q):"keyword c"==e?p(A):"("==e?p(h(")"),A,k(")"),b,V):"operator"==e?p(g):"["==e?p(h("]"),I(g,"]"),b,V):"{"==e?p(h("}"),I(Z,"}"),b,V):p()}function A(e){return e.match(/[;\}\)\],]/)?m():m(g)}function V(e,t){if("operator"==e&&/\+\+|--/.test(t))return p(V);if("operator"==e||":"==e)return p(g);if(";"!=e)return"("==e?p(h(")"),I(g,")"),b,V):"."==e?p(T,V):"["==e?p(h("]"),g,k("]"),b,V):void 0}function S(e){return"attribute"==e?p(S):"function"==e?p(q):"var"==e?p(P):void 0}function E(e){return":"==e?p(E):"variable"==e?p(E):"("==e?p(h(")"),I(W,")"),b,w):void 0}function W(e){return"variable"==e?p():void 0}function z(e,t){return"variable"==e&&/[A-Z]/.test(t.charAt(0))?(s(t),p()):"variable"==e||"property"==e||"."==e||"*"==t?p(z):void 0}function M(e,t){return"variable"==e&&/[A-Z]/.test(t.charAt(0))?(s(t),p()):"type"==e&&/[A-Z]/.test(t.charAt(0))?p():void 0}function C(e){return":"==e?p(b,w):m(V,k(";"),b)}function T(e){return"variable"==e?(Q.marked="property",p()):void 0}function Z(e){return"variable"==e&&(Q.marked="property"),N.hasOwnProperty(e)?p(k(":"),g):void 0}function I(e,t){function n(r){return","==r?p(e,n):r==t?p():p(k(t))}return function(r){return r==t?p():m(e,n)}}function O(e){return"}"==e?p():m(w,O)}function P(e,t){return"variable"==e?(v(t),p(B,_)):p()}function _(e,t){return"="==t?p(g,_):","==e?p(P):void 0}function D(e,t){return"variable"==e&&v(t),p(h(")"),y,j,g,b,w,x)}function j(e,t){return"in"==t?p():void 0}function q(e,t){return"variable"==e?(v(t),p(q)):"new"==t?p(q):"("==e?p(h(")"),y,I($,")"),b,B,w,x):void 0}function B(e){return":"==e?p(F):void 0}function F(e){return"type"==e?p():"variable"==e?p():"{"==e?p(h("}"),I(U,"}"),b):void 0}function U(e){return"variable"==e?p(B):void 0}function $(e,t){return"variable"==e?(v(t),p(B)):void 0}var G,H,J=e.indentUnit,K=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),a={type:"atom",style:"atom"},o={type:"attribute",style:"attribute"},u=e("typedef");return{"if":t,"while":t,"else":n,"do":n,"try":n,"return":r,"break":r,"continue":r,"new":r,"throw":r,"var":e("var"),inline:o,"static":o,using:e("import"),"public":o,"private":o,cast:e("cast"),"import":e("import"),macro:e("macro"),"function":e("function"),"catch":e("catch"),untyped:e("untyped"),callback:e("cb"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,never:e("property_access"),trace:e("trace"),"class":u,"abstract":u,"enum":u,"interface":u,typedef:u,"extends":u,"implements":u,dynamic:u,"true":a,"false":a,"null":a}}(),L=/[+\-*&%=<>!?|]/,N={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},Q={state:null,column:null,marked:null,cc:null},R={name:"this",next:null};return b.lex=!0,{startState:function(e){var n=["Int","Float","String","Void","Std","Bool","Dynamic","Array"];return{tokenize:a,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new c((e||0)-J,0,"block",!1),localVars:t.localVars,importedtypes:n,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==G?n:(t.reAllowed=!("operator"!=G&&"keyword c"!=G&&!G.match(/^[\[{}\(,;:]$/)),t.kwAllowed="."!=G,f(t,n,G,H,e))},indent:function(e,t){if(e.tokenize!=a)return 0;var n=t&&t.charAt(0),r=e.lexical;"stat"==r.type&&"}"==n&&(r=r.prev);var i=r.type,o=n==i;return"vardef"==i?r.indented+4:"form"==i&&"{"==n?r.indented:"stat"==i||"form"==i?r.indented+J:"switch"!=r.info||o?r.align?r.column+(o?0:1):r.indented+(o?0:J):r.indented+(/^(?:case|default)\b/.test(t)?J:2*J)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-haxe","haxe"),e.defineMode("hxml",function(){return{startState:function(){return{define:!1,inString:!1}},token:function(e,t){var n=e.peek(),r=e.sol();if("#"==n)return e.skipToEnd(),"comment";if(r&&"-"==n){var i="variable-2";return e.eat(/-/),"-"==e.peek()&&(e.eat(/-/),i="keyword a"),"D"==e.peek()&&(e.eat(/[D]/),i="keyword c",t.define=!0),e.eatWhile(/[A-Z]/i),i}var n=e.peek();return 0==t.inString&&"'"==n&&(t.inString=!0,n=e.next()),1==t.inString?(e.skipTo("'")||e.skipToEnd(),"'"==e.peek()&&(e.next(),t.inString=!1),"string"):(e.next(),null)},lineComment:"#"}}),e.defineMIME("text/x-hxml","hxml")}); +\ 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("haxe",function(a,b){function c(a,b,c){return b.tokenize=c,c(a,b)}function d(a,b){for(var c,d=!1;null!=(c=a.next());){if(c==b&&!d)return!1;d=!d&&"\\"==c}return d}function e(a,b,c){return S=a,T=c,b}function f(a,b){var f=a.next();if('"'==f||"'"==f)return c(a,b,g(f));if(/[\[\]{}\(\),;\:\.]/.test(f))return e(f);if("0"==f&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),e("number","number");if(/\d/.test(f)||"-"==f&&a.eat(/\d/))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),e("number","number");if(b.reAllowed&&"~"==f&&a.eat(/\//))return d(a,"/"),a.eatWhile(/[gimsu]/),e("regexp","string-2");if("/"==f)return a.eat("*")?c(a,b,h):a.eat("/")?(a.skipToEnd(),e("comment","comment")):(a.eatWhile(W),e("operator",null,a.current()));if("#"==f)return a.skipToEnd(),e("conditional","meta");if("@"==f)return a.eat(/:/),a.eatWhile(/[\w_]/),e("metadata","meta");if(W.test(f))return a.eatWhile(W),e("operator",null,a.current());var i;if(/[A-Z]/.test(f))return a.eatWhile(/[\w_<>]/),i=a.current(),e("type","variable-3",i);a.eatWhile(/[\w_]/);var i=a.current(),j=V.propertyIsEnumerable(i)&&V[i];return j&&b.kwAllowed?e(j.type,j.style,i):e("variable","variable",i)}function g(a){return function(b,c){return d(b,a)||(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,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 j(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function k(a,b,c,d,e){var f=a.cc;for(Y.state=a,Y.stream=e,Y.marked=null,Y.cc=f,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var g=f.length?f.pop():v;if(g(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return Y.marked?Y.marked:"variable"==c&&j(a,d)?"variable-2":"variable"==c&&l(a,d)?"variable-3":b}}}function l(a,b){if(/[a-z]/.test(b.charAt(0)))return!1;for(var c=a.importedtypes.length,d=0;c>d;d++)if(a.importedtypes[d]==b)return!0}function m(a){for(var b=Y.state,c=b.importedtypes;c;c=c.next)if(c.name==a)return;b.importedtypes={name:a,next:b.importedtypes}}function n(){for(var a=arguments.length-1;a>=0;a--)Y.cc.push(arguments[a])}function o(){return n.apply(null,arguments),!0}function p(a){var b=Y.state;if(b.context){Y.marked="def";for(var c=b.localVars;c;c=c.next)if(c.name==a)return;b.localVars={name:a,next:b.localVars}}}function q(){Y.state.context||(Y.state.localVars=Z),Y.state.context={prev:Y.state.context,vars:Y.state.localVars}}function r(){Y.state.localVars=Y.state.context.vars,Y.state.context=Y.state.context.prev}function s(a,b){var c=function(){var c=Y.state;c.lexical=new i(c.indented,Y.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function t(){var a=Y.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function u(a){function b(c){return c==a?o():";"==a?n():o(b)}return b}function v(a){return"@"==a?o(A):"var"==a?o(s("vardef"),J,u(";"),t):"keyword a"==a?o(s("form"),w,v,t):"keyword b"==a?o(s("form"),v,t):"{"==a?o(s("}"),q,I,t,r):";"==a?o():"attribute"==a?o(z):"function"==a?o(N):"for"==a?o(s("form"),u("("),s(")"),L,u(")"),t,v,t):"variable"==a?o(s("stat"),E):"switch"==a?o(s("form"),w,s("}","switch"),u("{"),I,t,t):"case"==a?o(w,u(":")):"default"==a?o(u(":")):"catch"==a?o(s("form"),q,u("("),R,u(")"),v,t,r):"import"==a?o(C,u(";")):"typedef"==a?o(D):n(s("stat"),w,u(";"),t)}function w(a){return X.hasOwnProperty(a)?o(y):"function"==a?o(N):"keyword c"==a?o(x):"("==a?o(s(")"),x,u(")"),t,y):"operator"==a?o(w):"["==a?o(s("]"),H(w,"]"),t,y):"{"==a?o(s("}"),H(G,"}"),t,y):o()}function x(a){return a.match(/[;\}\)\],]/)?n():n(w)}function y(a,b){if("operator"==a&&/\+\+|--/.test(b))return o(y);if("operator"==a||":"==a)return o(w);if(";"!=a)return"("==a?o(s(")"),H(w,")"),t,y):"."==a?o(F,y):"["==a?o(s("]"),w,u("]"),t,y):void 0}function z(a){return"attribute"==a?o(z):"function"==a?o(N):"var"==a?o(J):void 0}function A(a){return":"==a?o(A):"variable"==a?o(A):"("==a?o(s(")"),H(B,")"),t,v):void 0}function B(a){return"variable"==a?o():void 0}function C(a,b){return"variable"==a&&/[A-Z]/.test(b.charAt(0))?(m(b),o()):"variable"==a||"property"==a||"."==a||"*"==b?o(C):void 0}function D(a,b){return"variable"==a&&/[A-Z]/.test(b.charAt(0))?(m(b),o()):"type"==a&&/[A-Z]/.test(b.charAt(0))?o():void 0}function E(a){return":"==a?o(t,v):n(y,u(";"),t)}function F(a){return"variable"==a?(Y.marked="property",o()):void 0}function G(a){return"variable"==a&&(Y.marked="property"),X.hasOwnProperty(a)?o(u(":"),w):void 0}function H(a,b){function c(d){return","==d?o(a,c):d==b?o():o(u(b))}return function(d){return d==b?o():n(a,c)}}function I(a){return"}"==a?o():n(v,I)}function J(a,b){return"variable"==a?(p(b),o(O,K)):o()}function K(a,b){return"="==b?o(w,K):","==a?o(J):void 0}function L(a,b){return"variable"==a&&p(b),o(s(")"),q,M,w,t,v,r)}function M(a,b){return"in"==b?o():void 0}function N(a,b){return"variable"==a?(p(b),o(N)):"new"==b?o(N):"("==a?o(s(")"),q,H(R,")"),t,O,v,r):void 0}function O(a){return":"==a?o(P):void 0}function P(a){return"type"==a?o():"variable"==a?o():"{"==a?o(s("}"),H(Q,"}"),t):void 0}function Q(a){return"variable"==a?o(O):void 0}function R(a,b){return"variable"==a?(p(b),o(O)):void 0}var S,T,U=a.indentUnit,V=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"atom"},g={type:"attribute",style:"attribute"},h=a("typedef");return{"if":b,"while":b,"else":c,"do":c,"try":c,"return":d,"break":d,"continue":d,"new":d,"throw":d,"var":a("var"),inline:g,"static":g,using:a("import"),"public":g,"private":g,cast:a("cast"),"import":a("import"),macro:a("macro"),"function":a("function"),"catch":a("catch"),untyped:a("untyped"),callback:a("cb"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,never:a("property_access"),trace:a("trace"),"class":h,"abstract":h,"enum":h,"interface":h,typedef:h,"extends":h,"implements":h,dynamic:h,"true":f,"false":f,"null":f}}(),W=/[+\-*&%=<>!?|]/,X={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},Y={state:null,column:null,marked:null,cc:null},Z={name:"this",next:null};return t.lex=!0,{startState:function(a){var c=["Int","Float","String","Void","Std","Bool","Dynamic","Array"];return{tokenize:f,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new i((a||0)-U,0,"block",!1),localVars:b.localVars,importedtypes:c,context:b.localVars&&{vars:b.localVars},indented:0}},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==S?c:(b.reAllowed=!("operator"!=S&&"keyword c"!=S&&!S.match(/^[\[{}\(,;:]$/)),b.kwAllowed="."!=S,k(b,c,S,T,a))},indent:function(a,b){if(a.tokenize!=f)return 0;var c=b&&b.charAt(0),d=a.lexical;"stat"==d.type&&"}"==c&&(d=d.prev);var e=d.type,g=c==e;return"vardef"==e?d.indented+4:"form"==e&&"{"==c?d.indented:"stat"==e||"form"==e?d.indented+U:"switch"!=d.info||g?d.align?d.column+(g?0:1):d.indented+(g?0:U):d.indented+(/^(?:case|default)\b/.test(b)?U:2*U)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),a.defineMIME("text/x-haxe","haxe"),a.defineMode("hxml",function(){return{startState:function(){return{define:!1,inString:!1}},token:function(a,b){var c=a.peek(),d=a.sol();if("#"==c)return a.skipToEnd(),"comment";if(d&&"-"==c){var e="variable-2";return a.eat(/-/),"-"==a.peek()&&(a.eat(/-/),e="keyword a"),"D"==a.peek()&&(a.eat(/[D]/),e="keyword c",b.define=!0),a.eatWhile(/[A-Z]/i),e}var c=a.peek();return 0==b.inString&&"'"==c&&(b.inString=!0,c=a.next()),1==b.inString?(a.skipTo("'")||a.skipToEnd(),"'"==a.peek()&&(a.next(),b.inString=!1),"string"):(a.next(),null)},lineComment:"#"}}),a.defineMIME("text/x-hxml","hxml")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/htmlembedded/htmlembedded.js b/media/editors/codemirror/mode/htmlembedded/htmlembedded.js +index e8f7ba8..464dc57 100644 +--- a/media/editors/codemirror/mode/htmlembedded/htmlembedded.js ++++ b/media/editors/codemirror/mode/htmlembedded/htmlembedded.js +@@ -3,84 +3,26 @@ + + (function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS +- mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed")); ++ mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), ++ require("../../addon/mode/multiplex")); + else if (typeof define == "function" && define.amd) // AMD +- define(["../../lib/codemirror", "../htmlmixed/htmlmixed"], mod); ++ define(["../../lib/codemirror", "../htmlmixed/htmlmixed", ++ "../../addon/mode/multiplex"], mod); + else // Plain browser env + mod(CodeMirror); + })(function(CodeMirror) { +-"use strict"; +- +-CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { +- +- //config settings +- var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, +- scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; +- +- //inner modes +- var scriptingMode, htmlMixedMode; +- +- //tokenizer when in html mode +- function htmlDispatch(stream, state) { +- if (stream.match(scriptStartRegex, false)) { +- state.token=scriptingDispatch; +- return scriptingMode.token(stream, state.scriptState); +- } +- else +- return htmlMixedMode.token(stream, state.htmlState); +- } +- +- //tokenizer when in scripting mode +- function scriptingDispatch(stream, state) { +- if (stream.match(scriptEndRegex, false)) { +- state.token=htmlDispatch; +- return htmlMixedMode.token(stream, state.htmlState); +- } +- else +- return scriptingMode.token(stream, state.scriptState); +- } +- +- +- return { +- startState: function() { +- scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); +- htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); +- return { +- token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, +- htmlState : CodeMirror.startState(htmlMixedMode), +- scriptState : CodeMirror.startState(scriptingMode) +- }; +- }, +- +- token: function(stream, state) { +- return state.token(stream, state); +- }, +- +- indent: function(state, textAfter) { +- if (state.token == htmlDispatch) +- return htmlMixedMode.indent(state.htmlState, textAfter); +- else if (scriptingMode.indent) +- return scriptingMode.indent(state.scriptState, textAfter); +- }, +- +- copyState: function(state) { +- return { +- token : state.token, +- htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), +- scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) +- }; +- }, +- +- innerMode: function(state) { +- if (state.token == scriptingDispatch) return {state: state.scriptState, mode: scriptingMode}; +- else return {state: state.htmlState, mode: htmlMixedMode}; +- } +- }; +-}, "htmlmixed"); +- +-CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); +-CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); +-CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); +-CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingModeSpec:"ruby"}); +- ++ "use strict"; ++ ++ CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { ++ return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { ++ open: parserConfig.open || parserConfig.scriptStartRegex || "<%", ++ close: parserConfig.close || parserConfig.scriptEndRegex || "%>", ++ mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) ++ }); ++ }, "htmlmixed"); ++ ++ CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); ++ CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); ++ CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); ++ CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); + }); +diff --git a/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js b/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js +index d93535f..5483b7d 100644 +--- a/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js ++++ b/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("htmlembedded",function(e,n){function i(t,e){return t.match(a,!1)?(e.token=o,r.token(t,e.scriptState)):d.token(t,e.htmlState)}function o(t,e){return t.match(c,!1)?(e.token=i,d.token(t,e.htmlState)):r.token(t,e.scriptState)}var r,d,a=n.scriptStartRegex||/^<%/i,c=n.scriptEndRegex||/^%>/i;return{startState:function(){return r=r||t.getMode(e,n.scriptingModeSpec),d=d||t.getMode(e,"htmlmixed"),{token:n.startOpen?o:i,htmlState:t.startState(d),scriptState:t.startState(r)}},token:function(t,e){return e.token(t,e)},indent:function(t,e){return t.token==i?d.indent(t.htmlState,e):r.indent?r.indent(t.scriptState,e):void 0},copyState:function(e){return{token:e.token,htmlState:t.copyState(d,e.htmlState),scriptState:t.copyState(r,e.scriptState)}},innerMode:function(t){return t.token==o?{state:t.scriptState,mode:r}:{state:t.htmlState,mode:d}}}},"htmlmixed"),t.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),t.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),t.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),t.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("htmlembedded",function(b,c){return a.multiplexingMode(a.getMode(b,"htmlmixed"),{open:c.open||c.scriptStartRegex||"<%",close:c.close||c.scriptEndRegex||"%>",mode:a.getMode(b,c.scriptingModeSpec)})},"htmlmixed"),a.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),a.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),a.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),a.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/htmlmixed/htmlmixed.js b/media/editors/codemirror/mode/htmlmixed/htmlmixed.js +index 1cc438f..24552e2 100644 +--- a/media/editors/codemirror/mode/htmlmixed/htmlmixed.js ++++ b/media/editors/codemirror/mode/htmlmixed/htmlmixed.js +@@ -57,9 +57,9 @@ CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { + } + function maybeBackup(stream, pat, style) { + var cur = stream.current(); +- var close = cur.search(pat), m; ++ var close = cur.search(pat); + if (close > -1) stream.backUp(cur.length - close); +- else if (m = cur.match(/<\/?$/)) { ++ else if (cur.match(/<\/?$/)) { + stream.backUp(cur.length); + if (!stream.match(pat, false)) stream.match(cur); + } +diff --git a/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js b/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js +index 2734acd..47aa4aa 100644 +--- a/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js ++++ b/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("htmlmixed",function(e,a){function o(t,e){var a=e.htmlState.tagName;a&&(a=a.toLowerCase());var o=r.token(t,e.htmlState);if("script"==a&&/\btag\b/.test(o)&&">"==t.current()){var l=t.string.slice(Math.max(0,t.pos-100),t.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);l=l?l[1]:"",l&&/[\"\']/.test(l.charAt(0))&&(l=l.slice(1,l.length-1));for(var m=0;m"==t.current()&&(e.token=c,e.localMode=s,e.localState=s.startState(r.indent(e.htmlState,"")));return o}function l(t,e,a){var o,l=t.current(),n=l.search(e);return n>-1?t.backUp(l.length-n):(o=l.match(/<\/?$/))&&(t.backUp(l.length),t.match(e,!1)||t.match(l)),a}function n(t,e){return t.match(/^<\/\s*script\s*>/i,!1)?(e.token=o,e.localState=e.localMode=null,null):l(t,/<\/\s*script\s*>/,e.localMode.token(t,e.localState))}function c(t,e){return t.match(/^<\/\s*style\s*>/i,!1)?(e.token=o,e.localState=e.localMode=null,null):l(t,/<\/\s*style\s*>/,s.token(t,e.localState))}var r=t.getMode(e,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag}),s=t.getMode(e,"css"),i=[],m=a&&a.scriptTypes;if(i.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:t.getMode(e,"javascript")}),m)for(var d=0;d"==a.current()){var e=a.string.slice(Math.max(0,a.pos-100),a.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);e=e?e[1]:"",e&&/[\"\']/.test(e.charAt(0))&&(e=e.slice(1,e.length-1));for(var k=0;k"==a.current()&&(b.token=g,b.localMode=i,b.localState=i.startState(h.indent(b.htmlState,"")));return d}function e(a,b,c){var d=a.current(),e=d.search(b);return e>-1?a.backUp(d.length-e):d.match(/<\/?$/)&&(a.backUp(d.length),a.match(b,!1)||a.match(d)),c}function f(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=d,b.localState=b.localMode=null,null):e(a,/<\/\s*script\s*>/,b.localMode.token(a,b.localState))}function g(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=d,b.localState=b.localMode=null,null):e(a,/<\/\s*style\s*>/,i.token(a,b.localState))}var h=a.getMode(b,{name:"xml",htmlMode:!0,multilineTagIndentFactor:c.multilineTagIndentFactor,multilineTagIndentPastTag:c.multilineTagIndentPastTag}),i=a.getMode(b,"css"),j=[],k=c&&c.scriptTypes;if(j.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:a.getMode(b,"javascript")}),k)for(var l=0;l=100&&200>i?"positive informational":i>=200&&300>i?"positive success":i>=300&&400>i?"positive redirect":i>=400&&500>i?"negative client-error":i>=500&&600>i?"negative server-error":"error"}function n(r,e){return r.skipToEnd(),e.cur=u,null}function o(r,e){return r.eatWhile(/\S/),e.cur=i,"string-2"}function i(e,t){return e.match(/^HTTP\/\d\.\d$/)?(t.cur=u,"keyword"):r(e,t)}function u(r){return r.sol()&&!r.eat(/[ \t]/)?r.match(/^.*?:/)?"atom":(r.skipToEnd(),"error"):(r.skipToEnd(),"string")}function c(r){return r.skipToEnd(),null}return{token:function(r,e){var t=e.cur;return t!=u&&t!=c&&r.eatSpace()?null:t(r,e)},blankLine:function(r){r.cur=c},startState:function(){return{cur:e}}}}),r.defineMIME("message/http","http")}); +\ 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("http",function(){function a(a,b){return a.skipToEnd(),b.cur=g,"error"}function b(b,d){return b.match(/^HTTP\/\d\.\d/)?(d.cur=c,"keyword"):b.match(/^[A-Z]+/)&&/[ \t]/.test(b.peek())?(d.cur=e,"keyword"):a(b,d)}function c(b,c){var e=b.match(/^\d+/);if(!e)return a(b,c);c.cur=d;var f=Number(e[0]);return f>=100&&200>f?"positive informational":f>=200&&300>f?"positive success":f>=300&&400>f?"positive redirect":f>=400&&500>f?"negative client-error":f>=500&&600>f?"negative server-error":"error"}function d(a,b){return a.skipToEnd(),b.cur=g,null}function e(a,b){return a.eatWhile(/\S/),b.cur=f,"string-2"}function f(b,c){return b.match(/^HTTP\/\d\.\d$/)?(c.cur=g,"keyword"):a(b,c)}function g(a){return a.sol()&&!a.eat(/[ \t]/)?a.match(/^.*?:/)?"atom":(a.skipToEnd(),"error"):(a.skipToEnd(),"string")}function h(a){return a.skipToEnd(),null}return{token:function(a,b){var c=b.cur;return c!=g&&c!=h&&a.eatSpace()?null:c(a,b)},blankLine:function(a){a.cur=h},startState:function(){return{cur:b}}}}),a.defineMIME("message/http","http")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/idl/idl.min.js b/media/editors/codemirror/mode/idl/idl.min.js +index 7decde6..b332bdf 100644 +--- a/media/editors/codemirror/mode/idl/idl.min.js ++++ b/media/editors/codemirror/mode/idl/idl.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e){if(e.eatSpace())return null;if(e.match(";"))return e.skipToEnd(),"comment";if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return"number";if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return"number"}return e.match(/^"([^"]|(""))*"/)?"string":e.match(/^'([^']|(''))*'/)?"string":e.match(o)?"keyword":e.match(a)?"builtin":e.match(l)?"variable":e.match(s)||e.match(n)?"operator":(e.next(),null)}var i=["a_correlate","abs","acos","adapt_hist_equal","alog","alog2","alog10","amoeba","annotate","app_user_dir","app_user_dir_query","arg_present","array_equal","array_indices","arrow","ascii_template","asin","assoc","atan","axis","axis","bandpass_filter","bandreject_filter","barplot","bar_plot","beseli","beselj","beselk","besely","beta","biginteger","bilinear","bin_date","binary_template","bindgen","binomial","bit_ffs","bit_population","blas_axpy","blk_con","boolarr","boolean","boxplot","box_cursor","breakpoint","broyden","bubbleplot","butterworth","bytarr","byte","byteorder","bytscl","c_correlate","calendar","caldat","call_external","call_function","call_method","call_procedure","canny","catch","cd","cdf","ceil","chebyshev","check_math","chisqr_cvf","chisqr_pdf","choldc","cholsol","cindgen","cir_3pnt","clipboard","close","clust_wts","cluster","cluster_tree","cmyk_convert","code_coverage","color_convert","color_exchange","color_quan","color_range_map","colorbar","colorize_sample","colormap_applicable","colormap_gradient","colormap_rotation","colortable","comfit","command_line_args","common","compile_opt","complex","complexarr","complexround","compute_mesh_normals","cond","congrid","conj","constrained_min","contour","contour","convert_coord","convol","convol_fft","coord2to3","copy_lun","correlate","cos","cosh","cpu","cramer","createboxplotdata","create_cursor","create_struct","create_view","crossp","crvlength","ct_luminance","cti_test","cursor","curvefit","cv_coord","cvttobm","cw_animate","cw_animate_getp","cw_animate_load","cw_animate_run","cw_arcball","cw_bgroup","cw_clr_index","cw_colorsel","cw_defroi","cw_field","cw_filesel","cw_form","cw_fslider","cw_light_editor","cw_light_editor_get","cw_light_editor_set","cw_orient","cw_palette_editor","cw_palette_editor_get","cw_palette_editor_set","cw_pdmenu","cw_rgbslider","cw_tmpl","cw_zoom","db_exists","dblarr","dcindgen","dcomplex","dcomplexarr","define_key","define_msgblk","define_msgblk_from_file","defroi","defsysv","delvar","dendro_plot","dendrogram","deriv","derivsig","determ","device","dfpmin","diag_matrix","dialog_dbconnect","dialog_message","dialog_pickfile","dialog_printersetup","dialog_printjob","dialog_read_image","dialog_write_image","dictionary","digital_filter","dilate","dindgen","dissolve","dist","distance_measure","dlm_load","dlm_register","doc_library","double","draw_roi","edge_dog","efont","eigenql","eigenvec","ellipse","elmhes","emboss","empty","enable_sysrtn","eof","eos","erase","erf","erfc","erfcx","erode","errorplot","errplot","estimator_filter","execute","exit","exp","expand","expand_path","expint","extrac","extract_slice","f_cvf","f_pdf","factorial","fft","file_basename","file_chmod","file_copy","file_delete","file_dirname","file_expand_path","file_gunzip","file_gzip","file_info","file_lines","file_link","file_mkdir","file_move","file_poll_input","file_readlink","file_same","file_search","file_tar","file_test","file_untar","file_unzip","file_which","file_zip","filepath","findgen","finite","fix","flick","float","floor","flow3","fltarr","flush","format_axis_values","forward_function","free_lun","fstat","fulstr","funct","function","fv_test","fx_root","fz_roots","gamma","gamma_ct","gauss_cvf","gauss_pdf","gauss_smooth","gauss2dfit","gaussfit","gaussian_function","gaussint","get_drive_list","get_dxf_objects","get_kbrd","get_login_info","get_lun","get_screen_size","getenv","getwindows","greg2jul","grib","grid_input","grid_tps","grid3","griddata","gs_iter","h_eq_ct","h_eq_int","hanning","hash","hdf","hdf5","heap_free","heap_gc","heap_nosave","heap_refcount","heap_save","help","hilbert","hist_2d","hist_equal","histogram","hls","hough","hqr","hsv","i18n_multibytetoutf8","i18n_multibytetowidechar","i18n_utf8tomultibyte","i18n_widechartomultibyte","ibeta","icontour","iconvertcoord","idelete","identity","idl_base64","idl_container","idl_validname","idlexbr_assistant","idlitsys_createtool","idlunit","iellipse","igamma","igetcurrent","igetdata","igetid","igetproperty","iimage","image","image_cont","image_statistics","image_threshold","imaginary","imap","indgen","int_2d","int_3d","int_tabulated","intarr","interpol","interpolate","interval_volume","invert","ioctl","iopen","ir_filter","iplot","ipolygon","ipolyline","iputdata","iregister","ireset","iresolve","irotate","isa","isave","iscale","isetcurrent","isetproperty","ishft","isocontour","isosurface","isurface","itext","itranslate","ivector","ivolume","izoom","journal","json_parse","json_serialize","jul2greg","julday","keyword_set","krig2d","kurtosis","kw_test","l64indgen","la_choldc","la_cholmprove","la_cholsol","la_determ","la_eigenproblem","la_eigenql","la_eigenvec","la_elmhes","la_gm_linear_model","la_hqr","la_invert","la_least_square_equality","la_least_squares","la_linear_equation","la_ludc","la_lumprove","la_lusol","la_svd","la_tridc","la_trimprove","la_triql","la_trired","la_trisol","label_date","label_region","ladfit","laguerre","lambda","lambdap","lambertw","laplacian","least_squares_filter","leefilt","legend","legendre","linbcg","lindgen","linfit","linkimage","list","ll_arc_distance","lmfit","lmgr","lngamma","lnp_test","loadct","locale_get","logical_and","logical_or","logical_true","lon64arr","lonarr","long","long64","lsode","lu_complex","ludc","lumprove","lusol","m_correlate","machar","make_array","make_dll","make_rt","map","mapcontinents","mapgrid","map_2points","map_continents","map_grid","map_image","map_patch","map_proj_forward","map_proj_image","map_proj_info","map_proj_init","map_proj_inverse","map_set","matrix_multiply","matrix_power","max","md_test","mean","meanabsdev","mean_filter","median","memory","mesh_clip","mesh_decimate","mesh_issolid","mesh_merge","mesh_numtriangles","mesh_obj","mesh_smooth","mesh_surfacearea","mesh_validate","mesh_volume","message","min","min_curve_surf","mk_html_help","modifyct","moment","morph_close","morph_distance","morph_gradient","morph_hitormiss","morph_open","morph_thin","morph_tophat","multi","n_elements","n_params","n_tags","ncdf","newton","noise_hurl","noise_pick","noise_scatter","noise_slur","norm","obj_class","obj_destroy","obj_hasmethod","obj_isa","obj_new","obj_valid","objarr","on_error","on_ioerror","online_help","openr","openu","openw","oplot","oploterr","orderedhash","p_correlate","parse_url","particle_trace","path_cache","path_sep","pcomp","plot","plot3d","plot","plot_3dbox","plot_field","ploterr","plots","polar_contour","polar_surface","polyfill","polyshade","pnt_line","point_lun","polarplot","poly","poly_2d","poly_area","poly_fit","polyfillv","polygon","polyline","polywarp","popd","powell","pref_commit","pref_get","pref_set","prewitt","primes","print","printf","printd","pro","product","profile","profiler","profiles","project_vol","ps_show_fonts","psafm","pseudo","ptr_free","ptr_new","ptr_valid","ptrarr","pushd","qgrid3","qhull","qromb","qromo","qsimp","query_*","query_ascii","query_bmp","query_csv","query_dicom","query_gif","query_image","query_jpeg","query_jpeg2000","query_mrsid","query_pict","query_png","query_ppm","query_srf","query_tiff","query_video","query_wav","r_correlate","r_test","radon","randomn","randomu","ranks","rdpix","read","readf","read_ascii","read_binary","read_bmp","read_csv","read_dicom","read_gif","read_image","read_interfile","read_jpeg","read_jpeg2000","read_mrsid","read_pict","read_png","read_ppm","read_spr","read_srf","read_sylk","read_tiff","read_video","read_wav","read_wave","read_x11_bitmap","read_xwd","reads","readu","real_part","rebin","recall_commands","recon3","reduce_colors","reform","region_grow","register_cursor","regress","replicate","replicate_inplace","resolve_all","resolve_routine","restore","retall","return","reverse","rk4","roberts","rot","rotate","round","routine_filepath","routine_info","rs_test","s_test","save","savgol","scale3","scale3d","scatterplot","scatterplot3d","scope_level","scope_traceback","scope_varfetch","scope_varname","search2d","search3d","sem_create","sem_delete","sem_lock","sem_release","set_plot","set_shading","setenv","sfit","shade_surf","shade_surf_irr","shade_volume","shift","shift_diff","shmdebug","shmmap","shmunmap","shmvar","show3","showfont","signum","simplex","sin","sindgen","sinh","size","skewness","skip_lun","slicer3","slide_image","smooth","sobel","socket","sort","spawn","sph_4pnt","sph_scat","spher_harm","spl_init","spl_interp","spline","spline_p","sprsab","sprsax","sprsin","sprstp","sqrt","standardize","stddev","stop","strarr","strcmp","strcompress","streamline","streamline","stregex","stretch","string","strjoin","strlen","strlowcase","strmatch","strmessage","strmid","strpos","strput","strsplit","strtrim","struct_assign","struct_hide","strupcase","surface","surface","surfr","svdc","svdfit","svsol","swap_endian","swap_endian_inplace","symbol","systime","t_cvf","t_pdf","t3d","tag_names","tan","tanh","tek_color","temporary","terminal_size","tetra_clip","tetra_surface","tetra_volume","text","thin","thread","threed","tic","time_test2","timegen","timer","timestamp","timestamptovalues","tm_test","toc","total","trace","transpose","tri_surf","triangulate","trigrid","triql","trired","trisol","truncate_lun","ts_coef","ts_diff","ts_fcast","ts_smooth","tv","tvcrs","tvlct","tvrd","tvscl","typename","uindgen","uint","uintarr","ul64indgen","ulindgen","ulon64arr","ulonarr","ulong","ulong64","uniq","unsharp_mask","usersym","value_locate","variance","vector","vector_field","vel","velovect","vert_t3d","voigt","volume","voronoi","voxel_proj","wait","warp_tri","watershed","wdelete","wf_draw","where","widget_base","widget_button","widget_combobox","widget_control","widget_displaycontextmenu","widget_draw","widget_droplist","widget_event","widget_info","widget_label","widget_list","widget_propertysheet","widget_slider","widget_tab","widget_table","widget_text","widget_tree","widget_tree_move","widget_window","wiener_filter","window","window","write_bmp","write_csv","write_gif","write_image","write_jpeg","write_jpeg2000","write_nrif","write_pict","write_png","write_ppm","write_spr","write_srf","write_sylk","write_tiff","write_video","write_wav","write_wave","writeu","wset","wshow","wtn","wv_applet","wv_cwt","wv_cw_wavelet","wv_denoise","wv_dwt","wv_fn_coiflet","wv_fn_daubechies","wv_fn_gaussian","wv_fn_haar","wv_fn_morlet","wv_fn_paul","wv_fn_symlet","wv_import_data","wv_import_wavelet","wv_plot3d_wps","wv_plot_multires","wv_pwt","wv_tool_denoise","xbm_edit","xdisplayfile","xdxf","xfont","xinteranimate","xloadct","xmanager","xmng_tmpl","xmtool","xobjview","xobjview_rotate","xobjview_write_image","xpalette","xpcolor","xplot3d","xregistered","xroi","xsq_test","xsurface","xvaredit","xvolume","xvolume_rotate","xvolume_write_image","xyouts","zlib_compress","zlib_uncompress","zoom","zoom_24"],a=t(i),_=["begin","end","endcase","endfor","endwhile","endif","endrep","endforeach","break","case","continue","for","foreach","goto","if","then","else","repeat","until","switch","while","do","pro","function"],o=t(_);e.registerHelper("hintWords","idl",i.concat(_));var l=new RegExp("^[_a-z¡-￿][_a-z0-9¡-￿]*","i"),s=/[+\-*&=<>\/@#~$]/,n=new RegExp("(and|or|eq|lt|le|gt|ge|ne|not)","i");e.defineMode("idl",function(){return{token:function(e){return r(e)}}}),e.defineMIME("text/x-idl","idl")}); +\ 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){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function c(a){if(a.eatSpace())return null;if(a.match(";"))return a.skipToEnd(),"comment";if(a.match(/^[0-9\.+-]/,!1)){if(a.match(/^[+-]?0x[0-9a-fA-F]+/))return"number";if(a.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return"number";if(a.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return"number"}return a.match(/^"([^"]|(""))*"/)?"string":a.match(/^'([^']|(''))*'/)?"string":a.match(g)?"keyword":a.match(e)?"builtin":a.match(h)?"variable":a.match(i)||a.match(j)?"operator":(a.next(),null)}var d=["a_correlate","abs","acos","adapt_hist_equal","alog","alog2","alog10","amoeba","annotate","app_user_dir","app_user_dir_query","arg_present","array_equal","array_indices","arrow","ascii_template","asin","assoc","atan","axis","axis","bandpass_filter","bandreject_filter","barplot","bar_plot","beseli","beselj","beselk","besely","beta","biginteger","bilinear","bin_date","binary_template","bindgen","binomial","bit_ffs","bit_population","blas_axpy","blk_con","boolarr","boolean","boxplot","box_cursor","breakpoint","broyden","bubbleplot","butterworth","bytarr","byte","byteorder","bytscl","c_correlate","calendar","caldat","call_external","call_function","call_method","call_procedure","canny","catch","cd","cdf","ceil","chebyshev","check_math","chisqr_cvf","chisqr_pdf","choldc","cholsol","cindgen","cir_3pnt","clipboard","close","clust_wts","cluster","cluster_tree","cmyk_convert","code_coverage","color_convert","color_exchange","color_quan","color_range_map","colorbar","colorize_sample","colormap_applicable","colormap_gradient","colormap_rotation","colortable","comfit","command_line_args","common","compile_opt","complex","complexarr","complexround","compute_mesh_normals","cond","congrid","conj","constrained_min","contour","contour","convert_coord","convol","convol_fft","coord2to3","copy_lun","correlate","cos","cosh","cpu","cramer","createboxplotdata","create_cursor","create_struct","create_view","crossp","crvlength","ct_luminance","cti_test","cursor","curvefit","cv_coord","cvttobm","cw_animate","cw_animate_getp","cw_animate_load","cw_animate_run","cw_arcball","cw_bgroup","cw_clr_index","cw_colorsel","cw_defroi","cw_field","cw_filesel","cw_form","cw_fslider","cw_light_editor","cw_light_editor_get","cw_light_editor_set","cw_orient","cw_palette_editor","cw_palette_editor_get","cw_palette_editor_set","cw_pdmenu","cw_rgbslider","cw_tmpl","cw_zoom","db_exists","dblarr","dcindgen","dcomplex","dcomplexarr","define_key","define_msgblk","define_msgblk_from_file","defroi","defsysv","delvar","dendro_plot","dendrogram","deriv","derivsig","determ","device","dfpmin","diag_matrix","dialog_dbconnect","dialog_message","dialog_pickfile","dialog_printersetup","dialog_printjob","dialog_read_image","dialog_write_image","dictionary","digital_filter","dilate","dindgen","dissolve","dist","distance_measure","dlm_load","dlm_register","doc_library","double","draw_roi","edge_dog","efont","eigenql","eigenvec","ellipse","elmhes","emboss","empty","enable_sysrtn","eof","eos","erase","erf","erfc","erfcx","erode","errorplot","errplot","estimator_filter","execute","exit","exp","expand","expand_path","expint","extrac","extract_slice","f_cvf","f_pdf","factorial","fft","file_basename","file_chmod","file_copy","file_delete","file_dirname","file_expand_path","file_gunzip","file_gzip","file_info","file_lines","file_link","file_mkdir","file_move","file_poll_input","file_readlink","file_same","file_search","file_tar","file_test","file_untar","file_unzip","file_which","file_zip","filepath","findgen","finite","fix","flick","float","floor","flow3","fltarr","flush","format_axis_values","forward_function","free_lun","fstat","fulstr","funct","function","fv_test","fx_root","fz_roots","gamma","gamma_ct","gauss_cvf","gauss_pdf","gauss_smooth","gauss2dfit","gaussfit","gaussian_function","gaussint","get_drive_list","get_dxf_objects","get_kbrd","get_login_info","get_lun","get_screen_size","getenv","getwindows","greg2jul","grib","grid_input","grid_tps","grid3","griddata","gs_iter","h_eq_ct","h_eq_int","hanning","hash","hdf","hdf5","heap_free","heap_gc","heap_nosave","heap_refcount","heap_save","help","hilbert","hist_2d","hist_equal","histogram","hls","hough","hqr","hsv","i18n_multibytetoutf8","i18n_multibytetowidechar","i18n_utf8tomultibyte","i18n_widechartomultibyte","ibeta","icontour","iconvertcoord","idelete","identity","idl_base64","idl_container","idl_validname","idlexbr_assistant","idlitsys_createtool","idlunit","iellipse","igamma","igetcurrent","igetdata","igetid","igetproperty","iimage","image","image_cont","image_statistics","image_threshold","imaginary","imap","indgen","int_2d","int_3d","int_tabulated","intarr","interpol","interpolate","interval_volume","invert","ioctl","iopen","ir_filter","iplot","ipolygon","ipolyline","iputdata","iregister","ireset","iresolve","irotate","isa","isave","iscale","isetcurrent","isetproperty","ishft","isocontour","isosurface","isurface","itext","itranslate","ivector","ivolume","izoom","journal","json_parse","json_serialize","jul2greg","julday","keyword_set","krig2d","kurtosis","kw_test","l64indgen","la_choldc","la_cholmprove","la_cholsol","la_determ","la_eigenproblem","la_eigenql","la_eigenvec","la_elmhes","la_gm_linear_model","la_hqr","la_invert","la_least_square_equality","la_least_squares","la_linear_equation","la_ludc","la_lumprove","la_lusol","la_svd","la_tridc","la_trimprove","la_triql","la_trired","la_trisol","label_date","label_region","ladfit","laguerre","lambda","lambdap","lambertw","laplacian","least_squares_filter","leefilt","legend","legendre","linbcg","lindgen","linfit","linkimage","list","ll_arc_distance","lmfit","lmgr","lngamma","lnp_test","loadct","locale_get","logical_and","logical_or","logical_true","lon64arr","lonarr","long","long64","lsode","lu_complex","ludc","lumprove","lusol","m_correlate","machar","make_array","make_dll","make_rt","map","mapcontinents","mapgrid","map_2points","map_continents","map_grid","map_image","map_patch","map_proj_forward","map_proj_image","map_proj_info","map_proj_init","map_proj_inverse","map_set","matrix_multiply","matrix_power","max","md_test","mean","meanabsdev","mean_filter","median","memory","mesh_clip","mesh_decimate","mesh_issolid","mesh_merge","mesh_numtriangles","mesh_obj","mesh_smooth","mesh_surfacearea","mesh_validate","mesh_volume","message","min","min_curve_surf","mk_html_help","modifyct","moment","morph_close","morph_distance","morph_gradient","morph_hitormiss","morph_open","morph_thin","morph_tophat","multi","n_elements","n_params","n_tags","ncdf","newton","noise_hurl","noise_pick","noise_scatter","noise_slur","norm","obj_class","obj_destroy","obj_hasmethod","obj_isa","obj_new","obj_valid","objarr","on_error","on_ioerror","online_help","openr","openu","openw","oplot","oploterr","orderedhash","p_correlate","parse_url","particle_trace","path_cache","path_sep","pcomp","plot","plot3d","plot","plot_3dbox","plot_field","ploterr","plots","polar_contour","polar_surface","polyfill","polyshade","pnt_line","point_lun","polarplot","poly","poly_2d","poly_area","poly_fit","polyfillv","polygon","polyline","polywarp","popd","powell","pref_commit","pref_get","pref_set","prewitt","primes","print","printf","printd","pro","product","profile","profiler","profiles","project_vol","ps_show_fonts","psafm","pseudo","ptr_free","ptr_new","ptr_valid","ptrarr","pushd","qgrid3","qhull","qromb","qromo","qsimp","query_*","query_ascii","query_bmp","query_csv","query_dicom","query_gif","query_image","query_jpeg","query_jpeg2000","query_mrsid","query_pict","query_png","query_ppm","query_srf","query_tiff","query_video","query_wav","r_correlate","r_test","radon","randomn","randomu","ranks","rdpix","read","readf","read_ascii","read_binary","read_bmp","read_csv","read_dicom","read_gif","read_image","read_interfile","read_jpeg","read_jpeg2000","read_mrsid","read_pict","read_png","read_ppm","read_spr","read_srf","read_sylk","read_tiff","read_video","read_wav","read_wave","read_x11_bitmap","read_xwd","reads","readu","real_part","rebin","recall_commands","recon3","reduce_colors","reform","region_grow","register_cursor","regress","replicate","replicate_inplace","resolve_all","resolve_routine","restore","retall","return","reverse","rk4","roberts","rot","rotate","round","routine_filepath","routine_info","rs_test","s_test","save","savgol","scale3","scale3d","scatterplot","scatterplot3d","scope_level","scope_traceback","scope_varfetch","scope_varname","search2d","search3d","sem_create","sem_delete","sem_lock","sem_release","set_plot","set_shading","setenv","sfit","shade_surf","shade_surf_irr","shade_volume","shift","shift_diff","shmdebug","shmmap","shmunmap","shmvar","show3","showfont","signum","simplex","sin","sindgen","sinh","size","skewness","skip_lun","slicer3","slide_image","smooth","sobel","socket","sort","spawn","sph_4pnt","sph_scat","spher_harm","spl_init","spl_interp","spline","spline_p","sprsab","sprsax","sprsin","sprstp","sqrt","standardize","stddev","stop","strarr","strcmp","strcompress","streamline","streamline","stregex","stretch","string","strjoin","strlen","strlowcase","strmatch","strmessage","strmid","strpos","strput","strsplit","strtrim","struct_assign","struct_hide","strupcase","surface","surface","surfr","svdc","svdfit","svsol","swap_endian","swap_endian_inplace","symbol","systime","t_cvf","t_pdf","t3d","tag_names","tan","tanh","tek_color","temporary","terminal_size","tetra_clip","tetra_surface","tetra_volume","text","thin","thread","threed","tic","time_test2","timegen","timer","timestamp","timestamptovalues","tm_test","toc","total","trace","transpose","tri_surf","triangulate","trigrid","triql","trired","trisol","truncate_lun","ts_coef","ts_diff","ts_fcast","ts_smooth","tv","tvcrs","tvlct","tvrd","tvscl","typename","uindgen","uint","uintarr","ul64indgen","ulindgen","ulon64arr","ulonarr","ulong","ulong64","uniq","unsharp_mask","usersym","value_locate","variance","vector","vector_field","vel","velovect","vert_t3d","voigt","volume","voronoi","voxel_proj","wait","warp_tri","watershed","wdelete","wf_draw","where","widget_base","widget_button","widget_combobox","widget_control","widget_displaycontextmenu","widget_draw","widget_droplist","widget_event","widget_info","widget_label","widget_list","widget_propertysheet","widget_slider","widget_tab","widget_table","widget_text","widget_tree","widget_tree_move","widget_window","wiener_filter","window","window","write_bmp","write_csv","write_gif","write_image","write_jpeg","write_jpeg2000","write_nrif","write_pict","write_png","write_ppm","write_spr","write_srf","write_sylk","write_tiff","write_video","write_wav","write_wave","writeu","wset","wshow","wtn","wv_applet","wv_cwt","wv_cw_wavelet","wv_denoise","wv_dwt","wv_fn_coiflet","wv_fn_daubechies","wv_fn_gaussian","wv_fn_haar","wv_fn_morlet","wv_fn_paul","wv_fn_symlet","wv_import_data","wv_import_wavelet","wv_plot3d_wps","wv_plot_multires","wv_pwt","wv_tool_denoise","xbm_edit","xdisplayfile","xdxf","xfont","xinteranimate","xloadct","xmanager","xmng_tmpl","xmtool","xobjview","xobjview_rotate","xobjview_write_image","xpalette","xpcolor","xplot3d","xregistered","xroi","xsq_test","xsurface","xvaredit","xvolume","xvolume_rotate","xvolume_write_image","xyouts","zlib_compress","zlib_uncompress","zoom","zoom_24"],e=b(d),f=["begin","end","endcase","endfor","endwhile","endif","endrep","endforeach","break","case","continue","for","foreach","goto","if","then","else","repeat","until","switch","while","do","pro","function"],g=b(f);a.registerHelper("hintWords","idl",d.concat(f));var h=new RegExp("^[_a-z¡-￿][_a-z0-9¡-￿]*","i"),i=/[+\-*&=<>\/@#~$]/,j=new RegExp("(and|or|eq|lt|le|gt|ge|ne|not)","i");a.defineMode("idl",function(){return{token:function(a){return c(a)}}}),a.defineMIME("text/x-idl","idl")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/jade/jade.min.js b/media/editors/codemirror/mode/jade/jade.min.js +index eb17b96..5c11a7b 100644 +--- a/media/editors/codemirror/mode/jade/jade.min.js ++++ b/media/editors/codemirror/mode/jade/jade.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("jade",function(e){function n(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=X.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function i(t,e){if(t.sol()&&(e.javaScriptLine=!1,e.javaScriptLineExcludesColon=!1),e.javaScriptLine){if(e.javaScriptLineExcludesColon&&":"===t.peek())return e.javaScriptLine=!1,void(e.javaScriptLineExcludesColon=!1);var n=X.token(t,e.jsState);return t.eol()&&(e.javaScriptLine=!1),n||!0}}function r(t,e){if(e.javaScriptArguments){if(0===e.javaScriptArgumentsDepth&&"("!==t.peek())return void(e.javaScriptArguments=!1);if("("===t.peek()?e.javaScriptArgumentsDepth++:")"===t.peek()&&e.javaScriptArgumentsDepth--,0===e.javaScriptArgumentsDepth)return void(e.javaScriptArguments=!1);var n=X.token(t,e.jsState);return n||!0}}function a(t){return t.match(/^yield\b/)?"keyword":void 0}function s(t){return t.match(/^(?:doctype) *([^\n]+)?/)?P:void 0}function o(t,e){return t.match("#{")?(e.isInterpolating=!0,e.interpolationNesting=0,"punctuation"):void 0}function c(t,e){if(e.isInterpolating){if("}"===t.peek()){if(e.interpolationNesting--,e.interpolationNesting<0)return t.next(),e.isInterpolating=!1,"puncutation"}else"{"===t.peek()&&e.interpolationNesting++;return X.token(t,e.jsState)||!0}}function u(t,e){return t.match(/^case\b/)?(e.javaScriptLine=!0,K):void 0}function p(t,e){return t.match(/^when\b/)?(e.javaScriptLine=!0,e.javaScriptLineExcludesColon=!0,K):void 0}function d(t){return t.match(/^default\b/)?K:void 0}function l(t,e){return t.match(/^extends?\b/)?(e.restOfLine="string",K):void 0}function h(t,e){return t.match(/^append\b/)?(e.restOfLine="variable",K):void 0}function f(t,e){return t.match(/^prepend\b/)?(e.restOfLine="variable",K):void 0}function v(t,e){return t.match(/^block\b *(?:(prepend|append)\b)?/)?(e.restOfLine="variable",K):void 0}function m(t,e){return t.match(/^include\b/)?(e.restOfLine="string",K):void 0}function S(t,e){return t.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&t.match("include")?(e.isIncludeFiltered=!0,K):void 0}function j(t,e){if(e.isIncludeFiltered){var n=x(t,e);return e.isIncludeFiltered=!1,e.restOfLine="string",n}}function g(t,e){return t.match(/^mixin\b/)?(e.javaScriptLine=!0,K):void 0}function b(t,e){return t.match(/^\+([-\w]+)/)?(t.match(/^\( *[-\w]+ *=/,!1)||(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0),"variable"):t.match(/^\+#{/,!1)?(t.next(),e.mixinCallAfter=!0,o(t,e)):void 0}function L(t,e){return e.mixinCallAfter?(e.mixinCallAfter=!1,t.match(/^\( *[-\w]+ *=/,!1)||(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0),!0):void 0}function A(t,e){return t.match(/^(if|unless|else if|else)\b/)?(e.javaScriptLine=!0,K):void 0}function k(t,e){return t.match(/^(- *)?(each|for)\b/)?(e.isEach=!0,K):void 0}function y(t,e){if(e.isEach){if(t.match(/^ in\b/))return e.javaScriptLine=!0,e.isEach=!1,K;if(t.sol()||t.eol())e.isEach=!1;else if(t.next()){for(;!t.match(/^ in\b/,!1)&&t.next(););return"variable"}}}function T(t,e){return t.match(/^while\b/)?(e.javaScriptLine=!0,K):void 0}function M(t,e){var n;return(n=t.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(e.lastTag=n[1].toLowerCase(),"script"===e.lastTag&&(e.scriptType="application/javascript"),"tag"):void 0}function x(n,i){if(n.match(/^:([\w\-]+)/)){var r;return e&&e.innerModes&&(r=e.innerModes(n.current().substring(1))),r||(r=n.current().substring(1)),"string"==typeof r&&(r=t.getMode(e,r)),Z(n,i,r),"atom"}}function N(t,e){return t.match(/^(!?=|-)/)?(e.javaScriptLine=!0,"punctuation"):void 0}function O(t){return t.match(/^#([\w-]+)/)?Q:void 0}function w(t){return t.match(/^\.([\w-]+)/)?R:void 0}function I(t,e){return"("==t.peek()?(t.next(),e.isAttrs=!0,e.attrsNest=[],e.inAttributeName=!0,e.attrValue="",e.attributeIsType=!1,"punctuation"):void 0}function E(t,e){if(e.isAttrs){if(W[t.peek()]&&e.attrsNest.push(W[t.peek()]),e.attrsNest[e.attrsNest.length-1]===t.peek())e.attrsNest.pop();else if(t.eat(")"))return e.isAttrs=!1,"punctuation";if(e.inAttributeName&&t.match(/^[^=,\)!]+/))return("="===t.peek()||"!"===t.peek())&&(e.inAttributeName=!1,e.jsState=X.startState(),e.attributeIsType="script"===e.lastTag&&"type"===t.current().trim().toLowerCase()?!0:!1),"attribute";var n=X.token(t,e.jsState);if(e.attributeIsType&&"string"===n&&(e.scriptType=t.current().toString()),0===e.attrsNest.length&&("string"===n||"variable"===n||"keyword"===n))try{return Function("","var x "+e.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),e.inAttributeName=!0,e.attrValue="",t.backUp(t.current().length),E(t,e)}catch(i){}return e.attrValue+=t.current(),n||!0}}function C(t,e){return t.match(/^&attributes\b/)?(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0,"keyword"):void 0}function F(t){return t.sol()&&t.eatSpace()?"indent":void 0}function D(t,e){return t.match(/^ *\/\/(-)?([^\n]*)/)?(e.indentOf=t.indentation(),e.indentToken="comment","comment"):void 0}function V(t){return t.match(/^: */)?"colon":void 0}function q(t,e){return t.match(/^(?:\| ?| )([^\n]+)/)?"string":t.match(/^(<[^\n]*)/,!1)?(Z(t,e,"htmlmixed"),e.innerModeForLine=!0,$(t,e,!0)):void 0}function z(t,e){if(t.eat(".")){var n=null;return"script"===e.lastTag&&-1!=e.scriptType.toLowerCase().indexOf("javascript")?n=e.scriptType.toLowerCase().replace(/"|'/g,""):"style"===e.lastTag&&(n="css"),Z(t,e,n),"dot"}}function U(t){return t.next(),null}function Z(n,i,r){r=t.mimeModes[r]||r,r=e.innerModes?e.innerModes(r)||r:r,r=t.mimeModes[r]||r,r=t.getMode(e,r),i.indentOf=n.indentation(),r&&"null"!==r.name?i.innerMode=r:i.indentToken="string"}function $(t,e,n){return t.indentation()>e.indentOf||e.innerModeForLine&&!t.sol()||n?e.innerMode?(e.innerState||(e.innerState=e.innerMode.startState?e.innerMode.startState(t.indentation()):{}),t.hideFirstChars(e.indentOf+2,function(){return e.innerMode.token(t,e.innerState)||!0})):(t.skipToEnd(),e.indentToken):void(t.sol()&&(e.indentOf=1/0,e.indentToken=null,e.innerMode=null,e.innerState=null))}function B(t,e){if(t.sol()&&(e.restOfLine=""),e.restOfLine){t.skipToEnd();var n=e.restOfLine;return e.restOfLine="",n}}function G(){return new n}function H(t){return t.copy()}function J(t,e){var n=$(t,e)||B(t,e)||c(t,e)||j(t,e)||y(t,e)||E(t,e)||i(t,e)||r(t,e)||L(t,e)||a(t,e)||s(t,e)||o(t,e)||u(t,e)||p(t,e)||d(t,e)||l(t,e)||h(t,e)||f(t,e)||v(t,e)||m(t,e)||S(t,e)||g(t,e)||b(t,e)||A(t,e)||k(t,e)||T(t,e)||M(t,e)||x(t,e)||N(t,e)||O(t,e)||w(t,e)||I(t,e)||C(t,e)||F(t,e)||q(t,e)||D(t,e)||V(t,e)||z(t,e)||U(t,e);return n===!0?null:n}var K="keyword",P="meta",Q="builtin",R="qualifier",W={"{":"}","(":")","[":"]"},X=t.getMode(e,"javascript");return n.prototype.copy=function(){var e=new n;return e.javaScriptLine=this.javaScriptLine,e.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,e.javaScriptArguments=this.javaScriptArguments,e.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,e.isInterpolating=this.isInterpolating,e.interpolationNesting=this.intpolationNesting,e.jsState=t.copyState(X,this.jsState),e.innerMode=this.innerMode,this.innerMode&&this.innerState&&(e.innerState=t.copyState(this.innerMode,this.innerState)),e.restOfLine=this.restOfLine,e.isIncludeFiltered=this.isIncludeFiltered,e.isEach=this.isEach,e.lastTag=this.lastTag,e.scriptType=this.scriptType,e.isAttrs=this.isAttrs,e.attrsNest=this.attrsNest.slice(),e.inAttributeName=this.inAttributeName,e.attributeIsType=this.attributeIsType,e.attrValue=this.attrValue,e.indentOf=this.indentOf,e.indentToken=this.indentToken,e.innerModeForLine=this.innerModeForLine,e},{startState:G,copyState:H,token:J}}),t.defineMIME("text/x-jade","jade")}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("jade",function(b){function c(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=Z.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function d(a,b){if(a.sol()&&(b.javaScriptLine=!1,b.javaScriptLineExcludesColon=!1),b.javaScriptLine){if(b.javaScriptLineExcludesColon&&":"===a.peek())return b.javaScriptLine=!1,void(b.javaScriptLineExcludesColon=!1);var c=Z.token(a,b.jsState);return a.eol()&&(b.javaScriptLine=!1),c||!0}}function e(a,b){if(b.javaScriptArguments){if(0===b.javaScriptArgumentsDepth&&"("!==a.peek())return void(b.javaScriptArguments=!1);if("("===a.peek()?b.javaScriptArgumentsDepth++:")"===a.peek()&&b.javaScriptArgumentsDepth--,0===b.javaScriptArgumentsDepth)return void(b.javaScriptArguments=!1);var c=Z.token(a,b.jsState);return c||!0}}function f(a){return a.match(/^yield\b/)?"keyword":void 0}function g(a){return a.match(/^(?:doctype) *([^\n]+)?/)?V:void 0}function h(a,b){return a.match("#{")?(b.isInterpolating=!0,b.interpolationNesting=0,"punctuation"):void 0}function i(a,b){if(b.isInterpolating){if("}"===a.peek()){if(b.interpolationNesting--,b.interpolationNesting<0)return a.next(),b.isInterpolating=!1,"puncutation"}else"{"===a.peek()&&b.interpolationNesting++;return Z.token(a,b.jsState)||!0}}function j(a,b){return a.match(/^case\b/)?(b.javaScriptLine=!0,U):void 0}function k(a,b){return a.match(/^when\b/)?(b.javaScriptLine=!0,b.javaScriptLineExcludesColon=!0,U):void 0}function l(a){return a.match(/^default\b/)?U:void 0}function m(a,b){return a.match(/^extends?\b/)?(b.restOfLine="string",U):void 0}function n(a,b){return a.match(/^append\b/)?(b.restOfLine="variable",U):void 0}function o(a,b){return a.match(/^prepend\b/)?(b.restOfLine="variable",U):void 0}function p(a,b){return a.match(/^block\b *(?:(prepend|append)\b)?/)?(b.restOfLine="variable",U):void 0}function q(a,b){return a.match(/^include\b/)?(b.restOfLine="string",U):void 0}function r(a,b){return a.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&a.match("include")?(b.isIncludeFiltered=!0,U):void 0}function s(a,b){if(b.isIncludeFiltered){var c=B(a,b);return b.isIncludeFiltered=!1,b.restOfLine="string",c}}function t(a,b){return a.match(/^mixin\b/)?(b.javaScriptLine=!0,U):void 0}function u(a,b){return a.match(/^\+([-\w]+)/)?(a.match(/^\( *[-\w]+ *=/,!1)||(b.javaScriptArguments=!0,b.javaScriptArgumentsDepth=0),"variable"):a.match(/^\+#{/,!1)?(a.next(),b.mixinCallAfter=!0,h(a,b)):void 0}function v(a,b){return b.mixinCallAfter?(b.mixinCallAfter=!1,a.match(/^\( *[-\w]+ *=/,!1)||(b.javaScriptArguments=!0,b.javaScriptArgumentsDepth=0),!0):void 0}function w(a,b){return a.match(/^(if|unless|else if|else)\b/)?(b.javaScriptLine=!0,U):void 0}function x(a,b){return a.match(/^(- *)?(each|for)\b/)?(b.isEach=!0,U):void 0}function y(a,b){if(b.isEach){if(a.match(/^ in\b/))return b.javaScriptLine=!0,b.isEach=!1,U;if(a.sol()||a.eol())b.isEach=!1;else if(a.next()){for(;!a.match(/^ in\b/,!1)&&a.next(););return"variable"}}}function z(a,b){return a.match(/^while\b/)?(b.javaScriptLine=!0,U):void 0}function A(a,b){var c;return(c=a.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(b.lastTag=c[1].toLowerCase(),"script"===b.lastTag&&(b.scriptType="application/javascript"),"tag"):void 0}function B(c,d){if(c.match(/^:([\w\-]+)/)){var e;return b&&b.innerModes&&(e=b.innerModes(c.current().substring(1))),e||(e=c.current().substring(1)),"string"==typeof e&&(e=a.getMode(b,e)),O(c,d,e),"atom"}}function C(a,b){return a.match(/^(!?=|-)/)?(b.javaScriptLine=!0,"punctuation"):void 0}function D(a){return a.match(/^#([\w-]+)/)?W:void 0}function E(a){return a.match(/^\.([\w-]+)/)?X:void 0}function F(a,b){return"("==a.peek()?(a.next(),b.isAttrs=!0,b.attrsNest=[],b.inAttributeName=!0,b.attrValue="",b.attributeIsType=!1,"punctuation"):void 0}function G(a,b){if(b.isAttrs){if(Y[a.peek()]&&b.attrsNest.push(Y[a.peek()]),b.attrsNest[b.attrsNest.length-1]===a.peek())b.attrsNest.pop();else if(a.eat(")"))return b.isAttrs=!1,"punctuation";if(b.inAttributeName&&a.match(/^[^=,\)!]+/))return("="===a.peek()||"!"===a.peek())&&(b.inAttributeName=!1,b.jsState=Z.startState(),"script"===b.lastTag&&"type"===a.current().trim().toLowerCase()?b.attributeIsType=!0:b.attributeIsType=!1),"attribute";var c=Z.token(a,b.jsState);if(b.attributeIsType&&"string"===c&&(b.scriptType=a.current().toString()),0===b.attrsNest.length&&("string"===c||"variable"===c||"keyword"===c))try{return Function("","var x "+b.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),b.inAttributeName=!0,b.attrValue="",a.backUp(a.current().length),G(a,b)}catch(d){}return b.attrValue+=a.current(),c||!0}}function H(a,b){return a.match(/^&attributes\b/)?(b.javaScriptArguments=!0,b.javaScriptArgumentsDepth=0,"keyword"):void 0}function I(a){return a.sol()&&a.eatSpace()?"indent":void 0}function J(a,b){return a.match(/^ *\/\/(-)?([^\n]*)/)?(b.indentOf=a.indentation(),b.indentToken="comment","comment"):void 0}function K(a){return a.match(/^: */)?"colon":void 0}function L(a,b){return a.match(/^(?:\| ?| )([^\n]+)/)?"string":a.match(/^(<[^\n]*)/,!1)?(O(a,b,"htmlmixed"),b.innerModeForLine=!0,P(a,b,!0)):void 0}function M(a,b){if(a.eat(".")){var c=null;return"script"===b.lastTag&&-1!=b.scriptType.toLowerCase().indexOf("javascript")?c=b.scriptType.toLowerCase().replace(/"|'/g,""):"style"===b.lastTag&&(c="css"),O(a,b,c),"dot"}}function N(a){return a.next(),null}function O(c,d,e){e=a.mimeModes[e]||e,e=b.innerModes?b.innerModes(e)||e:e,e=a.mimeModes[e]||e,e=a.getMode(b,e),d.indentOf=c.indentation(),e&&"null"!==e.name?d.innerMode=e:d.indentToken="string"}function P(a,b,c){return a.indentation()>b.indentOf||b.innerModeForLine&&!a.sol()||c?b.innerMode?(b.innerState||(b.innerState=b.innerMode.startState?b.innerMode.startState(a.indentation()):{}),a.hideFirstChars(b.indentOf+2,function(){return b.innerMode.token(a,b.innerState)||!0})):(a.skipToEnd(),b.indentToken):void(a.sol()&&(b.indentOf=1/0,b.indentToken=null,b.innerMode=null,b.innerState=null))}function Q(a,b){if(a.sol()&&(b.restOfLine=""),b.restOfLine){a.skipToEnd();var c=b.restOfLine;return b.restOfLine="",c}}function R(){return new c}function S(a){return a.copy()}function T(a,b){var c=P(a,b)||Q(a,b)||i(a,b)||s(a,b)||y(a,b)||G(a,b)||d(a,b)||e(a,b)||v(a,b)||f(a,b)||g(a,b)||h(a,b)||j(a,b)||k(a,b)||l(a,b)||m(a,b)||n(a,b)||o(a,b)||p(a,b)||q(a,b)||r(a,b)||t(a,b)||u(a,b)||w(a,b)||x(a,b)||z(a,b)||A(a,b)||B(a,b)||C(a,b)||D(a,b)||E(a,b)||F(a,b)||H(a,b)||I(a,b)||L(a,b)||J(a,b)||K(a,b)||M(a,b)||N(a,b);return c===!0?null:c}var U="keyword",V="meta",W="builtin",X="qualifier",Y={"{":"}","(":")","[":"]"},Z=a.getMode(b,"javascript");return c.prototype.copy=function(){var b=new c;return b.javaScriptLine=this.javaScriptLine,b.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,b.javaScriptArguments=this.javaScriptArguments,b.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,b.isInterpolating=this.isInterpolating,b.interpolationNesting=this.intpolationNesting,b.jsState=a.copyState(Z,this.jsState),b.innerMode=this.innerMode,this.innerMode&&this.innerState&&(b.innerState=a.copyState(this.innerMode,this.innerState)),b.restOfLine=this.restOfLine,b.isIncludeFiltered=this.isIncludeFiltered,b.isEach=this.isEach,b.lastTag=this.lastTag,b.scriptType=this.scriptType,b.isAttrs=this.isAttrs,b.attrsNest=this.attrsNest.slice(),b.inAttributeName=this.inAttributeName,b.attributeIsType=this.attributeIsType,b.attrValue=this.attrValue,b.indentOf=this.indentOf,b.indentToken=this.indentToken,b.innerModeForLine=this.innerModeForLine,b},{startState:R,copyState:S,token:T}}),a.defineMIME("text/x-jade","jade")}); +\ 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 3f05ac4..ef01847 100644 +--- a/media/editors/codemirror/mode/javascript/javascript.js ++++ b/media/editors/codemirror/mode/javascript/javascript.js +@@ -549,6 +549,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { + } + function classBody(type, value) { + if (type == "variable" || cx.style == "keyword") { ++ if (value == "static") { ++ cx.marked = "keyword"; ++ return cont(classBody); ++ } + cx.marked = "property"; + if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody); + return cont(functiondef, classBody); +@@ -581,7 +585,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { + function importSpec(type, value) { + if (type == "{") return contCommasep(importSpec, "}"); + if (type == "variable") register(value); +- return cont(); ++ if (value == "*") cx.marked = "keyword"; ++ return cont(maybeAs); ++ } ++ function maybeAs(_type, value) { ++ if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } + } + function maybeFrom(_type, value) { + if (value == "from") { cx.marked = "keyword"; return cont(expression); } +@@ -669,6 +677,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { + blockCommentEnd: jsonMode ? null : "*/", + lineComment: jsonMode ? null : "//", + fold: "brace", ++ closeBrackets: "()[]{}''\"\"``", + + helperType: jsonMode ? "json" : "javascript", + jsonldMode: jsonldMode, +diff --git a/media/editors/codemirror/mode/javascript/javascript.min.js b/media/editors/codemirror/mode/javascript/javascript.min.js +index e031cf7..bd5d8d4 100644 +--- a/media/editors/codemirror/mode/javascript/javascript.min.js ++++ b/media/editors/codemirror/mode/javascript/javascript.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,r){function n(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function a(e,t,r){return mt=e,yt=r,t}function i(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=o(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return a("number","number");if("."==r&&e.match(".."))return a("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return a(r);if("="==r&&e.eat(">"))return a("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),a("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),a("number","number");if("/"==r)return e.eat("*")?(t.tokenize=c,c(e,t)):e.eat("/")?(e.skipToEnd(),a("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(n(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),a("regexp","string-2")):(e.eatWhile(Mt),a("operator","operator",e.current()));if("`"==r)return t.tokenize=u,u(e,t);if("#"==r)return e.skipToEnd(),a("error","error");if(Mt.test(r))return e.eatWhile(Mt),a("operator","operator",e.current());if(wt.test(r)){e.eatWhile(wt);var i=e.current(),l=jt.propertyIsEnumerable(i)&&jt[i];return l&&"."!=t.lastType?a(l.type,l.style,i):a("variable","variable",i)}}function o(e){return function(t,r){var n,o=!1;if(xt&&"@"==t.peek()&&t.match(Vt))return r.tokenize=i,a("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||o);)o=!o&&"\\"==n;return o||(r.tokenize=i),a("string","string")}}function c(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=i;break}n="*"==r}return a("comment","comment")}function u(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=i;break}n=!n&&"\\"==r}return a("quasi","string-2",e.current())}function l(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(0>r)){for(var n=0,a=!1,i=r-1;i>=0;--i){var o=e.string.charAt(i),c=Et.indexOf(o);if(c>=0&&3>c){if(!n){++i;break}if(0==--n)break}else if(c>=3&&6>c)++n;else if(wt.test(o))a=!0;else{if(/["'\/]/.test(o))return;if(a&&!n){++i;break}}}a&&!n&&(t.fatArrowAt=i)}}function s(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function d(e,t,r,n,a){var i=e.cc;for(zt.state=e,zt.stream=a,zt.marked=null,zt.cc=i,zt.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=i.length?i.pop():ht?w:g;if(o(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return zt.marked?zt.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)zt.cc.push(arguments[e])}function v(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var n=zt.state;if(n.context){if(zt.marked="def",t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function y(){zt.state.context={prev:zt.state.context,vars:zt.state.localVars},zt.state.localVars=Tt}function b(){zt.state.localVars=zt.state.context.vars,zt.state.context=zt.state.context.prev}function k(e,t){var r=function(){var r=zt.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new s(n,zt.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function x(){var e=zt.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function h(e){function t(r){return r==e?v():";"==e?p():v(t)}return t}function g(e,t){return"var"==e?v(k("vardef",t.length),F,h(";"),x):"keyword a"==e?v(k("form"),w,g,x):"keyword b"==e?v(k("form"),g,x):"{"==e?v(k("}"),U,x):";"==e?v():"if"==e?("else"==zt.state.lexical.info&&zt.state.cc[zt.state.cc.length-1]==x&&zt.state.cc.pop()(),v(k("form"),w,g,x,Q)):"function"==e?v(et):"for"==e?v(k("form"),R,g,x):"variable"==e?v(k("stat"),q):"switch"==e?v(k("form"),w,k("}","switch"),h("{"),U,x,x):"case"==e?v(w,h(":")):"default"==e?v(h(":")):"catch"==e?v(k("form"),y,h("("),tt,h(")"),g,x,b):"module"==e?v(k("form"),y,ot,b,x):"class"==e?v(k("form"),rt,x):"export"==e?v(k("form"),ct,x):"import"==e?v(k("form"),ut,x):p(k("stat"),w,h(";"),x)}function w(e){return M(e,!1)}function j(e){return M(e,!0)}function M(e,t){if(zt.state.fatArrowAt==zt.stream.start){var r=t?$:C;if("("==e)return v(y,k(")"),N(G,")"),x,h("=>"),r,b);if("variable"==e)return p(y,G,h("=>"),r,b)}var n=t?z:I;return It.hasOwnProperty(e)?v(n):"function"==e?v(et,n):"keyword c"==e?v(t?E:V):"("==e?v(k(")"),V,pt,h(")"),x,n):"operator"==e||"spread"==e?v(t?j:w):"["==e?v(k("]"),ft,x,n):"{"==e?H(P,"}",null,n):"quasi"==e?p(T,n):v()}function V(e){return e.match(/[;\}\)\],]/)?p():p(w)}function E(e){return e.match(/[;\}\)\],]/)?p():p(j)}function I(e,t){return","==e?v(w):z(e,t,!1)}function z(e,t,r){var n=0==r?I:z,a=0==r?w:j;return"=>"==e?v(y,r?$:C,b):"operator"==e?/\+\+|--/.test(t)?v(n):"?"==t?v(w,h(":"),a):v(a):"quasi"==e?p(T,n):";"!=e?"("==e?H(j,")","call",n):"."==e?v(O,n):"["==e?v(k("]"),V,h("]"),x,n):void 0:void 0}function T(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?v(T):v(w,A)}function A(e){return"}"==e?(zt.marked="string-2",zt.state.tokenize=u,v(T)):void 0}function C(e){return l(zt.stream,zt.state),p("{"==e?g:w)}function $(e){return l(zt.stream,zt.state),p("{"==e?g:j)}function q(e){return":"==e?v(x,g):p(I,h(";"),x)}function O(e){return"variable"==e?(zt.marked="property",v()):void 0}function P(e,t){return"variable"==e||"keyword"==zt.style?(zt.marked="property",v("get"==t||"set"==t?S:W)):"number"==e||"string"==e?(zt.marked=xt?"property":zt.style+" property",v(W)):"jsonld-keyword"==e?v(W):"["==e?v(w,h("]"),W):void 0}function S(e){return"variable"!=e?p(W):(zt.marked="property",v(et))}function W(e){return":"==e?v(j):"("==e?p(et):void 0}function N(e,t){function r(n){if(","==n){var a=zt.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),v(e,r)}return n==t?v():v(h(t))}return function(n){return n==t?v():p(e,r)}}function H(e,t,r){for(var n=3;n!?|~^]/,Vt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Et="([{}])",It={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},zt={state:null,column:null,marked:null,cc:null},Tt={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:i,lastType:"sof",cc:[],lexical:new s((e||0)-bt,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),l(e,t)),t.tokenize!=c&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==mt?r:(t.lastType="operator"!=mt||"++"!=yt&&"--"!=yt?mt:"incdec",d(t,r,mt,yt,e))},indent:function(t,n){if(t.tokenize==c)return e.Pass;if(t.tokenize!=i)return 0;var a=n&&n.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var l=t.cc[u];if(l==x)o=o.prev;else if(l!=Q)break}"stat"==o.type&&"}"==a&&(o=o.prev),kt&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var s=o.type,f=a==s;return"vardef"==s?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==s&&"{"==a?o.indented:"form"==s?o.indented+bt:"stat"==s?o.indented+(vt(t,n)?kt||bt:0):"switch"!=o.info||f||0==r.doubleIndentSwitch?o.align?o.column+(f?0:1):o.indented+(f?0:bt):o.indented+(/^(?:case|default)\b/.test(n)?bt:2*bt)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:ht?null:"/*",blockCommentEnd:ht?null:"*/",lineComment:ht?null:"//",fold:"brace",helperType:ht?"json":"javascript",jsonldMode:xt,jsonMode:ht}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.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 qa=a,ra=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(/\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")):"operator"==b.lastType||"keyword c"==b.lastType||"sof"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(d(a),a.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),e("regexp","string-2")):(a.eatWhile(za),e("operator","operator",a.current()));if("`"==c)return b.tokenize=i,i(a,b);if("#"==c)return a.skipToEnd(),e("error","error");if(za.test(c))return a.eatWhile(za),e("operator","operator",a.current());if(xa.test(c)){a.eatWhile(xa);var f=a.current(),j=ya.propertyIsEnumerable(f)&&ya[f];return j&&"."!=b.lastType?e(j.type,j.style,f):e("variable","variable",f)}}function g(a){return function(b,c){var d,g=!1;if(ua&&"@"==b.peek()&&b.match(Aa))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(!(0>c)){for(var d=0,e=!1,f=c-1;f>=0;--f){var g=a.string.charAt(f),h=Ba.indexOf(g);if(h>=0&&3>h){if(!d){++f;break}if(0==--d)break}else if(h>=3&&6>h)++d;else if(xa.test(g))e=!0;else{if(/["'\/]/.test(g))return;if(e&&!d){++f;break}}}e&&!d&&(b.fatArrowAt=f)}}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(Da.state=a,Da.stream=e,Da.marked=null,Da.cc=f,Da.style=b,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var g=f.length?f.pop():va?w:v;if(g(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return Da.marked?Da.marked:"variable"==c&&l(a,d)?"variable-2":b}}}function n(){for(var a=arguments.length-1;a>=0;a--)Da.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=Da.state;if(d.context){if(Da.marked="def",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(){Da.state.context={prev:Da.state.context,vars:Da.state.localVars},Da.state.localVars=Ea}function r(){Da.state.localVars=Da.state.context.vars,Da.state.context=Da.state.context.prev}function s(a,b){var c=function(){var c=Da.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,Da.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function t(){var a=Da.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function u(a){function b(c){return c==a?o():";"==a?n():o(b)}return b}function v(a,b){return"var"==a?o(s("vardef",b.length),R,u(";"),t):"keyword a"==a?o(s("form"),w,v,t):"keyword b"==a?o(s("form"),v,t):"{"==a?o(s("}"),O,t):";"==a?o():"if"==a?("else"==Da.state.lexical.info&&Da.state.cc[Da.state.cc.length-1]==t&&Da.state.cc.pop()(),o(s("form"),w,v,t,W)):"function"==a?o(aa):"for"==a?o(s("form"),X,v,t):"variable"==a?o(s("stat"),H):"switch"==a?o(s("form"),w,s("}","switch"),u("{"),O,t,t):"case"==a?o(w,u(":")):"default"==a?o(u(":")):"catch"==a?o(s("form"),q,u("("),ba,u(")"),v,t,r):"module"==a?o(s("form"),q,ga,r,t):"class"==a?o(s("form"),ca,t):"export"==a?o(s("form"),ha,t):"import"==a?o(s("form"),ia,t):n(s("stat"),w,u(";"),t)}function w(a){return y(a,!1)}function x(a){return y(a,!0)}function y(a,b){if(Da.state.fatArrowAt==Da.stream.start){var c=b?G:F;if("("==a)return o(q,s(")"),M(S,")"),t,u("=>"),c,r);if("variable"==a)return n(q,S,u("=>"),c,r)}var d=b?C:B;return Ca.hasOwnProperty(a)?o(d):"function"==a?o(aa,d):"keyword c"==a?o(b?A:z):"("==a?o(s(")"),z,oa,u(")"),t,d):"operator"==a||"spread"==a?o(b?x:w):"["==a?o(s("]"),ma,t,d):"{"==a?N(J,"}",null,d):"quasi"==a?n(D,d):o()}function z(a){return a.match(/[;\}\)\],]/)?n():n(w)}function A(a){return a.match(/[;\}\)\],]/)?n():n(x)}function B(a,b){return","==a?o(w):C(a,b,!1)}function C(a,b,c){var d=0==c?B:C,e=0==c?w:x;return"=>"==a?o(q,c?G:F,r):"operator"==a?/\+\+|--/.test(b)?o(d):"?"==b?o(w,u(":"),e):o(e):"quasi"==a?n(D,d):";"!=a?"("==a?N(x,")","call",d):"."==a?o(I,d):"["==a?o(s("]"),z,u("]"),t,d):void 0:void 0}function D(a,b){return"quasi"!=a?n():"${"!=b.slice(b.length-2)?o(D):o(w,E)}function E(a){return"}"==a?(Da.marked="string-2",Da.state.tokenize=i,o(D)):void 0}function F(a){return j(Da.stream,Da.state),n("{"==a?v:w)}function G(a){return j(Da.stream,Da.state),n("{"==a?v:x)}function H(a){return":"==a?o(t,v):n(B,u(";"),t)}function I(a){return"variable"==a?(Da.marked="property",o()):void 0}function J(a,b){return"variable"==a||"keyword"==Da.style?(Da.marked="property",o("get"==b||"set"==b?K:L)):"number"==a||"string"==a?(Da.marked=ua?"property":Da.style+" property",o(L)):"jsonld-keyword"==a?o(L):"["==a?o(w,u("]"),L):void 0}function K(a){return"variable"!=a?n(L):(Da.marked="property",o(aa))}function L(a){return":"==a?o(x):"("==a?n(aa):void 0}function M(a,b){function c(d){if(","==d){var e=Da.state.lexical;return"call"==e.info&&(e.pos=(e.pos||0)+1),o(a,c)}return d==b?o():o(u(b))}return function(d){return d==b?o():n(a,c)}}function N(a,b,c){for(var d=3;d!?|~^]/,Aa=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ba="([{}])",Ca={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Da={state:null,column:null,marked:null,cc:null},Ea={name:"this",next:{name:"arguments"}};return t.lex=!0,{startState:function(a){var b={tokenize:f,lastType:"sof",cc:[],lexical:new k((a||0)-sa,0,"block",!1),localVars:c.localVars,context:c.localVars&&{vars:c.localVars},indented: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"==qa?c:(b.lastType="operator"!=qa||"++"!=ra&&"--"!=ra?qa:"incdec",m(b,c,qa,ra,a))},indent:function(b,d){if(b.tokenize==h)return a.Pass;if(b.tokenize!=f)return 0;var e=d&&d.charAt(0),g=b.lexical;if(!/^\s*else\b/.test(d))for(var i=b.cc.length-1;i>=0;--i){var j=b.cc[i];if(j==t)g=g.prev;else if(j!=W)break}"stat"==g.type&&"}"==e&&(g=g.prev),ta&&")"==g.type&&"stat"==g.prev.type&&(g=g.prev);var k=g.type,l=e==k;return"vardef"==k?g.indented+("operator"==b.lastType||","==b.lastType?g.info+1:0):"form"==k&&"{"==e?g.indented:"form"==k?g.indented+sa:"stat"==k?g.indented+(pa(b,d)?ta||sa:0):"switch"!=g.info||l||0==c.doubleIndentSwitch?g.align?g.column+(l?0:1):g.indented+(l?0:sa):g.indented+(/^(?:case|default)\b/.test(d)?sa:2*sa)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:va?null:"/*",blockCommentEnd:va?null:"*/",lineComment:va?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:va?"json":"javascript",jsonldMode:ua,jsonMode:va}}),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/javascript/json-ld.html b/media/editors/codemirror/mode/javascript/json-ld.html +deleted file mode 100644 +index 3a37f0b..0000000 +--- a/media/editors/codemirror/mode/javascript/json-ld.html ++++ /dev/null +@@ -1,72 +0,0 @@ +- +- +-CodeMirror: JSON-LD mode +- +- +- +- +- +- +- +- +- +- +- +- +-
    +-

    JSON-LD mode

    +- +- +-
    +- +- +- +-

    This is a specialization of the JavaScript mode.

    +-
    +diff --git a/media/editors/codemirror/mode/javascript/test.js b/media/editors/codemirror/mode/javascript/test.js +deleted file mode 100644 +index 91b0e89..0000000 +--- a/media/editors/codemirror/mode/javascript/test.js ++++ /dev/null +@@ -1,200 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({indentUnit: 2}, "javascript"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- +- MT("locals", +- "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"); +- +- MT("comma-and-binop", +- "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"); +- +- MT("destructuring", +- "([keyword function]([def a], [[[def b], [def c] ]]) {", +- " [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);", +- " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];", +- "})();"); +- +- MT("class_body", +- "[keyword class] [variable Foo] {", +- " [property constructor]() {}", +- " [property sayName]() {", +- " [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];", +- " }", +- "}"); +- +- MT("class", +- "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {", +- " [property get] [property prop]() { [keyword return] [number 24]; }", +- " [property constructor]([def x], [def y]) {", +- " [keyword super]([string 'something']);", +- " [keyword this].[property x] [operator =] [variable-2 x];", +- " }", +- "}"); +- +- MT("module", +- "[keyword module] [string 'foo'] {", +- " [keyword export] [keyword let] [def x] [operator =] [number 42];", +- " [keyword export] [keyword *] [keyword from] [string 'somewhere'];", +- "}"); +- +- MT("import", +- "[keyword function] [variable foo]() {", +- " [keyword import] [def $] [keyword from] [string 'jquery'];", +- " [keyword module] [def crypto] [keyword from] [string 'crypto'];", +- " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];", +- "}"); +- +- MT("const", +- "[keyword function] [variable f]() {", +- " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];", +- "}"); +- +- MT("for/of", +- "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}"); +- +- MT("generator", +- "[keyword function*] [variable repeat]([def n]) {", +- " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])", +- " [keyword yield] [variable-2 i];", +- "}"); +- +- MT("quotedStringAddition", +- "[keyword let] [variable f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];"); +- +- MT("quotedFatArrow", +- "[keyword let] [variable f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];"); +- +- MT("fatArrow", +- "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);", +- "[variable a];", // No longer in scope +- "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];", +- "[variable c];"); +- +- MT("spread", +- "[keyword function] [variable f]([def a], [meta ...][def b]) {", +- " [variable something]([variable-2 a], [meta ...][variable-2 b]);", +- "}"); +- +- MT("comprehension", +- "[keyword function] [variable f]() {", +- " [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];", +- " ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));", +- "}"); +- +- MT("quasi", +- "[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); +- +- MT("quasi_no_function", +- "[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); +- +- MT("indent_statement", +- "[keyword var] [variable x] [operator =] [number 10]", +- "[variable x] [operator +=] [variable y] [operator +]", +- " [atom Infinity]", +- "[keyword debugger];"); +- +- MT("indent_if", +- "[keyword if] ([number 1])", +- " [keyword break];", +- "[keyword else] [keyword if] ([number 2])", +- " [keyword continue];", +- "[keyword else]", +- " [number 10];", +- "[keyword if] ([number 1]) {", +- " [keyword break];", +- "} [keyword else] [keyword if] ([number 2]) {", +- " [keyword continue];", +- "} [keyword else] {", +- " [number 10];", +- "}"); +- +- MT("indent_for", +- "[keyword for] ([keyword var] [variable i] [operator =] [number 0];", +- " [variable i] [operator <] [number 100];", +- " [variable i][operator ++])", +- " [variable doSomething]([variable i]);", +- "[keyword debugger];"); +- +- MT("indent_c_style", +- "[keyword function] [variable foo]()", +- "{", +- " [keyword debugger];", +- "}"); +- +- MT("indent_else", +- "[keyword for] (;;)", +- " [keyword if] ([variable foo])", +- " [keyword if] ([variable bar])", +- " [number 1];", +- " [keyword else]", +- " [number 2];", +- " [keyword else]", +- " [number 3];"); +- +- MT("indent_funarg", +- "[variable foo]([number 10000],", +- " [keyword function]([def a]) {", +- " [keyword debugger];", +- "};"); +- +- MT("indent_below_if", +- "[keyword for] (;;)", +- " [keyword if] ([variable foo])", +- " [number 1];", +- "[number 2];"); +- +- MT("multilinestring", +- "[keyword var] [variable x] [operator =] [string 'foo\\]", +- "[string bar'];"); +- +- MT("scary_regexp", +- "[string-2 /foo[[/]]bar/];"); +- +- MT("indent_strange_array", +- "[keyword var] [variable x] [operator =] [[", +- " [number 1],,", +- " [number 2],", +- "]];", +- "[number 10];"); +- +- var jsonld_mode = CodeMirror.getMode( +- {indentUnit: 2}, +- {name: "javascript", jsonld: true} +- ); +- function LD(name) { +- test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1)); +- } +- +- LD("json_ld_keywords", +- '{', +- ' [meta "@context"]: {', +- ' [meta "@base"]: [string "http://example.com"],', +- ' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],', +- ' [property "likesFlavor"]: {', +- ' [meta "@container"]: [meta "@list"]', +- ' [meta "@reverse"]: [string "@beFavoriteOf"]', +- ' },', +- ' [property "nick"]: { [meta "@container"]: [meta "@set"] },', +- ' [property "nick"]: { [meta "@container"]: [meta "@index"] }', +- ' },', +- ' [meta "@graph"]: [[ {', +- ' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],', +- ' [property "name"]: [string "John Lennon"],', +- ' [property "modified"]: {', +- ' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],', +- ' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]', +- ' }', +- ' } ]]', +- '}'); +- +- LD("json_ld_fake", +- '{', +- ' [property "@fake"]: [string "@fake"],', +- ' [property "@contextual"]: [string "@identifier"],', +- ' [property "user@domain.com"]: [string "@graphical"],', +- ' [property "@ID"]: [string "@@ID"]', +- '}'); +-})(); +diff --git a/media/editors/codemirror/mode/javascript/test.min.js b/media/editors/codemirror/mode/javascript/test.min.js +deleted file mode 100644 +index 24c2a2d..0000000 +--- a/media/editors/codemirror/mode/javascript/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function r(r){test.mode(r,o,Array.prototype.slice.call(arguments,1))}function e(r){test.mode(r,a,Array.prototype.slice.call(arguments,1))}var o=CodeMirror.getMode({indentUnit:2},"javascript");r("locals","[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"),r("comma-and-binop","[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"),r("destructuring","([keyword function]([def a], [[[def b], [def c] ]]) {"," [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);"," [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];","})();"),r("class_body","[keyword class] [variable Foo] {"," [property constructor]() {}"," [property sayName]() {"," [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];"," }","}"),r("class","[keyword class] [variable Point] [keyword extends] [variable SuperThing] {"," [property get] [property prop]() { [keyword return] [number 24]; }"," [property constructor]([def x], [def y]) {"," [keyword super]([string 'something']);"," [keyword this].[property x] [operator =] [variable-2 x];"," }","}"),r("module","[keyword module] [string 'foo'] {"," [keyword export] [keyword let] [def x] [operator =] [number 42];"," [keyword export] [keyword *] [keyword from] [string 'somewhere'];","}"),r("import","[keyword function] [variable foo]() {"," [keyword import] [def $] [keyword from] [string 'jquery'];"," [keyword module] [def crypto] [keyword from] [string 'crypto'];"," [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];","}"),r("const","[keyword function] [variable f]() {"," [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];","}"),r("for/of","[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}"),r("generator","[keyword function*] [variable repeat]([def n]) {"," [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])"," [keyword yield] [variable-2 i];","}"),r("quotedStringAddition","[keyword let] [variable f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];"),r("quotedFatArrow","[keyword let] [variable f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];"),r("fatArrow","[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);","[variable a];","[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];","[variable c];"),r("spread","[keyword function] [variable f]([def a], [meta ...][def b]) {"," [variable something]([variable-2 a], [meta ...][variable-2 b]);","}"),r("comprehension","[keyword function] [variable f]() {"," [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];"," ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));","}"),r("quasi","[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"),r("quasi_no_function","[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"),r("indent_statement","[keyword var] [variable x] [operator =] [number 10]","[variable x] [operator +=] [variable y] [operator +]"," [atom Infinity]","[keyword debugger];"),r("indent_if","[keyword if] ([number 1])"," [keyword break];","[keyword else] [keyword if] ([number 2])"," [keyword continue];","[keyword else]"," [number 10];","[keyword if] ([number 1]) {"," [keyword break];","} [keyword else] [keyword if] ([number 2]) {"," [keyword continue];","} [keyword else] {"," [number 10];","}"),r("indent_for","[keyword for] ([keyword var] [variable i] [operator =] [number 0];"," [variable i] [operator <] [number 100];"," [variable i][operator ++])"," [variable doSomething]([variable i]);","[keyword debugger];"),r("indent_c_style","[keyword function] [variable foo]()","{"," [keyword debugger];","}"),r("indent_else","[keyword for] (;;)"," [keyword if] ([variable foo])"," [keyword if] ([variable bar])"," [number 1];"," [keyword else]"," [number 2];"," [keyword else]"," [number 3];"),r("indent_funarg","[variable foo]([number 10000],"," [keyword function]([def a]) {"," [keyword debugger];","};"),r("indent_below_if","[keyword for] (;;)"," [keyword if] ([variable foo])"," [number 1];","[number 2];"),r("multilinestring","[keyword var] [variable x] [operator =] [string 'foo\\]","[string bar'];"),r("scary_regexp","[string-2 /foo[[/]]bar/];"),r("indent_strange_array","[keyword var] [variable x] [operator =] [["," [number 1],,"," [number 2],","]];","[number 10];");var a=CodeMirror.getMode({indentUnit:2},{name:"javascript",jsonld:!0});e("json_ld_keywords","{",' [meta "@context"]: {',' [meta "@base"]: [string "http://example.com"],',' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],',' [property "likesFlavor"]: {',' [meta "@container"]: [meta "@list"]',' [meta "@reverse"]: [string "@beFavoriteOf"]'," },",' [property "nick"]: { [meta "@container"]: [meta "@set"] },',' [property "nick"]: { [meta "@container"]: [meta "@index"] }'," },",' [meta "@graph"]: [[ {',' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],',' [property "name"]: [string "John Lennon"],',' [property "modified"]: {',' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],',' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]'," }"," } ]]","}"),e("json_ld_fake","{",' [property "@fake"]: [string "@fake"],',' [property "@contextual"]: [string "@identifier"],',' [property "user@domain.com"]: [string "@graphical"],',' [property "@ID"]: [string "@@ID"]',"}")}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/javascript/typescript.html b/media/editors/codemirror/mode/javascript/typescript.html +deleted file mode 100644 +index 2cfc538..0000000 +--- a/media/editors/codemirror/mode/javascript/typescript.html ++++ /dev/null +@@ -1,61 +0,0 @@ +- +- +-CodeMirror: TypeScript mode +- +- +- +- +- +- +- +- +- +-
    +-

    TypeScript mode

    +- +- +-
    +- +- +- +-

    This is a specialization of the JavaScript mode.

    +-
    +diff --git a/media/editors/codemirror/mode/jinja2/jinja2.min.js b/media/editors/codemirror/mode/jinja2/jinja2.min.js +index 0e22461..be1cba2 100644 +--- a/media/editors/codemirror/mode/jinja2/jinja2.min.js ++++ b/media/editors/codemirror/mode/jinja2/jinja2.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("jinja2",function(){function e(e,a){var c=e.peek();if(a.incomment)return e.skipTo("#}")?(e.eatWhile(/\#|}/),a.incomment=!1):e.skipToEnd(),"comment";if(a.intag){if(a.operator){if(a.operator=!1,e.match(i))return"atom";if(e.match(o))return"number"}if(a.sign){if(a.sign=!1,e.match(i))return"atom";if(e.match(o))return"number"}if(a.instring)return c==a.instring&&(a.instring=!1),e.next(),"string";if("'"==c||'"'==c)return a.instring=c,e.next(),"string";if(e.match(a.intag+"}")||e.eat("-")&&e.match(a.intag+"}"))return a.intag=!1,"tag";if(e.match(t))return a.operator=!0,"operator";if(e.match(r))a.sign=!0;else if(e.eat(" ")||e.sol()){if(e.match(n))return"keyword";if(e.match(i))return"atom";if(e.match(o))return"number";e.sol()&&e.next()}else e.next();return"variable"}if(e.eat("{")){if(c=e.eat("#"))return a.incomment=!0,e.skipTo("#}")?(e.eatWhile(/\#|}/),a.incomment=!1):e.skipToEnd(),"comment";if(c=e.eat(/\{|%/))return a.intag=c,"{"==c&&(a.intag="}"),e.eat("-"),"tag"}e.next()}var n=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","plural"],t=/^[+\-*&%=<>!?|~^]/,r=/^[:\[\(\{]/,i=["true","false"],o=/^(\d[+\-\*\/])?\d+(\.\d+)?/;return n=new RegExp("(("+n.join(")|(")+"))\\b"),i=new RegExp("(("+i.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,n){return n.tokenize(e,n)}}})}); +\ 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("jinja2",function(){function a(a,g){var h=a.peek();if(g.incomment)return a.skipTo("#}")?(a.eatWhile(/\#|}/),g.incomment=!1):a.skipToEnd(),"comment";if(g.intag){if(g.operator){if(g.operator=!1,a.match(e))return"atom";if(a.match(f))return"number"}if(g.sign){if(g.sign=!1,a.match(e))return"atom";if(a.match(f))return"number"}if(g.instring)return h==g.instring&&(g.instring=!1),a.next(),"string";if("'"==h||'"'==h)return g.instring=h,a.next(),"string";if(a.match(g.intag+"}")||a.eat("-")&&a.match(g.intag+"}"))return g.intag=!1,"tag";if(a.match(c))return g.operator=!0,"operator";if(a.match(d))g.sign=!0;else if(a.eat(" ")||a.sol()){if(a.match(b))return"keyword";if(a.match(e))return"atom";if(a.match(f))return"number";a.sol()&&a.next()}else a.next();return"variable"}if(a.eat("{")){if(h=a.eat("#"))return g.incomment=!0,a.skipTo("#}")?(a.eatWhile(/\#|}/),g.incomment=!1):a.skipToEnd(),"comment";if(h=a.eat(/\{|%/))return g.intag=h,"{"==h&&(g.intag="}"),a.eat("-"),"tag"}a.next()}var b=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","plural"],c=/^[+\-*&%=<>!?|~^]/,d=/^[:\[\(\{]/,e=["true","false"],f=/^(\d[+\-\*\/])?\d+(\.\d+)?/;return b=new RegExp("(("+b.join(")|(")+"))\\b"),e=new RegExp("(("+e.join(")|(")+"))\\b"),{startState:function(){return{tokenize:a}},token:function(a,b){return b.tokenize(a,b)}}})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/julia/julia.js b/media/editors/codemirror/mode/julia/julia.js +index e854988..d0a74ce 100644 +--- a/media/editors/codemirror/mode/julia/julia.js ++++ b/media/editors/codemirror/mode/julia/julia.js +@@ -34,7 +34,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { + var closers = wordRegexp(blockClosers); + var macro = /^@[_A-Za-z][_A-Za-z0-9]*/; + var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/; +- var indentInfo = null; + + function in_array(state) { + var ch = cur_scope(state); +@@ -247,7 +246,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { + } + + function tokenLexer(stream, state) { +- indentInfo = null; + var style = state.tokenize(stream, state); + var current = stream.current(); + +diff --git a/media/editors/codemirror/mode/julia/julia.min.js b/media/editors/codemirror/mode/julia/julia.min.js +index 644eb80..e91312d 100644 +--- a/media/editors/codemirror/mode/julia/julia.min.js ++++ b/media/editors/codemirror/mode/julia/julia.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("julia",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e){var t=i(e);return"["==t||"{"==t?!0:!1}function i(e){return 0==e.scopes.length?null:e.scopes[e.scopes.length-1]}function a(e,t){var n=t.leaving_expr;if(e.sol()&&(n=!1),t.leaving_expr=!1,n&&e.match(/^'+/))return"operator";if(e.match(/^\.{2,3}/))return"operator";if(e.eatSpace())return null;var a=e.peek();if("#"===a)return e.skipToEnd(),"comment";"["===a&&t.scopes.push("["),"{"===a&&t.scopes.push("{");var l=i(t);"["===l&&"]"===a&&(t.scopes.pop(),t.leaving_expr=!0),"{"===l&&"}"===a&&(t.scopes.pop(),t.leaving_expr=!0),")"===a&&(t.leaving_expr=!0);var m;if(!r(t)&&(m=e.match(x,!1))&&t.scopes.push(m),!r(t)&&e.match(y,!1)&&t.scopes.pop(),r(t)&&e.match(/^end/))return"number";if(e.match(/^=>/))return"operator";if(e.match(/^[0-9\.]/,!1)){var p=RegExp(/^im\b/),h=!1;if(e.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)&&(h=!0),e.match(/^\d+\.(?!\.)\d*/)&&(h=!0),e.match(/^\.\d+/)&&(h=!0),h)return e.match(p),t.leaving_expr=!0,"number";var d=!1;if(e.match(/^0x[0-9a-f]+/i)&&(d=!0),e.match(/^0b[01]+/i)&&(d=!0),e.match(/^0o[0-7]+/i)&&(d=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(d=!0),e.match(/^0(?![\dx])/i)&&(d=!0),d)return e.match(p),t.leaving_expr=!0,"number"}return e.match(/^(::)|(<:)/)?"operator":!n&&e.match(z)?"string":e.match(u)?"operator":e.match(g)?(t.tokenize=o(e.current()),t.tokenize(e,t)):e.match(_)?"meta":e.match(f)?null:e.match(b)?"keyword":e.match(v)?"builtin":e.match(s)?(t.leaving_expr=!0,"variable"):(e.next(),c)}function o(e){function n(n,o){for(;!n.eol();)if(n.eatWhile(/[^'"\\]/),n.eat("\\")){if(n.next(),r&&n.eol())return i}else{if(n.match(e))return o.tokenize=a,i;n.eat(/['"]/)}if(r){if(t.singleLineStringErrors)return c;o.tokenize=a}return i}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var r=1==e.length,i="string";return n.isString=!0,n}function l(e,t){F=null;var n=t.tokenize(e,t),r=e.current();return"."===r?(n=e.match(s,!1)?null:c,null===n&&"meta"===t.lastStyle&&(n="meta"),n):n}var c="error",u=t.operators||/^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/,f=t.delimiters||/^[;,()[\]{}]/,s=t.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/,m=["begin","function","type","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"],p=["end","else","elseif","catch","finally"],h=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","macro","module","baremodule","type","immutable","quote","typealias","abstract","bitstype","ccall"],d=["true","false","enumerate","open","close","nothing","NaN","Inf","print","println","Int","Int8","Uint8","Int16","Uint16","Int32","Uint32","Int64","Uint64","Int128","Uint128","Bool","Char","Float16","Float32","Float64","Array","Vector","Matrix","String","UTF8String","ASCIIString","error","warn","info","@printf"],g=/^(`|'|"{3}|([br]?"))/,b=n(h),v=n(d),x=n(m),y=n(p),_=/^@[_A-Za-z][_A-Za-z0-9]*/,z=/^:[_A-Za-z][_A-Za-z0-9]*/,F=null,k={startState:function(){return{tokenize:a,scopes:[],leaving_expr:!1}},token:function(e,t){var n=l(e,t);return t.lastStyle=n,n},indent:function(e,t){var n=0;return("end"==t||"]"==t||"}"==t||"else"==t||"elseif"==t||"catch"==t||"finally"==t)&&(n=-1),4*(e.scopes.length+n)},lineComment:"#",fold:"indent",electricChars:"edlsifyh]}"};return k}),e.defineMIME("text/x-julia","julia")}); +\ 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("julia",function(a,b){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function d(a){var b=e(a);return"["==b||"{"==b?!0:!1}function e(a){return 0==a.scopes.length?null:a.scopes[a.scopes.length-1]}function f(a,b){var c=b.leaving_expr;if(a.sol()&&(c=!1),b.leaving_expr=!1,c&&a.match(/^'+/))return"operator";if(a.match(/^\.{2,3}/))return"operator";if(a.eatSpace())return null;var f=a.peek();if("#"===f)return a.skipToEnd(),"comment";"["===f&&b.scopes.push("["),"{"===f&&b.scopes.push("{");var h=e(b);"["===h&&"]"===f&&(b.scopes.pop(),b.leaving_expr=!0),"{"===h&&"}"===f&&(b.scopes.pop(),b.leaving_expr=!0),")"===f&&(b.leaving_expr=!0);var m;if(!d(b)&&(m=a.match(t,!1))&&b.scopes.push(m),!d(b)&&a.match(u,!1)&&b.scopes.pop(),d(b)&&a.match(/^end/))return"number";if(a.match(/^=>/))return"operator";if(a.match(/^[0-9\.]/,!1)){var n=RegExp(/^im\b/),o=!1;if(a.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)&&(o=!0),a.match(/^\d+\.(?!\.)\d*/)&&(o=!0),a.match(/^\.\d+/)&&(o=!0),o)return a.match(n),b.leaving_expr=!0,"number";var p=!1;if(a.match(/^0x[0-9a-f]+/i)&&(p=!0),a.match(/^0b[01]+/i)&&(p=!0),a.match(/^0o[0-7]+/i)&&(p=!0),a.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(p=!0),a.match(/^0(?![\dx])/i)&&(p=!0),p)return a.match(n),b.leaving_expr=!0,"number"}return a.match(/^(::)|(<:)/)?"operator":!c&&a.match(w)?"string":a.match(j)?"operator":a.match(q)?(b.tokenize=g(a.current()),b.tokenize(a,b)):a.match(v)?"meta":a.match(k)?null:a.match(r)?"keyword":a.match(s)?"builtin":a.match(l)?(b.leaving_expr=!0,"variable"):(a.next(),i)}function g(a){function c(c,g){for(;!c.eol();)if(c.eatWhile(/[^'"\\]/),c.eat("\\")){if(c.next(),d&&c.eol())return e}else{if(c.match(a))return g.tokenize=f,e;c.eat(/['"]/)}if(d){if(b.singleLineStringErrors)return i;g.tokenize=f}return e}for(;"rub".indexOf(a.charAt(0).toLowerCase())>=0;)a=a.substr(1);var d=1==a.length,e="string";return c.isString=!0,c}function h(a,b){var c=b.tokenize(a,b),d=a.current();return"."===d?(c=a.match(l,!1)?null:i,null===c&&"meta"===b.lastStyle&&(c="meta"),c):c}var i="error",j=b.operators||/^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/,k=b.delimiters||/^[;,()[\]{}]/,l=b.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/,m=["begin","function","type","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"],n=["end","else","elseif","catch","finally"],o=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","macro","module","baremodule","type","immutable","quote","typealias","abstract","bitstype","ccall"],p=["true","false","enumerate","open","close","nothing","NaN","Inf","print","println","Int","Int8","Uint8","Int16","Uint16","Int32","Uint32","Int64","Uint64","Int128","Uint128","Bool","Char","Float16","Float32","Float64","Array","Vector","Matrix","String","UTF8String","ASCIIString","error","warn","info","@printf"],q=/^(`|'|"{3}|([br]?"))/,r=c(o),s=c(p),t=c(m),u=c(n),v=/^@[_A-Za-z][_A-Za-z0-9]*/,w=/^:[_A-Za-z][_A-Za-z0-9]*/,x={startState:function(){return{tokenize:f,scopes:[],leaving_expr:!1}},token:function(a,b){var c=h(a,b);return b.lastStyle=c,c},indent:function(a,b){var c=0;return("end"==b||"]"==b||"}"==b||"else"==b||"elseif"==b||"catch"==b||"finally"==b)&&(c=-1),4*(a.scopes.length+c)},lineComment:"#",fold:"indent",electricChars:"edlsifyh]}"};return x}),a.defineMIME("text/x-julia","julia")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/kotlin/kotlin.js b/media/editors/codemirror/mode/kotlin/kotlin.js +index 73c84f6..1efec85 100644 +--- a/media/editors/codemirror/mode/kotlin/kotlin.js ++++ b/media/editors/codemirror/mode/kotlin/kotlin.js +@@ -271,6 +271,7 @@ CodeMirror.defineMode("kotlin", function (config, parserConfig) { + else return ctx.indented + (closing ? 0 : config.indentUnit); + }, + ++ closeBrackets: {triples: "'\""}, + electricChars: "{}" + }; + }); +diff --git a/media/editors/codemirror/mode/kotlin/kotlin.min.js b/media/editors/codemirror/mode/kotlin/kotlin.min.js +index 4fbf7b9..b008678 100644 +--- a/media/editors/codemirror/mode/kotlin/kotlin.min.js ++++ b/media/editors/codemirror/mode/kotlin/kotlin.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("kotlin",function(e,t){function n(e){for(var t={},n=e.split(" "),r=0;r"))return c="->",null;if(/[\-+*&%=<>!?|\/~]/.test(n))return e.eatWhile(/[\-+*&%=<>|~]/),"operator";e.eatWhile(/[\w\$_]/);var r=e.current();return h.propertyIsEnumerable(r)?"atom":k.propertyIsEnumerable(r)?(y.propertyIsEnumerable(r)&&(c="newstatement"),"softKeyword"):m.propertyIsEnumerable(r)?(y.propertyIsEnumerable(r)&&(c="newstatement"),"keyword"):"word"}function i(e,t,n){function r(t,n){for(var u,l=!1,s=!i;null!=(u=t.next());){if(u==e&&!l){if(!i)break;if(t.match(e+e)){s=!0;break}}if('"'==e&&"$"==u&&!l&&t.eat("{"))return n.tokenize.push(o()),"string";if("$"==u&&!l&&!t.eat(" "))return n.tokenize.push(a()),"string";l=!l&&"\\"==u}return d&&n.tokenize.push(r),s&&n.tokenize.pop(),"string"}var i=!1;if("/"!=e&&t.eat(e)){if(!t.eat(e))return"string";i=!0}return n.tokenize.push(r),r(t,n)}function o(){function e(e,n){if("}"==e.peek()){if(t--,0==t)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](e,n)}else"{"==e.peek()&&t++;return r(e,n)}var t=1;return e.isBase=!0,e}function a(){function e(e,t){if(e.eat(/[\w]/)){var n=e.eatWhile(/[\w]/);if(n)return t.tokenize.pop(),"word"}return t.tokenize.pop(),"string"}return e.isBase=!0,e}function u(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize.pop();break}r="*"==n}return"comment"}function l(e){return!e||"operator"==e||"->"==e||/[\.\[\{\(,;:]/.test(e)||"newstatement"==e||"keyword"==e||"proplabel"==e}function s(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function f(e,t,n){return e.context=new s(e.indented,t,n,null,e.context)}function p(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var c,d=t.multiLineStrings,m=n("package continue return object while break class data trait throw super when type this else This try val var fun for is in if do as true false null get set"),k=n("import where by get set abstract enum open annotation override private public internal protected catch out vararg inline finally final ref"),y=n("catch class do else finally for if where try while enum"),h=n("null true false this");return r.isBase=!0,{startState:function(t){return{tokenize:[r],context:new s((t||0)-e.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"statement"!=n.type||l(t.lastToken)||(p(t),n=t.context)),e.eatSpace())return null;c=null;var r=t.tokenize[t.tokenize.length-1](e,t);if("comment"==r)return r;if(null==n.align&&(n.align=!0),";"!=c&&":"!=c||"statement"!=n.type)if("->"==c&&"statement"==n.type&&"}"==n.prev.type)p(t),t.context.align=!1;else if("{"==c)f(t,e.column(),"}");else if("["==c)f(t,e.column(),"]");else if("("==c)f(t,e.column(),")");else if("}"==c){for(;"statement"==n.type;)n=p(t);for("}"==n.type&&(n=p(t));"statement"==n.type;)n=p(t)}else c==n.type?p(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==c)&&f(t,e.column(),"statement");else p(t);return t.startOfLine=!1,t.lastToken=c||r,r},indent:function(t,n){if(!t.tokenize[t.tokenize.length-1].isBase)return 0;var r=n&&n.charAt(0),i=t.context;"statement"!=i.type||l(t.lastToken)||(i=i.prev);var o=r==i.type;return"statement"==i.type?i.indented+("{"==r?0:e.indentUnit):i.align?i.column+(o?0:1):i.indented+(o?0:e.indentUnit)},electricChars:"{}"}}),e.defineMIME("text/x-kotlin","kotlin")}); +\ 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("kotlin",function(a,b){function c(a){for(var b={},c=a.split(" "),d=0;d"))return m="->",null;if(/[\-+*&%=<>!?|\/~]/.test(c))return a.eatWhile(/[\-+*&%=<>|~]/),"operator";a.eatWhile(/[\w\$_]/);var d=a.current();return r.propertyIsEnumerable(d)?"atom":p.propertyIsEnumerable(d)?(q.propertyIsEnumerable(d)&&(m="newstatement"),"softKeyword"):o.propertyIsEnumerable(d)?(q.propertyIsEnumerable(d)&&(m="newstatement"),"keyword"):"word"}function e(a,b,c){function d(b,c){for(var h,i=!1,j=!e;null!=(h=b.next());){if(h==a&&!i){if(!e)break;if(b.match(a+a)){j=!0;break}}if('"'==a&&"$"==h&&!i&&b.eat("{"))return c.tokenize.push(f()),"string";if("$"==h&&!i&&!b.eat(" "))return c.tokenize.push(g()),"string";i=!i&&"\\"==h}return n&&c.tokenize.push(d),j&&c.tokenize.pop(),"string"}var e=!1;if("/"!=a&&b.eat(a)){if(!b.eat(a))return"string";e=!0}return c.tokenize.push(d),d(b,c)}function f(){function a(a,c){if("}"==a.peek()){if(b--,0==b)return c.tokenize.pop(),c.tokenize[c.tokenize.length-1](a,c)}else"{"==a.peek()&&b++;return d(a,c)}var b=1;return a.isBase=!0,a}function g(){function a(a,b){if(a.eat(/[\w]/)){var c=a.eatWhile(/[\w]/);if(c)return b.tokenize.pop(),"word"}return b.tokenize.pop(),"string"}return a.isBase=!0,a}function h(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize.pop();break}d="*"==c}return"comment"}function i(a){return!a||"operator"==a||"->"==a||/[\.\[\{\(,;:]/.test(a)||"newstatement"==a||"keyword"==a||"proplabel"==a}function j(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function k(a,b,c){return a.context=new j(a.indented,b,c,null,a.context)}function l(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var m,n=b.multiLineStrings,o=c("package continue return object while break class data trait throw super when type this else This try val var fun for is in if do as true false null get set"),p=c("import where by get set abstract enum open annotation override private public internal protected catch out vararg inline finally final ref"),q=c("catch class do else finally for if where try while enum"),r=c("null true false this");return d.isBase=!0,{startState:function(b){return{tokenize:[d],context:new j((b||0)-a.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0,"statement"!=c.type||i(b.lastToken)||(l(b),c=b.context)),a.eatSpace())return null;m=null;var d=b.tokenize[b.tokenize.length-1](a,b);if("comment"==d)return d;if(null==c.align&&(c.align=!0),";"!=m&&":"!=m||"statement"!=c.type)if("->"==m&&"statement"==c.type&&"}"==c.prev.type)l(b),b.context.align=!1;else if("{"==m)k(b,a.column(),"}");else if("["==m)k(b,a.column(),"]");else if("("==m)k(b,a.column(),")");else if("}"==m){for(;"statement"==c.type;)c=l(b);for("}"==c.type&&(c=l(b));"statement"==c.type;)c=l(b)}else m==c.type?l(b):("}"==c.type||"top"==c.type||"statement"==c.type&&"newstatement"==m)&&k(b,a.column(),"statement");else l(b);return b.startOfLine=!1,b.lastToken=m||d,d},indent:function(b,c){if(!b.tokenize[b.tokenize.length-1].isBase)return 0;var d=c&&c.charAt(0),e=b.context;"statement"!=e.type||i(b.lastToken)||(e=e.prev);var f=d==e.type;return"statement"==e.type?e.indented+("{"==d?0:a.indentUnit):e.align?e.column+(f?0:1):e.indented+(f?0:a.indentUnit)},closeBrackets:{triples:"'\""},electricChars:"{}"}}),a.defineMIME("text/x-kotlin","kotlin")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/livescript/livescript.js b/media/editors/codemirror/mode/livescript/livescript.js +index 55882ef..4b26e04 100644 +--- a/media/editors/codemirror/mode/livescript/livescript.js ++++ b/media/editors/codemirror/mode/livescript/livescript.js +@@ -24,8 +24,8 @@ + var nr = Rules[next_rule]; + if (nr.splice) { + for (var i$ = 0; i$ < nr.length; ++i$) { +- var r = nr[i$], m; +- if (r.regex && (m = stream.match(r.regex))) { ++ var r = nr[i$]; ++ if (r.regex && stream.match(r.regex)) { + state.next = r.next || state.next; + return r.token; + } +diff --git a/media/editors/codemirror/mode/livescript/livescript.min.js b/media/editors/codemirror/mode/livescript/livescript.min.js +index ca302a9..eae94dc 100644 +--- a/media/editors/codemirror/mode/livescript/livescript.min.js ++++ b/media/editors/codemirror/mode/livescript/livescript.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("livescript",function(){var e=function(e,t){var r=t.next||"start";if(r){t.next=t.next;var n=g[r];if(n.splice){for(var o=0;o|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+t+")?))\\s*$"),n="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",o={token:"string",regex:".+"},g={start:[{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)"+n},{token:"constant.language",regex:"(?:true|false|yes|no|on|off|null|void|undefined)"+n},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+n},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+n},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+n},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+n},{token:"identifier",regex:t+"\\s*:(?![:=])"},{token:"variable",regex:t},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:t,next:"start"},{token:"text",regex:"",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},o],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},o],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},o],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},o],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},o],words:[{token:"string",regex:".*?\\]>",next:"key"},o]};for(var x in g){var i=g[x];if(i.splice)for(var a=0,s=i.length;s>a;++a){var k=i[a];"string"==typeof k.regex&&(g[x][a].regex=new RegExp("^"+k.regex))}else"string"==typeof k.regex&&(g[x].regex=new RegExp("^"+i.regex))}e.defineMIME("text/x-livescript","livescript")}); +\ 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("livescript",function(){var a=function(a,b){var c=b.next||"start";if(c){b.next=b.next;var d=f[c];if(d.splice){for(var e=0;e|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+b+")?))\\s*$"),d="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",e={token:"string",regex:".+"},f={start:[{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)"+d},{token:"constant.language",regex:"(?:true|false|yes|no|on|off|null|void|undefined)"+d},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+d},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+d},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+d},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+d},{token:"identifier",regex:b+"\\s*:(?![:=])"},{token:"variable",regex:b},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:b,next:"start"},{token:"text",regex:"",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},e],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},e],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},e],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},e],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},e],words:[{token:"string",regex:".*?\\]>",next:"key"},e]};for(var g in f){var h=f[g];if(h.splice)for(var i=0,j=h.length;j>i;++i){var k=h[i];"string"==typeof k.regex&&(f[g][i].regex=new RegExp("^"+k.regex))}else"string"==typeof k.regex&&(f[g].regex=new RegExp("^"+h.regex))}a.defineMIME("text/x-livescript","livescript")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/lua/lua.min.js b/media/editors/codemirror/mode/lua/lua.min.js +index c5151cd..de751af 100644 +--- a/media/editors/codemirror/mode/lua/lua.min.js ++++ b/media/editors/codemirror/mode/lua/lua.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("lua",function(e,t){function n(e){return new RegExp("^(?:"+e.join("|")+")","i")}function a(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function r(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var n=e.next();return"-"==n&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=i(r(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==n||"'"==n?(t.cur=u(n))(e,t):"["==n&&/[\[=]/.test(e.peek())?(t.cur=i(r(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function i(e,t){return function(n,a){for(var r,i=null;null!=(r=n.next());)if(null==i)"]"==r&&(i=0);else if("="==r)++i;else{if("]"==r&&i==e){a.cur=o;break}i=null}return t}}function u(e){return function(t,n){for(var a,r=!1;null!=(a=t.next())&&(a!=e||r);)r=!r&&"\\"==a;return r||(n.cur=o),"string"}}var l=e.indentUnit,s=a(t.specials||[]),c=a(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),m=a(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),d=a(["function","if","repeat","do","\\(","{"]),g=a(["end","until","\\)","}"]),f=n(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),a=e.current();return"variable"==n&&(m.test(a)?n="keyword":c.test(a)?n="builtin":s.test(a)&&(n="variable-2")),"comment"!=n&&"string"!=n&&(d.test(a)?++t.indentDepth:g.test(a)&&--t.indentDepth),n},indent:function(e,t){var n=f.test(t);return e.basecol+l*(e.indentDepth-(n?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}); +\ 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("lua",function(a,b){function c(a){return new RegExp("^(?:"+a.join("|")+")","i")}function d(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function e(a){for(var b=0;a.eat("=");)++b;return a.eat("["),b}function f(a,b){var c=a.next();return"-"==c&&a.eat("-")?a.eat("[")&&a.eat("[")?(b.cur=g(e(a),"comment"))(a,b):(a.skipToEnd(),"comment"):'"'==c||"'"==c?(b.cur=h(c))(a,b):"["==c&&/[\[=]/.test(a.peek())?(b.cur=g(e(a),"string"))(a,b):/\d/.test(c)?(a.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(c)?(a.eatWhile(/[\w\\\-_.]/),"variable"):null}function g(a,b){return function(c,d){for(var e,g=null;null!=(e=c.next());)if(null==g)"]"==e&&(g=0);else if("="==e)++g;else{if("]"==e&&g==a){d.cur=f;break}g=null}return b}}function h(a){return function(b,c){for(var d,e=!1;null!=(d=b.next())&&(d!=a||e);)e=!e&&"\\"==d;return e||(c.cur=f),"string"}}var i=a.indentUnit,j=d(b.specials||[]),k=d(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),l=d(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),m=d(["function","if","repeat","do","\\(","{"]),n=d(["end","until","\\)","}"]),o=c(["end","until","\\)","}","else","elseif"]);return{startState:function(a){return{basecol:a||0,indentDepth:0,cur:f}},token:function(a,b){if(a.eatSpace())return null;var c=b.cur(a,b),d=a.current();return"variable"==c&&(l.test(d)?c="keyword":k.test(d)?c="builtin":j.test(d)&&(c="variable-2")),"comment"!=c&&"string"!=c&&(m.test(d)?++b.indentDepth:n.test(d)&&--b.indentDepth),c},indent:function(a,b){var c=o.test(b);return a.basecol+i*(a.indentDepth-(c?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),a.defineMIME("text/x-lua","lua")}); +\ 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 3c80311..bc5314f 100644 +--- a/media/editors/codemirror/mode/markdown/markdown.js ++++ b/media/editors/codemirror/mode/markdown/markdown.js +@@ -72,7 +72,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { + , ulRE = /^[*\-+]\s+/ + , olRE = /^[0-9]+\.\s+/ + , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE +- , atxHeaderRE = /^#+/ ++ , atxHeaderRE = /^#+ ?/ + , setextHeaderRE = /^(?:\={1,}|-{1,})$/ + , textRE = /^[^#!\[\]*_\\<>` "'(~]+/; + +@@ -116,18 +116,20 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { + + var sol = stream.sol(); + +- var prevLineIsList = (state.list !== false); +- if (state.list !== false && state.indentationDiff >= 0) { // Continued list +- if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block +- state.indentation -= state.indentationDiff; ++ var prevLineIsList = state.list !== false; ++ if (prevLineIsList) { ++ if (state.indentationDiff >= 0) { // Continued list ++ if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block ++ state.indentation -= state.indentationDiff; ++ } ++ state.list = null; ++ } else if (state.indentation > 0) { ++ state.list = null; ++ state.listDepth = Math.floor(state.indentation / 4); ++ } else { // No longer a list ++ state.list = false; ++ state.listDepth = 0; + } +- state.list = null; +- } else if (state.list !== false && state.indentation > 0) { +- state.list = null; +- state.listDepth = Math.floor(state.indentation / 4); +- } else if (state.list !== false) { // No longer a list +- state.list = false; +- state.listDepth = 0; + } + + var match = null; +@@ -138,7 +140,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { + } else if (stream.eatSpace()) { + return null; + } else if (match = stream.match(atxHeaderRE)) { +- state.header = match[0].length <= 6 ? match[0].length : 6; ++ state.header = Math.min(6, match[0].indexOf(" ") !== -1 ? match[0].length - 1 : match[0].length); + if (modeCfg.highlightFormatting) state.formatting = "header"; + state.f = state.inline; + return getType(state); +diff --git a/media/editors/codemirror/mode/markdown/markdown.min.js b/media/editors/codemirror/mode/markdown/markdown.min.js +index efd4af7..6e14ce0 100644 +--- a/media/editors/codemirror/mode/markdown/markdown.min.js ++++ b/media/editors/codemirror/mode/markdown/markdown.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("markdown",function(e,i){function n(i){if(t.findModeByName){var n=t.findModeByName(i);n&&(i=n.mime||n.mimes[0])}var r=t.getMode(e,i);return"null"==r.name?null:r}function r(t,e,i){return e.f=e.inline=i,i(t,e)}function a(t,e,i){return e.f=e.block=i,i(t,e)}function o(t){return t.linkTitle=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,L||t.f!=h||(t.f=m,t.block=l),t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.thisLineHasContent=!1,null}function l(t,e){var a=t.sol(),o=e.list!==!1;e.list!==!1&&e.indentationDiff>=0?(e.indentationDiff<4&&(e.indentation-=e.indentationDiff),e.list=null):e.list!==!1&&e.indentation>0?(e.list=null,e.listDepth=Math.floor(e.indentation/4)):e.list!==!1&&(e.list=!1,e.listDepth=0);var l=null;if(e.indentationDiff>=4)return e.indentation-=4,t.skipToEnd(),M;if(t.eatSpace())return null;if(l=t.match(P))return e.header=l[0].length<=6?l[0].length:6,i.highlightFormatting&&(e.formatting="header"),e.f=e.inline,f(e);if(e.prevLineHasContent&&(l=t.match(z)))return e.header="="==l[0].charAt(0)?1:2,i.highlightFormatting&&(e.formatting="header"),e.f=e.inline,f(e);if(t.eat(">"))return e.indentation++,e.quote=a?1:e.quote+1,i.highlightFormatting&&(e.formatting="quote"),t.eatSpace(),f(e);if("["===t.peek())return r(t,e,p);if(t.match(U,!0))return T;if((!e.prevLineHasContent||o)&&(t.match(R,!1)||t.match(A,!1))){var h=null;return t.match(R,!0)?h="ul":(t.match(A,!0),h="ol"),e.indentation+=4,e.list=!0,e.listDepth++,i.taskLists&&t.match(I,!1)&&(e.taskList=!0),e.f=e.inline,i.highlightFormatting&&(e.formatting=["list","list-"+h]),f(e)}return i.fencedCodeBlocks&&t.match(/^```[ \t]*([\w+#]*)/,!0)?(e.localMode=n(RegExp.$1),e.localMode&&(e.localState=e.localMode.startState()),e.f=e.block=g,i.highlightFormatting&&(e.formatting="code-block"),e.code=!0,f(e)):r(t,e,e.inline)}function h(t,e){var i=F.token(t,e.htmlState);return(L&&null===e.htmlState.tagStart&&!e.htmlState.context||e.md_inside&&t.current().indexOf(">")>-1)&&(e.f=m,e.block=l,e.htmlState=null),i}function g(t,e){return t.sol()&&t.match("```",!1)?(e.localMode=e.localState=null,e.f=e.block=s,null):e.localMode?e.localMode.token(t,e.localState):(t.skipToEnd(),M)}function s(t,e){t.match("```"),e.block=l,e.f=m,i.highlightFormatting&&(e.formatting="code-block"),e.code=!0;var n=f(e);return e.code=!1,n}function f(t){var e=[];if(t.formatting){e.push(y),"string"==typeof t.formatting&&(t.formatting=[t.formatting]);for(var n=0;n=t.quote?y+"-"+t.formatting[n]+"-"+t.quote:"error")}if(t.taskOpen)return e.push("meta"),e.length?e.join(" "):null;if(t.taskClosed)return e.push("property"),e.length?e.join(" "):null;if(t.linkHref)return e.push(O),e.length?e.join(" "):null;if(t.strong&&e.push(E),t.em&&e.push(j),t.strikethrough&&e.push(W),t.linkText&&e.push(N),t.code&&e.push(M),t.header&&(e.push(q),e.push(q+"-"+t.header)),t.quote&&(e.push(w),e.push(!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=t.quote?w+"-"+t.quote:w+"-"+i.maxBlockquoteDepth)),t.list!==!1){var r=(t.listDepth-1)%3;e.push(r?1===r?D:H:C)}return t.trailingSpaceNewLine?e.push("trailing-space-new-line"):t.trailingSpace&&e.push("trailing-space-"+(t.trailingSpace%2?"a":"b")),e.length?e.join(" "):null}function u(t,e){return t.match(G,!0)?f(e):void 0}function m(e,n){var r=n.text(e,n);if("undefined"!=typeof r)return r;if(n.list)return n.list=null,f(n);if(n.taskList){var o="x"!==e.match(I,!0)[1];return o?n.taskOpen=!0:n.taskClosed=!0,i.highlightFormatting&&(n.formatting="task"),n.taskList=!1,f(n)}if(n.taskOpen=!1,n.taskClosed=!1,n.header&&e.match(/^#+$/,!0))return i.highlightFormatting&&(n.formatting="header"),f(n);var l=e.sol(),g=e.next();if("\\"===g&&(e.next(),i.highlightFormatting)){var s=f(n);return s?s+" formatting-escape":"formatting-escape"}if(n.linkTitle){n.linkTitle=!1;var u=g;"("===g&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var m="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(e.match(new RegExp(m),!0))return O}if("`"===g){var k=n.formatting;i.highlightFormatting&&(n.formatting="code");var p=f(n),v=e.pos;e.eatWhile("`");var x=1+e.pos-v;return n.code?x===b?(n.code=!1,p):(n.formatting=k,f(n)):(b=x,n.code=!0,f(n))}if(n.code)return f(n);if("!"===g&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return e.match(/\[[^\]]*\]/),n.inline=n.f=d,B;if("["===g&&e.match(/.*\](\(.*\)| ?\[.*\])/,!1))return n.linkText=!0,i.highlightFormatting&&(n.formatting="link"),f(n);if("]"===g&&n.linkText&&e.match(/\(.*\)| ?\[.*\]/,!1)){i.highlightFormatting&&(n.formatting="link");var s=f(n);return n.linkText=!1,n.inline=n.f=d,s}if("<"===g&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=c,i.highlightFormatting&&(n.formatting="link");var s=f(n);return s?s+=" ":s="",s+_}if("<"===g&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=c,i.highlightFormatting&&(n.formatting="link");var s=f(n);return s?s+=" ":s="",s+$}if("<"===g&&e.match(/^\w/,!1)){if(-1!=e.string.indexOf(">")){var S=e.string.substring(1,e.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(S)&&(n.md_inside=!0)}return e.backUp(1),n.htmlState=t.startState(F),a(e,n,h)}if("<"===g&&e.match(/^\/\w*?>/))return n.md_inside=!1,"tag";var L=!1;if(!i.underscoresBreakWords&&"_"===g&&"_"!==e.peek()&&e.match(/(\w)/,!1)){var q=e.pos-2;if(q>=0){var M=e.string.charAt(q);"_"!==M&&M.match(/(\w)/,!1)&&(L=!0)}}if("*"===g||"_"===g&&!L)if(l&&" "===e.peek());else{if(n.strong===g&&e.eat(g)){i.highlightFormatting&&(n.formatting="strong");var p=f(n);return n.strong=!1,p}if(!n.strong&&e.eat(g))return n.strong=g,i.highlightFormatting&&(n.formatting="strong"),f(n);if(n.em===g){i.highlightFormatting&&(n.formatting="em");var p=f(n);return n.em=!1,p}if(!n.em)return n.em=g,i.highlightFormatting&&(n.formatting="em"),f(n)}else if(" "===g&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return f(n);e.backUp(1)}if(i.strikethrough)if("~"===g&&e.eatWhile(g)){if(n.strikethrough){i.highlightFormatting&&(n.formatting="strikethrough");var p=f(n);return n.strikethrough=!1,p}if(e.match(/^[^\s]/,!1))return n.strikethrough=!0,i.highlightFormatting&&(n.formatting="strikethrough"),f(n)}else if(" "===g&&e.match(/^~~/,!0)){if(" "===e.peek())return f(n);e.backUp(2)}return" "===g&&(e.match(/ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),f(n)}function c(t,e){var n=t.next();if(">"===n){e.f=e.inline=m,i.highlightFormatting&&(e.formatting="link");var r=f(e);return r?r+=" ":r="",r+_}return t.match(/^[^>]+/,!0),_}function d(t,e){if(t.eatSpace())return null;var n=t.next();return"("===n||"["===n?(e.f=e.inline=k("("===n?")":"]"),i.highlightFormatting&&(e.formatting="link-string"),e.linkHref=!0,f(e)):"error"}function k(t){return function(e,n){var r=e.next();if(r===t){n.f=n.inline=m,i.highlightFormatting&&(n.formatting="link-string");var a=f(n);return n.linkHref=!1,a}return e.match(S(t),!0)&&e.backUp(1),n.linkHref=!0,f(n)}}function p(t,e){return t.match(/^[^\]]*\]:/,!1)?(e.f=v,t.next(),i.highlightFormatting&&(e.formatting="link"),e.linkText=!0,f(e)):r(t,e,m)}function v(t,e){if(t.match(/^\]:/,!0)){e.f=e.inline=x,i.highlightFormatting&&(e.formatting="link");var n=f(e);return e.linkText=!1,n}return t.match(/^[^\]]+/,!0),N}function x(t,e){return t.eatSpace()?null:(t.match(/^[^\s]+/,!0),void 0===t.peek()?e.linkTitle=!0:t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),e.f=e.inline=m,O)}function S(t){return J[t]||(t=(t+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),J[t]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+t+")")),J[t]}var L=t.modes.hasOwnProperty("xml"),F=t.getMode(e,L?{name:"xml",htmlMode:!0}:"text/plain");void 0===i.highlightFormatting&&(i.highlightFormatting=!1),void 0===i.maxBlockquoteDepth&&(i.maxBlockquoteDepth=0),void 0===i.underscoresBreakWords&&(i.underscoresBreakWords=!0),void 0===i.fencedCodeBlocks&&(i.fencedCodeBlocks=!1),void 0===i.taskLists&&(i.taskLists=!1),void 0===i.strikethrough&&(i.strikethrough=!1);var b=0,q="header",M="comment",w="quote",C="variable-2",D="variable-3",H="keyword",T="hr",B="tag",y="formatting",_="link",$="link",N="link",O="string",j="em",E="strong",W="strikethrough",U=/^([*\-=_])(?:\s*\1){2,}\s*$/,R=/^[*\-+]\s+/,A=/^[0-9]+\.\s+/,I=/^\[(x| )\](?=\s)/,P=/^#+/,z=/^(?:\={1,}|-{1,})$/,G=/^[^#!\[\]*_\\<>` "'(~]+/,J=[],K={startState:function(){return{f:l,prevLineHasContent:!1,thisLineHasContent:!1,block:l,htmlState:null,indentation:0,inline:m,text:u,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(e){return{f:e.f,prevLineHasContent:e.prevLineHasContent,thisLineHasContent:e.thisLineHasContent,block:e.block,htmlState:e.htmlState&&t.copyState(F,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkTitle:e.linkTitle,em:e.em,strong:e.strong,strikethrough:e.strikethrough,header:e.header,taskList:e.taskList,list:e.list,listDepth:e.listDepth,quote:e.quote,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside}},token:function(t,e){if(e.formatting=!1,t.sol()){var i=!!e.header;if(e.header=0,t.match(/^\s*$/,!0)||i)return e.prevLineHasContent=!1,o(e),i?this.token(t,e):null;e.prevLineHasContent=e.thisLineHasContent,e.thisLineHasContent=!0,e.taskList=!1,e.code=!1,e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.f=e.block;var n=t.match(/^\s*/,!0)[0].replace(/\t/g," ").length,r=4*Math.floor((n-e.indentation)/4);r>4&&(r=4);var a=e.indentation+r;if(e.indentationDiff=a-e.indentation,e.indentation=a,n>0)return null}return e.f(t,e)},innerMode:function(t){return t.block==h?{state:t.htmlState,mode:F}:t.localState?{state:t.localState,mode:t.localMode}:{state:t,mode:K}},blankLine:o,getType:f,fold:"markdown"};return K},"xml"),t.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.linkTitle=!1,a.em=!1,a.strong=!1,a.strikethrough=!1,a.quote=0,v||a.f!=i||(a.f=n,a.block=h),a.trailingSpace=0,a.trailingSpaceNewLine=!1,a.thisLineHasContent=!1,null}function h(a,b){var f=a.sol(),g=b.list!==!1;g&&(b.indentationDiff>=0?(b.indentationDiff<4&&(b.indentation-=b.indentationDiff),b.list=null):b.indentation>0?(b.list=null,b.listDepth=Math.floor(b.indentation/4)):(b.list=!1,b.listDepth=0));var h=null;if(b.indentationDiff>=4)return b.indentation-=4,a.skipToEnd(),z;if(a.eatSpace())return null;if(h=a.match(S))return b.header=Math.min(6,-1!==h[0].indexOf(" ")?h[0].length-1:h[0].length),c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,l(b);if(b.prevLineHasContent&&(h=a.match(T)))return b.header="="==h[0].charAt(0)?1:2,c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,l(b);if(a.eat(">"))return b.indentation++,b.quote=f?1:b.quote+1,c.highlightFormatting&&(b.formatting="quote"),a.eatSpace(),l(b);if("["===a.peek())return e(a,b,r);if(a.match(O,!0))return E;if((!b.prevLineHasContent||g)&&(a.match(P,!1)||a.match(Q,!1))){var i=null;return a.match(P,!0)?i="ul":(a.match(Q,!0),i="ol"),b.indentation+=4,b.list=!0,b.listDepth++,c.taskLists&&a.match(R,!1)&&(b.taskList=!0),b.f=b.inline,c.highlightFormatting&&(b.formatting=["list","list-"+i]),l(b)}return c.fencedCodeBlocks&&a.match(/^```[ \t]*([\w+#]*)/,!0)?(b.localMode=d(RegExp.$1),b.localMode&&(b.localState=b.localMode.startState()),b.f=b.block=j,c.highlightFormatting&&(b.formatting="code-block"),b.code=!0,l(b)):e(a,b,b.inline)}function i(a,b){var c=w.token(a,b.htmlState);return(v&&null===b.htmlState.tagStart&&!b.htmlState.context||b.md_inside&&a.current().indexOf(">")>-1)&&(b.f=n,b.block=h,b.htmlState=null),c}function j(a,b){return a.sol()&&a.match("```",!1)?(b.localMode=b.localState=null,b.f=b.block=k,null):b.localMode?b.localMode.token(a,b.localState):(a.skipToEnd(),z)}function k(a,b){a.match("```"),b.block=h,b.f=n,c.highlightFormatting&&(b.formatting="code-block"),b.code=!0;var d=l(b);return b.code=!1,d}function l(a){var b=[];if(a.formatting){b.push(G),"string"==typeof a.formatting&&(a.formatting=[a.formatting]);for(var d=0;d=a.quote?b.push(G+"-"+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)return b.push(K),b.length?b.join(" "):null;if(a.strong&&b.push(M),a.em&&b.push(L),a.strikethrough&&b.push(N),a.linkText&&b.push(J),a.code&&b.push(z),a.header&&(b.push(y),b.push(y+"-"+a.header)),a.quote&&(b.push(A),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=a.quote?b.push(A+"-"+a.quote):b.push(A+"-"+c.maxBlockquoteDepth)),a.list!==!1){var e=(a.listDepth-1)%3;e?1===e?b.push(C):b.push(D):b.push(B)}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){return a.match(U,!0)?l(b):void 0}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="x"!==b.match(R,!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.sol(),j=b.next();if("\\"===j&&(b.next(),c.highlightFormatting)){var k=l(d);return k?k+" formatting-escape":"formatting-escape"}if(d.linkTitle){d.linkTitle=!1;var m=j;"("===j&&(m=")"),m=(m+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var n="^\\s*(?:[^"+m+"\\\\]+|\\\\\\\\|\\\\.)"+m;if(b.match(new RegExp(n),!0))return K}if("`"===j){var q=d.formatting;c.highlightFormatting&&(d.formatting="code");var r=l(d),s=b.pos;b.eatWhile("`");var t=1+b.pos-s;return d.code?t===x?(d.code=!1,r):(d.formatting=q,l(d)):(x=t,d.code=!0,l(d))}if(d.code)return l(d);if("!"===j&&b.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.match(/\[[^\]]*\]/),d.inline=d.f=p,F;if("["===j&&b.match(/.*\](\(.*\)| ?\[.*\])/,!1))return d.linkText=!0,c.highlightFormatting&&(d.formatting="link"),l(d);if("]"===j&&d.linkText&&b.match(/\(.*\)| ?\[.*\]/,!1)){c.highlightFormatting&&(d.formatting="link");var k=l(d);return d.linkText=!1,d.inline=d.f=p,k}if("<"===j&&b.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link");var k=l(d);return k?k+=" ":k="",k+H}if("<"===j&&b.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link");var k=l(d);return k?k+=" ":k="",k+I}if("<"===j&&b.match(/^\w/,!1)){if(-1!=b.string.indexOf(">")){var u=b.string.substring(1,b.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(u)&&(d.md_inside=!0)}return b.backUp(1),d.htmlState=a.startState(w),f(b,d,i)}if("<"===j&&b.match(/^\/\w*?>/))return d.md_inside=!1,"tag";var v=!1;if(!c.underscoresBreakWords&&"_"===j&&"_"!==b.peek()&&b.match(/(\w)/,!1)){var y=b.pos-2;if(y>=0){var z=b.string.charAt(y);"_"!==z&&z.match(/(\w)/,!1)&&(v=!0)}}if("*"===j||"_"===j&&!v)if(h&&" "===b.peek());else{if(d.strong===j&&b.eat(j)){c.highlightFormatting&&(d.formatting="strong");var r=l(d);return d.strong=!1,r}if(!d.strong&&b.eat(j))return d.strong=j,c.highlightFormatting&&(d.formatting="strong"),l(d);if(d.em===j){c.highlightFormatting&&(d.formatting="em");var r=l(d);return d.em=!1,r}if(!d.em)return d.em=j,c.highlightFormatting&&(d.formatting="em"),l(d)}else if(" "===j&&(b.eat("*")||b.eat("_"))){if(" "===b.peek())return l(d);b.backUp(1)}if(c.strikethrough)if("~"===j&&b.eatWhile(j)){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(" "===j&&b.match(/^~~/,!0)){if(" "===b.peek())return l(d);b.backUp(2)}return" "===j&&(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+H}return a.match(/^[^>]+/,!0),H}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(u(a),!0)&&b.backUp(1),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),J}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,K)}function u(a){return V[a]||(a=(a+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),V[a]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+a+")")),V[a]}var v=a.modes.hasOwnProperty("xml"),w=a.getMode(b,v?{name:"xml",htmlMode:!0}:"text/plain");void 0===c.highlightFormatting&&(c.highlightFormatting=!1),void 0===c.maxBlockquoteDepth&&(c.maxBlockquoteDepth=0),void 0===c.underscoresBreakWords&&(c.underscoresBreakWords=!0),void 0===c.fencedCodeBlocks&&(c.fencedCodeBlocks=!1),void 0===c.taskLists&&(c.taskLists=!1),void 0===c.strikethrough&&(c.strikethrough=!1);var x=0,y="header",z="comment",A="quote",B="variable-2",C="variable-3",D="keyword",E="hr",F="tag",G="formatting",H="link",I="link",J="link",K="string",L="em",M="strong",N="strikethrough",O=/^([*\-=_])(?:\s*\1){2,}\s*$/,P=/^[*\-+]\s+/,Q=/^[0-9]+\.\s+/,R=/^\[(x| )\](?=\s)/,S=/^#+ ?/,T=/^(?:\={1,}|-{1,})$/,U=/^[^#!\[\]*_\\<>` "'(~]+/,V=[],W={startState:function(){return{f:h,prevLineHasContent:!1,thisLineHasContent:!1,block:h,htmlState:null,indentation:0,inline:n,text:m,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(b){return{f:b.f,prevLineHasContent:b.prevLineHasContent,thisLineHasContent:b.thisLineHasContent,block:b.block,htmlState:b.htmlState&&a.copyState(w,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,linkTitle:b.linkTitle,em:b.em,strong:b.strong,strikethrough:b.strikethrough,header:b.header,taskList:b.taskList,list:b.list,listDepth:b.listDepth,quote:b.quote,trailingSpace:b.trailingSpace,trailingSpaceNewLine:b.trailingSpaceNewLine,md_inside:b.md_inside}},token:function(a,b){if(b.formatting=!1,a.sol()){var c=!!b.header;if(b.header=0,a.match(/^\s*$/,!0)||c)return b.prevLineHasContent=!1,g(b),c?this.token(a,b):null;b.prevLineHasContent=b.thisLineHasContent,b.thisLineHasContent=!0,b.taskList=!1,b.code=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,b.f=b.block;var d=a.match(/^\s*/,!0)[0].replace(/\t/g," ").length,e=4*Math.floor((d-b.indentation)/4);e>4&&(e=4);var f=b.indentation+e;if(b.indentationDiff=f-b.indentation,b.indentation=f,d>0)return null}return b.f(a,b)},innerMode:function(a){return a.block==i?{state:a.htmlState,mode:w}:a.localState?{state:a.localState,mode:a.localMode}:{state:a,mode:W}},blankLine:g,getType:l,fold:"markdown"};return W},"xml"),a.defineMIME("text/x-markdown","markdown")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/markdown/test.js b/media/editors/codemirror/mode/markdown/test.js +deleted file mode 100644 +index 96ca1ae..0000000 +--- a/media/editors/codemirror/mode/markdown/test.js ++++ /dev/null +@@ -1,754 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({tabSize: 4}, "markdown"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true}); +- function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } +- +- FT("formatting_emAsterisk", +- "[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]"); +- +- FT("formatting_emUnderscore", +- "[em&formatting&formatting-em _][em foo][em&formatting&formatting-em _]"); +- +- FT("formatting_strongAsterisk", +- "[strong&formatting&formatting-strong **][strong foo][strong&formatting&formatting-strong **]"); +- +- FT("formatting_strongUnderscore", +- "[strong&formatting&formatting-strong __][strong foo][strong&formatting&formatting-strong __]"); +- +- FT("formatting_codeBackticks", +- "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); +- +- FT("formatting_doubleBackticks", +- "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); +- +- FT("formatting_atxHeader", +- "[header&header-1&formatting&formatting-header&formatting-header-1 #][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]"); +- +- FT("formatting_setextHeader", +- "foo", +- "[header&header-1&formatting&formatting-header&formatting-header-1 =]"); +- +- FT("formatting_blockquote", +- "[quote"e-1&formatting&formatting-quote&formatting-quote-1 > ][quote"e-1 foo]"); +- +- FT("formatting_list", +- "[variable-2&formatting&formatting-list&formatting-list-ul - ][variable-2 foo]"); +- FT("formatting_list", +- "[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]"); +- +- FT("formatting_link", +- "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]"); +- +- FT("formatting_linkReference", +- "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]", +- "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]"); +- +- FT("formatting_linkWeb", +- "[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]"); +- +- FT("formatting_linkEmail", +- "[link&formatting&formatting-link <][link user@example.com][link&formatting&formatting-link >]"); +- +- FT("formatting_escape", +- "[formatting-escape \\*]"); +- +- MT("plainText", +- "foo"); +- +- // Don't style single trailing space +- MT("trailingSpace1", +- "foo "); +- +- // Two or more trailing spaces should be styled with line break character +- MT("trailingSpace2", +- "foo[trailing-space-a ][trailing-space-new-line ]"); +- +- MT("trailingSpace3", +- "foo[trailing-space-a ][trailing-space-b ][trailing-space-new-line ]"); +- +- MT("trailingSpace4", +- "foo[trailing-space-a ][trailing-space-b ][trailing-space-a ][trailing-space-new-line ]"); +- +- // Code blocks using 4 spaces (regardless of CodeMirror.tabSize value) +- MT("codeBlocksUsing4Spaces", +- " [comment foo]"); +- +- // Code blocks using 4 spaces with internal indentation +- MT("codeBlocksUsing4SpacesIndentation", +- " [comment bar]", +- " [comment hello]", +- " [comment world]", +- " [comment foo]", +- "bar"); +- +- // Code blocks using 4 spaces with internal indentation +- MT("codeBlocksUsing4SpacesIndentation", +- " foo", +- " [comment bar]", +- " [comment hello]", +- " [comment world]"); +- +- // Code blocks should end even after extra indented lines +- MT("codeBlocksWithTrailingIndentedLine", +- " [comment foo]", +- " [comment bar]", +- " [comment baz]", +- " ", +- "hello"); +- +- // Code blocks using 1 tab (regardless of CodeMirror.indentWithTabs value) +- MT("codeBlocksUsing1Tab", +- "\t[comment foo]"); +- +- // Inline code using backticks +- MT("inlineCodeUsingBackticks", +- "foo [comment `bar`]"); +- +- // Block code using single backtick (shouldn't work) +- MT("blockCodeSingleBacktick", +- "[comment `]", +- "foo", +- "[comment `]"); +- +- // Unclosed backticks +- // Instead of simply marking as CODE, it would be nice to have an +- // incomplete flag for CODE, that is styled slightly different. +- MT("unclosedBackticks", +- "foo [comment `bar]"); +- +- // Per documentation: "To include a literal backtick character within a +- // code span, you can use multiple backticks as the opening and closing +- // delimiters" +- MT("doubleBackticks", +- "[comment ``foo ` bar``]"); +- +- // Tests based on Dingus +- // http://daringfireball.net/projects/markdown/dingus +- // +- // Multiple backticks within an inline code block +- MT("consecutiveBackticks", +- "[comment `foo```bar`]"); +- +- // Multiple backticks within an inline code block with a second code block +- MT("consecutiveBackticks", +- "[comment `foo```bar`] hello [comment `world`]"); +- +- // Unclosed with several different groups of backticks +- MT("unclosedBackticks", +- "[comment ``foo ``` bar` hello]"); +- +- // Closed with several different groups of backticks +- MT("closedBackticks", +- "[comment ``foo ``` bar` hello``] world"); +- +- // atx headers +- // http://daringfireball.net/projects/markdown/syntax#header +- +- MT("atxH1", +- "[header&header-1 # foo]"); +- +- MT("atxH2", +- "[header&header-2 ## foo]"); +- +- MT("atxH3", +- "[header&header-3 ### foo]"); +- +- MT("atxH4", +- "[header&header-4 #### foo]"); +- +- MT("atxH5", +- "[header&header-5 ##### foo]"); +- +- MT("atxH6", +- "[header&header-6 ###### foo]"); +- +- // H6 - 7x '#' should still be H6, per Dingus +- // http://daringfireball.net/projects/markdown/dingus +- MT("atxH6NotH7", +- "[header&header-6 ####### foo]"); +- +- // Inline styles should be parsed inside headers +- MT("atxH1inline", +- "[header&header-1 # foo ][header&header-1&em *bar*]"); +- +- // Setext headers - H1, H2 +- // Per documentation, "Any number of underlining =’s or -’s will work." +- // http://daringfireball.net/projects/markdown/syntax#header +- // Ideally, the text would be marked as `header` as well, but this is +- // not really feasible at the moment. So, instead, we're testing against +- // what works today, to avoid any regressions. +- // +- // Check if single underlining = works +- MT("setextH1", +- "foo", +- "[header&header-1 =]"); +- +- // Check if 3+ ='s work +- MT("setextH1", +- "foo", +- "[header&header-1 ===]"); +- +- // Check if single underlining - works +- MT("setextH2", +- "foo", +- "[header&header-2 -]"); +- +- // Check if 3+ -'s work +- MT("setextH2", +- "foo", +- "[header&header-2 ---]"); +- +- // Single-line blockquote with trailing space +- MT("blockquoteSpace", +- "[quote"e-1 > foo]"); +- +- // Single-line blockquote +- MT("blockquoteNoSpace", +- "[quote"e-1 >foo]"); +- +- // No blank line before blockquote +- MT("blockquoteNoBlankLine", +- "foo", +- "[quote"e-1 > bar]"); +- +- // Nested blockquote +- MT("blockquoteSpace", +- "[quote"e-1 > foo]", +- "[quote"e-1 >][quote"e-2 > foo]", +- "[quote"e-1 >][quote"e-2 >][quote"e-3 > foo]"); +- +- // Single-line blockquote followed by normal paragraph +- MT("blockquoteThenParagraph", +- "[quote"e-1 >foo]", +- "", +- "bar"); +- +- // Multi-line blockquote (lazy mode) +- MT("multiBlockquoteLazy", +- "[quote"e-1 >foo]", +- "[quote"e-1 bar]"); +- +- // Multi-line blockquote followed by normal paragraph (lazy mode) +- MT("multiBlockquoteLazyThenParagraph", +- "[quote"e-1 >foo]", +- "[quote"e-1 bar]", +- "", +- "hello"); +- +- // Multi-line blockquote (non-lazy mode) +- MT("multiBlockquote", +- "[quote"e-1 >foo]", +- "[quote"e-1 >bar]"); +- +- // Multi-line blockquote followed by normal paragraph (non-lazy mode) +- MT("multiBlockquoteThenParagraph", +- "[quote"e-1 >foo]", +- "[quote"e-1 >bar]", +- "", +- "hello"); +- +- // Check list types +- +- MT("listAsterisk", +- "foo", +- "bar", +- "", +- "[variable-2 * foo]", +- "[variable-2 * bar]"); +- +- MT("listPlus", +- "foo", +- "bar", +- "", +- "[variable-2 + foo]", +- "[variable-2 + bar]"); +- +- MT("listDash", +- "foo", +- "bar", +- "", +- "[variable-2 - foo]", +- "[variable-2 - bar]"); +- +- MT("listNumber", +- "foo", +- "bar", +- "", +- "[variable-2 1. foo]", +- "[variable-2 2. bar]"); +- +- // Lists require a preceding blank line (per Dingus) +- MT("listBogus", +- "foo", +- "1. bar", +- "2. hello"); +- +- // List after header +- MT("listAfterHeader", +- "[header&header-1 # foo]", +- "[variable-2 - bar]"); +- +- // Formatting in lists (*) +- MT("listAsteriskFormatting", +- "[variable-2 * ][variable-2&em *foo*][variable-2 bar]", +- "[variable-2 * ][variable-2&strong **foo**][variable-2 bar]", +- "[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", +- "[variable-2 * ][variable-2&comment `foo`][variable-2 bar]"); +- +- // Formatting in lists (+) +- MT("listPlusFormatting", +- "[variable-2 + ][variable-2&em *foo*][variable-2 bar]", +- "[variable-2 + ][variable-2&strong **foo**][variable-2 bar]", +- "[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", +- "[variable-2 + ][variable-2&comment `foo`][variable-2 bar]"); +- +- // Formatting in lists (-) +- MT("listDashFormatting", +- "[variable-2 - ][variable-2&em *foo*][variable-2 bar]", +- "[variable-2 - ][variable-2&strong **foo**][variable-2 bar]", +- "[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", +- "[variable-2 - ][variable-2&comment `foo`][variable-2 bar]"); +- +- // Formatting in lists (1.) +- MT("listNumberFormatting", +- "[variable-2 1. ][variable-2&em *foo*][variable-2 bar]", +- "[variable-2 2. ][variable-2&strong **foo**][variable-2 bar]", +- "[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", +- "[variable-2 4. ][variable-2&comment `foo`][variable-2 bar]"); +- +- // Paragraph lists +- MT("listParagraph", +- "[variable-2 * foo]", +- "", +- "[variable-2 * bar]"); +- +- // Multi-paragraph lists +- // +- // 4 spaces +- MT("listMultiParagraph", +- "[variable-2 * foo]", +- "", +- "[variable-2 * bar]", +- "", +- " [variable-2 hello]"); +- +- // 4 spaces, extra blank lines (should still be list, per Dingus) +- MT("listMultiParagraphExtra", +- "[variable-2 * foo]", +- "", +- "[variable-2 * bar]", +- "", +- "", +- " [variable-2 hello]"); +- +- // 4 spaces, plus 1 space (should still be list, per Dingus) +- MT("listMultiParagraphExtraSpace", +- "[variable-2 * foo]", +- "", +- "[variable-2 * bar]", +- "", +- " [variable-2 hello]", +- "", +- " [variable-2 world]"); +- +- // 1 tab +- MT("listTab", +- "[variable-2 * foo]", +- "", +- "[variable-2 * bar]", +- "", +- "\t[variable-2 hello]"); +- +- // No indent +- MT("listNoIndent", +- "[variable-2 * foo]", +- "", +- "[variable-2 * bar]", +- "", +- "hello"); +- +- // Blockquote +- MT("blockquote", +- "[variable-2 * foo]", +- "", +- "[variable-2 * bar]", +- "", +- " [variable-2"e"e-1 > hello]"); +- +- // Code block +- MT("blockquoteCode", +- "[variable-2 * foo]", +- "", +- "[variable-2 * bar]", +- "", +- " [comment > hello]", +- "", +- " [variable-2 world]"); +- +- // Code block followed by text +- MT("blockquoteCodeText", +- "[variable-2 * foo]", +- "", +- " [variable-2 bar]", +- "", +- " [comment hello]", +- "", +- " [variable-2 world]"); +- +- // Nested list +- +- MT("listAsteriskNested", +- "[variable-2 * foo]", +- "", +- " [variable-3 * bar]"); +- +- MT("listPlusNested", +- "[variable-2 + foo]", +- "", +- " [variable-3 + bar]"); +- +- MT("listDashNested", +- "[variable-2 - foo]", +- "", +- " [variable-3 - bar]"); +- +- MT("listNumberNested", +- "[variable-2 1. foo]", +- "", +- " [variable-3 2. bar]"); +- +- MT("listMixed", +- "[variable-2 * foo]", +- "", +- " [variable-3 + bar]", +- "", +- " [keyword - hello]", +- "", +- " [variable-2 1. world]"); +- +- MT("listBlockquote", +- "[variable-2 * foo]", +- "", +- " [variable-3 + bar]", +- "", +- " [quote"e-1&variable-3 > hello]"); +- +- MT("listCode", +- "[variable-2 * foo]", +- "", +- " [variable-3 + bar]", +- "", +- " [comment hello]"); +- +- // Code with internal indentation +- MT("listCodeIndentation", +- "[variable-2 * foo]", +- "", +- " [comment bar]", +- " [comment hello]", +- " [comment world]", +- " [comment foo]", +- " [variable-2 bar]"); +- +- // List nesting edge cases +- MT("listNested", +- "[variable-2 * foo]", +- "", +- " [variable-3 * bar]", +- "", +- " [variable-2 hello]" +- ); +- MT("listNested", +- "[variable-2 * foo]", +- "", +- " [variable-3 * bar]", +- "", +- " [variable-3 * foo]" +- ); +- +- // Code followed by text +- MT("listCodeText", +- "[variable-2 * foo]", +- "", +- " [comment bar]", +- "", +- "hello"); +- +- // Following tests directly from official Markdown documentation +- // http://daringfireball.net/projects/markdown/syntax#hr +- +- MT("hrSpace", +- "[hr * * *]"); +- +- MT("hr", +- "[hr ***]"); +- +- MT("hrLong", +- "[hr *****]"); +- +- MT("hrSpaceDash", +- "[hr - - -]"); +- +- MT("hrDashLong", +- "[hr ---------------------------------------]"); +- +- // Inline link with title +- MT("linkTitle", +- "[link [[foo]]][string (http://example.com/ \"bar\")] hello"); +- +- // Inline link without title +- MT("linkNoTitle", +- "[link [[foo]]][string (http://example.com/)] bar"); +- +- // Inline link with image +- MT("linkImage", +- "[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar"); +- +- // Inline link with Em +- MT("linkEm", +- "[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar"); +- +- // Inline link with Strong +- MT("linkStrong", +- "[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar"); +- +- // Inline link with EmStrong +- MT("linkEmStrong", +- "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar"); +- +- // Image with title +- MT("imageTitle", +- "[tag ![[foo]]][string (http://example.com/ \"bar\")] hello"); +- +- // Image without title +- MT("imageNoTitle", +- "[tag ![[foo]]][string (http://example.com/)] bar"); +- +- // Image with asterisks +- MT("imageAsterisks", +- "[tag ![[*foo*]]][string (http://example.com/)] bar"); +- +- // Not a link. Should be normal text due to square brackets being used +- // regularly in text, especially in quoted material, and no space is allowed +- // between square brackets and parentheses (per Dingus). +- MT("notALink", +- "[[foo]] (bar)"); +- +- // Reference-style links +- MT("linkReference", +- "[link [[foo]]][string [[bar]]] hello"); +- +- // Reference-style links with Em +- MT("linkReferenceEm", +- "[link [[][link&em *foo*][link ]]][string [[bar]]] hello"); +- +- // Reference-style links with Strong +- MT("linkReferenceStrong", +- "[link [[][link&strong **foo**][link ]]][string [[bar]]] hello"); +- +- // Reference-style links with EmStrong +- MT("linkReferenceEmStrong", +- "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello"); +- +- // Reference-style links with optional space separator (per docuentation) +- // "You can optionally use a space to separate the sets of brackets" +- MT("linkReferenceSpace", +- "[link [[foo]]] [string [[bar]]] hello"); +- +- // Should only allow a single space ("...use *a* space...") +- MT("linkReferenceDoubleSpace", +- "[[foo]] [[bar]] hello"); +- +- // Reference-style links with implicit link name +- MT("linkImplicit", +- "[link [[foo]]][string [[]]] hello"); +- +- // @todo It would be nice if, at some point, the document was actually +- // checked to see if the referenced link exists +- +- // Link label, for reference-style links (taken from documentation) +- +- MT("labelNoTitle", +- "[link [[foo]]:] [string http://example.com/]"); +- +- MT("labelIndented", +- " [link [[foo]]:] [string http://example.com/]"); +- +- MT("labelSpaceTitle", +- "[link [[foo bar]]:] [string http://example.com/ \"hello\"]"); +- +- MT("labelDoubleTitle", +- "[link [[foo bar]]:] [string http://example.com/ \"hello\"] \"world\""); +- +- MT("labelTitleDoubleQuotes", +- "[link [[foo]]:] [string http://example.com/ \"bar\"]"); +- +- MT("labelTitleSingleQuotes", +- "[link [[foo]]:] [string http://example.com/ 'bar']"); +- +- MT("labelTitleParenthese", +- "[link [[foo]]:] [string http://example.com/ (bar)]"); +- +- MT("labelTitleInvalid", +- "[link [[foo]]:] [string http://example.com/] bar"); +- +- MT("labelLinkAngleBrackets", +- "[link [[foo]]:] [string \"bar\"]"); +- +- MT("labelTitleNextDoubleQuotes", +- "[link [[foo]]:] [string http://example.com/]", +- "[string \"bar\"] hello"); +- +- MT("labelTitleNextSingleQuotes", +- "[link [[foo]]:] [string http://example.com/]", +- "[string 'bar'] hello"); +- +- MT("labelTitleNextParenthese", +- "[link [[foo]]:] [string http://example.com/]", +- "[string (bar)] hello"); +- +- MT("labelTitleNextMixed", +- "[link [[foo]]:] [string http://example.com/]", +- "(bar\" hello"); +- +- MT("linkWeb", +- "[link ] foo"); +- +- MT("linkWebDouble", +- "[link ] foo [link ]"); +- +- MT("linkEmail", +- "[link ] foo"); +- +- MT("linkEmailDouble", +- "[link ] foo [link ]"); +- +- MT("emAsterisk", +- "[em *foo*] bar"); +- +- MT("emUnderscore", +- "[em _foo_] bar"); +- +- MT("emInWordAsterisk", +- "foo[em *bar*]hello"); +- +- MT("emInWordUnderscore", +- "foo[em _bar_]hello"); +- +- // Per documentation: "...surround an * or _ with spaces, it’ll be +- // treated as a literal asterisk or underscore." +- +- MT("emEscapedBySpaceIn", +- "foo [em _bar _ hello_] world"); +- +- MT("emEscapedBySpaceOut", +- "foo _ bar[em _hello_]world"); +- +- MT("emEscapedByNewline", +- "foo", +- "_ bar[em _hello_]world"); +- +- // Unclosed emphasis characters +- // Instead of simply marking as EM / STRONG, it would be nice to have an +- // incomplete flag for EM and STRONG, that is styled slightly different. +- MT("emIncompleteAsterisk", +- "foo [em *bar]"); +- +- MT("emIncompleteUnderscore", +- "foo [em _bar]"); +- +- MT("strongAsterisk", +- "[strong **foo**] bar"); +- +- MT("strongUnderscore", +- "[strong __foo__] bar"); +- +- MT("emStrongAsterisk", +- "[em *foo][em&strong **bar*][strong hello**] world"); +- +- MT("emStrongUnderscore", +- "[em _foo][em&strong __bar_][strong hello__] world"); +- +- // "...same character must be used to open and close an emphasis span."" +- MT("emStrongMixed", +- "[em _foo][em&strong **bar*hello__ world]"); +- +- MT("emStrongMixed", +- "[em *foo][em&strong __bar_hello** world]"); +- +- // These characters should be escaped: +- // \ backslash +- // ` backtick +- // * asterisk +- // _ underscore +- // {} curly braces +- // [] square brackets +- // () parentheses +- // # hash mark +- // + plus sign +- // - minus sign (hyphen) +- // . dot +- // ! exclamation mark +- +- MT("escapeBacktick", +- "foo \\`bar\\`"); +- +- MT("doubleEscapeBacktick", +- "foo \\\\[comment `bar\\\\`]"); +- +- MT("escapeAsterisk", +- "foo \\*bar\\*"); +- +- MT("doubleEscapeAsterisk", +- "foo \\\\[em *bar\\\\*]"); +- +- MT("escapeUnderscore", +- "foo \\_bar\\_"); +- +- MT("doubleEscapeUnderscore", +- "foo \\\\[em _bar\\\\_]"); +- +- MT("escapeHash", +- "\\# foo"); +- +- MT("doubleEscapeHash", +- "\\\\# foo"); +- +- MT("escapeNewline", +- "\\", +- "[em *foo*]"); +- +- +- // Tests to make sure GFM-specific things aren't getting through +- +- MT("taskList", +- "[variable-2 * [ ]] bar]"); +- +- MT("fencedCodeBlocks", +- "[comment ```]", +- "foo", +- "[comment ```]"); +- +- // Tests that require XML mode +- +- MT("xmlMode", +- "[tag&bracket <][tag div][tag&bracket >]", +- "*foo*", +- "[tag&bracket <][tag http://github.com][tag&bracket />]", +- "[tag&bracket ]", +- "[link ]"); +- +- MT("xmlModeWithMarkdownInside", +- "[tag&bracket <][tag div] [attribute markdown]=[string 1][tag&bracket >]", +- "[em *foo*]", +- "[link ]", +- "[tag ]", +- "[link ]", +- "[tag&bracket <][tag div][tag&bracket >]", +- "[tag&bracket ]"); +- +-})(); +diff --git a/media/editors/codemirror/mode/markdown/test.min.js b/media/editors/codemirror/mode/markdown/test.min.js +deleted file mode 100644 +index 2de7c7a..0000000 +--- a/media/editors/codemirror/mode/markdown/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function e(e){test.mode(e,a,Array.prototype.slice.call(arguments,1))}function o(e){test.mode(e,t,Array.prototype.slice.call(arguments,1))}var a=CodeMirror.getMode({tabSize:4},"markdown"),t=CodeMirror.getMode({tabSize:4},{name:"markdown",highlightFormatting:!0});o("formatting_emAsterisk","[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]"),o("formatting_emUnderscore","[em&formatting&formatting-em _][em foo][em&formatting&formatting-em _]"),o("formatting_strongAsterisk","[strong&formatting&formatting-strong **][strong foo][strong&formatting&formatting-strong **]"),o("formatting_strongUnderscore","[strong&formatting&formatting-strong __][strong foo][strong&formatting&formatting-strong __]"),o("formatting_codeBackticks","[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"),o("formatting_doubleBackticks","[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"),o("formatting_atxHeader","[header&header-1&formatting&formatting-header&formatting-header-1 #][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]"),o("formatting_setextHeader","foo","[header&header-1&formatting&formatting-header&formatting-header-1 =]"),o("formatting_blockquote","[quote"e-1&formatting&formatting-quote&formatting-quote-1 > ][quote"e-1 foo]"),o("formatting_list","[variable-2&formatting&formatting-list&formatting-list-ul - ][variable-2 foo]"),o("formatting_list","[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]"),o("formatting_link","[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]"),o("formatting_linkReference","[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]","[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]"),o("formatting_linkWeb","[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]"),o("formatting_linkEmail","[link&formatting&formatting-link <][link user@example.com][link&formatting&formatting-link >]"),o("formatting_escape","[formatting-escape \\*]"),e("plainText","foo"),e("trailingSpace1","foo "),e("trailingSpace2","foo[trailing-space-a ][trailing-space-new-line ]"),e("trailingSpace3","foo[trailing-space-a ][trailing-space-b ][trailing-space-new-line ]"),e("trailingSpace4","foo[trailing-space-a ][trailing-space-b ][trailing-space-a ][trailing-space-new-line ]"),e("codeBlocksUsing4Spaces"," [comment foo]"),e("codeBlocksUsing4SpacesIndentation"," [comment bar]"," [comment hello]"," [comment world]"," [comment foo]","bar"),e("codeBlocksUsing4SpacesIndentation"," foo"," [comment bar]"," [comment hello]"," [comment world]"),e("codeBlocksWithTrailingIndentedLine"," [comment foo]"," [comment bar]"," [comment baz]"," ","hello"),e("codeBlocksUsing1Tab"," [comment foo]"),e("inlineCodeUsingBackticks","foo [comment `bar`]"),e("blockCodeSingleBacktick","[comment `]","foo","[comment `]"),e("unclosedBackticks","foo [comment `bar]"),e("doubleBackticks","[comment ``foo ` bar``]"),e("consecutiveBackticks","[comment `foo```bar`]"),e("consecutiveBackticks","[comment `foo```bar`] hello [comment `world`]"),e("unclosedBackticks","[comment ``foo ``` bar` hello]"),e("closedBackticks","[comment ``foo ``` bar` hello``] world"),e("atxH1","[header&header-1 # foo]"),e("atxH2","[header&header-2 ## foo]"),e("atxH3","[header&header-3 ### foo]"),e("atxH4","[header&header-4 #### foo]"),e("atxH5","[header&header-5 ##### foo]"),e("atxH6","[header&header-6 ###### foo]"),e("atxH6NotH7","[header&header-6 ####### foo]"),e("atxH1inline","[header&header-1 # foo ][header&header-1&em *bar*]"),e("setextH1","foo","[header&header-1 =]"),e("setextH1","foo","[header&header-1 ===]"),e("setextH2","foo","[header&header-2 -]"),e("setextH2","foo","[header&header-2 ---]"),e("blockquoteSpace","[quote"e-1 > foo]"),e("blockquoteNoSpace","[quote"e-1 >foo]"),e("blockquoteNoBlankLine","foo","[quote"e-1 > bar]"),e("blockquoteSpace","[quote"e-1 > foo]","[quote"e-1 >][quote"e-2 > foo]","[quote"e-1 >][quote"e-2 >][quote"e-3 > foo]"),e("blockquoteThenParagraph","[quote"e-1 >foo]","","bar"),e("multiBlockquoteLazy","[quote"e-1 >foo]","[quote"e-1 bar]"),e("multiBlockquoteLazyThenParagraph","[quote"e-1 >foo]","[quote"e-1 bar]","","hello"),e("multiBlockquote","[quote"e-1 >foo]","[quote"e-1 >bar]"),e("multiBlockquoteThenParagraph","[quote"e-1 >foo]","[quote"e-1 >bar]","","hello"),e("listAsterisk","foo","bar","","[variable-2 * foo]","[variable-2 * bar]"),e("listPlus","foo","bar","","[variable-2 + foo]","[variable-2 + bar]"),e("listDash","foo","bar","","[variable-2 - foo]","[variable-2 - bar]"),e("listNumber","foo","bar","","[variable-2 1. foo]","[variable-2 2. bar]"),e("listBogus","foo","1. bar","2. hello"),e("listAfterHeader","[header&header-1 # foo]","[variable-2 - bar]"),e("listAsteriskFormatting","[variable-2 * ][variable-2&em *foo*][variable-2 bar]","[variable-2 * ][variable-2&strong **foo**][variable-2 bar]","[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 * ][variable-2&comment `foo`][variable-2 bar]"),e("listPlusFormatting","[variable-2 + ][variable-2&em *foo*][variable-2 bar]","[variable-2 + ][variable-2&strong **foo**][variable-2 bar]","[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 + ][variable-2&comment `foo`][variable-2 bar]"),e("listDashFormatting","[variable-2 - ][variable-2&em *foo*][variable-2 bar]","[variable-2 - ][variable-2&strong **foo**][variable-2 bar]","[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 - ][variable-2&comment `foo`][variable-2 bar]"),e("listNumberFormatting","[variable-2 1. ][variable-2&em *foo*][variable-2 bar]","[variable-2 2. ][variable-2&strong **foo**][variable-2 bar]","[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 4. ][variable-2&comment `foo`][variable-2 bar]"),e("listParagraph","[variable-2 * foo]","","[variable-2 * bar]"),e("listMultiParagraph","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2 hello]"),e("listMultiParagraphExtra","[variable-2 * foo]","","[variable-2 * bar]","",""," [variable-2 hello]"),e("listMultiParagraphExtraSpace","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2 hello]",""," [variable-2 world]"),e("listTab","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2 hello]"),e("listNoIndent","[variable-2 * foo]","","[variable-2 * bar]","","hello"),e("blockquote","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2"e"e-1 > hello]"),e("blockquoteCode","[variable-2 * foo]","","[variable-2 * bar]",""," [comment > hello]",""," [variable-2 world]"),e("blockquoteCodeText","[variable-2 * foo]",""," [variable-2 bar]",""," [comment hello]",""," [variable-2 world]"),e("listAsteriskNested","[variable-2 * foo]",""," [variable-3 * bar]"),e("listPlusNested","[variable-2 + foo]",""," [variable-3 + bar]"),e("listDashNested","[variable-2 - foo]",""," [variable-3 - bar]"),e("listNumberNested","[variable-2 1. foo]",""," [variable-3 2. bar]"),e("listMixed","[variable-2 * foo]",""," [variable-3 + bar]",""," [keyword - hello]",""," [variable-2 1. world]"),e("listBlockquote","[variable-2 * foo]",""," [variable-3 + bar]",""," [quote"e-1&variable-3 > hello]"),e("listCode","[variable-2 * foo]",""," [variable-3 + bar]",""," [comment hello]"),e("listCodeIndentation","[variable-2 * foo]",""," [comment bar]"," [comment hello]"," [comment world]"," [comment foo]"," [variable-2 bar]"),e("listNested","[variable-2 * foo]",""," [variable-3 * bar]",""," [variable-2 hello]"),e("listNested","[variable-2 * foo]",""," [variable-3 * bar]",""," [variable-3 * foo]"),e("listCodeText","[variable-2 * foo]",""," [comment bar]","","hello"),e("hrSpace","[hr * * *]"),e("hr","[hr ***]"),e("hrLong","[hr *****]"),e("hrSpaceDash","[hr - - -]"),e("hrDashLong","[hr ---------------------------------------]"),e("linkTitle",'[link [[foo]]][string (http://example.com/ "bar")] hello'),e("linkNoTitle","[link [[foo]]][string (http://example.com/)] bar"),e("linkImage","[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar"),e("linkEm","[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar"),e("linkStrong","[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar"),e("linkEmStrong","[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar"),e("imageTitle",'[tag ![[foo]]][string (http://example.com/ "bar")] hello'),e("imageNoTitle","[tag ![[foo]]][string (http://example.com/)] bar"),e("imageAsterisks","[tag ![[*foo*]]][string (http://example.com/)] bar"),e("notALink","[[foo]] (bar)"),e("linkReference","[link [[foo]]][string [[bar]]] hello"),e("linkReferenceEm","[link [[][link&em *foo*][link ]]][string [[bar]]] hello"),e("linkReferenceStrong","[link [[][link&strong **foo**][link ]]][string [[bar]]] hello"),e("linkReferenceEmStrong","[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello"),e("linkReferenceSpace","[link [[foo]]] [string [[bar]]] hello"),e("linkReferenceDoubleSpace","[[foo]] [[bar]] hello"),e("linkImplicit","[link [[foo]]][string [[]]] hello"),e("labelNoTitle","[link [[foo]]:] [string http://example.com/]"),e("labelIndented"," [link [[foo]]:] [string http://example.com/]"),e("labelSpaceTitle",'[link [[foo bar]]:] [string http://example.com/ "hello"]'),e("labelDoubleTitle",'[link [[foo bar]]:] [string http://example.com/ "hello"] "world"'),e("labelTitleDoubleQuotes",'[link [[foo]]:] [string http://example.com/ "bar"]'),e("labelTitleSingleQuotes","[link [[foo]]:] [string http://example.com/ 'bar']"),e("labelTitleParenthese","[link [[foo]]:] [string http://example.com/ (bar)]"),e("labelTitleInvalid","[link [[foo]]:] [string http://example.com/] bar"),e("labelLinkAngleBrackets",'[link [[foo]]:] [string "bar"]'),e("labelTitleNextDoubleQuotes","[link [[foo]]:] [string http://example.com/]",'[string "bar"] hello'),e("labelTitleNextSingleQuotes","[link [[foo]]:] [string http://example.com/]","[string 'bar'] hello"),e("labelTitleNextParenthese","[link [[foo]]:] [string http://example.com/]","[string (bar)] hello"),e("labelTitleNextMixed","[link [[foo]]:] [string http://example.com/]",'(bar" hello'),e("linkWeb","[link ] foo"),e("linkWebDouble","[link ] foo [link ]"),e("linkEmail","[link ] foo"),e("linkEmailDouble","[link ] foo [link ]"),e("emAsterisk","[em *foo*] bar"),e("emUnderscore","[em _foo_] bar"),e("emInWordAsterisk","foo[em *bar*]hello"),e("emInWordUnderscore","foo[em _bar_]hello"),e("emEscapedBySpaceIn","foo [em _bar _ hello_] world"),e("emEscapedBySpaceOut","foo _ bar[em _hello_]world"),e("emEscapedByNewline","foo","_ bar[em _hello_]world"),e("emIncompleteAsterisk","foo [em *bar]"),e("emIncompleteUnderscore","foo [em _bar]"),e("strongAsterisk","[strong **foo**] bar"),e("strongUnderscore","[strong __foo__] bar"),e("emStrongAsterisk","[em *foo][em&strong **bar*][strong hello**] world"),e("emStrongUnderscore","[em _foo][em&strong __bar_][strong hello__] world"),e("emStrongMixed","[em _foo][em&strong **bar*hello__ world]"),e("emStrongMixed","[em *foo][em&strong __bar_hello** world]"),e("escapeBacktick","foo \\`bar\\`"),e("doubleEscapeBacktick","foo \\\\[comment `bar\\\\`]"),e("escapeAsterisk","foo \\*bar\\*"),e("doubleEscapeAsterisk","foo \\\\[em *bar\\\\*]"),e("escapeUnderscore","foo \\_bar\\_"),e("doubleEscapeUnderscore","foo \\\\[em _bar\\\\_]"),e("escapeHash","\\# foo"),e("doubleEscapeHash","\\\\# foo"),e("escapeNewline","\\","[em *foo*]"),e("taskList","[variable-2 * [ ]] bar]"),e("fencedCodeBlocks","[comment ```]","foo","[comment ```]"),e("xmlMode","[tag&bracket <][tag div][tag&bracket >]","*foo*","[tag&bracket <][tag http://github.com][tag&bracket />]","[tag&bracket ]","[link ]"),e("xmlModeWithMarkdownInside","[tag&bracket <][tag div] [attribute markdown]=[string 1][tag&bracket >]","[em *foo*]","[link ]","[tag ]","[link ]","[tag&bracket <][tag div][tag&bracket >]","[tag&bracket ]")}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/mathematica/mathematica.js b/media/editors/codemirror/mode/mathematica/mathematica.js +new file mode 100644 +index 0000000..5ae6f55 +--- /dev/null ++++ b/media/editors/codemirror/mode/mathematica/mathematica.js +@@ -0,0 +1,175 @@ ++// CodeMirror, copyright (c) by Marijn Haverbeke and others ++// Distributed under an MIT license: http://codemirror.net/LICENSE ++ ++// Mathematica mode copyright (c) 2015 by Calin Barbat ++// Based on code by Patrick Scheibe (halirutan) ++// See: https://github.com/halirutan/Mathematica-Source-Highlighting/tree/master/src/lang-mma.js ++ ++(function(mod) { ++ if (typeof exports == "object" && typeof module == "object") // CommonJS ++ mod(require("../../lib/codemirror")); ++ else if (typeof define == "function" && define.amd) // AMD ++ define(["../../lib/codemirror"], mod); ++ else // Plain browser env ++ mod(CodeMirror); ++})(function(CodeMirror) { ++"use strict"; ++ ++CodeMirror.defineMode('mathematica', function(_config, _parserConfig) { ++ ++ // used pattern building blocks ++ var Identifier = '[a-zA-Z\\$][a-zA-Z0-9\\$]*'; ++ var pBase = "(?:\\d+)"; ++ var pFloat = "(?:\\.\\d+|\\d+\\.\\d*|\\d+)"; ++ var pFloatBase = "(?:\\.\\w+|\\w+\\.\\w*|\\w+)"; ++ var pPrecision = "(?:`(?:`?"+pFloat+")?)"; ++ ++ // regular expressions ++ var reBaseForm = new RegExp('(?:'+pBase+'(?:\\^\\^'+pFloatBase+pPrecision+'?(?:\\*\\^[+-]?\\d+)?))'); ++ var reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\*\\^[+-]?\\d+)?)'); ++ var reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)'); ++ ++ function tokenBase(stream, state) { ++ var ch; ++ ++ // get next character ++ ch = stream.next(); ++ ++ // string ++ if (ch === '"') { ++ state.tokenize = tokenString; ++ return state.tokenize(stream, state); ++ } ++ ++ // comment ++ if (ch === '(') { ++ if (stream.eat('*')) { ++ state.commentLevel++; ++ state.tokenize = tokenComment; ++ return state.tokenize(stream, state); ++ } ++ } ++ ++ // go back one character ++ stream.backUp(1); ++ ++ // look for numbers ++ // Numbers in a baseform ++ if (stream.match(reBaseForm, true, false)) { ++ return 'number'; ++ } ++ ++ // Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition ++ // (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow. ++ if (stream.match(reFloatForm, true, false)) { ++ return 'number'; ++ } ++ ++ /* In[23] and Out[34] */ ++ if (stream.match(/(?:In|Out)\[[0-9]*\]/, true, false)) { ++ return 'atom'; ++ } ++ ++ // usage ++ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) { ++ return 'meta'; ++ } ++ ++ // message ++ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) { ++ return 'string-2'; ++ } ++ ++ // this makes a look-ahead match for something like variable:{_Integer} ++ // the match is then forwarded to the mma-patterns tokenizer. ++ if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/, true, false)) { ++ return 'variable-2'; ++ } ++ ++ // catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___) ++ // Cannot start with a number, but can have numbers at any other position. Examples ++ // blub__Integer, a1_, b34_Integer32 ++ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) { ++ return 'variable-2'; ++ } ++ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/, true, false)) { ++ return 'variable-2'; ++ } ++ if (stream.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) { ++ return 'variable-2'; ++ } ++ ++ // Named characters in Mathematica, like \[Gamma]. ++ if (stream.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/, true, false)) { ++ return 'variable-3'; ++ } ++ ++ // Match all braces separately ++ if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) { ++ return 'bracket'; ++ } ++ ++ // Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match ++ // only one. ++ if (stream.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/, true, false)) { ++ return 'variable-2'; ++ } ++ ++ // Literals like variables, keywords, functions ++ if (stream.match(reIdInContext, true, false)) { ++ return 'keyword'; ++ } ++ ++ // operators. Note that operators like @@ or /; are matched separately for each symbol. ++ if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) { ++ return 'operator'; ++ } ++ ++ // everything else is an error ++ return 'error'; ++ } ++ ++ function tokenString(stream, state) { ++ var next, end = false, escaped = false; ++ while ((next = stream.next()) != null) { ++ if (next === '"' && !escaped) { ++ end = true; ++ break; ++ } ++ escaped = !escaped && next === '\\'; ++ } ++ if (end && !escaped) { ++ state.tokenize = tokenBase; ++ } ++ return 'string'; ++ }; ++ ++ function tokenComment(stream, state) { ++ var prev, next; ++ while(state.commentLevel > 0 && (next = stream.next()) != null) { ++ if (prev === '(' && next === '*') state.commentLevel++; ++ if (prev === '*' && next === ')') state.commentLevel--; ++ prev = next; ++ } ++ if (state.commentLevel <= 0) { ++ state.tokenize = tokenBase; ++ } ++ return 'comment'; ++ } ++ ++ return { ++ startState: function() {return {tokenize: tokenBase, commentLevel: 0};}, ++ token: function(stream, state) { ++ if (stream.eatSpace()) return null; ++ return state.tokenize(stream, state); ++ }, ++ blockCommentStart: "(*", ++ blockCommentEnd: "*)" ++ }; ++}); ++ ++CodeMirror.defineMIME('text/x-mathematica', { ++ name: 'mathematica' ++}); ++ ++}); +diff --git a/media/editors/codemirror/mode/mathematica/mathematica.min.js b/media/editors/codemirror/mode/mathematica/mathematica.min.js +new file mode 100644 +index 0000000..a5872ae +--- /dev/null ++++ b/media/editors/codemirror/mode/mathematica/mathematica.min.js +@@ -0,0 +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("mathematica",function(a,b){function c(a,b){var c;return c=a.next(),'"'===c?(b.tokenize=d,b.tokenize(a,b)):"("===c&&a.eat("*")?(b.commentLevel++,b.tokenize=e,b.tokenize(a,b)):(a.backUp(1),a.match(k,!0,!1)?"number":a.match(l,!0,!1)?"number":a.match(/(?:In|Out)\[[0-9]*\]/,!0,!1)?"atom":a.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/,!0,!1)?"meta":a.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/,!0,!1)?"string-2":a.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/,!0,!1)?"variable-2":a.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)?"variable-2":a.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/,!0,!1)?"variable-2":a.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)?"variable-2":a.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/,!0,!1)?"variable-3":a.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)?"bracket":a.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/,!0,!1)?"variable-2":a.match(m,!0,!1)?"keyword":a.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/,!0,!1)?"operator":"error")}function d(a,b){for(var d,e=!1,f=!1;null!=(d=a.next());){if('"'===d&&!f){e=!0;break}f=!f&&"\\"===d}return e&&!f&&(b.tokenize=c),"string"}function e(a,b){for(var d,e;b.commentLevel>0&&null!=(e=a.next());)"("===d&&"*"===e&&b.commentLevel++,"*"===d&&")"===e&&b.commentLevel--,d=e;return b.commentLevel<=0&&(b.tokenize=c),"comment"}var f="[a-zA-Z\\$][a-zA-Z0-9\\$]*",g="(?:\\d+)",h="(?:\\.\\d+|\\d+\\.\\d*|\\d+)",i="(?:\\.\\w+|\\w+\\.\\w*|\\w+)",j="(?:`(?:`?"+h+")?)",k=new RegExp("(?:"+g+"(?:\\^\\^"+i+j+"?(?:\\*\\^[+-]?\\d+)?))"),l=new RegExp("(?:"+h+j+"?(?:\\*\\^[+-]?\\d+)?)"),m=new RegExp("(?:`?)(?:"+f+")(?:`(?:"+f+"))*(?:`?)");return{startState:function(){return{tokenize:c,commentLevel:0}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)},blockCommentStart:"(*",blockCommentEnd:"*)"}}),a.defineMIME("text/x-mathematica",{name:"mathematica"})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/meta.js b/media/editors/codemirror/mode/meta.js +index e110288..44e0dbf 100644 +--- a/media/editors/codemirror/mode/meta.js ++++ b/media/editors/codemirror/mode/meta.js +@@ -13,12 +13,14 @@ + + CodeMirror.modeInfo = [ + {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]}, ++ {name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]}, + {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i}, + {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]}, + {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]}, + {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]}, + {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]}, + {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]}, ++ {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/}, + {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]}, + {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]}, + {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]}, +@@ -70,7 +72,9 @@ + {name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]}, + {name: "mIRC", mime: "text/mirc", mode: "mirc"}, + {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"}, ++ {name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]}, + {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]}, ++ {name: "MUMPS", mime: "text/x-mumps", mode: "mumps"}, + {name: "MS SQL", mime: "text/x-mssql", mode: "sql"}, + {name: "MySQL", mime: "text/x-mysql", mode: "sql"}, + {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i}, +@@ -104,7 +108,6 @@ + {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]}, + {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]}, + {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]}, +- {name: "SmartyMixed", mime: "text/x-smarty", mode: "smartymixed"}, + {name: "Solr", mime: "text/x-solr", mode: "solr"}, + {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]}, + {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]}, +@@ -120,6 +123,7 @@ + {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"}, + {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]}, + {name: "Tornado", mime: "text/x-tornado", mode: "tornado"}, ++ {name: "troff", mime: "troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]}, + {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]}, + {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]}, + {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]}, +@@ -128,7 +132,7 @@ + {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]}, + {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]}, + {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]}, +- {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml"], alias: ["yml"]}, ++ {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]}, + {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]} + ]; + // Ensure all modes have a mime property for backwards compatibility +diff --git a/media/editors/codemirror/mode/meta.min.js b/media/editors/codemirror/mode/meta.min.js +index fb300fd..cb85f2f 100644 +--- a/media/editors/codemirror/mode/meta.min.js ++++ b/media/editors/codemirror/mode/meta.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj"]},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"kotlin",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["py","pyw"]},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"]},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"SmartyMixed",mime:"text/x-smarty",mode:"smartymixed"},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"MariaDB",mime:"text/x-mariadb",mode:"sql"},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]}];for(var m=0;m-1&&m.substring(i+1,m.length);return x?e.findModeByExtension(x):void 0},e.findModeByName=function(m){m=m.toLowerCase();for(var t=0;t-1&&b.substring(e+1,b.length);return f?a.findModeByExtension(f):void 0},a.findModeByName=function(b){b=b.toLowerCase();for(var c=0;c!?^\/\|]/;return{startState:function(){return{tokenize:$,beforeParams:!1,inParams:!1}},token:function(e,i){return e.eatSpace()?null:i.tokenize(e,i)}}})}); +\ 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.defineMIME("text/mirc","mirc"),a.defineMode("mirc",function(){function a(a){for(var b={},c=a.split(" "),d=0;d!?^\/\|]/;return{startState:function(){return{tokenize:c,beforeParams:!1,inParams:!1}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)}}})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/mllike/mllike.js b/media/editors/codemirror/mode/mllike/mllike.js +index 04ab1c9..bf0b8a6 100644 +--- a/media/editors/codemirror/mode/mllike/mllike.js ++++ b/media/editors/codemirror/mode/mllike/mllike.js +@@ -85,7 +85,7 @@ CodeMirror.defineMode('mllike', function(_config, parserConfig) { + } + stream.eatWhile(/\w/); + var cur = stream.current(); +- return words[cur] || 'variable'; ++ return words.hasOwnProperty(cur) ? words[cur] : 'variable'; + } + + function tokenString(stream, state) { +diff --git a/media/editors/codemirror/mode/mllike/mllike.min.js b/media/editors/codemirror/mode/mllike/mllike.min.js +index df8d59d..dbb4409 100644 +--- a/media/editors/codemirror/mode/mllike/mllike.min.js ++++ b/media/editors/codemirror/mode/mllike/mllike.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("mllike",function(e,r){function t(e,t){var d=e.next();if('"'===d)return t.tokenize=o,t.tokenize(e,t);if("("===d&&e.eat("*"))return t.commentLevel++,t.tokenize=n,t.tokenize(e,t);if("~"===d)return e.eatWhile(/\w/),"variable-2";if("`"===d)return e.eatWhile(/\w/),"quote";if("/"===d&&r.slashComments&&e.eat("/"))return e.skipToEnd(),"comment";if(/\d/.test(d))return e.eatWhile(/[\d]/),e.eat(".")&&e.eatWhile(/[\d]/),"number";if(/[+\-*&%=<>!?|]/.test(d))return"operator";e.eatWhile(/\w/);var l=e.current();return i[l]||"variable"}function o(e,r){for(var o,n=!1,i=!1;null!=(o=e.next());){if('"'===o&&!i){n=!0;break}i=!i&&"\\"===o}return n&&!i&&(r.tokenize=t),"string"}function n(e,r){for(var o,n;r.commentLevel>0&&null!=(n=e.next());)"("===o&&"*"===n&&r.commentLevel++,"*"===o&&")"===n&&r.commentLevel--,o=n;return r.commentLevel<=0&&(r.tokenize=t),"comment"}var i={let:"keyword",rec:"keyword","in":"keyword",of:"keyword",and:"keyword","if":"keyword",then:"keyword","else":"keyword","for":"keyword",to:"keyword","while":"keyword","do":"keyword",done:"keyword",fun:"keyword","function":"keyword",val:"keyword",type:"keyword",mutable:"keyword",match:"keyword","with":"keyword","try":"keyword",open:"builtin",ignore:"builtin",begin:"keyword",end:"keyword"},d=r.extraWords||{};for(var l in d)d.hasOwnProperty(l)&&(i[l]=r.extraWords[l]);return{startState:function(){return{tokenize:t,commentLevel:0}},token:function(e,r){return e.eatSpace()?null:r.tokenize(e,r)},blockCommentStart:"(*",blockCommentEnd:"*)",lineComment:r.slashComments?"//":null}}),e.defineMIME("text/x-ocaml",{name:"mllike",extraWords:{succ:"keyword",trace:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin","true":"atom","false":"atom",raise:"keyword"}}),e.defineMIME("text/x-fsharp",{name:"mllike",extraWords:{"abstract":"keyword",as:"keyword",assert:"keyword",base:"keyword","class":"keyword","default":"keyword",delegate:"keyword",downcast:"keyword",downto:"keyword",elif:"keyword",exception:"keyword",extern:"keyword","finally":"keyword",global:"keyword",inherit:"keyword",inline:"keyword","interface":"keyword",internal:"keyword",lazy:"keyword","let!":"keyword",member:"keyword",module:"keyword",namespace:"keyword","new":"keyword","null":"keyword",override:"keyword","private":"keyword","public":"keyword","return":"keyword","return!":"keyword",select:"keyword","static":"keyword",struct:"keyword",upcast:"keyword",use:"keyword","use!":"keyword",val:"keyword",when:"keyword","yield":"keyword","yield!":"keyword",List:"builtin",Seq:"builtin",Map:"builtin",Set:"builtin","int":"builtin",string:"builtin",raise:"builtin",failwith:"builtin",not:"builtin","true":"builtin","false":"builtin"},slashComments:!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("mllike",function(a,b){function c(a,c){var g=a.next();if('"'===g)return c.tokenize=d,c.tokenize(a,c);if("("===g&&a.eat("*"))return c.commentLevel++,c.tokenize=e,c.tokenize(a,c);if("~"===g)return a.eatWhile(/\w/),"variable-2";if("`"===g)return a.eatWhile(/\w/),"quote";if("/"===g&&b.slashComments&&a.eat("/"))return a.skipToEnd(),"comment";if(/\d/.test(g))return a.eatWhile(/[\d]/),a.eat(".")&&a.eatWhile(/[\d]/),"number";if(/[+\-*&%=<>!?|]/.test(g))return"operator";a.eatWhile(/\w/);var h=a.current();return f.hasOwnProperty(h)?f[h]:"variable"}function d(a,b){for(var d,e=!1,f=!1;null!=(d=a.next());){if('"'===d&&!f){e=!0;break}f=!f&&"\\"===d}return e&&!f&&(b.tokenize=c),"string"}function e(a,b){for(var d,e;b.commentLevel>0&&null!=(e=a.next());)"("===d&&"*"===e&&b.commentLevel++,"*"===d&&")"===e&&b.commentLevel--,d=e;return b.commentLevel<=0&&(b.tokenize=c),"comment"}var f={let:"keyword",rec:"keyword","in":"keyword",of:"keyword",and:"keyword","if":"keyword",then:"keyword","else":"keyword","for":"keyword",to:"keyword","while":"keyword","do":"keyword",done:"keyword",fun:"keyword","function":"keyword",val:"keyword",type:"keyword",mutable:"keyword",match:"keyword","with":"keyword","try":"keyword",open:"builtin",ignore:"builtin",begin:"keyword",end:"keyword"},g=b.extraWords||{};for(var h in g)g.hasOwnProperty(h)&&(f[h]=b.extraWords[h]);return{startState:function(){return{tokenize:c,commentLevel:0}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)},blockCommentStart:"(*",blockCommentEnd:"*)",lineComment:b.slashComments?"//":null}}),a.defineMIME("text/x-ocaml",{name:"mllike",extraWords:{succ:"keyword",trace:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin","true":"atom","false":"atom",raise:"keyword"}}),a.defineMIME("text/x-fsharp",{name:"mllike",extraWords:{"abstract":"keyword",as:"keyword",assert:"keyword",base:"keyword","class":"keyword","default":"keyword",delegate:"keyword",downcast:"keyword",downto:"keyword",elif:"keyword",exception:"keyword",extern:"keyword","finally":"keyword",global:"keyword",inherit:"keyword",inline:"keyword","interface":"keyword",internal:"keyword",lazy:"keyword","let!":"keyword",member:"keyword",module:"keyword",namespace:"keyword","new":"keyword","null":"keyword",override:"keyword","private":"keyword","public":"keyword","return":"keyword","return!":"keyword",select:"keyword","static":"keyword",struct:"keyword",upcast:"keyword",use:"keyword","use!":"keyword",val:"keyword",when:"keyword","yield":"keyword","yield!":"keyword",List:"builtin",Seq:"builtin",Map:"builtin",Set:"builtin","int":"builtin",string:"builtin",raise:"builtin",failwith:"builtin",not:"builtin","true":"builtin","false":"builtin"},slashComments:!0})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/modelica/modelica.min.js b/media/editors/codemirror/mode/modelica/modelica.min.js +index bd9f492..348ae9f 100644 +--- a/media/editors/codemirror/mode/modelica/modelica.min.js ++++ b/media/editors/codemirror/mode/modelica/modelica.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r0&&t.level--:t.level++,t.tokenize=null,t.sol=!1,c.propertyIsEnumerable(n)?"keyword":f.propertyIsEnumerable(n)?"builtin":p.propertyIsEnumerable(n)?"atom":"variable"}function a(e,t){for(;e.eat(/[^']/););return t.tokenize=null,t.sol=!1,e.eat("'")?"variable":"error"}function u(e,t){return e.eatWhile(k),e.eat(".")&&e.eatWhile(k),(e.eat("e")||e.eat("E"))&&(e.eat("-")||e.eat("+"),e.eatWhile(k)),t.tokenize=null,t.sol=!1,"number"}var s=t.indentUnit,c=n.keywords||{},f=n.builtin||{},p=n.atoms||{},d=/[;=\(:\),{}.*<>+\-\/^\[\]]/,m=/(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/,k=/[0-9]/,b=/[_a-zA-Z]/;return{startState:function(){return{tokenize:null,level:0,sol:!0}},token:function(e,t){if(null!=t.tokenize)return t.tokenize(e,t);if(e.sol()&&(t.sol=!0),e.eatSpace())return t.tokenize=null,null;var n=e.next();if("/"==n&&e.eat("/"))t.tokenize=r;else if("/"==n&&e.eat("*"))t.tokenize=o;else{if(m.test(n+e.peek()))return e.next(),t.tokenize=null,"operator";if(d.test(n))return t.tokenize=null,"operator";if(b.test(n))t.tokenize=l;else if("'"==n&&e.peek()&&"'"!=e.peek())t.tokenize=a;else if('"'==n)t.tokenize=i;else{if(!k.test(n))return t.tokenize=null,"error";t.tokenize=u}}return t.tokenize(e,t)},indent:function(t,n){if(null!=t.tokenize)return e.Pass;var r=t.level;return/(algorithm)/.test(n)&&r--,/(equation)/.test(n)&&r--,/(initial algorithm)/.test(n)&&r--,/(initial equation)/.test(n)&&r--,/(end)/.test(n)&&r--,r>0?s*r:0},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});var r="algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within",o="abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh",i="Real Boolean Integer String";n(["text/x-modelica"],{name:"modelica",keywords:t(r),builtin:t(o),atoms:t(i)})}); +\ 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){for(var b={},c=a.split(" "),d=0;d0&&b.level--:b.level++,b.tokenize=null,b.sol=!1,k.propertyIsEnumerable(c)?"keyword":l.propertyIsEnumerable(c)?"builtin":m.propertyIsEnumerable(c)?"atom":"variable"}function h(a,b){for(;a.eat(/[^']/););return b.tokenize=null,b.sol=!1,a.eat("'")?"variable":"error"}function i(a,b){return a.eatWhile(p),a.eat(".")&&a.eatWhile(p),(a.eat("e")||a.eat("E"))&&(a.eat("-")||a.eat("+"),a.eatWhile(p)),b.tokenize=null,b.sol=!1,"number"}var j=b.indentUnit,k=c.keywords||{},l=c.builtin||{},m=c.atoms||{},n=/[;=\(:\),{}.*<>+\-\/^\[\]]/,o=/(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/,p=/[0-9]/,q=/[_a-zA-Z]/;return{startState:function(){return{tokenize:null,level:0,sol:!0}},token:function(a,b){if(null!=b.tokenize)return b.tokenize(a,b);if(a.sol()&&(b.sol=!0),a.eatSpace())return b.tokenize=null,null;var c=a.next();if("/"==c&&a.eat("/"))b.tokenize=d;else if("/"==c&&a.eat("*"))b.tokenize=e;else{if(o.test(c+a.peek()))return a.next(),b.tokenize=null,"operator";if(n.test(c))return b.tokenize=null,"operator";if(q.test(c))b.tokenize=g;else if("'"==c&&a.peek()&&"'"!=a.peek())b.tokenize=h;else if('"'==c)b.tokenize=f;else{if(!p.test(c))return b.tokenize=null,"error";b.tokenize=i}}return b.tokenize(a,b)},indent:function(b,c){if(null!=b.tokenize)return a.Pass;var d=b.level;return/(algorithm)/.test(c)&&d--,/(equation)/.test(c)&&d--,/(initial algorithm)/.test(c)&&d--,/(initial equation)/.test(c)&&d--,/(end)/.test(c)&&d--,d>0?j*d:0},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});var d="algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within",e="abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh",f="Real Boolean Integer String";c(["text/x-modelica"],{name:"modelica",keywords:b(d),builtin:b(e),atoms:b(f)})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/mumps/mumps.js b/media/editors/codemirror/mode/mumps/mumps.js +new file mode 100644 +index 0000000..469f8c3 +--- /dev/null ++++ b/media/editors/codemirror/mode/mumps/mumps.js +@@ -0,0 +1,148 @@ ++// CodeMirror, copyright (c) by Marijn Haverbeke and others ++// Distributed under an MIT license: http://codemirror.net/LICENSE ++ ++/* ++ This MUMPS Language script was constructed using vbscript.js as a template. ++*/ ++ ++(function(mod) { ++ if (typeof exports == "object" && typeof module == "object") // CommonJS ++ mod(require("../../lib/codemirror")); ++ else if (typeof define == "function" && define.amd) // AMD ++ define(["../../lib/codemirror"], mod); ++ else // Plain browser env ++ mod(CodeMirror); ++})(function(CodeMirror) { ++ "use strict"; ++ ++ CodeMirror.defineMode("mumps", function() { ++ function wordRegexp(words) { ++ return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); ++ } ++ ++ var singleOperators = new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]"); ++ var doubleOperators = new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))"); ++ var singleDelimiters = new RegExp("^[\\.,:]"); ++ var brackets = new RegExp("[()]"); ++ var identifiers = new RegExp("^[%A-Za-z][A-Za-z0-9]*"); ++ var commandKeywords = ["break","close","do","else","for","goto", "halt", "hang", "if", "job","kill","lock","merge","new","open", "quit", "read", "set", "tcommit", "trollback", "tstart", "use", "view", "write", "xecute", "b","c","d","e","f","g", "h", "i", "j","k","l","m","n","o", "q", "r", "s", "tc", "tro", "ts", "u", "v", "w", "x"]; ++ // The following list includes instrinsic functions _and_ special variables ++ var intrinsicFuncsWords = ["\\$ascii", "\\$char", "\\$data", "\\$ecode", "\\$estack", "\\$etrap", "\\$extract", "\\$find", "\\$fnumber", "\\$get", "\\$horolog", "\\$io", "\\$increment", "\\$job", "\\$justify", "\\$length", "\\$name", "\\$next", "\\$order", "\\$piece", "\\$qlength", "\\$qsubscript", "\\$query", "\\$quit", "\\$random", "\\$reverse", "\\$select", "\\$stack", "\\$test", "\\$text", "\\$translate", "\\$view", "\\$x", "\\$y", "\\$a", "\\$c", "\\$d", "\\$e", "\\$ec", "\\$es", "\\$et", "\\$f", "\\$fn", "\\$g", "\\$h", "\\$i", "\\$j", "\\$l", "\\$n", "\\$na", "\\$o", "\\$p", "\\$q", "\\$ql", "\\$qs", "\\$r", "\\$re", "\\$s", "\\$st", "\\$t", "\\$tr", "\\$v", "\\$z"]; ++ var intrinsicFuncs = wordRegexp(intrinsicFuncsWords); ++ var command = wordRegexp(commandKeywords); ++ ++ function tokenBase(stream, state) { ++ if (stream.sol()) { ++ state.label = true; ++ state.commandMode = 0; ++ } ++ ++ // The character has meaning in MUMPS. Ignoring consecutive ++ // spaces would interfere with interpreting whether the next non-space ++ // character belongs to the command or argument context. ++ ++ // Examine each character and update a mode variable whose interpretation is: ++ // >0 => command 0 => argument <0 => command post-conditional ++ var ch = stream.peek(); ++ ++ if (ch == " " || ch == "\t") { // Pre-process ++ state.label = false; ++ if (state.commandMode == 0) ++ state.commandMode = 1; ++ else if ((state.commandMode < 0) || (state.commandMode == 2)) ++ state.commandMode = 0; ++ } else if ((ch != ".") && (state.commandMode > 0)) { ++ if (ch == ":") ++ state.commandMode = -1; // SIS - Command post-conditional ++ else ++ state.commandMode = 2; ++ } ++ ++ // Do not color parameter list as line tag ++ if ((ch === "(") || (ch === "\u0009")) ++ state.label = false; ++ ++ // MUMPS comment starts with ";" ++ if (ch === ";") { ++ stream.skipToEnd(); ++ return "comment"; ++ } ++ ++ // Number Literals // SIS/RLM - MUMPS permits canonic number followed by concatenate operator ++ if (stream.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/)) ++ return "number"; ++ ++ // Handle Strings ++ if (ch == '"') { ++ if (stream.skipTo('"')) { ++ stream.next(); ++ return "string"; ++ } else { ++ stream.skipToEnd(); ++ return "error"; ++ } ++ } ++ ++ // Handle operators and Delimiters ++ if (stream.match(doubleOperators) || stream.match(singleOperators)) ++ return "operator"; ++ ++ // Prevents leading "." in DO block from falling through to error ++ if (stream.match(singleDelimiters)) ++ return null; ++ ++ if (brackets.test(ch)) { ++ stream.next(); ++ return "bracket"; ++ } ++ ++ if (state.commandMode > 0 && stream.match(command)) ++ return "variable-2"; ++ ++ if (stream.match(intrinsicFuncs)) ++ return "builtin"; ++ ++ if (stream.match(identifiers)) ++ return "variable"; ++ ++ // Detect dollar-sign when not a documented intrinsic function ++ // "^" may introduce a GVN or SSVN - Color same as function ++ if (ch === "$" || ch === "^") { ++ stream.next(); ++ return "builtin"; ++ } ++ ++ // MUMPS Indirection ++ if (ch === "@") { ++ stream.next(); ++ return "string-2"; ++ } ++ ++ if (/[\w%]/.test(ch)) { ++ stream.eatWhile(/[\w%]/); ++ return "variable"; ++ } ++ ++ // Handle non-detected items ++ stream.next(); ++ return "error"; ++ } ++ ++ return { ++ startState: function() { ++ return { ++ label: false, ++ commandMode: 0 ++ }; ++ }, ++ ++ token: function(stream, state) { ++ var style = tokenBase(stream, state); ++ if (state.label) return "tag"; ++ return style; ++ } ++ }; ++ }); ++ ++ CodeMirror.defineMIME("text/x-mumps", "mumps"); ++}); +diff --git a/media/editors/codemirror/mode/mumps/mumps.min.js b/media/editors/codemirror/mode/mumps/mumps.min.js +new file mode 100644 +index 0000000..fd075fb +--- /dev/null ++++ b/media/editors/codemirror/mode/mumps/mumps.min.js +@@ -0,0 +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("mumps",function(){function a(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function b(a,b){a.sol()&&(b.label=!0,b.commandMode=0);var h=a.peek();return" "==h||" "==h?(b.label=!1,0==b.commandMode?b.commandMode=1:(b.commandMode<0||2==b.commandMode)&&(b.commandMode=0)):"."!=h&&b.commandMode>0&&(":"==h?b.commandMode=-1:b.commandMode=2),("("===h||" "===h)&&(b.label=!1),";"===h?(a.skipToEnd(),"comment"):a.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/)?"number":'"'==h?a.skipTo('"')?(a.next(),"string"):(a.skipToEnd(),"error"):a.match(d)||a.match(c)?"operator":a.match(e)?null:f.test(h)?(a.next(),"bracket"):b.commandMode>0&&a.match(k)?"variable-2":a.match(j)?"builtin":a.match(g)?"variable":"$"===h||"^"===h?(a.next(),"builtin"):"@"===h?(a.next(),"string-2"):/[\w%]/.test(h)?(a.eatWhile(/[\w%]/),"variable"):(a.next(),"error")}var c=new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]"),d=new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))"),e=new RegExp("^[\\.,:]"),f=new RegExp("[()]"),g=new RegExp("^[%A-Za-z][A-Za-z0-9]*"),h=["break","close","do","else","for","goto","halt","hang","if","job","kill","lock","merge","new","open","quit","read","set","tcommit","trollback","tstart","use","view","write","xecute","b","c","d","e","f","g","h","i","j","k","l","m","n","o","q","r","s","tc","tro","ts","u","v","w","x"],i=["\\$ascii","\\$char","\\$data","\\$ecode","\\$estack","\\$etrap","\\$extract","\\$find","\\$fnumber","\\$get","\\$horolog","\\$io","\\$increment","\\$job","\\$justify","\\$length","\\$name","\\$next","\\$order","\\$piece","\\$qlength","\\$qsubscript","\\$query","\\$quit","\\$random","\\$reverse","\\$select","\\$stack","\\$test","\\$text","\\$translate","\\$view","\\$x","\\$y","\\$a","\\$c","\\$d","\\$e","\\$ec","\\$es","\\$et","\\$f","\\$fn","\\$g","\\$h","\\$i","\\$j","\\$l","\\$n","\\$na","\\$o","\\$p","\\$q","\\$ql","\\$qs","\\$r","\\$re","\\$s","\\$st","\\$t","\\$tr","\\$v","\\$z"],j=a(i),k=a(h);return{startState:function(){return{label:!1,commandMode:0}},token:function(a,c){var d=b(a,c);return c.label?"tag":d}}}),a.defineMIME("text/x-mumps","mumps")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/nginx/nginx.min.js b/media/editors/codemirror/mode/nginx/nginx.min.js +index 9aaa18c..54f2824 100644 +--- a/media/editors/codemirror/mode/nginx/nginx.min.js ++++ b/media/editors/codemirror/mode/nginx/nginx.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("nginx",function(e){function _(e){for(var _={},t=e.split(" "),i=0;i*\/]/.test(o)?t(null,"select-op"):/[;{}:\[\]]/.test(o)?t(null,o):(e.eatWhile(/[\w\\\-]/),t("variable","variable")):t(null,"compare"):void t(null,"compare")}function r(e,_){for(var r,s=!1;null!=(r=e.next());){if(s&&"/"==r){_.tokenize=i;break}s="*"==r}return t("comment","comment")}function s(e,_){for(var r,s=0;null!=(r=e.next());){if(s>=2&&">"==r){_.tokenize=i;break}s="-"==r?s+1:0}return t("comment","comment")}function a(e){return function(_,r){for(var s,a=!1;null!=(s=_.next())&&(s!=e||a);)a=!a&&"\\"==s;return a||(r.tokenize=i),t("string","string")}}var o,n=_("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=_("http mail events server types location upstream charset_map limit_except if geo map"),l=_("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),p=e.indentUnit;return{startState:function(e){return{tokenize:i,baseIndent:e||0,stack:[]}},token:function(e,_){if(e.eatSpace())return null;o=null;var t=_.tokenize(e,_),i=_.stack[_.stack.length-1];return"hash"==o&&"rule"==i?t="atom":"variable"==t&&("rule"==i?t="number":i&&"@media{"!=i||(t="tag")),"rule"==i&&/^[\{\};]$/.test(o)&&_.stack.pop(),"{"==o?"@media"==i?_.stack[_.stack.length-1]="@media{":_.stack.push("{"):"}"==o?_.stack.pop():"@media"==o?_.stack.push("@media"):"{"==i&&"comment"!=o&&_.stack.push("rule"),t},indent:function(e,_){var t=e.stack.length;return/^\}/.test(_)&&(t-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+t*p},electricChars:"}"}}),e.defineMIME("text/nginx","text/x-nginx-conf")}); +\ 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("nginx",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d*\/]/.test(h)?c(null,"select-op"):/[;{}:\[\]]/.test(h)?c(null,h):(a.eatWhile(/[\w\\\-]/),c("variable","variable")):c(null,"compare"):void c(null,"compare")}function e(a,b){for(var e,f=!1;null!=(e=a.next());){if(f&&"/"==e){b.tokenize=d;break}f="*"==e}return c("comment","comment")}function f(a,b){for(var e,f=0;null!=(e=a.next());){if(f>=2&&">"==e){b.tokenize=d;break}f="-"==e?f+1:0}return c("comment","comment")}function g(a){return function(b,e){for(var f,g=!1;null!=(f=b.next())&&(f!=a||g);)g=!g&&"\\"==f;return g||(e.tokenize=d),c("string","string")}}var h,i=b("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),j=b("http mail events server types location upstream charset_map limit_except if geo map"),k=b("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),l=a.indentUnit;return{startState:function(a){return{tokenize:d,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;h=null;var c=b.tokenize(a,b),d=b.stack[b.stack.length-1];return"hash"==h&&"rule"==d?c="atom":"variable"==c&&("rule"==d?c="number":d&&"@media{"!=d||(c="tag")),"rule"==d&&/^[\{\};]$/.test(h)&&b.stack.pop(),"{"==h?"@media"==d?b.stack[b.stack.length-1]="@media{":b.stack.push("{"):"}"==h?b.stack.pop():"@media"==h?b.stack.push("@media"):"{"==d&&"comment"!=h&&b.stack.push("rule"),c},indent:function(a,b){var c=a.stack.length;return/^\}/.test(b)&&(c-="rule"==a.stack[a.stack.length-1]?2:1),a.baseIndent+c*l},electricChars:"}"}}),a.defineMIME("text/nginx","text/x-nginx-conf")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/ntriples/ntriples.min.js b/media/editors/codemirror/mode/ntriples/ntriples.min.js +index 2f03eed..80b8f11 100644 +--- a/media/editors/codemirror/mode/ntriples/ntriples.min.js ++++ b/media/editors/codemirror/mode/ntriples/ntriples.min.js +@@ -1 +1 @@ +-!function(_){"object"==typeof exports&&"object"==typeof module?_(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],_):_(CodeMirror)}(function(_){"use strict";_.defineMode("ntriples",function(){function _(_,I){var R,n=_.location;R=n==e.PRE_SUBJECT&&"<"==I?e.WRITING_SUB_URI:n==e.PRE_SUBJECT&&"_"==I?e.WRITING_BNODE_URI:n==e.PRE_PRED&&"<"==I?e.WRITING_PRED_URI:n==e.PRE_OBJ&&"<"==I?e.WRITING_OBJ_URI:n==e.PRE_OBJ&&"_"==I?e.WRITING_OBJ_BNODE:n==e.PRE_OBJ&&'"'==I?e.WRITING_OBJ_LITERAL:n==e.WRITING_SUB_URI&&">"==I?e.PRE_PRED:n==e.WRITING_BNODE_URI&&" "==I?e.PRE_PRED:n==e.WRITING_PRED_URI&&">"==I?e.PRE_OBJ:n==e.WRITING_OBJ_URI&&">"==I?e.POST_OBJ:n==e.WRITING_OBJ_BNODE&&" "==I?e.POST_OBJ:n==e.WRITING_OBJ_LITERAL&&'"'==I?e.POST_OBJ:n==e.WRITING_LIT_LANG&&" "==I?e.POST_OBJ:n==e.WRITING_LIT_TYPE&&">"==I?e.POST_OBJ:n==e.WRITING_OBJ_LITERAL&&"@"==I?e.WRITING_LIT_LANG:n==e.WRITING_OBJ_LITERAL&&"^"==I?e.WRITING_LIT_TYPE:" "!=I||n!=e.PRE_SUBJECT&&n!=e.PRE_PRED&&n!=e.PRE_OBJ&&n!=e.POST_OBJ?n==e.POST_OBJ&&"."==I?e.PRE_SUBJECT:e.ERROR:n,_.location=R}var e={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};return{startState:function(){return{location:e.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(e,I){var R=e.next();if("<"==R){_(I,R);var n="";return e.eatWhile(function(_){return"#"!=_&&">"!=_?(n+=_,!0):!1}),I.uris.push(n),e.match("#",!1)?"variable":(e.next(),_(I,">"),"variable")}if("#"==R){var t="";return e.eatWhile(function(_){return">"!=_&&" "!=_?(t+=_,!0):!1}),I.anchors.push(t),"variable-2"}if(">"==R)return _(I,">"),"variable";if("_"==R){_(I,R);var r="";return e.eatWhile(function(_){return" "!=_?(r+=_,!0):!1}),I.bnodes.push(r),e.next(),_(I," "),"builtin"}if('"'==R)return _(I,R),e.eatWhile(function(_){return'"'!=_}),e.next(),"@"!=e.peek()&&"^"!=e.peek()&&_(I,'"'),"string";if("@"==R){_(I,"@");var i="";return e.eatWhile(function(_){return" "!=_?(i+=_,!0):!1}),I.langs.push(i),e.next(),_(I," "),"string-2"}if("^"==R){e.next(),_(I,"^");var T="";return e.eatWhile(function(_){return">"!=_?(T+=_,!0):!1}),I.types.push(T),e.next(),_(I,">"),"variable"}" "==R&&_(I,R),"."==R&&_(I,R)}}}),_.defineMIME("text/n-triples","ntriples")}); +\ 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("ntriples",function(){function a(a,c){var d,e=a.location;d=e==b.PRE_SUBJECT&&"<"==c?b.WRITING_SUB_URI:e==b.PRE_SUBJECT&&"_"==c?b.WRITING_BNODE_URI:e==b.PRE_PRED&&"<"==c?b.WRITING_PRED_URI:e==b.PRE_OBJ&&"<"==c?b.WRITING_OBJ_URI:e==b.PRE_OBJ&&"_"==c?b.WRITING_OBJ_BNODE:e==b.PRE_OBJ&&'"'==c?b.WRITING_OBJ_LITERAL:e==b.WRITING_SUB_URI&&">"==c?b.PRE_PRED:e==b.WRITING_BNODE_URI&&" "==c?b.PRE_PRED:e==b.WRITING_PRED_URI&&">"==c?b.PRE_OBJ:e==b.WRITING_OBJ_URI&&">"==c?b.POST_OBJ:e==b.WRITING_OBJ_BNODE&&" "==c?b.POST_OBJ:e==b.WRITING_OBJ_LITERAL&&'"'==c?b.POST_OBJ:e==b.WRITING_LIT_LANG&&" "==c?b.POST_OBJ:e==b.WRITING_LIT_TYPE&&">"==c?b.POST_OBJ:e==b.WRITING_OBJ_LITERAL&&"@"==c?b.WRITING_LIT_LANG:e==b.WRITING_OBJ_LITERAL&&"^"==c?b.WRITING_LIT_TYPE:" "!=c||e!=b.PRE_SUBJECT&&e!=b.PRE_PRED&&e!=b.PRE_OBJ&&e!=b.POST_OBJ?e==b.POST_OBJ&&"."==c?b.PRE_SUBJECT:b.ERROR:e,a.location=d}var b={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};return{startState:function(){return{location:b.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(b,c){var d=b.next();if("<"==d){a(c,d);var e="";return b.eatWhile(function(a){return"#"!=a&&">"!=a?(e+=a,!0):!1}),c.uris.push(e),b.match("#",!1)?"variable":(b.next(),a(c,">"),"variable")}if("#"==d){var f="";return b.eatWhile(function(a){return">"!=a&&" "!=a?(f+=a,!0):!1}),c.anchors.push(f),"variable-2"}if(">"==d)return a(c,">"),"variable";if("_"==d){a(c,d);var g="";return b.eatWhile(function(a){return" "!=a?(g+=a,!0):!1}),c.bnodes.push(g),b.next(),a(c," "),"builtin"}if('"'==d)return a(c,d),b.eatWhile(function(a){return'"'!=a}),b.next(),"@"!=b.peek()&&"^"!=b.peek()&&a(c,'"'),"string";if("@"==d){a(c,"@");var h="";return b.eatWhile(function(a){return" "!=a?(h+=a,!0):!1}),c.langs.push(h),b.next(),a(c," "),"string-2"}if("^"==d){b.next(),a(c,"^");var i="";return b.eatWhile(function(a){return">"!=a?(i+=a,!0):!1}),c.types.push(i),b.next(),a(c,">"),"variable"}" "==d&&a(c,d),"."==d&&a(c,d)}}}),a.defineMIME("text/n-triples","ntriples")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/octave/octave.min.js b/media/editors/codemirror/mode/octave/octave.min.js +index 622383a..4525e3d 100644 +--- a/media/editors/codemirror/mode/octave/octave.min.js ++++ b/media/editors/codemirror/mode/octave/octave.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("octave",function(){function e(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e,n){return e.sol()||"'"!==e.peek()?(n.tokenize=r,r(e,n)):(e.next(),n.tokenize=r,"operator")}function t(e,n){return e.match(/^.*%}/)?(n.tokenize=r,"comment"):(e.skipToEnd(),"comment")}function r(d,p){if(d.eatSpace())return null;if(d.match("%{"))return p.tokenize=t,d.skipToEnd(),"comment";if(d.match(/^[%#]/))return d.skipToEnd(),"comment";if(d.match(/^[0-9\.+-]/,!1)){if(d.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return d.tokenize=r,"number";if(d.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/))return"number";if(d.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}return d.match(e(["nan","NaN","inf","Inf"]))?"number":d.match(/^"([^"]|(""))*"/)?"string":d.match(/^'([^']|(''))*'/)?"string":d.match(l)?"keyword":d.match(s)?"builtin":d.match(u)?"variable":d.match(i)||d.match(a)?"operator":d.match(o)||d.match(c)||d.match(m)?null:d.match(f)?(p.tokenize=n,null):(d.next(),"error")}var i=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),o=new RegExp("^[\\(\\[\\{\\},:=;]"),a=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),c=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),m=new RegExp("^((>>=)|(<<=))"),f=new RegExp("^[\\]\\)]"),u=new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*"),s=e(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),l=e(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);return{startState:function(){return{tokenize:r}},token:function(e,t){var r=t.tokenize(e,t);return("number"===r||"variable"===r)&&(t.tokenize=n),r}}}),e.defineMIME("text/x-octave","octave")}); +\ 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("octave",function(){function a(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function b(a,b){return a.sol()||"'"!==a.peek()?(b.tokenize=d,d(a,b)):(a.next(),b.tokenize=d,"operator")}function c(a,b){return a.match(/^.*%}/)?(b.tokenize=d,"comment"):(a.skipToEnd(),"comment")}function d(n,o){if(n.eatSpace())return null;if(n.match("%{"))return o.tokenize=c,n.skipToEnd(),"comment";if(n.match(/^[%#]/))return n.skipToEnd(),"comment";if(n.match(/^[0-9\.+-]/,!1)){if(n.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return n.tokenize=d,"number";if(n.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/))return"number";if(n.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}return n.match(a(["nan","NaN","inf","Inf"]))?"number":n.match(/^"([^"]|(""))*"/)?"string":n.match(/^'([^']|(''))*'/)?"string":n.match(m)?"keyword":n.match(l)?"builtin":n.match(k)?"variable":n.match(e)||n.match(g)?"operator":n.match(f)||n.match(h)||n.match(i)?null:n.match(j)?(o.tokenize=b,null):(n.next(),"error")}var e=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),f=new RegExp("^[\\(\\[\\{\\},:=;]"),g=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),h=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),i=new RegExp("^((>>=)|(<<=))"),j=new RegExp("^[\\]\\)]"),k=new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*"),l=a(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),m=a(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);return{startState:function(){return{tokenize:d}},token:function(a,c){var d=c.tokenize(a,c);return("number"===d||"variable"===d)&&(c.tokenize=b),d}}}),a.defineMIME("text/x-octave","octave")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/pascal/pascal.min.js b/media/editors/codemirror/mode/pascal/pascal.min.js +index a58c8bd..3291170 100644 +--- a/media/editors/codemirror/mode/pascal/pascal.min.js ++++ b/media/editors/codemirror/mode/pascal/pascal.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("pascal",function(){function e(e){for(var t={},r=e.split(" "),n=0;n!?|\/]/;return{startState:function(){return{tokenize:null}},token:function(e,r){if(e.eatSpace())return null;var n=(r.tokenize||t)(e,r);return"comment"==n||"meta"==n?n:n},electricChars:"{}"}}),e.defineMIME("text/x-pascal","pascal")}); +\ 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("pascal",function(){function a(a){for(var b={},c=a.split(" "),d=0;d!?|\/]/;return{startState:function(){return{tokenize:null}},token:function(a,c){if(a.eatSpace())return null;var d=(c.tokenize||b)(a,c);return"comment"==d||"meta"==d?d:d},electricChars:"{}"}}),a.defineMIME("text/x-pascal","pascal")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/pegjs/pegjs.min.js b/media/editors/codemirror/mode/pegjs/pegjs.min.js +index af0359e..4e2ab05 100644 +--- a/media/editors/codemirror/mode/pegjs/pegjs.min.js ++++ b/media/editors/codemirror/mode/pegjs/pegjs.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("pegjs",function(t){function n(e){return e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)}var r=e.getMode(t,"javascript");return{startState:function(){return{inString:!1,stringType:null,inComment:!1,inChracterClass:!1,braced:0,lhs:!0,localState:null}},token:function(e,t){if(e&&(t.inString||t.inComment||'"'!=e.peek()&&"'"!=e.peek()||(t.stringType=e.peek(),e.next(),t.inString=!0)),t.inString||t.inComment||!e.match(/^\/\*/)||(t.inComment=!0),t.inString){for(;t.inString&&!e.eol();)e.peek()===t.stringType?(e.next(),t.inString=!1):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string"}if(t.inComment){for(;t.inComment&&!e.eol();)e.match(/\*\//)?t.inComment=!1:e.match(/^.[^\*]*/);return"comment"}if(t.inChracterClass)for(;t.inChracterClass&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(/^\\./)||(t.inChracterClass=!1);else{if("["===e.peek())return e.next(),t.inChracterClass=!0,"bracket";if(e.match(/^\/\//))return e.skipToEnd(),"comment";if(t.braced||"{"===e.peek()){null===t.localState&&(t.localState=r.startState());var i=r.token(e,t.localState),a=e.current();if(!i)for(var o=0;o=0?r:0,t)}return e.string.substr(0,e.pos-1)}function n(e,t){var r=e.string.length,n=r-e.pos+1;return e.string.substr(e.pos,t&&r>t?t:n)}function i(e,t){var r,n=e.pos+t;e.pos=0>=n?0:n>=(r=e.string.length-1)?r:n}e.defineMode("perl",function(){function e(e,t,r,n,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var s,o=!1,u=0;s=e.next();){if(s===r[u]&&!o)return void 0!==r[++u]?(t.chain=r[u],t.style=n,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,n;o=!o&&"\\"==s}return n},t.tokenize(e,t)}function s(e,t,r){return t.tokenize=function(e,t){return e.string==r&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,l){if(a.eatSpace())return null;if(l.chain)return e(a,l,l.chain,l.style,l.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),s(a,l,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return s(a,l,"=cut");var f=a.next();if('"'==f||"'"==f){if(r(a,3)=="<<"+f){var E=a.pos;a.eatWhile(/\w/);var R=a.current().substr(1);if(R&&a.eat(f))return s(a,l,R);a.pos=E}return e(a,l,[f],"string")}if("q"==f){var c=t(a,-2);if(!c||!/\w/.test(c))if(c=t(a,0),"x"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],u,$);if("["==c)return i(a,2),e(a,l,["]"],u,$);if("{"==c)return i(a,2),e(a,l,["}"],u,$);if("<"==c)return i(a,2),e(a,l,[">"],u,$);if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],u,$)}else if("q"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],"string");if("["==c)return i(a,2),e(a,l,["]"],"string");if("{"==c)return i(a,2),e(a,l,["}"],"string");if("<"==c)return i(a,2),e(a,l,[">"],"string");if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],"string")}else if("w"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],"bracket");if("["==c)return i(a,2),e(a,l,["]"],"bracket");if("{"==c)return i(a,2),e(a,l,["}"],"bracket");if("<"==c)return i(a,2),e(a,l,[">"],"bracket");if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],"bracket")}else if("r"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],u,$);if("["==c)return i(a,2),e(a,l,["]"],u,$);if("{"==c)return i(a,2),e(a,l,["}"],u,$);if("<"==c)return i(a,2),e(a,l,[">"],u,$);if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],u,$)}else if(/[\^'"!~\/(\[{<]/.test(c)){if("("==c)return i(a,1),e(a,l,[")"],"string");if("["==c)return i(a,1),e(a,l,["]"],"string");if("{"==c)return i(a,1),e(a,l,["}"],"string");if("<"==c)return i(a,1),e(a,l,[">"],"string");if(/[\^'"!~\/]/.test(c))return e(a,l,[a.eat(c)],"string")}}if("m"==f){var c=t(a,-2);if((!c||!/\w/.test(c))&&(c=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(c))return e(a,l,[c],u,$);if("("==c)return e(a,l,[")"],u,$);if("["==c)return e(a,l,["]"],u,$);if("{"==c)return e(a,l,["}"],u,$);if("<"==c)return e(a,l,[">"],u,$)}}if("s"==f){var c=/[\/>\]})\w]/.test(t(a,-2));if(!c&&(c=a.eat(/[(\[{<\^'"!~\/]/)))return"["==c?e(a,l,["]","]"],u,$):"{"==c?e(a,l,["}","}"],u,$):"<"==c?e(a,l,[">",">"],u,$):"("==c?e(a,l,[")",")"],u,$):e(a,l,[c,c],u,$)}if("y"==f){var c=/[\/>\]})\w]/.test(t(a,-2));if(!c&&(c=a.eat(/[(\[{<\^'"!~\/]/)))return"["==c?e(a,l,["]","]"],u,$):"{"==c?e(a,l,["}","}"],u,$):"<"==c?e(a,l,[">",">"],u,$):"("==c?e(a,l,[")",")"],u,$):e(a,l,[c,c],u,$)}if("t"==f){var c=/[\/>\]})\w]/.test(t(a,-2));if(!c&&(c=a.eat("r"),c&&(c=a.eat(/[(\[{<\^'"!~\/]/))))return"["==c?e(a,l,["]","]"],u,$):"{"==c?e(a,l,["}","}"],u,$):"<"==c?e(a,l,[">",">"],u,$):"("==c?e(a,l,[")",")"],u,$):e(a,l,[c,c],u,$)}if("`"==f)return e(a,l,[f],"variable-2");if("/"==f)return/~\s*$/.test(r(a))?e(a,l,[f],u,$):"operator";if("$"==f){var E=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=E}if(/[$@%]/.test(f)){var E=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(t(a,-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var c=a.current();if(o[c])return"variable-2"}a.pos=E}if(/[$@%&]/.test(f)&&(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}"))){var c=a.current();return o[c]?"variable-2":"variable"}if("#"==f&&"$"!=t(a,-2))return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(f)){var E=a.pos;if(a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),o[a.current()])return"operator";a.pos=E}if("_"==f&&1==a.pos){if("_END__"==n(a,6))return e(a,l,["\x00"],"comment");if("_DATA__"==n(a,7))return e(a,l,["\x00"],"variable-2");if("_C__"==n(a,7))return e(a,l,["\x00"],"string")}if(/\w/.test(f)){var E=a.pos;if("{"==t(a,-2)&&("}"==t(a,0)||a.eatWhile(/\w/)&&"}"==t(a,0)))return"string";a.pos=E}if(/[A-Z]/.test(f)){var p=t(a,-2),E=a.pos;if(a.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(a,0))){var c=o[a.current()];return c?(c[1]&&(c=c[0]),":"!=p?1==c?"keyword":2==c?"def":3==c?"atom":4==c?"operator":5==c?"variable-2":"meta":"meta"):"meta"}a.pos=E}if(/[a-zA-Z_]/.test(f)){var p=t(a,-2);a.eatWhile(/\w/);var c=o[a.current()];return c?(c[1]&&(c=c[0]),":"!=p?1==c?"keyword":2==c?"def":3==c?"atom":4==c?"operator":5==c?"variable-2":"meta":"meta"):"meta"}return null}var o={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},u="string-2",$=/[goseximacplud]/;return{startState:function(){return{tokenize:a,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||a)(e,t)},lineComment:"#"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}); +\ 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.string.charAt(a.pos+(b||0))}function c(a,b){if(b){var c=a.pos-b;return a.string.substr(c>=0?c:0,b)}return a.string.substr(0,a.pos-1)}function d(a,b){var c=a.string.length,d=c-a.pos+1;return a.string.substr(a.pos,b&&c>b?b:d)}function e(a,b){var c,d=a.pos+b;0>=d?a.pos=0:d>=(c=a.string.length-1)?a.pos=c:a.pos=d}a.defineMode("perl",function(){function a(a,b,c,d,e){return b.chain=null,b.style=null,b.tail=null,b.tokenize=function(a,b){for(var f,h=!1,i=0;f=a.next();){if(f===c[i]&&!h)return void 0!==c[++i]?(b.chain=c[i],b.style=d,b.tail=e):e&&a.eatWhile(e),b.tokenize=g,d;h=!h&&"\\"==f}return d},b.tokenize(a,b)}function f(a,b,c){return b.tokenize=function(a,b){return a.string==c&&(b.tokenize=g),a.skipToEnd(),"string"},b.tokenize(a,b)}function g(g,k){if(g.eatSpace())return null;if(k.chain)return a(g,k,k.chain,k.style,k.tail);if(g.match(/^\-?[\d\.]/,!1)&&g.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(g.match(/^<<(?=\w)/))return g.eatWhile(/\w/),f(g,k,g.current().substr(2));if(g.sol()&&g.match(/^\=item(?!\w)/))return f(g,k,"=cut");var l=g.next();if('"'==l||"'"==l){if(c(g,3)=="<<"+l){var m=g.pos;g.eatWhile(/\w/);var n=g.current().substr(1);if(n&&g.eat(l))return f(g,k,n);g.pos=m}return a(g,k,[l],"string")}if("q"==l){var o=b(g,-2);if(!o||!/\w/.test(o))if(o=b(g,0),"x"==o){if(o=b(g,1),"("==o)return e(g,2),a(g,k,[")"],i,j);if("["==o)return e(g,2),a(g,k,["]"],i,j);if("{"==o)return e(g,2),a(g,k,["}"],i,j);if("<"==o)return e(g,2),a(g,k,[">"],i,j);if(/[\^'"!~\/]/.test(o))return e(g,1),a(g,k,[g.eat(o)],i,j)}else if("q"==o){if(o=b(g,1),"("==o)return e(g,2),a(g,k,[")"],"string");if("["==o)return e(g,2),a(g,k,["]"],"string");if("{"==o)return e(g,2),a(g,k,["}"],"string");if("<"==o)return e(g,2),a(g,k,[">"],"string");if(/[\^'"!~\/]/.test(o))return e(g,1),a(g,k,[g.eat(o)],"string")}else if("w"==o){if(o=b(g,1),"("==o)return e(g,2),a(g,k,[")"],"bracket");if("["==o)return e(g,2),a(g,k,["]"],"bracket");if("{"==o)return e(g,2),a(g,k,["}"],"bracket");if("<"==o)return e(g,2),a(g,k,[">"],"bracket");if(/[\^'"!~\/]/.test(o))return e(g,1),a(g,k,[g.eat(o)],"bracket")}else if("r"==o){if(o=b(g,1),"("==o)return e(g,2),a(g,k,[")"],i,j);if("["==o)return e(g,2),a(g,k,["]"],i,j);if("{"==o)return e(g,2),a(g,k,["}"],i,j);if("<"==o)return e(g,2),a(g,k,[">"],i,j);if(/[\^'"!~\/]/.test(o))return e(g,1),a(g,k,[g.eat(o)],i,j)}else if(/[\^'"!~\/(\[{<]/.test(o)){if("("==o)return e(g,1),a(g,k,[")"],"string");if("["==o)return e(g,1),a(g,k,["]"],"string");if("{"==o)return e(g,1),a(g,k,["}"],"string");if("<"==o)return e(g,1),a(g,k,[">"],"string");if(/[\^'"!~\/]/.test(o))return a(g,k,[g.eat(o)],"string")}}if("m"==l){var o=b(g,-2);if((!o||!/\w/.test(o))&&(o=g.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(o))return a(g,k,[o],i,j);if("("==o)return a(g,k,[")"],i,j);if("["==o)return a(g,k,["]"],i,j);if("{"==o)return a(g,k,["}"],i,j);if("<"==o)return a(g,k,[">"],i,j)}}if("s"==l){var o=/[\/>\]})\w]/.test(b(g,-2));if(!o&&(o=g.eat(/[(\[{<\^'"!~\/]/)))return"["==o?a(g,k,["]","]"],i,j):"{"==o?a(g,k,["}","}"],i,j):"<"==o?a(g,k,[">",">"],i,j):"("==o?a(g,k,[")",")"],i,j):a(g,k,[o,o],i,j)}if("y"==l){var o=/[\/>\]})\w]/.test(b(g,-2));if(!o&&(o=g.eat(/[(\[{<\^'"!~\/]/)))return"["==o?a(g,k,["]","]"],i,j):"{"==o?a(g,k,["}","}"],i,j):"<"==o?a(g,k,[">",">"],i,j):"("==o?a(g,k,[")",")"],i,j):a(g,k,[o,o],i,j)}if("t"==l){var o=/[\/>\]})\w]/.test(b(g,-2));if(!o&&(o=g.eat("r"),o&&(o=g.eat(/[(\[{<\^'"!~\/]/))))return"["==o?a(g,k,["]","]"],i,j):"{"==o?a(g,k,["}","}"],i,j):"<"==o?a(g,k,[">",">"],i,j):"("==o?a(g,k,[")",")"],i,j):a(g,k,[o,o],i,j)}if("`"==l)return a(g,k,[l],"variable-2");if("/"==l)return/~\s*$/.test(c(g))?a(g,k,[l],i,j):"operator";if("$"==l){var m=g.pos;if(g.eatWhile(/\d/)||g.eat("{")&&g.eatWhile(/\d/)&&g.eat("}"))return"variable-2";g.pos=m}if(/[$@%]/.test(l)){var m=g.pos;if(g.eat("^")&&g.eat(/[A-Z]/)||!/[@$%&]/.test(b(g,-2))&&g.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var o=g.current();if(h[o])return"variable-2"}g.pos=m}if(/[$@%&]/.test(l)&&(g.eatWhile(/[\w$\[\]]/)||g.eat("{")&&g.eatWhile(/[\w$\[\]]/)&&g.eat("}"))){var o=g.current();return h[o]?"variable-2":"variable"}if("#"==l&&"$"!=b(g,-2))return g.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(l)){var m=g.pos;if(g.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),h[g.current()])return"operator";g.pos=m}if("_"==l&&1==g.pos){if("_END__"==d(g,6))return a(g,k,["\x00"],"comment");if("_DATA__"==d(g,7))return a(g,k,["\x00"],"variable-2");if("_C__"==d(g,7))return a(g,k,["\x00"],"string")}if(/\w/.test(l)){var m=g.pos;if("{"==b(g,-2)&&("}"==b(g,0)||g.eatWhile(/\w/)&&"}"==b(g,0)))return"string";g.pos=m}if(/[A-Z]/.test(l)){var p=b(g,-2),m=g.pos;if(g.eatWhile(/[A-Z_]/),!/[\da-z]/.test(b(g,0))){var o=h[g.current()];return o?(o[1]&&(o=o[0]),":"!=p?1==o?"keyword":2==o?"def":3==o?"atom":4==o?"operator":5==o?"variable-2":"meta":"meta"):"meta"}g.pos=m}if(/[a-zA-Z_]/.test(l)){var p=b(g,-2);g.eatWhile(/\w/);var o=h[g.current()];return o?(o[1]&&(o=o[0]),":"!=p?1==o?"keyword":2==o?"def":3==o?"atom":4==o?"operator":5==o?"variable-2":"meta":"meta"):"meta"}return null}var h={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},i="string-2",j=/[goseximacplud]/;return{startState:function(){return{tokenize:g,chain:null,style:null,tail:null}},token:function(a,b){return(b.tokenize||g)(a,b)},lineComment:"#"}}),a.registerHelper("wordChars","perl",/[\w$]/),a.defineMIME("text/x-perl","perl")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/php/php.js b/media/editors/codemirror/mode/php/php.js +index e112d91..1c62eb4 100644 +--- a/media/editors/codemirror/mode/php/php.js ++++ b/media/editors/codemirror/mode/php/php.js +@@ -94,6 +94,7 @@ + helperType: "php", + keywords: keywords(phpKeywords), + blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"), ++ defKeywords: keywords("class function interface namespace trait"), + atoms: keywords(phpAtoms), + builtin: keywords(phpBuiltin), + multiLineStrings: true, +diff --git a/media/editors/codemirror/mode/php/php.min.js b/media/editors/codemirror/mode/php/php.min.js +index 9e87aa4..bedd3d6 100644 +--- a/media/editors/codemirror/mode/php/php.min.js ++++ b/media/editors/codemirror/mode/php/php.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},_=e.split(" "),r=0;r<_.length;++r)t[_[r]]=!0;return t}function _(e,t){return 0==e.length?r(t):function(s,i){for(var l=e[0],n=0;n\w/,!1)&&(t.tokenize=_([[["->",null]],[[/[\w]+/,"variable"]]],r)),"variable-2";for(var s=!1;!e.eol()&&(s||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!s&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}s="\\"==e.next()&&!s}return"string"}var i="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",l="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",n="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[i,l,n].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var a={name:"clike",helperType:"php",keywords:t(i),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),atoms:t(l),builtin:t(n),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){if(e.match(/<",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,_){function r(e,t){var _=t.curMode==i;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),_)return _&&null==t.php.tokenize&&e.match("?>")?(t.curMode=s,t.curState=t.html,"meta"):i.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=i,t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var r="string"}else if(t.pending&&e.pos/.test(n)?l[0]:{end:e.pos,style:r},e.backUp(n.length-a)),r}var s=e.getMode(t,"text/html"),i=e.getMode(t,a);return{startState:function(){var t=e.startState(s),r=e.startState(i);return{html:t,php:r,curMode:_.startOpen?i:s,curState:_.startOpen?r:t,pending:null}},copyState:function(t){var _,r=t.html,l=e.copyState(s,r),n=t.php,a=e.copyState(i,n);return _=t.curMode==s?l:a,{html:l,php:a,curMode:t.curMode,curState:_,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=i&&/^\s*<\//.test(t)||e.curMode==i&&/^\?>/.test(t)?s.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",a)}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d\w/,!1)&&(b.tokenize=c([[["->",null]],[[/[\w]+/,"variable"]]],d)),"variable-2";for(var e=!1;!a.eol()&&(e||!a.match("{$",!1)&&!a.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!e&&a.match(d)){b.tokenize=null,b.tokStack.pop(),b.tokStack.pop();break}e="\\"==a.next()&&!e}return"string"}var f="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",g="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",h="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";a.registerHelper("hintWords","php",[f,g,h].join(" ").split(" ")),a.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:b(f),blockKeywords:b("catch do else elseif for foreach if switch try while finally"),defKeywords:b("class function interface namespace trait"),atoms:b(g),builtin:b(h),multiLineStrings:!0,hooks:{$:function(a){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,b){if(a.match(/<",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1},'"':function(a,b){return(b.tokStack||(b.tokStack=[])).push('"',0),b.tokenize=d('"'),"string"},"{":function(a,b){return b.tokStack&&b.tokStack.length&&b.tokStack[b.tokStack.length-1]++,!1},"}":function(a,b){return b.tokStack&&b.tokStack.length>0&&!--b.tokStack[b.tokStack.length-1]&&(b.tokenize=d(b.tokStack[b.tokStack.length-2])),!1}}};a.defineMode("php",function(b,c){function d(a,b){var c=b.curMode==f;if(a.sol()&&b.pending&&'"'!=b.pending&&"'"!=b.pending&&(b.pending=null),c)return c&&null==b.php.tokenize&&a.match("?>")?(b.curMode=e,b.curState=b.html,"meta"):f.token(a,b.curState);if(a.match(/^<\?\w*/))return b.curMode=f,b.curState=b.php,"meta";if('"'==b.pending||"'"==b.pending){for(;!a.eol()&&a.next()!=b.pending;);var d="string"}else if(b.pending&&a.pos/.test(h)?b.pending=g[0]:b.pending={end:a.pos,style:d},a.backUp(h.length-i)),d}var e=a.getMode(b,"text/html"),f=a.getMode(b,i);return{startState:function(){var b=a.startState(e),d=a.startState(f);return{html:b,php:d,curMode:c.startOpen?f:e,curState:c.startOpen?d:b,pending:null}},copyState:function(b){var c,d=b.html,g=a.copyState(e,d),h=b.php,i=a.copyState(f,h);return c=b.curMode==e?g:i,{html:g,php:i,curMode:b.curMode,curState:c,pending:b.pending}},token:d,indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?e.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",i)}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/php/test.js b/media/editors/codemirror/mode/php/test.js +deleted file mode 100644 +index e2ecefc..0000000 +--- a/media/editors/codemirror/mode/php/test.js ++++ /dev/null +@@ -1,154 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({indentUnit: 2}, "php"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- +- MT('simple_test', +- '[meta ]'); +- +- MT('variable_interpolation_non_alphanumeric', +- '[meta $/$\\$}$\\\"$:$;$?$|$[[$]]$+$=aaa"]', +- '[meta ?>]'); +- +- MT('variable_interpolation_digits', +- '[meta ]'); +- +- MT('variable_interpolation_simple_syntax_1', +- '[meta ]'); +- +- MT('variable_interpolation_simple_syntax_2', +- '[meta ]'); +- +- MT('variable_interpolation_simple_syntax_3', +- '[meta [variable aaaaa][string .aaaaaa"];', +- '[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];', +- '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];', +- '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];', +- '[meta ?>]'); +- +- MT('variable_interpolation_escaping', +- '[meta aaa.aaa"];', +- '[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];', +- '[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];', +- '[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];', +- '[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];', +- '[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];', +- '[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];', +- '[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];', +- '[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];', +- '[meta ?>]'); +- +- MT('variable_interpolation_complex_syntax_1', +- '[meta aaa.aaa"];', +- '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];', +- '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][[',' [number 42]',']]}[string ->aaa.aaa"];', +- '[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa'); +- +- MT('variable_interpolation_complex_syntax_2', +- '[meta } $aaaaaa.aaa"];', +- '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];', +- '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];'); +- +- +- function build_recursive_monsters(nt, t, n){ +- var monsters = [t]; +- for (var i = 1; i <= n; ++i) +- monsters[i] = nt.join(monsters[i - 1]); +- return monsters; +- } +- +- var m1 = build_recursive_monsters( +- ['[string "][variable-2 $]{[variable aaa] [operator +] ', '}[string "]'], +- '[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]', +- 10 +- ); +- +- MT('variable_interpolation_complex_syntax_3_1', +- '[meta ]'); +- +- var m2 = build_recursive_monsters( +- ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', '}[string .a"]'], +- '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', +- 5 +- ); +- +- MT('variable_interpolation_complex_syntax_3_2', +- '[meta ]'); +- +- function build_recursive_monsters_2(mf1, mf2, nt, t, n){ +- var monsters = [t]; +- for (var i = 1; i <= n; ++i) +- monsters[i] = nt[0] + mf1[i - 1] + nt[1] + mf2[i - 1] + nt[2] + monsters[i - 1] + nt[3]; +- return monsters; +- } +- +- var m3 = build_recursive_monsters_2( +- m1, +- m2, +- ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', ' [operator +] ', '}[string .a"]'], +- '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', +- 4 +- ); +- +- MT('variable_interpolation_complex_syntax_3_3', +- '[meta ]'); +- +- MT("variable_interpolation_heredoc", +- "[meta =i;++i)o[i]=a.join(o[i-1]);return o}function r(a,e,r,o,i){for(var t=[o],n=1;i>=n;++n)t[n]=r[0]+a[n-1]+r[1]+e[n-1]+r[2]+t[n-1]+r[3];return t}var o=CodeMirror.getMode({indentUnit:2},"php");a("simple_test",'[meta ]'),a("variable_interpolation_non_alphanumeric","[meta $/$\\$}$\\"$:$;$?$|$[[$]]$+$=aaa"]',"[meta ?>]"),a("variable_interpolation_digits","[meta ]"),a("variable_interpolation_simple_syntax_1","[meta ]"),a("variable_interpolation_simple_syntax_2","[meta ]"),a("variable_interpolation_simple_syntax_3","[meta [variable aaaaa][string .aaaaaa"];','[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];','[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];','[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];',"[meta ?>]"),a("variable_interpolation_escaping","[meta aaa.aaa"];','[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];','[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];','[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];','[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];','[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];','[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];','[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];','[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];',"[meta ?>]"),a("variable_interpolation_complex_syntax_1","[meta aaa.aaa"];','[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];','[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][['," [number 42]",']]}[string ->aaa.aaa"];','[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa'),a("variable_interpolation_complex_syntax_2","[meta } $aaaaaa.aaa"];','[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];','[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];');var i=e(['[string "][variable-2 $]{[variable aaa] [operator +] ','}[string "]'],'[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]',10);a("variable_interpolation_complex_syntax_3_1","[meta ]");var t=e(['[string "a][variable-2 $]{[variable aaa] [operator +] '," [operator +] ",'}[string .a"]'],'[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]',5);a("variable_interpolation_complex_syntax_3_2","[meta ]");var n=r(i,t,['[string "a][variable-2 $]{[variable aaa] [operator +] '," [operator +] "," [operator +] ",'}[string .a"]'],'[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]',4);a("variable_interpolation_complex_syntax_3_3","[meta ]"),a("variable_interpolation_heredoc","[meta =&?:\/!|]/;return{startState:function(){return{tokenize:I,startOfLine:!0}},token:function(e,O){if(e.eatSpace())return null;var T=O.tokenize(e,O);return T}}}),function(){function O(e){for(var O={},T=e.split(" "),E=0;E=&?:\/!|]/;return{startState:function(){return{tokenize:f,startOfLine:!0}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c}}}),function(){function b(a){for(var b={},c=a.split(" "),d=0;d.*/,!1),s=e.match(/(\s+)?[\w:_]+(\s+)?{/,!1),c=e.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/,!1),u=e.next();if("$"===u)return e.match(o)?t.continueString?"variable-2":"variable":"error";if(t.continueString)return e.backUp(1),n(e,t);if(t.inDefinition){if(e.match(/(\s+)?[\w:_]+(\s+)?/))return"def";e.match(/\s+{/),t.inDefinition=!1}return t.inInclude?(e.match(/(\s+)?\S+(\s+)?/),t.inInclude=!1,"def"):e.match(/(\s+)?\w+\(/)?(e.backUp(1),"def"):r?(e.match(/(\s+)?\w+/),"tag"):a&&i.hasOwnProperty(a)?(e.backUp(1),e.match(/[\w]+/),e.match(/\s+\S+\s+{/,!1)&&(t.inDefinition=!0),"include"==a&&(t.inInclude=!0),i[a]):/(^|\s+)[A-Z][\w:_]+/.test(a)?(e.backUp(1),e.match(/(^|\s+)[A-Z][\w:_]+/),"def"):s?(e.match(/(\s+)?[\w:_]+/),"def"):c?(e.match(/(\s+)?[@]{1,2}/),"special"):"#"==u?(e.skipToEnd(),"comment"):"'"==u||'"'==u?(t.pending=u,n(e,t)):"{"==u||"}"==u?"bracket":"/"==u?(e.match(/.*?\//),"variable-3"):u.match(/[0-9]/)?(e.eatWhile(/[0-9]+/),"number"):"="==u?(">"==e.peek()&&e.next(),"operator"):(e.eatWhile(/[\w-]/),null)}var i={},o=/({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;return e("keyword","class define site node include import inherits"),e("keyword","case if else in and elsif default or"),e("atom","false true running present absent file directory undef"),e("builtin","action augeas burst chain computer cron destination dport exec file filebucket group host icmp iniface interface jump k5login limit log_level log_prefix macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod name notify outiface package proto reject resources router schedule scheduled_task selboolean selmodule service source sport ssh_authorized_key sshkey stage state table tidy todest toports tosource user vlan yumrepo zfs zone zpool"),{startState:function(){var e={};return e.inDefinition=!1,e.inInclude=!1,e.continueString=!1,e.pending=!1,e},token:function(e,n){return e.eatSpace()?null:t(e,n)}}}),e.defineMIME("text/x-puppet","puppet")}); +\ 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("puppet",function(){function a(a,b){for(var c=b.split(" "),e=0;e.*/,!1),h=a.match(/(\s+)?[\w:_]+(\s+)?{/,!1),i=a.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/,!1),j=a.next();if("$"===j)return a.match(e)?c.continueString?"variable-2":"variable":"error";if(c.continueString)return a.backUp(1),b(a,c);if(c.inDefinition){if(a.match(/(\s+)?[\w:_]+(\s+)?/))return"def";a.match(/\s+{/),c.inDefinition=!1}return c.inInclude?(a.match(/(\s+)?\S+(\s+)?/),c.inInclude=!1,"def"):a.match(/(\s+)?\w+\(/)?(a.backUp(1),"def"):g?(a.match(/(\s+)?\w+/),"tag"):f&&d.hasOwnProperty(f)?(a.backUp(1),a.match(/[\w]+/),a.match(/\s+\S+\s+{/,!1)&&(c.inDefinition=!0),"include"==f&&(c.inInclude=!0),d[f]):/(^|\s+)[A-Z][\w:_]+/.test(f)?(a.backUp(1),a.match(/(^|\s+)[A-Z][\w:_]+/),"def"):h?(a.match(/(\s+)?[\w:_]+/),"def"):i?(a.match(/(\s+)?[@]{1,2}/),"special"):"#"==j?(a.skipToEnd(),"comment"):"'"==j||'"'==j?(c.pending=j,b(a,c)):"{"==j||"}"==j?"bracket":"/"==j?(a.match(/.*?\//),"variable-3"):j.match(/[0-9]/)?(a.eatWhile(/[0-9]+/),"number"):"="==j?(">"==a.peek()&&a.next(),"operator"):(a.eatWhile(/[\w-]/),null)}var d={},e=/({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;return a("keyword","class define site node include import inherits"),a("keyword","case if else in and elsif default or"),a("atom","false true running present absent file directory undef"),a("builtin","action augeas burst chain computer cron destination dport exec file filebucket group host icmp iniface interface jump k5login limit log_level log_prefix macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod name notify outiface package proto reject resources router schedule scheduled_task selboolean selmodule service source sport ssh_authorized_key sshkey stage state table tidy todest toports tosource user vlan yumrepo zfs zone zpool"),{startState:function(){var a={};return a.inDefinition=!1,a.inInclude=!1,a.continueString=!1,a.pending=!1,a},token:function(a,b){return a.eatSpace()?null:c(a,b)}}}),a.defineMIME("text/x-puppet","puppet")}); +\ 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 98c0409..cdb58bb 100644 +--- a/media/editors/codemirror/mode/python/python.js ++++ b/media/editors/codemirror/mode/python/python.js +@@ -162,15 +162,13 @@ + if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) + return null; + +- if (stream.match(doubleOperators) +- || stream.match(singleOperators) +- || stream.match(wordOperators)) ++ if (stream.match(doubleOperators) || stream.match(singleOperators)) + return "operator"; + + if (stream.match(singleDelimiters)) + return null; + +- if (stream.match(keywords)) ++ if (stream.match(keywords) || stream.match(wordOperators)) + return "keyword"; + + if (stream.match(builtins)) +@@ -339,6 +337,7 @@ + return scope.offset; + }, + ++ closeBrackets: {triples: "'\""}, + lineComment: "#", + fold: "indent" + }; +diff --git a/media/editors/codemirror/mode/python/python.min.js b/media/editors/codemirror/mode/python/python.min.js +index 76d5058..c8bed71 100644 +--- a/media/editors/codemirror/mode/python/python.min.js ++++ b/media/editors/codemirror/mode/python/python.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e){return e.scopes[e.scopes.length-1]}var r=t(["and","or","not","is"]),i=["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"],a=["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__"],o={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},s={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};e.registerHelper("hintWords","python",i.concat(a)),e.defineMode("python",function(l,c){function p(e,t){if(e.sol()&&"py"==n(t).type){var r=n(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?d(e,t,"py"):r>i&&m(e,t)&&(t.errorToken=!0),null}var a=u(e,t);return r>0&&m(e,t)&&(a+=" "+h),a}return u(e,t)}function u(e,t){if(e.eatSpace())return null;var n=e.peek();if("#"==n)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var a=!1;if(e.match(/^0x[0-9a-f]+/i)&&(a=!0),e.match(/^0b[01]+/i)&&(a=!0),e.match(/^0o[0-7]+/i)&&(a=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),a=!0),e.match(/^0(?![\dx])/i)&&(a=!0),a)return e.eat(/L/i),"number"}return e.match(R)?(t.tokenize=f(e.current()),t.tokenize(e,t)):e.match(x)||e.match(v)?null:e.match(g)||e.match(k)||e.match(r)?"operator":e.match(b)?null:e.match(S)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(w)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),h)}function f(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=p,r;t.eat(/['"]/)}if(n){if(c.singleLineStringErrors)return h;i.tokenize=p}return r}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function d(e,t,r){var i=0,a=null;if("py"==r)for(;"py"!=n(t).type;)t.scopes.pop();i=n(t).offset+("py"==r?l.indentUnit:E),"py"==r||e.match(/^(\s|#.*)*$/,!1)||(a=e.column()+1),t.scopes.push({offset:i,type:r,align:a})}function m(e,t){for(var r=e.indentation();n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function y(e,t){var r=t.tokenize(e,t),i=e.current();if("."==i)return r=e.match(w,!1)?null:h,null==r&&"meta"==t.lastStyle&&(r="meta"),r;if("@"==i)return c.version&&3==parseInt(c.version,10)?e.match(w,!1)?"meta":"operator":e.match(w,!1)?"meta":h;"variable"!=r&&"builtin"!=r||"meta"!=t.lastStyle||(r="meta"),("pass"==i||"return"==i)&&(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||d(e,t,"py");var a=1==i.length?"[({".indexOf(i):-1;if(-1!=a&&d(e,t,"])}".slice(a,a+1)),a="])}".indexOf(i),-1!=a){if(n(t).type!=i)return h;t.scopes.pop()}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var h="error",b=c.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),g=c.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),v=c.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),x=c.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(c.version&&3==parseInt(c.version,10))var k=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"),w=c.identifiers||new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*");else var k=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),w=c.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*");var E=c.hangingIndent||l.indentUnit,_=i,z=a;if(void 0!=c.extra_keywords&&(_=_.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(z=z.concat(c.extra_builtins)),c.version&&3==parseInt(c.version,10)){_=_.concat(s.keywords),z=z.concat(s.builtins);var R=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{_=_.concat(o.keywords),z=z.concat(o.builtins);var R=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var S=t(_),T=t(z),I={startState:function(e){return{tokenize:p,scopes:[{offset:e||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=y(e,t);t.lastStyle=r;var i=e.current();return i&&r&&(t.lastToken=i),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+h:r},indent:function(t,r){if(t.tokenize!=p)return t.tokenize.isString?e.Pass:0;var i=n(t),a=r&&r.charAt(0)==i.type;return null!=i.align?i.align-(a?1:0):a&&t.scopes.length>1?t.scopes[t.scopes.length-2].offset:i.offset},lineComment:"#",fold:"indent"};return I}),e.defineMIME("text/x-python","python");var l=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:l("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}); +\ 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){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__"],g={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},h={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};a.registerHelper("hintWords","python",e.concat(f)),a.defineMode("python",function(i,j){function k(a,b){if(a.sol()&&"py"==c(b).type){var d=c(b).offset;if(a.eatSpace()){var e=a.indentation();return e>d?n(a,b,"py"):d>e&&o(a,b)&&(b.errorToken=!0),null}var f=l(a,b);return d>0&&o(a,b)&&(f+=" "+q),f}return l(a,b)}function l(a,b){if(a.eatSpace())return null;var c=a.peek();if("#"==c)return a.skipToEnd(),"comment";if(a.match(/^[0-9\.]/,!1)){var e=!1;if(a.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(e=!0),a.match(/^\d+\.\d*/)&&(e=!0),a.match(/^\.\d+/)&&(e=!0),e)return a.eat(/J/i),"number";var f=!1;if(a.match(/^0x[0-9a-f]+/i)&&(f=!0),a.match(/^0b[01]+/i)&&(f=!0),a.match(/^0o[0-7]+/i)&&(f=!0),a.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(a.eat(/J/i),f=!0),a.match(/^0(?![\dx])/i)&&(f=!0),f)return a.eat(/L/i),"number"}return a.match(A)?(b.tokenize=m(a.current()),b.tokenize(a,b)):a.match(u)||a.match(t)?null:a.match(s)||a.match(v)?"operator":a.match(r)?null:a.match(B)||a.match(d)?"keyword":a.match(C)?"builtin":a.match(/^(self|cls)\b/)?"variable-2":a.match(w)?"def"==b.lastToken||"class"==b.lastToken?"def":"variable":(a.next(),q)}function m(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=k,d;b.eat(/['"]/)}if(c){if(j.singleLineStringErrors)return q;e.tokenize=k}return d}for(;"rub".indexOf(a.charAt(0).toLowerCase())>=0;)a=a.substr(1);var c=1==a.length,d="string";return b.isString=!0,b}function n(a,b,d){var e=0,f=null;if("py"==d)for(;"py"!=c(b).type;)b.scopes.pop();e=c(b).offset+("py"==d?i.indentUnit:x),"py"==d||a.match(/^(\s|#.*)*$/,!1)||(f=a.column()+1),b.scopes.push({offset:e,type:d,align:f})}function o(a,b){for(var d=a.indentation();c(b).offset>d;){if("py"!=c(b).type)return!0;b.scopes.pop()}return c(b).offset!=d}function p(a,b){var d=b.tokenize(a,b),e=a.current();if("."==e)return d=a.match(w,!1)?null:q,null==d&&"meta"==b.lastStyle&&(d="meta"),d;if("@"==e)return j.version&&3==parseInt(j.version,10)?a.match(w,!1)?"meta":"operator":a.match(w,!1)?"meta":q;"variable"!=d&&"builtin"!=d||"meta"!=b.lastStyle||(d="meta"),("pass"==e||"return"==e)&&(b.dedent+=1),"lambda"==e&&(b.lambda=!0),":"!=e||b.lambda||"py"!=c(b).type||n(a,b,"py");var f=1==e.length?"[({".indexOf(e):-1;if(-1!=f&&n(a,b,"])}".slice(f,f+1)),f="])}".indexOf(e),-1!=f){if(c(b).type!=e)return q;b.scopes.pop()}return b.dedent>0&&a.eol()&&"py"==c(b).type&&(b.scopes.length>1&&b.scopes.pop(),b.dedent-=1),d}var q="error",r=j.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),s=j.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),t=j.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),u=j.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(j.version&&3==parseInt(j.version,10))var v=j.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"),w=j.identifiers||new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*");else var v=j.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),w=j.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*");var x=j.hangingIndent||i.indentUnit,y=e,z=f;if(void 0!=j.extra_keywords&&(y=y.concat(j.extra_keywords)),void 0!=j.extra_builtins&&(z=z.concat(j.extra_builtins)),j.version&&3==parseInt(j.version,10)){y=y.concat(h.keywords),z=z.concat(h.builtins);var A=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{y=y.concat(g.keywords),z=z.concat(g.builtins);var A=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var B=b(y),C=b(z),D={startState:function(a){return{tokenize:k,scopes:[{offset:a||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=b.errorToken;c&&(b.errorToken=!1);var d=p(a,b);b.lastStyle=d;var e=a.current();return e&&d&&(b.lastToken=e),a.eol()&&b.lambda&&(b.lambda=!1),c?d+" "+q:d},indent:function(b,d){if(b.tokenize!=k)return b.tokenize.isString?a.Pass:0;var e=c(b),f=d&&d.charAt(0)==e.type;return null!=e.align?e.align-(f?1:0):f&&b.scopes.length>1?b.scopes[b.scopes.length-2].offset:e.offset},closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"};return D}),a.defineMIME("text/x-python","python");var i=function(a){return a.split(" ")};a.defineMIME("text/x-cython",{name:"python",extra_keywords:i("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/q/q.min.js b/media/editors/codemirror/mode/q/q.min.js +index 9703566..2395a93 100644 +--- a/media/editors/codemirror/mode/q/q.min.js ++++ b/media/editors/codemirror/mode/q/q.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("q",function(e){function t(e){return new RegExp("^("+e.join("|")+")$")}function n(e,t){var r=e.sol(),s=e.next();if(l=null,r){if("/"==s)return(t.tokenize=o)(e,t);if("\\"==s)return e.eol()||/\s/.test(e.peek())?(e.skipToEnd(),/^\\\s*$/.test(e.current())?(t.tokenize=i)(e,t):t.tokenize=n,"comment"):(t.tokenize=n,"builtin")}if(/\s/.test(s))return"/"==e.peek()?(e.skipToEnd(),"comment"):"whitespace";if('"'==s)return(t.tokenize=c)(e,t);if("`"==s)return e.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";if("."==s&&/\d/.test(e.peek())||/\d/.test(s)){var a=null;return e.backUp(1),e.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)||e.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)||e.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)||e.match(/^\d+[ptuv]{1}/)?a="temporal":(e.match(/^0[NwW]{1}/)||e.match(/^0x[\d|a-f|A-F]*/)||e.match(/^[0|1]+[b]{1}/)||e.match(/^\d+[chijn]{1}/)||e.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))&&(a="number"),!a||(s=e.peek())&&!m.test(s)?(e.next(),"error"):a}return/[A-Z|a-z]|\./.test(s)?(e.eatWhile(/[A-Z|a-z|\.|_|\d]/),u.test(e.current())?"keyword":"variable"):/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(s)?null:/[{}\(\[\]\)]/.test(s)?null:"error"}function o(e,t){return e.skipToEnd(),/\/\s*$/.test(e.current())?(t.tokenize=r)(e,t):t.tokenize=n,"comment"}function r(e,t){var o=e.sol()&&"\\"==e.peek();return e.skipToEnd(),o&&/^\\\s*$/.test(e.current())&&(t.tokenize=n),"comment"}function i(e){return e.skipToEnd(),"comment"}function c(e,t){for(var o,r=!1,i=!1;o=e.next();){if('"'==o&&!r){i=!0;break}r=!r&&"\\"==o}return i&&(t.tokenize=n),"string"}function s(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function a(e){e.indent=e.context.indent,e.context=e.context.prev}var l,d=e.indentUnit,u=t(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),m=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation());var n=t.tokenize(e,t);if("comment"!=n&&t.context&&null==t.context.align&&"pattern"!=t.context.type&&(t.context.align=!0),"("==l)s(t,")",e.column());else if("["==l)s(t,"]",e.column());else if("{"==l)s(t,"}",e.column());else if(/[\]\}\)]/.test(l)){for(;t.context&&"pattern"==t.context.type;)a(t);t.context&&l==t.context.type&&a(t)}else"."==l&&t.context&&"pattern"==t.context.type?a(t):/atom|string|variable/.test(n)&&t.context&&(/[\}\]]/.test(t.context.type)?s(t,"pattern",e.column()):"pattern"!=t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return n},indent:function(e,t){var n=t&&t.charAt(0),o=e.context;if(/[\]\}]/.test(n))for(;o&&"pattern"==o.type;)o=o.prev;var r=o&&n==o.type;return o?"pattern"==o.type?o.col:o.align?o.col+(r?0:1):o.indent+(r?0:d):0}}}),e.defineMIME("text/x-q","q")}); +\ 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("q",function(a){function b(a){return new RegExp("^("+a.join("|")+")$")}function c(a,b){var e=a.sol(),h=a.next();if(j=null,e){if("/"==h)return(b.tokenize=d)(a,b);if("\\"==h)return a.eol()||/\s/.test(a.peek())?(a.skipToEnd(),/^\\\s*$/.test(a.current())?(b.tokenize=f)(a,b):b.tokenize=c,"comment"):(b.tokenize=c,"builtin")}if(/\s/.test(h))return"/"==a.peek()?(a.skipToEnd(),"comment"):"whitespace";if('"'==h)return(b.tokenize=g)(a,b);if("`"==h)return a.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";if("."==h&&/\d/.test(a.peek())||/\d/.test(h)){var i=null;return a.backUp(1),a.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)||a.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)||a.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)||a.match(/^\d+[ptuv]{1}/)?i="temporal":(a.match(/^0[NwW]{1}/)||a.match(/^0x[\d|a-f|A-F]*/)||a.match(/^[0|1]+[b]{1}/)||a.match(/^\d+[chijn]{1}/)||a.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))&&(i="number"),!i||(h=a.peek())&&!m.test(h)?(a.next(),"error"):i}return/[A-Z|a-z]|\./.test(h)?(a.eatWhile(/[A-Z|a-z|\.|_|\d]/),l.test(a.current())?"keyword":"variable"):/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(h)?null:/[{}\(\[\]\)]/.test(h)?null:"error"}function d(a,b){return a.skipToEnd(),/\/\s*$/.test(a.current())?(b.tokenize=e)(a,b):b.tokenize=c,"comment"}function e(a,b){var d=a.sol()&&"\\"==a.peek();return a.skipToEnd(),d&&/^\\\s*$/.test(a.current())&&(b.tokenize=c),"comment"}function f(a){return a.skipToEnd(),"comment"}function g(a,b){for(var d,e=!1,f=!1;d=a.next();){if('"'==d&&!e){f=!0;break}e=!e&&"\\"==d}return f&&(b.tokenize=c),"string"}function h(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function i(a){a.indent=a.context.indent,a.context=a.context.prev}var j,k=a.indentUnit,l=b(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),m=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;return{startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(a,b){a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation());var c=b.tokenize(a,b);if("comment"!=c&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==j)h(b,")",a.column());else if("["==j)h(b,"]",a.column());else if("{"==j)h(b,"}",a.column());else if(/[\]\}\)]/.test(j)){for(;b.context&&"pattern"==b.context.type;)i(b);b.context&&j==b.context.type&&i(b)}else"."==j&&b.context&&"pattern"==b.context.type?i(b):/atom|string|variable/.test(c)&&b.context&&(/[\}\]]/.test(b.context.type)?h(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return c},indent:function(a,b){var c=b&&b.charAt(0),d=a.context;if(/[\]\}]/.test(c))for(;d&&"pattern"==d.type;)d=d.prev;var e=d&&c==d.type;return d?"pattern"==d.type?d.col:d.align?d.col+(e?0:1):d.indent+(e?0:k):0}}}),a.defineMIME("text/x-q","q")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/r/r.min.js b/media/editors/codemirror/mode/r/r.min.js +index b2eb957..f4fe531 100644 +--- a/media/editors/codemirror/mode/r/r.min.js ++++ b/media/editors/codemirror/mode/r/r.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),n={},r=0;r=!&|~$:]/;return{startState:function(){return{tokenize:n,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);"comment"!=n&&null==t.ctx.align&&(t.ctx.align=!0);var r=t.ctx.type;return";"!=o&&"{"!=o&&"}"!=o||"block"!=r||a(t),"{"==o?i(t,"}",e):"("==o?(i(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==o?i(t,"]",e):"block"==o?i(t,"block",e):o==r&&a(t),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(t,r){if(t.tokenize!=n)return 0;var i=r&&r.charAt(0),a=t.ctx,o=i==a.type;return"block"==a.type?a.indent+("{"==i?0:e.indentUnit):a.align?a.column+(o?0:1):a.indent+(o?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}); +\ 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("r",function(a){function b(a){for(var b=a.split(" "),c={},d=0;d=!&|~$:]/;return{startState:function(){return{tokenize:c,ctx:{type:"top",indent:-a.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(a,b){if(a.sol()&&(null==b.ctx.align&&(b.ctx.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);"comment"!=c&&null==b.ctx.align&&(b.ctx.align=!0);var d=b.ctx.type;return";"!=g&&"{"!=g&&"}"!=g||"block"!=d||f(b),"{"==g?e(b,"}",a):"("==g?(e(b,")",a),b.afterIdent&&(b.ctx.argList=!0)):"["==g?e(b,"]",a):"block"==g?e(b,"block",a):g==d&&f(b),b.afterIdent="variable"==c||"keyword"==c,c},indent:function(b,d){if(b.tokenize!=c)return 0;var e=d&&d.charAt(0),f=b.ctx,g=e==f.type;return"block"==f.type?f.indent+("{"==e?0:a.indentUnit):f.align?f.column+(g?0:1):f.indent+(g?0:a.indentUnit)},lineComment:"#"}}),a.defineMIME("text/x-rsrc","r")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/rpm/rpm.min.js b/media/editors/codemirror/mode/rpm/rpm.min.js +index 6dd1814..2c77060 100644 +--- a/media/editors/codemirror/mode/rpm/rpm.min.js ++++ b/media/editors/codemirror/mode/rpm/rpm.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("rpm-changes",function(){var e=/^-+$/,r=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /,t=/^[\w+.-]+@[\w.-]+/;return{token:function(n){if(n.sol()){if(n.match(e))return"tag";if(n.match(r))return"tag"}return n.match(t)?"string":(n.next(),null)}}}),e.defineMIME("text/x-rpm-changes","rpm-changes"),e.defineMode("rpm-spec",function(){var e=/^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/,r=/^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/,t=/^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/,n=/^%(ifnarch|ifarch|if)/,i=/^%(else|endif)/,o=/^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;return{startState:function(){return{controlFlow:!1,macroParameters:!1,section:!1}},token:function(c,a){var u=c.peek();if("#"==u)return c.skipToEnd(),"comment";if(c.sol()){if(c.match(r))return"preamble";if(c.match(t))return"section"}if(c.match(/^\$\w+/))return"def";if(c.match(/^\$\{\w+\}/))return"def";if(c.match(i))return"keyword";if(c.match(n))return a.controlFlow=!0,"keyword";if(a.controlFlow){if(c.match(o))return"operator";if(c.match(/^(\d+)/))return"number";c.eol()&&(a.controlFlow=!1)}if(c.match(e))return"number";if(c.match(/^%[\w]+/))return c.match(/^\(/)&&(a.macroParameters=!0),"macro";if(a.macroParameters){if(c.match(/^\d+/))return"number";if(c.match(/^\)/))return a.macroParameters=!1,"macro"}return c.match(/^%\{\??[\w \-]+\}/)?"macro":(c.next(),null)}}}),e.defineMIME("text/x-rpm-spec","rpm-spec")}); +\ 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("rpm-changes",function(){var a=/^-+$/,b=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /,c=/^[\w+.-]+@[\w.-]+/;return{token:function(d){if(d.sol()){if(d.match(a))return"tag";if(d.match(b))return"tag"}return d.match(c)?"string":(d.next(),null)}}}),a.defineMIME("text/x-rpm-changes","rpm-changes"),a.defineMode("rpm-spec",function(){var a=/^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/,b=/^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/,c=/^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/,d=/^%(ifnarch|ifarch|if)/,e=/^%(else|endif)/,f=/^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;return{startState:function(){return{controlFlow:!1,macroParameters:!1,section:!1}},token:function(g,h){var i=g.peek();if("#"==i)return g.skipToEnd(),"comment";if(g.sol()){if(g.match(b))return"preamble";if(g.match(c))return"section"}if(g.match(/^\$\w+/))return"def";if(g.match(/^\$\{\w+\}/))return"def";if(g.match(e))return"keyword";if(g.match(d))return h.controlFlow=!0,"keyword";if(h.controlFlow){if(g.match(f))return"operator";if(g.match(/^(\d+)/))return"number";g.eol()&&(h.controlFlow=!1)}if(g.match(a))return"number";if(g.match(/^%[\w]+/))return g.match(/^\(/)&&(h.macroParameters=!0),"macro";if(h.macroParameters){if(g.match(/^\d+/))return"number";if(g.match(/^\)/))return h.macroParameters=!1,"macro"}return g.match(/^%\{\??[\w \-]+\}/)?"macro":(g.next(),null)}}}),a.defineMIME("text/x-rpm-spec","rpm-spec")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/rst/rst.min.js b/media/editors/codemirror/mode/rst/rst.min.js +index ca19d9a..4dd8fb8 100644 +--- a/media/editors/codemirror/mode/rst/rst.min.js ++++ b/media/editors/codemirror/mode/rst/rst.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../python/python"),require("../stex/stex"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../python/python","../stex/stex","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("rst",function(t,a){var c=/^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/,n=/^\*[^\*\s](?:[^\*]*[^\*\s])?\*/,r=/^``[^`\s](?:[^`]*[^`\s])``/,m=/^(?:[\d]+(?:[\.,]\d+)*)/,o=/^(?:\s\+[\d]+(?:[\.,]\d+)*)/,s=/^(?:\s\-[\d]+(?:[\.,]\d+)*)/,h="[Hh][Tt][Tt][Pp][Ss]?://",l="(?:[\\d\\w.-]+)\\.(?:\\w{2,6})",i="(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*",p=new RegExp("^"+h+l+i),d={token:function(e){if(e.match(c)&&e.match(/\W+|$/,!1))return"strong";if(e.match(n)&&e.match(/\W+|$/,!1))return"em";if(e.match(r)&&e.match(/\W+|$/,!1))return"string-2";if(e.match(m))return"number";if(e.match(o))return"positive";if(e.match(s))return"negative";if(e.match(p))return"link";for(;!(null==e.next()||e.match(c,!1)||e.match(n,!1)||e.match(r,!1)||e.match(m,!1)||e.match(o,!1)||e.match(s,!1)||e.match(p,!1)););return null}},u=e.getMode(t,a.backdrop||"rst-base");return e.overlayMode(u,d,!0)},"python","stex"),e.defineMode("rst-base",function(t){function a(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,a){return"undefined"!=typeof t[a]?t[a]:e})}function c(t,a){var r=null;if(t.sol()&&t.match(V,!1))l(a,s,{mode:d,local:e.startState(d)});else if(t.sol()&&t.match($))l(a,n),r="meta";else if(t.sol()&&t.match(v))l(a,c),r="header";else if(p(a)==P||t.match(P,!1))switch(i(a)){case 0:l(a,c,h(P,1)),t.match(/^:/),r="meta";break;case 1:l(a,c,h(P,2)),t.match(b),r="keyword",t.current().match(/^(?:math|latex)/)&&(a.tmp_stex=!0);break;case 2:l(a,c,h(P,3)),t.match(/^:`/),r="meta";break;case 3:if(a.tmp_stex&&(a.tmp_stex=void 0,a.tmp={mode:u,local:e.startState(u)}),a.tmp){if("`"==t.peek()){l(a,c,h(P,4)),a.tmp=void 0;break}r=a.tmp.mode.token(t,a.tmp.local);break}l(a,c,h(P,4)),t.match(_),r="string";break;case 4:l(a,c,h(P,5)),t.match(/^`/),r="meta";break;case 5:l(a,c,h(P,6)),t.match(k);break;default:l(a,c)}else if(p(a)==z||t.match(z,!1))switch(i(a)){case 0:l(a,c,h(z,1)),t.match(/^`/),r="meta";break;case 1:l(a,c,h(z,2)),t.match(_),r="string";break;case 2:l(a,c,h(z,3)),t.match(/^`:/),r="meta";break;case 3:l(a,c,h(z,4)),t.match(b),r="keyword";break;case 4:l(a,c,h(z,5)),t.match(/^:/),r="meta";break;case 5:l(a,c,h(z,6)),t.match(k);break;default:l(a,c)}else if(p(a)==B||t.match(B,!1))switch(i(a)){case 0:l(a,c,h(B,1)),t.match(/^:/),r="meta";break;case 1:l(a,c,h(B,2)),t.match(b),r="keyword";break;case 2:l(a,c,h(B,3)),t.match(/^:/),r="meta";break;case 3:l(a,c,h(B,4)),t.match(k);break;default:l(a,c)}else if(p(a)==j||t.match(j,!1))switch(i(a)){case 0:l(a,c,h(j,1)),t.match(G),r="variable-2";break;case 1:l(a,c,h(j,2)),t.match(/^_?_?/)&&(r="link");break;default:l(a,c)}else if(t.match(I))l(a,c),r="quote";else if(t.match(A))l(a,c),r="quote";else if(t.match(C))l(a,c),(!t.peek()||t.peek().match(/^\W$/))&&(r="link");else if(p(a)==H||t.match(H,!1))switch(i(a)){case 0:!t.peek()||t.peek().match(/^\W$/)?l(a,c,h(H,1)):t.match(H);break;case 1:l(a,c,h(H,2)),t.match(/^`/),r="link";break;case 2:l(a,c,h(H,3)),t.match(_);break;case 3:l(a,c,h(H,4)),t.match(/^`_/),r="link";break;default:l(a,c)}else t.match(U)?l(a,m):t.next()&&l(a,c);return r}function n(t,a){var m=null;if(p(a)==W||t.match(W,!1))switch(i(a)){case 0:l(a,n,h(W,1)),t.match(G),m="variable-2";break;case 1:l(a,n,h(W,2)),t.match(J);break;case 2:l(a,n,h(W,3)),t.match(K),m="keyword";break;case 3:l(a,n,h(W,4)),t.match(L),m="meta";break;default:l(a,c)}else if(p(a)==M||t.match(M,!1))switch(i(a)){case 0:l(a,n,h(M,1)),t.match(D),m="keyword",t.current().match(/^(?:math|latex)/)?a.tmp_stex=!0:t.current().match(/^python/)&&(a.tmp_py=!0);break;case 1:l(a,n,h(M,2)),t.match(F),m="meta",(t.match(/^latex\s*$/)||a.tmp_stex)&&(a.tmp_stex=void 0,l(a,s,{mode:u,local:e.startState(u)}));break;case 2:l(a,n,h(M,3)),(t.match(/^python\s*$/)||a.tmp_py)&&(a.tmp_py=void 0,l(a,s,{mode:d,local:e.startState(d)}));break;default:l(a,c)}else if(p(a)==S||t.match(S,!1))switch(i(a)){case 0:l(a,n,h(S,1)),t.match(N),t.match(O),m="link";break;case 1:l(a,n,h(S,2)),t.match(Q),m="meta";break;default:l(a,c)}else t.match(q)?(l(a,c),m="quote"):t.match(T)?(l(a,c),m="quote"):(t.eatSpace(),t.eol()?l(a,c):(t.skipToEnd(),l(a,r),m="comment"));return m}function r(e,t){return o(e,t,"comment")}function m(e,t){return o(e,t,"meta")}function o(e,t,a){return e.eol()||e.eatSpace()?(e.skipToEnd(),a):(l(t,c),null)}function s(e,t){return t.ctx.mode&&t.ctx.local?e.sol()?(e.eatSpace()||l(t,c),null):t.ctx.mode.token(e,t.ctx.local):(l(t,c),null)}function h(e,t,a,c){return{phase:e,stage:t,mode:a,local:c}}function l(e,t,a){e.tok=t,e.ctx=a||{}}function i(e){return e.ctx.stage||0}function p(e){return e.ctx.phase}var d=e.getMode(t,"python"),u=e.getMode(t,"stex"),f="\\s+",x="(?:\\s*|\\W|$)",k=new RegExp(a("^{0}",x)),w="(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",b=new RegExp(a("^{0}",w)),g="(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",E=a("(?:{0}|`{1}`)",w,g),R="(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)",y="(?:[^\\`]+)",_=new RegExp(a("^{0}",y)),v=new RegExp("^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"),$=new RegExp(a("^\\.\\.{0}",f)),S=new RegExp(a("^_{0}:{1}|^__:{1}",E,x)),M=new RegExp(a("^{0}::{1}",E,x)),W=new RegExp(a("^\\|{0}\\|{1}{2}::{3}",R,f,E,x)),q=new RegExp(a("^\\[(?:\\d+|#{0}?|\\*)]{1}",E,x)),T=new RegExp(a("^\\[{0}\\]{1}",E,x)),j=new RegExp(a("^\\|{0}\\|",R)),I=new RegExp(a("^\\[(?:\\d+|#{0}?|\\*)]_",E)),A=new RegExp(a("^\\[{0}\\]_",E)),C=new RegExp(a("^{0}__?",E)),H=new RegExp(a("^`{0}`_",y)),P=new RegExp(a("^:{0}:`{1}`{2}",w,y,x)),z=new RegExp(a("^`{1}`:{0}:{2}",w,y,x)),B=new RegExp(a("^:{0}:{1}",w,x)),D=new RegExp(a("^{0}",E)),F=new RegExp(a("^::{0}",x)),G=new RegExp(a("^\\|{0}\\|",R)),J=new RegExp(a("^{0}",f)),K=new RegExp(a("^{0}",E)),L=new RegExp(a("^::{0}",x)),N=new RegExp("^_"),O=new RegExp(a("^{0}|_",E)),Q=new RegExp(a("^:{0}",x)),U=new RegExp("^::\\s*$"),V=new RegExp("^\\s+(?:>>>|In \\[\\d+\\]:)\\s");return{startState:function(){return{tok:c,ctx:h(void 0,0)}},copyState:function(t){var a=t.ctx,c=t.tmp;return a.local&&(a={mode:a.mode,local:e.copyState(a.mode,a.local)}),c&&(c={mode:c.mode,local:e.copyState(c.mode,c.local)}),{tok:t.tok,ctx:a,tmp:c}},innerMode:function(e){return e.tmp?{state:e.tmp.local,mode:e.tmp.mode}:e.ctx.mode?{state:e.ctx.local,mode:e.ctx.mode}:null},token:function(e,t){return t.tok(e,t)}}},"python","stex"),e.defineMIME("text/x-rst","rst")}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../python/python"),require("../stex/stex"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../python/python","../stex/stex","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("rst",function(b,c){var d=/^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/,e=/^\*[^\*\s](?:[^\*]*[^\*\s])?\*/,f=/^``[^`\s](?:[^`]*[^`\s])``/,g=/^(?:[\d]+(?:[\.,]\d+)*)/,h=/^(?:\s\+[\d]+(?:[\.,]\d+)*)/,i=/^(?:\s\-[\d]+(?:[\.,]\d+)*)/,j="[Hh][Tt][Tt][Pp][Ss]?://",k="(?:[\\d\\w.-]+)\\.(?:\\w{2,6})",l="(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*",m=new RegExp("^"+j+k+l),n={token:function(a){if(a.match(d)&&a.match(/\W+|$/,!1))return"strong";if(a.match(e)&&a.match(/\W+|$/,!1))return"em";if(a.match(f)&&a.match(/\W+|$/,!1))return"string-2";if(a.match(g))return"number";if(a.match(h))return"positive";if(a.match(i))return"negative";if(a.match(m))return"link";for(;!(null==a.next()||a.match(d,!1)||a.match(e,!1)||a.match(f,!1)||a.match(g,!1)||a.match(h,!1)||a.match(i,!1)||a.match(m,!1)););return null}},o=a.getMode(b,c.backdrop||"rst-base");return a.overlayMode(o,n,!0)},"python","stex"),a.defineMode("rst-base",function(b){function c(a){var b=Array.prototype.slice.call(arguments,1);return a.replace(/{(\d+)}/g,function(a,c){return"undefined"!=typeof b[c]?b[c]:a})}function d(b,c){var f=null;if(b.sol()&&b.match(Y,!1))k(c,i,{mode:n,local:a.startState(n)});else if(b.sol()&&b.match(A))k(c,e),f="meta";else if(b.sol()&&b.match(z))k(c,d),f="header";else if(m(c)==L||b.match(L,!1))switch(l(c)){case 0:k(c,d,j(L,1)),b.match(/^:/),f="meta";break;case 1:k(c,d,j(L,2)),b.match(t),f="keyword",b.current().match(/^(?:math|latex)/)&&(c.tmp_stex=!0);break;case 2:k(c,d,j(L,3)),b.match(/^:`/),f="meta";break;case 3:if(c.tmp_stex&&(c.tmp_stex=void 0,c.tmp={mode:o,local:a.startState(o)}),c.tmp){if("`"==b.peek()){k(c,d,j(L,4)),c.tmp=void 0;break}f=c.tmp.mode.token(b,c.tmp.local);break}k(c,d,j(L,4)),b.match(y),f="string";break;case 4:k(c,d,j(L,5)),b.match(/^`/),f="meta";break;case 5:k(c,d,j(L,6)),b.match(r);break;default:k(c,d)}else if(m(c)==M||b.match(M,!1))switch(l(c)){case 0:k(c,d,j(M,1)),b.match(/^`/),f="meta";break;case 1:k(c,d,j(M,2)),b.match(y),f="string";break;case 2:k(c,d,j(M,3)),b.match(/^`:/),f="meta";break;case 3:k(c,d,j(M,4)),b.match(t),f="keyword";break;case 4:k(c,d,j(M,5)),b.match(/^:/),f="meta";break;case 5:k(c,d,j(M,6)),b.match(r);break;default:k(c,d)}else if(m(c)==N||b.match(N,!1))switch(l(c)){case 0:k(c,d,j(N,1)),b.match(/^:/),f="meta";break;case 1:k(c,d,j(N,2)),b.match(t),f="keyword";break;case 2:k(c,d,j(N,3)),b.match(/^:/),f="meta";break;case 3:k(c,d,j(N,4)),b.match(r);break;default:k(c,d)}else if(m(c)==G||b.match(G,!1))switch(l(c)){case 0:k(c,d,j(G,1)),b.match(Q),f="variable-2";break;case 1:k(c,d,j(G,2)),b.match(/^_?_?/)&&(f="link");break;default:k(c,d)}else if(b.match(H))k(c,d),f="quote";else if(b.match(I))k(c,d),f="quote";else if(b.match(J))k(c,d),(!b.peek()||b.peek().match(/^\W$/))&&(f="link");else if(m(c)==K||b.match(K,!1))switch(l(c)){case 0:!b.peek()||b.peek().match(/^\W$/)?k(c,d,j(K,1)):b.match(K);break;case 1:k(c,d,j(K,2)),b.match(/^`/),f="link";break;case 2:k(c,d,j(K,3)),b.match(y);break;case 3:k(c,d,j(K,4)),b.match(/^`_/),f="link";break;default:k(c,d)}else b.match(X)?k(c,g):b.next()&&k(c,d);return f}function e(b,c){var g=null;if(m(c)==D||b.match(D,!1))switch(l(c)){case 0:k(c,e,j(D,1)),b.match(Q),g="variable-2";break;case 1:k(c,e,j(D,2)),b.match(R);break;case 2:k(c,e,j(D,3)),b.match(S),g="keyword";break;case 3:k(c,e,j(D,4)),b.match(T),g="meta";break;default:k(c,d)}else if(m(c)==C||b.match(C,!1))switch(l(c)){case 0:k(c,e,j(C,1)),b.match(O),g="keyword",b.current().match(/^(?:math|latex)/)?c.tmp_stex=!0:b.current().match(/^python/)&&(c.tmp_py=!0);break;case 1:k(c,e,j(C,2)),b.match(P),g="meta",(b.match(/^latex\s*$/)||c.tmp_stex)&&(c.tmp_stex=void 0,k(c,i,{mode:o,local:a.startState(o)}));break;case 2:k(c,e,j(C,3)),(b.match(/^python\s*$/)||c.tmp_py)&&(c.tmp_py=void 0,k(c,i,{mode:n,local:a.startState(n)}));break;default:k(c,d)}else if(m(c)==B||b.match(B,!1))switch(l(c)){case 0:k(c,e,j(B,1)),b.match(U),b.match(V),g="link";break;case 1:k(c,e,j(B,2)),b.match(W),g="meta";break;default:k(c,d)}else b.match(E)?(k(c,d),g="quote"):b.match(F)?(k(c,d),g="quote"):(b.eatSpace(),b.eol()?k(c,d):(b.skipToEnd(),k(c,f),g="comment"));return g}function f(a,b){return h(a,b,"comment")}function g(a,b){return h(a,b,"meta")}function h(a,b,c){return a.eol()||a.eatSpace()?(a.skipToEnd(),c):(k(b,d),null)}function i(a,b){return b.ctx.mode&&b.ctx.local?a.sol()?(a.eatSpace()||k(b,d),null):b.ctx.mode.token(a,b.ctx.local):(k(b,d),null)}function j(a,b,c,d){return{phase:a,stage:b,mode:c,local:d}}function k(a,b,c){a.tok=b,a.ctx=c||{}}function l(a){return a.ctx.stage||0}function m(a){return a.ctx.phase}var n=a.getMode(b,"python"),o=a.getMode(b,"stex"),p="\\s+",q="(?:\\s*|\\W|$)",r=new RegExp(c("^{0}",q)),s="(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",t=new RegExp(c("^{0}",s)),u="(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",v=c("(?:{0}|`{1}`)",s,u),w="(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)",x="(?:[^\\`]+)",y=new RegExp(c("^{0}",x)),z=new RegExp("^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"),A=new RegExp(c("^\\.\\.{0}",p)),B=new RegExp(c("^_{0}:{1}|^__:{1}",v,q)),C=new RegExp(c("^{0}::{1}",v,q)),D=new RegExp(c("^\\|{0}\\|{1}{2}::{3}",w,p,v,q)),E=new RegExp(c("^\\[(?:\\d+|#{0}?|\\*)]{1}",v,q)),F=new RegExp(c("^\\[{0}\\]{1}",v,q)),G=new RegExp(c("^\\|{0}\\|",w)),H=new RegExp(c("^\\[(?:\\d+|#{0}?|\\*)]_",v)),I=new RegExp(c("^\\[{0}\\]_",v)),J=new RegExp(c("^{0}__?",v)),K=new RegExp(c("^`{0}`_",x)),L=new RegExp(c("^:{0}:`{1}`{2}",s,x,q)),M=new RegExp(c("^`{1}`:{0}:{2}",s,x,q)),N=new RegExp(c("^:{0}:{1}",s,q)),O=new RegExp(c("^{0}",v)),P=new RegExp(c("^::{0}",q)),Q=new RegExp(c("^\\|{0}\\|",w)),R=new RegExp(c("^{0}",p)),S=new RegExp(c("^{0}",v)),T=new RegExp(c("^::{0}",q)),U=new RegExp("^_"),V=new RegExp(c("^{0}|_",v)),W=new RegExp(c("^:{0}",q)),X=new RegExp("^::\\s*$"),Y=new RegExp("^\\s+(?:>>>|In \\[\\d+\\]:)\\s");return{startState:function(){return{tok:d,ctx:j(void 0,0)}},copyState:function(b){var c=b.ctx,d=b.tmp;return c.local&&(c={mode:c.mode,local:a.copyState(c.mode,c.local)}),d&&(d={mode:d.mode,local:a.copyState(d.mode,d.local)}),{tok:b.tok,ctx:c,tmp:d}},innerMode:function(a){return a.tmp?{state:a.tmp.local,mode:a.tmp.mode}:a.ctx.mode?{state:a.ctx.local,mode:a.ctx.mode}:null},token:function(a,b){return b.tok(a,b)}}},"python","stex"),a.defineMIME("text/x-rst","rst")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/ruby/ruby.min.js b/media/editors/codemirror/mode/ruby/ruby.min.js +index e2a5a7b..ee29fca 100644 +--- a/media/editors/codemirror/mode/ruby/ruby.min.js ++++ b/media/editors/codemirror/mode/ruby/ruby.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;r>n;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(l=null,e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(f),"comment";if(e.eatSpace())return null;var r,i=e.next();if("`"==i||"'"==i||'"'==i)return n(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var d=e.current().length;e.backUp(e.current().length-o);for(var c=0;e.current().lengthc)break}if(e.backUp(e.current().length-o),0==c)return n(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var k="string",h=!0;e.eat("s")?k="atom":e.eat(/[WQ]/)?k="string":e.eat(/[r]/)?k="string-2":e.eat(/[wxq]/)&&(k="string",h=!1);var m=e.eat(/[^\w\s=]/);return m?(p.propertyIsEnumerable(m)&&(m=p[m]),n(a(m,k,h,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(u(r[1]),e,t);if("0"==i)return e.eatWhile(e.eat("x")?/[\da-fA-F]/:e.eat("b")?/[01]/:/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?n(a("'","atom",!1),e,t):e.eat('"')?n(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return l=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var x=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||x||(l="."),"operator"}return null}return l="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,u){var f,l=!1;for("read-quoted-paused"===u.context.type&&(u.context=u.context.prev,a.eat("}"));null!=(f=a.next());){if(f==e&&(r||!l)){u.tokenize.pop();break}if(n&&"#"==f&&!l){if(a.eat("{")){"}"==e&&(u.context={prev:u.context,type:"read-quoted-paused"}),u.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){u.tokenize.push(o());break}}l=!l&&"\\"==f}return t}}function u(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function f(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var l,d=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),c=t(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),s=t(["end","until"]),p={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=l;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":d.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,c.propertyIsEnumerable(o)?n="indent":s.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indentedc;++c)b[a[c]]=!0;return b}function c(a,b,c){return c.tokenize.push(a),a(b,c)}function d(a,b){if(j=null,a.sol()&&a.match("=begin")&&a.eol())return b.tokenize.push(i),"comment";if(a.eatSpace())return null;var d,e=a.next();if("`"==e||"'"==e||'"'==e)return c(g(e,"string",'"'==e||"`"==e),a,b);if("/"==e){var f=a.current().length;if(a.skipTo("/")){var k=a.current().length;a.backUp(a.current().length-f);for(var l=0;a.current().lengthl)break}if(a.backUp(a.current().length-f),0==l)return c(g(e,"string-2",!0),a,b)}return"operator"}if("%"==e){var o="string",p=!0;a.eat("s")?o="atom":a.eat(/[WQ]/)?o="string":a.eat(/[r]/)?o="string-2":a.eat(/[wxq]/)&&(o="string",p=!1);var q=a.eat(/[^\w\s=]/);return q?(n.propertyIsEnumerable(q)&&(q=n[q]),c(g(q,o,p,!0),a,b)):"operator"}if("#"==e)return a.skipToEnd(),"comment";if("<"==e&&(d=a.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return c(h(d[1]),a,b);if("0"==e)return a.eat("x")?a.eatWhile(/[\da-fA-F]/):a.eat("b")?a.eatWhile(/[01]/):a.eatWhile(/[0-7]/),"number";if(/\d/.test(e))return a.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==e){for(;a.match(/^\\[CM]-/););return a.eat("\\")?a.eatWhile(/\w/):a.next(),"string"}if(":"==e)return a.eat("'")?c(g("'","atom",!1),a,b):a.eat('"')?c(g('"',"atom",!0),a,b):a.eat(/[\<\>]/)?(a.eat(/[\<\>]/),"atom"):a.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":a.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(a.eatWhile(/[\w$\xa1-\uffff]/),a.eat(/[\?\!\=]/),"atom"):"operator";if("@"==e&&a.match(/^@?[a-zA-Z_\xa1-\uffff]/))return a.eat("@"),a.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==e)return a.eat(/[a-zA-Z_]/)?a.eatWhile(/[\w]/):a.eat(/\d/)?a.eat(/\d/):a.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(e))return a.eatWhile(/[\w\xa1-\uffff]/),a.eat(/[\?\!]/),a.eat(":")?"atom":"ident";if("|"!=e||!b.varList&&"{"!=b.lastTok&&"do"!=b.lastTok){if(/[\(\)\[\]{}\\;]/.test(e))return j=e,null;if("-"==e&&a.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(e)){var r=a.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=e||r||(j="."),"operator"}return null}return j="|",null}function e(a){return a||(a=1),function(b,c){if("}"==b.peek()){if(1==a)return c.tokenize.pop(),c.tokenize[c.tokenize.length-1](b,c);c.tokenize[c.tokenize.length-1]=e(a-1)}else"{"==b.peek()&&(c.tokenize[c.tokenize.length-1]=e(a+1));return d(b,c)}}function f(){var a=!1;return function(b,c){return a?(c.tokenize.pop(),c.tokenize[c.tokenize.length-1](b,c)):(a=!0,d(b,c))}}function g(a,b,c,d){return function(g,h){var i,j=!1;for("read-quoted-paused"===h.context.type&&(h.context=h.context.prev,g.eat("}"));null!=(i=g.next());){if(i==a&&(d||!j)){h.tokenize.pop();break}if(c&&"#"==i&&!j){if(g.eat("{")){"}"==a&&(h.context={prev:h.context,type:"read-quoted-paused"}),h.tokenize.push(e());break}if(/[@\$]/.test(g.peek())){h.tokenize.push(f());break}}j=!j&&"\\"==i}return b}}function h(a){return function(b,c){return b.match(a)?c.tokenize.pop():b.skipToEnd(),"string"}}function i(a,b){return a.sol()&&a.match("=end")&&a.eol()&&b.tokenize.pop(),a.skipToEnd(),"comment"}var j,k=b(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),l=b(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),m=b(["end","until"]),n={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[d],indented:0,context:{type:"top",indented:-a.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(a,b){a.sol()&&(b.indented=a.indentation());var c,d=b.tokenize[b.tokenize.length-1](a,b),e=j;if("ident"==d){var f=a.current();d="."==b.lastTok?"property":k.propertyIsEnumerable(a.current())?"keyword":/^[A-Z]/.test(f)?"tag":"def"==b.lastTok||"class"==b.lastTok||b.varList?"def":"variable","keyword"==d&&(e=f,l.propertyIsEnumerable(f)?c="indent":m.propertyIsEnumerable(f)?c="dedent":"if"!=f&&"unless"!=f||a.column()!=a.indentation()?"do"==f&&b.context.indented")?e("->",null):a.match(V)?(t.eatWhile(V),e("op",null)):(t.eatWhile(/\w/),K=t.current(),t.match(/^::\w/)?(t.backUp(1),e("prefix","variable-2")):o.keywords.propertyIsEnumerable(K)?e(o.keywords[K],K.match(/true|false/)?"atom":"keyword"):e("name","variable"))}function n(n,r){for(var o,a=!1;o=n.next();){if('"'==o&&!a)return r.tokenize=t,e("atom","string");a=!a&&"\\"==o}return e("op","string")}function r(e){return function(n,o){for(var a,i=null;a=n.next();){if("/"==a&&"*"==i){if(1==e){o.tokenize=t;break}return o.tokenize=r(e-1),o.tokenize(n,o)}if("*"==a&&"/"==i)return o.tokenize=r(e+1),o.tokenize(n,o);i=a}return"comment"}}function o(){for(var e=arguments.length-1;e>=0;e--)X.cc.push(arguments[e])}function a(){return o.apply(null,arguments),!0}function i(e,t){var n=function(){var n=X.state;n.lexical={indented:n.indented,column:X.stream.column(),type:e,prev:n.lexical,info:t}};return n.lex=!0,n}function u(){var e=X.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function l(){X.state.keywords=R}function c(){X.state.keywords=Q}function f(e,t){function n(r){return","==r?a(e,n):r==t?a():a(n)}return function(r){return r==t?a():o(e,n)}}function m(e,t){return a(i("stat",t),e,u,d)}function d(e){return"}"==e?a():"let"==e?m(w,"let"):"fn"==e?m(j):"type"==e?a(i("stat"),C,s,u,d):"enum"==e?m(W):"mod"==e?m(M):"iface"==e?m($):"impl"==e?m(S):"open-attr"==e?a(i("]"),f(k,"]"),u):"ignore"==e||e.match(/[\]\);,]/)?a(d):o(i("stat"),k,u,s,d)}function s(e){return";"==e?a():o()}function k(e){return"atom"==e||"name"==e?a(p):"{"==e?a(i("}"),y,u):e.match(/[\[\(]/)?G(e,k):e.match(/[\]\)\};,]/)?o():"if-style"==e?a(k,k):"else-style"==e||"op"==e?a(k):"for"==e?a(A,v,z,k,k):"alt"==e?a(k,_):"fn"==e?a(j):"macro"==e?a(F):a()}function p(e){return"."==K?a(h):"::<"==K?a(I,p):"op"==e||":"==K?a(k):"("==e||"["==e?G(e,k):o()}function h(){return K.match(/^\w+$/)?(X.marked="variable",a(p)):o(k)}function y(e){if("op"==e){if("|"==K)return a(b,u,i("}","block"),d);if("||"==K)return a(u,i("}","block"),d)}return o("mutable"==K||K.match(/^\w+$/)&&":"==X.stream.peek()&&!X.stream.match("::",!1)?x(k):d)}function x(e){function t(n){return"mutable"==K||"with"==K?(X.marked="keyword",a(t)):K.match(/^\w*$/)?(X.marked="variable",a(t)):":"==n?a(e,t):"}"==n?a():a(t)}return t}function b(e){return"name"==e?(X.marked="def",a(b)):"op"==e&&"|"==K?a():a(b)}function w(e){return e.match(/[\]\)\};]/)?a():"="==K?a(k,g):","==e?a(w):o(A,v,w)}function g(e){return e.match(/[\]\)\};,]/)?o(w):o(k,g)}function v(e){return":"==e?a(l,P,c):o()}function z(e){return"name"==e&&"in"==K?(X.marked="keyword",a()):o()}function j(e){return"@"==K||"~"==K?(X.marked="keyword",a(j)):"name"==e?(X.marked="def",a(j)):"<"==K?a(I,j):"{"==e?o(k):"("==e?a(i(")"),f(O,")"),u,j):"->"==e?a(l,P,c,j):";"==e?a():a(j)}function C(e){return"name"==e?(X.marked="def",a(C)):"<"==K?a(I,C):"="==K?a(l,P,c):a(C)}function W(e){return"name"==e?(X.marked="def",a(W)):"<"==K?a(I,W):"="==K?a(l,P,c,s):"{"==e?a(i("}"),l,E,c,u):a(W)}function E(e){return"}"==e?a():"("==e?a(i(")"),f(P,")"),u,E):(K.match(/^\w+$/)&&(X.marked="def"),a(E))}function M(e){return"name"==e?(X.marked="def",a(M)):"{"==e?a(i("}"),d,u):o()}function $(e){return"name"==e?(X.marked="def",a($)):"<"==K?a(I,$):"{"==e?a(i("}"),d,u):o()}function S(e){return"<"==K?a(I,S):"of"==K||"for"==K?(X.marked="keyword",a(P,S)):"name"==e?(X.marked="def",a(S)):"{"==e?a(i("}"),d,u):o()}function I(){return">"==K?a():","==K?a(I):":"==K?a(P,I):o(P,I)}function O(e){return"name"==e?(X.marked="def",a(O)):":"==e?a(l,P,c):o()}function P(e){return"name"==e?(X.marked="variable-3",a(T)):"mutable"==K?(X.marked="keyword",a(P)):"atom"==e?a(T):"op"==e||"obj"==e?a(P):"fn"==e?a(q):"{"==e?a(i("{"),x(P),u):G(e,P)}function T(){return"<"==K?a(I):o()}function q(e){return"("==e?a(i("("),f(P,")"),u,q):"->"==e?a(P):o()}function A(e){return"name"==e?(X.marked="def",a(U)):"atom"==e?a(U):"op"==e?a(A):e.match(/[\]\)\};,]/)?o():G(e,A)}function U(e){return"op"==e&&"."==K?a():"to"==K?(X.marked="keyword",a(A)):o()}function _(e){return"{"==e?a(i("}","alt"),B,u):o()}function B(e){return"}"==e?a():"|"==e?a(B):"when"==K?(X.marked="keyword",a(k,D)):e.match(/[\]\);,]/)?a(B):o(A,D)}function D(e){return"{"==e?a(i("}","alt"),d,u,B):o(B)}function F(e){return e.match(/[\[\(\{]/)?G(e,k):o()}function G(e,t){return"["==e?a(i("]"),f(t,"]"),u):"("==e?a(i(")"),f(t,")"),u):"{"==e?a(i("}"),f(t,"}"),u):a()}function H(e,t,n){var r=e.cc;for(X.state=e,X.stream=t,X.marked=null,X.cc=r;;){var o=r.length?r.pop():d;if(o(J)){for(;r.length&&r[r.length-1].lex;)r.pop()();return X.marked||n}}}var J,K,L=4,N=2,Q={"if":"if-style","while":"if-style",loop:"else-style","else":"else-style","do":"else-style",ret:"else-style",fail:"else-style","break":"atom",cont:"atom","const":"let",resource:"fn",let:"let",fn:"fn","for":"for",alt:"alt",iface:"iface",impl:"impl",type:"type","enum":"enum",mod:"mod",as:"op","true":"atom","false":"atom",assert:"op",check:"op",claim:"op","native":"ignore",unsafe:"ignore","import":"else-style","export":"else-style",copy:"op",log:"op",log_err:"op",use:"op",bind:"op",self:"atom",struct:"enum"},R=function(){for(var e={fn:"fn",block:"fn",obj:"obj"},t="bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "),n=0,r=t.length;r>n;++n)e[t[n]]="atom";return e}(),V=/[+\-*&%=<>!?|\.@]/,X={state:null,stream:null,marked:null,cc:null};return u.lex=l.lex=c.lex=!0,{startState:function(){return{tokenize:t,cc:[],lexical:{indented:-L,column:0,type:"top",align:!1},keywords:Q,indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null;J=K=null;var n=t.tokenize(e,t);return"comment"==n?n:(t.lexical.hasOwnProperty("align")||(t.lexical.align=!0),"prefix"==J?n:(K||(K=e.current()),H(t,e,n)))},indent:function(e,n){if(e.tokenize!=t)return 0;var r=n&&n.charAt(0),o=e.lexical,a=o.type,i=r==a;return"stat"==a?o.indented+L:o.align?o.column+(i?0:1):o.indented+(i?0:"alt"==o.info?N:L)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),e.defineMIME("text/x-rustsrc","rust")}); +\ 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("rust",function(){function a(a,b){return S=a,b}function b(b,e){var f=b.next();if('"'==f)return e.tokenize=c,e.tokenize(b,e);if("'"==f)return S="atom",b.eat("\\")?b.skipTo("'")?(b.next(),"string"):"error":(b.next(),b.eat("'")?"string":"error");if("/"==f){if(b.eat("/"))return b.skipToEnd(),"comment";if(b.eat("*"))return e.tokenize=d(1),e.tokenize(b,e)}if("#"==f)return b.eat("[")?(S="open-attr",null):(b.eatWhile(/\w/),a("macro","meta"));if(":"==f&&b.match(":<"))return a("op",null);if(f.match(/\d/)||"."==f&&b.eat(/\d/)){var g=!1;return b.match(/^x[\da-f]+/i)||b.match(/^b[01]+/)||(b.eatWhile(/\d/),b.eat(".")&&(g=!0,b.eatWhile(/\d/)),b.match(/^e[+\-]?\d+/i)&&(g=!0)),g?b.match(/^f(?:32|64)/):b.match(/^[ui](?:8|16|32|64)/),a("atom","number")}return f.match(/[()\[\]{}:;,]/)?a(f,null):"-"==f&&b.eat(">")?a("->",null):f.match(Y)?(b.eatWhile(Y),a("op",null)):(b.eatWhile(/\w/),T=b.current(),b.match(/^::\w/)?(b.backUp(1),a("prefix","variable-2")):e.keywords.propertyIsEnumerable(T)?a(e.keywords[T],T.match(/true|false/)?"atom":"keyword"):a("name","variable"))}function c(c,d){for(var e,f=!1;e=c.next();){if('"'==e&&!f)return d.tokenize=b,a("atom","string");f=!f&&"\\"==e}return a("op","string")}function d(a){return function(c,e){for(var f,g=null;f=c.next();){if("/"==f&&"*"==g){if(1==a){e.tokenize=b;break}return e.tokenize=d(a-1),e.tokenize(c,e)}if("*"==f&&"/"==g)return e.tokenize=d(a+1),e.tokenize(c,e);g=f}return"comment"}}function e(){for(var a=arguments.length-1;a>=0;a--)Z.cc.push(arguments[a])}function f(){return e.apply(null,arguments),!0}function g(a,b){var c=function(){var c=Z.state;c.lexical={indented:c.indented,column:Z.stream.column(),type:a,prev:c.lexical,info:b}};return c.lex=!0,c}function h(){var a=Z.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function i(){Z.state.keywords=X}function j(){Z.state.keywords=W}function k(a,b){function c(d){return","==d?f(a,c):d==b?f():f(c)}return function(d){return d==b?f():e(a,c)}}function l(a,b){return f(g("stat",b),a,h,m)}function m(a){return"}"==a?f():"let"==a?l(u,"let"):"fn"==a?l(y):"type"==a?f(g("stat"),z,n,h,m):"enum"==a?l(A):"mod"==a?l(C):"iface"==a?l(D):"impl"==a?l(E):"open-attr"==a?f(g("]"),k(o,"]"),h):"ignore"==a||a.match(/[\]\);,]/)?f(m):e(g("stat"),o,h,n,m)}function n(a){return";"==a?f():e()}function o(a){return"atom"==a||"name"==a?f(p):"{"==a?f(g("}"),r,h):a.match(/[\[\(]/)?Q(a,o):a.match(/[\]\)\};,]/)?e():"if-style"==a?f(o,o):"else-style"==a||"op"==a?f(o):"for"==a?f(K,w,x,o,o):"alt"==a?f(o,M):"fn"==a?f(y):"macro"==a?f(P):f()}function p(a){return"."==T?f(q):"::<"==T?f(F,p):"op"==a||":"==T?f(o):"("==a||"["==a?Q(a,o):e()}function q(){return T.match(/^\w+$/)?(Z.marked="variable",f(p)):e(o)}function r(a){if("op"==a){if("|"==T)return f(t,h,g("}","block"),m);if("||"==T)return f(h,g("}","block"),m)}return e("mutable"==T||T.match(/^\w+$/)&&":"==Z.stream.peek()&&!Z.stream.match("::",!1)?s(o):m)}function s(a){function b(c){return"mutable"==T||"with"==T?(Z.marked="keyword",f(b)):T.match(/^\w*$/)?(Z.marked="variable",f(b)):":"==c?f(a,b):"}"==c?f():f(b)}return b}function t(a){return"name"==a?(Z.marked="def",f(t)):"op"==a&&"|"==T?f():f(t)}function u(a){return a.match(/[\]\)\};]/)?f():"="==T?f(o,v):","==a?f(u):e(K,w,u)}function v(a){return a.match(/[\]\)\};,]/)?e(u):e(o,v)}function w(a){return":"==a?f(i,H,j):e()}function x(a){return"name"==a&&"in"==T?(Z.marked="keyword",f()):e()}function y(a){return"@"==T||"~"==T?(Z.marked="keyword",f(y)):"name"==a?(Z.marked="def",f(y)):"<"==T?f(F,y):"{"==a?e(o):"("==a?f(g(")"),k(G,")"),h,y):"->"==a?f(i,H,j,y):";"==a?f():f(y)}function z(a){return"name"==a?(Z.marked="def",f(z)):"<"==T?f(F,z):"="==T?f(i,H,j):f(z)}function A(a){return"name"==a?(Z.marked="def",f(A)):"<"==T?f(F,A):"="==T?f(i,H,j,n):"{"==a?f(g("}"),i,B,j,h):f(A)}function B(a){return"}"==a?f():"("==a?f(g(")"),k(H,")"),h,B):(T.match(/^\w+$/)&&(Z.marked="def"),f(B))}function C(a){return"name"==a?(Z.marked="def",f(C)):"{"==a?f(g("}"),m,h):e()}function D(a){return"name"==a?(Z.marked="def",f(D)):"<"==T?f(F,D):"{"==a?f(g("}"),m,h):e()}function E(a){return"<"==T?f(F,E):"of"==T||"for"==T?(Z.marked="keyword",f(H,E)):"name"==a?(Z.marked="def",f(E)):"{"==a?f(g("}"),m,h):e()}function F(){return">"==T?f():","==T?f(F):":"==T?f(H,F):e(H,F)}function G(a){return"name"==a?(Z.marked="def",f(G)):":"==a?f(i,H,j):e()}function H(a){return"name"==a?(Z.marked="variable-3",f(I)):"mutable"==T?(Z.marked="keyword",f(H)):"atom"==a?f(I):"op"==a||"obj"==a?f(H):"fn"==a?f(J):"{"==a?f(g("{"),s(H),h):Q(a,H)}function I(){return"<"==T?f(F):e()}function J(a){return"("==a?f(g("("),k(H,")"),h,J):"->"==a?f(H):e()}function K(a){return"name"==a?(Z.marked="def",f(L)):"atom"==a?f(L):"op"==a?f(K):a.match(/[\]\)\};,]/)?e():Q(a,K)}function L(a){return"op"==a&&"."==T?f():"to"==T?(Z.marked="keyword",f(K)):e()}function M(a){return"{"==a?f(g("}","alt"),N,h):e()}function N(a){return"}"==a?f():"|"==a?f(N):"when"==T?(Z.marked="keyword",f(o,O)):a.match(/[\]\);,]/)?f(N):e(K,O)}function O(a){return"{"==a?f(g("}","alt"),m,h,N):e(N)}function P(a){return a.match(/[\[\(\{]/)?Q(a,o):e()}function Q(a,b){return"["==a?f(g("]"),k(b,"]"),h):"("==a?f(g(")"),k(b,")"),h):"{"==a?f(g("}"),k(b,"}"),h):f()}function R(a,b,c){var d=a.cc;for(Z.state=a,Z.stream=b,Z.marked=null,Z.cc=d;;){var e=d.length?d.pop():m;if(e(S)){for(;d.length&&d[d.length-1].lex;)d.pop()();return Z.marked||c}}}var S,T,U=4,V=2,W={"if":"if-style","while":"if-style",loop:"else-style","else":"else-style","do":"else-style",ret:"else-style",fail:"else-style","break":"atom",cont:"atom","const":"let",resource:"fn",let:"let",fn:"fn","for":"for",alt:"alt",iface:"iface",impl:"impl",type:"type","enum":"enum",mod:"mod",as:"op","true":"atom","false":"atom",assert:"op",check:"op",claim:"op","native":"ignore",unsafe:"ignore","import":"else-style","export":"else-style",copy:"op",log:"op",log_err:"op",use:"op",bind:"op",self:"atom",struct:"enum"},X=function(){for(var a={fn:"fn",block:"fn",obj:"obj"},b="bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "),c=0,d=b.length;d>c;++c)a[b[c]]="atom";return a}(),Y=/[+\-*&%=<>!?|\.@]/,Z={state:null,stream:null,marked:null,cc:null};return h.lex=i.lex=j.lex=!0,{startState:function(){return{tokenize:b,cc:[],lexical:{indented:-U,column:0,type:"top",align:!1},keywords:W,indented:0}},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation()),a.eatSpace())return null;S=T=null;var c=b.tokenize(a,b);return"comment"==c?c:(b.lexical.hasOwnProperty("align")||(b.lexical.align=!0),"prefix"==S?c:(T||(T=a.current()),R(b,a,c)))},indent:function(a,c){if(a.tokenize!=b)return 0;var d=c&&c.charAt(0),e=a.lexical,f=e.type,g=d==f;return"stat"==f?e.indented+U:e.align?e.column+(g?0:1):e.indented+(g?0:"alt"==e.info?V:U)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),a.defineMIME("text/x-rustsrc","rust")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/sass/sass.js b/media/editors/codemirror/mode/sass/sass.js +index 52a66829..6973ece 100644 +--- a/media/editors/codemirror/mode/sass/sass.js ++++ b/media/editors/codemirror/mode/sass/sass.js +@@ -232,7 +232,7 @@ CodeMirror.defineMode("sass", function(config) { + + if (stream.eatWhile(/[\w-]/)){ + if(stream.match(/ *: *[\w-\+\$#!\("']/,false)){ +- return "propery"; ++ return "property"; + } + else if(stream.match(/ *:/,false)){ + indent(state); +diff --git a/media/editors/codemirror/mode/sass/sass.min.js b/media/editors/codemirror/mode/sass/sass.min.js +index 756676e..5d7d218 100644 +--- a/media/editors/codemirror/mode/sass/sass.min.js ++++ b/media/editors/codemirror/mode/sass/sass.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sass",function(e){function t(e){return new RegExp("^"+e.join("|"))}function r(e,t){var r=e.peek();return")"===r?(e.next(),t.tokenizer=f,"operator"):"("===r?(e.next(),e.eatSpace(),"operator"):"'"===r||'"'===r?(t.tokenizer=o(e.next()),"string"):(t.tokenizer=o(")",!1),"string")}function n(e,t){return function(r,n){return r.sol()&&r.indentation()<=e?(n.tokenizer=f,f(r,n)):(t&&r.skipTo("*/")?(r.next(),r.next(),n.tokenizer=f):r.skipToEnd(),"comment")}}function o(e,t){function r(n,o){var a=n.next(),u=n.peek(),c=n.string.charAt(n.pos-2),s="\\"!==a&&u===e||a===e&&"\\"!==c;return s?(a!==e&&t&&n.next(),o.tokenizer=f,"string"):"#"===a&&"{"===u?(o.tokenizer=i(r),n.next(),"operator"):"string"}return null==t&&(t=!0),r}function i(e){return function(t,r){return"}"===t.peek()?(t.next(),r.tokenizer=e,"operator"):f(t,r)}}function a(t){if(0==t.indentCount){t.indentCount++;var r=t.scopes[0].offset,n=r+e.indentUnit;t.scopes.unshift({offset:n})}}function u(e){1!=e.scopes.length&&e.scopes.shift()}function f(e,t){var c=e.peek();if(e.match("/*"))return t.tokenizer=n(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=n(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=i(f),"operator";if('"'===c||"'"===c)return e.next(),t.tokenizer=o(c),"string";if(t.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(t.cursorHalf=0),"unit";if(e.match(p))return e.peek()||(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=r,e.peek()||(t.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(t.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(t.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(l))return e.peek()||(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(t.cursorHalf=0),"attribute";if(!e.peek())return t.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(p))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=r,"atom";if("="===c&&e.match(/^=[\w-]+/))return a(t),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||u(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return a(t),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"propery":e.match(/ *:/,!1)?(a(t),t.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(a(t),"atom");if(":"===c)return e.match(k)?"keyword":(e.next(),t.cursorHalf=1,"operator")}return e.match(l)?"operator":(e.next(),null)}function c(t,r){t.sol()&&(r.indentCount=0);var n=r.tokenizer(t,r),o=t.current();if(("@return"===o||"}"===o)&&u(r),null!==n){for(var i=t.pos-o.length,a=i+e.indentUnit*r.indentCount,f=[],c=0;c","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],l=t(m),k=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:f,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var r=c(e,t);return t.lastToken={style:r,content:e.current()},r},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}); +\ 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("sass",function(a){function b(a){return new RegExp("^"+a.join("|"))}function c(a,b){var c=a.peek();return")"===c?(a.next(),b.tokenizer=i,"operator"):"("===c?(a.next(),a.eatSpace(),"operator"):"'"===c||'"'===c?(b.tokenizer=e(a.next()),"string"):(b.tokenizer=e(")",!1),"string")}function d(a,b){return function(c,d){return c.sol()&&c.indentation()<=a?(d.tokenizer=i,i(c,d)):(b&&c.skipTo("*/")?(c.next(),c.next(),d.tokenizer=i):c.skipToEnd(),"comment")}}function e(a,b){function c(d,e){var g=d.next(),h=d.peek(),j=d.string.charAt(d.pos-2),k="\\"!==g&&h===a||g===a&&"\\"!==j;return k?(g!==a&&b&&d.next(),e.tokenizer=i,"string"):"#"===g&&"{"===h?(e.tokenizer=f(c),d.next(),"operator"):"string"}return null==b&&(b=!0),c}function f(a){return function(b,c){return"}"===b.peek()?(b.next(),c.tokenizer=a,"operator"):i(b,c)}}function g(b){if(0==b.indentCount){b.indentCount++;var c=b.scopes[0].offset,d=c+a.indentUnit;b.scopes.unshift({offset:d})}}function h(a){1!=a.scopes.length&&a.scopes.shift()}function i(a,b){var j=a.peek();if(a.match("/*"))return b.tokenizer=d(a.indentation(),!0),b.tokenizer(a,b);if(a.match("//"))return b.tokenizer=d(a.indentation(),!1),b.tokenizer(a,b);if(a.match("#{"))return b.tokenizer=f(i),"operator";if('"'===j||"'"===j)return a.next(),b.tokenizer=e(j),"string";if(b.cursorHalf){if("#"===j&&(a.next(),a.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return a.peek()||(b.cursorHalf=0),"number";if(a.match(/^-?[0-9\.]+/))return a.peek()||(b.cursorHalf=0),"number";if(a.match(/^(px|em|in)\b/))return a.peek()||(b.cursorHalf=0),"unit";if(a.match(l))return a.peek()||(b.cursorHalf=0),"keyword";if(a.match(/^url/)&&"("===a.peek())return b.tokenizer=c,a.peek()||(b.cursorHalf=0),"atom";if("$"===j)return a.next(),a.eatWhile(/[\w-]/),a.peek()||(b.cursorHalf=0),"variable-3";if("!"===j)return a.next(),a.peek()||(b.cursorHalf=0),a.match(/^[\w]+/)?"keyword":"operator";if(a.match(n))return a.peek()||(b.cursorHalf=0),"operator";if(a.eatWhile(/[\w-]/))return a.peek()||(b.cursorHalf=0),"attribute";if(!a.peek())return b.cursorHalf=0,null}else{if("."===j){if(a.next(),a.match(/^[\w-]+/))return g(b),"atom";if("#"===a.peek())return g(b),"atom"}if("#"===j){if(a.next(),a.match(/^[\w-]+/))return g(b),"atom";if("#"===a.peek())return g(b),"atom"}if("$"===j)return a.next(),a.eatWhile(/[\w-]/),"variable-2";if(a.match(/^-?[0-9\.]+/))return"number";if(a.match(/^(px|em|in)\b/))return"unit";if(a.match(l))return"keyword";if(a.match(/^url/)&&"("===a.peek())return b.tokenizer=c,"atom";if("="===j&&a.match(/^=[\w-]+/))return g(b),"meta";if("+"===j&&a.match(/^\+[\w-]+/))return"variable-3";if("@"===j&&a.match(/@extend/)&&(a.match(/\s*[\w]/)||h(b)),a.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return g(b),"meta";if("@"===j)return a.next(),a.eatWhile(/[\w-]/),"meta";if(a.eatWhile(/[\w-]/))return a.match(/ *: *[\w-\+\$#!\("']/,!1)?"property":a.match(/ *:/,!1)?(g(b),b.cursorHalf=1,"atom"):a.match(/ *,/,!1)?"atom":(g(b),"atom");if(":"===j)return a.match(o)?"keyword":(a.next(),b.cursorHalf=1,"operator")}return a.match(n)?"operator":(a.next(),null)}function j(b,c){b.sol()&&(c.indentCount=0);var d=c.tokenizer(b,c),e=b.current();if(("@return"===e||"}"===e)&&h(c),null!==d){for(var f=b.pos-e.length,g=f+a.indentUnit*c.indentCount,i=[],j=0;j","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],n=b(m),o=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:i,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(a,b){var c=j(a,b);return b.lastToken={style:c,content:a.current()},c},indent:function(a){return a.scopes[0].offset}}}),a.defineMIME("text/x-sass","sass")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/scheme/scheme.js b/media/editors/codemirror/mode/scheme/scheme.js +index 979edc0..2234645 100644 +--- a/media/editors/codemirror/mode/scheme/scheme.js ++++ b/media/editors/codemirror/mode/scheme/scheme.js +@@ -239,6 +239,7 @@ CodeMirror.defineMode("scheme", function () { + return state.indentStack.indent; + }, + ++ closeBrackets: {pairs: "()[]{}\"\""}, + lineComment: ";;" + }; + }); +diff --git a/media/editors/codemirror/mode/scheme/scheme.min.js b/media/editors/codemirror/mode/scheme/scheme.min.js +index b2ef963..f65d002 100644 +--- a/media/editors/codemirror/mode/scheme/scheme.min.js ++++ b/media/editors/codemirror/mode/scheme/scheme.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("scheme",function(){function e(e){for(var t={},n=e.split(" "),r=0;rinteger char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),g=e("define let letrec let* lambda"),x=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),b=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),v=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),k=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var x=null;switch(t.mode){case"string":for(var b,v=!1;null!=(b=e.next());){if('"'==b&&!v){t.mode=!1;break}v=!v&&"\\"==b}x=s;break;case"comment":for(var b,k=!1;null!=(b=e.next());){if("#"==b&&k){t.mode=!1;break}k="|"==b}x=d;break;case"s-expr-comment":if(t.mode=!1,"("!=e.peek()&&"["!=e.peek()){e.eatWhile(/[^/s]/),x=d;break}t.sExprComment=0;default:var y=e.next();if('"'==y)t.mode="string",x=s;else if("'"==y)x=u;else if("#"==y)if(e.eat("|"))t.mode="comment",x=d;else if(e.eat(/[tf]/i))x=u;else if(e.eat(";"))t.mode="s-expr-comment",x=d;else{var w=null,E=!1,q=!0;e.eat(/[ei]/i)?E=!0:e.backUp(1),e.match(/^#b/i)?w=i:e.match(/^#o/i)?w=a:e.match(/^#x/i)?w=o:e.match(/^#d/i)?w=c:e.match(/^[-+0-9.]/,!1)?(q=!1,w=c):E||e.eat("#"),null!=w&&(q&&!E&&e.match(/^#[ei]/i),w(e)&&(x=m))}else if(/^[-+0-9.]/.test(y)&&c(e,!0))x=m;else if(";"==y)e.skipToEnd(),x=d;else if("("==y||"["==y){for(var S,C="",$=e.column();null!=(S=e.eat(/[^\s\(\[\;\)\]]/));)C+=S;C.length>0&&g.propertyIsEnumerable(C)?n(t,$+f,y):(e.eatSpace(),e.eol()||";"==e.peek()?n(t,$+1,y):n(t,$+e.current().length,y)),e.backUp(e.current().length-1),"number"==typeof t.sExprComment&&t.sExprComment++,x=p}else")"==y||"]"==y?(x=p,null!=t.indentStack&&t.indentStack.type==(")"==y?"(":"[")&&(r(t),"number"==typeof t.sExprComment&&0==--t.sExprComment&&(x=d,t.sExprComment=!1))):(e.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/),x=h&&h.propertyIsEnumerable(e.current())?l:"variable")}return"number"==typeof t.sExprComment?d:x},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},lineComment:";;"}}),e.defineMIME("text/x-scheme","scheme")}); +\ 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("scheme",function(){function a(a){for(var b={},c=a.split(" "),d=0;dinteger char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),q=a("define let letrec let* lambda"),r=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),s=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),t=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),u=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(a,b){if(null==b.indentStack&&a.sol()&&(b.indentation=a.indentation()),a.eatSpace())return null;var r=null;switch(b.mode){case"string":for(var s,t=!1;null!=(s=a.next());){if('"'==s&&!t){b.mode=!1;break}t=!t&&"\\"==s}r=k;break;case"comment":for(var s,u=!1;null!=(s=a.next());){if("#"==s&&u){b.mode=!1;break}u="|"==s}r=j;break;case"s-expr-comment":if(b.mode=!1,"("!=a.peek()&&"["!=a.peek()){a.eatWhile(/[^/s]/),r=j;break}b.sExprComment=0;default:var v=a.next();if('"'==v)b.mode="string",r=k;else if("'"==v)r=l;else if("#"==v)if(a.eat("|"))b.mode="comment",r=j;else if(a.eat(/[tf]/i))r=l;else if(a.eat(";"))b.mode="s-expr-comment",r=j;else{var w=null,x=!1,y=!0;a.eat(/[ei]/i)?x=!0:a.backUp(1),a.match(/^#b/i)?w=e:a.match(/^#o/i)?w=f:a.match(/^#x/i)?w=h:a.match(/^#d/i)?w=g:a.match(/^[-+0-9.]/,!1)?(y=!1,w=g):x||a.eat("#"),null!=w&&(y&&!x&&a.match(/^#[ei]/i),w(a)&&(r=m))}else if(/^[-+0-9.]/.test(v)&&g(a,!0))r=m;else if(";"==v)a.skipToEnd(),r=j;else if("("==v||"["==v){for(var z,A="",B=a.column();null!=(z=a.eat(/[^\s\(\[\;\)\]]/));)A+=z;A.length>0&&q.propertyIsEnumerable(A)?c(b,B+o,v):(a.eatSpace(),a.eol()||";"==a.peek()?c(b,B+1,v):c(b,B+a.current().length,v)),a.backUp(a.current().length-1),"number"==typeof b.sExprComment&&b.sExprComment++,r=n}else")"==v||"]"==v?(r=n,null!=b.indentStack&&b.indentStack.type==(")"==v?"(":"[")&&(d(b),"number"==typeof b.sExprComment&&0==--b.sExprComment&&(r=j,b.sExprComment=!1))):(a.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/),r=p&&p.propertyIsEnumerable(a.current())?i:"variable")}return"number"==typeof b.sExprComment?j:r},indent:function(a){return null==a.indentStack?a.indentation:a.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:";;"}}),a.defineMIME("text/x-scheme","scheme")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/shell/shell.min.js b/media/editors/codemirror/mode/shell/shell.min.js +index 08b6fe2..b9904fa 100644 +--- a/media/editors/codemirror/mode/shell/shell.min.js ++++ b/media/editors/codemirror/mode/shell/shell.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}); +\ 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("shell",function(){function a(a,b){for(var c=b.split(" "),d=0;d1&&a.eat("$");var e=a.next(),f=/\w/;return"{"===e&&(f=/[^}]/),"("===e?(b.tokens[0]=c(")"),d(a,b)):(/\d/.test(e)||(a.eatWhile(f),a.eat("}")),b.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(a,b){return d(a,b)},lineComment:"#",fold:"brace"}}),a.defineMIME("text/x-sh","shell")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/shell/test.js b/media/editors/codemirror/mode/shell/test.js +deleted file mode 100644 +index a413b5a..0000000 +--- a/media/editors/codemirror/mode/shell/test.js ++++ /dev/null +@@ -1,58 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({}, "shell"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- +- MT("var", +- "text [def $var] text"); +- MT("varBraces", +- "text[def ${var}]text"); +- MT("varVar", +- "text [def $a$b] text"); +- MT("varBracesVarBraces", +- "text[def ${a}${b}]text"); +- +- MT("singleQuotedVar", +- "[string 'text $var text']"); +- MT("singleQuotedVarBraces", +- "[string 'text ${var} text']"); +- +- MT("doubleQuotedVar", +- '[string "text ][def $var][string text"]'); +- MT("doubleQuotedVarBraces", +- '[string "text][def ${var}][string text"]'); +- MT("doubleQuotedVarPunct", +- '[string "text ][def $@][string text"]'); +- MT("doubleQuotedVarVar", +- '[string "][def $a$b][string "]'); +- MT("doubleQuotedVarBracesVarBraces", +- '[string "][def ${a}${b}][string "]'); +- +- MT("notAString", +- "text\\'text"); +- MT("escapes", +- "outside\\'\\\"\\`\\\\[string \"inside\\`\\'\\\"\\\\`\\$notAVar\"]outside\\$\\(notASubShell\\)"); +- +- MT("subshell", +- "[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."); +- MT("doubleQuotedSubshell", +- "[builtin echo] [string \"][quote $(whoami)][string 's log, stardate `date`.\"]"); +- +- MT("hashbang", +- "[meta #!/bin/bash]"); +- MT("comment", +- "text [comment # Blurb]"); +- +- MT("numbers", +- "[number 0] [number 1] [number 2]"); +- MT("keywords", +- "[keyword while] [atom true]; [keyword do]", +- " [builtin sleep] [number 3]", +- "[keyword done]"); +- MT("options", +- "[builtin ls] [attribute -l] [attribute --human-readable]"); +- MT("operator", +- "[def var][operator =]value"); +-})(); +diff --git a/media/editors/codemirror/mode/shell/test.min.js b/media/editors/codemirror/mode/shell/test.min.js +deleted file mode 100644 +index cc88c5b..0000000 +--- a/media/editors/codemirror/mode/shell/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({},"shell");t("var","text [def $var] text"),t("varBraces","text[def ${var}]text"),t("varVar","text [def $a$b] text"),t("varBracesVarBraces","text[def ${a}${b}]text"),t("singleQuotedVar","[string 'text $var text']"),t("singleQuotedVarBraces","[string 'text ${var} text']"),t("doubleQuotedVar",'[string "text ][def $var][string text"]'),t("doubleQuotedVarBraces",'[string "text][def ${var}][string text"]'),t("doubleQuotedVarPunct",'[string "text ][def $@][string text"]'),t("doubleQuotedVarVar",'[string "][def $a$b][string "]'),t("doubleQuotedVarBracesVarBraces",'[string "][def ${a}${b}][string "]'),t("notAString","text\\'text"),t("escapes",'outside\\\'\\"\\`\\\\[string "inside\\`\\\'\\"\\\\`\\$notAVar"]outside\\$\\(notASubShell\\)'),t("subshell","[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."),t("doubleQuotedSubshell",'[builtin echo] [string "][quote $(whoami)][string \'s log, stardate `date`."]'),t("hashbang","[meta #!/bin/bash]"),t("comment","text [comment # Blurb]"),t("numbers","[number 0] [number 1] [number 2]"),t("keywords","[keyword while] [atom true]; [keyword do]"," [builtin sleep] [number 3]","[keyword done]"),t("options","[builtin ls] [attribute -l] [attribute --human-readable]"),t("operator","[def var][operator =]value")}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/sieve/sieve.min.js b/media/editors/codemirror/mode/sieve/sieve.min.js +index 255c236..94db61c 100644 +--- a/media/editors/codemirror/mode/sieve/sieve.min.js ++++ b/media/editors/codemirror/mode/sieve/sieve.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sieve",function(e){function n(e){for(var n={},t=e.split(" "),r=0;rt&&(t=0),t*f},electricChars:"}"}}),e.defineMIME("application/sieve","sieve")}); +\ 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("sieve",function(a){function b(a){for(var b={},c=a.split(" "),d=0;dc&&(c=0),c*i},electricChars:"}"}}),a.defineMIME("application/sieve","sieve")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/slim/slim.min.js b/media/editors/codemirror/mode/slim/slim.min.js +index e759bef..e1f94af 100644 +--- a/media/editors/codemirror/mode/slim/slim.min.js ++++ b/media/editors/codemirror/mode/slim/slim.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("slim",function(e){function n(t,e,n){var i=function(i,r){return r.tokenize=e,i.pos-1&&(e.tokenize=n(t.pos,e.tokenize,o),t.backUp(u.length-a-r)),o}function r(t,e){t.stack={parent:t.stack,style:"continuation",indented:e,tokenize:t.line},t.line=t.tokenize}function o(t){t.line==t.tokenize&&(t.line=t.stack.tokenize,t.stack=t.stack.parent)}function u(t,e){return function(n,i){if(o(i),n.match(/^\\$/))return r(i,t),"lineContinuation";var u=e(n,i);return n.eol()&&n.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)&&n.backUp(1),u}}function a(t,e){return function(n,i){o(i);var u=e(n,i);return n.eol()&&n.current().match(/,$/)&&r(i,t),u}}function c(t,e){return function(n,i){var r=n.peek();return r==t&&1==i.rubyState.tokenize.length?(n.next(),i.tokenize=e,"closeAttributeTag"):s(n,i)}}function l(t){var e,n=function(n,i){if(1==i.rubyState.tokenize.length&&!i.rubyState.context.prev){if(n.backUp(1),n.eatSpace())return i.rubyState=e,i.tokenize=t,t(n,i);n.next()}return s(n,i)};return function(t,i){return e=i.rubyState,i.rubyState=Z.startState(),i.tokenize=n,s(t,i)}}function s(t,e){return Z.token(t,e.rubyState)}function k(t,e){return t.match(/^\\$/)?"lineContinuation":d(t,e)}function d(t,e){return t.match(/^#\{/)?(e.tokenize=c("}",e.tokenize),null):i(t,e,/[^\\]#\{/,1,P.token(t,e.htmlState))}function m(t){return function(e,n){var i=k(e,n);return e.eol()&&(n.tokenize=t),i}}function f(t,e,n){return e.stack={parent:e.stack,style:"html",indented:t.column()+n,tokenize:e.line},e.line=e.tokenize=d,null}function b(t,e){return t.skipToEnd(),e.stack.style}function z(t,e){return e.stack={parent:e.stack,style:"comment",indented:e.indented+1,tokenize:e.line},e.line=b,b(t,e)}function p(t,e){return t.eat(e.stack.endQuote)?(e.line=e.stack.line,e.tokenize=e.stack.tokenize,e.stack=e.stack.parent,null):t.match(K)?(e.tokenize=x,"slimAttribute"):(t.next(),null)}function x(t,e){return t.match(/^==?/)?(e.tokenize=h,null):p(t,e)}function h(t,e){var n=t.peek();return'"'==n||"'"==n?(e.tokenize=q(n,"string",!0,!1,p),t.next(),e.tokenize(t,e)):"["==n?l(p)(t,e):t.match(/^(true|false|nil)\b/)?(e.tokenize=p,"keyword"):l(p)(t,e)}function y(t,e,n){return t.stack={parent:t.stack,style:"wrapper",indented:t.indented+1,tokenize:n,line:t.line,endQuote:e},t.line=t.tokenize=p,null}function S(e,n){if(e.match(/^#\{/))return n.tokenize=c("}",n.tokenize),null;var i=new t.StringStream(e.string.slice(n.stack.indented),e.tabSize);i.pos=e.pos-n.stack.indented,i.start=e.start-n.stack.indented,i.lastColumnPos=e.lastColumnPos-n.stack.indented,i.lastColumnValue=e.lastColumnValue-n.stack.indented;var r=n.subMode.token(i,n.subState);return e.pos=i.pos+n.stack.indented,r}function v(t,e){return e.stack.indented=t.column(),e.line=e.tokenize=S,e.tokenize(t,e)}function w(n){var i=D[n],r=t.mimeModes[i];if(r)return t.getMode(e,r);var o=t.modes[i];return o?o(e,{name:i}):t.getMode(e,"null")}function g(t){return _.hasOwnProperty(t)?_[t]:_[t]=w(t)}function M(t,e){var n=g(t),i=n.startState&&n.startState();return e.subMode=n,e.subState=i,e.stack={parent:e.stack,style:"sub",indented:e.indented+1,tokenize:e.line},e.line=e.tokenize=v,"slimSubmode"}function C(t){return t.skipToEnd(),"slimDoctype"}function E(t,e){var n=t.peek();if("<"==n)return(e.tokenize=m(e.tokenize))(t,e);if(t.match(/^[|']/))return f(t,e,1);if(t.match(/^\/(!|\[\w+])?/))return z(t,e);if(t.match(/^(-|==?[<>]?)/))return e.tokenize=u(t.column(),a(t.column(),s)),"slimSwitch";if(t.match(/^doctype\b/))return e.tokenize=C,"keyword";var i=t.match(Q);return i?M(i[1],e):L(t,e)}function A(t,e){return e.startOfLine?E(t,e):L(t,e)}function L(t,e){return t.eat("*")?(e.tokenize=l($),null):t.match(H)?(e.tokenize=$,"slimTag"):T(t,e)}function $(t,e){return t.match(/^(<>?|>e.indented&&"slimSubmode"!=e.last;)e.line=e.tokenize=e.stack.tokenize,e.stack=e.stack.parent,e.subMode=null,e.subState=null;if(t.eatSpace())return null;var n=e.tokenize(t,e);return e.startOfLine=!1,n&&(e.last=n),V.hasOwnProperty(n)?V[n]:n},blankLine:function(t){return t.subMode&&t.subMode.blankLine?t.subMode.blankLine(t.subState):void 0},innerMode:function(t){return t.subMode?{state:t.subState,mode:t.subMode}:{state:t,mode:X}}};return X},"htmlmixed","ruby"),t.defineMIME("text/x-slim","slim"),t.defineMIME("application/x-slim","slim")}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("slim",function(b){function c(a,b,c){var d=function(d,e){return e.tokenize=b,d.pos-1&&(b.tokenize=c(a.pos,b.tokenize,f),a.backUp(g.length-h-e)),f}function e(a,b){a.stack={parent:a.stack,style:"continuation",indented:b,tokenize:a.line},a.line=a.tokenize}function f(a){a.line==a.tokenize&&(a.line=a.stack.tokenize,a.stack=a.stack.parent)}function g(a,b){return function(c,d){if(f(d),c.match(/^\\$/))return e(d,a),"lineContinuation";var g=b(c,d);return c.eol()&&c.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)&&c.backUp(1),g}}function h(a,b){return function(c,d){f(d);var g=b(c,d);return c.eol()&&c.current().match(/,$/)&&e(d,a),g}}function i(a,b){return function(c,d){var e=c.peek();return e==a&&1==d.rubyState.tokenize.length?(c.next(),d.tokenize=b,"closeAttributeTag"):k(c,d)}}function j(a){var b,c=function(c,d){if(1==d.rubyState.tokenize.length&&!d.rubyState.context.prev){if(c.backUp(1),c.eatSpace())return d.rubyState=b,d.tokenize=a,a(c,d);c.next()}return k(c,d)};return function(a,d){return b=d.rubyState,d.rubyState=N.startState(),d.tokenize=c,k(a,d)}}function k(a,b){return N.token(a,b.rubyState)}function l(a,b){return a.match(/^\\$/)?"lineContinuation":m(a,b)}function m(a,b){return a.match(/^#\{/)?(b.tokenize=i("}",b.tokenize),null):d(a,b,/[^\\]#\{/,1,M.token(a,b.htmlState))}function n(a){return function(b,c){var d=l(b,c);return b.eol()&&(c.tokenize=a),d}}function o(a,b,c){return b.stack={parent:b.stack,style:"html",indented:a.column()+c,tokenize:b.line},b.line=b.tokenize=m,null}function p(a,b){return a.skipToEnd(),b.stack.style}function q(a,b){return b.stack={parent:b.stack,style:"comment",indented:b.indented+1,tokenize:b.line},b.line=p,p(a,b)}function r(a,b){return a.eat(b.stack.endQuote)?(b.line=b.stack.line,b.tokenize=b.stack.tokenize,b.stack=b.stack.parent,null):a.match(X)?(b.tokenize=s,"slimAttribute"):(a.next(),null)}function s(a,b){return a.match(/^==?/)?(b.tokenize=t,null):r(a,b)}function t(a,b){var c=a.peek();return'"'==c||"'"==c?(b.tokenize=K(c,"string",!0,!1,r),a.next(),b.tokenize(a,b)):"["==c?j(r)(a,b):a.match(/^(true|false|nil)\b/)?(b.tokenize=r,"keyword"):j(r)(a,b)}function u(a,b,c){return a.stack={parent:a.stack,style:"wrapper",indented:a.indented+1,tokenize:c,line:a.line,endQuote:b},a.line=a.tokenize=r,null}function v(b,c){if(b.match(/^#\{/))return c.tokenize=i("}",c.tokenize),null;var d=new a.StringStream(b.string.slice(c.stack.indented),b.tabSize);d.pos=b.pos-c.stack.indented,d.start=b.start-c.stack.indented,d.lastColumnPos=b.lastColumnPos-c.stack.indented,d.lastColumnValue=b.lastColumnValue-c.stack.indented;var e=c.subMode.token(d,c.subState);return b.pos=d.pos+c.stack.indented,e}function w(a,b){return b.stack.indented=a.column(),b.line=b.tokenize=v,b.tokenize(a,b)}function x(c){var d=P[c],e=a.mimeModes[d];if(e)return a.getMode(b,e);var f=a.modes[d];return f?f(b,{name:d}):a.getMode(b,"null")}function y(a){return O.hasOwnProperty(a)?O[a]:O[a]=x(a)}function z(a,b){var c=y(a),d=c.startState&&c.startState();return b.subMode=c,b.subState=d,b.stack={parent:b.stack,style:"sub",indented:b.indented+1,tokenize:b.line},b.line=b.tokenize=w,"slimSubmode"}function A(a,b){return a.skipToEnd(),"slimDoctype"}function B(a,b){var c=a.peek();if("<"==c)return(b.tokenize=n(b.tokenize))(a,b);if(a.match(/^[|']/))return o(a,b,1);if(a.match(/^\/(!|\[\w+])?/))return q(a,b);if(a.match(/^(-|==?[<>]?)/))return b.tokenize=g(a.column(),h(a.column(),k)),"slimSwitch";if(a.match(/^doctype\b/))return b.tokenize=A,"keyword";var d=a.match(Q);return d?z(d[1],b):D(a,b)}function C(a,b){return b.startOfLine?B(a,b):D(a,b)}function D(a,b){return a.eat("*")?(b.tokenize=j(E),null):a.match(V)?(b.tokenize=E,"slimTag"):F(a,b)}function E(a,b){return a.match(/^(<>?|>b.indented&&"slimSubmode"!=b.last;)b.line=b.tokenize=b.stack.tokenize,b.stack=b.stack.parent,b.subMode=null,b.subState=null;if(a.eatSpace())return null;var c=b.tokenize(a,b);return b.startOfLine=!1,c&&(b.last=c),R.hasOwnProperty(c)?R[c]:c},blankLine:function(a){return a.subMode&&a.subMode.blankLine?a.subMode.blankLine(a.subState):void 0},innerMode:function(a){return a.subMode?{state:a.subState,mode:a.subMode}:{state:a,mode:$}}};return $},"htmlmixed","ruby"),a.defineMIME("text/x-slim","slim"),a.defineMIME("application/x-slim","slim")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/slim/test.js b/media/editors/codemirror/mode/slim/test.js +deleted file mode 100644 +index be4ddac..0000000 +--- a/media/editors/codemirror/mode/slim/test.js ++++ /dev/null +@@ -1,96 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh +- +-(function() { +- var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "slim"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- +- // Requires at least one media query +- MT("elementName", +- "[tag h1] Hey There"); +- +- MT("oneElementPerLine", +- "[tag h1] Hey There .h2"); +- +- MT("idShortcut", +- "[attribute&def #test] Hey There"); +- +- MT("tagWithIdShortcuts", +- "[tag h1][attribute&def #test] Hey There"); +- +- MT("classShortcut", +- "[attribute&qualifier .hello] Hey There"); +- +- MT("tagWithIdAndClassShortcuts", +- "[tag h1][attribute&def #test][attribute&qualifier .hello] Hey There"); +- +- MT("docType", +- "[keyword doctype] xml"); +- +- MT("comment", +- "[comment / Hello WORLD]"); +- +- MT("notComment", +- "[tag h1] This is not a / comment "); +- +- MT("attributes", +- "[tag a]([attribute title]=[string \"test\"]) [attribute href]=[string \"link\"]}"); +- +- MT("multiLineAttributes", +- "[tag a]([attribute title]=[string \"test\"]", +- " ) [attribute href]=[string \"link\"]}"); +- +- MT("htmlCode", +- "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"); +- +- MT("rubyBlock", +- "[operator&special =][variable-2 @item]"); +- +- MT("selectorRubyBlock", +- "[tag a][attribute&qualifier .test][operator&special =] [variable-2 @item]"); +- +- MT("nestedRubyBlock", +- "[tag a]", +- " [operator&special =][variable puts] [string \"test\"]"); +- +- MT("multilinePlaintext", +- "[tag p]", +- " | Hello,", +- " World"); +- +- MT("multilineRuby", +- "[tag p]", +- " [comment /# this is a comment]", +- " [comment and this is a comment too]", +- " | Date/Time", +- " [operator&special -] [variable now] [operator =] [tag DateTime][operator .][property now]", +- " [tag strong][operator&special =] [variable now]", +- " [operator&special -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])", +- " [operator&special =][string \"Happy\"]", +- " [operator&special =][string \"Belated\"]", +- " [operator&special =][string \"Birthday\"]"); +- +- MT("multilineComment", +- "[comment /]", +- " [comment Multiline]", +- " [comment Comment]"); +- +- MT("hamlAfterRubyTag", +- "[attribute&qualifier .block]", +- " [tag strong][operator&special =] [variable now]", +- " [attribute&qualifier .test]", +- " [operator&special =][variable now]", +- " [attribute&qualifier .right]"); +- +- MT("stretchedRuby", +- "[operator&special =] [variable puts] [string \"Hello\"],", +- " [string \"World\"]"); +- +- MT("interpolationInHashAttribute", +- "[tag div]{[attribute id] = [string \"]#{[variable test]}[string _]#{[variable ting]}[string \"]} test"); +- +- MT("interpolationInHTMLAttribute", +- "[tag div]([attribute title]=[string \"]#{[variable test]}[string _]#{[variable ting]()}[string \"]) Test"); +-})(); +diff --git a/media/editors/codemirror/mode/slim/test.min.js b/media/editors/codemirror/mode/slim/test.min.js +deleted file mode 100644 +index 60f0661..0000000 +--- a/media/editors/codemirror/mode/slim/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4,indentUnit:2},"slim");t("elementName","[tag h1] Hey There"),t("oneElementPerLine","[tag h1] Hey There .h2"),t("idShortcut","[attribute&def #test] Hey There"),t("tagWithIdShortcuts","[tag h1][attribute&def #test] Hey There"),t("classShortcut","[attribute&qualifier .hello] Hey There"),t("tagWithIdAndClassShortcuts","[tag h1][attribute&def #test][attribute&qualifier .hello] Hey There"),t("docType","[keyword doctype] xml"),t("comment","[comment / Hello WORLD]"),t("notComment","[tag h1] This is not a / comment "),t("attributes",'[tag a]([attribute title]=[string "test"]) [attribute href]=[string "link"]}'),t("multiLineAttributes",'[tag a]([attribute title]=[string "test"]',' ) [attribute href]=[string "link"]}'),t("htmlCode","[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"),t("rubyBlock","[operator&special =][variable-2 @item]"),t("selectorRubyBlock","[tag a][attribute&qualifier .test][operator&special =] [variable-2 @item]"),t("nestedRubyBlock","[tag a]",' [operator&special =][variable puts] [string "test"]'),t("multilinePlaintext","[tag p]"," | Hello,"," World"),t("multilineRuby","[tag p]"," [comment /# this is a comment]"," [comment and this is a comment too]"," | Date/Time"," [operator&special -] [variable now] [operator =] [tag DateTime][operator .][property now]"," [tag strong][operator&special =] [variable now]",' [operator&special -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string "December 31, 2006"])',' [operator&special =][string "Happy"]',' [operator&special =][string "Belated"]',' [operator&special =][string "Birthday"]'),t("multilineComment","[comment /]"," [comment Multiline]"," [comment Comment]"),t("hamlAfterRubyTag","[attribute&qualifier .block]"," [tag strong][operator&special =] [variable now]"," [attribute&qualifier .test]"," [operator&special =][variable now]"," [attribute&qualifier .right]"),t("stretchedRuby",'[operator&special =] [variable puts] [string "Hello"],',' [string "World"]'),t("interpolationInHashAttribute",'[tag div]{[attribute id] = [string "]#{[variable test]}[string _]#{[variable ting]}[string "]} test'),t("interpolationInHTMLAttribute",'[tag div]([attribute title]=[string "]#{[variable test]}[string _]#{[variable ting]()}[string "]) Test')}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/smalltalk/smalltalk.min.js b/media/editors/codemirror/mode/smalltalk/smalltalk.min.js +index cf3f1f0..e11cbcd 100644 +--- a/media/editors/codemirror/mode/smalltalk/smalltalk.min.js ++++ b/media/editors/codemirror/mode/smalltalk/smalltalk.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("smalltalk",function(e){var t=/[+\-\/\\*~<>=@%|&?!.,:;^]/,n=/true|false|nil|self|super|thisContext/,i=function(e,t){this.next=e,this.parent=t},a=function(e,t,n){this.name=e,this.context=t,this.eos=n},r=function(){this.context=new i(o,null),this.expectVariable=!0,this.indentation=0,this.userIndentationDelta=0};r.prototype.userIndent=function(t){this.userIndentationDelta=t>0?t/e.indentUnit-this.indentation:0};var o=function(e,r,o){var d=new a(null,r,!1),f=e.next();return'"'===f?d=s(e,new i(s,r)):"'"===f?d=u(e,new i(u,r)):"#"===f?"'"===e.peek()?(e.next(),d=c(e,new i(c,r))):d.name=e.eatWhile(/[^\s.{}\[\]()]/)?"string-2":"meta":"$"===f?("<"===e.next()&&(e.eatWhile(/[^\s>]/),e.next()),d.name="string-2"):"|"===f&&o.expectVariable?d.context=new i(l,r):/[\[\]{}()]/.test(f)?(d.name="bracket",d.eos=/[\[{(]/.test(f),"["===f?o.indentation++:"]"===f&&(o.indentation=Math.max(0,o.indentation-1))):t.test(f)?(e.eatWhile(t),d.name="operator",d.eos=";"!==f):/\d/.test(f)?(e.eatWhile(/[\w\d]/),d.name="number"):/[\w_]/.test(f)?(e.eatWhile(/[\w\d_]/),d.name=o.expectVariable?n.test(e.current())?"keyword":"variable":null):d.eos=o.expectVariable,d},s=function(e,t){return e.eatWhile(/[^"]/),new a("comment",e.eat('"')?t.parent:t,!0)},u=function(e,t){return e.eatWhile(/[^']/),new a("string",e.eat("'")?t.parent:t,!1)},c=function(e,t){return e.eatWhile(/[^']/),new a("string-2",e.eat("'")?t.parent:t,!1)},l=function(e,t){var n=new a(null,t,!1),i=e.next();return"|"===i?(n.context=t.parent,n.eos=!0):(e.eatWhile(/[^|]/),n.name="variable"),n};return{startState:function(){return new r},token:function(e,t){if(t.userIndent(e.indentation()),e.eatSpace())return null;var n=t.context.next(e,t.context,t);return t.context=n.context,t.expectVariable=n.eos,n.name},blankLine:function(e){e.userIndent(0)},indent:function(t,n){var i=t.context.next===o&&n&&"]"===n.charAt(0)?-1:t.userIndentationDelta;return(t.indentation+i)*e.indentUnit},electricChars:"]"}}),e.defineMIME("text/x-stsrc",{name:"smalltalk"})}); +\ 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("smalltalk",function(a){var b=/[+\-\/\\*~<>=@%|&?!.,:;^]/,c=/true|false|nil|self|super|thisContext/,d=function(a,b){this.next=a,this.parent=b},e=function(a,b,c){this.name=a,this.context=b,this.eos=c},f=function(){this.context=new d(g,null),this.expectVariable=!0,this.indentation=0,this.userIndentationDelta=0};f.prototype.userIndent=function(b){this.userIndentationDelta=b>0?b/a.indentUnit-this.indentation:0};var g=function(a,f,g){var l=new e(null,f,!1),m=a.next();return'"'===m?l=h(a,new d(h,f)):"'"===m?l=i(a,new d(i,f)):"#"===m?"'"===a.peek()?(a.next(),l=j(a,new d(j,f))):a.eatWhile(/[^\s.{}\[\]()]/)?l.name="string-2":l.name="meta":"$"===m?("<"===a.next()&&(a.eatWhile(/[^\s>]/),a.next()),l.name="string-2"):"|"===m&&g.expectVariable?l.context=new d(k,f):/[\[\]{}()]/.test(m)?(l.name="bracket",l.eos=/[\[{(]/.test(m),"["===m?g.indentation++:"]"===m&&(g.indentation=Math.max(0,g.indentation-1))):b.test(m)?(a.eatWhile(b),l.name="operator",l.eos=";"!==m):/\d/.test(m)?(a.eatWhile(/[\w\d]/),l.name="number"):/[\w_]/.test(m)?(a.eatWhile(/[\w\d_]/),l.name=g.expectVariable?c.test(a.current())?"keyword":"variable":null):l.eos=g.expectVariable,l},h=function(a,b){return a.eatWhile(/[^"]/),new e("comment",a.eat('"')?b.parent:b,!0)},i=function(a,b){return a.eatWhile(/[^']/),new e("string",a.eat("'")?b.parent:b,!1)},j=function(a,b){return a.eatWhile(/[^']/),new e("string-2",a.eat("'")?b.parent:b,!1)},k=function(a,b){var c=new e(null,b,!1),d=a.next();return"|"===d?(c.context=b.parent,c.eos=!0):(a.eatWhile(/[^|]/),c.name="variable"),c};return{startState:function(){return new f},token:function(a,b){if(b.userIndent(a.indentation()),a.eatSpace())return null;var c=b.context.next(a,b.context,b);return b.context=c.context,b.expectVariable=c.eos,c.name},blankLine:function(a){a.userIndent(0)},indent:function(b,c){var d=b.context.next===g&&c&&"]"===c.charAt(0)?-1:b.userIndentationDelta;return(b.indentation+d)*a.indentUnit},electricChars:"]"}}),a.defineMIME("text/x-stsrc",{name:"smalltalk"})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/smarty/smarty.js b/media/editors/codemirror/mode/smarty/smarty.js +index bb05324..6e0fbed 100644 +--- a/media/editors/codemirror/mode/smarty/smarty.js ++++ b/media/editors/codemirror/mode/smarty/smarty.js +@@ -13,134 +13,123 @@ + else // Plain browser env + mod(CodeMirror); + })(function(CodeMirror) { +-"use strict"; +- +-CodeMirror.defineMode("smarty", function(config) { + "use strict"; + +- // our default settings; check to see if they're overridden +- var settings = { +- rightDelimiter: '}', +- leftDelimiter: '{', +- smartyVersion: 2 // for backward compatibility +- }; +- if (config.hasOwnProperty("leftDelimiter")) { +- settings.leftDelimiter = config.leftDelimiter; +- } +- if (config.hasOwnProperty("rightDelimiter")) { +- settings.rightDelimiter = config.rightDelimiter; +- } +- if (config.hasOwnProperty("smartyVersion") && config.smartyVersion === 3) { +- settings.smartyVersion = 3; +- } +- +- var keyFunctions = ["debug", "extends", "function", "include", "literal"]; +- var last; +- var regs = { +- operatorChars: /[+\-*&%=<>!?]/, +- validIdentifier: /[a-zA-Z0-9_]/, +- stringChar: /['"]/ +- }; +- +- var helpers = { +- cont: function(style, lastType) { ++ CodeMirror.defineMode("smarty", function(config, parserConf) { ++ var rightDelimiter = parserConf.rightDelimiter || "}"; ++ var leftDelimiter = parserConf.leftDelimiter || "{"; ++ var version = parserConf.version || 2; ++ var baseMode = CodeMirror.getMode(config, parserConf.baseMode || "null"); ++ ++ var keyFunctions = ["debug", "extends", "function", "include", "literal"]; ++ var regs = { ++ operatorChars: /[+\-*&%=<>!?]/, ++ validIdentifier: /[a-zA-Z0-9_]/, ++ stringChar: /['"]/ ++ }; ++ ++ var last; ++ function cont(style, lastType) { + last = lastType; + return style; +- }, +- chain: function(stream, state, parser) { ++ } ++ ++ function chain(stream, state, parser) { + state.tokenize = parser; + return parser(stream, state); + } +- }; + ++ // Smarty 3 allows { and } surrounded by whitespace to NOT slip into Smarty mode ++ function doesNotCount(stream, pos) { ++ if (pos == null) pos = stream.pos; ++ return version === 3 && leftDelimiter == "{" && ++ (pos == stream.string.length || /\s/.test(stream.string.charAt(pos))); ++ } + +- // our various parsers +- var parsers = { +- +- // the main tokenizer +- tokenizer: function(stream, state) { +- if (stream.match(settings.leftDelimiter, true)) { ++ function tokenTop(stream, state) { ++ var string = stream.string; ++ for (var scan = stream.pos;;) { ++ var nextMatch = string.indexOf(leftDelimiter, scan); ++ scan = nextMatch + leftDelimiter.length; ++ if (nextMatch == -1 || !doesNotCount(stream, nextMatch + leftDelimiter.length)) break; ++ } ++ if (nextMatch == stream.pos) { ++ stream.match(leftDelimiter); + if (stream.eat("*")) { +- return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter)); ++ return chain(stream, state, tokenBlock("comment", "*" + rightDelimiter)); + } else { +- // Smarty 3 allows { and } surrounded by whitespace to NOT slip into Smarty mode + state.depth++; +- var isEol = stream.eol(); +- var isFollowedByWhitespace = /\s/.test(stream.peek()); +- if (settings.smartyVersion === 3 && settings.leftDelimiter === "{" && (isEol || isFollowedByWhitespace)) { +- state.depth--; +- return null; +- } else { +- state.tokenize = parsers.smarty; +- last = "startTag"; +- return "tag"; +- } ++ state.tokenize = tokenSmarty; ++ last = "startTag"; ++ return "tag"; + } +- } else { +- stream.next(); +- return null; + } +- }, ++ ++ if (nextMatch > -1) stream.string = string.slice(0, nextMatch); ++ var token = baseMode.token(stream, state.base); ++ if (nextMatch > -1) stream.string = string; ++ return token; ++ } + + // parsing Smarty content +- smarty: function(stream, state) { +- if (stream.match(settings.rightDelimiter, true)) { +- if (settings.smartyVersion === 3) { ++ function tokenSmarty(stream, state) { ++ if (stream.match(rightDelimiter, true)) { ++ if (version === 3) { + state.depth--; + if (state.depth <= 0) { +- state.tokenize = parsers.tokenizer; ++ state.tokenize = tokenTop; + } + } else { +- state.tokenize = parsers.tokenizer; ++ state.tokenize = tokenTop; + } +- return helpers.cont("tag", null); ++ return cont("tag", null); + } + +- if (stream.match(settings.leftDelimiter, true)) { ++ if (stream.match(leftDelimiter, true)) { + state.depth++; +- return helpers.cont("tag", "startTag"); ++ return cont("tag", "startTag"); + } + + var ch = stream.next(); + if (ch == "$") { + stream.eatWhile(regs.validIdentifier); +- return helpers.cont("variable-2", "variable"); ++ return cont("variable-2", "variable"); + } else if (ch == "|") { +- return helpers.cont("operator", "pipe"); ++ return cont("operator", "pipe"); + } else if (ch == ".") { +- return helpers.cont("operator", "property"); ++ return cont("operator", "property"); + } else if (regs.stringChar.test(ch)) { +- state.tokenize = parsers.inAttribute(ch); +- return helpers.cont("string", "string"); ++ state.tokenize = tokenAttribute(ch); ++ return cont("string", "string"); + } else if (regs.operatorChars.test(ch)) { + stream.eatWhile(regs.operatorChars); +- return helpers.cont("operator", "operator"); ++ return cont("operator", "operator"); + } else if (ch == "[" || ch == "]") { +- return helpers.cont("bracket", "bracket"); ++ return cont("bracket", "bracket"); + } else if (ch == "(" || ch == ")") { +- return helpers.cont("bracket", "operator"); ++ return cont("bracket", "operator"); + } else if (/\d/.test(ch)) { + stream.eatWhile(/\d/); +- return helpers.cont("number", "number"); ++ return cont("number", "number"); + } else { + + if (state.last == "variable") { + if (ch == "@") { + stream.eatWhile(regs.validIdentifier); +- return helpers.cont("property", "property"); ++ return cont("property", "property"); + } else if (ch == "|") { + stream.eatWhile(regs.validIdentifier); +- return helpers.cont("qualifier", "modifier"); ++ return cont("qualifier", "modifier"); + } + } else if (state.last == "pipe") { + stream.eatWhile(regs.validIdentifier); +- return helpers.cont("qualifier", "modifier"); ++ return cont("qualifier", "modifier"); + } else if (state.last == "whitespace") { + stream.eatWhile(regs.validIdentifier); +- return helpers.cont("attribute", "modifier"); ++ return cont("attribute", "modifier"); + } if (state.last == "property") { + stream.eatWhile(regs.validIdentifier); +- return helpers.cont("property", null); ++ return cont("property", null); + } else if (/\s/.test(ch)) { + last = "whitespace"; + return null; +@@ -156,37 +145,37 @@ CodeMirror.defineMode("smarty", function(config) { + } + for (var i=0, j=keyFunctions.length; i!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/},o={cont:function(e,t){return r=t,e},chain:function(e,t,r){return t.tokenize=r,r(e,t)}},a={tokenizer:function(e,i){if(e.match(t.leftDelimiter,!0)){if(e.eat("*"))return o.chain(e,i,a.inBlock("comment","*"+t.rightDelimiter));i.depth++;var n=e.eol(),l=/\s/.test(e.peek());return 3===t.smartyVersion&&"{"===t.leftDelimiter&&(n||l)?(i.depth--,null):(i.tokenize=a.smarty,r="startTag","tag")}return e.next(),null},smarty:function(e,l){if(e.match(t.rightDelimiter,!0))return 3===t.smartyVersion?(l.depth--,l.depth<=0&&(l.tokenize=a.tokenizer)):l.tokenize=a.tokenizer,o.cont("tag",null);if(e.match(t.leftDelimiter,!0))return l.depth++,o.cont("tag","startTag");var f=e.next();if("$"==f)return e.eatWhile(n.validIdentifier),o.cont("variable-2","variable");if("|"==f)return o.cont("operator","pipe");if("."==f)return o.cont("operator","property");if(n.stringChar.test(f))return l.tokenize=a.inAttribute(f),o.cont("string","string");if(n.operatorChars.test(f))return e.eatWhile(n.operatorChars),o.cont("operator","operator");if("["==f||"]"==f)return o.cont("bracket","bracket");if("("==f||")"==f)return o.cont("bracket","operator");if(/\d/.test(f))return e.eatWhile(/\d/),o.cont("number","number");if("variable"==l.last){if("@"==f)return e.eatWhile(n.validIdentifier),o.cont("property","property");if("|"==f)return e.eatWhile(n.validIdentifier),o.cont("qualifier","modifier")}else{if("pipe"==l.last)return e.eatWhile(n.validIdentifier),o.cont("qualifier","modifier");if("whitespace"==l.last)return e.eatWhile(n.validIdentifier),o.cont("attribute","modifier")}if("property"==l.last)return e.eatWhile(n.validIdentifier),o.cont("property",null);if(/\s/.test(f))return r="whitespace",null;var u="";"/"!=f&&(u+=f);for(var s=null;s=e.eat(n.validIdentifier);)u+=s;for(var c=0,d=i.length;d>c;c++)if(i[c]==u)return o.cont("keyword","keyword");return/\s/.test(f)?null:o.cont("tag","tag")},inAttribute:function(e){return function(t,r){for(var i=null,n=null;!t.eol();){if(n=t.peek(),t.next()==e&&"\\"!==i){r.tokenize=a.smarty;break}i=n}return"string"}},inBlock:function(e,t){return function(r,i){for(;!r.eol();){if(r.match(t)){i.tokenize=a.tokenizer;break}r.next()}return e}}};return{startState:function(){return{tokenize:a.tokenizer,mode:"smarty",last:null,depth:0}},token:function(e,t){var i=t.tokenize(e,t);return t.last=r,i},electricChars:""}}),e.defineMIME("text/x-smarty","smarty")}); +\ 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("smarty",function(b,c){function d(a,b){return k=b,a}function e(a,b,c){return b.tokenize=c,c(a,b)}function f(a,b){return null==b&&(b=a.pos),3===n&&"{"==m&&(b==a.string.length||/\s/.test(a.string.charAt(b)))}function g(a,b){for(var c=a.string,d=a.pos;;){var g=c.indexOf(m,d);if(d=g+m.length,-1==g||!f(a,g+m.length))break}if(g==a.pos)return a.match(m),a.eat("*")?e(a,b,j("comment","*"+l)):(b.depth++,b.tokenize=h,k="startTag","tag");g>-1&&(a.string=c.slice(0,g));var i=o.token(a,b.base);return g>-1&&(a.string=c),i}function h(a,b){if(a.match(l,!0))return 3===n?(b.depth--,b.depth<=0&&(b.tokenize=g)):b.tokenize=g,d("tag",null);if(a.match(m,!0))return b.depth++,d("tag","startTag");var c=a.next();if("$"==c)return a.eatWhile(q.validIdentifier),d("variable-2","variable");if("|"==c)return d("operator","pipe");if("."==c)return d("operator","property");if(q.stringChar.test(c))return b.tokenize=i(c),d("string","string");if(q.operatorChars.test(c))return a.eatWhile(q.operatorChars),d("operator","operator");if("["==c||"]"==c)return d("bracket","bracket");if("("==c||")"==c)return d("bracket","operator");if(/\d/.test(c))return a.eatWhile(/\d/),d("number","number");if("variable"==b.last){if("@"==c)return a.eatWhile(q.validIdentifier),d("property","property");if("|"==c)return a.eatWhile(q.validIdentifier),d("qualifier","modifier")}else{if("pipe"==b.last)return a.eatWhile(q.validIdentifier),d("qualifier","modifier");if("whitespace"==b.last)return a.eatWhile(q.validIdentifier),d("attribute","modifier")}if("property"==b.last)return a.eatWhile(q.validIdentifier),d("property",null);if(/\s/.test(c))return k="whitespace",null;var e="";"/"!=c&&(e+=c);for(var f=null;f=a.eat(q.validIdentifier);)e+=f;for(var h=0,j=p.length;j>h;h++)if(p[h]==e)return d("keyword","keyword");return/\s/.test(c)?null:d("tag","tag")}function i(a){return function(b,c){for(var d=null,e=null;!b.eol();){if(e=b.peek(),b.next()==a&&"\\"!==d){c.tokenize=h;break}d=e}return"string"}}function j(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=g;break}c.next()}return a}}var k,l=c.rightDelimiter||"}",m=c.leftDelimiter||"{",n=c.version||2,o=a.getMode(b,c.baseMode||"null"),p=["debug","extends","function","include","literal"],q={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/};return{startState:function(){return{base:a.startState(o),tokenize:g,last:null,depth:0}},copyState:function(b){return{base:a.copyState(o,b.base),tokenize:b.tokenize,last:b.last,depth:b.depth}},innerMode:function(a){return a.tokenize==g?{mode:o,state:a.base}:void 0},token:function(a,b){var c=b.tokenize(a,b);return b.last=k,c},indent:function(b,c){return b.tokenize==g&&o.indent?o.indent(b.base,c):a.Pass},blockCommentStart:m+"*",blockCommentEnd:"*"+l}}),a.defineMIME("text/x-smarty","smarty")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/smartymixed/smartymixed.js b/media/editors/codemirror/mode/smartymixed/smartymixed.js +deleted file mode 100644 +index 4fc7ca4..0000000 +--- a/media/editors/codemirror/mode/smartymixed/smartymixed.js ++++ /dev/null +@@ -1,197 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-/** +-* @file smartymixed.js +-* @brief Smarty Mixed Codemirror mode (Smarty + Mixed HTML) +-* @author Ruslan Osmanov +-* @version 3.0 +-* @date 05.07.2013 +-*/ +- +-// Warning: Don't base other modes on this one. This here is a +-// terrible way to write a mixed mode. +- +-(function(mod) { +- if (typeof exports == "object" && typeof module == "object") // CommonJS +- mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../smarty/smarty")); +- else if (typeof define == "function" && define.amd) // AMD +- define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../smarty/smarty"], mod); +- else // Plain browser env +- mod(CodeMirror); +-})(function(CodeMirror) { +-"use strict"; +- +-CodeMirror.defineMode("smartymixed", function(config) { +- var htmlMixedMode = CodeMirror.getMode(config, "htmlmixed"); +- var smartyMode = CodeMirror.getMode(config, "smarty"); +- +- var settings = { +- rightDelimiter: '}', +- leftDelimiter: '{' +- }; +- +- if (config.hasOwnProperty("leftDelimiter")) { +- settings.leftDelimiter = config.leftDelimiter; +- } +- if (config.hasOwnProperty("rightDelimiter")) { +- settings.rightDelimiter = config.rightDelimiter; +- } +- +- function reEsc(str) { return str.replace(/[^\s\w]/g, "\\$&"); } +- +- var reLeft = reEsc(settings.leftDelimiter), reRight = reEsc(settings.rightDelimiter); +- var regs = { +- smartyComment: new RegExp("^" + reRight + "\\*"), +- literalOpen: new RegExp(reLeft + "literal" + reRight), +- literalClose: new RegExp(reLeft + "\/literal" + reRight), +- hasLeftDelimeter: new RegExp(".*" + reLeft), +- htmlHasLeftDelimeter: new RegExp("[^<>]*" + reLeft) +- }; +- +- var helpers = { +- chain: function(stream, state, parser) { +- state.tokenize = parser; +- return parser(stream, state); +- }, +- +- cleanChain: function(stream, state, parser) { +- state.tokenize = null; +- state.localState = null; +- state.localMode = null; +- return (typeof parser == "string") ? (parser ? parser : null) : parser(stream, state); +- }, +- +- maybeBackup: function(stream, pat, style) { +- var cur = stream.current(); +- var close = cur.search(pat), +- m; +- if (close > - 1) stream.backUp(cur.length - close); +- else if (m = cur.match(/<\/?$/)) { +- stream.backUp(cur.length); +- if (!stream.match(pat, false)) stream.match(cur[0]); +- } +- return style; +- } +- }; +- +- var parsers = { +- html: function(stream, state) { +- var htmlTagName = state.htmlMixedState.htmlState.context && state.htmlMixedState.htmlState.context.tagName +- ? state.htmlMixedState.htmlState.context.tagName +- : null; +- +- if (!state.inLiteral && stream.match(regs.htmlHasLeftDelimeter, false) && htmlTagName === null) { +- state.tokenize = parsers.smarty; +- state.localMode = smartyMode; +- state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, "")); +- return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState)); +- } else if (!state.inLiteral && stream.match(settings.leftDelimiter, false)) { +- state.tokenize = parsers.smarty; +- state.localMode = smartyMode; +- state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, "")); +- return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState)); +- } +- return htmlMixedMode.token(stream, state.htmlMixedState); +- }, +- +- smarty: function(stream, state) { +- if (stream.match(settings.leftDelimiter, false)) { +- if (stream.match(regs.smartyComment, false)) { +- return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter)); +- } +- } else if (stream.match(settings.rightDelimiter, false)) { +- stream.eat(settings.rightDelimiter); +- state.tokenize = parsers.html; +- state.localMode = htmlMixedMode; +- state.localState = state.htmlMixedState; +- return "tag"; +- } +- +- return helpers.maybeBackup(stream, settings.rightDelimiter, smartyMode.token(stream, state.localState)); +- }, +- +- inBlock: function(style, terminator) { +- return function(stream, state) { +- while (!stream.eol()) { +- if (stream.match(terminator)) { +- helpers.cleanChain(stream, state, ""); +- break; +- } +- stream.next(); +- } +- return style; +- }; +- } +- }; +- +- return { +- startState: function() { +- var state = htmlMixedMode.startState(); +- return { +- token: parsers.html, +- localMode: null, +- localState: null, +- htmlMixedState: state, +- tokenize: null, +- inLiteral: false +- }; +- }, +- +- copyState: function(state) { +- var local = null, tok = (state.tokenize || state.token); +- if (state.localState) { +- local = CodeMirror.copyState((tok != parsers.html ? smartyMode : htmlMixedMode), state.localState); +- } +- return { +- token: state.token, +- tokenize: state.tokenize, +- localMode: state.localMode, +- localState: local, +- htmlMixedState: CodeMirror.copyState(htmlMixedMode, state.htmlMixedState), +- inLiteral: state.inLiteral +- }; +- }, +- +- token: function(stream, state) { +- if (stream.match(settings.leftDelimiter, false)) { +- if (!state.inLiteral && stream.match(regs.literalOpen, true)) { +- state.inLiteral = true; +- return "keyword"; +- } else if (state.inLiteral && stream.match(regs.literalClose, true)) { +- state.inLiteral = false; +- return "keyword"; +- } +- } +- if (state.inLiteral && state.localState != state.htmlMixedState) { +- state.tokenize = parsers.html; +- state.localMode = htmlMixedMode; +- state.localState = state.htmlMixedState; +- } +- +- var style = (state.tokenize || state.token)(stream, state); +- return style; +- }, +- +- indent: function(state, textAfter) { +- if (state.localMode == smartyMode +- || (state.inLiteral && !state.localMode) +- || regs.hasLeftDelimeter.test(textAfter)) { +- return CodeMirror.Pass; +- } +- return htmlMixedMode.indent(state.htmlMixedState, textAfter); +- }, +- +- innerMode: function(state) { +- return { +- state: state.localState || state.htmlMixedState, +- mode: state.localMode || htmlMixedMode +- }; +- } +- }; +-}, "htmlmixed", "smarty"); +- +-CodeMirror.defineMIME("text/x-smarty", "smartymixed"); +-// vim: et ts=2 sts=2 sw=2 +- +-}); +diff --git a/media/editors/codemirror/mode/smartymixed/smartymixed.min.js b/media/editors/codemirror/mode/smartymixed/smartymixed.min.js +deleted file mode 100644 +index e038748..0000000 +--- a/media/editors/codemirror/mode/smartymixed/smartymixed.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../smarty/smarty")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../smarty/smarty"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("smartymixed",function(e){function l(t){return t.replace(/[^\s\w]/g,"\\$&")}var i=t.getMode(e,"htmlmixed"),a=t.getMode(e,"smarty"),r={rightDelimiter:"}",leftDelimiter:"{"};e.hasOwnProperty("leftDelimiter")&&(r.leftDelimiter=e.leftDelimiter),e.hasOwnProperty("rightDelimiter")&&(r.rightDelimiter=e.rightDelimiter);var n=l(r.leftDelimiter),o=l(r.rightDelimiter),m={smartyComment:new RegExp("^"+o+"\\*"),literalOpen:new RegExp(n+"literal"+o),literalClose:new RegExp(n+"/literal"+o),hasLeftDelimeter:new RegExp(".*"+n),htmlHasLeftDelimeter:new RegExp("[^<>]*"+n)},c={chain:function(t,e,l){return e.tokenize=l,l(t,e)},cleanChain:function(t,e,l){return e.tokenize=null,e.localState=null,e.localMode=null,"string"==typeof l?l?l:null:l(t,e)},maybeBackup:function(t,e,l){var i,a=t.current(),r=a.search(e);return r>-1?t.backUp(a.length-r):(i=a.match(/<\/?$/))&&(t.backUp(a.length),t.match(e,!1)||t.match(a[0])),l}},h={html:function(t,e){var l=e.htmlMixedState.htmlState.context&&e.htmlMixedState.htmlState.context.tagName?e.htmlMixedState.htmlState.context.tagName:null;return!e.inLiteral&&t.match(m.htmlHasLeftDelimeter,!1)&&null===l?(e.tokenize=h.smarty,e.localMode=a,e.localState=a.startState(i.indent(e.htmlMixedState,"")),c.maybeBackup(t,r.leftDelimiter,a.token(t,e.localState))):!e.inLiteral&&t.match(r.leftDelimiter,!1)?(e.tokenize=h.smarty,e.localMode=a,e.localState=a.startState(i.indent(e.htmlMixedState,"")),c.maybeBackup(t,r.leftDelimiter,a.token(t,e.localState))):i.token(t,e.htmlMixedState)},smarty:function(t,e){if(t.match(r.leftDelimiter,!1)){if(t.match(m.smartyComment,!1))return c.chain(t,e,h.inBlock("comment","*"+r.rightDelimiter))}else if(t.match(r.rightDelimiter,!1))return t.eat(r.rightDelimiter),e.tokenize=h.html,e.localMode=i,e.localState=e.htmlMixedState,"tag";return c.maybeBackup(t,r.rightDelimiter,a.token(t,e.localState))},inBlock:function(t,e){return function(l,i){for(;!l.eol();){if(l.match(e)){c.cleanChain(l,i,"");break}l.next()}return t}}};return{startState:function(){var t=i.startState();return{token:h.html,localMode:null,localState:null,htmlMixedState:t,tokenize:null,inLiteral:!1}},copyState:function(e){var l=null,r=e.tokenize||e.token;return e.localState&&(l=t.copyState(r!=h.html?a:i,e.localState)),{token:e.token,tokenize:e.tokenize,localMode:e.localMode,localState:l,htmlMixedState:t.copyState(i,e.htmlMixedState),inLiteral:e.inLiteral}},token:function(t,e){if(t.match(r.leftDelimiter,!1)){if(!e.inLiteral&&t.match(m.literalOpen,!0))return e.inLiteral=!0,"keyword";if(e.inLiteral&&t.match(m.literalClose,!0))return e.inLiteral=!1,"keyword"}e.inLiteral&&e.localState!=e.htmlMixedState&&(e.tokenize=h.html,e.localMode=i,e.localState=e.htmlMixedState);var l=(e.tokenize||e.token)(t,e);return l},indent:function(e,l){return e.localMode==a||e.inLiteral&&!e.localMode||m.hasLeftDelimeter.test(l)?t.Pass:i.indent(e.htmlMixedState,l)},innerMode:function(t){return{state:t.localState||t.htmlMixedState,mode:t.localMode||i}}}},"htmlmixed","smarty"),t.defineMIME("text/x-smarty","smartymixed")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/solr/solr.min.js b/media/editors/codemirror/mode/solr/solr.min.js +index e7af1e6..8927782 100644 +--- a/media/editors/codemirror/mode/solr/solr.min.js ++++ b/media/editors/codemirror/mode/solr/solr.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("solr",function(){function e(e){return parseFloat(e,10).toString()===e}function t(e){return function(t,n){for(var r,i=!1;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=o),"string"}}function n(e){return function(t,n){var r="operator";return"+"==e?r+=" positive":"-"==e?r+=" negative":"|"==e?t.eat(/\|/):"&"==e?t.eat(/\&/):"^"==e&&(r+=" boost"),n.tokenize=o,r}}function r(t){return function(n,r){for(var u=t;(t=n.peek())&&null!=t.match(i);)u+=n.next();return r.tokenize=o,f.test(u)?"operator":e(u)?"number":":"==n.peek()?"field":"string"}}function o(e,f){var c=e.next();return'"'==c?f.tokenize=t(c):u.test(c)?f.tokenize=n(c):i.test(c)&&(f.tokenize=r(c)),f.tokenize!=o?f.tokenize(e,f):null}var i=/[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/,u=/[\|\!\+\-\*\?\~\^\&]/,f=/^(OR|AND|NOT|TO)$/i;return{startState:function(){return{tokenize:o}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)}}}),e.defineMIME("text/x-solr","solr")}); +\ 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("solr",function(){function a(a){return parseFloat(a,10).toString()===a}function b(a){return function(b,c){for(var d,f=!1;null!=(d=b.next())&&(d!=a||f);)f=!f&&"\\"==d;return f||(c.tokenize=e),"string"}}function c(a){return function(b,c){var d="operator";return"+"==a?d+=" positive":"-"==a?d+=" negative":"|"==a?b.eat(/\|/):"&"==a?b.eat(/\&/):"^"==a&&(d+=" boost"),c.tokenize=e,d}}function d(b){return function(c,d){for(var g=b;(b=c.peek())&&null!=b.match(f);)g+=c.next();return d.tokenize=e,h.test(g)?"operator":a(g)?"number":":"==c.peek()?"field":"string"}}function e(a,h){var i=a.next();return'"'==i?h.tokenize=b(i):g.test(i)?h.tokenize=c(i):f.test(i)&&(h.tokenize=d(i)),h.tokenize!=e?h.tokenize(a,h):null}var f=/[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/,g=/[\|\!\+\-\*\?\~\^\&]/,h=/^(OR|AND|NOT|TO)$/i;return{startState:function(){return{tokenize:e}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)}}}),a.defineMIME("text/x-solr","solr")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/soy/soy.js b/media/editors/codemirror/mode/soy/soy.js +index 7e81e8d..79bfc24 100644 +--- a/media/editors/codemirror/mode/soy/soy.js ++++ b/media/editors/codemirror/mode/soy/soy.js +@@ -96,7 +96,7 @@ + else state.indent -= (stream.current() == "/}" || indentingTags.indexOf(state.tag) == -1 ? 2 : 1) * config.indentUnit; + state.soyState.pop(); + return "keyword"; +- } else if (stream.match(/^(\w+)(?==)/)) { ++ } else if (stream.match(/^([\w?]+)(?==)/)) { + if (stream.current() == "kind" && (match = stream.match(/^="([^"]+)/, false))) { + var kind = match[1]; + state.kind.push(kind); +@@ -134,7 +134,7 @@ + return "comment"; + } else if (stream.match(stream.sol() ? /^\s*\/\/.*/ : /^\s+\/\/.*/)) { + return "comment"; +- } else if (stream.match(/^\{\$\w*/)) { ++ } else if (stream.match(/^\{\$[\w?]*/)) { + state.indent += 2 * config.indentUnit; + state.soyState.push("variable"); + return "variable-2"; +@@ -142,7 +142,7 @@ + state.indent += config.indentUnit; + state.soyState.push("literal"); + return "keyword"; +- } else if (match = stream.match(/^\{([\/@\\]?\w*)/)) { ++ } else if (match = stream.match(/^\{([\/@\\]?[\w?]*)/)) { + if (match[1] != "/switch") + state.indent += (/^(\/|(else|elseif|case|default)$)/.test(match[1]) && state.tag != "switch" ? 1 : 2) * config.indentUnit; + state.tag = match[1]; +diff --git a/media/editors/codemirror/mode/soy/soy.min.js b/media/editors/codemirror/mode/soy/soy.min.js +index aef317f..f176f29 100644 +--- a/media/editors/codemirror/mode/soy/soy.min.js ++++ b/media/editors/codemirror/mode/soy/soy.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],t):t(CodeMirror)}(function(t){"use strict";var e=["template","literal","msg","fallbackmsg","let","if","elseif","else","switch","case","default","foreach","ifempty","for","call","param","deltemplate","delcall","log"];t.defineMode("soy",function(n){function a(t){return t[t.length-1]}function i(t,e,n){var a=t.string,i=n.exec(a.substr(t.pos));i&&(t.string=a.substr(0,t.pos+i.index));var l=t.hideFirstChars(e.indent,function(){return e.localMode.token(t,e.localState)});return t.string=a,l}var l=t.getMode(n,"text/plain"),o={html:t.getMode(n,{name:"text/html",multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:l,text:l,uri:l,css:t.getMode(n,"text/css"),js:t.getMode(n,{name:"text/javascript",statementIndent:2*n.indentUnit})};return{startState:function(){return{kind:[],kindTag:[],soyState:[],indent:0,localMode:o.html,localState:t.startState(o.html)}},copyState:function(e){return{tag:e.tag,kind:e.kind.concat([]),kindTag:e.kindTag.concat([]),soyState:e.soyState.concat([]),indent:e.indent,localMode:e.localMode,localState:t.copyState(e.localMode,e.localState)}},token:function(l,s){var r;switch(a(s.soyState)){case"comment":return l.match(/^.*?\*\//)?s.soyState.pop():l.skipToEnd(),"comment";case"variable":return l.match(/^}/)?(s.indent-=2*n.indentUnit,s.soyState.pop(),"variable-2"):(l.next(),null);case"tag":if(l.match(/^\/?}/))return"/template"==s.tag||"/deltemplate"==s.tag?s.indent=0:s.indent-=("/}"==l.current()||-1==e.indexOf(s.tag)?2:1)*n.indentUnit,s.soyState.pop(),"keyword";if(l.match(/^(\w+)(?==)/)){if("kind"==l.current()&&(r=l.match(/^="([^"]+)/,!1))){var c=r[1];s.kind.push(c),s.kindTag.push(s.tag),s.localMode=o[c]||o.html,s.localState=t.startState(s.localMode)}return"attribute"}return l.match(/^"/)?(s.soyState.push("string"),"string"):(l.next(),null);case"literal":return l.match(/^(?=\{\/literal})/)?(s.indent-=n.indentUnit,s.soyState.pop(),this.token(l,s)):i(l,s,/\{\/literal}/);case"string":return l.match(/^.*?"/)?s.soyState.pop():l.skipToEnd(),"string"}return l.match(/^\/\*/)?(s.soyState.push("comment"),"comment"):l.match(l.sol()?/^\s*\/\/.*/:/^\s+\/\/.*/)?"comment":l.match(/^\{\$\w*/)?(s.indent+=2*n.indentUnit,s.soyState.push("variable"),"variable-2"):l.match(/^\{literal}/)?(s.indent+=n.indentUnit,s.soyState.push("literal"),"keyword"):(r=l.match(/^\{([\/@\\]?\w*)/))?("/switch"!=r[1]&&(s.indent+=(/^(\/|(else|elseif|case|default)$)/.test(r[1])&&"switch"!=s.tag?1:2)*n.indentUnit),s.tag=r[1],s.tag=="/"+a(s.kindTag)&&(s.kind.pop(),s.kindTag.pop(),s.localMode=o[a(s.kind)]||o.html,s.localState=t.startState(s.localMode)),s.soyState.push("tag"),"keyword"):i(l,s,/\{|\s+\/\/|\/\*/)},indent:function(e,i){var l=e.indent,o=a(e.soyState);if("comment"==o)return t.Pass;if("literal"==o)/^\{\/literal}/.test(i)&&(l-=n.indentUnit);else{if(/^\s*\{\/(template|deltemplate)\b/.test(i))return 0;/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(i)&&(l-=n.indentUnit),"switch"!=e.tag&&/^\{(case|default)\b/.test(i)&&(l-=n.indentUnit),/^\{\/switch\b/.test(i)&&(l-=n.indentUnit)}return l&&e.localMode.indent&&(l+=e.localMode.indent(e.localState,i)),l},innerMode:function(t){return t.soyState.length&&"literal"!=a(t.soyState)?null:{state:t.localState,mode:t.localMode}},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",fold:"indent"}},"htmlmixed"),t.registerHelper("hintWords","soy",e.concat(["delpackage","namespace","alias","print","css","debugger"])),t.defineMIME("text/x-soy","soy")}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],a):a(CodeMirror)}(function(a){"use strict";var b=["template","literal","msg","fallbackmsg","let","if","elseif","else","switch","case","default","foreach","ifempty","for","call","param","deltemplate","delcall","log"];a.defineMode("soy",function(c){function d(a){return a[a.length-1]}function e(a,b,c){var d=a.string,e=c.exec(d.substr(a.pos));e&&(a.string=d.substr(0,a.pos+e.index));var f=a.hideFirstChars(b.indent,function(){return b.localMode.token(a,b.localState)});return a.string=d,f}var f=a.getMode(c,"text/plain"),g={html:a.getMode(c,{name:"text/html",multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:f,text:f,uri:f,css:a.getMode(c,"text/css"),js:a.getMode(c,{name:"text/javascript",statementIndent:2*c.indentUnit})};return{startState:function(){return{kind:[],kindTag:[],soyState:[],indent:0,localMode:g.html,localState:a.startState(g.html)}},copyState:function(b){return{tag:b.tag,kind:b.kind.concat([]),kindTag:b.kindTag.concat([]),soyState:b.soyState.concat([]),indent:b.indent,localMode:b.localMode,localState:a.copyState(b.localMode,b.localState)}},token:function(f,h){var i;switch(d(h.soyState)){case"comment":return f.match(/^.*?\*\//)?h.soyState.pop():f.skipToEnd(),"comment";case"variable":return f.match(/^}/)?(h.indent-=2*c.indentUnit,h.soyState.pop(),"variable-2"):(f.next(),null);case"tag":if(f.match(/^\/?}/))return"/template"==h.tag||"/deltemplate"==h.tag?h.indent=0:h.indent-=("/}"==f.current()||-1==b.indexOf(h.tag)?2:1)*c.indentUnit,h.soyState.pop(),"keyword";if(f.match(/^([\w?]+)(?==)/)){if("kind"==f.current()&&(i=f.match(/^="([^"]+)/,!1))){var j=i[1];h.kind.push(j),h.kindTag.push(h.tag),h.localMode=g[j]||g.html,h.localState=a.startState(h.localMode)}return"attribute"}return f.match(/^"/)?(h.soyState.push("string"),"string"):(f.next(),null);case"literal":return f.match(/^(?=\{\/literal})/)?(h.indent-=c.indentUnit,h.soyState.pop(),this.token(f,h)):e(f,h,/\{\/literal}/);case"string":return f.match(/^.*?"/)?h.soyState.pop():f.skipToEnd(),"string"}return f.match(/^\/\*/)?(h.soyState.push("comment"),"comment"):f.match(f.sol()?/^\s*\/\/.*/:/^\s+\/\/.*/)?"comment":f.match(/^\{\$[\w?]*/)?(h.indent+=2*c.indentUnit,h.soyState.push("variable"),"variable-2"):f.match(/^\{literal}/)?(h.indent+=c.indentUnit,h.soyState.push("literal"),"keyword"):(i=f.match(/^\{([\/@\\]?[\w?]*)/))?("/switch"!=i[1]&&(h.indent+=(/^(\/|(else|elseif|case|default)$)/.test(i[1])&&"switch"!=h.tag?1:2)*c.indentUnit),h.tag=i[1],h.tag=="/"+d(h.kindTag)&&(h.kind.pop(),h.kindTag.pop(),h.localMode=g[d(h.kind)]||g.html,h.localState=a.startState(h.localMode)),h.soyState.push("tag"),"keyword"):e(f,h,/\{|\s+\/\/|\/\*/)},indent:function(b,e){var f=b.indent,g=d(b.soyState);if("comment"==g)return a.Pass;if("literal"==g)/^\{\/literal}/.test(e)&&(f-=c.indentUnit);else{if(/^\s*\{\/(template|deltemplate)\b/.test(e))return 0;/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(e)&&(f-=c.indentUnit),"switch"!=b.tag&&/^\{(case|default)\b/.test(e)&&(f-=c.indentUnit),/^\{\/switch\b/.test(e)&&(f-=c.indentUnit)}return f&&b.localMode.indent&&(f+=b.localMode.indent(b.localState,e)),f},innerMode:function(a){return a.soyState.length&&"literal"!=d(a.soyState)?null:{state:a.localState,mode:a.localMode}},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",fold:"indent"}},"htmlmixed"),a.registerHelper("hintWords","soy",b.concat(["delpackage","namespace","alias","print","css","debugger"])),a.defineMIME("text/x-soy","soy")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/sparql/sparql.min.js b/media/editors/codemirror/mode/sparql/sparql.min.js +index ed0d471..bad2eef 100644 +--- a/media/editors/codemirror/mode/sparql/sparql.min.js ++++ b/media/editors/codemirror/mode/sparql/sparql.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("sparql",function(t){function e(t){return new RegExp("^(?:"+t.join("|")+")$","i")}function n(t,e){var n=t.next();if(a=null,"$"==n||"?"==n)return"?"==n&&t.match(/\s/,!1)?"operator":(t.match(/^[\w\d]*/),"variable-2");if("<"!=n||t.match(/^[\s\u00a0=]/,!1)){if('"'==n||"'"==n)return e.tokenize=r(n),e.tokenize(t,e);if(/[{}\(\),\.;\[\]]/.test(n))return a=n,"bracket";if("#"==n)return t.skipToEnd(),"comment";if(l.test(n))return t.eatWhile(l),"operator";if(":"==n)return t.eatWhile(/[\w\d\._\-]/),"atom";if("@"==n)return t.eatWhile(/[a-z\d\-]/i),"meta";if(t.eatWhile(/[_\w\d]/),t.eat(":"))return t.eatWhile(/[\w\d_\-]/),"atom";var i=t.current();return s.test(i)?"builtin":u.test(i)?"keyword":"variable"}return t.match(/^[^\s\u00a0>]*>?/),"atom"}function r(t){return function(e,r){for(var i,o=!1;null!=(i=e.next());){if(i==t&&!o){r.tokenize=n;break}o=!o&&"\\"==i}return"string"}}function i(t,e,n){t.context={prev:t.context,indent:t.indent,col:n,type:e}}function o(t){t.indent=t.context.indent,t.context=t.context.prev}var a,c=t.indentUnit,s=e(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","iri","uri","bnode","count","sum","min","max","avg","sample","group_concat","rand","abs","ceil","floor","round","concat","substr","strlen","replace","ucase","lcase","encode_for_uri","contains","strstarts","strends","strbefore","strafter","year","month","day","hours","minutes","seconds","timezone","tz","now","uuid","struuid","md5","sha1","sha256","sha384","sha512","coalesce","if","strlang","strdt","isnumeric","regex","exists","isblank","isliteral","a"]),u=e(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc","as","having","undef","values","group","minus","in","not","service","silent","using","insert","delete","union","true","false","with","data","copy","to","move","add","create","drop","clear","load"]),l=/[*+\-<>=&|\^\/!\?]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(t,e){if(t.sol()&&(e.context&&null==e.context.align&&(e.context.align=!1),e.indent=t.indentation()),t.eatSpace())return null;var n=e.tokenize(t,e);if("comment"!=n&&e.context&&null==e.context.align&&"pattern"!=e.context.type&&(e.context.align=!0),"("==a)i(e,")",t.column());else if("["==a)i(e,"]",t.column());else if("{"==a)i(e,"}",t.column());else if(/[\]\}\)]/.test(a)){for(;e.context&&"pattern"==e.context.type;)o(e);e.context&&a==e.context.type&&o(e)}else"."==a&&e.context&&"pattern"==e.context.type?o(e):/atom|string|variable/.test(n)&&e.context&&(/[\}\]]/.test(e.context.type)?i(e,"pattern",t.column()):"pattern"!=e.context.type||e.context.align||(e.context.align=!0,e.context.col=t.column()));return n},indent:function(t,e){var n=e&&e.charAt(0),r=t.context;if(/[\]\}]/.test(n))for(;r&&"pattern"==r.type;)r=r.prev;var i=r&&n==r.type;return r?"pattern"==r.type?r.col:r.align?r.col+(i?0:1):r.indent+(i?0:c):0}}}),t.defineMIME("application/sparql-query","sparql")}); +\ 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("sparql",function(a){function b(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function c(a,b){var c=a.next();if(g=null,"$"==c||"?"==c)return"?"==c&&a.match(/\s/,!1)?"operator":(a.match(/^[\w\d]*/),"variable-2");if("<"!=c||a.match(/^[\s\u00a0=]/,!1)){if('"'==c||"'"==c)return b.tokenize=d(c),b.tokenize(a,b);if(/[{}\(\),\.;\[\]]/.test(c))return g=c,"bracket";if("#"==c)return a.skipToEnd(),"comment";if(k.test(c))return a.eatWhile(k),"operator";if(":"==c)return a.eatWhile(/[\w\d\._\-]/),"atom";if("@"==c)return a.eatWhile(/[a-z\d\-]/i),"meta";if(a.eatWhile(/[_\w\d]/),a.eat(":"))return a.eatWhile(/[\w\d_\-]/),"atom";var e=a.current();return i.test(e)?"builtin":j.test(e)?"keyword":"variable"}return a.match(/^[^\s\u00a0>]*>?/),"atom"}function d(a){return function(b,d){for(var e,f=!1;null!=(e=b.next());){if(e==a&&!f){d.tokenize=c;break}f=!f&&"\\"==e}return"string"}}function e(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function f(a){a.indent=a.context.indent,a.context=a.context.prev}var g,h=a.indentUnit,i=b(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","iri","uri","bnode","count","sum","min","max","avg","sample","group_concat","rand","abs","ceil","floor","round","concat","substr","strlen","replace","ucase","lcase","encode_for_uri","contains","strstarts","strends","strbefore","strafter","year","month","day","hours","minutes","seconds","timezone","tz","now","uuid","struuid","md5","sha1","sha256","sha384","sha512","coalesce","if","strlang","strdt","isnumeric","regex","exists","isblank","isliteral","a"]),j=b(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc","as","having","undef","values","group","minus","in","not","service","silent","using","insert","delete","union","true","false","with","data","copy","to","move","add","create","drop","clear","load"]),k=/[*+\-<>=&|\^\/!\?]/;return{startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(a,b){if(a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);if("comment"!=c&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==g)e(b,")",a.column());else if("["==g)e(b,"]",a.column());else if("{"==g)e(b,"}",a.column());else if(/[\]\}\)]/.test(g)){for(;b.context&&"pattern"==b.context.type;)f(b);b.context&&g==b.context.type&&f(b)}else"."==g&&b.context&&"pattern"==b.context.type?f(b):/atom|string|variable/.test(c)&&b.context&&(/[\}\]]/.test(b.context.type)?e(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return c},indent:function(a,b){var c=b&&b.charAt(0),d=a.context;if(/[\]\}]/.test(c))for(;d&&"pattern"==d.type;)d=d.prev;var e=d&&c==d.type;return d?"pattern"==d.type?d.col:d.align?d.col+(e?0:1):d.indent+(e?0:h):0}}}),a.defineMIME("application/sparql-query","sparql")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js b/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js +index b782706..7ed51e3 100644 +--- a/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js ++++ b/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("spreadsheet",function(){return{startState:function(){return{stringType:null,stack:[]}},token:function(e,t){if(e){switch(0===t.stack.length&&('"'==e.peek()||"'"==e.peek())&&(t.stringType=e.peek(),e.next(),t.stack.unshift("string")),t.stack[0]){case"string":for(;"string"===t.stack[0]&&!e.eol();)e.peek()===t.stringType?(e.next(),t.stack.shift()):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return"string";case"characterClass":for(;"characterClass"===t.stack[0]&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(/^\\./)||t.stack.shift();return"operator"}var r=e.peek();switch(r){case"[":return e.next(),t.stack.unshift("characterClass"),"bracket";case":":return e.next(),"operator";case"\\":return e.match(/\\[a-z]+/)?"string-2":null;case".":case",":case";":case"*":case"-":case"+":case"^":case"<":case"/":case"=":return e.next(),"atom";case"$":return e.next(),"builtin"}return e.match(/\d+/)?e.match(/^\w+/)?"error":"number":e.match(/^[a-zA-Z_]\w*/)?e.match(/(?=[\(.])/,!1)?"keyword":"variable-2":-1!=["[","]","(",")","{","}"].indexOf(r)?(e.next(),"bracket"):(e.eatSpace()||e.next(),null)}}}}),e.defineMIME("text/x-spreadsheet","spreadsheet")}); +\ 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("spreadsheet",function(){return{startState:function(){return{stringType:null,stack:[]}},token:function(a,b){if(a){switch(0===b.stack.length&&('"'==a.peek()||"'"==a.peek())&&(b.stringType=a.peek(),a.next(),b.stack.unshift("string")),b.stack[0]){case"string":for(;"string"===b.stack[0]&&!a.eol();)a.peek()===b.stringType?(a.next(),b.stack.shift()):"\\"===a.peek()?(a.next(),a.next()):a.match(/^.[^\\\"\']*/);return"string";case"characterClass":for(;"characterClass"===b.stack[0]&&!a.eol();)a.match(/^[^\]\\]+/)||a.match(/^\\./)||b.stack.shift();return"operator"}var c=a.peek();switch(c){case"[":return a.next(),b.stack.unshift("characterClass"),"bracket";case":":return a.next(),"operator";case"\\":return a.match(/\\[a-z]+/)?"string-2":null;case".":case",":case";":case"*":case"-":case"+":case"^":case"<":case"/":case"=":return a.next(),"atom";case"$":return a.next(),"builtin"}return a.match(/\d+/)?a.match(/^\w+/)?"error":"number":a.match(/^[a-zA-Z_]\w*/)?a.match(/(?=[\(.])/,!1)?"keyword":"variable-2":-1!=["[","]","(",")","{","}"].indexOf(c)?(a.next(),"bracket"):(a.eatSpace()||a.next(),null)}}}}),a.defineMIME("text/x-spreadsheet","spreadsheet")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/sql/sql.js b/media/editors/codemirror/mode/sql/sql.js +index ee6c194..a908277 100644 +--- a/media/editors/codemirror/mode/sql/sql.js ++++ b/media/editors/codemirror/mode/sql/sql.js +@@ -257,7 +257,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { + } + + // these keywords are used by all SQL dialects (however, a mode can still overwrite it) +- var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where "; ++ var sqlKeywords = "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 "; + + // turn a space-separated list into an array + function set(str) { +@@ -280,7 +280,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { + CodeMirror.defineMIME("text/x-mssql", { + name: "sql", + client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), +- keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"), ++ keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"), + builtin: set("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: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=]/, +@@ -293,7 +293,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { + CodeMirror.defineMIME("text/x-mysql", { + name: "sql", + client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), +- keywords: set(sqlKeywords + "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 groupby_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"), ++ keywords: set(sqlKeywords + "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: set("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: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^]/, +@@ -327,9 +327,9 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { + CodeMirror.defineMIME("text/x-cassandra", { + name: "sql", + client: { }, +- keywords: set("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"), +- builtin: set("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"), +- atoms: set("false true"), ++ keywords: set("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: set("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"), ++ atoms: set("false true infinity NaN"), + operatorChars: /^[<>=]/, + dateSQL: { }, + support: set("commentSlashSlash decimallessFloat"), +diff --git a/media/editors/codemirror/mode/sql/sql.min.js b/media/editors/codemirror/mode/sql/sql.min.js +index d88b691..de95e20 100644 +--- a/media/editors/codemirror/mode/sql/sql.min.js ++++ b/media/editors/codemirror/mode/sql/sql.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,r){function a(e,t){var r=e.next();if(b[r]){var a=b[r](e,t);if(a!==!1)return a}if(1==p.hexNumber&&("0"==r&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==r||"X"==r)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==r||"B"==r)&&e.match(/^'[01]+'/)||"0"==r&&e.match(/^b[01]+/)))return"number";if(r.charCodeAt(0)>47&&r.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==r&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==r||'"'==r&&p.doubleQuote)return t.tokenize=n(r),t.tokenize(e,t);if((1==p.nCharCast&&("n"==r||"N"==r)||1==p.charsetCast&&"_"==r&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(r))return null;if(p.commentSlashSlash&&"/"==r&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==r||"-"==r&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==r&&e.eat("*"))return t.tokenize=i,t.tokenize(e,t);if("."!=r){if(m.test(r))return e.eatWhile(m),null;if("{"==r&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var o=e.current().toLowerCase();return h.hasOwnProperty(o)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(o)?"atom":u.hasOwnProperty(o)?"builtin":d.hasOwnProperty(o)?"keyword":l.hasOwnProperty(o)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function n(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){r.tokenize=a;break}i=!i&&"\\"==n}return"string"}}function i(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=a;break}}return"comment"}function o(e,t,r){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:r}}function s(e){e.indent=e.context.indent,e.context=e.context.prev}var l=r.client||{},c=r.atoms||{"false":!0,"true":!0,"null":!0},u=r.builtin||{},d=r.keywords||{},m=r.operatorChars||/^[*+\-%<>!=&|~^]/,p=r.support||{},b=r.hooks||{},h=r.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:a,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var r=t.tokenize(e,t);if("comment"==r)return r;t.context&&null==t.context.align&&(t.context.align=!0);var a=e.current();return"("==a?o(e,t,")"):"["==a?o(e,t,"]"):t.context&&t.context.type==a&&s(t),r},indent:function(r,a){var n=r.context;if(!n)return e.Pass;var i=a.charAt(0)==n.type;return n.align?n.col+(i?0:1):n.indent+(i?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function r(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function a(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function n(e){for(var t={},r=e.split(" "),a=0;a!=]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),builtin:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:n("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":r}}),e.defineMIME("text/x-mysql",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"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 groupby_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:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":a}}),e.defineMIME("text/x-mariadb",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"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:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":a}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:n("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"),builtin:n("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"),atoms:n("false true"),operatorChars:/^[<>=]/,dateSQL:{},support:n("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:n("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:n("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:n("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 lenght lenghtb 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:n("date time timestamp"),support:n("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:n("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:n("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:n("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:n("date timestamp"),support:n("ODBCdotTable doubleQuote 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(1==n.hexNumber&&("0"==c&&a.match(/^[xX][0-9a-fA-F]+/)||("x"==c||"X"==c)&&a.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==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]+)?/),1==n.decimallessFloat&&a.eat("."),"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((1==n.nCharCast&&("n"==c||"N"==c)||1==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,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 1==n.zerolessFloat&&a.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==n.ODBCdotTable&&a.match(/^[a-zA-Z_]+/)?"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=!f&&"\\"==e}return"string"}}function f(a,b){for(;;){if(!a.skipTo("*")){a.skipToEnd();break}if(a.next(),a.eat("/")){b.tokenize=d;break}}return"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};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),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 d=a.current();return"("==d?g(a,b,")"):"["==d?g(a,b,"]"):b.context&&b.context.type==d&&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?"#":null}}),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){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 d(a){return a.eat("N")?"atom":a.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function e(a){for(var b={},c=a.split(" "),d=0;d!=]/,dateSQL:e("date time timestamp"),support:e("ODBCdotTable doubleQuote binaryNumber hexNumber")}),a.defineMIME("text/x-mssql",{name:"sql",client:e("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:e(f+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"),builtin:e("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:e("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:e("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":c}}),a.defineMIME("text/x-mysql",{name:"sql",client:e("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:e(f+"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:e("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:e("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:e("date time timestamp"),support:e("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":c,"`":b,"\\":d}}),a.defineMIME("text/x-mariadb",{name:"sql",client:e("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:e(f+"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:e("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:e("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:e("date time timestamp"),support:e("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":c,"`":b,"\\":d}}),a.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:e("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:e("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:e("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:e("commentSlashSlash decimallessFloat"),hooks:{}}),a.defineMIME("text/x-plsql",{name:"sql",client:e("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:e("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:e("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 lenght lenghtb 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:e("date time timestamp"),support:e("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),a.defineMIME("text/x-hive",{name:"sql",keywords:e("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:e("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:e("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:e("date timestamp"),support:e("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/stex/stex.min.js b/media/editors/codemirror/mode/stex/stex.min.js +index 66b9ba2..c58e9cd 100644 +--- a/media/editors/codemirror/mode/stex/stex.min.js ++++ b/media/editors/codemirror/mode/stex/stex.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("stex",function(){function t(t,e){t.cmdState.push(e)}function e(t){return t.cmdState.length>0?t.cmdState[t.cmdState.length-1]:null}function n(t){var e=t.cmdState.pop();e&&e.closeBracket()}function r(t){for(var e=t.cmdState,n=e.length-1;n>=0;n--){var r=e[n];if("DEFAULT"!=r.name)return r}return{styleIdentifier:function(){return null}}}function i(t,e,n){return function(){this.name=t,this.bracketNo=0,this.style=e,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}function a(t,e){t.f=e}function c(n,i){var c;if(n.match(/^\\[a-zA-Z@]+/)){var s=n.current().slice(1);return c=f[s]||f.DEFAULT,c=new c,t(i,c),a(i,o),c.style}if(n.match(/^\\[$&%#{}_]/))return"tag";if(n.match(/^\\[,;!\/\\]/))return"tag";if(n.match("\\["))return a(i,function(t,e){return u(t,e,"\\]")}),"keyword";if(n.match("$$"))return a(i,function(t,e){return u(t,e,"$$")}),"keyword";if(n.match("$"))return a(i,function(t,e){return u(t,e,"$")}),"keyword";var m=n.next();return"%"==m?(n.skipToEnd(),"comment"):"}"==m||"]"==m?(c=e(i))?(c.closeBracket(m),a(i,o),"bracket"):"error":"{"==m||"["==m?(c=f.DEFAULT,c=new c,t(i,c),"bracket"):/\d/.test(m)?(n.eatWhile(/[\w.%]/),"atom"):(n.eatWhile(/[\w\-_]/),c=r(i),"begin"==c.name&&(c.argument=n.current()),c.styleIdentifier())}function u(t,e,n){if(t.eatSpace())return null;if(t.match(n))return a(e,c),"keyword";if(t.match(/^\\[a-zA-Z@]+/))return"tag";if(t.match(/^[a-zA-Z]+/))return"variable-2";if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/]/))return"tag";if(t.match(/^[\^_&]/))return"tag";if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=t.next();return"{"==r||"}"==r||"["==r||"]"==r||"("==r||")"==r?"bracket":"%"==r?(t.skipToEnd(),"comment"):"error"}function o(t,r){var i,u=t.peek();return"{"==u||"["==u?(i=e(r),i.openBracket(u),t.eat(u),a(r,c),"bracket"):/[ \t\r]/.test(u)?(t.eat(u),null):(a(r,c),n(r),c(t,r))}var f={};return f.importmodule=i("importmodule","tag",["string","builtin"]),f.documentclass=i("documentclass","tag",["","atom"]),f.usepackage=i("usepackage","tag",["atom"]),f.begin=i("begin","tag",["atom"]),f.end=i("end","tag",["atom"]),f.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:c}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=c,t.cmdState.length=0},lineComment:"%"}}),t.defineMIME("text/x-stex","stex"),t.defineMIME("text/x-latex","stex")}); +\ 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("stex",function(){function a(a,b){a.cmdState.push(b)}function b(a){return a.cmdState.length>0?a.cmdState[a.cmdState.length-1]:null}function c(a){var b=a.cmdState.pop();b&&b.closeBracket()}function d(a){for(var b=a.cmdState,c=b.length-1;c>=0;c--){var d=b[c];if("DEFAULT"!=d.name)return d}return{styleIdentifier:function(){return null}}}function e(a,b,c){return function(){this.name=a,this.bracketNo=0,this.style=b,this.styles=c,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}function f(a,b){a.f=b}function g(c,e){var g;if(c.match(/^\\[a-zA-Z@]+/)){var k=c.current().slice(1);return g=j[k]||j.DEFAULT,g=new g,a(e,g),f(e,i),g.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return f(e,function(a,b){return h(a,b,"\\]")}),"keyword";if(c.match("$$"))return f(e,function(a,b){return h(a,b,"$$")}),"keyword";if(c.match("$"))return f(e,function(a,b){return h(a,b,"$")}),"keyword";var l=c.next();return"%"==l?(c.skipToEnd(),"comment"):"}"==l||"]"==l?(g=b(e))?(g.closeBracket(l),f(e,i),"bracket"):"error":"{"==l||"["==l?(g=j.DEFAULT,g=new g,a(e,g),"bracket"):/\d/.test(l)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),g=d(e),"begin"==g.name&&(g.argument=c.current()),g.styleIdentifier())}function h(a,b,c){if(a.eatSpace())return null;if(a.match(c))return f(b,g),"keyword";if(a.match(/^\\[a-zA-Z@]+/))return"tag";if(a.match(/^[a-zA-Z]+/))return"variable-2";if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/]/))return"tag";if(a.match(/^[\^_&]/))return"tag";if(a.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(a.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var d=a.next();return"{"==d||"}"==d||"["==d||"]"==d||"("==d||")"==d?"bracket":"%"==d?(a.skipToEnd(),"comment"):"error"}function i(a,d){var e,h=a.peek();return"{"==h||"["==h?(e=b(d),e.openBracket(h),a.eat(h),f(d,g),"bracket"):/[ \t\r]/.test(h)?(a.eat(h),null):(f(d,g),c(d),g(a,d))}var j={};return j.importmodule=e("importmodule","tag",["string","builtin"]),j.documentclass=e("documentclass","tag",["","atom"]),j.usepackage=e("usepackage","tag",["atom"]),j.begin=e("begin","tag",["atom"]),j.end=e("end","tag",["atom"]),j.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:g}},copyState:function(a){return{cmdState:a.cmdState.slice(),f:a.f}},token:function(a,b){return b.f(a,b)},blankLine:function(a){a.f=g,a.cmdState.length=0},lineComment:"%"}}),a.defineMIME("text/x-stex","stex"),a.defineMIME("text/x-latex","stex")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/stex/test.js b/media/editors/codemirror/mode/stex/test.js +deleted file mode 100644 +index 22f027e..0000000 +--- a/media/editors/codemirror/mode/stex/test.js ++++ /dev/null +@@ -1,123 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({tabSize: 4}, "stex"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- +- MT("word", +- "foo"); +- +- MT("twoWords", +- "foo bar"); +- +- MT("beginEndDocument", +- "[tag \\begin][bracket {][atom document][bracket }]", +- "[tag \\end][bracket {][atom document][bracket }]"); +- +- MT("beginEndEquation", +- "[tag \\begin][bracket {][atom equation][bracket }]", +- " E=mc^2", +- "[tag \\end][bracket {][atom equation][bracket }]"); +- +- MT("beginModule", +- "[tag \\begin][bracket {][atom module][bracket }[[]]]"); +- +- MT("beginModuleId", +- "[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]"); +- +- MT("importModule", +- "[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]"); +- +- MT("importModulePath", +- "[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]"); +- +- MT("psForPDF", +- "[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]"); +- +- MT("comment", +- "[comment % foo]"); +- +- MT("tagComment", +- "[tag \\item][comment % bar]"); +- +- MT("commentTag", +- " [comment % \\item]"); +- +- MT("commentLineBreak", +- "[comment %]", +- "foo"); +- +- MT("tagErrorCurly", +- "[tag \\begin][error }][bracket {]"); +- +- MT("tagErrorSquare", +- "[tag \\item][error ]]][bracket {]"); +- +- MT("commentCurly", +- "[comment % }]"); +- +- MT("tagHash", +- "the [tag \\#] key"); +- +- MT("tagNumber", +- "a [tag \\$][atom 5] stetson"); +- +- MT("tagPercent", +- "[atom 100][tag \\%] beef"); +- +- MT("tagAmpersand", +- "L [tag \\&] N"); +- +- MT("tagUnderscore", +- "foo[tag \\_]bar"); +- +- MT("tagBracketOpen", +- "[tag \\emph][bracket {][tag \\{][bracket }]"); +- +- MT("tagBracketClose", +- "[tag \\emph][bracket {][tag \\}][bracket }]"); +- +- MT("tagLetterNumber", +- "section [tag \\S][atom 1]"); +- +- MT("textTagNumber", +- "para [tag \\P][atom 2]"); +- +- MT("thinspace", +- "x[tag \\,]y"); +- +- MT("thickspace", +- "x[tag \\;]y"); +- +- MT("negativeThinspace", +- "x[tag \\!]y"); +- +- MT("periodNotSentence", +- "J.\\ L.\\ is"); +- +- MT("periodSentence", +- "X[tag \\@]. The"); +- +- MT("italicCorrection", +- "[bracket {][tag \\em] If[tag \\/][bracket }] I"); +- +- MT("tagBracket", +- "[tag \\newcommand][bracket {][tag \\pop][bracket }]"); +- +- MT("inlineMathTagFollowedByNumber", +- "[keyword $][tag \\pi][number 2][keyword $]"); +- +- MT("inlineMath", +- "[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text"); +- +- MT("displayMath", +- "More [keyword $$]\t[variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text"); +- +- MT("mathWithComment", +- "[keyword $][variable-2 x] [comment % $]", +- "[variable-2 y][keyword $] other text"); +- +- MT("lineBreakArgument", +- "[tag \\\\][bracket [[][atom 1cm][bracket ]]]"); +-})(); +diff --git a/media/editors/codemirror/mode/stex/test.min.js b/media/editors/codemirror/mode/stex/test.min.js +deleted file mode 100644 +index 3ca4b62..0000000 +--- a/media/editors/codemirror/mode/stex/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4},"stex");t("word","foo"),t("twoWords","foo bar"),t("beginEndDocument","[tag \\begin][bracket {][atom document][bracket }]","[tag \\end][bracket {][atom document][bracket }]"),t("beginEndEquation","[tag \\begin][bracket {][atom equation][bracket }]"," E=mc^2","[tag \\end][bracket {][atom equation][bracket }]"),t("beginModule","[tag \\begin][bracket {][atom module][bracket }[[]]]"),t("beginModuleId","[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]"),t("importModule","[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]"),t("importModulePath","[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]"),t("psForPDF","[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]"),t("comment","[comment % foo]"),t("tagComment","[tag \\item][comment % bar]"),t("commentTag"," [comment % \\item]"),t("commentLineBreak","[comment %]","foo"),t("tagErrorCurly","[tag \\begin][error }][bracket {]"),t("tagErrorSquare","[tag \\item][error ]]][bracket {]"),t("commentCurly","[comment % }]"),t("tagHash","the [tag \\#] key"),t("tagNumber","a [tag \\$][atom 5] stetson"),t("tagPercent","[atom 100][tag \\%] beef"),t("tagAmpersand","L [tag \\&] N"),t("tagUnderscore","foo[tag \\_]bar"),t("tagBracketOpen","[tag \\emph][bracket {][tag \\{][bracket }]"),t("tagBracketClose","[tag \\emph][bracket {][tag \\}][bracket }]"),t("tagLetterNumber","section [tag \\S][atom 1]"),t("textTagNumber","para [tag \\P][atom 2]"),t("thinspace","x[tag \\,]y"),t("thickspace","x[tag \\;]y"),t("negativeThinspace","x[tag \\!]y"),t("periodNotSentence","J.\\ L.\\ is"),t("periodSentence","X[tag \\@]. The"),t("italicCorrection","[bracket {][tag \\em] If[tag \\/][bracket }] I"),t("tagBracket","[tag \\newcommand][bracket {][tag \\pop][bracket }]"),t("inlineMathTagFollowedByNumber","[keyword $][tag \\pi][number 2][keyword $]"),t("inlineMath","[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text"),t("displayMath","More [keyword $$] [variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text"),t("mathWithComment","[keyword $][variable-2 x] [comment % $]","[variable-2 y][keyword $] other text"),t("lineBreakArgument","[tag \\\\][bracket [[][atom 1cm][bracket ]]]")}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/stylus/stylus.js b/media/editors/codemirror/mode/stylus/stylus.js +index 6f7c754..fc46a01 100644 +--- a/media/editors/codemirror/mode/stylus/stylus.js ++++ b/media/editors/codemirror/mode/stylus/stylus.js +@@ -1,6 +1,8 @@ + // CodeMirror, copyright (c) by Marijn Haverbeke and others + // Distributed under an MIT license: http://codemirror.net/LICENSE + ++// Stylus mode created by Dmitry Kiselyov http://git.io/AaRB ++ + (function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); +@@ -12,433 +14,755 @@ + "use strict"; + + CodeMirror.defineMode("stylus", function(config) { +- +- var operatorsRegexp = /^(\?:?|\+[+=]?|-[\-=]?|\*[\*=]?|\/=?|[=!:\?]?=|<=?|>=?|%=?|&&|\|=?|\~|!|\^|\\)/, +- delimitersRegexp = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/, +- wordOperatorsRegexp = wordRegexp(wordOperators), +- commonKeywordsRegexp = wordRegexp(commonKeywords), +- commonAtomsRegexp = wordRegexp(commonAtoms), +- commonDefRegexp = wordRegexp(commonDef), +- vendorPrefixesRegexp = new RegExp(/^\-(moz|ms|o|webkit)-/), +- cssValuesWithBracketsRegexp = new RegExp("^(" + cssValuesWithBrackets_.join("|") + ")\\([\\w\-\\#\\,\\.\\%\\s\\(\\)]*\\)"); +- +- var tokenBase = function(stream, state) { +- +- if (stream.eatSpace()) return null; +- +- var ch = stream.peek(); +- +- // Single line Comment +- if (stream.match('//')) { ++ var indentUnit = config.indentUnit, ++ tagKeywords = keySet(tagKeywords_), ++ tagVariablesRegexp = /^(a|b|i|s|col|em)$/i, ++ propertyKeywords = keySet(propertyKeywords_), ++ nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_), ++ valueKeywords = keySet(valueKeywords_), ++ colorKeywords = keySet(colorKeywords_), ++ documentTypes = keySet(documentTypes_), ++ documentTypesRegexp = wordRegexp(documentTypes_), ++ mediaFeatures = keySet(mediaFeatures_), ++ mediaTypes = keySet(mediaTypes_), ++ fontProperties = keySet(fontProperties_), ++ operatorsRegexp = /^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/, ++ wordOperatorKeywordsRegexp = wordRegexp(wordOperatorKeywords_), ++ blockKeywords = keySet(blockKeywords_), ++ vendorPrefixesRegexp = new RegExp(/^\-(moz|ms|o|webkit)-/i), ++ commonAtoms = keySet(commonAtoms_), ++ firstWordMatch = "", ++ states = {}, ++ ch, ++ style, ++ type, ++ override; ++ ++ /** ++ * Tokenizers ++ */ ++ function tokenBase(stream, state) { ++ firstWordMatch = stream.string.match(/(^[\w-]+\s*=\s*$)|(^\s*[\w-]+\s*=\s*[\w-])|(^\s*(\.|#|@|\$|\&|\[|\d|\+|::?|\{|\>|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/); ++ state.context.line.firstWord = firstWordMatch ? firstWordMatch[0].replace(/^\s*/, "") : ""; ++ state.context.line.indent = stream.indentation(); ++ ch = stream.peek(); ++ ++ // Line comment ++ if (stream.match("//")) { + stream.skipToEnd(); +- return "comment"; ++ return ["comment", "comment"]; + } +- +- // Multiline Comment +- if (stream.match('/*')) { +- state.tokenizer = multilineComment; +- return state.tokenizer(stream, state); ++ // Block comment ++ if (stream.match("/*")) { ++ state.tokenize = tokenCComment; ++ return tokenCComment(stream, state); + } +- +- // Strings +- if (ch === '"' || ch === "'") { ++ // String ++ if (ch == "\"" || ch == "'") { + stream.next(); +- state.tokenizer = buildStringTokenizer(ch); +- return "string"; ++ state.tokenize = tokenString(ch); ++ return state.tokenize(stream, state); + } +- + // Def +- if (ch === "@") { ++ if (ch == "@") { + stream.next(); +- if (stream.match(/extend/)) { +- dedent(state); // remove indentation after selectors +- } else if (stream.match(/media[\w-\s]*[\w-]/)) { +- indent(state); +- } else if(stream.eatWhile(/[\w-]/)) { +- if(stream.current().match(commonDefRegexp)) { +- indent(state); +- } +- } +- return "def"; +- } +- +- // Number +- if (stream.match(/^-?[0-9\.]/, false)) { +- +- // Floats +- if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i) || stream.match(/^-?\d+\.\d*/)) { +- +- // Prevent from getting extra . on 1.. +- if (stream.peek() == ".") { +- stream.backUp(1); +- } +- // Units +- stream.eatWhile(/[a-z%]/i); +- return "number"; +- } +- // Integers +- if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/) || stream.match(/^-?0(?![\dx])/i)) { +- // Units +- stream.eatWhile(/[a-z%]/i); +- return "number"; +- } ++ stream.eatWhile(/[\w\\-]/); ++ return ["def", stream.current()]; + } +- +- // Hex color and id selector +- if (ch === "#") { ++ // ID selector or Hex color ++ if (ch == "#") { + stream.next(); +- + // Hex color + if (stream.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i)) { +- return "atom"; ++ return ["atom", "atom"]; + } +- + // ID selector +- if (stream.match(/^[\w-]+/i)) { +- indent(state); +- return "builtin"; ++ if (stream.match(/^[a-z][\w-]*/i)) { ++ return ["builtin", "hash"]; + } + } +- + // Vendor prefixes + if (stream.match(vendorPrefixesRegexp)) { +- return "meta"; ++ return ["meta", "vendor-prefixes"]; + } +- +- // Gradients and animation as CSS value +- if (stream.match(cssValuesWithBracketsRegexp)) { +- return "atom"; ++ // Numbers ++ if (stream.match(/^-?[0-9]?\.?[0-9]/)) { ++ stream.eatWhile(/[a-z%]/i); ++ return ["number", "unit"]; + } +- +- // Mixins / Functions with indentation +- if (stream.sol() && stream.match(/^\.?[a-z][\w-]*\(/i)) { +- stream.backUp(1); +- indent(state); +- return "keyword"; ++ // !important|optional ++ if (ch == "!") { ++ stream.next(); ++ return [stream.match(/^(important|optional)/i) ? "keyword": "operator", "important"]; ++ } ++ // Class ++ if (ch == "." && stream.match(/^\.[a-z][\w-]*/i)) { ++ return ["qualifier", "qualifier"]; ++ } ++ // url url-prefix domain regexp ++ if (stream.match(documentTypesRegexp)) { ++ if (stream.peek() == "(") state.tokenize = tokenParenthesized; ++ return ["property", "word"]; + } +- + // Mixins / Functions +- if (stream.match(/^\.?[a-z][\w-]*\(/i)) { ++ if (stream.match(/^[a-z][\w-]*\(/i)) { + stream.backUp(1); +- return "keyword"; ++ return ["keyword", "mixin"]; + } +- +- // +Block mixins +- if (stream.match(/^(\+|\-)[a-z][\w-]+\(/i)) { ++ // Block mixins ++ if (stream.match(/^(\+|-)[a-z][\w-]*\(/i)) { + stream.backUp(1); +- indent(state); +- return "keyword"; ++ return ["keyword", "block-mixin"]; + } +- +- // url tokens +- if (stream.match(/^url/) && stream.peek() === "(") { +- state.tokenizer = urlTokens; +- if(!stream.peek()) { +- state.cursorHalf = 0; ++ // Parent Reference BEM naming ++ if (stream.string.match(/^\s*&/) && stream.match(/^[-_]+[a-z][\w-]*/)) { ++ return ["qualifier", "qualifier"]; ++ } ++ // / Root Reference & Parent Reference ++ if (stream.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)) { ++ stream.backUp(1); ++ return ["variable-3", "reference"]; ++ } ++ if (stream.match(/^&{1}\s*$/)) { ++ return ["variable-3", "reference"]; ++ } ++ // Variable ++ if (ch == "$" && stream.match(/^\$[\w-]+/i)) { ++ return ["variable-2", "variable-name"]; ++ } ++ // Word operator ++ if (stream.match(wordOperatorKeywordsRegexp)) { ++ return ["operator", "operator"]; ++ } ++ // Word ++ if (stream.match(/^[-_]*[a-z0-9]+[\w-]*/i)) { ++ if (stream.match(/^(\.|\[)[\w-\'\"\]]+/i, false)) { ++ if (!wordIsTag(stream.current())) { ++ stream.match(/[\w-]+/); ++ return ["variable-2", "variable-name"]; ++ } + } +- return "atom"; ++ return ["variable-2", "word"]; + } +- +- // Class +- if (stream.match(/^\.[a-z][\w-]*/i)) { +- indent(state); +- return "qualifier"; ++ // Operators ++ if (stream.match(operatorsRegexp)) { ++ return ["operator", stream.current()]; + } +- +- // & Parent Reference with BEM naming +- if (stream.match(/^(_|__|-|--)[a-z0-9-]+/)) { +- return "qualifier"; ++ // Delimiters ++ if (/[:;,{}\[\]\(\)]/.test(ch)) { ++ stream.next(); ++ return [null, ch]; + } ++ // Non-detected items ++ stream.next(); ++ return [null, null]; ++ } + +- // Pseudo elements/classes +- if (ch == ':' && stream.match(/^::?[\w-]+/)) { +- indent(state); +- return "variable-3"; ++ /** ++ * Token comment ++ */ ++ function tokenCComment(stream, state) { ++ var maybeEnd = false, ch; ++ while ((ch = stream.next()) != null) { ++ if (maybeEnd && ch == "/") { ++ state.tokenize = null; ++ break; ++ } ++ maybeEnd = (ch == "*"); + } ++ return ["comment", "comment"]; ++ } + +- // Conditionals +- if (stream.match(wordRegexp(["for", "if", "else", "unless"]))) { +- indent(state); +- return "keyword"; +- } ++ /** ++ * Token string ++ */ ++ function tokenString(quote) { ++ return function(stream, state) { ++ var escaped = false, ch; ++ while ((ch = stream.next()) != null) { ++ if (ch == quote && !escaped) { ++ if (quote == ")") stream.backUp(1); ++ break; ++ } ++ escaped = !escaped && ch == "\\"; ++ } ++ if (ch == quote || !escaped && quote != ")") state.tokenize = null; ++ return ["string", "string"]; ++ }; ++ } + +- // Keywords +- if (stream.match(commonKeywordsRegexp)) { +- return "keyword"; +- } ++ /** ++ * Token parenthesized ++ */ ++ function tokenParenthesized(stream, state) { ++ stream.next(); // Must be "(" ++ if (!stream.match(/\s*[\"\')]/, false)) ++ state.tokenize = tokenString(")"); ++ else ++ state.tokenize = null; ++ return [null, "("]; ++ } + +- // Atoms +- if (stream.match(commonAtomsRegexp)) { +- return "atom"; +- } ++ /** ++ * Context management ++ */ ++ function Context(type, indent, prev, line) { ++ this.type = type; ++ this.indent = indent; ++ this.prev = prev; ++ this.line = line || {firstWord: "", indent: 0}; ++ } + +- // Variables +- if (stream.match(/^\$?[a-z][\w-]+\s?=(\s|[\w-'"\$])/i)) { +- stream.backUp(2); +- var cssPropertie = stream.current().toLowerCase().match(/[\w-]+/)[0]; +- return cssProperties[cssPropertie] === undefined ? "variable-2" : "property"; +- } else if (stream.match(/\$[\w-\.]+/i)) { +- return "variable-2"; +- } else if (stream.match(/\$?[\w-]+\.[\w-]+/i)) { +- var cssTypeSelector = stream.current().toLowerCase().match(/[\w]+/)[0]; +- if(cssTypeSelectors[cssTypeSelector] === undefined) { +- return "variable-2"; +- } else stream.backUp(stream.current().length); +- } ++ function pushContext(state, stream, type, indent) { ++ indent = indent >= 0 ? indent : indentUnit; ++ state.context = new Context(type, stream.indentation() + indent, state.context); ++ return type; ++ } + +- // !important +- if (ch === "!") { +- stream.next(); +- return stream.match(/^[\w]+/) ? "keyword": "operator"; +- } ++ function popContext(state, currentIndent) { ++ var contextIndent = state.context.indent - indentUnit; ++ currentIndent = currentIndent || false; ++ state.context = state.context.prev; ++ if (currentIndent) state.context.indent = contextIndent; ++ return state.context.type; ++ } + +- // / Root Reference +- if (stream.match(/^\/(:|\.|#|[a-z])/)) { +- stream.backUp(1); +- return "variable-3"; +- } ++ function pass(type, stream, state) { ++ return states[state.context.type](type, stream, state); ++ } + +- // Operators and delimiters +- if (stream.match(operatorsRegexp) || stream.match(wordOperatorsRegexp)) { +- return "operator"; +- } +- if (stream.match(delimitersRegexp)) { +- return null; +- } ++ function popAndPass(type, stream, state, n) { ++ for (var i = n || 1; i > 0; i--) ++ state.context = state.context.prev; ++ return pass(type, stream, state); ++ } + +- // & Parent Reference +- if (ch === "&") { +- stream.next(); +- return "variable-3"; +- } ++ ++ /** ++ * Parser ++ */ ++ function wordIsTag(word) { ++ return word.toLowerCase() in tagKeywords; ++ } ++ ++ function wordIsProperty(word) { ++ word = word.toLowerCase(); ++ return word in propertyKeywords || word in fontProperties; ++ } ++ ++ function wordIsBlock(word) { ++ return word.toLowerCase() in blockKeywords; ++ } ++ ++ function wordIsVendorPrefix(word) { ++ return word.toLowerCase().match(vendorPrefixesRegexp); ++ } ++ ++ function wordAsValue(word) { ++ var wordLC = word.toLowerCase(); ++ var override = "variable-2"; ++ if (wordIsTag(word)) override = "tag"; ++ else if (wordIsBlock(word)) override = "block-keyword"; ++ else if (wordIsProperty(word)) override = "property"; ++ else if (wordLC in valueKeywords || wordLC in commonAtoms) override = "atom"; ++ else if (wordLC == "return" || wordLC in colorKeywords) override = "keyword"; + + // Font family +- if (stream.match(/^[A-Z][a-z0-9-]+/)) { +- return "string"; +- } ++ else if (word.match(/^[A-Z]/)) override = "string"; ++ return override; ++ } + +- // CSS rule +- // NOTE: Some css selectors and property values have the same name +- // (embed, menu, pre, progress, sub, table), +- // so they will have the same color (.cm-atom). +- if (stream.match(/[\w-]*/i)) { ++ function typeIsBlock(type, stream) { ++ return ((endOfLine(stream) && (type == "{" || type == "]" || type == "hash" || type == "qualifier")) || type == "block-mixin"); ++ } + +- var word = stream.current().toLowerCase(); ++ function typeIsInterpolation(type, stream) { ++ return type == "{" && stream.match(/^\s*\$?[\w-]+/i, false); ++ } + +- if(cssProperties[word] !== undefined) { +- // CSS property +- if(!stream.eol()) +- return "property"; +- else +- return "variable-2"; +- +- } else if(cssValues[word] !== undefined) { +- // CSS value +- return "atom"; +- +- } else if(cssTypeSelectors[word] !== undefined) { +- // CSS type selectors +- indent(state); +- return "tag"; +- +- } else if(word) { +- // By default variable-2 +- return "variable-2"; +- } +- } ++ function typeIsPseudo(type, stream) { ++ return type == ":" && stream.match(/^[a-z-]+/, false); ++ } + +- // Handle non-detected items +- stream.next(); +- return null; ++ function startOfLine(stream) { ++ return stream.sol() || stream.string.match(new RegExp("^\\s*" + escapeRegExp(stream.current()))); ++ } + +- }; ++ function endOfLine(stream) { ++ return stream.eol() || stream.match(/^\s*$/, false); ++ } ++ ++ function firstWordOfLine(line) { ++ var re = /^\s*[-_]*[a-z0-9]+[\w-]*/i; ++ var result = typeof line == "string" ? line.match(re) : line.string.match(re); ++ return result ? result[0].replace(/^\s*/, "") : ""; ++ } + +- var tokenLexer = function(stream, state) { + +- if (stream.sol()) { +- state.indentCount = 0; ++ /** ++ * Block ++ */ ++ states.block = function(type, stream, state) { ++ if ((type == "comment" && startOfLine(stream)) || ++ (type == "," && endOfLine(stream)) || ++ type == "mixin") { ++ return pushContext(state, stream, "block", 0); ++ } ++ if (typeIsInterpolation(type, stream)) { ++ return pushContext(state, stream, "interpolation"); ++ } ++ if (endOfLine(stream) && type == "]") { ++ if (!/^\s*(\.|#|:|\[|\*|&)/.test(stream.string) && !wordIsTag(firstWordOfLine(stream))) { ++ return pushContext(state, stream, "block", 0); ++ } ++ } ++ if (typeIsBlock(type, stream, state)) { ++ return pushContext(state, stream, "block"); ++ } ++ if (type == "}" && endOfLine(stream)) { ++ return pushContext(state, stream, "block", 0); ++ } ++ if (type == "variable-name") { ++ if ((stream.indentation() == 0 && startOfLine(stream)) || wordIsBlock(firstWordOfLine(stream))) { ++ return pushContext(state, stream, "variableName"); ++ } ++ else { ++ return pushContext(state, stream, "variableName", 0); ++ } ++ } ++ if (type == "=") { ++ if (!endOfLine(stream) && !wordIsBlock(firstWordOfLine(stream))) { ++ return pushContext(state, stream, "block", 0); ++ } ++ return pushContext(state, stream, "block"); ++ } ++ if (type == "*") { ++ if (endOfLine(stream) || stream.match(/\s*(,|\.|#|\[|:|{)/,false)) { ++ override = "tag"; ++ return pushContext(state, stream, "block"); ++ } ++ } ++ if (typeIsPseudo(type, stream)) { ++ return pushContext(state, stream, "pseudo"); ++ } ++ if (/@(font-face|media|supports|(-moz-)?document)/.test(type)) { ++ return pushContext(state, stream, endOfLine(stream) ? "block" : "atBlock"); ++ } ++ if (/@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { ++ return pushContext(state, stream, "keyframes"); ++ } ++ if (/@extends?/.test(type)) { ++ return pushContext(state, stream, "extend", 0); + } ++ if (type && type.charAt(0) == "@") { + +- var style = state.tokenizer(stream, state); +- var current = stream.current(); ++ // Property Lookup ++ if (stream.indentation() > 0 && wordIsProperty(stream.current().slice(1))) { ++ override = "variable-2"; ++ return "block"; ++ } ++ if (/(@import|@require|@charset)/.test(type)) { ++ return pushContext(state, stream, "block", 0); ++ } ++ return pushContext(state, stream, "block"); ++ } ++ if (type == "reference" && endOfLine(stream)) { ++ return pushContext(state, stream, "block"); ++ } ++ if (type == "(") { ++ return pushContext(state, stream, "parens"); ++ } + +- if (stream.eol() && (current === "}" || current === ",")) { +- dedent(state); ++ if (type == "vendor-prefixes") { ++ return pushContext(state, stream, "vendorPrefixes"); + } ++ if (type == "word") { ++ var word = stream.current(); ++ override = wordAsValue(word); ++ ++ if (override == "property") { ++ if (startOfLine(stream)) { ++ return pushContext(state, stream, "block", 0); ++ } else { ++ override = "atom"; ++ return "block"; ++ } ++ } + +- if (style !== null) { +- var startOfToken = stream.pos - current.length; +- var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); ++ if (override == "tag") { + +- var newScopes = []; ++ // tag is a css value ++ if (/embed|menu|pre|progress|sub|table/.test(word)) { ++ if (wordIsProperty(firstWordOfLine(stream))) { ++ override = "atom"; ++ return "block"; ++ } ++ } + +- for (var i = 0; i < state.scopes.length; i++) { +- var scope = state.scopes[i]; ++ // tag is an attribute ++ if (stream.string.match(new RegExp("\\[\\s*" + word + "|" + word +"\\s*\\]"))) { ++ override = "atom"; ++ return "block"; ++ } + +- if (scope.offset <= withCurrentIndent) { +- newScopes.push(scope); ++ // tag is a variable ++ if (tagVariablesRegexp.test(word)) { ++ if ((startOfLine(stream) && stream.string.match(/=/)) || ++ (!startOfLine(stream) && ++ !stream.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/) && ++ !wordIsTag(firstWordOfLine(stream)))) { ++ override = "variable-2"; ++ if (wordIsBlock(firstWordOfLine(stream))) return "block"; ++ return pushContext(state, stream, "block", 0); ++ } + } ++ ++ if (endOfLine(stream)) return pushContext(state, stream, "block"); + } ++ if (override == "block-keyword") { ++ override = "keyword"; + +- state.scopes = newScopes; ++ // Postfix conditionals ++ if (stream.current(/(if|unless)/) && !startOfLine(stream)) { ++ return "block"; ++ } ++ return pushContext(state, stream, "block"); ++ } ++ if (word == "return") return pushContext(state, stream, "block", 0); + } +- +- return style; ++ return state.context.type; + }; + +- return { +- startState: function() { +- return { +- tokenizer: tokenBase, +- scopes: [{offset: 0, type: 'styl'}] +- }; +- }, + +- token: function(stream, state) { +- var style = tokenLexer(stream, state); +- state.lastToken = { style: style, content: stream.current() }; +- return style; +- }, ++ /** ++ * Parens ++ */ ++ states.parens = function(type, stream, state) { ++ if (type == "(") return pushContext(state, stream, "parens"); ++ if (type == ")") { ++ if (state.context.prev.type == "parens") { ++ return popContext(state); ++ } ++ if ((stream.string.match(/^[a-z][\w-]*\(/i) && endOfLine(stream)) || ++ wordIsBlock(firstWordOfLine(stream)) || ++ /(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(firstWordOfLine(stream)) || ++ (!stream.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/) && ++ wordIsTag(firstWordOfLine(stream)))) { ++ return pushContext(state, stream, "block"); ++ } ++ if (stream.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/) || ++ stream.string.match(/^\s*(\(|\)|[0-9])/) || ++ stream.string.match(/^\s+[a-z][\w-]*\(/i) || ++ stream.string.match(/^\s+[\$-]?[a-z]/i)) { ++ return pushContext(state, stream, "block", 0); ++ } ++ if (endOfLine(stream)) return pushContext(state, stream, "block"); ++ else return pushContext(state, stream, "block", 0); ++ } ++ if (type && type.charAt(0) == "@" && wordIsProperty(stream.current().slice(1))) { ++ override = "variable-2"; ++ } ++ if (type == "word") { ++ var word = stream.current(); ++ override = wordAsValue(word); ++ if (override == "tag" && tagVariablesRegexp.test(word)) { ++ override = "variable-2"; ++ } ++ if (override == "property" || word == "to") override = "atom"; ++ } ++ if (type == "variable-name") { ++ return pushContext(state, stream, "variableName"); ++ } ++ if (typeIsPseudo(type, stream)) { ++ return pushContext(state, stream, "pseudo"); ++ } ++ return state.context.type; ++ }; + +- indent: function(state) { +- return state.scopes[0].offset; +- }, +- +- lineComment: "//", +- fold: "indent" + ++ /** ++ * Vendor prefixes ++ */ ++ states.vendorPrefixes = function(type, stream, state) { ++ if (type == "word") { ++ override = "property"; ++ return pushContext(state, stream, "block", 0); ++ } ++ return popContext(state); + }; + +- function urlTokens(stream, state) { +- var ch = stream.peek(); + +- if (ch === ")") { +- stream.next(); +- state.tokenizer = tokenBase; +- return "operator"; +- } else if (ch === "(") { +- stream.next(); +- stream.eatSpace(); ++ /** ++ * Pseudo ++ */ ++ states.pseudo = function(type, stream, state) { ++ if (!wordIsProperty(firstWordOfLine(stream.string))) { ++ stream.match(/^[a-z-]+/); ++ override = "variable-3"; ++ if (endOfLine(stream)) return pushContext(state, stream, "block"); ++ return popContext(state); ++ } ++ return popAndPass(type, stream, state); ++ }; ++ + +- return "operator"; +- } else if (ch === "'" || ch === '"') { +- state.tokenizer = buildStringTokenizer(stream.next()); +- return "string"; +- } else { +- state.tokenizer = buildStringTokenizer(")", false); +- return "string"; ++ /** ++ * atBlock ++ */ ++ states.atBlock = function(type, stream, state) { ++ if (type == "(") return pushContext(state, stream, "atBlock_parens"); ++ if (typeIsBlock(type, stream, state)) { ++ return pushContext(state, stream, "block"); + } +- } ++ if (typeIsInterpolation(type, stream)) { ++ return pushContext(state, stream, "interpolation"); ++ } ++ if (type == "word") { ++ var word = stream.current().toLowerCase(); ++ if (/^(only|not|and|or)$/.test(word)) ++ override = "keyword"; ++ else if (documentTypes.hasOwnProperty(word)) ++ override = "tag"; ++ else if (mediaTypes.hasOwnProperty(word)) ++ override = "attribute"; ++ else if (mediaFeatures.hasOwnProperty(word)) ++ override = "property"; ++ else if (nonStandardPropertyKeywords.hasOwnProperty(word)) ++ override = "string-2"; ++ else override = wordAsValue(stream.current()); ++ if (override == "tag" && endOfLine(stream)) { ++ return pushContext(state, stream, "block"); ++ } ++ } ++ if (type == "operator" && /^(not|and|or)$/.test(stream.current())) { ++ override = "keyword"; ++ } ++ return state.context.type; ++ }; + +- function multilineComment(stream, state) { +- if (stream.skipTo("*/")) { +- stream.next(); +- stream.next(); +- state.tokenizer = tokenBase; +- } else { +- stream.next(); ++ states.atBlock_parens = function(type, stream, state) { ++ if (type == "{" || type == "}") return state.context.type; ++ if (type == ")") { ++ if (endOfLine(stream)) return pushContext(state, stream, "block"); ++ else return pushContext(state, stream, "atBlock"); + } +- return "comment"; +- } ++ if (type == "word") { ++ var word = stream.current().toLowerCase(); ++ override = wordAsValue(word); ++ if (/^(max|min)/.test(word)) override = "property"; ++ if (override == "tag") { ++ tagVariablesRegexp.test(word) ? override = "variable-2" : override = "atom"; ++ } ++ return state.context.type; ++ } ++ return states.atBlock(type, stream, state); ++ }; + +- function buildStringTokenizer(quote, greedy) { + +- if(greedy == null) { +- greedy = true; ++ /** ++ * Keyframes ++ */ ++ states.keyframes = function(type, stream, state) { ++ if (stream.indentation() == "0" && ((type == "}" && startOfLine(stream)) || type == "]" || type == "hash" ++ || type == "qualifier" || wordIsTag(stream.current()))) { ++ return popAndPass(type, stream, state); + } ++ if (type == "{") return pushContext(state, stream, "keyframes"); ++ if (type == "}") { ++ if (startOfLine(stream)) return popContext(state, true); ++ else return pushContext(state, stream, "keyframes"); ++ } ++ if (type == "unit" && /^[0-9]+\%$/.test(stream.current())) { ++ return pushContext(state, stream, "keyframes"); ++ } ++ if (type == "word") { ++ override = wordAsValue(stream.current()); ++ if (override == "block-keyword") { ++ override = "keyword"; ++ return pushContext(state, stream, "keyframes"); ++ } ++ } ++ if (/@(font-face|media|supports|(-moz-)?document)/.test(type)) { ++ return pushContext(state, stream, endOfLine(stream) ? "block" : "atBlock"); ++ } ++ if (type == "mixin") { ++ return pushContext(state, stream, "block", 0); ++ } ++ return state.context.type; ++ }; + +- function stringTokenizer(stream, state) { +- var nextChar = stream.next(); +- var peekChar = stream.peek(); +- var previousChar = stream.string.charAt(stream.pos-2); +- +- var endingString = ((nextChar !== "\\" && peekChar === quote) || +- (nextChar === quote && previousChar !== "\\")); + +- if (endingString) { +- if (nextChar !== quote && greedy) { +- stream.next(); +- } +- state.tokenizer = tokenBase; +- return "string"; +- } else if (nextChar === "#" && peekChar === "{") { +- state.tokenizer = buildInterpolationTokenizer(stringTokenizer); +- stream.next(); +- return "operator"; +- } else { +- return "string"; ++ /** ++ * Interpolation ++ */ ++ states.interpolation = function(type, stream, state) { ++ if (type == "{") popContext(state) && pushContext(state, stream, "block"); ++ if (type == "}") { ++ if (stream.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i) || ++ (stream.string.match(/^\s*[a-z]/i) && wordIsTag(firstWordOfLine(stream)))) { ++ return pushContext(state, stream, "block"); + } ++ if (!stream.string.match(/^(\{|\s*\&)/) || ++ stream.match(/\s*[\w-]/,false)) { ++ return pushContext(state, stream, "block", 0); ++ } ++ return pushContext(state, stream, "block"); ++ } ++ if (type == "variable-name") { ++ return pushContext(state, stream, "variableName", 0); ++ } ++ if (type == "word") { ++ override = wordAsValue(stream.current()); ++ if (override == "tag") override = "atom"; + } ++ return state.context.type; ++ }; + +- return stringTokenizer; +- } + +- function buildInterpolationTokenizer(currentTokenizer) { +- return function(stream, state) { +- if (stream.peek() === "}") { +- stream.next(); +- state.tokenizer = currentTokenizer; +- return "operator"; +- } else { +- return tokenBase(stream, state); +- } +- }; +- } ++ /** ++ * Extend/s ++ */ ++ states.extend = function(type, stream, state) { ++ if (type == "[" || type == "=") return "extend"; ++ if (type == "]") return popContext(state); ++ if (type == "word") { ++ override = wordAsValue(stream.current()); ++ return "extend"; ++ } ++ return popContext(state); ++ }; ++ + +- function indent(state) { +- if (state.indentCount == 0) { +- state.indentCount++; +- var lastScopeOffset = state.scopes[0].offset; +- var currentOffset = lastScopeOffset + config.indentUnit; +- state.scopes.unshift({ offset:currentOffset }); ++ /** ++ * Variable name ++ */ ++ states.variableName = function(type, stream, state) { ++ if (type == "string" || type == "[" || type == "]" || stream.current().match(/^(\.|\$)/)) { ++ if (stream.current().match(/^\.[\w-]+/i)) override = "variable-2"; ++ if (endOfLine(stream)) return popContext(state); ++ return "variableName"; + } +- } ++ return popAndPass(type, stream, state); ++ }; + +- function dedent(state) { +- if (state.scopes.length == 1) { return true; } +- state.scopes.shift(); +- } + ++ return { ++ startState: function(base) { ++ return { ++ tokenize: null, ++ state: "block", ++ context: new Context("block", base || 0, null) ++ }; ++ }, ++ token: function(stream, state) { ++ if (!state.tokenize && stream.eatSpace()) return null; ++ style = (state.tokenize || tokenBase)(stream, state); ++ if (style && typeof style == "object") { ++ type = style[1]; ++ style = style[0]; ++ } ++ override = style; ++ state.state = states[state.state](type, stream, state); ++ return override; ++ }, ++ indent: function(state, textAfter, line) { ++ ++ var cx = state.context, ++ ch = textAfter && textAfter.charAt(0), ++ indent = cx.indent, ++ lineFirstWord = firstWordOfLine(textAfter), ++ lineIndent = line.length - line.replace(/^\s*/, "").length, ++ prevLineFirstWord = state.context.prev ? state.context.prev.line.firstWord : "", ++ prevLineIndent = state.context.prev ? state.context.prev.line.indent : lineIndent; ++ ++ if (cx.prev && ++ (ch == "}" && (cx.type == "block" || cx.type == "atBlock" || cx.type == "keyframes") || ++ ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || ++ ch == "{" && (cx.type == "at"))) { ++ indent = cx.indent - indentUnit; ++ cx = cx.prev; ++ } else if (!(/(\})/.test(ch))) { ++ if (/@|\$|\d/.test(ch) || ++ /^\{/.test(textAfter) || ++/^\s*\/(\/|\*)/.test(textAfter) || ++ /^\s*\/\*/.test(prevLineFirstWord) || ++ /^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(textAfter) || ++/^(\+|-)?[a-z][\w-]*\(/i.test(textAfter) || ++/^return/.test(textAfter) || ++ wordIsBlock(lineFirstWord)) { ++ indent = lineIndent; ++ } else if (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(ch) || wordIsTag(lineFirstWord)) { ++ if (/\,\s*$/.test(prevLineFirstWord)) { ++ indent = prevLineIndent; ++ } else if (/^\s+/.test(line) && (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(prevLineFirstWord) || wordIsTag(prevLineFirstWord))) { ++ indent = lineIndent <= prevLineIndent ? prevLineIndent : prevLineIndent + indentUnit; ++ } else { ++ indent = lineIndent; ++ } ++ } else if (!/,\s*$/.test(line) && (wordIsVendorPrefix(lineFirstWord) || wordIsProperty(lineFirstWord))) { ++ if (wordIsBlock(prevLineFirstWord)) { ++ indent = lineIndent <= prevLineIndent ? prevLineIndent : prevLineIndent + indentUnit; ++ } else if (/^\{/.test(prevLineFirstWord)) { ++ indent = lineIndent <= prevLineIndent ? lineIndent : prevLineIndent + indentUnit; ++ } else if (wordIsVendorPrefix(prevLineFirstWord) || wordIsProperty(prevLineFirstWord)) { ++ indent = lineIndent >= prevLineIndent ? prevLineIndent : lineIndent; ++ } else if (/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(prevLineFirstWord) || ++ /=\s*$/.test(prevLineFirstWord) || ++ wordIsTag(prevLineFirstWord) || ++ /^\$[\w-\.\[\]\'\"]/.test(prevLineFirstWord)) { ++ indent = prevLineIndent + indentUnit; ++ } else { ++ indent = lineIndent; ++ } ++ } ++ } ++ return indent; ++ }, ++ electricChars: "}", ++ lineComment: "//", ++ fold: "indent" ++ }; + }); + +- // https://developer.mozilla.org/en-US/docs/Web/HTML/Element +- var cssTypeSelectors_ = ["a","abbr","address","area","article","aside","audio", "b", "base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]; +- // https://github.com/csscomb/csscomb.js/blob/master/config/zen.json +- var cssProperties_ = ["position","top","right","bottom","left","z-index","display","visibility","flex-direction","flex-order","flex-pack","float","clear","flex-align","overflow","overflow-x","overflow-y","overflow-scrolling","clip","box-sizing","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","min-width","min-height","max-width","max-height","width","height","outline","outline-width","outline-style","outline-color","outline-offset","border","border-spacing","border-collapse","border-width","border-style","border-color","border-top","border-top-width","border-top-style","border-top-color","border-right","border-right-width","border-right-style","border-right-color","border-bottom","border-bottom-width","border-bottom-style","border-bottom-color","border-left","border-left-width","border-left-style","border-left-color","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-image","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat","border-top-image","border-right-image","border-bottom-image","border-left-image","border-corner-image","border-top-left-image","border-top-right-image","border-bottom-right-image","border-bottom-left-image","background","filter:progid:DXImageTransform\\.Microsoft\\.AlphaImageLoader","background-color","background-image","background-attachment","background-position","background-position-x","background-position-y","background-clip","background-origin","background-size","background-repeat","box-decoration-break","box-shadow","color","table-layout","caption-side","empty-cells","list-style","list-style-position","list-style-type","list-style-image","quotes","content","counter-increment","counter-reset","writing-mode","vertical-align","text-align","text-align-last","text-decoration","text-emphasis","text-emphasis-position","text-emphasis-style","text-emphasis-color","text-indent","-ms-text-justify","text-justify","text-outline","text-transform","text-wrap","text-overflow","text-overflow-ellipsis","text-overflow-mode","text-size-adjust","text-shadow","white-space","word-spacing","word-wrap","word-break","tab-size","hyphens","letter-spacing","font","font-weight","font-style","font-variant","font-size-adjust","font-stretch","font-size","font-family","src","line-height","opacity","filter:\\\\\\\\'progid:DXImageTransform.Microsoft.Alpha","filter:progid:DXImageTransform.Microsoft.Alpha\\(Opacity","interpolation-mode","filter","resize","cursor","nav-index","nav-up","nav-right","nav-down","nav-left","transition","transition-delay","transition-timing-function","transition-duration","transition-property","transform","transform-origin","animation","animation-name","animation-duration","animation-play-state","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","pointer-events","unicode-bidi","direction","columns","column-span","column-width","column-count","column-fill","column-gap","column-rule","column-rule-width","column-rule-style","column-rule-color","break-before","break-inside","break-after","page-break-before","page-break-inside","page-break-after","orphans","widows","zoom","max-zoom","min-zoom","user-zoom","orientation","text-rendering","speak","animation-fill-mode","backface-visibility","user-drag","user-select","appearance"]; +- // https://github.com/codemirror/CodeMirror/blob/master/mode/css/css.js#L501 +- var cssValues_ = ["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale"]; +- var cssColorValues_ = ["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]; +- var cssValuesWithBrackets_ = ["gradient","linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","cubic-bezier","translateX","translateY","translate3d","rotate3d","scale","scale3d","perspective","skewX"]; +- +- var wordOperators = ["in", "and", "or", "not", "is a", "is", "isnt", "defined", "if unless"], +- commonKeywords = ["for", "if", "else", "unless", "return"], +- commonAtoms = ["null", "true", "false", "href", "title", "type", "not-allowed", "readonly", "disabled"], +- commonDef = ["@font-face", "@keyframes", "@media", "@viewport", "@page", "@host", "@supports", "@block", "@css"], +- cssTypeSelectors = keySet(cssTypeSelectors_), +- cssProperties = keySet(cssProperties_), +- cssValues = keySet(cssValues_.concat(cssColorValues_)), +- hintWords = wordOperators.concat(commonKeywords, +- commonAtoms, +- commonDef, +- cssTypeSelectors_, +- cssProperties_, +- cssValues_, +- cssValuesWithBrackets_, +- cssColorValues_); ++ // developer.mozilla.org/en-US/docs/Web/HTML/Element ++ var tagKeywords_ = ["a","abbr","address","area","article","aside","audio", "b", "base","bdi", "bdo","bgsound","blockquote","body","br","button","canvas","caption","cite", "code","col","colgroup","data","datalist","dd","del","details","dfn","div", "dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1", "h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe", "img","input","ins","kbd","keygen","label","legend","li","link","main","map", "mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes", "noscript","object","ol","optgroup","option","output","p","param","pre", "progress","q","rp","rt","ruby","s","samp","script","section","select", "small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track", "u","ul","var","video"]; ++ ++ // github.com/codemirror/CodeMirror/blob/master/mode/css/css.js ++ var documentTypes_ = ["domain", "regexp", "url", "url-prefix"]; ++ var mediaTypes_ = ["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]; ++ var mediaFeatures_ = ["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"]; ++ var propertyKeywords_ = ["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"]; ++ var nonStandardPropertyKeywords_ = ["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"]; ++ var fontProperties_ = ["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]; ++ var colorKeywords_ = ["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]; ++ var valueKeywords_ = ["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale"]; ++ ++ var wordOperatorKeywords_ = ["in","and","or","not","is not","is a","is","isnt","defined","if unless"], ++ blockKeywords_ = ["for","if","else","unless", "from", "to"], ++ commonAtoms_ = ["null","true","false","href","title","type","not-allowed","readonly","disabled"], ++ commonDef_ = ["@font-face", "@keyframes", "@media", "@viewport", "@page", "@host", "@supports", "@block", "@css"]; ++ ++ var hintWords = tagKeywords_.concat(documentTypes_,mediaTypes_,mediaFeatures_, ++ propertyKeywords_,nonStandardPropertyKeywords_, ++ colorKeywords_,valueKeywords_,fontProperties_, ++ wordOperatorKeywords_,blockKeywords_, ++ commonAtoms_,commonDef_); + + function wordRegexp(words) { ++ words = words.sort(function(a,b){return b > a;}); + return new RegExp("^((" + words.join(")|(") + "))\\b"); +- }; ++ } + + function keySet(array) { + var keys = {}; +- for (var i = 0; i < array.length; ++i) { +- keys[array[i]] = true; +- } ++ for (var i = 0; i < array.length; ++i) keys[array[i]] = true; + return keys; +- }; ++ } ++ ++ function escapeRegExp(text) { ++ return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); ++ } + + CodeMirror.registerHelper("hintWords", "stylus", hintWords); + CodeMirror.defineMIME("text/x-styl", "stylus"); +- + }); +diff --git a/media/editors/codemirror/mode/stylus/stylus.min.js b/media/editors/codemirror/mode/stylus/stylus.min.js +index 9f470c9..b7c1f34 100644 +--- a/media/editors/codemirror/mode/stylus/stylus.min.js ++++ b/media/editors/codemirror/mode/stylus/stylus.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e){for(var t={},r=0;r=?|%=?|&&|\|=?|\~|!|\^|\\)/,f=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,w=t(s),k=t(d),y=t(c),v=t(u),x=new RegExp(/^\-(moz|ms|o|webkit)-/),z=new RegExp("^("+l.join("|")+")\\([\\w-\\#\\,\\.\\%\\s\\(\\)]*\\)"),q=function(e,o){if(e.eatSpace())return null;var l=e.peek();if(e.match("//"))return e.skipToEnd(),"comment";if(e.match("/*"))return o.tokenizer=i,o.tokenizer(e,o);if('"'===l||"'"===l)return e.next(),o.tokenizer=a(l),"string";if("@"===l)return e.next(),e.match(/extend/)?b(o):e.match(/media[\w-\s]*[\w-]/)?n(o):e.eatWhile(/[\w-]/)&&e.current().match(v)&&n(o),"def";if(e.match(/^-?[0-9\.]/,!1)){if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)||e.match(/^-?\d+\.\d*/))return"."==e.peek()&&e.backUp(1),e.eatWhile(/[a-z%]/i),"number";if(e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)||e.match(/^-?0(?![\dx])/i))return e.eatWhile(/[a-z%]/i),"number"}if("#"===l){if(e.next(),e.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i))return"atom";if(e.match(/^[\w-]+/i))return n(o),"builtin"}if(e.match(x))return"meta";if(e.match(z))return"atom";if(e.sol()&&e.match(/^\.?[a-z][\w-]*\(/i))return e.backUp(1),n(o),"keyword";if(e.match(/^\.?[a-z][\w-]*\(/i))return e.backUp(1),"keyword";if(e.match(/^(\+|\-)[a-z][\w-]+\(/i))return e.backUp(1),n(o),"keyword";if(e.match(/^url/)&&"("===e.peek())return o.tokenizer=r,e.peek()||(o.cursorHalf=0),"atom";if(e.match(/^\.[a-z][\w-]*/i))return n(o),"qualifier";if(e.match(/^(_|__|-|--)[a-z0-9-]+/))return"qualifier";if(":"==l&&e.match(/^::?[\w-]+/))return n(o),"variable-3";if(e.match(t(["for","if","else","unless"])))return n(o),"keyword";if(e.match(k))return"keyword";if(e.match(y))return"atom";if(e.match(/^\$?[a-z][\w-]+\s?=(\s|[\w-'"\$])/i)){e.backUp(2);var s=e.current().toLowerCase().match(/[\w-]+/)[0];return void 0===p[s]?"variable-2":"property"}if(e.match(/\$[\w-\.]+/i))return"variable-2";if(e.match(/\$?[\w-]+\.[\w-]+/i)){var d=e.current().toLowerCase().match(/[\w]+/)[0];if(void 0===m[d])return"variable-2";e.backUp(e.current().length)}if("!"===l)return e.next(),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(/^\/(:|\.|#|[a-z])/))return e.backUp(1),"variable-3";if(e.match(g)||e.match(w))return"operator";if(e.match(f))return null;if("&"===l)return e.next(),"variable-3";if(e.match(/^[A-Z][a-z0-9-]+/))return"string";if(e.match(/[\w-]*/i)){var c=e.current().toLowerCase();if(void 0!==p[c])return e.eol()?"variable-2":"property";if(void 0!==h[c])return"atom";if(void 0!==m[c])return n(o),"tag";if(c)return"variable-2"}return e.next(),null},j=function(t,r){t.sol()&&(r.indentCount=0);var i=r.tokenizer(t,r),a=t.current();if(!t.eol()||"}"!==a&&","!==a||b(r),null!==i){for(var o=t.pos-a.length,n=o+e.indentUnit*r.indentCount,l=[],s=0;sa}),new RegExp("^(("+a.join(")|(")+"))\\b")}function c(a){for(var b={},c=0;c|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/),b.context.line.firstWord=da?da[0].replace(/^\s*/,""):"",b.context.line.indent=a.indentation(),K=a.peek(),a.match("//"))return a.skipToEnd(),["comment","comment"];if(a.match("/*"))return b.tokenize=r,r(a,b);if('"'==K||"'"==K)return a.next(),b.tokenize=s(K),b.tokenize(a,b);if("@"==K)return a.next(),a.eatWhile(/[\w\\-]/),["def",a.current()];if("#"==K){if(a.next(),a.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i))return["atom","atom"];if(a.match(/^[a-z][\w-]*/i))return["builtin","hash"]}return a.match(ba)?["meta","vendor-prefixes"]:a.match(/^-?[0-9]?\.?[0-9]/)?(a.eatWhile(/[a-z%]/i),["number","unit"]):"!"==K?(a.next(),[a.match(/^(important|optional)/i)?"keyword":"operator","important"]):"."==K&&a.match(/^\.[a-z][\w-]*/i)?["qualifier","qualifier"]:a.match(W)?("("==a.peek()&&(b.tokenize=t),["property","word"]):a.match(/^[a-z][\w-]*\(/i)?(a.backUp(1),["keyword","mixin"]):a.match(/^(\+|-)[a-z][\w-]*\(/i)?(a.backUp(1),["keyword","block-mixin"]):a.string.match(/^\s*&/)&&a.match(/^[-_]+[a-z][\w-]*/)?["qualifier","qualifier"]:a.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)?(a.backUp(1),["variable-3","reference"]):a.match(/^&{1}\s*$/)?["variable-3","reference"]:"$"==K&&a.match(/^\$[\w-]+/i)?["variable-2","variable-name"]:a.match(_)?["operator","operator"]:a.match(/^[-_]*[a-z0-9]+[\w-]*/i)?a.match(/^(\.|\[)[\w-\'\"\]]+/i,!1)&&!z(a.current())?(a.match(/[\w-]+/),["variable-2","variable-name"]):["variable-2","word"]:a.match($)?["operator",a.current()]:/[:;,{}\[\]\(\)]/.test(K)?(a.next(),[null,K]):(a.next(),[null,null])}function r(a,b){for(var c,d=!1;null!=(c=a.next());){if(d&&"/"==c){b.tokenize=null;break}d="*"==c}return["comment","comment"]}function s(a){return function(b,c){for(var d,e=!1;null!=(d=b.next());){if(d==a&&!e){")"==a&&b.backUp(1);break}e=!e&&"\\"==d}return(d==a||!e&&")"!=a)&&(c.tokenize=null),["string","string"]}}function t(a,b){return a.next(),a.match(/\s*[\"\')]/,!1)?b.tokenize=null:b.tokenize=s(")"),[null,"("]}function u(a,b,c,d){this.type=a,this.indent=b,this.prev=c,this.line=d||{firstWord:"",indent:0}}function v(a,b,c,d){return d=d>=0?d:O,a.context=new u(c,b.indentation()+d,a.context),c}function w(a,b){var c=a.context.indent-O;return b=b||!1,a.context=a.context.prev,b&&(a.context.indent=c),a.context.type}function x(a,b,c){return ea[c.context.type](a,b,c)}function y(a,b,c,d){for(var e=d||1;e>0;e--)c.context=c.context.prev;return x(a,b,c)}function z(a){return a.toLowerCase()in P}function A(a){return a=a.toLowerCase(),a in R||a in Z}function B(a){return a.toLowerCase()in aa}function C(a){return a.toLowerCase().match(ba)}function D(a){var b=a.toLowerCase(),c="variable-2";return z(a)?c="tag":B(a)?c="block-keyword":A(a)?c="property":b in T||b in ca?c="atom":"return"==b||b in U?c="keyword":a.match(/^[A-Z]/)&&(c="string"),c}function E(a,b){return I(b)&&("{"==a||"]"==a||"hash"==a||"qualifier"==a)||"block-mixin"==a}function F(a,b){return"{"==a&&b.match(/^\s*\$?[\w-]+/i,!1)}function G(a,b){return":"==a&&b.match(/^[a-z-]+/,!1)}function H(a){return a.sol()||a.string.match(new RegExp("^\\s*"+d(a.current())))}function I(a){return a.eol()||a.match(/^\s*$/,!1)}function J(a){var b=/^\s*[-_]*[a-z0-9]+[\w-]*/i,c="string"==typeof a?a.match(b):a.string.match(b);return c?c[0].replace(/^\s*/,""):""}var K,L,M,N,O=a.indentUnit,P=c(e),Q=/^(a|b|i|s|col|em)$/i,R=c(i),S=c(j),T=c(m),U=c(l),V=c(f),W=b(f),X=c(h),Y=c(g),Z=c(k),$=/^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/,_=b(n),aa=c(o),ba=new RegExp(/^\-(moz|ms|o|webkit)-/i),ca=c(p),da="",ea={};return ea.block=function(a,b,c){if("comment"==a&&H(b)||","==a&&I(b)||"mixin"==a)return v(c,b,"block",0);if(F(a,b))return v(c,b,"interpolation");if(I(b)&&"]"==a&&!/^\s*(\.|#|:|\[|\*|&)/.test(b.string)&&!z(J(b)))return v(c,b,"block",0);if(E(a,b,c))return v(c,b,"block");if("}"==a&&I(b))return v(c,b,"block",0);if("variable-name"==a)return 0==b.indentation()&&H(b)||B(J(b))?v(c,b,"variableName"):v(c,b,"variableName",0);if("="==a)return I(b)||B(J(b))?v(c,b,"block"):v(c,b,"block",0);if("*"==a&&(I(b)||b.match(/\s*(,|\.|#|\[|:|{)/,!1)))return N="tag",v(c,b,"block");if(G(a,b))return v(c,b,"pseudo");if(/@(font-face|media|supports|(-moz-)?document)/.test(a))return v(c,b,I(b)?"block":"atBlock");if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test(a))return v(c,b,"keyframes");if(/@extends?/.test(a))return v(c,b,"extend",0);if(a&&"@"==a.charAt(0))return b.indentation()>0&&A(b.current().slice(1))?(N="variable-2","block"):/(@import|@require|@charset)/.test(a)?v(c,b,"block",0):v(c,b,"block");if("reference"==a&&I(b))return v(c,b,"block");if("("==a)return v(c,b,"parens");if("vendor-prefixes"==a)return v(c,b,"vendorPrefixes");if("word"==a){var d=b.current();if(N=D(d),"property"==N)return H(b)?v(c,b,"block",0):(N="atom","block");if("tag"==N){if(/embed|menu|pre|progress|sub|table/.test(d)&&A(J(b)))return N="atom","block";if(b.string.match(new RegExp("\\[\\s*"+d+"|"+d+"\\s*\\]")))return N="atom","block";if(Q.test(d)&&(H(b)&&b.string.match(/=/)||!H(b)&&!b.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!z(J(b))))return N="variable-2",B(J(b))?"block":v(c,b,"block",0);if(I(b))return v(c,b,"block")}if("block-keyword"==N)return N="keyword",b.current(/(if|unless)/)&&!H(b)?"block":v(c,b,"block");if("return"==d)return v(c,b,"block",0)}return c.context.type},ea.parens=function(a,b,c){if("("==a)return v(c,b,"parens");if(")"==a)return"parens"==c.context.prev.type?w(c):b.string.match(/^[a-z][\w-]*\(/i)&&I(b)||B(J(b))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(J(b))||!b.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/)&&z(J(b))?v(c,b,"block"):b.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/)||b.string.match(/^\s*(\(|\)|[0-9])/)||b.string.match(/^\s+[a-z][\w-]*\(/i)||b.string.match(/^\s+[\$-]?[a-z]/i)?v(c,b,"block",0):I(b)?v(c,b,"block"):v(c,b,"block",0);if(a&&"@"==a.charAt(0)&&A(b.current().slice(1))&&(N="variable-2"),"word"==a){var d=b.current();N=D(d),"tag"==N&&Q.test(d)&&(N="variable-2"),("property"==N||"to"==d)&&(N="atom")}return"variable-name"==a?v(c,b,"variableName"):G(a,b)?v(c,b,"pseudo"):c.context.type},ea.vendorPrefixes=function(a,b,c){return"word"==a?(N="property",v(c,b,"block",0)):w(c)},ea.pseudo=function(a,b,c){return A(J(b.string))?y(a,b,c):(b.match(/^[a-z-]+/),N="variable-3",I(b)?v(c,b,"block"):w(c))},ea.atBlock=function(a,b,c){if("("==a)return v(c,b,"atBlock_parens");if(E(a,b,c))return v(c,b,"block");if(F(a,b))return v(c,b,"interpolation");if("word"==a){var d=b.current().toLowerCase();if(N=/^(only|not|and|or)$/.test(d)?"keyword":V.hasOwnProperty(d)?"tag":Y.hasOwnProperty(d)?"attribute":X.hasOwnProperty(d)?"property":S.hasOwnProperty(d)?"string-2":D(b.current()),"tag"==N&&I(b))return v(c,b,"block")}return"operator"==a&&/^(not|and|or)$/.test(b.current())&&(N="keyword"),c.context.type},ea.atBlock_parens=function(a,b,c){if("{"==a||"}"==a)return c.context.type;if(")"==a)return I(b)?v(c,b,"block"):v(c,b,"atBlock");if("word"==a){var d=b.current().toLowerCase();return N=D(d),/^(max|min)/.test(d)&&(N="property"),"tag"==N&&(N=Q.test(d)?"variable-2":"atom"),c.context.type}return ea.atBlock(a,b,c)},ea.keyframes=function(a,b,c){return"0"==b.indentation()&&("}"==a&&H(b)||"]"==a||"hash"==a||"qualifier"==a||z(b.current()))?y(a,b,c):"{"==a?v(c,b,"keyframes"):"}"==a?H(b)?w(c,!0):v(c,b,"keyframes"):"unit"==a&&/^[0-9]+\%$/.test(b.current())?v(c,b,"keyframes"):"word"==a&&(N=D(b.current()),"block-keyword"==N)?(N="keyword",v(c,b,"keyframes")):/@(font-face|media|supports|(-moz-)?document)/.test(a)?v(c,b,I(b)?"block":"atBlock"):"mixin"==a?v(c,b,"block",0):c.context.type},ea.interpolation=function(a,b,c){return"{"==a&&w(c)&&v(c,b,"block"),"}"==a?b.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||b.string.match(/^\s*[a-z]/i)&&z(J(b))?v(c,b,"block"):!b.string.match(/^(\{|\s*\&)/)||b.match(/\s*[\w-]/,!1)?v(c,b,"block",0):v(c,b,"block"):"variable-name"==a?v(c,b,"variableName",0):("word"==a&&(N=D(b.current()),"tag"==N&&(N="atom")),c.context.type)},ea.extend=function(a,b,c){return"["==a||"="==a?"extend":"]"==a?w(c):"word"==a?(N=D(b.current()),"extend"):w(c)},ea.variableName=function(a,b,c){return"string"==a||"["==a||"]"==a||b.current().match(/^(\.|\$)/)?(b.current().match(/^\.[\w-]+/i)&&(N="variable-2"),I(b)?w(c):"variableName"):y(a,b,c)},{startState:function(a){return{tokenize:null,state:"block",context:new u("block",a||0,null)}},token:function(a,b){return!b.tokenize&&a.eatSpace()?null:(L=(b.tokenize||q)(a,b),L&&"object"==typeof L&&(M=L[1],L=L[0]),N=L,b.state=ea[b.state](M,a,b),N)},indent:function(a,b,c){var d=a.context,e=b&&b.charAt(0),f=d.indent,g=J(b),h=c.length-c.replace(/^\s*/,"").length,i=a.context.prev?a.context.prev.line.firstWord:"",j=a.context.prev?a.context.prev.line.indent:h;return d.prev&&("}"==e&&("block"==d.type||"atBlock"==d.type||"keyframes"==d.type)||")"==e&&("parens"==d.type||"atBlock_parens"==d.type)||"{"==e&&"at"==d.type)?(f=d.indent-O,d=d.prev):/(\})/.test(e)||(/@|\$|\d/.test(e)||/^\{/.test(b)||/^\s*\/(\/|\*)/.test(b)||/^\s*\/\*/.test(i)||/^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(b)||/^(\+|-)?[a-z][\w-]*\(/i.test(b)||/^return/.test(b)||B(g)?f=h:/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(e)||z(g)?f=/\,\s*$/.test(i)?j:/^\s+/.test(c)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(i)||z(i))?j>=h?j:j+O:h:/,\s*$/.test(c)||!C(g)&&!A(g)||(f=B(i)?j>=h?j:j+O:/^\{/.test(i)?j>=h?h:j+O:C(i)||A(i)?h>=j?j:h:/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(i)||/=\s*$/.test(i)||z(i)||/^\$[\w-\.\[\]\'\"]/.test(i)?j+O:h)),f},electricChars:"}",lineComment:"//",fold:"indent"}});var e=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video"],f=["domain","regexp","url","url-prefix"],g=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],h=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],i=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"],j=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],k=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],l=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],m=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale"],n=["in","and","or","not","is not","is a","is","isnt","defined","if unless"],o=["for","if","else","unless","from","to"],p=["null","true","false","href","title","type","not-allowed","readonly","disabled"],q=["@font-face","@keyframes","@media","@viewport","@page","@host","@supports","@block","@css"],r=e.concat(f,g,h,i,j,l,m,k,n,o,p,q);a.registerHelper("hintWords","stylus",r),a.defineMIME("text/x-styl","stylus")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/tcl/tcl.min.js b/media/editors/codemirror/mode/tcl/tcl.min.js +index 144ca1a..49b0831 100644 +--- a/media/editors/codemirror/mode/tcl/tcl.min.js ++++ b/media/editors/codemirror/mode/tcl/tcl.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tcl",function(){function e(e){for(var r={},t=e.split(" "),n=0;n!?^\/\|]/;return{startState:function(){return{tokenize:t,beforeParams:!1,inParams:!1}},token:function(e,r){return e.eatSpace()?null:r.tokenize(e,r)}}}),e.defineMIME("text/x-tcl","tcl")}); +\ 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("tcl",function(){function a(a){for(var b={},c=a.split(" "),d=0;d!?^\/\|]/;return{startState:function(){return{tokenize:c,beforeParams:!1,inParams:!1}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)}}}),a.defineMIME("text/x-tcl","tcl")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/textile/test.js b/media/editors/codemirror/mode/textile/test.js +deleted file mode 100644 +index 49cdaf9..0000000 +--- a/media/editors/codemirror/mode/textile/test.js ++++ /dev/null +@@ -1,417 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({tabSize: 4}, 'textile'); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- +- MT('simpleParagraphs', +- 'Some text.', +- '', +- 'Some more text.'); +- +- /* +- * Phrase Modifiers +- */ +- +- MT('em', +- 'foo [em _bar_]'); +- +- MT('emBoogus', +- 'code_mirror'); +- +- MT('strong', +- 'foo [strong *bar*]'); +- +- MT('strongBogus', +- '3 * 3 = 9'); +- +- MT('italic', +- 'foo [em __bar__]'); +- +- MT('italicBogus', +- 'code__mirror'); +- +- MT('bold', +- 'foo [strong **bar**]'); +- +- MT('boldBogus', +- '3 ** 3 = 27'); +- +- MT('simpleLink', +- '[link "CodeMirror":http://codemirror.net]'); +- +- MT('referenceLink', +- '[link "CodeMirror":code_mirror]', +- 'Normal Text.', +- '[link [[code_mirror]]http://codemirror.net]'); +- +- MT('footCite', +- 'foo bar[qualifier [[1]]]'); +- +- MT('footCiteBogus', +- 'foo bar[[1a2]]'); +- +- MT('special-characters', +- 'Registered [tag (r)], ' + +- 'Trademark [tag (tm)], and ' + +- 'Copyright [tag (c)] 2008'); +- +- MT('cite', +- "A book is [keyword ??The Count of Monte Cristo??] by Dumas."); +- +- MT('additionAndDeletion', +- 'The news networks declared [negative -Al Gore-] ' + +- '[positive +George W. Bush+] the winner in Florida.'); +- +- MT('subAndSup', +- 'f(x, n) = log [builtin ~4~] x [builtin ^n^]'); +- +- MT('spanAndCode', +- 'A [quote %span element%] and [atom @code element@]'); +- +- MT('spanBogus', +- 'Percentage 25% is not a span.'); +- +- MT('citeBogus', +- 'Question? is not a citation.'); +- +- MT('codeBogus', +- 'user@example.com'); +- +- MT('subBogus', +- '~username'); +- +- MT('supBogus', +- 'foo ^ bar'); +- +- MT('deletionBogus', +- '3 - 3 = 0'); +- +- MT('additionBogus', +- '3 + 3 = 6'); +- +- MT('image', +- 'An image: [string !http://www.example.com/image.png!]'); +- +- MT('imageWithAltText', +- 'An image: [string !http://www.example.com/image.png (Alt Text)!]'); +- +- MT('imageWithUrl', +- 'An image: [string !http://www.example.com/image.png!:http://www.example.com/]'); +- +- /* +- * Headers +- */ +- +- MT('h1', +- '[header&header-1 h1. foo]'); +- +- MT('h2', +- '[header&header-2 h2. foo]'); +- +- MT('h3', +- '[header&header-3 h3. foo]'); +- +- MT('h4', +- '[header&header-4 h4. foo]'); +- +- MT('h5', +- '[header&header-5 h5. foo]'); +- +- MT('h6', +- '[header&header-6 h6. foo]'); +- +- MT('h7Bogus', +- 'h7. foo'); +- +- MT('multipleHeaders', +- '[header&header-1 h1. Heading 1]', +- '', +- 'Some text.', +- '', +- '[header&header-2 h2. Heading 2]', +- '', +- 'More text.'); +- +- MT('h1inline', +- '[header&header-1 h1. foo ][header&header-1&em _bar_][header&header-1 baz]'); +- +- /* +- * Lists +- */ +- +- MT('ul', +- 'foo', +- 'bar', +- '', +- '[variable-2 * foo]', +- '[variable-2 * bar]'); +- +- MT('ulNoBlank', +- 'foo', +- 'bar', +- '[variable-2 * foo]', +- '[variable-2 * bar]'); +- +- MT('ol', +- 'foo', +- 'bar', +- '', +- '[variable-2 # foo]', +- '[variable-2 # bar]'); +- +- MT('olNoBlank', +- 'foo', +- 'bar', +- '[variable-2 # foo]', +- '[variable-2 # bar]'); +- +- MT('ulFormatting', +- '[variable-2 * ][variable-2&em _foo_][variable-2 bar]', +- '[variable-2 * ][variable-2&strong *][variable-2&em&strong _foo_]' + +- '[variable-2&strong *][variable-2 bar]', +- '[variable-2 * ][variable-2&strong *foo*][variable-2 bar]'); +- +- MT('olFormatting', +- '[variable-2 # ][variable-2&em _foo_][variable-2 bar]', +- '[variable-2 # ][variable-2&strong *][variable-2&em&strong _foo_]' + +- '[variable-2&strong *][variable-2 bar]', +- '[variable-2 # ][variable-2&strong *foo*][variable-2 bar]'); +- +- MT('ulNested', +- '[variable-2 * foo]', +- '[variable-3 ** bar]', +- '[keyword *** bar]', +- '[variable-2 **** bar]', +- '[variable-3 ** bar]'); +- +- MT('olNested', +- '[variable-2 # foo]', +- '[variable-3 ## bar]', +- '[keyword ### bar]', +- '[variable-2 #### bar]', +- '[variable-3 ## bar]'); +- +- MT('ulNestedWithOl', +- '[variable-2 * foo]', +- '[variable-3 ## bar]', +- '[keyword *** bar]', +- '[variable-2 #### bar]', +- '[variable-3 ** bar]'); +- +- MT('olNestedWithUl', +- '[variable-2 # foo]', +- '[variable-3 ** bar]', +- '[keyword ### bar]', +- '[variable-2 **** bar]', +- '[variable-3 ## bar]'); +- +- MT('definitionList', +- '[number - coffee := Hot ][number&em _and_][number black]', +- '', +- 'Normal text.'); +- +- MT('definitionListSpan', +- '[number - coffee :=]', +- '', +- '[number Hot ][number&em _and_][number black =:]', +- '', +- 'Normal text.'); +- +- MT('boo', +- '[number - dog := woof woof]', +- '[number - cat := meow meow]', +- '[number - whale :=]', +- '[number Whale noises.]', +- '', +- '[number Also, ][number&em _splashing_][number . =:]'); +- +- /* +- * Attributes +- */ +- +- MT('divWithAttribute', +- '[punctuation div][punctuation&attribute (#my-id)][punctuation . foo bar]'); +- +- MT('divWithAttributeAnd2emRightPadding', +- '[punctuation div][punctuation&attribute (#my-id)((][punctuation . foo bar]'); +- +- MT('divWithClassAndId', +- '[punctuation div][punctuation&attribute (my-class#my-id)][punctuation . foo bar]'); +- +- MT('paragraphWithCss', +- 'p[attribute {color:red;}]. foo bar'); +- +- MT('paragraphNestedStyles', +- 'p. [strong *foo ][strong&em _bar_][strong *]'); +- +- MT('paragraphWithLanguage', +- 'p[attribute [[fr]]]. Parlez-vous français?'); +- +- MT('paragraphLeftAlign', +- 'p[attribute <]. Left'); +- +- MT('paragraphRightAlign', +- 'p[attribute >]. Right'); +- +- MT('paragraphRightAlign', +- 'p[attribute =]. Center'); +- +- MT('paragraphJustified', +- 'p[attribute <>]. Justified'); +- +- MT('paragraphWithLeftIndent1em', +- 'p[attribute (]. Left'); +- +- MT('paragraphWithRightIndent1em', +- 'p[attribute )]. Right'); +- +- MT('paragraphWithLeftIndent2em', +- 'p[attribute ((]. Left'); +- +- MT('paragraphWithRightIndent2em', +- 'p[attribute ))]. Right'); +- +- MT('paragraphWithLeftIndent3emRightIndent2em', +- 'p[attribute ((())]. Right'); +- +- MT('divFormatting', +- '[punctuation div. ][punctuation&strong *foo ]' + +- '[punctuation&strong&em _bar_][punctuation&strong *]'); +- +- MT('phraseModifierAttributes', +- 'p[attribute (my-class)]. This is a paragraph that has a class and' + +- ' this [em _][em&attribute (#special-phrase)][em emphasized phrase_]' + +- ' has an id.'); +- +- MT('linkWithClass', +- '[link "(my-class). This is a link with class":http://redcloth.org]'); +- +- /* +- * Layouts +- */ +- +- MT('paragraphLayouts', +- 'p. This is one paragraph.', +- '', +- 'p. This is another.'); +- +- MT('div', +- '[punctuation div. foo bar]'); +- +- MT('pre', +- '[operator pre. Text]'); +- +- MT('bq.', +- '[bracket bq. foo bar]', +- '', +- 'Normal text.'); +- +- MT('footnote', +- '[variable fn123. foo ][variable&strong *bar*]'); +- +- /* +- * Spanning Layouts +- */ +- +- MT('bq..ThenParagraph', +- '[bracket bq.. foo bar]', +- '', +- '[bracket More quote.]', +- 'p. Normal Text'); +- +- MT('bq..ThenH1', +- '[bracket bq.. foo bar]', +- '', +- '[bracket More quote.]', +- '[header&header-1 h1. Header Text]'); +- +- MT('bc..ThenParagraph', +- '[atom bc.. # Some ruby code]', +- '[atom obj = {foo: :bar}]', +- '[atom puts obj]', +- '', +- '[atom obj[[:love]] = "*love*"]', +- '[atom puts obj.love.upcase]', +- '', +- 'p. Normal text.'); +- +- MT('fn1..ThenParagraph', +- '[variable fn1.. foo bar]', +- '', +- '[variable More.]', +- 'p. Normal Text'); +- +- MT('pre..ThenParagraph', +- '[operator pre.. foo bar]', +- '', +- '[operator More.]', +- 'p. Normal Text'); +- +- /* +- * Tables +- */ +- +- MT('table', +- '[variable-3&operator |_. name |_. age|]', +- '[variable-3 |][variable-3&strong *Walter*][variable-3 | 5 |]', +- '[variable-3 |Florence| 6 |]', +- '', +- 'p. Normal text.'); +- +- MT('tableWithAttributes', +- '[variable-3&operator |_. name |_. age|]', +- '[variable-3 |][variable-3&attribute /2.][variable-3 Jim |]', +- '[variable-3 |][variable-3&attribute \\2{color: red}.][variable-3 Sam |]'); +- +- /* +- * HTML +- */ +- +- MT('html', +- '[comment
    ]', +- '[comment
    ]', +- '', +- '[header&header-1 h1. Welcome]', +- '', +- '[variable-2 * Item one]', +- '[variable-2 * Item two]', +- '', +- '[comment Example]', +- '', +- '[comment
    ]', +- '[comment
    ]'); +- +- MT('inlineHtml', +- 'I can use HTML directly in my [comment Textile].'); +- +- /* +- * No-Textile +- */ +- +- MT('notextile', +- '[string-2 notextile. *No* formatting]'); +- +- MT('notextileInline', +- 'Use [string-2 ==*asterisks*==] for [strong *strong*] text.'); +- +- MT('notextileWithPre', +- '[operator pre. *No* formatting]'); +- +- MT('notextileWithSpanningPre', +- '[operator pre.. *No* formatting]', +- '', +- '[operator *No* formatting]'); +- +- /* Only toggling phrases between non-word chars. */ +- +- MT('phrase-in-word', +- 'foo_bar_baz'); +- +- MT('phrase-non-word', +- '[negative -x-] aaa-bbb ccc-ddd [negative -eee-] fff [negative -ggg-]'); +- +- MT('phrase-lone-dash', +- 'foo - bar - baz'); +-})(); +diff --git a/media/editors/codemirror/mode/textile/test.min.js b/media/editors/codemirror/mode/textile/test.min.js +deleted file mode 100644 +index d15f50b..0000000 +--- a/media/editors/codemirror/mode/textile/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function a(a){test.mode(a,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4},"textile");a("simpleParagraphs","Some text.","","Some more text."),a("em","foo [em _bar_]"),a("emBoogus","code_mirror"),a("strong","foo [strong *bar*]"),a("strongBogus","3 * 3 = 9"),a("italic","foo [em __bar__]"),a("italicBogus","code__mirror"),a("bold","foo [strong **bar**]"),a("boldBogus","3 ** 3 = 27"),a("simpleLink",'[link "CodeMirror":http://codemirror.net]'),a("referenceLink",'[link "CodeMirror":code_mirror]',"Normal Text.","[link [[code_mirror]]http://codemirror.net]"),a("footCite","foo bar[qualifier [[1]]]"),a("footCiteBogus","foo bar[[1a2]]"),a("special-characters","Registered [tag (r)], Trademark [tag (tm)], and Copyright [tag (c)] 2008"),a("cite","A book is [keyword ??The Count of Monte Cristo??] by Dumas."),a("additionAndDeletion","The news networks declared [negative -Al Gore-] [positive +George W. Bush+] the winner in Florida."),a("subAndSup","f(x, n) = log [builtin ~4~] x [builtin ^n^]"),a("spanAndCode","A [quote %span element%] and [atom @code element@]"),a("spanBogus","Percentage 25% is not a span."),a("citeBogus","Question? is not a citation."),a("codeBogus","user@example.com"),a("subBogus","~username"),a("supBogus","foo ^ bar"),a("deletionBogus","3 - 3 = 0"),a("additionBogus","3 + 3 = 6"),a("image","An image: [string !http://www.example.com/image.png!]"),a("imageWithAltText","An image: [string !http://www.example.com/image.png (Alt Text)!]"),a("imageWithUrl","An image: [string !http://www.example.com/image.png!:http://www.example.com/]"),a("h1","[header&header-1 h1. foo]"),a("h2","[header&header-2 h2. foo]"),a("h3","[header&header-3 h3. foo]"),a("h4","[header&header-4 h4. foo]"),a("h5","[header&header-5 h5. foo]"),a("h6","[header&header-6 h6. foo]"),a("h7Bogus","h7. foo"),a("multipleHeaders","[header&header-1 h1. Heading 1]","","Some text.","","[header&header-2 h2. Heading 2]","","More text."),a("h1inline","[header&header-1 h1. foo ][header&header-1&em _bar_][header&header-1 baz]"),a("ul","foo","bar","","[variable-2 * foo]","[variable-2 * bar]"),a("ulNoBlank","foo","bar","[variable-2 * foo]","[variable-2 * bar]"),a("ol","foo","bar","","[variable-2 # foo]","[variable-2 # bar]"),a("olNoBlank","foo","bar","[variable-2 # foo]","[variable-2 # bar]"),a("ulFormatting","[variable-2 * ][variable-2&em _foo_][variable-2 bar]","[variable-2 * ][variable-2&strong *][variable-2&em&strong _foo_][variable-2&strong *][variable-2 bar]","[variable-2 * ][variable-2&strong *foo*][variable-2 bar]"),a("olFormatting","[variable-2 # ][variable-2&em _foo_][variable-2 bar]","[variable-2 # ][variable-2&strong *][variable-2&em&strong _foo_][variable-2&strong *][variable-2 bar]","[variable-2 # ][variable-2&strong *foo*][variable-2 bar]"),a("ulNested","[variable-2 * foo]","[variable-3 ** bar]","[keyword *** bar]","[variable-2 **** bar]","[variable-3 ** bar]"),a("olNested","[variable-2 # foo]","[variable-3 ## bar]","[keyword ### bar]","[variable-2 #### bar]","[variable-3 ## bar]"),a("ulNestedWithOl","[variable-2 * foo]","[variable-3 ## bar]","[keyword *** bar]","[variable-2 #### bar]","[variable-3 ** bar]"),a("olNestedWithUl","[variable-2 # foo]","[variable-3 ** bar]","[keyword ### bar]","[variable-2 **** bar]","[variable-3 ## bar]"),a("definitionList","[number - coffee := Hot ][number&em _and_][number black]","","Normal text."),a("definitionListSpan","[number - coffee :=]","","[number Hot ][number&em _and_][number black =:]","","Normal text."),a("boo","[number - dog := woof woof]","[number - cat := meow meow]","[number - whale :=]","[number Whale noises.]","","[number Also, ][number&em _splashing_][number . =:]"),a("divWithAttribute","[punctuation div][punctuation&attribute (#my-id)][punctuation . foo bar]"),a("divWithAttributeAnd2emRightPadding","[punctuation div][punctuation&attribute (#my-id)((][punctuation . foo bar]"),a("divWithClassAndId","[punctuation div][punctuation&attribute (my-class#my-id)][punctuation . foo bar]"),a("paragraphWithCss","p[attribute {color:red;}]. foo bar"),a("paragraphNestedStyles","p. [strong *foo ][strong&em _bar_][strong *]"),a("paragraphWithLanguage","p[attribute [[fr]]]. Parlez-vous français?"),a("paragraphLeftAlign","p[attribute <]. Left"),a("paragraphRightAlign","p[attribute >]. Right"),a("paragraphRightAlign","p[attribute =]. Center"),a("paragraphJustified","p[attribute <>]. Justified"),a("paragraphWithLeftIndent1em","p[attribute (]. Left"),a("paragraphWithRightIndent1em","p[attribute )]. Right"),a("paragraphWithLeftIndent2em","p[attribute ((]. Left"),a("paragraphWithRightIndent2em","p[attribute ))]. Right"),a("paragraphWithLeftIndent3emRightIndent2em","p[attribute ((())]. Right"),a("divFormatting","[punctuation div. ][punctuation&strong *foo ][punctuation&strong&em _bar_][punctuation&strong *]"),a("phraseModifierAttributes","p[attribute (my-class)]. This is a paragraph that has a class and this [em _][em&attribute (#special-phrase)][em emphasized phrase_] has an id."),a("linkWithClass",'[link "(my-class). This is a link with class":http://redcloth.org]'),a("paragraphLayouts","p. This is one paragraph.","","p. This is another."),a("div","[punctuation div. foo bar]"),a("pre","[operator pre. Text]"),a("bq.","[bracket bq. foo bar]","","Normal text."),a("footnote","[variable fn123. foo ][variable&strong *bar*]"),a("bq..ThenParagraph","[bracket bq.. foo bar]","","[bracket More quote.]","p. Normal Text"),a("bq..ThenH1","[bracket bq.. foo bar]","","[bracket More quote.]","[header&header-1 h1. Header Text]"),a("bc..ThenParagraph","[atom bc.. # Some ruby code]","[atom obj = {foo: :bar}]","[atom puts obj]","",'[atom obj[[:love]] = "*love*"]',"[atom puts obj.love.upcase]","","p. Normal text."),a("fn1..ThenParagraph","[variable fn1.. foo bar]","","[variable More.]","p. Normal Text"),a("pre..ThenParagraph","[operator pre.. foo bar]","","[operator More.]","p. Normal Text"),a("table","[variable-3&operator |_. name |_. age|]","[variable-3 |][variable-3&strong *Walter*][variable-3 | 5 |]","[variable-3 |Florence| 6 |]","","p. Normal text."),a("tableWithAttributes","[variable-3&operator |_. name |_. age|]","[variable-3 |][variable-3&attribute /2.][variable-3 Jim |]","[variable-3 |][variable-3&attribute \\2{color: red}.][variable-3 Sam |]"),a("html",'[comment
    ]','[comment
    ]',"","[header&header-1 h1. Welcome]","","[variable-2 * Item one]","[variable-2 * Item two]","",'[comment Example]',"","[comment
    ]","[comment
    ]"),a("inlineHtml",'I can use HTML directly in my [comment Textile].'),a("notextile","[string-2 notextile. *No* formatting]"),a("notextileInline","Use [string-2 ==*asterisks*==] for [strong *strong*] text."),a("notextileWithPre","[operator pre. *No* formatting]"),a("notextileWithSpanningPre","[operator pre.. *No* formatting]","","[operator *No* formatting]"),a("phrase-in-word","foo_bar_baz"),a("phrase-non-word","[negative -x-] aaa-bbb ccc-ddd [negative -eee-] fff [negative -ggg-]"),a("phrase-lone-dash","foo - bar - baz")}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/textile/textile.min.js b/media/editors/codemirror/mode/textile/textile.min.js +index 1700000..77bd0ba 100644 +--- a/media/editors/codemirror/mode/textile/textile.min.js ++++ b/media/editors/codemirror/mode/textile/textile.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){e.mode=f.newLayout,e.tableHeading=!1,"definitionList"===e.layoutType&&e.spanningLayout&&t.match(s("definitionListEnd"),!1)&&(e.spanningLayout=!1)}function n(t,e,n){if("_"===n)return t.eat("_")?i(t,e,"italic",/__/,2):i(t,e,"em",/_/,1);if("*"===n)return t.eat("*")?i(t,e,"bold",/\*\*/,2):i(t,e,"strong",/\*/,1);if("["===n)return t.match(/\d+\]/)&&(e.footCite=!0),a(e);if("("===n){var r=t.match(/^(r|tm|c)\)/);if(r)return l(e,c.specialChar)}if("<"===n&&t.match(/(\w+)[^>]+>[^<]+<\/\1>/))return l(e,c.html);if("?"===n&&t.eat("?"))return i(t,e,"cite",/\?\?/,2);if("="===n&&t.eat("="))return i(t,e,"notextile",/==/,2);if("-"===n&&!t.eat("-"))return i(t,e,"deletion",/-/,1);if("+"===n)return i(t,e,"addition",/\+/,1);if("~"===n)return i(t,e,"sub",/~/,1);if("^"===n)return i(t,e,"sup",/\^/,1);if("%"===n)return i(t,e,"span",/%/,1);if("@"===n)return i(t,e,"code",/@/,1);if("!"===n){var o=i(t,e,"image",/(?:\([^\)]+\))?!/,1);return t.match(/^:\S+/),o}return a(e)}function i(t,e,n,i,r){var l=t.pos>r?t.string.charAt(t.pos-r-1):null,o=t.peek();if(e[n]){if((!o||/\W/.test(o))&&l&&/\S/.test(l)){var u=a(e);return e[n]=!1,u}}else(!l||/\W/.test(l))&&o&&/\S/.test(o)&&t.match(new RegExp("^.*\\S"+i.source+"(?:\\W|$)"),!1)&&(e[n]=!0,e.mode=f.attributes);return a(e)}function a(t){var e=r(t);if(e)return e;var n=[];return t.layoutType&&n.push(c[t.layoutType]),n=n.concat(o(t,"addition","bold","cite","code","deletion","em","footCite","image","italic","link","span","strong","sub","sup","table","tableHeading")),"header"===t.layoutType&&n.push(c.header+"-"+t.header),n.length?n.join(" "):null}function r(t){var e=t.layoutType;switch(e){case"notextile":case"code":case"pre":return c[e];default:return t.notextile?c.notextile+(e?" "+c[e]:""):null}}function l(t,e){var n=r(t);if(n)return n;var i=a(t);return e?i?i+" "+e:e:i}function o(t){for(var e=[],n=1;n]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(t){switch(t){case"drawTable":return d.makeRe("^",d.single.drawTable,"$");case"html":return d.makeRe("^",d.single.html,"(?:",d.single.html,")*","$");case"linkDefinition":return d.makeRe("^",d.single.linkDefinition,"$");case"listLayout":return d.makeRe("^",d.single.list,s("allAttributes"),"*\\s+");case"tableCellAttributes":return d.makeRe("^",d.choiceRe(d.single.tableCellAttributes,s("allAttributes")),"+\\.");case"type":return d.makeRe("^",s("allTypes"));case"typeLayout":return d.makeRe("^",s("allTypes"),s("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return d.makeRe("^",s("allAttributes"),"+");case"allTypes":return d.choiceRe(d.single.div,d.single.foot,d.single.header,d.single.bc,d.single.bq,d.single.notextile,d.single.pre,d.single.table,d.single.para);case"allAttributes":return d.choiceRe(d.attributes.selector,d.attributes.css,d.attributes.lang,d.attributes.align,d.attributes.pad);default:return d.makeRe("^",d.single[t])}},makeRe:function(){for(var t="",e=0;e]+>[^<]+<\/\1>/))return g(b,k.html);if("?"===c&&a.eat("?"))return d(a,b,"cite",/\?\?/,2);if("="===c&&a.eat("="))return d(a,b,"notextile",/==/,2);if("-"===c&&!a.eat("-"))return d(a,b,"deletion",/-/,1);if("+"===c)return d(a,b,"addition",/\+/,1);if("~"===c)return d(a,b,"sub",/~/,1);if("^"===c)return d(a,b,"sup",/\^/,1);if("%"===c)return d(a,b,"span",/%/,1);if("@"===c)return d(a,b,"code",/@/,1);if("!"===c){var h=d(a,b,"image",/(?:\([^\)]+\))?!/,1);return a.match(/^:\S+/),h}return e(b)}function d(a,b,c,d,f){var g=a.pos>f?a.string.charAt(a.pos-f-1):null,h=a.peek();if(b[c]){if((!h||/\W/.test(h))&&g&&/\S/.test(g)){var i=e(b);return b[c]=!1,i}}else(!g||/\W/.test(g))&&h&&/\S/.test(h)&&a.match(new RegExp("^.*\\S"+d.source+"(?:\\W|$)"),!1)&&(b[c]=!0,b.mode=m.attributes);return e(b)}function e(a){var b=f(a);if(b)return b;var c=[];return a.layoutType&&c.push(k[a.layoutType]),c=c.concat(h(a,"addition","bold","cite","code","deletion","em","footCite","image","italic","link","span","strong","sub","sup","table","tableHeading")),"header"===a.layoutType&&c.push(k.header+"-"+a.header),c.length?c.join(" "):null}function f(a){var b=a.layoutType;switch(b){case"notextile":case"code":case"pre":return k[b];default:return a.notextile?k.notextile+(b?" "+k[b]:""):null}}function g(a,b){var c=f(a);if(c)return c;var d=e(a);return b?d?d+" "+b:b:d}function h(a){for(var b=[],c=1;c]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(a){switch(a){case"drawTable":return l.makeRe("^",l.single.drawTable,"$");case"html":return l.makeRe("^",l.single.html,"(?:",l.single.html,")*","$");case"linkDefinition":return l.makeRe("^",l.single.linkDefinition,"$");case"listLayout":return l.makeRe("^",l.single.list,j("allAttributes"),"*\\s+");case"tableCellAttributes":return l.makeRe("^",l.choiceRe(l.single.tableCellAttributes,j("allAttributes")),"+\\.");case"type":return l.makeRe("^",j("allTypes"));case"typeLayout":return l.makeRe("^",j("allTypes"),j("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return l.makeRe("^",j("allAttributes"),"+");case"allTypes":return l.choiceRe(l.single.div,l.single.foot,l.single.header,l.single.bc,l.single.bq,l.single.notextile,l.single.pre,l.single.table,l.single.para);case"allAttributes":return l.choiceRe(l.attributes.selector,l.attributes.css,l.attributes.lang,l.attributes.align,l.attributes.pad);default:return l.makeRe("^",l.single[a])}},makeRe:function(){for(var a="",b=0;b|]/.test(ch)) { + if (ch == "!") { // tw header + stream.skipToEnd(); +- return ret("header", "header"); ++ return "header"; + } + if (ch == "*") { // tw list + stream.eatWhile('*'); +- return ret("list", "comment"); ++ return "comment"; + } + if (ch == "#") { // tw numbered list + stream.eatWhile('#'); +- return ret("list", "comment"); ++ return "comment"; + } + if (ch == ";") { // definition list, term + stream.eatWhile(';'); +- return ret("list", "comment"); ++ return "comment"; + } + if (ch == ":") { // definition list, description + stream.eatWhile(':'); +- return ret("list", "comment"); ++ return "comment"; + } + if (ch == ">") { // single line quote + stream.eatWhile(">"); +- return ret("quote", "quote"); ++ return "quote"; + } + if (ch == '|') { +- return ret('table', 'header'); ++ return 'header'; + } + } + +@@ -146,29 +136,29 @@ CodeMirror.defineMode("tiddlywiki", function () { + // rudimentary html:// file:// link matching. TW knows much more ... + if (/[hf]/i.test(ch)) { + if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { +- return ret("link", "link"); ++ return "link"; + } + } + // just a little string indicator, don't want to have the whole string covered + if (ch == '"') { +- return ret('string', 'string'); ++ return 'string'; + } + if (ch == '~') { // _no_ CamelCase indicator should be bold +- return ret('text', 'brace'); ++ return 'brace'; + } + if (/[\[\]]/.test(ch)) { // check for [[..]] + if (stream.peek() == ch) { + stream.next(); +- return ret('brace', 'brace'); ++ return 'brace'; + } + } + if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting + stream.eatWhile(isSpaceName); +- return ret("link", "link"); ++ return "link"; + } + if (/\d/.test(ch)) { // numbers + stream.eatWhile(/\d/); +- return ret("number", "number"); ++ return "number"; + } + if (ch == "/") { // tw invisible comment + if (stream.eat("%")) { +@@ -191,7 +181,7 @@ CodeMirror.defineMode("tiddlywiki", function () { + return chain(stream, state, twTokenStrike); + // mdash + if (stream.peek() == ' ') +- return ret('text', 'brace'); ++ return 'brace'; + } + } + if (ch == "'") { // tw bold +@@ -205,7 +195,7 @@ CodeMirror.defineMode("tiddlywiki", function () { + } + } + else { +- return ret(ch); ++ return null; + } + + // core macro handling +@@ -213,8 +203,7 @@ CodeMirror.defineMode("tiddlywiki", function () { + var word = stream.current(), + known = textwords.propertyIsEnumerable(word) && textwords[word]; + +- return known ? ret(known.type, known.style, word) : ret("text", null, word); +- ++ return known ? known.style : null; + } // jsTokenBase() + + // tw invisible comment +@@ -228,7 +217,7 @@ CodeMirror.defineMode("tiddlywiki", function () { + } + maybeEnd = (ch == "%"); + } +- return ret("comment", "comment"); ++ return "comment"; + } + + // tw strong / bold +@@ -242,29 +231,29 @@ CodeMirror.defineMode("tiddlywiki", function () { + } + maybeEnd = (ch == "'"); + } +- return ret("text", "strong"); ++ return "strong"; + } + + // tw code + function twTokenCode(stream, state) { +- var ch, sb = state.block; ++ var sb = state.block; + + if (sb && stream.current()) { +- return ret("code", "comment"); ++ return "comment"; + } + + if (!sb && stream.match(reUntilCodeStop)) { + state.tokenize = jsTokenBase; +- return ret("code", "comment"); ++ return "comment"; + } + + if (sb && stream.sol() && stream.match(reCodeBlockStop)) { + state.tokenize = jsTokenBase; +- return ret("code", "comment"); ++ return "comment"; + } + +- ch = stream.next(); +- return (sb) ? ret("code", "comment") : ret("code", "comment"); ++ stream.next(); ++ return "comment"; + } + + // tw em / italic +@@ -278,7 +267,7 @@ CodeMirror.defineMode("tiddlywiki", function () { + } + maybeEnd = (ch == "/"); + } +- return ret("text", "em"); ++ return "em"; + } + + // tw underlined text +@@ -292,7 +281,7 @@ CodeMirror.defineMode("tiddlywiki", function () { + } + maybeEnd = (ch == "_"); + } +- return ret("text", "underlined"); ++ return "underlined"; + } + + // tw strike through text looks ugly +@@ -307,7 +296,7 @@ CodeMirror.defineMode("tiddlywiki", function () { + } + maybeEnd = (ch == "-"); + } +- return ret("text", "strikethrough"); ++ return "strikethrough"; + } + + // macro +@@ -315,19 +304,19 @@ CodeMirror.defineMode("tiddlywiki", function () { + var ch, word, known; + + if (stream.current() == '<<') { +- return ret('brace', 'macro'); ++ return 'macro'; + } + + ch = stream.next(); + if (!ch) { + state.tokenize = jsTokenBase; +- return ret(ch); ++ return null; + } + if (ch == ">") { + if (stream.peek() == '>') { + stream.next(); + state.tokenize = jsTokenBase; +- return ret("brace", "macro"); ++ return "macro"; + } + } + +@@ -336,10 +325,10 @@ CodeMirror.defineMode("tiddlywiki", function () { + known = keywords.propertyIsEnumerable(word) && keywords[word]; + + if (known) { +- return ret(known.type, known.style, word); ++ return known.style, word; + } + else { +- return ret("macro", null, word); ++ return null, word; + } + } + +diff --git a/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.css b/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.css +index 8ab7cb1..0311c95 100644 +--- a/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.css ++++ b/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.css +@@ -1 +1 @@ +-span.cm-underlined{text-decoration:underline}span.cm-strikethrough{text-decoration:line-through}span.cm-brace{color:#170;font-weight:bold}span.cm-table{color:blue;font-weight:bold} +\ No newline at end of file ++span.cm-underlined{text-decoration:underline}span.cm-strikethrough{text-decoration:line-through}span.cm-brace{color:#170;font-weight:700}span.cm-table{color:#00f;font-weight:700} +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.js b/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.js +index 9233859..320c353 100644 +--- a/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.js ++++ b/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tiddlywiki",function(){function e(e,t,r){return t.tokenize=r,r(e,t)}function t(e,t,r){return l=e,m=r,t}function r(r,l){var m,d=r.sol();if(l.block=!1,m=r.peek(),d&&/[<\/\*{}\-]/.test(m)){if(r.match($))return l.block=!0,e(r,l,o);if(r.match(x))return t("quote","quote");if(r.match(b)||r.match(p))return t("code","comment");if(r.match(g)||r.match(v)||r.match(y)||r.match(w))return t("code","comment");if(r.match(k))return t("hr","hr")}if(m=r.next(),d&&/[\/\*!#;:>|]/.test(m)){if("!"==m)return r.skipToEnd(),t("header","header");if("*"==m)return r.eatWhile("*"),t("list","comment");if("#"==m)return r.eatWhile("#"),t("list","comment");if(";"==m)return r.eatWhile(";"),t("list","comment");if(":"==m)return r.eatWhile(":"),t("list","comment");if(">"==m)return r.eatWhile(">"),t("quote","quote");if("|"==m)return t("table","header")}if("{"==m&&r.match(/\{\{/))return e(r,l,o);if(/[hf]/i.test(m)&&/[ti]/i.test(r.peek())&&r.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return t("link","link");if('"'==m)return t("string","string");if("~"==m)return t("text","brace");if(/[\[\]]/.test(m)&&r.peek()==m)return r.next(),t("brace","brace");if("@"==m)return r.eatWhile(h),t("link","link");if(/\d/.test(m))return r.eatWhile(/\d/),t("number","number");if("/"==m){if(r.eat("%"))return e(r,l,n);if(r.eat("/"))return e(r,l,a)}if("_"==m&&r.eat("_"))return e(r,l,u);if("-"==m&&r.eat("-")){if(" "!=r.peek())return e(r,l,c);if(" "==r.peek())return t("text","brace")}if("'"==m&&r.eat("'"))return e(r,l,i);if("<"!=m)return t(m);if(r.eat("<"))return e(r,l,f);r.eatWhile(/[\w\$_]/);var z=r.current(),W=s.propertyIsEnumerable(z)&&s[z];return W?t(W.type,W.style,z):t("text",null,z)}function n(e,n){for(var i,o=!1;i=e.next();){if("/"==i&&o){n.tokenize=r;break}o="%"==i}return t("comment","comment")}function i(e,n){for(var i,o=!1;i=e.next();){if("'"==i&&o){n.tokenize=r;break}o="'"==i}return t("text","strong")}function o(e,n){var i,o=n.block;return o&&e.current()?t("code","comment"):!o&&e.match(W)?(n.tokenize=r,t("code","comment")):o&&e.sol()&&e.match(z)?(n.tokenize=r,t("code","comment")):(i=e.next(),o?t("code","comment"):t("code","comment"))}function a(e,n){for(var i,o=!1;i=e.next();){if("/"==i&&o){n.tokenize=r;break}o="/"==i}return t("text","em")}function u(e,n){for(var i,o=!1;i=e.next();){if("_"==i&&o){n.tokenize=r;break}o="_"==i}return t("text","underlined")}function c(e,n){for(var i,o=!1;i=e.next();){if("-"==i&&o){n.tokenize=r;break}o="-"==i}return t("text","strikethrough")}function f(e,n){var i,o,a;return"<<"==e.current()?t("brace","macro"):(i=e.next())?">"==i&&">"==e.peek()?(e.next(),n.tokenize=r,t("brace","macro")):(e.eatWhile(/[\w\$_]/),o=e.current(),a=d.propertyIsEnumerable(o)&&d[o],a?t(a.type,a.style,o):t("macro",null,o)):(n.tokenize=r,t(i))}var l,m,s={},d=function(){function e(e){return{type:e,style:"macro"}}return{allTags:e("allTags"),closeAll:e("closeAll"),list:e("list"),newJournal:e("newJournal"),newTiddler:e("newTiddler"),permaview:e("permaview"),saveChanges:e("saveChanges"),search:e("search"),slider:e("slider"),tabs:e("tabs"),tag:e("tag"),tagging:e("tagging"),tags:e("tags"),tiddler:e("tiddler"),timeline:e("timeline"),today:e("today"),version:e("version"),option:e("option"),"with":e("with"),filter:e("filter")}}(),h=/[\w_\-]/i,k=/^\-\-\-\-+$/,b=/^\/\*\*\*$/,p=/^\*\*\*\/$/,x=/^<<<$/,g=/^\/\/\{\{\{$/,v=/^\/\/\}\}\}$/,y=/^$/,w=/^$/,$=/^\{\{\{$/,z=/^\}\}\}$/,W=/.*?\}\}\}/;return{startState:function(){return{tokenize:r,indented:0,level:0}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t);return r},electricChars:""}}),e.defineMIME("text/x-tiddlywiki","tiddlywiki")}); +\ 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("tiddlywiki",function(){function a(a,b,c){return b.tokenize=c,c(a,b)}function b(b,k){var v,w=b.sol();if(k.block=!1,v=b.peek(),w&&/[<\/\*{}\-]/.test(v)){if(b.match(u))return k.block=!0,a(b,k,e);if(b.match(p))return"quote";if(b.match(n)||b.match(o))return"comment";if(b.match(q)||b.match(r)||b.match(s)||b.match(t))return"comment";if(b.match(m))return"hr"}if(v=b.next(),w&&/[\/\*!#;:>|]/.test(v)){if("!"==v)return b.skipToEnd(),"header";if("*"==v)return b.eatWhile("*"),"comment";if("#"==v)return b.eatWhile("#"),"comment";if(";"==v)return b.eatWhile(";"),"comment";if(":"==v)return b.eatWhile(":"),"comment";if(">"==v)return b.eatWhile(">"),"quote";if("|"==v)return"header"}if("{"==v&&b.match(/\{\{/))return a(b,k,e);if(/[hf]/i.test(v)&&/[ti]/i.test(b.peek())&&b.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return"link";if('"'==v)return"string";if("~"==v)return"brace";if(/[\[\]]/.test(v)&&b.peek()==v)return b.next(),"brace";if("@"==v)return b.eatWhile(l),"link";if(/\d/.test(v))return b.eatWhile(/\d/),"number";if("/"==v){if(b.eat("%"))return a(b,k,c);if(b.eat("/"))return a(b,k,f)}if("_"==v&&b.eat("_"))return a(b,k,g);if("-"==v&&b.eat("-")){if(" "!=b.peek())return a(b,k,h);if(" "==b.peek())return"brace"}if("'"==v&&b.eat("'"))return a(b,k,d);if("<"!=v)return null;if(b.eat("<"))return a(b,k,i);b.eatWhile(/[\w\$_]/);var x=b.current(),y=j.propertyIsEnumerable(x)&&j[x];return y?y.style:null}function c(a,c){for(var d,e=!1;d=a.next();){if("/"==d&&e){c.tokenize=b;break}e="%"==d}return"comment"}function d(a,c){for(var d,e=!1;d=a.next();){if("'"==d&&e){c.tokenize=b;break}e="'"==d}return"strong"}function e(a,c){var d=c.block;return d&&a.current()?"comment":!d&&a.match(w)?(c.tokenize=b,"comment"):d&&a.sol()&&a.match(v)?(c.tokenize=b,"comment"):(a.next(),"comment")}function f(a,c){for(var d,e=!1;d=a.next();){if("/"==d&&e){c.tokenize=b;break}e="/"==d}return"em"}function g(a,c){for(var d,e=!1;d=a.next();){if("_"==d&&e){c.tokenize=b;break}e="_"==d}return"underlined"}function h(a,c){for(var d,e=!1;d=a.next();){if("-"==d&&e){c.tokenize=b;break}e="-"==d}return"strikethrough"}function i(a,c){var d,e,f;return"<<"==a.current()?"macro":(d=a.next())?">"==d&&">"==a.peek()?(a.next(),c.tokenize=b,"macro"):(a.eatWhile(/[\w\$_]/),e=a.current(),f=k.propertyIsEnumerable(e)&&k[e],f?(f.style,e):e):(c.tokenize=b,null)}var j={},k=function(){function a(a){return{type:a,style:"macro"}}return{allTags:a("allTags"),closeAll:a("closeAll"),list:a("list"),newJournal:a("newJournal"),newTiddler:a("newTiddler"),permaview:a("permaview"),saveChanges:a("saveChanges"),search:a("search"),slider:a("slider"),tabs:a("tabs"),tag:a("tag"),tagging:a("tagging"),tags:a("tags"),tiddler:a("tiddler"),timeline:a("timeline"),today:a("today"),version:a("version"),option:a("option"),"with":a("with"),filter:a("filter")}}(),l=/[\w_\-]/i,m=/^\-\-\-\-+$/,n=/^\/\*\*\*$/,o=/^\*\*\*\/$/,p=/^<<<$/,q=/^\/\/\{\{\{$/,r=/^\/\/\}\}\}$/,s=/^$/,t=/^$/,u=/^\{\{\{$/,v=/^\}\}\}$/,w=/.*?\}\}\}/;return{startState:function(){return{tokenize:b,indented:0,level:0}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c},electricChars:""}}),a.defineMIME("text/x-tiddlywiki","tiddlywiki")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/tiki/tiki.js b/media/editors/codemirror/mode/tiki/tiki.js +index c90aac9..5e05b1f 100644 +--- a/media/editors/codemirror/mode/tiki/tiki.js ++++ b/media/editors/codemirror/mode/tiki/tiki.js +@@ -52,35 +52,27 @@ CodeMirror.defineMode('tiki', function(config) { + case "{": //plugin + stream.eat("/"); + stream.eatSpace(); +- var tagName = ""; +- var c; +- while ((c = stream.eat(/[^\s\u00a0=\"\'\/?(}]/))) tagName += c; ++ stream.eatWhile(/[^\s\u00a0=\"\'\/?(}]/); + state.tokenize = inPlugin; + return "tag"; +- break; + case "_": //bold +- if (stream.eat("_")) { ++ if (stream.eat("_")) + return chain(inBlock("strong", "__", inText)); +- } + break; + case "'": //italics +- if (stream.eat("'")) { +- // Italic text ++ if (stream.eat("'")) + return chain(inBlock("em", "''", inText)); +- } + break; + case "(":// Wiki Link +- if (stream.eat("(")) { ++ if (stream.eat("(")) + return chain(inBlock("variable-2", "))", inText)); +- } + break; + case "[":// Weblink + return chain(inBlock("variable-3", "]", inText)); + break; + case "|": //table +- if (stream.eat("|")) { ++ if (stream.eat("|")) + return chain(inBlock("comment", "||")); +- } + break; + case "-": + if (stream.eat("=")) {//titleBar +@@ -90,22 +82,19 @@ CodeMirror.defineMode('tiki', function(config) { + } + break; + case "=": //underline +- if (stream.match("==")) { ++ if (stream.match("==")) + return chain(inBlock("tw-underline", "===", inText)); +- } + break; + case ":": +- if (stream.eat(":")) { ++ if (stream.eat(":")) + return chain(inBlock("comment", "::")); +- } + break; + case "^": //box + return chain(inBlock("tw-box", "^")); + break; + case "~": //np +- if (stream.match("np~")) { ++ if (stream.match("np~")) + return chain(inBlock("meta", "~/np~")); +- } + break; + } + +diff --git a/media/editors/codemirror/mode/tiki/tiki.min.css b/media/editors/codemirror/mode/tiki/tiki.min.css +index c52ac19..fdd7f4a 100644 +--- a/media/editors/codemirror/mode/tiki/tiki.min.css ++++ b/media/editors/codemirror/mode/tiki/tiki.min.css +@@ -1 +1 @@ +-.cm-tw-syntaxerror{color:#FFF;background-color:#900}.cm-tw-deleted{text-decoration:line-through}.cm-tw-header5{font-weight:bold}.cm-tw-listitem:first-child{padding-left:10px}.cm-tw-box{border-top-width:0!important;border-style:solid;border-width:1px;border-color:inherit}.cm-tw-underline{text-decoration:underline} +\ No newline at end of file ++.cm-tw-syntaxerror{color:#FFF;background-color:#900}.cm-tw-deleted{text-decoration:line-through}.cm-tw-header5{font-weight:700}.cm-tw-listitem:first-child{padding-left:10px}.cm-tw-box{border-top-width:0!important;border-style:solid;border-width:1px;border-color:inherit}.cm-tw-underline{text-decoration:underline} +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/tiki/tiki.min.js b/media/editors/codemirror/mode/tiki/tiki.min.js +index 5841226..4bff4d7 100644 +--- a/media/editors/codemirror/mode/tiki/tiki.min.js ++++ b/media/editors/codemirror/mode/tiki/tiki.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tiki",function(e){function t(e,t,n){return function(i,o){for(;!i.eol();){if(i.match(t)){o.tokenize=r;break}i.next()}return n&&(o.tokenize=n),e}}function n(e){return function(t,n){for(;!t.eol();)t.next();return n.tokenize=r,e}}function r(e,o){function a(t){return o.tokenize=t,t(e,o)}var u=e.sol(),c=e.next();switch(c){case"{":e.eat("/"),e.eatSpace();for(var f,s="";f=e.eat(/[^\s\u00a0=\"\'\/?(}]/);)s+=f;return o.tokenize=i,"tag";case"_":if(e.eat("_"))return a(t("strong","__",r));break;case"'":if(e.eat("'"))return a(t("em","''",r));break;case"(":if(e.eat("("))return a(t("variable-2","))",r));break;case"[":return a(t("variable-3","]",r));case"|":if(e.eat("|"))return a(t("comment","||"));break;case"-":if(e.eat("="))return a(t("header string","=-",r));if(e.eat("-"))return a(t("error tw-deleted","--",r));break;case"=":if(e.match("=="))return a(t("tw-underline","===",r));break;case":":if(e.eat(":"))return a(t("comment","::"));break;case"^":return a(t("tw-box","^"));case"~":if(e.match("np~"))return a(t("meta","~/np~"))}if(u)switch(c){case"!":return a(e.match("!!!!!")?n("header string"):e.match("!!!!")?n("header string"):e.match("!!!")?n("header string"):e.match("!!")?n("header string"):n("header string"));case"*":case"#":case"+":return a(n("tw-listitem bracket"))}return null}function i(e,t){var n=e.next(),i=e.peek();return"}"==n?(t.tokenize=r,"tag"):"("==n||")"==n?"bracket":"="==n?(b="equals",">"==i&&(n=e.next(),i=e.peek()),/[\'\"]/.test(i)||(t.tokenize=a()),"operator"):/[\'\"]/.test(n)?(t.tokenize=o(n),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=\"\'\/?]/),"keyword")}function o(e){return function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return"string"}}function a(){return function(e,t){for(;!e.eol();){var n=e.next(),r=e.peek();if(" "==n||","==n||/[ )}]/.test(r)){t.tokenize=i;break}}return"string"}}function u(){for(var e=arguments.length-1;e>=0;e--)h.cc.push(arguments[e])}function c(){return u.apply(null,arguments),!0}function f(e,t){var n=h.context&&h.context.noIndent;h.context={prev:h.context,pluginName:e,indent:h.indented,startOfLine:t,noIndent:n}}function s(){h.context&&(h.context=h.context.prev)}function l(e){if("openPlugin"==e)return h.pluginName=x,c(g,d(h.startOfLine));if("closePlugin"==e){var t=!1;return h.context?(t=h.context.pluginName!=x,s()):t=!0,t&&(v="error"),c(k(t))}return"string"==e?(h.context&&"!cdata"==h.context.name||f("!cdata"),h.tokenize==r&&s(),c()):c()}function d(e){return function(t){return"selfclosePlugin"==t||"endPlugin"==t?c():"endPlugin"==t?(f(h.pluginName,e),c()):c()}}function k(e){return function(t){return e&&(v="error"),"endPlugin"==t?c():u()}}function g(e){return"keyword"==e?(v="attribute",c(g)):"equals"==e?c(m,g):u()}function m(e){return"keyword"==e?(v="string",c()):"string"==e?c(p):u()}function p(e){return"string"==e?c(p):u()}var x,b,h,v,z=e.indentUnit;return{startState:function(){return{tokenize:r,cc:[],indented:0,startOfLine:!0,pluginName:null,context:null}},token:function(e,t){if(e.sol()&&(t.startOfLine=!0,t.indented=e.indentation()),e.eatSpace())return null;v=b=x=null;var n=t.tokenize(e,t);if((n||b)&&"comment"!=n)for(h=t;;){var r=t.cc.pop()||l;if(r(b||n))break}return t.startOfLine=!1,v||n},indent:function(e,t){var n=e.context;if(n&&n.noIndent)return 0;for(n&&/^{\//.test(t)&&(n=n.prev);n&&!n.startOfLine;)n=n.prev;return n?n.indent+z:0},electricChars:"/"}}),e.defineMIME("text/tiki","tiki")}); +\ 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("tiki",function(a){function b(a,b,c){return function(e,f){for(;!e.eol();){if(e.match(b)){f.tokenize=d;break}e.next()}return c&&(f.tokenize=c),a}}function c(a){return function(b,c){for(;!b.eol();)b.next();return c.tokenize=d,a}}function d(a,f){function g(b){return f.tokenize=b,b(a,f)}var h=a.sol(),i=a.next();switch(i){case"{":return a.eat("/"),a.eatSpace(),a.eatWhile(/[^\s\u00a0=\"\'\/?(}]/),f.tokenize=e,"tag";case"_":if(a.eat("_"))return g(b("strong","__",d));break;case"'":if(a.eat("'"))return g(b("em","''",d));break;case"(":if(a.eat("("))return g(b("variable-2","))",d));break;case"[":return g(b("variable-3","]",d));case"|":if(a.eat("|"))return g(b("comment","||"));break;case"-":if(a.eat("="))return g(b("header string","=-",d));if(a.eat("-"))return g(b("error tw-deleted","--",d));break;case"=":if(a.match("=="))return g(b("tw-underline","===",d));break;case":":if(a.eat(":"))return g(b("comment","::"));break;case"^":return g(b("tw-box","^"));case"~":if(a.match("np~"))return g(b("meta","~/np~"))}if(h)switch(i){case"!":return g(a.match("!!!!!")?c("header string"):a.match("!!!!")?c("header string"):a.match("!!!")?c("header string"):a.match("!!")?c("header string"):c("header string"));case"*":case"#":case"+":return g(c("tw-listitem bracket"))}return null}function e(a,b){var c=a.next(),e=a.peek();return"}"==c?(b.tokenize=d,"tag"):"("==c||")"==c?"bracket":"="==c?(s="equals",">"==e&&(c=a.next(),e=a.peek()),/[\'\"]/.test(e)||(b.tokenize=g()),"operator"):/[\'\"]/.test(c)?(b.tokenize=f(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=\"\'\/?]/),"keyword")}function f(a){return function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=e;break}return"string"}}function g(){return function(a,b){for(;!a.eol();){var c=a.next(),d=a.peek();if(" "==c||","==c||/[ )}]/.test(d)){b.tokenize=e;break}}return"string"}}function h(){for(var a=arguments.length-1;a>=0;a--)t.cc.push(arguments[a])}function i(){return h.apply(null,arguments),!0}function j(a,b){var c=t.context&&t.context.noIndent;t.context={prev:t.context,pluginName:a,indent:t.indented,startOfLine:b,noIndent:c}}function k(){t.context&&(t.context=t.context.prev)}function l(a){if("openPlugin"==a)return t.pluginName=r,i(o,m(t.startOfLine));if("closePlugin"==a){var b=!1;return t.context?(b=t.context.pluginName!=r,k()):b=!0,b&&(u="error"),i(n(b))}return"string"==a?(t.context&&"!cdata"==t.context.name||j("!cdata"),t.tokenize==d&&k(),i()):i()}function m(a){return function(b){return"selfclosePlugin"==b||"endPlugin"==b?i():"endPlugin"==b?(j(t.pluginName,a),i()):i()}}function n(a){return function(b){return a&&(u="error"),"endPlugin"==b?i():h()}}function o(a){return"keyword"==a?(u="attribute",i(o)):"equals"==a?i(p,o):h()}function p(a){return"keyword"==a?(u="string",i()):"string"==a?i(q):h()}function q(a){return"string"==a?i(q):h()}var r,s,t,u,v=a.indentUnit;return{startState:function(){return{tokenize:d,cc:[],indented:0,startOfLine:!0,pluginName:null,context:null}},token:function(a,b){if(a.sol()&&(b.startOfLine=!0,b.indented=a.indentation()),a.eatSpace())return null;u=s=r=null;var c=b.tokenize(a,b);if((c||s)&&"comment"!=c)for(t=b;;){var d=b.cc.pop()||l;if(d(s||c))break}return b.startOfLine=!1,u||c},indent:function(a,b){var c=a.context;if(c&&c.noIndent)return 0;for(c&&/^{\//.test(b)&&(c=c.prev);c&&!c.startOfLine;)c=c.prev;return c?c.indent+v:0},electricChars:"/"}}),a.defineMIME("text/tiki","tiki")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/toml/toml.min.js b/media/editors/codemirror/mode/toml/toml.min.js +index 1b8beba..e6e3e2b 100644 +--- a/media/editors/codemirror/mode/toml/toml.min.js ++++ b/media/editors/codemirror/mode/toml/toml.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("toml",function(){return{startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(e,t){if(t.inString||'"'!=e.peek()&&"'"!=e.peek()||(t.stringType=e.peek(),e.next(),t.inString=!0),e.sol()&&0===t.inArray&&(t.lhs=!0),t.inString){for(;t.inString&&!e.eol();)e.peek()===t.stringType?(e.next(),t.inString=!1):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string"}return t.inArray&&"]"===e.peek()?(e.next(),t.inArray--,"bracket"):t.lhs&&"["===e.peek()&&e.skipTo("]")?(e.next(),"]"===e.peek()&&e.next(),"atom"):"#"===e.peek()?(e.skipToEnd(),"comment"):e.eatSpace()?null:t.lhs&&e.eatWhile(function(e){return"="!=e&&" "!=e})?"property":t.lhs&&"="===e.peek()?(e.next(),t.lhs=!1,null):!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/)?"atom":t.lhs||!e.match("true")&&!e.match("false")?t.lhs||"["!==e.peek()?!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/)?"number":(e.eatSpace()||e.next(),null):(t.inArray++,e.next(),"bracket"):"atom"}}}),e.defineMIME("text/x-toml","toml")}); +\ 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("toml",function(){return{startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(a,b){if(b.inString||'"'!=a.peek()&&"'"!=a.peek()||(b.stringType=a.peek(),a.next(),b.inString=!0),a.sol()&&0===b.inArray&&(b.lhs=!0),b.inString){for(;b.inString&&!a.eol();)a.peek()===b.stringType?(a.next(),b.inString=!1):"\\"===a.peek()?(a.next(),a.next()):a.match(/^.[^\\\"\']*/);return b.lhs?"property string":"string"}return b.inArray&&"]"===a.peek()?(a.next(),b.inArray--,"bracket"):b.lhs&&"["===a.peek()&&a.skipTo("]")?(a.next(),"]"===a.peek()&&a.next(),"atom"):"#"===a.peek()?(a.skipToEnd(),"comment"):a.eatSpace()?null:b.lhs&&a.eatWhile(function(a){return"="!=a&&" "!=a})?"property":b.lhs&&"="===a.peek()?(a.next(),b.lhs=!1,null):!b.lhs&&a.match(/^\d\d\d\d[\d\-\:\.T]*Z/)?"atom":b.lhs||!a.match("true")&&!a.match("false")?b.lhs||"["!==a.peek()?!b.lhs&&a.match(/^\-?\d+(?:\.\d+)?/)?"number":(a.eatSpace()||a.next(),null):(b.inArray++,a.next(),"bracket"):"atom"}}}),a.defineMIME("text/x-toml","toml")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/tornado/tornado.min.js b/media/editors/codemirror/mode/tornado/tornado.min.js +index e0d6090..7677ff9 100644 +--- a/media/editors/codemirror/mode/tornado/tornado.min.js ++++ b/media/editors/codemirror/mode/tornado/tornado.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tornado:inner",function(){function e(e,n){e.eatWhile(/[^\{]/);var o=e.next();return"{"==o&&(o=e.eat(/\{|%|#/))?(n.tokenize=t(o),"tag"):void 0}function t(t){return"{"==t&&(t="}"),function(o,r){var i=o.next();return i==t&&o.eat("}")?(r.tokenize=e,"tag"):o.match(n)?"keyword":"#"==t?"comment":"string"}}var n=["and","as","assert","autoescape","block","break","class","comment","context","continue","datetime","def","del","elif","else","end","escape","except","exec","extends","false","finally","for","from","global","if","import","in","include","is","json_encode","lambda","length","linkify","load","module","none","not","or","pass","print","put","raise","raw","return","self","set","squeeze","super","true","try","url_escape","while","with","without","xhtml_escape","yield"];return n=new RegExp("^(("+n.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,t){return t.tokenize(e,t)}}}),e.defineMode("tornado",function(t){var n=e.getMode(t,"text/html"),o=e.getMode(t,"tornado:inner");return e.overlayMode(n,o)}),e.defineMIME("text/x-tornado","tornado")}); +\ No newline at end of file ++!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("tornado:inner",function(){function a(a,c){a.eatWhile(/[^\{]/);var d=a.next();return"{"==d&&(d=a.eat(/\{|%|#/))?(c.tokenize=b(d),"tag"):void 0}function b(b){return"{"==b&&(b="}"),function(d,e){var f=d.next();return f==b&&d.eat("}")?(e.tokenize=a,"tag"):d.match(c)?"keyword":"#"==b?"comment":"string"}}var c=["and","as","assert","autoescape","block","break","class","comment","context","continue","datetime","def","del","elif","else","end","escape","except","exec","extends","false","finally","for","from","global","if","import","in","include","is","json_encode","lambda","length","linkify","load","module","none","not","or","pass","print","put","raise","raw","return","self","set","squeeze","super","true","try","url_escape","while","with","without","xhtml_escape","yield"];return c=new RegExp("^(("+c.join(")|(")+"))\\b"),{startState:function(){return{tokenize:a}},token:function(a,b){return b.tokenize(a,b)}}}),a.defineMode("tornado",function(b){var c=a.getMode(b,"text/html"),d=a.getMode(b,"tornado:inner");return a.overlayMode(c,d)}),a.defineMIME("text/x-tornado","tornado")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/troff/troff.js b/media/editors/codemirror/mode/troff/troff.js +new file mode 100644 +index 0000000..beca778 +--- /dev/null ++++ b/media/editors/codemirror/mode/troff/troff.js +@@ -0,0 +1,82 @@ ++// CodeMirror, copyright (c) by Marijn Haverbeke and others ++// Distributed under an MIT license: http://codemirror.net/LICENSE ++ ++(function(mod) { ++ if (typeof exports == "object" && typeof module == "object") ++ mod(require("../../lib/codemirror")); ++ else if (typeof define == "function" && define.amd) ++ define(["../../lib/codemirror"], mod); ++ else ++ mod(CodeMirror); ++})(function(CodeMirror) { ++"use strict"; ++ ++CodeMirror.defineMode('troff', function() { ++ ++ var words = {}; ++ ++ function tokenBase(stream) { ++ if (stream.eatSpace()) return null; ++ ++ var sol = stream.sol(); ++ var ch = stream.next(); ++ ++ if (ch === '\\') { ++ if (stream.match('fB') || stream.match('fR') || stream.match('fI') || ++ stream.match('u') || stream.match('d') || ++ stream.match('%') || stream.match('&')) { ++ return 'string'; ++ } ++ if (stream.match('m[')) { ++ stream.skipTo(']'); ++ stream.next(); ++ return 'string'; ++ } ++ if (stream.match('s+') || stream.match('s-')) { ++ stream.eatWhile(/[\d-]/); ++ return 'string'; ++ } ++ if (stream.match('\(') || stream.match('*\(')) { ++ stream.eatWhile(/[\w-]/); ++ return 'string'; ++ } ++ return 'string'; ++ } ++ if (sol && (ch === '.' || ch === '\'')) { ++ if (stream.eat('\\') && stream.eat('\"')) { ++ stream.skipToEnd(); ++ return 'comment'; ++ } ++ } ++ if (sol && ch === '.') { ++ if (stream.match('B ') || stream.match('I ') || stream.match('R ')) { ++ return 'attribute'; ++ } ++ if (stream.match('TH ') || stream.match('SH ') || stream.match('SS ') || stream.match('HP ')) { ++ stream.skipToEnd(); ++ return 'quote'; ++ } ++ if ((stream.match(/[A-Z]/) && stream.match(/[A-Z]/)) || (stream.match(/[a-z]/) && stream.match(/[a-z]/))) { ++ return 'attribute'; ++ } ++ } ++ stream.eatWhile(/[\w-]/); ++ var cur = stream.current(); ++ return words.hasOwnProperty(cur) ? words[cur] : null; ++ } ++ ++ function tokenize(stream, state) { ++ return (state.tokens[0] || tokenBase) (stream, state); ++ }; ++ ++ return { ++ startState: function() {return {tokens:[]};}, ++ token: function(stream, state) { ++ return tokenize(stream, state); ++ } ++ }; ++}); ++ ++CodeMirror.defineMIME('troff', 'troff'); ++ ++}); +diff --git a/media/editors/codemirror/mode/troff/troff.min.js b/media/editors/codemirror/mode/troff/troff.min.js +new file mode 100644 +index 0000000..3fd4353 +--- /dev/null ++++ b/media/editors/codemirror/mode/troff/troff.min.js +@@ -0,0 +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("troff",function(){function a(a){if(a.eatSpace())return null;var b=a.sol(),d=a.next();if("\\"===d)return a.match("fB")||a.match("fR")||a.match("fI")||a.match("u")||a.match("d")||a.match("%")||a.match("&")?"string":a.match("m[")?(a.skipTo("]"),a.next(),"string"):a.match("s+")||a.match("s-")?(a.eatWhile(/[\d-]/),"string"):a.match("(")||a.match("*(")?(a.eatWhile(/[\w-]/),"string"):"string";if(b&&("."===d||"'"===d)&&a.eat("\\")&&a.eat('"'))return a.skipToEnd(),"comment";if(b&&"."===d){if(a.match("B ")||a.match("I ")||a.match("R "))return"attribute";if(a.match("TH ")||a.match("SH ")||a.match("SS ")||a.match("HP "))return a.skipToEnd(),"quote";if(a.match(/[A-Z]/)&&a.match(/[A-Z]/)||a.match(/[a-z]/)&&a.match(/[a-z]/))return"attribute"}a.eatWhile(/[\w-]/);var e=a.current();return c.hasOwnProperty(e)?c[e]:null}function b(b,c){return(c.tokens[0]||a)(b,c)}var c={};return{startState:function(){return{tokens:[]}},token:function(a,c){return b(a,c)}}}),a.defineMIME("troff","troff")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.js b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.js +new file mode 100644 +index 0000000..e108051 +--- /dev/null ++++ b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.js +@@ -0,0 +1,214 @@ ++// CodeMirror, copyright (c) by Marijn Haverbeke and others ++// Distributed under an MIT license: http://codemirror.net/LICENSE ++ ++(function(mod) { ++ if (typeof exports == "object" && typeof module == "object") // CommonJS ++ mod(require("../../lib/codemirror")); ++ else if (typeof define == "function" && define.amd) // AMD ++ define(["../../lib/codemirror"], mod); ++ else // Plain browser env ++ mod(CodeMirror); ++})(function(CodeMirror) { ++ "use strict"; ++ ++ CodeMirror.defineMode("ttcn-cfg", function(config, parserConfig) { ++ var indentUnit = config.indentUnit, ++ keywords = parserConfig.keywords || {}, ++ fileNCtrlMaskOptions = parserConfig.fileNCtrlMaskOptions || {}, ++ externalCommands = parserConfig.externalCommands || {}, ++ multiLineStrings = parserConfig.multiLineStrings, ++ indentStatements = parserConfig.indentStatements !== false; ++ var isOperatorChar = /[\|]/; ++ var curPunc; ++ ++ function tokenBase(stream, state) { ++ var ch = stream.next(); ++ if (ch == '"' || ch == "'") { ++ state.tokenize = tokenString(ch); ++ return state.tokenize(stream, state); ++ } ++ if (/[:=]/.test(ch)) { ++ curPunc = ch; ++ return "punctuation"; ++ } ++ if (ch == "#"){ ++ stream.skipToEnd(); ++ return "comment"; ++ } ++ if (/\d/.test(ch)) { ++ stream.eatWhile(/[\w\.]/); ++ return "number"; ++ } ++ if (isOperatorChar.test(ch)) { ++ stream.eatWhile(isOperatorChar); ++ return "operator"; ++ } ++ if (ch == "["){ ++ stream.eatWhile(/[\w_\]]/); ++ return "number sectionTitle"; ++ } ++ ++ stream.eatWhile(/[\w\$_]/); ++ var cur = stream.current(); ++ if (keywords.propertyIsEnumerable(cur)) return "keyword"; ++ if (fileNCtrlMaskOptions.propertyIsEnumerable(cur)) ++ return "negative fileNCtrlMaskOptions"; ++ if (externalCommands.propertyIsEnumerable(cur)) return "negative externalCommands"; ++ ++ return "variable"; ++ } ++ ++ function tokenString(quote) { ++ return function(stream, state) { ++ var escaped = false, next, end = false; ++ while ((next = stream.next()) != null) { ++ if (next == quote && !escaped){ ++ var afterNext = stream.peek(); ++ //look if the character if the quote is like the B in '10100010'B ++ if (afterNext){ ++ afterNext = afterNext.toLowerCase(); ++ if(afterNext == "b" || afterNext == "h" || afterNext == "o") ++ stream.next(); ++ } ++ end = true; break; ++ } ++ escaped = !escaped && next == "\\"; ++ } ++ if (end || !(escaped || multiLineStrings)) ++ state.tokenize = null; ++ return "string"; ++ }; ++ } ++ ++ function Context(indented, column, type, align, prev) { ++ this.indented = indented; ++ this.column = column; ++ this.type = type; ++ this.align = align; ++ this.prev = prev; ++ } ++ function pushContext(state, col, type) { ++ var indent = state.indented; ++ if (state.context && state.context.type == "statement") ++ indent = state.context.indented; ++ return state.context = new Context(indent, col, type, null, state.context); ++ } ++ function popContext(state) { ++ var t = state.context.type; ++ if (t == ")" || t == "]" || t == "}") ++ state.indented = state.context.indented; ++ return state.context = state.context.prev; ++ } ++ ++ //Interface ++ return { ++ startState: function(basecolumn) { ++ return { ++ tokenize: null, ++ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), ++ indented: 0, ++ startOfLine: true ++ }; ++ }, ++ ++ token: function(stream, state) { ++ var ctx = state.context; ++ if (stream.sol()) { ++ if (ctx.align == null) ctx.align = false; ++ state.indented = stream.indentation(); ++ state.startOfLine = true; ++ } ++ if (stream.eatSpace()) return null; ++ curPunc = null; ++ var style = (state.tokenize || tokenBase)(stream, state); ++ if (style == "comment") return style; ++ if (ctx.align == null) ctx.align = true; ++ ++ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") ++ && ctx.type == "statement"){ ++ popContext(state); ++ } ++ else if (curPunc == "{") pushContext(state, stream.column(), "}"); ++ else if (curPunc == "[") pushContext(state, stream.column(), "]"); ++ else if (curPunc == "(") pushContext(state, stream.column(), ")"); ++ else if (curPunc == "}") { ++ while (ctx.type == "statement") ctx = popContext(state); ++ if (ctx.type == "}") ctx = popContext(state); ++ while (ctx.type == "statement") ctx = popContext(state); ++ } ++ else if (curPunc == ctx.type) popContext(state); ++ else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") ++ && curPunc != ';') || (ctx.type == "statement" ++ && curPunc == "newstatement"))) ++ pushContext(state, stream.column(), "statement"); ++ state.startOfLine = false; ++ return style; ++ }, ++ ++ electricChars: "{}", ++ lineComment: "#", ++ fold: "brace" ++ }; ++ }); ++ ++ function words(str) { ++ var obj = {}, words = str.split(" "); ++ for (var i = 0; i < words.length; ++i) ++ obj[words[i]] = true; ++ return obj; ++ } ++ ++ CodeMirror.defineMIME("text/x-ttcn-cfg", { ++ name: "ttcn-cfg", ++ keywords: words("Yes No LogFile FileMask ConsoleMask AppendFile" + ++ " TimeStampFormat LogEventTypes SourceInfoFormat" + ++ " LogEntityName LogSourceInfo DiskFullAction" + ++ " LogFileNumber LogFileSize MatchingHints Detailed" + ++ " Compact SubCategories Stack Single None Seconds" + ++ " DateTime Time Stop Error Retry Delete TCPPort KillTimer" + ++ " NumHCs UnixSocketsEnabled LocalAddress"), ++ fileNCtrlMaskOptions: words("TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING" + ++ " TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP" + ++ " TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION" + ++ " TTCN_USER TTCN_FUNCTION TTCN_STATISTICS" + ++ " TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG" + ++ " EXECUTOR ERROR WARNING PORTEVENT TIMEROP" + ++ " VERDICTOP DEFAULTOP TESTCASE ACTION USER" + ++ " FUNCTION STATISTICS PARALLEL MATCHING DEBUG" + ++ " LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED" + ++ " DEBUG_ENCDEC DEBUG_TESTPORT" + ++ " DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE" + ++ " DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT" + ++ " DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED" + ++ " EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA" + ++ " EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS" + ++ " EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED" + ++ " FUNCTION_RND FUNCTION_UNQUALIFIED" + ++ " MATCHING_DONE MATCHING_MCSUCCESS" + ++ " MATCHING_MCUNSUCC MATCHING_MMSUCCESS" + ++ " MATCHING_MMUNSUCC MATCHING_PCSUCCESS" + ++ " MATCHING_PCUNSUCC MATCHING_PMSUCCESS" + ++ " MATCHING_PMUNSUCC MATCHING_PROBLEM" + ++ " MATCHING_TIMEOUT MATCHING_UNQUALIFIED" + ++ " PARALLEL_PORTCONN PARALLEL_PORTMAP" + ++ " PARALLEL_PTC PARALLEL_UNQUALIFIED" + ++ " PORTEVENT_DUALRECV PORTEVENT_DUALSEND" + ++ " PORTEVENT_MCRECV PORTEVENT_MCSEND" + ++ " PORTEVENT_MMRECV PORTEVENT_MMSEND" + ++ " PORTEVENT_MQUEUE PORTEVENT_PCIN" + ++ " PORTEVENT_PCOUT PORTEVENT_PMIN" + ++ " PORTEVENT_PMOUT PORTEVENT_PQUEUE" + ++ " PORTEVENT_STATE PORTEVENT_UNQUALIFIED" + ++ " STATISTICS_UNQUALIFIED STATISTICS_VERDICT" + ++ " TESTCASE_FINISH TESTCASE_START" + ++ " TESTCASE_UNQUALIFIED TIMEROP_GUARD" + ++ " TIMEROP_READ TIMEROP_START TIMEROP_STOP" + ++ " TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED" + ++ " USER_UNQUALIFIED VERDICTOP_FINAL" + ++ " VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT" + ++ " VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED"), ++ externalCommands: words("BeginControlPart EndControlPart BeginTestCase" + ++ " EndTestCase"), ++ multiLineStrings: true ++ }); ++}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js +new file mode 100644 +index 0000000..9903f74 +--- /dev/null ++++ b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js +@@ -0,0 +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){for(var b={},c=a.split(" "),d=0;d!\/]/; ++ var curPunc; ++ ++ function tokenBase(stream, state) { ++ var ch = stream.next(); ++ ++ if (ch == '"' || ch == "'") { ++ state.tokenize = tokenString(ch); ++ return state.tokenize(stream, state); ++ } ++ if (/[\[\]{}\(\),;\\:\?\.]/.test(ch)) { ++ curPunc = ch; ++ return "punctuation"; ++ } ++ if (ch == "#"){ ++ stream.skipToEnd(); ++ return "atom preprocessor"; ++ } ++ if (ch == "%"){ ++ stream.eatWhile(/\b/); ++ return "atom ttcn3Macros"; ++ } ++ if (/\d/.test(ch)) { ++ stream.eatWhile(/[\w\.]/); ++ return "number"; ++ } ++ if (ch == "/") { ++ if (stream.eat("*")) { ++ state.tokenize = tokenComment; ++ return tokenComment(stream, state); ++ } ++ if (stream.eat("/")) { ++ stream.skipToEnd(); ++ return "comment"; ++ } ++ } ++ if (isOperatorChar.test(ch)) { ++ if(ch == "@"){ ++ if(stream.match("try") || stream.match("catch") ++ || stream.match("lazy")){ ++ return "keyword"; ++ } ++ } ++ stream.eatWhile(isOperatorChar); ++ return "operator"; ++ } ++ stream.eatWhile(/[\w\$_\xa1-\uffff]/); ++ var cur = stream.current(); ++ ++ if (keywords.propertyIsEnumerable(cur)) return "keyword"; ++ if (builtin.propertyIsEnumerable(cur)) return "builtin"; ++ ++ if (timerOps.propertyIsEnumerable(cur)) return "def timerOps"; ++ if (configOps.propertyIsEnumerable(cur)) return "def configOps"; ++ if (verdictOps.propertyIsEnumerable(cur)) return "def verdictOps"; ++ if (portOps.propertyIsEnumerable(cur)) return "def portOps"; ++ if (sutOps.propertyIsEnumerable(cur)) return "def sutOps"; ++ if (functionOps.propertyIsEnumerable(cur)) return "def functionOps"; ++ ++ if (verdictConsts.propertyIsEnumerable(cur)) return "string verdictConsts"; ++ if (booleanConsts.propertyIsEnumerable(cur)) return "string booleanConsts"; ++ if (otherConsts.propertyIsEnumerable(cur)) return "string otherConsts"; ++ ++ if (types.propertyIsEnumerable(cur)) return "builtin types"; ++ if (visibilityModifiers.propertyIsEnumerable(cur)) ++ return "builtin visibilityModifiers"; ++ if (templateMatch.propertyIsEnumerable(cur)) return "atom templateMatch"; ++ ++ return "variable"; ++ } ++ ++ function tokenString(quote) { ++ return function(stream, state) { ++ var escaped = false, next, end = false; ++ while ((next = stream.next()) != null) { ++ if (next == quote && !escaped){ ++ var afterQuote = stream.peek(); ++ //look if the character after the quote is like the B in '10100010'B ++ if (afterQuote){ ++ afterQuote = afterQuote.toLowerCase(); ++ if(afterQuote == "b" || afterQuote == "h" || afterQuote == "o") ++ stream.next(); ++ } ++ end = true; break; ++ } ++ escaped = !escaped && next == "\\"; ++ } ++ if (end || !(escaped || multiLineStrings)) ++ state.tokenize = null; ++ return "string"; ++ }; ++ } ++ ++ function tokenComment(stream, state) { ++ var maybeEnd = false, ch; ++ while (ch = stream.next()) { ++ if (ch == "/" && maybeEnd) { ++ state.tokenize = null; ++ break; ++ } ++ maybeEnd = (ch == "*"); ++ } ++ return "comment"; ++ } ++ ++ function Context(indented, column, type, align, prev) { ++ this.indented = indented; ++ this.column = column; ++ this.type = type; ++ this.align = align; ++ this.prev = prev; ++ } ++ ++ function pushContext(state, col, type) { ++ var indent = state.indented; ++ if (state.context && state.context.type == "statement") ++ indent = state.context.indented; ++ return state.context = new Context(indent, col, type, null, state.context); ++ } ++ ++ function popContext(state) { ++ var t = state.context.type; ++ if (t == ")" || t == "]" || t == "}") ++ state.indented = state.context.indented; ++ return state.context = state.context.prev; ++ } ++ ++ //Interface ++ return { ++ startState: function(basecolumn) { ++ return { ++ tokenize: null, ++ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), ++ indented: 0, ++ startOfLine: true ++ }; ++ }, ++ ++ token: function(stream, state) { ++ var ctx = state.context; ++ if (stream.sol()) { ++ if (ctx.align == null) ctx.align = false; ++ state.indented = stream.indentation(); ++ state.startOfLine = true; ++ } ++ if (stream.eatSpace()) return null; ++ curPunc = null; ++ var style = (state.tokenize || tokenBase)(stream, state); ++ if (style == "comment") return style; ++ if (ctx.align == null) ctx.align = true; ++ ++ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") ++ && ctx.type == "statement"){ ++ popContext(state); ++ } ++ else if (curPunc == "{") pushContext(state, stream.column(), "}"); ++ else if (curPunc == "[") pushContext(state, stream.column(), "]"); ++ else if (curPunc == "(") pushContext(state, stream.column(), ")"); ++ else if (curPunc == "}") { ++ while (ctx.type == "statement") ctx = popContext(state); ++ if (ctx.type == "}") ctx = popContext(state); ++ while (ctx.type == "statement") ctx = popContext(state); ++ } ++ else if (curPunc == ctx.type) popContext(state); ++ else if (indentStatements && ++ (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || ++ (ctx.type == "statement" && curPunc == "newstatement"))) ++ pushContext(state, stream.column(), "statement"); ++ ++ state.startOfLine = false; ++ ++ return style; ++ }, ++ ++ electricChars: "{}", ++ blockCommentStart: "/*", ++ blockCommentEnd: "*/", ++ lineComment: "//", ++ fold: "brace" ++ }; ++ }); ++ ++ function words(str) { ++ var obj = {}, words = str.split(" "); ++ for (var i = 0; i < words.length; ++i) obj[words[i]] = true; ++ return obj; ++ } ++ ++ function def(mimes, mode) { ++ if (typeof mimes == "string") mimes = [mimes]; ++ var words = []; ++ function add(obj) { ++ if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) ++ words.push(prop); ++ } ++ ++ add(mode.keywords); ++ add(mode.builtin); ++ add(mode.timerOps); ++ add(mode.portOps); ++ ++ if (words.length) { ++ mode.helperType = mimes[0]; ++ CodeMirror.registerHelper("hintWords", mimes[0], words); ++ } ++ ++ for (var i = 0; i < mimes.length; ++i) ++ CodeMirror.defineMIME(mimes[i], mode); ++ } ++ ++ def(["text/x-ttcn", "text/x-ttcn3", "text/x-ttcnpp"], { ++ name: "ttcn", ++ keywords: words("activate address alive all alt altstep and and4b any" + ++ " break case component const continue control deactivate" + ++ " display do else encode enumerated except exception" + ++ " execute extends extension external for from function" + ++ " goto group if import in infinity inout interleave" + ++ " label language length log match message mixed mod" + ++ " modifies module modulepar mtc noblock not not4b nowait" + ++ " of on optional or or4b out override param pattern port" + ++ " procedure record recursive rem repeat return runs select" + ++ " self sender set signature system template testcase to" + ++ " type union value valueof var variant while with xor xor4b"), ++ builtin: words("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue" + ++ " decomp decvalue float2int float2str hex2bit hex2int" + ++ " hex2oct hex2str int2bit int2char int2float int2hex" + ++ " int2oct int2str int2unichar isbound ischosen ispresent" + ++ " isvalue lengthof log2str oct2bit oct2char oct2hex oct2int" + ++ " oct2str regexp replace rnd sizeof str2bit str2float" + ++ " str2hex str2int str2oct substr unichar2int unichar2char" + ++ " enum2int"), ++ types: words("anytype bitstring boolean char charstring default float" + ++ " hexstring integer objid octetstring universal verdicttype timer"), ++ timerOps: words("read running start stop timeout"), ++ portOps: words("call catch check clear getcall getreply halt raise receive" + ++ " reply send trigger"), ++ configOps: words("create connect disconnect done kill killed map unmap"), ++ verdictOps: words("getverdict setverdict"), ++ sutOps: words("action"), ++ functionOps: words("apply derefers refers"), ++ ++ verdictConsts: words("error fail inconc none pass"), ++ booleanConsts: words("true false"), ++ otherConsts: words("null NULL omit"), ++ ++ visibilityModifiers: words("private public friend"), ++ templateMatch: words("complement ifpresent subset superset permutation"), ++ multiLineStrings: true ++ }); ++}); +diff --git a/media/editors/codemirror/mode/ttcn/ttcn.min.js b/media/editors/codemirror/mode/ttcn/ttcn.min.js +new file mode 100644 +index 0000000..afa666d +--- /dev/null ++++ b/media/editors/codemirror/mode/ttcn/ttcn.min.js +@@ -0,0 +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){for(var b={},c=a.split(" "),d=0;d!\/]/;return{startState:function(a){return{tokenize:null,context:new f((a||0)-j,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var d=b.context;if(a.sol()&&(null==d.align&&(d.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;i=null;var e=(b.tokenize||c)(a,b);if("comment"==e)return e;if(null==d.align&&(d.align=!0),";"!=i&&":"!=i&&","!=i||"statement"!=d.type)if("{"==i)g(b,a.column(),"}");else if("["==i)g(b,a.column(),"]");else if("("==i)g(b,a.column(),")");else if("}"==i){for(;"statement"==d.type;)d=h(b);for("}"==d.type&&(d=h(b));"statement"==d.type;)d=h(b)}else i==d.type?h(b):z&&(("}"==d.type||"top"==d.type)&&";"!=i||"statement"==d.type&&"newstatement"==i)&&g(b,a.column(),"statement");else h(b);return b.startOfLine=!1,e},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),c(["text/x-ttcn","text/x-ttcn3","text/x-ttcnpp"],{name:"ttcn",keywords:b("activate address alive all alt altstep and and4b any break case component const continue control deactivate display do else encode enumerated except exception execute extends extension external for from function goto group if import in infinity inout interleave label language length log match message mixed mod modifies module modulepar mtc noblock not not4b nowait of on optional or or4b out override param pattern port procedure record recursive rem repeat return runs select self sender set signature system template testcase to type union value valueof var variant while with xor xor4b"),builtin:b("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue decomp decvalue float2int float2str hex2bit hex2int hex2oct hex2str int2bit int2char int2float int2hex int2oct int2str int2unichar isbound ischosen ispresent isvalue lengthof log2str oct2bit oct2char oct2hex oct2int oct2str regexp replace rnd sizeof str2bit str2float str2hex str2int str2oct substr unichar2int unichar2char enum2int"),types:b("anytype bitstring boolean char charstring default float hexstring integer objid octetstring universal verdicttype timer"),timerOps:b("read running start stop timeout"),portOps:b("call catch check clear getcall getreply halt raise receive reply send trigger"),configOps:b("create connect disconnect done kill killed map unmap"),verdictOps:b("getverdict setverdict"),sutOps:b("action"),functionOps:b("apply derefers refers"),verdictConsts:b("error fail inconc none pass"),booleanConsts:b("true false"),otherConsts:b("null NULL omit"),visibilityModifiers:b("private public friend"),templateMatch:b("complement ifpresent subset superset permutation"),multiLineStrings:!0})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/turtle/turtle.min.js b/media/editors/codemirror/mode/turtle/turtle.min.js +index 7d202be..e3df23e 100644 +--- a/media/editors/codemirror/mode/turtle/turtle.min.js ++++ b/media/editors/codemirror/mode/turtle/turtle.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("turtle",function(t){function e(t){return new RegExp("^(?:"+t.join("|")+")$","i")}function n(t,e){var n=t.next();if(c=null,"<"==n&&!t.match(/^[\s\u00a0=]/,!1))return t.match(/^[^\s\u00a0>]*>?/),"atom";if('"'==n||"'"==n)return e.tokenize=o(n),e.tokenize(t,e);if(/[{}\(\),\.;\[\]]/.test(n))return c=n,null;if("#"==n)return t.skipToEnd(),"comment";if(a.test(n))return t.eatWhile(a),null;if(":"==n)return"operator";if(t.eatWhile(/[_\w\d]/),":"==t.peek())return"variable-3";var r=t.current();return l.test(r)?"meta":n>="A"&&"Z">=n?"comment":"keyword";var r}function o(t){return function(e,o){for(var r,i=!1;null!=(r=e.next());){if(r==t&&!i){o.tokenize=n;break}i=!i&&"\\"==r}return"string"}}function r(t,e,n){t.context={prev:t.context,indent:t.indent,col:n,type:e}}function i(t){t.indent=t.context.indent,t.context=t.context.prev}var c,u=t.indentUnit,l=(e([]),e(["@prefix","@base","a"])),a=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(t,e){if(t.sol()&&(e.context&&null==e.context.align&&(e.context.align=!1),e.indent=t.indentation()),t.eatSpace())return null;var n=e.tokenize(t,e);if("comment"!=n&&e.context&&null==e.context.align&&"pattern"!=e.context.type&&(e.context.align=!0),"("==c)r(e,")",t.column());else if("["==c)r(e,"]",t.column());else if("{"==c)r(e,"}",t.column());else if(/[\]\}\)]/.test(c)){for(;e.context&&"pattern"==e.context.type;)i(e);e.context&&c==e.context.type&&i(e)}else"."==c&&e.context&&"pattern"==e.context.type?i(e):/atom|string|variable/.test(n)&&e.context&&(/[\}\]]/.test(e.context.type)?r(e,"pattern",t.column()):"pattern"!=e.context.type||e.context.align||(e.context.align=!0,e.context.col=t.column()));return n},indent:function(t,e){var n=e&&e.charAt(0),o=t.context;if(/[\]\}]/.test(n))for(;o&&"pattern"==o.type;)o=o.prev;var r=o&&n==o.type;return o?"pattern"==o.type?o.col:o.align?o.col+(r?0:1):o.indent+(r?0:u):0},lineComment:"#"}}),t.defineMIME("text/turtle","turtle")}); +\ 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("turtle",function(a){function b(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function c(a,b){var c=a.next();if(g=null,"<"==c&&!a.match(/^[\s\u00a0=]/,!1))return a.match(/^[^\s\u00a0>]*>?/),"atom";if('"'==c||"'"==c)return b.tokenize=d(c),b.tokenize(a,b);if(/[{}\(\),\.;\[\]]/.test(c))return g=c,null;if("#"==c)return a.skipToEnd(),"comment";if(j.test(c))return a.eatWhile(j),null;if(":"==c)return"operator";if(a.eatWhile(/[_\w\d]/),":"==a.peek())return"variable-3";var e=a.current();return i.test(e)?"meta":c>="A"&&"Z">=c?"comment":"keyword";var e}function d(a){return function(b,d){for(var e,f=!1;null!=(e=b.next());){if(e==a&&!f){d.tokenize=c;break}f=!f&&"\\"==e}return"string"}}function e(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function f(a){a.indent=a.context.indent,a.context=a.context.prev}var g,h=a.indentUnit,i=(b([]),b(["@prefix","@base","a"])),j=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(a,b){if(a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);if("comment"!=c&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==g)e(b,")",a.column());else if("["==g)e(b,"]",a.column());else if("{"==g)e(b,"}",a.column());else if(/[\]\}\)]/.test(g)){for(;b.context&&"pattern"==b.context.type;)f(b);b.context&&g==b.context.type&&f(b)}else"."==g&&b.context&&"pattern"==b.context.type?f(b):/atom|string|variable/.test(c)&&b.context&&(/[\}\]]/.test(b.context.type)?e(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return c},indent:function(a,b){var c=b&&b.charAt(0),d=a.context;if(/[\]\}]/.test(c))for(;d&&"pattern"==d.type;)d=d.prev;var e=d&&c==d.type;return d?"pattern"==d.type?d.col:d.align?d.col+(e?0:1):d.indent+(e?0:h):0},lineComment:"#"}}),a.defineMIME("text/turtle","turtle")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/vb/vb.js b/media/editors/codemirror/mode/vb/vb.js +index 902203e..665248f 100644 +--- a/media/editors/codemirror/mode/vb/vb.js ++++ b/media/editors/codemirror/mode/vb/vb.js +@@ -29,13 +29,14 @@ CodeMirror.defineMode("vb", function(conf, parserConf) { + var middleKeywords = ['else','elseif','case', 'catch']; + var endKeywords = ['next','loop']; + +- var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'in']); +- var commonkeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until', ++ var operatorKeywords = ['and', 'or', 'not', 'xor', 'in']; ++ var wordOperators = wordRegexp(operatorKeywords); ++ var commonKeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until', + 'goto', 'byval','byref','new','handles','property', 'return', + 'const','private', 'protected', 'friend', 'public', 'shared', 'static', 'true','false']; + var commontypes = ['integer','string','double','decimal','boolean','short','char', 'float','single']; + +- var keywords = wordRegexp(commonkeywords); ++ var keywords = wordRegexp(commonKeywords); + var types = wordRegexp(commontypes); + var stringPrefixes = '"'; + +@@ -47,8 +48,8 @@ CodeMirror.defineMode("vb", function(conf, parserConf) { + + var indentInfo = null; + +- +- ++ CodeMirror.registerHelper("hintWords", "vb", openingKeywords.concat(middleKeywords).concat(endKeywords) ++ .concat(operatorKeywords).concat(commonKeywords).concat(commontypes)); + + function indent(_stream, state) { + state.currentIndent++; +diff --git a/media/editors/codemirror/mode/vb/vb.min.js b/media/editors/codemirror/mode/vb/vb.min.js +index 784a7a7..174963b 100644 +--- a/media/editors/codemirror/mode/vb/vb.min.js ++++ b/media/editors/codemirror/mode/vb/vb.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("vb",function(e,n){function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e,n){n.currentIndent++}function i(e,n){n.currentIndent--}function o(e,n){if(e.eatSpace())return null;var t=e.peek();if("'"===t)return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var o=!1;if(e.match(/^\d*\.\d+F?/i)?o=!0:e.match(/^\d+\.\d*F?/)?o=!0:e.match(/^\.\d+F?/)&&(o=!0),o)return e.eat(/J/i),"number";var c=!1;if(e.match(/^&H[0-9a-f]+/i)?c=!0:e.match(/^&O[0-7]+/i)?c=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),c=!0):e.match(/^0(?![\dx])/i)&&(c=!0),c)return e.eat(/L/i),"number"}return e.match(I)?(n.tokenize=a(e.current()),n.tokenize(e,n)):e.match(h)||e.match(m)?null:e.match(l)||e.match(d)||e.match(x)?"operator":e.match(f)?null:e.match(R)?(r(e,n),n.doInCurrentLine=!0,"keyword"):e.match(E)?(n.doInCurrentLine?n.doInCurrentLine=!1:r(e,n),"keyword"):e.match(L)?"keyword":e.match(C)?(i(e,n),i(e,n),"keyword"):e.match(z)?(i(e,n),"keyword"):e.match(y)?"keyword":e.match(w)?"keyword":e.match(s)?"variable":(e.next(),u)}function a(e){var t=1==e.length,r="string";return function(i,a){for(;!i.eol();){if(i.eatWhile(/[^'"]/),i.match(e))return a.tokenize=o,r;i.eat(/['"]/)}if(t){if(n.singleLineStringErrors)return u;a.tokenize=o}return r}}function c(e,n){var t=n.tokenize(e,n),o=e.current();if("."===o)return t=n.tokenize(e,n),o=e.current(),"variable"===t?"variable":u;var a="[({".indexOf(o);return-1!==a&&r(e,n),"dedent"===F&&i(e,n)?u:(a="])}".indexOf(o),-1!==a&&i(e,n)?u:t)}var u="error",d=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),f=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),l=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),m=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),h=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),s=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),p=["class","module","sub","enum","select","while","if","function","get","set","property","try"],b=["else","elseif","case","catch"],k=["next","loop"],x=t(["and","or","not","xor","in"]),g=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],v=["integer","string","double","decimal","boolean","short","char","float","single"],w=t(g),y=t(v),I='"',E=t(p),L=t(b),z=t(k),C=t(["end"]),R=t(["do"]),F=null,M={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:o,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,n){e.sol()&&(n.currentIndent+=n.nextLineIndent,n.nextLineIndent=0,n.doInCurrentLine=0);var t=c(e,n);return n.lastToken={style:t,content:e.current()},t},indent:function(n,t){var r=t.replace(/^\s+|\s+$/g,"");return r.match(z)||r.match(C)||r.match(L)?e.indentUnit*(n.currentIndent-1):n.currentIndent<0?0:n.currentIndent*e.indentUnit}};return M}),e.defineMIME("text/x-vb","vb")}); +\ 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("vb",function(b,c){function d(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function e(a,b){b.currentIndent++}function f(a,b){b.currentIndent--}function g(a,b){if(a.eatSpace())return null;var c=a.peek();if("'"===c)return a.skipToEnd(),"comment";if(a.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var d=!1;if(a.match(/^\d*\.\d+F?/i)?d=!0:a.match(/^\d+\.\d*F?/)?d=!0:a.match(/^\.\d+F?/)&&(d=!0),d)return a.eat(/J/i),"number";var g=!1;if(a.match(/^&H[0-9a-f]+/i)?g=!0:a.match(/^&O[0-7]+/i)?g=!0:a.match(/^[1-9]\d*F?/)?(a.eat(/J/i),g=!0):a.match(/^0(?![\dx])/i)&&(g=!0),g)return a.eat(/L/i),"number"}return a.match(z)?(b.tokenize=h(a.current()),b.tokenize(a,b)):a.match(o)||a.match(n)?null:a.match(m)||a.match(k)||a.match(u)?"operator":a.match(l)?null:a.match(E)?(e(a,b),b.doInCurrentLine=!0,"keyword"):a.match(A)?(b.doInCurrentLine?b.doInCurrentLine=!1:e(a,b),"keyword"):a.match(B)?"keyword":a.match(D)?(f(a,b),f(a,b),"keyword"):a.match(C)?(f(a,b),"keyword"):a.match(y)?"keyword":a.match(x)?"keyword":a.match(p)?"variable":(a.next(),j)}function h(a){var b=1==a.length,d="string";return function(e,f){for(;!e.eol();){if(e.eatWhile(/[^'"]/),e.match(a))return f.tokenize=g,d;e.eat(/['"]/)}if(b){if(c.singleLineStringErrors)return j;f.tokenize=g}return d}}function i(a,b){var c=b.tokenize(a,b),d=a.current();if("."===d)return c=b.tokenize(a,b),d=a.current(),"variable"===c?"variable":j;var g="[({".indexOf(d);return-1!==g&&e(a,b),"dedent"===F&&f(a,b)?j:(g="])}".indexOf(d),-1!==g&&f(a,b)?j:c)}var j="error",k=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),l=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),m=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),n=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),o=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),p=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),q=["class","module","sub","enum","select","while","if","function","get","set","property","try"],r=["else","elseif","case","catch"],s=["next","loop"],t=["and","or","not","xor","in"],u=d(t),v=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],w=["integer","string","double","decimal","boolean","short","char","float","single"],x=d(v),y=d(w),z='"',A=d(q),B=d(r),C=d(s),D=d(["end"]),E=d(["do"]),F=null;a.registerHelper("hintWords","vb",q.concat(r).concat(s).concat(t).concat(v).concat(w));var G={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:g,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(a,b){a.sol()&&(b.currentIndent+=b.nextLineIndent,b.nextLineIndent=0,b.doInCurrentLine=0);var c=i(a,b);return b.lastToken={style:c,content:a.current()},c},indent:function(a,c){var d=c.replace(/^\s+|\s+$/g,"");return d.match(C)||d.match(D)||d.match(B)?b.indentUnit*(a.currentIndent-1):a.currentIndent<0?0:a.currentIndent*b.indentUnit}};return G}),a.defineMIME("text/x-vb","vb")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/vbscript/vbscript.min.js b/media/editors/codemirror/mode/vbscript/vbscript.min.js +index 4d021e1..6ec685d 100644 +--- a/media/editors/codemirror/mode/vbscript/vbscript.min.js ++++ b/media/editors/codemirror/mode/vbscript/vbscript.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("vbscript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e,t){t.currentIndent++}function a(e,t){t.currentIndent--}function i(e,t){if(e.eatSpace())return"space";var n=e.peek();if("'"===n)return e.skipToEnd(),"comment";if(e.match(K))return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var i=!1;if(e.match(/^\d*\.\d+/i)?i=!0:e.match(/^\d+\.\d*/)?i=!0:e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var c=!1;if(e.match(/^&H[0-9a-f]+/i)?c=!0:e.match(/^&O[0-7]+/i)?c=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),c=!0):e.match(/^0(?![\dx])/i)&&(c=!0),c)return e.eat(/L/i),"number"}return e.match(R)?(t.tokenize=o(e.current()),t.tokenize(e,t)):e.match(l)||e.match(s)||e.match(h)?"operator":e.match(u)?null:e.match(d)?"bracket":e.match(W)?(t.doInCurrentLine=!0,"keyword"):e.match(q)?(r(e,t),t.doInCurrentLine=!0,"keyword"):e.match(B)?(t.doInCurrentLine?t.doInCurrentLine=!1:r(e,t),"keyword"):e.match(M)?"keyword":e.match(N)?(a(e,t),a(e,t),"keyword"):e.match(A)?(t.doInCurrentLine?t.doInCurrentLine=!1:a(e,t),"keyword"):e.match(T)?"keyword":e.match(j)?"atom":e.match(F)?"variable-2":e.match(O)?"builtin":e.match(z)?"variable-2":e.match(v)?"variable":(e.next(),b)}function o(e){var n=1==e.length,r="string";return function(a,o){for(;!a.eol();){if(a.eatWhile(/[^'"]/),a.match(e))return o.tokenize=i,r;a.eat(/['"]/)}if(n){if(t.singleLineStringErrors)return b;o.tokenize=i}return r}}function c(e,t){var n=t.tokenize(e,t),r=e.current();return"."===r?(n=t.tokenize(e,t),r=e.current(),!n||"variable"!==n.substr(0,8)&&"builtin"!==n&&"keyword"!==n?b:(("builtin"===n||"keyword"===n)&&(n="variable"),S.indexOf(r.substr(1))>-1&&(n="variable-2"),n)):n}var b="error",s=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),l=new RegExp("^((<>)|(<=)|(>=))"),u=new RegExp("^[\\.,]"),d=new RegExp("^[\\(\\)]"),v=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),m=["class","sub","select","while","if","function","property","with","for"],p=["else","elseif","case"],f=["next","loop","wend"],h=n(["and","or","not","xor","is","mod","eqv","imp"]),y=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],g=["true","false","nothing","empty","null"],x=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],k=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],w=["WScript","err","debug","RegExp"],I=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],C=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],L=["server","response","request","session","application"],E=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],D=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],S=C.concat(I);w=w.concat(k),e.isASP&&(w=w.concat(L),S=S.concat(D,E));var T=n(y),j=n(g),O=n(x),z=n(w),F=n(S),R='"',B=n(m),M=n(p),A=n(f),N=n(["end"]),q=n(["do"]),W=n(["on error resume next","exit"]),K=n(["rem"]),U={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:i,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var n=c(e,t);return t.lastToken={style:n,content:e.current()},"space"===n&&(n=null),n},indent:function(t,n){var r=n.replace(/^\s+|\s+$/g,"");return r.match(A)||r.match(N)||r.match(M)?e.indentUnit*(t.currentIndent-1):t.currentIndent<0?0:t.currentIndent*e.indentUnit}};return U}),e.defineMIME("text/vbscript","vbscript")}); +\ 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("vbscript",function(a,b){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function d(a,b){b.currentIndent++}function e(a,b){b.currentIndent--}function f(a,b){if(a.eatSpace())return"space";var c=a.peek();if("'"===c)return a.skipToEnd(),"comment";if(a.match(P))return a.skipToEnd(),"comment";if(a.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!a.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var f=!1;if(a.match(/^\d*\.\d+/i)?f=!0:a.match(/^\d+\.\d*/)?f=!0:a.match(/^\.\d+/)&&(f=!0),f)return a.eat(/J/i),"number";var h=!1;if(a.match(/^&H[0-9a-f]+/i)?h=!0:a.match(/^&O[0-7]+/i)?h=!0:a.match(/^[1-9]\d*F?/)?(a.eat(/J/i),h=!0):a.match(/^0(?![\dx])/i)&&(h=!0),h)return a.eat(/L/i),"number"}return a.match(I)?(b.tokenize=g(a.current()),b.tokenize(a,b)):a.match(k)||a.match(j)||a.match(r)?"operator":a.match(l)?null:a.match(m)?"bracket":a.match(O)?(b.doInCurrentLine=!0,"keyword"):a.match(N)?(d(a,b),b.doInCurrentLine=!0,"keyword"):a.match(J)?(b.doInCurrentLine?b.doInCurrentLine=!1:d(a,b),"keyword"):a.match(K)?"keyword":a.match(M)?(e(a,b),e(a,b),"keyword"):a.match(L)?(b.doInCurrentLine?b.doInCurrentLine=!1:e(a,b),"keyword"):a.match(D)?"keyword":a.match(E)?"atom":a.match(H)?"variable-2":a.match(F)?"builtin":a.match(G)?"variable-2":a.match(n)?"variable":(a.next(),i)}function g(a){var c=1==a.length,d="string";return function(e,g){for(;!e.eol();){if(e.eatWhile(/[^'"]/),e.match(a))return g.tokenize=f,d;e.eat(/['"]/)}if(c){if(b.singleLineStringErrors)return i;g.tokenize=f}return d}}function h(a,b){var c=b.tokenize(a,b),d=a.current();return"."===d?(c=b.tokenize(a,b),d=a.current(),!c||"variable"!==c.substr(0,8)&&"builtin"!==c&&"keyword"!==c?i:(("builtin"===c||"keyword"===c)&&(c="variable"),C.indexOf(d.substr(1))>-1&&(c="variable-2"),c)):c}var i="error",j=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),k=new RegExp("^((<>)|(<=)|(>=))"),l=new RegExp("^[\\.,]"),m=new RegExp("^[\\(\\)]"),n=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),o=["class","sub","select","while","if","function","property","with","for"],p=["else","elseif","case"],q=["next","loop","wend"],r=c(["and","or","not","xor","is","mod","eqv","imp"]),s=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],t=["true","false","nothing","empty","null"],u=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],v=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],w=["WScript","err","debug","RegExp"],x=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],y=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],z=["server","response","request","session","application"],A=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],B=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],C=y.concat(x);w=w.concat(v),a.isASP&&(w=w.concat(z),C=C.concat(B,A));var D=c(s),E=c(t),F=c(u),G=c(w),H=c(C),I='"',J=c(o),K=c(p),L=c(q),M=c(["end"]),N=c(["do"]),O=c(["on error resume next","exit"]),P=c(["rem"]),Q={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:f,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(a,b){a.sol()&&(b.currentIndent+=b.nextLineIndent,b.nextLineIndent=0,b.doInCurrentLine=0);var c=h(a,b);return b.lastToken={style:c,content:a.current()},"space"===c&&(c=null),c},indent:function(b,c){var d=c.replace(/^\s+|\s+$/g,"");return d.match(L)||d.match(M)||d.match(K)?a.indentUnit*(b.currentIndent-1):b.currentIndent<0?0:b.currentIndent*a.indentUnit}};return Q}),a.defineMIME("text/vbscript","vbscript")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/velocity/velocity.min.js b/media/editors/codemirror/mode/velocity/velocity.min.js +index 0d64e640..08735aa 100644 +--- a/media/editors/codemirror/mode/velocity/velocity.min.js ++++ b/media/editors/codemirror/mode/velocity/velocity.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("velocity",function(){function e(e){for(var t={},n=e.split(" "),r=0;rk.length&&"."==e.string.charAt(e.pos-k.length-1)&&n.lastTokenWasBuiltin?"builtin":(n.lastTokenWasBuiltin=!1,null)}return n.lastTokenWasBuiltin=!1,n.inString?(n.inString=!1,"string"):n.inParams?t(e,n,r(c)):void 0}function r(e){return function(t,r){for(var i,a=!1,o=!1;null!=(i=t.next());){if(i==e&&!a){o=!0;break}if('"'==e&&"$"==t.peek()&&!a){r.inString=!0,o=!0;break}a=!a&&"\\"==i}return o&&(r.tokenize=n),"string"}}function i(e,t){for(var r,i=!1;r=e.next();){if("#"==r&&i){t.tokenize=n;break}i="*"==r}return"comment"}function a(e,t){for(var r,i=0;r=e.next();){if("#"==r&&2==i){t.tokenize=n;break}"]"==r?i++:" "!=r&&(i=0)}return"meta"}var o=e("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"),s=e("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"),l=e("$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"),u=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:n,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},blockCommentStart:"#*",blockCommentEnd:"*#",lineComment:"##",fold:"velocity"}}),e.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/mode/verilog/test.js b/media/editors/codemirror/mode/verilog/test.js +deleted file mode 100644 +index 9c8c094..0000000 +--- a/media/editors/codemirror/mode/verilog/test.js ++++ /dev/null +@@ -1,273 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({indentUnit: 4}, "verilog"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- +- MT("binary_literals", +- "[number 1'b0]", +- "[number 1'b1]", +- "[number 1'bx]", +- "[number 1'bz]", +- "[number 1'bX]", +- "[number 1'bZ]", +- "[number 1'B0]", +- "[number 1'B1]", +- "[number 1'Bx]", +- "[number 1'Bz]", +- "[number 1'BX]", +- "[number 1'BZ]", +- "[number 1'b0]", +- "[number 1'b1]", +- "[number 2'b01]", +- "[number 2'bxz]", +- "[number 2'b11]", +- "[number 2'b10]", +- "[number 2'b1Z]", +- "[number 12'b0101_0101_0101]", +- "[number 1'b 0]", +- "[number 'b0101]" +- ); +- +- MT("octal_literals", +- "[number 3'o7]", +- "[number 3'O7]", +- "[number 3'so7]", +- "[number 3'SO7]" +- ); +- +- MT("decimal_literals", +- "[number 0]", +- "[number 1]", +- "[number 7]", +- "[number 123_456]", +- "[number 'd33]", +- "[number 8'd255]", +- "[number 8'D255]", +- "[number 8'sd255]", +- "[number 8'SD255]", +- "[number 32'd123]", +- "[number 32 'd123]", +- "[number 32 'd 123]" +- ); +- +- MT("hex_literals", +- "[number 4'h0]", +- "[number 4'ha]", +- "[number 4'hF]", +- "[number 4'hx]", +- "[number 4'hz]", +- "[number 4'hX]", +- "[number 4'hZ]", +- "[number 32'hdc78]", +- "[number 32'hDC78]", +- "[number 32 'hDC78]", +- "[number 32'h DC78]", +- "[number 32 'h DC78]", +- "[number 32'h44x7]", +- "[number 32'hFFF?]" +- ); +- +- MT("real_number_literals", +- "[number 1.2]", +- "[number 0.1]", +- "[number 2394.26331]", +- "[number 1.2E12]", +- "[number 1.2e12]", +- "[number 1.30e-2]", +- "[number 0.1e-0]", +- "[number 23E10]", +- "[number 29E-2]", +- "[number 236.123_763_e-12]" +- ); +- +- MT("operators", +- "[meta ^]" +- ); +- +- MT("keywords", +- "[keyword logic]", +- "[keyword logic] [variable foo]", +- "[keyword reg] [variable abc]" +- ); +- +- MT("variables", +- "[variable _leading_underscore]", +- "[variable _if]", +- "[number 12] [variable foo]", +- "[variable foo] [number 14]" +- ); +- +- MT("tick_defines", +- "[def `FOO]", +- "[def `foo]", +- "[def `FOO_bar]" +- ); +- +- MT("system_calls", +- "[meta $display]", +- "[meta $vpi_printf]" +- ); +- +- MT("line_comment", "[comment // Hello world]"); +- +- // Alignment tests +- MT("align_port_map_style1", +- /** +- * mod mod(.a(a), +- * .b(b) +- * ); +- */ +- "[variable mod] [variable mod][bracket (].[variable a][bracket (][variable a][bracket )],", +- " .[variable b][bracket (][variable b][bracket )]", +- " [bracket )];", +- "" +- ); +- +- MT("align_port_map_style2", +- /** +- * mod mod( +- * .a(a), +- * .b(b) +- * ); +- */ +- "[variable mod] [variable mod][bracket (]", +- " .[variable a][bracket (][variable a][bracket )],", +- " .[variable b][bracket (][variable b][bracket )]", +- "[bracket )];", +- "" +- ); +- +- // Indentation tests +- MT("indent_single_statement_if", +- "[keyword if] [bracket (][variable foo][bracket )]", +- " [keyword break];", +- "" +- ); +- +- MT("no_indent_after_single_line_if", +- "[keyword if] [bracket (][variable foo][bracket )] [keyword break];", +- "" +- ); +- +- MT("indent_after_if_begin_same_line", +- "[keyword if] [bracket (][variable foo][bracket )] [keyword begin]", +- " [keyword break];", +- " [keyword break];", +- "[keyword end]", +- "" +- ); +- +- MT("indent_after_if_begin_next_line", +- "[keyword if] [bracket (][variable foo][bracket )]", +- " [keyword begin]", +- " [keyword break];", +- " [keyword break];", +- " [keyword end]", +- "" +- ); +- +- MT("indent_single_statement_if_else", +- "[keyword if] [bracket (][variable foo][bracket )]", +- " [keyword break];", +- "[keyword else]", +- " [keyword break];", +- "" +- ); +- +- MT("indent_if_else_begin_same_line", +- "[keyword if] [bracket (][variable foo][bracket )] [keyword begin]", +- " [keyword break];", +- " [keyword break];", +- "[keyword end] [keyword else] [keyword begin]", +- " [keyword break];", +- " [keyword break];", +- "[keyword end]", +- "" +- ); +- +- MT("indent_if_else_begin_next_line", +- "[keyword if] [bracket (][variable foo][bracket )]", +- " [keyword begin]", +- " [keyword break];", +- " [keyword break];", +- " [keyword end]", +- "[keyword else]", +- " [keyword begin]", +- " [keyword break];", +- " [keyword break];", +- " [keyword end]", +- "" +- ); +- +- MT("indent_if_nested_without_begin", +- "[keyword if] [bracket (][variable foo][bracket )]", +- " [keyword if] [bracket (][variable foo][bracket )]", +- " [keyword if] [bracket (][variable foo][bracket )]", +- " [keyword break];", +- "" +- ); +- +- MT("indent_case", +- "[keyword case] [bracket (][variable state][bracket )]", +- " [variable FOO]:", +- " [keyword break];", +- " [variable BAR]:", +- " [keyword break];", +- "[keyword endcase]", +- "" +- ); +- +- MT("unindent_after_end_with_preceding_text", +- "[keyword begin]", +- " [keyword break]; [keyword end]", +- "" +- ); +- +- MT("export_function_one_line_does_not_indent", +- "[keyword export] [string \"DPI-C\"] [keyword function] [variable helloFromSV];", +- "" +- ); +- +- MT("export_task_one_line_does_not_indent", +- "[keyword export] [string \"DPI-C\"] [keyword task] [variable helloFromSV];", +- "" +- ); +- +- MT("export_function_two_lines_indents_properly", +- "[keyword export]", +- " [string \"DPI-C\"] [keyword function] [variable helloFromSV];", +- "" +- ); +- +- MT("export_task_two_lines_indents_properly", +- "[keyword export]", +- " [string \"DPI-C\"] [keyword task] [variable helloFromSV];", +- "" +- ); +- +- MT("import_function_one_line_does_not_indent", +- "[keyword import] [string \"DPI-C\"] [keyword function] [variable helloFromC];", +- "" +- ); +- +- MT("import_task_one_line_does_not_indent", +- "[keyword import] [string \"DPI-C\"] [keyword task] [variable helloFromC];", +- "" +- ); +- +- MT("import_package_single_line_does_not_indent", +- "[keyword import] [variable p]::[variable x];", +- "[keyword import] [variable p]::[variable y];", +- "" +- ); +- +- MT("covergoup_with_function_indents_properly", +- "[keyword covergroup] [variable cg] [keyword with] [keyword function] [variable sample][bracket (][keyword bit] [variable b][bracket )];", +- " [variable c] : [keyword coverpoint] [variable c];", +- "[keyword endgroup]: [variable cg]", +- "" +- ); +- +-})(); +diff --git a/media/editors/codemirror/mode/verilog/test.min.js b/media/editors/codemirror/mode/verilog/test.min.js +deleted file mode 100644 +index 37f74d0..0000000 +--- a/media/editors/codemirror/mode/verilog/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function e(e){test.mode(e,r,Array.prototype.slice.call(arguments,1))}var r=CodeMirror.getMode({indentUnit:4},"verilog");e("binary_literals","[number 1'b0]","[number 1'b1]","[number 1'bx]","[number 1'bz]","[number 1'bX]","[number 1'bZ]","[number 1'B0]","[number 1'B1]","[number 1'Bx]","[number 1'Bz]","[number 1'BX]","[number 1'BZ]","[number 1'b0]","[number 1'b1]","[number 2'b01]","[number 2'bxz]","[number 2'b11]","[number 2'b10]","[number 2'b1Z]","[number 12'b0101_0101_0101]","[number 1'b 0]","[number 'b0101]"),e("octal_literals","[number 3'o7]","[number 3'O7]","[number 3'so7]","[number 3'SO7]"),e("decimal_literals","[number 0]","[number 1]","[number 7]","[number 123_456]","[number 'd33]","[number 8'd255]","[number 8'D255]","[number 8'sd255]","[number 8'SD255]","[number 32'd123]","[number 32 'd123]","[number 32 'd 123]"),e("hex_literals","[number 4'h0]","[number 4'ha]","[number 4'hF]","[number 4'hx]","[number 4'hz]","[number 4'hX]","[number 4'hZ]","[number 32'hdc78]","[number 32'hDC78]","[number 32 'hDC78]","[number 32'h DC78]","[number 32 'h DC78]","[number 32'h44x7]","[number 32'hFFF?]"),e("real_number_literals","[number 1.2]","[number 0.1]","[number 2394.26331]","[number 1.2E12]","[number 1.2e12]","[number 1.30e-2]","[number 0.1e-0]","[number 23E10]","[number 29E-2]","[number 236.123_763_e-12]"),e("operators","[meta ^]"),e("keywords","[keyword logic]","[keyword logic] [variable foo]","[keyword reg] [variable abc]"),e("variables","[variable _leading_underscore]","[variable _if]","[number 12] [variable foo]","[variable foo] [number 14]"),e("tick_defines","[def `FOO]","[def `foo]","[def `FOO_bar]"),e("system_calls","[meta $display]","[meta $vpi_printf]"),e("line_comment","[comment // Hello world]"),e("align_port_map_style1","[variable mod] [variable mod][bracket (].[variable a][bracket (][variable a][bracket )],"," .[variable b][bracket (][variable b][bracket )]"," [bracket )];",""),e("align_port_map_style2","[variable mod] [variable mod][bracket (]"," .[variable a][bracket (][variable a][bracket )],"," .[variable b][bracket (][variable b][bracket )]","[bracket )];",""),e("indent_single_statement_if","[keyword if] [bracket (][variable foo][bracket )]"," [keyword break];",""),e("no_indent_after_single_line_if","[keyword if] [bracket (][variable foo][bracket )] [keyword break];",""),e("indent_after_if_begin_same_line","[keyword if] [bracket (][variable foo][bracket )] [keyword begin]"," [keyword break];"," [keyword break];","[keyword end]",""),e("indent_after_if_begin_next_line","[keyword if] [bracket (][variable foo][bracket )]"," [keyword begin]"," [keyword break];"," [keyword break];"," [keyword end]",""),e("indent_single_statement_if_else","[keyword if] [bracket (][variable foo][bracket )]"," [keyword break];","[keyword else]"," [keyword break];",""),e("indent_if_else_begin_same_line","[keyword if] [bracket (][variable foo][bracket )] [keyword begin]"," [keyword break];"," [keyword break];","[keyword end] [keyword else] [keyword begin]"," [keyword break];"," [keyword break];","[keyword end]",""),e("indent_if_else_begin_next_line","[keyword if] [bracket (][variable foo][bracket )]"," [keyword begin]"," [keyword break];"," [keyword break];"," [keyword end]","[keyword else]"," [keyword begin]"," [keyword break];"," [keyword break];"," [keyword end]",""),e("indent_if_nested_without_begin","[keyword if] [bracket (][variable foo][bracket )]"," [keyword if] [bracket (][variable foo][bracket )]"," [keyword if] [bracket (][variable foo][bracket )]"," [keyword break];",""),e("indent_case","[keyword case] [bracket (][variable state][bracket )]"," [variable FOO]:"," [keyword break];"," [variable BAR]:"," [keyword break];","[keyword endcase]",""),e("unindent_after_end_with_preceding_text","[keyword begin]"," [keyword break]; [keyword end]",""),e("export_function_one_line_does_not_indent",'[keyword export] [string "DPI-C"] [keyword function] [variable helloFromSV];',""),e("export_task_one_line_does_not_indent",'[keyword export] [string "DPI-C"] [keyword task] [variable helloFromSV];',""),e("export_function_two_lines_indents_properly","[keyword export]",' [string "DPI-C"] [keyword function] [variable helloFromSV];',""),e("export_task_two_lines_indents_properly","[keyword export]",' [string "DPI-C"] [keyword task] [variable helloFromSV];',""),e("import_function_one_line_does_not_indent",'[keyword import] [string "DPI-C"] [keyword function] [variable helloFromC];',""),e("import_task_one_line_does_not_indent",'[keyword import] [string "DPI-C"] [keyword task] [variable helloFromC];',""),e("import_package_single_line_does_not_indent","[keyword import] [variable p]::[variable x];","[keyword import] [variable p]::[variable y];",""),e("covergoup_with_function_indents_properly","[keyword covergroup] [variable cg] [keyword with] [keyword function] [variable sample][bracket (][keyword bit] [variable b][bracket )];"," [variable c] : [keyword coverpoint] [variable c];","[keyword endgroup]: [variable cg]","")}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/verilog/verilog.js b/media/editors/codemirror/mode/verilog/verilog.js +index 96b9f24..9d2a4cd 100644 +--- a/media/editors/codemirror/mode/verilog/verilog.js ++++ b/media/editors/codemirror/mode/verilog/verilog.js +@@ -375,73 +375,73 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { + name: "verilog" + }); + +- // SVXVerilog mode ++ // TLVVerilog mode + +- var svxchScopePrefixes = { ++ var tlvchScopePrefixes = { + ">": "property", "->": "property", "-": "hr", "|": "link", "?$": "qualifier", "?*": "qualifier", + "@-": "variable-3", "@": "variable-3", "?": "qualifier" + }; + +- function svxGenIndent(stream, state) { +- var svxindentUnit = 2; ++ function tlvGenIndent(stream, state) { ++ var tlvindentUnit = 2; + var rtnIndent = -1, indentUnitRq = 0, curIndent = stream.indentation(); +- switch (state.svxCurCtlFlowChar) { ++ switch (state.tlvCurCtlFlowChar) { + case "\\": + curIndent = 0; + break; + case "|": +- if (state.svxPrevPrevCtlFlowChar == "@") { ++ if (state.tlvPrevPrevCtlFlowChar == "@") { + indentUnitRq = -2; //-2 new pipe rq after cur pipe + break; + } +- if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) ++ if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar]) + indentUnitRq = 1; // +1 new scope + break; + case "M": // m4 +- if (state.svxPrevPrevCtlFlowChar == "@") { ++ if (state.tlvPrevPrevCtlFlowChar == "@") { + indentUnitRq = -2; //-2 new inst rq after pipe + break; + } +- if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) ++ if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar]) + indentUnitRq = 1; // +1 new scope + break; + case "@": +- if (state.svxPrevCtlFlowChar == "S") ++ if (state.tlvPrevCtlFlowChar == "S") + indentUnitRq = -1; // new pipe stage after stmts +- if (state.svxPrevCtlFlowChar == "|") ++ if (state.tlvPrevCtlFlowChar == "|") + indentUnitRq = 1; // 1st pipe stage + break; + case "S": +- if (state.svxPrevCtlFlowChar == "@") ++ if (state.tlvPrevCtlFlowChar == "@") + indentUnitRq = 1; // flow in pipe stage +- if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) ++ if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar]) + indentUnitRq = 1; // +1 new scope + break; + } +- var statementIndentUnit = svxindentUnit; ++ var statementIndentUnit = tlvindentUnit; + rtnIndent = curIndent + (indentUnitRq*statementIndentUnit); + return rtnIndent >= 0 ? rtnIndent : curIndent; + } + +- CodeMirror.defineMIME("text/x-svx", { ++ CodeMirror.defineMIME("text/x-tlv", { + name: "verilog", + hooks: { + "\\": function(stream, state) { + var vxIndent = 0, style = false; + var curPunc = stream.string; +- if ((stream.sol()) && (/\\SV/.test(stream.string))) { +- curPunc = (/\\SVX_version/.test(stream.string)) +- ? "\\SVX_version" : stream.string; ++ if ((stream.sol()) && ((/\\SV/.test(stream.string)) || (/\\TLV/.test(stream.string)))) { ++ curPunc = (/\\TLV_version/.test(stream.string)) ++ ? "\\TLV_version" : stream.string; + stream.skipToEnd(); + if (curPunc == "\\SV" && state.vxCodeActive) {state.vxCodeActive = false;}; +- if ((/\\SVX/.test(curPunc) && !state.vxCodeActive) +- || (curPunc=="\\SVX_version" && state.vxCodeActive)) {state.vxCodeActive = true;}; ++ if ((/\\TLV/.test(curPunc) && !state.vxCodeActive) ++ || (curPunc=="\\TLV_version" && state.vxCodeActive)) {state.vxCodeActive = true;}; + style = "keyword"; +- state.svxCurCtlFlowChar = state.svxPrevPrevCtlFlowChar +- = state.svxPrevCtlFlowChar = ""; ++ state.tlvCurCtlFlowChar = state.tlvPrevPrevCtlFlowChar ++ = state.tlvPrevCtlFlowChar = ""; + if (state.vxCodeActive == true) { +- state.svxCurCtlFlowChar = "\\"; +- vxIndent = svxGenIndent(stream, state); ++ state.tlvCurCtlFlowChar = "\\"; ++ vxIndent = tlvGenIndent(stream, state); + } + state.vxIndentRq = vxIndent; + } +@@ -449,12 +449,12 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { + }, + tokenBase: function(stream, state) { + var vxIndent = 0, style = false; +- var svxisOperatorChar = /[\[\]=:]/; +- var svxkpScopePrefixs = { ++ var tlvisOperatorChar = /[\[\]=:]/; ++ var tlvkpScopePrefixs = { + "**":"variable-2", "*":"variable-2", "$$":"variable", "$":"variable", + "^^":"attribute", "^":"attribute"}; + var ch = stream.peek(); +- var vxCurCtlFlowCharValueAtStart = state.svxCurCtlFlowChar; ++ var vxCurCtlFlowCharValueAtStart = state.tlvCurCtlFlowChar; + if (state.vxCodeActive == true) { + if (/[\[\]{}\(\);\:]/.test(ch)) { + // bypass nesting and 1 char punc +@@ -465,70 +465,70 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { + if (stream.eat("/")) { + stream.skipToEnd(); + style = "comment"; +- state.svxCurCtlFlowChar = "S"; ++ state.tlvCurCtlFlowChar = "S"; + } else { + stream.backUp(1); + } + } else if (ch == "@") { + // pipeline stage +- style = svxchScopePrefixes[ch]; +- state.svxCurCtlFlowChar = "@"; ++ style = tlvchScopePrefixes[ch]; ++ state.tlvCurCtlFlowChar = "@"; + stream.next(); + stream.eatWhile(/[\w\$_]/); + } else if (stream.match(/\b[mM]4+/, true)) { // match: function(pattern, consume, caseInsensitive) + // m4 pre proc + stream.skipTo("("); + style = "def"; +- state.svxCurCtlFlowChar = "M"; ++ state.tlvCurCtlFlowChar = "M"; + } else if (ch == "!" && stream.sol()) { +- // v stmt in svx region +- // state.svxCurCtlFlowChar = "S"; ++ // v stmt in tlv region ++ // state.tlvCurCtlFlowChar = "S"; + style = "comment"; + stream.next(); +- } else if (svxisOperatorChar.test(ch)) { ++ } else if (tlvisOperatorChar.test(ch)) { + // operators +- stream.eatWhile(svxisOperatorChar); ++ stream.eatWhile(tlvisOperatorChar); + style = "operator"; + } else if (ch == "#") { + // phy hier +- state.svxCurCtlFlowChar = (state.svxCurCtlFlowChar == "") +- ? ch : state.svxCurCtlFlowChar; ++ state.tlvCurCtlFlowChar = (state.tlvCurCtlFlowChar == "") ++ ? ch : state.tlvCurCtlFlowChar; + stream.next(); + stream.eatWhile(/[+-]\d/); + style = "tag"; +- } else if (svxkpScopePrefixs.propertyIsEnumerable(ch)) { +- // special SVX operators +- style = svxkpScopePrefixs[ch]; +- state.svxCurCtlFlowChar = state.svxCurCtlFlowChar == "" ? "S" : state.svxCurCtlFlowChar; // stmt ++ } else if (tlvkpScopePrefixs.propertyIsEnumerable(ch)) { ++ // special TLV operators ++ style = tlvkpScopePrefixs[ch]; ++ state.tlvCurCtlFlowChar = state.tlvCurCtlFlowChar == "" ? "S" : state.tlvCurCtlFlowChar; // stmt + stream.next(); + stream.match(/[a-zA-Z_0-9]+/); +- } else if (style = svxchScopePrefixes[ch] || false) { +- // special SVX operators +- state.svxCurCtlFlowChar = state.svxCurCtlFlowChar == "" ? ch : state.svxCurCtlFlowChar; ++ } else if (style = tlvchScopePrefixes[ch] || false) { ++ // special TLV operators ++ state.tlvCurCtlFlowChar = state.tlvCurCtlFlowChar == "" ? ch : state.tlvCurCtlFlowChar; + stream.next(); + stream.match(/[a-zA-Z_0-9]+/); + } +- if (state.svxCurCtlFlowChar != vxCurCtlFlowCharValueAtStart) { // flow change +- vxIndent = svxGenIndent(stream, state); ++ if (state.tlvCurCtlFlowChar != vxCurCtlFlowCharValueAtStart) { // flow change ++ vxIndent = tlvGenIndent(stream, state); + state.vxIndentRq = vxIndent; + } + } + return style; + }, + token: function(stream, state) { +- if (state.vxCodeActive == true && stream.sol() && state.svxCurCtlFlowChar != "") { +- state.svxPrevPrevCtlFlowChar = state.svxPrevCtlFlowChar; +- state.svxPrevCtlFlowChar = state.svxCurCtlFlowChar; +- state.svxCurCtlFlowChar = ""; ++ if (state.vxCodeActive == true && stream.sol() && state.tlvCurCtlFlowChar != "") { ++ state.tlvPrevPrevCtlFlowChar = state.tlvPrevCtlFlowChar; ++ state.tlvPrevCtlFlowChar = state.tlvCurCtlFlowChar; ++ state.tlvCurCtlFlowChar = ""; + } + }, + indent: function(state) { + return (state.vxCodeActive == true) ? state.vxIndentRq : -1; + }, + startState: function(state) { +- state.svxCurCtlFlowChar = ""; +- state.svxPrevCtlFlowChar = ""; +- state.svxPrevPrevCtlFlowChar = ""; ++ state.tlvCurCtlFlowChar = ""; ++ state.tlvPrevCtlFlowChar = ""; ++ state.tlvPrevPrevCtlFlowChar = ""; + state.vxCodeActive = true; + state.vxIndentRq = 0; + } +diff --git a/media/editors/codemirror/mode/verilog/verilog.min.js b/media/editors/codemirror/mode/verilog/verilog.min.js +index 1f4e320..037ddcf 100644 +--- a/media/editors/codemirror/mode/verilog/verilog.min.js ++++ b/media/editors/codemirror/mode/verilog/verilog.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){var r=2,i=-1,a=0,o=e.indentation();switch(t.svxCurCtlFlowChar){case"\\":o=0;break;case"|":if("@"==t.svxPrevPrevCtlFlowChar){a=-2;break}n[t.svxPrevCtlFlowChar]&&(a=1);break;case"M":if("@"==t.svxPrevPrevCtlFlowChar){a=-2;break}n[t.svxPrevCtlFlowChar]&&(a=1);break;case"@":"S"==t.svxPrevCtlFlowChar&&(a=-1),"|"==t.svxPrevCtlFlowChar&&(a=1);break;case"S":"@"==t.svxPrevCtlFlowChar&&(a=1),n[t.svxPrevCtlFlowChar]&&(a=1)}var l=r;return i=o+a*l,i>=0?i:o}e.defineMode("verilog",function(t,n){function r(e){for(var t={},n=e.split(" "),r=0;r=0)return r}var a=t.context,o=n&&n.charAt(0);"statement"==a.type&&"}"==o&&(a=a.prev);var l=!1,s=n.match(q);return s&&(l=u(s[0],a.type)),"statement"==a.type?a.indented+("{"==o?0:C):A.test(a.type)&&a.align&&!m?a.column+(l?0:1):")"!=a.type||l?a.indented+(l?0:p):a.indented+C},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-verilog",{name:"verilog"}),e.defineMIME("text/x-systemverilog",{name:"verilog"});var n={">":"property","->":"property","-":"hr","|":"link","?$":"qualifier","?*":"qualifier","@-":"variable-3","@":"variable-3","?":"qualifier"};e.defineMIME("text/x-svx",{name:"verilog",hooks:{"\\":function(e,n){var r=0,i=!1,a=e.string;return e.sol()&&/\\SV/.test(e.string)&&(a=/\\SVX_version/.test(e.string)?"\\SVX_version":e.string,e.skipToEnd(),"\\SV"==a&&n.vxCodeActive&&(n.vxCodeActive=!1),(/\\SVX/.test(a)&&!n.vxCodeActive||"\\SVX_version"==a&&n.vxCodeActive)&&(n.vxCodeActive=!0),i="keyword",n.svxCurCtlFlowChar=n.svxPrevPrevCtlFlowChar=n.svxPrevCtlFlowChar="",1==n.vxCodeActive&&(n.svxCurCtlFlowChar="\\",r=t(e,n)),n.vxIndentRq=r),i},tokenBase:function(e,r){var i=0,a=!1,o=/[\[\]=:]/,l={"**":"variable-2","*":"variable-2",$$:"variable",$:"variable","^^":"attribute","^":"attribute"},s=e.peek(),c=r.svxCurCtlFlowChar;return 1==r.vxCodeActive&&(/[\[\]{}\(\);\:]/.test(s)?(a="meta",e.next()):"/"==s?(e.next(),e.eat("/")?(e.skipToEnd(),a="comment",r.svxCurCtlFlowChar="S"):e.backUp(1)):"@"==s?(a=n[s],r.svxCurCtlFlowChar="@",e.next(),e.eatWhile(/[\w\$_]/)):e.match(/\b[mM]4+/,!0)?(e.skipTo("("),a="def",r.svxCurCtlFlowChar="M"):"!"==s&&e.sol()?(a="comment",e.next()):o.test(s)?(e.eatWhile(o),a="operator"):"#"==s?(r.svxCurCtlFlowChar=""==r.svxCurCtlFlowChar?s:r.svxCurCtlFlowChar,e.next(),e.eatWhile(/[+-]\d/),a="tag"):l.propertyIsEnumerable(s)?(a=l[s],r.svxCurCtlFlowChar=""==r.svxCurCtlFlowChar?"S":r.svxCurCtlFlowChar,e.next(),e.match(/[a-zA-Z_0-9]+/)):(a=n[s]||!1)&&(r.svxCurCtlFlowChar=""==r.svxCurCtlFlowChar?s:r.svxCurCtlFlowChar,e.next(),e.match(/[a-zA-Z_0-9]+/)),r.svxCurCtlFlowChar!=c&&(i=t(e,r),r.vxIndentRq=i)),a},token:function(e,t){1==t.vxCodeActive&&e.sol()&&""!=t.svxCurCtlFlowChar&&(t.svxPrevPrevCtlFlowChar=t.svxPrevCtlFlowChar,t.svxPrevCtlFlowChar=t.svxCurCtlFlowChar,t.svxCurCtlFlowChar="")},indent:function(e){return 1==e.vxCodeActive?e.vxIndentRq:-1},startState:function(e){e.svxCurCtlFlowChar="",e.svxPrevCtlFlowChar="",e.svxPrevPrevCtlFlowChar="",e.vxCodeActive=!0,e.vxIndentRq=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";function b(a,b){var d=2,e=-1,f=0,g=a.indentation();switch(b.tlvCurCtlFlowChar){case"\\":g=0;break;case"|":if("@"==b.tlvPrevPrevCtlFlowChar){f=-2;break}c[b.tlvPrevCtlFlowChar]&&(f=1);break;case"M":if("@"==b.tlvPrevPrevCtlFlowChar){f=-2;break}c[b.tlvPrevCtlFlowChar]&&(f=1);break;case"@":"S"==b.tlvPrevCtlFlowChar&&(f=-1),"|"==b.tlvPrevCtlFlowChar&&(f=1);break;case"S":"@"==b.tlvPrevCtlFlowChar&&(f=1),c[b.tlvPrevCtlFlowChar]&&(f=1)}var h=d;return e=g+f*h,e>=0?e:g}a.defineMode("verilog",function(b,c){function d(a){for(var b={},c=a.split(" "),d=0;d=0)return d}var f=b.context,g=c&&c.charAt(0);"statement"==f.type&&"}"==g&&(f=f.prev);var h=!1,i=c.match(D);return i&&(h=k(i[0],f.type)),"statement"==f.type?f.indented+("{"==g?0:p):E.test(f.type)&&f.align&&!q?f.column+(h?0:1):")"!=f.type||h?f.indented+(h?0:o):f.indented+p},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),a.defineMIME("text/x-verilog",{name:"verilog"}),a.defineMIME("text/x-systemverilog",{name:"verilog"});var c={">":"property","->":"property","-":"hr","|":"link","?$":"qualifier","?*":"qualifier","@-":"variable-3","@":"variable-3","?":"qualifier"};a.defineMIME("text/x-tlv",{name:"verilog",hooks:{"\\":function(a,c){var d=0,e=!1,f=a.string;return a.sol()&&(/\\SV/.test(a.string)||/\\TLV/.test(a.string))&&(f=/\\TLV_version/.test(a.string)?"\\TLV_version":a.string,a.skipToEnd(),"\\SV"==f&&c.vxCodeActive&&(c.vxCodeActive=!1),(/\\TLV/.test(f)&&!c.vxCodeActive||"\\TLV_version"==f&&c.vxCodeActive)&&(c.vxCodeActive=!0),e="keyword",c.tlvCurCtlFlowChar=c.tlvPrevPrevCtlFlowChar=c.tlvPrevCtlFlowChar="",1==c.vxCodeActive&&(c.tlvCurCtlFlowChar="\\",d=b(a,c)),c.vxIndentRq=d),e},tokenBase:function(a,d){var e=0,f=!1,g=/[\[\]=:]/,h={"**":"variable-2","*":"variable-2",$$:"variable",$:"variable","^^":"attribute","^":"attribute"},i=a.peek(),j=d.tlvCurCtlFlowChar;return 1==d.vxCodeActive&&(/[\[\]{}\(\);\:]/.test(i)?(f="meta",a.next()):"/"==i?(a.next(),a.eat("/")?(a.skipToEnd(),f="comment",d.tlvCurCtlFlowChar="S"):a.backUp(1)):"@"==i?(f=c[i],d.tlvCurCtlFlowChar="@",a.next(),a.eatWhile(/[\w\$_]/)):a.match(/\b[mM]4+/,!0)?(a.skipTo("("),f="def",d.tlvCurCtlFlowChar="M"):"!"==i&&a.sol()?(f="comment",a.next()):g.test(i)?(a.eatWhile(g),f="operator"):"#"==i?(d.tlvCurCtlFlowChar=""==d.tlvCurCtlFlowChar?i:d.tlvCurCtlFlowChar,a.next(),a.eatWhile(/[+-]\d/),f="tag"):h.propertyIsEnumerable(i)?(f=h[i],d.tlvCurCtlFlowChar=""==d.tlvCurCtlFlowChar?"S":d.tlvCurCtlFlowChar,a.next(),a.match(/[a-zA-Z_0-9]+/)):(f=c[i]||!1)&&(d.tlvCurCtlFlowChar=""==d.tlvCurCtlFlowChar?i:d.tlvCurCtlFlowChar,a.next(),a.match(/[a-zA-Z_0-9]+/)),d.tlvCurCtlFlowChar!=j&&(e=b(a,d),d.vxIndentRq=e)),f},token:function(a,b){1==b.vxCodeActive&&a.sol()&&""!=b.tlvCurCtlFlowChar&&(b.tlvPrevPrevCtlFlowChar=b.tlvPrevCtlFlowChar,b.tlvPrevCtlFlowChar=b.tlvCurCtlFlowChar,b.tlvCurCtlFlowChar="")},indent:function(a){return 1==a.vxCodeActive?a.vxIndentRq:-1},startState:function(a){a.tlvCurCtlFlowChar="",a.tlvPrevCtlFlowChar="",a.tlvPrevPrevCtlFlowChar="",a.vxCodeActive=!0,a.vxIndentRq=0}}})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/xml/test.js b/media/editors/codemirror/mode/xml/test.js +deleted file mode 100644 +index f48156b..0000000 +--- a/media/editors/codemirror/mode/xml/test.js ++++ /dev/null +@@ -1,51 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-(function() { +- var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } +- +- MT("matching", +- "[tag&bracket <][tag top][tag&bracket >]", +- " text", +- " [tag&bracket <][tag inner][tag&bracket />]", +- "[tag&bracket ]"); +- +- MT("nonmatching", +- "[tag&bracket <][tag top][tag&bracket >]", +- " [tag&bracket <][tag inner][tag&bracket />]", +- " [tag&bracket ]"); +- +- MT("doctype", +- "[meta ]", +- "[tag&bracket <][tag top][tag&bracket />]"); +- +- MT("cdata", +- "[tag&bracket <][tag top][tag&bracket >]", +- " [atom ]", +- "[tag&bracket ]"); +- +- // HTML tests +- mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); +- +- MT("selfclose", +- "[tag&bracket <][tag html][tag&bracket >]", +- " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", +- "[tag&bracket ]"); +- +- MT("list", +- "[tag&bracket <][tag ol][tag&bracket >]", +- " [tag&bracket <][tag li][tag&bracket >]one", +- " [tag&bracket <][tag li][tag&bracket >]two", +- "[tag&bracket ]"); +- +- MT("valueless", +- "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); +- +- MT("pThenArticle", +- "[tag&bracket <][tag p][tag&bracket >]", +- " foo", +- "[tag&bracket <][tag article][tag&bracket >]bar"); +- +-})(); +diff --git a/media/editors/codemirror/mode/xml/test.min.js b/media/editors/codemirror/mode/xml/test.min.js +deleted file mode 100644 +index 6fe19d3..0000000 +--- a/media/editors/codemirror/mode/xml/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function t(t){test.mode(t,a,Array.prototype.slice.call(arguments,1),e)}var a=CodeMirror.getMode({indentUnit:2},"xml"),e="xml";t("matching","[tag&bracket <][tag top][tag&bracket >]"," text"," [tag&bracket <][tag inner][tag&bracket />]","[tag&bracket ]"),t("nonmatching","[tag&bracket <][tag top][tag&bracket >]"," [tag&bracket <][tag inner][tag&bracket />]"," [tag&bracket ]"),t("doctype","[meta ]","[tag&bracket <][tag top][tag&bracket />]"),t("cdata","[tag&bracket <][tag top][tag&bracket >]"," [atom ]","[tag&bracket ]"),a=CodeMirror.getMode({indentUnit:2},"text/html"),t("selfclose","[tag&bracket <][tag html][tag&bracket >]",' [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string "/foobar"][tag&bracket >]',"[tag&bracket ]"),t("list","[tag&bracket <][tag ol][tag&bracket >]"," [tag&bracket <][tag li][tag&bracket >]one"," [tag&bracket <][tag li][tag&bracket >]two","[tag&bracket ]"),t("valueless","[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"),t("pThenArticle","[tag&bracket <][tag p][tag&bracket >]"," foo","[tag&bracket <][tag article][tag&bracket >]bar")}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/xml/xml.min.js b/media/editors/codemirror/mode/xml/xml.min.js +index fd99f66..8d92fba 100644 +--- a/media/editors/codemirror/mode/xml/xml.min.js ++++ b/media/editors/codemirror/mode/xml/xml.min.js +@@ -1 +1 @@ +-!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("xml",function(e,n){function r(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();if("<"==r)return t.eat("!")?t.eat("[")?t.match("CDATA[")?n(i("atom","]]>")):null:t.match("--")?n(i("comment","-->")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(l(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=i("meta","?>"),"meta"):(z=t.eat("/")?"closeTag":"openTag",e.tokenize=o,"tag bracket");if("&"==r){var a;return a=t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"),a?"atom":"error"}return t.eatWhile(/[^&<]/),null}function o(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=r,z=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return z="equals",null;if("<"==n){e.tokenize=r,e.state=f,e.tagName=e.tagStart=null;var o=e.tokenize(t,e);return o?o+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=a(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=o;break}return"string"};return e.isInAttribute=!0,e}function i(t,e){return function(n,o){for(;!n.eol();){if(n.match(e)){o.tokenize=r;break}n.next()}return t}}function l(t){return function(e,n){for(var o;null!=(o=e.next());){if("<"==o)return n.tokenize=l(t+1),n.tokenize(e,n);if(">"==o){if(1==t){n.tokenize=r;break}return n.tokenize=l(t-1),n.tokenize(e,n)}}return"meta"}}function u(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(T.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function d(t){t.context&&(t.context=t.context.prev)}function c(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!T.contextGrabbers.hasOwnProperty(n)||!T.contextGrabbers[n].hasOwnProperty(e))return;d(t)}}function f(t,e,n){return"openTag"==t?(n.tagStart=e.column(),s):"closeTag"==t?m:f}function s(t,e,n){return"word"==t?(n.tagName=e.current(),N="tag",h):(N="error",s)}function m(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&T.implicitlyClosed.hasOwnProperty(n.context.tagName)&&d(n),n.context&&n.context.tagName==r?(N="tag",g):(N="tag error",p)}return N="error",p}function g(t,e,n){return"endTag"!=t?(N="error",g):(d(n),f)}function p(t,e,n){return N="error",g(t,e,n)}function h(t,e,n){if("word"==t)return N="attribute",x;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||T.autoSelfClosers.hasOwnProperty(r)?c(n,r):(c(n,r),n.context=new u(n,r,o==n.indented)),f}return N="error",h}function x(t,e,n){return"equals"==t?b:(T.allowMissing||(N="error"),h(t,e,n))}function b(t,e,n){return"string"==t?k:"word"==t&&T.allowUnquoted?(N="string",h):(N="error",h(t,e,n))}function k(t,e,n){return"string"==t?k:h(t,e,n)}var w=e.indentUnit,v=n.multilineTagIndentFactor||1,y=n.multilineTagIndentPastTag;null==y&&(y=!0);var z,N,T=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},C=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;z=null;var n=e.tokenize(t,e);return(n||z)&&"comment"!=n&&(N=null,e.state=e.state(z||n,t,e),N&&(n="error"==N?n+" error":N)),n},indent:function(e,n,a){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+w;if(i&&i.noIndent)return t.Pass;if(e.tokenize!=o&&e.tokenize!=r)return a?a.match(/^(\s*)/)[0].length:0;if(e.tagName)return y?e.tagStart+e.tagName.length+2:e.tagStart+w*v;if(C&&/$/,blockCommentStart:"",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}}),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!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("xml",function(b,c){function d(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if("<"==d)return a.eat("!")?a.eat("[")?a.match("CDATA[")?c(g("atom","]]>")):null:a.match("--")?c(g("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(h(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=g("meta","?>"),"meta"):(x=a.eat("/")?"closeTag":"openTag",b.tokenize=e,"tag bracket");if("&"==d){var f;return f=a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),f?"atom":"error"}return a.eatWhile(/[^&<]/),null}function e(a,b){var c=a.next();if(">"==c||"/"==c&&a.eat(">"))return b.tokenize=d,x=">"==c?"endTag":"selfcloseTag","tag bracket";if("="==c)return x="equals",null;if("<"==c){b.tokenize=d,b.state=l,b.tagName=b.tagStart=null;var e=b.tokenize(a,b);return e?e+" tag error":"tag error"}return/[\'\"]/.test(c)?(b.tokenize=f(c),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(a){var b=function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=e;break}return"string"};return b.isInAttribute=!0,b}function g(a,b){return function(c,e){for(;!c.eol();){if(c.match(b)){e.tokenize=d;break}c.next()}return a}}function h(a){return function(b,c){for(var e;null!=(e=b.next());){if("<"==e)return c.tokenize=h(a+1),c.tokenize(b,c);if(">"==e){if(1==a){c.tokenize=d;break}return c.tokenize=h(a-1),c.tokenize(b,c)}}return"meta"}}function i(a,b,c){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=c,(z.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function j(a){a.context&&(a.context=a.context.prev)}function k(a,b){for(var c;;){if(!a.context)return;if(c=a.context.tagName,!z.contextGrabbers.hasOwnProperty(c)||!z.contextGrabbers[c].hasOwnProperty(b))return;j(a)}}function l(a,b,c){return"openTag"==a?(c.tagStart=b.column(),m):"closeTag"==a?n:l}function m(a,b,c){return"word"==a?(c.tagName=b.current(),y="tag",q):(y="error",m)}function n(a,b,c){if("word"==a){var d=b.current();return c.context&&c.context.tagName!=d&&z.implicitlyClosed.hasOwnProperty(c.context.tagName)&&j(c),c.context&&c.context.tagName==d?(y="tag",o):(y="tag error",p)}return y="error",p}function o(a,b,c){return"endTag"!=a?(y="error",o):(j(c),l)}function p(a,b,c){return y="error",o(a,b,c)}function q(a,b,c){if("word"==a)return y="attribute",r;if("endTag"==a||"selfcloseTag"==a){var d=c.tagName,e=c.tagStart;return c.tagName=c.tagStart=null,"selfcloseTag"==a||z.autoSelfClosers.hasOwnProperty(d)?k(c,d):(k(c,d),c.context=new i(c,d,e==c.indented)),l}return y="error",q}function r(a,b,c){return"equals"==a?s:(z.allowMissing||(y="error"),q(a,b,c))}function s(a,b,c){return"string"==a?t:"word"==a&&z.allowUnquoted?(y="string",q):(y="error",q(a,b,c))}function t(a,b,c){return"string"==a?t:q(a,b,c)}var u=b.indentUnit,v=c.multilineTagIndentFactor||1,w=c.multilineTagIndentPastTag;null==w&&(w=!0);var x,y,z=c.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},A=c.alignCDATA;return{startState:function(){return{tokenize:d,state:l,indented:0,tagName:null,tagStart:null,context:null}},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;x=null;var c=b.tokenize(a,b);return(c||x)&&"comment"!=c&&(y=null,b.state=b.state(x||c,a,b),y&&(c="error"==y?c+" error":y)),c},indent:function(b,c,f){var g=b.context;if(b.tokenize.isInAttribute)return b.tagStart==b.indented?b.stringStartCol+1:b.indented+u;if(g&&g.noIndent)return a.Pass;if(b.tokenize!=e&&b.tokenize!=d)return f?f.match(/^(\s*)/)[0].length:0;if(b.tagName)return w?b.tagStart+b.tagName.length+2:b.tagStart+u*v;if(A&&/$/,blockCommentStart:"",configuration:c.htmlMode?"html":"xml",helperType:c.htmlMode?"html":"xml"}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/xquery/test.js b/media/editors/codemirror/mode/xquery/test.js +deleted file mode 100644 +index 1f148cd..0000000 +--- a/media/editors/codemirror/mode/xquery/test.js ++++ /dev/null +@@ -1,67 +0,0 @@ +-// CodeMirror, copyright (c) by Marijn Haverbeke and others +-// Distributed under an MIT license: http://codemirror.net/LICENSE +- +-// Don't take these too seriously -- the expected results appear to be +-// based on the results of actual runs without any serious manual +-// verification. If a change you made causes them to fail, the test is +-// as likely to wrong as the code. +- +-(function() { +- var mode = CodeMirror.getMode({tabSize: 4}, "xquery"); +- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } +- +- MT("eviltest", +- "[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a \"comment\" :)]", +- " [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]", +- " [keyword let] [variable $joe][keyword :=][atom 1]", +- " [keyword return] [keyword element] [variable element] {", +- " [keyword attribute] [variable attribute] { [atom 1] },", +- " [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },", +- " [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],", +- " [keyword //][variable x] } [comment (: a more 'evil' test :)]", +- " [comment (: Modified Blakeley example (: with nested comment :) ... :)]", +- " [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]", +- " [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]", +- " [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]", +- " [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]", +- " [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]", +- " [keyword return] [keyword element] [variable element] {", +- " [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },", +- " [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },", +- " [keyword element] [variable text] { [keyword text] { [variable "text"] } },", +- " [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],", +- " [keyword //][variable fn:doc]", +- " }"); +- +- MT("testEmptySequenceKeyword", +- "[string \"foo\"] [keyword instance] [keyword of] [keyword empty-sequence]()"); +- +- MT("testMultiAttr", +- "[tag

    ][variable hello] [variable world][tag

    ]"); +- +- MT("test namespaced variable", +- "[keyword declare] [keyword namespace] [variable e] [keyword =] [string \"http://example.com/ANamespace\"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]"); +- +- MT("test EQName variable", +- "[keyword declare] [keyword variable] [variable $\"http://www.example.com/ns/my\":var] [keyword :=] [atom 12][variable ;]", +- "[tag ]{[variable $\"http://www.example.com/ns/my\":var]}[tag ]"); +- +- MT("test EQName function", +- "[keyword declare] [keyword function] [def&variable \"http://www.example.com/ns/my\":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", +- " [variable $a] [keyword +] [atom 2]", +- "}[variable ;]", +- "[tag ]{[def&variable \"http://www.example.com/ns/my\":fn]([atom 12])}[tag ]"); +- +- MT("test EQName function with single quotes", +- "[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", +- " [variable $a] [keyword +] [atom 2]", +- "}[variable ;]", +- "[tag ]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag ]"); +- +- MT("testProcessingInstructions", +- "[def&variable data]([comment&meta ]) [keyword instance] [keyword of] [atom xs:string]"); +- +- MT("testQuoteEscapeDouble", +- "[keyword let] [variable $rootfolder] [keyword :=] [string \"c:\\builds\\winnt\\HEAD\\qa\\scripts\\\"]", +- "[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string \"keys\\\"])"); +-})(); +diff --git a/media/editors/codemirror/mode/xquery/test.min.js b/media/editors/codemirror/mode/xquery/test.min.js +deleted file mode 100644 +index 9fa2f91..0000000 +--- a/media/editors/codemirror/mode/xquery/test.min.js ++++ /dev/null +@@ -1 +0,0 @@ +-!function(){function e(e){test.mode(e,a,Array.prototype.slice.call(arguments,1))}var a=CodeMirror.getMode({tabSize:4},"xquery");e("eviltest",'[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a "comment" :)]'," [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]"," [keyword let] [variable $joe][keyword :=][atom 1]"," [keyword return] [keyword element] [variable element] {"," [keyword attribute] [variable attribute] { [atom 1] },"," [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },"," [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],"," [keyword //][variable x] } [comment (: a more 'evil' test :)]"," [comment (: Modified Blakeley example (: with nested comment :) ... :)]"," [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]"," [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]"," [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]"," [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]"," [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]"," [keyword return] [keyword element] [variable element] {"," [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },"," [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },"," [keyword element] [variable text] { [keyword text] { [variable "text"] } },"," [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],"," [keyword //][variable fn:doc]"," }"),e("testEmptySequenceKeyword",'[string "foo"] [keyword instance] [keyword of] [keyword empty-sequence]()'),e("testMultiAttr",'[tag

    ][variable hello] [variable world][tag

    ]'),e("test namespaced variable",'[keyword declare] [keyword namespace] [variable e] [keyword =] [string "http://example.com/ANamespace"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]'),e("test EQName variable",'[keyword declare] [keyword variable] [variable $"http://www.example.com/ns/my":var] [keyword :=] [atom 12][variable ;]','[tag ]{[variable $"http://www.example.com/ns/my":var]}[tag ]'),e("test EQName function",'[keyword declare] [keyword function] [def&variable "http://www.example.com/ns/my":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {'," [variable $a] [keyword +] [atom 2]","}[variable ;]",'[tag ]{[def&variable "http://www.example.com/ns/my":fn]([atom 12])}[tag ]'),e("test EQName function with single quotes","[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {"," [variable $a] [keyword +] [atom 2]","}[variable ;]","[tag ]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag ]"),e("testProcessingInstructions","[def&variable data]([comment&meta ]) [keyword instance] [keyword of] [atom xs:string]"),e("testQuoteEscapeDouble",'[keyword let] [variable $rootfolder] [keyword :=] [string "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"]','[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string "keys\\"])')}(); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/xquery/xquery.js b/media/editors/codemirror/mode/xquery/xquery.js +index c8f3d90..c642ee5 100644 +--- a/media/editors/codemirror/mode/xquery/xquery.js ++++ b/media/editors/codemirror/mode/xquery/xquery.js +@@ -68,15 +68,6 @@ CodeMirror.defineMode("xquery", function() { + return kwObj; + }(); + +- // Used as scratch variables to communicate multiple values without +- // consing up tons of objects. +- var type, content; +- +- function ret(tp, style, cont) { +- type = tp; content = cont; +- return style; +- } +- + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); +@@ -95,7 +86,7 @@ CodeMirror.defineMode("xquery", function() { + + if(stream.match("![CDATA", false)) { + state.tokenize = tokenCDATA; +- return ret("tag", "tag"); ++ return "tag"; + } + + if(stream.match("?", false)) { +@@ -112,28 +103,28 @@ CodeMirror.defineMode("xquery", function() { + // start code block + else if(ch == "{") { + pushStateStack(state,{ type: "codeblock"}); +- return ret("", null); ++ return null; + } + // end code block + else if(ch == "}") { + popStateStack(state); +- return ret("", null); ++ return null; + } + // if we're in an XML block + else if(isInXmlBlock(state)) { + if(ch == ">") +- return ret("tag", "tag"); ++ return "tag"; + else if(ch == "/" && stream.eat(">")) { + popStateStack(state); +- return ret("tag", "tag"); ++ return "tag"; + } + else +- return ret("word", "variable"); ++ return "variable"; + } + // if a number + else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/); +- return ret("number", "atom"); ++ return "atom"; + } + // comment start + else if (ch === "(" && stream.eat(":")) { +@@ -149,27 +140,27 @@ CodeMirror.defineMode("xquery", function() { + } + // assignment + else if(ch ===":" && stream.eat("=")) { +- return ret("operator", "keyword"); ++ return "keyword"; + } + // open paren + else if(ch === "(") { + pushStateStack(state, { type: "paren"}); +- return ret("", null); ++ return null; + } + // close paren + else if(ch === ")") { + popStateStack(state); +- return ret("", null); ++ return null; + } + // open paren + else if(ch === "[") { + pushStateStack(state, { type: "bracket"}); +- return ret("", null); ++ return null; + } + // close paren + else if(ch === "]") { + popStateStack(state); +- return ret("", null); ++ return null; + } + else { + var known = keywords.propertyIsEnumerable(ch) && keywords[ch]; +@@ -204,15 +195,14 @@ CodeMirror.defineMode("xquery", function() { + // if the previous word was element, attribute, axis specifier, this word should be the name of that + if(isInXmlConstructor(state)) { + popStateStack(state); +- return ret("word", "variable", word); ++ return "variable"; + } + // as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and + // push the stack so we know to look for it on the next word + if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"}); + + // if the word is known, return the details of that else just call this a generic 'word' +- return known ? ret(known.type, known.style, word) : +- ret("word", "variable", word); ++ return known ? known.style : "variable"; + } + } + +@@ -235,7 +225,7 @@ CodeMirror.defineMode("xquery", function() { + maybeNested = (ch == "("); + } + +- return ret("comment", "comment"); ++ return "comment"; + } + + // tokenizer for string literals +@@ -247,7 +237,7 @@ CodeMirror.defineMode("xquery", function() { + if(isInString(state) && stream.current() == quote) { + popStateStack(state); + if(f) state.tokenize = f; +- return ret("string", "string"); ++ return "string"; + } + + pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) }); +@@ -255,7 +245,7 @@ CodeMirror.defineMode("xquery", function() { + // if we're in a string and in an XML block, allow an embedded code block + if(stream.match("{", false) && isInXmlAttributeBlock(state)) { + state.tokenize = tokenBase; +- return ret("string", "string"); ++ return "string"; + } + + +@@ -269,13 +259,13 @@ CodeMirror.defineMode("xquery", function() { + // if we're in a string and in an XML block, allow an embedded code block in an attribute + if(stream.match("{", false) && isInXmlAttributeBlock(state)) { + state.tokenize = tokenBase; +- return ret("string", "string"); ++ return "string"; + } + + } + } + +- return ret("string", "string"); ++ return "string"; + }; + } + +@@ -293,7 +283,7 @@ CodeMirror.defineMode("xquery", function() { + } + stream.eatWhile(isVariableChar); + state.tokenize = tokenBase; +- return ret("variable", "variable"); ++ return "variable"; + } + + // tokenizer for XML tags +@@ -303,19 +293,19 @@ CodeMirror.defineMode("xquery", function() { + if(isclose && stream.eat(">")) { + popStateStack(state); + state.tokenize = tokenBase; +- return ret("tag", "tag"); ++ return "tag"; + } + // self closing tag without attributes? + if(!stream.eat("/")) + pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase}); + if(!stream.eat(">")) { + state.tokenize = tokenAttribute; +- return ret("tag", "tag"); ++ return "tag"; + } + else { + state.tokenize = tokenBase; + } +- return ret("tag", "tag"); ++ return "tag"; + }; + } + +@@ -326,14 +316,14 @@ CodeMirror.defineMode("xquery", function() { + if(ch == "/" && stream.eat(">")) { + if(isInXmlAttributeBlock(state)) popStateStack(state); + if(isInXmlBlock(state)) popStateStack(state); +- return ret("tag", "tag"); ++ return "tag"; + } + if(ch == ">") { + if(isInXmlAttributeBlock(state)) popStateStack(state); +- return ret("tag", "tag"); ++ return "tag"; + } + if(ch == "=") +- return ret("", null); ++ return null; + // quoted string + if (ch == '"' || ch == "'") + return chain(stream, state, tokenString(ch, tokenAttribute)); +@@ -351,7 +341,7 @@ CodeMirror.defineMode("xquery", function() { + state.tokenize = tokenBase; + } + +- return ret("attribute", "attribute"); ++ return "attribute"; + } + + // handle comments, including nested +@@ -360,7 +350,7 @@ CodeMirror.defineMode("xquery", function() { + while (ch = stream.next()) { + if (ch == "-" && stream.match("->", true)) { + state.tokenize = tokenBase; +- return ret("comment", "comment"); ++ return "comment"; + } + } + } +@@ -372,7 +362,7 @@ CodeMirror.defineMode("xquery", function() { + while (ch = stream.next()) { + if (ch == "]" && stream.match("]", true)) { + state.tokenize = tokenBase; +- return ret("comment", "comment"); ++ return "comment"; + } + } + } +@@ -383,7 +373,7 @@ CodeMirror.defineMode("xquery", function() { + while (ch = stream.next()) { + if (ch == "?" && stream.match(">", true)) { + state.tokenize = tokenBase; +- return ret("comment", "comment meta"); ++ return "comment meta"; + } + } + } +diff --git a/media/editors/codemirror/mode/xquery/xquery.min.js b/media/editors/codemirror/mode/xquery/xquery.min.js +index b5ee70cb..0332102 100644 +--- a/media/editors/codemirror/mode/xquery/xquery.min.js ++++ b/media/editors/codemirror/mode/xquery/xquery.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("xquery",function(){function e(e,t,n){return b=e,k=n,t}function t(e,t,n){return t.tokenize=n,n(e,t)}function n(n,c){var m=n.next(),p=!1,y=g(n);if("<"==m){if(n.match("!--",!0))return t(n,c,u);if(n.match("![CDATA",!1))return c.tokenize=s,e("tag","tag");if(n.match("?",!1))return t(n,c,f);var b=n.eat("/");n.eatSpace();for(var k,z="";k=n.eat(/[^\s\u00a0=<>\"\'\/?]/);)z+=k;return t(n,c,o(z,b))}if("{"==m)return h(c,{type:"codeblock"}),e("",null);if("}"==m)return x(c),e("",null);if(l(c))return">"==m?e("tag","tag"):"/"==m&&n.eat(">")?(x(c),e("tag","tag")):e("word","variable");if(/\d/.test(m))return n.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),e("number","atom");if("("===m&&n.eat(":"))return h(c,{type:"comment"}),t(n,c,r);if(y||'"'!==m&&"'"!==m){if("$"===m)return t(n,c,i);if(":"===m&&n.eat("="))return e("operator","keyword");if("("===m)return h(c,{type:"paren"}),e("",null);if(")"===m)return x(c),e("",null);if("["===m)return h(c,{type:"bracket"}),e("",null);if("]"===m)return x(c),e("",null);var w=v.propertyIsEnumerable(m)&&v[m];if(y&&'"'===m)for(;'"'!==n.next(););if(y&&"'"===m)for(;"'"!==n.next(););w||n.eatWhile(/[\w\$_-]/);var q=n.eat(":");!n.eat(":")&&q&&n.eatWhile(/[\w\$_-]/),n.match(/^[ \t]*\(/,!1)&&(p=!0);var _=n.current();return w=v.propertyIsEnumerable(_)&&v[_],p&&!w&&(w={type:"function_call",style:"variable def"}),d(c)?(x(c),e("word","variable",_)):(("element"==_||"attribute"==_||"axis_specifier"==w.type)&&h(c,{type:"xmlconstructor"}),w?e(w.type,w.style,_):e("word","variable",_))}return t(n,c,a(m))}function r(t,n){for(var r,a=!1,i=!1,o=0;r=t.next();){if(")"==r&&a){if(!(o>0)){x(n);break}o--}else":"==r&&i&&o++;a=":"==r,i="("==r}return e("comment","comment")}function a(t,r){return function(i,o){var c;if(p(o)&&i.current()==t)return x(o),r&&(o.tokenize=r),e("string","string");if(h(o,{type:"string",name:t,tokenize:a(t,r)}),i.match("{",!1)&&m(o))return o.tokenize=n,e("string","string");for(;c=i.next();){if(c==t){x(o),r&&(o.tokenize=r);break}if(i.match("{",!1)&&m(o))return o.tokenize=n,e("string","string")}return e("string","string")}}function i(t,r){var a=/[\w\$_-]/;if(t.eat('"')){for(;'"'!==t.next(););t.eat(":")}else t.eatWhile(a),t.match(":=",!1)||t.eat(":");return t.eatWhile(a),r.tokenize=n,e("variable","variable")}function o(t,r){return function(a,i){return a.eatSpace(),r&&a.eat(">")?(x(i),i.tokenize=n,e("tag","tag")):(a.eat("/")||h(i,{type:"tag",name:t,tokenize:n}),a.eat(">")?(i.tokenize=n,e("tag","tag")):(i.tokenize=c,e("tag","tag")))}}function c(r,i){var o=r.next();return"/"==o&&r.eat(">")?(m(i)&&x(i),l(i)&&x(i),e("tag","tag")):">"==o?(m(i)&&x(i),e("tag","tag")):"="==o?e("",null):'"'==o||"'"==o?t(r,i,a(o,c)):(m(i)||h(i,{type:"attribute",tokenize:c}),r.eat(/[a-zA-Z_:]/),r.eatWhile(/[-a-zA-Z0-9_:.]/),r.eatSpace(),(r.match(">",!1)||r.match("/",!1))&&(x(i),i.tokenize=n),e("attribute","attribute"))}function u(t,r){for(var a;a=t.next();)if("-"==a&&t.match("->",!0))return r.tokenize=n,e("comment","comment")}function s(t,r){for(var a;a=t.next();)if("]"==a&&t.match("]",!0))return r.tokenize=n,e("comment","comment")}function f(t,r){for(var a;a=t.next();)if("?"==a&&t.match(">",!0))return r.tokenize=n,e("comment","comment meta")}function l(e){return y(e,"tag")}function m(e){return y(e,"attribute")}function d(e){return y(e,"xmlconstructor")}function p(e){return y(e,"string")}function g(e){return'"'===e.current()?e.match(/^[^\"]+\"\:/,!1):"'"===e.current()?e.match(/^[^\"]+\'\:/,!1):!1}function y(e,t){return e.stack.length&&e.stack[e.stack.length-1].type==t}function h(e,t){e.stack.push(t)}function x(e){e.stack.pop();var t=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=t||n}var b,k,v=function(){function e(e){return{type:e,style:"keyword"}}for(var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),a=e("operator"),i={type:"atom",style:"atom"},o={type:"punctuation",style:null},c={type:"axis_specifier",style:"qualifier"},u={"if":t,"switch":t,"while":t,"for":t,"else":n,then:n,"try":n,"finally":n,"catch":n,element:r,attribute:r,let:r,"implements":r,"import":r,module:r,namespace:r,"return":r,"super":r,"this":r,"throws":r,where:r,"private":r,",":o,"null":i,"fn:false()":i,"fn:true()":i},s=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"],f=0,l=s.length;l>f;f++)u[s[f]]=e(s[f]);for(var m=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"],f=0,l=m.length;l>f;f++)u[m[f]]=i;for(var d=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"],f=0,l=d.length;l>f;f++)u[d[f]]=a;for(var p=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"],f=0,l=p.length;l>f;f++)u[p[f]]=c;return u}();return{startState:function(){return{tokenize:n,cc:[],stack:[]}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},blockCommentStart:"(:",blockCommentEnd:":)"}}),e.defineMIME("application/xquery","xquery")}); +\ 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("xquery",function(){function a(a,b,c){return b.tokenize=c,c(a,b)}function b(b,g){var l=b.next(),n=!1,p=o(b);if("<"==l){if(b.match("!--",!0))return a(b,g,h);if(b.match("![CDATA",!1))return g.tokenize=i,"tag";if(b.match("?",!1))return a(b,g,j);var t=b.eat("/");b.eatSpace();for(var u,v="";u=b.eat(/[^\s\u00a0=<>\"\'\/?]/);)v+=u;return a(b,g,f(v,t))}if("{"==l)return q(g,{type:"codeblock"}),null;if("}"==l)return r(g),null;if(k(g))return">"==l?"tag":"/"==l&&b.eat(">")?(r(g),"tag"):"variable";if(/\d/.test(l))return b.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),"atom";if("("===l&&b.eat(":"))return q(g,{type:"comment"}),a(b,g,c);if(p||'"'!==l&&"'"!==l){if("$"===l)return a(b,g,e);if(":"===l&&b.eat("="))return"keyword";if("("===l)return q(g,{type:"paren"}),null;if(")"===l)return r(g),null;if("["===l)return q(g,{type:"bracket"}),null;if("]"===l)return r(g),null;var w=s.propertyIsEnumerable(l)&&s[l];if(p&&'"'===l)for(;'"'!==b.next(););if(p&&"'"===l)for(;"'"!==b.next(););w||b.eatWhile(/[\w\$_-]/);var x=b.eat(":");!b.eat(":")&&x&&b.eatWhile(/[\w\$_-]/),b.match(/^[ \t]*\(/,!1)&&(n=!0);var y=b.current();return w=s.propertyIsEnumerable(y)&&s[y],n&&!w&&(w={type:"function_call",style:"variable def"}),m(g)?(r(g),"variable"):(("element"==y||"attribute"==y||"axis_specifier"==w.type)&&q(g,{type:"xmlconstructor"}),w?w.style:"variable")}return a(b,g,d(l))}function c(a,b){for(var c,d=!1,e=!1,f=0;c=a.next();){if(")"==c&&d){if(!(f>0)){r(b);break}f--}else":"==c&&e&&f++;d=":"==c,e="("==c}return"comment"}function d(a,c){return function(e,f){var g;if(n(f)&&e.current()==a)return r(f),c&&(f.tokenize=c),"string";if(q(f,{type:"string",name:a,tokenize:d(a,c)}),e.match("{",!1)&&l(f))return f.tokenize=b,"string";for(;g=e.next();){if(g==a){r(f),c&&(f.tokenize=c);break}if(e.match("{",!1)&&l(f))return f.tokenize=b,"string"}return"string"}}function e(a,c){var d=/[\w\$_-]/;if(a.eat('"')){for(;'"'!==a.next(););a.eat(":")}else a.eatWhile(d),a.match(":=",!1)||a.eat(":");return a.eatWhile(d),c.tokenize=b,"variable"}function f(a,c){return function(d,e){return d.eatSpace(),c&&d.eat(">")?(r(e),e.tokenize=b,"tag"):(d.eat("/")||q(e,{type:"tag",name:a,tokenize:b}),d.eat(">")?(e.tokenize=b,"tag"):(e.tokenize=g,"tag"))}}function g(c,e){var f=c.next();return"/"==f&&c.eat(">")?(l(e)&&r(e),k(e)&&r(e),"tag"):">"==f?(l(e)&&r(e),"tag"):"="==f?null:'"'==f||"'"==f?a(c,e,d(f,g)):(l(e)||q(e,{type:"attribute",tokenize:g}),c.eat(/[a-zA-Z_:]/),c.eatWhile(/[-a-zA-Z0-9_:.]/),c.eatSpace(),(c.match(">",!1)||c.match("/",!1))&&(r(e),e.tokenize=b),"attribute")}function h(a,c){for(var d;d=a.next();)if("-"==d&&a.match("->",!0))return c.tokenize=b,"comment"}function i(a,c){for(var d;d=a.next();)if("]"==d&&a.match("]",!0))return c.tokenize=b,"comment"}function j(a,c){for(var d;d=a.next();)if("?"==d&&a.match(">",!0))return c.tokenize=b,"comment meta"}function k(a){return p(a,"tag")}function l(a){return p(a,"attribute")}function m(a){return p(a,"xmlconstructor")}function n(a){return p(a,"string")}function o(a){return'"'===a.current()?a.match(/^[^\"]+\"\:/,!1):"'"===a.current()?a.match(/^[^\"]+\'\:/,!1):!1}function p(a,b){return a.stack.length&&a.stack[a.stack.length-1].type==b}function q(a,b){a.stack.push(b)}function r(a){a.stack.pop();var c=a.stack.length&&a.stack[a.stack.length-1].tokenize;a.tokenize=c||b}var s=function(){function a(a){return{type:a,style:"keyword"}}for(var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"atom"},g={type:"punctuation",style:null},h={type:"axis_specifier",style:"qualifier"},i={"if":b,"switch":b,"while":b,"for":b,"else":c,then:c,"try":c,"finally":c,"catch":c,element:d,attribute:d,let:d,"implements":d,"import":d,module:d,namespace:d,"return":d,"super":d,"this":d,"throws":d,where:d,"private":d,",":g,"null":f,"fn:false()":f,"fn:true()":f},j=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"],k=0,l=j.length;l>k;k++)i[j[k]]=a(j[k]);for(var m=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"],k=0,l=m.length;l>k;k++)i[m[k]]=f;for(var n=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"],k=0,l=n.length;l>k;k++)i[n[k]]=e;for(var o=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"],k=0,l=o.length;l>k;k++)i[o[k]]=h;return i}();return{startState:function(){return{tokenize:b,cc:[],stack:[]}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c},blockCommentStart:"(:",blockCommentEnd:":)"}}),a.defineMIME("application/xquery","xquery")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/yaml/yaml.min.js b/media/editors/codemirror/mode/yaml/yaml.min.js +index d435782..1d44a82 100644 +--- a/media/editors/codemirror/mode/yaml/yaml.min.js ++++ b/media/editors/codemirror/mode/yaml/yaml.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],i=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,t){var r=e.peek(),n=t.escaped;if(t.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(t.literal&&e.indentation()>t.keyCol)return e.skipToEnd(),"string";if(t.literal&&(t.literal=!1),e.sol()){if(t.keyCol=0,t.pair=!1,t.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?t.inlinePairs++:"}"==r?t.inlinePairs--:"["==r?t.inlineList++:t.inlineList--,"meta";if(t.inlineList>0&&!n&&","==r)return e.next(),"meta";if(t.inlinePairs>0&&!n&&","==r)return t.keyCol=0,t.pair=!1,t.pairStart=!1,e.next(),"meta";if(t.pairStart){if(e.match(/^\s*(\||\>)\s*/))return t.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==t.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(t.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(i))return"keyword"}return!t.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(t.pair=!0,t.keyCol=e.indentation(),"atom"):t.pair&&e.match(/^:\s*/)?(t.pairStart=!0,"meta"):(t.pairStart=!1,t.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}); +\ 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("yaml",function(){var a=["true","false","on","off","yes","no"],b=new RegExp("\\b(("+a.join(")|(")+"))$","i");return{token:function(a,c){var d=a.peek(),e=c.escaped;if(c.escaped=!1,"#"==d&&(0==a.pos||/\s/.test(a.string.charAt(a.pos-1))))return a.skipToEnd(),"comment";if(a.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(c.literal&&a.indentation()>c.keyCol)return a.skipToEnd(),"string";if(c.literal&&(c.literal=!1),a.sol()){if(c.keyCol=0,c.pair=!1,c.pairStart=!1,a.match(/---/))return"def";if(a.match(/\.\.\./))return"def";if(a.match(/\s*-\s+/))return"meta"}if(a.match(/^(\{|\}|\[|\])/))return"{"==d?c.inlinePairs++:"}"==d?c.inlinePairs--:"["==d?c.inlineList++:c.inlineList--,"meta";if(c.inlineList>0&&!e&&","==d)return a.next(),"meta";if(c.inlinePairs>0&&!e&&","==d)return c.keyCol=0,c.pair=!1,c.pairStart=!1,a.next(),"meta";if(c.pairStart){if(a.match(/^\s*(\||\>)\s*/))return c.literal=!0,"meta";if(a.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==c.inlinePairs&&a.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(c.inlinePairs>0&&a.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(a.match(b))return"keyword"}return!c.pair&&a.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(c.pair=!0,c.keyCol=a.indentation(),"atom"):c.pair&&a.match(/^:\s*/)?(c.pairStart=!0,"meta"):(c.pairStart=!1,c.escaped="\\"==d,a.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),a.defineMIME("text/x-yaml","yaml")}); +\ No newline at end of file +diff --git a/media/editors/codemirror/mode/z80/z80.js b/media/editors/codemirror/mode/z80/z80.js +index ec41d05..aae7021 100644 +--- a/media/editors/codemirror/mode/z80/z80.js ++++ b/media/editors/codemirror/mode/z80/z80.js +@@ -3,26 +3,35 @@ + + (function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS +- mod(require("../../lib/codemirror")); ++ mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD +- define(["../../lib/codemirror"], mod); ++ define(["../../lib/codemirror"], mod); + else // Plain browser env +- mod(CodeMirror); ++ mod(CodeMirror); + })(function(CodeMirror) { + "use strict"; + +-CodeMirror.defineMode('z80', function() { +- var keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; +- var keywords2 = /^(call|j[pr]|ret[in]?)\b/i; +- var keywords3 = /^b_?(call|jump)\b/i; ++CodeMirror.defineMode('z80', function(_config, parserConfig) { ++ var ez80 = parserConfig.ez80; ++ var keywords1, keywords2; ++ if (ez80) { ++ keywords1 = /^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i; ++ keywords2 = /^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i; ++ } else { ++ keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; ++ keywords2 = /^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i; ++ } ++ + var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i; + var variables2 = /^(n?[zc]|p[oe]?|m)\b/i; + var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i; +- var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i; ++ var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i; + + return { + startState: function() { +- return {context: 0}; ++ return { ++ context: 0 ++ }; + }, + token: function(stream, state) { + if (!stream.column()) +@@ -34,14 +43,21 @@ CodeMirror.defineMode('z80', function() { + var w; + + if (stream.eatWhile(/\w/)) { ++ if (ez80 && stream.eat('.')) { ++ stream.eatWhile(/\w/); ++ } + w = stream.current(); + + if (stream.indentation()) { +- if (state.context == 1 && variables1.test(w)) +- return 'variable-2'; ++ if ((state.context == 1 || state.context == 4) && variables1.test(w)) { ++ state.context = 4; ++ return 'var2'; ++ } + +- if (state.context == 2 && variables2.test(w)) +- return 'variable-3'; ++ if (state.context == 2 && variables2.test(w)) { ++ state.context = 4; ++ return 'var3'; ++ } + + if (keywords1.test(w)) { + state.context = 1; +@@ -49,14 +65,13 @@ CodeMirror.defineMode('z80', function() { + } else if (keywords2.test(w)) { + state.context = 2; + return 'keyword'; +- } else if (keywords3.test(w)) { +- state.context = 3; +- return 'keyword'; ++ } else if (state.context == 4 && numbers.test(w)) { ++ return 'number'; + } + + if (errors.test(w)) + return 'error'; +- } else if (numbers.test(w)) { ++ } else if (stream.match(numbers)) { + return 'number'; + } else { + return null; +@@ -77,7 +92,7 @@ CodeMirror.defineMode('z80', function() { + if (stream.match(/\\?.'/)) + return 'number'; + } else if (stream.eat('.') || stream.sol() && stream.eat('#')) { +- state.context = 4; ++ state.context = 5; + + if (stream.eatWhile(/\w/)) + return 'def'; +@@ -96,5 +111,6 @@ CodeMirror.defineMode('z80', function() { + }); + + CodeMirror.defineMIME("text/x-z80", "z80"); ++CodeMirror.defineMIME("text/x-ez80", { name: "z80", ez80: true }); + + }); +diff --git a/media/editors/codemirror/mode/z80/z80.min.js b/media/editors/codemirror/mode/z80/z80.min.js +index 8c8b86c..d8eaea4 100644 +--- a/media/editors/codemirror/mode/z80/z80.min.js ++++ b/media/editors/codemirror/mode/z80/z80.min.js +@@ -1 +1 @@ +-!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("z80",function(){var e=/^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i,t=/^(call|j[pr]|ret[in]?)\b/i,r=/^b_?(call|jump)\b/i,n=/^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i,i=/^(n?[zc]|p[oe]?|m)\b/i,o=/^([hl][xy]|i[xy][hl]|slia|sll)\b/i,l=/^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i;return{startState:function(){return{context:0}},token:function(f,u){if(f.column()||(u.context=0),f.eatSpace())return null;var c;if(f.eatWhile(/\w/)){if(c=f.current(),!f.indentation())return l.test(c)?"number":null;if(1==u.context&&n.test(c))return"variable-2";if(2==u.context&&i.test(c))return"variable-3";if(e.test(c))return u.context=1,"keyword";if(t.test(c))return u.context=2,"keyword";if(r.test(c))return u.context=3,"keyword";if(o.test(c))return"error"}else{if(f.eat(";"))return f.skipToEnd(),"comment";if(f.eat('"')){for(;(c=f.next())&&'"'!=c;)"\\"==c&&f.next();return"string"}if(f.eat("'")){if(f.match(/\\?.'/))return"number"}else if(f.eat(".")||f.sol()&&f.eat("#")){if(u.context=4,f.eatWhile(/\w/))return"def"}else if(f.eat("$")){if(f.eatWhile(/[\da-f]/i))return"number"}else if(f.eat("%")){if(f.eatWhile(/[01]/))return"number"}else f.next()}return null}}}),e.defineMIME("text/x-z80","z80")}); +\ 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("z80",function(a,b){var c,d,e=b.ez80;e?(c=/^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i,d=/^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i):(c=/^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i,d=/^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i);var f=/^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i,g=/^(n?[zc]|p[oe]?|m)\b/i,h=/^([hl][xy]|i[xy][hl]|slia|sll)\b/i,i=/^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i;return{startState:function(){return{context:0}},token:function(a,b){if(a.column()||(b.context=0),a.eatSpace())return null;var j;if(a.eatWhile(/\w/)){if(e&&a.eat(".")&&a.eatWhile(/\w/),j=a.current(),!a.indentation())return a.match(i)?"number":null;if((1==b.context||4==b.context)&&f.test(j))return b.context=4,"var2";if(2==b.context&&g.test(j))return b.context=4,"var3";if(c.test(j))return b.context=1,"keyword";if(d.test(j))return b.context=2,"keyword";if(4==b.context&&i.test(j))return"number";if(h.test(j))return"error"}else{if(a.eat(";"))return a.skipToEnd(),"comment";if(a.eat('"')){for(;(j=a.next())&&'"'!=j;)"\\"==j&&a.next();return"string"}if(a.eat("'")){if(a.match(/\\?.'/))return"number"}else if(a.eat(".")||a.sol()&&a.eat("#")){if(b.context=5,a.eatWhile(/\w/))return"def"}else if(a.eat("$")){if(a.eatWhile(/[\da-f]/i))return"number"}else if(a.eat("%")){if(a.eatWhile(/[01]/))return"number"}else a.next()}return null}}}),a.defineMIME("text/x-z80","z80"),a.defineMIME("text/x-ez80",{name:"z80",ez80:!0})}); +\ No newline at end of file +diff --git a/media/editors/codemirror/theme/liquibyte.css b/media/editors/codemirror/theme/liquibyte.css +new file mode 100644 +index 0000000..a6e070c +--- /dev/null ++++ b/media/editors/codemirror/theme/liquibyte.css +@@ -0,0 +1,95 @@ ++.cm-s-liquibyte.CodeMirror { ++ background-color: #000; ++ color: #fff; ++ line-height: 1.2em; ++ font-size: 1em; ++} ++.CodeMirror-focused .cm-matchhighlight { ++ text-decoration: underline; ++ text-decoration-color: #0f0; ++ text-decoration-style: wavy; ++} ++.cm-trailingspace { ++ text-decoration: line-through; ++ text-decoration-color: #f00; ++ text-decoration-style: dotted; ++} ++.cm-tab { ++ text-decoration: line-through; ++ text-decoration-color: #404040; ++ text-decoration-style: dotted; ++} ++.cm-s-liquibyte .CodeMirror-gutters { background-color: #262626; border-right: 1px solid #505050; padding-right: 0.8em; } ++.cm-s-liquibyte .CodeMirror-gutter-elt div{ font-size: 1.2em; } ++.cm-s-liquibyte .CodeMirror-guttermarker { } ++.cm-s-liquibyte .CodeMirror-guttermarker-subtle { } ++.cm-s-liquibyte .CodeMirror-linenumber { color: #606060; padding-left: 0;} ++.cm-s-liquibyte .CodeMirror-cursor { border-left: 1px solid #eee !important; } ++ ++.cm-s-liquibyte span.cm-comment { color: #008000; } ++.cm-s-liquibyte span.cm-def { color: #ffaf40; font-weight: bold; } ++.cm-s-liquibyte span.cm-keyword { color: #c080ff; font-weight: bold; } ++.cm-s-liquibyte span.cm-builtin { color: #ffaf40; font-weight: bold; } ++.cm-s-liquibyte span.cm-variable { color: #5967ff; font-weight: bold; } ++.cm-s-liquibyte span.cm-string { color: #ff8000; } ++.cm-s-liquibyte span.cm-number { color: #0f0; font-weight: bold; } ++.cm-s-liquibyte span.cm-atom { color: #bf3030; font-weight: bold; } ++ ++.cm-s-liquibyte span.cm-variable-2 { color: #007f7f; font-weight: bold; } ++.cm-s-liquibyte span.cm-variable-3 { color: #c080ff; font-weight: bold; } ++.cm-s-liquibyte span.cm-property { color: #999; font-weight: bold; } ++.cm-s-liquibyte span.cm-operator { color: #fff; } ++ ++.cm-s-liquibyte span.cm-meta { color: #0f0; } ++.cm-s-liquibyte span.cm-qualifier { color: #fff700; font-weight: bold; } ++.cm-s-liquibyte span.cm-bracket { color: #cc7; } ++.cm-s-liquibyte span.cm-tag { color: #ff0; font-weight: bold; } ++.cm-s-liquibyte span.cm-attribute { color: #c080ff; font-weight: bold; } ++.cm-s-liquibyte span.cm-error { color: #f00; } ++ ++.cm-s-liquibyte .CodeMirror-selected { background-color: rgba(255, 0, 0, 0.25) !important; } ++ ++.cm-s-liquibyte span.cm-compilation { background-color: rgba(255, 255, 255, 0.12); } ++ ++.cm-s-liquibyte .CodeMirror-activeline-background {background-color: rgba(0, 255, 0, 0.15) !important;} ++ ++/* Default styles for common addons */ ++div.CodeMirror span.CodeMirror-matchingbracket { color: #0f0; font-weight: bold; } ++div.CodeMirror span.CodeMirror-nonmatchingbracket { color: #f00; font-weight: bold; } ++.CodeMirror-matchingtag { background-color: rgba(150, 255, 0, .3); } ++/* Scrollbars */ ++/* Simple */ ++div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover { ++ background-color: rgba(80, 80, 80, .7); ++} ++div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div { ++ background-color: rgba(80, 80, 80, .3); ++ border: 1px solid #404040; ++ border-radius: 5px; ++} ++div.CodeMirror-simplescroll-vertical div { ++ border-top: 1px solid #404040; ++ border-bottom: 1px solid #404040; ++} ++div.CodeMirror-simplescroll-horizontal div { ++ border-left: 1px solid #404040; ++ border-right: 1px solid #404040; ++} ++div.CodeMirror-simplescroll-vertical { ++ background-color: #262626; ++} ++div.CodeMirror-simplescroll-horizontal { ++ background-color: #262626; ++ border-top: 1px solid #404040; ++} ++/* Overlay */ ++div.CodeMirror-overlayscroll-horizontal div, div.CodeMirror-overlayscroll-vertical div { ++ background-color: #404040; ++ border-radius: 5px; ++} ++div.CodeMirror-overlayscroll-vertical div { ++ border: 1px solid #404040; ++} ++div.CodeMirror-overlayscroll-horizontal div { ++ border: 1px solid #404040; ++} +diff --git a/media/editors/codemirror/theme/mdn-like.css b/media/editors/codemirror/theme/mdn-like.css +index 93293c0..9c73dc2 100644 +--- a/media/editors/codemirror/theme/mdn-like.css ++++ b/media/editors/codemirror/theme/mdn-like.css +@@ -13,7 +13,7 @@ + .cm-s-mdn-like.CodeMirror ::-moz-selection { background: #cfc; } + + .cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; } +-.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; margin-left: 3px; } ++.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; padding-left: 8px; } + div.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; } + + .cm-s-mdn-like .cm-keyword { color: #6262FF; } +diff --git a/media/editors/codemirror/theme/monokai.css b/media/editors/codemirror/theme/monokai.css +index 6dfcc73..9b9a6f3 100644 +--- a/media/editors/codemirror/theme/monokai.css ++++ b/media/editors/codemirror/theme/monokai.css +@@ -18,8 +18,9 @@ + .cm-s-monokai span.cm-keyword {color: #f92672;} + .cm-s-monokai span.cm-string {color: #e6db74;} + +-.cm-s-monokai span.cm-variable {color: #a6e22e;} ++.cm-s-monokai span.cm-variable {color: #f8f8f2;} + .cm-s-monokai span.cm-variable-2 {color: #9effff;} ++.cm-s-monokai span.cm-variable-3 {color: #66d9ef;} + .cm-s-monokai span.cm-def {color: #fd971f;} + .cm-s-monokai span.cm-bracket {color: #f8f8f2;} + .cm-s-monokai span.cm-tag {color: #f92672;} +diff --git a/media/editors/codemirror/theme/solarized.css b/media/editors/codemirror/theme/solarized.css +index 4a10b7c..9db3951 100644 +--- a/media/editors/codemirror/theme/solarized.css ++++ b/media/editors/codemirror/theme/solarized.css +@@ -53,7 +53,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png + .cm-s-solarized .cm-number { color: #d33682; } + .cm-s-solarized .cm-def { color: #2aa198; } + +-.cm-s-solarized .cm-variable { color: #268bd2; } ++.cm-s-solarized .cm-variable { color: #839496; } + .cm-s-solarized .cm-variable-2 { color: #b58900; } + .cm-s-solarized .cm-variable-3 { color: #6c71c4; } + +diff --git a/media/editors/codemirror/theme/ttcn.css b/media/editors/codemirror/theme/ttcn.css +new file mode 100644 +index 0000000..959c047 +--- /dev/null ++++ b/media/editors/codemirror/theme/ttcn.css +@@ -0,0 +1,66 @@ ++/* DEFAULT THEME */ ++.cm-atom {color: #219;} ++.cm-attribute {color: #00c;} ++.cm-bracket {color: #997;} ++.cm-comment {color: #333333;} ++.cm-def {color: #00f;} ++.cm-em {font-style: italic;} ++.cm-error {color: #f00;} ++.cm-header {color: #00f; font-weight: bold;} ++.cm-hr {color: #999;} ++.cm-invalidchar {color: #f00;} ++.cm-keyword {font-weight:bold} ++.cm-link {color: #00c; text-decoration: underline;} ++.cm-meta {color: #555;} ++.cm-negative {color: #d44;} ++.cm-positive {color: #292;} ++.cm-qualifier {color: #555;} ++.cm-quote {color: #090;} ++.cm-strikethrough {text-decoration: line-through;} ++.cm-string {color: #006400;} ++.cm-string-2 {color: #f50;} ++.cm-strong {font-weight: bold;} ++.cm-tag {color: #170;} ++.cm-variable {color: #8B2252;} ++.cm-variable-2 {color: #05a;} ++.cm-variable-3 {color: #085;} ++ ++.cm-negative {color: #d44;} ++.cm-positive {color: #292;} ++.cm-header, .cm-strong {font-weight: bold;} ++.cm-em {font-style: italic;} ++.cm-link {text-decoration: underline;} ++.cm-strikethrough {text-decoration: line-through;} ++ ++.cm-s-default .cm-error {color: #f00;} ++.cm-invalidchar {color: #f00;} ++ ++/* ASN */ ++.cm-s-ttcn .cm-accessTypes, ++.cm-s-ttcn .cm-compareTypes {color: #27408B} ++.cm-s-ttcn .cm-cmipVerbs {color: #8B2252} ++.cm-s-ttcn .cm-modifier {color:#D2691E} ++.cm-s-ttcn .cm-status {color:#8B4545} ++.cm-s-ttcn .cm-storage {color:#A020F0} ++.cm-s-ttcn .cm-tags {color:#006400} ++ ++/* CFG */ ++.cm-s-ttcn .cm-externalCommands {color: #8B4545; font-weight:bold} ++.cm-s-ttcn .cm-fileNCtrlMaskOptions, ++.cm-s-ttcn .cm-sectionTitle {color: #2E8B57; font-weight:bold} ++ ++/* TTCN */ ++.cm-s-ttcn .cm-booleanConsts, ++.cm-s-ttcn .cm-otherConsts, ++.cm-s-ttcn .cm-verdictConsts {color: #006400} ++.cm-s-ttcn .cm-configOps, ++.cm-s-ttcn .cm-functionOps, ++.cm-s-ttcn .cm-portOps, ++.cm-s-ttcn .cm-sutOps, ++.cm-s-ttcn .cm-timerOps, ++.cm-s-ttcn .cm-verdictOps {color: #0000FF} ++.cm-s-ttcn .cm-preprocessor, ++.cm-s-ttcn .cm-templateMatch, ++.cm-s-ttcn .cm-ttcn3Macros {color: #27408B} ++.cm-s-ttcn .cm-types {color: #A52A2A; font-weight:bold} ++.cm-s-ttcn .cm-visibilityModifiers {font-weight:bold} +diff --git a/plugins/editors/codemirror/codemirror.xml b/plugins/editors/codemirror/codemirror.xml +index 366605f..1255d17 100644 +--- a/plugins/editors/codemirror/codemirror.xml ++++ b/plugins/editors/codemirror/codemirror.xml +@@ -1,7 +1,7 @@ + + + plg_editors_codemirror +- 5.0 ++ 5.3 + 28 March 2011 + Marijn Haverbeke + marijnh@gmail.com diff --git a/media/editors/codemirror/lib/addons.css b/media/editors/codemirror/lib/addons.css new file mode 100644 index 0000000000000..cd6f285bdcc89 --- /dev/null +++ b/media/editors/codemirror/lib/addons.css @@ -0,0 +1,94 @@ +.CodeMirror-fullscreen { + position: fixed; + top: 0; left: 0; right: 0; bottom: 0; + height: auto; + z-index: 9; +} + +.CodeMirror-foldmarker { + color: blue; + text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; + font-family: arial; + line-height: .3; + cursor: pointer; +} +.CodeMirror-foldgutter { + width: .7em; +} +.CodeMirror-foldgutter-open, +.CodeMirror-foldgutter-folded { + cursor: pointer; +} +.CodeMirror-foldgutter-open:after { + content: "\25BE"; +} +.CodeMirror-foldgutter-folded:after { + content: "\25B8"; +} + +.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { + position: absolute; + background: #ccc; + -moz-box-sizing: border-box; + box-sizing: border-box; + border: 1px solid #bbb; + border-radius: 2px; +} + +.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { + position: absolute; + z-index: 6; + background: #eee; +} + +.CodeMirror-simplescroll-horizontal { + bottom: 0; left: 0; + height: 8px; +} +.CodeMirror-simplescroll-horizontal div { + bottom: 0; + height: 100%; +} + +.CodeMirror-simplescroll-vertical { + right: 0; top: 0; + width: 8px; +} +.CodeMirror-simplescroll-vertical div { + right: 0; + width: 100%; +} + + +.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { + display: none; +} + +.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { + position: absolute; + background: #bcd; + border-radius: 3px; +} + +.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { + position: absolute; + z-index: 6; +} + +.CodeMirror-overlayscroll-horizontal { + bottom: 0; left: 0; + height: 6px; +} +.CodeMirror-overlayscroll-horizontal div { + bottom: 0; + height: 100%; +} + +.CodeMirror-overlayscroll-vertical { + right: 0; top: 0; + width: 6px; +} +.CodeMirror-overlayscroll-vertical div { + right: 0; + width: 100%; +} diff --git a/media/editors/codemirror/lib/addons.min.css b/media/editors/codemirror/lib/addons.min.css new file mode 100644 index 0000000000000..e81039a5d0e24 --- /dev/null +++ b/media/editors/codemirror/lib/addons.min.css @@ -0,0 +1 @@ +.CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-gutter-filler,.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%} \ No newline at end of file diff --git a/media/editors/codemirror/mode/asciiarmor/asciiarmor.js b/media/editors/codemirror/mode/asciiarmor/asciiarmor.js new file mode 100644 index 0000000000000..d830903767c91 --- /dev/null +++ b/media/editors/codemirror/mode/asciiarmor/asciiarmor.js @@ -0,0 +1,73 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function errorIfNotEmpty(stream) { + var nonWS = stream.match(/^\s*\S/); + stream.skipToEnd(); + return nonWS ? "error" : null; + } + + CodeMirror.defineMode("asciiarmor", function() { + return { + token: function(stream, state) { + var m; + if (state.state == "top") { + if (stream.sol() && (m = stream.match(/^-----BEGIN (.*)?-----\s*$/))) { + state.state = "headers"; + state.type = m[1]; + return "tag"; + } + return errorIfNotEmpty(stream); + } else if (state.state == "headers") { + if (stream.sol() && stream.match(/^\w+:/)) { + state.state = "header"; + return "atom"; + } else { + var result = errorIfNotEmpty(stream); + if (result) state.state = "body"; + return result; + } + } else if (state.state == "header") { + stream.skipToEnd(); + state.state = "headers"; + return "string"; + } else if (state.state == "body") { + if (stream.sol() && (m = stream.match(/^-----END (.*)?-----\s*$/))) { + if (m[1] != state.type) return "error"; + state.state = "end"; + return "tag"; + } else { + if (stream.eatWhile(/[A-Za-z0-9+\/=]/)) { + return null; + } else { + stream.next(); + return "error"; + } + } + } else if (state.state == "end") { + return errorIfNotEmpty(stream); + } + }, + blankLine: function(state) { + if (state.state == "headers") state.state = "body"; + }, + startState: function() { + return {state: "top", type: null}; + } + }; + }); + + CodeMirror.defineMIME("application/pgp", "asciiarmor"); + CodeMirror.defineMIME("application/pgp-keys", "asciiarmor"); + CodeMirror.defineMIME("application/pgp-signature", "asciiarmor"); +}); diff --git a/media/editors/codemirror/mode/asciiarmor/asciiarmor.min.js b/media/editors/codemirror/mode/asciiarmor/asciiarmor.min.js new file mode 100644 index 0000000000000..bbddf5df0ebeb --- /dev/null +++ b/media/editors/codemirror/mode/asciiarmor/asciiarmor.min.js @@ -0,0 +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){var b=a.match(/^\s*\S/);return a.skipToEnd(),b?"error":null}a.defineMode("asciiarmor",function(){return{token:function(a,c){var d;if("top"==c.state)return a.sol()&&(d=a.match(/^-----BEGIN (.*)?-----\s*$/))?(c.state="headers",c.type=d[1],"tag"):b(a);if("headers"==c.state){if(a.sol()&&a.match(/^\w+:/))return c.state="header","atom";var e=b(a);return e&&(c.state="body"),e}return"header"==c.state?(a.skipToEnd(),c.state="headers","string"):"body"==c.state?a.sol()&&(d=a.match(/^-----END (.*)?-----\s*$/))?d[1]!=c.type?"error":(c.state="end","tag"):a.eatWhile(/[A-Za-z0-9+\/=]/)?null:(a.next(),"error"):"end"==c.state?b(a):void 0},blankLine:function(a){"headers"==a.state&&(a.state="body")},startState:function(){return{state:"top",type:null}}}}),a.defineMIME("application/pgp","asciiarmor"),a.defineMIME("application/pgp-keys","asciiarmor"),a.defineMIME("application/pgp-signature","asciiarmor")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/asn.1/asn.1.js b/media/editors/codemirror/mode/asn.1/asn.1.js new file mode 100644 index 0000000000000..9600247ea60d9 --- /dev/null +++ b/media/editors/codemirror/mode/asn.1/asn.1.js @@ -0,0 +1,204 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("asn.1", function(config, parserConfig) { + var indentUnit = config.indentUnit, + keywords = parserConfig.keywords || {}, + cmipVerbs = parserConfig.cmipVerbs || {}, + compareTypes = parserConfig.compareTypes || {}, + status = parserConfig.status || {}, + tags = parserConfig.tags || {}, + storage = parserConfig.storage || {}, + modifier = parserConfig.modifier || {}, + accessTypes = parserConfig.accessTypes|| {}, + multiLineStrings = parserConfig.multiLineStrings, + indentStatements = parserConfig.indentStatements !== false; + var isOperatorChar = /[\|\^]/; + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]\(\){}:=,;]/.test(ch)) { + curPunc = ch; + return "punctuation"; + } + if (ch == "-"){ + if (stream.eat("-")) { + stream.skipToEnd(); + return "comment"; + } + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + + stream.eatWhile(/[\w\-]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) return "keyword"; + if (cmipVerbs.propertyIsEnumerable(cur)) return "variable cmipVerbs"; + if (compareTypes.propertyIsEnumerable(cur)) return "atom compareTypes"; + if (status.propertyIsEnumerable(cur)) return "comment status"; + if (tags.propertyIsEnumerable(cur)) return "variable-3 tags"; + if (storage.propertyIsEnumerable(cur)) return "builtin storage"; + if (modifier.propertyIsEnumerable(cur)) return "string-2 modifier"; + if (accessTypes.propertyIsEnumerable(cur)) return "atom accessTypes"; + + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped){ + var afterNext = stream.peek(); + //look if the character if the quote is like the B in '10100010'B + if (afterNext){ + afterNext = afterNext.toLowerCase(); + if(afterNext == "b" || afterNext == "h" || afterNext == "o") + stream.next(); + } + end = true; break; + } + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = null; + return "string"; + }; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + var indent = state.indented; + if (state.context && state.context.type == "statement") + indent = state.context.indented; + return state.context = new Context(indent, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + //Interface + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":" || curPunc == ",") + && ctx.type == "statement"){ + popContext(state); + } + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") + && curPunc != ';') || (ctx.type == "statement" + && curPunc == "newstatement"))) + pushContext(state, stream.column(), "statement"); + + state.startOfLine = false; + return style; + }, + + electricChars: "{}", + lineComment: "--", + fold: "brace" + }; + }); + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + CodeMirror.defineMIME("text/x-ttcn-asn", { + name: "asn.1", + keywords: words("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION" + + " REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED" + + " WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN" + + " IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS" + + " MINACCESS MAXACCESS REVISION STATUS DESCRIPTION" + + " SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName" + + " ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY" + + " IMPLIED EXPORTS"), + cmipVerbs: words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"), + compareTypes: words("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY" + + " MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY" + + " OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL" + + " SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL" + + " TEXTUAL-CONVENTION"), + status: words("current deprecated mandatory obsolete"), + tags: words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS" + + " UNIVERSAL"), + storage: words("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING" + + " UTCTime InterfaceIndex IANAifType CMIP-Attribute" + + " REAL PACKAGE PACKAGES IpAddress PhysAddress" + + " NetworkAddress BITS BMPString TimeStamp TimeTicks" + + " TruthValue RowStatus DisplayString GeneralString" + + " GraphicString IA5String NumericString" + + " PrintableString SnmpAdminAtring TeletexString" + + " UTF8String VideotexString VisibleString StringStore" + + " ISO646String T61String UniversalString Unsigned32" + + " Integer32 Gauge Gauge32 Counter Counter32 Counter64"), + modifier: words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS" + + " GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS" + + " DEFINED"), + accessTypes: words("not-accessible accessible-for-notify read-only" + + " read-create read-write"), + multiLineStrings: true + }); +}); diff --git a/media/editors/codemirror/mode/asn.1/asn.min.js b/media/editors/codemirror/mode/asn.1/asn.min.js new file mode 100644 index 0000000000000..7d682f74b3a57 --- /dev/null +++ b/media/editors/codemirror/mode/asn.1/asn.min.js @@ -0,0 +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){for(var b={},c=a.split(" "),d=0;d|[#\/]([A-Za-z_]\w*)/, token: "keyword" }, + { regex: /(?:else|this)\b/, token: "keyword" }, + + // Numeral + { regex: /\d+/i, token: "number" }, + + // Atoms like = and . + { regex: /=|~|@|true|false/, token: "atom" }, + + // Paths + { regex: /(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/, token: "variable-2" } + ], + dash_comment: [ + { regex: /--\}\}/, pop: true, token: "comment" }, + + // Commented code + { regex: /./, token: "comment"} + ], + comment: [ + { regex: /\}\}/, pop: true, token: "comment" }, + { regex: /./, token: "comment" } + ] + }); + + CodeMirror.defineMIME("text/x-handlebars-template", "handlebars"); +}); diff --git a/media/editors/codemirror/mode/handlebars/handlebars.min.js b/media/editors/codemirror/mode/handlebars/handlebars.min.js new file mode 100644 index 0000000000000..11ce1cb24e717 --- /dev/null +++ b/media/editors/codemirror/mode/handlebars/handlebars.min.js @@ -0,0 +1 @@ +!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],a):a(CodeMirror)}(function(a){"use strict";a.defineSimpleMode("handlebars",{start:[{regex:/\{\{!--/,push:"dash_comment",token:"comment"},{regex:/\{\{!/,push:"comment",token:"comment"},{regex:/\{\{/,push:"handlebars",token:"tag"}],handlebars:[{regex:/\}\}/,pop:!0,token:"tag"},{regex:/"(?:[^\\]|\\.)*?"/,token:"string"},{regex:/'(?:[^\\]|\\.)*?'/,token:"string"},{regex:/>|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}]}),a.defineMIME("text/x-handlebars-template","handlebars")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/mathematica/mathematica.js b/media/editors/codemirror/mode/mathematica/mathematica.js new file mode 100644 index 0000000000000..5ae6f55cb563d --- /dev/null +++ b/media/editors/codemirror/mode/mathematica/mathematica.js @@ -0,0 +1,175 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Mathematica mode copyright (c) 2015 by Calin Barbat +// Based on code by Patrick Scheibe (halirutan) +// See: https://github.com/halirutan/Mathematica-Source-Highlighting/tree/master/src/lang-mma.js + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('mathematica', function(_config, _parserConfig) { + + // used pattern building blocks + var Identifier = '[a-zA-Z\\$][a-zA-Z0-9\\$]*'; + var pBase = "(?:\\d+)"; + var pFloat = "(?:\\.\\d+|\\d+\\.\\d*|\\d+)"; + var pFloatBase = "(?:\\.\\w+|\\w+\\.\\w*|\\w+)"; + var pPrecision = "(?:`(?:`?"+pFloat+")?)"; + + // regular expressions + var reBaseForm = new RegExp('(?:'+pBase+'(?:\\^\\^'+pFloatBase+pPrecision+'?(?:\\*\\^[+-]?\\d+)?))'); + var reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\*\\^[+-]?\\d+)?)'); + var reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)'); + + function tokenBase(stream, state) { + var ch; + + // get next character + ch = stream.next(); + + // string + if (ch === '"') { + state.tokenize = tokenString; + return state.tokenize(stream, state); + } + + // comment + if (ch === '(') { + if (stream.eat('*')) { + state.commentLevel++; + state.tokenize = tokenComment; + return state.tokenize(stream, state); + } + } + + // go back one character + stream.backUp(1); + + // look for numbers + // Numbers in a baseform + if (stream.match(reBaseForm, true, false)) { + return 'number'; + } + + // Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition + // (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow. + if (stream.match(reFloatForm, true, false)) { + return 'number'; + } + + /* In[23] and Out[34] */ + if (stream.match(/(?:In|Out)\[[0-9]*\]/, true, false)) { + return 'atom'; + } + + // usage + if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) { + return 'meta'; + } + + // message + if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) { + return 'string-2'; + } + + // this makes a look-ahead match for something like variable:{_Integer} + // the match is then forwarded to the mma-patterns tokenizer. + if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/, true, false)) { + return 'variable-2'; + } + + // catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___) + // Cannot start with a number, but can have numbers at any other position. Examples + // blub__Integer, a1_, b34_Integer32 + if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) { + return 'variable-2'; + } + if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/, true, false)) { + return 'variable-2'; + } + if (stream.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) { + return 'variable-2'; + } + + // Named characters in Mathematica, like \[Gamma]. + if (stream.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/, true, false)) { + return 'variable-3'; + } + + // Match all braces separately + if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) { + return 'bracket'; + } + + // Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match + // only one. + if (stream.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/, true, false)) { + return 'variable-2'; + } + + // Literals like variables, keywords, functions + if (stream.match(reIdInContext, true, false)) { + return 'keyword'; + } + + // operators. Note that operators like @@ or /; are matched separately for each symbol. + if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) { + return 'operator'; + } + + // everything else is an error + return 'error'; + } + + function tokenString(stream, state) { + var next, end = false, escaped = false; + while ((next = stream.next()) != null) { + if (next === '"' && !escaped) { + end = true; + break; + } + escaped = !escaped && next === '\\'; + } + if (end && !escaped) { + state.tokenize = tokenBase; + } + return 'string'; + }; + + function tokenComment(stream, state) { + var prev, next; + while(state.commentLevel > 0 && (next = stream.next()) != null) { + if (prev === '(' && next === '*') state.commentLevel++; + if (prev === '*' && next === ')') state.commentLevel--; + prev = next; + } + if (state.commentLevel <= 0) { + state.tokenize = tokenBase; + } + return 'comment'; + } + + return { + startState: function() {return {tokenize: tokenBase, commentLevel: 0};}, + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + }, + blockCommentStart: "(*", + blockCommentEnd: "*)" + }; +}); + +CodeMirror.defineMIME('text/x-mathematica', { + name: 'mathematica' +}); + +}); diff --git a/media/editors/codemirror/mode/mathematica/mathematica.min.js b/media/editors/codemirror/mode/mathematica/mathematica.min.js new file mode 100644 index 0000000000000..a5872ae032f6e --- /dev/null +++ b/media/editors/codemirror/mode/mathematica/mathematica.min.js @@ -0,0 +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("mathematica",function(a,b){function c(a,b){var c;return c=a.next(),'"'===c?(b.tokenize=d,b.tokenize(a,b)):"("===c&&a.eat("*")?(b.commentLevel++,b.tokenize=e,b.tokenize(a,b)):(a.backUp(1),a.match(k,!0,!1)?"number":a.match(l,!0,!1)?"number":a.match(/(?:In|Out)\[[0-9]*\]/,!0,!1)?"atom":a.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/,!0,!1)?"meta":a.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/,!0,!1)?"string-2":a.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/,!0,!1)?"variable-2":a.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)?"variable-2":a.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/,!0,!1)?"variable-2":a.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)?"variable-2":a.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/,!0,!1)?"variable-3":a.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)?"bracket":a.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/,!0,!1)?"variable-2":a.match(m,!0,!1)?"keyword":a.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/,!0,!1)?"operator":"error")}function d(a,b){for(var d,e=!1,f=!1;null!=(d=a.next());){if('"'===d&&!f){e=!0;break}f=!f&&"\\"===d}return e&&!f&&(b.tokenize=c),"string"}function e(a,b){for(var d,e;b.commentLevel>0&&null!=(e=a.next());)"("===d&&"*"===e&&b.commentLevel++,"*"===d&&")"===e&&b.commentLevel--,d=e;return b.commentLevel<=0&&(b.tokenize=c),"comment"}var f="[a-zA-Z\\$][a-zA-Z0-9\\$]*",g="(?:\\d+)",h="(?:\\.\\d+|\\d+\\.\\d*|\\d+)",i="(?:\\.\\w+|\\w+\\.\\w*|\\w+)",j="(?:`(?:`?"+h+")?)",k=new RegExp("(?:"+g+"(?:\\^\\^"+i+j+"?(?:\\*\\^[+-]?\\d+)?))"),l=new RegExp("(?:"+h+j+"?(?:\\*\\^[+-]?\\d+)?)"),m=new RegExp("(?:`?)(?:"+f+")(?:`(?:"+f+"))*(?:`?)");return{startState:function(){return{tokenize:c,commentLevel:0}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)},blockCommentStart:"(*",blockCommentEnd:"*)"}}),a.defineMIME("text/x-mathematica",{name:"mathematica"})}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/mumps/mumps.js b/media/editors/codemirror/mode/mumps/mumps.js new file mode 100644 index 0000000000000..469f8c3d1c3a7 --- /dev/null +++ b/media/editors/codemirror/mode/mumps/mumps.js @@ -0,0 +1,148 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/* + This MUMPS Language script was constructed using vbscript.js as a template. +*/ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("mumps", function() { + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); + } + + var singleOperators = new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]"); + var doubleOperators = new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))"); + var singleDelimiters = new RegExp("^[\\.,:]"); + var brackets = new RegExp("[()]"); + var identifiers = new RegExp("^[%A-Za-z][A-Za-z0-9]*"); + var commandKeywords = ["break","close","do","else","for","goto", "halt", "hang", "if", "job","kill","lock","merge","new","open", "quit", "read", "set", "tcommit", "trollback", "tstart", "use", "view", "write", "xecute", "b","c","d","e","f","g", "h", "i", "j","k","l","m","n","o", "q", "r", "s", "tc", "tro", "ts", "u", "v", "w", "x"]; + // The following list includes instrinsic functions _and_ special variables + var intrinsicFuncsWords = ["\\$ascii", "\\$char", "\\$data", "\\$ecode", "\\$estack", "\\$etrap", "\\$extract", "\\$find", "\\$fnumber", "\\$get", "\\$horolog", "\\$io", "\\$increment", "\\$job", "\\$justify", "\\$length", "\\$name", "\\$next", "\\$order", "\\$piece", "\\$qlength", "\\$qsubscript", "\\$query", "\\$quit", "\\$random", "\\$reverse", "\\$select", "\\$stack", "\\$test", "\\$text", "\\$translate", "\\$view", "\\$x", "\\$y", "\\$a", "\\$c", "\\$d", "\\$e", "\\$ec", "\\$es", "\\$et", "\\$f", "\\$fn", "\\$g", "\\$h", "\\$i", "\\$j", "\\$l", "\\$n", "\\$na", "\\$o", "\\$p", "\\$q", "\\$ql", "\\$qs", "\\$r", "\\$re", "\\$s", "\\$st", "\\$t", "\\$tr", "\\$v", "\\$z"]; + var intrinsicFuncs = wordRegexp(intrinsicFuncsWords); + var command = wordRegexp(commandKeywords); + + function tokenBase(stream, state) { + if (stream.sol()) { + state.label = true; + state.commandMode = 0; + } + + // The character has meaning in MUMPS. Ignoring consecutive + // spaces would interfere with interpreting whether the next non-space + // character belongs to the command or argument context. + + // Examine each character and update a mode variable whose interpretation is: + // >0 => command 0 => argument <0 => command post-conditional + var ch = stream.peek(); + + if (ch == " " || ch == "\t") { // Pre-process + state.label = false; + if (state.commandMode == 0) + state.commandMode = 1; + else if ((state.commandMode < 0) || (state.commandMode == 2)) + state.commandMode = 0; + } else if ((ch != ".") && (state.commandMode > 0)) { + if (ch == ":") + state.commandMode = -1; // SIS - Command post-conditional + else + state.commandMode = 2; + } + + // Do not color parameter list as line tag + if ((ch === "(") || (ch === "\u0009")) + state.label = false; + + // MUMPS comment starts with ";" + if (ch === ";") { + stream.skipToEnd(); + return "comment"; + } + + // Number Literals // SIS/RLM - MUMPS permits canonic number followed by concatenate operator + if (stream.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/)) + return "number"; + + // Handle Strings + if (ch == '"') { + if (stream.skipTo('"')) { + stream.next(); + return "string"; + } else { + stream.skipToEnd(); + return "error"; + } + } + + // Handle operators and Delimiters + if (stream.match(doubleOperators) || stream.match(singleOperators)) + return "operator"; + + // Prevents leading "." in DO block from falling through to error + if (stream.match(singleDelimiters)) + return null; + + if (brackets.test(ch)) { + stream.next(); + return "bracket"; + } + + if (state.commandMode > 0 && stream.match(command)) + return "variable-2"; + + if (stream.match(intrinsicFuncs)) + return "builtin"; + + if (stream.match(identifiers)) + return "variable"; + + // Detect dollar-sign when not a documented intrinsic function + // "^" may introduce a GVN or SSVN - Color same as function + if (ch === "$" || ch === "^") { + stream.next(); + return "builtin"; + } + + // MUMPS Indirection + if (ch === "@") { + stream.next(); + return "string-2"; + } + + if (/[\w%]/.test(ch)) { + stream.eatWhile(/[\w%]/); + return "variable"; + } + + // Handle non-detected items + stream.next(); + return "error"; + } + + return { + startState: function() { + return { + label: false, + commandMode: 0 + }; + }, + + token: function(stream, state) { + var style = tokenBase(stream, state); + if (state.label) return "tag"; + return style; + } + }; + }); + + CodeMirror.defineMIME("text/x-mumps", "mumps"); +}); diff --git a/media/editors/codemirror/mode/mumps/mumps.min.js b/media/editors/codemirror/mode/mumps/mumps.min.js new file mode 100644 index 0000000000000..fd075fbb753f0 --- /dev/null +++ b/media/editors/codemirror/mode/mumps/mumps.min.js @@ -0,0 +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("mumps",function(){function a(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function b(a,b){a.sol()&&(b.label=!0,b.commandMode=0);var h=a.peek();return" "==h||" "==h?(b.label=!1,0==b.commandMode?b.commandMode=1:(b.commandMode<0||2==b.commandMode)&&(b.commandMode=0)):"."!=h&&b.commandMode>0&&(":"==h?b.commandMode=-1:b.commandMode=2),("("===h||" "===h)&&(b.label=!1),";"===h?(a.skipToEnd(),"comment"):a.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/)?"number":'"'==h?a.skipTo('"')?(a.next(),"string"):(a.skipToEnd(),"error"):a.match(d)||a.match(c)?"operator":a.match(e)?null:f.test(h)?(a.next(),"bracket"):b.commandMode>0&&a.match(k)?"variable-2":a.match(j)?"builtin":a.match(g)?"variable":"$"===h||"^"===h?(a.next(),"builtin"):"@"===h?(a.next(),"string-2"):/[\w%]/.test(h)?(a.eatWhile(/[\w%]/),"variable"):(a.next(),"error")}var c=new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]"),d=new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))"),e=new RegExp("^[\\.,:]"),f=new RegExp("[()]"),g=new RegExp("^[%A-Za-z][A-Za-z0-9]*"),h=["break","close","do","else","for","goto","halt","hang","if","job","kill","lock","merge","new","open","quit","read","set","tcommit","trollback","tstart","use","view","write","xecute","b","c","d","e","f","g","h","i","j","k","l","m","n","o","q","r","s","tc","tro","ts","u","v","w","x"],i=["\\$ascii","\\$char","\\$data","\\$ecode","\\$estack","\\$etrap","\\$extract","\\$find","\\$fnumber","\\$get","\\$horolog","\\$io","\\$increment","\\$job","\\$justify","\\$length","\\$name","\\$next","\\$order","\\$piece","\\$qlength","\\$qsubscript","\\$query","\\$quit","\\$random","\\$reverse","\\$select","\\$stack","\\$test","\\$text","\\$translate","\\$view","\\$x","\\$y","\\$a","\\$c","\\$d","\\$e","\\$ec","\\$es","\\$et","\\$f","\\$fn","\\$g","\\$h","\\$i","\\$j","\\$l","\\$n","\\$na","\\$o","\\$p","\\$q","\\$ql","\\$qs","\\$r","\\$re","\\$s","\\$st","\\$t","\\$tr","\\$v","\\$z"],j=a(i),k=a(h);return{startState:function(){return{label:!1,commandMode:0}},token:function(a,c){var d=b(a,c);return c.label?"tag":d}}}),a.defineMIME("text/x-mumps","mumps")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/troff/troff.js b/media/editors/codemirror/mode/troff/troff.js new file mode 100644 index 0000000000000..beca778eeb3d6 --- /dev/null +++ b/media/editors/codemirror/mode/troff/troff.js @@ -0,0 +1,82 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) + define(["../../lib/codemirror"], mod); + else + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('troff', function() { + + var words = {}; + + function tokenBase(stream) { + if (stream.eatSpace()) return null; + + var sol = stream.sol(); + var ch = stream.next(); + + if (ch === '\\') { + if (stream.match('fB') || stream.match('fR') || stream.match('fI') || + stream.match('u') || stream.match('d') || + stream.match('%') || stream.match('&')) { + return 'string'; + } + if (stream.match('m[')) { + stream.skipTo(']'); + stream.next(); + return 'string'; + } + if (stream.match('s+') || stream.match('s-')) { + stream.eatWhile(/[\d-]/); + return 'string'; + } + if (stream.match('\(') || stream.match('*\(')) { + stream.eatWhile(/[\w-]/); + return 'string'; + } + return 'string'; + } + if (sol && (ch === '.' || ch === '\'')) { + if (stream.eat('\\') && stream.eat('\"')) { + stream.skipToEnd(); + return 'comment'; + } + } + if (sol && ch === '.') { + if (stream.match('B ') || stream.match('I ') || stream.match('R ')) { + return 'attribute'; + } + if (stream.match('TH ') || stream.match('SH ') || stream.match('SS ') || stream.match('HP ')) { + stream.skipToEnd(); + return 'quote'; + } + if ((stream.match(/[A-Z]/) && stream.match(/[A-Z]/)) || (stream.match(/[a-z]/) && stream.match(/[a-z]/))) { + return 'attribute'; + } + } + stream.eatWhile(/[\w-]/); + var cur = stream.current(); + return words.hasOwnProperty(cur) ? words[cur] : null; + } + + function tokenize(stream, state) { + return (state.tokens[0] || tokenBase) (stream, state); + }; + + return { + startState: function() {return {tokens:[]};}, + token: function(stream, state) { + return tokenize(stream, state); + } + }; +}); + +CodeMirror.defineMIME('troff', 'troff'); + +}); diff --git a/media/editors/codemirror/mode/troff/troff.min.js b/media/editors/codemirror/mode/troff/troff.min.js new file mode 100644 index 0000000000000..3fd43538d61b7 --- /dev/null +++ b/media/editors/codemirror/mode/troff/troff.min.js @@ -0,0 +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("troff",function(){function a(a){if(a.eatSpace())return null;var b=a.sol(),d=a.next();if("\\"===d)return a.match("fB")||a.match("fR")||a.match("fI")||a.match("u")||a.match("d")||a.match("%")||a.match("&")?"string":a.match("m[")?(a.skipTo("]"),a.next(),"string"):a.match("s+")||a.match("s-")?(a.eatWhile(/[\d-]/),"string"):a.match("(")||a.match("*(")?(a.eatWhile(/[\w-]/),"string"):"string";if(b&&("."===d||"'"===d)&&a.eat("\\")&&a.eat('"'))return a.skipToEnd(),"comment";if(b&&"."===d){if(a.match("B ")||a.match("I ")||a.match("R "))return"attribute";if(a.match("TH ")||a.match("SH ")||a.match("SS ")||a.match("HP "))return a.skipToEnd(),"quote";if(a.match(/[A-Z]/)&&a.match(/[A-Z]/)||a.match(/[a-z]/)&&a.match(/[a-z]/))return"attribute"}a.eatWhile(/[\w-]/);var e=a.current();return c.hasOwnProperty(e)?c[e]:null}function b(b,c){return(c.tokens[0]||a)(b,c)}var c={};return{startState:function(){return{tokens:[]}},token:function(a,c){return b(a,c)}}}),a.defineMIME("troff","troff")}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.js b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.js new file mode 100644 index 0000000000000..e10805119c17c --- /dev/null +++ b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.js @@ -0,0 +1,214 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("ttcn-cfg", function(config, parserConfig) { + var indentUnit = config.indentUnit, + keywords = parserConfig.keywords || {}, + fileNCtrlMaskOptions = parserConfig.fileNCtrlMaskOptions || {}, + externalCommands = parserConfig.externalCommands || {}, + multiLineStrings = parserConfig.multiLineStrings, + indentStatements = parserConfig.indentStatements !== false; + var isOperatorChar = /[\|]/; + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[:=]/.test(ch)) { + curPunc = ch; + return "punctuation"; + } + if (ch == "#"){ + stream.skipToEnd(); + return "comment"; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + if (ch == "["){ + stream.eatWhile(/[\w_\]]/); + return "number sectionTitle"; + } + + stream.eatWhile(/[\w\$_]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) return "keyword"; + if (fileNCtrlMaskOptions.propertyIsEnumerable(cur)) + return "negative fileNCtrlMaskOptions"; + if (externalCommands.propertyIsEnumerable(cur)) return "negative externalCommands"; + + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped){ + var afterNext = stream.peek(); + //look if the character if the quote is like the B in '10100010'B + if (afterNext){ + afterNext = afterNext.toLowerCase(); + if(afterNext == "b" || afterNext == "h" || afterNext == "o") + stream.next(); + } + end = true; break; + } + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = null; + return "string"; + }; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + var indent = state.indented; + if (state.context && state.context.type == "statement") + indent = state.context.indented; + return state.context = new Context(indent, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + //Interface + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":" || curPunc == ",") + && ctx.type == "statement"){ + popContext(state); + } + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") + && curPunc != ';') || (ctx.type == "statement" + && curPunc == "newstatement"))) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + return style; + }, + + electricChars: "{}", + lineComment: "#", + fold: "brace" + }; + }); + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) + obj[words[i]] = true; + return obj; + } + + CodeMirror.defineMIME("text/x-ttcn-cfg", { + name: "ttcn-cfg", + keywords: words("Yes No LogFile FileMask ConsoleMask AppendFile" + + " TimeStampFormat LogEventTypes SourceInfoFormat" + + " LogEntityName LogSourceInfo DiskFullAction" + + " LogFileNumber LogFileSize MatchingHints Detailed" + + " Compact SubCategories Stack Single None Seconds" + + " DateTime Time Stop Error Retry Delete TCPPort KillTimer" + + " NumHCs UnixSocketsEnabled LocalAddress"), + fileNCtrlMaskOptions: words("TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING" + + " TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP" + + " TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION" + + " TTCN_USER TTCN_FUNCTION TTCN_STATISTICS" + + " TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG" + + " EXECUTOR ERROR WARNING PORTEVENT TIMEROP" + + " VERDICTOP DEFAULTOP TESTCASE ACTION USER" + + " FUNCTION STATISTICS PARALLEL MATCHING DEBUG" + + " LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED" + + " DEBUG_ENCDEC DEBUG_TESTPORT" + + " DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE" + + " DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT" + + " DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED" + + " EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA" + + " EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS" + + " EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED" + + " FUNCTION_RND FUNCTION_UNQUALIFIED" + + " MATCHING_DONE MATCHING_MCSUCCESS" + + " MATCHING_MCUNSUCC MATCHING_MMSUCCESS" + + " MATCHING_MMUNSUCC MATCHING_PCSUCCESS" + + " MATCHING_PCUNSUCC MATCHING_PMSUCCESS" + + " MATCHING_PMUNSUCC MATCHING_PROBLEM" + + " MATCHING_TIMEOUT MATCHING_UNQUALIFIED" + + " PARALLEL_PORTCONN PARALLEL_PORTMAP" + + " PARALLEL_PTC PARALLEL_UNQUALIFIED" + + " PORTEVENT_DUALRECV PORTEVENT_DUALSEND" + + " PORTEVENT_MCRECV PORTEVENT_MCSEND" + + " PORTEVENT_MMRECV PORTEVENT_MMSEND" + + " PORTEVENT_MQUEUE PORTEVENT_PCIN" + + " PORTEVENT_PCOUT PORTEVENT_PMIN" + + " PORTEVENT_PMOUT PORTEVENT_PQUEUE" + + " PORTEVENT_STATE PORTEVENT_UNQUALIFIED" + + " STATISTICS_UNQUALIFIED STATISTICS_VERDICT" + + " TESTCASE_FINISH TESTCASE_START" + + " TESTCASE_UNQUALIFIED TIMEROP_GUARD" + + " TIMEROP_READ TIMEROP_START TIMEROP_STOP" + + " TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED" + + " USER_UNQUALIFIED VERDICTOP_FINAL" + + " VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT" + + " VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED"), + externalCommands: words("BeginControlPart EndControlPart BeginTestCase" + + " EndTestCase"), + multiLineStrings: true + }); +}); \ No newline at end of file diff --git a/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js new file mode 100644 index 0000000000000..9903f745e0a18 --- /dev/null +++ b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js @@ -0,0 +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){for(var b={},c=a.split(" "),d=0;d!\/]/; + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]{}\(\),;\\:\?\.]/.test(ch)) { + curPunc = ch; + return "punctuation"; + } + if (ch == "#"){ + stream.skipToEnd(); + return "atom preprocessor"; + } + if (ch == "%"){ + stream.eatWhile(/\b/); + return "atom ttcn3Macros"; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + if(ch == "@"){ + if(stream.match("try") || stream.match("catch") + || stream.match("lazy")){ + return "keyword"; + } + } + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + var cur = stream.current(); + + if (keywords.propertyIsEnumerable(cur)) return "keyword"; + if (builtin.propertyIsEnumerable(cur)) return "builtin"; + + if (timerOps.propertyIsEnumerable(cur)) return "def timerOps"; + if (configOps.propertyIsEnumerable(cur)) return "def configOps"; + if (verdictOps.propertyIsEnumerable(cur)) return "def verdictOps"; + if (portOps.propertyIsEnumerable(cur)) return "def portOps"; + if (sutOps.propertyIsEnumerable(cur)) return "def sutOps"; + if (functionOps.propertyIsEnumerable(cur)) return "def functionOps"; + + if (verdictConsts.propertyIsEnumerable(cur)) return "string verdictConsts"; + if (booleanConsts.propertyIsEnumerable(cur)) return "string booleanConsts"; + if (otherConsts.propertyIsEnumerable(cur)) return "string otherConsts"; + + if (types.propertyIsEnumerable(cur)) return "builtin types"; + if (visibilityModifiers.propertyIsEnumerable(cur)) + return "builtin visibilityModifiers"; + if (templateMatch.propertyIsEnumerable(cur)) return "atom templateMatch"; + + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped){ + var afterQuote = stream.peek(); + //look if the character after the quote is like the B in '10100010'B + if (afterQuote){ + afterQuote = afterQuote.toLowerCase(); + if(afterQuote == "b" || afterQuote == "h" || afterQuote == "o") + stream.next(); + } + end = true; break; + } + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = null; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + + function pushContext(state, col, type) { + var indent = state.indented; + if (state.context && state.context.type == "statement") + indent = state.context.indented; + return state.context = new Context(indent, col, type, null, state.context); + } + + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + //Interface + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":" || curPunc == ",") + && ctx.type == "statement"){ + popContext(state); + } + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (indentStatements && + (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || + (ctx.type == "statement" && curPunc == "newstatement"))) + pushContext(state, stream.column(), "statement"); + + state.startOfLine = false; + + return style; + }, + + electricChars: "{}", + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//", + fold: "brace" + }; + }); + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + function def(mimes, mode) { + if (typeof mimes == "string") mimes = [mimes]; + var words = []; + function add(obj) { + if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) + words.push(prop); + } + + add(mode.keywords); + add(mode.builtin); + add(mode.timerOps); + add(mode.portOps); + + if (words.length) { + mode.helperType = mimes[0]; + CodeMirror.registerHelper("hintWords", mimes[0], words); + } + + for (var i = 0; i < mimes.length; ++i) + CodeMirror.defineMIME(mimes[i], mode); + } + + def(["text/x-ttcn", "text/x-ttcn3", "text/x-ttcnpp"], { + name: "ttcn", + keywords: words("activate address alive all alt altstep and and4b any" + + " break case component const continue control deactivate" + + " display do else encode enumerated except exception" + + " execute extends extension external for from function" + + " goto group if import in infinity inout interleave" + + " label language length log match message mixed mod" + + " modifies module modulepar mtc noblock not not4b nowait" + + " of on optional or or4b out override param pattern port" + + " procedure record recursive rem repeat return runs select" + + " self sender set signature system template testcase to" + + " type union value valueof var variant while with xor xor4b"), + builtin: words("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue" + + " decomp decvalue float2int float2str hex2bit hex2int" + + " hex2oct hex2str int2bit int2char int2float int2hex" + + " int2oct int2str int2unichar isbound ischosen ispresent" + + " isvalue lengthof log2str oct2bit oct2char oct2hex oct2int" + + " oct2str regexp replace rnd sizeof str2bit str2float" + + " str2hex str2int str2oct substr unichar2int unichar2char" + + " enum2int"), + types: words("anytype bitstring boolean char charstring default float" + + " hexstring integer objid octetstring universal verdicttype timer"), + timerOps: words("read running start stop timeout"), + portOps: words("call catch check clear getcall getreply halt raise receive" + + " reply send trigger"), + configOps: words("create connect disconnect done kill killed map unmap"), + verdictOps: words("getverdict setverdict"), + sutOps: words("action"), + functionOps: words("apply derefers refers"), + + verdictConsts: words("error fail inconc none pass"), + booleanConsts: words("true false"), + otherConsts: words("null NULL omit"), + + visibilityModifiers: words("private public friend"), + templateMatch: words("complement ifpresent subset superset permutation"), + multiLineStrings: true + }); +}); diff --git a/media/editors/codemirror/mode/ttcn/ttcn.min.js b/media/editors/codemirror/mode/ttcn/ttcn.min.js new file mode 100644 index 0000000000000..afa666da9a68e --- /dev/null +++ b/media/editors/codemirror/mode/ttcn/ttcn.min.js @@ -0,0 +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){for(var b={},c=a.split(" "),d=0;d!\/]/;return{startState:function(a){return{tokenize:null,context:new f((a||0)-j,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var d=b.context;if(a.sol()&&(null==d.align&&(d.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;i=null;var e=(b.tokenize||c)(a,b);if("comment"==e)return e;if(null==d.align&&(d.align=!0),";"!=i&&":"!=i&&","!=i||"statement"!=d.type)if("{"==i)g(b,a.column(),"}");else if("["==i)g(b,a.column(),"]");else if("("==i)g(b,a.column(),")");else if("}"==i){for(;"statement"==d.type;)d=h(b);for("}"==d.type&&(d=h(b));"statement"==d.type;)d=h(b)}else i==d.type?h(b):z&&(("}"==d.type||"top"==d.type)&&";"!=i||"statement"==d.type&&"newstatement"==i)&&g(b,a.column(),"statement");else h(b);return b.startOfLine=!1,e},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),c(["text/x-ttcn","text/x-ttcn3","text/x-ttcnpp"],{name:"ttcn",keywords:b("activate address alive all alt altstep and and4b any break case component const continue control deactivate display do else encode enumerated except exception execute extends extension external for from function goto group if import in infinity inout interleave label language length log match message mixed mod modifies module modulepar mtc noblock not not4b nowait of on optional or or4b out override param pattern port procedure record recursive rem repeat return runs select self sender set signature system template testcase to type union value valueof var variant while with xor xor4b"),builtin:b("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue decomp decvalue float2int float2str hex2bit hex2int hex2oct hex2str int2bit int2char int2float int2hex int2oct int2str int2unichar isbound ischosen ispresent isvalue lengthof log2str oct2bit oct2char oct2hex oct2int oct2str regexp replace rnd sizeof str2bit str2float str2hex str2int str2oct substr unichar2int unichar2char enum2int"),types:b("anytype bitstring boolean char charstring default float hexstring integer objid octetstring universal verdicttype timer"),timerOps:b("read running start stop timeout"),portOps:b("call catch check clear getcall getreply halt raise receive reply send trigger"),configOps:b("create connect disconnect done kill killed map unmap"),verdictOps:b("getverdict setverdict"),sutOps:b("action"),functionOps:b("apply derefers refers"),verdictConsts:b("error fail inconc none pass"),booleanConsts:b("true false"),otherConsts:b("null NULL omit"),visibilityModifiers:b("private public friend"),templateMatch:b("complement ifpresent subset superset permutation"),multiLineStrings:!0})}); \ No newline at end of file diff --git a/media/editors/codemirror/theme/liquibyte.css b/media/editors/codemirror/theme/liquibyte.css new file mode 100644 index 0000000000000..a6e070c6a8877 --- /dev/null +++ b/media/editors/codemirror/theme/liquibyte.css @@ -0,0 +1,95 @@ +.cm-s-liquibyte.CodeMirror { + background-color: #000; + color: #fff; + line-height: 1.2em; + font-size: 1em; +} +.CodeMirror-focused .cm-matchhighlight { + text-decoration: underline; + text-decoration-color: #0f0; + text-decoration-style: wavy; +} +.cm-trailingspace { + text-decoration: line-through; + text-decoration-color: #f00; + text-decoration-style: dotted; +} +.cm-tab { + text-decoration: line-through; + text-decoration-color: #404040; + text-decoration-style: dotted; +} +.cm-s-liquibyte .CodeMirror-gutters { background-color: #262626; border-right: 1px solid #505050; padding-right: 0.8em; } +.cm-s-liquibyte .CodeMirror-gutter-elt div{ font-size: 1.2em; } +.cm-s-liquibyte .CodeMirror-guttermarker { } +.cm-s-liquibyte .CodeMirror-guttermarker-subtle { } +.cm-s-liquibyte .CodeMirror-linenumber { color: #606060; padding-left: 0;} +.cm-s-liquibyte .CodeMirror-cursor { border-left: 1px solid #eee !important; } + +.cm-s-liquibyte span.cm-comment { color: #008000; } +.cm-s-liquibyte span.cm-def { color: #ffaf40; font-weight: bold; } +.cm-s-liquibyte span.cm-keyword { color: #c080ff; font-weight: bold; } +.cm-s-liquibyte span.cm-builtin { color: #ffaf40; font-weight: bold; } +.cm-s-liquibyte span.cm-variable { color: #5967ff; font-weight: bold; } +.cm-s-liquibyte span.cm-string { color: #ff8000; } +.cm-s-liquibyte span.cm-number { color: #0f0; font-weight: bold; } +.cm-s-liquibyte span.cm-atom { color: #bf3030; font-weight: bold; } + +.cm-s-liquibyte span.cm-variable-2 { color: #007f7f; font-weight: bold; } +.cm-s-liquibyte span.cm-variable-3 { color: #c080ff; font-weight: bold; } +.cm-s-liquibyte span.cm-property { color: #999; font-weight: bold; } +.cm-s-liquibyte span.cm-operator { color: #fff; } + +.cm-s-liquibyte span.cm-meta { color: #0f0; } +.cm-s-liquibyte span.cm-qualifier { color: #fff700; font-weight: bold; } +.cm-s-liquibyte span.cm-bracket { color: #cc7; } +.cm-s-liquibyte span.cm-tag { color: #ff0; font-weight: bold; } +.cm-s-liquibyte span.cm-attribute { color: #c080ff; font-weight: bold; } +.cm-s-liquibyte span.cm-error { color: #f00; } + +.cm-s-liquibyte .CodeMirror-selected { background-color: rgba(255, 0, 0, 0.25) !important; } + +.cm-s-liquibyte span.cm-compilation { background-color: rgba(255, 255, 255, 0.12); } + +.cm-s-liquibyte .CodeMirror-activeline-background {background-color: rgba(0, 255, 0, 0.15) !important;} + +/* Default styles for common addons */ +div.CodeMirror span.CodeMirror-matchingbracket { color: #0f0; font-weight: bold; } +div.CodeMirror span.CodeMirror-nonmatchingbracket { color: #f00; font-weight: bold; } +.CodeMirror-matchingtag { background-color: rgba(150, 255, 0, .3); } +/* Scrollbars */ +/* Simple */ +div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover { + background-color: rgba(80, 80, 80, .7); +} +div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div { + background-color: rgba(80, 80, 80, .3); + border: 1px solid #404040; + border-radius: 5px; +} +div.CodeMirror-simplescroll-vertical div { + border-top: 1px solid #404040; + border-bottom: 1px solid #404040; +} +div.CodeMirror-simplescroll-horizontal div { + border-left: 1px solid #404040; + border-right: 1px solid #404040; +} +div.CodeMirror-simplescroll-vertical { + background-color: #262626; +} +div.CodeMirror-simplescroll-horizontal { + background-color: #262626; + border-top: 1px solid #404040; +} +/* Overlay */ +div.CodeMirror-overlayscroll-horizontal div, div.CodeMirror-overlayscroll-vertical div { + background-color: #404040; + border-radius: 5px; +} +div.CodeMirror-overlayscroll-vertical div { + border: 1px solid #404040; +} +div.CodeMirror-overlayscroll-horizontal div { + border: 1px solid #404040; +} diff --git a/media/editors/codemirror/theme/ttcn.css b/media/editors/codemirror/theme/ttcn.css new file mode 100644 index 0000000000000..959c047968393 --- /dev/null +++ b/media/editors/codemirror/theme/ttcn.css @@ -0,0 +1,66 @@ +/* DEFAULT THEME */ +.cm-atom {color: #219;} +.cm-attribute {color: #00c;} +.cm-bracket {color: #997;} +.cm-comment {color: #333333;} +.cm-def {color: #00f;} +.cm-em {font-style: italic;} +.cm-error {color: #f00;} +.cm-header {color: #00f; font-weight: bold;} +.cm-hr {color: #999;} +.cm-invalidchar {color: #f00;} +.cm-keyword {font-weight:bold} +.cm-link {color: #00c; text-decoration: underline;} +.cm-meta {color: #555;} +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-qualifier {color: #555;} +.cm-quote {color: #090;} +.cm-strikethrough {text-decoration: line-through;} +.cm-string {color: #006400;} +.cm-string-2 {color: #f50;} +.cm-strong {font-weight: bold;} +.cm-tag {color: #170;} +.cm-variable {color: #8B2252;} +.cm-variable-2 {color: #05a;} +.cm-variable-3 {color: #085;} + +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} +.cm-strikethrough {text-decoration: line-through;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +/* ASN */ +.cm-s-ttcn .cm-accessTypes, +.cm-s-ttcn .cm-compareTypes {color: #27408B} +.cm-s-ttcn .cm-cmipVerbs {color: #8B2252} +.cm-s-ttcn .cm-modifier {color:#D2691E} +.cm-s-ttcn .cm-status {color:#8B4545} +.cm-s-ttcn .cm-storage {color:#A020F0} +.cm-s-ttcn .cm-tags {color:#006400} + +/* CFG */ +.cm-s-ttcn .cm-externalCommands {color: #8B4545; font-weight:bold} +.cm-s-ttcn .cm-fileNCtrlMaskOptions, +.cm-s-ttcn .cm-sectionTitle {color: #2E8B57; font-weight:bold} + +/* TTCN */ +.cm-s-ttcn .cm-booleanConsts, +.cm-s-ttcn .cm-otherConsts, +.cm-s-ttcn .cm-verdictConsts {color: #006400} +.cm-s-ttcn .cm-configOps, +.cm-s-ttcn .cm-functionOps, +.cm-s-ttcn .cm-portOps, +.cm-s-ttcn .cm-sutOps, +.cm-s-ttcn .cm-timerOps, +.cm-s-ttcn .cm-verdictOps {color: #0000FF} +.cm-s-ttcn .cm-preprocessor, +.cm-s-ttcn .cm-templateMatch, +.cm-s-ttcn .cm-ttcn3Macros {color: #27408B} +.cm-s-ttcn .cm-types {color: #A52A2A; font-weight:bold} +.cm-s-ttcn .cm-visibilityModifiers {font-weight:bold} From 8f0868fb3e2c462524f77755c625c83d13fa8b83 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Sat, 30 May 2015 17:39:50 +0100 Subject: [PATCH 437/809] Fix English error of word "Chose" Fixes #7075 --- administrator/language/en-GB/en-GB.plg_content_pagebreak.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.plg_content_pagebreak.ini b/administrator/language/en-GB/en-GB.plg_content_pagebreak.ini index 8680bc014ac3f..5cc6a013e7095 100644 --- a/administrator/language/en-GB/en-GB.plg_content_pagebreak.ini +++ b/administrator/language/en-GB/en-GB.plg_content_pagebreak.ini @@ -19,7 +19,7 @@ PLG_CONTENT_PAGEBREAK_SITE_ARTICLEINDEX_LABEL="Article Index Heading" PLG_CONTENT_PAGEBREAK_SITE_TITLE_DESC="Title and heading attributes from Plugin added to Site Title tag." PLG_CONTENT_PAGEBREAK_SITE_TITLE_LABEL="Show Site Title" PLG_CONTENT_PAGEBREAK_SLIDERS="Sliders" -PLG_CONTENT_PAGEBREAK_STYLE_DESC="Chose whether to layout the article with separate pages, tabs or sliders." +PLG_CONTENT_PAGEBREAK_STYLE_DESC="Choose whether to layout the article with separate pages, tabs or sliders." PLG_CONTENT_PAGEBREAK_STYLE_LABEL="Presentation Style" PLG_CONTENT_PAGEBREAK_TABS="Tabs" PLG_CONTENT_PAGEBREAK_TOC_DESC="Display a table of contents on multipage Articles." From cf0339f7661ccfebc016e031ebe647854db05b17 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Sat, 30 May 2015 18:21:59 +0100 Subject: [PATCH 438/809] Fix unit test in PHP 7, clean up assertions and clean failure descriptions --- .../libraries/joomla/form/JFormTest.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tests/unit/suites/libraries/joomla/form/JFormTest.php b/tests/unit/suites/libraries/joomla/form/JFormTest.php index 897439683ef49..0db9c9b76feec 100644 --- a/tests/unit/suites/libraries/joomla/form/JFormTest.php +++ b/tests/unit/suites/libraries/joomla/form/JFormTest.php @@ -2067,9 +2067,8 @@ public function testSetFields() { $form = new JFormInspector('form1'); - $this->assertThat( + $this->assertTrue( $form->load(JFormDataHelper::$loadDocument), - $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.' ); @@ -2082,22 +2081,20 @@ public function testSetFields() // Test without replace. - $this->assertThat( + $this->assertTrue( $form->setFields($xml1->field, null, false), - $this->isTrue(), - 'Line:' . __LINE__ . ' The setFields method should return true.' + 'Line:' . __LINE__ . ' The setFields method should return true for an existing field.' ); - $this->assertThat( + $this->assertEquals( $form->getFieldAttribute('title', 'required', 'default'), - $this->equalTo('default'), - 'Line:' . __LINE__ . ' The label should contain just the field name.' + 'default', + 'Line:' . __LINE__ . ' The getFieldAttribute method should return the default value if the attribute is not set.' ); - $this->assertThat( + $this->assertFalse( $form->getField('ordering'), - $this->logicalNot($this->isFalse()), - 'Line:' . __LINE__ . ' The label should contain just the field name.' + 'Line:' . __LINE__ . ' The getField method returns false when themethod doesn't exist.' ); } From 07af341cadd1da18f4ca422496a5e6081aeb4991 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Sat, 30 May 2015 18:27:00 +0100 Subject: [PATCH 439/809] Fix non-existing filter --- administrator/components/com_categories/models/category.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php index 27a1ec2ec5985..1de58b5d48a8c 100644 --- a/administrator/components/com_categories/models/category.php +++ b/administrator/components/com_categories/models/category.php @@ -324,7 +324,7 @@ protected function loadFormData() $filters = (array) $app->getUserState('com_categories.categories.' . $extension . '.filter'); $data->set('published', $app->input->getInt('published', (isset($filters['published']) ? $filters['published'] : null))); - $data->set('language', $app->input->getVar('language', (isset($filters['language']) ? $filters['language'] : null))); + $data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null))); $data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : null))); } From 23130a1e180de9d465811070474ec5ae4b2d94aa Mon Sep 17 00:00:00 2001 From: George Wilson Date: Sat, 30 May 2015 18:30:51 +0100 Subject: [PATCH 440/809] Fix quoting --- tests/unit/suites/libraries/joomla/form/JFormTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/suites/libraries/joomla/form/JFormTest.php b/tests/unit/suites/libraries/joomla/form/JFormTest.php index 0db9c9b76feec..4b3e4192dd8fa 100644 --- a/tests/unit/suites/libraries/joomla/form/JFormTest.php +++ b/tests/unit/suites/libraries/joomla/form/JFormTest.php @@ -2094,7 +2094,7 @@ public function testSetFields() $this->assertFalse( $form->getField('ordering'), - 'Line:' . __LINE__ . ' The getField method returns false when themethod doesn't exist.' + 'Line:' . __LINE__ . ' The getField method returns false when the method does not exist.' ); } From d2cbfa42b2168e81634edf0ae9aec4dafbeb4c96 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sat, 30 May 2015 13:59:17 -0400 Subject: [PATCH 441/809] Adjust test again --- tests/unit/suites/libraries/joomla/form/JFormTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/suites/libraries/joomla/form/JFormTest.php b/tests/unit/suites/libraries/joomla/form/JFormTest.php index 4b3e4192dd8fa..d281144677db6 100644 --- a/tests/unit/suites/libraries/joomla/form/JFormTest.php +++ b/tests/unit/suites/libraries/joomla/form/JFormTest.php @@ -2092,9 +2092,9 @@ public function testSetFields() 'Line:' . __LINE__ . ' The getFieldAttribute method should return the default value if the attribute is not set.' ); - $this->assertFalse( + $this->assertNotFalse( $form->getField('ordering'), - 'Line:' . __LINE__ . ' The getField method returns false when the method does not exist.' + 'Line:' . __LINE__ . ' The getField method does not return false when the field exists.' ); } From d6f1ff2444aca6fa2fa13d5a1176b02548ac8a4f Mon Sep 17 00:00:00 2001 From: George Wilson Date: Sat, 30 May 2015 19:21:57 +0100 Subject: [PATCH 442/809] I made a boo boo --- 6686.diff | 15795 ---------------------------------------------------- 1 file changed, 15795 deletions(-) delete mode 100644 6686.diff diff --git a/6686.diff b/6686.diff deleted file mode 100644 index c7337a5a7edea..0000000000000 --- a/6686.diff +++ /dev/null @@ -1,15795 +0,0 @@ -diff --git a/media/editors/codemirror/LICENSE b/media/editors/codemirror/LICENSE -index d21bbea..f4a5a4a 100644 ---- a/media/editors/codemirror/LICENSE -+++ b/media/editors/codemirror/LICENSE -@@ -1,4 +1,4 @@ --Copyright (C) 2014 by Marijn Haverbeke and others -+Copyright (C) 2015 by Marijn Haverbeke and others - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal -diff --git a/media/editors/codemirror/addon/comment/comment.min.js b/media/editors/codemirror/addon/comment/comment.min.js -index b7cf9a5..d671250 100644 ---- a/media/editors/codemirror/addon/comment/comment.min.js -+++ b/media/editors/codemirror/addon/comment/comment.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(e){var n=e.search(i);return-1==n?0:n}var t={},i=/[^\s\u00a0]/,l=e.Pos;e.commands.toggleComment=function(e){for(var n=1/0,t=e.listSelections(),i=null,o=t.length-1;o>=0;o--){var r=t[o].from(),a=t[o].to();r.line>=n||(a.line>=n&&(a=l(n,0)),n=r.line,null==i?e.uncomment(r,a)?i="un":(e.lineComment(r,a),i="line"):"un"==i?e.uncomment(r,a):e.lineComment(r,a))}},e.defineExtension("lineComment",function(e,o,r){r||(r=t);var a=this,m=a.getModeAt(e),c=r.lineComment||m.lineComment;if(!c)return void((r.blockCommentStart||m.blockCommentStart)&&(r.fullLines=!0,a.blockComment(e,o,r)));var f=a.getLine(e.line);if(null!=f){var g=Math.min(0!=o.ch||o.line==e.line?o.line+1:o.line,a.lastLine()+1),s=null==r.padding?" ":r.padding,d=r.commentBlankLines||e.line==o.line;a.operation(function(){if(r.indent)for(var t=f.slice(0,n(f)),o=e.line;g>o;++o){var m=a.getLine(o),u=t.length;(d||i.test(m))&&(m.slice(0,u)!=t&&(u=n(m)),a.replaceRange(t+c+s,l(o,0),l(o,u)))}else for(var o=e.line;g>o;++o)(d||i.test(a.getLine(o)))&&a.replaceRange(c+s,l(o,0))})}}),e.defineExtension("blockComment",function(e,n,o){o||(o=t);var r=this,a=r.getModeAt(e),m=o.blockCommentStart||a.blockCommentStart,c=o.blockCommentEnd||a.blockCommentEnd;if(!m||!c)return void((o.lineComment||a.lineComment)&&0!=o.fullLines&&r.lineComment(e,n,o));var f=Math.min(n.line,r.lastLine());f!=e.line&&0==n.ch&&i.test(r.getLine(f))&&--f;var g=null==o.padding?" ":o.padding;e.line>f||r.operation(function(){if(0!=o.fullLines){var t=i.test(r.getLine(f));r.replaceRange(g+c,l(f)),r.replaceRange(m+g,l(e.line,0));var s=o.blockCommentLead||a.blockCommentLead;if(null!=s)for(var d=e.line+1;f>=d;++d)(d!=f||t)&&r.replaceRange(s+g,l(d,0))}else r.replaceRange(c,n),r.replaceRange(m,e)})}),e.defineExtension("uncomment",function(e,n,o){o||(o=t);var r,a=this,m=a.getModeAt(e),c=Math.min(0!=n.ch||n.line==e.line?n.line:n.line-1,a.lastLine()),f=Math.min(e.line,c),g=o.lineComment||m.lineComment,s=[],d=null==o.padding?" ":o.padding;e:if(g){for(var u=f;c>=u;++u){var h=a.getLine(u),v=h.indexOf(g);if(v>-1&&!/comment/.test(a.getTokenTypeAt(l(u,v+1)))&&(v=-1),-1==v&&(u!=c||u==f)&&i.test(h))break e;if(v>-1&&i.test(h.slice(0,v)))break e;s.push(h)}if(a.operation(function(){for(var e=f;c>=e;++e){var n=s[e-f],t=n.indexOf(g),i=t+g.length;0>t||(n.slice(i,i+d.length)==d&&(i+=d.length),r=!0,a.replaceRange("",l(e,t),l(e,i)))}}),r)return!0}var p=o.blockCommentStart||m.blockCommentStart,C=o.blockCommentEnd||m.blockCommentEnd;if(!p||!C)return!1;var b=o.blockCommentLead||m.blockCommentLead,k=a.getLine(f),L=c==f?k:a.getLine(c),x=k.indexOf(p),R=L.lastIndexOf(C);if(-1==R&&f!=c&&(L=a.getLine(--c),R=L.lastIndexOf(C)),-1==x||-1==R||!/comment/.test(a.getTokenTypeAt(l(f,x+1)))||!/comment/.test(a.getTokenTypeAt(l(c,R+1))))return!1;var O=k.lastIndexOf(p,e.ch),M=-1==O?-1:k.slice(0,e.ch).indexOf(C,O+p.length);if(-1!=O&&-1!=M&&M+C.length!=e.ch)return!1;M=L.indexOf(C,n.ch);var E=L.slice(n.ch).lastIndexOf(p,M-n.ch);return O=-1==M||-1==E?-1:n.ch+E,-1!=M&&-1!=O&&O!=n.ch?!1:(a.operation(function(){a.replaceRange("",l(c,R-(d&&L.slice(R-d.length,R)==d?d.length:0)),l(c,R+C.length));var e=x+p.length;if(d&&k.slice(e,e+d.length)==d&&(e+=d.length),a.replaceRange("",l(f,x),l(f,e)),b)for(var n=f+1;c>=n;++n){var t=a.getLine(n),o=t.indexOf(b);if(-1!=o&&!i.test(t.slice(0,o))){var r=o+b.length;d&&t.slice(r,r+d.length)==d&&(r+=d.length),a.replaceRange("",l(n,o),l(n,r))}}}),!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";function b(a){var b=a.search(d);return-1==b?0:b}var c={},d=/[^\s\u00a0]/,e=a.Pos;a.commands.toggleComment=function(a){for(var b=1/0,c=a.listSelections(),d=null,f=c.length-1;f>=0;f--){var g=c[f].from(),h=c[f].to();g.line>=b||(h.line>=b&&(h=e(b,0)),b=g.line,null==d?a.uncomment(g,h)?d="un":(a.lineComment(g,h),d="line"):"un"==d?a.uncomment(g,h):a.lineComment(g,h))}},a.defineExtension("lineComment",function(a,f,g){g||(g=c);var h=this,i=h.getModeAt(a),j=g.lineComment||i.lineComment;if(!j)return void((g.blockCommentStart||i.blockCommentStart)&&(g.fullLines=!0,h.blockComment(a,f,g)));var k=h.getLine(a.line);if(null!=k){var l=Math.min(0!=f.ch||f.line==a.line?f.line+1:f.line,h.lastLine()+1),m=null==g.padding?" ":g.padding,n=g.commentBlankLines||a.line==f.line;h.operation(function(){if(g.indent)for(var c=k.slice(0,b(k)),f=a.line;l>f;++f){var i=h.getLine(f),o=c.length;(n||d.test(i))&&(i.slice(0,o)!=c&&(o=b(i)),h.replaceRange(c+j+m,e(f,0),e(f,o)))}else for(var f=a.line;l>f;++f)(n||d.test(h.getLine(f)))&&h.replaceRange(j+m,e(f,0))})}}),a.defineExtension("blockComment",function(a,b,f){f||(f=c);var g=this,h=g.getModeAt(a),i=f.blockCommentStart||h.blockCommentStart,j=f.blockCommentEnd||h.blockCommentEnd;if(!i||!j)return void((f.lineComment||h.lineComment)&&0!=f.fullLines&&g.lineComment(a,b,f));var k=Math.min(b.line,g.lastLine());k!=a.line&&0==b.ch&&d.test(g.getLine(k))&&--k;var l=null==f.padding?" ":f.padding;a.line>k||g.operation(function(){if(0!=f.fullLines){var c=d.test(g.getLine(k));g.replaceRange(l+j,e(k)),g.replaceRange(i+l,e(a.line,0));var m=f.blockCommentLead||h.blockCommentLead;if(null!=m)for(var n=a.line+1;k>=n;++n)(n!=k||c)&&g.replaceRange(m+l,e(n,0))}else g.replaceRange(j,b),g.replaceRange(i,a)})}),a.defineExtension("uncomment",function(a,b,f){f||(f=c);var g,h=this,i=h.getModeAt(a),j=Math.min(0!=b.ch||b.line==a.line?b.line:b.line-1,h.lastLine()),k=Math.min(a.line,j),l=f.lineComment||i.lineComment,m=[],n=null==f.padding?" ":f.padding;a:if(l){for(var o=k;j>=o;++o){var p=h.getLine(o),q=p.indexOf(l);if(q>-1&&!/comment/.test(h.getTokenTypeAt(e(o,q+1)))&&(q=-1),-1==q&&(o!=j||o==k)&&d.test(p))break a;if(q>-1&&d.test(p.slice(0,q)))break a;m.push(p)}if(h.operation(function(){for(var a=k;j>=a;++a){var b=m[a-k],c=b.indexOf(l),d=c+l.length;0>c||(b.slice(d,d+n.length)==n&&(d+=n.length),g=!0,h.replaceRange("",e(a,c),e(a,d)))}}),g)return!0}var r=f.blockCommentStart||i.blockCommentStart,s=f.blockCommentEnd||i.blockCommentEnd;if(!r||!s)return!1;var t=f.blockCommentLead||i.blockCommentLead,u=h.getLine(k),v=j==k?u:h.getLine(j),w=u.indexOf(r),x=v.lastIndexOf(s);if(-1==x&&k!=j&&(v=h.getLine(--j),x=v.lastIndexOf(s)),-1==w||-1==x||!/comment/.test(h.getTokenTypeAt(e(k,w+1)))||!/comment/.test(h.getTokenTypeAt(e(j,x+1))))return!1;var y=u.lastIndexOf(r,a.ch),z=-1==y?-1:u.slice(0,a.ch).indexOf(s,y+r.length);if(-1!=y&&-1!=z&&z+s.length!=a.ch)return!1;z=v.indexOf(s,b.ch);var A=v.slice(b.ch).lastIndexOf(r,z-b.ch);return y=-1==z||-1==A?-1:b.ch+A,-1!=z&&-1!=y&&y!=b.ch?!1:(h.operation(function(){h.replaceRange("",e(j,x-(n&&v.slice(x-n.length,x)==n?n.length:0)),e(j,x+s.length));var a=w+r.length;if(n&&u.slice(a,a+n.length)==n&&(a+=n.length),h.replaceRange("",e(k,w),e(k,a)),t)for(var b=k+1;j>=b;++b){var c=h.getLine(b),f=c.indexOf(t);if(-1!=f&&!d.test(c.slice(0,f))){var g=f+t.length;n&&c.slice(g,g+n.length)==n&&(g+=n.length),h.replaceRange("",e(b,f),e(b,g))}}}),!0)})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/comment/continuecomment.min.js b/media/editors/codemirror/addon/comment/continuecomment.min.js -index 78c6566..36236db 100644 ---- a/media/editors/codemirror/addon/comment/continuecomment.min.js -+++ b/media/editors/codemirror/addon/comment/continuecomment.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(n){if(n.getOption("disableInput"))return e.Pass;for(var o,i=n.listSelections(),r=[],l=0;l=u);else if(0==s.string.indexOf(o.blockCommentStart)){if(f=d.slice(0,s.start),!/^\s*$/.test(f)){f="";for(var C=0;Cs.start&&/^\s*$/.test(d.slice(0,a))&&(f=d.slice(0,a));null!=f&&(f+=o.blockCommentContinue)}if(null==f&&o.lineComment&&t(n)){var g=n.getLine(m.line),a=g.indexOf(o.lineComment);a>-1&&(f=g.slice(0,a),/\S/.test(f)?f=null:f+=o.lineComment+g.slice(a+o.lineComment.length).match(/^\s*/)[0])}if(null==f)return e.Pass;r[l]="\n"+f}n.operation(function(){for(var e=i.length-1;e>=0;e--)n.replaceRange(r[e],i[e].from(),i[e].to(),"+insert")})}function t(e){var n=e.getOption("continueComments");return n&&"object"==typeof n?n.continueLineComment!==!1:!0}for(var o=["clike","css","javascript"],i=0;i=m);else if(0==i.string.indexOf(d.blockCommentStart)){if(k=n.slice(0,i.start),!/^\s*$/.test(k)){k="";for(var o=0;oi.start&&/^\s*$/.test(n.slice(0,l))&&(k=n.slice(0,l));null!=k&&(k+=d.blockCommentContinue)}if(null==k&&d.lineComment&&c(b)){var p=b.getLine(h.line),l=p.indexOf(d.lineComment);l>-1&&(k=p.slice(0,l),/\S/.test(k)?k=null:k+=d.lineComment+p.slice(l+d.lineComment.length).match(/^\s*/)[0])}if(null==k)return a.Pass;f[g]="\n"+k}b.operation(function(){for(var a=e.length-1;a>=0;a--)b.replaceRange(f[a],e[a].from(),e[a].to(),"+insert")})}function c(a){var b=a.getOption("continueComments");return b&&"object"==typeof b?b.continueLineComment!==!1:!0}for(var d=["clike","css","javascript"],e=0;e=s&&u()},200)}),e.on(p,"focus",function(){++s})}}),e.defineExtension("openNotification",function(t,i){function r(){c||(c=!0,clearTimeout(u),l.parentNode.removeChild(l))}n(this,r);var u,l=o(this,t,i&&i.bottom),c=!1,f=i&&"undefined"!=typeof i.duration?i.duration:5e3;return e.on(l,"click",function(o){e.e_preventDefault(o),r()}),f&&(u=setTimeout(r,f)),r})}); -\ 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,c){var d,e=a.getWrapperElement();return d=e.appendChild(document.createElement("div")),c?d.className="CodeMirror-dialog CodeMirror-dialog-bottom":d.className="CodeMirror-dialog CodeMirror-dialog-top","string"==typeof b?d.innerHTML=b:d.appendChild(b),d}function c(a,b){a.state.currentNotificationClose&&a.state.currentNotificationClose(),a.state.currentNotificationClose=b}a.defineExtension("openDialog",function(d,e,f){function g(a){if("string"==typeof a)l.value=a;else{if(j)return;j=!0,i.parentNode.removeChild(i),k.focus(),f.onClose&&f.onClose(i)}}f||(f={}),c(this,null);var h,i=b(this,d,f.bottom),j=!1,k=this,l=i.getElementsByTagName("input")[0];return l?(f.value&&(l.value=f.value,f.selectValueOnOpen!==!1&&l.select()),f.onInput&&a.on(l,"input",function(a){f.onInput(a,l.value,g)}),f.onKeyUp&&a.on(l,"keyup",function(a){f.onKeyUp(a,l.value,g)}),a.on(l,"keydown",function(b){f&&f.onKeyDown&&f.onKeyDown(b,l.value,g)||((27==b.keyCode||f.closeOnEnter!==!1&&13==b.keyCode)&&(l.blur(),a.e_stop(b),g()),13==b.keyCode&&e(l.value,b))}),f.closeOnBlur!==!1&&a.on(l,"blur",g),l.focus()):(h=i.getElementsByTagName("button")[0])&&(a.on(h,"click",function(){g(),k.focus()}),f.closeOnBlur!==!1&&a.on(h,"blur",g),h.focus()),g}),a.defineExtension("openConfirm",function(d,e,f){function g(){j||(j=!0,h.parentNode.removeChild(h),k.focus())}c(this,null);var h=b(this,d,f&&f.bottom),i=h.getElementsByTagName("button"),j=!1,k=this,l=1;i[0].focus();for(var m=0;m=l&&g()},200)}),a.on(n,"focus",function(){++l})}}),a.defineExtension("openNotification",function(d,e){function f(){i||(i=!0,clearTimeout(g),h.parentNode.removeChild(h))}c(this,f);var g,h=b(this,d,e&&e.bottom),i=!1,j=e&&"undefined"!=typeof e.duration?e.duration:5e3;return a.on(h,"click",function(b){a.e_preventDefault(b),f()}),j&&(g=setTimeout(f,j)),f})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/display/fullscreen.min.js b/media/editors/codemirror/addon/display/fullscreen.min.js -index 647a060..2c97706 100644 ---- a/media/editors/codemirror/addon/display/fullscreen.min.js -+++ b/media/editors/codemirror/addon/display/fullscreen.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function o(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var o=e.state.fullScreenRestore;t.style.width=o.width,t.style.height=o.height,window.scrollTo(o.scrollLeft,o.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,l,i){i==e.Init&&(i=!1),!i!=!l&&(l?t(r):o(r))})}); -\ 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){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))})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/display/panel.js b/media/editors/codemirror/addon/display/panel.js -index 22c0453..ba29484 100644 ---- a/media/editors/codemirror/addon/display/panel.js -+++ b/media/editors/codemirror/addon/display/panel.js -@@ -10,13 +10,31 @@ - mod(CodeMirror); - })(function(CodeMirror) { - CodeMirror.defineExtension("addPanel", function(node, options) { -+ options = options || {}; -+ - if (!this.state.panels) initPanels(this); - - var info = this.state.panels; -- if (options && options.position == "bottom") -- info.wrapper.appendChild(node); -- else -- info.wrapper.insertBefore(node, info.wrapper.firstChild); -+ var wrapper = info.wrapper; -+ var cmWrapper = this.getWrapperElement(); -+ -+ if (options.after instanceof Panel && !options.after.cleared) { -+ wrapper.insertBefore(node, options.before.node.nextSibling); -+ } else if (options.before instanceof Panel && !options.before.cleared) { -+ wrapper.insertBefore(node, options.before.node); -+ } else if (options.replace instanceof Panel && !options.replace.cleared) { -+ wrapper.insertBefore(node, options.replace.node); -+ options.replace.clear(); -+ } else if (options.position == "bottom") { -+ wrapper.appendChild(node); -+ } else if (options.position == "before-bottom") { -+ wrapper.insertBefore(node, cmWrapper.nextSibling); -+ } else if (options.position == "after-top") { -+ wrapper.insertBefore(node, cmWrapper); -+ } else { -+ wrapper.insertBefore(node, wrapper.firstChild); -+ } -+ - var height = (options && options.height) || node.offsetHeight; - this._setSize(null, info.heightLeft -= height); - info.panels++; -diff --git a/media/editors/codemirror/addon/display/panel.min.js b/media/editors/codemirror/addon/display/panel.min.js -index 83e2a84..b62dcd0 100644 ---- a/media/editors/codemirror/addon/display/panel.min.js -+++ b/media/editors/codemirror/addon/display/panel.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i,r){this.cm=e,this.node=t,this.options=i,this.height=r,this.cleared=!1}function i(e){var t=e.getWrapperElement(),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r=parseInt(i.height),s=e.state.panels={setHeight:t.style.height,heightLeft:r,panels:0,wrapper:document.createElement("div")};t.parentNode.insertBefore(s.wrapper,t);var n=e.hasFocus();s.wrapper.appendChild(t),n&&e.focus(),e._setSize=e.setSize,null!=r&&(e.setSize=function(t,i){if(null==i)return this._setSize(t,i);if(s.setHeight=i,"number"!=typeof i){var n=/^(\d+\.?\d*)px$/.exec(i);n?i=Number(n[1]):(s.wrapper.style.height=i,i=s.wrapper.offsetHeight,s.wrapper.style.height="")}e._setSize(t,s.heightLeft+=i-r),r=i})}function r(e){var t=e.state.panels;e.state.panels=null;var i=e.getWrapperElement();t.wrapper.parentNode.replaceChild(i,t.wrapper),i.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}e.defineExtension("addPanel",function(e,r){this.state.panels||i(this);var s=this.state.panels;r&&"bottom"==r.position?s.wrapper.appendChild(e):s.wrapper.insertBefore(e,s.wrapper.firstChild);var n=r&&r.height||e.offsetHeight;return this._setSize(null,s.heightLeft-=n),s.panels++,new t(this,e,r,n)}),t.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var e=this.cm.state.panels;this.cm._setSize(null,e.heightLeft+=this.height),e.wrapper.removeChild(this.node),0==--e.panels&&r(this.cm)}},t.prototype.changed=function(e){var t=null==e?this.node.offsetHeight:e,i=this.cm.state.panels;this.cm._setSize(null,i.height+=t-this.height),this.height=t}}); -\ 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,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()}a.defineExtension("addPanel",function(a,d){d=d||{},this.state.panels||c(this);var e=this.state.panels,f=e.wrapper,g=this.getWrapperElement();d.after instanceof b&&!d.after.cleared?f.insertBefore(a,d.before.node.nextSibling):d.before instanceof b&&!d.before.cleared?f.insertBefore(a,d.before.node):d.replace instanceof b&&!d.replace.cleared?(f.insertBefore(a,d.replace.node),d.replace.clear()):"bottom"==d.position?f.appendChild(a):"before-bottom"==d.position?f.insertBefore(a,g.nextSibling):"after-top"==d.position?f.insertBefore(a,g):f.insertBefore(a,f.firstChild);var h=d&&d.height||a.offsetHeight;return this._setSize(null,e.heightLeft-=h),e.panels++,new b(this,a,d,h)}),b.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var a=this.cm.state.panels;this.cm._setSize(null,a.heightLeft+=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.height+=b-this.height),this.height=b}}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/display/placeholder.min.js b/media/editors/codemirror/addon/display/placeholder.min.js -index 8bd912c..862fcb1 100644 ---- a/media/editors/codemirror/addon/display/placeholder.min.js -+++ b/media/editors/codemirror/addon/display/placeholder.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function o(e){r(e);var o=e.state.placeholder=document.createElement("pre");o.style.cssText="height: 0; overflow: visible",o.className="CodeMirror-placeholder",o.appendChild(document.createTextNode(e.getOption("placeholder"))),e.display.lineSpace.insertBefore(o,e.display.lineSpace.firstChild)}function t(e){n(e)&&o(e)}function l(e){var t=e.getWrapperElement(),l=n(e);t.className=t.className.replace(" CodeMirror-empty","")+(l?" CodeMirror-empty":""),l?o(e):r(e)}function n(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(o,n,a){var i=a&&a!=e.Init;if(n&&!i)o.on("blur",t),o.on("change",l),l(o);else if(!n&&i){o.off("blur",t),o.off("change",l),r(o);var c=o.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}n&&!o.hasFocus()&&t(o)})}); -\ 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){a.state.placeholder&&(a.state.placeholder.parentNode.removeChild(a.state.placeholder),a.state.placeholder=null)}function c(a){b(a);var c=a.state.placeholder=document.createElement("pre");c.style.cssText="height: 0; overflow: visible",c.className="CodeMirror-placeholder",c.appendChild(document.createTextNode(a.getOption("placeholder"))),a.display.lineSpace.insertBefore(c,a.display.lineSpace.firstChild)}function d(a){f(a)&&c(a)}function e(a){var d=a.getWrapperElement(),e=f(a);d.className=d.className.replace(" CodeMirror-empty","")+(e?" CodeMirror-empty":""),e?c(a):b(a)}function f(a){return 1===a.lineCount()&&""===a.getLine(0)}a.defineOption("placeholder","",function(c,f,g){var h=g&&g!=a.Init;if(f&&!h)c.on("blur",d),c.on("change",e),e(c);else if(!f&&h){c.off("blur",d),c.off("change",e),b(c);var i=c.getWrapperElement();i.className=i.className.replace(" CodeMirror-empty","")}f&&!c.hasFocus()&&d(c)})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/display/rulers.js b/media/editors/codemirror/addon/display/rulers.js -index 13185d3..01f6566 100644 ---- a/media/editors/codemirror/addon/display/rulers.js -+++ b/media/editors/codemirror/addon/display/rulers.js -@@ -38,7 +38,7 @@ - for (var i = 0; i < val.length; i++) { - var elt = document.createElement("div"); - elt.className = "CodeMirror-ruler"; -- var col, cls = null, conf = val[i]; -+ var col, conf = val[i]; - if (typeof conf == "number") { - col = conf; - } else { -@@ -47,7 +47,6 @@ - if (conf.color) elt.style.borderColor = conf.color; - if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle; - if (conf.width) elt.style.borderLeftWidth = conf.width; -- cls = val[i].className; - } - elt.style.left = (left + col * cw) + "px"; - elt.style.top = "-50px"; -diff --git a/media/editors/codemirror/addon/display/rulers.min.js b/media/editors/codemirror/addon/display/rulers.min.js -index 9b419cb..a047c3f 100644 ---- a/media/editors/codemirror/addon/display/rulers.min.js -+++ b/media/editors/codemirror/addon/display/rulers.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function r(e){for(var r=e.display.lineSpace.childNodes.length-1;r>=0;r--){var o=e.display.lineSpace.childNodes[r];/(^|\s)CodeMirror-ruler($|\s)/.test(o.className)&&o.parentNode.removeChild(o)}}function o(r){for(var o=r.getOption("rulers"),t=r.defaultCharWidth(),l=r.charCoords(e.Pos(r.firstLine(),0),"div").left,i=r.display.scroller.offsetHeight+30,s=0;s=0;b--){var c=a.display.lineSpace.childNodes[b];/(^|\s)CodeMirror-ruler($|\s)/.test(c.className)&&c.parentNode.removeChild(c)}}function c(b){for(var c=b.getOption("rulers"),d=b.defaultCharWidth(),e=b.charCoords(a.Pos(b.firstLine(),0),"div").left,f=b.display.scroller.offsetHeight+30,g=0;g= 0; i--) { -+ var cur = ranges[i].head; -+ cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); -+ } -+ } -+ -+ function handleEnter(cm) { -+ var conf = getConfig(cm); -+ var explode = conf && getOption(conf, "explode"); -+ if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass; -+ -+ var ranges = cm.listSelections(); -+ for (var i = 0; i < ranges.length; i++) { -+ if (!ranges[i].empty()) return CodeMirror.Pass; -+ var around = charsAround(cm, ranges[i].head); -+ if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass; -+ } -+ cm.operation(function() { -+ cm.replaceSelection("\n\n", null); -+ cm.execCommand("goCharLeft"); -+ ranges = cm.listSelections(); -+ for (var i = 0; i < ranges.length; i++) { -+ var line = ranges[i].head.line; -+ cm.indentLine(line, null, true); -+ cm.indentLine(line + 1, null, true); -+ } -+ }); -+ } -+ -+ function handleChar(cm, ch) { -+ var conf = getConfig(cm); -+ if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; -+ -+ var pairs = getOption(conf, "pairs"); -+ var pos = pairs.indexOf(ch); -+ if (pos == -1) return CodeMirror.Pass; -+ var triples = getOption(conf, "triples"); -+ -+ var identical = pairs.charAt(pos + 1) == ch; -+ var ranges = cm.listSelections(); -+ var opening = pos % 2 == 0; -+ -+ var type, next; -+ for (var i = 0; i < ranges.length; i++) { -+ var range = ranges[i], cur = range.head, curType; -+ var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); -+ if (opening && !range.empty()) { -+ curType = "surround"; -+ } else if ((identical || !opening) && next == ch) { -+ if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch) -+ curType = "skipThree"; -+ else -+ curType = "skip"; -+ } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && -+ cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch && -+ (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) { -+ curType = "addFour"; -+ } else if (identical) { -+ if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both"; -+ else return CodeMirror.Pass; -+ } else if (opening && (cm.getLine(cur.line).length == cur.ch || -+ isClosingBracket(next, pairs) || -+ /\s/.test(next))) { -+ curType = "both"; -+ } else { -+ return CodeMirror.Pass; -+ } -+ if (!type) type = curType; -+ else if (type != curType) return CodeMirror.Pass; -+ } -+ -+ var left = pos % 2 ? pairs.charAt(pos - 1) : ch; -+ var right = pos % 2 ? ch : pairs.charAt(pos + 1); -+ cm.operation(function() { -+ if (type == "skip") { -+ cm.execCommand("goCharRight"); -+ } else if (type == "skipThree") { -+ for (var i = 0; i < 3; i++) -+ cm.execCommand("goCharRight"); -+ } else if (type == "surround") { -+ var sels = cm.getSelections(); -+ for (var i = 0; i < sels.length; i++) -+ sels[i] = left + sels[i] + right; -+ cm.replaceSelections(sels, "around"); -+ } else if (type == "both") { -+ cm.replaceSelection(left + right, null); -+ cm.triggerElectric(left + right); -+ cm.execCommand("goCharLeft"); -+ } else if (type == "addFour") { -+ cm.replaceSelection(left + left + left + left, "before"); -+ cm.execCommand("goCharRight"); -+ } -+ }); -+ } -+ -+ function isClosingBracket(ch, pairs) { -+ var pos = pairs.lastIndexOf(ch); -+ return pos > -1 && pos % 2 == 1; -+ } -+ - function charsAround(cm, pos) { - var str = cm.getRange(Pos(pos.line, pos.ch - 1), - Pos(pos.line, pos.ch + 1)); -@@ -53,109 +182,4 @@ - stream.start = stream.pos; - } - } -- -- function buildKeymap(pairs, triples) { -- var map = { -- name : "autoCloseBrackets", -- Backspace: function(cm) { -- if (cm.getOption("disableInput")) return CodeMirror.Pass; -- var ranges = cm.listSelections(); -- for (var i = 0; i < ranges.length; i++) { -- if (!ranges[i].empty()) return CodeMirror.Pass; -- var around = charsAround(cm, ranges[i].head); -- if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; -- } -- for (var i = ranges.length - 1; i >= 0; i--) { -- var cur = ranges[i].head; -- cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); -- } -- } -- }; -- var closingBrackets = ""; -- for (var i = 0; i < pairs.length; i += 2) (function(left, right) { -- closingBrackets += right; -- map["'" + left + "'"] = function(cm) { -- if (cm.getOption("disableInput")) return CodeMirror.Pass; -- var ranges = cm.listSelections(), type, next; -- for (var i = 0; i < ranges.length; i++) { -- var range = ranges[i], cur = range.head, curType; -- var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); -- if (!range.empty()) { -- curType = "surround"; -- } else if (left == right && next == right) { -- if (cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == left + left + left) -- curType = "skipThree"; -- else -- curType = "skip"; -- } else if (left == right && cur.ch > 1 && triples.indexOf(left) >= 0 && -- cm.getRange(Pos(cur.line, cur.ch - 2), cur) == left + left && -- (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != left)) { -- curType = "addFour"; -- } else if (left == '"' || left == "'") { -- if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, left)) curType = "both"; -- else return CodeMirror.Pass; -- } else if (cm.getLine(cur.line).length == cur.ch || closingBrackets.indexOf(next) >= 0 || SPACE_CHAR_REGEX.test(next)) { -- curType = "both"; -- } else { -- return CodeMirror.Pass; -- } -- if (!type) type = curType; -- else if (type != curType) return CodeMirror.Pass; -- } -- -- cm.operation(function() { -- if (type == "skip") { -- cm.execCommand("goCharRight"); -- } else if (type == "skipThree") { -- for (var i = 0; i < 3; i++) -- cm.execCommand("goCharRight"); -- } else if (type == "surround") { -- var sels = cm.getSelections(); -- for (var i = 0; i < sels.length; i++) -- sels[i] = left + sels[i] + right; -- cm.replaceSelections(sels, "around"); -- } else if (type == "both") { -- cm.replaceSelection(left + right, null); -- cm.execCommand("goCharLeft"); -- } else if (type == "addFour") { -- cm.replaceSelection(left + left + left + left, "before"); -- cm.execCommand("goCharRight"); -- } -- }); -- }; -- if (left != right) map["'" + right + "'"] = function(cm) { -- var ranges = cm.listSelections(); -- for (var i = 0; i < ranges.length; i++) { -- var range = ranges[i]; -- if (!range.empty() || -- cm.getRange(range.head, Pos(range.head.line, range.head.ch + 1)) != right) -- return CodeMirror.Pass; -- } -- cm.execCommand("goCharRight"); -- }; -- })(pairs.charAt(i), pairs.charAt(i + 1)); -- return map; -- } -- -- function buildExplodeHandler(pairs) { -- return function(cm) { -- if (cm.getOption("disableInput")) return CodeMirror.Pass; -- var ranges = cm.listSelections(); -- for (var i = 0; i < ranges.length; i++) { -- if (!ranges[i].empty()) return CodeMirror.Pass; -- var around = charsAround(cm, ranges[i].head); -- if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; -- } -- cm.operation(function() { -- cm.replaceSelection("\n\n", null); -- cm.execCommand("goCharLeft"); -- ranges = cm.listSelections(); -- for (var i = 0; i < ranges.length; i++) { -- var line = ranges[i].head.line; -- cm.indentLine(line, null, true); -- cm.indentLine(line + 1, null, true); -- } -- }); -- }; -- } - }); -diff --git a/media/editors/codemirror/addon/edit/closebrackets.min.js b/media/editors/codemirror/addon/edit/closebrackets.min.js -index e90d29b..72db8a7 100644 ---- a/media/editors/codemirror/addon/edit/closebrackets.min.js -+++ b/media/editors/codemirror/addon/edit/closebrackets.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(e,n){var t=e.getRange(c(n.line,n.ch-1),c(n.line,n.ch+1));return 2==t.length?t:null}function t(n,t,r){var i=n.getLine(t.line),o=n.getTokenAt(t);if(/\bstring2?\b/.test(o.type))return!1;var a=new e.StringStream(i.slice(0,t.ch)+r+i.slice(t.ch),4);for(a.pos=a.start=o.start;;){var l=n.getMode().token(a,o.state);if(a.pos>=t.ch+1)return/\bstring2?\b/.test(l);a.start=a.pos}}function r(r,i){for(var o={name:"autoCloseBrackets",Backspace:function(t){if(t.getOption("disableInput"))return e.Pass;for(var i=t.listSelections(),o=0;o=0;o--){var l=i[o].head;t.replaceRange("",c(l.line,l.ch-1),c(l.line,l.ch+1))}}},a="",l=0;l1&&i.indexOf(n)>=0&&o.getRange(c(p.line,p.ch-2),p)==n+n&&(p.ch<=2||o.getRange(c(p.line,p.ch-3),c(p.line,p.ch-2))!=n))d="addFour";else if('"'==n||"'"==n){if(e.isWordChar(f)||!t(o,p,n))return e.Pass;d="both"}else{if(!(o.getLine(p.line).length==p.ch||a.indexOf(f)>=0||s.test(f)))return e.Pass;d="both"}else d="surround";if(l){if(l!=d)return e.Pass}else l=d}o.operation(function(){if("skip"==l)o.execCommand("goCharRight");else if("skipThree"==l)for(var e=0;3>e;e++)o.execCommand("goCharRight");else if("surround"==l){for(var t=o.getSelections(),e=0;e=0;h--){var k=g[h].head;c.replaceRange("",l(k.line,k.ch-1),l(k.line,k.ch+1))}}function f(c){var e=d(c),f=e&&b(e,"explode");if(!f||c.getOption("disableInput"))return a.Pass;for(var g=c.listSelections(),h=0;h1&&n.indexOf(e)>=0&&c.getRange(l(u.line,u.ch-2),u)==e+e&&(u.ch<=2||c.getRange(l(u.line,u.ch-3),l(u.line,u.ch-2))!=e))s="addFour";else if(o){if(a.isWordChar(m)||!j(c,u,e))return a.Pass;s="both"}else{if(!q||c.getLine(u.line).length!=u.ch&&!h(m,g)&&!/\s/.test(m))return a.Pass;s="both"}else s=n.indexOf(e)>=0&&c.getRange(u,l(u.line,u.ch+3))==e+e+e?"skipThree":"skip";if(k){if(k!=s)return a.Pass}else k=s}var v=i%2?g.charAt(i-1):e,w=i%2?e:g.charAt(i+1);c.operation(function(){if("skip"==k)c.execCommand("goCharRight");else if("skipThree"==k)for(var a=0;3>a;a++)c.execCommand("goCharRight");else if("surround"==k){for(var b=c.getSelections(),a=0;a-1&&c%2==1}function i(a,b){var c=a.getRange(l(b.line,b.ch-1),l(b.line,b.ch+1));return 2==c.length?c:null}function j(b,c,d){var e=b.getLine(c.line),f=b.getTokenAt(c);if(/\bstring2?\b/.test(f.type))return!1;var g=new a.StringStream(e.slice(0,c.ch)+d+e.slice(c.ch),4);for(g.pos=g.start=f.start;;){var h=b.getMode().token(g,f.state);if(g.pos>=c.ch+1)return/\bstring2?\b/.test(h);g.start=g.pos}}var k={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},l=a.Pos;a.defineOption("autoCloseBrackets",!1,function(b,c,d){d&&d!=a.Init&&(b.removeKeyMap(n),b.state.closeBrackets=null),c&&(b.state.closeBrackets=c,b.addKeyMap(n))});for(var m=k.pairs+"`",n={Backspace:e,Enter:f},o=0;oc.ch&&(v=v.slice(0,v.length-d.end+c.ch));var b=v.toLowerCase();if(!v||"string"==d.type&&(d.end!=c.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&"closeTag"==g.type||d.string.indexOf("/")==d.string.length-1||h&&r(h,b)>-1||a(t,v,c,g,!0))return e.Pass;var y=p&&r(p,b)>-1;o[l]={indent:y,text:">"+(y?"\n\n":"")+"",newPos:y?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=n.length-1;l>=0;l--){var x=o[l];t.replaceRange(x.text,n[l].head,n[l].anchor,"+insert");var P=t.listSelections().slice(0);P[l]={head:x.newPos,anchor:x.newPos},t.setSelections(P),x.indent&&(t.indentLine(x.newPos.line,null,!0),t.indentLine(x.newPos.line+1,null,!0))}}function n(t,n){for(var o=t.listSelections(),r=[],i=n?"/":"";else{if("htmlmixed"!=t.getMode().name||"css"!=d.mode.name)return e.Pass;r[s]=i+"style>"}else{if(!f.context||!f.context.tagName||a(t,f.context.tagName,l,f))return e.Pass;r[s]=i+f.context.tagName+">"}}t.replaceSelections(r),o=t.listSelections();for(var s=0;sn;++n)if(e[n]==t)return n;return-1}function a(t,n,o,r,a){if(!e.scanForClosingTag)return!1;var i=Math.min(t.lastLine()+1,o.line+500),s=e.scanForClosingTag(t,o,null,i);if(!s||s.tag!=n)return!1;for(var l=r.context,c=a?1:0;l&&l.tagName==n;l=l.prev)++c;o=s.to;for(var d=1;c>d;d++){var f=e.scanForClosingTag(t,o,null,i);if(!f||f.tag!=n)return!1;o=f.to}return!0}e.defineOption("autoCloseTags",!1,function(n,r,a){if(a!=e.Init&&a&&n.removeKeyMap("autoCloseTags"),r){var i={name:"autoCloseTags"};("object"!=typeof r||r.whenClosing)&&(i["'/'"]=function(e){return o(e)}),("object"!=typeof r||r.whenOpening)&&(i["'>'"]=function(e){return t(e)}),n.addKeyMap(i)}});var i=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],s=["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"];e.commands.closeTag=function(e){return n(e)}}); -\ No newline at end of file -+!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=0;ij.ch&&(r=r.slice(0,r.length-k.end+j.ch));var s=r.toLowerCase();if(!r||"string"==k.type&&(k.end!=j.ch||!/[\"\']/.test(k.string.charAt(k.string.length-1))||1==k.string.length)||"tag"==k.type&&"closeTag"==m.type||k.string.indexOf("/")==k.string.length-1||p&&e(p,s)>-1||f(b,r,j,m,!0))return a.Pass;var t=q&&e(q,s)>-1;d[i]={indent:t,text:">"+(t?"\n\n":"")+"",newPos:t?a.Pos(j.line+1,0):a.Pos(j.line,j.ch+1)}}for(var i=c.length-1;i>=0;i--){var u=d[i];b.replaceRange(u.text,c[i].head,c[i].anchor,"+insert");var v=b.listSelections().slice(0);v[i]={head:u.newPos,anchor:u.newPos},b.setSelections(v),u.indent&&(b.indentLine(u.newPos.line,null,!0),b.indentLine(u.newPos.line+1,null,!0))}}function c(b,c){for(var d=b.listSelections(),e=[],g=c?"/":"";else{if("htmlmixed"!=b.getMode().name||"css"!=k.mode.name)return a.Pass;e[h]=g+"style>"}else{if(!l.context||!l.context.tagName||f(b,l.context.tagName,i,l))return a.Pass;e[h]=g+l.context.tagName+">"}}b.replaceSelections(e),d=b.listSelections();for(var h=0;hc;++c)if(a[c]==b)return c;return-1}function f(b,c,d,e,f){if(!a.scanForClosingTag)return!1;var g=Math.min(b.lastLine()+1,d.line+500),h=a.scanForClosingTag(b,d,null,g);if(!h||h.tag!=c)return!1;for(var i=e.context,j=f?1:0;i&&i.tagName==c;i=i.prev)++j;d=h.to;for(var k=1;j>k;k++){var l=a.scanForClosingTag(b,d,null,g);if(!l||l.tag!=c)return!1;d=l.to}return!0}a.defineOption("autoCloseTags",!1,function(c,e,f){if(f!=a.Init&&f&&c.removeKeyMap("autoCloseTags"),e){var g={name:"autoCloseTags"};("object"!=typeof e||e.whenClosing)&&(g["'/'"]=function(a){return d(a)}),("object"!=typeof e||e.whenOpening)&&(g["'>'"]=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)}}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/edit/continuelist.js b/media/editors/codemirror/addon/edit/continuelist.js -index ca8d267..86de49c 100644 ---- a/media/editors/codemirror/addon/edit/continuelist.js -+++ b/media/editors/codemirror/addon/edit/continuelist.js -@@ -19,23 +19,23 @@ - if (cm.getOption("disableInput")) return CodeMirror.Pass; - var ranges = cm.listSelections(), replacements = []; - for (var i = 0; i < ranges.length; i++) { -- var pos = ranges[i].head, match; -+ var pos = ranges[i].head; - var eolState = cm.getStateAfter(pos.line); - var inList = eolState.list !== false; -- var inQuote = eolState.quote !== false; -+ var inQuote = eolState.quote !== 0; - -- if (!ranges[i].empty() || (!inList && !inQuote) || !(match = cm.getLine(pos.line).match(listRE))) { -+ var line = cm.getLine(pos.line), match = listRE.exec(line); -+ if (!ranges[i].empty() || (!inList && !inQuote) || !match) { - cm.execCommand("newlineAndIndent"); - return; - } -- if (cm.getLine(pos.line).match(emptyListRE)) { -+ if (emptyListRE.test(line)) { - cm.replaceRange("", { - line: pos.line, ch: 0 - }, { - line: pos.line, ch: pos.ch + 1 - }); - replacements[i] = "\n"; -- - } else { - var indent = match[1], after = match[4]; - var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 -diff --git a/media/editors/codemirror/addon/edit/continuelist.min.js b/media/editors/codemirror/addon/edit/continuelist.min.js -index c64320e..95c28fa 100644 ---- a/media/editors/codemirror/addon/edit/continuelist.min.js -+++ b/media/editors/codemirror/addon/edit/continuelist.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var n=/^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\s*)/,t=/^(\s*)(>[> ]*|[*+-]|(\d+)\.)(\s*)$/,i=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return e.Pass;for(var r=o.listSelections(),d=[],l=0;l")>=0?s[2]:parseInt(s[3],10)+1+".";d[l]="\n"+m+h+p}}o.replaceSelections(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";var b=/^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\s*)/,c=/^(\s*)(>[> ]*|[*+-]|(\d+)\.)(\s*)$/,d=/[*+-]\s/;a.commands.newlineAndIndentContinueMarkdownList=function(e){if(e.getOption("disableInput"))return a.Pass;for(var f=e.listSelections(),g=[],h=0;h")>=0?n[2]:parseInt(n[3],10)+1+".";g[h]="\n"+o+q+p}}e.replaceSelections(g)}}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/edit/matchbrackets.min.js b/media/editors/codemirror/addon/edit/matchbrackets.min.js -index 0ed4a5a..7a0e0c0 100644 ---- a/media/editors/codemirror/addon/edit/matchbrackets.min.js -+++ b/media/editors/codemirror/addon/edit/matchbrackets.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i,r){var o=e.getLineHandle(t.line),f=t.ch-1,l=f>=0&&c[o.text.charAt(f)]||c[o.text.charAt(++f)];if(!l)return null;var u=">"==l.charAt(1)?1:-1;if(i&&u>0!=(f==t.ch))return null;var h=e.getTokenTypeAt(a(t.line,f+1)),s=n(e,a(t.line,f+(u>0?1:0)),u,h||null,r);return null==s?null:{from:a(t.line,f),to:s&&s.pos,match:s&&s.ch==l.charAt(0),forward:u>0}}function n(e,t,n,i,r){for(var o=r&&r.maxScanLineLength||1e4,f=r&&r.maxScanLines||1e3,l=[],u=r&&r.bracketRegex?r.bracketRegex:/[(){}[\]]/,h=n>0?Math.min(t.line+f,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-f),s=t.line;s!=h;s+=n){var m=e.getLine(s);if(m){var d=n>0?0:m.length-1,g=n>0?m.length:-1;if(!(m.length>o))for(s==t.line&&(d=t.ch-(0>n?1:0));d!=g;d+=n){var p=m.charAt(d);if(u.test(p)&&(void 0===i||e.getTokenTypeAt(a(s,d+1))==i)){var v=c[p];if(">"==v.charAt(1)==n>0)l.push(p);else{if(!l.length)return{pos:a(s,d),ch:p};l.pop()}}}}}return s-n==(n>0?e.lastLine():e.firstLine())?!1:null}function i(e,n,i){for(var r=e.state.matchBrackets.maxHighlightLineLength||1e3,c=[],f=e.listSelections(),l=0;l",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;e.defineOption("matchBrackets",!1,function(t,n,i){i&&i!=e.Init&&t.off("cursorActivity",r),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",r))}),e.defineExtension("matchBrackets",function(){i(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,i){return t(this,e,n,i)}),e.defineExtension("scanForBracket",function(e,t,i,r){return n(this,e,t,i,r)})}); -\ 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,d,e){var f=a.getLineHandle(b.line),i=b.ch-1,j=i>=0&&h[f.text.charAt(i)]||h[f.text.charAt(++i)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(d&&k>0!=(i==b.ch))return null;var l=a.getTokenTypeAt(g(b.line,i+1)),m=c(a,g(b.line,i+(k>0?1:0)),k,l||null,e);return null==m?null:{from:g(b.line,i),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-(0>c?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())?!1:null}function d(a,c,d){for(var e=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},i=null;a.defineOption("matchBrackets",!1,function(b,c,d){d&&d!=a.Init&&b.off("cursorActivity",e),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 b(this,a,c,d)}),a.defineExtension("scanForBracket",function(a,b,d,e){return c(this,a,b,d,e)})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/edit/matchtags.min.js b/media/editors/codemirror/addon/edit/matchtags.min.js -index ad512db..ed9b892 100644 ---- a/media/editors/codemirror/addon/edit/matchtags.min.js -+++ b/media/editors/codemirror/addon/edit/matchtags.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],t):t(CodeMirror)}(function(t){"use strict";function e(t){t.state.tagHit&&t.state.tagHit.clear(),t.state.tagOther&&t.state.tagOther.clear(),t.state.tagHit=t.state.tagOther=null}function a(a){a.state.failedTagMatch=!1,a.operation(function(){if(e(a),!a.somethingSelected()){var o=a.getCursor(),i=a.getViewport();i.from=Math.min(i.from,o.line),i.to=Math.max(o.line+1,i.to);var r=t.findMatchingTag(a,o,i);if(r){if(a.state.matchBothTags){var n="open"==r.at?r.open:r.close;n&&(a.state.tagHit=a.markText(n.from,n.to,{className:"CodeMirror-matchingtag"}))}var c="close"==r.at?r.open:r.close;c?a.state.tagOther=a.markText(c.from,c.to,{className:"CodeMirror-matchingtag"}):a.state.failedTagMatch=!0}}})}function o(t){t.state.failedTagMatch&&a(t)}t.defineOption("matchTags",!1,function(i,r,n){n&&n!=t.Init&&(i.off("cursorActivity",a),i.off("viewportChange",o),e(i)),r&&(i.state.matchBothTags="object"==typeof r&&r.bothTags,i.on("cursorActivity",a),i.on("viewportChange",o),a(i))}),t.commands.toMatchingTag=function(e){var a=t.findMatchingTag(e,e.getCursor());if(a){var o="close"==a.at?a.open:a.close;o&&e.extendSelection(o.to,o.from)}}}); -\ No newline at end of file -+!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)}}}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/edit/trailingspace.min.js b/media/editors/codemirror/addon/edit/trailingspace.min.js -index ce38681..3751c2c 100644 ---- a/media/editors/codemirror/addon/edit/trailingspace.min.js -+++ b/media/editors/codemirror/addon/edit/trailingspace.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineOption("showTrailingSpace",!1,function(i,n,o){o==e.Init&&(o=!1),o&&!n?i.removeOverlay("trailingspace"):!o&&n&&i.addOverlay({token:function(e){for(var i=e.string.length,n=i;n&&/\s/.test(e.string.charAt(n-1));--n);return n>e.pos?(e.pos=n,null):(e.pos=i,"trailingspace")},name:"trailingspace"})})}); -\ 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){a.defineOption("showTrailingSpace",!1,function(b,c,d){d==a.Init&&(d=!1),d&&!c?b.removeOverlay("trailingspace"):!d&&c&&b.addOverlay({token:function(a){for(var b=a.string.length,c=b;c&&/\s/.test(a.string.charAt(c-1));--c);return c>a.pos?(a.pos=c,null):(a.pos=b,"trailingspace")},name:"trailingspace"})})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/fold/brace-fold.min.js b/media/editors/codemirror/addon/fold/brace-fold.min.js -index 31806c3..f8b3056 100644 ---- a/media/editors/codemirror/addon/fold/brace-fold.min.js -+++ b/media/editors/codemirror/addon/fold/brace-fold.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(r,n){function t(t){for(var i=n.ch,s=0;;){var u=0>=i?-1:f.lastIndexOf(t,i-1);if(-1!=u){if(1==s&&u=v;++v)for(var p=r.getLine(v),m=v==l?i:0;;){var P=p.indexOf(s,m),k=p.indexOf(u,m);if(0>P&&(P=p.length),0>k&&(k=p.length),m=Math.min(P,k),m==p.length)break;if(r.getTokenTypeAt(e.Pos(v,m+1))==o)if(m==P)++c;else if(!--c){a=v,d=m;break e}++m}if(null!=a&&(l!=a||d!=i))return{from:e.Pos(l,i),to:e.Pos(a,d)}}}),e.registerHelper("fold","import",function(r,n){function t(n){if(nr.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));if(/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"keyword"!=t.type||"import"!=t.string)return null;for(var i=n,o=Math.min(r.lastLine(),n+10);o>=i;++i){var l=r.getLine(i),f=l.indexOf(";");if(-1!=f)return{startCh:t.end,end:e.Pos(i,f)}}}var i,n=n.line,o=t(n);if(!o||t(n-1)||(i=t(n-2))&&i.end.line==n-1)return null;for(var l=o.end;;){var f=t(l.line+1);if(null==f)break;l=f.end}return{from:r.clipPos(e.Pos(n,o.startCh+1)),to:l}}),e.registerHelper("fold","include",function(r,n){function t(n){if(nr.lastLine())return null;var t=r.getTokenAt(e.Pos(n,1));return/\S/.test(t.string)||(t=r.getTokenAt(e.Pos(n,t.end+1))),"meta"==t.type&&"#include"==t.string.slice(0,8)?t.start+8:void 0}var n=n.line,i=t(n);if(null==i||null!=t(n-1))return null;for(var o=n;;){var l=t(o+1);if(null==l)break;++o}return{from:e.Pos(n,i+1),to:r.clipPos(e.Pos(o))}})}); -\ 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.registerHelper("fold","brace",function(b,c){function d(d){for(var e=c.ch,i=0;;){var j=0>=e?-1:h.lastIndexOf(d,e-1);if(-1!=j){if(1==i&&j=o;++o)for(var p=b.getLine(o),q=o==g?e:0;;){var r=p.indexOf(i,q),s=p.indexOf(j,q);if(0>r&&(r=p.length),0>s&&(s=p.length),q=Math.min(r,s),q==p.length)break;if(b.getTokenTypeAt(a.Pos(o,q+1))==f)if(q==r)++m;else if(!--m){k=o,l=q;break a}++q}if(null!=k&&(g!=k||l!=e))return{from:a.Pos(g,e),to:a.Pos(k,l)}}}),a.registerHelper("fold","import",function(b,c){function d(c){if(cb.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);f>=e;++e){var g=b.getLine(e),h=g.indexOf(";");if(-1!=h)return{startCh:d.end,end:a.Pos(e,h)}}}var e,c=c.line,f=d(c);if(!f||d(c-1)||(e=d(c-2))&&e.end.line==c-1)return null;for(var g=f.end;;){var h=d(g.line+1);if(null==h)break;g=h.end}return{from:b.clipPos(a.Pos(c,f.startCh+1)),to:g}}),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 c=c.line,e=d(c);if(null==e||null!=d(c-1))return null;for(var f=c;;){var g=d(f+1);if(null==g)break;++f}return{from:a.Pos(c,e+1),to:b.clipPos(a.Pos(f))}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/fold/comment-fold.min.js b/media/editors/codemirror/addon/fold/comment-fold.min.js -index 3d68f5b..8cae02c 100644 ---- a/media/editors/codemirror/addon/fold/comment-fold.min.js -+++ b/media/editors/codemirror/addon/fold/comment-fold.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerGlobalHelper("fold","comment",function(e){return e.blockCommentStart&&e.blockCommentEnd},function(t,n){var o=t.getModeAt(n),r=o.blockCommentStart,i=o.blockCommentEnd;if(r&&i){for(var f,l=n.line,c=t.getLine(l),m=n.ch,a=0;;){var d=0>=m?-1:c.lastIndexOf(r,m-1);if(-1!=d){if(1==a&&d=h;++h)for(var k=t.getLine(h),v=h==l?f:0;;){var p=k.indexOf(r,v),C=k.indexOf(i,v);if(0>p&&(p=k.length),0>C&&(C=k.length),v=Math.min(p,C),v==k.length)break;if(v==p)++s;else if(!--s){u=h,b=v;break e}++v}if(null!=u&&(l!=u||b!=f))return{from:e.Pos(l,f),to:e.Pos(u,b)}}})}); -\ 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.registerGlobalHelper("fold","comment",function(a){return a.blockCommentStart&&a.blockCommentEnd},function(b,c){var d=b.getModeAt(c),e=d.blockCommentStart,f=d.blockCommentEnd;if(e&&f){for(var g,h=c.line,i=b.getLine(h),j=c.ch,k=0;;){var l=0>=j?-1:i.lastIndexOf(e,j-1);if(-1!=l){if(1==k&&l=q;++q)for(var r=b.getLine(q),s=q==h?g:0;;){var t=r.indexOf(e,s),u=r.indexOf(f,s);if(0>t&&(t=r.length),0>u&&(u=r.length),s=Math.min(t,u),s==r.length)break;if(s==t)++o;else if(!--o){m=q,n=s;break a}++s}if(null!=m&&(h!=m||n!=g))return{from:a.Pos(h,g),to:a.Pos(m,n)}}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/fold/foldcode.min.js b/media/editors/codemirror/addon/fold/foldcode.min.js -index 78f7915..d79993b 100644 ---- a/media/editors/codemirror/addon/fold/foldcode.min.js -+++ b/media/editors/codemirror/addon/fold/foldcode.min.js -@@ -1 +1 @@ --!function(n){"object"==typeof exports&&"object"==typeof module?n(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)}(function(n){"use strict";function o(o,i,t,f){function l(n){var e=d(o,i);if(!e||e.to.line-e.from.lineo.firstLine();)i=n.Pos(i.line-1,0),a=l(!1);if(a&&!a.cleared&&"unfold"!==f){var c=e(o,t);n.on(c,"mousedown",function(o){s.clear(),n.e_preventDefault(o)});var s=o.markText(a.from,a.to,{replacedWith:c,clearOnEnter:!0,__isFold:!0});s.on("clear",function(e,r){n.signal(o,"unfold",o,e,r)}),n.signal(o,"fold",o,a.from,a.to)}}function e(n,o){var e=r(n,o,"widget");if("string"==typeof e){var i=document.createTextNode(e);e=document.createElement("span"),e.appendChild(i),e.className="CodeMirror-foldmarker"}return e}function r(n,o,e){if(o&&void 0!==o[e])return o[e];var r=n.options.foldOptions;return r&&void 0!==r[e]?r[e]:i[e]}n.newFoldFunction=function(n,e){return function(r,i){o(r,i,{rangeFinder:n,widget:e})}},n.defineExtension("foldCode",function(n,e,r){o(this,n,e,r)}),n.defineExtension("isFolded",function(n){for(var o=this.findMarksAt(n),e=0;e=e;e++)o.foldCode(n.Pos(e,0),null,"fold")})},n.commands.unfoldAll=function(o){o.operation(function(){for(var e=o.firstLine(),r=o.lastLine();r>=e;e++)o.foldCode(n.Pos(e,0),null,"unfold")})},n.registerHelper("fold","combine",function(){var n=Array.prototype.slice.call(arguments,0);return function(o,e){for(var r=0;rb.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:!0,__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"}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=c;c++)b.foldCode(a.Pos(c,0),null,"fold")})},a.commands.unfoldAll=function(b){b.operation(function(){for(var c=b.firstLine(),d=b.lastLine();d>=c;c++)b.foldCode(a.Pos(c,0),null,"unfold")})},a.registerHelper("fold","combine",function(){var a=Array.prototype.slice.call(arguments,0);return function(b,c){for(var d=0;d=d&&(e=n(i.indicatorOpen))}o.setGutterMarker(t,i.gutter,e),++f})}function f(o){var t=o.getViewport(),e=o.state.foldGutter;e&&(o.operation(function(){i(o,t.from,t.to)}),e.from=t.from,e.to=t.to)}function d(o,t,e){var r=o.state.foldGutter;if(r){var n=r.options;e==n.gutter&&o.foldCode(c(t,0),n.rangeFinder)}}function a(o){var t=o.state.foldGutter;if(t){var e=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){f(o)},e.foldOnChangeTimeSpan||600)}}function u(o){var t=o.state.foldGutter;if(t){var e=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var e=o.getViewport();t.from==t.to||e.from-t.to>20||t.from-e.to>20?f(o):o.operation(function(){e.fromt.to&&(i(o,t.to,e.to),t.to=e.to)})},e.updateViewportTimeSpan||400)}}function l(o,t){var e=o.state.foldGutter;if(e){var r=t.line;r>=e.from&&r=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=u;++u){var d=t.getLine(u),s=r(d);if(s>f)l=u;else if(/\S/.test(d))break}return l?{from:e.Pos(n.line,o.length),to:e.Pos(l,t.getLine(l).length)}:void 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.registerHelper("fold","indent",function(b,c){var d=b.getOption("tabSize"),e=b.getLine(c.line);if(/\S/.test(e)){for(var f=function(b){return a.countColumn(b,null,d)},g=f(e),h=null,i=c.line+1,j=b.lastLine();j>=i;++i){var k=b.getLine(i),l=f(k);if(l>g)h=i;else if(/\S/.test(k))break}return h?{from:a.Pos(c.line,e.length),to:a.Pos(h,b.getLine(h).length)}:void 0}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/fold/markdown-fold.min.js b/media/editors/codemirror/addon/fold/markdown-fold.min.js -index e15ba76..10f647c 100644 ---- a/media/editors/codemirror/addon/fold/markdown-fold.min.js -+++ b/media/editors/codemirror/addon/fold/markdown-fold.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","markdown",function(n,t){function r(t){var r=n.getTokenTypeAt(e.Pos(t,0));return r&&/\bheader\b/.test(r)}function i(e,n,t){var i=n&&n.match(/^#+/);return i&&r(e)?i[0].length:(i=t&&t.match(/^[=\-]+\s*$/),i&&r(e+1)?"="==t[0]?1:2:o)}var o=100,f=n.getLine(t.line),l=n.getLine(t.line+1),c=i(t.line,f,l);if(c===o)return void 0;for(var u=n.lastLine(),d=t.line,a=n.getLine(d+2);u>d&&!(i(d+1,l,a)<=c);)++d,l=a,a=n.getLine(d+2);return{from:e.Pos(t.line,f.length),to:e.Pos(d,n.getLine(d).length)}})}); -\ 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.registerHelper("fold","markdown",function(b,c){function d(c){var d=b.getTokenTypeAt(a.Pos(c,0));return d&&/\bheader\b/.test(d)}function e(a,b,c){var e=b&&b.match(/^#+/);return e&&d(a)?e[0].length:(e=c&&c.match(/^[=\-]+\s*$/),e&&d(a+1)?"="==c[0]?1:2:f)}var f=100,g=b.getLine(c.line),h=b.getLine(c.line+1),i=e(c.line,g,h);if(i===f)return void 0;for(var j=b.lastLine(),k=c.line,l=b.getLine(k+2);j>k&&!(e(k+1,h,l)<=i);)++k,h=l,l=b.getLine(k+2);return{from:a.Pos(c.line,g.length),to:a.Pos(k,b.getLine(k).length)}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/fold/xml-fold.min.js b/media/editors/codemirror/addon/fold/xml-fold.min.js -index 0f2794a..3a7b105 100644 ---- a/media/editors/codemirror/addon/fold/xml-fold.min.js -+++ b/media/editors/codemirror/addon/fold/xml-fold.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(e,n){return e.line-n.line||e.ch-n.ch}function t(e,n,t,i){this.line=n,this.ch=t,this.cm=e,this.text=e.getLine(n),this.min=i?i.from:e.firstLine(),this.max=i?i.to-1:e.lastLine()}function i(e,n){var t=e.cm.getTokenTypeAt(h(e.line,n));return t&&/\btag\b/.test(t)}function r(e){return e.line>=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function f(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function o(e){for(;;){var n=e.text.indexOf(">",e.ch);if(-1==n){if(r(e))continue;return}{if(i(e,n+1)){var t=e.text.lastIndexOf("/",n),f=t>-1&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,f?"selfClose":"regular"}e.ch=n+1}}}function u(e){for(;;){var n=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==n){if(f(e))continue;return}if(i(e,n+1)){g.lastIndex=n,e.ch=n;var t=g.exec(e.text);if(t&&t.index==n)return t}else e.ch=n}}function c(e){for(;;){g.lastIndex=e.ch;var n=g.exec(e.text);if(!n){if(r(e))continue;return}{if(i(e,n.index+1))return e.ch=n.index+n[0].length,n;e.ch=n.index+1}}}function l(e){for(;;){var n=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==n){if(f(e))continue;return}{if(i(e,n+1)){var t=e.text.lastIndexOf("/",n),r=t>-1&&!/\S/.test(e.text.slice(t+1,n));return e.ch=n+1,r?"selfClose":"regular"}e.ch=n}}}function a(e,n){for(var t=[];;){var i,r=c(e),f=e.line,u=e.ch-(r?r[0].length:0);if(!r||!(i=o(e)))return;if("selfClose"!=i)if(r[1]){for(var l=t.length-1;l>=0;--l)if(t[l]==r[2]){t.length=l;break}if(0>l&&(!n||n==r[2]))return{tag:r[2],from:h(f,u),to:h(e.line,e.ch)}}else t.push(r[2])}}function s(e,n){for(var t=[];;){var i=l(e);if(!i)return;if("selfClose"!=i){var r=e.line,f=e.ch,o=u(e);if(!o)return;if(o[1])t.push(o[2]);else{for(var c=t.length-1;c>=0;--c)if(t[c]==o[2]){t.length=c;break}if(0>c&&(!n||n==o[2]))return{tag:o[2],from:h(e.line,e.ch),to:h(r,f)}}}else u(e)}}var h=e.Pos,x="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",v=x+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",g=new RegExp("<(/?)(["+x+"]["+v+"]*)","g");e.registerHelper("fold","xml",function(e,n){for(var i=new t(e,n.line,0);;){var r,f=c(i);if(!f||i.line!=n.line||!(r=o(i)))return;if(!f[1]&&"selfClose"!=r){var n=h(i.line,i.ch),u=a(i,f[2]);return u&&{from:n,to:u.from}}}}),e.findMatchingTag=function(e,i,r){var f=new t(e,i.line,i.ch,r);if(-1!=f.text.indexOf(">")||-1!=f.text.indexOf("<")){var c=o(f),l=c&&h(f.line,f.ch),x=c&&u(f);if(c&&x&&!(n(f,i)>0)){var v={from:h(f.line,f.ch),to:l,tag:x[2]};return"selfClose"==c?{open:v,close:null,at:"open"}:x[1]?{open:s(f,x[2]),close:v,at:"close"}:(f=new t(e,l.line,l.ch,r),{open:v,close:a(f,x[2]),at:"open"})}}},e.findEnclosingTag=function(e,n,i){for(var r=new t(e,n.line,n.ch,i);;){var f=s(r);if(!f)break;var o=new t(e,n.line,n.ch,i),u=a(o,f.tag);if(u)return{open:f,close:u}}},e.scanForClosingTag=function(e,n,i,r){var f=new t(e,n.line,n.ch,r?{from:0,to:r}:null);return a(f,i)}}); -\ 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?d.from:a.firstLine(),this.max=d?d.to-1:a.lastLine()}function d(a,b){var c=a.cm.getTokenTypeAt(m(a.line,b));return c&&/\btag\b/.test(c)}function e(a){return a.line>=a.max?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function f(a){return a.line<=a.min?void 0:(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(-1==b){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(-1==b){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(-1==b){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(0>j&&(!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(0>i&&(!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||d.line!=b.line||!(e=g(d)))return;if(!f[1]&&"selfClose"!=e){var b=m(d.line,d.ch),h=k(d,f[2]);return h&&{from:b,to:h.from}}}}),a.findMatchingTag=function(a,d,e){var f=new c(a,d.line,d.ch,e);if(-1!=f.text.indexOf(">")||-1!=f.text.indexOf("<")){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){for(var e=new c(a,b.line,b.ch,d);;){var f=l(e);if(!f)break;var g=new c(a,b.line,b.ch,d),h=k(g,f.tag);if(h)return{open:f,close:h}}},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/anyword-hint.min.js b/media/editors/codemirror/addon/hint/anyword-hint.min.js -index c9167e6..0d99ced 100644 ---- a/media/editors/codemirror/addon/hint/anyword-hint.min.js -+++ b/media/editors/codemirror/addon/hint/anyword-hint.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var r=/[\w$]+/,o=500;e.registerHelper("hint","anyword",function(t,i){for(var n=i&&i.word||r,f=i&&i.range||o,a=t.getCursor(),c=t.getLine(a.line),s=a.ch,l=s;l&&n.test(c.charAt(l-1));)--l;for(var d=l!=s&&c.slice(l,s),u=[],p={},g=new RegExp(n.source,"g"),h=-1;1>=h;h+=2)for(var m=a.line,y=Math.min(Math.max(m+h*f,t.firstLine()),t.lastLine())+h;m!=y;m+=h)for(var b,v=t.getLine(m);b=g.exec(v);)(m!=a.line||b[0]!==d)&&(d&&0!=b[0].lastIndexOf(d,0)||Object.prototype.hasOwnProperty.call(p,b[0])||(p[b[0]]=!0,u.push(b[0])));return{list:u,from:e.Pos(a.line,l),to:e.Pos(a.line,s)}})}); -\ 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";var b=/[\w$]+/,c=500;a.registerHelper("hint","anyword",function(d,e){for(var f=e&&e.word||b,g=e&&e.range||c,h=d.getCursor(),i=d.getLine(h.line),j=h.ch,k=j;k&&f.test(i.charAt(k-1));)--k;for(var l=k!=j&&i.slice(k,j),m=[],n={},o=new RegExp(f.source,"g"),p=-1;1>=p;p+=2)for(var q=h.line,r=Math.min(Math.max(q+p*g,d.firstLine()),d.lastLine())+p;q!=r;q+=p)for(var s,t=d.getLine(q);s=o.exec(t);)(q!=h.line||s[0]!==l)&&(l&&0!=s[0].lastIndexOf(l,0)||Object.prototype.hasOwnProperty.call(n,s[0])||(n[s[0]]=!0,m.push(s[0])));return{list:m,from:a.Pos(h.line,k),to:a.Pos(h.line,j)}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/hint/css-hint.js b/media/editors/codemirror/addon/hint/css-hint.js -index 488da34..2264272 100644 ---- a/media/editors/codemirror/addon/hint/css-hint.js -+++ b/media/editors/codemirror/addon/hint/css-hint.js -@@ -20,6 +20,10 @@ - var inner = CodeMirror.innerMode(cm.getMode(), token.state); - if (inner.mode.name != "css") return; - -+ if (token.type == "keyword" && "!important".indexOf(token.string) == 0) -+ return {list: ["!important"], from: CodeMirror.Pos(cur.line, token.start), -+ to: CodeMirror.Pos(cur.line, token.end)}; -+ - var start = token.start, end = cur.ch, word = token.string.slice(0, end - start); - if (/[^\w$_-]/.test(word)) { - word = ""; start = end = cur.ch; -diff --git a/media/editors/codemirror/addon/hint/css-hint.min.js b/media/editors/codemirror/addon/hint/css-hint.min.js -index fe0fc03..f2c3f47 100644 ---- a/media/editors/codemirror/addon/hint/css-hint.min.js -+++ b/media/editors/codemirror/addon/hint/css-hint.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],e):e(CodeMirror)}(function(e){"use strict";var r={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};e.registerHelper("hint","css",function(t){function o(e){for(var r in e)c&&0!=r.lastIndexOf(c,0)||l.push(r)}var s=t.getCursor(),i=t.getTokenAt(s),n=e.innerMode(t.getMode(),i.state);if("css"==n.mode.name){var a=i.start,d=s.ch,c=i.string.slice(0,d-a);/[^\w$_-]/.test(c)&&(c="",a=d=s.ch);var f=e.resolveMode("text/css"),l=[],p=n.state.state;return"pseudo"==p||"variable-3"==i.type?o(r):"block"==p||"maybeprop"==p?o(f.propertyKeywords):"prop"==p||"parens"==p||"at"==p||"params"==p?(o(f.valueKeywords),o(f.colorKeywords)):("media"==p||"media_parens"==p)&&(o(f.mediaTypes),o(f.mediaFeatures)),l.length?{list:l,from:e.Pos(s.line,a),to:e.Pos(s.line,d)}:void 0}})}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],a):a(CodeMirror)}(function(a){"use strict";var b={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};a.registerHelper("hint","css",function(c){function d(a){for(var b in a)j&&0!=b.lastIndexOf(j,0)||l.push(b)}var e=c.getCursor(),f=c.getTokenAt(e),g=a.innerMode(c.getMode(),f.state);if("css"==g.mode.name){if("keyword"==f.type&&0=="!important".indexOf(f.string))return{list:["!important"],from:a.Pos(e.line,f.start),to:a.Pos(e.line,f.end)};var h=f.start,i=e.ch,j=f.string.slice(0,i-h);/[^\w$_-]/.test(j)&&(j="",h=i=e.ch);var k=a.resolveMode("text/css"),l=[],m=g.state.state;return"pseudo"==m||"variable-3"==f.type?d(b):"block"==m||"maybeprop"==m?d(k.propertyKeywords):"prop"==m||"parens"==m||"at"==m||"params"==m?(d(k.valueKeywords),d(k.colorKeywords)):("media"==m||"media_parens"==m)&&(d(k.mediaTypes),d(k.mediaFeatures)),l.length?{list:l,from:a.Pos(e.line,h),to:a.Pos(e.line,i)}:void 0}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/hint/html-hint.min.js b/media/editors/codemirror/addon/hint/html-hint.min.js -index dc4f8e6..30b96ba 100644 ---- a/media/editors/codemirror/addon/hint/html-hint.min.js -+++ b/media/editors/codemirror/addon/hint/html-hint.min.js -@@ -1 +1 @@ --!function(l){"object"==typeof exports&&"object"==typeof module?l(require("../../lib/codemirror"),require("./xml-hint")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./xml-hint"],l):l(CodeMirror)}(function(l){"use strict";function t(l){for(var t in c)c.hasOwnProperty(t)&&(l.attrs[t]=c[t])}function e(t,e){var a={schemaInfo:d};if(e)for(var n in e)a[n]=e[n];return l.hint.xml(t,a)}var a="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),n=["_blank","_self","_top","_parent"],r=["ascii","utf-8","utf-16","latin1","latin1"],o=["get","post","put","delete"],s=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],u=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],i={attrs:{}},d={a:{attrs:{href:null,ping:null,type:null,media:u,target:n,hreflang:a}},abbr:i,acronym:i,address:i,applet:i,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:u,hreflang:a,type:null,shape:["default","rect","circle","poly"]}},article:i,aside:i,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:i,base:{attrs:{href:null,target:n}},basefont:i,bdi:i,bdo:i,big:i,blockquote:{attrs:{cite:null}},body:i,br:i,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:s,formmethod:o,formnovalidate:["","novalidate"],formtarget:n,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:i,center:i,cite:i,code:i,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:i,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:i,dir:i,div:i,dl:i,dt:i,em:i,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:i,figure:i,font:i,footer:i,form:{attrs:{action:null,name:null,"accept-charset":r,autocomplete:["on","off"],enctype:s,method:o,novalidate:["","novalidate"],target:n}},frame:i,frameset:i,h1:i,h2:i,h3:i,h4:i,h5:i,h6:i,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:i,hgroup:i,hr:i,html:{attrs:{manifest:null},children:["head","body"]},i:i,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:s,formmethod:o,formnovalidate:["","novalidate"],formtarget:n,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:i,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{"for":null,form:null}},legend:i,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:a,media:u,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:i,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:r,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:i,noframes:i,noscript:i,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{"for":null,form:null,name:null}},p:i,param:{attrs:{name:null,value:null}},pre:i,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:i,rt:i,ruby:i,s:i,samp:i,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:r}},section:i,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:i,source:{attrs:{src:null,type:null,media:null}},span:i,strike:i,strong:i,style:{attrs:{type:["text/css"],media:u,scoped:null}},sub:i,summary:i,sup:i,table:i,tbody:i,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:i,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:i,time:{attrs:{datetime:null}},title:i,tr:i,track:{attrs:{src:null,label:null,"default":null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:a}},tt:i,u:i,ul:i,"var":i,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:i},c={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],"class":null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};t(i);for(var m in d)d.hasOwnProperty(m)&&d[m]!=i&&t(d[m]);l.htmlSchema=d,l.registerHelper("hint","html",e)}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./xml-hint")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./xml-hint"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b in l)l.hasOwnProperty(b)&&(a.attrs[b]=l[b])}function c(b,c){var d={schemaInfo:k};if(c)for(var e in c)d[e]=c[e];return a.hint.xml(b,d)}var d="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),e=["_blank","_self","_top","_parent"],f=["ascii","utf-8","utf-16","latin1","latin1"],g=["get","post","put","delete"],h=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],i=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],j={attrs:{}},k={a:{attrs:{href:null,ping:null,type:null,media:i,target:e,hreflang:d}},abbr:j,acronym:j,address:j,applet:j,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:i,hreflang:d,type:null,shape:["default","rect","circle","poly"]}},article:j,aside:j,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:j,base:{attrs:{href:null,target:e}},basefont:j,bdi:j,bdo:j,big:j,blockquote:{attrs:{cite:null}},body:j,br:j,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:h,formmethod:g,formnovalidate:["","novalidate"],formtarget:e,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:j,center:j,cite:j,code:j,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:j,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:j,dir:j,div:j,dl:j,dt:j,em:j,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:j,figure:j,font:j,footer:j,form:{attrs:{action:null,name:null,"accept-charset":f,autocomplete:["on","off"],enctype:h,method:g,novalidate:["","novalidate"],target:e}},frame:j,frameset:j,h1:j,h2:j,h3:j,h4:j,h5:j,h6:j,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:j,hgroup:j,hr:j,html:{attrs:{manifest:null},children:["head","body"]},i:j,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:h,formmethod:g,formnovalidate:["","novalidate"],formtarget:e,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:j,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{"for":null,form:null}},legend:j,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:d,media:i,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:j,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:f,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:j,noframes:j,noscript:j,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{"for":null,form:null,name:null}},p:j,param:{attrs:{name:null,value:null}},pre:j,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:j,rt:j,ruby:j,s:j,samp:j,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:f}},section:j,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:j,source:{attrs:{src:null,type:null,media:null}},span:j,strike:j,strong:j,style:{attrs:{type:["text/css"],media:i,scoped:null}},sub:j,summary:j,sup:j,table:j,tbody:j,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:j,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:j,time:{attrs:{datetime:null}},title:j,tr:j,track:{attrs:{src:null,label:null,"default":null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:d}},tt:j,u:j,ul:j,"var":j,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:j},l={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],"class":null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};b(j);for(var m in k)k.hasOwnProperty(m)&&k[m]!=j&&b(k[m]);a.htmlSchema=k,a.registerHelper("hint","html",c)}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/hint/javascript-hint.min.js b/media/editors/codemirror/addon/hint/javascript-hint.min.js -index 23e6243..ed3d656 100644 ---- a/media/editors/codemirror/addon/hint/javascript-hint.min.js -+++ b/media/editors/codemirror/addon/hint/javascript-hint.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){function e(t,e){for(var r=0,n=t.length;n>r;++r)e(t[r])}function r(t,e){if(!Array.prototype.indexOf){for(var r=t.length;r--;)if(t[r]===e)return!0;return!1}return-1!=t.indexOf(e)}function n(e,r,n,i){var o=e.getCursor(),s=n(e,o);if(!/\b(?:string|comment)\b/.test(s.type)){s.state=t.innerMode(e.getMode(),s.state).state,/^[\w$_]*$/.test(s.string)?s.end>o.ch&&(s.end=o.ch,s.string=s.string.slice(0,o.ch-s.start)):s={start:o.ch,end:o.ch,string:"",state:s.state,type:"."==s.string?"property":null};for(var f=s;"property"==f.type;){if(f=n(e,l(o.line,f.start)),"."!=f.string)return;if(f=n(e,l(o.line,f.start)),!c)var c=[];c.push(f)}return{list:a(s,c,r,i),from:l(o.line,s.start),to:l(o.line,s.end)}}}function i(t,e){return n(t,u,function(t,e){return t.getTokenAt(e)},e)}function o(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&"."==r.string.charAt(0)?(r.end=r.start,r.string=".",r.type="property"):/^\.[\w$_]*$/.test(r.string)&&(r.type="property",r.start++,r.string=r.string.replace(/\./,"")),r}function s(t,e){return n(t,d,o,e)}function a(t,n,i,o){function s(t){0!=t.lastIndexOf(u,0)||r(l,t)||l.push(t)}function a(t){"string"==typeof t?e(f,s):t instanceof Array?e(c,s):t instanceof Function&&e(p,s);for(var r in t)s(r)}var l=[],u=t.string,d=o&&o.globalScope||window;if(n&&n.length){var g,h=n.pop();for(h.type&&0===h.type.indexOf("variable")?(o&&o.additionalContext&&(g=o.additionalContext[h.string]),o&&o.useGlobalScope===!1||(g=g||d[h.string])):"string"==h.type?g="":"atom"==h.type?g=1:"function"==h.type&&(null==d.jQuery||"$"!=h.string&&"jQuery"!=h.string||"function"!=typeof d.jQuery?null!=d._&&"_"==h.string&&"function"==typeof d._&&(g=d._()):g=d.jQuery());null!=g&&n.length;)g=g[n.pop().string];null!=g&&a(g)}else{for(var y=t.state.localVars;y;y=y.next)s(y.name);for(var y=t.state.globalVars;y;y=y.next)s(y.name);o&&o.useGlobalScope===!1||a(d),e(i,s)}return l}var l=t.Pos;t.registerHelper("hint","javascript",i),t.registerHelper("hint","coffeescript",s);var f="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),c="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),p="prototype apply call bind".split(" "),u="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),d="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;d>c;++c)b(a[c])}function c(a,b){if(!Array.prototype.indexOf){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1}return-1!=a.indexOf(b)}function d(b,c,d,e){var f=b.getCursor(),g=d(b,f);if(!/\b(?:string|comment)\b/.test(g.type)){g.state=a.innerMode(b.getMode(),g.state).state,/^[\w$_]*$/.test(g.string)?g.end>f.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 j=g;"property"==j.type;){if(j=d(b,i(f.line,j.start)),"."!=j.string)return;if(j=d(b,i(f.line,j.start)),!k)var k=[];k.push(j)}return{list:h(g,k,c,e),from:i(f.line,g.start),to:i(f.line,g.end)}}}function e(a,b){return d(a,m,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,n,f,b)}function h(a,d,e,f){function g(a){0!=a.lastIndexOf(m,0)||c(i,a)||i.push(a)}function h(a){"string"==typeof a?b(j,g):a instanceof Array?b(k,g):a instanceof Function&&b(l,g);for(var c in a)g(c)}var i=[],m=a.string,n=f&&f.globalScope||window;if(d&&d.length){var o,p=d.pop();for(p.type&&0===p.type.indexOf("variable")?(f&&f.additionalContext&&(o=f.additionalContext[p.string]),f&&f.useGlobalScope===!1||(o=o||n[p.string])):"string"==p.type?o="":"atom"==p.type?o=1:"function"==p.type&&(null==n.jQuery||"$"!=p.string&&"jQuery"!=p.string||"function"!=typeof n.jQuery?null!=n._&&"_"==p.string&&"function"==typeof n._&&(o=n._()):o=n.jQuery());null!=o&&d.length;)o=o[d.pop().string];null!=o&&h(o)}else{for(var q=a.state.localVars;q;q=q.next)g(q.name);for(var q=a.state.globalVars;q;q=q.next)g(q.name);f&&f.useGlobalScope===!1||h(n),b(e,g)}return i}var i=a.Pos;a.registerHelper("hint","javascript",e),a.registerHelper("hint","coffeescript",g);var j="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),k="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),l="prototype apply call bind".split(" "),m="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),n="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 f544619..d228fc8 100644 ---- a/media/editors/codemirror/addon/hint/show-hint.js -+++ b/media/editors/codemirror/addon/hint/show-hint.js -@@ -24,44 +24,45 @@ - return cm.showHint(newOpts); - }; - -- var asyncRunID = 0; -- function retrieveHints(getter, cm, options, then) { -- if (getter.async) { -- var id = ++asyncRunID; -- getter(cm, function(hints) { -- if (asyncRunID == id) then(hints); -- }, options); -- } else { -- then(getter(cm, options)); -- } -- } -- - CodeMirror.defineExtension("showHint", function(options) { - // We want a single cursor position. - if (this.listSelections().length > 1 || this.somethingSelected()) return; - - if (this.state.completionActive) this.state.completionActive.close(); - var completion = this.state.completionActive = new Completion(this, options); -- var getHints = completion.options.hint; -- if (!getHints) return; -+ if (!completion.options.hint) return; - - CodeMirror.signal(this, "startCompletion", this); -- return retrieveHints(getHints, this, completion.options, function(hints) { completion.showHints(hints); }); -+ completion.update(true); - }); - - function Completion(cm, options) { - this.cm = cm; - this.options = this.buildOptions(options); -- this.widget = this.onClose = null; -+ this.widget = null; -+ this.debounce = 0; -+ this.tick = 0; -+ this.startPos = this.cm.getCursor(); -+ this.startLen = this.cm.getLine(this.startPos.line).length; -+ -+ var self = this; -+ cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); }); - } - -+ var requestAnimationFrame = window.requestAnimationFrame || function(fn) { -+ return setTimeout(fn, 1000/60); -+ }; -+ var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; -+ - Completion.prototype = { - close: function() { - if (!this.active()) return; - this.cm.state.completionActive = null; -+ this.tick = null; -+ this.cm.off("cursorActivity", this.activityFunc); - -+ if (this.widget && this.data) CodeMirror.signal(this.data, "close"); - if (this.widget) this.widget.close(); -- if (this.onClose) this.onClose(); - CodeMirror.signal(this.cm, "endCompletion", this.cm); - }, - -@@ -78,70 +79,50 @@ - this.close(); - }, - -- showHints: function(data) { -- if (!data || !data.list.length || !this.active()) return this.close(); -- -- if (this.options.completeSingle && data.list.length == 1) -- this.pick(data, 0); -- else -- this.showWidget(data); -- }, -- -- showWidget: function(data) { -- this.widget = new Widget(this, data); -- CodeMirror.signal(data, "shown"); -- -- var debounce = 0, completion = this, finished; -- var closeOn = this.options.closeCharacters; -- var startPos = this.cm.getCursor(), startLen = this.cm.getLine(startPos.line).length; -- -- var requestAnimationFrame = window.requestAnimationFrame || function(fn) { -- return setTimeout(fn, 1000/60); -- }; -- var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; -- -- function done() { -- if (finished) return; -- finished = true; -- completion.close(); -- completion.cm.off("cursorActivity", activity); -- if (data) CodeMirror.signal(data, "close"); -+ cursorActivity: function() { -+ if (this.debounce) { -+ cancelAnimationFrame(this.debounce); -+ this.debounce = 0; - } - -- function update() { -- if (finished) return; -- CodeMirror.signal(data, "update"); -- retrieveHints(completion.options.hint, completion.cm, completion.options, finishUpdate); -- } -- function finishUpdate(data_) { -- data = data_; -- if (finished) return; -- if (!data || !data.list.length) return done(); -- if (completion.widget) completion.widget.close(); -- completion.widget = new Widget(completion, data); -+ var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line); -+ if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || -+ pos.ch < this.startPos.ch || this.cm.somethingSelected() || -+ (pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) { -+ this.close(); -+ } else { -+ var self = this; -+ this.debounce = requestAnimationFrame(function() {self.update();}); -+ if (this.widget) this.widget.disable(); - } -+ }, - -- function clearDebounce() { -- if (debounce) { -- cancelAnimationFrame(debounce); -- debounce = 0; -- } -+ update: function(first) { -+ if (this.tick == null) return; -+ if (this.data) CodeMirror.signal(this.data, "update"); -+ if (!this.options.hint.async) { -+ this.finishUpdate(this.options.hint(this.cm, this.options), first); -+ } else { -+ var myTick = ++this.tick, self = this; -+ this.options.hint(this.cm, function(data) { -+ if (self.tick == myTick) self.finishUpdate(data, first); -+ }, this.options); - } -+ }, -+ -+ finishUpdate: function(data, first) { -+ this.data = data; - -- function activity() { -- clearDebounce(); -- var pos = completion.cm.getCursor(), line = completion.cm.getLine(pos.line); -- if (pos.line != startPos.line || line.length - pos.ch != startLen - startPos.ch || -- pos.ch < startPos.ch || completion.cm.somethingSelected() || -- (pos.ch && closeOn.test(line.charAt(pos.ch - 1)))) { -- completion.close(); -+ var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle); -+ if (this.widget) this.widget.close(); -+ if (data && data.list.length) { -+ if (picked && data.list.length == 1) { -+ this.pick(data, 0); - } else { -- debounce = requestAnimationFrame(update); -- if (completion.widget) completion.widget.close(); -+ this.widget = new Widget(this, data); -+ CodeMirror.signal(data, "shown"); - } - } -- this.cm.on("cursorActivity", activity); -- this.onClose = done; - }, - - buildOptions: function(options) { -@@ -206,6 +187,7 @@ - function Widget(completion, data) { - this.completion = completion; - this.data = data; -+ this.picked = false; - var widget = this, cm = completion.cm; - - var hints = this.hints = document.createElement("ul"); -@@ -320,6 +302,13 @@ - cm.off("scroll", this.onScroll); - }, - -+ disable: function() { -+ this.completion.cm.removeKeyMap(this.keyMap); -+ var widget = this; -+ this.keyMap = {Enter: function() { widget.picked = true; }}; -+ this.completion.cm.addKeyMap(this.keyMap); -+ }, -+ - pick: function() { - this.completion.pick(this.data, this.selectedHint); - }, -diff --git a/media/editors/codemirror/addon/hint/show-hint.min.css b/media/editors/codemirror/addon/hint/show-hint.min.css -index c8c87f0..86c983e 100644 ---- a/media/editors/codemirror/addon/hint/show-hint.min.css -+++ b/media/editors/codemirror/addon/hint/show-hint.min.css -@@ -1 +1 @@ --.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:white;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;max-width:19em;overflow:hidden;white-space:pre;color:black;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:white} -\ No newline at end of file -+.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;max-width:19em;overflow:hidden;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff} -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/hint/show-hint.min.js b/media/editors/codemirror/addon/hint/show-hint.min.js -index e8fc4c6..c92ce65 100644 ---- a/media/editors/codemirror/addon/hint/show-hint.min.js -+++ b/media/editors/codemirror/addon/hint/show-hint.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e,i,n){if(t.async){var o=++h;t(e,function(t){h==o&&n(t)},i)}else n(t(e,i))}function i(t,e){this.cm=t,this.options=this.buildOptions(e),this.widget=this.onClose=null}function n(t){return"string"==typeof t?t:t.text}function o(t,e){function i(t,i){var o;o="string"!=typeof i?function(t){return i(t,e)}:n.hasOwnProperty(i)?n[i]:i,s[t]=o}var n={Up:function(){e.moveFocus(-1)},Down:function(){e.moveFocus(1)},PageUp:function(){e.moveFocus(-e.menuSize()+1,!0)},PageDown:function(){e.moveFocus(e.menuSize()-1,!0)},Home:function(){e.setFocus(0)},End:function(){e.setFocus(e.length-1)},Enter:e.pick,Tab:e.pick,Esc:e.close},o=t.options.customKeys,s=o?{}:n;if(o)for(var c in o)o.hasOwnProperty(c)&&i(c,o[c]);var l=t.options.extraKeys;if(l)for(var c in l)l.hasOwnProperty(c)&&i(c,l[c]);return s}function s(t,e){for(;e&&e!=t;){if("LI"===e.nodeName.toUpperCase()&&e.parentNode==t)return e;e=e.parentNode}}function c(e,i){this.completion=e,this.data=i;var c=this,h=e.cm,a=this.hints=document.createElement("ul");a.className="CodeMirror-hints",this.selectedHint=i.selectedHint||0;for(var f=i.list,u=0;u0){var k=b.bottom-b.top,A=g.top-(g.bottom-b.top);if(A-k>0)a.style.top=(w=g.top-k)+"px",y=!1;else if(k>H){a.style.height=H-5+"px",a.style.top=(w=g.bottom-b.top)+"px";var T=h.getCursor();i.from.ch!=T.ch&&(g=h.cursorCoords(T),a.style.left=(v=g.left)+"px",b=a.getBoundingClientRect())}}var N=b.right-C;if(N>0&&(b.right-b.left>C&&(a.style.width=C-5+"px",N-=b.right-b.left-C),a.style.left=(v=g.left-N)+"px"),h.addKeyMap(this.keyMap=o(e,{moveFocus:function(t,e){c.changeActive(c.selectedHint+t,e)},setFocus:function(t){c.changeActive(t)},menuSize:function(){return c.screenAmount()},length:f.length,close:function(){e.close()},pick:function(){c.pick()},data:i})),e.options.closeOnUnfocus){var O;h.on("blur",this.onBlur=function(){O=setTimeout(function(){e.close()},100)}),h.on("focus",this.onFocus=function(){clearTimeout(O)})}var S=h.getScrollInfo();return h.on("scroll",this.onScroll=function(){var t=h.getScrollInfo(),i=h.getWrapperElement().getBoundingClientRect(),n=w+S.top-t.top,o=n-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return y||(o+=a.offsetHeight),o<=i.top||o>=i.bottom?e.close():(a.style.top=n+"px",void(a.style.left=v+S.left-t.left+"px"))}),t.on(a,"dblclick",function(t){var e=s(a,t.target||t.srcElement);e&&null!=e.hintId&&(c.changeActive(e.hintId),c.pick())}),t.on(a,"click",function(t){var i=s(a,t.target||t.srcElement);i&&null!=i.hintId&&(c.changeActive(i.hintId),e.options.completeOnSingleClick&&c.pick())}),t.on(a,"mousedown",function(){setTimeout(function(){h.focus()},20)}),t.signal(i,"select",f[0],a.firstChild),!0}var l="CodeMirror-hint",r="CodeMirror-hint-active";t.showHint=function(t,e,i){if(!e)return t.showHint(i);i&&i.async&&(e.async=!0);var n={hint:e};if(i)for(var o in i)n[o]=i[o];return t.showHint(n)};var h=0;t.defineExtension("showHint",function(n){if(!(this.listSelections().length>1||this.somethingSelected())){this.state.completionActive&&this.state.completionActive.close();var o=this.state.completionActive=new i(this,n),s=o.options.hint;if(s)return t.signal(this,"startCompletion",this),e(s,this,o.options,function(t){o.showHints(t)})}}),i.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.widget&&this.widget.close(),this.onClose&&this.onClose(),t.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(e,i){var o=e.list[i];o.hint?o.hint(this.cm,e,o):this.cm.replaceRange(n(o),o.from||e.from,o.to||e.to,"complete"),t.signal(e,"pick",o),this.close()},showHints:function(t){return t&&t.list.length&&this.active()?void(this.options.completeSingle&&1==t.list.length?this.pick(t,0):this.showWidget(t)):this.close()},showWidget:function(i){function n(){h||(h=!0,f.close(),f.cm.off("cursorActivity",r),i&&t.signal(i,"close"))}function o(){h||(t.signal(i,"update"),e(f.options.hint,f.cm,f.options,s))}function s(t){if(i=t,!h){if(!i||!i.list.length)return n();f.widget&&f.widget.close(),f.widget=new c(f,i)}}function l(){a&&(g(a),a=0)}function r(){l();var t=f.cm.getCursor(),e=f.cm.getLine(t.line);t.line!=d.line||e.length-t.ch!=p-d.ch||t.ch=this.data.list.length?e=i?this.data.list.length-1:0:0>e&&(e=i?0:this.data.list.length-1),this.selectedHint!=e){var n=this.hints.childNodes[this.selectedHint];n.className=n.className.replace(" "+r,""),n=this.hints.childNodes[this.selectedHint=e],n.className+=" "+r,n.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+3),t.signal(this.data,"select",this.data.list[this.selectedHint],n)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},t.registerHelper("hint","auto",function(e,i){var n,o=e.getHelpers(e.getCursor(),"hint");if(o.length)for(var s=0;s,]/,closeOnUnfocus:!0,completeOnSingleClick:!1,container:null,customKeys:null,extraKeys:null};t.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=this.buildOptions(b),this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor(),this.startLen=this.cm.getLine(this.startPos.line).length;var c=this;a.on("cursorActivity",this.activityFunc=function(){c.cursorActivity()})}function c(a){return"string"==typeof a?a:a.text}function d(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 e(a,b){for(;b&&b!=a;){if("LI"===b.nodeName.toUpperCase()&&b.parentNode==a)return b;b=b.parentNode}}function f(b,f){this.completion=b,this.data=f,this.picked=!1;var i=this,j=b.cm,k=this.hints=document.createElement("ul");k.className="CodeMirror-hints",this.selectedHint=f.selectedHint||0;for(var l=f.list,m=0;m0){var y=w.bottom-w.top,z=q.top-(q.bottom-w.top);if(z-y>0)k.style.top=(s=q.top-y)+"px",t=!1;else if(y>v){k.style.height=v-5+"px",k.style.top=(s=q.bottom-w.top)+"px";var A=j.getCursor();f.from.ch!=A.ch&&(q=j.cursorCoords(A),k.style.left=(r=q.left)+"px",w=k.getBoundingClientRect())}}var B=w.right-u;if(B>0&&(w.right-w.left>u&&(k.style.width=u-5+"px",B-=w.right-w.left-u),k.style.left=(r=q.left-B)+"px"),j.addKeyMap(this.keyMap=d(b,{moveFocus:function(a,b){i.changeActive(i.selectedHint+a,b)},setFocus:function(a){i.changeActive(a)},menuSize:function(){return i.screenAmount()},length:l.length,close:function(){b.close()},pick:function(){i.pick()},data:f})),b.options.closeOnUnfocus){var C;j.on("blur",this.onBlur=function(){C=setTimeout(function(){b.close()},100)}),j.on("focus",this.onFocus=function(){clearTimeout(C)})}var D=j.getScrollInfo();return j.on("scroll",this.onScroll=function(){var a=j.getScrollInfo(),c=j.getWrapperElement().getBoundingClientRect(),d=s+D.top-a.top,e=d-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return t||(e+=k.offsetHeight),e<=c.top||e>=c.bottom?b.close():(k.style.top=d+"px",void(k.style.left=r+D.left-a.left+"px"))}),a.on(k,"dblclick",function(a){var b=e(k,a.target||a.srcElement);b&&null!=b.hintId&&(i.changeActive(b.hintId),i.pick())}),a.on(k,"click",function(a){var c=e(k,a.target||a.srcElement);c&&null!=c.hintId&&(i.changeActive(c.hintId),b.options.completeOnSingleClick&&i.pick())}),a.on(k,"mousedown",function(){setTimeout(function(){j.focus()},20)}),a.signal(f,"select",l[0],k.firstChild),!0}var g="CodeMirror-hint",h="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(c){if(!(this.listSelections().length>1||this.somethingSelected())){this.state.completionActive&&this.state.completionActive.close();var d=this.state.completionActive=new b(this,c);d.options.hint&&(a.signal(this,"startCompletion",this),d.update(!0))}});var i=window.requestAnimationFrame||function(a){return setTimeout(a,1e3/60)},j=window.cancelAnimationFrame||clearTimeout;b.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&a.signal(this.data,"close"),this.widget&&this.widget.close(),a.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(b,d){var e=b.list[d];e.hint?e.hint(this.cm,b,e):this.cm.replaceRange(c(e),e.from||b.from,e.to||b.to,"complete"),a.signal(b,"pick",e),this.close()},cursorActivity:function(){this.debounce&&(j(this.debounce),this.debounce=0);var a=this.cm.getCursor(),b=this.cm.getLine(a.line);if(a.line!=this.startPos.line||b.length-a.ch!=this.startLen-this.startPos.ch||a.ch=this.data.list.length?b=c?this.data.list.length-1:0:0>b&&(b=c?0:this.data.list.length-1),this.selectedHint!=b){var d=this.hints.childNodes[this.selectedHint];d.className=d.className.replace(" "+h,""),d=this.hints.childNodes[this.selectedHint=b],d.className+=" "+h,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",function(b,c){var d,e=b.getHelpers(b.getCursor(),"hint");if(e.length)for(var f=0;f,]/,closeOnUnfocus:!0,completeOnSingleClick:!1,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 5b0cc76..08051ce 100644 ---- a/media/editors/codemirror/addon/hint/sql-hint.js -+++ b/media/editors/codemirror/addon/hint/sql-hint.js -@@ -52,12 +52,9 @@ - function addMatches(result, search, wordlist, formatter) { - for (var word in wordlist) { - if (!wordlist.hasOwnProperty(word)) continue; -- if (Array.isArray(wordlist)) { -- word = wordlist[word]; -- } -- if (match(search, word)) { -- result.push(formatter(word)); -- } -+ if (wordlist.slice) word = wordlist[word]; -+ -+ if (match(search, word)) result.push(formatter(word)); - } - } - -@@ -115,18 +112,25 @@ - string = nameParts.pop(); - var table = nameParts.join("."); - -+ var alias = false; -+ var aliasTable = table; - // Check if table is available. If not, find table by Alias -- if (!getItem(tables, table)) -+ if (!getItem(tables, table)) { -+ var oldTable = table; - table = findTableByAlias(table, editor); -+ if (table !== oldTable) alias = true; -+ } - - var columns = getItem(tables, table); -- if (columns && Array.isArray(tables) && columns.columns) -+ if (columns && columns.columns) - columns = columns.columns; - - if (columns) { - addMatches(result, string, columns, function(w) { - if (typeof w == "string") { -- w = table + "." + w; -+ var tableInsert = table; -+ if (alias == true) tableInsert = aliasTable; -+ w = tableInsert + "." + w; - } else { - w = shallowClone(w); - w.text = table + "." + w.text; -@@ -208,9 +212,18 @@ - CodeMirror.registerHelper("hint", "sql", function(editor, options) { - tables = (options && options.tables) || {}; - var defaultTableName = options && options.defaultTable; -- defaultTable = (defaultTableName && getItem(tables, defaultTableName)) || []; -+ var disableKeywords = options && options.disableKeywords; -+ defaultTable = defaultTableName && getItem(tables, defaultTableName); - keywords = keywords || getKeywords(editor); - -+ if (defaultTableName && !defaultTable) -+ defaultTable = findTableByAlias(defaultTableName, editor); -+ -+ defaultTable = defaultTable || []; -+ -+ if (defaultTable.columns) -+ defaultTable = defaultTable.columns; -+ - var cur = editor.getCursor(); - var result = []; - var token = editor.getTokenAt(cur), start, end, search; -@@ -232,7 +245,8 @@ - } else { - addMatches(result, search, tables, function(w) {return w;}); - addMatches(result, search, defaultTable, function(w) {return w;}); -- addMatches(result, search, keywords, function(w) {return w.toUpperCase();}); -+ if (!disableKeywords) -+ addMatches(result, search, keywords, function(w) {return w.toUpperCase();}); - } - - 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 a8e075d..12f3828 100644 ---- a/media/editors/codemirror/addon/hint/sql-hint.min.js -+++ b/media/editors/codemirror/addon/hint/sql-hint.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../../mode/sql/sql")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/sql/sql"],t):t(CodeMirror)}(function(t){"use strict";function r(r){var n=r.doc.modeOption;return"sql"===n&&(n="text/x-sql"),t.resolveMode(n).keywords}function n(t){return"string"==typeof t?t:t.text}function e(t,r){if(!t.slice)return t[r];for(var e=t.length-1;e>=0;e--)if(n(t[e])==r)return t[e]}function o(t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}function i(t,r){var e=t.length,o=n(r).substr(0,e);return t.toUpperCase()===o.toUpperCase()}function s(t,r,n,e){for(var o in n)n.hasOwnProperty(o)&&(Array.isArray(n)&&(o=n[o]),i(r,o)&&t.push(e(o)))}function a(t){return"."==t.charAt(0)&&(t=t.substr(1)),t.replace(/`/g,"")}function u(t){for(var r=n(t).split("."),e=0;ed&&x>=v){f={start:p(d),end:p(x)};break}d=x}for(var b=n.getRange(f.start,f.end,!1),m=0;mc.ch&&(p.end=c.ch,p.string=p.string.slice(0,c.ch-p.start)),p.string.match(/^[.`\w@]\w*$/)?(u=p.string,i=p.start,a=p.end):(i=a=c.ch,u=""),"."==u.charAt(0)||"`"==u.charAt(0)?i=f(c,p,l,t):(s(l,u,h,function(t){return t}),s(l,u,d,function(t){return t}),s(l,u,v,function(t){return t.toUpperCase()})),{list:l,from:y(c.line,i),to:y(c.line,a)}})}); -\ 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(b){var c=b.doc.modeOption;return"sql"===c&&(c="text/x-sql"),a.resolveMode(c).keywords}function c(a){return"string"==typeof a?a:a.text}function d(a,b){if(!a.slice)return a[b];for(var d=a.length-1;d>=0;d--)if(c(a[d])==b)return a[d]}function e(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function f(a,b){var d=a.length,e=c(b).substr(0,d);return a.toUpperCase()===e.toUpperCase()}function g(a,b,c,d){for(var e in c)c.hasOwnProperty(e)&&(c.slice&&(e=c[e]),f(b,e)&&a.push(d(e)))}function h(a){return"."==a.charAt(0)&&(a=a.substr(1)),a.replace(/`/g,"")}function i(a){for(var b=c(a).split("."),d=0;dp&&u>=q){j={start:m(p),end:m(u)};break}p=u}for(var v=c.getRange(j.start,j.end,!1),t=0;tl.ch&&(r.end=l.ch,r.string=r.string.slice(0,l.ch-r.start)),r.string.match(/^[.`\w@]\w*$/)?(k=r.string,h=r.start,i=r.end):(h=i=l.ch,k=""),"."==k.charAt(0)||"`"==k.charAt(0)?h=j(l,r,m,a):(g(m,k,o,function(a){return a}),g(m,k,p,function(a){return a}),f||g(m,k,q,function(a){return a.toUpperCase()})),{list:m,from:s(l.line,h),to:s(l.line,i)}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/hint/xml-hint.min.js b/media/editors/codemirror/addon/hint/xml-hint.min.js -index bee0be1..3ea0a6e 100644 ---- a/media/editors/codemirror/addon/hint/xml-hint.min.js -+++ b/media/editors/codemirror/addon/hint/xml-hint.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,s){var n=s&&s.schemaInfo,a=s&&s.quoteChar||'"';if(n){var i=e.getCursor(),o=e.getTokenAt(i);o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start));var l=t.innerMode(e.getMode(),o.state);if("xml"==l.mode.name){var f,g,c=[],h=!1,p=/\btag\b/.test(o.type)&&!/>$/.test(o.string),u=p&&/^\w/.test(o.string);if(u){var d=e.getLine(i.line).slice(Math.max(0,o.start-2),o.start),m=/<\/$/.test(d)?"close":/<$/.test(d)?"open":null;m&&(g=o.start-("close"==m?2:1))}else p&&"<"==o.string?m="open":p&&"")}else{var y=n[l.state.tagName],w=y&&y.attrs,I=n["!attrs"];if(!w&&!I)return;if(w){if(I){var P={};for(var A in I)I.hasOwnProperty(A)&&(P[A]=I[A]);for(var A in w)w.hasOwnProperty(A)&&(P[A]=w[A]);w=P}}else w=I;if("string"==o.type||"="==o.string){var M,d=e.getRange(r(i.line,Math.max(0,i.ch-60)),r(i.line,"string"==o.type?o.start:o.end)),N=d.match(/([^\s\u00a0=<>\"\']+)=$/);if(!N||!w.hasOwnProperty(N[1])||!(M=w[N[1]]))return;if("function"==typeof M&&(M=M.call(this,e)),"string"==o.type){f=o.string;var $=0;/['"]/.test(o.string.charAt(0))&&(a=o.string.charAt(0),f=o.string.slice(1),$++);var C=o.string.length;/['"]/.test(o.string.charAt(C-1))&&(a=o.string.charAt(C-1),f=o.string.substr($,C-2)),h=!0}for(var O=0;Og.ch&&(h.end=g.ch,h.string=h.string.slice(0,g.ch-h.start));var i=a.innerMode(b.getMode(),h.state);if("xml"==i.mode.name){var j,k,l=[],m=!1,n=/\btag\b/.test(h.type)&&!/>$/.test(h.string),o=n&&/^\w/.test(h.string);if(o){var p=b.getLine(g.line).slice(Math.max(0,h.start-2),h.start),q=/<\/$/.test(p)?"close":/<$/.test(p)?"open":null;q&&(k=h.start-("close"==q?2:1))}else n&&"<"==h.string?q="open":n&&"")}else{var s=e[i.state.tagName],w=s&&s.attrs,x=e["!attrs"];if(!w&&!x)return;if(w){if(x){var y={};for(var z in x)x.hasOwnProperty(z)&&(y[z]=x[z]);for(var z in w)w.hasOwnProperty(z)&&(y[z]=w[z]);w=y}}else w=x;if("string"==h.type||"="==h.string){var A,p=b.getRange(c(g.line,Math.max(0,g.ch-60)),c(g.line,"string"==h.type?h.start:h.end)),B=p.match(/([^\s\u00a0=<>\"\']+)=$/);if(!B||!w.hasOwnProperty(B[1])||!(A=w[B[1]]))return;if("function"==typeof A&&(A=A.call(this,b)),"string"==h.type){j=h.string;var C=0;/['"]/.test(h.string.charAt(0))&&(f=h.string.charAt(0),j=h.string.slice(1),C++);var D=h.string.length;/['"]/.test(h.string.charAt(D-1))&&(f=h.string.charAt(D-1),j=h.string.substr(C,D-2)),m=!0}for(var u=0;u0){var d=o.character;s.forEach(function(e){d>e&&(d-=1)}),o.character=d}}var u=o.character-1,l=u+1;o.evidence&&(c=o.evidence.substring(u).search(/.\b/),c>-1&&(l+=c)),o.description=o.reason,o.start=o.character,o.end=l,o=n(o),o&&i.push({message:o.description,severity:o.severity,from:e.Pos(o.line-1,u),to:e.Pos(o.line-1,l)})}}}var a=["Dangerous comment"],c=[["Expected '{'","Statement body should be inside '{ }' braces."]],s=["Missing semicolon","Extra comma","Missing property name","Unmatched "," and instead saw"," is not defined","Unclosed string","Stopping, unable to continue"];e.registerHelper("lint","javascript",r)}); -\ 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){if(!window.JSHINT)return[];JSHINT(a,b,b.globals);var c=JSHINT.data().errors,d=[];return c&&f(c,d),d}function c(a){return d(a,h,"warning",!0),d(a,i,"error"),e(a)?null:a}function d(a,b,c,d){var e,f,g,h,i;e=a.description;for(var j=0;j0){var k=f.character;i.forEach(function(a){k>a&&(k-=1)}),f.character=k}}var l=f.character-1,m=l+1;f.evidence&&(h=f.evidence.substring(l).search(/.\b/),h>-1&&(m+=h)),f.description=f.reason,f.start=f.character,f.end=m,f=c(f),f&&d.push({message:f.description,severity:f.severity,from:a.Pos(f.line-1,l),to:a.Pos(f.line-1,m)})}}}var g=["Dangerous comment"],h=[["Expected '{'","Statement body should be inside '{ }' braces."]],i=["Missing semicolon","Extra comma","Missing property name","Unmatched "," and instead saw"," is not defined","Unclosed string","Stopping, unable to continue"];a.registerHelper("lint","javascript",b)}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/lint/json-lint.min.js b/media/editors/codemirror/addon/lint/json-lint.min.js -index a7ccc3c..dcba6fb 100644 ---- a/media/editors/codemirror/addon/lint/json-lint.min.js -+++ b/media/editors/codemirror/addon/lint/json-lint.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("lint","json",function(o){var r=[];jsonlint.parseError=function(o,t){var n=t.loc;r.push({from:e.Pos(n.first_line-1,n.first_column),to:e.Pos(n.last_line-1,n.last_column),message:o})};try{jsonlint.parse(o)}catch(t){}return r})}); -\ 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.registerHelper("lint","json",function(b){var c=[];jsonlint.parseError=function(b,d){var e=d.loc;c.push({from:a.Pos(e.first_line-1,e.first_column),to:a.Pos(e.last_line-1,e.last_column),message:b})};try{jsonlint.parse(b)}catch(d){}return c})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/lint/lint.js b/media/editors/codemirror/addon/lint/lint.js -index 18eb709..3eea203 100644 ---- a/media/editors/codemirror/addon/lint/lint.js -+++ b/media/editors/codemirror/addon/lint/lint.js -@@ -63,11 +63,9 @@ - this.onMouseOver = function(e) { onMouseOver(cm, e); }; - } - -- function parseOptions(cm, options) { -+ function parseOptions(_cm, options) { - if (options instanceof Function) return {getAnnotations: options}; - if (!options || options === true) options = {}; -- if (!options.getAnnotations) options.getAnnotations = cm.getHelper(CodeMirror.Pos(0, 0), "lint"); -- if (!options.getAnnotations) throw new Error("Required option 'getAnnotations' missing (lint addon)"); - return options; - } - -@@ -120,10 +118,12 @@ - function startLinting(cm) { - var state = cm.state.lint, options = state.options; - var passOptions = options.options || options; // Support deprecated passing of `options` property in options -- if (options.async || options.getAnnotations.async) -- options.getAnnotations(cm.getValue(), updateLinting, passOptions, cm); -+ var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint"); -+ if (!getAnnotations) return; -+ if (options.async || getAnnotations.async) -+ getAnnotations(cm.getValue(), updateLinting, passOptions, cm); - else -- updateLinting(cm, options.getAnnotations(cm.getValue(), passOptions, cm)); -+ updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm)); - } - - function updateLinting(cm, annotationsNotSorted) { -@@ -163,6 +163,7 @@ - - function onChange(cm) { - var state = cm.state.lint; -+ if (!state) return; - clearTimeout(state.timeout); - state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500); - } -@@ -188,6 +189,7 @@ - clearMarks(cm); - cm.off("change", onChange); - CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver); -+ clearTimeout(cm.state.lint.timeout); - delete cm.state.lint; - } - -diff --git a/media/editors/codemirror/addon/lint/lint.min.css b/media/editors/codemirror/addon/lint/lint.min.css -index d807285..967f390 100644 ---- a/media/editors/codemirror/addon/lint/lint.min.css -+++ b/media/editors/codemirror/addon/lint/lint.min.css -@@ -1 +1 @@ --.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:infobackground;border:1px solid black;border-radius:4px 4px 4px 4px;color:infotext;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark-error,.CodeMirror-lint-mark-warning{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-error{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")}.CodeMirror-lint-mark-warning{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=")}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=")}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=")}.CodeMirror-lint-marker-multiple{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%} -\ No newline at end of file -+.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:infobackground;border:1px solid #000;border-radius:4px;color:infotext;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark-error,.CodeMirror-lint-mark-warning{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==)}.CodeMirror-lint-mark-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=)}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=)}.CodeMirror-lint-marker-multiple{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%} -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/lint/lint.min.js b/media/editors/codemirror/addon/lint/lint.min.js -index 4291d87..6d347e7 100644 ---- a/media/editors/codemirror/addon/lint/lint.min.js -+++ b/media/editors/codemirror/addon/lint/lint.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,n){function o(e){return r.parentNode?(r.style.top=Math.max(0,e.clientY-r.offsetHeight-5)+"px",void(r.style.left=e.clientX+5+"px")):t.off(document,"mousemove",o)}var r=document.createElement("div");return r.className="CodeMirror-lint-tooltip",r.appendChild(n.cloneNode(!0)),document.body.appendChild(r),t.on(document,"mousemove",o),o(e),null!=r.style.opacity&&(r.style.opacity=1),r}function n(t){t.parentNode&&t.parentNode.removeChild(t)}function o(t){t.parentNode&&(null==t.style.opacity&&n(t),t.style.opacity=0,setTimeout(function(){n(t)},600))}function r(n,r,i){function a(){t.off(i,"mouseout",a),s&&(o(s),s=null)}var s=e(n,r),u=setInterval(function(){if(s)for(var t=i;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){a();break}}return s?void 0:clearInterval(u)},400);t.on(i,"mouseout",a)}function i(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){g(t,e)}}function a(e,n){if(n instanceof Function)return{getAnnotations:n};if(n&&n!==!0||(n={}),n.getAnnotations||(n.getAnnotations=e.getHelper(t.Pos(0,0),"lint")),!n.getAnnotations)throw new Error("Required option 'getAnnotations' missing (lint addon)");return n}function s(t){var e=t.state.lint;e.hasGutter&&t.clearGutter(h);for(var n=0;n1,n.options.tooltips))}}o.onUpdateLinting&&o.onUpdateLinting(e,r,t)}function p(t){var e=t.state.lint;clearTimeout(e.timeout),e.timeout=setTimeout(function(){d(t)},e.options.delay||500)}function v(t,e){var n=e.target||e.srcElement;r(e,f(t),n)}function g(t,e){var n=e.target||e.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className))for(var o=n.getBoundingClientRect(),r=(o.left+o.right)/2,i=(o.top+o.bottom)/2,a=t.findMarksAt(t.coordsChar({left:r,top:i},"client")),s=0;s1,c.options.tooltips))}}d.onUpdateLinting&&d.onUpdateLinting(b,e,a)}function o(a){var b=a.state.lint;b&&(clearTimeout(b.timeout),b.timeout=setTimeout(function(){m(a)},b.options.delay||500))}function p(a,b){var c=b.target||b.srcElement;e(b,l(a),c)}function q(a,b){var c=b.target||b.srcElement;if(/\bCodeMirror-lint-mark-/.test(c.className))for(var d=c.getBoundingClientRect(),e=(d.left+d.right)/2,f=(d.top+d.bottom)/2,g=a.findMarksAt(a.coordsChar({left:e,top:f},"client")),h=0;h 0 ? a : b; } - function posEq(a, b) { return a.line == b.line && a.ch == b.ch; } -+ -+ function findPrevDiff(chunks, start, isOrig) { -+ for (var i = chunks.length - 1; i >= 0; i--) { -+ var chunk = chunks[i]; -+ var to = (isOrig ? chunk.origTo : chunk.editTo) - 1; -+ if (to < start) return to; -+ } -+ } -+ -+ function findNextDiff(chunks, start, isOrig) { -+ for (var i = 0; i < chunks.length; i++) { -+ var chunk = chunks[i]; -+ var from = (isOrig ? chunk.origFrom : chunk.editFrom); -+ if (from > start) return from; -+ } -+ } -+ -+ function goNearbyDiff(cm, dir) { -+ var found = null, views = cm.state.diffViews, line = cm.getCursor().line; -+ if (views) for (var i = 0; i < views.length; i++) { -+ var dv = views[i], isOrig = cm == dv.orig; -+ ensureDiff(dv); -+ var pos = dir < 0 ? findPrevDiff(dv.chunks, line, isOrig) : findNextDiff(dv.chunks, line, isOrig); -+ if (pos != null && (found == null || (dir < 0 ? pos > found : pos < found))) -+ found = pos; -+ } -+ if (found != null) -+ cm.setCursor(found, 0); -+ else -+ return CodeMirror.Pass; -+ } -+ -+ CodeMirror.commands.goNextDiff = function(cm) { -+ return goNearbyDiff(cm, 1); -+ }; -+ CodeMirror.commands.goPrevDiff = function(cm) { -+ return goNearbyDiff(cm, -1); -+ }; - }); -diff --git a/media/editors/codemirror/addon/merge/merge.min.css b/media/editors/codemirror/addon/merge/merge.min.css -index 78619f7..2bc2c22 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-copybuttons-left,.CodeMirror-merge-copybuttons-right{position:absolute;left:0;top:0;right:0;bottom:0;line-height:1}.CodeMirror-merge-copy{position:absolute;cursor:pointer;color:#44c}.CodeMirror-merge-copy-reverse{position:absolute;cursor:pointer;color:#44c}.CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy{left:2px}.CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy{right:2px}.CodeMirror-merge-r-inserted,.CodeMirror-merge-l-inserted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==);background-position:bottom left;background-repeat:repeat-x}.CodeMirror-merge-r-deleted,.CodeMirror-merge-l-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-copybuttons-left,.CodeMirror-merge-copybuttons-right{position:absolute;left:0;top:0;right:0;bottom:0;line-height:1}.CodeMirror-merge-copy,.CodeMirror-merge-copy-reverse{position:absolute;cursor:pointer;color:#44c}.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 f971d27..c98b851 100644 ---- a/media/editors/codemirror/addon/merge/merge.min.js -+++ b/media/editors/codemirror/addon/merge/merge.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("diff_match_patch")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],e):e(CodeMirror,diff_match_patch)}(function(e,t){"use strict";function r(e,t){this.mv=e,this.type=t,this.classes="left"==t?{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 i(t){t.diffOutOfDate&&(t.diff=y(t.orig.getValue(),t.edit.getValue()),t.chunks=w(t.diff),t.diffOutOfDate=!1,e.signal(t.edit,"updateDiff",t.diff))}function o(e){function t(t){U=!0,h=!1,"full"==t&&(e.svg&&N(e.svg),e.copyButtons&&N(e.copyButtons),s(e.edit,a.marked,e.classes),s(e.orig,c.marked,e.classes),a.from=a.to=c.from=c.to=0),i(e),e.showDifferences&&(f(e.edit,e.diff,a,DIFF_INSERT,e.classes),f(e.orig,e.diff,c,DIFF_DELETE,e.classes)),d(e),"align"==e.mv.options.connect&&m(e),U=!1}function r(t){U||(e.dealigned=!0,o(t))}function o(e){U||h||(clearTimeout(l),e===!0&&(h=!0),l=setTimeout(t,e===!0?20:250))}function n(t,i){e.diffOutOfDate||(e.diffOutOfDate=!0,a.from=a.to=c.from=c.to=0),r(i.text.length-1!=i.to.line-i.from.line)}var l,a={from:0,to:0,marked:[]},c={from:0,to:0,marked:[]},h=!1;return e.edit.on("change",n),e.orig.on("change",n),e.edit.on("markerAdded",r),e.edit.on("markerCleared",r),e.orig.on("markerAdded",r),e.orig.on("markerCleared",r),e.edit.on("viewportChange",function(){o(!1)}),e.orig.on("viewportChange",function(){o(!1)}),t(),t}function n(e){e.edit.on("scroll",function(){l(e,DIFF_INSERT)&&d(e)}),e.orig.on("scroll",function(){l(e,DIFF_DELETE)&&d(e)})}function l(e,t){if(e.diffOutOfDate)return!1;if(!e.lockScroll)return!0;var r,i,o=+new Date;if(t==DIFF_INSERT?(r=e.edit,i=e.orig):(r=e.orig,i=e.edit),r.state.scrollSetBy==e&&(r.state.scrollSetAt||0)+50>o)return!1;var n=r.getScrollInfo();if("align"==e.mv.options.connect)v=n.top;else{var l,c,s=.5*n.clientHeight,f=n.top+s,h=r.lineAtHeight(f,"local"),d=L(e.chunks,h,t==DIFF_INSERT),u=a(r,t==DIFF_INSERT?d.edit:d.orig),g=a(i,t==DIFF_INSERT?d.orig:d.edit),m=(f-u.top)/(u.bot-u.top),v=g.top-s+m*(g.bot-g.top);if(v>n.top&&(c=n.top/s)<1)v=v*c+n.top*(1-c);else if((l=n.height-n.clientHeight-n.top)l&&(c=l/s)<1&&(v=v*c+(p.height-p.clientHeight-l)*(1-c))}}return i.scrollTo(n.left,v),i.state.scrollSetAt=o,i.state.scrollSetBy=e,!0}function a(e,t){var r=t.after;return null==r&&(r=e.lastLine()+1),{top:e.heightAtLine(t.before||0,"local"),bot:e.heightAtLine(r,"local")}}function c(e,t,r){e.lockScroll=t,t&&0!=r&&l(e,DIFF_INSERT)&&d(e),e.lockButton.innerHTML=t?"⇛⇚":"⇛  ⇚"}function s(t,r,i){for(var o=0;o20||r.from-n.to>20?(s(e,r.marked,o),h(e,t,i,r.marked,n.from,n.to,o),r.from=n.from,r.to=n.to):(n.fromr.to&&(h(e,t,i,r.marked,r.to,n.to,o),r.to=n.to))})}function h(e,t,r,i,o,n,l){function a(t,r){for(var a=Math.max(o,t),c=Math.min(n,r),s=a;c>s;++s){var f=e.addLineClass(s,"background",l.chunk);s==t&&e.addLineClass(f,"background",l.start),s==r-1&&e.addLineClass(f,"background",l.end),i.push(f)}t==r&&a==r&&c==r&&i.push(a?e.addLineClass(a-1,"background",l.end):e.addLineClass(a,"background",l.start))}for(var c=H(0,0),s=H(o,0),f=e.clipPos(H(n-1)),h=r==DIFF_DELETE?l.del:l.insert,d=0,u=0;up&&(u&&a(d,p),d=k)}else if(m==r){var C=x(c,v,!0),T=R(s,c),F=B(f,C);V(T,F)||i.push(e.markText(T,F,{className:h})),c=C}}d<=c.line&&a(d,c.line+1)}function d(e){if(e.showDifferences){if(e.svg){N(e.svg);var t=e.gap.offsetWidth;_(e.svg,"width",t,"height",e.gap.offsetHeight)}e.copyButtons&&N(e.copyButtons);for(var r=e.edit.getViewport(),i=e.orig.getViewport(),o=e.edit.getScrollInfo().top,n=e.orig.getScrollInfo().top,l=0;l=r.from&&a.origFrom<=i.to&&a.origTo>=i.from&&k(e,a,n,o,t)}}}function u(e,t){for(var r=0,i=0,o=0;oe&&n.editFrom<=e)return null;if(n.editFrom>e)break;r=n.editTo,i=n.origTo}return i+(e-r)}function g(e,t){for(var r=[],i=0;io.editTo)break}n>-1&&r.splice(n-1,0,[u(o.editTo,e.chunks),o.editTo,o.origTo])}return r}function m(e,t){if(e.dealigned||t){if(!e.orig.curOp)return e.orig.operation(function(){m(e,t)});e.dealigned=!1;var r=e.mv.left==e?e.mv.right:e.mv.left;r&&(i(r),r.dealigned=!1);for(var o=g(e,r),n=e.mv.aligners,l=0;l1&&r.push(p(e[n],t[n],a))}}function p(e,t,r){var i=!0;t>e.lastLine()&&(t--,i=!1);var o=document.createElement("div");return o.className="CodeMirror-merge-spacer",o.style.height=r+"px",o.style.minWidth="1px",e.addLineWidget(t,o,{height:r,above:i})}function k(e,t,r,i,o){var n="left"==e.type,l=e.orig.heightAtLine(t.origFrom,"local")-r;if(e.svg){var a=l,c=e.edit.heightAtLine(t.editFrom,"local")-i;if(n){var s=a;a=c,c=s}var f=e.orig.heightAtLine(t.origTo,"local")-r,h=e.edit.heightAtLine(t.editTo,"local")-i;if(n){var s=f;f=h,h=s}var d=" C "+o/2+" "+c+" "+o/2+" "+a+" "+(o+2)+" "+a,u=" C "+o/2+" "+f+" "+o/2+" "+h+" -1 "+h;_(e.svg.appendChild(document.createElementNS(P,"path")),"d","M -1 "+c+d+" L "+(o+2)+" "+f+u+" z","class",e.classes.connect)}if(e.copyButtons){var g=e.copyButtons.appendChild(O("div","left"==e.type?"⇝":"⇜","CodeMirror-merge-copy")),m=e.mv.options.allowEditingOriginals;if(g.title=m?"Push to left":"Revert chunk",g.chunk=t,g.style.top=l+"px",m){var v=e.orig.heightAtLine(t.editFrom,"local")-i,p=e.copyButtons.appendChild(O("div","right"==e.type?"⇝":"⇜","CodeMirror-merge-copy-reverse"));p.title="Push to right",p.chunk={editFrom:t.origFrom,editTo:t.origTo,origFrom:t.editFrom,origTo:t.editTo},p.style.top=v+"px","right"==e.type?p.style.left="2px":p.style.right="2px"}}}function C(e,t,r,i){e.diffOutOfDate||t.replaceRange(r.getRange(H(i.origFrom,0),H(i.origTo,0)),H(i.editFrom,0),H(i.editTo,0))}function T(t){var r=t.lockButton=O("div",null,"CodeMirror-merge-scrolllock");r.title="Toggle locked scrolling";var i=O("div",[r],"CodeMirror-merge-scrolllock-wrap");e.on(r,"click",function(){c(t,!t.lockScroll)});var o=[i];if(t.mv.options.revertButtons!==!1&&(t.copyButtons=O("div",null,"CodeMirror-merge-copybuttons-"+t.type),e.on(t.copyButtons,"click",function(e){var r=e.target||e.srcElement;if(r.chunk)return"CodeMirror-merge-copy-reverse"==r.className?void C(t,t.orig,t.edit,r.chunk):void C(t,t.edit,t.orig,r.chunk)}),o.unshift(t.copyButtons)),"align"!=t.mv.options.connect){var n=document.createElementNS&&document.createElementNS(P,"svg");n&&!n.createSVGRect&&(n=null),t.svg=n,n&&o.push(n)}return t.gap=O("div",o,"CodeMirror-merge-gap")}function F(e){return"string"==typeof e?e:e.getValue()}function y(e,t){var r=z.diff_main(e,t);z.diff_cleanupSemantic(r);for(var i=0;if&&(l&&t.push({origFrom:i,origTo:h,editFrom:r,editTo:f}),r=u,i=g)}else x(c==DIFF_INSERT?o:n,a[1])}return(r<=o.line||i<=n.line)&&t.push({origFrom:i,origTo:n.line+1,editFrom:r,editTo:o.line+1}),t}function M(e,t){if(t==e.length-1)return!0;var r=e[t+1][1];return 1==r.length||10!=r.charCodeAt(0)?!1:t==e.length-2?!0:(r=e[t+2][1],r.length>1&&10==r.charCodeAt(0))}function D(e,t){if(0==t)return!0;var r=e[t-1][1];return 10!=r.charCodeAt(r.length-1)?!1:1==t?!0:(r=e[t-2][1],10==r.charCodeAt(r.length-1))}function L(e,t,r){for(var i,o,n,l,a=0;at?(o=c.editFrom,l=c.origFrom):f>t&&(o=c.editTo,l=c.origTo)),t>=f?(i=c.editTo,n=c.origTo):t>=s&&(i=c.editFrom,n=c.origFrom)}return{edit:{before:i,after:o},orig:{before:n,after:l}}}function I(e,t,r){function i(){n.clear(),e.removeLineClass(t,"wrap","CodeMirror-merge-collapsed-line")}e.addLineClass(t,"wrap","CodeMirror-merge-collapsed-line");var o=document.createElement("span");o.className="CodeMirror-merge-collapsed-widget",o.title="Identical text collapsed. Click to expand.";var n=e.markText(H(t,0),H(r-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:o,clearOnEnter:!0});return o.addEventListener("click",i),{mark:n,clear:i}}function b(e,t){function r(){for(var e=0;e=0&&a=n;n++)r.push(!0);e.left&&E(e.left,t,o,r),e.right&&E(e.right,t,o,r);for(var a=0;at){var f=[{line:c,cm:i}];e.left&&f.push({line:u(c,e.left.chunks),cm:e.left.orig}),e.right&&f.push({line:u(c,e.right.chunks),cm:e.right.orig});var h=b(s,f);e.options.onCollapse&&e.options.onCollapse(e,c,s,h)}}}function O(e,t,r,i){var o=document.createElement(e);if(r&&(o.className=r),i&&(o.style.cssText=i),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var n=0;n0;--t)e.removeChild(e.firstChild)}function _(e){for(var t=1;t0?e:t}function V(e,t){return e.line==t.line&&e.ch==t.ch}var H=e.Pos,P="http://www.w3.org/2000/svg";r.prototype={constructor:r,init:function(t,r,i){this.edit=this.mv.edit,this.orig=e(t,A({value:r,readOnly:!this.mv.options.allowEditingOriginals},A(i))),this.diff=y(F(r),F(i.value)),this.chunks=w(this.diff),this.diffOutOfDate=this.dealigned=!1,this.showDifferences=i.showDifferences!==!1,this.forceUpdate=o(this),c(this,!0,!1),n(this)},setShowDifferences:function(e){e=e!==!1,e!=this.showDifferences&&(this.showDifferences=e,this.forceUpdate("full"))}};var U=!1,W=e.MergeView=function(t,i){if(!(this instanceof W))return new W(t,i);this.options=i;var o=i.origLeft,n=null==i.origRight?i.orig:i.origRight,l=null!=o,a=null!=n,c=1+(l?1:0)+(a?1:0),s=[],f=this.left=null,h=this.right=null,u=this;if(l){f=this.left=new r(this,"left");var g=O("div",null,"CodeMirror-merge-pane");s.push(g),s.push(T(f))}var v=O("div",null,"CodeMirror-merge-pane");if(s.push(v),a){h=this.right=new r(this,"right"),s.push(T(h));var p=O("div",null,"CodeMirror-merge-pane");s.push(p)}(a?p:v).className+=" CodeMirror-merge-pane-rightmost",s.push(O("div",null,null,"height: 0; clear: both;"));var k=this.wrap=t.appendChild(O("div",s,"CodeMirror-merge CodeMirror-merge-"+c+"pane"));this.edit=e(v,A(i)),f&&f.init(g,o,i),h&&h.init(p,n,i),i.collapseIdentical&&(U=!0,this.editor().operation(function(){S(u,i.collapseIdentical)}),U=!1),"align"==i.connect&&(this.aligners=[],m(this.left||this.right,!0));var C=function(){f&&d(f),h&&d(h)};e.on(window,"resize",C);var F=setInterval(function(){for(var t=k.parentNode;t&&t!=document.body;t=t.parentNode);t||(clearInterval(F),e.off(window,"resize",C))},5e3)};W.prototype={constuctor:W,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(e){this.right&&this.right.setShowDifferences(e),this.left&&this.left.setShowDifferences(e)},rightChunks:function(){return this.right?(i(this.right),this.right.chunks):void 0},leftChunks:function(){return this.left?(i(this.left),this.left.chunks):void 0}};var z=new t}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("diff_match_patch")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","diff_match_patch"],a):a(CodeMirror,diff_match_patch)}(function(a,b){"use strict";function c(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 d(b){b.diffOutOfDate&&(b.diff=w(b.orig.getValue(),b.edit.getValue()),b.chunks=x(b.diff),b.diffOutOfDate=!1,a.signal(b.edit,"updateDiff",b.diff))}function e(a){function b(b){S=!0,l=!1,"full"==b&&(a.svg&&G(a.svg),a.copyButtons&&G(a.copyButtons),j(a.edit,h.marked,a.classes),j(a.orig,i.marked,a.classes),h.from=h.to=i.from=i.to=0),d(a),a.showDifferences&&(k(a.edit,a.diff,h,DIFF_INSERT,a.classes),k(a.orig,a.diff,i,DIFF_DELETE,a.classes)),m(a),"align"==a.mv.options.connect&&p(a),S=!1}function c(b){S||(a.dealigned=!0,e(b))}function e(a){S||l||(clearTimeout(g),a===!0&&(l=!0),g=setTimeout(b,a===!0?20:250))}function f(b,d){a.diffOutOfDate||(a.diffOutOfDate=!0,h.from=h.to=i.from=i.to=0),c(d.text.length-1!=d.to.line-d.from.line)}var g,h={from:0,to:0,marked:[]},i={from:0,to:0,marked:[]},l=!1;return a.edit.on("change",f),a.orig.on("change",f),a.edit.on("markerAdded",c),a.edit.on("markerCleared",c),a.orig.on("markerAdded",c),a.orig.on("markerCleared",c),a.edit.on("viewportChange",function(){e(!1)}),a.orig.on("viewportChange",function(){e(!1)}),b(),b}function f(a){a.edit.on("scroll",function(){g(a,DIFF_INSERT)&&m(a)}),a.orig.on("scroll",function(){g(a,DIFF_DELETE)&&m(a)})}function g(a,b){if(a.diffOutOfDate)return!1;if(!a.lockScroll)return!0;var c,d,e=+new Date;if(b==DIFF_INSERT?(c=a.edit,d=a.orig):(c=a.orig,d=a.edit),c.state.scrollSetBy==a&&(c.state.scrollSetAt||0)+50>e)return!1;var f=c.getScrollInfo();if("align"==a.mv.options.connect)q=f.top;else{var g,i,j=.5*f.clientHeight,k=f.top+j,l=c.lineAtHeight(k,"local"),m=A(a.chunks,l,b==DIFF_INSERT),n=h(c,b==DIFF_INSERT?m.edit:m.orig),o=h(d,b==DIFF_INSERT?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((g=f.height-f.clientHeight-f.top)g&&(i=g/j)<1&&(q=q*i+(r.height-r.clientHeight-g)*(1-i))}}return d.scrollTo(f.left,q),d.state.scrollSetAt=e,d.state.scrollSetBy=a,!0}function h(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 i(a,b,c){a.lockScroll=b,b&&0!=c&&g(a,DIFF_INSERT)&&m(a),a.lockButton.innerHTML=b?"⇛⇚":"⇛  ⇚"}function j(b,c,d){for(var e=0;e20||c.from-f.to>20?(j(a,c.marked,e),l(a,b,d,c.marked,f.from,f.to,e),c.from=f.from,c.to=f.to):(f.fromc.to&&(l(a,b,d,c.marked,c.to,f.to,e),c.to=f.to))})}function l(a,b,c,d,e,f,g){function h(b,c){for(var h=Math.max(e,b),i=Math.min(f,c),j=h;i>j;++j){var k=a.addLineClass(j,"background",g.chunk);j==b&&a.addLineClass(k,"background",g.start),j==c-1&&a.addLineClass(k,"background",g.end),d.push(k)}b==c&&h==c&&i==c&&(h?d.push(a.addLineClass(h-1,"background",g.end)):d.push(a.addLineClass(h,"background",g.start)))}for(var i=Q(0,0),j=Q(e,0),k=a.clipPos(Q(f-1)),l=c==DIFF_DELETE?g.del:g.insert,m=0,n=0;nr&&(n&&h(m,r),m=s)}else if(p==c){var t=J(i,q,!0),u=L(j,i),v=K(k,t);M(u,v)||d.push(a.markText(u,v,{className:l})),i=t}}m<=i.line&&h(m,i.line+1)}function m(a){if(a.showDifferences){if(a.svg){G(a.svg);var b=a.gap.offsetWidth;H(a.svg,"width",b,"height",a.gap.offsetHeight)}a.copyButtons&&G(a.copyButtons);for(var c=a.edit.getViewport(),d=a.orig.getViewport(),e=a.edit.getScrollInfo().top,f=a.orig.getScrollInfo().top,g=0;g=c.from&&h.origFrom<=d.to&&h.origTo>=d.from&&s(a,h,f,e,b)}}}function n(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 o(a,b){for(var c=[],d=0;de.editTo)break}f>-1&&c.splice(f-1,0,[n(e.editTo,a.chunks),e.editTo,e.origTo])}return c}function p(a,b){if(a.dealigned||b){if(!a.orig.curOp)return a.orig.operation(function(){p(a,b)});a.dealigned=!1;var c=a.mv.left==a?a.mv.right:a.mv.left;c&&(d(c),c.dealigned=!1);for(var e=o(a,c),f=a.mv.aligners,g=0;g1&&c.push(r(a[f],b[f],h))}}function r(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})}function s(a,b,c,d,e){var f="left"==a.type,g=a.orig.heightAtLine(b.origFrom,"local")-c;if(a.svg){var h=g,i=a.edit.heightAtLine(b.editFrom,"local")-d;if(f){var j=h;h=i,i=j}var k=a.orig.heightAtLine(b.origTo,"local")-c,l=a.edit.heightAtLine(b.editTo,"local")-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;H(a.svg.appendChild(document.createElementNS(R,"path")),"d","M -1 "+i+m+" L "+(e+2)+" "+k+n+" z","class",a.classes.connect)}if(a.copyButtons){var o=a.copyButtons.appendChild(F("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=g+"px",p){var q=a.orig.heightAtLine(b.editFrom,"local")-d,r=a.copyButtons.appendChild(F("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 t(a,b,c,d){a.diffOutOfDate||b.replaceRange(c.getRange(Q(d.origFrom,0),Q(d.origTo,0)),Q(d.editFrom,0),Q(d.editTo,0))}function u(b){var c=b.lockButton=F("div",null,"CodeMirror-merge-scrolllock");c.title="Toggle locked scrolling";var d=F("div",[c],"CodeMirror-merge-scrolllock-wrap");a.on(c,"click",function(){i(b,!b.lockScroll)});var e=[d];if(b.mv.options.revertButtons!==!1&&(b.copyButtons=F("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 t(b,b.orig,b.edit,c.chunk):void t(b,b.edit,b.orig,c.chunk)}),e.unshift(b.copyButtons)),"align"!=b.mv.options.connect){var f=document.createElementNS&&document.createElementNS(R,"svg");f&&!f.createSVGRect&&(f=null),b.svg=f,f&&e.push(f)}return b.gap=F("div",e,"CodeMirror-merge-gap")}function v(a){return"string"==typeof a?a:a.getValue()}function w(a,b){var c=U.diff_main(a,b);U.diff_cleanupSemantic(c);for(var d=0;dk&&(g&&b.push({origFrom:d,origTo:l,editFrom:c,editTo:k}),c=n,d=o)}else J(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 y(a,b){if(b==a.length-1)return!0;var c=a[b+1][1];return 1==c.length||10!=c.charCodeAt(0)?!1:b==a.length-2?!0:(c=a[b+2][1],c.length>1&&10==c.charCodeAt(0))}function z(a,b){if(0==b)return!0;var c=a[b-1][1];return 10!=c.charCodeAt(c.length-1)?!1:1==b?!0:(c=a[b-2][1],10==c.charCodeAt(c.length-1))}function A(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)),b>=k?(d=i.editTo,f=i.origTo):b>=j&&(d=i.editFrom,f=i.origFrom)}return{edit:{before:d,after:e},orig:{before:f,after:g}}}function B(a,b,c){function d(){f.clear(),a.removeLineClass(b,"wrap","CodeMirror-merge-collapsed-line")}a.addLineClass(b,"wrap","CodeMirror-merge-collapsed-line");var e=document.createElement("span");e.className="CodeMirror-merge-collapsed-widget",e.title="Identical text collapsed. Click to expand.";var f=a.markText(Q(b,0),Q(c-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:e,clearOnEnter:!0});return e.addEventListener("click",d),{mark:f,clear:d}}function C(a,b){function c(){for(var a=0;a=0&&h=f;f++)c.push(!0);a.left&&D(a.left,b,e,c),a.right&&D(a.right,b,e,c);for(var h=0;hb){var k=[{line:i,cm:d}];a.left&&k.push({line:n(i,a.left.chunks),cm:a.left.orig}),a.right&&k.push({line:n(i,a.right.chunks),cm:a.right.orig});var l=C(j,k);a.options.onCollapse&&a.options.onCollapse(a,i,j,l)}}}function F(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 H(a){for(var b=1;b0?a:b}function M(a,b){return a.line==b.line&&a.ch==b.ch}function N(a,b,c){for(var d=a.length-1;d>=0;d--){var e=a[d],f=(c?e.origTo:e.editTo)-1;if(b>f)return f}}function O(a,b,c){for(var d=0;db)return f}}function P(b,c){var e=null,f=b.state.diffViews,g=b.getCursor().line;if(f)for(var h=0;hc?N(i.chunks,g,j):O(i.chunks,g,j);null==k||null!=e&&!(0>c?k>e:e>k)||(e=k)}return null==e?a.Pass:void b.setCursor(e,0)}var Q=a.Pos,R="http://www.w3.org/2000/svg";c.prototype={constructor:c,init:function(b,c,d){this.edit=this.mv.edit,(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this),this.orig=a(b,I({value:c,readOnly:!this.mv.options.allowEditingOriginals},I(d))),this.orig.state.diffViews=[this],this.diff=w(v(c),v(d.value)),this.chunks=x(this.diff),this.diffOutOfDate=this.dealigned=!1,this.showDifferences=d.showDifferences!==!1,this.forceUpdate=e(this),i(this,!0,!1),f(this)},setShowDifferences:function(a){a=a!==!1,a!=this.showDifferences&&(this.showDifferences=a,this.forceUpdate("full"))}};var S=!1,T=a.MergeView=function(b,d){if(!(this instanceof T))return new T(b,d);this.options=d;var e=d.origLeft,f=null==d.origRight?d.orig:d.origRight,g=null!=e,h=null!=f,i=1+(g?1:0)+(h?1:0),j=[],k=this.left=null,l=this.right=null,n=this;if(g){k=this.left=new c(this,"left");var o=F("div",null,"CodeMirror-merge-pane");j.push(o),j.push(u(k))}var q=F("div",null,"CodeMirror-merge-pane");if(j.push(q),h){l=this.right=new c(this,"right"),j.push(u(l));var r=F("div",null,"CodeMirror-merge-pane");j.push(r)}(h?r:q).className+=" CodeMirror-merge-pane-rightmost",j.push(F("div",null,null,"height: 0; clear: both;"));var s=this.wrap=b.appendChild(F("div",j,"CodeMirror-merge CodeMirror-merge-"+i+"pane"));this.edit=a(q,I(d)),k&&k.init(o,e,d),l&&l.init(r,f,d),d.collapseIdentical&&(S=!0,this.editor().operation(function(){E(n,d.collapseIdentical)}),S=!1),"align"==d.connect&&(this.aligners=[],p(this.left||this.right,!0));var t=function(){k&&m(k),l&&m(l)};a.on(window,"resize",t);var v=setInterval(function(){for(var b=s.parentNode;b&&b!=document.body;b=b.parentNode);b||(clearInterval(v),a.off(window,"resize",t))},5e3)};T.prototype={constuctor:T,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(a){this.right&&this.right.setShowDifferences(a),this.left&&this.left.setShowDifferences(a)},rightChunks:function(){return this.right?(d(this.right),this.right.chunks):void 0},leftChunks:function(){return this.left?(d(this.left),this.left.chunks):void 0}};var U=new b;a.commands.goNextDiff=function(a){return P(a,1)},a.commands.goPrevDiff=function(a){return P(a,-1)}}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/mode/loadmode.min.js b/media/editors/codemirror/addon/mode/loadmode.min.js -index 6403f3b..0434d34 100644 ---- a/media/editors/codemirror/addon/mode/loadmode.min.js -+++ b/media/editors/codemirror/addon/mode/loadmode.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],function(r){e(r,"amd")}):e(CodeMirror,"plain")}(function(e,r){function o(e,r){var o=r;return function(){0==--o&&e()}}function n(r,n){var t=e.modes[r].dependencies;if(!t)return n();for(var i=[],d=0;d -1 ? found + pattern.length : found; -+ } - var m = pattern.exec(from ? string.slice(from) : string); -- return m ? m.index + from : -1; -+ return m ? m.index + from + (returnEnd ? m[0].length : 0) : -1; - } - - return { -@@ -42,11 +44,11 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - token: function(stream, state) { - if (!state.innerActive) { - var cutOff = Infinity, oldContent = stream.string; -- for (var i = 0; i < n_others; ++i) { -+ for (var i = 0; i < others.length; ++i) { - var other = others[i]; - var found = indexOf(oldContent, other.open, stream.pos); - if (found == stream.pos) { -- stream.match(other.open); -+ if (!other.parseDelimiters) stream.match(other.open); - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); - return other.delimStyle; -@@ -64,8 +66,8 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - state.innerActive = state.inner = null; - return this.token(stream, state); - } -- var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos) : -1; -- if (found == stream.pos) { -+ var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos, curInner.parseDelimiters) : -1; -+ if (found == stream.pos && !curInner.parseDelimiters) { - stream.match(curInner.close); - state.innerActive = state.inner = null; - return curInner.delimStyle; -@@ -74,6 +76,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - var innerToken = curInner.mode.token(stream, state.inner); - if (found > -1) stream.string = oldContent; - -+ if (found == stream.pos && curInner.parseDelimiters) -+ state.innerActive = state.inner = null; -+ - if (curInner.innerStyle) { - if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle; - else innerToken = curInner.innerStyle; -@@ -95,7 +100,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - mode.blankLine(state.innerActive ? state.inner : state.outer); - } - if (!state.innerActive) { -- for (var i = 0; i < n_others; ++i) { -+ for (var i = 0; i < others.length; ++i) { - var other = others[i]; - if (other.open === "\n") { - state.innerActive = other; -diff --git a/media/editors/codemirror/addon/mode/multiplex.min.js b/media/editors/codemirror/addon/mode/multiplex.min.js -index 48438d5..11b56f6 100644 ---- a/media/editors/codemirror/addon/mode/multiplex.min.js -+++ b/media/editors/codemirror/addon/mode/multiplex.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.multiplexingMode=function(n){function t(e,n,t){if("string"==typeof n)return e.indexOf(n,t);var r=n.exec(t?e.slice(t):e);return r?r.index+t:-1}var r=Array.prototype.slice.call(arguments,1),i=r.length;return{startState:function(){return{outer:e.startState(n),innerActive:null,inner:null}},copyState:function(t){return{outer:e.copyState(n,t.outer),innerActive:t.innerActive,inner:t.innerActive&&e.copyState(t.innerActive.mode,t.inner)}},token:function(o,c){if(c.innerActive){var u=c.innerActive,l=o.string;if(!u.close&&o.sol())return c.innerActive=c.inner=null,this.token(o,c);var a=u.close?t(l,u.close,o.pos):-1;if(a==o.pos)return o.match(u.close),c.innerActive=c.inner=null,u.delimStyle;a>-1&&(o.string=l.slice(0,a));var s=u.mode.token(o,c.inner);return a>-1&&(o.string=l),u.innerStyle&&(s=s?s+" "+u.innerStyle:u.innerStyle),s}for(var v=1/0,l=o.string,d=0;i>d;++d){var f=r[d],a=t(l,f.open,o.pos);if(a==o.pos)return o.match(f.open),c.innerActive=f,c.inner=e.startState(f.mode,n.indent?n.indent(c.outer,""):0),f.delimStyle;-1!=a&&v>a&&(v=a)}1/0!=v&&(o.string=l.slice(0,v));var A=n.token(o,c.outer);return 1/0!=v&&(o.string=l),A},indent:function(t,r){var i=t.innerActive?t.innerActive.mode:n;return i.indent?i.indent(t.innerActive?t.inner:t.outer,r):e.Pass},blankLine:function(t){var o=t.innerActive?t.innerActive.mode:n;if(o.blankLine&&o.blankLine(t.innerActive?t.inner:t.outer),t.innerActive)"\n"===t.innerActive.close&&(t.innerActive=t.inner=null);else for(var c=0;i>c;++c){var u=r[c];"\n"===u.open&&(t.innerActive=u,t.inner=e.startState(u.mode,o.indent?o.indent(t.outer,""):0))}},electricChars:n.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:n}}}}}); -\ 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.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;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;li&&(k=i)}k!=1/0&&(e.string=h.slice(0,k));var n=b.token(e,f.outer);return k!=1/0&&(e.string=h),n},indent:function(c,d){var e=c.innerActive?c.innerActive.mode:b;return e.indent?e.indent(c.innerActive?c.inner:c.outer,d):a.Pass},blankLine:function(c){var e=c.innerActive?c.innerActive.mode:b;if(e.blankLine&&e.blankLine(c.innerActive?c.inner:c.outer),c.innerActive)"\n"===c.innerActive.close&&(c.innerActive=c.inner=null);else for(var f=0;f2){a.pending=[];for(var f=2;f-1)return e.Pass;var i=a.indent.length-1,l=t[a.state];e:for(;;){for(var d=0;di?0:a.indent[i]}}e.defineSimpleMode=function(t,n){e.defineMode(t,function(t){return e.simpleMode(t,n)})},e.simpleMode=function(n,a){t(a,"start");var i={},l=a.meta||{},s=!1;for(var c in a)if(c!=l&&a.hasOwnProperty(c))for(var u=i[c]=[],f=a[c],p=0;p2){d.pending=[];for(var m=2;m-1)return a.Pass;var g=d.indent.length-1,h=b[d.state];a:for(;;){for(var j=0;jg?0:d.indent[g]}}a.defineSimpleMode=function(b,c){a.defineMode(b,function(b){return a.simpleMode(b,c)})},a.simpleMode=function(c,d){b(d,"start");var g={},h=d.meta||{},i=!1;for(var k in d)if(k!=h&&d.hasOwnProperty(k))for(var l=g[k]=[],m=d[k],n=0;n=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||null},next:function(){return this.posr},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var r=this.string.indexOf(t,this.pos);return r>-1?(this.pos=r,!0):void 0},backUp:function(t){this.pos-=t},column:function(){return this.start-this.lineStart},indentation:function(){return 0},match:function(t,r,e){if("string"!=typeof t){var n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&r!==!1&&(this.pos+=n[0].length),n)}var i=function(t){return e?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);return i(o)==i(t)?(r!==!1&&(this.pos+=t.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,r){this.lineStart+=t;try{return r()}finally{this.lineStart-=t}}},CodeMirror.StringStream=r,CodeMirror.startState=function(t,r,e){return t.startState?t.startState(r,e):!0};var e=CodeMirror.modes={},n=CodeMirror.mimeModes={};CodeMirror.defineMode=function(t,r){arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),e[t]=r},CodeMirror.defineMIME=function(t,r){n[t]=r},CodeMirror.resolveMode=function(t){return"string"==typeof t&&n.hasOwnProperty(t)?t=n[t]:t&&"string"==typeof t.name&&n.hasOwnProperty(t.name)&&(t=n[t.name]),"string"==typeof t?{name:t}:t||{name:"null"}},CodeMirror.getMode=function(t,r){r=CodeMirror.resolveMode(r);var n=e[r.name];if(!n)throw new Error("Unknown mode: "+r);return n(t,r)},CodeMirror.registerHelper=CodeMirror.registerGlobalHelper=Math.min,CodeMirror.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}}),CodeMirror.defineMIME("text/plain","null"),CodeMirror.runMode=function(r,e,n,i){var o=CodeMirror.getMode({indentUnit:2},e);if(1==n.nodeType){var s=i&&i.tabSize||4,a=n,h=0;a.innerHTML="",n=function(t,r){if("\n"==t)return a.appendChild(document.createElement("br")),void(h=0);for(var e="",n=0;;){var i=t.indexOf(" ",n);if(-1==i){e+=t.slice(n),h+=t.length-n;break}h+=i-n,e+=t.slice(n,i);var o=s-h%s;h+=o;for(var u=0;o>u;++u)e+=" ";n=i+1}if(r){var d=a.appendChild(document.createElement("span"));d.className="cm-"+r.replace(/ +/g," cm-"),d.appendChild(document.createTextNode(e))}else a.appendChild(document.createTextNode(e))}}for(var u=t(r),d=i&&i.state||CodeMirror.startState(o),c=0,l=u.length;l>c;++c){c&&n("\n");var p=new CodeMirror.StringStream(u[c]);for(!p.string&&o.blankLine&&o.blankLine(d);!p.eol();){var f=o.token(p,d);n(p.current(),f,c,p.start,d),p.start=p.pos}}}}(); -\ No newline at end of file -+window.CodeMirror={},function(){"use strict";function a(a){return a.split(/\r?\n|\r/)}function b(a){this.pos=this.start=0,this.string=a,this.lineStart=0}b.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||null},next:function(){return this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.start-this.lineStart},indentation:function(){return 0},match:function(a,b,c){if("string"!=typeof a){var d=this.string.slice(this.pos).match(a);return d&&d.index>0?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);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}},CodeMirror.StringStream=b,CodeMirror.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};var c=CodeMirror.modes={},d=CodeMirror.mimeModes={};CodeMirror.defineMode=function(a,b){arguments.length>2&&(b.dependencies=Array.prototype.slice.call(arguments,2)),c[a]=b},CodeMirror.defineMIME=function(a,b){d[a]=b},CodeMirror.resolveMode=function(a){return"string"==typeof a&&d.hasOwnProperty(a)?a=d[a]:a&&"string"==typeof a.name&&d.hasOwnProperty(a.name)&&(a=d[a.name]),"string"==typeof a?{name:a}:a||{name:"null"}},CodeMirror.getMode=function(a,b){b=CodeMirror.resolveMode(b);var d=c[b.name];if(!d)throw new Error("Unknown mode: "+b);return d(a,b)},CodeMirror.registerHelper=CodeMirror.registerGlobalHelper=Math.min,CodeMirror.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),CodeMirror.defineMIME("text/plain","null"),CodeMirror.runMode=function(b,c,d,e){var f=CodeMirror.getMode({indentUnit:2},c);if(1==d.nodeType){var g=e&&e.tabSize||4,h=d,i=0;h.innerHTML="",d=function(a,b){if("\n"==a)return h.appendChild(document.createElement("br")),void(i=0);for(var c="",d=0;;){var e=a.indexOf(" ",d);if(-1==e){c+=a.slice(d),i+=a.length-d;break}i+=e-d,c+=a.slice(d,e);var f=g-i%g;i+=f;for(var j=0;f>j;++j)c+=" ";d=e+1}if(b){var k=h.appendChild(document.createElement("span"));k.className="cm-"+b.replace(/ +/g," cm-"),k.appendChild(document.createTextNode(c))}else h.appendChild(document.createTextNode(c))}}for(var j=a(b),k=e&&e.state||CodeMirror.startState(f),l=0,m=j.length;m>l;++l){l&&d("\n");var n=new CodeMirror.StringStream(j[l]);for(!n.string&&f.blankLine&&f.blankLine(k);!n.eol();){var o=f.token(n,k);d(n.current(),o,l,n.start,k),n.start=n.pos}}}}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/runmode/runmode.min.js b/media/editors/codemirror/addon/runmode/runmode.min.js -index 3cd0281..f6f7917 100644 ---- a/media/editors/codemirror/addon/runmode/runmode.min.js -+++ b/media/editors/codemirror/addon/runmode/runmode.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.runMode=function(t,n,r,o){var a=e.getMode(e.defaults,n),d=/MSIE \d/.test(navigator.userAgent),i=d&&(null==document.documentMode||document.documentMode<9);if(1==r.nodeType){var c=o&&o.tabSize||e.defaults.tabSize,l=r,u=0;l.innerHTML="",r=function(e,t){if("\n"==e)return l.appendChild(document.createTextNode(i?"\r":e)),void(u=0);for(var n="",r=0;;){var o=e.indexOf(" ",r);if(-1==o){n+=e.slice(r),u+=e.length-r;break}u+=o-r,n+=e.slice(r,o);var a=c-u%c;u+=a;for(var d=0;a>d;++d)n+=" ";r=o+1}if(t){var f=l.appendChild(document.createElement("span"));f.className="cm-"+t.replace(/ +/g," cm-"),f.appendChild(document.createTextNode(n))}else l.appendChild(document.createTextNode(n))}}for(var f=e.splitLines(t),s=o&&o.state||e.startState(a),m=0,p=f.length;p>m;++m){m&&r("\n");var v=new e.StringStream(f[m]);for(!v.string&&a.blankLine&&a.blankLine(s);!v.eol();){var b=a.token(v,s);r(v.current(),b,m,v.start,s),v.start=v.pos}}}}); -\ No newline at end of file -+function splitLines(a){return a.split(/\r?\n|\r/)}function StringStream(a){this.pos=this.start=0,this.string=a,this.lineStart=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";a.runMode=function(b,c,d,e){var f=a.getMode(a.defaults,c),g=/MSIE \d/.test(navigator.userAgent),h=g&&(null==document.documentMode||document.documentMode<9);if(1==d.nodeType){var i=e&&e.tabSize||a.defaults.tabSize,j=d,k=0;j.innerHTML="",d=function(a,b){if("\n"==a)return j.appendChild(document.createTextNode(h?"\r":a)),void(k=0);for(var c="",d=0;;){var e=a.indexOf(" ",d);if(-1==e){c+=a.slice(d),k+=a.length-d;break}k+=e-d,c+=a.slice(d,e);var f=i-k%i;k+=f;for(var g=0;f>g;++g)c+=" ";d=e+1}if(b){var l=j.appendChild(document.createElement("span"));l.className="cm-"+b.replace(/ +/g," cm-"),l.appendChild(document.createTextNode(c))}else j.appendChild(document.createTextNode(c))}}for(var l=a.splitLines(b),m=e&&e.state||a.startState(f),n=0,o=l.length;o>n;++n){n&&d("\n");var p=new a.StringStream(l[n]);for(!p.string&&f.blankLine&&f.blankLine(m);!p.eol();){var q=f.token(p,m);d(p.current(),q,n,p.start,m),p.start=p.pos}}}}),StringStream.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||null},next:function(){return this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.start-this.lineStart},indentation:function(){return 0},match:function(a,b,c){if("string"!=typeof a){var d=this.string.slice(this.pos).match(a);return d&&d.index>0?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);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}},exports.StringStream=StringStream,exports.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};var modes=exports.modes={},mimeModes=exports.mimeModes={};exports.defineMode=function(a,b){arguments.length>2&&(b.dependencies=Array.prototype.slice.call(arguments,2)),modes[a]=b},exports.defineMIME=function(a,b){mimeModes[a]=b},exports.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),exports.defineMIME("text/plain","null"),exports.resolveMode=function(a){return"string"==typeof a&&mimeModes.hasOwnProperty(a)?a=mimeModes[a]:a&&"string"==typeof a.name&&mimeModes.hasOwnProperty(a.name)&&(a=mimeModes[a.name]),"string"==typeof a?{name:a}:a||{name:"null"}},exports.getMode=function(a,b){b=exports.resolveMode(b);var c=modes[b.name];if(!c)throw new Error("Unknown mode: "+b);return c(a,b)},exports.registerHelper=exports.registerGlobalHelper=Math.min,exports.runMode=function(a,b,c,d){for(var e=exports.getMode({indentUnit:2},b),f=splitLines(a),g=d&&d.state||exports.startState(e),h=0,i=f.length;i>h;++h){h&&c("\n");var j=new exports.StringStream(f[h]);for(!j.string&&e.blankLine&&e.blankLine(g);!j.eol();){var k=e.token(j,g);c(j.current(),k,h,j.start,g),j.start=j.pos}}},require.cache[require.resolve("../../lib/codemirror")]=require.cache[require.resolve("./runmode.node")]; -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/runmode/runmode.node.min.js b/media/editors/codemirror/addon/runmode/runmode.node.min.js -deleted file mode 100644 -index 35e4eb9..0000000 ---- a/media/editors/codemirror/addon/runmode/runmode.node.min.js -+++ /dev/null -@@ -1 +0,0 @@ --function splitLines(t){return t.split(/\r?\n|\r/)}function StringStream(t){this.pos=this.start=0,this.string=t,this.lineStart=0}StringStream.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||null},next:function(){return this.pose},eatSpace:function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(t){var e=this.string.indexOf(t,this.pos);return e>-1?(this.pos=e,!0):void 0},backUp:function(t){this.pos-=t},column:function(){return this.start-this.lineStart},indentation:function(){return 0},match:function(t,e,r){if("string"!=typeof t){var n=this.string.slice(this.pos).match(t);return n&&n.index>0?null:(n&&e!==!1&&(this.pos+=n[0].length),n)}var s=function(t){return r?t.toLowerCase():t},i=this.string.substr(this.pos,t.length);return s(i)==s(t)?(e!==!1&&(this.pos+=t.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}}},exports.StringStream=StringStream,exports.startState=function(t,e,r){return t.startState?t.startState(e,r):!0};var modes=exports.modes={},mimeModes=exports.mimeModes={};exports.defineMode=function(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),modes[t]=e},exports.defineMIME=function(t,e){mimeModes[t]=e},exports.defineMode("null",function(){return{token:function(t){t.skipToEnd()}}}),exports.defineMIME("text/plain","null"),exports.resolveMode=function(t){return"string"==typeof t&&mimeModes.hasOwnProperty(t)?t=mimeModes[t]:t&&"string"==typeof t.name&&mimeModes.hasOwnProperty(t.name)&&(t=mimeModes[t.name]),"string"==typeof t?{name:t}:t||{name:"null"}},exports.getMode=function(t,e){e=exports.resolveMode(e);var r=modes[e.name];if(!r)throw new Error("Unknown mode: "+e);return r(t,e)},exports.registerHelper=exports.registerGlobalHelper=Math.min,exports.runMode=function(t,e,r,n){for(var s=exports.getMode({indentUnit:2},e),i=splitLines(t),o=n&&n.state||exports.startState(s),a=0,h=i.length;h>a;++a){a&&r("\n");var p=new exports.StringStream(i[a]);for(!p.string&&s.blankLine&&s.blankLine(o);!p.eol();){var u=s.token(p,o);r(p.current(),u,a,p.start,o),p.start=p.pos}}},require.cache[require.resolve("../../lib/codemirror")]=require.cache[require.resolve("./runmode.node")]; -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/scroll/annotatescrollbar.js b/media/editors/codemirror/addon/scroll/annotatescrollbar.js -index 54aeacf..e62a45a 100644 ---- a/media/editors/codemirror/addon/scroll/annotatescrollbar.js -+++ b/media/editors/codemirror/addon/scroll/annotatescrollbar.js -@@ -68,15 +68,30 @@ - var cm = this.cm, hScale = this.hScale; - - var frag = document.createDocumentFragment(), anns = this.annotations; -+ -+ var wrapping = cm.getOption("lineWrapping"); -+ var singleLineH = wrapping && cm.defaultTextHeight() * 1.5; -+ var curLine = null, curLineObj = null; -+ function getY(pos, top) { -+ if (curLine != pos.line) { -+ curLine = pos.line; -+ curLineObj = cm.getLineHandle(curLine); -+ } -+ if (wrapping && curLineObj.height > singleLineH) -+ return cm.charCoords(pos, "local")[top ? "top" : "bottom"]; -+ var topY = cm.heightAtLine(curLineObj, "local"); -+ return topY + (top ? 0 : curLineObj.height); -+ } -+ - if (cm.display.barWidth) for (var i = 0, nextTop; i < anns.length; i++) { - var ann = anns[i]; -- var top = nextTop || cm.charCoords(ann.from, "local").top * hScale; -- var bottom = cm.charCoords(ann.to, "local").bottom * hScale; -+ var top = nextTop || getY(ann.from, true) * hScale; -+ var bottom = getY(ann.to, false) * hScale; - while (i < anns.length - 1) { -- nextTop = cm.charCoords(anns[i + 1].from, "local").top * hScale; -+ nextTop = getY(anns[i + 1].from, true) * hScale; - if (nextTop > bottom + .9) break; - ann = anns[++i]; -- bottom = cm.charCoords(ann.to, "local").bottom * hScale; -+ bottom = getY(ann.to, false) * hScale; - } - if (bottom == top) continue; - var height = Math.max(bottom - top, 3); -diff --git a/media/editors/codemirror/addon/scroll/annotatescrollbar.min.js b/media/editors/codemirror/addon/scroll/annotatescrollbar.min.js -index a4e9618..b19c0ff 100644 ---- a/media/editors/codemirror/addon/scroll/annotatescrollbar.min.js -+++ b/media/editors/codemirror/addon/scroll/annotatescrollbar.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){function i(t){clearTimeout(o.doRedraw),o.doRedraw=setTimeout(function(){o.redraw()},t)}this.cm=t,this.options=e,this.buttonHeight=e.scrollButtonHeight||t.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=t.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var o=this;t.on("refresh",this.resizeHandler=function(){clearTimeout(o.doUpdate),o.doUpdate=setTimeout(function(){o.computeScale()&&i(20)},100)}),t.on("markerAdded",this.resizeHandler),t.on("markerCleared",this.resizeHandler),e.listenForChanges!==!1&&t.on("change",this.changeHandler=function(){i(250)})}t.defineExtension("annotateScrollbar",function(t){return"string"==typeof t&&(t={className:t}),new e(this,t)}),t.defineOption("scrollButtonHeight",0),e.prototype.computeScale=function(){var t=this.cm,e=(t.getWrapperElement().clientHeight-t.display.barHeight-2*this.buttonHeight)/t.heightAtLine(t.lastLine()+1,"local");return e!=this.hScale?(this.hScale=e,!0):void 0},e.prototype.update=function(t){this.annotations=t,this.redraw()},e.prototype.redraw=function(t){t!==!1&&this.computeScale();var e=this.cm,i=this.hScale,o=document.createDocumentFragment(),n=this.annotations;if(e.display.barWidth)for(var r,a=0;ad+.9));)s=n[++a],d=e.charCoords(s.to,"local").bottom*i;if(d!=h){var c=Math.max(d-h,3),l=o.appendChild(document.createElement("div"));l.style.cssText="position: absolute; right: 0px; width: "+Math.max(e.display.barWidth-1,2)+"px; top: "+(h+this.buttonHeight)+"px; height: "+c+"px",l.className=this.options.className}}this.div.textContent="",this.div.appendChild(o)},e.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)}}); -\ 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){function c(a){clearTimeout(d.doRedraw),d.doRedraw=setTimeout(function(){d.redraw()},a)}this.cm=a,this.options=b,this.buttonHeight=b.scrollButtonHeight||a.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=a.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var d=this;a.on("refresh",this.resizeHandler=function(){clearTimeout(d.doUpdate),d.doUpdate=setTimeout(function(){d.computeScale()&&c(20)},100)}),a.on("markerAdded",this.resizeHandler),a.on("markerCleared",this.resizeHandler),b.listenForChanges!==!1&&a.on("change",this.changeHandler=function(){c(250)})}a.defineExtension("annotateScrollbar",function(a){return"string"==typeof a&&(a={className:a}),new b(this,a)}),a.defineOption("scrollButtonHeight",0),b.prototype.computeScale=function(){var a=this.cm,b=(a.getWrapperElement().clientHeight-a.display.barHeight-2*this.buttonHeight)/a.heightAtLine(a.lastLine()+1,"local");return b!=this.hScale?(this.hScale=b,!0):void 0},b.prototype.update=function(a){this.annotations=a,this.redraw()},b.prototype.redraw=function(a){function b(a,b){if(i!=a.line&&(i=a.line,j=c.getLineHandle(i)),g&&j.height>h)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;if(c.display.barWidth)for(var k,l=0;lo+.9));)m=f[++l],o=b(m.to,!1)*d;if(o!=n){var p=Math.max(o-n,3),q=e.appendChild(document.createElement("div"));q.style.cssText="position: absolute; right: 0px; width: "+Math.max(c.display.barWidth-1,2)+"px; top: "+(n+this.buttonHeight)+"px; height: "+p+"px",q.className=this.options.className}}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)}}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/scroll/scrollpastend.min.js b/media/editors/codemirror/addon/scroll/scrollpastend.min.js -index 3b1a976..699865a 100644 ---- a/media/editors/codemirror/addon/scroll/scrollpastend.min.js -+++ b/media/editors/codemirror/addon/scroll/scrollpastend.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(n,i){e.changeEnd(i).line==n.lastLine()&&t(n)}function t(e){var n="";if(e.lineCount()>1){var t=e.display.scroller.clientHeight-30,i=e.getLineHandle(e.lastLine()).height;n=t-i+"px"}e.state.scrollPastEndPadding!=n&&(e.state.scrollPastEndPadding=n,e.display.lineSpace.parentNode.style.paddingBottom=n,e.setSize())}e.defineOption("scrollPastEnd",!1,function(i,o,d){d&&d!=e.Init&&(i.off("change",n),i.off("refresh",t),i.display.lineSpace.parentNode.style.paddingBottom="",i.state.scrollPastEndPadding=null),o&&(i.on("change",n),i.on("refresh",t),t(i))})}); -\ 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(b,d){a.changeEnd(d).line==b.lastLine()&&c(b)}function c(a){var b="";if(a.lineCount()>1){var c=a.display.scroller.clientHeight-30,d=a.getLineHandle(a.lastLine()).height;b=c-d+"px"}a.state.scrollPastEndPadding!=b&&(a.state.scrollPastEndPadding=b,a.display.lineSpace.parentNode.style.paddingBottom=b,a.setSize())}a.defineOption("scrollPastEnd",!1,function(d,e,f){f&&f!=a.Init&&(d.off("change",b),d.off("refresh",c),d.display.lineSpace.parentNode.style.paddingBottom="",d.state.scrollPastEndPadding=null),e&&(d.on("change",b),d.on("refresh",c),c(d))})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/scroll/simplescrollbars.js b/media/editors/codemirror/addon/scroll/simplescrollbars.js -index bb06adb..f78353a 100644 ---- a/media/editors/codemirror/addon/scroll/simplescrollbars.js -+++ b/media/editors/codemirror/addon/scroll/simplescrollbars.js -@@ -69,14 +69,20 @@ - if (update !== false) this.scroll(pos, this.orientation); - }; - -+ var minButtonSize = 10; -+ - Bar.prototype.update = function(scrollSize, clientSize, barSize) { - this.screen = clientSize; - this.total = scrollSize; - this.size = barSize; - -- // FIXME clip to min size? -+ var buttonSize = this.screen * (this.size / this.total); -+ if (buttonSize < minButtonSize) { -+ this.size -= minButtonSize - buttonSize; -+ buttonSize = minButtonSize; -+ } - this.inner.style[this.orientation == "horizontal" ? "width" : "height"] = -- this.screen * (this.size / this.total) + "px"; -+ buttonSize + "px"; - this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = - this.pos * (this.size / this.total) + "px"; - }; -diff --git a/media/editors/codemirror/addon/scroll/simplescrollbars.min.css b/media/editors/codemirror/addon/scroll/simplescrollbars.min.css -index b4b5245..618a2f7 100644 ---- a/media/editors/codemirror/addon/scroll/simplescrollbars.min.css -+++ b/media/editors/codemirror/addon/scroll/simplescrollbars.min.css -@@ -1 +1 @@ --.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler,.CodeMirror-overlayscroll .CodeMirror-gutter-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%} -\ No newline at end of file -+.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-gutter-filler,.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%} -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/scroll/simplescrollbars.min.js b/media/editors/codemirror/addon/scroll/simplescrollbars.min.js -index 06887f0..16af8d3 100644 ---- a/media/editors/codemirror/addon/scroll/simplescrollbars.min.js -+++ b/media/editors/codemirror/addon/scroll/simplescrollbars.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(e,o,i){function n(e){var o=t.wheelEventPixels(e)["horizontal"==s.orientation?"x":"y"],i=s.pos;s.moveTo(s.pos+o),s.pos!=i&&t.e_preventDefault(e)}this.orientation=o,this.scroll=i,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=e+"-"+o,this.inner=this.node.appendChild(document.createElement("div"));var s=this;t.on(this.inner,"mousedown",function(e){function o(){t.off(document,"mousemove",i),t.off(document,"mouseup",o)}function i(t){return 1!=t.which?o():void s.moveTo(h+(t[n]-r)*(s.total/s.size))}if(1==e.which){t.e_preventDefault(e);var n="horizontal"==s.orientation?"pageX":"pageY",r=e[n],h=s.pos;t.on(document,"mousemove",i),t.on(document,"mouseup",o)}}),t.on(this.node,"click",function(e){t.e_preventDefault(e);var o,i=s.inner.getBoundingClientRect();o="horizontal"==s.orientation?e.clientXi.right?1:0:e.clientYi.bottom?1:0,s.moveTo(s.pos+o*s.screen)}),t.on(this.node,"mousewheel",n),t.on(this.node,"DOMMouseScroll",n)}function o(t,o,i){this.addClass=t,this.horiz=new e(t,"horizontal",i),o(this.horiz.node),this.vert=new e(t,"vertical",i),o(this.vert.node),this.width=null}e.prototype.moveTo=function(t,e){0>t&&(t=0),t>this.total-this.screen&&(t=this.total-this.screen),t!=this.pos&&(this.pos=t,this.inner.style["horizontal"==this.orientation?"left":"top"]=t*(this.size/this.total)+"px",e!==!1&&this.scroll(t,this.orientation))},e.prototype.update=function(t,e,o){this.screen=e,this.total=t,this.size=o,this.inner.style["horizontal"==this.orientation?"width":"height"]=this.screen*(this.size/this.total)+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},o.prototype.update=function(t){if(null==this.width){var e=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;e&&(this.width=parseInt(e.height))}var o=this.width||0,i=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1;return this.vert.node.style.display=n?"block":"none",this.horiz.node.style.display=i?"block":"none",n&&(this.vert.update(t.scrollHeight,t.clientHeight,t.viewHeight-(i?o:0)),this.vert.node.style.display="block",this.vert.node.style.bottom=i?o+"px":"0"),i&&(this.horiz.update(t.scrollWidth,t.clientWidth,t.viewWidth-(n?o:0)-t.barLeft),this.horiz.node.style.right=n?o+"px":"0",this.horiz.node.style.left=t.barLeft+"px"),{right:n?o:0,bottom:i?o:0}},o.prototype.setScrollTop=function(t){this.vert.moveTo(t,!1)},o.prototype.setScrollLeft=function(t){this.horiz.moveTo(t,!1)},o.prototype.clear=function(){var t=this.horiz.node.parentNode;t.removeChild(this.horiz.node),t.removeChild(this.vert.node)},t.scrollbarModel.simple=function(t,e){return new o("CodeMirror-simplescroll",t,e)},t.scrollbarModel.overlay=function(t,e){return new o("CodeMirror-overlayscroll",t,e)}}); -\ 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(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.moveTo=function(a,b){0>a&&(a=0),a>this.total-this.screen&&(a=this.total-this.screen),a!=this.pos&&(this.pos=a,this.inner.style["horizontal"==this.orientation?"left":"top"]=a*(this.size/this.total)+"px",b!==!1&&this.scroll(a,this.orientation))};var d=10;b.prototype.update=function(a,b,c){this.screen=b,this.total=a,this.size=c;var e=this.screen*(this.size/this.total);d>e&&(this.size-=d-e,e=d),this.inner.style["horizontal"==this.orientation?"width":"height"]=e+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},c.prototype.update=function(a){if(null==this.width){var b=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;b&&(this.width=parseInt(b.height))}var c=this.width||0,d=a.scrollWidth>a.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.display="block",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.moveTo(a,!1)},c.prototype.setScrollLeft=function(a){this.horiz.moveTo(a,!1)},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)}}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/search/match-highlighter.min.js b/media/editors/codemirror/addon/search/match-highlighter.min.js -index d7cab78..546dda0 100644 ---- a/media/editors/codemirror/addon/search/match-highlighter.min.js -+++ b/media/editors/codemirror/addon/search/match-highlighter.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t){"object"==typeof t&&(this.minChars=t.minChars,this.style=t.style,this.showToken=t.showToken,this.delay=t.delay,this.wordsOnly=t.wordsOnly),null==this.style&&(this.style=s),null==this.minChars&&(this.minChars=h),null==this.delay&&(this.delay=a),null==this.wordsOnly&&(this.wordsOnly=c),this.overlay=this.timeout=null}function i(t){var e=t.state.matchHighlighter;clearTimeout(e.timeout),e.timeout=setTimeout(function(){r(t)},e.delay)}function r(t){t.operation(function(){var e=t.state.matchHighlighter;if(e.overlay&&(t.removeOverlay(e.overlay),e.overlay=null),!t.somethingSelected()&&e.showToken){for(var i=e.showToken===!0?/[\w$]/:e.showToken,r=t.getCursor(),o=t.getLine(r.line),h=r.ch,s=h;h&&i.test(o.charAt(h-1));)--h;for(;sh&&t.addOverlay(e.overlay=l(o.slice(h,s),i,e.style)))}var a=t.getCursor("from"),c=t.getCursor("to");if(a.line==c.line&&(!e.wordsOnly||n(t,a,c))){var u=t.getRange(a,c).replace(/^\s+|\s+$/g,"");u.length>=e.minChars&&t.addOverlay(e.overlay=l(u,!1,e.style))}})}function n(t,e,i){var r=t.getRange(e,i);if(null!==r.match(/^\w+$/)){if(e.ch>0){var n={line:e.line,ch:e.ch-1},o=t.getRange(n,e);if(null===o.match(/\W/))return!1}if(i.chh&&a.addOverlay(b.overlay=g(f.slice(h,i),c,b.style)))}var j=a.getCursor("from"),k=a.getCursor("to");if(j.line==k.line&&(!b.wordsOnly||e(a,j,k))){var l=a.getRange(j,k).replace(/^\s+|\s+$/g,"");l.length>=b.minChars&&a.addOverlay(b.overlay=g(l,!1,b.style))}})}function e(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= this.gap.from) this.matches.splice(i--, 1); - } - var cursor = this.cm.getSearchCursor(this.query, CodeMirror.Pos(this.gap.from, 0), this.caseFold); -+ var maxMatches = this.options && this.options.maxMatches || MAX_MATCHES; - while (cursor.findNext()) { - var match = {from: cursor.from(), to: cursor.to()}; - if (match.from.line >= this.gap.to) break; - this.matches.splice(i++, 0, match); -- if (this.matches.length > MAX_MATCHES) break; -+ if (this.matches.length > maxMatches) break; - } - this.gap = null; - }; -diff --git a/media/editors/codemirror/addon/search/matchesonscrollbar.min.js b/media/editors/codemirror/addon/search/matchesonscrollbar.min.js -index ae9842c..d63561c 100644 ---- a/media/editors/codemirror/addon/search/matchesonscrollbar.min.js -+++ b/media/editors/codemirror/addon/search/matchesonscrollbar.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e,i,o){this.cm=t;var a={listenForChanges:!1};for(var r in o)a[r]=o[r];a.className||(a.className="CodeMirror-search-match"),this.annotation=t.annotateScrollbar(a),this.query=e,this.caseFold=i,this.gap={from:t.firstLine(),to:t.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var n=this;t.on("change",this.changeHandler=function(t,e){n.onChange(e)})}function i(t,e,i){return e>=t?t:Math.max(e,t+i)}t.defineExtension("showMatchesOnScrollbar",function(t,i,o){return"string"==typeof o&&(o={className:o}),o||(o={}),new e(this,t,i,o)});var o=1e3;e.prototype.findMatches=function(){if(this.gap){for(var e=0;e=this.gap.to)break;i.to.line>=this.gap.from&&this.matches.splice(e--,1)}for(var a=this.cm.getSearchCursor(this.query,t.Pos(this.gap.from,0),this.caseFold);a.findNext();){var i={from:a.from(),to:a.to()};if(i.from.line>=this.gap.to)break;if(this.matches.splice(e++,0,i),this.matches.length>o)break}this.gap=null}},e.prototype.onChange=function(e){var o=e.from.line,a=t.changeEnd(e).line,r=a-e.to.line;if(this.gap?(this.gap.from=Math.min(i(this.gap.from,o,r),e.from.line),this.gap.to=Math.max(i(this.gap.to,o,r),e.from.line)):this.gap={from:e.from.line,to:a+1},r)for(var n=0;n=a?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 0) break; - ranges.push({anchor: cur.from(), head: cur.to()}); - } -diff --git a/media/editors/codemirror/addon/search/searchcursor.min.js b/media/editors/codemirror/addon/search/searchcursor.min.js -index 395ca0b..ce7c259 100644 ---- a/media/editors/codemirror/addon/search/searchcursor.min.js -+++ b/media/editors/codemirror/addon/search/searchcursor.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof t&&(o=!1),r=r?e.clipPos(r):i(0,0),this.pos={from:r,to:r},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(n,r){if(n){t.lastIndex=0;for(var o,s,l=e.getLine(r.line).slice(0,r.ch),h=0;;){t.lastIndex=h;var f=t.exec(l);if(!f)break;if(o=f,s=o.index,h=o.index+(o[0].length||1),h==l.length)break}var c=o&&o[0].length||0;c||(0==s&&0==l.length?o=void 0:s!=e.getLine(r.line).length&&c++)}else{t.lastIndex=r.ch;var l=e.getLine(r.line),o=t.exec(l),c=o&&o[0].length||0,s=o&&o.index;s+c==l.length||c||(c=1)}return o&&c?{from:i(r.line,s),to:i(r.line,s+c),match:o}:void 0};else{var s=t;o&&(t=t.toLowerCase());var l=o?function(e){return e.toLowerCase()}:function(e){return e},h=t.split("\n");if(1==h.length)this.matches=t.length?function(r,o){if(r){var h=e.getLine(o.line).slice(0,o.ch),f=l(h),c=f.lastIndexOf(t);if(c>-1)return c=n(h,f,c),{from:i(o.line,c),to:i(o.line,c+s.length)}}else{var h=e.getLine(o.line).slice(o.ch),f=l(h),c=f.indexOf(t);if(c>-1)return c=n(h,f,c)+o.ch,{from:i(o.line,c),to:i(o.line,c+s.length)}}}:function(){};else{var f=s.split("\n");this.matches=function(t,n){var r=h.length-1;if(t){if(n.line-(h.length-1)=1;--c,--s)if(h[c]!=l(e.getLine(s)))return;var u=e.getLine(s),g=u.length-f[0].length;if(l(u.slice(g))!=h[0])return;return{from:i(s,g),to:o}}if(!(n.line+(h.length-1)>e.lastLine())){var u=e.getLine(n.line),g=u.length-f[0].length;if(l(u.slice(g))==h[0]){for(var a=i(n.line,g),s=n.line+1,c=1;r>c;++c,++s)if(h[c]!=l(e.getLine(s)))return;if(l(e.getLine(s).slice(0,f[r].length))==h[r])return{from:a,to:i(s,f[r].length)}}}}}}}function n(e,t,n){if(e.length==t.length)return n;for(var i=Math.min(n,e.length);;){var r=e.slice(0,i).toLowerCase().length;if(n>r)++i;else{if(!(r>n))return i;--i}}}var i=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=i(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=i(r.line-1,this.doc.getLine(r.line-1).length)}else{var o=this.doc.lineCount();if(r.line==o-1)return t(o);r=i(r.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(t){if(this.atOccurrence){var n=e.splitLines(t);this.doc.replaceRange(n,this.pos.from,this.pos.to),this.pos.to=i(this.pos.from.line+n.length-1,n[n.length-1].length+(1==n.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,i){return new t(this.doc,e,n,i)}),e.defineDocExtension("getSearchCursor",function(e,n,i){return new t(this,e,n,i)}),e.defineExtension("selectMatches",function(t,n){for(var i,r=[],o=this.getSearchCursor(t,this.getCursor("from"),n);(i=o.findNext())&&!(e.cmpPos(o.to(),this.getCursor("to"))>0);)r.push({anchor:o.from(),head:o.to()});r.length&&this.setSelections(r,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";function b(a,b,e,f){if(this.atOccurrence=!1,this.doc=a,null==f&&"string"==typeof b&&(f=!1),e=e?a.clipPos(e):d(0,0),this.pos={from:e,to:e},"string"!=typeof b)b.global||(b=new RegExp(b.source,b.ignoreCase?"ig":"g")),this.matches=function(c,e){if(c){b.lastIndex=0;for(var f,g,h=a.getLine(e.line).slice(0,e.ch),i=0;;){b.lastIndex=i;var j=b.exec(h);if(!j)break;if(f=j,g=f.index,i=f.index+(f[0].length||1),i==h.length)break}var k=f&&f[0].length||0;k||(0==g&&0==h.length?f=void 0:g!=a.getLine(e.line).length&&k++)}else{b.lastIndex=e.ch;var h=a.getLine(e.line),f=b.exec(h),k=f&&f[0].length||0,g=f&&f.index;g+k==h.length||k||(k=1)}return f&&k?{from:d(e.line,g),to:d(e.line,g+k),match:f}:void 0};else{var g=b;f&&(b=b.toLowerCase());var h=f?function(a){return a.toLowerCase()}:function(a){return a},i=b.split("\n");if(1==i.length)b.length?this.matches=function(e,f){if(e){var i=a.getLine(f.line).slice(0,f.ch),j=h(i),k=j.lastIndexOf(b);if(k>-1)return k=c(i,j,k),{from:d(f.line,k),to:d(f.line,k+g.length)}}else{var i=a.getLine(f.line).slice(f.ch),j=h(i),k=j.indexOf(b);if(k>-1)return k=c(i,j,k)+f.ch,{from:d(f.line,k),to:d(f.line,k+g.length)}}}:this.matches=function(){};else{var j=g.split("\n");this.matches=function(b,c){var e=i.length-1;if(b){if(c.line-(i.length-1)=1;--k,--g)if(i[k]!=h(a.getLine(g)))return;var l=a.getLine(g),m=l.length-j[0].length;if(h(l.slice(m))!=i[0])return;return{from:d(g,m),to:f}}if(!(c.line+(i.length-1)>a.lastLine())){var l=a.getLine(c.line),m=l.length-j[0].length;if(h(l.slice(m))==i[0]){for(var n=d(c.line,m),g=c.line+1,k=1;e>k;++k,++g)if(i[k]!=h(a.getLine(g)))return;if(h(a.getLine(g).slice(0,j[e].length))==i[e])return{from:n,to:d(g,j[e].length)}}}}}}}function c(a,b,c){if(a.length==b.length)return c;for(var d=Math.min(c,a.length);;){var e=a.slice(0,d).toLowerCase().length;if(c>e)++d;else{if(!(e>c))return d;--d}}}var d=a.Pos;b.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function b(a){var b=d(a,0);return c.pos={from:b,to:b},c.atOccurrence=!1,!1}for(var c=this,e=this.doc.clipPos(a?this.pos.from:this.pos.to);;){if(this.pos=this.matches(a,e))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!e.line)return b(0);e=d(e.line-1,this.doc.getLine(e.line-1).length)}else{var f=this.doc.lineCount();if(e.line==f-1)return b(f);e=d(e.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(b,c){if(this.atOccurrence){var e=a.splitLines(b);this.doc.replaceRange(e,this.pos.from,this.pos.to,c),this.pos.to=d(this.pos.from.line+e.length-1,e[e.length-1].length+(1==e.length?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(a,c,d){return new b(this.doc,a,c,d)}),a.defineDocExtension("getSearchCursor",function(a,c,d){return new b(this,a,c,d)}),a.defineExtension("selectMatches",function(b,c){for(var d=[],e=this.getSearchCursor(b,this.getCursor("from"),c);e.findNext()&&!(a.cmpPos(e.to(),this.getCursor("to"))>0);)d.push({anchor:e.from(),head:e.to()});d.length&&this.setSelections(d,0)})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/selection/active-line.min.js b/media/editors/codemirror/addon/selection/active-line.min.js -index ed40234..466aad0 100644 ---- a/media/editors/codemirror/addon/selection/active-line.min.js -+++ b/media/editors/codemirror/addon/selection/active-line.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t=n.line,m=u?n:c(d,0),S=e.markText(s,m,{className:i});if(null==o?r.push(S):r.splice(o++,0,S),u)break;l=d}}function r(e){for(var t=e.state.markedSelection,n=0;n1)return i(e);var t=e.getCursor("start"),n=e.getCursor("end"),l=e.state.markedSelection;if(!l.length)return o(e,t,n);var c=l[0].find(),s=l[l.length-1].find();if(!c||!s||n.line-t.line=0||a(n,c.from)<=0)return i(e);for(;a(t,c.from)>0;)l.shift().clear(),c=l[0].find();for(a(t,c.from)<0&&(c.to.line-t.line0&&(n.line-s.from.line=c.line,n=m?c:i(l,0),o=a.markText(k,n,{className:f});if(null==d?e.push(o):e.splice(d++,0,o),m)break;g=l}}function e(a){for(var b=a.state.markedSelection,c=0;c1)return f(a);var b=a.getCursor("start"),c=a.getCursor("end"),g=a.state.markedSelection;if(!g.length)return d(a,b,c);var i=g[0].find(),k=g[g.length-1].find();if(!i||!k||c.line-b.line=0||j(c,i.from)<=0)return f(a);for(;j(b,i.from)>0;)g.shift().clear(),i=g[0].find();for(j(b,i.from)<0&&(i.to.line-b.line0&&(c.line-k.from.line=t.mouseX&&l.top<=t.mouseY&&l.bottom>=t.mouseY&&(n=!0)}var s=n?t.value:"";e.display.lineDiv.style.cursor!=s&&(e.display.lineDiv.style.cursor=s)}}e.defineOption("selectionPointer",!1,function(i,l){var s=i.state.selectionPointer;s&&(e.off(i.getWrapperElement(),"mousemove",s.mousemove),e.off(i.getWrapperElement(),"mouseout",s.mouseout),e.off(window,"scroll",s.windowScroll),i.off("cursorActivity",n),i.off("scroll",n),i.state.selectionPointer=null,i.display.lineDiv.style.cursor=""),l&&(s=i.state.selectionPointer={value:"string"==typeof l?l:"default",mousemove:function(e){t(i,e)},mouseout:function(e){o(i,e)},windowScroll:function(){n(i)},rects:null,mouseX:null,mouseY:null,willUpdate:!1},e.on(i.getWrapperElement(),"mousemove",s.mousemove),e.on(i.getWrapperElement(),"mouseout",s.mouseout),e.on(window,"scroll",s.windowScroll),i.on("cursorActivity",n),i.on("scroll",n))})}); -\ 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 c=a.state.selectionPointer;(null==b.buttons?b.which:b.buttons)?c.mouseX=c.mouseY=null:(c.mouseX=b.clientX,c.mouseY=b.clientY),e(a)}function c(a,b){if(!a.getWrapperElement().contains(b.relatedTarget)){var c=a.state.selectionPointer;c.mouseX=c.mouseY=null,e(a)}}function d(a){a.state.selectionPointer.rects=null,e(a)}function e(a){a.state.selectionPointer.willUpdate||(a.state.selectionPointer.willUpdate=!0,setTimeout(function(){f(a),a.state.selectionPointer.willUpdate=!1},50))}function f(a){var b=a.state.selectionPointer;if(b){if(null==b.rects&&null!=b.mouseX&&(b.rects=[],a.somethingSelected()))for(var c=a.display.selectionDiv.firstChild;c;c=c.nextSibling)b.rects.push(c.getBoundingClientRect());var d=!1;if(null!=b.mouseX)for(var e=0;e=b.mouseX&&f.top<=b.mouseY&&f.bottom>=b.mouseY&&(d=!0)}var g=d?b.value:"";a.display.lineDiv.style.cursor!=g&&(a.display.lineDiv.style.cursor=g)}}a.defineOption("selectionPointer",!1,function(e,f){var g=e.state.selectionPointer;g&&(a.off(e.getWrapperElement(),"mousemove",g.mousemove),a.off(e.getWrapperElement(),"mouseout",g.mouseout),a.off(window,"scroll",g.windowScroll),e.off("cursorActivity",d),e.off("scroll",d),e.state.selectionPointer=null,e.display.lineDiv.style.cursor=""),f&&(g=e.state.selectionPointer={value:"string"==typeof f?f:"default",mousemove:function(a){b(e,a)},mouseout:function(a){c(e,a)},windowScroll:function(){d(e)},rects:null,mouseX:null,mouseY:null,willUpdate:!1},a.on(e.getWrapperElement(),"mousemove",g.mousemove),a.on(e.getWrapperElement(),"mouseout",g.mouseout),a.on(window,"scroll",g.windowScroll),e.on("cursorActivity",d),e.on("scroll",d))})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/tern/tern.js b/media/editors/codemirror/addon/tern/tern.js -index b049549..99b8a64 100644 ---- a/media/editors/codemirror/addon/tern/tern.js -+++ b/media/editors/codemirror/addon/tern/tern.js -@@ -443,7 +443,7 @@ - function atInterestingExpression(cm) { - var pos = cm.getCursor("end"), tok = cm.getTokenAt(pos); - if (tok.start < pos.ch && (tok.type == "comment" || tok.type == "string")) return false; -- return /\w/.test(cm.getLine(pos.line).slice(Math.max(pos.ch - 1, 0), pos.ch + 1)); -+ return /[\w)\]]/.test(cm.getLine(pos.line).slice(Math.max(pos.ch - 1, 0), pos.ch + 1)); - } - - // Variable renaming -diff --git a/media/editors/codemirror/addon/tern/tern.min.css b/media/editors/codemirror/addon/tern/tern.min.css -index 68de4f5..f4ae8b4 100644 ---- a/media/editors/codemirror/addon/tern/tern.min.css -+++ b/media/editors/codemirror/addon/tern/tern.min.css -@@ -1 +1 @@ --.CodeMirror-Tern-completion{padding-left:22px;position:relative}.CodeMirror-Tern-completion:before{position:absolute;left:2px;bottom:2px;border-radius:50%;font-size:12px;font-weight:bold;height:15px;width:15px;line-height:16px;text-align:center;color:white;-moz-box-sizing:border-box;box-sizing:border-box}.CodeMirror-Tern-completion-unknown:before{content:"?";background:#4bb}.CodeMirror-Tern-completion-object:before{content:"O";background:#77c}.CodeMirror-Tern-completion-fn:before{content:"F";background:#7c7}.CodeMirror-Tern-completion-array:before{content:"A";background:#c66}.CodeMirror-Tern-completion-number:before{content:"1";background:#999}.CodeMirror-Tern-completion-string:before{content:"S";background:#999}.CodeMirror-Tern-completion-bool:before{content:"B";background:#999}.CodeMirror-Tern-completion-guess{color:#999}.CodeMirror-Tern-tooltip{border:1px solid silver;border-radius:3px;color:#444;padding:2px 5px;font-size:90%;font-family:monospace;background-color:white;white-space:pre-wrap;max-width:40em;position:absolute;z-index:10;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);transition:opacity 1s;-moz-transition:opacity 1s;-webkit-transition:opacity 1s;-o-transition:opacity 1s;-ms-transition:opacity 1s}.CodeMirror-Tern-hint-doc{max-width:25em;margin-top:-3px}.CodeMirror-Tern-fname{color:black}.CodeMirror-Tern-farg{color:#70a}.CodeMirror-Tern-farg-current{text-decoration:underline}.CodeMirror-Tern-type{color:#07c}.CodeMirror-Tern-fhint-guess{opacity:.7} -\ No newline at end of file -+.CodeMirror-Tern-completion{padding-left:22px;position:relative}.CodeMirror-Tern-completion:before{position:absolute;left:2px;bottom:2px;border-radius:50%;font-size:12px;font-weight:700;height:15px;width:15px;line-height:16px;text-align:center;color:#fff;-moz-box-sizing:border-box;box-sizing:border-box}.CodeMirror-Tern-completion-unknown:before{content:"?";background:#4bb}.CodeMirror-Tern-completion-object:before{content:"O";background:#77c}.CodeMirror-Tern-completion-fn:before{content:"F";background:#7c7}.CodeMirror-Tern-completion-array:before{content:"A";background:#c66}.CodeMirror-Tern-completion-number:before{content:"1";background:#999}.CodeMirror-Tern-completion-string:before{content:"S";background:#999}.CodeMirror-Tern-completion-bool:before{content:"B";background:#999}.CodeMirror-Tern-completion-guess{color:#999}.CodeMirror-Tern-tooltip{border:1px solid silver;border-radius:3px;color:#444;padding:2px 5px;font-size:90%;font-family:monospace;background-color:#fff;white-space:pre-wrap;max-width:40em;position:absolute;z-index:10;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);transition:opacity 1s;-moz-transition:opacity 1s;-webkit-transition:opacity 1s;-o-transition:opacity 1s;-ms-transition:opacity 1s}.CodeMirror-Tern-hint-doc{max-width:25em;margin-top:-3px}.CodeMirror-Tern-fname{color:#000}.CodeMirror-Tern-farg{color:#70a}.CodeMirror-Tern-farg-current{text-decoration:underline}.CodeMirror-Tern-type{color:#07c}.CodeMirror-Tern-fhint-guess{opacity:.7} -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/tern/tern.min.js b/media/editors/codemirror/addon/tern/tern.min.js -index 335c406..154b873 100644 ---- a/media/editors/codemirror/addon/tern/tern.min.js -+++ b/media/editors/codemirror/addon/tern/tern.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){var o=e.docs[t];o?n(F(e,o)):e.options.getFile?e.options.getFile(t,n):n(null)}function n(e,t,n){for(var o in e.docs){var r=e.docs[o];if(r.doc==t)return r}if(!n)for(var i=0;;++i)if(o="[doc"+(i||"")+"]",!e.docs[o]){n=o;break}return e.addDoc(n,t)}function o(t,o){return"string"==typeof o?t.docs[o]:(o instanceof e&&(o=o.getDoc()),o instanceof e.Doc?n(t,o):void 0)}function r(e,t,o){var r=n(e,t),s=e.cachedArgHints;s&&s.doc==t&&R(s.start,o.to)<=0&&(e.cachedArgHints=null);var a=r.changed;null==a&&(r.changed=a={from:o.from.line,to:o.from.line});var c=o.from.line+(o.text.length-1);o.from.line=a.to&&(a.to=c+1),a.from>o.from.line&&(a.from=o.from.line),t.lineCount()>L&&o.to-a.from>100&&setTimeout(function(){r.changed&&r.changed.to-r.changed.from>100&&i(e,r)},200)}function i(e,t){e.server.request({files:[{type:"full",name:t.name,text:F(e,t)}]},function(e){e?window.console.error(e):t.changed=null})}function s(t,n,o){t.request(n,{type:"completions",types:!0,docs:!0,urls:!0},function(r,i){if(r)return H(t,n,r);var s=[],c="",l=i.start,u=i.end;'["'==n.getRange(M(l.line,l.ch-2),l)&&'"]'!=n.getRange(u,M(u.line,u.ch+2))&&(c='"]');for(var f=0;f=d;--l){for(var h=n.getLine(l),g=0,m=0;;){var v=h.indexOf(" ",m);if(-1==v)break;g+=c-(v+g)%c-1,m=v+1}if(s=i.column-g,"("==h.charAt(s)){p=!0;break}}if(p){var y=M(l,s),C=t.cachedArgHints;return C&&C.doc==n.getDoc()&&0==R(y,C.start)?u(t,n,a):void t.request(n,{type:"type",preferFunction:!0,end:y},function(e,o){!e&&o.type&&/^fn\(/.test(o.type)&&(t.cachedArgHints={start:m,type:f(o.type),name:o.exprName||o.name||"fn",guess:o.guess,doc:n.getDoc()},u(t,n,a))})}}}}}function u(e,t,n){S(e);for(var o=e.cachedArgHints,r=o.type,i=w("span",o.guess?j+"fhint-guess":null,w("span",j+"fname",o.name),"("),s=0;s ":")")),r.rettype&&i.appendChild(w("span",j+"type",r.rettype));var c=t.cursorCoords(null,"page");e.activeArgHints=A(c.right+1,c.bottom,i)}function f(e){function t(t){for(var n=0,r=o;;){var i=e.charAt(o);if(t.test(i)&&!n)return e.slice(r,o);/[{\[\(]/.test(i)?++n:/[}\]\)]/.test(i)&&--n,++o}}var n=[],o=3;if(")"!=e.charAt(o))for(;;){var r=e.slice(o).match(/^([^, \(\[\{]+): /);if(r&&(o+=r[0].length,r=r[1]),n.push({name:r,type:t(/[\),]/)}),")"==e.charAt(o))break;o+=2}var i=e.slice(o).match(/^\) -> (.*)$/);return{args:n,rettype:i&&i[1]}}function d(e,t){function o(o){var r={type:"definition",variable:o||null},i=n(e,t.getDoc());e.server.request(x(e,i,r),function(n,o){if(n)return H(e,t,n);if(!o.file&&o.url)return void window.open(o.url);if(o.file){var r,s=e.docs[o.file];if(s&&(r=g(s.doc,o)))return e.jumpStack.push({file:i.name,start:t.getCursor("from"),end:t.getCursor("to")}),void h(e,i,s,r.start,r.end)}H(e,t,"Could not find a definition.")})}m(t)?o():T(t,"Jump to variable",function(e){e&&o(e)})}function p(e,t){var o=e.jumpStack.pop(),r=o&&e.docs[o.file];r&&h(e,n(e,t.getDoc()),r,o.start,o.end)}function h(e,t,n,o,r){n.doc.setSelection(o,r),t!=n&&e.options.switchToDoc&&(S(e),e.options.switchToDoc(n.name,n.doc))}function g(e,t){for(var n=t.context.slice(0,t.contextOffset).split("\n"),o=t.start.line-(n.length-1),r=M(o,(1==n.length?t.start.ch:e.getLine(o).length)-n[0].length),i=e.getLine(o).slice(r.ch),s=o+1;sf&&(a=u,l=f)}if(!a)return null;if(1==n.length?a.ch+=n[0].length:a=M(a.line+(n.length-1),n[n.length-1].length),t.start.line==t.end.line)var d=M(a.line,a.ch+(t.end.ch-t.start.ch));else var d=M(a.line+(t.end.line-t.start.line),t.end.ch);return{start:a,end:d}}function m(e){var t=e.getCursor("end"),n=e.getTokenAt(t);return n.start=0&&R(s,c.end)<=0&&(s=i.length-1))}t.setSelections(i,s)})}function C(e,t){for(var n=Object.create(null),o=0;oL&&s!==!1&&t.changed.to-t.changed.from<100&&t.changed.from<=a.line&&t.changed.to>n.end.line){r.push(b(t,a,n.end)),n.file="#0";var i=r[0].offsetLines;null!=n.start&&(n.start=M(n.start.line- -i,n.start.ch)),n.end=M(n.end.line-i,n.end.ch)}else r.push({type:"full",name:t.name,text:F(e,t)}),n.file=t.name,t.changed=null;else n.file=t.name;for(var c in e.docs){var l=e.docs[c];l.changed&&l!=t&&(r.push({type:"full",name:l.name,text:F(e,l)}),l.changed=null)}return{query:n,files:r}}function b(t,n,o){for(var r,i=t.doc,s=null,a=null,c=4,l=n.line-1,u=Math.max(0,l-50);l>=u;--l){var f=i.getLine(l),d=f.search(/\bfunction\b/);if(!(0>d)){var p=e.countColumn(f,null,c);null!=s&&p>=s||(s=p,a=l)}}null==a&&(a=u);var h=Math.min(i.lastLine(),o.line+20);if(null==s||s==e.countColumn(i.getLine(n.line),null,c))r=h;else for(r=o.line+1;h>r;++r){var p=e.countColumn(i.getLine(r),null,c);if(s>=p)break}var g=M(a,0);return{type:"part",name:t.name,offsetLines:g.line,text:i.getRange(g,M(r,0))}}function w(e,t){var n=document.createElement(e);t&&(n.className=t);for(var o=2;o",n):n(prompt(t,""))}function k(t,n){function o(){c=!0,a||r()}function r(){t.state.ternTooltip=null,s.parentNode&&(t.off("cursorActivity",r),t.off("blur",r),t.off("scroll",r),N(s))}t.state.ternTooltip&&D(t.state.ternTooltip);var i=t.cursorCoords(),s=t.state.ternTooltip=A(i.right+1,i.bottom,n),a=!1,c=!1;e.on(s,"mousemove",function(){a=!0}),e.on(s,"mouseout",function(t){e.contains(s,t.relatedTarget||t.toElement)||(c?r():a=!1)}),setTimeout(o,1700),t.on("cursorActivity",r),t.on("blur",r),t.on("scroll",r)}function A(e,t,n){var o=w("div",j+"tooltip",n);return o.style.left=e+"px",o.style.top=t+"px",document.body.appendChild(o),o}function D(e){var t=e&&e.parentNode;t&&t.removeChild(e)}function N(e){e.style.opacity="0",setTimeout(function(){D(e)},1100)}function H(e,t,n){e.options.showError?e.options.showError(t,n):k(t,String(n))}function S(e){e.activeArgHints&&(D(e.activeArgHints),e.activeArgHints=null)}function F(e,t){var n=t.doc.getValue();return e.options.fileFilter&&(n=e.options.fileFilter(n,t.name,t.doc)),n}function q(e){function n(e,t){t&&(e.id=++r,i[r]=t),o.postMessage(e)}var o=e.worker=new Worker(e.options.workerScript);o.postMessage({type:"init",defs:e.options.defs,plugins:e.options.plugins,scripts:e.options.workerDeps});var r=0,i={};o.onmessage=function(o){var r=o.data;"getFile"==r.type?t(e,r.name,function(e,t){n({type:"getFile",err:String(e),text:t,id:r.id})}):"debug"==r.type?window.console.log(r.message):r.id&&i[r.id]&&(i[r.id](r.err,r.body),delete i[r.id])},o.onerror=function(e){for(var t in i)i[t](e);i={}},this.addFile=function(e,t){n({type:"add",name:e,text:t})},this.delFile=function(e){n({type:"del",name:e})},this.request=function(e,t){n({type:"req",body:e},t)}}e.TernServer=function(e){var n=this;this.options=e||{};var o=this.options.plugins||(this.options.plugins={});o.doc_comment||(o.doc_comment=!0),this.server=this.options.useWorker?new q(this):new tern.Server({getFile:function(e,o){return t(n,e,o)},async:!0,defs:this.options.defs||[],plugins:o}),this.docs=Object.create(null),this.trackChange=function(e,t){r(n,e,t)},this.cachedArgHints=null,this.activeArgHints=null,this.jumpStack=[],this.getHint=function(e,t){return s(n,e,t)},this.getHint.async=!0},e.TernServer.prototype={addDoc:function(t,n){var o={doc:n,name:t,changed:null};return this.server.addFile(t,F(this,o)),e.on(n,"change",this.trackChange),this.docs[t]=o},delDoc:function(t){var n=o(this,t);n&&(e.off(n.doc,"change",this.trackChange),delete this.docs[n.name],this.server.delFile(n.name))},hideDoc:function(e){S(this);var t=o(this,e);t&&t.changed&&i(this,t)},complete:function(e){e.showHint({hint:this.getHint})},showType:function(e,t,n){c(this,e,t,"type",n)},showDocs:function(e,t,n){c(this,e,t,"documentation",n)},updateArgHints:function(e){l(this,e)},jumpToDef:function(e){d(this,e)},jumpBack:function(e){p(this,e)},rename:function(e){v(this,e)},selectName:function(e){y(this,e)},request:function(e,t,o,r){var i=this,s=n(this,e.getDoc()),a=x(this,s,t,r);this.server.request(a,function(e,n){!e&&i.options.responseFilter&&(n=i.options.responseFilter(s,t,a,e,n)),o(e,n)})},destroy:function(){this.worker&&(this.worker.terminate(),this.worker=null)}};var M=e.Pos,j="CodeMirror-Tern-",L=250,O=0,R=e.cmpPos}); -\ 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){var d=a.docs[b];d?c(E(a,d)):a.options.getFile?a.options.getFile(b,c):c(null)}function c(a,b,c){for(var d in a.docs){var e=a.docs[d];if(e.doc==b)return e}if(!c)for(var f=0;;++f)if(d="[doc"+(f||"")+"]",!a.docs[d]){c=d;break}return a.addDoc(c,b)}function d(b,d){return"string"==typeof d?b.docs[d]:(d instanceof a&&(d=d.getDoc()),d instanceof a.Doc?c(b,d):void 0)}function e(a,b,d){var e=c(a,b),g=a.cachedArgHints;g&&g.doc==b&&K(g.start,d.to)<=0&&(a.cachedArgHints=null);var h=e.changed;null==h&&(e.changed=h={from:d.from.line,to:d.from.line});var i=d.from.line+(d.text.length-1);d.from.line=h.to&&(h.to=i+1),h.from>d.from.line&&(h.from=d.from.line),b.lineCount()>I&&d.to-h.from>100&&setTimeout(function(){e.changed&&e.changed.to-e.changed.from>100&&f(a,e)},200)}function f(a,b){a.server.request({files:[{type:"full",name:b.name,text:E(a,b)}]},function(a){a?window.console.error(a):b.changed=null})}function g(b,c,d){b.request(c,{type:"completions",types:!0,docs:!0,urls:!0},function(e,f){if(e)return C(b,c,e);var g=[],i="",j=f.start,k=f.end;'["'==c.getRange(G(j.line,j.ch-2),j)&&'"]'!=c.getRange(k,G(k.line,k.ch+2))&&(i='"]');for(var l=0;l=m;--j){for(var o=c.getLine(j),p=0,q=0;;){var r=o.indexOf(" ",q);if(-1==r)break;p+=i-(r+p)%i-1,q=r+1}if(g=f.column-p,"("==o.charAt(g)){n=!0;break}}if(n){var s=G(j,g),t=b.cachedArgHints;return t&&t.doc==c.getDoc()&&0==K(s,t.start)?k(b,c,h):void b.request(c,{type:"type",preferFunction:!0,end:s},function(a,d){!a&&d.type&&/^fn\(/.test(d.type)&&(b.cachedArgHints={start:q,type:l(d.type),name:d.exprName||d.name||"fn",guess:d.guess,doc:c.getDoc()},k(b,c,h))})}}}}}function k(a,b,c){D(a);for(var d=a.cachedArgHints,e=d.type,f=w("span",d.guess?H+"fhint-guess":null,w("span",H+"fname",d.name),"("),g=0;g ":")")),e.rettype&&f.appendChild(w("span",H+"type",e.rettype));var i=b.cursorCoords(null,"page");a.activeArgHints=z(i.right+1,i.bottom,f)}function l(a){function b(b){for(var c=0,e=d;;){var f=a.charAt(d);if(b.test(f)&&!c)return a.slice(e,d);/[{\[\(]/.test(f)?++c:/[}\]\)]/.test(f)&&--c,++d}}var c=[],d=3;if(")"!=a.charAt(d))for(;;){var e=a.slice(d).match(/^([^, \(\[\{]+): /);if(e&&(d+=e[0].length,e=e[1]),c.push({name:e,type:b(/[\),]/)}),")"==a.charAt(d))break;d+=2}var f=a.slice(d).match(/^\) -> (.*)$/);return{args:c,rettype:f&&f[1]}}function m(a,b){function d(d){var e={type:"definition",variable:d||null},f=c(a,b.getDoc());a.server.request(u(a,f,e),function(c,d){if(c)return C(a,b,c);if(!d.file&&d.url)return void window.open(d.url);if(d.file){var e,g=a.docs[d.file];if(g&&(e=p(g.doc,d)))return a.jumpStack.push({file:f.name,start:b.getCursor("from"),end:b.getCursor("to")}),void o(a,f,g,e.start,e.end)}C(a,b,"Could not find a definition.")})}q(b)?d():x(b,"Jump to variable",function(a){a&&d(a)})}function n(a,b){var d=a.jumpStack.pop(),e=d&&a.docs[d.file];e&&o(a,c(a,b.getDoc()),e,d.start,d.end)}function o(a,b,c,d,e){c.doc.setSelection(d,e),b!=c&&a.options.switchToDoc&&(D(a),a.options.switchToDoc(c.name,c.doc))}function p(a,b){for(var c=b.context.slice(0,b.contextOffset).split("\n"),d=b.start.line-(c.length-1),e=G(d,(1==c.length?b.start.ch:a.getLine(d).length)-c[0].length),f=a.getLine(d).slice(e.ch),g=d+1;gl&&(h=k,j=l)}if(!h)return null;if(1==c.length?h.ch+=c[0].length:h=G(h.line+(c.length-1),c[c.length-1].length),b.start.line==b.end.line)var m=G(h.line,h.ch+(b.end.ch-b.start.ch));else var m=G(h.line+(b.end.line-b.start.line),b.end.ch);return{start:h,end:m}}function q(a){var b=a.getCursor("end"),c=a.getTokenAt(b);return c.start=0&&K(g,i.end)<=0&&(g=f.length-1))}b.setSelections(f,g)})}function t(a,b){for(var c=Object.create(null),d=0;dI&&g!==!1&&b.changed.to-b.changed.from<100&&b.changed.from<=h.line&&b.changed.to>c.end.line){e.push(v(b,h,c.end)),c.file="#0";var f=e[0].offsetLines;null!=c.start&&(c.start=G(c.start.line- -f,c.start.ch)),c.end=G(c.end.line-f,c.end.ch)}else e.push({type:"full",name:b.name,text:E(a,b)}),c.file=b.name,b.changed=null;else c.file=b.name;for(var i in a.docs){var j=a.docs[i];j.changed&&j!=b&&(e.push({type:"full",name:j.name,text:E(a,j)}),j.changed=null)}return{query:c,files:e}}function v(b,c,d){for(var e,f=b.doc,g=null,h=null,i=4,j=c.line-1,k=Math.max(0,j-50);j>=k;--j){var l=f.getLine(j),m=l.search(/\bfunction\b/);if(!(0>m)){var n=a.countColumn(l,null,i);null!=g&&n>=g||(g=n,h=j)}}null==h&&(h=k);var o=Math.min(f.lastLine(),d.line+20);if(null==g||g==a.countColumn(f.getLine(c.line),null,i))e=o;else for(e=d.line+1;o>e;++e){var n=a.countColumn(f.getLine(e),null,i);if(g>=n)break}var p=G(h,0);return{type:"part",name:b.name,offsetLines:p.line,text:f.getRange(p,G(e,0))}}function w(a,b){var c=document.createElement(a);b&&(c.className=b);for(var d=2;d",c):c(prompt(b,""))}function y(b,c){function d(){i=!0,h||e()}function e(){b.state.ternTooltip=null,g.parentNode&&(b.off("cursorActivity",e),b.off("blur",e),b.off("scroll",e),B(g))}b.state.ternTooltip&&A(b.state.ternTooltip);var f=b.cursorCoords(),g=b.state.ternTooltip=z(f.right+1,f.bottom,c),h=!1,i=!1;a.on(g,"mousemove",function(){h=!0}),a.on(g,"mouseout",function(b){a.contains(g,b.relatedTarget||b.toElement)||(i?e():h=!1)}),setTimeout(d,1700),b.on("cursorActivity",e),b.on("blur",e),b.on("scroll",e)}function z(a,b,c){var d=w("div",H+"tooltip",c);return d.style.left=a+"px",d.style.top=b+"px",document.body.appendChild(d),d}function A(a){var b=a&&a.parentNode;b&&b.removeChild(a)}function B(a){a.style.opacity="0",setTimeout(function(){A(a)},1100)}function C(a,b,c){a.options.showError?a.options.showError(b,c):y(b,String(c))}function D(a){a.activeArgHints&&(A(a.activeArgHints),a.activeArgHints=null)}function E(a,b){var c=b.doc.getValue();return a.options.fileFilter&&(c=a.options.fileFilter(c,b.name,b.doc)),c}function F(a){function c(a,b){b&&(a.id=++e,f[e]=b),d.postMessage(a)}var d=a.worker=new Worker(a.options.workerScript);d.postMessage({type:"init",defs:a.options.defs,plugins:a.options.plugins,scripts:a.options.workerDeps});var e=0,f={};d.onmessage=function(d){var e=d.data;"getFile"==e.type?b(a,e.name,function(a,b){c({type:"getFile",err:String(a),text:b,id:e.id})}):"debug"==e.type?window.console.log(e.message):e.id&&f[e.id]&&(f[e.id](e.err,e.body),delete f[e.id])},d.onerror=function(a){for(var b in f)f[b](a);f={}},this.addFile=function(a,b){c({type:"add",name:a,text:b})},this.delFile=function(a){c({type:"del",name:a})},this.request=function(a,b){c({type:"req",body:a},b)}}a.TernServer=function(a){var c=this;this.options=a||{};var d=this.options.plugins||(this.options.plugins={});d.doc_comment||(d.doc_comment=!0),this.options.useWorker?this.server=new F(this):this.server=new tern.Server({getFile:function(a,d){return b(c,a,d)},async:!0,defs:this.options.defs||[],plugins:d}),this.docs=Object.create(null),this.trackChange=function(a,b){e(c,a,b)},this.cachedArgHints=null,this.activeArgHints=null,this.jumpStack=[],this.getHint=function(a,b){return g(c,a,b)},this.getHint.async=!0},a.TernServer.prototype={addDoc:function(b,c){var d={doc:c,name:b,changed:null};return this.server.addFile(b,E(this,d)),a.on(c,"change",this.trackChange),this.docs[b]=d},delDoc:function(b){var c=d(this,b);c&&(a.off(c.doc,"change",this.trackChange),delete this.docs[c.name],this.server.delFile(c.name))},hideDoc:function(a){D(this);var b=d(this,a);b&&b.changed&&f(this,b)},complete:function(a){a.showHint({hint:this.getHint})},showType:function(a,b,c){i(this,a,b,"type",c)},showDocs:function(a,b,c){i(this,a,b,"documentation",c)},updateArgHints:function(a){j(this,a)},jumpToDef:function(a){m(this,a)},jumpBack:function(a){n(this,a)},rename:function(a){r(this,a)},selectName:function(a){s(this,a)},request:function(a,b,d,e){var f=this,g=c(this,a.getDoc()),h=u(this,g,b,e);this.server.request(h,function(a,c){!a&&f.options.responseFilter&&(c=f.options.responseFilter(g,b,h,a,c)),d(a,c)})},destroy:function(){this.worker&&(this.worker.terminate(),this.worker=null)}};var G=a.Pos,H="CodeMirror-Tern-",I=250,J=0,K=a.cmpPos}); -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/tern/worker.js b/media/editors/codemirror/addon/tern/worker.js -index 48277af..887f906 100644 ---- a/media/editors/codemirror/addon/tern/worker.js -+++ b/media/editors/codemirror/addon/tern/worker.js -@@ -39,6 +39,6 @@ function startServer(defs, plugins, scripts) { - }); - } - --var console = { -+this.console = { - log: function(v) { postMessage({type: "debug", message: v}); } - }; -diff --git a/media/editors/codemirror/addon/tern/worker.min.js b/media/editors/codemirror/addon/tern/worker.min.js -index 9c6543c..12d3c48 100644 ---- a/media/editors/codemirror/addon/tern/worker.min.js -+++ b/media/editors/codemirror/addon/tern/worker.min.js -@@ -1 +1 @@ --function getFile(e,r){postMessage({type:"getFile",name:e,id:++nextId}),pending[nextId]=r}function startServer(e,r,t){t&&importScripts.apply(null,t),server=new tern.Server({getFile:getFile,async:!0,defs:e,plugins:r})}var server;this.onmessage=function(e){var r=e.data;switch(r.type){case"init":return startServer(r.defs,r.plugins,r.scripts);case"add":return server.addFile(r.name,r.text);case"del":return server.delFile(r.name);case"req":return server.request(r.body,function(e,t){postMessage({id:r.id,body:t,err:e&&String(e)})});case"getFile":var t=pending[r.id];return delete pending[r.id],t(r.err,r.text);default:throw new Error("Unknown message type: "+r.type)}};var nextId=0,pending={},console={log:function(e){postMessage({type:"debug",message:e})}}; -\ No newline at end of file -+function getFile(a,b){postMessage({type:"getFile",name:a,id:++nextId}),pending[nextId]=b}function startServer(a,b,c){c&&importScripts.apply(null,c),server=new tern.Server({getFile:getFile,async:!0,defs:a,plugins:b})}var server;this.onmessage=function(a){var b=a.data;switch(b.type){case"init":return startServer(b.defs,b.plugins,b.scripts);case"add":return server.addFile(b.name,b.text);case"del":return server.delFile(b.name);case"req":return server.request(b.body,function(a,c){postMessage({id:b.id,body:c,err:a&&String(a)})});case"getFile":var c=pending[b.id];return delete pending[b.id],c(b.err,b.text);default:throw new Error("Unknown message type: "+b.type)}};var nextId=0,pending={};this.console={log:function(a){postMessage({type:"debug",message:a})}}; -\ No newline at end of file -diff --git a/media/editors/codemirror/addon/wrap/hardwrap.min.js b/media/editors/codemirror/addon/wrap/hardwrap.min.js -index 97d8e39..dadc37e 100644 ---- a/media/editors/codemirror/addon/wrap/hardwrap.min.js -+++ b/media/editors/codemirror/addon/wrap/hardwrap.min.js -@@ -1 +1 @@ --!function(r){"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)}(function(r){"use strict";function t(r,t,e){for(var n=e.paragraphStart||r.getHelper(t,"paragraphStart"),o=t.line,a=r.firstLine();o>a;--o){var i=r.getLine(o);if(n&&n.test(i))break;if(!/\S/.test(i)){++o;break}}for(var f=e.paragraphEnd||r.getHelper(t,"paragraphEnd"),l=t.line+1,s=r.lastLine();s>=l;++l){var i=r.getLine(l);if(f&&f.test(i)){++l;break}if(!/\S/.test(i))break}return{from:o,to:l}}function e(r,t,e,n){for(var o=t;o>0&&!e.test(r.slice(o-1,o+1));--o);0==o&&(o=t);var a=o;if(n)for(;" "==r.charAt(a-1);)--a;return{from:a,to:o}}function n(t,n,a,i){n=t.clipPos(n),a=t.clipPos(a);var f=i.column||80,l=i.wrapOn||/\s\S|-[^\.\d]/,s=i.killTrailingSpace!==!1,h=[],c="",g=n.line,p=t.getRange(n,a,!1);if(!p.length)return null;for(var u=p[0].match(/^[ \t]*/)[0],m=0;mf&&u==x&&e(c,f,l,s);S&&S.from==d&&S.to==d+b?(c=u+v,++g):h.push({text:[b?" ":""],from:o(g,d),to:o(g+1,x.length)})}for(;c.length>f;){var E=e(c,f,l,s);h.push({text:["",u],from:o(g,E.from),to:o(g,E.to)}),c=u+c.slice(E.to),++g}}return h.length&&t.operation(function(){for(var r=0;r=0;i--){var f,l=e[i];if(l.empty()){var s=t(r,l.head,{});f={from:o(s.from,0),to:o(s.to-1)}}else f={from:l.from(),to:l.to()};f.to.line>=a||(a=f.from.line,n(r,f.from,f.to,{}))}})},r.defineExtension("wrapRange",function(r,t,e){return n(this,r,t,e||{})}),r.defineExtension("wrapParagraphsInRange",function(r,e,a){a=a||{};for(var i=this,f=[],l=r.line;l<=e.line;){var s=t(i,o(l,0),a);f.push(s),l=s.to}var h=!1;return f.length&&i.operation(function(){for(var r=f.length-1;r>=0;--r)h=h||n(i,o(f[r].from,0),o(f[r].to-1),a)}),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,c){for(var d=c.paragraphStart||a.getHelper(b,"paragraphStart"),e=b.line,f=a.firstLine();e>f;--e){var g=a.getLine(e);if(d&&d.test(g))break;if(!/\S/.test(g)){++e;break}}for(var h=c.paragraphEnd||a.getHelper(b,"paragraphEnd"),i=b.line+1,j=a.lastLine();j>=i;++i){var g=a.getLine(i);if(h&&h.test(g)){++i;break}if(!/\S/.test(g))break}return{from:e,to:i}}function c(a,b,c,d){for(var e=b;e>0&&!c.test(a.slice(e-1,e+1));--e);0==e&&(e=b);var f=e;if(d)for(;" "==a.charAt(f-1);)--f;return{from:f,to:e}}function d(b,d,f,g){d=b.clipPos(d),f=b.clipPos(f);var h=g.column||80,i=g.wrapOn||/\s\S|-[^\.\d]/,j=g.killTrailingSpace!==!1,k=[],l="",m=d.line,n=b.getRange(d,f,!1);if(!n.length)return null;for(var o=n[0].match(/^[ \t]*/)[0],p=0;ph&&o==t&&c(l,h,i,j);u&&u.from==r&&u.to==r+s?(l=o+q,++m):k.push({text:[s?" ":""],from:e(m,r),to:e(m+1,t.length)})}for(;l.length>h;){var v=c(l,h,i,j);k.push({text:["",o],from:e(m,v.from),to:e(m,v.to)}),l=o+l.slice(v.to),++m}}return k.length&&b.operation(function(){for(var a=0;a=0;g--){var h,i=c[g];if(i.empty()){var j=b(a,i.head,{});h={from:e(j.from,0),to:e(j.to-1)}}else h={from:i.from(),to:i.to()};h.to.line>=f||(f=h.from.line,d(a,h.from,h.to,{}))}})},a.defineExtension("wrapRange",function(a,b,c){return d(this,a,b,c||{})}),a.defineExtension("wrapParagraphsInRange",function(a,c,f){f=f||{};for(var g=this,h=[],i=a.line;i<=c.line;){var j=b(g,e(i,0),f);h.push(j),i=j.to}var k=!1;return h.length&&g.operation(function(){for(var a=h.length-1;a>=0;--a)k=k||d(g,e(h[a].from,0),e(h[a].to-1),f)}),k})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/keymap/emacs.min.js b/media/editors/codemirror/keymap/emacs.min.js -index f1d293a..90356b9 100644 ---- a/media/editors/codemirror/keymap/emacs.min.js -+++ b/media/editors/codemirror/keymap/emacs.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){return t.line==e.line&&t.ch==e.ch}function n(t){M.push(t),M.length>50&&M.shift()}function r(t){return M.length?void(M[M.length-1]+=t):n(t)}function o(t){return M[M.length-(t?Math.min(t,1):1)]||""}function i(){return M.length>1&&M.pop(),o()}function l(t,o,i,l,c){null==c&&(c=t.getRange(o,i)),l&&B&&B.cm==t&&e(o,B.pos)&&t.isClean(B.gen)?r(c):n(c),t.replaceRange("",o,i,"+delete"),B=l?{cm:t,pos:o,gen:t.changeGeneration()}:null}function c(t,e,n){return t.findPosH(e,n,"char",!0)}function a(t,e,n){return t.findPosH(e,n,"word",!0)}function u(t,e,n){return t.findPosV(e,n,"line",t.doc.sel.goalColumn)}function f(t,e,n){return t.findPosV(e,n,"page",t.doc.sel.goalColumn)}function s(t,e,n){for(var r=e.line,o=t.getLine(r),i=/\S/.test(0>n?o.slice(0,e.ch):o.slice(e.ch)),l=t.firstLine(),c=t.lastLine();;){if(r+=n,l>r||r>c)return t.clipPos(H(r-n,0>n?0:null));o=t.getLine(r);var a=/\S/.test(o);if(a)i=!0;else if(i)return H(r,0)}}function C(t,e,n){for(var r=e.line,o=e.ch,i=t.getLine(e.line),l=!1;;){var c=i.charAt(o+(0>n?-1:0));if(c){if(l&&/[!?.]/.test(c))return H(r,o+(n>0?1:0));l||(l=/\w/.test(c)),o+=n}else{if(r==(0>n?t.firstLine():t.lastLine()))return H(r,o);if(i=t.getLine(r+n),!/\S/.test(i))return H(r,o);r+=n,o=0>n?i.length:0}}}function g(t,n,r){var o;if(t.findMatchingBracket&&(o=t.findMatchingBracket(n,!0))&&o.match&&(o.forward?1:-1)==r)return r>0?H(o.to.line,o.to.ch+1):o.to;for(var i=!0;;i=!1){var l=t.getTokenAt(n),c=H(n.line,0>r?l.start:l.end);if(!(i&&r>0&&l.end==n.ch)&&/\w/.test(l.string))return c;var a=t.findPosH(c,r,"char");if(e(c,a))return n;n=a}}function d(t,e){var n=t.state.emacsPrefix;return n?(x(t),"-"==n?-1:Number(n)):e?null:1}function p(t){var e="string"==typeof t?function(e){e.execCommand(t)}:t;return function(t){var n=d(t);e(t);for(var r=1;n>r;++r)e(t)}}function h(t,n,r,o){var i=d(t);0>i&&(o=-o,i=-i);for(var l=0;i>l;++l){var c=r(t,n,o);if(e(c,n))break;n=c}return n}function v(t,e){var n=function(n){n.extendSelection(h(n,n.getCursor(),t,e))};return n.motion=!0,n}function A(t,e,n){for(var r,o=t.listSelections(),i=o.length;i--;)r=o[i].head,l(t,r,h(t,r,e,n),!0)}function m(t){if(t.somethingSelected()){for(var e,n=t.listSelections(),r=n.length;r--;)e=n[r],l(t,e.anchor,e.head);return!0}}function S(t,e){return t.state.emacsPrefix?void("-"!=e&&(t.state.emacsPrefix+=e)):(t.state.emacsPrefix=e,t.on("keyHandled",P),void t.on("inputRead",L))}function P(t,e){t.state.emacsPrefixMap||G.hasOwnProperty(e)||x(t)}function x(t){t.state.emacsPrefix=null,t.off("keyHandled",P),t.off("inputRead",L)}function L(t,e){var n=d(t);if(n>1&&"+input"==e.origin){for(var r=e.text.join("\n"),o="",i=1;n>i;++i)o+=r;t.replaceSelection(o)}}function R(t){t.state.emacsPrefixMap=!0,t.addKeyMap(T),t.on("keyHandled",y),t.on("inputRead",y)}function y(t,e){("string"!=typeof e||!/^\d$/.test(e)&&"Ctrl-U"!=e)&&(t.removeKeyMap(T),t.state.emacsPrefixMap=!1,t.off("keyHandled",y),t.off("inputRead",y))}function w(t){t.setCursor(t.getCursor()),t.setExtending(!t.getExtending()),t.on("change",function(){t.setExtending(!1)})}function b(t){t.setExtending(!1),t.setCursor(t.getCursor())}function k(t,e,n){t.openDialog?t.openDialog(e+': ',n,{bottom:!0}):n(prompt(e,""))}function U(t,e){var n=t.getCursor(),r=t.findPosH(n,1,"word");t.replaceRange(e(t.getRange(n,r)),n,r),t.setCursor(r)}function X(t){for(var e=t.getCursor(),n=e.line,r=e.ch,o=[];n>=t.firstLine();){for(var i=t.getLine(n),l=null==r?i.length:r;l>0;){var r=i.charAt(--l);if(")"==r)o.push("(");else if("]"==r)o.push("[");else if("}"==r)o.push("{");else if(/[\(\{\[]/.test(r)&&(!o.length||o.pop()!=r))return t.extendSelection(H(n,l))}--n,r=null}}function D(t){t.execCommand("clearSearch"),b(t)}function E(t){T[t]=function(e){S(e,t)},K["Ctrl-"+t]=function(e){S(e,t)},G["Ctrl-"+t]=!0}for(var H=t.Pos,M=[],B=null,G={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0},K=t.keyMap.emacs=t.normalizeKeyMap({"Ctrl-W":function(t){l(t,t.getCursor("start"),t.getCursor("end"))},"Ctrl-K":p(function(t){var e=t.getCursor(),n=t.clipPos(H(e.line)),r=t.getRange(e,n);/\S/.test(r)||(r+="\n",n=H(e.line+1,0)),l(t,e,n,!0,r)}),"Alt-W":function(t){n(t.getSelection()),b(t)},"Ctrl-Y":function(t){var e=t.getCursor();t.replaceRange(o(d(t)),e,e,"paste"),t.setSelection(e,t.getCursor())},"Alt-Y":function(t){t.replaceSelection(i(),"around","paste")},"Ctrl-Space":w,"Ctrl-Shift-2":w,"Ctrl-F":v(c,1),"Ctrl-B":v(c,-1),Right:v(c,1),Left:v(c,-1),"Ctrl-D":function(t){A(t,c,1)},Delete:function(t){m(t)||A(t,c,1)},"Ctrl-H":function(t){A(t,c,-1)},Backspace:function(t){m(t)||A(t,c,-1)},"Alt-F":v(a,1),"Alt-B":v(a,-1),"Alt-D":function(t){A(t,a,1)},"Alt-Backspace":function(t){A(t,a,-1)},"Ctrl-N":v(u,1),"Ctrl-P":v(u,-1),Down:v(u,1),Up:v(u,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":v(f,-1),"Ctrl-V":v(f,1),PageUp:v(f,-1),PageDown:v(f,1),"Ctrl-Up":v(s,-1),"Ctrl-Down":v(s,1),"Alt-A":v(C,-1),"Alt-E":v(C,1),"Alt-K":function(t){A(t,C,1)},"Ctrl-Alt-K":function(t){A(t,g,1)},"Ctrl-Alt-Backspace":function(t){A(t,g,-1)},"Ctrl-Alt-F":v(g,1),"Ctrl-Alt-B":v(g,-1),"Shift-Ctrl-Alt-2":function(t){var e=t.getCursor();t.setSelection(h(t,e,g,1),e)},"Ctrl-Alt-T":function(t){var e=g(t,t.getCursor(),-1),n=g(t,e,1),r=g(t,n,1),o=g(t,r,-1);t.replaceRange(t.getRange(o,r)+t.getRange(n,o)+t.getRange(e,n),e,r)},"Ctrl-Alt-U":p(X),"Alt-Space":function(t){for(var e=t.getCursor(),n=e.ch,r=e.ch,o=t.getLine(e.line);n&&/\s/.test(o.charAt(n-1));)--n;for(;r0?t.setCursor(e-1):void k(t,"Goto line",function(e){var n;e&&!isNaN(n=Number(e))&&n==n|0&&n>0&&t.setCursor(n-1)})},"Ctrl-X Tab":function(t){t.indentSelection(d(t,!0)||t.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(t){t.setSelection(t.getCursor("head"),t.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(t){l(t,t.getCursor(),C(t,t.getCursor(),1),!0)},"Ctrl-X H":"selectAll","Ctrl-Q Tab":p("insertTab"),"Ctrl-U":R}),T={"Ctrl-G":x},N=0;10>N;++N)E(String(N));E("-")}); -\ 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)),g&&J&&J.cm==a&&b(e,J.pos)&&a.isClean(J.gen)?d(h):c(h),a.replaceRange("",e,f,"+delete"),J=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(0>c?e.slice(0,b.ch):e.slice(b.ch)),g=a.firstLine(),h=a.lastLine();;){if(d+=c,g>d||d>h)return a.clipPos(H(d-c,0>c?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+(0>c?-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==(0>c?a.firstLine():a.lastLine()))return H(d,e);if(f=a.getLine(d+c),!/\S/.test(f))return H(d,e);d+=c,e=0>c?f.length:0}}}function n(a,c,d){var e;if(a.findMatchingBracket&&(e=a.findMatchingBracket(c,!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,0>d?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;c>d;++d)b(a)}}function q(a,c,d,e){var f=o(a);0>f&&(e=-e,f=-f);for(var g=0;f>g;++g){var h=d(a,c,e);if(b(h,c))break;c=h}return c}function r(a,b){var c=function(c){c.extendSelection(q(c,c.getCursor(),a,b))};return c.motion=!0,c}function s(a,b,c){for(var d,e=a.listSelections(),f=e.length;f--;)d=e[f].head,g(a,d,q(a,d,b,c),!0)}function t(a){if(a.somethingSelected()){for(var b,c=a.listSelections(),d=c.length;d--;)b=c[d],g(a,b.anchor,b.head);return!0}}function u(a,b){return a.state.emacsPrefix?void("-"!=b&&(a.state.emacsPrefix+=b)):(a.state.emacsPrefix=b,a.on("keyHandled",v),void a.on("inputRead",x))}function v(a,b){a.state.emacsPrefixMap||K.hasOwnProperty(b)||w(a)}function w(a){a.state.emacsPrefix=null,a.off("keyHandled",v),a.off("inputRead",x)}function x(a,b){var c=o(a);if(c>1&&"+input"==b.origin){for(var d=b.text.join("\n"),e="",f=1;c>f;++f)e+=d;a.replaceSelection(e)}}function y(a){a.state.emacsPrefixMap=!0,a.addKeyMap(M),a.on("keyHandled",z),a.on("inputRead",z)}function z(a,b){("string"!=typeof b||!/^\d$/.test(b)&&"Ctrl-U"!=b)&&(a.removeKeyMap(M),a.state.emacsPrefixMap=!1,a.off("keyHandled",z),a.off("inputRead",z))}function A(a){a.setCursor(a.getCursor()),a.setExtending(!a.getExtending()),a.on("change",function(){a.setExtending(!1)})}function B(a){a.setExtending(!1),a.setCursor(a.getCursor())}function C(a,b,c){a.openDialog?a.openDialog(b+': ',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}for(var H=a.Pos,I=[],J=null,K={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0},L=a.keyMap.emacs=a.normalizeKeyMap({"Ctrl-W":function(a){g(a,a.getCursor("start"),a.getCursor("end"))},"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,!0,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)},Delete:function(a){t(a)||s(a,h,1)},"Ctrl-H":function(a){s(a,h,-1)},Backspace:function(a){t(a)||s(a,h,-1)},"Alt-F":r(i,1),"Alt-B":r(i,-1),"Alt-D":function(a){s(a,i,1)},"Alt-Backspace":function(a){s(a,i,-1)},"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)},"Ctrl-Alt-K":function(a){s(a,n,1)},"Ctrl-Alt-Backspace":function(a){s(a,n,-1)},"Ctrl-Alt-F":r(n,1),"Ctrl-Alt-B":r(n,-1),"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==c|0&&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),!0)},"Ctrl-X H":"selectAll","Ctrl-Q Tab":p("insertTab"),"Ctrl-U":y}),M={"Ctrl-G":w},N=0;10>N;++N)G(String(N));G("-")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/keymap/sublime.js b/media/editors/codemirror/keymap/sublime.js -index 45936c3..441456f 100644 ---- a/media/editors/codemirror/keymap/sublime.js -+++ b/media/editors/codemirror/keymap/sublime.js -@@ -409,6 +409,19 @@ - - map[cK + ctrl + "Backspace"] = "delLineLeft"; - -+ cmds[map["Backspace"] = "smartBackspace"] = function(cm) { -+ if (cm.somethingSelected()) return CodeMirror.Pass; -+ -+ var cursor = cm.getCursor(); -+ var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor); -+ var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption("tabSize")); -+ -+ if (toStartOfLine && !/\S/.test(toStartOfLine) && column % cm.getOption("indentUnit") == 0) -+ return cm.indentSelection("subtract"); -+ else -+ return CodeMirror.Pass; -+ }; -+ - cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) { - cm.operation(function() { - var ranges = cm.listSelections(); -diff --git a/media/editors/codemirror/keymap/sublime.min.js b/media/editors/codemirror/keymap/sublime.min.js -index e9a48d8..27dc0d1 100644 ---- a/media/editors/codemirror/keymap/sublime.min.js -+++ b/media/editors/codemirror/keymap/sublime.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,o){if(0>o&&0==n.ch)return t.clipPos(h(n.line-1));var r=t.getLine(n.line);if(o>0&&n.ch>=r.length)return t.clipPos(h(n.line+1,0));for(var i,l="start",a=n.ch,s=0>o?0:r.length,c=0;a!=s;a+=o,c++){var f=r.charAt(0>o?a-1:a),u="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==u&&f.toUpperCase()==f&&(u="W"),"start"==l)"o"!=u&&(l="in",i=u);else if("in"==l&&i!=u){if("w"==i&&"W"==u&&0>o&&a--,"W"==i&&"w"==u&&o>0){i="w";continue}break}}return h(n.line,a)}function n(e,n){e.extendSelectionsBy(function(o){return e.display.shift||e.doc.extend||o.empty()?t(e.doc,o.head,n):0>n?o.from():o.to()})}function o(e,t){e.operation(function(){for(var n=e.listSelections().length,o=[],r=-1,i=0;n>i;i++){var l=e.listSelections()[i].head;if(!(l.line<=r)){var a=h(l.line+(t?0:1),0);e.replaceRange("\n",a,null,"+insertLine"),e.indentLine(a.line,null,!0),o.push({head:a,anchor:a}),r=l.line+1}}e.setSelections(o)})}function r(t,n){for(var o=n.ch,r=o,i=t.getLine(n.line);o&&e.isWordChar(i.charAt(o-1));)--o;for(;re?-1:e==t?0:1}),e.replaceRange(f,s,c),n&&o.push({anchor:s,head:c})}n&&e.setSelections(o,0)})}function a(t,n){t.operation(function(){for(var o=t.listSelections(),i=[],l=[],a=0;a=0;a--){var s=o[i[a]];if(!(c&&e.cmpPos(s.head,c)>0)){var f=r(t,s.head);c=f.from,t.replaceRange(n(f.word),f.from,f.to)}}})}function s(t){var n=t.getCursor("from"),o=t.getCursor("to");if(0==e.cmpPos(n,o)){var i=r(t,n);if(!i.word)return;n=i.from,o=i.to}return{from:n,to:o,query:t.getRange(n,o),word:i}}function c(e,t){var n=s(e);if(n){var o=n.query,r=e.getSearchCursor(o,t?n.to:n.from);(t?r.findNext():r.findPrevious())?e.setSelection(r.from(),r.to()):(r=e.getSearchCursor(o,t?h(e.firstLine(),0):e.clipPos(h(e.lastLine()))),(t?r.findNext():r.findPrevious())?e.setSelection(r.from(),r.to()):n.word&&e.setSelection(n.from,n.to))}}var f=e.keyMap.sublime={fallthrough:"default"},u=e.commands,h=e.Pos,d=e.keyMap["default"]==e.keyMap.macDefault,p=d?"Cmd-":"Ctrl-";u[f["Alt-Left"]="goSubwordLeft"]=function(e){n(e,-1)},u[f["Alt-Right"]="goSubwordRight"]=function(e){n(e,1)},u[f[p+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},u[f[p+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},u[f["Shift-"+p+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],o=0;or.line&&l==i.line&&0==i.ch||n.push({anchor:l==r.line?r:h(l,0),head:l==i.line?i:h(l)});e.setSelections(n,0)},f["Shift-Tab"]="indentLess",u[f.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},u[f[p+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],o=0;oo?n.push(a,s):n.length&&(n[n.length-1]=s),o=s}e.operation(function(){for(var t=0;te.lastLine()?e.replaceRange("\n"+l,h(e.lastLine()),null,"+swapLine"):e.replaceRange(l+"\n",h(i,0),null,"+swapLine")}e.setSelections(r),e.scrollIntoView()})},u[f[g+"Down"]="swapLineDown"]=function(e){for(var t=e.listSelections(),n=[],o=e.lastLine()+1,r=t.length-1;r>=0;r--){var i=t[r],l=i.to().line+1,a=i.from().line;0!=i.to().ch||i.empty()||l--,o>l?n.push(l,a):n.length&&(n[n.length-1]=a),o=a}e.operation(function(){for(var t=n.length-2;t>=0;t-=2){var o=n[t],r=n[t+1],i=e.getLine(o);o==e.lastLine()?e.replaceRange("",h(o-1),h(o),"+swapLine"):e.replaceRange("",h(o,0),h(o+1,0),"+swapLine"),e.replaceRange(i+"\n",h(r,0),null,"+swapLine")}e.scrollIntoView()})},f[p+"/"]="toggleComment",u[f[p+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],o=0;on;n++){var o=e.listSelections()[n];o.empty()?e.replaceRange(e.getLine(o.head.line)+"\n",h(o.head.line,0)):e.replaceRange(e.getRange(o.from(),o.to()),o.from())}e.scrollIntoView()})},f[p+"T"]="transposeChars",u[f.F9="sortLines"]=function(e){l(e,!0)},u[f[p+"F9"]="sortLinesInsensitive"]=function(e){l(e,!1)},u[f.F2="nextBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){var n=t.shift(),o=n.find();if(o)return t.push(n),e.setSelection(o.from,o.to)}},u[f["Shift-F2"]="prevBookmark"]=function(e){var t=e.state.sublimeBookmarks;if(t)for(;t.length;){t.unshift(t.pop());var n=t[t.length-1].find();if(n)return e.setSelection(n.from,n.to);t.pop()}},u[f[p+"F2"]="toggleBookmark"]=function(e){for(var t=e.listSelections(),n=e.state.sublimeBookmarks||(e.state.sublimeBookmarks=[]),o=0;o=0;n--)e.replaceRange("",t[n].anchor,h(t[n].to().line),"+delete");e.scrollIntoView()})},u[f[v+p+"U"]="upcaseAtCursor"]=function(e){a(e,function(e){return e.toUpperCase()})},u[f[v+p+"L"]="downcaseAtCursor"]=function(e){a(e,function(e){return e.toLowerCase()})},u[f[v+p+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},u[f[v+p+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},u[f[v+p+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var o=t.getCursor(),r=n;if(e.cmpPos(o,r)>0){var i=r;r=o,o=i}t.state.sublimeKilled=t.getRange(o,r),t.replaceRange("",o,r)}},u[f[v+p+"X"]="swapWithSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},u[f[v+p+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},f[v+p+"G"]="clearBookmarks",u[f[v+p+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},u[f["Shift-Alt-Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;ne.firstLine()&&e.addSelection(h(o.head.line-1,o.head.ch))}})},u[f["Shift-Alt-Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;nd&&0==c.ch)return b.clipPos(m(c.line-1));var e=b.getLine(c.line);if(d>0&&c.ch>=e.length)return b.clipPos(m(c.line+1,0));for(var f,g="start",h=c.ch,i=0>d?0:e.length,j=0;h!=i;h+=d,j++){var k=e.charAt(0>d?h-1:h),l="_"!=k&&a.isWordChar(k)?"w":"o";if("w"==l&&k.toUpperCase()==k&&(l="W"),"start"==g)"o"!=l&&(g="in",f=l);else if("in"==g&&f!=l){if("w"==f&&"W"==l&&0>d&&h--,"W"==f&&"w"==l&&d>0){f="w";continue}break}}return m(c.line,h)}function c(a,c){a.extendSelectionsBy(function(d){return a.display.shift||a.doc.extend||d.empty()?b(a.doc,d.head,c):0>c?d.from():d.to()})}function d(a,b){a.operation(function(){for(var c=a.listSelections().length,d=[],e=-1,f=0;c>f;f++){var g=a.listSelections()[f].head;if(!(g.line<=e)){var h=m(g.line+(b?0:1),0);a.replaceRange("\n",h,null,"+insertLine"),a.indentLine(h.line,null,!0),d.push({head:h,anchor:h}),e=g.line+1}}a.setSelections(d)})}function e(b,c){for(var d=c.ch,e=d,f=b.getLine(c.line);d&&a.isWordChar(f.charAt(d-1));)--d;for(;ea?-1:a==b?0:1}),a.replaceRange(k,i,j),c&&d.push({anchor:i,head:j})}c&&a.setSelections(d,0)})}function h(b,c){b.operation(function(){for(var d=b.listSelections(),f=[],g=[],h=0;h=0;h--){var i=d[f[h]];if(!(j&&a.cmpPos(i.head,j)>0)){var k=e(b,i.head);j=k.from,b.replaceRange(c(k.word),k.from,k.to)}}})}function i(b){var c=b.getCursor("from"),d=b.getCursor("to");if(0==a.cmpPos(c,d)){var f=e(b,c);if(!f.word)return;c=f.from,d=f.to}return{from:c,to:d,query:b.getRange(c,d),word:f}}function j(a,b){var c=i(a);if(c){var d=c.query,e=a.getSearchCursor(d,b?c.to:c.from);(b?e.findNext():e.findPrevious())?a.setSelection(e.from(),e.to()):(e=a.getSearchCursor(d,b?m(a.firstLine(),0):a.clipPos(m(a.lastLine()))),(b?e.findNext():e.findPrevious())?a.setSelection(e.from(),e.to()):c.word&&a.setSelection(c.from,c.to))}}var k=a.keyMap.sublime={fallthrough:"default"},l=a.commands,m=a.Pos,n=a.keyMap["default"]==a.keyMap.macDefault,o=n?"Cmd-":"Ctrl-";l[k["Alt-Left"]="goSubwordLeft"]=function(a){c(a,-1)},l[k["Alt-Right"]="goSubwordRight"]=function(a){c(a,1)},l[k[o+"Up"]="scrollLineUp"]=function(a){var b=a.getScrollInfo();if(!a.somethingSelected()){var c=a.lineAtHeight(b.top+b.clientHeight,"local");a.getCursor().line>=c&&a.execCommand("goLineUp")}a.scrollTo(null,b.top-a.defaultTextHeight())},l[k[o+"Down"]="scrollLineDown"]=function(a){var b=a.getScrollInfo();if(!a.somethingSelected()){var c=a.lineAtHeight(b.top,"local")+1;a.getCursor().line<=c&&a.execCommand("goLineDown")}a.scrollTo(null,b.top+a.defaultTextHeight())},l[k["Shift-"+o+"L"]="splitSelectionByLine"]=function(a){for(var b=a.listSelections(),c=[],d=0;de.line&&g==f.line&&0==f.ch||c.push({anchor:g==e.line?e:m(g,0),head:g==f.line?f:m(g)});a.setSelections(c,0)},k["Shift-Tab"]="indentLess",l[k.Esc="singleSelectionTop"]=function(a){var b=a.listSelections()[0];a.setSelection(b.anchor,b.head,{scroll:!1})},l[k[o+"L"]="selectLine"]=function(a){for(var b=a.listSelections(),c=[],d=0;dd?c.push(h,i):c.length&&(c[c.length-1]=i),d=i}a.operation(function(){for(var b=0;ba.lastLine()?a.replaceRange("\n"+g,m(a.lastLine()),null,"+swapLine"):a.replaceRange(g+"\n",m(f,0),null,"+swapLine")}a.setSelections(e),a.scrollIntoView()})},l[k[q+"Down"]="swapLineDown"]=function(a){for(var b=a.listSelections(),c=[],d=a.lastLine()+1,e=b.length-1;e>=0;e--){var f=b[e],g=f.to().line+1,h=f.from().line;0!=f.to().ch||f.empty()||g--,d>g?c.push(g,h):c.length&&(c[c.length-1]=h),d=h}a.operation(function(){for(var b=c.length-2;b>=0;b-=2){var d=c[b],e=c[b+1],f=a.getLine(d);d==a.lastLine()?a.replaceRange("",m(d-1),m(d),"+swapLine"):a.replaceRange("",m(d,0),m(d+1,0),"+swapLine"),a.replaceRange(f+"\n",m(e,0),null,"+swapLine")}a.scrollIntoView()})},k[o+"/"]="toggleComment",l[k[o+"J"]="joinLines"]=function(a){for(var b=a.listSelections(),c=[],d=0;dc;c++){var d=a.listSelections()[c];d.empty()?a.replaceRange(a.getLine(d.head.line)+"\n",m(d.head.line,0)):a.replaceRange(a.getRange(d.from(),d.to()),d.from())}a.scrollIntoView()})},k[o+"T"]="transposeChars",l[k.F9="sortLines"]=function(a){g(a,!0)},l[k[o+"F9"]="sortLinesInsensitive"]=function(a){g(a,!1)},l[k.F2="nextBookmark"]=function(a){var b=a.state.sublimeBookmarks;if(b)for(;b.length;){var c=b.shift(),d=c.find();if(d)return b.push(c),a.setSelection(d.from,d.to)}},l[k["Shift-F2"]="prevBookmark"]=function(a){var b=a.state.sublimeBookmarks;if(b)for(;b.length;){b.unshift(b.pop());var c=b[b.length-1].find();if(c)return a.setSelection(c.from,c.to);b.pop()}},l[k[o+"F2"]="toggleBookmark"]=function(a){for(var b=a.listSelections(),c=a.state.sublimeBookmarks||(a.state.sublimeBookmarks=[]),d=0;d=0;c--)a.replaceRange("",b[c].anchor,m(b[c].to().line),"+delete");a.scrollIntoView()})},l[k[r+o+"U"]="upcaseAtCursor"]=function(a){h(a,function(a){return a.toUpperCase()})},l[k[r+o+"L"]="downcaseAtCursor"]=function(a){h(a,function(a){return a.toLowerCase()})},l[k[r+o+"Space"]="setSublimeMark"]=function(a){a.state.sublimeMark&&a.state.sublimeMark.clear(),a.state.sublimeMark=a.setBookmark(a.getCursor())},l[k[r+o+"A"]="selectToSublimeMark"]=function(a){var b=a.state.sublimeMark&&a.state.sublimeMark.find();b&&a.setSelection(a.getCursor(),b)},l[k[r+o+"W"]="deleteToSublimeMark"]=function(b){var c=b.state.sublimeMark&&b.state.sublimeMark.find();if(c){var d=b.getCursor(),e=c;if(a.cmpPos(d,e)>0){var f=e;e=d,d=f}b.state.sublimeKilled=b.getRange(d,e),b.replaceRange("",d,e)}},l[k[r+o+"X"]="swapWithSublimeMark"]=function(a){var b=a.state.sublimeMark&&a.state.sublimeMark.find();b&&(a.state.sublimeMark.clear(),a.state.sublimeMark=a.setBookmark(a.getCursor()),a.setCursor(b))},l[k[r+o+"Y"]="sublimeYank"]=function(a){null!=a.state.sublimeKilled&&a.replaceSelection(a.state.sublimeKilled,null,"paste")},k[r+o+"G"]="clearBookmarks",l[k[r+o+"C"]="showInCenter"]=function(a){var b=a.cursorCoords(null,"local");a.scrollTo(null,(b.top+b.bottom)/2-a.getScrollInfo().clientHeight/2)},l[k["Shift-Alt-Up"]="selectLinesUpward"]=function(a){a.operation(function(){for(var b=a.listSelections(),c=0;ca.firstLine()&&a.addSelection(m(d.head.line-1,d.head.ch))}})},l[k["Shift-Alt-Down"]="selectLinesDownward"]=function(a){a.operation(function(){for(var b=a.listSelections(),c=0;c, F, t, T -- * $, ^, 0, -, +, _ -- * gg, G -- * % -- * ', ` -- * -- * Operator: -- * d, y, c -- * dd, yy, cc -- * g~, g~g~ -- * >, <, >>, << -- * -- * Operator-Motion: -- * x, X, D, Y, C, ~ -- * -- * Action: -- * a, i, s, A, I, S, o, O -- * zz, z., z, zt, zb, z- -- * J -- * u, Ctrl-r -- * m -- * r -- * -- * Modes: -- * ESC - leave insert mode, visual mode, and clear input state. -- * Ctrl-[, Ctrl-c - same as ESC. -+ * Supported Ex commands: -+ * Refer to defaultExCommandMap below. - * - * Registers: unnamed, -, a-z, A-Z, 0-9 - * (Does not respect the special case for number registers when delete - * operator is made with these commands: %, (, ), , /, ?, n, N, {, } ) - * TODO: Implement the remaining registers. -+ * - * Marks: a-z, A-Z, and 0-9 - * TODO: Implement the remaining special marks. They have more complex - * behavior. -@@ -57,6 +31,7 @@ - * 6. Motion, operator, and action implementations - * 7. Helper functions for the key handler, motions, operators, and actions - * 8. Set up Vim to work as a keymap for CodeMirror. -+ * 9. Ex command implementations. - */ - - (function(mod) { -@@ -227,6 +202,34 @@ - { keys: ':', type: 'ex' } - ]; - -+ /** -+ * Ex commands -+ * Care must be taken when adding to the default Ex command map. For any -+ * pair of commands that have a shared prefix, at least one of their -+ * shortNames must not match the prefix of the other command. -+ */ -+ var defaultExCommandMap = [ -+ { 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: true }, -+ { name: 'nohlsearch', shortName: 'noh' }, -+ { name: 'delmarks', shortName: 'delm' }, -+ { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, -+ { name: 'global', shortName: 'g' } -+ ]; -+ - var Pos = CodeMirror.Pos; - - var Vim = function() { -@@ -336,7 +339,11 @@ - } - - var numberRegex = /[\d]/; -- var wordRegexp = [(/\w/), (/[^\w\s]/)], bigWordRegexp = [(/\S/)]; -+ var wordCharTest = [CodeMirror.isWordChar, function(ch) { -+ return ch && !CodeMirror.isWordChar(ch) && !/\s/.test(ch); -+ }], bigWordCharTest = [function(ch) { -+ return /\S/.test(ch); -+ }]; - function makeKeyRange(start, size) { - var keys = []; - for (var i = start; i < start + size; i++) { -@@ -378,18 +385,30 @@ - } - - var options = {}; -- function defineOption(name, defaultValue, type) { -- if (defaultValue === undefined) { throw Error('defaultValue is required'); } -+ function defineOption(name, defaultValue, type, aliases, callback) { -+ if (defaultValue === undefined && !callback) { -+ throw Error('defaultValue is required unless callback is provided'); -+ } - if (!type) { type = 'string'; } - options[name] = { - type: type, -- defaultValue: defaultValue -+ defaultValue: defaultValue, -+ callback: callback - }; -- setOption(name, defaultValue); -+ if (aliases) { -+ for (var i = 0; i < aliases.length; i++) { -+ options[aliases[i]] = options[name]; -+ } -+ } -+ if (defaultValue) { -+ setOption(name, defaultValue); -+ } - } - -- function setOption(name, value) { -+ function setOption(name, value, cm, cfg) { - var option = options[name]; -+ cfg = cfg || {}; -+ var scope = cfg.scope; - if (!option) { - throw Error('Unknown option: ' + name); - } -@@ -401,17 +420,60 @@ - value = true; - } - } -- option.value = option.type == 'boolean' ? !!value : value; -+ if (option.callback) { -+ if (scope !== 'local') { -+ option.callback(value, undefined); -+ } -+ if (scope !== 'global' && cm) { -+ option.callback(value, cm); -+ } -+ } else { -+ if (scope !== 'local') { -+ option.value = option.type == 'boolean' ? !!value : value; -+ } -+ if (scope !== 'global' && cm) { -+ cm.state.vim.options[name] = {value: value}; -+ } -+ } - } - -- function getOption(name) { -+ function getOption(name, cm, cfg) { - var option = options[name]; -+ cfg = cfg || {}; -+ var scope = cfg.scope; - if (!option) { - throw Error('Unknown option: ' + name); - } -- return option.value; -+ if (option.callback) { -+ var local = cm && option.callback(undefined, cm); -+ if (scope !== 'global' && local !== undefined) { -+ return local; -+ } -+ if (scope !== 'local') { -+ return option.callback(); -+ } -+ return; -+ } else { -+ var local = (scope !== 'global') && (cm && cm.state.vim.options[name]); -+ return (local || (scope !== 'local') && option || {}).value; -+ } - } - -+ defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) { -+ // Option is local. Do nothing for global. -+ if (cm === undefined) { -+ return; -+ } -+ // The 'filetype' option proxies to the CodeMirror 'mode' option. -+ if (name === undefined) { -+ var mode = cm.getOption('mode'); -+ return mode == 'null' ? '' : mode; -+ } else { -+ var mode = name == '' ? 'null' : name; -+ cm.setOption('mode', mode); -+ } -+ }); -+ - var createCircularJumpList = function() { - var size = 100; - var pointer = -1; -@@ -564,8 +626,9 @@ - visualBlock: false, - lastSelection: null, - lastPastedText: null, -- sel: { -- } -+ sel: {}, -+ // Buffer-local/window-local values of vim options. -+ options: {} - }; - } - return cm.state.vim; -@@ -623,11 +686,15 @@ - // Add user defined key bindings. - exCommandDispatcher.map(lhs, rhs, ctx); - }, -+ // TODO: Expose setOption and getOption as instance methods. Need to decide how to namespace -+ // them, or somehow make them work with the existing CodeMirror setOption/getOption API. - setOption: setOption, - getOption: getOption, - defineOption: defineOption, - defineEx: function(name, prefix, func){ -- if (name.indexOf(prefix) !== 0) { -+ if (!prefix) { -+ prefix = name; -+ } else if (name.indexOf(prefix) !== 0) { - throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered'); - } - exCommands[name]=func; -@@ -1035,12 +1102,10 @@ - break; - case 'search': - this.processSearch(cm, vim, command); -- clearInputState(cm); - break; - case 'ex': - case 'keyToEx': - this.processEx(cm, vim, command); -- clearInputState(cm); - break; - default: - break; -@@ -1133,6 +1198,7 @@ - updateSearchQuery(cm, query, ignoreCase, smartCase); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + query); -+ clearInputState(cm); - return; - } - commandDispatcher.processMotion(cm, vim, { -@@ -1175,15 +1241,21 @@ - } - function onPromptKeyDown(e, query, close) { - var keyName = CodeMirror.keyName(e); -- if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { -+ if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || -+ (keyName == 'Backspace' && query == '')) { - vimGlobalState.searchHistoryController.pushInput(query); - vimGlobalState.searchHistoryController.reset(); - updateSearchQuery(cm, originalQuery); - clearSearchHighlight(cm); - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - CodeMirror.e_stop(e); -+ clearInputState(cm); - close(); - cm.focus(); -+ } else if (keyName == 'Ctrl-U') { -+ // Ctrl-U clears input. -+ CodeMirror.e_stop(e); -+ close(''); - } - } - switch (command.searchArgs.querySrc) { -@@ -1244,10 +1316,12 @@ - } - function onPromptKeyDown(e, input, close) { - var keyName = CodeMirror.keyName(e), up; -- if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { -+ if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || -+ (keyName == 'Backspace' && input == '')) { - vimGlobalState.exCommandHistoryController.pushInput(input); - vimGlobalState.exCommandHistoryController.reset(); - CodeMirror.e_stop(e); -+ clearInputState(cm); - close(); - cm.focus(); - } -@@ -1255,6 +1329,10 @@ - up = keyName == 'Up' ? true : false; - input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || ''; - close(input); -+ } else if (keyName == 'Ctrl-U') { -+ // Ctrl-U clears input. -+ CodeMirror.e_stop(e); -+ close(''); - } else { - if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') - vimGlobalState.exCommandHistoryController.reset(); -@@ -1284,8 +1362,8 @@ - var registerName = inputState.registerName; - var sel = vim.sel; - // TODO: Make sure cm and vim selections are identical outside visual mode. -- var origHead = copyCursor(vim.visualMode ? sel.head: cm.getCursor('head')); -- var origAnchor = copyCursor(vim.visualMode ? sel.anchor : cm.getCursor('anchor')); -+ var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head): cm.getCursor('head')); -+ var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor')); - var oldHead = copyCursor(origHead); - var oldAnchor = copyCursor(origAnchor); - var newHead, newAnchor; -@@ -1851,10 +1929,11 @@ - var anchor = ranges[0].anchor, - head = ranges[0].head; - text = cm.getRange(anchor, head); -- if (!isWhiteSpaceString(text)) { -+ var lastState = vim.lastEditInputState || {}; -+ if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) { - // Exclude trailing whitespace if the range is not all whitespace. - var match = (/\s+$/).exec(text); -- if (match) { -+ if (match && lastState.motionArgs && lastState.motionArgs.forward) { - head = offsetCursor(head, 0, - match[0].length); - text = text.slice(0, - match[0].length); - } -@@ -2628,9 +2707,6 @@ - function lineLength(cm, lineNum) { - return cm.getLine(lineNum).length; - } -- function reverse(s){ -- return s.split('').reverse().join(''); -- } - function trim(s) { - if (s.trim) { - return s.trim(); -@@ -2944,59 +3020,38 @@ - - // Seek to first word or non-whitespace character, depending on if - // noSymbol is true. -- var textAfterIdx = line.substring(idx); -- var firstMatchedChar; -- if (noSymbol) { -- firstMatchedChar = textAfterIdx.search(/\w/); -- } else { -- firstMatchedChar = textAfterIdx.search(/\S/); -+ var test = noSymbol ? wordCharTest[0] : bigWordCharTest [0]; -+ while (!test(line.charAt(idx))) { -+ idx++; -+ if (idx >= line.length) { return null; } - } -- if (firstMatchedChar == -1) { -- return null; -- } -- idx += firstMatchedChar; -- textAfterIdx = line.substring(idx); -- var textBeforeIdx = line.substring(0, idx); - -- var matchRegex; -- // Greedy matchers for the "word" we are trying to expand. - if (bigWord) { -- matchRegex = /^\S+/; -+ test = bigWordCharTest[0]; - } else { -- if ((/\w/).test(line.charAt(idx))) { -- matchRegex = /^\w+/; -- } else { -- matchRegex = /^[^\w\s]+/; -+ test = wordCharTest[0]; -+ if (!test(line.charAt(idx))) { -+ test = wordCharTest[1]; - } - } - -- var wordAfterRegex = matchRegex.exec(textAfterIdx); -- var wordStart = idx; -- var wordEnd = idx + wordAfterRegex[0].length; -- // TODO: Find a better way to do this. It will be slow on very long lines. -- var revTextBeforeIdx = reverse(textBeforeIdx); -- var wordBeforeRegex = matchRegex.exec(revTextBeforeIdx); -- if (wordBeforeRegex) { -- wordStart -= wordBeforeRegex[0].length; -- } -+ var end = idx, start = idx; -+ while (test(line.charAt(end)) && end < line.length) { end++; } -+ while (test(line.charAt(start)) && start >= 0) { start--; } -+ start++; - - if (inclusive) { -- // If present, trim all whitespace after word. -- // Otherwise, trim all whitespace before word. -- var textAfterWordEnd = line.substring(wordEnd); -- var whitespacesAfterWord = textAfterWordEnd.match(/^\s*/)[0].length; -- if (whitespacesAfterWord > 0) { -- wordEnd += whitespacesAfterWord; -- } else { -- var revTrim = revTextBeforeIdx.length - wordStart; -- var textBeforeWordStart = revTextBeforeIdx.substring(revTrim); -- var whitespacesBeforeWord = textBeforeWordStart.match(/^\s*/)[0].length; -- wordStart -= whitespacesBeforeWord; -+ // If present, include all whitespace after word. -+ // Otherwise, include all whitespace before word, except indentation. -+ var wordEnd = end; -+ while (/\s/.test(line.charAt(end)) && end < line.length) { end++; } -+ if (wordEnd == end) { -+ var wordStart = start; -+ while (/\s/.test(line.charAt(start - 1)) && start > 0) { start--; } -+ if (!start) { start = wordStart; } - } - } -- -- return { start: Pos(cur.line, wordStart), -- end: Pos(cur.line, wordEnd) }; -+ return { start: Pos(cur.line, start), end: Pos(cur.line, end) }; - } - - function recordJumpPosition(cm, oldCur, newCur) { -@@ -3154,7 +3209,7 @@ - var pos = cur.ch; - var line = cm.getLine(lineNum); - var dir = forward ? 1 : -1; -- var regexps = bigWord ? bigWordRegexp : wordRegexp; -+ var charTests = bigWord ? bigWordCharTest: wordCharTest; - - if (emptyLineIsWord && line == '') { - lineNum += dir; -@@ -3174,11 +3229,11 @@ - // Find bounds of next word. - while (pos != stop) { - var foundWord = false; -- for (var i = 0; i < regexps.length && !foundWord; ++i) { -- if (regexps[i].test(line.charAt(pos))) { -+ for (var i = 0; i < charTests.length && !foundWord; ++i) { -+ if (charTests[i](line.charAt(pos))) { - wordStart = pos; - // Advance to end of word. -- while (pos != stop && regexps[i].test(line.charAt(pos))) { -+ while (pos != stop && charTests[i](line.charAt(pos))) { - pos += dir; - } - wordEnd = pos; -@@ -3510,7 +3565,8 @@ - function dialog(cm, template, shortText, onClose, options) { - if (cm.openDialog) { - cm.openDialog(template, onClose, { bottom: true, value: options.value, -- onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp }); -+ onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp, -+ selectValueOnOpen: false}); - } - else { - onClose(prompt(shortText, '')); -@@ -3584,13 +3640,17 @@ - // Translates the replace part of a search and replace from ex (vim) syntax into - // javascript form. Similar to translateRegex, but additionally fixes back references - // (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'. -+ var charUnescapes = {'\\n': '\n', '\\r': '\r', '\\t': '\t'}; - function translateRegexReplace(str) { - var escapeNextChar = false; - var out = []; - for (var i = -1; i < str.length; i++) { - var c = str.charAt(i) || ''; - var n = str.charAt(i+1) || ''; -- if (escapeNextChar) { -+ if (charUnescapes[c + n]) { -+ out.push(charUnescapes[c+n]); -+ i++; -+ } else if (escapeNextChar) { - // At any point in the loop, escapeNextChar is true if the previous - // character was a '\' and was not escaped. - out.push(c); -@@ -3618,6 +3678,7 @@ - } - - // Unescape \ and / in the replace part, for PCRE mode. -+ var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t'}; - function unescapeRegexReplace(str) { - var stream = new CodeMirror.StringStream(str); - var output = []; -@@ -3626,13 +3687,15 @@ - while (stream.peek() && stream.peek() != '\\') { - output.push(stream.next()); - } -- if (stream.match('\\/', true)) { -- // \/ => / -- output.push('/'); -- } else if (stream.match('\\\\', true)) { -- // \\ => \ -- output.push('\\'); -- } else { -+ var matched = false; -+ for (var matcher in unescapes) { -+ if (stream.match(matcher, true)) { -+ matched = true; -+ output.push(unescapes[matcher]); -+ break; -+ } -+ } -+ if (!matched) { - // Don't change anything - output.push(stream.next()); - } -@@ -3862,32 +3925,18 @@ - return {top: from.line, bottom: to.line}; - } - -- // Ex command handling -- // Care must be taken when adding to the default Ex command map. For any -- // pair of commands that have a shared prefix, at least one of their -- // shortNames must not match the prefix of the other command. -- var defaultExCommandMap = [ -- { 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: 'set' }, -- { name: 'sort', shortName: 'sor' }, -- { name: 'substitute', shortName: 's', possiblyAsync: true }, -- { name: 'nohlsearch', shortName: 'noh' }, -- { name: 'delmarks', shortName: 'delm' }, -- { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, -- { name: 'global', shortName: 'g' } -- ]; - var ExCommandDispatcher = function() { - this.buildCommandMap_(); - }; - ExCommandDispatcher.prototype = { - processCommand: function(cm, input, opt_params) { -+ var that = this; -+ cm.operation(function () { -+ cm.curOp.isVimOp = true; -+ that._processCommand(cm, input, opt_params); -+ }); -+ }, -+ _processCommand: function(cm, input, opt_params) { - var vim = cm.state.vim; - var commandHistoryRegister = vimGlobalState.registerController.getRegister(':'); - var previousCommand = commandHistoryRegister.toString(); -@@ -4100,6 +4149,13 @@ - }; - - var exCommands = { -+ colorscheme: function(cm, params) { -+ if (!params.args || params.args.length < 1) { -+ showConfirm(cm, cm.getOption('theme')); -+ return; -+ } -+ cm.setOption('theme', params.args[0]); -+ }, - map: function(cm, params, ctx) { - var mapArgs = params.args; - if (!mapArgs || mapArgs.length < 2) { -@@ -4133,6 +4189,9 @@ - }, - set: function(cm, params) { - var setArgs = params.args; -+ // Options passed through to the setOption/getOption calls. May be passed in by the -+ // local/global versions of the set command -+ var setCfg = params.setCfg || {}; - if (!setArgs || setArgs.length < 1) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); -@@ -4156,24 +4215,35 @@ - optionName = optionName.substring(2); - value = false; - } -+ - var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean'; - if (optionIsBoolean && value == undefined) { - // Calling set with a boolean option sets it to true. - value = true; - } -- if (!optionIsBoolean && !value || forceGet) { -- var oldValue = getOption(optionName); -- // If no value is provided, then we assume this is a get. -+ // If no value is provided, then we assume this is a get. -+ if (!optionIsBoolean && value === undefined || forceGet) { -+ var oldValue = getOption(optionName, cm, setCfg); - if (oldValue === true || oldValue === false) { - showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName); - } else { - showConfirm(cm, ' ' + optionName + '=' + oldValue); - } - } else { -- setOption(optionName, value); -+ setOption(optionName, value, cm, setCfg); - } - }, -- registers: function(cm,params) { -+ setlocal: function (cm, params) { -+ // setCfg is passed through to setOption -+ params.setCfg = {scope: 'local'}; -+ this.set(cm, params); -+ }, -+ setglobal: function (cm, params) { -+ // setCfg is passed through to setOption -+ params.setCfg = {scope: 'global'}; -+ this.set(cm, params); -+ }, -+ registers: function(cm, params) { - var regArgs = params.args; - var registers = vimGlobalState.registerController.registers; - var regInfo = '----------Registers----------

    '; -@@ -4400,6 +4470,9 @@ - var query = state.getQuery(); - var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line; - var lineEnd = params.lineEnd || lineStart; -+ if (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) { -+ lineEnd = Infinity; -+ } - if (count) { - lineStart = lineEnd; - lineEnd = lineStart + count - 1; -@@ -4518,10 +4591,9 @@ - searchCursor.replace(newText); - } - function next() { -- var found; - // The below only loops to skip over multiple occurrences on the same - // line when 'global' is not true. -- while(found = searchCursor.findNext() && -+ while(searchCursor.findNext() && - isInRange(searchCursor.from(), lineStart, lineEnd)) { - if (!global && lastPos && searchCursor.from().line == lastPos.line) { - continue; -@@ -4696,6 +4768,14 @@ - - function executeMacroRegister(cm, vim, macroModeState, registerName) { - var register = vimGlobalState.registerController.getRegister(registerName); -+ if (registerName == ':') { -+ // Read-only register containing last Ex command. -+ if (register.keyBuffer[0]) { -+ exCommandDispatcher.processCommand(cm, register.keyBuffer[0]); -+ } -+ macroModeState.isPlaying = false; -+ return; -+ } - var keyBuffer = register.keyBuffer; - var imc = 0; - macroModeState.isPlaying = true; -@@ -4795,7 +4875,7 @@ - } - function updateFakeCursor(cm) { - var vim = cm.state.vim; -- var from = copyCursor(vim.sel.head); -+ var from = clipCursorToContent(cm, copyCursor(vim.sel.head)); - var to = offsetCursor(from, 0, 1); - if (vim.fakeCursor) { - vim.fakeCursor.clear(); -@@ -4806,7 +4886,7 @@ - var anchor = cm.getCursor('anchor'); - var head = cm.getCursor('head'); - // Enter or exit visual mode to match mouse selection. -- if (vim.visualMode && cursorEqual(head, anchor) && lineLength(cm, head.line) > head.ch) { -+ if (vim.visualMode && !cm.somethingSelected()) { - exitVisualMode(cm, false); - } else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) { - vim.visualMode = true; -diff --git a/media/editors/codemirror/keymap/vim.min.js b/media/editors/codemirror/keymap/vim.min.js -index ce38ea7..17b9160 100644 ---- a/media/editors/codemirror/keymap/vim.min.js -+++ b/media/editors/codemirror/keymap/vim.min.js -@@ -1,3 +1,3 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(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"],e):e(CodeMirror)}(function(e){"use strict";var t=[{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:"xi",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",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:"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:"moveToEol",motionArgs:{inclusive:!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:"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:"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"}],r=e.Pos,n=function(){function n(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",Xt),x(t),e.on(t.getInputField(),"paste",c(t))}function o(t){t.setOption("disableInput",!1),t.off("cursorActivity",Xt),e.off(t.getInputField(),"paste",c(t)),t.state.vim=null}function i(t,r){this==e.keyMap.vim&&e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),r&&r.attach==a||o(t,!1)}function a(t,r){this==e.keyMap.vim&&e.addClass(t.getWrapperElement(),"cm-fat-cursor"),r&&r.attach==a||n(t)}function s(t,r){if(!r)return void 0;var n=l(t);if(!n)return!1;var o=e.Vim.findKey(r,n);return"function"==typeof o&&e.signal(r,"vim-keypress",n),o}function l(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split("-");/-$/.test(e)&&t.splice(-2,2,"-");var r=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==r.length)return!1;for(var n=!1,o=0;o"):!1}function c(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(P(e.getCursor(),0,1)),Ar.enterInsertMode(e,{},t))}),t.onPasteFn}function u(e,t){for(var r=[],n=e;e+t>n;n++)r.push(String.fromCharCode(n));return r}function h(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function p(e){return/^[a-z]$/.test(e)}function d(e){return-1!="()[]{}".indexOf(e)}function f(e){return lr.test(e)}function m(e){return/^[A-Z]$/.test(e)}function g(e){return/^\s*$/.test(e)}function v(e,t){for(var r=0;rn;n++)r.push(e);return r}function B(e,t){Sr[e]=t}function I(e,t){Ar[e]=t}function O(e,t,n){var o=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),i=q(e,o)-1;i=n?i+1:i;var a=Math.min(Math.max(0,t.ch),i);return r(o,a)}function K(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function P(e,t,n){return"object"==typeof t&&(n=t.ch,t=t.line),r(e.line+t,e.ch+n)}function N(e,t){return{line:t.line-e.line,ch:t.line-e.line}}function j(e,t,r,n){for(var o,i=[],a=[],s=0;s"==t.slice(-11)){var r=t.length-11,n=e.slice(0,r),o=t.slice(0,r);return n==o&&e.length>r?"full":0==o.indexOf(n)?"partial":!1}return e==t?"full":0==t.indexOf(e)?"partial":!1}function F(e){var t=/^.*(<[\w\-]+>)$/.exec(e),r=t?t[1]:e.slice(-1);if(r.length>1)switch(r){case"":r="\n";break;case"":r=" "}return r}function D(e,t,r){return function(){for(var n=0;r>n;n++)t(e)}}function W(e){return r(e.line,e.ch)}function V(e,t){return e.ch==t.ch&&e.line==t.line}function _(e,t){return e.line2&&(t=J.apply(void 0,Array.prototype.slice.call(arguments,1))),_(e,t)?e:t}function U(e,t){return arguments.length>2&&(t=U.apply(void 0,Array.prototype.slice.call(arguments,1))),_(e,t)?t:e}function $(e,t,r){var n=_(e,t),o=_(t,r);return n&&o}function q(e,t){return e.getLine(t).length}function Q(e){return e.split("").reverse().join("")}function z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Z(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function G(e,t,n){var o=q(e,t),i=new Array(n-o+1).join(" ");e.setCursor(r(t,o)),e.replaceRange(i,e.getCursor())}function Y(e,t){var n=[],o=e.listSelections(),i=W(e.clipPos(t)),a=!V(t,i),s=e.getCursor("head"),l=et(o,s),c=V(o[l].head,o[l].anchor),u=o.length-1,h=u-l>l?u:0,p=o[h].anchor,d=Math.min(p.line,i.line),f=Math.max(p.line,i.line),m=p.ch,g=i.ch,v=o[h].head.ch-m,y=g-m;v>0&&0>=y?(m++,a||g--):0>v&&y>=0?(m--,c||g++):0>v&&-1==y&&(m--,g++);for(var k=d;f>=k;k++){var C={anchor:new r(k,m),head:new r(k,g)};n.push(C)}return l=i.line==f?n.length-1:0,e.setSelections(n),t.ch=g,p.ch=m,p}function X(e,t,r){for(var n=[],o=0;r>o;o++){var i=P(t,o,0);n.push({anchor:i,head:i})}e.setSelections(n,0)}function et(e,t,r){for(var n=0;nc&&(i.line=c),i.ch=q(e,i.line)}return{ranges:[{anchor:a,head:i}],primary:0}}if("block"==n){for(var u=Math.min(a.line,i.line),h=Math.min(a.ch,i.ch),p=Math.max(a.line,i.line),d=Math.max(a.ch,i.ch)+1,f=p-u+1,m=i.line==u?0:f-1,g=[],v=0;f>v;v++)g.push({anchor:r(u+v,h),head:r(u+v,d)});return{ranges:g,primary:m}}}function at(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=J(t,e.getCursor("anchor"))),t}function st(t,r){var n=t.state.vim;r!==!1&&t.setCursor(O(t,n.sel.head)),rt(t,n),n.visualMode=!1,n.visualLine=!1,n.visualBlock=!1,e.signal(t,"vim-mode-change",{mode:"normal"}),n.fakeCursor&&n.fakeCursor.clear()}function lt(e,t,r){var n=e.getRange(t,r);if(/\n\s*$/.test(n)){var o=n.split("\n");o.pop();for(var i,i=o.pop();o.length>0&&i&&g(i);i=o.pop())r.line--,r.ch=0;i?(r.line--,r.ch=q(e,r.line)):r.ch=0}}function ct(e,t,r){t.ch=0,r.ch=0,r.line++}function ut(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function ht(e,t,n,o,i){var a,s=at(e),l=e.getLine(s.line),c=s.ch,u=l.substring(c);if(a=u.search(i?/\w/:/\S/),-1==a)return null;c+=a,u=l.substring(c);var h,p=l.substring(0,c);h=o?/^\S+/:/\w/.test(l.charAt(c))?/^\w+/:/^[^\w\s]+/;var d=h.exec(u),f=c,m=c+d[0].length,g=Q(p),v=h.exec(g);if(v&&(f-=v[0].length),t){var y=l.substring(m),k=y.match(/^\s*/)[0].length;if(k>0)m+=k;else{var C=g.length-f,w=g.substring(C),x=w.match(/^\s*/)[0].length;f-=x}}return{start:r(s.line,f),end:r(s.line,m)}}function pt(e,t,r){V(t,r)||kr.jumpList.add(e,t,r)}function dt(e,t){kr.lastChararacterSearch.increment=e,kr.lastChararacterSearch.forward=t.forward,kr.lastChararacterSearch.selectedCharacter=t.selectedCharacter}function ft(e,t,n,o){var i=W(e.getCursor()),a=n?1:-1,s=n?e.lineCount():-1,l=i.ch,c=i.line,u=e.getLine(c),h={lineText:u,nextCh:u.charAt(l),lastCh:null,index:l,symb:o,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[o],forward:n,depth:0,curMoveThrough:!1},p=br[o];if(!p)return i;var d=Lr[p].init,f=Lr[p].isComplete;for(d&&d(h);c!==s&&t;){if(h.index+=a,h.nextCh=h.lineText.charAt(h.index),!h.nextCh){if(c+=a,h.lineText=e.getLine(c)||"",a>0)h.index=0;else{var m=h.lineText.length;h.index=m>0?m-1:0}h.nextCh=h.lineText.charAt(h.index)}f(h)&&(i.line=c,i.ch=h.index,t--)}return h.nextCh||h.curMoveThrough?r(c,h.index):i}function mt(e,t,r,n,o){var i=t.line,a=t.ch,s=e.getLine(i),l=r?1:-1,c=n?ur:cr;if(o&&""==s){if(i+=l,s=e.getLine(i),!h(e,i))return null;a=r?0:s.length}for(;;){if(o&&""==s)return{from:0,to:0,line:i};for(var u=l>0?s.length:-1,p=u,d=u;a!=u;){for(var f=!1,m=0;m0?0:s.length}throw new Error("The impossible happened.")}function gt(e,t,n,o,i,a){var s=W(t),l=[];(o&&!i||!o&&i)&&n++;for(var c=!(o&&i),u=0;n>u;u++){var h=mt(e,t,o,a,c);if(!h){var p=q(e,e.lastLine());l.push(o?{line:e.lastLine(),from:p,to:p}:{line:0,from:0,to:0});break}l.push(h),t=r(h.line,o?h.to-1:h.from)}var d=l.length!=n,f=l[0],m=l.pop();return o&&!i?(d||f.from==s.ch&&f.line==s.line||(m=l.pop()),r(m.line,m.from)):o&&i?r(m.line,m.to-1):!o&&i?(d||f.to==s.ch&&f.line==s.line||(m=l.pop()),r(m.line,m.to)):r(m.line,m.from)}function vt(e,t,n,o){for(var i,a=e.getCursor(),s=a.ch,l=0;t>l;l++){var c=e.getLine(a.line);if(i=Ct(s,c,o,n,!0),-1==i)return null;s=i}return r(e.getCursor().line,i)}function yt(e,t){var n=e.getCursor().line;return O(e,r(n,t-1))}function kt(e,t,r,n){v(r,fr)&&(t.marks[r]&&t.marks[r].clear(),t.marks[r]=e.setBookmark(n))}function Ct(e,t,r,n,o){var i;return n?(i=t.indexOf(r,e+1),-1==i||o||(i-=1)):(i=t.lastIndexOf(r,e-1),-1==i||o||(i+=1)),i}function wt(e,t,n,o,i){function a(t){return!e.getLine(t)}function s(e,t,r){return r?a(e)!=a(e+t):!a(e)&&a(e+t)}var l,c,u=t.line,h=e.firstLine(),p=e.lastLine(),d=u;if(o){for(;d>=h&&p>=d&&n>0;)s(d,o)&&n--,d+=o;return new r(d,0)}var f=e.state.vim;if(f.visualLine&&s(u,1,!0)){var m=f.sel.anchor;s(m.line,-1,!0)&&(i&&m.line==u||(u+=1))}var g=a(u);for(d=u;p>=d&&n;d++)s(d,1,!0)&&(i&&a(d)==g||n--);for(c=new r(d,0),d>p&&!g?g=!0:i=!1,d=u;d>h&&(i&&a(d)!=g&&d!=u||!s(d,-1,!0));d--);return l=new r(d,0),{start:l,end:c}}function xt(e,t,n,o){var i,a,s=t,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],c={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],u=e.getLine(s.line).charAt(s.ch),h=u===c?1:0;if(i=e.scanForBracket(r(s.line,s.ch+h),-1,null,{bracketRegex:l}),a=e.scanForBracket(r(s.line,s.ch+h),1,null,{bracketRegex:l}),!i||!a)return{start:s,end:s};if(i=i.pos,a=a.pos,i.line==a.line&&i.ch>a.ch||i.line>a.line){var p=i;i=a,a=p}return o?a.ch+=1:i.ch+=1,{start:i,end:a}}function Mt(e,t,n,o){var i,a,s,l,c=W(t),u=e.getLine(c.line),h=u.split(""),p=h.indexOf(n);if(c.ch-1&&!i;s--)h[s]==n&&(i=s+1);else i=c.ch+1;if(i&&!a)for(s=i,l=h.length;l>s&&!a;s++)h[s]==n&&(a=s);return i&&a?(o&&(--i,++a),{start:r(c.line,i),end:r(c.line,a)}):{start:c,end:c}}function St(){}function At(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new St)}function bt(e,t,r,n,o){e.openDialog?e.openDialog(t,n,{bottom:!0,value:o.value,onKeyDown:o.onKeyDown,onKeyUp:o.onKeyUp}):n(prompt(r,""))}function Lt(e){var t=Tt(e)||[];if(!t.length)return[];var r=[];if(0===t[0]){for(var n=0;n'+t+"
    ",{bottom:!0,duration:5e3}):alert(t)}function Kt(e,t){var r="";return e&&(r+=''+e+""),r+=' ',t&&(r+='',r+=t,r+=""),r}function Pt(e,t){var r=(t.prefix||"")+" "+(t.desc||""),n=Kt(t.prefix,t.desc);bt(e,n,r,t.onClose,t)}function Nt(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var r=["global","multiline","ignoreCase","source"],n=0;ns;s++){var l=a.find(t);if(0==s&&l&&V(a.from(),i)&&(l=a.find(t)),!l&&(a=e.getSearchCursor(n,t?r(e.lastLine()):r(e.firstLine(),0)),!a.find(t)))return}return a.from()})}function Wt(e){var t=At(e);e.removeOverlay(At(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Vt(e,t,r){return"number"!=typeof e&&(e=e.line),t instanceof Array?v(e,t):r?e>=t&&r>=e:e==t}function _t(e){var t=e.getScrollInfo(),r=6,n=10,o=e.coordsChar({left:0,top:r+t.top},"local"),i=t.clientHeight-n+t.top,a=e.coordsChar({left:0,top:i},"local");return{top:o.line,bottom:a.line}}function Jt(t,r,n,o,i,a,s,l,c){function u(){t.operation(function(){for(;!m;)h(),p();d()})}function h(){var e=t.getRange(a.from(),a.to()),r=e.replace(s,l);a.replace(r)}function p(){for(var e;e=a.findNext()&&Vt(a.from(),o,i);)if(n||!g||a.from().line!=g.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),g=a.from(),void(m=!1);m=!0}function d(e){if(e&&e(),t.focus(),g){t.setCursor(g);var r=t.state.vim;r.exMode=!1,r.lastHPos=r.lastHSPos=g.ch}c&&c()}function f(r,n,o){e.e_stop(r);var i=e.keyName(r);switch(i){case"Y":h(),p();break;case"N":p();break;case"A":var a=c;c=void 0,t.operation(u),c=a;break;case"L":h();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":d(o)}return m&&d(o),!0}t.state.vim.exMode=!0;var m=!1,g=a.from();return p(),m?void Ot(t,"No matches for "+s.source):r?void Pt(t,{prefix:"replace with "+l+" (y/n/a/q/l)",onKeyDown:f}):(u(),void(c&&c()))}function Ut(t){var r=t.state.vim,n=kr.macroModeState,o=kr.registerController.getRegister("."),i=n.isPlaying,a=n.lastInsertModeChanges,s=[];if(!i){for(var l=a.inVisualBlock?r.lastSelection.visualBlock.height:1,c=a.changes,s=[],u=0;u1&&(or(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),o.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),n.isRecording&&Zt(n)}function $t(e){t.push(e)}function qt(e,t,r,n,o){var i={keys:e,type:t};i[t]=r,i[t+"Args"]=n;for(var a in o)i[a]=o[a];$t(i)}function Qt(t,r,n,o){var i=kr.registerController.getRegister(o),a=i.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var l=0;l|<\w+>|./.exec(h),u=c[0],h=h.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"),r.insertMode){var p=i.insertModeChanges[s++].changes;kr.macroModeState.lastInsertModeChanges.changes=p,ir(t,p,1),Ut(t)}n.isPlaying=!1}function zt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=kr.registerController.getRegister(r);n&&n.pushText(t)}}function Zt(e){if(!e.isPlaying){var t=e.latestRegister,r=kr.registerController.getRegister(t);r&&r.pushInsertModeChanges(e.lastInsertModeChanges)}}function Gt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=kr.registerController.getRegister(r);n&&n.pushSearchQuery(t)}}function Yt(e,t){var r=kr.macroModeState,n=r.lastInsertModeChanges;if(!r.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var o=t.text.join("\n");n.changes.push(o)}t=t.next}}function Xt(e){var t=e.state.vim;if(t.insertMode){var r=kr.macroModeState;if(r.isPlaying)return;var n=r.lastInsertModeChanges;n.expectCursorActivityForChange?n.expectCursorActivityForChange=!1:n.changes=[]}else e.curOp.isVimOp||tr(e,t);t.visualMode&&er(e)}function er(e){var t=e.state.vim,r=W(t.sel.head),n=P(r,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(r,n,{className:"cm-animate-fat-cursor"})}function tr(t,r){var n=t.getCursor("anchor"),o=t.getCursor("head");if(r.visualMode&&V(o,n)&&q(t,o.line)>o.ch?st(t,!1):r.visualMode||r.insertMode||!t.somethingSelected()||(r.visualMode=!0,r.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"})),r.visualMode){var i=_(o,n)?0:-1,a=_(o,n)?-1:0; --o=P(o,0,i),n=P(n,0,a),r.sel={anchor:n,head:o},kt(t,r,"<",J(o,n)),kt(t,r,">",U(o,n))}else r.insertMode||(r.lastHPos=t.getCursor().ch)}function rr(e){this.keyName=e}function nr(t){function r(){return o.changes.push(new rr(i)),!0}var n=kr.macroModeState,o=n.lastInsertModeChanges,i=e.keyName(t);i&&(-1!=i.indexOf("Delete")||-1!=i.indexOf("Backspace"))&&e.lookupKey(i,"vim-insert",r)}function or(e,t,r,n){function o(){s?xr.processAction(e,t,t.lastEditActionCommand):xr.evalInput(e,t)}function i(r){if(a.lastInsertModeChanges.changes.length>0){r=t.lastEditActionCommand?r:1;var n=a.lastInsertModeChanges;ir(e,n.changes,r)}}var a=kr.macroModeState;a.isPlaying=!0;var s=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;r>c;c++)o(),i(1);else n||o(),i(r);t.inputState=l,t.insertMode&&!n&&Ut(e),a.isPlaying=!1}function ir(t,r,n){function o(r){return"string"==typeof r?e.commands[r](t):r(t),!0}var i=t.getCursor("head"),a=kr.macroModeState.lastInsertModeChanges.inVisualBlock;if(a){var s=t.state.vim,l=s.lastSelection,c=N(l.anchor,l.head);X(t,i,c.line+1),n=t.listSelections().length,t.setCursor(i)}for(var u=0;n>u;u++){a&&t.setCursor(P(i,u,0));for(var h=0;h"]),mr=[].concat(hr,pr,dr,["-",'"',".",":","/"]),gr={},vr=function(){function e(e,t,s){function l(t){var o=++n%r,i=a[o];i&&i.clear(),a[o]=e.setBookmark(t)}var c=n%r,u=a[c];if(u){var h=u.find();h&&!V(h,t)&&l(t)}else l(t);l(s),o=n,i=n-r+1,0>i&&(i=0)}function t(e,t){n+=t,n>o?n=o:i>n&&(n=i);var s=a[(r+n)%r];if(s&&!s.find()){var l,c=t>0?1:-1,u=e.getCursor();do if(n+=c,s=a[(r+n)%r],s&&(l=s.find())&&!V(u,l))break;while(o>n&&n>i)}return s}var r=100,n=-1,o=0,i=0,a=new Array(r);return{cachedCursor:void 0,add:e,move:t}},yr=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var e=kr.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var r=kr.registerController.getRegister(t);r&&(r.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var kr,Cr,wr={buildKeyMap:function(){},getRegisterController:function(){return kr.registerController},resetVimGlobalState_:M,getVimGlobalState_:function(){return kr},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:rr,map:function(e,t,r){Ir.map(e,t,r)},setOption:k,getOption:C,defineOption:y,defineEx:function(e,t,r){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered');Br[e]=r,Ir.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,r){var n=this.findKey(e,t,r);return"function"==typeof n?n():void 0},findKey:function(r,n,o){function i(){var e=kr.macroModeState;if(e.isRecording){if("q"==n)return e.exitMacroRecordMode(),A(r),!0;"mapping"!=o&&zt(e,n)}}function a(){return""==n?(A(r),h.visualMode?st(r):h.insertMode&&Ut(r),!0):void 0}function s(t){for(var o;t;)o=/<\w+-.+?>|<\w+>|./.exec(t),n=o[0],t=t.substring(o.index+n.length),e.Vim.handleKey(r,n,"mapping")}function l(){if(a())return!0;for(var e=h.inputState.keyBuffer=h.inputState.keyBuffer+n,o=1==n.length,i=xr.matchCommand(e,t,h.inputState,"insert");e.length>1&&"full"!=i.type;){var e=h.inputState.keyBuffer=e.slice(1),s=xr.matchCommand(e,t,h.inputState,"insert");"none"!=s.type&&(i=s)}if("none"==i.type)return A(r),!1;if("partial"==i.type)return Cr&&window.clearTimeout(Cr),Cr=window.setTimeout(function(){h.insertMode&&h.inputState.keyBuffer&&A(r)},C("insertModeEscKeysTimeout")),!o;if(Cr&&window.clearTimeout(Cr),o){var l=r.getCursor();r.replaceRange("",P(l,0,-(e.length-1)),l,"+input")}return A(r),i.command}function c(){if(i()||a())return!0;var e=h.inputState.keyBuffer=h.inputState.keyBuffer+n;if(/^[1-9]\d*$/.test(e))return!0;var o=/^(\d*)(.*)$/.exec(e);if(!o)return A(r),!1;var s=h.visualMode?"visual":"normal",l=xr.matchCommand(o[2]||o[1],t,h.inputState,s);if("none"==l.type)return A(r),!1;if("partial"==l.type)return!0;h.inputState.keyBuffer="";var o=/^(\d*)(.*)$/.exec(e);return o[1]&&"0"!=o[1]&&h.inputState.pushRepeatDigit(o[1]),l.command}var u,h=x(r);return u=h.insertMode?l():c(),u===!1?void 0:u===!0?function(){}:function(){return r.operation(function(){r.curOp.isVimOp=!0;try{"keyToKey"==u.type?s(u.toKeys):xr.processCommand(r,h,u)}catch(t){throw r.state.vim=void 0,x(r),e.Vim.suppressErrorLogging||console.log(t),t}return!0})}},handleEx:function(e,t){Ir.processCommand(e,t)},defineMotion:R,defineAction:I,defineOperator:B,mapCommand:qt,_mapCommand:$t,exitVisualMode:st,exitInsertMode:Ut};S.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},S.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},b.prototype={setText:function(e,t,r){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!r},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(yr(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},L.prototype={pushText:function(e,t,r,n,o){n&&"\n"==r.charAt(0)&&(r=r.slice(1)+"\n"),n&&"\n"!==r.charAt(r.length-1)&&(r+="\n");var i=this.isValidRegister(e)?this.getRegister(e):null;if(!i){switch(t){case"yank":this.registers[0]=new b(r,n,o);break;case"delete":case"change":-1==r.indexOf("\n")?this.registers["-"]=new b(r,n):(this.shiftNumericRegisters_(),this.registers[1]=new b(r,n))}return void this.unnamedRegister.setText(r,n,o)}var a=m(e);a?i.pushText(r,n):i.setText(r,n,o),this.unnamedRegister.setText(i.toString(),n)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new b),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&v(e,mr)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},T.prototype={nextMatch:function(e,t){var r=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+n;t?o>=0:o=r.length?(this.iterator=r.length,this.initialPrefix):0>o?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var xr={matchCommand:function(e,t,r,n){var o=j(e,t,n,r);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var i,a=0;a"==i.keys.slice(-11)&&(r.selectedCharacter=F(e)),{type:"full",command:i}},processCommand:function(e,t,r){switch(t.inputState.repeatOverride=r.repeatOverride,r.type){case"motion":this.processMotion(e,t,r);break;case"operator":this.processOperator(e,t,r);break;case"operatorMotion":this.processOperatorMotion(e,t,r);break;case"action":this.processAction(e,t,r);break;case"search":this.processSearch(e,t,r),A(e);break;case"ex":case"keyToEx":this.processEx(e,t,r),A(e)}},processMotion:function(e,t,r){t.inputState.motion=r.motion,t.inputState.motionArgs=K(r.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,r){var n=t.inputState;if(n.operator){if(n.operator==r.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);A(e)}n.operator=r.operator,n.operatorArgs=K(r.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,r){var n=t.visualMode,o=K(r.operatorMotionArgs);o&&n&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,r),n||this.processMotion(e,t,r)},processAction:function(e,t,r){var n=t.inputState,o=n.getRepeat(),i=!!o,a=K(r.actionArgs)||{};n.selectedCharacter&&(a.selectedCharacter=n.selectedCharacter),r.operator&&this.processOperator(e,t,r),r.motion&&this.processMotion(e,t,r),(r.motion||r.operator)&&this.evalInput(e,t),a.repeat=o||1,a.repeatIsExplicit=i,a.registerName=n.registerName,A(e),t.lastMotion=null,r.isEdit&&this.recordLastEdit(t,n,r),Ar[r.action](e,a,t)},processSearch:function(t,r,n){function o(e,o,i){kr.searchHistoryController.pushInput(e),kr.searchHistoryController.reset();try{jt(t,e,o,i)}catch(a){return void Ot(t,"Invalid regex: "+e)}xr.processMotion(t,r,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}function i(e){t.scrollTo(p.left,p.top),o(e,!0,!0);var r=kr.macroModeState;r.isRecording&&Gt(r,e)}function a(r,n,o){var i,a=e.keyName(r);"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=kr.searchHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kr.searchHistoryController.reset();var s;try{s=jt(t,n,!0,!0)}catch(r){}s?t.scrollIntoView(Dt(t,!l,s),30):(Wt(t),t.scrollTo(p.left,p.top))}function s(r,n,o){var i=e.keyName(r);("Esc"==i||"Ctrl-C"==i||"Ctrl-["==i)&&(kr.searchHistoryController.pushInput(n),kr.searchHistoryController.reset(),jt(t,h),Wt(t),t.scrollTo(p.left,p.top),e.e_stop(r),o(),t.focus())}if(t.getSearchCursor){var l=n.searchArgs.forward,c=n.searchArgs.wholeWordOnly;At(t).setReversed(!l);var u=l?"/":"?",h=At(t).getQuery(),p=t.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var d=kr.macroModeState;if(d.isPlaying){var f=d.replaySearchQueries.shift();o(f,!0,!1)}else Pt(t,{onClose:i,prefix:u,desc:Tr,onKeyUp:a,onKeyDown:s});break;case"wordUnderCursor":var m=ht(t,!1,!0,!1,!0),g=!0;if(m||(m=ht(t,!1,!0,!1,!1),g=!1),!m)return;var f=t.getLine(m.start.line).substring(m.start.ch,m.end.ch);f=g&&c?"\\b"+f+"\\b":Z(f),kr.jumpList.cachedCursor=t.getCursor(),t.setCursor(m.start),o(f,!0,!1)}}},processEx:function(t,r,n){function o(e){kr.exCommandHistoryController.pushInput(e),kr.exCommandHistoryController.reset(),Ir.processCommand(t,e)}function i(r,n,o){var i,a=e.keyName(r);("Esc"==a||"Ctrl-C"==a||"Ctrl-["==a)&&(kr.exCommandHistoryController.pushInput(n),kr.exCommandHistoryController.reset(),e.e_stop(r),o(),t.focus()),"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=kr.exCommandHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kr.exCommandHistoryController.reset()}"keyToEx"==n.type?Ir.processCommand(t,n.exArgs.input):r.visualMode?Pt(t,{onClose:o,prefix:":",value:"'<,'>",onKeyDown:i}):Pt(t,{onClose:o,prefix:":",onKeyDown:i})},evalInput:function(e,t){var n,o,i,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},h=a.registerName,p=t.sel,d=W(t.visualMode?p.head:e.getCursor("head")),f=W(t.visualMode?p.anchor:e.getCursor("anchor")),m=W(d),g=W(f);if(c&&this.recordLastEdit(t,a),i=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat(),i>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===i)&&(i=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=i,A(e),s){var v=Mr[s](e,d,l,t);if(t.lastMotion=Mr[s],!v)return;if(l.toJumplist){var y=kr.jumpList,k=y.cachedCursor;k?(pt(e,k,v),delete y.cachedCursor):pt(e,d,v)}v instanceof Array?(o=v[0],n=v[1]):n=v,n||(n=W(d)),t.visualMode?(t.visualBlock&&1/0===n.ch||(n=O(e,n,t.visualBlock)),o&&(o=O(e,o,!0)),o=o||g,p.anchor=o,p.head=n,ot(e),kt(e,t,"<",_(o,n)?o:n),kt(e,t,">",_(o,n)?n:o)):c||(n=O(e,n),e.setCursor(n.line,n.ch))}if(c){if(u.lastSel){o=g;var C=u.lastSel,w=Math.abs(C.head.line-C.anchor.line),x=Math.abs(C.head.ch-C.anchor.ch);n=C.visualLine?r(g.line+w,g.ch):C.visualBlock?r(g.line+w,g.ch+x):C.head.line==C.anchor.line?r(g.line,g.ch+x):r(g.line+w,g.ch),t.visualMode=!0,t.visualLine=C.visualLine,t.visualBlock=C.visualBlock,p=t.sel={anchor:o,head:n},ot(e)}else t.visualMode&&(u.lastSel={anchor:W(p.anchor),head:W(p.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var M,S,b,L,T;if(t.visualMode){if(M=J(p.head,p.anchor),S=U(p.head,p.anchor),b=t.visualLine||u.linewise,L=t.visualBlock?"block":b?"line":"char",T=it(e,{anchor:M,head:S},L),b){var R=T.ranges;if("block"==L)for(var E=0;El&&i.line==c||l>u&&i.line==u?void 0:(n.toFirstChar&&(a=ut(e.getLine(l)),o.lastHPos=a),o.lastHSPos=e.charCoords(r(l,a),"div").left,r(l,a))},moveByDisplayLines:function(e,t,n,o){var i=t;switch(o.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:o.lastHSPos=e.charCoords(i,"div").left}var a=n.repeat,s=e.findPosV(i,n.forward?a:-a,"line",o.lastHSPos);if(s.hitSide)if(n.forward)var l=e.charCoords(s,"div"),c={top:l.top+8,left:o.lastHSPos},s=e.coordsChar(c,"div");else{var u=e.charCoords(r(e.firstLine(),0),"div");u.left=o.lastHSPos,s=e.coordsChar(u,"div")}return o.lastHPos=s.ch,s},moveByPage:function(e,t,r){var n=t,o=r.repeat;return e.findPosV(n,r.forward?o:-o,"page")},moveByParagraph:function(e,t,r){var n=r.forward?1:-1;return wt(e,t,r.repeat,n)},moveByScroll:function(e,t,r,n){var o=e.getScrollInfo(),i=null,a=r.repeat;a||(a=o.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");r.repeat=a;var i=Mr.moveByDisplayLines(e,t,r,n);if(!i)return null;var l=e.charCoords(i,"local");return e.scrollTo(null,o.top+l.top-s.top),i},moveByWords:function(e,t,r){return gt(e,t,r.repeat,!!r.forward,!!r.wordEnd,!!r.bigWord)},moveTillCharacter:function(e,t,r){var n=r.repeat,o=vt(e,n,r.forward,r.selectedCharacter),i=r.forward?-1:1;return dt(i,r),o?(o.ch+=i,o):null},moveToCharacter:function(e,t,r){var n=r.repeat;return dt(0,r),vt(e,n,r.forward,r.selectedCharacter)||t},moveToSymbol:function(e,t,r){var n=r.repeat;return ft(e,n,r.forward,r.selectedCharacter)||t},moveToColumn:function(e,t,r,n){var o=r.repeat;return n.lastHPos=o-1,n.lastHSPos=e.charCoords(t,"div").left,yt(e,o)},moveToEol:function(e,t,n,o){var i=t;o.lastHPos=1/0;var a=r(i.line+n.repeat-1,1/0),s=e.clipPos(a);return s.ch--,o.lastHSPos=e.charCoords(s,"div").left,a},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return r(n.line,ut(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n,o=t,i=o.line,a=o.ch,s=e.getLine(i);do if(n=s.charAt(a++),n&&d(n)){var l=e.getTokenTypeAt(r(i,a));if("string"!==l&&"comment"!==l)break}while(n);if(n){var c=e.findMatchingBracket(r(i,a));return c.to}return o},moveToStartOfLine:function(e,t){return r(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var o=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(o=n.repeat-e.getOption("firstLineNumber")),r(o,ut(e.getLine(o)))},textObjectManipulation:function(e,t,r,n){var o={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},i={"'":!0,'"':!0},a=r.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!r.textObjectInner;if(o[a])s=xt(e,t,a,l);else if(i[a])s=Mt(e,t,a,l);else if("W"===a)s=ht(e,l,!0,!0);else if("w"===a)s=ht(e,l,!0,!1);else{if("p"!==a)return null;if(s=wt(e,t,r.repeat,0,l),r.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var c=n.inputState.operatorArgs;c&&(c.linewise=!0),s.end.line--}}return e.state.vim.visualMode?nt(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,r){var n=kr.lastChararacterSearch,o=r.repeat,i=r.forward===n.forward,a=(n.increment?1:0)*(i?-1:1);e.moveH(-a,"char"),r.inclusive=i?!0:!1;var s=vt(e,o,i,n.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}},Sr={change:function(t,r,n){var o,i,a=t.state.vim;if(kr.macroModeState.lastInsertModeChanges.inVisualBlock=a.visualBlock,a.visualMode){i=t.getSelection();var s=E("",n.length);t.replaceSelections(s),o=J(n[0].head,n[0].anchor)}else{var l=n[0].anchor,c=n[0].head;if(i=t.getRange(l,c),!g(i)){var u=/\s+$/.exec(i);u&&(c=P(c,0,-u[0].length),i=i.slice(0,-u[0].length))}var h=c.line-1==t.lastLine();t.replaceRange("",l,c),r.linewise&&!h&&(e.commands.newlineAndIndent(t),l.ch=null),o=l}kr.registerController.pushText(r.registerName,"change",i,r.linewise,n.length>1),Ar.enterInsertMode(t,{head:o},t.state.vim)},"delete":function(e,t,n){var o,i,a=e.state.vim;if(a.visualBlock){i=e.getSelection();var s=E("",n.length);e.replaceSelections(s),o=n[0].anchor}else{var l=n[0].anchor,c=n[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=r(l.line-1,q(e,l.line-1))),i=e.getRange(l,c),e.replaceRange("",l,c),o=l,t.linewise&&(o=Mr.moveToFirstNonWhiteSpaceCharacter(e,l))}return kr.registerController.pushText(t.registerName,"delete",i,t.linewise,a.visualBlock),O(e,o)},indent:function(e,t,r){var n=e.state.vim,o=r[0].anchor.line,i=n.visualBlock?r[r.length-1].anchor.line:r[0].head.line,a=n.visualMode?t.repeat:1;t.linewise&&i--;for(var s=o;i>=s;s++)for(var l=0;a>l;l++)e.indentLine(s,t.indentRight);return Mr.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},changeCase:function(e,t,r,n,o){for(var i=e.getSelections(),a=[],s=t.toLower,l=0;lc.top?(l.line+=(s-c.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u=a.anchor.line?P(a.head,0,1):r(a.anchor.line,0);else if("inplace"==i&&o.visualMode)return;t.setOption("keyMap","vim-insert"),t.setOption("disableInput",!1),n&&n.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})),kr.macroModeState.isPlaying||(t.on("change",Yt),e.on(t.getInputField(),"keydown",nr)),o.visualMode&&st(t),X(t,s,l)}},toggleVisualMode:function(t,n,o){var i,a=n.repeat,s=t.getCursor();o.visualMode?o.visualLine^n.linewise||o.visualBlock^n.blockwise?(o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t)):st(t):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,i=O(t,r(s.line,s.ch+a-1),!0),o.sel={anchor:s,head:i},e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t),kt(t,o,"<",J(s,i)),kt(t,o,">",U(s,i)))},reselectLastSelection:function(t,r,n){var o=n.lastSelection;if(n.visualMode&&rt(t,n),o){var i=o.anchorMark.find(),a=o.headMark.find();if(!i||!a)return;n.sel={anchor:i,head:a},n.visualMode=!0,n.visualLine=o.visualLine,n.visualBlock=o.visualBlock,ot(t),kt(t,n,"<",J(i,a)),kt(t,n,">",U(i,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var o,i;if(n.visualMode){if(o=e.getCursor("anchor"),i=e.getCursor("head"),_(i,o)){var a=i;i=o,o=a}i.ch=q(e,i.line)-1}else{var s=Math.max(t.repeat,2);o=e.getCursor(),i=O(e,r(o.line+s-1,1/0))}for(var l=0,c=o.line;cr)return"";if(e.getOption("indentWithTabs")){var n=Math.floor(r/s);return Array(n+1).join(" ")}return Array(r+1).join(" ")});a+=p?"\n":""}if(t.repeat>1)var a=Array(t.repeat+1).join(a);var f=i.linewise,m=i.blockwise;if(f)n.visualMode?a=n.visualLine?a.slice(0,-1):"\n"+a.slice(0,a.length-1)+"\n":t.after?(a="\n"+a.slice(0,a.length-1),o.ch=q(e,o.line)):o.ch=0;else{if(m){a=a.split("\n");for(var g=0;ge.lastLine()&&e.replaceRange("\n",r(b,0));var L=q(e,b);Lu.length&&(i=u.length),a=r(l.line,i)}if("\n"==s)o.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var h=t.getRange(l,a);if(h=h.replace(/[^\n]/g,s),o.visualBlock){var p=new Array(t.getOption("tabSize")+1).join(" ");h=t.getSelection(),h=h.replace(/\t/g,p).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(h)}else t.replaceRange(h,l,a);o.visualMode?(l=_(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),st(t,!1)):t.setCursor(P(a,0,-1))}},incrementNumberToken:function(e,t){for(var n,o,i,a,s,l=e.getCursor(),c=e.getLine(l.line),u=/-?\d+/g;null!==(n=u.exec(c))&&(s=n[0],o=n.index,i=o+s.length,!(l.ch=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb?!0:!1}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};y("pcre",!0,"boolean"),St.prototype={getQuery:function(){return kr.query},setQuery:function(e){kr.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return kr.isReversed},setReversed:function(e){kr.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Tr="(Javascript regexp)",Rr=[{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:"set"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],Er=function(){this.buildCommandMap_()};Er.prototype={processCommand:function(t,r,n){var o=t.state.vim,i=kr.registerController.getRegister(":"),a=i.toString();o.visualMode&&st(t);var s=new e.StringStream(r);i.setText(r);var l=n||{};l.input=r;try{this.parseInput_(t,s,l)}catch(c){throw Ot(t,c),c}var u,h;if(l.commandName){if(u=this.matchCommand_(l.commandName)){if(h=u.name,u.excludeFromCommandHistory&&i.setText(a),this.parseCommandArgs_(s,l,u),"exToKey"==u.type){for(var p=0;p0;t--){var r=e.substring(0,t);if(this.commandMap_[r]){var n=this.commandMap_[r];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={}; --for(var e=0;e
    ";if(r){var i;r=r.join("");for(var a=0;a"}}else for(var i in n){var l=n[i].toString();l.length&&(o+='"'+i+" "+l+"
    ")}Ot(e,o)},sort:function(t,n){function o(){if(n.argString){var t=new e.StringStream(n.argString);if(t.eat("!")&&(a=!0),t.eol())return;if(!t.eatSpace())return"Invalid arguments";var r=t.match(/[a-z]+/);if(r){r=r[0],s=-1!=r.indexOf("i"),l=-1!=r.indexOf("u");var o=-1!=r.indexOf("d")&&1,i=-1!=r.indexOf("x")&&1,u=-1!=r.indexOf("o")&&1;if(o+i+u>1)return"Invalid arguments";c=o&&"decimal"||i&&"hex"||u&&"octal"}t.eatSpace()&&t.match(/\/.*\//)}}function i(e,t){if(a){var r;r=e,e=t,t=r}s&&(e=e.toLowerCase(),t=t.toLowerCase());var n=c&&g.exec(e),o=c&&g.exec(t);return n?(n=parseInt((n[1]+n[2]).toLowerCase(),v),o=parseInt((o[1]+o[2]).toLowerCase(),v),n-o):t>e?-1:1}var a,s,l,c,u=o();if(u)return void Ot(t,u+": "+n.argString);var h=n.line||t.firstLine(),p=n.lineEnd||n.line||t.lastLine();if(h!=p){var d=r(h,0),f=r(p,q(t,p)),m=t.getRange(d,f).split("\n"),g="decimal"==c?/(-?)([\d]+)/:"hex"==c?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==c?/([0-7]+)/:null,v="decimal"==c?10:"hex"==c?16:"octal"==c?8:null,y=[],k=[];if(c)for(var C=0;C=p;p++){var d=c.test(e.getLine(p));d&&(u.push(p+1),h+=e.getLine(p)+"
    ")}if(!n)return void Ot(e,h);var f=0,m=function(){if(f=u)return void Ot(t,"Invalid argument: "+r.argString.substring(i));for(var h=0;u-c>=h;h++){var d=String.fromCharCode(c+h);delete n.marks[d]}}else delete n.marks[a]}}},Ir=new Er;return e.keyMap.vim={attach:a,detach:i,call:s},y("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(t){var r=e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent;r(t)},fallthrough:["default"],attach:a,detach:i,call:s},e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:a,detach:i,call:s},M(),wr};e.Vim=n()}); -\ 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:"xi",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",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:"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:"moveToEol",motionArgs:{inclusive:!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:"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:"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:"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",_a),x(b),a.on(b.getInputField(),"paste",k(b))}function f(b){b.setOption("disableInput",!1),b.off("cursorActivity",_a),a.off(b.getInputField(),"paste",k(b)),b.state.vim=null}function g(b,c){this==a.keyMap.vim&&a.rmClass(b.getWrapperElement(),"cm-fat-cursor"),c&&c.attach==h||f(b,!1)}function h(b,c){this==a.keyMap.vim&&a.addClass(b.getWrapperElement(),"cm-fat-cursor"),c&&c.attach==h||e(b)}function i(b,c){if(!c)return void 0;var d=j(b);if(!d)return!1;var e=a.Vim.findKey(c,d);return"function"==typeof e&&a.signal(c,"vim-keypress",d),e}function j(a){if("'"==a.charAt(0))return a.charAt(1);var b=a.split("-");/-$/.test(a)&&b.splice(-2,2,"-");var c=b[b.length-1];if(1==b.length&&1==b[0].length)return!1;if(2==b.length&&"Shift"==b[0]&&1==c.length)return!1;for(var d=!1,e=0;e"):!1}function k(a){var b=a.state.vim;return b.onPasteFn||(b.onPasteFn=function(){b.insertMode||(a.setCursor(K(a.getCursor(),0,1)),zb.enterInsertMode(a,{},b))}),b.onPasteFn}function l(a,b){for(var c=[],d=a;a+b>d;d++)c.push(String.fromCharCode(d));return c}function m(a,b){return b>=a.firstLine()&&b<=a.lastLine()}function n(a){return/^[a-z]$/.test(a)}function o(a){return-1!="()[]{}".indexOf(a)}function p(a){return ib.test(a)}function q(a){return/^[A-Z]$/.test(a)}function r(a){return/^\s*$/.test(a)}function s(a,b){for(var c=0;cd;d++)c.push(a);return c}function G(a,b){yb[a]=b}function H(a,b){zb[a]=b}function I(a,b,c){var e=Math.min(Math.max(a.firstLine(),b.line),a.lastLine()),f=W(a,e)-1;f=c?f+1:f;var g=Math.min(Math.max(0,b.ch),f);return d(e,g)}function J(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function K(a,b,c){return"object"==typeof b&&(c=b.ch,b=b.line),d(a.line+b,a.ch+c)}function L(a,b){return{line:b.line-a.line,ch:b.line-a.line}}function M(a,b,c,d){for(var e,f=[],g=[],h=0;h"==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":!1}return a==b?"full":0==b.indexOf(a)?"partial":!1}function O(a){var b=/^.*(<[\w\-]+>)$/.exec(a),c=b?b[1]:a.slice(-1);if(c.length>1)switch(c){case"":c="\n";break;case"":c=" "}return c}function P(a,b,c){return function(){for(var d=0;c>d;d++)b(a)}}function Q(a){return d(a.line,a.ch)}function R(a,b){return a.ch==b.ch&&a.line==b.line}function S(a,b){return a.line2&&(b=T.apply(void 0,Array.prototype.slice.call(arguments,1))),S(a,b)?a:b}function U(a,b){return arguments.length>2&&(b=U.apply(void 0,Array.prototype.slice.call(arguments,1))),S(a,b)?b:a}function V(a,b,c){var d=S(a,b),e=S(b,c);return d&&e}function W(a,b){return a.getLine(b).length}function X(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Y(a){return a.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Z(a,b,c){var e=W(a,b),f=new Array(c-e+1).join(" ");a.setCursor(d(b,e)),a.replaceRange(f,a.getCursor())}function $(a,b){var c=[],e=a.listSelections(),f=Q(a.clipPos(b)),g=!R(b,f),h=a.getCursor("head"),i=aa(e,h),j=R(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&&0>=s?(p++,g||q--):0>r&&s>=0?(p--,j||q++):0>r&&-1==s&&(p--,q++);for(var t=n;o>=t;t++){var u={anchor:new d(t,p),head:new d(t,q)};c.push(u)}return i=f.line==o?c.length-1:0,a.setSelections(c),b.ch=q,m.ch=p,m}function _(a,b,c){for(var d=[],e=0;c>e;e++){var f=K(b,e,0);d.push({anchor:f,head:f})}a.setSelections(d,0)}function aa(a,b,c){for(var d=0;dj&&(f.line=j),f.ch=W(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;o>r;r++)q.push({anchor:d(k+r,l),head:d(k+r,n)});return{ranges:q,primary:p}}}function ga(a){var b=a.getCursor("head");return 1==a.getSelection().length&&(b=T(b,a.getCursor("anchor"))),b}function ha(b,c){var d=b.state.vim;c!==!1&&b.setCursor(I(b,d.sel.head)),ca(b,d),d.visualMode=!1,d.visualLine=!1,d.visualBlock=!1,a.signal(b,"vim-mode-change",{mode:"normal"}),d.fakeCursor&&d.fakeCursor.clear()}function ia(a,b,c){var d=a.getRange(b,c);if(/\n\s*$/.test(d)){var e=d.split("\n");e.pop();for(var f,f=e.pop();e.length>0&&f&&r(f);f=e.pop())c.line--,c.ch=0;f?(c.line--,c.ch=W(a,c.line)):c.ch=0}}function ja(a,b,c){b.ch=0,c.ch=0,c.line++}function ka(a){if(!a)return 0;var b=a.search(/\S/);return-1==b?a.length:b}function la(a,b,c,e,f){for(var g=ga(a),h=a.getLine(g.line),i=g.ch,j=f?jb[0]:kb[0];!j(h.charAt(i));)if(i++,i>=h.length)return null;e?j=kb[0]:(j=jb[0],j(h.charAt(i))||(j=jb[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 ma(a,b,c){R(b,c)||tb.jumpList.add(a,b,c)}function na(a,b){tb.lastChararacterSearch.increment=a,tb.lastChararacterSearch.forward=b.forward,tb.lastChararacterSearch.selectedCharacter=b.selectedCharacter}function oa(a,b,c,e){var f=Q(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=Ab[e];if(!m)return f;var n=Bb[m].init,o=Bb[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 pa(a,b,c,d,e){var f=b.line,g=b.ch,h=a.getLine(f),i=c?1:-1,j=d?kb:jb;if(e&&""==h){if(f+=i,h=a.getLine(f),!m(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,n=k;g!=k;){for(var o=!1,p=0;p0?0:h.length}throw new Error("The impossible happened.")}function qa(a,b,c,e,f,g){var h=Q(b),i=[];(e&&!f||!e&&f)&&c++;for(var j=!(e&&f),k=0;c>k;k++){var l=pa(a,b,e,g,j);if(!l){var m=W(a,a.lastLine());i.push(e?{line:a.lastLine(),from:m,to:m}:{line:0,from:0,to:0});break}i.push(l),b=d(l.line,e?l.to-1:l.from)}var n=i.length!=c,o=i[0],p=i.pop();return e&&!f?(n||o.from==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.from)):e&&f?d(p.line,p.to-1):!e&&f?(n||o.to==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.to)):d(p.line,p.from)}function ra(a,b,c,e){for(var f,g=a.getCursor(),h=g.ch,i=0;b>i;i++){var j=a.getLine(g.line);if(f=ua(h,j,e,c,!0),-1==f)return null;h=f}return d(a.getCursor().line,f)}function sa(a,b){var c=a.getCursor().line;return I(a,d(c,b-1))}function ta(a,b,c,d){s(c,ob)&&(b.marks[c]&&b.marks[c].clear(),b.marks[c]=a.setBookmark(d))}function ua(a,b,c,d,e){var f;return d?(f=b.indexOf(c,a+1),-1==f||e||(f-=1)):(f=b.lastIndexOf(c,a-1),-1==f||e||(f+=1)),f}function va(a,b,c,e,f){function g(b){return!a.getLine(b)}function h(a,b,c){return c?g(a)!=g(a+b):!g(a)&&g(a+b)}var i,j,k=b.line,l=a.firstLine(),m=a.lastLine(),n=k;if(e){for(;n>=l&&m>=n&&c>0;)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;m>=n&&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 wa(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 xa(a,b,c,e){var f,g,h,i,j=Q(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;i>h&&!g;h++)l[h]==c&&(g=h);return f&&g?(e&&(--f,++g),{start:d(j.line,f),end:d(j.line,g)}):{start:j,end:j}}function ya(){}function za(a){var b=a.state.vim;return b.searchState_||(b.searchState_=new ya)}function Aa(a,b,c,d,e){a.openDialog?a.openDialog(b,d,{bottom:!0,value:e.value,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,selectValueOnOpen:!1}):d(prompt(c,""))}function Ba(a){var b=Ca(a)||[];if(!b.length)return[];var c=[];if(0===b[0]){for(var d=0;d'+b+"
    ",{bottom:!0,duration:5e3}):alert(b)}function Ia(a,b){var c="";return a&&(c+=''+a+""),c+=' ',b&&(c+='',c+=b,c+=""),c}function Ja(a,b){var c=(b.prefix||"")+" "+(b.desc||""),d=Ia(b.prefix,b.desc);Aa(a,d,c,b.onClose,b)}function Ka(a,b){if(a instanceof RegExp&&b instanceof RegExp){for(var c=["global","multiline","ignoreCase","source"],d=0;dh;h++){var i=g.find(b);if(0==h&&i&&R(g.from(),f)&&(i=g.find(b)),!i&&(g=a.getSearchCursor(c,b?d(a.lastLine()):d(a.firstLine(),0)),!g.find(b)))return}return g.from()})}function Pa(a){var b=za(a);a.removeOverlay(za(a).getOverlay()),b.setOverlay(null),b.getScrollbarAnnotate()&&(b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(null))}function Qa(a,b,c){return"number"!=typeof a&&(a=a.line),b instanceof Array?s(a,b):c?a>=b&&c>=a:a==b}function Ra(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 Sa(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()&&Qa(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 Ha(b,"No matches for "+h.source):c?void Ja(b,{prefix:"replace with "+i+" (y/n/a/q/l)",onKeyDown:o}):(k(),void(j&&j()))}function Ta(b){var c=b.state.vim,d=tb.macroModeState,e=tb.registerController.getRegister("."),f=d.isPlaying,g=d.lastInsertModeChanges,h=[];if(!f){for(var i=g.inVisualBlock?c.lastSelection.visualBlock.height:1,j=g.changes,h=[],k=0;k1&&(eb(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&&Ya(d)}function Ua(a){b.push(a)}function Va(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];Ua(f)}function Wa(b,c,d,e){var f=tb.registerController.getRegister(e);if(":"==e)return f.keyBuffer[0]&&Hb.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;tb.macroModeState.lastInsertModeChanges.changes=m,fb(b,m,1),Ta(b)}d.isPlaying=!1}function Xa(a,b){if(!a.isPlaying){var c=a.latestRegister,d=tb.registerController.getRegister(c);d&&d.pushText(b)}}function Ya(a){if(!a.isPlaying){ -+var b=a.latestRegister,c=tb.registerController.getRegister(b);c&&c.pushInsertModeChanges(a.lastInsertModeChanges)}}function Za(a,b){if(!a.isPlaying){var c=a.latestRegister,d=tb.registerController.getRegister(c);d&&d.pushSearchQuery(b)}}function $a(a,b){var c=tb.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.changes.push(e)}b=b.next}}function _a(a){var b=a.state.vim;if(b.insertMode){var c=tb.macroModeState;if(c.isPlaying)return;var d=c.lastInsertModeChanges;d.expectCursorActivityForChange?d.expectCursorActivityForChange=!1:d.changes=[]}else a.curOp.isVimOp||bb(a,b);b.visualMode&&ab(a)}function ab(a){var b=a.state.vim,c=I(a,Q(b.sel.head)),d=K(c,0,1);b.fakeCursor&&b.fakeCursor.clear(),b.fakeCursor=a.markText(c,d,{className:"cm-animate-fat-cursor"})}function bb(b,c){var d=b.getCursor("anchor"),e=b.getCursor("head");if(c.visualMode&&!b.somethingSelected()?ha(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=S(e,d)?0:-1,g=S(e,d)?-1:0;e=K(e,0,f),d=K(d,0,g),c.sel={anchor:d,head:e},ta(b,c,"<",T(e,d)),ta(b,c,">",U(e,d))}else c.insertMode||(c.lastHPos=b.getCursor().ch)}function cb(a){this.keyName=a}function db(b){function c(){return e.changes.push(new cb(f)),!0}var d=tb.macroModeState,e=d.lastInsertModeChanges,f=a.keyName(b);f&&(-1!=f.indexOf("Delete")||-1!=f.indexOf("Backspace"))&&a.lookupKey(f,"vim-insert",c)}function eb(a,b,c,d){function e(){h?wb.processAction(a,b,b.lastEditActionCommand):wb.evalInput(a,b)}function f(c){if(g.lastInsertModeChanges.changes.length>0){c=b.lastEditActionCommand?c:1;var d=g.lastInsertModeChanges;fb(a,d.changes,c)}}var g=tb.macroModeState;g.isPlaying=!0;var h=!!b.lastEditActionCommand,i=b.inputState;if(b.inputState=b.lastEditInputState,h&&b.lastEditActionCommand.interlaceInsertRepeat)for(var j=0;c>j;j++)e(),f(1);else d||e(),f(c);b.inputState=i,b.insertMode&&!d&&Ta(a),g.isPlaying=!1}function fb(b,c,d){function e(c){return"string"==typeof c?a.commands[c](b):c(b),!0}var f=b.getCursor("head"),g=tb.macroModeState.lastInsertModeChanges.inVisualBlock;if(g){var h=b.state.vim,i=h.lastSelection,j=L(i.anchor,i.head);_(b,f,j.line+1),d=b.listSelections().length,b.setCursor(f)}for(var k=0;d>k;k++){g&&b.setCursor(K(f,k,0));for(var l=0;l"]),pb=[].concat(lb,mb,nb,["-",'"',".",":","/"]),qb={};t("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 rb=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&&!R(l,b)&&i(b)}else i(b);i(h),e=d,f=d-c+1,0>f&&(f=0)}function b(a,b){d+=b,d>e?d=e:f>d&&(d=f);var h=g[(c+d)%c];if(h&&!h.find()){var i,j=b>0?1:-1,k=a.getCursor();do if(d+=j,h=g[(c+d)%c],h&&(i=h.find())&&!R(k,i))break;while(e>d&&d>f)}return h}var c=100,d=-1,e=0,f=0,g=new Array(c);return{cachedCursor:void 0,add:a,move:b}},sb=function(a){return a?{changes:a.changes,expectCursorActivityForChange:a.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var a=tb.macroModeState;a.onRecordingDone&&a.onRecordingDone(),a.onRecordingDone=void 0,a.isRecording=!1},enterMacroRecordMode:function(a,b){var c=tb.registerController.getRegister(b);c&&(c.clear(),this.latestRegister=b,a.openDialog&&(this.onRecordingDone=a.openDialog("(recording)["+b+"]",null,{bottom:!0})),this.isRecording=!0)}};var tb,ub,vb={buildKeyMap:function(){},getRegisterController:function(){return tb.registerController},resetVimGlobalState_:y,getVimGlobalState_:function(){return tb},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:cb,map:function(a,b,c){Hb.map(a,b,c)},setOption:u,getOption:v,defineOption:t,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;Gb[a]=c,Hb.commandMap_[b]={name:a,shortName:b,type:"api"}},handleKey:function(a,b,c){var d=this.findKey(a,b,c);return"function"==typeof d?d():void 0},findKey:function(c,d,e){function f(){var a=tb.macroModeState;if(a.isRecording){if("q"==d)return a.exitMacroRecordMode(),A(c),!0;"mapping"!=e&&Xa(a,d)}}function g(){return""==d?(A(c),l.visualMode?ha(c):l.insertMode&&Ta(c),!0):void 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=wb.matchCommand(a,b,l.inputState,"insert");a.length>1&&"full"!=f.type;){var a=l.inputState.keyBuffer=a.slice(1),h=wb.matchCommand(a,b,l.inputState,"insert");"none"!=h.type&&(f=h)}if("none"==f.type)return A(c),!1;if("partial"==f.type)return ub&&window.clearTimeout(ub),ub=window.setTimeout(function(){l.insertMode&&l.inputState.keyBuffer&&A(c)},v("insertModeEscKeysTimeout")),!e;if(ub&&window.clearTimeout(ub),e){var i=c.getCursor();c.replaceRange("",K(i,0,-(a.length-1)),i,"+input")}return A(c),f.command}function j(){if(f()||g())return!0;var a=l.inputState.keyBuffer=l.inputState.keyBuffer+d;if(/^[1-9]\d*$/.test(a))return!0;var e=/^(\d*)(.*)$/.exec(a);if(!e)return A(c),!1;var h=l.visualMode?"visual":"normal",i=wb.matchCommand(e[2]||e[1],b,l.inputState,h);if("none"==i.type)return A(c),!1;if("partial"==i.type)return!0;l.inputState.keyBuffer="";var e=/^(\d*)(.*)$/.exec(a);return e[1]&&"0"!=e[1]&&l.inputState.pushRepeatDigit(e[1]),i.command}var k,l=x(c);return k=l.insertMode?i():j(),k===!1?void 0:k===!0?function(){}:function(){return c.operation(function(){c.curOp.isVimOp=!0;try{"keyToKey"==k.type?h(k.toKeys):wb.processCommand(c,l,k)}catch(b){throw c.state.vim=void 0,x(c),a.Vim.suppressErrorLogging||console.log(b),b}return!0})}},handleEx:function(a,b){Hb.processCommand(a,b)},defineMotion:E,defineAction:H,defineOperator:G,mapCommand:Va,_mapCommand:Ua,exitVisualMode:ha,exitInsertMode:Ta};z.prototype.pushRepeatDigit=function(a){this.operator?this.motionRepeat=this.motionRepeat.concat(a):this.prefixRepeat=this.prefixRepeat.concat(a)},z.prototype.getRepeat=function(){var a=0;return(this.prefixRepeat.length>0||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},B.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(sb(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("")}},C.prototype={pushText:function(a,b,c,d,e){d&&"\n"==c.charAt(0)&&(c=c.slice(1)+"\n"),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 B(c,d,e);break;case"delete":case"change":-1==c.indexOf("\n")?this.registers["-"]=new B(c,d):(this.shiftNumericRegisters_(),this.registers[1]=new B(c,d))}return void this.unnamedRegister.setText(c,d,e)}var g=q(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 B),this.registers[a]):this.unnamedRegister},isValidRegister:function(a){return a&&s(a,pb)},shiftNumericRegisters_:function(){for(var a=9;a>=2;a--)this.registers[a]=this.getRegister(""+(a-1))}},D.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):0>e?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 wb={matchCommand:function(a,b,c,d){var e=M(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)&&(c.selectedCharacter=O(a)),{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=J(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);A(a)}d.operator=c.operator,d.operatorArgs=J(c.operatorArgs),b.visualMode&&this.evalInput(a,b)},processOperatorMotion:function(a,b,c){var d=b.visualMode,e=J(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=J(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,A(a),b.lastMotion=null,c.isEdit&&this.recordLastEdit(b,d,c),zb[c.action](a,g,b)},processSearch:function(b,c,d){function e(a,e,f){tb.searchHistoryController.pushInput(a),tb.searchHistoryController.reset();try{La(b,a,e,f)}catch(g){return Ha(b,"Invalid regex: "+a),void A(b)}wb.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=tb.macroModeState;c.isRecording&&Za(c,a)}function g(c,d,e){var f,g=a.keyName(c);"Up"==g||"Down"==g?(f="Up"==g?!0:!1,d=tb.searchHistoryController.nextMatch(d,f)||"",e(d)):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&tb.searchHistoryController.reset();var h;try{h=La(b,d,!0,!0)}catch(c){}h?b.scrollIntoView(Oa(b,!i,h),30):(Pa(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?(tb.searchHistoryController.pushInput(d),tb.searchHistoryController.reset(),La(b,l),Pa(b),b.scrollTo(m.left,m.top),a.e_stop(c),A(b),e(),b.focus()):"Ctrl-U"==f&&(a.e_stop(c),e(""))}if(b.getSearchCursor){var i=d.searchArgs.forward,j=d.searchArgs.wholeWordOnly;za(b).setReversed(!i);var k=i?"/":"?",l=za(b).getQuery(),m=b.getScrollInfo();switch(d.searchArgs.querySrc){case"prompt":var n=tb.macroModeState;if(n.isPlaying){var o=n.replaySearchQueries.shift();e(o,!0,!1)}else Ja(b,{onClose:f,prefix:k,desc:Eb,onKeyUp:g,onKeyDown:h});break;case"wordUnderCursor":var p=la(b,!1,!0,!1,!0),q=!0;if(p||(p=la(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":Y(o),tb.jumpList.cachedCursor=b.getCursor(),b.setCursor(p.start),e(o,!0,!1)}}},processEx:function(b,c,d){function e(a){tb.exCommandHistoryController.pushInput(a),tb.exCommandHistoryController.reset(),Hb.processCommand(b,a)}function f(c,d,e){var f,g=a.keyName(c);("Esc"==g||"Ctrl-C"==g||"Ctrl-["==g||"Backspace"==g&&""==d)&&(tb.exCommandHistoryController.pushInput(d),tb.exCommandHistoryController.reset(),a.e_stop(c),A(b),e(),b.focus()),"Up"==g||"Down"==g?(f="Up"==g?!0:!1,d=tb.exCommandHistoryController.nextMatch(d,f)||"",e(d)):"Ctrl-U"==g?(a.e_stop(c),e("")):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&tb.exCommandHistoryController.reset()}"keyToEx"==d.type?Hb.processCommand(b,d.exArgs.input):c.visualMode?Ja(b,{onClose:e,prefix:":",value:"'<,'>",onKeyDown:f}):Ja(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=Q(b.visualMode?I(a,m.head):a.getCursor("head")),o=Q(b.visualMode?I(a,m.anchor):a.getCursor("anchor")),p=Q(n),q=Q(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,A(a),h){var r=xb[h](a,n,i,b);if(b.lastMotion=xb[h],!r)return;if(i.toJumplist){var s=tb.jumpList,t=s.cachedCursor;t?(ma(a,t,r),delete s.cachedCursor):ma(a,n,r)}r instanceof Array?(e=r[0],c=r[1]):c=r,c||(c=Q(n)),b.visualMode?(b.visualBlock&&c.ch===1/0||(c=I(a,c,b.visualBlock)),e&&(e=I(a,e,!0)),e=e||q,m.anchor=e,m.head=c,ea(a),ta(a,b,"<",S(e,c)?e:c),ta(a,b,">",S(e,c)?c:e)):j||(c=I(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},ea(a)}else b.visualMode&&(k.lastSel={anchor:Q(m.anchor),head:Q(m.head),visualBlock:b.visualBlock,visualLine:b.visualLine});var x,y,z,B,C;if(b.visualMode){if(x=T(m.head,m.anchor),y=U(m.head,m.anchor),z=b.visualLine||k.linewise,B=b.visualBlock?"block":z?"line":"char",C=fa(a,{anchor:x,head:y},B),z){var D=C.ranges;if("block"==B)for(var E=0;Ei&&f.line==j||i>k&&f.line==k?void 0:(c.toFirstChar&&(g=ka(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 va(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=xb.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 qa(a,b,c.repeat,!!c.forward,!!c.wordEnd,!!c.bigWord)},moveTillCharacter:function(a,b,c){var d=c.repeat,e=ra(a,d,c.forward,c.selectedCharacter),f=c.forward?-1:1;return na(f,c),e?(e.ch+=f,e):null},moveToCharacter:function(a,b,c){var d=c.repeat;return na(0,c),ra(a,d,c.forward,c.selectedCharacter)||b},moveToSymbol:function(a,b,c){var d=c.repeat;return oa(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,sa(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,ka(a.getLine(c.line)))},moveToMatchedSymbol:function(a,b){var c,e=b,f=e.line,g=e.ch,h=a.getLine(f);do if(c=h.charAt(g++),c&&o(c)){var i=a.getTokenTypeAt(d(f,g));if("string"!==i&&"comment"!==i)break}while(c);if(c){var j=a.findMatchingBracket(d(f,g));return j.to}return e},moveToStartOfLine:function(a,b){return d(b.line,0)},moveToLineOrEdgeOfDocument:function(a,b,c){var e=c.forward?a.lastLine():a.firstLine();return c.repeatIsExplicit&&(e=c.repeat-a.getOption("firstLineNumber")),d(e,ka(a.getLine(e)))},textObjectManipulation:function(a,b,c,d){var e={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},f={"'":!0,'"':!0},g=c.selectedCharacter;"b"==g?g="(":"B"==g&&(g="{");var h,i=!c.textObjectInner;if(e[g])h=wa(a,b,g,i);else if(f[g])h=xa(a,b,g,i);else if("W"===g)h=la(a,i,!0,!0);else if("w"===g)h=la(a,i,!0,!1);else{if("p"!==g)return null;if(h=va(a,b,c.repeat,0,i),c.linewise=!0,d.visualMode)d.visualLine||(d.visualLine=!0);else{var j=d.inputState.operatorArgs;j&&(j.linewise=!0),h.end.line--}}return a.state.vim.visualMode?da(a,h.start,h.end):[h.start,h.end]},repeatLastCharacterSearch:function(a,b,c){var d=tb.lastChararacterSearch,e=c.repeat,f=c.forward===d.forward,g=(d.increment?1:0)*(f?-1:1);a.moveH(-g,"char"),c.inclusive=f?!0:!1;var h=ra(a,e,f,d.selectedCharacter);return h?(h.ch+=g,h):(a.moveH(g,"char"),b)}},yb={change:function(b,c,d){var e,f,g=b.state.vim;if(tb.macroModeState.lastInsertModeChanges.inVisualBlock=g.visualBlock,g.visualMode){f=b.getSelection();var h=F("",d.length);b.replaceSelections(h),e=T(d[0].head,d[0].anchor)}else{var i=d[0].anchor,j=d[0].head;f=b.getRange(i,j);var k=g.lastEditInputState||{};if("moveByWords"==k.motion&&!r(f)){var l=/\s+$/.exec(f);l&&k.motionArgs&&k.motionArgs.forward&&(j=K(j,0,-l[0].length),f=f.slice(0,-l[0].length))}var m=j.line-1==b.lastLine();b.replaceRange("",i,j),c.linewise&&!m&&(a.commands.newlineAndIndent(b),i.ch=null),e=i}tb.registerController.pushText(c.registerName,"change",f,c.linewise,d.length>1),zb.enterInsertMode(b,{head:e},b.state.vim)},"delete":function(a,b,c){var e,f,g=a.state.vim;if(g.visualBlock){f=a.getSelection();var h=F("",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,W(a,i.line-1))),f=a.getRange(i,j),a.replaceRange("",i,j),e=i,b.linewise&&(e=xb.moveToFirstNonWhiteSpaceCharacter(a,i))}return tb.registerController.pushText(b.registerName,"delete",f,b.linewise,g.visualBlock),I(a,e)},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;f>=h;h++)for(var i=0;g>i;i++)a.indentLine(h,b.indentRight);return xb.moveToFirstNonWhiteSpaceCharacter(a,c[0].anchor)},changeCase:function(a,b,c,d,e){for(var f=a.getSelections(),g=[],h=b.toLower,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?K(g.head,0,1):d(g.anchor.line,0);else if("inplace"==f&&e.visualMode)return;b.setOption("keyMap","vim-insert"),b.setOption("disableInput",!1),c&&c.replace?(b.toggleOverwrite(!0),b.setOption("keyMap","vim-replace"),a.signal(b,"vim-mode-change",{mode:"replace"})):(b.setOption("keyMap","vim-insert"),a.signal(b,"vim-mode-change",{mode:"insert"})),tb.macroModeState.isPlaying||(b.on("change",$a),a.on(b.getInputField(),"keydown",db)),e.visualMode&&ha(b),_(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":""}),ea(b)):ha(b):(e.visualMode=!0,e.visualLine=!!c.linewise,e.visualBlock=!!c.blockwise,f=I(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":""}),ea(b),ta(b,e,"<",T(h,f)),ta(b,e,">",U(h,f)))},reselectLastSelection:function(b,c,d){var e=d.lastSelection;if(d.visualMode&&ca(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,ea(b),ta(b,d,"<",T(f,g)),ta(b,d,">",U(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"),S(f,e)){var g=f;f=e,e=g}f.ch=W(a,f.line)-1}else{var h=Math.max(b.repeat,2);e=a.getCursor(),f=I(a,d(e.line+h-1,1/0))}for(var i=0,j=e.line;jc)return"";if(a.getOption("indentWithTabs")){var d=Math.floor(c/h);return Array(d+1).join(" ")}return Array(c+1).join(" ")});g+=m?"\n":""}if(b.repeat>1)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=W(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=W(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=S(j[0].anchor,j[0].head)?j[0].anchor:j[0].head,b.setCursor(i),ha(b,!1)):b.setCursor(K(g,0,-1))}},incrementNumberToken:function(a,b){for(var c,e,f,g,h,i=a.getCursor(),j=a.getLine(i.line),k=/-?\d+/g;null!==(c=k.exec(j))&&(h=c[0],e=c.index,f=e+h.length,!(i.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?!0:!1}},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}}};t("pcre",!0,"boolean"),ya.prototype={getQuery:function(){return tb.query},setQuery:function(a){tb.query=a},getOverlay:function(){return this.searchOverlay},setOverlay:function(a){this.searchOverlay=a},isReversed:function(){return tb.isReversed},setReversed:function(a){tb.isReversed=a},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(a){this.annotate=a}};var Cb={"\\n":"\n","\\r":"\r","\\t":" "},Db={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":" "},Eb="(Javascript regexp)",Fb=function(){this.buildCommandMap_()};Fb.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=tb.registerController.getRegister(":"),g=f.toString();e.visualMode&&ha(b);var h=new a.StringStream(c);f.setText(c);var i=d||{};i.input=c;try{this.parseInput_(b,h,i)}catch(j){throw Ha(b,j),j}var k,l;if(i.commandName){if(k=this.matchCommand_(i.commandName)){ -+if(l=k.name,k.excludeFromCommandHistory&&f.setText(g),this.parseCommandArgs_(h,i,k),"exToKey"==k.type){for(var m=0;m0;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+"
    ")}Ha(a,e)},sort:function(b,c){function e(){if(c.argString){var b=new a.StringStream(c.argString);if(b.eat("!")&&(g=!0),b.eol())return;if(!b.eatSpace())return"Invalid arguments";var d=b.match(/[a-z]+/);if(d){d=d[0],h=-1!=d.indexOf("i"),i=-1!=d.indexOf("u");var e=-1!=d.indexOf("d")&&1,f=-1!=d.indexOf("x")&&1,k=-1!=d.indexOf("o")&&1;if(e+f+k>1)return"Invalid arguments";j=e&&"decimal"||f&&"hex"||k&&"octal"}b.eatSpace()&&b.match(/\/.*\//)}}function f(a,b){if(g){var c;c=a,a=b,b=c}h&&(a=a.toLowerCase(),b=b.toLowerCase());var d=j&&q.exec(a),e=j&&q.exec(b);return d?(d=parseInt((d[1]+d[2]).toLowerCase(),r),e=parseInt((e[1]+e[2]).toLowerCase(),r),d-e):b>a?-1:1}var g,h,i,j,k=e();if(k)return void Ha(b,k+": "+c.argString);var l=c.line||b.firstLine(),m=c.lineEnd||c.line||b.lastLine();if(l!=m){var n=d(l,0),o=d(m,W(b,m)),p=b.getRange(n,o).split("\n"),q="decimal"==j?/(-?)([\d]+)/:"hex"==j?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==j?/([0-7]+)/:null,r="decimal"==j?10:"hex"==j?16:"octal"==j?8:null,s=[],t=[];if(j)for(var u=0;u=m;m++){var n=j.test(a.getLine(m));n&&(k.push(m+1),l+=a.getLine(m)+"
    ")}if(!d)return void Ha(a,l);var o=0,p=function(){if(o=k)return void Ha(b,"Invalid argument: "+c.argString.substring(f));for(var l=0;k-j>=l;l++){var m=String.fromCharCode(j+l);delete d.marks[m]}}else delete d.marks[g]}}},Hb=new Fb;return a.keyMap.vim={attach:h,detach:g,call:i},t("insertModeEscKeysTimeout",200,"number"),a.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(b){var c=a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent;c(b)},fallthrough:["default"],attach:h,detach:g,call:i},a.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:h,detach:g,call:i},y(),vb};a.Vim=e()}); -\ No newline at end of file -diff --git a/media/editors/codemirror/lib/addons.css b/media/editors/codemirror/lib/addons.css -new file mode 100644 -index 0000000..5c73dea ---- /dev/null -+++ b/media/editors/codemirror/lib/addons.css -@@ -0,0 +1,94 @@ -+.CodeMirror-fullscreen { -+ position: fixed; -+ top: 0; left: 0; right: 0; bottom: 0; -+ height: auto; -+ z-index: 9; -+} -+ -+.CodeMirror-foldmarker { -+ color: blue; -+ text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; -+ font-family: arial; -+ line-height: .3; -+ cursor: pointer; -+} -+.CodeMirror-foldgutter { -+ width: .7em; -+} -+.CodeMirror-foldgutter-open, -+.CodeMirror-foldgutter-folded { -+ cursor: pointer; -+} -+.CodeMirror-foldgutter-open:after { -+ content: "\25BE"; -+} -+.CodeMirror-foldgutter-folded:after { -+ content: "\25B8"; -+} -+ -+.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { -+ position: absolute; -+ background: #ccc; -+ -moz-box-sizing: border-box; -+ box-sizing: border-box; -+ border: 1px solid #bbb; -+ border-radius: 2px; -+} -+ -+.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { -+ position: absolute; -+ z-index: 6; -+ background: #eee; -+} -+ -+.CodeMirror-simplescroll-horizontal { -+ bottom: 0; left: 0; -+ height: 8px; -+} -+.CodeMirror-simplescroll-horizontal div { -+ bottom: 0; -+ height: 100%; -+} -+ -+.CodeMirror-simplescroll-vertical { -+ right: 0; top: 0; -+ width: 8px; -+} -+.CodeMirror-simplescroll-vertical div { -+ right: 0; -+ width: 100%; -+} -+ -+ -+.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { -+ display: none; -+} -+ -+.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { -+ position: absolute; -+ background: #bcd; -+ border-radius: 3px; -+} -+ -+.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { -+ position: absolute; -+ z-index: 6; -+} -+ -+.CodeMirror-overlayscroll-horizontal { -+ bottom: 0; left: 0; -+ height: 6px; -+} -+.CodeMirror-overlayscroll-horizontal div { -+ bottom: 0; -+ height: 100%; -+} -+ -+.CodeMirror-overlayscroll-vertical { -+ right: 0; top: 0; -+ width: 6px; -+} -+.CodeMirror-overlayscroll-vertical div { -+ right: 0; -+ width: 100%; -+} -diff --git a/media/editors/codemirror/lib/addons.js b/media/editors/codemirror/lib/addons.js -index ac63cd9..482dab6 100644 ---- a/media/editors/codemirror/lib/addons.js -+++ b/media/editors/codemirror/lib/addons.js -@@ -1,20 +1,3 @@ --/** -- * addon/display/fullscreen.js -- * addon/display/panel.js -- * addon/edit/closebrackets.js -- * addon/edit/closetag.js -- * addon/edit/matchbrackets.js -- * addon/edit/matchtags.js -- * addon/fold/brace-fold.js -- * addon/fold/foldcode.js -- * addon/fold/foldgutter.js -- * addon/fold/xml-fold.js -- * addon/mode/loadmode.js -- * addon/mode/multiplex.js -- * addon/scroll/simplescrollbars.js -- * addon/selection/active-line.js -- * keymap/vim.js --**/ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -56,6 +39,7 @@ - cm.refresh(); - } - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -68,13 +52,31 @@ - mod(CodeMirror); - })(function(CodeMirror) { - CodeMirror.defineExtension("addPanel", function(node, options) { -+ options = options || {}; -+ - if (!this.state.panels) initPanels(this); - - var info = this.state.panels; -- if (options && options.position == "bottom") -- info.wrapper.appendChild(node); -- else -- info.wrapper.insertBefore(node, info.wrapper.firstChild); -+ var wrapper = info.wrapper; -+ var cmWrapper = this.getWrapperElement(); -+ -+ if (options.after instanceof Panel && !options.after.cleared) { -+ wrapper.insertBefore(node, options.before.node.nextSibling); -+ } else if (options.before instanceof Panel && !options.before.cleared) { -+ wrapper.insertBefore(node, options.before.node); -+ } else if (options.replace instanceof Panel && !options.replace.cleared) { -+ wrapper.insertBefore(node, options.replace.node); -+ options.replace.clear(); -+ } else if (options.position == "bottom") { -+ wrapper.appendChild(node); -+ } else if (options.position == "before-bottom") { -+ wrapper.insertBefore(node, cmWrapper.nextSibling); -+ } else if (options.position == "after-top") { -+ wrapper.insertBefore(node, cmWrapper); -+ } else { -+ wrapper.insertBefore(node, wrapper.firstChild); -+ } -+ - var height = (options && options.height) || node.offsetHeight; - this._setSize(null, info.heightLeft -= height); - info.panels++; -@@ -150,6 +152,7 @@ - cm.setSize(); - } - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -161,29 +164,158 @@ - else // Plain browser env - mod(CodeMirror); - })(function(CodeMirror) { -- var DEFAULT_BRACKETS = "()[]{}''\"\""; -- var DEFAULT_TRIPLES = "'\""; -- var DEFAULT_EXPLODE_ON_ENTER = "[]{}"; -- var SPACE_CHAR_REGEX = /\s/; -+ var defaults = { -+ pairs: "()[]{}''\"\"", -+ triples: "", -+ explode: "[]{}" -+ }; - - var Pos = CodeMirror.Pos; - - CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) { -- if (old != CodeMirror.Init && old) -- cm.removeKeyMap("autoCloseBrackets"); -- if (!val) return; -- var pairs = DEFAULT_BRACKETS, triples = DEFAULT_TRIPLES, explode = DEFAULT_EXPLODE_ON_ENTER; -- if (typeof val == "string") pairs = val; -- else if (typeof val == "object") { -- if (val.pairs != null) pairs = val.pairs; -- if (val.triples != null) triples = val.triples; -- if (val.explode != null) explode = val.explode; -- } -- var map = buildKeymap(pairs, triples); -- if (explode) map.Enter = buildExplodeHandler(explode); -- cm.addKeyMap(map); -+ if (old && old != CodeMirror.Init) { -+ cm.removeKeyMap(keyMap); -+ cm.state.closeBrackets = null; -+ } -+ if (val) { -+ cm.state.closeBrackets = val; -+ cm.addKeyMap(keyMap); -+ } - }); - -+ function getOption(conf, name) { -+ if (name == "pairs" && typeof conf == "string") return conf; -+ if (typeof conf == "object" && conf[name] != null) return conf[name]; -+ return defaults[name]; -+ } -+ -+ var bind = defaults.pairs + "`"; -+ var keyMap = {Backspace: handleBackspace, Enter: handleEnter}; -+ for (var i = 0; i < bind.length; i++) -+ keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i)); -+ -+ function handler(ch) { -+ return function(cm) { return handleChar(cm, ch); }; -+ } -+ -+ function getConfig(cm) { -+ var deflt = cm.state.closeBrackets; -+ if (!deflt) return null; -+ var mode = cm.getModeAt(cm.getCursor()); -+ return mode.closeBrackets || deflt; -+ } -+ -+ function handleBackspace(cm) { -+ var conf = getConfig(cm); -+ if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; -+ -+ var pairs = getOption(conf, "pairs"); -+ var ranges = cm.listSelections(); -+ for (var i = 0; i < ranges.length; i++) { -+ if (!ranges[i].empty()) return CodeMirror.Pass; -+ var around = charsAround(cm, ranges[i].head); -+ if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; -+ } -+ for (var i = ranges.length - 1; i >= 0; i--) { -+ var cur = ranges[i].head; -+ cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); -+ } -+ } -+ -+ function handleEnter(cm) { -+ var conf = getConfig(cm); -+ var explode = conf && getOption(conf, "explode"); -+ if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass; -+ -+ var ranges = cm.listSelections(); -+ for (var i = 0; i < ranges.length; i++) { -+ if (!ranges[i].empty()) return CodeMirror.Pass; -+ var around = charsAround(cm, ranges[i].head); -+ if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass; -+ } -+ cm.operation(function() { -+ cm.replaceSelection("\n\n", null); -+ cm.execCommand("goCharLeft"); -+ ranges = cm.listSelections(); -+ for (var i = 0; i < ranges.length; i++) { -+ var line = ranges[i].head.line; -+ cm.indentLine(line, null, true); -+ cm.indentLine(line + 1, null, true); -+ } -+ }); -+ } -+ -+ function handleChar(cm, ch) { -+ var conf = getConfig(cm); -+ if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass; -+ -+ var pairs = getOption(conf, "pairs"); -+ var pos = pairs.indexOf(ch); -+ if (pos == -1) return CodeMirror.Pass; -+ var triples = getOption(conf, "triples"); -+ -+ var identical = pairs.charAt(pos + 1) == ch; -+ var ranges = cm.listSelections(); -+ var opening = pos % 2 == 0; -+ -+ var type, next; -+ for (var i = 0; i < ranges.length; i++) { -+ var range = ranges[i], cur = range.head, curType; -+ var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); -+ if (opening && !range.empty()) { -+ curType = "surround"; -+ } else if ((identical || !opening) && next == ch) { -+ if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch) -+ curType = "skipThree"; -+ else -+ curType = "skip"; -+ } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 && -+ cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch && -+ (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) { -+ curType = "addFour"; -+ } else if (identical) { -+ if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both"; -+ else return CodeMirror.Pass; -+ } else if (opening && (cm.getLine(cur.line).length == cur.ch || -+ isClosingBracket(next, pairs) || -+ /\s/.test(next))) { -+ curType = "both"; -+ } else { -+ return CodeMirror.Pass; -+ } -+ if (!type) type = curType; -+ else if (type != curType) return CodeMirror.Pass; -+ } -+ -+ var left = pos % 2 ? pairs.charAt(pos - 1) : ch; -+ var right = pos % 2 ? ch : pairs.charAt(pos + 1); -+ cm.operation(function() { -+ if (type == "skip") { -+ cm.execCommand("goCharRight"); -+ } else if (type == "skipThree") { -+ for (var i = 0; i < 3; i++) -+ cm.execCommand("goCharRight"); -+ } else if (type == "surround") { -+ var sels = cm.getSelections(); -+ for (var i = 0; i < sels.length; i++) -+ sels[i] = left + sels[i] + right; -+ cm.replaceSelections(sels, "around"); -+ } else if (type == "both") { -+ cm.replaceSelection(left + right, null); -+ cm.triggerElectric(left + right); -+ cm.execCommand("goCharLeft"); -+ } else if (type == "addFour") { -+ cm.replaceSelection(left + left + left + left, "before"); -+ cm.execCommand("goCharRight"); -+ } -+ }); -+ } -+ -+ function isClosingBracket(ch, pairs) { -+ var pos = pairs.lastIndexOf(ch); -+ return pos > -1 && pos % 2 == 1; -+ } -+ - function charsAround(cm, pos) { - var str = cm.getRange(Pos(pos.line, pos.ch - 1), - Pos(pos.line, pos.ch + 1)); -@@ -205,112 +337,8 @@ - stream.start = stream.pos; - } - } -- -- function buildKeymap(pairs, triples) { -- var map = { -- name : "autoCloseBrackets", -- Backspace: function(cm) { -- if (cm.getOption("disableInput")) return CodeMirror.Pass; -- var ranges = cm.listSelections(); -- for (var i = 0; i < ranges.length; i++) { -- if (!ranges[i].empty()) return CodeMirror.Pass; -- var around = charsAround(cm, ranges[i].head); -- if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; -- } -- for (var i = ranges.length - 1; i >= 0; i--) { -- var cur = ranges[i].head; -- cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); -- } -- } -- }; -- var closingBrackets = ""; -- for (var i = 0; i < pairs.length; i += 2) (function(left, right) { -- closingBrackets += right; -- map["'" + left + "'"] = function(cm) { -- if (cm.getOption("disableInput")) return CodeMirror.Pass; -- var ranges = cm.listSelections(), type, next; -- for (var i = 0; i < ranges.length; i++) { -- var range = ranges[i], cur = range.head, curType; -- var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); -- if (!range.empty()) { -- curType = "surround"; -- } else if (left == right && next == right) { -- if (cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == left + left + left) -- curType = "skipThree"; -- else -- curType = "skip"; -- } else if (left == right && cur.ch > 1 && triples.indexOf(left) >= 0 && -- cm.getRange(Pos(cur.line, cur.ch - 2), cur) == left + left && -- (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != left)) { -- curType = "addFour"; -- } else if (left == '"' || left == "'") { -- if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, left)) curType = "both"; -- else return CodeMirror.Pass; -- } else if (cm.getLine(cur.line).length == cur.ch || closingBrackets.indexOf(next) >= 0 || SPACE_CHAR_REGEX.test(next)) { -- curType = "both"; -- } else { -- return CodeMirror.Pass; -- } -- if (!type) type = curType; -- else if (type != curType) return CodeMirror.Pass; -- } -- -- cm.operation(function() { -- if (type == "skip") { -- cm.execCommand("goCharRight"); -- } else if (type == "skipThree") { -- for (var i = 0; i < 3; i++) -- cm.execCommand("goCharRight"); -- } else if (type == "surround") { -- var sels = cm.getSelections(); -- for (var i = 0; i < sels.length; i++) -- sels[i] = left + sels[i] + right; -- cm.replaceSelections(sels, "around"); -- } else if (type == "both") { -- cm.replaceSelection(left + right, null); -- cm.execCommand("goCharLeft"); -- } else if (type == "addFour") { -- cm.replaceSelection(left + left + left + left, "before"); -- cm.execCommand("goCharRight"); -- } -- }); -- }; -- if (left != right) map["'" + right + "'"] = function(cm) { -- var ranges = cm.listSelections(); -- for (var i = 0; i < ranges.length; i++) { -- var range = ranges[i]; -- if (!range.empty() || -- cm.getRange(range.head, Pos(range.head.line, range.head.ch + 1)) != right) -- return CodeMirror.Pass; -- } -- cm.execCommand("goCharRight"); -- }; -- })(pairs.charAt(i), pairs.charAt(i + 1)); -- return map; -- } -- -- function buildExplodeHandler(pairs) { -- return function(cm) { -- if (cm.getOption("disableInput")) return CodeMirror.Pass; -- var ranges = cm.listSelections(); -- for (var i = 0; i < ranges.length; i++) { -- if (!ranges[i].empty()) return CodeMirror.Pass; -- var around = charsAround(cm, ranges[i].head); -- if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass; -- } -- cm.operation(function() { -- cm.replaceSelection("\n\n", null); -- cm.execCommand("goCharLeft"); -- ranges = cm.listSelections(); -- for (var i = 0; i < ranges.length; i++) { -- var line = ranges[i].head.line; -- cm.indentLine(line, null, true); -- cm.indentLine(line + 1, null, true); -- } -- }); -- }; -- } - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -477,6 +505,7 @@ - return true; - } - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -597,6 +626,7 @@ - return scanForBracket(this, pos, dir, style, config); - }); - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -663,6 +693,7 @@ - } - }; - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -768,6 +799,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { - }); - - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -917,6 +949,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { - return getOption(this, options, name); - }); - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -971,7 +1004,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { - function isFolded(cm, line) { - var marks = cm.findMarksAt(Pos(line)); - for (var i = 0; i < marks.length; ++i) -- if (marks[i].__isFold && marks[i].find().from.line == line) return true; -+ if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i]; - } - - function marker(spec) { -@@ -1017,7 +1050,9 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { - if (!state) return; - var opts = state.options; - if (gutter != opts.gutter) return; -- cm.foldCode(Pos(line, 0), opts.rangeFinder); -+ var folded = isFolded(cm, line); -+ if (folded) folded.clear(); -+ else cm.foldCode(Pos(line, 0), opts.rangeFinder); - } - - function onChange(cm) { -@@ -1061,6 +1096,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { - updateFoldInfo(cm, line, line + 1); - } - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -1243,6 +1279,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { - return findMatchingClose(iter, name); - }; - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -1307,6 +1344,7 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { - }); - }; - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -1323,12 +1361,14 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { - CodeMirror.multiplexingMode = function(outer /*, others */) { - // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects - var others = Array.prototype.slice.call(arguments, 1); -- var n_others = others.length; - -- function indexOf(string, pattern, from) { -- if (typeof pattern == "string") return string.indexOf(pattern, from); -+ function indexOf(string, pattern, from, returnEnd) { -+ if (typeof pattern == "string") { -+ var found = string.indexOf(pattern, from); -+ return returnEnd && found > -1 ? found + pattern.length : found; -+ } - var m = pattern.exec(from ? string.slice(from) : string); -- return m ? m.index + from : -1; -+ return m ? m.index + from + (returnEnd ? m[0].length : 0) : -1; - } - - return { -@@ -1351,11 +1391,11 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - token: function(stream, state) { - if (!state.innerActive) { - var cutOff = Infinity, oldContent = stream.string; -- for (var i = 0; i < n_others; ++i) { -+ for (var i = 0; i < others.length; ++i) { - var other = others[i]; - var found = indexOf(oldContent, other.open, stream.pos); - if (found == stream.pos) { -- stream.match(other.open); -+ if (!other.parseDelimiters) stream.match(other.open); - state.innerActive = other; - state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); - return other.delimStyle; -@@ -1373,8 +1413,8 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - state.innerActive = state.inner = null; - return this.token(stream, state); - } -- var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos) : -1; -- if (found == stream.pos) { -+ var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos, curInner.parseDelimiters) : -1; -+ if (found == stream.pos && !curInner.parseDelimiters) { - stream.match(curInner.close); - state.innerActive = state.inner = null; - return curInner.delimStyle; -@@ -1383,6 +1423,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - var innerToken = curInner.mode.token(stream, state.inner); - if (found > -1) stream.string = oldContent; - -+ if (found == stream.pos && curInner.parseDelimiters) -+ state.innerActive = state.inner = null; -+ - if (curInner.innerStyle) { - if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle; - else innerToken = curInner.innerStyle; -@@ -1404,7 +1447,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - mode.blankLine(state.innerActive ? state.inner : state.outer); - } - if (!state.innerActive) { -- for (var i = 0; i < n_others; ++i) { -+ for (var i = 0; i < others.length; ++i) { - var other = others[i]; - if (other.open === "\n") { - state.innerActive = other; -@@ -1425,6 +1468,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - }; - - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -1496,14 +1540,20 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - if (update !== false) this.scroll(pos, this.orientation); - }; - -+ var minButtonSize = 10; -+ - Bar.prototype.update = function(scrollSize, clientSize, barSize) { - this.screen = clientSize; - this.total = scrollSize; - this.size = barSize; - -- // FIXME clip to min size? -+ var buttonSize = this.screen * (this.size / this.total); -+ if (buttonSize < minButtonSize) { -+ this.size -= minButtonSize - buttonSize; -+ buttonSize = minButtonSize; -+ } - this.inner.style[this.orientation == "horizontal" ? "width" : "height"] = -- this.screen * (this.size / this.total) + "px"; -+ buttonSize + "px"; - this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = - this.pos * (this.size / this.total) + "px"; - }; -@@ -1566,6 +1616,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - return new SimpleScrollbars("CodeMirror-overlayscroll", place, scroll); - }; - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -@@ -1637,47 +1688,22 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - updateActiveLines(cm, sel.ranges); - } - }); -+ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - - /** - * Supported keybindings: -+ * Too many to list. Refer to defaultKeyMap below. - * -- * Motion: -- * h, j, k, l -- * gj, gk -- * e, E, w, W, b, B, ge, gE -- * f, F, t, T -- * $, ^, 0, -, +, _ -- * gg, G -- * % -- * ', ` -- * -- * Operator: -- * d, y, c -- * dd, yy, cc -- * g~, g~g~ -- * >, <, >>, << -- * -- * Operator-Motion: -- * x, X, D, Y, C, ~ -- * -- * Action: -- * a, i, s, A, I, S, o, O -- * zz, z., z, zt, zb, z- -- * J -- * u, Ctrl-r -- * m -- * r -- * -- * Modes: -- * ESC - leave insert mode, visual mode, and clear input state. -- * Ctrl-[, Ctrl-c - same as ESC. -+ * Supported Ex commands: -+ * Refer to defaultExCommandMap below. - * - * Registers: unnamed, -, a-z, A-Z, 0-9 - * (Does not respect the special case for number registers when delete - * operator is made with these commands: %, (, ), , /, ?, n, N, {, } ) - * TODO: Implement the remaining registers. -+ * - * Marks: a-z, A-Z, and 0-9 - * TODO: Implement the remaining special marks. They have more complex - * behavior. -@@ -1696,6 +1722,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - * 6. Motion, operator, and action implementations - * 7. Helper functions for the key handler, motions, operators, and actions - * 8. Set up Vim to work as a keymap for CodeMirror. -+ * 9. Ex command implementations. - */ - - (function(mod) { -@@ -1866,6 +1893,34 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - { keys: ':', type: 'ex' } - ]; - -+ /** -+ * Ex commands -+ * Care must be taken when adding to the default Ex command map. For any -+ * pair of commands that have a shared prefix, at least one of their -+ * shortNames must not match the prefix of the other command. -+ */ -+ var defaultExCommandMap = [ -+ { 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: true }, -+ { name: 'nohlsearch', shortName: 'noh' }, -+ { name: 'delmarks', shortName: 'delm' }, -+ { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, -+ { name: 'global', shortName: 'g' } -+ ]; -+ - var Pos = CodeMirror.Pos; - - var Vim = function() { -@@ -1975,7 +2030,11 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - } - - var numberRegex = /[\d]/; -- var wordRegexp = [(/\w/), (/[^\w\s]/)], bigWordRegexp = [(/\S/)]; -+ var wordCharTest = [CodeMirror.isWordChar, function(ch) { -+ return ch && !CodeMirror.isWordChar(ch) && !/\s/.test(ch); -+ }], bigWordCharTest = [function(ch) { -+ return /\S/.test(ch); -+ }]; - function makeKeyRange(start, size) { - var keys = []; - for (var i = start; i < start + size; i++) { -@@ -2017,18 +2076,30 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - } - - var options = {}; -- function defineOption(name, defaultValue, type) { -- if (defaultValue === undefined) { throw Error('defaultValue is required'); } -+ function defineOption(name, defaultValue, type, aliases, callback) { -+ if (defaultValue === undefined && !callback) { -+ throw Error('defaultValue is required unless callback is provided'); -+ } - if (!type) { type = 'string'; } - options[name] = { - type: type, -- defaultValue: defaultValue -+ defaultValue: defaultValue, -+ callback: callback - }; -- setOption(name, defaultValue); -+ if (aliases) { -+ for (var i = 0; i < aliases.length; i++) { -+ options[aliases[i]] = options[name]; -+ } -+ } -+ if (defaultValue) { -+ setOption(name, defaultValue); -+ } - } - -- function setOption(name, value) { -+ function setOption(name, value, cm, cfg) { - var option = options[name]; -+ cfg = cfg || {}; -+ var scope = cfg.scope; - if (!option) { - throw Error('Unknown option: ' + name); - } -@@ -2040,17 +2111,60 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - value = true; - } - } -- option.value = option.type == 'boolean' ? !!value : value; -+ if (option.callback) { -+ if (scope !== 'local') { -+ option.callback(value, undefined); -+ } -+ if (scope !== 'global' && cm) { -+ option.callback(value, cm); -+ } -+ } else { -+ if (scope !== 'local') { -+ option.value = option.type == 'boolean' ? !!value : value; -+ } -+ if (scope !== 'global' && cm) { -+ cm.state.vim.options[name] = {value: value}; -+ } -+ } - } - -- function getOption(name) { -+ function getOption(name, cm, cfg) { - var option = options[name]; -+ cfg = cfg || {}; -+ var scope = cfg.scope; - if (!option) { - throw Error('Unknown option: ' + name); - } -- return option.value; -+ if (option.callback) { -+ var local = cm && option.callback(undefined, cm); -+ if (scope !== 'global' && local !== undefined) { -+ return local; -+ } -+ if (scope !== 'local') { -+ return option.callback(); -+ } -+ return; -+ } else { -+ var local = (scope !== 'global') && (cm && cm.state.vim.options[name]); -+ return (local || (scope !== 'local') && option || {}).value; -+ } - } - -+ defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) { -+ // Option is local. Do nothing for global. -+ if (cm === undefined) { -+ return; -+ } -+ // The 'filetype' option proxies to the CodeMirror 'mode' option. -+ if (name === undefined) { -+ var mode = cm.getOption('mode'); -+ return mode == 'null' ? '' : mode; -+ } else { -+ var mode = name == '' ? 'null' : name; -+ cm.setOption('mode', mode); -+ } -+ }); -+ - var createCircularJumpList = function() { - var size = 100; - var pointer = -1; -@@ -2203,8 +2317,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - visualBlock: false, - lastSelection: null, - lastPastedText: null, -- sel: { -- } -+ sel: {}, -+ // Buffer-local/window-local values of vim options. -+ options: {} - }; - } - return cm.state.vim; -@@ -2262,11 +2377,15 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - // Add user defined key bindings. - exCommandDispatcher.map(lhs, rhs, ctx); - }, -+ // TODO: Expose setOption and getOption as instance methods. Need to decide how to namespace -+ // them, or somehow make them work with the existing CodeMirror setOption/getOption API. - setOption: setOption, - getOption: getOption, - defineOption: defineOption, - defineEx: function(name, prefix, func){ -- if (name.indexOf(prefix) !== 0) { -+ if (!prefix) { -+ prefix = name; -+ } else if (name.indexOf(prefix) !== 0) { - throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered'); - } - exCommands[name]=func; -@@ -2674,12 +2793,10 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - break; - case 'search': - this.processSearch(cm, vim, command); -- clearInputState(cm); - break; - case 'ex': - case 'keyToEx': - this.processEx(cm, vim, command); -- clearInputState(cm); - break; - default: - break; -@@ -2772,6 +2889,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - updateSearchQuery(cm, query, ignoreCase, smartCase); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + query); -+ clearInputState(cm); - return; - } - commandDispatcher.processMotion(cm, vim, { -@@ -2814,15 +2932,21 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - } - function onPromptKeyDown(e, query, close) { - var keyName = CodeMirror.keyName(e); -- if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { -+ if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || -+ (keyName == 'Backspace' && query == '')) { - vimGlobalState.searchHistoryController.pushInput(query); - vimGlobalState.searchHistoryController.reset(); - updateSearchQuery(cm, originalQuery); - clearSearchHighlight(cm); - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - CodeMirror.e_stop(e); -+ clearInputState(cm); - close(); - cm.focus(); -+ } else if (keyName == 'Ctrl-U') { -+ // Ctrl-U clears input. -+ CodeMirror.e_stop(e); -+ close(''); - } - } - switch (command.searchArgs.querySrc) { -@@ -2883,10 +3007,12 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - } - function onPromptKeyDown(e, input, close) { - var keyName = CodeMirror.keyName(e), up; -- if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { -+ if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || -+ (keyName == 'Backspace' && input == '')) { - vimGlobalState.exCommandHistoryController.pushInput(input); - vimGlobalState.exCommandHistoryController.reset(); - CodeMirror.e_stop(e); -+ clearInputState(cm); - close(); - cm.focus(); - } -@@ -2894,6 +3020,10 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - up = keyName == 'Up' ? true : false; - input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || ''; - close(input); -+ } else if (keyName == 'Ctrl-U') { -+ // Ctrl-U clears input. -+ CodeMirror.e_stop(e); -+ close(''); - } else { - if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') - vimGlobalState.exCommandHistoryController.reset(); -@@ -2923,8 +3053,8 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - var registerName = inputState.registerName; - var sel = vim.sel; - // TODO: Make sure cm and vim selections are identical outside visual mode. -- var origHead = copyCursor(vim.visualMode ? sel.head: cm.getCursor('head')); -- var origAnchor = copyCursor(vim.visualMode ? sel.anchor : cm.getCursor('anchor')); -+ var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head): cm.getCursor('head')); -+ var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor')); - var oldHead = copyCursor(origHead); - var oldAnchor = copyCursor(origAnchor); - var newHead, newAnchor; -@@ -3490,10 +3620,11 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - var anchor = ranges[0].anchor, - head = ranges[0].head; - text = cm.getRange(anchor, head); -- if (!isWhiteSpaceString(text)) { -+ var lastState = vim.lastEditInputState || {}; -+ if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) { - // Exclude trailing whitespace if the range is not all whitespace. - var match = (/\s+$/).exec(text); -- if (match) { -+ if (match && lastState.motionArgs && lastState.motionArgs.forward) { - head = offsetCursor(head, 0, - match[0].length); - text = text.slice(0, - match[0].length); - } -@@ -4267,9 +4398,6 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - function lineLength(cm, lineNum) { - return cm.getLine(lineNum).length; - } -- function reverse(s){ -- return s.split('').reverse().join(''); -- } - function trim(s) { - if (s.trim) { - return s.trim(); -@@ -4583,59 +4711,38 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - - // Seek to first word or non-whitespace character, depending on if - // noSymbol is true. -- var textAfterIdx = line.substring(idx); -- var firstMatchedChar; -- if (noSymbol) { -- firstMatchedChar = textAfterIdx.search(/\w/); -- } else { -- firstMatchedChar = textAfterIdx.search(/\S/); -+ var test = noSymbol ? wordCharTest[0] : bigWordCharTest [0]; -+ while (!test(line.charAt(idx))) { -+ idx++; -+ if (idx >= line.length) { return null; } - } -- if (firstMatchedChar == -1) { -- return null; -- } -- idx += firstMatchedChar; -- textAfterIdx = line.substring(idx); -- var textBeforeIdx = line.substring(0, idx); - -- var matchRegex; -- // Greedy matchers for the "word" we are trying to expand. - if (bigWord) { -- matchRegex = /^\S+/; -+ test = bigWordCharTest[0]; - } else { -- if ((/\w/).test(line.charAt(idx))) { -- matchRegex = /^\w+/; -- } else { -- matchRegex = /^[^\w\s]+/; -+ test = wordCharTest[0]; -+ if (!test(line.charAt(idx))) { -+ test = wordCharTest[1]; - } - } - -- var wordAfterRegex = matchRegex.exec(textAfterIdx); -- var wordStart = idx; -- var wordEnd = idx + wordAfterRegex[0].length; -- // TODO: Find a better way to do this. It will be slow on very long lines. -- var revTextBeforeIdx = reverse(textBeforeIdx); -- var wordBeforeRegex = matchRegex.exec(revTextBeforeIdx); -- if (wordBeforeRegex) { -- wordStart -= wordBeforeRegex[0].length; -- } -+ var end = idx, start = idx; -+ while (test(line.charAt(end)) && end < line.length) { end++; } -+ while (test(line.charAt(start)) && start >= 0) { start--; } -+ start++; - - if (inclusive) { -- // If present, trim all whitespace after word. -- // Otherwise, trim all whitespace before word. -- var textAfterWordEnd = line.substring(wordEnd); -- var whitespacesAfterWord = textAfterWordEnd.match(/^\s*/)[0].length; -- if (whitespacesAfterWord > 0) { -- wordEnd += whitespacesAfterWord; -- } else { -- var revTrim = revTextBeforeIdx.length - wordStart; -- var textBeforeWordStart = revTextBeforeIdx.substring(revTrim); -- var whitespacesBeforeWord = textBeforeWordStart.match(/^\s*/)[0].length; -- wordStart -= whitespacesBeforeWord; -+ // If present, include all whitespace after word. -+ // Otherwise, include all whitespace before word, except indentation. -+ var wordEnd = end; -+ while (/\s/.test(line.charAt(end)) && end < line.length) { end++; } -+ if (wordEnd == end) { -+ var wordStart = start; -+ while (/\s/.test(line.charAt(start - 1)) && start > 0) { start--; } -+ if (!start) { start = wordStart; } - } - } -- -- return { start: Pos(cur.line, wordStart), -- end: Pos(cur.line, wordEnd) }; -+ return { start: Pos(cur.line, start), end: Pos(cur.line, end) }; - } - - function recordJumpPosition(cm, oldCur, newCur) { -@@ -4793,7 +4900,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - var pos = cur.ch; - var line = cm.getLine(lineNum); - var dir = forward ? 1 : -1; -- var regexps = bigWord ? bigWordRegexp : wordRegexp; -+ var charTests = bigWord ? bigWordCharTest: wordCharTest; - - if (emptyLineIsWord && line == '') { - lineNum += dir; -@@ -4813,11 +4920,11 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - // Find bounds of next word. - while (pos != stop) { - var foundWord = false; -- for (var i = 0; i < regexps.length && !foundWord; ++i) { -- if (regexps[i].test(line.charAt(pos))) { -+ for (var i = 0; i < charTests.length && !foundWord; ++i) { -+ if (charTests[i](line.charAt(pos))) { - wordStart = pos; - // Advance to end of word. -- while (pos != stop && regexps[i].test(line.charAt(pos))) { -+ while (pos != stop && charTests[i](line.charAt(pos))) { - pos += dir; - } - wordEnd = pos; -@@ -5149,7 +5256,8 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - function dialog(cm, template, shortText, onClose, options) { - if (cm.openDialog) { - cm.openDialog(template, onClose, { bottom: true, value: options.value, -- onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp }); -+ onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp, -+ selectValueOnOpen: false}); - } - else { - onClose(prompt(shortText, '')); -@@ -5223,13 +5331,17 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - // Translates the replace part of a search and replace from ex (vim) syntax into - // javascript form. Similar to translateRegex, but additionally fixes back references - // (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'. -+ var charUnescapes = {'\\n': '\n', '\\r': '\r', '\\t': '\t'}; - function translateRegexReplace(str) { - var escapeNextChar = false; - var out = []; - for (var i = -1; i < str.length; i++) { - var c = str.charAt(i) || ''; - var n = str.charAt(i+1) || ''; -- if (escapeNextChar) { -+ if (charUnescapes[c + n]) { -+ out.push(charUnescapes[c+n]); -+ i++; -+ } else if (escapeNextChar) { - // At any point in the loop, escapeNextChar is true if the previous - // character was a '\' and was not escaped. - out.push(c); -@@ -5257,6 +5369,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - } - - // Unescape \ and / in the replace part, for PCRE mode. -+ var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t'}; - function unescapeRegexReplace(str) { - var stream = new CodeMirror.StringStream(str); - var output = []; -@@ -5265,13 +5378,15 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - while (stream.peek() && stream.peek() != '\\') { - output.push(stream.next()); - } -- if (stream.match('\\/', true)) { -- // \/ => / -- output.push('/'); -- } else if (stream.match('\\\\', true)) { -- // \\ => \ -- output.push('\\'); -- } else { -+ var matched = false; -+ for (var matcher in unescapes) { -+ if (stream.match(matcher, true)) { -+ matched = true; -+ output.push(unescapes[matcher]); -+ break; -+ } -+ } -+ if (!matched) { - // Don't change anything - output.push(stream.next()); - } -@@ -5501,32 +5616,18 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - return {top: from.line, bottom: to.line}; - } - -- // Ex command handling -- // Care must be taken when adding to the default Ex command map. For any -- // pair of commands that have a shared prefix, at least one of their -- // shortNames must not match the prefix of the other command. -- var defaultExCommandMap = [ -- { 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: 'set' }, -- { name: 'sort', shortName: 'sor' }, -- { name: 'substitute', shortName: 's', possiblyAsync: true }, -- { name: 'nohlsearch', shortName: 'noh' }, -- { name: 'delmarks', shortName: 'delm' }, -- { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, -- { name: 'global', shortName: 'g' } -- ]; - var ExCommandDispatcher = function() { - this.buildCommandMap_(); - }; - ExCommandDispatcher.prototype = { - processCommand: function(cm, input, opt_params) { -+ var that = this; -+ cm.operation(function () { -+ cm.curOp.isVimOp = true; -+ that._processCommand(cm, input, opt_params); -+ }); -+ }, -+ _processCommand: function(cm, input, opt_params) { - var vim = cm.state.vim; - var commandHistoryRegister = vimGlobalState.registerController.getRegister(':'); - var previousCommand = commandHistoryRegister.toString(); -@@ -5739,6 +5840,13 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - }; - - var exCommands = { -+ colorscheme: function(cm, params) { -+ if (!params.args || params.args.length < 1) { -+ showConfirm(cm, cm.getOption('theme')); -+ return; -+ } -+ cm.setOption('theme', params.args[0]); -+ }, - map: function(cm, params, ctx) { - var mapArgs = params.args; - if (!mapArgs || mapArgs.length < 2) { -@@ -5772,6 +5880,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - }, - set: function(cm, params) { - var setArgs = params.args; -+ // Options passed through to the setOption/getOption calls. May be passed in by the -+ // local/global versions of the set command -+ var setCfg = params.setCfg || {}; - if (!setArgs || setArgs.length < 1) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); -@@ -5795,24 +5906,35 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - optionName = optionName.substring(2); - value = false; - } -+ - var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean'; - if (optionIsBoolean && value == undefined) { - // Calling set with a boolean option sets it to true. - value = true; - } -- if (!optionIsBoolean && !value || forceGet) { -- var oldValue = getOption(optionName); -- // If no value is provided, then we assume this is a get. -+ // If no value is provided, then we assume this is a get. -+ if (!optionIsBoolean && value === undefined || forceGet) { -+ var oldValue = getOption(optionName, cm, setCfg); - if (oldValue === true || oldValue === false) { - showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName); - } else { - showConfirm(cm, ' ' + optionName + '=' + oldValue); - } - } else { -- setOption(optionName, value); -+ setOption(optionName, value, cm, setCfg); - } - }, -- registers: function(cm,params) { -+ setlocal: function (cm, params) { -+ // setCfg is passed through to setOption -+ params.setCfg = {scope: 'local'}; -+ this.set(cm, params); -+ }, -+ setglobal: function (cm, params) { -+ // setCfg is passed through to setOption -+ params.setCfg = {scope: 'global'}; -+ this.set(cm, params); -+ }, -+ registers: function(cm, params) { - var regArgs = params.args; - var registers = vimGlobalState.registerController.registers; - var regInfo = '----------Registers----------

    '; -@@ -6039,6 +6161,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - var query = state.getQuery(); - var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line; - var lineEnd = params.lineEnd || lineStart; -+ if (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) { -+ lineEnd = Infinity; -+ } - if (count) { - lineStart = lineEnd; - lineEnd = lineStart + count - 1; -@@ -6157,10 +6282,9 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - searchCursor.replace(newText); - } - function next() { -- var found; - // The below only loops to skip over multiple occurrences on the same - // line when 'global' is not true. -- while(found = searchCursor.findNext() && -+ while(searchCursor.findNext() && - isInRange(searchCursor.from(), lineStart, lineEnd)) { - if (!global && lastPos && searchCursor.from().line == lastPos.line) { - continue; -@@ -6335,6 +6459,14 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - - function executeMacroRegister(cm, vim, macroModeState, registerName) { - var register = vimGlobalState.registerController.getRegister(registerName); -+ if (registerName == ':') { -+ // Read-only register containing last Ex command. -+ if (register.keyBuffer[0]) { -+ exCommandDispatcher.processCommand(cm, register.keyBuffer[0]); -+ } -+ macroModeState.isPlaying = false; -+ return; -+ } - var keyBuffer = register.keyBuffer; - var imc = 0; - macroModeState.isPlaying = true; -@@ -6434,7 +6566,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - } - function updateFakeCursor(cm) { - var vim = cm.state.vim; -- var from = copyCursor(vim.sel.head); -+ var from = clipCursorToContent(cm, copyCursor(vim.sel.head)); - var to = offsetCursor(from, 0, 1); - if (vim.fakeCursor) { - vim.fakeCursor.clear(); -@@ -6445,7 +6577,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) { - var anchor = cm.getCursor('anchor'); - var head = cm.getCursor('head'); - // Enter or exit visual mode to match mouse selection. -- if (vim.visualMode && cursorEqual(head, anchor) && lineLength(cm, head.line) > head.ch) { -+ if (vim.visualMode && !cm.somethingSelected()) { - exitVisualMode(cm, false); - } else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) { - vim.visualMode = true; -diff --git a/media/editors/codemirror/lib/addons.min.css b/media/editors/codemirror/lib/addons.min.css -new file mode 100644 -index 0000000..e81039a ---- /dev/null -+++ b/media/editors/codemirror/lib/addons.min.css -@@ -0,0 +1 @@ -+.CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-foldmarker{color:#00f;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-folded,.CodeMirror-foldgutter-open{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-gutter-filler,.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%} -\ No newline at end of file -diff --git a/media/editors/codemirror/lib/addons.min.js b/media/editors/codemirror/lib/addons.min.js -index 362005d..f789dcf 100644 ---- a/media/editors/codemirror/lib/addons.min.js -+++ b/media/editors/codemirror/lib/addons.min.js -@@ -1,3 +1,4 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function r(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var r=e.state.fullScreenRestore;t.style.width=r.width,t.style.height=r.height,window.scrollTo(r.scrollLeft,r.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(n,o,i){i==e.Init&&(i=!1),!i!=!o&&(o?t(n):r(n))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,r,n){this.cm=e,this.node=t,this.options=r,this.height=n,this.cleared=!1}function r(e){var t=e.getWrapperElement(),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n=parseInt(r.height),o=e.state.panels={setHeight:t.style.height,heightLeft:n,panels:0,wrapper:document.createElement("div")};t.parentNode.insertBefore(o.wrapper,t);var i=e.hasFocus();o.wrapper.appendChild(t),i&&e.focus(),e._setSize=e.setSize,null!=n&&(e.setSize=function(t,r){if(null==r)return this._setSize(t,r);if(o.setHeight=r,"number"!=typeof r){var i=/^(\d+\.?\d*)px$/.exec(r);i?r=Number(i[1]):(o.wrapper.style.height=r,r=o.wrapper.offsetHeight,o.wrapper.style.height="")}e._setSize(t,o.heightLeft+=r-n),n=r})}function n(e){var t=e.state.panels;e.state.panels=null;var r=e.getWrapperElement();t.wrapper.parentNode.replaceChild(r,t.wrapper),r.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}e.defineExtension("addPanel",function(e,n){this.state.panels||r(this);var o=this.state.panels;n&&"bottom"==n.position?o.wrapper.appendChild(e):o.wrapper.insertBefore(e,o.wrapper.firstChild);var i=n&&n.height||e.offsetHeight;return this._setSize(null,o.heightLeft-=i),o.panels++,new t(this,e,n,i)}),t.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var e=this.cm.state.panels;this.cm._setSize(null,e.heightLeft+=this.height),e.wrapper.removeChild(this.node),0==--e.panels&&n(this.cm)}},t.prototype.changed=function(e){var t=null==e?this.node.offsetHeight:e,r=this.cm.state.panels;this.cm._setSize(null,r.height+=t-this.height),this.height=t}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){var r=e.getRange(c(t.line,t.ch-1),c(t.line,t.ch+1));return 2==r.length?r:null}function r(t,r,n){var o=t.getLine(r.line),i=t.getTokenAt(r);if(/\bstring2?\b/.test(i.type))return!1;var a=new e.StringStream(o.slice(0,r.ch)+n+o.slice(r.ch),4);for(a.pos=a.start=i.start;;){var s=t.getMode().token(a,i.state);if(a.pos>=r.ch+1)return/\bstring2?\b/.test(s);a.start=a.pos}}function n(n,o){for(var i={name:"autoCloseBrackets",Backspace:function(r){if(r.getOption("disableInput"))return e.Pass;for(var o=r.listSelections(),i=0;i=0;i--){var s=o[i].head;r.replaceRange("",c(s.line,s.ch-1),c(s.line,s.ch+1))}}},a="",s=0;s1&&o.indexOf(t)>=0&&i.getRange(c(m.line,m.ch-2),m)==t+t&&(m.ch<=2||i.getRange(c(m.line,m.ch-3),c(m.line,m.ch-2))!=t))d="addFour";else if('"'==t||"'"==t){if(e.isWordChar(u)||!r(i,m,t))return e.Pass;d="both"}else{if(!(i.getLine(m.line).length==m.ch||a.indexOf(u)>=0||l.test(u)))return e.Pass;d="both"}else d="surround";if(s){if(s!=d)return e.Pass}else s=d}i.operation(function(){if("skip"==s)i.execCommand("goCharRight");else if("skipThree"==s)for(var e=0;3>e;e++)i.execCommand("goCharRight");else if("surround"==s){for(var r=i.getSelections(),e=0;ec.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==h.type||u.string.indexOf("/")==u.string.length-1||m&&o(m,y)>-1||i(t,v,c,h,!0))return e.Pass;var C=g&&o(g,y)>-1;n[l]={indent:C,text:">"+(C?"\n\n":"")+"",newPos:C?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=r.length-1;l>=0;l--){var k=n[l];t.replaceRange(k.text,r[l].head,r[l].anchor,"+insert");var w=t.listSelections().slice(0);w[l]={head:k.newPos,anchor:k.newPos},t.setSelections(w),k.indent&&(t.indentLine(k.newPos.line,null,!0),t.indentLine(k.newPos.line+1,null,!0))}}function r(t,r){for(var n=t.listSelections(),o=[],a=r?"/":"";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;o[s]=a+"style>"}else{if(!f.context||!f.context.tagName||i(t,f.context.tagName,l,f))return e.Pass;o[s]=a+f.context.tagName+">"}}t.replaceSelections(o),n=t.listSelections();for(var s=0;sr;++r)if(e[r]==t)return r;return-1}function i(t,r,n,o,i){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,n.line+500),s=e.scanForClosingTag(t,n,null,a);if(!s||s.tag!=r)return!1;for(var l=o.context,c=i?1:0;l&&l.tagName==r;l=l.prev)++c;n=s.to;for(var u=1;c>u;u++){var f=e.scanForClosingTag(t,n,null,a);if(!f||f.tag!=r)return!1;n=f.to}return!0}e.defineOption("autoCloseTags",!1,function(r,o,i){if(i!=e.Init&&i&&r.removeKeyMap("autoCloseTags"),o){var a={name:"autoCloseTags"};("object"!=typeof o||o.whenClosing)&&(a["'/'"]=function(e){return n(e)}),("object"!=typeof o||o.whenOpening)&&(a["'>'"]=function(e){return t(e)}),r.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],s=["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"];e.commands.closeTag=function(e){return r(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n,o){var i=e.getLineHandle(t.line),l=t.ch-1,c=l>=0&&s[i.text.charAt(l)]||s[i.text.charAt(++l)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(n&&u>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(a(t.line,l+1)),h=r(e,a(t.line,l+(u>0?1:0)),u,f||null,o);return null==h?null:{from:a(t.line,l),to:h&&h.pos,match:h&&h.ch==c.charAt(0),forward:u>0}}function r(e,t,r,n,o){for(var i=o&&o.maxScanLineLength||1e4,l=o&&o.maxScanLines||1e3,c=[],u=o&&o.bracketRegex?o.bracketRegex:/[(){}[\]]/,f=r>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),h=t.line;h!=f;h+=r){var d=e.getLine(h);if(d){var p=r>0?0:d.length-1,m=r>0?d.length:-1;if(!(d.length>i))for(h==t.line&&(p=t.ch-(0>r?1:0));p!=m;p+=r){var g=d.charAt(p);if(u.test(g)&&(void 0===n||e.getTokenTypeAt(a(h,p+1))==n)){var v=s[g];if(">"==v.charAt(1)==r>0)c.push(g);else{if(!c.length)return{pos:a(h,p),ch:g};c.pop()}}}}}return h-r==(r>0?e.lastLine():e.firstLine())?!1:null}function n(e,r,n){for(var o=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),c=0;c",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,r,n){n&&n!=e.Init&&t.off("cursorActivity",o),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",o))}),e.defineExtension("matchBrackets",function(){n(this,!0)}),e.defineExtension("findMatchingBracket",function(e,r,n){return t(this,e,r,n)}),e.defineExtension("scanForBracket",function(e,t,n,o){return r(this,e,t,n,o)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function r(r){r.state.failedTagMatch=!1,r.operation(function(){if(t(r),!r.somethingSelected()){var n=r.getCursor(),o=r.getViewport();o.from=Math.min(o.from,n.line),o.to=Math.max(n.line+1,o.to);var i=e.findMatchingTag(r,n,o);if(i){if(r.state.matchBothTags){var a="open"==i.at?i.open:i.close;a&&(r.state.tagHit=r.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var s="close"==i.at?i.open:i.close;s?r.state.tagOther=r.markText(s.from,s.to,{className:"CodeMirror-matchingtag"}):r.state.failedTagMatch=!0}}})}function n(e){e.state.failedTagMatch&&r(e)}e.defineOption("matchTags",!1,function(o,i,a){a&&a!=e.Init&&(o.off("cursorActivity",r),o.off("viewportChange",n),t(o)),i&&(o.state.matchBothTags="object"==typeof i&&i.bothTags,o.on("cursorActivity",r),o.on("viewportChange",n),r(o))}),e.commands.toMatchingTag=function(t){var r=e.findMatchingTag(t,t.getCursor());if(r){var n="close"==r.at?r.open:r.close;n&&t.extendSelection(n.to,n.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(t,r){function n(n){for(var o=r.ch,l=0;;){var c=0>=o?-1:s.lastIndexOf(n,o-1);if(-1!=c){if(1==l&&c=p;++p)for(var m=t.getLine(p),g=p==a?o:0;;){var v=m.indexOf(l,g),y=m.indexOf(c,g);if(0>v&&(v=m.length),0>y&&(y=m.length),g=Math.min(v,y),g==m.length)break;if(t.getTokenTypeAt(e.Pos(p,g+1))==i)if(g==v)++h;else if(!--h){u=p,f=g;break e}++g}if(null!=u&&(a!=u||f!=o))return{from:e.Pos(a,o),to:e.Pos(u,f)}}}),e.registerHelper("fold","import",function(t,r){function n(r){if(rt.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));if(/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"keyword"!=n.type||"import"!=n.string)return null;for(var o=r,i=Math.min(t.lastLine(),r+10);i>=o;++o){var a=t.getLine(o),s=a.indexOf(";");if(-1!=s)return{startCh:n.end,end:e.Pos(o,s)}}}var o,r=r.line,i=n(r);if(!i||n(r-1)||(o=n(r-2))&&o.end.line==r-1)return null;for(var a=i.end;;){var s=n(a.line+1);if(null==s)break;a=s.end}return{from:t.clipPos(e.Pos(r,i.startCh+1)),to:a}}),e.registerHelper("fold","include",function(t,r){function n(r){if(rt.lastLine())return null;var n=t.getTokenAt(e.Pos(r,1));return/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(r,n.end+1))),"meta"==n.type&&"#include"==n.string.slice(0,8)?n.start+8:void 0}var r=r.line,o=n(r);if(null==o||null!=n(r-1))return null;for(var i=r;;){var a=n(i+1);if(null==a)break;++i}return{from:e.Pos(r,o+1),to:t.clipPos(e.Pos(i))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,o,i,a){function s(e){var r=l(t,o);if(!r||r.to.line-r.from.linet.firstLine();)o=e.Pos(o.line-1,0),u=s(!1);if(u&&!u.cleared&&"unfold"!==a){var f=r(t,i);e.on(f,"mousedown",function(t){h.clear(),e.e_preventDefault(t)});var h=t.markText(u.from,u.to,{replacedWith:f,clearOnEnter:!0,__isFold:!0});h.on("clear",function(r,n){e.signal(t,"unfold",t,r,n)}),e.signal(t,"fold",t,u.from,u.to)}}function r(e,t){var r=n(e,t,"widget");if("string"==typeof r){var o=document.createTextNode(r);r=document.createElement("span"),r.appendChild(o),r.className="CodeMirror-foldmarker"}return r}function n(e,t,r){if(t&&void 0!==t[r])return t[r];var n=e.options.foldOptions;return n&&void 0!==n[r]?n[r]:o[r]}e.newFoldFunction=function(e,r){return function(n,o){t(n,o,{rangeFinder:e,widget:r})}},e.defineExtension("foldCode",function(e,r,n){t(this,e,r,n)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),r=0;r=r;r++)t.foldCode(e.Pos(r,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var r=t.firstLine(),n=t.lastLine();n>=r;r++)t.foldCode(e.Pos(r,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,r){for(var n=0;n=s&&(r=o(i.indicatorOpen))}e.setGutterMarker(t,i.gutter,r),++a})}function a(e){var t=e.getViewport(),r=e.state.foldGutter;r&&(e.operation(function(){i(e,t.from,t.to)}),r.from=t.from,r.to=t.to)}function s(e,t,r){var n=e.state.foldGutter;if(n){var o=n.options;r==o.gutter&&e.foldCode(f(t,0),o.rangeFinder)}}function l(e){var t=e.state.foldGutter;if(t){var r=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},r.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var r=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var r=e.getViewport();t.from==t.to||r.from-t.to>20||t.from-r.to>20?a(e):e.operation(function(){r.fromt.to&&(i(e,t.to,r.to),t.to=r.to)})},r.updateViewportTimeSpan||400)}}function u(e,t){var r=e.state.foldGutter;if(r){var n=t.line;n>=r.from&&n=e.max?void 0:(e.ch=0,e.text=e.cm.getLine(++e.line),!0)}function i(e){return e.line<=e.min?void 0:(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0)}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(o(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),i=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}}function s(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(i(e))continue;return}if(n(e,t+1)){m.lastIndex=t,e.ch=t;var r=m.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function l(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(o(e))continue;return}{if(n(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(i(e))continue;return}{if(n(e,t+1)){var r=e.text.lastIndexOf("/",t),o=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var r=[];;){var n,o=l(e),i=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(n=a(e)))return;if("selfClose"!=n)if(o[1]){for(var c=r.length-1;c>=0;--c)if(r[c]==o[2]){r.length=c;break}if(0>c&&(!t||t==o[2]))return{tag:o[2],from:h(i,s),to:h(e.line,e.ch)}}else r.push(o[2])}}function f(e,t){for(var r=[];;){var n=c(e);if(!n)return;if("selfClose"!=n){var o=e.line,i=e.ch,a=s(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var l=r.length-1;l>=0;--l)if(r[l]==a[2]){r.length=l;break}if(0>l&&(!t||t==a[2]))return{tag:a[2],from:h(e.line,e.ch),to:h(o,i)}}}else s(e)}}var h=e.Pos,d="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",p=d+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+d+"]["+p+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var n=new r(e,t.line,0);;){var o,i=l(n);if(!i||n.line!=t.line||!(o=a(n)))return;if(!i[1]&&"selfClose"!=o){var t=h(n.line,n.ch),s=u(n,i[2]);return s&&{from:t,to:s.from}}}}),e.findMatchingTag=function(e,n,o){var i=new r(e,n.line,n.ch,o);if(-1!=i.text.indexOf(">")||-1!=i.text.indexOf("<")){var l=a(i),c=l&&h(i.line,i.ch),d=l&&s(i);if(l&&d&&!(t(i,n)>0)){var p={from:h(i.line,i.ch),to:c,tag:d[2]};return"selfClose"==l?{open:p,close:null,at:"open"}:d[1]?{open:f(i,d[2]),close:p,at:"close"}:(i=new r(e,c.line,c.ch,o),{open:p,close:u(i,d[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,n){for(var o=new r(e,t.line,t.ch,n);;){var i=f(o);if(!i)break;var a=new r(e,t.line,t.ch,n),s=u(a,i.tag);if(s)return{open:i,close:s}}},e.scanForClosingTag=function(e,t,n,o){var i=new r(e,t.line,t.ch,o?{from:0,to:o}:null);return u(i,n)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],function(t){e(t,"amd")}):e(CodeMirror,"plain")}(function(e,t){function r(e,t){var r=t;return function(){0==--r&&e()}}function n(t,n){var o=e.modes[t].dependencies;if(!o)return n();for(var i=[],a=0;a-1&&(i.string=l.slice(0,c));var u=s.mode.token(i,a.inner);return c>-1&&(i.string=l),s.innerStyle&&(u=u?u+" "+s.innerStyle:s.innerStyle),u}for(var f=1/0,l=i.string,h=0;o>h;++h){var d=n[h],c=r(l,d.open,i.pos);if(c==i.pos)return i.match(d.open),a.innerActive=d,a.inner=e.startState(d.mode,t.indent?t.indent(a.outer,""):0),d.delimStyle;-1!=c&&f>c&&(f=c)}1/0!=f&&(i.string=l.slice(0,f));var p=t.token(i,a.outer);return 1/0!=f&&(i.string=l),p},indent:function(r,n){var o=r.innerActive?r.innerActive.mode:t;return o.indent?o.indent(r.innerActive?r.inner:r.outer,n):e.Pass},blankLine:function(r){var i=r.innerActive?r.innerActive.mode:t;if(i.blankLine&&i.blankLine(r.innerActive?r.inner:r.outer),r.innerActive)"\n"===r.innerActive.close&&(r.innerActive=r.inner=null);else for(var a=0;o>a;++a){var s=n[a];"\n"===s.open&&(r.innerActive=s,r.inner=e.startState(s.mode,i.indent?i.indent(r.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,r,n){function o(t){var r=e.wheelEventPixels(t)["horizontal"==i.orientation?"x":"y"],n=i.pos;i.moveTo(i.pos+r),i.pos!=n&&e.e_preventDefault(t)}this.orientation=r,this.scroll=n,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=t+"-"+r,this.inner=this.node.appendChild(document.createElement("div"));var i=this;e.on(this.inner,"mousedown",function(t){function r(){e.off(document,"mousemove",n),e.off(document,"mouseup",r)}function n(e){return 1!=e.which?r():void i.moveTo(s+(e[o]-a)*(i.total/i.size))}if(1==t.which){e.e_preventDefault(t);var o="horizontal"==i.orientation?"pageX":"pageY",a=t[o],s=i.pos;e.on(document,"mousemove",n),e.on(document,"mouseup",r)}}),e.on(this.node,"click",function(t){e.e_preventDefault(t);var r,n=i.inner.getBoundingClientRect();r="horizontal"==i.orientation?t.clientXn.right?1:0:t.clientYn.bottom?1:0,i.moveTo(i.pos+r*i.screen)}),e.on(this.node,"mousewheel",o),e.on(this.node,"DOMMouseScroll",o)}function r(e,r,n){this.addClass=e,this.horiz=new t(e,"horizontal",n),r(this.horiz.node),this.vert=new t(e,"vertical",n),r(this.vert.node),this.width=null}t.prototype.moveTo=function(e,t){0>e&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),e!=this.pos&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",t!==!1&&this.scroll(e,this.orientation))},t.prototype.update=function(e,t,r){this.screen=t,this.total=e,this.size=r,this.inner.style["horizontal"==this.orientation?"width":"height"]=this.screen*(this.size/this.total)+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},r.prototype.update=function(e){if(null==this.width){var t=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;t&&(this.width=parseInt(t.height))}var r=this.width||0,n=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=o?"block":"none",this.horiz.node.style.display=n?"block":"none",o&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(n?r:0)),this.vert.node.style.display="block",this.vert.node.style.bottom=n?r+"px":"0"),n&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(o?r:0)-e.barLeft),this.horiz.node.style.right=o?r+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:o?r:0,bottom:n?r:0}},r.prototype.setScrollTop=function(e){this.vert.moveTo(e,!1)},r.prototype.setScrollLeft=function(e){this.horiz.moveTo(e,!1)},r.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new r("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new r("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t",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:"xi",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",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:"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:"moveToEol",motionArgs:{inclusive:!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:"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:"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"}],r=e.Pos,n=function(){function n(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",Zt),x(t),e.on(t.getInputField(),"paste",c(t)) --}function o(t){t.setOption("disableInput",!1),t.off("cursorActivity",Zt),e.off(t.getInputField(),"paste",c(t)),t.state.vim=null}function i(t,r){this==e.keyMap.vim&&e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),r&&r.attach==a||o(t,!1)}function a(t,r){this==e.keyMap.vim&&e.addClass(t.getWrapperElement(),"cm-fat-cursor"),r&&r.attach==a||n(t)}function s(t,r){if(!r)return void 0;var n=l(t);if(!n)return!1;var o=e.Vim.findKey(r,n);return"function"==typeof o&&e.signal(r,"vim-keypress",n),o}function l(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split("-");/-$/.test(e)&&t.splice(-2,2,"-");var r=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==r.length)return!1;for(var n=!1,o=0;o"):!1}function c(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(N(e.getCursor(),0,1)),br.enterInsertMode(e,{},t))}),t.onPasteFn}function u(e,t){for(var r=[],n=e;e+t>n;n++)r.push(String.fromCharCode(n));return r}function f(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function h(e){return/^[a-z]$/.test(e)}function d(e){return-1!="()[]{}".indexOf(e)}function p(e){return lr.test(e)}function m(e){return/^[A-Z]$/.test(e)}function g(e){return/^\s*$/.test(e)}function v(e,t){for(var r=0;rn;n++)r.push(e);return r}function E(e,t){Sr[e]=t}function I(e,t){br[e]=t}function B(e,t,n){var o=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),i=J(e,o)-1;i=n?i+1:i;var a=Math.min(Math.max(0,t.ch),i);return r(o,a)}function P(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function N(e,t,n){return"object"==typeof t&&(n=t.ch,t=t.line),r(e.line+t,e.ch+n)}function j(e,t){return{line:t.line-e.line,ch:t.line-e.line}}function F(e,t,r,n){for(var o,i=[],a=[],s=0;s"==t.slice(-11)){var r=t.length-11,n=e.slice(0,r),o=t.slice(0,r);return n==o&&e.length>r?"full":0==o.indexOf(n)?"partial":!1}return e==t?"full":0==t.indexOf(e)?"partial":!1}function H(e){var t=/^.*(<[\w\-]+>)$/.exec(e),r=t?t[1]:e.slice(-1);if(r.length>1)switch(r){case"":r="\n";break;case"":r=" "}return r}function D(e,t,r){return function(){for(var n=0;r>n;n++)t(e)}}function z(e){return r(e.line,e.ch)}function _(e,t){return e.ch==t.ch&&e.line==t.line}function W(e,t){return e.line2&&(t=q.apply(void 0,Array.prototype.slice.call(arguments,1))),W(e,t)?e:t}function V(e,t){return arguments.length>2&&(t=V.apply(void 0,Array.prototype.slice.call(arguments,1))),W(e,t)?t:e}function U(e,t,r){var n=W(e,t),o=W(t,r);return n&&o}function J(e,t){return e.getLine(t).length}function $(e){return e.split("").reverse().join("")}function Q(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function G(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Y(e,t,n){var o=J(e,t),i=new Array(n-o+1).join(" ");e.setCursor(r(t,o)),e.replaceRange(i,e.getCursor())}function X(e,t){var n=[],o=e.listSelections(),i=z(e.clipPos(t)),a=!_(t,i),s=e.getCursor("head"),l=et(o,s),c=_(o[l].head,o[l].anchor),u=o.length-1,f=u-l>l?u:0,h=o[f].anchor,d=Math.min(h.line,i.line),p=Math.max(h.line,i.line),m=h.ch,g=i.ch,v=o[f].head.ch-m,y=g-m;v>0&&0>=y?(m++,a||g--):0>v&&y>=0?(m--,c||g++):0>v&&-1==y&&(m--,g++);for(var C=d;p>=C;C++){var k={anchor:new r(C,m),head:new r(C,g)};n.push(k)}return l=i.line==p?n.length-1:0,e.setSelections(n),t.ch=g,h.ch=m,h}function Z(e,t,r){for(var n=[],o=0;r>o;o++){var i=N(t,o,0);n.push({anchor:i,head:i})}e.setSelections(n,0)}function et(e,t,r){for(var n=0;nc&&(i.line=c),i.ch=J(e,i.line)}return{ranges:[{anchor:a,head:i}],primary:0}}if("block"==n){for(var u=Math.min(a.line,i.line),f=Math.min(a.ch,i.ch),h=Math.max(a.line,i.line),d=Math.max(a.ch,i.ch)+1,p=h-u+1,m=i.line==u?0:p-1,g=[],v=0;p>v;v++)g.push({anchor:r(u+v,f),head:r(u+v,d)});return{ranges:g,primary:m}}}function at(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=q(t,e.getCursor("anchor"))),t}function st(t,r){var n=t.state.vim;r!==!1&&t.setCursor(B(t,n.sel.head)),rt(t,n),n.visualMode=!1,n.visualLine=!1,n.visualBlock=!1,e.signal(t,"vim-mode-change",{mode:"normal"}),n.fakeCursor&&n.fakeCursor.clear()}function lt(e,t,r){var n=e.getRange(t,r);if(/\n\s*$/.test(n)){var o=n.split("\n");o.pop();for(var i,i=o.pop();o.length>0&&i&&g(i);i=o.pop())r.line--,r.ch=0;i?(r.line--,r.ch=J(e,r.line)):r.ch=0}}function ct(e,t,r){t.ch=0,r.ch=0,r.line++}function ut(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function ft(e,t,n,o,i){var a,s=at(e),l=e.getLine(s.line),c=s.ch,u=l.substring(c);if(a=u.search(i?/\w/:/\S/),-1==a)return null;c+=a,u=l.substring(c);var f,h=l.substring(0,c);f=o?/^\S+/:/\w/.test(l.charAt(c))?/^\w+/:/^[^\w\s]+/;var d=f.exec(u),p=c,m=c+d[0].length,g=$(h),v=f.exec(g);if(v&&(p-=v[0].length),t){var y=l.substring(m),C=y.match(/^\s*/)[0].length;if(C>0)m+=C;else{var k=g.length-p,w=g.substring(k),x=w.match(/^\s*/)[0].length;p-=x}}return{start:r(s.line,p),end:r(s.line,m)}}function ht(e,t,r){_(t,r)||Cr.jumpList.add(e,t,r)}function dt(e,t){Cr.lastChararacterSearch.increment=e,Cr.lastChararacterSearch.forward=t.forward,Cr.lastChararacterSearch.selectedCharacter=t.selectedCharacter}function pt(e,t,n,o){var i=z(e.getCursor()),a=n?1:-1,s=n?e.lineCount():-1,l=i.ch,c=i.line,u=e.getLine(c),f={lineText:u,nextCh:u.charAt(l),lastCh:null,index:l,symb:o,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[o],forward:n,depth:0,curMoveThrough:!1},h=Ar[o];if(!h)return i;var d=Lr[h].init,p=Lr[h].isComplete;for(d&&d(f);c!==s&&t;){if(f.index+=a,f.nextCh=f.lineText.charAt(f.index),!f.nextCh){if(c+=a,f.lineText=e.getLine(c)||"",a>0)f.index=0;else{var m=f.lineText.length;f.index=m>0?m-1:0}f.nextCh=f.lineText.charAt(f.index)}p(f)&&(i.line=c,i.ch=f.index,t--)}return f.nextCh||f.curMoveThrough?r(c,f.index):i}function mt(e,t,r,n,o){var i=t.line,a=t.ch,s=e.getLine(i),l=r?1:-1,c=n?ur:cr;if(o&&""==s){if(i+=l,s=e.getLine(i),!f(e,i))return null;a=r?0:s.length}for(;;){if(o&&""==s)return{from:0,to:0,line:i};for(var u=l>0?s.length:-1,h=u,d=u;a!=u;){for(var p=!1,m=0;m0?0:s.length}throw new Error("The impossible happened.")}function gt(e,t,n,o,i,a){var s=z(t),l=[];(o&&!i||!o&&i)&&n++;for(var c=!(o&&i),u=0;n>u;u++){var f=mt(e,t,o,a,c);if(!f){var h=J(e,e.lastLine());l.push(o?{line:e.lastLine(),from:h,to:h}:{line:0,from:0,to:0});break}l.push(f),t=r(f.line,o?f.to-1:f.from)}var d=l.length!=n,p=l[0],m=l.pop();return o&&!i?(d||p.from==s.ch&&p.line==s.line||(m=l.pop()),r(m.line,m.from)):o&&i?r(m.line,m.to-1):!o&&i?(d||p.to==s.ch&&p.line==s.line||(m=l.pop()),r(m.line,m.to)):r(m.line,m.from)}function vt(e,t,n,o){for(var i,a=e.getCursor(),s=a.ch,l=0;t>l;l++){var c=e.getLine(a.line);if(i=kt(s,c,o,n,!0),-1==i)return null;s=i}return r(e.getCursor().line,i)}function yt(e,t){var n=e.getCursor().line;return B(e,r(n,t-1))}function Ct(e,t,r,n){v(r,pr)&&(t.marks[r]&&t.marks[r].clear(),t.marks[r]=e.setBookmark(n))}function kt(e,t,r,n,o){var i;return n?(i=t.indexOf(r,e+1),-1==i||o||(i-=1)):(i=t.lastIndexOf(r,e-1),-1==i||o||(i+=1)),i}function wt(e,t,n,o,i){function a(t){return!e.getLine(t)}function s(e,t,r){return r?a(e)!=a(e+t):!a(e)&&a(e+t)}var l,c,u=t.line,f=e.firstLine(),h=e.lastLine(),d=u;if(o){for(;d>=f&&h>=d&&n>0;)s(d,o)&&n--,d+=o;return new r(d,0)}var p=e.state.vim;if(p.visualLine&&s(u,1,!0)){var m=p.sel.anchor;s(m.line,-1,!0)&&(i&&m.line==u||(u+=1))}var g=a(u);for(d=u;h>=d&&n;d++)s(d,1,!0)&&(i&&a(d)==g||n--);for(c=new r(d,0),d>h&&!g?g=!0:i=!1,d=u;d>f&&(i&&a(d)!=g&&d!=u||!s(d,-1,!0));d--);return l=new r(d,0),{start:l,end:c}}function xt(e,t,n,o){var i,a,s=t,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],c={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],u=e.getLine(s.line).charAt(s.ch),f=u===c?1:0;if(i=e.scanForBracket(r(s.line,s.ch+f),-1,null,{bracketRegex:l}),a=e.scanForBracket(r(s.line,s.ch+f),1,null,{bracketRegex:l}),!i||!a)return{start:s,end:s};if(i=i.pos,a=a.pos,i.line==a.line&&i.ch>a.ch||i.line>a.line){var h=i;i=a,a=h}return o?a.ch+=1:i.ch+=1,{start:i,end:a}}function Mt(e,t,n,o){var i,a,s,l,c=z(t),u=e.getLine(c.line),f=u.split(""),h=f.indexOf(n);if(c.ch-1&&!i;s--)f[s]==n&&(i=s+1);else i=c.ch+1;if(i&&!a)for(s=i,l=f.length;l>s&&!a;s++)f[s]==n&&(a=s);return i&&a?(o&&(--i,++a),{start:r(c.line,i),end:r(c.line,a)}):{start:c,end:c}}function St(){}function bt(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new St)}function At(e,t,r,n,o){e.openDialog?e.openDialog(t,n,{bottom:!0,value:o.value,onKeyDown:o.onKeyDown,onKeyUp:o.onKeyUp}):n(prompt(r,""))}function Lt(e){var t=Tt(e)||[];if(!t.length)return[];var r=[];if(0===t[0]){for(var n=0;n'+t+"
    ",{bottom:!0,duration:5e3}):alert(t)}function Pt(e,t){var r="";return e&&(r+=''+e+""),r+=' ',t&&(r+='',r+=t,r+=""),r}function Nt(e,t){var r=(t.prefix||"")+" "+(t.desc||""),n=Pt(t.prefix,t.desc);At(e,n,r,t.onClose,t)}function jt(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var r=["global","multiline","ignoreCase","source"],n=0;ns;s++){var l=a.find(t);if(0==s&&l&&_(a.from(),i)&&(l=a.find(t)),!l&&(a=e.getSearchCursor(n,t?r(e.lastLine()):r(e.firstLine(),0)),!a.find(t)))return}return a.from()})}function zt(e){var t=bt(e);e.removeOverlay(bt(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function _t(e,t,r){return"number"!=typeof e&&(e=e.line),t instanceof Array?v(e,t):r?e>=t&&r>=e:e==t}function Wt(e){var t=e.getScrollInfo(),r=6,n=10,o=e.coordsChar({left:0,top:r+t.top},"local"),i=t.clientHeight-n+t.top,a=e.coordsChar({left:0,top:i},"local");return{top:o.line,bottom:a.line}}function qt(t,r,n,o,i,a,s,l,c){function u(){t.operation(function(){for(;!m;)f(),h();d()})}function f(){var e=t.getRange(a.from(),a.to()),r=e.replace(s,l);a.replace(r)}function h(){for(var e;e=a.findNext()&&_t(a.from(),o,i);)if(n||!g||a.from().line!=g.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),g=a.from(),void(m=!1);m=!0}function d(e){if(e&&e(),t.focus(),g){t.setCursor(g);var r=t.state.vim;r.exMode=!1,r.lastHPos=r.lastHSPos=g.ch}c&&c()}function p(r,n,o){e.e_stop(r);var i=e.keyName(r);switch(i){case"Y":f(),h();break;case"N":h();break;case"A":var a=c;c=void 0,t.operation(u),c=a;break;case"L":f();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":d(o)}return m&&d(o),!0}t.state.vim.exMode=!0;var m=!1,g=a.from();return h(),m?void Bt(t,"No matches for "+s.source):r?void Nt(t,{prefix:"replace with "+l+" (y/n/a/q/l)",onKeyDown:p}):(u(),void(c&&c()))}function Vt(t){var r=t.state.vim,n=Cr.macroModeState,o=Cr.registerController.getRegister("."),i=n.isPlaying,a=n.lastInsertModeChanges,s=[];if(!i){for(var l=a.inVisualBlock?r.lastSelection.visualBlock.height:1,c=a.changes,s=[],u=0;u1&&(or(t,r,r.insertModeRepeat-1,!0),r.lastEditInputState.repeatOverride=r.insertModeRepeat),delete r.insertModeRepeat,r.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),o.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),n.isRecording&&Gt(n)}function Ut(e){t.push(e)}function Jt(e,t,r,n,o){var i={keys:e,type:t};i[t]=r,i[t+"Args"]=n;for(var a in o)i[a]=o[a];Ut(i)}function $t(t,r,n,o){var i=Cr.registerController.getRegister(o),a=i.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=i.searchQueries.slice(0);for(var l=0;l|<\w+>|./.exec(f),u=c[0],f=f.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"),r.insertMode){var h=i.insertModeChanges[s++].changes;Cr.macroModeState.lastInsertModeChanges.changes=h,ir(t,h,1),Vt(t)}n.isPlaying=!1}function Qt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=Cr.registerController.getRegister(r);n&&n.pushText(t)}}function Gt(e){if(!e.isPlaying){var t=e.latestRegister,r=Cr.registerController.getRegister(t);r&&r.pushInsertModeChanges(e.lastInsertModeChanges)}}function Yt(e,t){if(!e.isPlaying){var r=e.latestRegister,n=Cr.registerController.getRegister(r);n&&n.pushSearchQuery(t)}}function Xt(e,t){var r=Cr.macroModeState,n=r.lastInsertModeChanges;if(!r.isPlaying)for(;t;){if(n.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var o=t.text.join("\n");n.changes.push(o)}t=t.next}}function Zt(e){var t=e.state.vim;if(t.insertMode){var r=Cr.macroModeState;if(r.isPlaying)return;var n=r.lastInsertModeChanges;n.expectCursorActivityForChange?n.expectCursorActivityForChange=!1:n.changes=[]}else e.curOp.isVimOp||tr(e,t);t.visualMode&&er(e)}function er(e){var t=e.state.vim,r=z(t.sel.head),n=N(r,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(r,n,{className:"cm-animate-fat-cursor"})}function tr(t,r){var n=t.getCursor("anchor"),o=t.getCursor("head");if(r.visualMode&&_(o,n)&&J(t,o.line)>o.ch?st(t,!1):r.visualMode||r.insertMode||!t.somethingSelected()||(r.visualMode=!0,r.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"})),r.visualMode){var i=W(o,n)?0:-1,a=W(o,n)?-1:0;o=N(o,0,i),n=N(n,0,a),r.sel={anchor:n,head:o},Ct(t,r,"<",q(o,n)),Ct(t,r,">",V(o,n))}else r.insertMode||(r.lastHPos=t.getCursor().ch)}function rr(e){this.keyName=e}function nr(t){function r(){return o.changes.push(new rr(i)),!0}var n=Cr.macroModeState,o=n.lastInsertModeChanges,i=e.keyName(t);i&&(-1!=i.indexOf("Delete")||-1!=i.indexOf("Backspace"))&&e.lookupKey(i,"vim-insert",r)}function or(e,t,r,n){function o(){s?xr.processAction(e,t,t.lastEditActionCommand):xr.evalInput(e,t)}function i(r){if(a.lastInsertModeChanges.changes.length>0){r=t.lastEditActionCommand?r:1;var n=a.lastInsertModeChanges;ir(e,n.changes,r)}}var a=Cr.macroModeState;a.isPlaying=!0;var s=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;r>c;c++)o(),i(1);else n||o(),i(r);t.inputState=l,t.insertMode&&!n&&Vt(e),a.isPlaying=!1}function ir(t,r,n){function o(r){return"string"==typeof r?e.commands[r](t):r(t),!0}var i=t.getCursor("head"),a=Cr.macroModeState.lastInsertModeChanges.inVisualBlock;if(a){var s=t.state.vim,l=s.lastSelection,c=j(l.anchor,l.head);Z(t,i,c.line+1),n=t.listSelections().length,t.setCursor(i)}for(var u=0;n>u;u++){a&&t.setCursor(N(i,u,0));for(var f=0;f"]),mr=[].concat(fr,hr,dr,["-",'"',".",":","/"]),gr={},vr=function(){function e(e,t,s){function l(t){var o=++n%r,i=a[o];i&&i.clear(),a[o]=e.setBookmark(t)}var c=n%r,u=a[c];if(u){var f=u.find();f&&!_(f,t)&&l(t)}else l(t);l(s),o=n,i=n-r+1,0>i&&(i=0)}function t(e,t){n+=t,n>o?n=o:i>n&&(n=i);var s=a[(r+n)%r];if(s&&!s.find()){var l,c=t>0?1:-1,u=e.getCursor();do if(n+=c,s=a[(r+n)%r],s&&(l=s.find())&&!_(u,l))break;while(o>n&&n>i)}return s}var r=100,n=-1,o=0,i=0,a=new Array(r);return{cachedCursor:void 0,add:e,move:t}},yr=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var e=Cr.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var r=Cr.registerController.getRegister(t);r&&(r.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var Cr,kr,wr={buildKeyMap:function(){},getRegisterController:function(){return Cr.registerController},resetVimGlobalState_:M,getVimGlobalState_:function(){return Cr},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:rr,map:function(e,t,r){Ir.map(e,t,r)},setOption:C,getOption:k,defineOption:y,defineEx:function(e,t,r){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered');Er[e]=r,Ir.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,r){var n=this.findKey(e,t,r);return"function"==typeof n?n():void 0},findKey:function(r,n,o){function i(){var e=Cr.macroModeState;if(e.isRecording){if("q"==n)return e.exitMacroRecordMode(),b(r),!0;"mapping"!=o&&Qt(e,n)}}function a(){return""==n?(b(r),f.visualMode?st(r):f.insertMode&&Vt(r),!0):void 0}function s(t){for(var o;t;)o=/<\w+-.+?>|<\w+>|./.exec(t),n=o[0],t=t.substring(o.index+n.length),e.Vim.handleKey(r,n,"mapping")}function l(){if(a())return!0;for(var e=f.inputState.keyBuffer=f.inputState.keyBuffer+n,o=1==n.length,i=xr.matchCommand(e,t,f.inputState,"insert");e.length>1&&"full"!=i.type;){var e=f.inputState.keyBuffer=e.slice(1),s=xr.matchCommand(e,t,f.inputState,"insert");"none"!=s.type&&(i=s)}if("none"==i.type)return b(r),!1;if("partial"==i.type)return kr&&window.clearTimeout(kr),kr=window.setTimeout(function(){f.insertMode&&f.inputState.keyBuffer&&b(r)},k("insertModeEscKeysTimeout")),!o;if(kr&&window.clearTimeout(kr),o){var l=r.getCursor();r.replaceRange("",N(l,0,-(e.length-1)),l,"+input")}return b(r),i.command}function c(){if(i()||a())return!0;var e=f.inputState.keyBuffer=f.inputState.keyBuffer+n;if(/^[1-9]\d*$/.test(e))return!0;var o=/^(\d*)(.*)$/.exec(e);if(!o)return b(r),!1;var s=f.visualMode?"visual":"normal",l=xr.matchCommand(o[2]||o[1],t,f.inputState,s);if("none"==l.type)return b(r),!1;if("partial"==l.type)return!0;f.inputState.keyBuffer="";var o=/^(\d*)(.*)$/.exec(e);return o[1]&&"0"!=o[1]&&f.inputState.pushRepeatDigit(o[1]),l.command}var u,f=x(r);return u=f.insertMode?l():c(),u===!1?void 0:u===!0?function(){}:function(){return r.operation(function(){r.curOp.isVimOp=!0;try{"keyToKey"==u.type?s(u.toKeys):xr.processCommand(r,f,u)}catch(t){throw r.state.vim=void 0,x(r),e.Vim.suppressErrorLogging||console.log(t),t}return!0})}},handleEx:function(e,t){Ir.processCommand(e,t)},defineMotion:O,defineAction:I,defineOperator:E,mapCommand:Jt,_mapCommand:Ut,exitVisualMode:st,exitInsertMode:Vt};S.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},S.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},A.prototype={setText:function(e,t,r){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!r},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(yr(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},L.prototype={pushText:function(e,t,r,n,o){n&&"\n"==r.charAt(0)&&(r=r.slice(1)+"\n"),n&&"\n"!==r.charAt(r.length-1)&&(r+="\n");var i=this.isValidRegister(e)?this.getRegister(e):null;if(!i){switch(t){case"yank":this.registers[0]=new A(r,n,o);break;case"delete":case"change":-1==r.indexOf("\n")?this.registers["-"]=new A(r,n):(this.shiftNumericRegisters_(),this.registers[1]=new A(r,n))}return void this.unnamedRegister.setText(r,n,o)}var a=m(e);a?i.pushText(r,n):i.setText(r,n,o),this.unnamedRegister.setText(i.toString(),n)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new A),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&v(e,mr)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},T.prototype={nextMatch:function(e,t){var r=this.historyBuffer,n=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+n;t?o>=0:o=r.length?(this.iterator=r.length,this.initialPrefix):0>o?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var xr={matchCommand:function(e,t,r,n){var o=F(e,t,n,r);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var i,a=0;a"==i.keys.slice(-11)&&(r.selectedCharacter=H(e)),{type:"full",command:i}},processCommand:function(e,t,r){switch(t.inputState.repeatOverride=r.repeatOverride,r.type){case"motion":this.processMotion(e,t,r);break;case"operator":this.processOperator(e,t,r);break;case"operatorMotion":this.processOperatorMotion(e,t,r);break;case"action":this.processAction(e,t,r);break;case"search":this.processSearch(e,t,r),b(e);break;case"ex":case"keyToEx":this.processEx(e,t,r),b(e)}},processMotion:function(e,t,r){t.inputState.motion=r.motion,t.inputState.motionArgs=P(r.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,r){var n=t.inputState;if(n.operator){if(n.operator==r.operator)return n.motion="expandToLine",n.motionArgs={linewise:!0},void this.evalInput(e,t);b(e)}n.operator=r.operator,n.operatorArgs=P(r.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,r){var n=t.visualMode,o=P(r.operatorMotionArgs);o&&n&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,r),n||this.processMotion(e,t,r)},processAction:function(e,t,r){var n=t.inputState,o=n.getRepeat(),i=!!o,a=P(r.actionArgs)||{};n.selectedCharacter&&(a.selectedCharacter=n.selectedCharacter),r.operator&&this.processOperator(e,t,r),r.motion&&this.processMotion(e,t,r),(r.motion||r.operator)&&this.evalInput(e,t),a.repeat=o||1,a.repeatIsExplicit=i,a.registerName=n.registerName,b(e),t.lastMotion=null,r.isEdit&&this.recordLastEdit(t,n,r),br[r.action](e,a,t)},processSearch:function(t,r,n){function o(e,o,i){Cr.searchHistoryController.pushInput(e),Cr.searchHistoryController.reset();try{Ft(t,e,o,i)}catch(a){return void Bt(t,"Invalid regex: "+e)}xr.processMotion(t,r,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}function i(e){t.scrollTo(h.left,h.top),o(e,!0,!0);var r=Cr.macroModeState;r.isRecording&&Yt(r,e)}function a(r,n,o){var i,a=e.keyName(r);"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=Cr.searchHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&Cr.searchHistoryController.reset();var s;try{s=Ft(t,n,!0,!0)}catch(r){}s?t.scrollIntoView(Dt(t,!l,s),30):(zt(t),t.scrollTo(h.left,h.top))}function s(r,n,o){var i=e.keyName(r);("Esc"==i||"Ctrl-C"==i||"Ctrl-["==i)&&(Cr.searchHistoryController.pushInput(n),Cr.searchHistoryController.reset(),Ft(t,f),zt(t),t.scrollTo(h.left,h.top),e.e_stop(r),o(),t.focus())}if(t.getSearchCursor){var l=n.searchArgs.forward,c=n.searchArgs.wholeWordOnly;bt(t).setReversed(!l);var u=l?"/":"?",f=bt(t).getQuery(),h=t.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var d=Cr.macroModeState;if(d.isPlaying){var p=d.replaySearchQueries.shift();o(p,!0,!1)}else Nt(t,{onClose:i,prefix:u,desc:Tr,onKeyUp:a,onKeyDown:s});break;case"wordUnderCursor":var m=ft(t,!1,!0,!1,!0),g=!0;if(m||(m=ft(t,!1,!0,!1,!1),g=!1),!m)return;var p=t.getLine(m.start.line).substring(m.start.ch,m.end.ch);p=g&&c?"\\b"+p+"\\b":G(p),Cr.jumpList.cachedCursor=t.getCursor(),t.setCursor(m.start),o(p,!0,!1)}}},processEx:function(t,r,n){function o(e){Cr.exCommandHistoryController.pushInput(e),Cr.exCommandHistoryController.reset(),Ir.processCommand(t,e)}function i(r,n,o){var i,a=e.keyName(r);("Esc"==a||"Ctrl-C"==a||"Ctrl-["==a)&&(Cr.exCommandHistoryController.pushInput(n),Cr.exCommandHistoryController.reset(),e.e_stop(r),o(),t.focus()),"Up"==a||"Down"==a?(i="Up"==a?!0:!1,n=Cr.exCommandHistoryController.nextMatch(n,i)||"",o(n)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&Cr.exCommandHistoryController.reset()}"keyToEx"==n.type?Ir.processCommand(t,n.exArgs.input):r.visualMode?Nt(t,{onClose:o,prefix:":",value:"'<,'>",onKeyDown:i}):Nt(t,{onClose:o,prefix:":",onKeyDown:i})},evalInput:function(e,t){var n,o,i,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},f=a.registerName,h=t.sel,d=z(t.visualMode?h.head:e.getCursor("head")),p=z(t.visualMode?h.anchor:e.getCursor("anchor")),m=z(d),g=z(p);if(c&&this.recordLastEdit(t,a),i=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat(),i>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===i)&&(i=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=i,b(e),s){var v=Mr[s](e,d,l,t);if(t.lastMotion=Mr[s],!v)return;if(l.toJumplist){var y=Cr.jumpList,C=y.cachedCursor;C?(ht(e,C,v),delete y.cachedCursor):ht(e,d,v)}v instanceof Array?(o=v[0],n=v[1]):n=v,n||(n=z(d)),t.visualMode?(t.visualBlock&&1/0===n.ch||(n=B(e,n,t.visualBlock)),o&&(o=B(e,o,!0)),o=o||g,h.anchor=o,h.head=n,ot(e),Ct(e,t,"<",W(o,n)?o:n),Ct(e,t,">",W(o,n)?n:o)):c||(n=B(e,n),e.setCursor(n.line,n.ch)) --}if(c){if(u.lastSel){o=g;var k=u.lastSel,w=Math.abs(k.head.line-k.anchor.line),x=Math.abs(k.head.ch-k.anchor.ch);n=k.visualLine?r(g.line+w,g.ch):k.visualBlock?r(g.line+w,g.ch+x):k.head.line==k.anchor.line?r(g.line,g.ch+x):r(g.line+w,g.ch),t.visualMode=!0,t.visualLine=k.visualLine,t.visualBlock=k.visualBlock,h=t.sel={anchor:o,head:n},ot(e)}else t.visualMode&&(u.lastSel={anchor:z(h.anchor),head:z(h.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var M,S,A,L,T;if(t.visualMode){if(M=q(h.head,h.anchor),S=V(h.head,h.anchor),A=t.visualLine||u.linewise,L=t.visualBlock?"block":A?"line":"char",T=it(e,{anchor:M,head:S},L),A){var O=T.ranges;if("block"==L)for(var R=0;Rl&&i.line==c||l>u&&i.line==u?void 0:(n.toFirstChar&&(a=ut(e.getLine(l)),o.lastHPos=a),o.lastHSPos=e.charCoords(r(l,a),"div").left,r(l,a))},moveByDisplayLines:function(e,t,n,o){var i=t;switch(o.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:o.lastHSPos=e.charCoords(i,"div").left}var a=n.repeat,s=e.findPosV(i,n.forward?a:-a,"line",o.lastHSPos);if(s.hitSide)if(n.forward)var l=e.charCoords(s,"div"),c={top:l.top+8,left:o.lastHSPos},s=e.coordsChar(c,"div");else{var u=e.charCoords(r(e.firstLine(),0),"div");u.left=o.lastHSPos,s=e.coordsChar(u,"div")}return o.lastHPos=s.ch,s},moveByPage:function(e,t,r){var n=t,o=r.repeat;return e.findPosV(n,r.forward?o:-o,"page")},moveByParagraph:function(e,t,r){var n=r.forward?1:-1;return wt(e,t,r.repeat,n)},moveByScroll:function(e,t,r,n){var o=e.getScrollInfo(),i=null,a=r.repeat;a||(a=o.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");r.repeat=a;var i=Mr.moveByDisplayLines(e,t,r,n);if(!i)return null;var l=e.charCoords(i,"local");return e.scrollTo(null,o.top+l.top-s.top),i},moveByWords:function(e,t,r){return gt(e,t,r.repeat,!!r.forward,!!r.wordEnd,!!r.bigWord)},moveTillCharacter:function(e,t,r){var n=r.repeat,o=vt(e,n,r.forward,r.selectedCharacter),i=r.forward?-1:1;return dt(i,r),o?(o.ch+=i,o):null},moveToCharacter:function(e,t,r){var n=r.repeat;return dt(0,r),vt(e,n,r.forward,r.selectedCharacter)||t},moveToSymbol:function(e,t,r){var n=r.repeat;return pt(e,n,r.forward,r.selectedCharacter)||t},moveToColumn:function(e,t,r,n){var o=r.repeat;return n.lastHPos=o-1,n.lastHSPos=e.charCoords(t,"div").left,yt(e,o)},moveToEol:function(e,t,n,o){var i=t;o.lastHPos=1/0;var a=r(i.line+n.repeat-1,1/0),s=e.clipPos(a);return s.ch--,o.lastHSPos=e.charCoords(s,"div").left,a},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return r(n.line,ut(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n,o=t,i=o.line,a=o.ch,s=e.getLine(i);do if(n=s.charAt(a++),n&&d(n)){var l=e.getTokenTypeAt(r(i,a));if("string"!==l&&"comment"!==l)break}while(n);if(n){var c=e.findMatchingBracket(r(i,a));return c.to}return o},moveToStartOfLine:function(e,t){return r(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var o=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(o=n.repeat-e.getOption("firstLineNumber")),r(o,ut(e.getLine(o)))},textObjectManipulation:function(e,t,r,n){var o={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},i={"'":!0,'"':!0},a=r.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!r.textObjectInner;if(o[a])s=xt(e,t,a,l);else if(i[a])s=Mt(e,t,a,l);else if("W"===a)s=ft(e,l,!0,!0);else if("w"===a)s=ft(e,l,!0,!1);else{if("p"!==a)return null;if(s=wt(e,t,r.repeat,0,l),r.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var c=n.inputState.operatorArgs;c&&(c.linewise=!0),s.end.line--}}return e.state.vim.visualMode?nt(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,r){var n=Cr.lastChararacterSearch,o=r.repeat,i=r.forward===n.forward,a=(n.increment?1:0)*(i?-1:1);e.moveH(-a,"char"),r.inclusive=i?!0:!1;var s=vt(e,o,i,n.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}},Sr={change:function(t,r,n){var o,i,a=t.state.vim;if(Cr.macroModeState.lastInsertModeChanges.inVisualBlock=a.visualBlock,a.visualMode){i=t.getSelection();var s=R("",n.length);t.replaceSelections(s),o=q(n[0].head,n[0].anchor)}else{var l=n[0].anchor,c=n[0].head;if(i=t.getRange(l,c),!g(i)){var u=/\s+$/.exec(i);u&&(c=N(c,0,-u[0].length),i=i.slice(0,-u[0].length))}var f=c.line-1==t.lastLine();t.replaceRange("",l,c),r.linewise&&!f&&(e.commands.newlineAndIndent(t),l.ch=null),o=l}Cr.registerController.pushText(r.registerName,"change",i,r.linewise,n.length>1),br.enterInsertMode(t,{head:o},t.state.vim)},"delete":function(e,t,n){var o,i,a=e.state.vim;if(a.visualBlock){i=e.getSelection();var s=R("",n.length);e.replaceSelections(s),o=n[0].anchor}else{var l=n[0].anchor,c=n[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=r(l.line-1,J(e,l.line-1))),i=e.getRange(l,c),e.replaceRange("",l,c),o=l,t.linewise&&(o=Mr.moveToFirstNonWhiteSpaceCharacter(e,l))}return Cr.registerController.pushText(t.registerName,"delete",i,t.linewise,a.visualBlock),B(e,o)},indent:function(e,t,r){var n=e.state.vim,o=r[0].anchor.line,i=n.visualBlock?r[r.length-1].anchor.line:r[0].head.line,a=n.visualMode?t.repeat:1;t.linewise&&i--;for(var s=o;i>=s;s++)for(var l=0;a>l;l++)e.indentLine(s,t.indentRight);return Mr.moveToFirstNonWhiteSpaceCharacter(e,r[0].anchor)},changeCase:function(e,t,r,n,o){for(var i=e.getSelections(),a=[],s=t.toLower,l=0;lc.top?(l.line+=(s-c.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u=a.anchor.line?N(a.head,0,1):r(a.anchor.line,0);else if("inplace"==i&&o.visualMode)return;t.setOption("keyMap","vim-insert"),t.setOption("disableInput",!1),n&&n.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})),Cr.macroModeState.isPlaying||(t.on("change",Xt),e.on(t.getInputField(),"keydown",nr)),o.visualMode&&st(t),Z(t,s,l)}},toggleVisualMode:function(t,n,o){var i,a=n.repeat,s=t.getCursor();o.visualMode?o.visualLine^n.linewise||o.visualBlock^n.blockwise?(o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t)):st(t):(o.visualMode=!0,o.visualLine=!!n.linewise,o.visualBlock=!!n.blockwise,i=B(t,r(s.line,s.ch+a-1),!0),o.sel={anchor:s,head:i},e.signal(t,"vim-mode-change",{mode:"visual",subMode:o.visualLine?"linewise":o.visualBlock?"blockwise":""}),ot(t),Ct(t,o,"<",q(s,i)),Ct(t,o,">",V(s,i)))},reselectLastSelection:function(t,r,n){var o=n.lastSelection;if(n.visualMode&&rt(t,n),o){var i=o.anchorMark.find(),a=o.headMark.find();if(!i||!a)return;n.sel={anchor:i,head:a},n.visualMode=!0,n.visualLine=o.visualLine,n.visualBlock=o.visualBlock,ot(t),Ct(t,n,"<",q(i,a)),Ct(t,n,">",V(i,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var o,i;if(n.visualMode){if(o=e.getCursor("anchor"),i=e.getCursor("head"),W(i,o)){var a=i;i=o,o=a}i.ch=J(e,i.line)-1}else{var s=Math.max(t.repeat,2);o=e.getCursor(),i=B(e,r(o.line+s-1,1/0))}for(var l=0,c=o.line;cr)return"";if(e.getOption("indentWithTabs")){var n=Math.floor(r/s);return Array(n+1).join(" ")}return Array(r+1).join(" ")});a+=h?"\n":""}if(t.repeat>1)var a=Array(t.repeat+1).join(a);var p=i.linewise,m=i.blockwise;if(p)n.visualMode?a=n.visualLine?a.slice(0,-1):"\n"+a.slice(0,a.length-1)+"\n":t.after?(a="\n"+a.slice(0,a.length-1),o.ch=J(e,o.line)):o.ch=0;else{if(m){a=a.split("\n");for(var g=0;ge.lastLine()&&e.replaceRange("\n",r(A,0));var L=J(e,A);Lu.length&&(i=u.length),a=r(l.line,i)}if("\n"==s)o.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var f=t.getRange(l,a);if(f=f.replace(/[^\n]/g,s),o.visualBlock){var h=new Array(t.getOption("tabSize")+1).join(" ");f=t.getSelection(),f=f.replace(/\t/g,h).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(f)}else t.replaceRange(f,l,a);o.visualMode?(l=W(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),st(t,!1)):t.setCursor(N(a,0,-1))}},incrementNumberToken:function(e,t){for(var n,o,i,a,s,l=e.getCursor(),c=e.getLine(l.line),u=/-?\d+/g;null!==(n=u.exec(c))&&(s=n[0],o=n.index,i=o+s.length,!(l.ch=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb?!0:!1}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};y("pcre",!0,"boolean"),St.prototype={getQuery:function(){return Cr.query},setQuery:function(e){Cr.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return Cr.isReversed},setReversed:function(e){Cr.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var Tr="(Javascript regexp)",Or=[{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:"set"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],Rr=function(){this.buildCommandMap_()};Rr.prototype={processCommand:function(t,r,n){var o=t.state.vim,i=Cr.registerController.getRegister(":"),a=i.toString();o.visualMode&&st(t);var s=new e.StringStream(r);i.setText(r);var l=n||{};l.input=r;try{this.parseInput_(t,s,l)}catch(c){throw Bt(t,c),c}var u,f;if(l.commandName){if(u=this.matchCommand_(l.commandName)){if(f=u.name,u.excludeFromCommandHistory&&i.setText(a),this.parseCommandArgs_(s,l,u),"exToKey"==u.type){for(var h=0;h0;t--){var r=e.substring(0,t);if(this.commandMap_[r]){var n=this.commandMap_[r];if(0===n.name.indexOf(e))return n}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e
    ";if(r){var i;r=r.join("");for(var a=0;a"}}else for(var i in n){var l=n[i].toString();l.length&&(o+='"'+i+" "+l+"
    ")}Bt(e,o)},sort:function(t,n){function o(){if(n.argString){var t=new e.StringStream(n.argString);if(t.eat("!")&&(a=!0),t.eol())return;if(!t.eatSpace())return"Invalid arguments";var r=t.match(/[a-z]+/);if(r){r=r[0],s=-1!=r.indexOf("i"),l=-1!=r.indexOf("u");var o=-1!=r.indexOf("d")&&1,i=-1!=r.indexOf("x")&&1,u=-1!=r.indexOf("o")&&1;if(o+i+u>1)return"Invalid arguments";c=o&&"decimal"||i&&"hex"||u&&"octal"}t.eatSpace()&&t.match(/\/.*\//)}}function i(e,t){if(a){var r;r=e,e=t,t=r}s&&(e=e.toLowerCase(),t=t.toLowerCase());var n=c&&g.exec(e),o=c&&g.exec(t);return n?(n=parseInt((n[1]+n[2]).toLowerCase(),v),o=parseInt((o[1]+o[2]).toLowerCase(),v),n-o):t>e?-1:1}var a,s,l,c,u=o();if(u)return void Bt(t,u+": "+n.argString);var f=n.line||t.firstLine(),h=n.lineEnd||n.line||t.lastLine();if(f!=h){var d=r(f,0),p=r(h,J(t,h)),m=t.getRange(d,p).split("\n"),g="decimal"==c?/(-?)([\d]+)/:"hex"==c?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==c?/([0-7]+)/:null,v="decimal"==c?10:"hex"==c?16:"octal"==c?8:null,y=[],C=[];if(c)for(var k=0;k=h;h++){var d=c.test(e.getLine(h));d&&(u.push(h+1),f+=e.getLine(h)+"
    ")}if(!n)return void Bt(e,f);var p=0,m=function(){if(p=u)return void Bt(t,"Invalid argument: "+r.argString.substring(i));for(var f=0;u-c>=f;f++){var d=String.fromCharCode(c+f);delete n.marks[d]}}else delete n.marks[a]}}},Ir=new Rr;return e.keyMap.vim={attach:a,detach:i,call:s},y("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(t){var r=e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent;r(t)},fallthrough:["default"],attach:a,detach:i,call:s},e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:a,detach:i,call:s},M(),wr};e.Vim=n()}); -\ 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){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()}a.defineExtension("addPanel",function(a,d){d=d||{},this.state.panels||c(this);var e=this.state.panels,f=e.wrapper,g=this.getWrapperElement();d.after instanceof b&&!d.after.cleared?f.insertBefore(a,d.before.node.nextSibling):d.before instanceof b&&!d.before.cleared?f.insertBefore(a,d.before.node):d.replace instanceof b&&!d.replace.cleared?(f.insertBefore(a,d.replace.node),d.replace.clear()):"bottom"==d.position?f.appendChild(a):"before-bottom"==d.position?f.insertBefore(a,g.nextSibling):"after-top"==d.position?f.insertBefore(a,g):f.insertBefore(a,f.firstChild);var h=d&&d.height||a.offsetHeight;return this._setSize(null,e.heightLeft-=h),e.panels++,new b(this,a,d,h)}),b.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var a=this.cm.state.panels;this.cm._setSize(null,a.heightLeft+=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.height+=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]:k[b]}function c(a){return function(b){return g(b,a)}}function d(a){var b=a.state.closeBrackets;if(!b)return null;var c=a.getModeAt(a.getCursor());return c.closeBrackets||b}function e(c){var e=d(c);if(!e||c.getOption("disableInput"))return a.Pass;for(var f=b(e,"pairs"),g=c.listSelections(),h=0;h=0;h--){var k=g[h].head;c.replaceRange("",l(k.line,k.ch-1),l(k.line,k.ch+1))}}function f(c){var e=d(c),f=e&&b(e,"explode");if(!f||c.getOption("disableInput"))return a.Pass;for(var g=c.listSelections(),h=0;h1&&n.indexOf(e)>=0&&c.getRange(l(u.line,u.ch-2),u)==e+e&&(u.ch<=2||c.getRange(l(u.line,u.ch-3),l(u.line,u.ch-2))!=e))s="addFour";else if(o){if(a.isWordChar(m)||!j(c,u,e))return a.Pass;s="both"}else{if(!q||c.getLine(u.line).length!=u.ch&&!h(m,g)&&!/\s/.test(m))return a.Pass;s="both"}else s=n.indexOf(e)>=0&&c.getRange(u,l(u.line,u.ch+3))==e+e+e?"skipThree":"skip";if(k){if(k!=s)return a.Pass}else k=s}var v=i%2?g.charAt(i-1):e,w=i%2?e:g.charAt(i+1);c.operation(function(){if("skip"==k)c.execCommand("goCharRight");else if("skipThree"==k)for(var a=0;3>a;a++)c.execCommand("goCharRight");else if("surround"==k){for(var b=c.getSelections(),a=0;a-1&&c%2==1}function i(a,b){var c=a.getRange(l(b.line,b.ch-1),l(b.line,b.ch+1));return 2==c.length?c:null}function j(b,c,d){var e=b.getLine(c.line),f=b.getTokenAt(c);if(/\bstring2?\b/.test(f.type))return!1;var g=new a.StringStream(e.slice(0,c.ch)+d+e.slice(c.ch),4);for(g.pos=g.start=f.start;;){var h=b.getMode().token(g,f.state);if(g.pos>=c.ch+1)return/\bstring2?\b/.test(h);g.start=g.pos}}var k={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},l=a.Pos;a.defineOption("autoCloseBrackets",!1,function(b,c,d){d&&d!=a.Init&&(b.removeKeyMap(n),b.state.closeBrackets=null),c&&(b.state.closeBrackets=c,b.addKeyMap(n))});for(var m=k.pairs+"`",n={Backspace:e,Enter:f},o=0;oj.ch&&(r=r.slice(0,r.length-k.end+j.ch));var s=r.toLowerCase();if(!r||"string"==k.type&&(k.end!=j.ch||!/[\"\']/.test(k.string.charAt(k.string.length-1))||1==k.string.length)||"tag"==k.type&&"closeTag"==m.type||k.string.indexOf("/")==k.string.length-1||p&&e(p,s)>-1||f(b,r,j,m,!0))return a.Pass;var t=q&&e(q,s)>-1;d[i]={indent:t,text:">"+(t?"\n\n":"")+"",newPos:t?a.Pos(j.line+1,0):a.Pos(j.line,j.ch+1)}}for(var i=c.length-1;i>=0;i--){var u=d[i];b.replaceRange(u.text,c[i].head,c[i].anchor,"+insert");var v=b.listSelections().slice(0);v[i]={head:u.newPos,anchor:u.newPos},b.setSelections(v),u.indent&&(b.indentLine(u.newPos.line,null,!0),b.indentLine(u.newPos.line+1,null,!0))}}function c(b,c){for(var d=b.listSelections(),e=[],g=c?"/":"";else{if("htmlmixed"!=b.getMode().name||"css"!=k.mode.name)return a.Pass;e[h]=g+"style>"}else{if(!l.context||!l.context.tagName||f(b,l.context.tagName,i,l))return a.Pass;e[h]=g+l.context.tagName+">"}}b.replaceSelections(e),d=b.listSelections();for(var h=0;hc;++c)if(a[c]==b)return c;return-1}function f(b,c,d,e,f){if(!a.scanForClosingTag)return!1;var g=Math.min(b.lastLine()+1,d.line+500),h=a.scanForClosingTag(b,d,null,g);if(!h||h.tag!=c)return!1;for(var i=e.context,j=f?1:0;i&&i.tagName==c;i=i.prev)++j;d=h.to;for(var k=1;j>k;k++){var l=a.scanForClosingTag(b,d,null,g);if(!l||l.tag!=c)return!1;d=l.to}return!0}a.defineOption("autoCloseTags",!1,function(c,e,f){if(f!=a.Init&&f&&c.removeKeyMap("autoCloseTags"),e){var g={name:"autoCloseTags"};("object"!=typeof e||e.whenClosing)&&(g["'/'"]=function(a){return d(a)}),("object"!=typeof e||e.whenOpening)&&(g["'>'"]=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,e){var f=a.getLineHandle(b.line),i=b.ch-1,j=i>=0&&h[f.text.charAt(i)]||h[f.text.charAt(++i)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(d&&k>0!=(i==b.ch))return null;var l=a.getTokenTypeAt(g(b.line,i+1)),m=c(a,g(b.line,i+(k>0?1:0)),k,l||null,e);return null==m?null:{from:g(b.line,i),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-(0>c?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())?!1:null}function d(a,c,d){for(var e=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},i=null;a.defineOption("matchBrackets",!1,function(b,c,d){d&&d!=a.Init&&b.off("cursorActivity",e),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 b(this,a,c,d)}),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 e=c.ch,i=0;;){var j=0>=e?-1:h.lastIndexOf(d,e-1);if(-1!=j){if(1==i&&j=o;++o)for(var p=b.getLine(o),q=o==g?e:0;;){var r=p.indexOf(i,q),s=p.indexOf(j,q);if(0>r&&(r=p.length),0>s&&(s=p.length),q=Math.min(r,s),q==p.length)break;if(b.getTokenTypeAt(a.Pos(o,q+1))==f)if(q==r)++m;else if(!--m){k=o,l=q;break a}++q}if(null!=k&&(g!=k||l!=e))return{from:a.Pos(g,e),to:a.Pos(k,l)}}}),a.registerHelper("fold","import",function(b,c){function d(c){if(cb.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);f>=e;++e){var g=b.getLine(e),h=g.indexOf(";");if(-1!=h)return{startCh:d.end,end:a.Pos(e,h)}}}var e,c=c.line,f=d(c);if(!f||d(c-1)||(e=d(c-2))&&e.end.line==c-1)return null;for(var g=f.end;;){var h=d(g.line+1);if(null==h)break;g=h.end}return{from:b.clipPos(a.Pos(c,f.startCh+1)),to:g}}),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 c=c.line,e=d(c);if(null==e||null!=d(c-1))return null;for(var f=c;;){var g=d(f+1);if(null==g)break;++f}return{from:a.Pos(c,e+1),to:b.clipPos(a.Pos(f))}})}),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:!0,__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"}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=c;c++)b.foldCode(a.Pos(c,0),null,"fold")})},a.commands.unfoldAll=function(b){b.operation(function(){for(var c=b.firstLine(),d=b.lastLine();d>=c;c++)b.foldCode(a.Pos(c,0),null,"unfold")})},a.registerHelper("fold","combine",function(){var a=Array.prototype.slice.call(arguments,0);return function(b,c){for(var d=0;d=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?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function f(a){return a.line<=a.min?void 0:(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(-1==b){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(-1==b){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(-1==b){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(0>j&&(!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(0>i&&(!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||d.line!=b.line||!(e=g(d)))return;if(!f[1]&&"selfClose"!=e){var b=m(d.line,d.ch),h=k(d,f[2]);return h&&{from:b,to:h.from}}}}),a.findMatchingTag=function(a,d,e){var f=new c(a,d.line,d.ch,e);if(-1!=f.text.indexOf(">")||-1!=f.text.indexOf("<")){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){for(var e=new c(a,b.line,b.ch,d);;){var f=l(e);if(!f)break;var g=new c(a,b.line,b.ch,d),h=k(g,f.tag);if(h)return{open:f,close:h}}},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;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;li&&(k=i)}k!=1/0&&(e.string=h.slice(0,k));var n=b.token(e,f.outer);return k!=1/0&&(e.string=h),n},indent:function(c,d){var e=c.innerActive?c.innerActive.mode:b;return e.indent?e.indent(c.innerActive?c.inner:c.outer,d):a.Pass},blankLine:function(c){var e=c.innerActive?c.innerActive.mode:b;if(e.blankLine&&e.blankLine(c.innerActive?c.inner:c.outer),c.innerActive)"\n"===c.innerActive.close&&(c.innerActive=c.inner=null);else for(var f=0;fd.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.moveTo=function(a,b){0>a&&(a=0),a>this.total-this.screen&&(a=this.total-this.screen),a!=this.pos&&(this.pos=a,this.inner.style["horizontal"==this.orientation?"left":"top"]=a*(this.size/this.total)+"px",b!==!1&&this.scroll(a,this.orientation))};var d=10;b.prototype.update=function(a,b,c){this.screen=b,this.total=a,this.size=c;var e=this.screen*(this.size/this.total);d>e&&(this.size-=d-e,e=d),this.inner.style["horizontal"==this.orientation?"width":"height"]=e+"px",this.inner.style["horizontal"==this.orientation?"left":"top"]=this.pos*(this.size/this.total)+"px"},c.prototype.update=function(a){if(null==this.width){var b=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;b&&(this.width=parseInt(b.height))}var c=this.width||0,d=a.scrollWidth>a.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.display="block",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.moveTo(a,!1)},c.prototype.setScrollLeft=function(a){this.horiz.moveTo(a,!1)},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")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b=0;b",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:"xi",context:"visual" -+},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",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:"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:"moveToEol",motionArgs:{inclusive:!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:"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:"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:"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",_a),x(b),a.on(b.getInputField(),"paste",k(b))}function f(b){b.setOption("disableInput",!1),b.off("cursorActivity",_a),a.off(b.getInputField(),"paste",k(b)),b.state.vim=null}function g(b,c){this==a.keyMap.vim&&a.rmClass(b.getWrapperElement(),"cm-fat-cursor"),c&&c.attach==h||f(b,!1)}function h(b,c){this==a.keyMap.vim&&a.addClass(b.getWrapperElement(),"cm-fat-cursor"),c&&c.attach==h||e(b)}function i(b,c){if(!c)return void 0;var d=j(b);if(!d)return!1;var e=a.Vim.findKey(c,d);return"function"==typeof e&&a.signal(c,"vim-keypress",d),e}function j(a){if("'"==a.charAt(0))return a.charAt(1);var b=a.split("-");/-$/.test(a)&&b.splice(-2,2,"-");var c=b[b.length-1];if(1==b.length&&1==b[0].length)return!1;if(2==b.length&&"Shift"==b[0]&&1==c.length)return!1;for(var d=!1,e=0;e"):!1}function k(a){var b=a.state.vim;return b.onPasteFn||(b.onPasteFn=function(){b.insertMode||(a.setCursor(K(a.getCursor(),0,1)),zb.enterInsertMode(a,{},b))}),b.onPasteFn}function l(a,b){for(var c=[],d=a;a+b>d;d++)c.push(String.fromCharCode(d));return c}function m(a,b){return b>=a.firstLine()&&b<=a.lastLine()}function n(a){return/^[a-z]$/.test(a)}function o(a){return-1!="()[]{}".indexOf(a)}function p(a){return ib.test(a)}function q(a){return/^[A-Z]$/.test(a)}function r(a){return/^\s*$/.test(a)}function s(a,b){for(var c=0;cd;d++)c.push(a);return c}function G(a,b){yb[a]=b}function H(a,b){zb[a]=b}function I(a,b,c){var e=Math.min(Math.max(a.firstLine(),b.line),a.lastLine()),f=W(a,e)-1;f=c?f+1:f;var g=Math.min(Math.max(0,b.ch),f);return d(e,g)}function J(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function K(a,b,c){return"object"==typeof b&&(c=b.ch,b=b.line),d(a.line+b,a.ch+c)}function L(a,b){return{line:b.line-a.line,ch:b.line-a.line}}function M(a,b,c,d){for(var e,f=[],g=[],h=0;h"==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":!1}return a==b?"full":0==b.indexOf(a)?"partial":!1}function O(a){var b=/^.*(<[\w\-]+>)$/.exec(a),c=b?b[1]:a.slice(-1);if(c.length>1)switch(c){case"":c="\n";break;case"":c=" "}return c}function P(a,b,c){return function(){for(var d=0;c>d;d++)b(a)}}function Q(a){return d(a.line,a.ch)}function R(a,b){return a.ch==b.ch&&a.line==b.line}function S(a,b){return a.line2&&(b=T.apply(void 0,Array.prototype.slice.call(arguments,1))),S(a,b)?a:b}function U(a,b){return arguments.length>2&&(b=U.apply(void 0,Array.prototype.slice.call(arguments,1))),S(a,b)?b:a}function V(a,b,c){var d=S(a,b),e=S(b,c);return d&&e}function W(a,b){return a.getLine(b).length}function X(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Y(a){return a.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Z(a,b,c){var e=W(a,b),f=new Array(c-e+1).join(" ");a.setCursor(d(b,e)),a.replaceRange(f,a.getCursor())}function $(a,b){var c=[],e=a.listSelections(),f=Q(a.clipPos(b)),g=!R(b,f),h=a.getCursor("head"),i=aa(e,h),j=R(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&&0>=s?(p++,g||q--):0>r&&s>=0?(p--,j||q++):0>r&&-1==s&&(p--,q++);for(var t=n;o>=t;t++){var u={anchor:new d(t,p),head:new d(t,q)};c.push(u)}return i=f.line==o?c.length-1:0,a.setSelections(c),b.ch=q,m.ch=p,m}function _(a,b,c){for(var d=[],e=0;c>e;e++){var f=K(b,e,0);d.push({anchor:f,head:f})}a.setSelections(d,0)}function aa(a,b,c){for(var d=0;dj&&(f.line=j),f.ch=W(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;o>r;r++)q.push({anchor:d(k+r,l),head:d(k+r,n)});return{ranges:q,primary:p}}}function ga(a){var b=a.getCursor("head");return 1==a.getSelection().length&&(b=T(b,a.getCursor("anchor"))),b}function ha(b,c){var d=b.state.vim;c!==!1&&b.setCursor(I(b,d.sel.head)),ca(b,d),d.visualMode=!1,d.visualLine=!1,d.visualBlock=!1,a.signal(b,"vim-mode-change",{mode:"normal"}),d.fakeCursor&&d.fakeCursor.clear()}function ia(a,b,c){var d=a.getRange(b,c);if(/\n\s*$/.test(d)){var e=d.split("\n");e.pop();for(var f,f=e.pop();e.length>0&&f&&r(f);f=e.pop())c.line--,c.ch=0;f?(c.line--,c.ch=W(a,c.line)):c.ch=0}}function ja(a,b,c){b.ch=0,c.ch=0,c.line++}function ka(a){if(!a)return 0;var b=a.search(/\S/);return-1==b?a.length:b}function la(a,b,c,e,f){for(var g=ga(a),h=a.getLine(g.line),i=g.ch,j=f?jb[0]:kb[0];!j(h.charAt(i));)if(i++,i>=h.length)return null;e?j=kb[0]:(j=jb[0],j(h.charAt(i))||(j=jb[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 ma(a,b,c){R(b,c)||tb.jumpList.add(a,b,c)}function na(a,b){tb.lastChararacterSearch.increment=a,tb.lastChararacterSearch.forward=b.forward,tb.lastChararacterSearch.selectedCharacter=b.selectedCharacter}function oa(a,b,c,e){var f=Q(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=Ab[e];if(!m)return f;var n=Bb[m].init,o=Bb[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 pa(a,b,c,d,e){var f=b.line,g=b.ch,h=a.getLine(f),i=c?1:-1,j=d?kb:jb;if(e&&""==h){if(f+=i,h=a.getLine(f),!m(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,n=k;g!=k;){for(var o=!1,p=0;p0?0:h.length}throw new Error("The impossible happened.")}function qa(a,b,c,e,f,g){var h=Q(b),i=[];(e&&!f||!e&&f)&&c++;for(var j=!(e&&f),k=0;c>k;k++){var l=pa(a,b,e,g,j);if(!l){var m=W(a,a.lastLine());i.push(e?{line:a.lastLine(),from:m,to:m}:{line:0,from:0,to:0});break}i.push(l),b=d(l.line,e?l.to-1:l.from)}var n=i.length!=c,o=i[0],p=i.pop();return e&&!f?(n||o.from==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.from)):e&&f?d(p.line,p.to-1):!e&&f?(n||o.to==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.to)):d(p.line,p.from)}function ra(a,b,c,e){for(var f,g=a.getCursor(),h=g.ch,i=0;b>i;i++){var j=a.getLine(g.line);if(f=ua(h,j,e,c,!0),-1==f)return null;h=f}return d(a.getCursor().line,f)}function sa(a,b){var c=a.getCursor().line;return I(a,d(c,b-1))}function ta(a,b,c,d){s(c,ob)&&(b.marks[c]&&b.marks[c].clear(),b.marks[c]=a.setBookmark(d))}function ua(a,b,c,d,e){var f;return d?(f=b.indexOf(c,a+1),-1==f||e||(f-=1)):(f=b.lastIndexOf(c,a-1),-1==f||e||(f+=1)),f}function va(a,b,c,e,f){function g(b){return!a.getLine(b)}function h(a,b,c){return c?g(a)!=g(a+b):!g(a)&&g(a+b)}var i,j,k=b.line,l=a.firstLine(),m=a.lastLine(),n=k;if(e){for(;n>=l&&m>=n&&c>0;)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;m>=n&&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 wa(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 xa(a,b,c,e){var f,g,h,i,j=Q(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;i>h&&!g;h++)l[h]==c&&(g=h);return f&&g?(e&&(--f,++g),{start:d(j.line,f),end:d(j.line,g)}):{start:j,end:j}}function ya(){}function za(a){var b=a.state.vim;return b.searchState_||(b.searchState_=new ya)}function Aa(a,b,c,d,e){a.openDialog?a.openDialog(b,d,{bottom:!0,value:e.value,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,selectValueOnOpen:!1}):d(prompt(c,""))}function Ba(a){var b=Ca(a)||[];if(!b.length)return[];var c=[];if(0===b[0]){for(var d=0;d'+b+"
    ",{bottom:!0,duration:5e3}):alert(b)}function Ia(a,b){var c="";return a&&(c+=''+a+""),c+=' ',b&&(c+='',c+=b,c+=""),c}function Ja(a,b){var c=(b.prefix||"")+" "+(b.desc||""),d=Ia(b.prefix,b.desc);Aa(a,d,c,b.onClose,b)}function Ka(a,b){if(a instanceof RegExp&&b instanceof RegExp){for(var c=["global","multiline","ignoreCase","source"],d=0;dh;h++){var i=g.find(b);if(0==h&&i&&R(g.from(),f)&&(i=g.find(b)),!i&&(g=a.getSearchCursor(c,b?d(a.lastLine()):d(a.firstLine(),0)),!g.find(b)))return}return g.from()})}function Pa(a){var b=za(a);a.removeOverlay(za(a).getOverlay()),b.setOverlay(null),b.getScrollbarAnnotate()&&(b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(null))}function Qa(a,b,c){return"number"!=typeof a&&(a=a.line),b instanceof Array?s(a,b):c?a>=b&&c>=a:a==b}function Ra(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 Sa(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()&&Qa(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 Ha(b,"No matches for "+h.source):c?void Ja(b,{prefix:"replace with "+i+" (y/n/a/q/l)",onKeyDown:o}):(k(),void(j&&j()))}function Ta(b){var c=b.state.vim,d=tb.macroModeState,e=tb.registerController.getRegister("."),f=d.isPlaying,g=d.lastInsertModeChanges,h=[];if(!f){for(var i=g.inVisualBlock?c.lastSelection.visualBlock.height:1,j=g.changes,h=[],k=0;k1&&(eb(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&&Ya(d)}function Ua(a){b.push(a)}function Va(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];Ua(f)}function Wa(b,c,d,e){var f=tb.registerController.getRegister(e);if(":"==e)return f.keyBuffer[0]&&Hb.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;tb.macroModeState.lastInsertModeChanges.changes=m,fb(b,m,1),Ta(b)}d.isPlaying=!1}function Xa(a,b){if(!a.isPlaying){var c=a.latestRegister,d=tb.registerController.getRegister(c);d&&d.pushText(b)}}function Ya(a){if(!a.isPlaying){var b=a.latestRegister,c=tb.registerController.getRegister(b);c&&c.pushInsertModeChanges(a.lastInsertModeChanges)}}function Za(a,b){if(!a.isPlaying){var c=a.latestRegister,d=tb.registerController.getRegister(c);d&&d.pushSearchQuery(b)}}function $a(a,b){var c=tb.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.changes.push(e)}b=b.next}}function _a(a){var b=a.state.vim;if(b.insertMode){var c=tb.macroModeState;if(c.isPlaying)return;var d=c.lastInsertModeChanges;d.expectCursorActivityForChange?d.expectCursorActivityForChange=!1:d.changes=[]}else a.curOp.isVimOp||bb(a,b);b.visualMode&&ab(a)}function ab(a){var b=a.state.vim,c=I(a,Q(b.sel.head)),d=K(c,0,1);b.fakeCursor&&b.fakeCursor.clear(),b.fakeCursor=a.markText(c,d,{className:"cm-animate-fat-cursor"})}function bb(b,c){var d=b.getCursor("anchor"),e=b.getCursor("head");if(c.visualMode&&!b.somethingSelected()?ha(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=S(e,d)?0:-1,g=S(e,d)?-1:0;e=K(e,0,f),d=K(d,0,g),c.sel={anchor:d,head:e},ta(b,c,"<",T(e,d)),ta(b,c,">",U(e,d))}else c.insertMode||(c.lastHPos=b.getCursor().ch); -+}function cb(a){this.keyName=a}function db(b){function c(){return e.changes.push(new cb(f)),!0}var d=tb.macroModeState,e=d.lastInsertModeChanges,f=a.keyName(b);f&&(-1!=f.indexOf("Delete")||-1!=f.indexOf("Backspace"))&&a.lookupKey(f,"vim-insert",c)}function eb(a,b,c,d){function e(){h?wb.processAction(a,b,b.lastEditActionCommand):wb.evalInput(a,b)}function f(c){if(g.lastInsertModeChanges.changes.length>0){c=b.lastEditActionCommand?c:1;var d=g.lastInsertModeChanges;fb(a,d.changes,c)}}var g=tb.macroModeState;g.isPlaying=!0;var h=!!b.lastEditActionCommand,i=b.inputState;if(b.inputState=b.lastEditInputState,h&&b.lastEditActionCommand.interlaceInsertRepeat)for(var j=0;c>j;j++)e(),f(1);else d||e(),f(c);b.inputState=i,b.insertMode&&!d&&Ta(a),g.isPlaying=!1}function fb(b,c,d){function e(c){return"string"==typeof c?a.commands[c](b):c(b),!0}var f=b.getCursor("head"),g=tb.macroModeState.lastInsertModeChanges.inVisualBlock;if(g){var h=b.state.vim,i=h.lastSelection,j=L(i.anchor,i.head);_(b,f,j.line+1),d=b.listSelections().length,b.setCursor(f)}for(var k=0;d>k;k++){g&&b.setCursor(K(f,k,0));for(var l=0;l"]),pb=[].concat(lb,mb,nb,["-",'"',".",":","/"]),qb={};t("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 rb=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&&!R(l,b)&&i(b)}else i(b);i(h),e=d,f=d-c+1,0>f&&(f=0)}function b(a,b){d+=b,d>e?d=e:f>d&&(d=f);var h=g[(c+d)%c];if(h&&!h.find()){var i,j=b>0?1:-1,k=a.getCursor();do if(d+=j,h=g[(c+d)%c],h&&(i=h.find())&&!R(k,i))break;while(e>d&&d>f)}return h}var c=100,d=-1,e=0,f=0,g=new Array(c);return{cachedCursor:void 0,add:a,move:b}},sb=function(a){return a?{changes:a.changes,expectCursorActivityForChange:a.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var a=tb.macroModeState;a.onRecordingDone&&a.onRecordingDone(),a.onRecordingDone=void 0,a.isRecording=!1},enterMacroRecordMode:function(a,b){var c=tb.registerController.getRegister(b);c&&(c.clear(),this.latestRegister=b,a.openDialog&&(this.onRecordingDone=a.openDialog("(recording)["+b+"]",null,{bottom:!0})),this.isRecording=!0)}};var tb,ub,vb={buildKeyMap:function(){},getRegisterController:function(){return tb.registerController},resetVimGlobalState_:y,getVimGlobalState_:function(){return tb},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:cb,map:function(a,b,c){Hb.map(a,b,c)},setOption:u,getOption:v,defineOption:t,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;Gb[a]=c,Hb.commandMap_[b]={name:a,shortName:b,type:"api"}},handleKey:function(a,b,c){var d=this.findKey(a,b,c);return"function"==typeof d?d():void 0},findKey:function(c,d,e){function f(){var a=tb.macroModeState;if(a.isRecording){if("q"==d)return a.exitMacroRecordMode(),A(c),!0;"mapping"!=e&&Xa(a,d)}}function g(){return""==d?(A(c),l.visualMode?ha(c):l.insertMode&&Ta(c),!0):void 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=wb.matchCommand(a,b,l.inputState,"insert");a.length>1&&"full"!=f.type;){var a=l.inputState.keyBuffer=a.slice(1),h=wb.matchCommand(a,b,l.inputState,"insert");"none"!=h.type&&(f=h)}if("none"==f.type)return A(c),!1;if("partial"==f.type)return ub&&window.clearTimeout(ub),ub=window.setTimeout(function(){l.insertMode&&l.inputState.keyBuffer&&A(c)},v("insertModeEscKeysTimeout")),!e;if(ub&&window.clearTimeout(ub),e){var i=c.getCursor();c.replaceRange("",K(i,0,-(a.length-1)),i,"+input")}return A(c),f.command}function j(){if(f()||g())return!0;var a=l.inputState.keyBuffer=l.inputState.keyBuffer+d;if(/^[1-9]\d*$/.test(a))return!0;var e=/^(\d*)(.*)$/.exec(a);if(!e)return A(c),!1;var h=l.visualMode?"visual":"normal",i=wb.matchCommand(e[2]||e[1],b,l.inputState,h);if("none"==i.type)return A(c),!1;if("partial"==i.type)return!0;l.inputState.keyBuffer="";var e=/^(\d*)(.*)$/.exec(a);return e[1]&&"0"!=e[1]&&l.inputState.pushRepeatDigit(e[1]),i.command}var k,l=x(c);return k=l.insertMode?i():j(),k===!1?void 0:k===!0?function(){}:function(){return c.operation(function(){c.curOp.isVimOp=!0;try{"keyToKey"==k.type?h(k.toKeys):wb.processCommand(c,l,k)}catch(b){throw c.state.vim=void 0,x(c),a.Vim.suppressErrorLogging||console.log(b),b}return!0})}},handleEx:function(a,b){Hb.processCommand(a,b)},defineMotion:E,defineAction:H,defineOperator:G,mapCommand:Va,_mapCommand:Ua,exitVisualMode:ha,exitInsertMode:Ta};z.prototype.pushRepeatDigit=function(a){this.operator?this.motionRepeat=this.motionRepeat.concat(a):this.prefixRepeat=this.prefixRepeat.concat(a)},z.prototype.getRepeat=function(){var a=0;return(this.prefixRepeat.length>0||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},B.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(sb(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("")}},C.prototype={pushText:function(a,b,c,d,e){d&&"\n"==c.charAt(0)&&(c=c.slice(1)+"\n"),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 B(c,d,e);break;case"delete":case"change":-1==c.indexOf("\n")?this.registers["-"]=new B(c,d):(this.shiftNumericRegisters_(),this.registers[1]=new B(c,d))}return void this.unnamedRegister.setText(c,d,e)}var g=q(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 B),this.registers[a]):this.unnamedRegister},isValidRegister:function(a){return a&&s(a,pb)},shiftNumericRegisters_:function(){for(var a=9;a>=2;a--)this.registers[a]=this.getRegister(""+(a-1))}},D.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):0>e?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 wb={matchCommand:function(a,b,c,d){var e=M(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)&&(c.selectedCharacter=O(a)),{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=J(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);A(a)}d.operator=c.operator,d.operatorArgs=J(c.operatorArgs),b.visualMode&&this.evalInput(a,b)},processOperatorMotion:function(a,b,c){var d=b.visualMode,e=J(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=J(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,A(a),b.lastMotion=null,c.isEdit&&this.recordLastEdit(b,d,c),zb[c.action](a,g,b)},processSearch:function(b,c,d){function e(a,e,f){tb.searchHistoryController.pushInput(a),tb.searchHistoryController.reset();try{La(b,a,e,f)}catch(g){return Ha(b,"Invalid regex: "+a),void A(b)}wb.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=tb.macroModeState;c.isRecording&&Za(c,a)}function g(c,d,e){var f,g=a.keyName(c);"Up"==g||"Down"==g?(f="Up"==g?!0:!1,d=tb.searchHistoryController.nextMatch(d,f)||"",e(d)):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&tb.searchHistoryController.reset();var h;try{h=La(b,d,!0,!0)}catch(c){}h?b.scrollIntoView(Oa(b,!i,h),30):(Pa(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?(tb.searchHistoryController.pushInput(d),tb.searchHistoryController.reset(),La(b,l),Pa(b),b.scrollTo(m.left,m.top),a.e_stop(c),A(b),e(),b.focus()):"Ctrl-U"==f&&(a.e_stop(c),e(""))}if(b.getSearchCursor){var i=d.searchArgs.forward,j=d.searchArgs.wholeWordOnly;za(b).setReversed(!i);var k=i?"/":"?",l=za(b).getQuery(),m=b.getScrollInfo();switch(d.searchArgs.querySrc){case"prompt":var n=tb.macroModeState;if(n.isPlaying){var o=n.replaySearchQueries.shift();e(o,!0,!1)}else Ja(b,{onClose:f,prefix:k,desc:Eb,onKeyUp:g,onKeyDown:h});break;case"wordUnderCursor":var p=la(b,!1,!0,!1,!0),q=!0;if(p||(p=la(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":Y(o),tb.jumpList.cachedCursor=b.getCursor(),b.setCursor(p.start),e(o,!0,!1)}}},processEx:function(b,c,d){function e(a){tb.exCommandHistoryController.pushInput(a),tb.exCommandHistoryController.reset(),Hb.processCommand(b,a)}function f(c,d,e){var f,g=a.keyName(c);("Esc"==g||"Ctrl-C"==g||"Ctrl-["==g||"Backspace"==g&&""==d)&&(tb.exCommandHistoryController.pushInput(d),tb.exCommandHistoryController.reset(),a.e_stop(c),A(b),e(),b.focus()),"Up"==g||"Down"==g?(f="Up"==g?!0:!1,d=tb.exCommandHistoryController.nextMatch(d,f)||"",e(d)):"Ctrl-U"==g?(a.e_stop(c),e("")):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&tb.exCommandHistoryController.reset()}"keyToEx"==d.type?Hb.processCommand(b,d.exArgs.input):c.visualMode?Ja(b,{onClose:e,prefix:":",value:"'<,'>",onKeyDown:f}):Ja(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=Q(b.visualMode?I(a,m.head):a.getCursor("head")),o=Q(b.visualMode?I(a,m.anchor):a.getCursor("anchor")),p=Q(n),q=Q(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,A(a),h){var r=xb[h](a,n,i,b);if(b.lastMotion=xb[h],!r)return;if(i.toJumplist){var s=tb.jumpList,t=s.cachedCursor;t?(ma(a,t,r),delete s.cachedCursor):ma(a,n,r)}r instanceof Array?(e=r[0],c=r[1]):c=r,c||(c=Q(n)),b.visualMode?(b.visualBlock&&c.ch===1/0||(c=I(a,c,b.visualBlock)),e&&(e=I(a,e,!0)),e=e||q,m.anchor=e,m.head=c,ea(a),ta(a,b,"<",S(e,c)?e:c),ta(a,b,">",S(e,c)?c:e)):j||(c=I(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},ea(a)}else b.visualMode&&(k.lastSel={anchor:Q(m.anchor),head:Q(m.head),visualBlock:b.visualBlock,visualLine:b.visualLine});var x,y,z,B,C;if(b.visualMode){if(x=T(m.head,m.anchor),y=U(m.head,m.anchor),z=b.visualLine||k.linewise,B=b.visualBlock?"block":z?"line":"char",C=fa(a,{anchor:x,head:y},B),z){var D=C.ranges;if("block"==B)for(var E=0;Ei&&f.line==j||i>k&&f.line==k?void 0:(c.toFirstChar&&(g=ka(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 va(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=xb.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 qa(a,b,c.repeat,!!c.forward,!!c.wordEnd,!!c.bigWord)},moveTillCharacter:function(a,b,c){var d=c.repeat,e=ra(a,d,c.forward,c.selectedCharacter),f=c.forward?-1:1;return na(f,c),e?(e.ch+=f,e):null},moveToCharacter:function(a,b,c){var d=c.repeat;return na(0,c),ra(a,d,c.forward,c.selectedCharacter)||b},moveToSymbol:function(a,b,c){var d=c.repeat;return oa(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,sa(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,ka(a.getLine(c.line)))},moveToMatchedSymbol:function(a,b){var c,e=b,f=e.line,g=e.ch,h=a.getLine(f);do if(c=h.charAt(g++),c&&o(c)){var i=a.getTokenTypeAt(d(f,g));if("string"!==i&&"comment"!==i)break}while(c);if(c){var j=a.findMatchingBracket(d(f,g));return j.to}return e},moveToStartOfLine:function(a,b){return d(b.line,0)},moveToLineOrEdgeOfDocument:function(a,b,c){var e=c.forward?a.lastLine():a.firstLine();return c.repeatIsExplicit&&(e=c.repeat-a.getOption("firstLineNumber")),d(e,ka(a.getLine(e)))},textObjectManipulation:function(a,b,c,d){var e={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},f={"'":!0,'"':!0},g=c.selectedCharacter;"b"==g?g="(":"B"==g&&(g="{");var h,i=!c.textObjectInner;if(e[g])h=wa(a,b,g,i);else if(f[g])h=xa(a,b,g,i);else if("W"===g)h=la(a,i,!0,!0);else if("w"===g)h=la(a,i,!0,!1);else{if("p"!==g)return null;if(h=va(a,b,c.repeat,0,i),c.linewise=!0,d.visualMode)d.visualLine||(d.visualLine=!0);else{var j=d.inputState.operatorArgs;j&&(j.linewise=!0),h.end.line--}}return a.state.vim.visualMode?da(a,h.start,h.end):[h.start,h.end]},repeatLastCharacterSearch:function(a,b,c){var d=tb.lastChararacterSearch,e=c.repeat,f=c.forward===d.forward,g=(d.increment?1:0)*(f?-1:1);a.moveH(-g,"char"),c.inclusive=f?!0:!1;var h=ra(a,e,f,d.selectedCharacter);return h?(h.ch+=g,h):(a.moveH(g,"char"),b)}},yb={change:function(b,c,d){var e,f,g=b.state.vim;if(tb.macroModeState.lastInsertModeChanges.inVisualBlock=g.visualBlock,g.visualMode){f=b.getSelection();var h=F("",d.length);b.replaceSelections(h),e=T(d[0].head,d[0].anchor)}else{var i=d[0].anchor,j=d[0].head;f=b.getRange(i,j);var k=g.lastEditInputState||{};if("moveByWords"==k.motion&&!r(f)){var l=/\s+$/.exec(f);l&&k.motionArgs&&k.motionArgs.forward&&(j=K(j,0,-l[0].length),f=f.slice(0,-l[0].length))}var m=j.line-1==b.lastLine();b.replaceRange("",i,j),c.linewise&&!m&&(a.commands.newlineAndIndent(b),i.ch=null),e=i}tb.registerController.pushText(c.registerName,"change",f,c.linewise,d.length>1),zb.enterInsertMode(b,{head:e},b.state.vim)},"delete":function(a,b,c){var e,f,g=a.state.vim;if(g.visualBlock){f=a.getSelection();var h=F("",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,W(a,i.line-1))),f=a.getRange(i,j),a.replaceRange("",i,j),e=i,b.linewise&&(e=xb.moveToFirstNonWhiteSpaceCharacter(a,i))}return tb.registerController.pushText(b.registerName,"delete",f,b.linewise,g.visualBlock),I(a,e)},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;f>=h;h++)for(var i=0;g>i;i++)a.indentLine(h,b.indentRight);return xb.moveToFirstNonWhiteSpaceCharacter(a,c[0].anchor)},changeCase:function(a,b,c,d,e){for(var f=a.getSelections(),g=[],h=b.toLower,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?K(g.head,0,1):d(g.anchor.line,0);else if("inplace"==f&&e.visualMode)return;b.setOption("keyMap","vim-insert"),b.setOption("disableInput",!1),c&&c.replace?(b.toggleOverwrite(!0),b.setOption("keyMap","vim-replace"),a.signal(b,"vim-mode-change",{mode:"replace"})):(b.setOption("keyMap","vim-insert"),a.signal(b,"vim-mode-change",{mode:"insert"})),tb.macroModeState.isPlaying||(b.on("change",$a),a.on(b.getInputField(),"keydown",db)),e.visualMode&&ha(b),_(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":""}),ea(b)):ha(b):(e.visualMode=!0,e.visualLine=!!c.linewise,e.visualBlock=!!c.blockwise,f=I(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":""}),ea(b),ta(b,e,"<",T(h,f)),ta(b,e,">",U(h,f)))},reselectLastSelection:function(b,c,d){var e=d.lastSelection;if(d.visualMode&&ca(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,ea(b),ta(b,d,"<",T(f,g)),ta(b,d,">",U(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"),S(f,e)){var g=f;f=e,e=g}f.ch=W(a,f.line)-1}else{var h=Math.max(b.repeat,2);e=a.getCursor(),f=I(a,d(e.line+h-1,1/0))}for(var i=0,j=e.line;jc)return"";if(a.getOption("indentWithTabs")){var d=Math.floor(c/h);return Array(d+1).join(" ")}return Array(c+1).join(" ")});g+=m?"\n":""}if(b.repeat>1)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=W(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=W(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=S(j[0].anchor,j[0].head)?j[0].anchor:j[0].head,b.setCursor(i),ha(b,!1)):b.setCursor(K(g,0,-1))}},incrementNumberToken:function(a,b){for(var c,e,f,g,h,i=a.getCursor(),j=a.getLine(i.line),k=/-?\d+/g;null!==(c=k.exec(j))&&(h=c[0],e=c.index,f=e+h.length,!(i.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?!0:!1}},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}}};t("pcre",!0,"boolean"),ya.prototype={getQuery:function(){return tb.query},setQuery:function(a){tb.query=a},getOverlay:function(){return this.searchOverlay},setOverlay:function(a){this.searchOverlay=a},isReversed:function(){return tb.isReversed},setReversed:function(a){tb.isReversed=a},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(a){this.annotate=a}};var Cb={"\\n":"\n","\\r":"\r","\\t":" "},Db={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":" "},Eb="(Javascript regexp)",Fb=function(){this.buildCommandMap_()};Fb.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=tb.registerController.getRegister(":"),g=f.toString();e.visualMode&&ha(b);var h=new a.StringStream(c);f.setText(c);var i=d||{};i.input=c;try{this.parseInput_(b,h,i)}catch(j){throw Ha(b,j),j}var k,l;if(i.commandName){if(k=this.matchCommand_(i.commandName)){if(l=k.name,k.excludeFromCommandHistory&&f.setText(g),this.parseCommandArgs_(h,i,k),"exToKey"==k.type){for(var m=0;m0;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+"
    ")}Ha(a,e)},sort:function(b,c){function e(){if(c.argString){var b=new a.StringStream(c.argString);if(b.eat("!")&&(g=!0),b.eol())return;if(!b.eatSpace())return"Invalid arguments";var d=b.match(/[a-z]+/);if(d){d=d[0],h=-1!=d.indexOf("i"),i=-1!=d.indexOf("u");var e=-1!=d.indexOf("d")&&1,f=-1!=d.indexOf("x")&&1,k=-1!=d.indexOf("o")&&1;if(e+f+k>1)return"Invalid arguments";j=e&&"decimal"||f&&"hex"||k&&"octal"}b.eatSpace()&&b.match(/\/.*\//)}}function f(a,b){if(g){var c;c=a,a=b,b=c}h&&(a=a.toLowerCase(),b=b.toLowerCase());var d=j&&q.exec(a),e=j&&q.exec(b);return d?(d=parseInt((d[1]+d[2]).toLowerCase(),r),e=parseInt((e[1]+e[2]).toLowerCase(),r),d-e):b>a?-1:1}var g,h,i,j,k=e();if(k)return void Ha(b,k+": "+c.argString);var l=c.line||b.firstLine(),m=c.lineEnd||c.line||b.lastLine();if(l!=m){var n=d(l,0),o=d(m,W(b,m)),p=b.getRange(n,o).split("\n"),q="decimal"==j?/(-?)([\d]+)/:"hex"==j?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==j?/([0-7]+)/:null,r="decimal"==j?10:"hex"==j?16:"octal"==j?8:null,s=[],t=[];if(j)for(var u=0;u=m;m++){var n=j.test(a.getLine(m));n&&(k.push(m+1),l+=a.getLine(m)+"
    ")}if(!d)return void Ha(a,l);var o=0,p=function(){if(o=k)return void Ha(b,"Invalid argument: "+c.argString.substring(f));for(var l=0;k-j>=l;l++){var m=String.fromCharCode(j+l);delete d.marks[m]}}else delete d.marks[g]}}},Hb=new Fb;return a.keyMap.vim={attach:h,detach:g,call:i},t("insertModeEscKeysTimeout",200,"number"),a.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(b){var c=a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent;c(b)},fallthrough:["default"],attach:h,detach:g,call:i},a.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:h,detach:g,call:i},y(),vb};a.Vim=e()}); -\ No newline at end of file -diff --git a/media/editors/codemirror/lib/codemirror.css b/media/editors/codemirror/lib/codemirror.css -index bf4bb94..ceacd13 100644 ---- a/media/editors/codemirror/lib/codemirror.css -+++ b/media/editors/codemirror/lib/codemirror.css -@@ -33,8 +33,7 @@ - min-width: 20px; - text-align: right; - color: #999; -- -moz-box-sizing: content-box; -- box-sizing: content-box; -+ white-space: nowrap; - } - - .CodeMirror-guttermarker { color: black; } -@@ -127,6 +126,8 @@ div.CodeMirror-overwrite div.CodeMirror-cursor {} - .cm-s-default .cm-error {color: #f00;} - .cm-invalidchar {color: #f00;} - -+.CodeMirror-composing { border-bottom: 2px solid; } -+ - /* Default styles for common addons */ - - div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} -@@ -154,14 +155,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} - height: 100%; - outline: none; /* Prevent dragging from highlighting the element */ - position: relative; -- -moz-box-sizing: content-box; -- box-sizing: content-box; - } - .CodeMirror-sizer { - position: relative; - border-right: 30px solid transparent; -- -moz-box-sizing: content-box; -- box-sizing: content-box; - } - - /* The fake, visible scrollbars. Used to force redraw during scrolling -@@ -196,8 +193,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} - .CodeMirror-gutter { - white-space: normal; - height: 100%; -- -moz-box-sizing: content-box; -- box-sizing: content-box; - display: inline-block; - margin-bottom: -30px; - /* Hack to make IE7 behave */ -@@ -265,6 +260,16 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} - outline: none; - } - -+/* Force content-box sizing for the elements where we expect it */ -+.CodeMirror-scroll, -+.CodeMirror-sizer, -+.CodeMirror-gutter, -+.CodeMirror-gutters, -+.CodeMirror-linenumber { -+ -moz-box-sizing: content-box; -+ box-sizing: content-box; -+} -+ - .CodeMirror-measure { - position: absolute; - width: 100%; -@@ -318,100 +323,3 @@ div.CodeMirror-cursors { - - /* Help users use markselection to safely style text background */ - span.CodeMirror-selectedtext { background: none; } --/** -- * addon/display/fullscreen.css -- * addon/fold/foldgutter.css -- * addon/scroll/simplescrollbars.css --**/ --.CodeMirror-fullscreen { -- position: fixed; -- top: 0; left: 0; right: 0; bottom: 0; -- height: auto; -- z-index: 9; --} --.CodeMirror-foldmarker { -- color: blue; -- text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; -- font-family: arial; -- line-height: .3; -- cursor: pointer; --} --.CodeMirror-foldgutter { -- width: .7em; --} --.CodeMirror-foldgutter-open, --.CodeMirror-foldgutter-folded { -- cursor: pointer; --} --.CodeMirror-foldgutter-open:after { -- content: "\25BE"; --} --.CodeMirror-foldgutter-folded:after { -- content: "\25B8"; --} --.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { -- position: absolute; -- background: #ccc; -- -moz-box-sizing: border-box; -- box-sizing: border-box; -- border: 1px solid #bbb; -- border-radius: 2px; --} -- --.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { -- position: absolute; -- z-index: 6; -- background: #eee; --} -- --.CodeMirror-simplescroll-horizontal { -- bottom: 0; left: 0; -- height: 8px; --} --.CodeMirror-simplescroll-horizontal div { -- bottom: 0; -- height: 100%; --} -- --.CodeMirror-simplescroll-vertical { -- right: 0; top: 0; -- width: 8px; --} --.CodeMirror-simplescroll-vertical div { -- right: 0; -- width: 100%; --} -- -- --.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { -- display: none; --} -- --.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { -- position: absolute; -- background: #bcd; -- border-radius: 3px; --} -- --.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { -- position: absolute; -- z-index: 6; --} -- --.CodeMirror-overlayscroll-horizontal { -- bottom: 0; left: 0; -- height: 6px; --} --.CodeMirror-overlayscroll-horizontal div { -- bottom: 0; -- height: 100%; --} -- --.CodeMirror-overlayscroll-vertical { -- right: 0; top: 0; -- width: 6px; --} --.CodeMirror-overlayscroll-vertical div { -- right: 0; -- width: 100%; --} -diff --git a/media/editors/codemirror/lib/codemirror.js b/media/editors/codemirror/lib/codemirror.js -index 98a45c6..a1dfd0f 100644 ---- a/media/editors/codemirror/lib/codemirror.js -+++ b/media/editors/codemirror/lib/codemirror.js -@@ -82,12 +82,15 @@ - keyMaps: [], // stores maps added by addKeyMap - overlays: [], // highlighting overlays, as added by addOverlay - modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info -- overwrite: false, focused: false, -+ overwrite: false, -+ delayingBlurEvent: false, -+ focused: false, - suppressEdits: false, // used to disable editing during key handlers when in readOnly mode - pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll - draggingText: false, - highlight: new Delayed(), // stores highlight worker timeout -- keySeq: null // Unfinished key sequence -+ keySeq: null, // Unfinished key sequence -+ specialChars: null - }; - - var cm = this; -@@ -591,7 +594,7 @@ - "CodeMirror-linenumber CodeMirror-gutter-elt")); - var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; - display.lineGutter.style.width = ""; -- display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding); -+ display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; - display.lineNumWidth = display.lineNumInnerWidth + padding; - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; - display.lineGutter.style.width = display.lineNumWidth + "px"; -@@ -725,12 +728,9 @@ - } - - function postUpdateDisplay(cm, update) { -- var force = update.force, viewport = update.viewport; -+ var viewport = update.viewport; - for (var first = true;; first = false) { -- if (first && cm.options.lineWrapping && update.oldDisplayWidth != displayWidth(cm)) { -- force = true; -- } else { -- force = false; -+ if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { - // Clip forced viewport to actual scrollable area. - if (viewport && viewport.top != null) - viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; -@@ -1076,7 +1076,7 @@ - // was made out of. - var lastCopied = null; - -- function applyTextInput(cm, inserted, deleted, sel) { -+ function applyTextInput(cm, inserted, deleted, sel, origin) { - var doc = cm.doc; - cm.display.shift = false; - if (!sel) sel = doc.sel; -@@ -1102,33 +1102,43 @@ - } - var updateInput = cm.curOp.updateInput; - var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines, -- origin: cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input"}; -+ origin: origin || (cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}; - makeChange(cm.doc, changeEvent); - signalLater(cm, "inputRead", cm, changeEvent); -- // When an 'electric' character is inserted, immediately trigger a reindent -- if (inserted && !cm.state.pasteIncoming && cm.options.electricChars && -- cm.options.smartIndent && range.head.ch < 100 && -- (!i || sel.ranges[i - 1].head.line != range.head.line)) { -- var mode = cm.getModeAt(range.head); -- var end = changeEnd(changeEvent); -- if (mode.electricChars) { -- for (var j = 0; j < mode.electricChars.length; j++) -- if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { -- indentLine(cm, end.line, "smart"); -- break; -- } -- } else if (mode.electricInput) { -- if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch))) -- indentLine(cm, end.line, "smart"); -- } -- } - } -+ if (inserted && !cm.state.pasteIncoming) -+ triggerElectric(cm, inserted); -+ - ensureCursorVisible(cm); - cm.curOp.updateInput = updateInput; - cm.curOp.typing = true; - cm.state.pasteIncoming = cm.state.cutIncoming = false; - } - -+ function triggerElectric(cm, inserted) { -+ // When an 'electric' character is inserted, immediately trigger a reindent -+ if (!cm.options.electricChars || !cm.options.smartIndent) return; -+ var sel = cm.doc.sel; -+ -+ for (var i = sel.ranges.length - 1; i >= 0; i--) { -+ var range = sel.ranges[i]; -+ if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) continue; -+ var mode = cm.getModeAt(range.head); -+ var indented = false; -+ if (mode.electricChars) { -+ for (var j = 0; j < mode.electricChars.length; j++) -+ if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { -+ indented = indentLine(cm, range.head.line, "smart"); -+ break; -+ } -+ } else if (mode.electricInput) { -+ if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) -+ indented = indentLine(cm, range.head.line, "smart"); -+ } -+ if (indented) signalLater(cm, "electricInput", cm, range.head.line); -+ } -+ } -+ - function copyableRanges(cm) { - var text = [], ranges = []; - for (var i = 0; i < cm.doc.sel.ranges.length; i++) { -@@ -1164,6 +1174,7 @@ - this.inaccurateSelection = false; - // Used to work around IE issue with selection being forgotten when focus moves away from textarea - this.hasSelection = false; -+ this.composing = null; - }; - - function hiddenTextarea() { -@@ -1228,6 +1239,8 @@ - te.value = lastCopied.join("\n"); - selectInput(te); - } -+ } else if (!cm.options.lineWiseCopyCut) { -+ return; - } else { - var ranges = copyableRanges(cm); - lastCopied = ranges.text; -@@ -1254,6 +1267,21 @@ - on(display.lineSpace, "selectstart", function(e) { - if (!eventInWidget(display, e)) e_preventDefault(e); - }); -+ -+ on(te, "compositionstart", function() { -+ var start = cm.getCursor("from"); -+ input.composing = { -+ start: start, -+ range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) -+ }; -+ }); -+ on(te, "compositionend", function() { -+ if (input.composing) { -+ input.poll(); -+ input.composing.range.clear(); -+ input.composing = null; -+ } -+ }); - }, - - prepareSelection: function() { -@@ -1381,19 +1409,29 @@ - return false; - } - -- if (text.charCodeAt(0) == 0x200b && cm.doc.sel == cm.display.selForContextMenu && !prevInput) -- prevInput = "\u200b"; -+ if (cm.doc.sel == cm.display.selForContextMenu) { -+ var first = text.charCodeAt(0); -+ if (first == 0x200b && !prevInput) prevInput = "\u200b"; -+ if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo"); } -+ } - // Find the part of the input that is actually new - var same = 0, l = Math.min(prevInput.length, text.length); - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same; - - var self = this; - runInOp(cm, function() { -- applyTextInput(cm, text.slice(same), prevInput.length - same); -+ applyTextInput(cm, text.slice(same), prevInput.length - same, -+ null, self.composing ? "*compose" : null); - - // Don't leave long text in the textarea, since it makes further polling slow - if (text.length > 1000 || text.indexOf("\n") > -1) input.value = self.prevInput = ""; - else self.prevInput = text; -+ -+ if (self.composing) { -+ self.composing.range.clear(); -+ self.composing.range = cm.markText(self.composing.start, cm.getCursor("to"), -+ {className: "CodeMirror-composing"}); -+ } - }); - return true; - }, -@@ -1440,7 +1478,9 @@ - function prepareSelectAllHack() { - if (te.selectionStart != null) { - var selected = cm.somethingSelected(); -- var extval = te.value = "\u200b" + (selected ? te.value : ""); -+ var extval = "\u200b" + (selected ? te.value : ""); -+ te.value = "\u21da"; // Used to catch context-menu undo -+ te.value = extval; - input.prevInput = selected ? "" : "\u200b"; - te.selectionStart = 1; te.selectionEnd = extval.length; - // Re-set this, in case some other handler touched the -@@ -1458,7 +1498,8 @@ - if (te.selectionStart != null) { - if (!ie || (ie && ie_version < 9)) prepareSelectAllHack(); - var i = 0, poll = function() { -- if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0) -+ if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && -+ te.selectionEnd > 0 && input.prevInput == "\u200b") - operation(cm, commands.selectAll)(cm); - else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500); - else display.input.reset(); -@@ -1491,6 +1532,7 @@ - this.cm = cm; - this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; - this.polling = new Delayed(); -+ this.gracePeriod = false; - } - - ContentEditableInput.prototype = copyObj({ -@@ -1552,6 +1594,8 @@ - if (cm.somethingSelected()) { - lastCopied = cm.getSelections(); - if (e.type == "cut") cm.replaceSelection("", null, "cut"); -+ } else if (!cm.options.lineWiseCopyCut) { -+ return; - } else { - var ranges = copyableRanges(cm); - lastCopied = ranges.text; -@@ -1625,10 +1669,21 @@ - sel.removeAllRanges(); - sel.addRange(rng); - if (old && sel.anchorNode == null) sel.addRange(old); -+ else if (gecko) this.startGracePeriod(); - } - this.rememberSelection(); - }, - -+ startGracePeriod: function() { -+ var input = this; -+ clearTimeout(this.gracePeriod); -+ this.gracePeriod = setTimeout(function() { -+ input.gracePeriod = false; -+ if (input.selectionChanged()) -+ input.cm.operation(function() { input.cm.curOp.selectionChanged = true; }); -+ }, 20); -+ }, -+ - showMultipleSelections: function(info) { - removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); - removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); -@@ -1671,12 +1726,15 @@ - this.polling.set(this.cm.options.pollInterval, poll); - }, - -- pollSelection: function() { -- if (this.composing) return; -+ selectionChanged: function() { -+ var sel = window.getSelection(); -+ return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || -+ sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset; -+ }, - -- var sel = window.getSelection(), cm = this.cm; -- if (sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || -- sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset) { -+ pollSelection: function() { -+ if (!this.composing && !this.gracePeriod && this.selectionChanged()) { -+ var sel = window.getSelection(), cm = this.cm; - this.rememberSelection(); - var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var head = domToPos(cm, sel.focusNode, sel.focusOffset); -@@ -1783,7 +1841,7 @@ - var partPos = getBidiPartAt(order, pos.ch); - side = partPos % 2 ? "right" : "left"; - } -- var result = nodeAndOffsetInLineMap(info.map, pos.ch, "left"); -+ var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); - result.offset = result.collapse == "right" ? result.end : result.start; - return result; - } -@@ -2895,6 +2953,7 @@ - updateMaxLine: false, // Set when the widest line needs to be determined anew - scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet - scrollToPos: null, // Used to scroll to a specific position -+ focus: false, - id: ++nextOpId // Unique ID - }; - if (operationGroup) { -@@ -3012,6 +3071,7 @@ - - if (cm.state.focused && op.updateInput) - cm.display.input.reset(op.typing); -+ if (op.focus && op.focus == activeElt()) ensureFocus(op.cm); - } - - function endOperation_finish(op) { -@@ -3376,15 +3436,11 @@ - // Prevent wrapper from ever scrolling - on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - -- function drag_(e) { -- if (!signalDOMEvent(cm, e)) e_stop(e); -- } -- if (cm.options.dragDrop) { -- on(d.scroller, "dragstart", function(e){onDragStart(cm, e);}); -- on(d.scroller, "dragenter", drag_); -- on(d.scroller, "dragover", drag_); -- on(d.scroller, "drop", operation(cm, onDrop)); -- } -+ d.dragFunctions = { -+ simple: function(e) {if (!signalDOMEvent(cm, e)) e_stop(e);}, -+ start: function(e){onDragStart(cm, e);}, -+ drop: operation(cm, onDrop) -+ }; - - var inp = d.input.getField(); - on(inp, "keyup", function(e) { onKeyUp.call(cm, e); }); -@@ -3394,6 +3450,18 @@ - on(inp, "blur", bind(onBlur, cm)); - } - -+ function dragDropChanged(cm, value, old) { -+ var wasOn = old && old != CodeMirror.Init; -+ if (!value != !wasOn) { -+ var funcs = cm.display.dragFunctions; -+ var toggle = value ? on : off; -+ toggle(cm.display.scroller, "dragstart", funcs.start); -+ toggle(cm.display.scroller, "dragenter", funcs.simple); -+ toggle(cm.display.scroller, "dragover", funcs.simple); -+ toggle(cm.display.scroller, "drop", funcs.drop); -+ } -+ } -+ - // Called when the window resizes - function onResize(cm) { - var d = cm.display; -@@ -3475,6 +3543,7 @@ - break; - case 3: - if (captureRightClick) onContextMenu(cm, e); -+ else delayBlurEvent(cm); - break; - } - } -@@ -3482,7 +3551,7 @@ - var lastClick, lastDoubleClick; - function leftButtonDown(cm, e, start) { - if (ie) setTimeout(bind(ensureFocus, cm), 0); -- else ensureFocus(cm); -+ else cm.curOp.focus = activeElt(); - - var now = +new Date, type; - if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { -@@ -3507,7 +3576,7 @@ - // Start a text drag. When it ends, see if any dragging actually - // happen, and treat as a click if it didn't. - function leftButtonStartDrag(cm, e, start, modifier) { -- var display = cm.display; -+ var display = cm.display, startTime = +new Date; - var dragEnd = operation(cm, function(e2) { - if (webkit) display.scroller.draggable = false; - cm.state.draggingText = false; -@@ -3515,12 +3584,13 @@ - off(display.scroller, "drop", dragEnd); - if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { - e_preventDefault(e2); -- if (!modifier) -+ if (!modifier && +new Date - 200 < startTime) - extendSelection(cm.doc, start); -- display.input.focus(); -- // Work around unexplainable focus problem in IE9 (#2127) -- if (ie && ie_version == 9) -+ // 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); -+ else -+ display.input.focus(); - } - }); - // Let the drag handler handle this. -@@ -3546,6 +3616,7 @@ - ourRange = new Range(start, start); - } else { - ourRange = doc.sel.primary(); -+ ourIndex = doc.sel.primIndex; - } - - if (e.altKey) { -@@ -3577,7 +3648,7 @@ - ourIndex = ranges.length; - setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), - {scroll: false, origin: "*mouse"}); -- } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single") { -+ } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) { - setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0)); - startSel = doc.sel; - } else { -@@ -3640,7 +3711,7 @@ - var cur = posFromMouse(cm, e, true, type == "rect"); - if (!cur) return; - if (cmp(cur, lastPos) != 0) { -- ensureFocus(cm); -+ cm.curOp.focus = activeElt(); - extendTo(cur); - var visible = visibleLines(display, doc); - if (cur.line >= visible.to || cur.line < visible.from) -@@ -3743,7 +3814,7 @@ - try { - var text = e.dataTransfer.getData("Text"); - if (text) { -- if (cm.state.draggingText && !(mac ? e.metaKey : e.ctrlKey)) -+ if (cm.state.draggingText && !(mac ? e.altKey : e.ctrlKey)) - var selected = cm.listSelections(); - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); - if (selected) for (var i = 0; i < selected.length; ++i) -@@ -3998,7 +4069,7 @@ - var lastStoppedKey = null; - function onKeyDown(e) { - var cm = this; -- ensureFocus(cm); -+ cm.curOp.focus = activeElt(); - if (signalDOMEvent(cm, e)) return; - // IE does strange things with escape. - if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; -@@ -4050,7 +4121,19 @@ - - // FOCUS/BLUR EVENTS - -+ function delayBlurEvent(cm) { -+ cm.state.delayingBlurEvent = true; -+ setTimeout(function() { -+ if (cm.state.delayingBlurEvent) { -+ cm.state.delayingBlurEvent = false; -+ onBlur(cm); -+ } -+ }, 100); -+ } -+ - function onFocus(cm) { -+ if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false; -+ - if (cm.options.readOnly == "nocursor") return; - if (!cm.state.focused) { - signal(cm, "focus", cm); -@@ -4068,6 +4151,8 @@ - restartBlink(cm); - } - function onBlur(cm) { -+ if (cm.state.delayingBlurEvent) return; -+ - if (cm.state.focused) { - signal(cm, "blur", cm); - cm.state.focused = false; -@@ -4572,6 +4657,8 @@ - - if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); -+ line.stateAfter = null; -+ return true; - } else { - // Ensure that, if the cursor was in the whitespace at the start - // of the line, it is moved to the end of that space. -@@ -4584,7 +4671,6 @@ - } - } - } -- line.stateAfter = null; - } - - // Utility for applying a change to a line by handle or number, -@@ -4824,7 +4910,7 @@ - - getHelpers: function(pos, type) { - var found = []; -- if (!helpers.hasOwnProperty(type)) return helpers; -+ if (!helpers.hasOwnProperty(type)) return found; - var help = helpers[type], mode = this.getModeAt(pos); - if (typeof mode[type] == "string") { - if (help[mode[type]]) found.push(help[mode[type]]); -@@ -4874,10 +4960,15 @@ - return lineAtHeight(this.doc, height + this.display.viewOffset); - }, - heightAtLine: function(line, mode) { -- var end = false, last = this.doc.first + this.doc.size - 1; -- if (line < this.doc.first) line = this.doc.first; -- else if (line > last) { line = last; end = true; } -- var lineObj = getLine(this.doc, line); -+ var end = false, lineObj; -+ if (typeof line == "number") { -+ var last = this.doc.first + this.doc.size - 1; -+ if (line < this.doc.first) line = this.doc.first; -+ else if (line > last) { line = last; end = true; } -+ lineObj = getLine(this.doc, line); -+ } else { -+ lineObj = line; -+ } - return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page").top + - (end ? this.doc.height - heightAtLine(lineObj) : 0); - }, -@@ -4906,12 +4997,6 @@ - }); - }), - -- addLineWidget: methodOp(function(handle, node, options) { -- return addLineWidget(this, handle, node, options); -- }), -- -- removeLineWidget: function(widget) { widget.clear(); }, -- - lineInfo: function(line) { - if (typeof line == "number") { - if (!isLine(this.doc, line)) return null; -@@ -4973,6 +5058,8 @@ - return commands[cmd](this); - }, - -+ triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), -+ - findPosH: function(from, amount, unit, visually) { - var dir = 1; - if (amount < 0) { dir = -1; amount = -amount; } -@@ -5186,10 +5273,10 @@ - clearCaches(cm); - regChange(cm); - }, true); -- option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val) { -- cm.options.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); -- cm.refresh(); -- }, true); -+ option("specialChars", /[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g, function(cm, val, old) { -+ cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); -+ if (old != CodeMirror.Init) cm.refresh(); -+ }); - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function(cm) {cm.refresh();}, true); - option("electricChars", true); - option("inputStyle", mobile ? "contenteditable" : "textarea", function() { -@@ -5235,6 +5322,7 @@ - option("showCursorWhenSelecting", false, updateSelection, true); - - option("resetSelectionOnContextMenu", true); -+ option("lineWiseCopyCut", true); - - option("readOnly", false, function(cm, val) { - if (val == "nocursor") { -@@ -5247,7 +5335,7 @@ - } - }); - option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true); -- option("dragDrop", true); -+ option("dragDrop", true, dragDropChanged); - - option("cursorBlinkRate", 530); - option("cursorScrollMargin", 0); -@@ -5639,7 +5727,7 @@ - for (var i = 0; i < keys.length; i++) { - var val, name; - if (i == keys.length - 1) { -- name = keyname; -+ name = keys.join(" "); - val = value; - } else { - name = keys.slice(0, i + 1).join(" "); -@@ -6431,10 +6519,10 @@ - - // Line widgets are block elements displayed above or below a line. - -- var LineWidget = CodeMirror.LineWidget = function(cm, node, options) { -+ var LineWidget = CodeMirror.LineWidget = function(doc, node, options) { - if (options) for (var opt in options) if (options.hasOwnProperty(opt)) - this[opt] = options[opt]; -- this.cm = cm; -+ this.doc = doc; - this.node = node; - }; - eventMixin(LineWidget); -@@ -6445,52 +6533,55 @@ - } - - LineWidget.prototype.clear = function() { -- var cm = this.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); -+ var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); - if (no == null || !ws) return; - for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1); - if (!ws.length) line.widgets = null; - var height = widgetHeight(this); -- runInOp(cm, function() { -+ updateLineHeight(line, Math.max(0, line.height - height)); -+ if (cm) runInOp(cm, function() { - adjustScrollWhenAboveVisible(cm, line, -height); - regLineChange(cm, no, "widget"); -- updateLineHeight(line, Math.max(0, line.height - height)); - }); - }; - LineWidget.prototype.changed = function() { -- var oldH = this.height, cm = this.cm, line = this.line; -+ var oldH = this.height, cm = this.doc.cm, line = this.line; - this.height = null; - var diff = widgetHeight(this) - oldH; - if (!diff) return; -- runInOp(cm, function() { -+ updateLineHeight(line, line.height + diff); -+ if (cm) runInOp(cm, function() { - cm.curOp.forceUpdate = true; - adjustScrollWhenAboveVisible(cm, line, diff); -- updateLineHeight(line, line.height + diff); - }); - }; - - function widgetHeight(widget) { - if (widget.height != null) return widget.height; -+ var cm = widget.doc.cm; -+ if (!cm) return 0; - if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;"; - if (widget.coverGutter) -- parentStyle += "margin-left: -" + widget.cm.display.gutters.offsetWidth + "px;"; -+ parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; - if (widget.noHScroll) -- parentStyle += "width: " + widget.cm.display.wrapper.clientWidth + "px;"; -- removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, parentStyle)); -+ parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; -+ removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); - } - return widget.height = widget.node.offsetHeight; - } - -- function addLineWidget(cm, handle, node, options) { -- var widget = new LineWidget(cm, node, options); -- if (widget.noHScroll) cm.display.alignWidgets = true; -- changeLine(cm.doc, handle, "widget", function(line) { -+ function addLineWidget(doc, handle, node, options) { -+ var widget = new LineWidget(doc, node, options); -+ var cm = doc.cm; -+ if (cm && widget.noHScroll) cm.display.alignWidgets = true; -+ changeLine(doc, handle, "widget", function(line) { - var widgets = line.widgets || (line.widgets = []); - if (widget.insertAt == null) widgets.push(widget); - else widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); - widget.line = line; -- if (!lineIsHidden(cm.doc, line)) { -- var aboveVisible = heightAtLine(line) < cm.doc.scrollTop; -+ if (cm && !lineIsHidden(doc, line)) { -+ var aboveVisible = heightAtLine(line) < doc.scrollTop; - updateLineHeight(line, line.height + widgetHeight(widget)); - if (aboveVisible) addToScrollPos(cm, null, widget.height); - cm.curOp.forceUpdate = true; -@@ -6710,7 +6801,9 @@ - // is needed on Webkit to be able to get line-level bounding - // rectangles for it (in measureChar). - var content = elt("span", null, null, webkit ? "padding-right: .1px" : null); -- var builder = {pre: elt("pre", [content]), content: content, col: 0, pos: 0, cm: cm}; -+ var builder = {pre: elt("pre", [content]), content: content, -+ col: 0, pos: 0, cm: cm, -+ splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}; - lineView.measure = {}; - - // Iterate over the logical lines that make up this visual line. -@@ -6720,8 +6813,6 @@ - builder.addToken = buildToken; - // Optionally wire in some hacks into the token-rendering - // algorithm, to deal with browser quirks. -- if ((ie || webkit) && cm.getOption("lineWrapping")) -- builder.addToken = buildTokenSplitSpaces(builder.addToken); - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line))) - builder.addToken = buildTokenBadBidi(builder.addToken, order); - builder.map = []; -@@ -6770,10 +6861,11 @@ - // the line map. Takes care to render special characters separately. - function buildToken(builder, text, style, startStyle, endStyle, title, css) { - if (!text) return; -- var special = builder.cm.options.specialChars, mustWrap = false; -+ var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text; -+ var special = builder.cm.state.specialChars, mustWrap = false; - if (!special.test(text)) { - builder.col += text.length; -- var content = document.createTextNode(text); -+ var content = document.createTextNode(displayText); - builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie && ie_version < 9) mustWrap = true; - builder.pos += text.length; -@@ -6784,7 +6876,7 @@ - var m = special.exec(text); - var skipped = m ? m.index - pos : text.length - pos; - if (skipped) { -- var txt = document.createTextNode(text.slice(pos, pos + skipped)); -+ var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); - if (ie && ie_version < 9) content.appendChild(elt("span", [txt])); - else content.appendChild(txt); - builder.map.push(builder.pos, builder.pos + skipped, txt); -@@ -6821,22 +6913,17 @@ - builder.content.appendChild(content); - } - -- function buildTokenSplitSpaces(inner) { -- function split(old) { -- var out = " "; -- for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; -- out += " "; -- return out; -- } -- return function(builder, text, style, startStyle, endStyle, title) { -- inner(builder, text.replace(/ {3,}/g, split), style, startStyle, endStyle, title); -- }; -+ function splitSpaces(old) { -+ var out = " "; -+ for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0"; -+ out += " "; -+ return out; - } - - // Work around nonsense dimensions being reported for stretches of - // right-to-left text. - function buildTokenBadBidi(inner, order) { -- return function(builder, text, style, startStyle, endStyle, title) { -+ return function(builder, text, style, startStyle, endStyle, title, css) { - style = style ? style + " cm-force-border" : "cm-force-border"; - var start = builder.pos, end = start + text.length; - for (;;) { -@@ -6845,8 +6932,8 @@ - var part = order[i]; - if (part.to > start && part.from <= start) break; - } -- if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title); -- inner(builder, text.slice(0, part.to - start), style, startStyle, null, title); -+ if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title, css); -+ inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); - startStyle = null; - text = text.slice(part.to - start); - start = part.to; -@@ -6888,8 +6975,13 @@ - var foundBookmarks = []; - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], m = sp.marker; -- if (sp.from <= pos && (sp.to == null || sp.to > pos)) { -- if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; } -+ if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { -+ foundBookmarks.push(m); -+ } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { -+ if (sp.to != null && sp.to != pos && nextChange > sp.to) { -+ nextChange = sp.to; -+ spanEndStyle = ""; -+ } - if (m.className) spanStyle += " " + m.className; - if (m.css) css = m.css; - if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle; -@@ -6900,12 +6992,12 @@ - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from; - } -- if (m.type == "bookmark" && sp.from == pos && m.widgetNode) foundBookmarks.push(m); - } - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, - collapsed.marker, collapsed.from == null); - if (collapsed.to == null) return; -+ if (collapsed.to == pos) collapsed = false; - } - if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j) - buildCollapsedSpan(builder, 0, foundBookmarks[j]); -@@ -7368,13 +7460,19 @@ - }); - }), - -+ addLineWidget: docMethodOp(function(handle, node, options) { -+ return addLineWidget(this, handle, node, options); -+ }), -+ removeLineWidget: function(widget) { widget.clear(); }, -+ - markText: function(from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, "range"); - }, - setBookmark: function(pos, options) { - var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), - insertLeft: options && options.insertLeft, -- clearWhenEmpty: false, shared: options && options.shared}; -+ clearWhenEmpty: false, shared: options && options.shared, -+ handleMouseEvents: options && options.handleMouseEvents}; - pos = clipPos(this, pos); - return markText(this, pos, pos, realOpts, "bookmark"); - }, -@@ -8108,7 +8206,7 @@ - return function(){return f.apply(null, args);}; - } - -- var nonASCIISingleCaseWordChar = /[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; -+ var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - var isWordCharBasic = CodeMirror.isWordChar = function(ch) { - return /\w/.test(ch) || ch > "\x80" && - (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)); -@@ -8630,6 +8728,8 @@ - lst(order).to -= m[0].length; - order.push(new BidiSpan(0, len - m[0].length, len)); - } -+ if (order[0].level == 2) -+ order.unshift(new BidiSpan(1, order[0].to, order[0].to)); - if (order[0].level != lst(order).level) - order.push(new BidiSpan(order[0].level, len, len)); - -@@ -8639,7 +8739,7 @@ - - // THE END - -- CodeMirror.version = "5.0.1"; -+ CodeMirror.version = "5.3.0"; - - return CodeMirror; - }); -diff --git a/media/editors/codemirror/lib/codemirror.min.css b/media/editors/codemirror/lib/codemirror.min.css -index 59b6677..5cd3f69 100644 ---- a/media/editors/codemirror/lib/codemirror.min.css -+++ b/media/editors/codemirror/lib/codemirror.min.css -@@ -1 +1 @@ --.CodeMirror{font-family:monospace;height:300px;color:black}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid black}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.CodeMirror.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}@-moz-keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}@-webkit-keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}@keyframes blink{0%{background:#7e7}50%{background:0}100%{background:#7e7}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-sizer{position:relative;border-right:30px solid transparent;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;display:inline-block;margin-bottom:-30px;*zoom:1;*display:inline}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;height:100%}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;border-right:0;width:0}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror ::selection{background:#d7d4f0}.CodeMirror ::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0}.CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}.CodeMirror-simplescroll-horizontal div,.CodeMirror-simplescroll-vertical div{position:absolute;background:#ccc;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #bbb;border-radius:2px}.CodeMirror-simplescroll-horizontal,.CodeMirror-simplescroll-vertical{position:absolute;z-index:6;background:#eee}.CodeMirror-simplescroll-horizontal{bottom:0;left:0;height:8px}.CodeMirror-simplescroll-horizontal div{bottom:0;height:100%}.CodeMirror-simplescroll-vertical{right:0;top:0;width:8px}.CodeMirror-simplescroll-vertical div{right:0;width:100%}.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler,.CodeMirror-overlayscroll .CodeMirror-gutter-filler{display:none}.CodeMirror-overlayscroll-horizontal div,.CodeMirror-overlayscroll-vertical div{position:absolute;background:#bcd;border-radius:3px}.CodeMirror-overlayscroll-horizontal,.CodeMirror-overlayscroll-vertical{position:absolute;z-index:6}.CodeMirror-overlayscroll-horizontal{bottom:0;left:0;height:6px}.CodeMirror-overlayscroll-horizontal div{bottom:0;height:100%}.CodeMirror-overlayscroll-vertical{right:0;top:0;width:6px}.CodeMirror-overlayscroll-vertical div{right:0;width:100%} -\ No newline at end of file -+.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7}.CodeMirror.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1)infinite;-moz-animation:blink 1.06s steps(1)infinite;animation:blink 1.06s steps(1)infinite}@-moz-keyframes blink{0%,100%{background:#7e7}50%{background:0 0}}@-webkit-keyframes blink{0%,100%{background:#7e7}50%{background:0 0}}@keyframes blink{0%,100%{background:#7e7}50%{background:0 0}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;border-right:none;width:0}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror ::selection,.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror ::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0} -\ No newline at end of file -diff --git a/media/editors/codemirror/lib/codemirror.min.js b/media/editors/codemirror/lib/codemirror.min.js -index cae56ba..4e56fe1 100644 ---- a/media/editors/codemirror/lib/codemirror.min.js -+++ b/media/editors/codemirror/lib/codemirror.min.js -@@ -1,5 +1,5 @@ --!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);this.CodeMirror=e()}}(function(){"use strict";function e(r,n){if(!(this instanceof e))return new e(r,n);this.options=n=n?Oo(n):{},Oo(Kl,n,!1),d(n);var i=n.value;"string"==typeof i&&(i=new ps(i,n.mode)),this.doc=i;var o=new e.inputStyles[n.inputStyle](this),l=this.display=new t(r,i,o);l.wrapper.CodeMirror=this,u(this),s(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),n.autofocus&&!wl&&l.input.focus(),m(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new So,keySeq:null};var a=this;cl&&11>fl&&setTimeout(function(){a.display.input.reset(!0)},20),Rr(this),Vo(),mr(this),this.curOp.forceUpdate=!0,Vi(this,i),n.autofocus&&!wl||a.hasFocus()?setTimeout(Do(cn,this),20):fn(this);for(var c in jl)jl.hasOwnProperty(c)&&jl[c](this,n[c],Xl);C(this),n.finishInit&&n.finishInit(this);for(var f=0;ffl&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),hl||sl&&wl||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,r.init(n)}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),n(t)}function n(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,zt(e,100),e.state.modeGen++,e.curOp&&Dr(e)}function i(e){e.options.lineWrapping?(Bs(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Rs(e.display.wrapper,"CodeMirror-wrap"),h(e)),l(e),Dr(e),ir(e),setTimeout(function(){y(e)},100)}function o(e){var t=gr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/vr(e.display)-3);return function(i){if(gi(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;lt.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function d(e){var t=Mo(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Gt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Vt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function g(e,t,r){this.cm=r;var n=this.vert=zo("div",[zo("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=zo("div",[zo("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),ws(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ws(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedOverlay=!1,cl&&8>fl&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function v(){}function m(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Rs(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ws(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,r){"horizontal"==r?Qr(t,e):Zr(t,e)},t),t.display.scrollbars.addClass&&Bs(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var r=e.display.barWidth,n=e.display.barHeight;b(e,t);for(var i=0;4>i&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&O(e),b(e,p(e)),r=e.display.barWidth,n=e.display.barHeight}function b(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function w(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Bt(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=$i(t,n),l=$i(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;o>s?(o=s,l=$i(t,qi(Ki(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=$i(t,qi(Ki(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function x(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=L(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Fr(e))return!1;C(e)&&(Ir(e),t.dims=H(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroml&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Ml&&(o=di(e.doc,o),l=pi(e.doc,l));var s=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Er(e,o,l),r.viewOffset=qi(Ki(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var a=Fr(e);if(!s&&0==a&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Ro();return a>4&&(r.lineDiv.style.display="none"),I(e,r.updateLineNumbers,t.dims),a>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,u&&Ro()!=u&&u.offsetHeight&&u.focus(),Eo(r.cursorDiv),Eo(r.selectionDiv),r.gutters.style.height=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,zt(e,400)),r.updateLineNumbers=null,!0}function A(e,t){for(var r=t.force,n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Kt(e))r=!0;else if(r=!1,n&&null!=n.top&&(n={top:Math.min(e.doc.height+Gt(e.display)-jt(e),n.top)}),t.visible=w(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!M(e,t))break;O(e);var o=p(e);Ot(e),W(e,o),y(e,o)}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function N(e,t){var r=new k(e,t);if(M(e,r)){O(e),A(e,r);var n=p(e);Ot(e),W(e,n),y(e,n),r.finish()}}function W(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var r=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=r+"px",e.display.gutters.style.height=Math.max(r+Vt(e),t.clientHeight)+"px"}function O(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;nfl){var l=o.node.offsetTop+o.node.offsetHeight;i=l-r,r=l}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var a=o.line.height-i;if(2>i&&(i=gr(t)),(a>.001||-.001>a)&&(_i(o.line,i),D(o.line),o.rest))for(var u=0;u=t&&f.lineNumber;f.changes&&(Mo(f.changes,"gutter")>-1&&(h=!1),P(e,f,u,r)),h&&(Eo(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(S(e.options,u)))),s=f.node.nextSibling}else{var d=V(e,f,u,r);l.insertBefore(d,s)}u+=f.size}for(;s;)s=n(s)}function P(e,t,r,n){for(var i=0;ifl&&(e.node.style.zIndex=2)),e.node}function E(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=z(e);e.background=r.insertBefore(zo("div",null,t),r.firstChild)}}function F(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Oi(e,t)}function R(e,t){var r=t.text.className,n=F(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,B(t)):r&&(t.text.className=r)}function B(e){E(e),e.line.wrapClass?z(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function G(e,t,r,n){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=z(t),l=t.gutter=zo("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px");if(e.display.input.setUneditable(l),o.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(zo("div",S(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var s=0;s1&&(Wl&&Wl.join("\n")==t?l=n.ranges.length%Wl.length==0&&Ao(Wl,Vs):o.length==n.ranges.length&&(l=Ao(o,function(e){return[e]})));for(var s=n.ranges.length-1;s>=0;s--){var a=n.ranges[s],u=a.from(),c=a.to();a.empty()&&(r&&r>0?u=Al(u.line,u.ch-r):e.state.overwrite&&!e.state.pasteIncoming&&(c=Al(c.line,Math.min(Ki(i,c.line).text.length,c.ch+To(o).length))));var f=e.curOp.updateInput,h={from:u,to:c,text:l?l[s%l.length]:o,origin:e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input"};if(bn(e.doc,h),mo(e,"inputRead",e,h),t&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&a.head.ch<100&&(!s||n.ranges[s-1].head.line!=a.head.line)){var d=e.getModeAt(a.head),p=Vl(h);if(d.electricChars){for(var g=0;g-1){Hn(e,p.line,"smart");break}}else d.electricInput&&d.electricInput.test(Ki(i,p.line).text.slice(0,p.ch))&&Hn(e,p.line,"smart")}}On(e),e.curOp.updateInput=f,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e){for(var t=[],r=[],n=0;ni?u.map:c[i],l=0;li?e.line:e.rest[i]),f=o[l]+n;return(0>n||s!=t)&&(f=o[l+(n?1:0)]),Al(a,f)}}}var i=e.text.firstChild,o=!1;if(!t||!zs(i,t))return ot(Al(Yi(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[r],r=0,!t)){var l=e.rest?To(e.rest):e.line;return ot(Al(Yi(l),l.text.length),o)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,r&&(r=s.nodeValue.length));a.parentNode!=i;)a=a.parentNode;var u=e.measure,c=u.maps,f=n(s,a,r);if(f)return ot(f,o);for(var h=a.nextSibling,d=s?s.nodeValue.length-r:0;h;h=h.nextSibling){if(f=n(h,h.firstChild,0))return ot(Al(f.line,f.ch-d),o);d+=h.textContent.length}for(var p=a.previousSibling,d=r;p;p=p.previousSibling){if(f=n(p,p.firstChild,-1))return ot(Al(f.line,f.ch+d),o);d+=h.textContent.length}}function at(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function l(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return""==r&&(r=t.textContent.replace(/\u200b/g,"")),void(s+=r);var u,c=t.getAttribute("cm-marker");if(c){var f=e.findMarks(Al(n,0),Al(i+1,0),o(+c));return void(f.length&&(u=f[0].find())&&(s+=ji(e.doc,u.from,u.to).join("\n")))}if("false"==t.getAttribute("contenteditable"))return;for(var h=0;h=0){var l=$(o.from(),i.from()),s=Y(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;t>=n&&--t,e.splice(--n,2,new ct(a?s:l,a?l:s))}}return new ut(e,t)}function ht(e,t){return new ut([new ct(e,t||e)],0)}function dt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function pt(e,t){if(t.liner?Al(r,Ki(e,r).text.length):gt(t,Ki(e,t.line).text.length)}function gt(e,t){var r=e.ch;return null==r||r>t?Al(e.line,t):0>r?Al(e.line,0):e}function vt(e,t){return t>=e.first&&t=o.ch:u.to>o.ch))){if(n&&(Cs(c,"beforeCursorEnter"),c.explicitlyCleared)){if(s.markedSpans){--a;continue}break}if(!c.atomic)continue;var f=c.find(0>l?-1:1);if(0==Nl(f,o)&&(f.ch+=l,f.ch<0?f=f.line>e.first?pt(e,Al(f.line-1)):null:f.ch>s.text.length&&(f=f.linet&&(t=0),t=Math.round(t),n=Math.round(n),s.appendChild(zo("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?c-e:r)+"px; height: "+(n-t)+"px"))}function i(t,r,i){function o(r,n){return ur(e,Al(t,r),"div",f,n)}var s,a,f=Ki(l,t),h=f.text.length;return Yo(Zi(f),r||0,null==i?h:i,function(e,t,l){var f,d,p,g=o(e,"left");if(e==t)f=g,d=p=g.left;else{if(f=o(t-1,"right"),"rtl"==l){var v=g;g=f,f=v}d=g.left,p=f.right}null==r&&0==e&&(d=u),f.top-g.top>3&&(n(d,g.top,null,g.bottom),d=u,g.bottoma.bottom||f.bottom==a.bottom&&f.right>a.right)&&(a=f),u+1>d&&(d=u),n(d,f.top,p-d,f.bottom)}),{start:s,end:a}}var o=e.display,l=e.doc,s=document.createDocumentFragment(),a=Ut(e.display),u=a.left,c=Math.max(o.sizerWidth,Kt(e)-o.sizer.offsetLeft)-a.right,f=t.from(),h=t.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Ki(l,f.line),p=Ki(l,h.line),g=fi(d)==fi(p),v=i(f.line,f.ch,g?d.text.length+1:null).end,m=i(h.line,g?0:null,h.ch).start;g&&(v.top0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function zt(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Ql(t.mode,Rt(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,s=Mi(e,o,n,!0);o.styles=s.styles;var a=o.styleClasses,u=s.classes;u?o.styleClasses=u:a&&(o.styleClasses=null);for(var c=!l||l.length!=o.styles.length||a!=u&&(!a||!u||a.bgClass!=u.bgClass||a.textClass!=u.textClass),f=0;!c&&fr?(zt(e,e.options.workDelay),!0):void 0}),i.length&&Tr(e,function(){for(var t=0;tl;--s){if(s<=o.first)return o.first;var a=Ki(o,s-1);if(a.stateAfter&&(!r||s<=o.frontier))return s;var u=Ns(a.text,null,e.options.tabSize);(null==i||n>u)&&(i=s-1,n=u)}return i}function Rt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=Ft(e,t,r),l=o>n.first&&Ki(n,o-1).stateAfter;return l=l?Ql(n.mode,l):Jl(n.mode),n.iter(o,t,function(r){Ni(e,r.text,l);var s=o==t-1||o%5==0||o>=i.viewFrom&&o2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function _t(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Yt(e,t){t=fi(t);var r=Yi(t),n=e.display.externalMeasured=new Wr(e.doc,t,r);n.lineN=r;var i=n.built=Oi(e,n);return n.text=i.pre,Fo(e.display.lineMeasure,i.pre),n}function $t(e,t,r,n){return Qt(e,Zt(e,t),r,n)}function qt(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt?(i=0,o=1,l="left"):u>t?(i=t-a,o=i+1):(s==e.length-3||t==u&&e[s+3]>t)&&(o=u-a,i=o-1,t>=u&&(l="right")),null!=i){if(n=e[s+2],a==u&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)n=e[(s-=3)+2],l="left";if("right"==r&&i==u-a)for(;sc;c++){for(;s&&Po(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+afl&&0==s&&a==o.coverEnd-o.coverStart)i=l.parentNode.getBoundingClientRect();else if(cl&&e.options.lineWrapping){var f=Ds(l,s,a).getClientRects();i=f.length?f["right"==n?f.length-1:0]:Il}else i=Ds(l,s,a).getBoundingClientRect()||Il;if(i.left||i.right||0==s)break;a=s,s-=1,u="right"}cl&&11>fl&&(i=tr(e.display.measure,i))}else{s>0&&(u=n="right");var f;i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==n?f.length-1:0]:l.getBoundingClientRect()}if(cl&&9>fl&&!s&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+vr(e.display),top:h.top,bottom:h.bottom}:Il}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,c=0;cr.from?l(e-1):l(e,n)}n=n||Ki(e.doc,t.line),i||(i=Zt(e,n));var a=Zi(n),u=t.ch;if(!a)return l(u);var c=nl(a,u),f=s(u,c);return null!=Ys&&(f.other=s(u,Ys)),f}function fr(e,t){var r=0,t=pt(e.doc,t);e.options.lineWrapping||(r=vr(e.display)*t.ch);var n=Ki(e.doc,t.line),i=qi(n)+Bt(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function hr(e,t,r,n){var i=Al(e,t);return i.xRel=n,r&&(i.outside=!0),i}function dr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,0>r)return hr(n.first,0,!0,-1);var i=$i(n,r),o=n.first+n.size-1;if(i>o)return hr(n.first+n.size-1,Ki(n,o).text.length,!0,1);0>t&&(t=0);for(var l=Ki(n,i);;){var s=pr(e,l,i,t,r),a=ui(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=Yi(l=u.to.line)}}function pr(e,t,r,n,i){function o(n){var i=cr(e,Al(r,n),"line",t,u);return s=!0,l>i.bottom?i.left-a:lv)return hr(r,d,m,1);for(;;){if(c?d==h||d==ol(t,h,1):1>=d-h){for(var y=p>n||v-n>=n-p?h:d,b=n-(y==h?p:v);Po(t.text.charAt(y));)++y;var w=hr(r,y,y==h?g:m,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(f/2),C=h+x;if(c){C=h;for(var S=0;x>S;++S)C=ol(t,C,1)}var L=o(C);L>n?(d=C,v=L,(m=s)&&(v+=1e3),f=x):(h=C,p=L,g=s,f-=x)}}function gr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ol){Ol=zo("pre");for(var t=0;49>t;++t)Ol.appendChild(document.createTextNode("x")),Ol.appendChild(zo("br"));Ol.appendChild(document.createTextNode("x"))}Fo(e.measure,Ol);var r=Ol.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Eo(e.measure),r||1}function vr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=zo("span","xxxxxxxxxx"),r=zo("pre",[t]);Fo(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function mr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++zl},Pl?Pl.ops.push(e.curOp):e.curOp.ownsGroup=Pl={ops:[e.curOp],delayedCallbacks:[]}}function yr(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new k(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Cr(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function Sr(e){var t=e.cm,r=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$t(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Vt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Kt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Lr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLefto;o=n){var l=new Wr(e.doc,Ki(e.doc,o),o);n=o+l.size,i.push(l)}return i}function Dr(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ml&&di(e.doc,t)i.viewFrom?Ir(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Ir(e);else if(t<=i.viewFrom){var o=zr(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):Ir(e)}else if(r>=i.viewTo){var o=zr(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Ir(e)}else{var l=zr(e,t,t,-1),s=zr(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Or(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):Ir(e)}var a=i.externalMeasured;a&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Pr(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==Mo(l,r)&&l.push(r)}}}function Ir(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Pr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,n=0;nt)return n}function zr(e,t,r,n){var i,o=Pr(e,t),l=e.display.view;if(!Ml||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=0,a=e.display.viewFrom;o>s;s++)a+=l[s].size;if(a!=t){if(n>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}for(;di(e.doc,r)!=r;){if(o==(0>n?0:l.length-1))return null;r+=n*l[o-(0>n?1:0)].size,o+=n}return{index:o,lineN:r}}function Er(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=Or(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Or(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Pr(e,r)))),n.viewTo=r}function Fr(e){for(var t=e.display.view,r=0,n=0;n400}function i(t){bo(e,t)||bs(t)}var o=e.display;ws(o.scroller,"mousedown",Mr(e,Vr)),cl&&11>fl?ws(o.scroller,"dblclick",Mr(e,function(t){if(!bo(e,t)){var r=Ur(e,t);if(r&&!Yr(e,t)&&!Gr(e.display,t)){ms(t);var n=e.findWordAt(r);bt(e.doc,n.anchor,n.head)}}})):ws(o.scroller,"dblclick",function(t){bo(e,t)||ms(t)}),kl||ws(o.scroller,"contextmenu",function(t){hn(e,t)});var l,s={end:0};ws(o.scroller,"touchstart",function(e){if(!r(e)){clearTimeout(l);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-s.end<=300?s:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),ws(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),ws(o.scroller,"touchend",function(r){var i=o.activeTouch;if(i&&!Gr(o,r)&&null!=i.left&&!i.moved&&new Date-i.start<300){var l,s=e.coordsChar(o.activeTouch,"page");l=!i.prev||n(i,i.prev)?new ct(s,s):!i.prev.prev||n(i,i.prev.prev)?e.findWordAt(s):new ct(Al(s.line,0),pt(e.doc,Al(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),ms(r)}t()}),ws(o.scroller,"touchcancel",t),ws(o.scroller,"scroll",function(){o.scroller.clientHeight&&(Zr(e,o.scroller.scrollTop),Qr(e,o.scroller.scrollLeft,!0),Cs(e,"scroll",e))}),ws(o.scroller,"mousewheel",function(t){Jr(e,t)}),ws(o.scroller,"DOMMouseScroll",function(t){Jr(e,t)}),ws(o.wrapper,"scroll",function(){o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),e.options.dragDrop&&(ws(o.scroller,"dragstart",function(t){qr(e,t)}),ws(o.scroller,"dragenter",i),ws(o.scroller,"dragover",i),ws(o.scroller,"drop",Mr(e,$r)));var a=o.input.getField();ws(a,"keyup",function(t){an.call(e,t)}),ws(a,"keydown",Mr(e,ln)),ws(a,"keypress",Mr(e,un)),ws(a,"focus",Do(cn,e)),ws(a,"blur",Do(fn,e))}function Br(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Gr(e,t){for(var r=go(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Ur(e,t,r,n){var i=e.display;if(!r&&"true"==go(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=dr(e,o,l);if(n&&1==u.xRel&&(a=Ki(e.doc,u.line).text).length==u.ch){var c=Ns(a,a.length,e.options.tabSize)-a.length;u=Al(u.line,Math.max(0,Math.round((o-Ut(e.display).left)/vr(e.display))-c))}return u}function Vr(e){var t=this,r=t.display;if(!(r.activeTouch&&r.input.supportsTouch()||bo(t,e))){if(r.shift=e.shiftKey,Gr(r,e))return void(hl||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!Yr(t,e)){var n=Ur(t,e);switch(window.focus(),vo(e)){case 1:n?Kr(t,e,n):go(e)==r.scroller&&ms(e);break;case 2:hl&&(t.state.lastMiddleDown=+new Date),n&&bt(t.doc,n),setTimeout(function(){r.input.focus()},20),ms(e);break;case 3:kl&&hn(t,e)}}}}function Kr(e,t,r){cl?setTimeout(Do(q,e),0):q(e);var n,i=+new Date;Hl&&Hl.time>i-400&&0==Nl(Hl.pos,r)?n="triple":Dl&&Dl.time>i-400&&0==Nl(Dl.pos,r)?(n="double",Hl={time:i,pos:r}):(n="single",Dl={time:i,pos:r});var o,l=e.doc.sel,s=xl?t.metaKey:t.ctrlKey;e.options.dragDrop&&Us&&!Z(e)&&"single"==n&&(o=l.contains(r))>-1&&!l.ranges[o].empty()?jr(e,t,r,s):Xr(e,t,r,n,s)}function jr(e,t,r,n){var i=e.display,o=Mr(e,function(l){hl&&(i.scroller.draggable=!1),e.state.draggingText=!1,xs(document,"mouseup",o),xs(i.scroller,"drop",o),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(ms(l),n||bt(e.doc,r),i.input.focus(),cl&&9==fl&&setTimeout(function(){document.body.focus(),i.input.focus()},20))});hl&&(i.scroller.draggable=!0),e.state.draggingText=o,i.scroller.dragDrop&&i.scroller.dragDrop(),ws(document,"mouseup",o),ws(i.scroller,"drop",o)}function Xr(e,t,r,n,i){function o(t){if(0!=Nl(v,t))if(v=t,"rect"==n){for(var i=[],o=e.options.tabSize,l=Ns(Ki(u,r.line).text,r.ch,o),s=Ns(Ki(u,t.line).text,t.ch,o),a=Math.min(l,s),d=Math.max(l,s),p=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));g>=p;p++){var m=Ki(u,p).text,y=Lo(m,a,o);a==d?i.push(new ct(Al(p,y),Al(p,y))):m.length>y&&i.push(new ct(Al(p,y),Al(p,Lo(m,d,o))))}i.length||i.push(new ct(r,r)),kt(u,ft(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,w=b.anchor,x=t;if("single"!=n){if("double"==n)var C=e.findWordAt(t);else var C=new ct(Al(t.line,0),pt(u,Al(t.line+1,0)));Nl(C.anchor,w)>0?(x=C.head,w=$(b.from(),C.anchor)):(x=C.anchor,w=Y(b.to(),C.head))}var i=h.ranges.slice(0);i[f]=new ct(pt(u,w),x),kt(u,ft(i,f),Ms)}}function l(t){var r=++y,i=Ur(e,t,!0,"rect"==n);if(i)if(0!=Nl(i,v)){q(e),o(i);var s=w(a,u);(i.line>=s.to||i.linem.bottom?20:0;c&&setTimeout(Mr(e,function(){y==r&&(a.scroller.scrollTop+=c,l(t))}),50)}}function s(e){y=1/0,ms(e),a.input.focus(),xs(document,"mousemove",b),xs(document,"mouseup",x),u.history.lastSelOrigin=null}var a=e.display,u=e.doc;ms(t);var c,f,h=u.sel,d=h.ranges;if(i&&!t.shiftKey?(f=u.sel.contains(r),c=f>-1?d[f]:new ct(r,r)):c=u.sel.primary(),t.altKey)n="rect",i||(c=new ct(r,r)),r=Ur(e,t,!0,!0),f=-1;else if("double"==n){var p=e.findWordAt(r);c=e.display.shift||u.extend?yt(u,c,p.anchor,p.head):p}else if("triple"==n){var g=new ct(Al(r.line,0),pt(u,Al(r.line+1,0)));c=e.display.shift||u.extend?yt(u,c,g.anchor,g.head):g}else c=yt(u,c,r);i?-1==f?(f=d.length,kt(u,ft(d.concat([c]),f),{scroll:!1,origin:"*mouse"})):d.length>1&&d[f].empty()&&"single"==n?(kt(u,ft(d.slice(0,f).concat(d.slice(f+1)),0)),h=u.sel):xt(u,f,c,Ms):(f=0,kt(u,new ut([c],0),Ms),h=u.sel);var v=r,m=a.wrapper.getBoundingClientRect(),y=0,b=Mr(e,function(e){vo(e)?l(e):s(e)}),x=Mr(e,s);ws(document,"mousemove",b),ws(document,"mouseup",x)}function _r(e,t,r,n,i){try{var o=t.clientX,l=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ms(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(l>a.bottom||!xo(e,r))return po(t);l-=a.top-s.viewOffset;for(var u=0;u=o){var f=$i(e.doc,l),h=e.options.gutters[u];return i(e,r,e,f,h,t),po(t)}}}function Yr(e,t){return _r(e,t,"gutterClick",!0,mo)}function $r(e){var t=this;if(!bo(t,e)&&!Gr(t.display,e)){ms(e),cl&&(El=+new Date);var r=Ur(t,e,!0),n=e.dataTransfer.files;if(r&&!Z(t))if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=function(e,n){var s=new FileReader;s.onload=Mr(t,function(){if(o[n]=s.result,++l==i){r=pt(t.doc,r);var e={from:r,to:r,text:Vs(o.join("\n")),origin:"paste"};bn(t.doc,e),Lt(t.doc,ht(r,Vl(e)))}}),s.readAsText(e)},a=0;i>a;++a)s(n[a],a);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(xl?e.metaKey:e.ctrlKey))var u=t.listSelections();if(Tt(t.doc,ht(r,r)),u)for(var a=0;al.clientWidth||i&&l.scrollHeight>l.clientHeight){if(i&&xl&&hl)e:for(var s=t.target,a=o.view;s!=l;s=s.parentNode)for(var u=0;uc?f=Math.max(0,f+c-50):h=Math.min(e.doc.height,h+c+50),N(e,{top:f,bottom:h})}20>Fl&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Rl=(Rl*Fl+r)/(Fl+1),++Fl)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function en(e,t,r){if("string"==typeof t&&(t=es[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{Z(e)&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=ks}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function tn(e,t,r){for(var n=0;nfl&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=nn(t,e);gl&&(Ul=n?r:null,!n&&88==r&&!js&&(xl?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||sn(t)}}function sn(e){function t(e){18!=e.keyCode&&e.altKey||(Rs(r,"CodeMirror-crosshair"),xs(document,"keyup",t),xs(document,"mouseover",t))}var r=e.display.lineDiv;Bs(r,"CodeMirror-crosshair"),ws(document,"keyup",t),ws(document,"mouseover",t)}function an(e){16==e.keyCode&&(this.doc.sel.shift=!1),bo(this,e)}function un(e){var t=this;if(!(Gr(t.display,e)||bo(t,e)||e.ctrlKey&&!e.altKey||xl&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(gl&&r==Ul)return Ul=null,void ms(e);if(!gl||e.which&&!(e.which<10)||!nn(t,e)){var i=String.fromCharCode(null==n?r:n);on(t,e,i)||t.display.input.onKeyPress(e)}}}function cn(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(Cs(e,"focus",e),e.state.focused=!0,Bs(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),hl&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Pt(e))}function fn(e){e.state.focused&&(Cs(e,"blur",e),e.state.focused=!1,Rs(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function hn(e,t){Gr(e.display,t)||dn(e,t)||e.display.input.onContextMenu(t)}function dn(e,t){return xo(e,"gutterContextMenu")?_r(e,t,"gutterContextMenu",!1,Cs):!1}function pn(e,t){if(Nl(e,t.from)<0)return e;if(Nl(e,t.to)<=0)return Vl(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Vl(t).ch-t.to.ch),Al(r,n)}function gn(e,t){for(var r=[],n=0;n=0;--i)wn(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else wn(e,t)}}function wn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Nl(t.from,t.to)){var r=gn(e,t);ro(e,t,r,e.cm?e.cm.curOp.id:0/0),Sn(e,t,r,Qn(e,t));var n=[];Ui(e,function(e,r){r||-1!=Mo(n,e.history)||(ho(e.history,t),n.push(e.history)),Sn(e,t,null,Qn(e,t))})}}function xn(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a=0;--a){var f=n.changes[a];if(f.origin=t,c&&!yn(e,f,!1))return void(l.length=0);u.push(Ji(e,f));var h=a?gn(e,f):To(l);Sn(e,f,h,ei(e,f)),!a&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Vl(f)});var d=[];Ui(e,function(e,t){t||-1!=Mo(d,e.history)||(ho(e.history,f),d.push(e.history)),Sn(e,f,null,ei(e,f))})}}}}function Cn(e,t){if(0!=t&&(e.first+=t,e.sel=new ut(Ao(e.sel.ranges,function(e){return new ct(Al(e.anchor.line+t,e.anchor.ch),Al(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Dr(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:Al(o,Ki(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ji(e,t.from,t.to),r||(r=gn(e,t)),e.cm?Ln(e.cm,t,n):Ri(e,t,n),Tt(e,r,Ts)}}function Ln(e,t,r){var n=e.doc,i=e.display,l=t.from,s=t.to,a=!1,u=l.line;e.options.lineWrapping||(u=Yi(fi(Ki(n,l.line))),n.iter(u,s.line+1,function(e){return e==i.maxLine?(a=!0,!0):void 0})),n.sel.contains(t.from,t.to)>-1&&wo(e),Ri(n,t,r,o(e)),e.options.lineWrapping||(n.iter(u,l.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,l.line),zt(e,400);var c=t.text.length-(s.line-l.line)-1;t.full?Dr(e):l.line!=s.line||1!=t.text.length||Fi(e.doc,t)?Dr(e,l.line,s.line+1,c):Hr(e,l.line,"text");var h=xo(e,"changes"),d=xo(e,"change");if(d||h){var p={from:l,to:s,text:t.text,removed:t.removed,origin:t.origin};d&&mo(e,"change",e,p),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function kn(e,t,r,n,i){if(n||(n=r),Nl(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=Vs(t)),bn(e,{from:r,to:n,text:t,origin:i})}function Tn(e,t){if(!bo(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!yl){var o=zo("div","​",null,"position: absolute; top: "+(t.top-r.viewOffset-Bt(e.display))+"px; height: "+(t.bottom-t.top+Vt(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Mn(e,t,r,n){null==n&&(n=0);for(var i=0;5>i;i++){var o=!1,l=cr(e,t),s=r&&r!=t?cr(e,r):l,a=Nn(e,Math.min(l.left,s.left),Math.min(l.top,s.top)-n,Math.max(l.left,s.left),Math.max(l.bottom,s.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=a.scrollTop&&(Zr(e,a.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=a.scrollLeft&&(Qr(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return l}function An(e,t,r,n,i){var o=Nn(e,t,r,n,i);null!=o.scrollTop&&Zr(e,o.scrollTop),null!=o.scrollLeft&&Qr(e,o.scrollLeft)}function Nn(e,t,r,n,i){var o=e.display,l=gr(e.display);0>r&&(r=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,a=jt(e),u={};i-r>a&&(i=r+a);var c=e.doc.height+Gt(o),f=l>r,h=i>c-l;if(s>r)u.scrollTop=f?0:r;else if(i>s+a){var d=Math.min(r,(h?c:i)-a);d!=s&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Kt(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),10>t?u.scrollLeft=0:p>t?u.scrollLeft=Math.max(0,t-(v?0:10)):n>g+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Wn(e,t,r){(null!=t||null!=r)&&Dn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function On(e){Dn(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?Al(t.line,t.ch-1):t,n=Al(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Dn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=fr(e,t.from),n=fr(e,t.to),i=Nn(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Hn(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Rt(e,t):r="prev");var l=e.options.tabSize,s=Ki(o,t),a=Ns(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&(u=o.mode.indent(i,s.text.slice(c.length),s.text),u==ks||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?Ns(Ki(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)h+=l,f+=" ";if(u>h&&(f+=ko(u-h)),f!=c)kn(o,f,Al(t,0),Al(t,c.length),"+input");else for(var d=0;d=0;t--)kn(e.doc,"",n[t].from,n[t].to,"+delete");On(e)})}function zn(e,t,r,n,i){function o(){var t=s+r;return t=e.first+e.size?f=!1:(s=t,c=Ki(e,t))}function l(e){var t=(i?ol:ll)(c,a,r,!0);if(null==t){if(e||!o())return f=!1;a=i?(0>r?Qo:Zo)(c):0>r?c.text.length:0}else a=t;return!0}var s=t.line,a=t.ch,u=r,c=Ki(e,s),f=!0;if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var h=null,d="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),g=!0;!(0>r)||l(!g);g=!1){var v=c.text.charAt(a)||"\n",m=Ho(v,p)?"w":d&&"\n"==v?"n":!d||/\s/.test(v)?null:"p";if(!d||g||m||(m="s"),h&&h!=m){0>r&&(r=1,l());break}if(m&&(h=m),r>0&&!l(!g))break}var y=Wt(e,Al(s,a),u,!0);return f||(y.hitSide=!0),y}function En(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(s-(0>r?1.5:.5)*gr(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var a=dr(e,l,i);if(!a.outside)break;if(0>r?0>=i:i>=o.height){a.hitSide=!0;break}i+=5*r}return a}function Fn(t,r,n,i){e.defaults[t]=r,n&&(jl[t]=i?function(e,t,r){r!=Xl&&n(e,t,r)}:n)}function Rn(e){for(var t,r,n,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l0||0==l&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=zo("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(ci(e,t.line,t,r,o)||t.line!=r.line&&ci(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ml=!0}o.addToHistory&&ro(e,{from:t,to:r,origin:"markText"},e.sel,0/0);var s,a=t.line,u=e.cm;if(e.iter(a,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&fi(e)==u.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&_i(e,0),$n(e,new Xn(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a}),o.collapsed&&e.iter(t.line,r.line+1,function(t){gi(e,t)&&_i(t,0)}),o.clearOnEnter&&ws(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Tl=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ls,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Dr(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)Hr(u,c,"text");o.atomic&&At(u.doc),mo(u,"markerAdded",u,o)}return o}function Un(e,t,r,n,i){n=Oo(n),n.shared=!1;var o=[Gn(e,t,r,n,i)],l=o[0],s=n.widgetNode;return Ui(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(Gn(e,pt(e,t),pt(e,r),n,i));for(var a=0;a=t:o.to>t);(n||(n=[])).push(new Xn(l,o.from,a?null:o.to))}}return n}function Zn(e,t,r){if(e)for(var n,i=0;i=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from0&&s)for(var f=0;ff;++f)p.push(g);p.push(a)}return p}function Jn(e){for(var t=0;t0)){var c=[a,1],f=Nl(u.from,s.from),h=Nl(u.to,s.to);(0>f||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from}),(h>0||!l.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-1}}return i}function ri(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(Nl(u.to,r)>0||a.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Nl(u.from,n)<0||a.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function fi(e){for(var t;t=ai(e);)e=t.find(-1,!0).line;return e}function hi(e){for(var t,r;t=ui(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function di(e,t){var r=Ki(e,t),n=fi(r);return r==n?t:Yi(n)}function pi(e,t){if(t>e.lastLine())return t;var r,n=Ki(e,t);if(!gi(e,n))return t;for(;r=ui(n);)n=r.find(1,!0).line;return Yi(n)+1}function gi(e,t){var r=Ml&&t.markedSpans;if(r)for(var n,i=0;io;o++){i&&(i[0]=e.innerMode(t,n).mode);var l=t.token(r,n);if(r.pos>r.start)return l}throw new Error("Mode "+t.name+" failed to advance stream.")}function ki(e,t,r,n){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?Ql(l.mode,c):c}}var o,l=e.doc,s=l.mode;t=pt(l,t);var a,u=Ki(l,t.line),c=Rt(e,t.line,r),f=new os(u.text,e.options.tabSize);for(n&&(a=[]);(n||f.pose.options.maxHighlightLength?(s=!1,l&&Ni(e,t,n,f.pos),f.pos=t.length,a=null):a=Ci(Li(r,f,n,h),o),h){var d=h[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;uu;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"cm-overlay "+t),a=r+2;else for(;a>r;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ai(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Mi(e,t,t.stateAfter=Rt(e,Yi(t)));t.styles=n.styles,n.classes?t.styleClasses=n.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Ni(e,t,r,n){var i=e.doc.mode,o=new os(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&Si(i,r);!o.eol()&&o.pos<=e.options.maxHighlightLength;)Li(i,o,r),o.start=o.pos}function Wi(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?hs:fs;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Oi(e,t){var r=zo("span",null,null,hl?"padding-right: .1px":null),n={pre:zo("pre",[r]),content:r,col:0,pos:0,cm:e};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=Hi,(cl||hl)&&e.getOption("lineWrapping")&&(n.addToken=Ii(n.addToken)),Xo(e.display.measure)&&(o=Zi(l))&&(n.addToken=Pi(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&Yi(l);Ei(l,n,Ai(e,l,s)),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=Go(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=Go(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(jo(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return hl&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),Cs(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=Go(n.pre.className,n.textClass||"")),n}function Di(e){var t=zo("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Hi(e,t,r,n,i,o,l){if(t){var s=e.cm.options.specialChars,a=!1;if(s.test(t))for(var u=document.createDocumentFragment(),c=0;;){s.lastIndex=c;var f=s.exec(t),h=f?f.index-c:t.length-c;if(h){var d=document.createTextNode(t.slice(c,c+h));u.appendChild(cl&&9>fl?zo("span",[d]):d),e.map.push(e.pos,e.pos+h,d),e.col+=h,e.pos+=h}if(!f)break;if(c+=h+1," "==f[0]){var p=e.cm.options.tabSize,g=p-e.col%p,d=u.appendChild(zo("span",ko(g),"cm-tab"));d.setAttribute("role","presentation"),d.setAttribute("cm-text"," "),e.col+=g}else{var d=e.cm.options.specialCharPlaceholder(f[0]);d.setAttribute("cm-text",f[0]),u.appendChild(cl&&9>fl?zo("span",[d]):d),e.col+=1}e.map.push(e.pos,e.pos+1,d),e.pos++}else{e.col+=t.length;var u=document.createTextNode(t);e.map.push(e.pos,e.pos+t.length,u),cl&&9>fl&&(a=!0),e.pos+=t.length}if(r||n||i||a||l){var v=r||"";n&&(v+=n),i&&(v+=i);var m=zo("span",[u],v,l);return o&&(m.title=o),e.content.appendChild(m)}e.content.appendChild(u)}}function Ii(e){function t(e){for(var t=" ",r=0;ra&&f.from<=a)break}if(f.to>=u)return e(r,n,i,o,l,s);e(r,n.slice(0,f.to-a),i,o,null,s),o=null,n=n.slice(f.to-a),a=f.to}}}function zi(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Ei(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=f=s="",h=null,m=1/0;for(var y=[],b=0;bp)?(null!=w.to&&m>w.to&&(m=w.to,u=""),x.className&&(a+=" "+x.className),x.css&&(s=x.css),x.startStyle&&w.from==p&&(c+=" "+x.startStyle),x.endStyle&&w.to==m&&(u+=" "+x.endStyle),x.title&&!f&&(f=x.title),x.collapsed&&(!h||li(h.marker,x)<0)&&(h=w)):w.from>p&&m>w.from&&(m=w.from),"bookmark"==x.type&&w.from==p&&x.widgetNode&&y.push(x)}if(h&&(h.from||0)==p&&(zi(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to))return;if(!h&&y.length)for(var b=0;b=d)break;for(var C=Math.min(d,m);;){if(v){var S=p+v.length;if(!h){var L=S>C?v.slice(0,C-p):v;t.addToken(t,L,l?l+a:a,c,p+L.length==m?u:"",f,s)}if(S>=C){v=v.slice(C-p),p=C;break}p=S,c=""}v=i.slice(o,o=r[g++]),l=Wi(r[g++],t.cm.options)}}else for(var g=1;gr;++r)o.push(new cs(u[r],i(r),n));return o}var s=t.from,a=t.to,u=t.text,c=Ki(e,s.line),f=Ki(e,a.line),h=To(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Fi(e,t)){var g=l(0,u.length-1);o(f,f.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(a.ch),d);else{var g=l(1,u.length-1);g.push(new cs(h+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,g)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(f,h+f.text.slice(a.ch),d);var g=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,g)}mo(e,"change",e,t)}function Bi(e){this.lines=e,this.parent=null;for(var t=0,r=0;tt||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(o>t){r=i;break}t-=o}return r.lines[t]}function ji(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function Xi(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function _i(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Yi(e){if(null==e.parent)return null;for(var t=e.parent,r=Mo(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function $i(e,t){var r=e.first;e:do{for(var n=0;nt){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var n=0;nt)break;t-=s}return r+n}function qi(e){e=fi(e);for(var t=0,r=e.parent,n=0;n1&&!e.done[e.done.length-2].ranges?(e.done.pop(),To(e.done)):void 0}function ro(e,t,r,n){var i=e.history;i.undone.length=0;var o,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=to(i,i.lastOp==n))){var s=To(o.changes);0==Nl(t.from,t.to)&&0==Nl(t.from,s.to)?s.to=Vl(t):o.changes.push(Ji(e,t))}else{var a=To(i.done);for(a&&a.ranges||oo(e.sel,i.done),o={changes:[Ji(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||Cs(e,"historyAdded")}function no(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function io(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||no(e,o,To(i.done),t))?i.done[i.done.length-1]=t:oo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&eo(i.undone)}function oo(e,t){var r=To(t);r&&r.ranges&&r.equals(e)||t.push(e)}function lo(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function so(e){if(!e)return null;for(var t,r=0;r-1&&(To(s)[f]=c[f],delete c[f])}}}return i}function co(e,t,r,n){r0}function Co(e){e.prototype.on=function(e,t){ws(this,e,t)},e.prototype.off=function(e,t){xs(this,e,t)}}function So(){this.id=null}function Lo(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function ko(e){for(;Ws.length<=e;)Ws.push(To(Ws)+" ");return Ws[e]}function To(e){return e[e.length-1]}function Mo(e,t){for(var r=0;r-1&&Is(e)?!0:t.test(e):Is(e)}function Io(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Po(e){return e.charCodeAt(0)>=768&&Ps.test(e)}function zo(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild);return e}function Fo(e,t){return Eo(e).appendChild(t)}function Ro(){return document.activeElement}function Bo(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Go(e,t){for(var r=e.split(" "),n=0;n2&&!(cl&&8>fl))}var r=Es?zo("span","​"):zo("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Xo(e){if(null!=Fs)return Fs;var t=Fo(e,document.createTextNode("AخA")),r=Ds(t,0,1).getBoundingClientRect();if(!r||r.left==r.right)return!1;var n=Ds(t,1,2).getBoundingClientRect();return Fs=n.right-r.right<3}function _o(e){if(null!=Xs)return Xs;var t=Fo(e,zo("span","x")),r=t.getBoundingClientRect(),n=Ds(t,0,1).getBoundingClientRect();return Xs=Math.abs(r.left-n.left)>1}function Yo(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function $o(e){return e.level%2?e.to:e.from}function qo(e){return e.level%2?e.from:e.to}function Zo(e){var t=Zi(e);return t?$o(t[0]):0}function Qo(e){var t=Zi(e);return t?qo(To(t)):e.text.length}function Jo(e,t){var r=Ki(e.doc,t),n=fi(r);n!=r&&(t=Yi(n));var i=Zi(n),o=i?i[0].level%2?Qo(n):Zo(n):0;return Al(t,o)}function el(e,t){for(var r,n=Ki(e.doc,t);r=ui(n);)n=r.find(1,!0).line,t=null;var i=Zi(n),o=i?i[0].level%2?Zo(n):Qo(n):n.text.length;return Al(null==t?Yi(n):t,o)}function tl(e,t){var r=Jo(e,t.line),n=Ki(e.doc,r.line),i=Zi(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return Al(r.line,l?0:o)}return r}function rl(e,t,r){var n=e[0].level;return t==n?!0:r==n?!1:r>t}function nl(e,t){Ys=null;for(var r,n=0;nt)return n;if(i.from==t||i.to==t){if(null!=r)return rl(e,i.level,e[r].level)?(i.from!=i.to&&(Ys=r),n):(i.from!=i.to&&(Ys=n),r);r=n}}return r}function il(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&Po(e.text.charAt(t)));return t}function ol(e,t,r,n){var i=Zi(e);if(!i)return ll(e,t,r,n);for(var o=nl(i,t),l=i[o],s=il(e,t,l.level%2?-r:r,n);;){if(s>l.from&&s0==l.level%2?l.to:l.from);if(l=i[o+=r],!l)return null;s=r>0==l.level%2?il(e,l.to,-1,n):il(e,l.from,1,n)}}function ll(e,t,r,n){var i=t+r;if(n)for(;i>0&&Po(e.text.charAt(i));)i+=r;return 0>i||i>e.text.length?null:i}var sl=/gecko\/\d/i.test(navigator.userAgent),al=/MSIE \d/.test(navigator.userAgent),ul=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),cl=al||ul,fl=cl&&(al?document.documentMode||6:ul[1]),hl=/WebKit\//.test(navigator.userAgent),dl=hl&&/Qt\/\d+\.\d+/.test(navigator.userAgent),pl=/Chrome\//.test(navigator.userAgent),gl=/Opera\//.test(navigator.userAgent),vl=/Apple Computer/.test(navigator.vendor),ml=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),yl=/PhantomJS/.test(navigator.userAgent),bl=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),wl=bl||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),xl=bl||/Mac/.test(navigator.platform),Cl=/win/i.test(navigator.platform),Sl=gl&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Sl&&(Sl=Number(Sl[1])),Sl&&Sl>=15&&(gl=!1,hl=!0);var Ll=xl&&(dl||gl&&(null==Sl||12.11>Sl)),kl=sl||cl&&fl>=9,Tl=!1,Ml=!1;g.prototype=Oo({update:function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&e.clientHeight>0&&(0==n&&this.overlayHack(),this.checkedOverlay=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},overlayHack:function(){var e=xl&&!ml?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;var t=this,r=function(e){go(e)!=t.vert&&go(e)!=t.horiz&&Mr(t.cm,Vr)(e)};ws(this.vert,"mousedown",r),ws(this.horiz,"mousedown",r)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},g.prototype),v.prototype=Oo({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},v.prototype),e.scrollbarModel={"native":g,"null":v},k.prototype.signal=function(e,t){xo(e,t)&&this.events.push(arguments)},k.prototype.finish=function(){for(var e=0;e=9&&r.hasSelection&&(r.hasSelection=null),r.poll()}),ws(o,"paste",function(){if(hl&&!n.state.fakedLastChar&&!(new Date-n.state.lastMiddleDown<200)){var e=o.selectionStart,t=o.selectionEnd;o.value+="$",o.selectionEnd=t,o.selectionStart=e,n.state.fakedLastChar=!0}n.state.pasteIncoming=!0,r.fastPoll()}),ws(o,"cut",t),ws(o,"copy",t),ws(e.scroller,"paste",function(t){Gr(e,t)||(n.state.pasteIncoming=!0,r.focus())}),ws(e.lineSpace,"selectstart",function(t){Gr(e,t)||ms(t)})},prepareSelection:function(){var e=this.cm,t=e.display,r=e.doc,n=Dt(e);if(e.options.moveInputWithCursor){var i=cr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},showSelection:function(e){var t=this.cm,r=t.display;Fo(r.cursorDiv,e.cursors),Fo(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=js&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var l=t?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&Os(this.textarea),cl&&fl>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",cl&&fl>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!wl||Ro()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,r=this.prevInput;if(!e.state.focused||Ks(t)&&!r||Z(e)||e.options.disableInput||e.state.keySeq)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var n=t.value;if(n==r&&!e.somethingSelected())return!1;if(cl&&fl>=9&&this.hasSelection===n||xl&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;8203!=n.charCodeAt(0)||e.doc.sel!=e.display.selForContextMenu||r||(r="​");for(var i=0,o=Math.min(r.length,n.length);o>i&&r.charCodeAt(i)==n.charCodeAt(i);)++i;var l=this;return Tr(e,function(){Q(e,n.slice(i),r.length-i),n.length>1e3||n.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=n --}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){cl&&fl>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t=l.value="​"+(e?l.value:"");n.prevInput=e?"":"​",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.position="relative",l.style.cssText=c,cl&&9>fl&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!cl||cl&&9>fl)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart?Mr(i,es.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset()};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,l=n.textarea,s=Ur(i,e),a=o.scroller.scrollTop;if(s&&!gl){var u=i.options.resetSelectionOnContextMenu;u&&-1==i.doc.sel.contains(s)&&Mr(i,kt)(i.doc,ht(s),Ts);var c=l.style.cssText;if(n.wrapper.style.position="absolute",l.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(cl?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",hl)var f=window.scrollY;if(o.input.focus(),hl&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),cl&&fl>=9&&t(),kl){bs(e);var h=function(){xs(window,"mouseup",h),setTimeout(r,20)};ws(window,"mouseup",h)}else setTimeout(r,50)}},setUneditable:No,needsContentAttribute:!1},tt.prototype),nt.prototype=Oo({init:function(e){function t(e){if(n.somethingSelected())Wl=n.getSelections(),"cut"==e.type&&n.replaceSelection("",null,"cut");else{var t=J(n);Wl=t.text,"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,Ts),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!bl)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Wl.join("\n"));else{var r=rt(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=Wl.join("\n");var o=document.activeElement;Os(i),setTimeout(function(){n.display.lineSpace.removeChild(r),o.focus()},50)}}var r=this,n=r.cm,i=r.div=e.lineDiv;i.contentEditable="true",et(i),ws(i,"paste",function(e){var t=e.clipboardData&&e.clipboardData.getData("text/plain");t&&(e.preventDefault(),n.replaceSelection(t,null,"paste"))}),ws(i,"compositionstart",function(e){var t=e.data;if(r.composing={sel:n.doc.sel,data:t,startData:t},t){var i=n.doc.sel.primary(),o=n.getLine(i.head.line),l=o.indexOf(t,Math.max(0,i.head.ch-t.length));l>-1&&l<=i.head.ch&&(r.composing.sel=ht(Al(i.head.line,l),Al(i.head.line,l+t.length)))}}),ws(i,"compositionupdate",function(e){r.composing.data=e.data}),ws(i,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),ws(i,"touchstart",function(){r.forceCompositionEnd()}),ws(i,"input",function(){r.composing||r.pollContent()||Tr(r.cm,function(){Dr(n)})}),ws(i,"copy",t),ws(i,"cut",t)},prepareSelection:function(){var e=Dt(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=lt(this.cm,e.anchorNode,e.anchorOffset),n=lt(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=Nl($(r,n),t.from())||0!=Nl(Y(r,n),t.to())){var i=it(this.cm,t.from()),o=it(this.cm,t.to());if(i||o){var l=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var a=l[l.length-1].measure,u=a.maps?a.maps[a.maps.length-1]:a.map;o={node:u[u.length-1],offset:u[u.length-2]-u[u.length-3]}}}else i={node:l[0].measure.map[2],offset:0};try{var c=Ds(i.node,i.offset,o.offset,o.node)}catch(f){}c&&(e.removeAllRanges(),e.addRange(c),s&&null==e.anchorNode&&e.addRange(s)),this.rememberSelection()}}},showMultipleSelections:function(e){Fo(this.cm.display.cursorDiv,e.cursors),Fo(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return zs(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Tr(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},pollSelection:function(){if(!this.composing){var e=window.getSelection(),t=this.cm;if(e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset){this.rememberSelection();var r=lt(t,e.anchorNode,e.anchorOffset),n=lt(t,e.focusNode,e.focusOffset);r&&n&&Tr(t,function(){kt(t.doc,ht(r,n),Ts),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},pollContent:function(){var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.linet.viewTo-1)return!1;var o;if(n.line==t.viewFrom||0==(o=Pr(e,n.line)))var l=Yi(t.view[0].line),s=t.view[0].node;else var l=Yi(t.view[o].line),s=t.view[o-1].node.nextSibling;var a=Pr(e,i.line);if(a==t.view.length-1)var u=t.viewTo-1,c=t.view[a].node;else var u=Yi(t.view[a+1].line)-1,c=t.view[a+1].node.previousSibling;for(var f=Vs(at(e,s,c,l,u)),h=ji(e.doc,Al(l,0),Al(u,Ki(e.doc,u).text.length));f.length>1&&h.length>1;)if(To(f)==To(h))f.pop(),h.pop(),u--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),l++}for(var d=0,p=0,g=f[0],v=h[0],m=Math.min(g.length,v.length);m>d&&g.charCodeAt(d)==v.charCodeAt(d);)++d;for(var y=To(f),b=To(h),w=Math.min(y.length-(1==f.length?d:0),b.length-(1==h.length?d:0));w>p&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;f[f.length-1]=y.slice(0,y.length-p),f[0]=f[0].slice(d);var x=Al(l,d),C=Al(u,h.length?To(h).length-p:0);return f.length>1||f[0]||Nl(x,C)?(kn(e.doc,f,x,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){e.data&&e.data!=e.startData&&Mr(this.cm,Q)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.setAttribute("contenteditable","false")},onKeyPress:function(e){e.preventDefault(),Mr(this.cm,Q)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},onContextMenu:No,resetPosition:No,needsContentAttribute:!0},nt.prototype),e.inputStyles={textarea:tt,contenteditable:nt},ut.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&Nl(e,n.to())<=0)return r}return-1}},ct.prototype={from:function(){return $(this.anchor,this.head)},to:function(){return Y(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Ol,Dl,Hl,Il={left:0,right:0,top:0,bottom:0},Pl=null,zl=0,El=0,Fl=0,Rl=null;cl?Rl=-.53:sl?Rl=15:pl?Rl=-.7:vl&&(Rl=-1/3);var Bl=function(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}};e.wheelEventPixels=function(e){var t=Bl(e);return t.x*=Rl,t.y*=Rl,t};var Gl=new So,Ul=null,Vl=e.changeEnd=function(e){return e.text?Al(e.from.line+e.text.length-1,To(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];(r[e]!=t||"mode"==e)&&(r[e]=t,jl.hasOwnProperty(e)&&Mr(this,jl[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Bn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(Hn(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&On(this));else{var o=i.from(),l=i.to(),s=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;r>a;++a)Hn(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&xt(this.doc,n,new ct(o,u[n].to()),Ts)}}}),getTokenAt:function(e,t){return ki(this,e,t)},getLineTokens:function(e,t){return ki(this,Al(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,r=Ai(this,Ki(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]s?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Zl.hasOwnProperty(t))return Zl;var n=Zl[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;on&&(e=n,r=!0);var i=Ki(this.doc,e);return sr(this,i,{top:0,left:0},t||"page").top+(r?this.doc.height-qi(i):0)},defaultTextHeight:function(){return gr(this.display)},defaultCharWidth:function(){return vr(this.display)},setGutterMarker:Ar(function(e,t,r){return In(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&Io(n)&&(e.gutterMarkers=null),!0})}),clearGutter:Ar(function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,Hr(t,n,"gutter"),Io(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),addLineWidget:Ar(function(e,t,r){return bi(this,e,t,r)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!vt(this.doc,e))return null;var t=e;if(e=Ki(this.doc,e),!e)return null}else{var t=Yi(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=cr(this,pt(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&An(this,s,l,s+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:Ar(ln),triggerOnKeyPress:Ar(un),triggerOnKeyUp:an,execCommand:function(e){return es.hasOwnProperty(e)?es[e](this):void 0},findPosH:function(e,t,r,n){var i=1;0>t&&(i=-1,t=-t);for(var o=0,l=pt(this.doc,e);t>o&&(l=zn(this.doc,l,i,r,n),!l.hitSide);++o);return l},moveH:Ar(function(e,t){var r=this;r.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?zn(r.doc,n.head,e,t,r.options.rtlMoveVisually):0>e?n.from():n.to()},As)}),deleteH:Ar(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Pn(this,function(r){var i=zn(n,r.head,e,t,!1);return 0>e?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;0>t&&(i=-1,t=-t);for(var l=0,s=pt(this.doc,e);t>l;++l){var a=cr(this,s,"div");if(null==o?o=a.left:a.left=o,s=En(this,a,i,r),s.hitSide)break}return s},moveV:Ar(function(e,t){var r=this,n=this.doc,i=[],o=!r.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return 0>e?l.from():l.to();var s=cr(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=En(r,s,e,t);return"page"==t&&l==n.sel.primary()&&Wn(r,null,ur(r,a,"div").top-s.top),a},As),i.length)for(var l=0;l0&&s(r.charAt(n-1));)--n;for(;i.5)&&l(this),Cs(this,"refresh",this)}),swapDoc:Ar(function(e){var t=this.doc;return t.cm=null,Vi(this,e),ir(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,mo(this,"swapDoc",this,t),t}),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}},Co(e);var Kl=e.defaults={},jl=e.optionHandlers={},Xl=e.Init={toString:function(){return"CodeMirror.Init"}};Fn("value","",function(e,t){e.setValue(t)},!0),Fn("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),Fn("indentUnit",2,r,!0),Fn("indentWithTabs",!1),Fn("smartIndent",!0),Fn("tabSize",4,function(e){n(e),ir(e),Dr(e)},!0),Fn("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t){e.options.specialChars=new RegExp(t.source+(t.test(" ")?"":"| "),"g"),e.refresh()},!0),Fn("specialCharPlaceholder",Di,function(e){e.refresh()},!0),Fn("electricChars",!0),Fn("inputStyle",wl?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Fn("rtlMoveVisually",!Cl),Fn("wholeLineUpdateBefore",!0),Fn("theme","default",function(e){s(e),a(e)},!0),Fn("keyMap","default",function(t,r,n){var i=Bn(r),o=n!=e.Init&&Bn(n);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Fn("extraKeys",null),Fn("lineWrapping",!1,i,!0),Fn("gutters",[],function(e){d(e.options),a(e)},!0),Fn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?L(e.display)+"px":"0",e.refresh()},!0),Fn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Fn("scrollbarStyle","native",function(e){m(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Fn("lineNumbers",!1,function(e){d(e.options),a(e)},!0),Fn("firstLineNumber",1,a,!0),Fn("lineNumberFormatter",function(e){return e},a,!0),Fn("showCursorWhenSelecting",!1,Ot,!0),Fn("resetSelectionOnContextMenu",!0),Fn("readOnly",!1,function(e,t){"nocursor"==t?(fn(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||e.display.input.reset())}),Fn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Fn("dragDrop",!0),Fn("cursorBlinkRate",530),Fn("cursorScrollMargin",0),Fn("cursorHeight",1,Ot,!0),Fn("singleCursorHeightPerLine",!0,Ot,!0),Fn("workTime",100),Fn("workDelay",100),Fn("flattenSpans",!0,n,!0),Fn("addModeClass",!1,n,!0),Fn("pollInterval",100),Fn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Fn("historyEventDelay",1250),Fn("viewportMargin",10,function(e){e.refresh()},!0),Fn("maxHighlightLength",1e4,n,!0),Fn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Fn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Fn("autofocus",null);var _l=e.modes={},Yl=e.mimeModes={};e.defineMode=function(t,r){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),_l[t]=r},e.defineMIME=function(e,t){Yl[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Yl.hasOwnProperty(t))t=Yl[t];else if(t&&"string"==typeof t.name&&Yl.hasOwnProperty(t.name)){var r=Yl[t.name];"string"==typeof r&&(r={name:r}),t=Wo(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),n=_l[r.name];if(!n)return e.getMode(t,"text/plain");var i=n(t,r);if($l.hasOwnProperty(r.name)){var o=$l[r.name];for(var l in o)o.hasOwnProperty(l)&&(i.hasOwnProperty(l)&&(i["_"+l]=i[l]),i[l]=o[l])}if(i.name=r.name,r.helperType&&(i.helperType=r.helperType),r.modeProps)for(var l in r.modeProps)i[l]=r.modeProps[l];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var $l=e.modeExtensions={};e.extendMode=function(e,t){var r=$l.hasOwnProperty(e)?$l[e]:$l[e]={};Oo(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){ps.prototype[e]=t},e.defineOption=Fn;var ql=[];e.defineInitHook=function(e){ql.push(e)};var Zl=e.helpers={};e.registerHelper=function(t,r,n){Zl.hasOwnProperty(t)||(Zl[t]=e[t]={_global:[]}),Zl[t][r]=n},e.registerGlobalHelper=function(t,r,n,i){e.registerHelper(t,r,i),Zl[t]._global.push({pred:n,val:i})};var Ql=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},Jl=e.startState=function(e,t,r){return e.startState?e.startState(t,r):!0};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var es=e.commands={selectAll:function(e){e.setSelection(Al(e.firstLine(),0),Al(e.lastLine()),Ts)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ts)},killLine:function(e){Pn(e,function(t){if(t.empty()){var r=Ki(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new Al(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Al(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Ki(e.doc,i.line-1).text;l&&e.replaceRange(o.charAt(0)+"\n"+l.charAt(l.length-1),Al(i.line-1,l.length-1),Al(i.line,1),"+transpose")}r.push(new ct(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){Tr(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var n=e.listSelections()[r];e.replaceRange("\n",n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0),On(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},ts=e.keyMap={};ts.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ts.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ts.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},ts.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ts["default"]=xl?ts.macDefault:ts.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Ao(r.split(" "),Rn),o=0;o=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ls=0,ss=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ls};Co(ss),ss.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&mr(e),xo(this,"clear")){var r=this.find();r&&mo(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Dr(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&At(e.doc)),e&&mo(e,"markerCleared",e,this),t&&br(e),this.parent&&this.parent.clear()}},ss.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;ir;++r){var i=this.lines[r];this.height-=i.height,xi(i),mo(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;ne;++e)if(r(this.lines[e]))return!0}},Gi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;re){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Bi))){var s=[];this.collapse(s),this.children=[new Bi(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t=e){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var l=i.lines.splice(i.lines.length-25,25),s=new Bi(l);i.height-=s.height,this.children.splice(n+1,0,s),s.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Gi(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=Mo(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new Gi(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;ne){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var ds=0,ps=e.Doc=function(e,t,r){if(!(this instanceof ps))return new ps(e,t,r);null==r&&(r=0),Gi.call(this,[new Bi([new cs("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var n=Al(r,0);this.sel=ht(n),this.history=new Qi(null),this.id=++ds,this.modeOption=t,"string"==typeof e&&(e=Vs(e)),Ri(this,{from:n,to:n,text:e}),kt(this,ht(n),Ts)};ps.prototype=Wo(Gi.prototype,{constructor:ps,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n=0;o--)bn(this,n[o]);s?Lt(this,s):this.cm&&On(this.cm)}),undo:Nr(function(){xn(this,"undo")}),redo:Nr(function(){xn(this,"redo")}),undoSelection:Nr(function(){xn(this,"undo",!0)}),redoSelection:Nr(function(){xn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=pt(this,e),t=pt(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;sa.to||null==a.from&&i!=e.line||i==t.line&&a.from>t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=i,void++r)}),pt(this,Al(r,t))},indexFromPos:function(e){e=pt(this,e);var t=e.ch;return e.linet&&(t=e.from),null!=e.to&&e.tos||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}},Ws=[""],Os=function(e){e.select()};bl?Os=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:cl&&(Os=function(e){try{e.select()}catch(t){}});var Ds,Hs=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Is=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Hs.test(e))},Ps=/[\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]/;Ds=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var zs=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};cl&&11>fl&&(Ro=function(){try{return document.activeElement}catch(e){return document.body}});var Es,Fs,Rs=e.rmClass=function(e,t){var r=e.className,n=Bo(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Bs=e.addClass=function(e,t){var r=e.className;Bo(t).test(r)||(e.className+=(r?" ":"")+t)},Gs=!1,Us=function(){if(cl&&9>fl)return!1;var e=zo("div");return"draggable"in e||"dragDrop"in e}(),Vs=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;n>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Ks=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},js=function(){var e=zo("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Xs=null,_s={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=_s,function(){for(var e=0;10>e;e++)_s[e+48]=_s[e+96]=String(e);for(var e=65;90>=e;e++)_s[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)_s[e+111]=_s[e+63235]="F"+e}();var Ys,$s=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?n.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,s=/[Lb1n]/,a=/[1n]/,u="L";return function(r){if(!i.test(r))return!1;for(var n,c=r.length,f=[],h=0;c>h;++h)f.push(n=e(r.charCodeAt(h)));for(var h=0,d=u;c>h;++h){var n=f[h];"m"==n?f[h]=d:d=n}for(var h=0,p=u;c>h;++h){var n=f[h];"1"==n&&"r"==p?f[h]="n":l.test(n)&&(p=n,"r"==n&&(f[h]="R"))}for(var h=1,d=f[0];c-1>h;++h){var n=f[h];"+"==n&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=n||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d),d=n}for(var h=0;c>h;++h){var n=f[h];if(","==n)f[h]="N";else if("%"==n){for(var g=h+1;c>g&&"%"==f[g];++g);for(var v=h&&"!"==f[h-1]||c>g&&"1"==f[g]?"1":"N",m=h;g>m;++m)f[m]=v;h=g-1}}for(var h=0,p=u;c>h;++h){var n=f[h];"L"==p&&"1"==n?f[h]="L":l.test(n)&&(p=n)}for(var h=0;c>h;++h)if(o.test(f[h])){for(var g=h+1;c>g&&o.test(f[g]);++g);for(var y="L"==(h?f[h-1]:u),b="L"==(c>g?f[g]:u),v=y||b?"L":"R",m=h;g>m;++m)f[m]=v;h=g-1}for(var w,x=[],h=0;c>h;)if(s.test(f[h])){var C=h;for(++h;c>h&&s.test(f[h]);++h);x.push(new t(0,C,h))}else{var S=h,L=x.length;for(++h;c>h&&"L"!=f[h];++h);for(var m=S;h>m;)if(a.test(f[m])){m>S&&x.splice(L,0,new t(1,S,m));var k=m;for(++m;h>m&&a.test(f[m]);++m);x.splice(L,0,new t(2,k,m)),S=m}else++m;h>S&&x.splice(L,0,new t(1,S,h))}return 1==x[0].level&&(w=r.match(/^\s+/))&&(x[0].from=w[0].length,x.unshift(new t(0,0,w[0].length))),1==To(x).level&&(w=r.match(/\s+$/))&&(To(x).to-=w[0].length,x.push(new t(0,c-w[0].length,c))),x[0].level!=To(x).level&&x.push(new t(x[0].level,c,c)),x}}();return e.version="5.0.1",e}); -\ No newline at end of file -+!function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);this.CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d?Ge(d):{},Ge(Uf,d,!1),n(d);var e=d.value;"string"==typeof e&&(e=new qg(e,d.mode)),this.doc=e;var f=new a.inputStyles[d.inputStyle](this),g=this.display=new b(c,e,f);g.wrapper.CodeMirror=this,j(this),h(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!wf&&g.input.focus(),r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new ye,keySeq:null,specialChars:null};var i=this;mf&&11>nf&&setTimeout(function(){i.display.input.reset(!0)},20),Ob(this),Se(),sb(this),this.curOp.forceUpdate=!0,Td(this,e),d.autofocus&&!wf||i.hasFocus()?setTimeout(He(mc,this),20):nc(this);for(var k in Vf)Vf.hasOwnProperty(k)&&Vf[k](this,d[k],Wf);w(this),d.finishInit&&d.finishInit(this);for(var l=0;l<$f.length;++l)$f[l](this);ub(this),of&&d.lineWrapping&&"optimizelegibility"==getComputedStyle(g.lineDiv).textRendering&&(g.lineDiv.style.textRendering="auto")}function b(a,b,c){var d=this;this.input=c,d.scrollbarFiller=Le("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=Le("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=Le("div",null,"CodeMirror-code"),d.selectionDiv=Le("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=Le("div",null,"CodeMirror-cursors"),d.measure=Le("div",null,"CodeMirror-measure"),d.lineMeasure=Le("div",null,"CodeMirror-measure"),d.lineSpace=Le("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none"),d.mover=Le("div",[Le("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=Le("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=Le("div",null,null,"position: absolute; height: "+Ag+"px; width: 1px;"),d.gutters=Le("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=Le("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=Le("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),mf&&8>nf&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),of||jf&&wf||(d.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(d.wrapper):a(d.wrapper)),d.viewFrom=d.viewTo=b.first,d.reportedViewFrom=d.reportedViewTo=b.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,c.init(d)}function c(b){b.doc.mode=a.getMode(b.options,b.doc.modeOption),d(b)}function d(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,La(a,100),a.state.modeGen++,a.curOp&&Hb(a)}function e(a){a.options.lineWrapping?(Qg(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Pg(a.display.wrapper,"CodeMirror-wrap"),m(a)),g(a),Hb(a),fb(a),setTimeout(function(){s(a)},100)}function f(a){var b=qb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/rb(a.display)-3);return function(e){if(rd(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;gb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=Ce(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Qa(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+Sa(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function p(a,b,c){this.cm=c;var d=this.vert=Le("div",[Le("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=Le("div",[Le("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d),a(e),wg(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")}),wg(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")}),this.checkedOverlay=!1,mf&&8>nf&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function q(){}function r(b){b.display.scrollbars&&(b.display.scrollbars.clear(),b.display.scrollbars.addClass&&Pg(b.display.wrapper,b.display.scrollbars.addClass)),b.display.scrollbars=new a.scrollbarModel[b.options.scrollbarStyle](function(a){b.display.wrapper.insertBefore(a,b.display.scrollbarFiller),wg(a,"mousedown",function(){b.state.focused&&setTimeout(function(){b.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,c){"horizontal"==c?ac(b,a):_b(b,a)},b),b.display.scrollbars.addClass&&Qg(b.display.wrapper,b.display.scrollbars.addClass)}function s(a,b){b||(b=o(a));var c=a.display.barWidth,d=a.display.barHeight;t(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&F(a),t(a,o(a)),c=a.display.barWidth,d=a.display.barHeight}function t(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",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 u(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Pa(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=Zd(b,d),g=Zd(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;f>h?(f=h,g=Zd(b,$d(Ud(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=Zd(b,$d(Ud(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function v(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=y(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Nb(a))return!1;w(a)&&(Jb(a),b.dims=H(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFromg&&c.viewTo-g<20&&(g=Math.min(e,c.viewTo)),Df&&(f=pd(a.doc,f),g=qd(a.doc,g));var h=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;Mb(a,f,g),c.viewOffset=$d(Ud(a.doc,c.viewFrom)),a.display.mover.style.top=c.viewOffset+"px";var i=Nb(a);if(!h&&0==i&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;var j=Oe();return i>4&&(c.lineDiv.style.display="none"),I(a,c.updateLineNumbers,b.dims),i>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,j&&Oe()!=j&&j.offsetHeight&&j.focus(),Me(c.cursorDiv),Me(c.selectionDiv),c.gutters.style.height=0,h&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,La(a,400)),c.updateLineNumbers=null,!0}function C(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Ta(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Qa(a.display)-Ua(a),c.top)}),b.visible=u(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&B(a,b);d=!1){F(a);var e=o(a);Ga(a),E(a,e),s(a,e)}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 D(a,b){var c=new z(a,b);if(B(a,c)){F(a),C(a,c);var d=o(a);Ga(a),E(a,d),s(a,d),c.finish()}}function E(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";var c=b.docHeight+a.display.barHeight;a.display.heightForcer.style.top=c+"px",a.display.gutters.style.height=Math.max(c+Sa(a),b.clientHeight)+"px"}function F(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;dnf){var g=f.node.offsetTop+f.node.offsetHeight;e=g-c,c=g}else{var h=f.node.getBoundingClientRect();e=h.bottom-h.top}var i=f.line.height-e;if(2>e&&(e=qb(b)),(i>.001||-.001>i)&&(Xd(f.line,e),G(f.line),f.rest))for(var j=0;j=b&&l.lineNumber;l.changes&&(Ce(l.changes,"gutter")>-1&&(m=!1),J(a,l,j,c)),m&&(Me(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(x(a.options,j)))),h=l.node.nextSibling}else{var n=R(a,l,j,c);g.insertBefore(n,h)}j+=l.size}for(;h;)h=d(h)}function J(a,b,c,d){for(var e=0;enf&&(a.node.style.zIndex=2)),a.node}function L(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=K(a);a.background=c.insertBefore(Le("div",null,b),c.firstChild)}}function M(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Hd(a,b)}function N(a,b){var c=b.text.className,d=M(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,O(b)):c&&(b.text.className=c)}function O(a){L(a),a.line.wrapClass?K(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var b=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=b||""}function P(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);var e=b.line.gutterMarkers;if(a.options.lineNumbers||e){var f=K(b),g=b.gutter=Le("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px");if(a.display.input.setUneditable(g),f.insertBefore(g,b.text),b.line.gutterClass&&(g.className+=" "+b.line.gutterClass),!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(Le("div",x(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),e)for(var h=0;h1&&(Gf&&Gf.join("\n")==b?h=d.ranges.length%Gf.length==0&&De(Gf,Tg):g.length==d.ranges.length&&(h=De(g,function(a){return[a]})));for(var i=d.ranges.length-1;i>=0;i--){var j=d.ranges[i],k=j.from(),l=j.to();j.empty()&&(c&&c>0?k=Ef(k.line,k.ch-c):a.state.overwrite&&!a.state.pasteIncoming&&(l=Ef(l.line,Math.min(Ud(f,l.line).text.length,l.ch+Be(g).length))));var m=a.curOp.updateInput,n={from:k,to:l,text:h?h[i%h.length]:g,origin:e||(a.state.pasteIncoming?"paste":a.state.cutIncoming?"cut":"+input")};vc(a.doc,n),se(a,"inputRead",a,n)}b&&!a.state.pasteIncoming&&_(a,b),Hc(a),a.curOp.updateInput=m,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function _(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=Jc(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(Ud(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Jc(a,e.head.line,"smart"));g&&se(a,"electricInput",a,e.head.line)}}}function aa(a){for(var b=[],c=[],d=0;de?j.map:k[e],g=0;ge?a.line:a.rest[e]),l=f[g]+d;return(0>d||h!=b)&&(l=f[g+(d?1:0)]),Ef(i,l)}}}var e=a.text.firstChild,f=!1;if(!b||!Mg(e,b))return ga(Ef(Yd(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b)){var g=a.rest?Be(a.rest):a.line;return ga(Ef(Yd(g),g.text.length),f)}var h=3==b.nodeType?b:null,i=b;for(h||1!=b.childNodes.length||3!=b.firstChild.nodeType||(h=b.firstChild,c&&(c=h.nodeValue.length));i.parentNode!=e;)i=i.parentNode;var j=a.measure,k=j.maps,l=d(h,i,c);if(l)return ga(l,f);for(var m=i.nextSibling,n=h?h.nodeValue.length-c:0;m;m=m.nextSibling){if(l=d(m,m.firstChild,0))return ga(Ef(l.line,l.ch-n),f);n+=m.textContent.length}for(var o=i.previousSibling,n=c;o;o=o.previousSibling){if(l=d(o,o.firstChild,-1))return ga(Ef(l.line,l.ch+n),f);n+=m.textContent.length}}function ja(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return""==c&&(c=b.textContent.replace(/\u200b/g,"")),void(h+=c);var j,k=b.getAttribute("cm-marker");if(k){var l=a.findMarks(Ef(d,0),Ef(e+1,0),f(+k));return void(l.length&&(j=l[0].find())&&(h+=Vd(a.doc,j.from,j.to).join("\n")))}if("false"==b.getAttribute("contenteditable"))return;for(var m=0;m=0){var g=X(f.from(),e.from()),h=W(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new la(i?h:g,i?g:h))}}return new ka(a,b)}function na(a,b){return new ka([new la(a,b||a)],0)}function oa(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function pa(a,b){if(b.linec?Ef(c,Ud(a,c).text.length):qa(b,Ud(a,b.line).text.length)}function qa(a,b){var c=a.ch;return null==c||c>b?Ef(a.line,b):0>c?Ef(a.line,0):a}function ra(a,b){return b>=a.first&&b=f.ch:j.to>f.ch))){if(d&&(yg(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find(0>g?-1:1);if(0==Ff(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?pa(a,Ef(l.line-1)):null:l.ch>h.text.length&&(l=l.lineb&&(b=0),b=Math.round(b),d=Math.round(d),h.appendChild(Le("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?k-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){function f(c,d){return kb(a,Ef(b,c),"div",l,d)}var h,i,l=Ud(g,b),m=l.text.length;return Xe(_d(l),c||0,null==e?m:e,function(a,b,g){var l,n,o,p=f(a,"left");if(a==b)l=p,n=o=p.left;else{if(l=f(b-1,"right"),"rtl"==g){var q=p;p=l,l=q}n=p.left,o=l.right}null==c&&0==a&&(n=j),l.top-p.top>3&&(d(n,p.top,null,p.bottom),n=j,p.bottomi.bottom||l.bottom==i.bottom&&l.right>i.right)&&(i=l),j+1>n&&(n=j),d(n,l.top,o-n,l.bottom)}),{start:h,end:i}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),i=Ra(a.display),j=i.left,k=Math.max(f.sizerWidth,Ta(a)-f.sizer.offsetLeft)-i.right,l=b.from(),m=b.to();if(l.line==m.line)e(l.line,l.ch,m.ch);else{var n=Ud(g,l.line),o=Ud(g,m.line),p=nd(n)==nd(o),q=e(l.line,l.ch,p?n.text.length+1:null).end,r=e(m.line,p?0:null,m.ch).start;p&&(q.top0?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function La(a,b){a.doc.mode.startState&&a.doc.frontier=a.display.viewTo)){var c=+new Date+a.options.workTime,d=ag(b.mode,Oa(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=Dd(a,f,d,!0);f.styles=h.styles;var i=f.styleClasses,j=h.classes;j?f.styleClasses=j:i&&(f.styleClasses=null);for(var k=!g||g.length!=f.styles.length||i!=j&&(!i||!j||i.bgClass!=j.bgClass||i.textClass!=j.textClass),l=0;!k&&lc?(La(a,a.options.workDelay),!0):void 0}),e.length&&Bb(a,function(){for(var b=0;bg;--h){if(h<=f.first)return f.first;var i=Ud(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Fg(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Oa(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Na(a,b,c),g=f>d.first&&Ud(d,f-1).stateAfter;return g=g?ag(d.mode,g):bg(d.mode),d.iter(f,b,function(c){Fd(a,c.text,g);var h=f==b-1||f%5==0||f>=e.viewFrom&&f2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Wa(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[d],cache:a.measure.caches[d],before:!0}}function Xa(a,b){b=nd(b);var c=Yd(b),d=a.display.externalMeasured=new Fb(a.doc,b,c);d.lineN=c;var e=d.built=Hd(a,d);return d.text=e.pre,Ne(a.display.lineMeasure,e.pre),d}function Ya(a,b,c,d){return _a(a,$a(a,b),c,d)}function Za(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bb?(e=0,f=1,g="left"):j>b?(e=b-i,f=e+1):(h==a.length-3||b==j&&a[h+3]>b)&&(f=j-i,e=f-1,b>=j&&(g="right")),null!=e){if(d=a[h+2],i==j&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;h&&a[h-2]==a[h-3]&&a[h-1].insertLeft;)d=a[(h-=3)+2],g="left";if("right"==c&&e==j-i)for(;hk;k++){for(;h&&Ke(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+inf&&0==h&&i==f.coverEnd-f.coverStart)e=g.parentNode.getBoundingClientRect();else if(mf&&a.options.lineWrapping){var l=Ig(g,h,i).getClientRects();e=l.length?l["right"==d?l.length-1:0]:Kf}else e=Ig(g,h,i).getBoundingClientRect()||Kf;if(e.left||e.right||0==h)break;i=h,h-=1,j="right"}mf&&11>nf&&(e=cb(a.display.measure,e))}else{h>0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(mf&&9>nf&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+rb(a.display),top:m.top,bottom:m.bottom}:Kf}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,k=0;kc.from?g(a-1):g(a,d)}d=d||Ud(a.doc,b.line),e||(e=$a(a,d));var i=_d(d),j=b.ch;if(!i)return g(j);var k=ef(i,j),l=h(j,k);return null!=Yg&&(l.other=h(j,Yg)),l}function mb(a,b){var c=0,b=pa(a.doc,b);a.options.lineWrapping||(c=rb(a.display)*b.ch);var d=Ud(a.doc,b.line),e=$d(d)+Pa(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function nb(a,b,c,d){var e=Ef(a,b);return e.xRel=d,c&&(e.outside=!0),e}function ob(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return nb(d.first,0,!0,-1);var e=Zd(d,c),f=d.first+d.size-1;if(e>f)return nb(d.first+d.size-1,Ud(d,f).text.length,!0,1);0>b&&(b=0);for(var g=Ud(d,e);;){var h=pb(a,g,e,b,c),i=ld(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=Yd(g=j.to.line)}}function pb(a,b,c,d,e){function f(d){var e=lb(a,Ef(c,d),"line",b,j);return h=!0,g>e.bottom?e.left-i:gq)return nb(c,n,r,1);for(;;){if(k?n==m||n==gf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Ke(b.text.charAt(s));)++s;var u=nb(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=gf(b,w,1)}var y=f(w);y>d?(n=w,q=y,(r=h)&&(q+=1e3),l=v):(m=w,o=y,p=h,l-=v)}}function qb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Hf){Hf=Le("pre");for(var b=0;49>b;++b)Hf.appendChild(document.createTextNode("x")),Hf.appendChild(Le("br"));Hf.appendChild(document.createTextNode("x"))}Ne(a.measure,Hf);var c=Hf.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Me(a.measure),c||1}function rb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Le("span","xxxxxxxxxx"),c=Le("pre",[b]);Ne(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function sb(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:++Mf},Lf?Lf.ops.push(a.curOp):a.curOp.ownsGroup=Lf={ops:[a.curOp],delayedCallbacks:[]}}function tb(a){var b=a.delayedCallbacks,c=0;do{for(;c=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new z(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function xb(a){a.updatedDisplay=a.mustUpdate&&B(a.cm,a.update)}function yb(a){var b=a.cm,c=b.display;a.updatedDisplay&&F(b),a.barMeasure=o(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=Ya(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+Sa(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Ta(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection())}function zb(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeftf;f=d){var g=new Fb(a.doc,Ud(a.doc,f),f);d=f+g.size,e.push(g)}return e}function Hb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&cb)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Df&&pd(a.doc,b)e.viewFrom?Jb(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Jb(a);else if(b<=e.viewFrom){var f=Lb(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Jb(a)}else if(c>=e.viewTo){var f=Lb(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Jb(a)}else{var g=Lb(a,b,b,-1),h=Lb(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Gb(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Jb(a)}var i=e.externalMeasured;i&&(c=e.lineN&&b=d.viewTo)){var f=d.view[Kb(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==Ce(g,c)&&g.push(c)}}}function Jb(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Kb(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;db)return d}function Lb(a,b,c,d){var e,f=Kb(a,b),g=a.display.view;if(!Df||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=0,i=a.display.viewFrom;f>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(f==g.length-1)return null;e=i+g[f].size-b,f++}else e=i-b;b+=e,c+=e}for(;pd(a.doc,c)!=c;){if(f==(0>d?0:g.length-1))return null;c+=d*g[f-(0>d?1:0)].size,f+=d}return{index:f,lineN:c}}function Mb(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Gb(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Gb(a,b,d.viewFrom).concat(d.view):d.viewFromc&&(d.view=d.view.slice(0,Kb(a,c)))),d.viewTo=c}function Nb(a){for(var b=a.display.view,c=0,d=0;d400}var e=a.display;wg(e.scroller,"mousedown",Cb(a,Tb)),mf&&11>nf?wg(e.scroller,"dblclick",Cb(a,function(b){if(!ue(a,b)){var c=Sb(a,b);if(c&&!Yb(a,b)&&!Rb(a.display,b)){tg(b);var d=a.findWordAt(c);ua(a.doc,d.anchor,d.head)}}})):wg(e.scroller,"dblclick",function(b){ue(a,b)||tg(b)}),Bf||wg(e.scroller,"contextmenu",function(b){oc(a,b)});var f,g={end:0};wg(e.scroller,"touchstart",function(a){if(!c(a)){clearTimeout(f);var b=+new Date;e.activeTouch={start:b,moved:!1,prev:b-g.end<=300?g:null},1==a.touches.length&&(e.activeTouch.left=a.touches[0].pageX,e.activeTouch.top=a.touches[0].pageY)}}),wg(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),wg(e.scroller,"touchend",function(c){var f=e.activeTouch;if(f&&!Rb(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 la(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new la(Ef(h.line,0),pa(a.doc,Ef(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),tg(c)}b()}),wg(e.scroller,"touchcancel",b),wg(e.scroller,"scroll",function(){e.scroller.clientHeight&&(_b(a,e.scroller.scrollTop),ac(a,e.scroller.scrollLeft,!0),yg(a,"scroll",a))}),wg(e.scroller,"mousewheel",function(b){bc(a,b)}),wg(e.scroller,"DOMMouseScroll",function(b){bc(a,b)}),wg(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={simple:function(b){ue(a,b)||vg(b)},start:function(b){$b(a,b)},drop:Cb(a,Zb)};var h=e.input.getField();wg(h,"keyup",function(b){jc.call(a,b)}),wg(h,"keydown",Cb(a,hc)),wg(h,"keypress",Cb(a,kc)),wg(h,"focus",He(mc,a)),wg(h,"blur",He(nc,a))}function Pb(b,c,d){var e=d&&d!=a.Init;if(!c!=!e){var f=b.display.dragFunctions,g=c?wg:xg;g(b.display.scroller,"dragstart",f.start),g(b.display.scroller,"dragenter",f.simple),g(b.display.scroller,"dragover",f.simple),g(b.display.scroller,"drop",f.drop)}}function Qb(a){var b=a.display;(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)&&(b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize())}function Rb(a,b){for(var c=qe(b);c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function Sb(a,b,c,d){var e=a.display;if(!c&&"true"==qe(b).getAttribute("cm-not-content"))return null;var f,g,h=e.lineSpace.getBoundingClientRect();try{f=b.clientX-h.left,g=b.clientY-h.top}catch(b){return null}var i,j=ob(a,f,g);if(d&&1==j.xRel&&(i=Ud(a.doc,j.line).text).length==j.ch){var k=Fg(i,i.length,a.options.tabSize)-i.length;j=Ef(j.line,Math.max(0,Math.round((f-Ra(a.display).left)/rb(a.display))-k))}return j}function Tb(a){var b=this,c=b.display;if(!(c.activeTouch&&c.input.supportsTouch()||ue(b,a))){if(c.shift=a.shiftKey,Rb(c,a))return void(of||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)));if(!Yb(b,a)){var d=Sb(b,a);switch(window.focus(),re(a)){case 1:d?Ub(b,a,d):qe(a)==c.scroller&&tg(a);break;case 2:of&&(b.state.lastMiddleDown=+new Date),d&&ua(b.doc,d),setTimeout(function(){c.input.focus()},20),tg(a);break;case 3:Bf?oc(b,a):lc(b)}}}}function Ub(a,b,c){mf?setTimeout(He(Y,a),0):a.curOp.focus=Oe();var d,e=+new Date;Jf&&Jf.time>e-400&&0==Ff(Jf.pos,c)?d="triple":If&&If.time>e-400&&0==Ff(If.pos,c)?(d="double",Jf={time:e,pos:c}):(d="single",If={time:e,pos:c});var f,g=a.doc.sel,h=xf?b.metaKey:b.ctrlKey;a.options.dragDrop&&Sg&&!Z(a)&&"single"==d&&(f=g.contains(c))>-1&&!g.ranges[f].empty()?Vb(a,b,c,h):Wb(a,b,c,d,h)}function Vb(a,b,c,d){var e=a.display,f=+new Date,g=Cb(a,function(h){of&&(e.scroller.draggable=!1),a.state.draggingText=!1,xg(document,"mouseup",g),xg(e.scroller,"drop",g),Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)<10&&(tg(h),!d&&+new Date-200=o;o++){var r=Ud(j,o).text,s=ze(r,i,f);i==n?e.push(new la(Ef(o,s),Ef(o,s))):r.length>s&&e.push(new la(Ef(o,s),Ef(o,ze(r,n,f))))}e.length||e.push(new la(c,c)),Aa(j,ma(m.ranges.slice(0,l).concat(e),l),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var t=k,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=a.findWordAt(b);else var w=new la(Ef(b.line,0),pa(j,Ef(b.line+1,0)));Ff(w.anchor,u)>0?(v=w.head,u=X(t.from(),w.anchor)):(v=w.anchor,u=W(t.to(),w.head))}var e=m.ranges.slice(0);e[l]=new la(pa(j,u),v),Aa(j,ma(e,l),Dg)}}function g(b){var c=++s,e=Sb(a,b,!0,"rect"==d);if(e)if(0!=Ff(e,q)){a.curOp.focus=Oe(),f(e);var h=u(i,j);(e.line>=h.to||e.liner.bottom?20:0;k&&setTimeout(Cb(a,function(){s==c&&(i.scroller.scrollTop+=k,g(b))}),50)}}function h(a){s=1/0,tg(a),i.input.focus(),xg(document,"mousemove",t),xg(document,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;tg(b);var k,l,m=j.sel,n=m.ranges;if(e&&!b.shiftKey?(l=j.sel.contains(c),k=l>-1?n[l]:new la(c,c)):(k=j.sel.primary(),l=j.sel.primIndex),b.altKey)d="rect",e||(k=new la(c,c)),c=Sb(a,b,!0,!0),l=-1;else if("double"==d){var o=a.findWordAt(c);k=a.display.shift||j.extend?ta(j,k,o.anchor,o.head):o}else if("triple"==d){var p=new la(Ef(c.line,0),pa(j,Ef(c.line+1,0)));k=a.display.shift||j.extend?ta(j,k,p.anchor,p.head):p}else k=ta(j,k,c);e?-1==l?(l=n.length,Aa(j,ma(n.concat([k]),l),{scroll:!1,origin:"*mouse"})):n.length>1&&n[l].empty()&&"single"==d&&!b.shiftKey?(Aa(j,ma(n.slice(0,l).concat(n.slice(l+1)),0)),m=j.sel):wa(j,l,k,Dg):(l=0,Aa(j,new ka([k],0),Dg),m=j.sel);var q=c,r=i.wrapper.getBoundingClientRect(),s=0,t=Cb(a,function(a){re(a)?g(a):h(a)}),v=Cb(a,h);wg(document,"mousemove",t),wg(document,"mouseup",v)}function Xb(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&tg(b);var h=a.display,i=h.lineDiv.getBoundingClientRect();if(g>i.bottom||!we(a,c))return pe(b);g-=i.top-h.viewOffset;for(var j=0;j=f){var l=Zd(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),pe(b)}}}function Yb(a,b){return Xb(a,b,"gutterClick",!0,se)}function Zb(a){var b=this;if(!ue(b,a)&&!Rb(b.display,a)){tg(a),mf&&(Nf=+new Date);var c=Sb(b,a,!0),d=a.dataTransfer.files;if(c&&!Z(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){var h=new FileReader;h.onload=Cb(b,function(){if(f[d]=h.result,++g==e){c=pa(b.doc,c);var a={from:c,to:c,text:Tg(f.join("\n")),origin:"paste"};vc(b.doc,a),za(b.doc,na(c,Tf(a)))}}),h.readAsText(a)},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(function(){b.display.input.focus()},20);try{var f=a.dataTransfer.getData("Text");if(f){if(b.state.draggingText&&!(xf?a.altKey:a.ctrlKey))var j=b.listSelections();if(Ba(b.doc,na(c,c)),j)for(var i=0;ig.clientWidth||e&&g.scrollHeight>g.clientHeight){if(e&&xf&&of)a:for(var h=b.target,i=f.view;h!=g;h=h.parentNode)for(var j=0;jk?l=Math.max(0,l+k-50):m=Math.min(a.doc.height,m+k+50),D(a,{top:l,bottom:m})}20>Of&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(Pf=(Pf*Of+c)/(Of+1),++Of)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function cc(a,b,c){if("string"==typeof b&&(b=cg[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{Z(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Bg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function dc(a,b,c){for(var d=0;dnf&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=fc(b,a);rf&&(Sf=d?c:null,!d&&88==c&&!Vg&&(xf?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||ic(b)}}function ic(a){function b(a){18!=a.keyCode&&a.altKey||(Pg(c,"CodeMirror-crosshair"),xg(document,"keyup",b),xg(document,"mouseover",b))}var c=a.display.lineDiv;Qg(c,"CodeMirror-crosshair"),wg(document,"keyup",b),wg(document,"mouseover",b)}function jc(a){16==a.keyCode&&(this.doc.sel.shift=!1),ue(this,a)}function kc(a){var b=this;if(!(Rb(b.display,a)||ue(b,a)||a.ctrlKey&&!a.altKey||xf&&a.metaKey)){var c=a.keyCode,d=a.charCode;if(rf&&c==Sf)return Sf=null,void tg(a);if(!rf||a.which&&!(a.which<10)||!fc(b,a)){var e=String.fromCharCode(null==d?c:d);gc(b,a,e)||b.display.input.onKeyPress(a)}}}function lc(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,nc(a))},100)}function mc(a){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(yg(a,"focus",a),a.state.focused=!0,Qg(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),of&&setTimeout(function(){a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Ka(a))}function nc(a){a.state.delayingBlurEvent||(a.state.focused&&(yg(a,"blur",a),a.state.focused=!1,Pg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function oc(a,b){Rb(a.display,b)||pc(a,b)||a.display.input.onContextMenu(b)}function pc(a,b){return we(a,"gutterContextMenu")?Xb(a,b,"gutterContextMenu",!1,yg):!1}function qc(a,b){if(Ff(a,b.from)<0)return a;if(Ff(a,b.to)<=0)return Tf(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+=Tf(b).ch-b.to.ch),Ef(c,d)}function rc(a,b){for(var c=[],d=0;d=0;--e)wc(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else wc(a,b)}}function wc(a,b){if(1!=b.text.length||""!=b.text[0]||0!=Ff(b.from,b.to)){var c=rc(a,b);ee(a,b,c,a.cm?a.cm.curOp.id:NaN),zc(a,b,c,ad(a,b));var d=[];Sd(a,function(a,c){c||-1!=Ce(d,a.history)||(oe(a.history,b),d.push(a.history)),zc(a,b,null,ad(a,b))})}}function xc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i=0;--i){var l=d.changes[i];if(l.origin=b,k&&!uc(a,l,!1))return void(g.length=0);j.push(be(a,l));var m=i?rc(a,l):Be(g);zc(a,l,m,cd(a,l)),!i&&a.cm&&a.cm.scrollIntoView({from:l.from,to:Tf(l)});var n=[];Sd(a,function(a,b){b||-1!=Ce(n,a.history)||(oe(a.history,l),n.push(a.history)),zc(a,l,null,cd(a,l))})}}}}function yc(a,b){if(0!=b&&(a.first+=b,a.sel=new ka(De(a.sel.ranges,function(a){return new la(Ef(a.anchor.line+b,a.anchor.ch),Ef(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Hb(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:Ef(f,Ud(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=Vd(a,b.from,b.to),c||(c=rc(a,b)),a.cm?Ac(a.cm,b,d):Pd(a,b,d),Ba(a,c,Cg)}}function Ac(a,b,c){var d=a.doc,e=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=Yd(nd(Ud(d,g.line))),d.iter(j,h.line+1,function(a){return a==e.maxLine?(i=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&ve(a),Pd(d,b,c,f(a)),a.options.lineWrapping||(d.iter(j,g.line+b.text.length,function(a){var b=l(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,g.line),La(a,400);var k=b.text.length-(h.line-g.line)-1;b.full?Hb(a):g.line!=h.line||1!=b.text.length||Od(a.doc,b)?Hb(a,g.line,h.line+1,k):Ib(a,g.line,"text");var m=we(a,"changes"),n=we(a,"change");if(n||m){var o={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};n&&se(a,"change",a,o),m&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(o)}a.display.selForContextMenu=null}function Bc(a,b,c,d,e){if(d||(d=c),Ff(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=Tg(b)),vc(a,{from:c,to:d,text:b,origin:e})}function Cc(a,b){if(!ue(a,"scrollCursorIntoView")){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!uf){var f=Le("div","​",null,"position: absolute; top: "+(b.top-c.viewOffset-Pa(a.display))+"px; height: "+(b.bottom-b.top+Sa(a)+c.barHeight)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}}function Dc(a,b,c,d){null==d&&(d=0);for(var e=0;5>e;e++){var f=!1,g=lb(a,b),h=c&&c!=b?lb(a,c):g,i=Fc(a,Math.min(g.left,h.left),Math.min(g.top,h.top)-d,Math.max(g.left,h.left),Math.max(g.bottom,h.bottom)+d),j=a.doc.scrollTop,k=a.doc.scrollLeft;if(null!=i.scrollTop&&(_b(a,i.scrollTop),Math.abs(a.doc.scrollTop-j)>1&&(f=!0)),null!=i.scrollLeft&&(ac(a,i.scrollLeft),Math.abs(a.doc.scrollLeft-k)>1&&(f=!0)),!f)break}return g}function Ec(a,b,c,d,e){var f=Fc(a,b,c,d,e);null!=f.scrollTop&&_b(a,f.scrollTop),null!=f.scrollLeft&&ac(a,f.scrollLeft)}function Fc(a,b,c,d,e){var f=a.display,g=qb(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=Ua(a),j={};e-c>i&&(e=c+i);var k=a.doc.height+Qa(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=Ta(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0),q=d-b>p;return q&&(d=b+p),10>b?j.scrollLeft=0:o>b?j.scrollLeft=Math.max(0,b-(q?0:10)):d>p+o-3&&(j.scrollLeft=d+(q?0:10)-p),j}function Gc(a,b,c){(null!=b||null!=c)&&Ic(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Hc(a){Ic(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?Ef(b.line,b.ch-1):b,d=Ef(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Ic(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=mb(a,b.from),d=mb(a,b.to),e=Fc(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function Jc(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Oa(a,b):c="prev");var g=a.options.tabSize,h=Ud(f,b),i=Fg(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==Bg||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?Fg(Ud(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 l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(j/g);n;--n)m+=g,l+=" ";if(j>m&&(l+=Ae(j-m)),l!=k)return Bc(f,l,Ef(b,0),Ef(b,k.length),"+input"),h.stateAfter=null,!0;for(var n=0;n=0;b--)Bc(a.doc,"",d[b].from,d[b].to,"+delete");Hc(a)})}function Mc(a,b,c,d,e){function f(){var b=h+c;return b=a.first+a.size?l=!1:(h=b,k=Ud(a,b))}function g(a){var b=(e?gf:hf)(k,i,c,!0);if(null==b){if(a||!f())return l=!1;i=e?(0>c?_e:$e)(k):0>c?k.text.length:0}else i=b;return!0}var h=b.line,i=b.ch,j=c,k=Ud(a,h),l=!0;if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=a.cm&&a.cm.getHelper(b,"wordChars"),p=!0;!(0>c)||g(!p);p=!1){var q=k.text.charAt(i)||"\n",r=Ie(q,o)?"w":n&&"\n"==q?"n":!n||/\s/.test(q)?null:"p";if(!n||p||r||(r="s"),m&&m!=r){0>c&&(c=1,g());break}if(r&&(m=r),c>0&&!g(!p))break}var s=Fa(a,Ef(h,i),j,!0);return l||(s.hitSide=!0),s}function Nc(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); -+e=b.top+c*(h-(0>c?1.5:.5)*qb(a.display))}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(;;){var i=ob(a,g,e);if(!i.outside)break;if(0>c?0>=e:e>=f.height){i.hitSide=!0;break}e+=5*c}return i}function Oc(b,c,d,e){a.defaults[b]=c,d&&(Vf[b]=e?function(a,b,c){c!=Wf&&d(a,b,c)}:d)}function Pc(a){for(var b,c,d,e,f=a.split(/-(?!$)/),a=f[f.length-1],g=0;g0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Le("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(md(a,b.line,b,c,f)||b.line!=c.line&&md(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");Df=!0}f.addToHistory&&ee(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var h,i=b.line,j=a.cm;if(a.iter(i,c.line+1,function(a){j&&f.collapsed&&!j.options.lineWrapping&&nd(a)==j.display.maxLine&&(h=!0),f.collapsed&&i!=b.line&&Xd(a,0),Zc(a,new Wc(f,i==b.line?b.ch:null,i==c.line?c.ch:null)),++i}),f.collapsed&&a.iter(b.line,c.line+1,function(b){rd(a,b)&&Xd(b,0)}),f.clearOnEnter&&wg(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(Cf=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++ig,f.atomic=!0),j){if(h&&(j.curOp.updateMaxLine=!0),f.collapsed)Hb(j,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(var k=b.line;k<=c.line;k++)Ib(j,k,"text");f.atomic&&Da(j.doc),se(j,"markerAdded",j,f)}return f}function Sc(a,b,c,d,e){d=Ge(d),d.shared=!1;var f=[Rc(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Sd(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Rc(a,pa(a,b),pa(a,c),d,e));for(var i=0;i=b:f.to>b);(d||(d=[])).push(new Wc(g,f.from,i?null:f.to))}}return d}function _c(a,b,c){if(a)for(var d,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 l=0;ll;++l)o.push(p);o.push(i)}return o}function bd(a){for(var b=0;b0)){var k=[i,1],l=Ff(j.from,h.from),m=Ff(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function ed(a){var b=a.markedSpans;if(b){for(var c=0;c=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(Ff(j.to,c)>0||i.marker.inclusiveRight&&e.inclusiveLeft)||k>=0&&(Ff(j.from,d)<0||i.marker.inclusiveLeft&&e.inclusiveRight)))return!0}}}function nd(a){for(var b;b=kd(a);)a=b.find(-1,!0).line;return a}function od(a){for(var b,c;b=ld(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function pd(a,b){var c=Ud(a,b),d=nd(c);return c==d?b:Yd(d)}function qd(a,b){if(b>a.lastLine())return b;var c,d=Ud(a,b);if(!rd(a,d))return b;for(;c=ld(d);)d=c.find(1,!0).line;return Yd(d)+1}function rd(a,b){var c=Df&&b.markedSpans;if(c)for(var d,e=0;ef;f++){e&&(e[0]=a.innerMode(b,d).mode);var g=b.token(c,d);if(c.pos>c.start)return g}throw new Error("Mode "+b.name+" failed to advance stream.")}function Bd(a,b,c,d){function e(a){return{start:l.start,end:l.pos,string:l.current(),type:f||null,state:a?ag(g.mode,k):k}}var f,g=a.doc,h=g.mode;b=pa(g,b);var i,j=Ud(g,b.line),k=Oa(a,b.line,c),l=new hg(j.text,a.options.tabSize);for(d&&(i=[]);(d||l.posa.options.maxHighlightLength?(h=!1,g&&Fd(a,b,d,l.pos),l.pos=b.length,i=null):i=yd(Ad(c,l,d,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;jj;){var d=e[i];d>a&&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,"cm-overlay "+b),i=c+2;else for(;i>c;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"cm-overlay "+b}},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Ed(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=Dd(a,b,b.stateAfter=Oa(a,Yd(b)));b.styles=d.styles,d.classes?b.styleClasses=d.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.frontier&&a.doc.frontier++}return b.styles}function Fd(a,b,c,d){var e=a.doc.mode,f=new hg(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&zd(e,c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)Ad(e,f,c),f.start=f.pos}function Gd(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?og:ng;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Hd(a,b){var c=Le("span",null,null,of?"padding-right: .1px":null),d={pre:Le("pre",[c]),content:c,col:0,pos:0,cm:a,splitSpaces:(mf||of)&&a.getOption("lineWrapping")};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var f,g=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=Jd,Ve(a.display.measure)&&(f=_d(g))&&(d.addToken=Ld(d.addToken,f)),d.map=[];var h=b!=a.display.externalMeasured&&Yd(g);Nd(g,d,Ed(a,g,h)),g.styleClasses&&(g.styleClasses.bgClass&&(d.bgClass=Qe(g.styleClasses.bgClass,d.bgClass||"")),g.styleClasses.textClass&&(d.textClass=Qe(g.styleClasses.textClass,d.textClass||""))),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Ue(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return of&&/\bcm-tab\b/.test(d.content.lastChild.className)&&(d.content.className="cm-tab-wrap-hack"),yg(a,"renderLine",a,b.line,d.pre),d.pre.className&&(d.textClass=Qe(d.pre.className,d.textClass||"")),d}function Id(a){var b=Le("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b.setAttribute("aria-label",b.title),b}function Jd(a,b,c,d,e,f,g){if(b){var h=a.splitSpaces?b.replace(/ {3,}/g,Kd):b,i=a.cm.state.specialChars,j=!1;if(i.test(b))for(var k=document.createDocumentFragment(),l=0;;){i.lastIndex=l;var m=i.exec(b),n=m?m.index-l:b.length-l;if(n){var o=document.createTextNode(h.slice(l,l+n));mf&&9>nf?k.appendChild(Le("span",[o])):k.appendChild(o),a.map.push(a.pos,a.pos+n,o),a.col+=n,a.pos+=n}if(!m)break;if(l+=n+1," "==m[0]){var p=a.cm.options.tabSize,q=p-a.col%p,o=k.appendChild(Le("span",Ae(q),"cm-tab"));o.setAttribute("role","presentation"),o.setAttribute("cm-text"," "),a.col+=q}else{var o=a.cm.options.specialCharPlaceholder(m[0]);o.setAttribute("cm-text",m[0]),mf&&9>nf?k.appendChild(Le("span",[o])):k.appendChild(o),a.col+=1}a.map.push(a.pos,a.pos+1,o),a.pos++}else{a.col+=b.length;var k=document.createTextNode(h);a.map.push(a.pos,a.pos+b.length,k),mf&&9>nf&&(j=!0),a.pos+=b.length}if(c||d||e||j||g){var r=c||"";d&&(r+=d),e&&(r+=e);var s=Le("span",[k],r,g);return f&&(s.title=f),a.content.appendChild(s)}a.content.appendChild(k)}}function Kd(a){for(var b=" ",c=0;cj&&m.from<=j)break}if(m.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,m.to-j),e,f,null,h,i),f=null,d=d.slice(m.to-j),j=m.to}}}function Md(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}function Nd(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=0;to||v.collapsed&&u.to==o&&u.from==o)?(null!=u.to&&u.to!=o&&r>u.to&&(r=u.to,j=""),v.className&&(i+=" "+v.className),v.css&&(h=v.css),v.startStyle&&u.from==o&&(k+=" "+v.startStyle),v.endStyle&&u.to==r&&(j+=" "+v.endStyle),v.title&&!l&&(l=v.title),v.collapsed&&(!m||id(m.marker,v)<0)&&(m=u)):u.from>o&&r>u.from&&(r=u.from)}if(m&&(m.from||0)==o){if(Md(b,(null==m.to?n+1:m.to)-o,m.marker,null==m.from),null==m.to)return;m.to==o&&(m=!1)}if(!m&&s.length)for(var t=0;t=n)break;for(var w=Math.min(n,r);;){if(q){var x=o+q.length;if(!m){var y=x>w?q.slice(0,w-o):q;b.addToken(b,y,g?g+i:i,k,o+y.length==r?j:"",l,h)}if(x>=w){q=q.slice(w-o),o=w;break}o=x,k=""}q=e.slice(f,f=c[p++]),g=Gd(c[p++],b.cm.options)}}else for(var p=1;pc;++c)f.push(new mg(j[c],e(c),d));return f}var h=b.from,i=b.to,j=b.text,k=Ud(a,h.line),l=Ud(a,i.line),m=Be(j),n=e(j.length-1),o=i.line-h.line;if(b.full)a.insert(0,g(0,j.length)),a.remove(j.length,a.size-j.length);else if(Od(a,b)){var p=g(0,j.length-1);f(l,l.text,n),o&&a.remove(h.line,o),p.length&&a.insert(h.line,p)}else if(k==l)if(1==j.length)f(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{var p=g(1,j.length-1);p.push(new mg(m+k.text.slice(i.ch),n,d)),f(k,k.text.slice(0,h.ch)+j[0],e(0)),a.insert(h.line+1,p)}else if(1==j.length)f(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),e(0)),a.remove(h.line+1,o);else{f(k,k.text.slice(0,h.ch)+j[0],e(0)),f(l,m+l.text.slice(i.ch),n);var p=g(1,j.length-1);o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,p)}se(a,"change",a,b)}function Qd(a){this.lines=a,this.parent=null;for(var b=0,c=0;bb||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(f>b){c=e;break}b-=f}return c.lines[b]}function Vd(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function Wd(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function Xd(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function Yd(a){if(null==a.parent)return null;for(var b=a.parent,c=Ce(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function Zd(a,b){var c=a.first;a:do{for(var d=0;db){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;db)break;b-=h}return c+d}function $d(a){a=nd(a);for(var b=0,c=a.parent,d=0;d1&&!a.done[a.done.length-2].ranges?(a.done.pop(),Be(a.done)):void 0}function ee(a,b,c,d){var e=a.history;e.undone.length=0;var f,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=de(e,e.lastOp==d))){var h=Be(f.changes);0==Ff(b.from,b.to)&&0==Ff(b.from,h.to)?h.to=Tf(b):f.changes.push(be(a,b))}else{var i=Be(e.done);for(i&&i.ranges||he(a.sel,e.done),f={changes:[be(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=g,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||yg(a,"historyAdded")}function fe(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 ge(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||fe(a,f,Be(e.done),b))?e.done[e.done.length-1]=b:he(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&ce(e.undone)}function he(a,b){var c=Be(b);c&&c.ranges&&c.equals(a)||b.push(a)}function ie(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 je(a){if(!a)return null;for(var b,c=0;c-1&&(Be(h)[l]=k[l],delete k[l])}}}return e}function me(a,b,c,d){c0}function xe(a){a.prototype.on=function(a,b){wg(this,a,b)},a.prototype.off=function(a,b){xg(this,a,b)}}function ye(){this.id=null}function ze(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function Ae(a){for(;Gg.length<=a;)Gg.push(Be(Gg)+" ");return Gg[a]}function Be(a){return a[a.length-1]}function Ce(a,b){for(var c=0;c-1&&Kg(a)?!0:b.test(a):Kg(a)}function Je(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Ke(a){return a.charCodeAt(0)>=768&&Lg.test(a)}function Le(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);return a}function Ne(a,b){return Me(a).appendChild(b)}function Oe(){return document.activeElement}function Pe(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function Qe(a,b){for(var c=a.split(" "),d=0;d2&&!(mf&&8>nf))}var c=Ng?Le("span","​"):Le("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}function Ve(a){if(null!=Og)return Og;var b=Ne(a,document.createTextNode("AخA")),c=Ig(b,0,1).getBoundingClientRect();if(!c||c.left==c.right)return!1;var d=Ig(b,1,2).getBoundingClientRect();return Og=d.right-c.right<3}function We(a){if(null!=Wg)return Wg;var b=Ne(a,Le("span","x")),c=b.getBoundingClientRect(),d=Ig(b,0,1).getBoundingClientRect();return Wg=Math.abs(c.left-d.left)>1}function Xe(a,b,c,d){if(!a)return d(b,c,"ltr");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"),e=!0)}e||d(b,c,"ltr")}function Ye(a){return a.level%2?a.to:a.from}function Ze(a){return a.level%2?a.from:a.to}function $e(a){var b=_d(a);return b?Ye(b[0]):0}function _e(a){var b=_d(a);return b?Ze(Be(b)):a.text.length}function af(a,b){var c=Ud(a.doc,b),d=nd(c);d!=c&&(b=Yd(d));var e=_d(d),f=e?e[0].level%2?_e(d):$e(d):0;return Ef(b,f)}function bf(a,b){for(var c,d=Ud(a.doc,b);c=ld(d);)d=c.find(1,!0).line,b=null;var e=_d(d),f=e?e[0].level%2?$e(d):_e(d):d.text.length;return Ef(null==b?Yd(d):b,f)}function cf(a,b){var c=af(a,b.line),d=Ud(a.doc,c.line),e=_d(d);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 Ef(c.line,g?0:f)}return c}function df(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function ef(a,b){Yg=null;for(var c,d=0;db)return d;if(e.from==b||e.to==b){if(null!=c)return df(a,e.level,a[c].level)?(e.from!=e.to&&(Yg=c),d):(e.from!=e.to&&(Yg=d),c);c=d}}return c}function ff(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Ke(a.text.charAt(b)));return b}function gf(a,b,c,d){var e=_d(a);if(!e)return hf(a,b,c,d);for(var f=ef(e,b),g=e[f],h=ff(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?ff(a,g.to,-1,d):ff(a,g.from,1,d)}}function hf(a,b,c,d){var e=b+c;if(d)for(;e>0&&Ke(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var jf=/gecko\/\d/i.test(navigator.userAgent),kf=/MSIE \d/.test(navigator.userAgent),lf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mf=kf||lf,nf=mf&&(kf?document.documentMode||6:lf[1]),of=/WebKit\//.test(navigator.userAgent),pf=of&&/Qt\/\d+\.\d+/.test(navigator.userAgent),qf=/Chrome\//.test(navigator.userAgent),rf=/Opera\//.test(navigator.userAgent),sf=/Apple Computer/.test(navigator.vendor),tf=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),uf=/PhantomJS/.test(navigator.userAgent),vf=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),wf=vf||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),xf=vf||/Mac/.test(navigator.platform),yf=/win/i.test(navigator.platform),zf=rf&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);zf&&(zf=Number(zf[1])),zf&&zf>=15&&(rf=!1,of=!0);var Af=xf&&(pf||rf&&(null==zf||12.11>zf)),Bf=jf||mf&&nf>=9,Cf=!1,Df=!1;p.prototype=Ge({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=a.scrollWidth-a.clientWidth+f+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&a.clientHeight>0&&(0==d&&this.overlayHack(),this.checkedOverlay=!0),{right:c?d:0,bottom:b?d:0}},setScrollLeft:function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a)},setScrollTop:function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a)},overlayHack:function(){var a=xf&&!tf?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=a;var b=this,c=function(a){qe(a)!=b.vert&&qe(a)!=b.horiz&&Cb(b.cm,Tb)(a)};wg(this.vert,"mousedown",c),wg(this.horiz,"mousedown",c)},clear:function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)}},p.prototype),q.prototype=Ge({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},q.prototype),a.scrollbarModel={"native":p,"null":q},z.prototype.signal=function(a,b){we(a,b)&&this.events.push(arguments)},z.prototype.finish=function(){for(var a=0;a=9&&c.hasSelection&&(c.hasSelection=null),c.poll()}),wg(f,"paste",function(){if(of&&!d.state.fakedLastChar&&!(new Date-d.state.lastMiddleDown<200)){var a=f.selectionStart,b=f.selectionEnd;f.value+="$",f.selectionEnd=b,f.selectionStart=a,d.state.fakedLastChar=!0}d.state.pasteIncoming=!0,c.fastPoll()}),wg(f,"cut",b),wg(f,"copy",b),wg(a.scroller,"paste",function(b){Rb(a,b)||(d.state.pasteIncoming=!0,c.focus())}),wg(a.lineSpace,"selectstart",function(b){Rb(a,b)||tg(b)}),wg(f,"compositionstart",function(){var a=d.getCursor("from");c.composing={start:a,range:d.markText(a,d.getCursor("to"),{className:"CodeMirror-composing"})}}),wg(f,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},prepareSelection:function(){var a=this.cm,b=a.display,c=a.doc,d=Ha(a);if(a.options.moveInputWithCursor){var e=lb(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},showSelection:function(a){var b=this.cm,c=b.display;Ne(c.cursorDiv,a.cursors),Ne(c.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},reset:function(a){if(!this.contextMenuPending){var b,c,d=this.cm,e=d.doc;if(d.somethingSelected()){this.prevInput="";var f=e.sel.primary();b=Vg&&(f.to().line-f.from().line>100||(c=d.getSelection()).length>1e3);var g=b?"-":c||d.getSelection();this.textarea.value=g,d.state.focused&&Hg(this.textarea),mf&&nf>=9&&(this.hasSelection=g)}else a||(this.prevInput=this.textarea.value="",mf&&nf>=9&&(this.hasSelection=null));this.inaccurateSelection=b}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!wf||Oe()!=this.textarea))try{this.textarea.focus()}catch(a){}},blur:function(){this.textarea.blur(); -+},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var a=this;a.pollingFast||a.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},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)},poll:function(){var a=this.cm,b=this.textarea,c=this.prevInput;if(!a.state.focused||Ug(b)&&!c||Z(a)||a.options.disableInput||a.state.keySeq)return!1;a.state.pasteIncoming&&a.state.fakedLastChar&&(b.value=b.value.substring(0,b.value.length-1),a.state.fakedLastChar=!1);var d=b.value;if(d==c&&!a.somethingSelected())return!1;if(mf&&nf>=9&&this.hasSelection===d||xf&&/[\uf700-\uf7ff]/.test(d))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var e=d.charCodeAt(0);if(8203!=e||c||(c="​"),8666==e)return this.reset(),this.cm.execCommand("undo")}for(var f=0,g=Math.min(c.length,d.length);g>f&&c.charCodeAt(f)==d.charCodeAt(f);)++f;var h=this;return Bb(a,function(){$(a,d.slice(f),c.length-f,null,h.composing?"*compose":null),d.length>1e3||d.indexOf("\n")>-1?b.value=h.prevInput="":h.prevInput=d,h.composing&&(h.composing.range.clear(),h.composing.range=a.markText(h.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){mf&&nf>=9&&(this.hasSelection=null),this.fastPoll()},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.position="relative",g.style.cssText=k,mf&&9>nf&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!mf||mf&&9>nf)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&"​"==d.prevInput?Cb(e,cg.selectAll)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):f.input.reset()};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=Sb(e,a),i=f.scroller.scrollTop;if(h&&!rf){var j=e.options.resetSelectionOnContextMenu;j&&-1==e.doc.sel.contains(h)&&Cb(e,Aa)(e.doc,na(h),Cg);var k=g.style.cssText;if(d.wrapper.style.position="absolute",g.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: "+(mf?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",of)var l=window.scrollY;if(f.input.focus(),of&&window.scrollTo(null,l),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),mf&&nf>=9&&b(),Bf){vg(a);var m=function(){xg(window,"mouseup",m),setTimeout(c,20)};wg(window,"mouseup",m)}else setTimeout(c,50)}},setUneditable:Ee,needsContentAttribute:!1},ca.prototype),ea.prototype=Ge({init:function(a){function b(a){if(d.somethingSelected())Gf=d.getSelections(),"cut"==a.type&&d.replaceSelection("",null,"cut");else{if(!d.options.lineWiseCopyCut)return;var b=aa(d);Gf=b.text,"cut"==a.type&&d.operation(function(){d.setSelections(b.ranges,0,Cg),d.replaceSelection("",null,"cut")})}if(a.clipboardData&&!vf)a.preventDefault(),a.clipboardData.clearData(),a.clipboardData.setData("text/plain",Gf.join("\n"));else{var c=da(),e=c.firstChild;d.display.lineSpace.insertBefore(c,d.display.lineSpace.firstChild),e.value=Gf.join("\n");var f=document.activeElement;Hg(e),setTimeout(function(){d.display.lineSpace.removeChild(c),f.focus()},50)}}var c=this,d=c.cm,e=c.div=a.lineDiv;e.contentEditable="true",ba(e),wg(e,"paste",function(a){var b=a.clipboardData&&a.clipboardData.getData("text/plain");b&&(a.preventDefault(),d.replaceSelection(b,null,"paste"))}),wg(e,"compositionstart",function(a){var b=a.data;if(c.composing={sel:d.doc.sel,data:b,startData:b},b){var e=d.doc.sel.primary(),f=d.getLine(e.head.line),g=f.indexOf(b,Math.max(0,e.head.ch-b.length));g>-1&&g<=e.head.ch&&(c.composing.sel=na(Ef(e.head.line,g),Ef(e.head.line,g+b.length)))}}),wg(e,"compositionupdate",function(a){c.composing.data=a.data}),wg(e,"compositionend",function(a){var b=c.composing;b&&(a.data==b.startData||/\u200b/.test(a.data)||(b.data=a.data),setTimeout(function(){b.handled||c.applyComposition(b),c.composing==b&&(c.composing=null)},50))}),wg(e,"touchstart",function(){c.forceCompositionEnd()}),wg(e,"input",function(){c.composing||c.pollContent()||Bb(c.cm,function(){Hb(d)})}),wg(e,"copy",b),wg(e,"cut",b)},prepareSelection:function(){var a=Ha(this.cm,!1);return a.focus=this.cm.state.focused,a},showSelection:function(a){a&&this.cm.display.view.length&&(a.focus&&this.showPrimarySelection(),this.showMultipleSelections(a))},showPrimarySelection:function(){var a=window.getSelection(),b=this.cm.doc.sel.primary(),c=ha(this.cm,a.anchorNode,a.anchorOffset),d=ha(this.cm,a.focusNode,a.focusOffset);if(!c||c.bad||!d||d.bad||0!=Ff(X(c,d),b.from())||0!=Ff(W(c,d),b.to())){var e=fa(this.cm,b.from()),f=fa(this.cm,b.to());if(e||f){var g=this.cm.display.view,h=a.rangeCount&&a.getRangeAt(0);if(e){if(!f){var i=g[g.length-1].measure,j=i.maps?i.maps[i.maps.length-1]:i.map;f={node:j[j.length-1],offset:j[j.length-2]-j[j.length-3]}}}else e={node:g[0].measure.map[2],offset:0};try{var k=Ig(e.node,e.offset,f.offset,f.node)}catch(l){}k&&(a.removeAllRanges(),a.addRange(k),h&&null==a.anchorNode?a.addRange(h):jf&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var a=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){a.gracePeriod=!1,a.selectionChanged()&&a.cm.operation(function(){a.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(a){Ne(this.cm.display.cursorDiv,a.cursors),Ne(this.cm.display.selectionDiv,a.selection)},rememberSelection:function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode,this.lastAnchorOffset=a.anchorOffset,this.lastFocusNode=a.focusNode,this.lastFocusOffset=a.focusOffset},selectionInEditor:function(){var a=window.getSelection();if(!a.rangeCount)return!1;var b=a.getRangeAt(0).commonAncestorContainer;return Mg(this.div,b)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():Bb(this.cm,function(){b.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,a)},selectionChanged:function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;this.rememberSelection();var c=ha(b,a.anchorNode,a.anchorOffset),d=ha(b,a.focusNode,a.focusOffset);c&&d&&Bb(b,function(){Aa(b.doc,na(c,d),Cg),(c.bad||d.bad)&&(b.curOp.selectionChanged=!0)})}},pollContent:function(){var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),e=c.to();if(d.lineb.viewTo-1)return!1;var f;if(d.line==b.viewFrom||0==(f=Kb(a,d.line)))var g=Yd(b.view[0].line),h=b.view[0].node;else var g=Yd(b.view[f].line),h=b.view[f-1].node.nextSibling;var i=Kb(a,e.line);if(i==b.view.length-1)var j=b.viewTo-1,k=b.view[i].node;else var j=Yd(b.view[i+1].line)-1,k=b.view[i+1].node.previousSibling;for(var l=Tg(ja(a,h,k,g,j)),m=Vd(a.doc,Ef(g,0),Ef(j,Ud(a.doc,j).text.length));l.length>1&&m.length>1;)if(Be(l)==Be(m))l.pop(),m.pop(),j--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,p=l[0],q=m[0],r=Math.min(p.length,q.length);r>n&&p.charCodeAt(n)==q.charCodeAt(n);)++n;for(var s=Be(l),t=Be(m),u=Math.min(s.length-(1==l.length?n:0),t.length-(1==m.length?n:0));u>o&&s.charCodeAt(s.length-o-1)==t.charCodeAt(t.length-o-1);)++o;l[l.length-1]=s.slice(0,s.length-o),l[0]=l[0].slice(n);var v=Ef(g,n),w=Ef(j,m.length?Be(m).length-o:0);return l.length>1||l[0]||Ff(v,w)?(Bc(a.doc,l,v,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(a){a.data&&a.data!=a.startData&&Cb(this.cm,$)(this.cm,a.data,0,a.sel)},setUneditable:function(a){a.setAttribute("contenteditable","false")},onKeyPress:function(a){a.preventDefault(),Cb(this.cm,$)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0)},onContextMenu:Ee,resetPosition:Ee,needsContentAttribute:!0},ea.prototype),a.inputStyles={textarea:ca,contenteditable:ea},ka.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b=0&&Ff(a,d.to())<=0)return c}return-1}},la.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return W(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Hf,If,Jf,Kf={left:0,right:0,top:0,bottom:0},Lf=null,Mf=0,Nf=0,Of=0,Pf=null;mf?Pf=-.53:jf?Pf=15:qf?Pf=-.7:sf&&(Pf=-1/3);var Qf=function(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}};a.wheelEventPixels=function(a){var b=Qf(a);return b.x*=Pf,b.y*=Pf,b};var Rf=new ye,Sf=null,Tf=a.changeEnd=function(a){return a.text?Ef(a.from.line+a.text.length-1,Be(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Vf.hasOwnProperty(a)&&Cb(this,Vf[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](Qc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cc&&(Jc(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Hc(this));else{var f=e.from(),g=e.to(),h=Math.max(c,f.line);c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var i=h;c>i;++i)Jc(this,i,a);var j=this.doc.sel.ranges;0==f.ch&&b.length==j.length&&j[d].from().ch>0&&wa(this.doc,d,new la(f,j[d].to()),Cg)}}}),getTokenAt:function(a,b){return Bd(this,a,b)},getLineTokens:function(a,b){return Bd(this,Ef(a),b,!0)},getTokenTypeAt:function(a){a=pa(this.doc,a);var b,c=Ed(this,Ud(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]h?b:0==h?null:b.slice(0,h-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!_f.hasOwnProperty(b))return c;var d=_f[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;fe&&(a=e,d=!0),c=Ud(this.doc,a)}else c=a;return ib(this,c,{top:0,left:0},b||"page").top+(d?this.doc.height-$d(c):0)},defaultTextHeight:function(){return qb(this.display)},defaultCharWidth:function(){return rb(this.display)},setGutterMarker:Db(function(a,b,c){return Kc(this.doc,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Je(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Db(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Ib(b,d,"gutter"),Je(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),lineInfo:function(a){if("number"==typeof a){if(!ra(this.doc,a))return null;var b=a;if(a=Ud(this.doc,a),!a)return null}else{var b=Yd(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=lb(this,pa(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&&Ec(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Db(hc),triggerOnKeyPress:Db(kc),triggerOnKeyUp:jc,execCommand:function(a){return cg.hasOwnProperty(a)?cg[a](this):void 0},triggerElectric:Db(function(a){_(this,a)}),findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=pa(this.doc,a);b>f&&(g=Mc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Db(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Mc(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Eg)}),deleteH:Db(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Lc(this,function(c){var e=Mc(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=pa(this.doc,a);b>g;++g){var i=lb(this,h,"div");if(null==f?f=i.left:i.left=f,h=Nc(this,i,e,c),h.hitSide)break}return h},moveV:Db(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=lb(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Nc(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Gc(c,null,kb(c,i,"div").top-h.top),i},Eg),e.length)for(var g=0;g0&&h(c.charAt(d-1));)--d;for(;e.5)&&g(this),yg(this,"refresh",this)}),swapDoc:Db(function(a){var b=this.doc;return b.cm=null,Td(this,a),fb(this),this.display.input.reset(),this.scrollTo(a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,se(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}},xe(a);var Uf=a.defaults={},Vf=a.optionHandlers={},Wf=a.Init={toString:function(){return"CodeMirror.Init"}};Oc("value","",function(a,b){a.setValue(b)},!0),Oc("mode",null,function(a,b){a.doc.modeOption=b,c(a)},!0),Oc("indentUnit",2,c,!0),Oc("indentWithTabs",!1),Oc("smartIndent",!0),Oc("tabSize",4,function(a){d(a),fb(a),Hb(a)},!0),Oc("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(b,c,d){b.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),d!=a.Init&&b.refresh()}),Oc("specialCharPlaceholder",Id,function(a){a.refresh()},!0),Oc("electricChars",!0),Oc("inputStyle",wf?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Oc("rtlMoveVisually",!yf),Oc("wholeLineUpdateBefore",!0),Oc("theme","default",function(a){h(a),i(a)},!0),Oc("keyMap","default",function(b,c,d){var e=Qc(c),f=d!=a.Init&&Qc(d);f&&f.detach&&f.detach(b,e),e.attach&&e.attach(b,f||null)}),Oc("extraKeys",null),Oc("lineWrapping",!1,e,!0),Oc("gutters",[],function(a){n(a.options),i(a)},!0),Oc("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?y(a.display)+"px":"0",a.refresh()},!0),Oc("coverGutterNextToScrollbar",!1,function(a){s(a)},!0),Oc("scrollbarStyle","native",function(a){r(a),s(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),Oc("lineNumbers",!1,function(a){n(a.options),i(a)},!0),Oc("firstLineNumber",1,i,!0),Oc("lineNumberFormatter",function(a){return a},i,!0),Oc("showCursorWhenSelecting",!1,Ga,!0),Oc("resetSelectionOnContextMenu",!0),Oc("lineWiseCopyCut",!0),Oc("readOnly",!1,function(a,b){"nocursor"==b?(nc(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||a.display.input.reset())}),Oc("disableInput",!1,function(a,b){b||a.display.input.reset()},!0),Oc("dragDrop",!0,Pb),Oc("cursorBlinkRate",530),Oc("cursorScrollMargin",0),Oc("cursorHeight",1,Ga,!0),Oc("singleCursorHeightPerLine",!0,Ga,!0),Oc("workTime",100),Oc("workDelay",100),Oc("flattenSpans",!0,d,!0),Oc("addModeClass",!1,d,!0),Oc("pollInterval",100),Oc("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),Oc("historyEventDelay",1250),Oc("viewportMargin",10,function(a){a.refresh()},!0),Oc("maxHighlightLength",1e4,d,!0),Oc("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()}),Oc("tabindex",null,function(a,b){a.display.input.getField().tabIndex=b||""}),Oc("autofocus",null);var Xf=a.modes={},Yf=a.mimeModes={};a.defineMode=function(b,c){a.defaults.mode||"null"==b||(a.defaults.mode=b),arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),Xf[b]=c},a.defineMIME=function(a,b){Yf[a]=b},a.resolveMode=function(b){if("string"==typeof b&&Yf.hasOwnProperty(b))b=Yf[b];else if(b&&"string"==typeof b.name&&Yf.hasOwnProperty(b.name)){var c=Yf[b.name];"string"==typeof c&&(c={name:c}),b=Fe(c,b),b.name=c.name}else if("string"==typeof b&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return"string"==typeof b?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=Xf[c.name];if(!d)return a.getMode(b,"text/plain");var e=d(b,c);if(Zf.hasOwnProperty(c.name)){var f=Zf[c.name];for(var g in f)f.hasOwnProperty(g)&&(e.hasOwnProperty(g)&&(e["_"+g]=e[g]),e[g]=f[g])}if(e.name=c.name,c.helperType&&(e.helperType=c.helperType),c.modeProps)for(var g in c.modeProps)e[g]=c.modeProps[g];return e},a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var Zf=a.modeExtensions={};a.extendMode=function(a,b){var c=Zf.hasOwnProperty(a)?Zf[a]:Zf[a]={};Ge(b,c)},a.defineExtension=function(b,c){a.prototype[b]=c},a.defineDocExtension=function(a,b){qg.prototype[a]=b},a.defineOption=Oc;var $f=[];a.defineInitHook=function(a){$f.push(a)};var _f=a.helpers={};a.registerHelper=function(b,c,d){_f.hasOwnProperty(b)||(_f[b]=a[b]={_global:[]}),_f[b][c]=d},a.registerGlobalHelper=function(b,c,d,e){a.registerHelper(b,c,e),_f[b]._global.push({pred:d,val:e})};var ag=a.copyState=function(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},bg=a.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};a.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var cg=a.commands={selectAll:function(a){a.setSelection(Ef(a.firstLine(),0),Ef(a.lastLine()),Cg)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Cg)},killLine:function(a){Lc(a,function(b){if(b.empty()){var c=Ud(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line0)e=new Ef(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),Ef(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=Ud(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+"\n"+g.charAt(g.length-1),Ef(e.line-1,g.length-1),Ef(e.line,1),"+transpose")}c.push(new la(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){Bb(a,function(){for(var b=a.listSelections().length,c=0;b>c;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0),Hc(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},dg=a.keyMap={};dg.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},dg.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},dg.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},dg.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},dg["default"]=xf?dg.macDefault:dg.pcDefault,a.normalizeKeyMap=function(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if("..."==d){delete a[c];continue}for(var e=De(c.split(" "),Pc),f=0;f=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},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);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var ig=0,jg=a.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a,this.id=++ig};xe(jg),jg.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&sb(a),we(this,"clear")){var c=this.find();c&&se(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;fa.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&Hb(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Da(a.doc)),a&&se(a,"markerCleared",a,this),b&&ub(a),this.parent&&this.parent.clear()}},jg.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;ec;++c){var e=this.lines[c];this.height-=e.height,xd(e),se(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;da;++a)if(c(this.lines[a]))return!0}},Rd.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;ca){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Qd))){var h=[];this.collapse(h),this.children=[new Qd(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new Qd(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Rd(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=Ce(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new Rd(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;da){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var pg=0,qg=a.Doc=function(a,b,c){if(!(this instanceof qg))return new qg(a,b,c);null==c&&(c=0),Rd.call(this,[new Qd([new mg("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var d=Ef(c,0);this.sel=na(d),this.history=new ae(null),this.id=++pg,this.modeOption=b,"string"==typeof a&&(a=Tg(a)),Pd(this,{from:d,to:d,text:a}),Aa(this,na(d),Cg)};qg.prototype=Fe(Rd.prototype,{constructor:qg,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d=0;f--)vc(this,d[f]);h?za(this,h):this.cm&&Hc(this.cm)}),undo:Eb(function(){xc(this,"undo")}),redo:Eb(function(){xc(this,"redo")}),undoSelection:Eb(function(){xc(this,"undo",!0)}),redoSelection:Eb(function(){xc(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=pa(this,a),b=pa(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;hi.to||null==i.from&&e!=a.line||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-=e,void++c)}),pa(this,Ef(c,b))},indexFromPos:function(a){a=pa(this,a);var b=a.ch;return a.lineb&&(b=a.from),null!=a.to&&a.toh||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},Gg=[""],Hg=function(a){a.select()};vf?Hg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:mf&&(Hg=function(a){try{a.select()}catch(b){}});var Ig,Jg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Kg=a.isWordChar=function(a){return/\w/.test(a)||a>"€"&&(a.toUpperCase()!=a.toLowerCase()||Jg.test(a))},Lg=/[\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]/;Ig=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(e){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Mg=a.contains=function(a,b){if(3==b.nodeType&&(b=b.parentNode),a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)};mf&&11>nf&&(Oe=function(){try{return document.activeElement}catch(a){return document.body}});var Ng,Og,Pg=a.rmClass=function(a,b){var c=a.className,d=Pe(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+(e?d[1]+e:"")}},Qg=a.addClass=function(a,b){var c=a.className;Pe(b).test(c)||(a.className+=(c?" ":"")+b)},Rg=!1,Sg=function(){if(mf&&9>nf)return!1;var a=Le("div");return"draggable"in a||"dragDrop"in a}(),Tg=a.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},Ug=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},Vg=function(){var a=Le("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),Wg=null,Xg={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};a.keyNames=Xg,function(){for(var a=0;10>a;a++)Xg[a+48]=Xg[a+96]=String(a);for(var a=65;90>=a;a++)Xg[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)Xg[a+111]=Xg[a+63235]="F"+a}();var Yg,Zg=function(){function a(a){return 247>=a?c.charAt(a):a>=1424&&1524>=a?"R":a>=1536&&1773>=a?d.charAt(a-1536):a>=1774&&2220>=a?"r":a>=8192&&8203>=a?"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="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/,j="L";return function(c){if(!e.test(c))return!1;for(var d,k=c.length,l=[],m=0;k>m;++m)l.push(d=a(c.charCodeAt(m)));for(var m=0,n=j;k>m;++m){var d=l[m];"m"==d?l[m]=n:n=d}for(var m=0,o=j;k>m;++m){var d=l[m];"1"==d&&"r"==o?l[m]="n":g.test(d)&&(o=d,"r"==d&&(l[m]="R"))}for(var m=1,n=l[0];k-1>m;++m){var d=l[m];"+"==d&&"1"==n&&"1"==l[m+1]?l[m]="1":","!=d||n!=l[m+1]||"1"!=n&&"n"!=n||(l[m]=n),n=d}for(var m=0;k>m;++m){var d=l[m];if(","==d)l[m]="N";else if("%"==d){for(var p=m+1;k>p&&"%"==l[p];++p);for(var q=m&&"!"==l[m-1]||k>p&&"1"==l[p]?"1":"N",r=m;p>r;++r)l[r]=q;m=p-1}}for(var m=0,o=j;k>m;++m){var d=l[m];"L"==o&&"1"==d?l[m]="L":g.test(d)&&(o=d)}for(var m=0;k>m;++m)if(f.test(l[m])){for(var p=m+1;k>p&&f.test(l[p]);++p);for(var s="L"==(m?l[m-1]:j),t="L"==(k>p?l[p]:j),q=s||t?"L":"R",r=m;p>r;++r)l[r]=q;m=p-1}for(var u,v=[],m=0;k>m;)if(h.test(l[m])){var w=m;for(++m;k>m&&h.test(l[m]);++m);v.push(new b(0,w,m))}else{var x=m,y=v.length;for(++m;k>m&&"L"!=l[m];++m);for(var r=x;m>r;)if(i.test(l[r])){r>x&&v.splice(y,0,new b(1,x,r));var z=r;for(++r;m>r&&i.test(l[r]);++r);v.splice(y,0,new b(2,z,r)),x=r}else++r;m>x&&v.splice(y,0,new b(1,x,m))}return 1==v[0].level&&(u=c.match(/^\s+/))&&(v[0].from=u[0].length,v.unshift(new b(0,0,u[0].length))),1==Be(v).level&&(u=c.match(/\s+$/))&&(Be(v).to-=u[0].length,v.push(new b(0,k-u[0].length,k))),2==v[0].level&&v.unshift(new b(1,v[0].to,v[0].to)),v[0].level!=Be(v).level&&v.push(new b(v[0].level,k,k)),v}}();return a.version="5.3.0",a}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/apl/apl.js b/media/editors/codemirror/mode/apl/apl.js -index 4357bed..caafe4e 100644 ---- a/media/editors/codemirror/mode/apl/apl.js -+++ b/media/editors/codemirror/mode/apl/apl.js -@@ -102,7 +102,7 @@ CodeMirror.defineMode("apl", function() { - }; - }, - token: function(stream, state) { -- var ch, funcName, word; -+ var ch, funcName; - if (stream.eatSpace()) { - return null; - } -@@ -163,7 +163,6 @@ CodeMirror.defineMode("apl", function() { - return "function jot-dot"; - } - stream.eatWhile(/[\w\$_]/); -- word = stream.current(); - state.prev = true; - return "keyword"; - } -diff --git a/media/editors/codemirror/mode/apl/apl.min.js b/media/editors/codemirror/mode/apl/apl.min.js -index 985701d..66fbd5a 100644 ---- a/media/editors/codemirror/mode/apl/apl.min.js -+++ b/media/editors/codemirror/mode/apl/apl.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("apl",function(){var e={".":"innerProduct","\\":"scan","/":"reduce","⌿":"reduce1Axis","⍀":"scan1Axis","¨":"each","⍣":"power"},n={"+":["conjugate","add"],"−":["negate","subtract"],"×":["signOf","multiply"],"÷":["reciprocal","divide"],"⌈":["ceiling","greaterOf"],"⌊":["floor","lesserOf"],"∣":["absolute","residue"],"⍳":["indexGenerate","indexOf"],"?":["roll","deal"],"⋆":["exponentiate","toThePowerOf"],"⍟":["naturalLog","logToTheBase"],"○":["piTimes","circularFuncs"],"!":["factorial","binomial"],"⌹":["matrixInverse","matrixDivide"],"<":[null,"lessThan"],"≤":[null,"lessThanOrEqual"],"=":[null,"equals"],">":[null,"greaterThan"],"≥":[null,"greaterThanOrEqual"],"≠":[null,"notEqual"],"≡":["depth","match"],"≢":[null,"notMatch"],"∈":["enlist","membership"],"⍷":[null,"find"],"∪":["unique","union"],"∩":[null,"intersection"],"∼":["not","without"],"∨":[null,"or"],"∧":[null,"and"],"⍱":[null,"nor"],"⍲":[null,"nand"],"⍴":["shapeOf","reshape"],",":["ravel","catenate"],"⍪":[null,"firstAxisCatenate"],"⌽":["reverse","rotate"],"⊖":["axis1Reverse","axis1Rotate"],"⍉":["transpose",null],"↑":["first","take"],"↓":[null,"drop"],"⊂":["enclose","partitionWithAxis"],"⊃":["diclose","pick"],"⌷":[null,"index"],"⍋":["gradeUp",null],"⍒":["gradeDown",null],"⊤":["encode",null],"⊥":["decode",null],"⍕":["format","formatByExample"],"⍎":["execute",null],"⊣":["stop","left"],"⊢":["pass","right"]},t=/[\.\/⌿⍀¨⍣]/,r=/⍬/,l=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,a=/←/,i=/[⍝#].*$/,o=function(e){var n;return n=!1,function(t){return n=t,t===e?"\\"===n:!0}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(u,s){var c,p,d;return u.eatSpace()?null:(c=u.next(),'"'===c||"'"===c?(u.eatWhile(o(c)),u.next(),s.prev=!0,"string"):/[\[{\(]/.test(c)?(s.prev=!1,null):/[\]}\)]/.test(c)?(s.prev=!0,null):r.test(c)?(s.prev=!1,"niladic"):/[¯\d]/.test(c)?(s.func?(s.func=!1,s.prev=!1):s.prev=!0,u.eatWhile(/[\w\.]/),"number"):t.test(c)?"operator apl-"+e[c]:a.test(c)?"apl-arrow":l.test(c)?(p="apl-",null!=n[c]&&(p+=s.prev?n[c][1]:n[c][0]),s.func=!0,s.prev=!1,"function "+p):i.test(c)?(u.skipToEnd(),"comment"):"∘"===c&&"."===u.peek()?(u.next(),"function jot-dot"):(u.eatWhile(/[\w\$_]/),d=u.current(),s.prev=!0,"keyword"))}}}),e.defineMIME("text/apl","apl")}); -\ 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("apl",function(){var a={".":"innerProduct","\\":"scan","/":"reduce","⌿":"reduce1Axis","⍀":"scan1Axis","¨":"each","⍣":"power"},b={"+":["conjugate","add"],"−":["negate","subtract"],"×":["signOf","multiply"],"÷":["reciprocal","divide"],"⌈":["ceiling","greaterOf"],"⌊":["floor","lesserOf"],"∣":["absolute","residue"],"⍳":["indexGenerate","indexOf"],"?":["roll","deal"],"⋆":["exponentiate","toThePowerOf"],"⍟":["naturalLog","logToTheBase"],"○":["piTimes","circularFuncs"],"!":["factorial","binomial"],"⌹":["matrixInverse","matrixDivide"],"<":[null,"lessThan"],"≤":[null,"lessThanOrEqual"],"=":[null,"equals"],">":[null,"greaterThan"],"≥":[null,"greaterThanOrEqual"],"≠":[null,"notEqual"],"≡":["depth","match"],"≢":[null,"notMatch"],"∈":["enlist","membership"],"⍷":[null,"find"],"∪":["unique","union"],"∩":[null,"intersection"],"∼":["not","without"],"∨":[null,"or"],"∧":[null,"and"],"⍱":[null,"nor"],"⍲":[null,"nand"],"⍴":["shapeOf","reshape"],",":["ravel","catenate"],"⍪":[null,"firstAxisCatenate"],"⌽":["reverse","rotate"],"⊖":["axis1Reverse","axis1Rotate"],"⍉":["transpose",null],"↑":["first","take"],"↓":[null,"drop"],"⊂":["enclose","partitionWithAxis"],"⊃":["diclose","pick"],"⌷":[null,"index"],"⍋":["gradeUp",null],"⍒":["gradeDown",null],"⊤":["encode",null],"⊥":["decode",null],"⍕":["format","formatByExample"],"⍎":["execute",null],"⊣":["stop","left"],"⊢":["pass","right"]},c=/[\.\/⌿⍀¨⍣]/,d=/⍬/,e=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,f=/←/,g=/[⍝#].*$/,h=function(a){var b;return b=!1,function(c){return b=c,c===a?"\\"===b:!0}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(i,j){var k,l;return i.eatSpace()?null:(k=i.next(),'"'===k||"'"===k?(i.eatWhile(h(k)),i.next(),j.prev=!0,"string"):/[\[{\(]/.test(k)?(j.prev=!1,null):/[\]}\)]/.test(k)?(j.prev=!0,null):d.test(k)?(j.prev=!1,"niladic"):/[¯\d]/.test(k)?(j.func?(j.func=!1,j.prev=!1):j.prev=!0,i.eatWhile(/[\w\.]/),"number"):c.test(k)?"operator apl-"+a[k]:f.test(k)?"apl-arrow":e.test(k)?(l="apl-",null!=b[k]&&(l+=j.prev?b[k][1]:b[k][0]),j.func=!0,j.prev=!1,"function "+l):g.test(k)?(i.skipToEnd(),"comment"):"∘"===k&&"."===i.peek()?(i.next(),"function jot-dot"):(i.eatWhile(/[\w\$_]/),j.prev=!0,"keyword"))}}}),a.defineMIME("text/apl","apl")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/asciiarmor/asciiarmor.js b/media/editors/codemirror/mode/asciiarmor/asciiarmor.js -new file mode 100644 -index 0000000..d830903 ---- /dev/null -+++ b/media/editors/codemirror/mode/asciiarmor/asciiarmor.js -@@ -0,0 +1,73 @@ -+// CodeMirror, copyright (c) by Marijn Haverbeke and others -+// Distributed under an MIT license: http://codemirror.net/LICENSE -+ -+(function(mod) { -+ if (typeof exports == "object" && typeof module == "object") // CommonJS -+ mod(require("../../lib/codemirror")); -+ else if (typeof define == "function" && define.amd) // AMD -+ define(["../../lib/codemirror"], mod); -+ else // Plain browser env -+ mod(CodeMirror); -+})(function(CodeMirror) { -+ "use strict"; -+ -+ function errorIfNotEmpty(stream) { -+ var nonWS = stream.match(/^\s*\S/); -+ stream.skipToEnd(); -+ return nonWS ? "error" : null; -+ } -+ -+ CodeMirror.defineMode("asciiarmor", function() { -+ return { -+ token: function(stream, state) { -+ var m; -+ if (state.state == "top") { -+ if (stream.sol() && (m = stream.match(/^-----BEGIN (.*)?-----\s*$/))) { -+ state.state = "headers"; -+ state.type = m[1]; -+ return "tag"; -+ } -+ return errorIfNotEmpty(stream); -+ } else if (state.state == "headers") { -+ if (stream.sol() && stream.match(/^\w+:/)) { -+ state.state = "header"; -+ return "atom"; -+ } else { -+ var result = errorIfNotEmpty(stream); -+ if (result) state.state = "body"; -+ return result; -+ } -+ } else if (state.state == "header") { -+ stream.skipToEnd(); -+ state.state = "headers"; -+ return "string"; -+ } else if (state.state == "body") { -+ if (stream.sol() && (m = stream.match(/^-----END (.*)?-----\s*$/))) { -+ if (m[1] != state.type) return "error"; -+ state.state = "end"; -+ return "tag"; -+ } else { -+ if (stream.eatWhile(/[A-Za-z0-9+\/=]/)) { -+ return null; -+ } else { -+ stream.next(); -+ return "error"; -+ } -+ } -+ } else if (state.state == "end") { -+ return errorIfNotEmpty(stream); -+ } -+ }, -+ blankLine: function(state) { -+ if (state.state == "headers") state.state = "body"; -+ }, -+ startState: function() { -+ return {state: "top", type: null}; -+ } -+ }; -+ }); -+ -+ CodeMirror.defineMIME("application/pgp", "asciiarmor"); -+ CodeMirror.defineMIME("application/pgp-keys", "asciiarmor"); -+ CodeMirror.defineMIME("application/pgp-signature", "asciiarmor"); -+}); -diff --git a/media/editors/codemirror/mode/asciiarmor/asciiarmor.min.js b/media/editors/codemirror/mode/asciiarmor/asciiarmor.min.js -new file mode 100644 -index 0000000..bbddf5d ---- /dev/null -+++ b/media/editors/codemirror/mode/asciiarmor/asciiarmor.min.js -@@ -0,0 +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){var b=a.match(/^\s*\S/);return a.skipToEnd(),b?"error":null}a.defineMode("asciiarmor",function(){return{token:function(a,c){var d;if("top"==c.state)return a.sol()&&(d=a.match(/^-----BEGIN (.*)?-----\s*$/))?(c.state="headers",c.type=d[1],"tag"):b(a);if("headers"==c.state){if(a.sol()&&a.match(/^\w+:/))return c.state="header","atom";var e=b(a);return e&&(c.state="body"),e}return"header"==c.state?(a.skipToEnd(),c.state="headers","string"):"body"==c.state?a.sol()&&(d=a.match(/^-----END (.*)?-----\s*$/))?d[1]!=c.type?"error":(c.state="end","tag"):a.eatWhile(/[A-Za-z0-9+\/=]/)?null:(a.next(),"error"):"end"==c.state?b(a):void 0},blankLine:function(a){"headers"==a.state&&(a.state="body")},startState:function(){return{state:"top",type:null}}}}),a.defineMIME("application/pgp","asciiarmor"),a.defineMIME("application/pgp-keys","asciiarmor"),a.defineMIME("application/pgp-signature","asciiarmor")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/asn.1/asn.1.js b/media/editors/codemirror/mode/asn.1/asn.1.js -new file mode 100644 -index 0000000..9600247 ---- /dev/null -+++ b/media/editors/codemirror/mode/asn.1/asn.1.js -@@ -0,0 +1,204 @@ -+// CodeMirror, copyright (c) by Marijn Haverbeke and others -+// Distributed under an MIT license: http://codemirror.net/LICENSE -+ -+(function(mod) { -+ if (typeof exports == "object" && typeof module == "object") // CommonJS -+ mod(require("../../lib/codemirror")); -+ else if (typeof define == "function" && define.amd) // AMD -+ define(["../../lib/codemirror"], mod); -+ else // Plain browser env -+ mod(CodeMirror); -+})(function(CodeMirror) { -+ "use strict"; -+ -+ CodeMirror.defineMode("asn.1", function(config, parserConfig) { -+ var indentUnit = config.indentUnit, -+ keywords = parserConfig.keywords || {}, -+ cmipVerbs = parserConfig.cmipVerbs || {}, -+ compareTypes = parserConfig.compareTypes || {}, -+ status = parserConfig.status || {}, -+ tags = parserConfig.tags || {}, -+ storage = parserConfig.storage || {}, -+ modifier = parserConfig.modifier || {}, -+ accessTypes = parserConfig.accessTypes|| {}, -+ multiLineStrings = parserConfig.multiLineStrings, -+ indentStatements = parserConfig.indentStatements !== false; -+ var isOperatorChar = /[\|\^]/; -+ var curPunc; -+ -+ function tokenBase(stream, state) { -+ var ch = stream.next(); -+ if (ch == '"' || ch == "'") { -+ state.tokenize = tokenString(ch); -+ return state.tokenize(stream, state); -+ } -+ if (/[\[\]\(\){}:=,;]/.test(ch)) { -+ curPunc = ch; -+ return "punctuation"; -+ } -+ if (ch == "-"){ -+ if (stream.eat("-")) { -+ stream.skipToEnd(); -+ return "comment"; -+ } -+ } -+ if (/\d/.test(ch)) { -+ stream.eatWhile(/[\w\.]/); -+ return "number"; -+ } -+ if (isOperatorChar.test(ch)) { -+ stream.eatWhile(isOperatorChar); -+ return "operator"; -+ } -+ -+ stream.eatWhile(/[\w\-]/); -+ var cur = stream.current(); -+ if (keywords.propertyIsEnumerable(cur)) return "keyword"; -+ if (cmipVerbs.propertyIsEnumerable(cur)) return "variable cmipVerbs"; -+ if (compareTypes.propertyIsEnumerable(cur)) return "atom compareTypes"; -+ if (status.propertyIsEnumerable(cur)) return "comment status"; -+ if (tags.propertyIsEnumerable(cur)) return "variable-3 tags"; -+ if (storage.propertyIsEnumerable(cur)) return "builtin storage"; -+ if (modifier.propertyIsEnumerable(cur)) return "string-2 modifier"; -+ if (accessTypes.propertyIsEnumerable(cur)) return "atom accessTypes"; -+ -+ return "variable"; -+ } -+ -+ function tokenString(quote) { -+ return function(stream, state) { -+ var escaped = false, next, end = false; -+ while ((next = stream.next()) != null) { -+ if (next == quote && !escaped){ -+ var afterNext = stream.peek(); -+ //look if the character if the quote is like the B in '10100010'B -+ if (afterNext){ -+ afterNext = afterNext.toLowerCase(); -+ if(afterNext == "b" || afterNext == "h" || afterNext == "o") -+ stream.next(); -+ } -+ end = true; break; -+ } -+ escaped = !escaped && next == "\\"; -+ } -+ if (end || !(escaped || multiLineStrings)) -+ state.tokenize = null; -+ return "string"; -+ }; -+ } -+ -+ function Context(indented, column, type, align, prev) { -+ this.indented = indented; -+ this.column = column; -+ this.type = type; -+ this.align = align; -+ this.prev = prev; -+ } -+ function pushContext(state, col, type) { -+ var indent = state.indented; -+ if (state.context && state.context.type == "statement") -+ indent = state.context.indented; -+ return state.context = new Context(indent, col, type, null, state.context); -+ } -+ function popContext(state) { -+ var t = state.context.type; -+ if (t == ")" || t == "]" || t == "}") -+ state.indented = state.context.indented; -+ return state.context = state.context.prev; -+ } -+ -+ //Interface -+ return { -+ startState: function(basecolumn) { -+ return { -+ tokenize: null, -+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), -+ indented: 0, -+ startOfLine: true -+ }; -+ }, -+ -+ token: function(stream, state) { -+ var ctx = state.context; -+ if (stream.sol()) { -+ if (ctx.align == null) ctx.align = false; -+ state.indented = stream.indentation(); -+ state.startOfLine = true; -+ } -+ if (stream.eatSpace()) return null; -+ curPunc = null; -+ var style = (state.tokenize || tokenBase)(stream, state); -+ if (style == "comment") return style; -+ if (ctx.align == null) ctx.align = true; -+ -+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") -+ && ctx.type == "statement"){ -+ popContext(state); -+ } -+ else if (curPunc == "{") pushContext(state, stream.column(), "}"); -+ else if (curPunc == "[") pushContext(state, stream.column(), "]"); -+ else if (curPunc == "(") pushContext(state, stream.column(), ")"); -+ else if (curPunc == "}") { -+ while (ctx.type == "statement") ctx = popContext(state); -+ if (ctx.type == "}") ctx = popContext(state); -+ while (ctx.type == "statement") ctx = popContext(state); -+ } -+ else if (curPunc == ctx.type) popContext(state); -+ else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") -+ && curPunc != ';') || (ctx.type == "statement" -+ && curPunc == "newstatement"))) -+ pushContext(state, stream.column(), "statement"); -+ -+ state.startOfLine = false; -+ return style; -+ }, -+ -+ electricChars: "{}", -+ lineComment: "--", -+ fold: "brace" -+ }; -+ }); -+ -+ function words(str) { -+ var obj = {}, words = str.split(" "); -+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true; -+ return obj; -+ } -+ -+ CodeMirror.defineMIME("text/x-ttcn-asn", { -+ name: "asn.1", -+ keywords: words("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION" + -+ " REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED" + -+ " WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN" + -+ " IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS" + -+ " MINACCESS MAXACCESS REVISION STATUS DESCRIPTION" + -+ " SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName" + -+ " ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY" + -+ " IMPLIED EXPORTS"), -+ cmipVerbs: words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"), -+ compareTypes: words("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY" + -+ " MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY" + -+ " OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL" + -+ " SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL" + -+ " TEXTUAL-CONVENTION"), -+ status: words("current deprecated mandatory obsolete"), -+ tags: words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS" + -+ " UNIVERSAL"), -+ storage: words("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING" + -+ " UTCTime InterfaceIndex IANAifType CMIP-Attribute" + -+ " REAL PACKAGE PACKAGES IpAddress PhysAddress" + -+ " NetworkAddress BITS BMPString TimeStamp TimeTicks" + -+ " TruthValue RowStatus DisplayString GeneralString" + -+ " GraphicString IA5String NumericString" + -+ " PrintableString SnmpAdminAtring TeletexString" + -+ " UTF8String VideotexString VisibleString StringStore" + -+ " ISO646String T61String UniversalString Unsigned32" + -+ " Integer32 Gauge Gauge32 Counter Counter32 Counter64"), -+ modifier: words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS" + -+ " GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS" + -+ " DEFINED"), -+ accessTypes: words("not-accessible accessible-for-notify read-only" + -+ " read-create read-write"), -+ multiLineStrings: true -+ }); -+}); -diff --git a/media/editors/codemirror/mode/asn.1/asn.min.js b/media/editors/codemirror/mode/asn.1/asn.min.js -new file mode 100644 -index 0000000..7d682f7 ---- /dev/null -+++ b/media/editors/codemirror/mode/asn.1/asn.min.js -@@ -0,0 +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){for(var b={},c=a.split(" "),d=0;d?$/.test(a)?(i.extenExten=!0,i.extenStart=!1,"strong"):(i.extenStart=!1,t.skipToEnd(),"error")):i.extenExten?(i.extenExten=!1,i.extenPriority=!0,t.eatWhile(/[^,]/),i.extenInclude&&(t.skipToEnd(),i.extenPriority=!1,i.extenInclude=!1),i.extenSame&&(i.extenPriority=!1,i.extenSame=!1,i.extenApplication=!0),"tag"):i.extenPriority?(i.extenPriority=!1,i.extenApplication=!0,r=t.next(),i.extenSame?null:(t.eatWhile(/[^,]/),"number")):i.extenApplication?(t.eatWhile(/,/),a=t.current(),","===a?null:(t.eatWhile(/\w/),a=t.current().toLowerCase(),i.extenApplication=!1,-1!==n.indexOf(a)?"def strong":null)):e(t,i)}}}),e.defineMIME("text/x-asterisk","asterisk")}); -\ 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("asterisk",function(){function a(a,d){var e="",f=a.next();if(";"==f)return a.skipToEnd(),"comment";if("["==f)return a.skipTo("]"),a.eat("]"),"header";if('"'==f)return a.skipTo('"'),"string";if("'"==f)return a.skipTo("'"),"string-2";if("#"==f&&(a.eatWhile(/\w/),e=a.current(),-1!==c.indexOf(e)))return a.skipToEnd(),"strong";if("$"==f){var g=a.peek();if("{"==g)return a.skipTo("}"),a.eat("}"),"variable-3"}if(a.eatWhile(/\w/),e=a.current(),-1!==b.indexOf(e)){switch(d.extenStart=!0,e){case"same":d.extenSame=!0;break;case"include":case"switch":case"ignorepat":d.extenInclude=!0}return"atom"}}var b=["exten","same","include","ignorepat","switch"],c=["#include","#exec"],d=["addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi","alarmreceiver","amd","answer","authenticate","background","backgrounddetect","bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent","changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge","congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge","dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility","datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa","dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy","externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif","goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete","ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus","jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme","meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete","minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode","mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish","originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce","parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones","privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten","readfile","receivefax","receivefax","receivefax","record","removequeuemember","resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun","saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax","sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags","setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel","slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground","speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound","speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor","stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec","trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate","vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring","waitforsilence","waitmusiconhold","waituntil","while","zapateller"];return{startState:function(){return{extenStart:!1,extenSame:!1,extenInclude:!1,extenExten:!1,extenPriority:!1,extenApplication:!1}},token:function(b,c){var e="";return b.eatSpace()?null:c.extenStart?(b.eatWhile(/[^\s]/),e=b.current(),/^=>?$/.test(e)?(c.extenExten=!0,c.extenStart=!1,"strong"):(c.extenStart=!1,b.skipToEnd(),"error")):c.extenExten?(c.extenExten=!1,c.extenPriority=!0,b.eatWhile(/[^,]/),c.extenInclude&&(b.skipToEnd(),c.extenPriority=!1,c.extenInclude=!1),c.extenSame&&(c.extenPriority=!1,c.extenSame=!1,c.extenApplication=!0),"tag"):c.extenPriority?(c.extenPriority=!1,c.extenApplication=!0,b.next(),c.extenSame?null:(b.eatWhile(/[^,]/),"number")):c.extenApplication?(b.eatWhile(/,/),e=b.current(),","===e?null:(b.eatWhile(/\w/),e=b.current().toLowerCase(),c.extenApplication=!1,-1!==d.indexOf(e)?"def strong":null)):a(b,c)}}}),a.defineMIME("text/x-asterisk","asterisk")}); -\ 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 e2223cc..c5469eb 100644 ---- a/media/editors/codemirror/mode/clike/clike.js -+++ b/media/editors/codemirror/mode/clike/clike.js -@@ -16,15 +16,18 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, - dontAlignCalls = parserConfig.dontAlignCalls, - keywords = parserConfig.keywords || {}, -+ types = parserConfig.types || {}, - builtin = parserConfig.builtin || {}, - blockKeywords = parserConfig.blockKeywords || {}, -+ defKeywords = parserConfig.defKeywords || {}, - atoms = parserConfig.atoms || {}, - hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings, -- indentStatements = parserConfig.indentStatements !== false; -+ indentStatements = parserConfig.indentStatements !== false, -+ indentSwitch = parserConfig.indentSwitch !== false; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - -- var curPunc; -+ var curPunc, isDefKeyword; - - function tokenBase(stream, state) { - var ch = stream.next(); -@@ -62,8 +65,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; -+ if (defKeywords.propertyIsEnumerable(cur)) isDefKeyword = true; - return "keyword"; - } -+ if (types.propertyIsEnumerable(cur)) return "variable-3"; - if (builtin.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "builtin"; -@@ -104,9 +109,12 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - this.align = align; - this.prev = prev; - } -+ function isStatement(context) { -+ return context.type == "statement" || context.type == "switchstatement"; -+ } - function pushContext(state, col, type) { - var indent = state.indented; -- if (state.context && state.context.type == "statement") -+ if (state.context && isStatement(state.context)) - indent = state.context.indented; - return state.context = new Context(indent, col, type, null, state.context); - } -@@ -117,6 +125,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - return state.context = state.context.prev; - } - -+ function typeBefore(stream, state) { -+ if (state.prevToken == "variable" || state.prevToken == "variable-3") return true; -+ if (/\S[>*\]]\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true; -+ } -+ - // Interface - - return { -@@ -125,7 +138,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, -- startOfLine: true -+ startOfLine: true, -+ prevToken: null - }; - }, - -@@ -137,41 +151,59 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - state.startOfLine = true; - } - if (stream.eatSpace()) return null; -- curPunc = null; -+ curPunc = isDefKeyword = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - -- if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state); -+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && isStatement(ctx)) popContext(state); - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { -- while (ctx.type == "statement") ctx = popContext(state); -+ while (isStatement(ctx)) ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); -- while (ctx.type == "statement") ctx = popContext(state); -+ while (isStatement(ctx)) ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (indentStatements && - (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || -- (ctx.type == "statement" && curPunc == "newstatement"))) -- pushContext(state, stream.column(), "statement"); -+ (isStatement(ctx) && curPunc == "newstatement"))) { -+ var type = "statement" -+ if (curPunc == "newstatement" && indentSwitch && stream.current() == "switch") -+ type = "switchstatement" -+ pushContext(state, stream.column(), type); -+ } -+ -+ if (style == "variable" && -+ ((state.prevToken == "def" || -+ (parserConfig.typeFirstDefinitions && typeBefore(stream, state) && -+ stream.match(/^\s*\(/, false))))) -+ style = "def"; -+ - state.startOfLine = false; -+ state.prevToken = isDefKeyword ? "def" : style; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); -- if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; -+ if (isStatement(ctx) && firstChar == "}") ctx = ctx.prev; - var closing = firstChar == ctx.type; -- if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); -- else if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1); -- else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; -- else return ctx.indented + (closing ? 0 : indentUnit); -+ var switchBlock = ctx.prev && ctx.prev.type == "switchstatement"; -+ if (isStatement(ctx)) -+ return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); -+ if (ctx.align && (!dontAlignCalls || ctx.type != ")")) -+ return ctx.column + (closing ? 0 : 1); -+ if (ctx.type == ")" && !closing) -+ return ctx.indented + statementIndentUnit; -+ -+ return ctx.indented + (closing ? 0 : indentUnit) + -+ (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0); - }, - -- electricChars: "{}", -+ electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{|\})$/ : /^\s*[{}]$/, - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//", -@@ -184,9 +216,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } -- var cKeywords = "auto if break int case long char register continue return default short do sizeof " + -- "double static else struct entry switch extern typedef float union for unsigned " + -- "goto while enum void const signed volatile"; -+ var cKeywords = "auto if break case register continue return default do sizeof " + -+ "static else struct switch extern typedef float union for " + -+ "goto while enum const volatile true false"; -+ var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t"; - - function cppHook(stream, state) { - if (!state.startOfLine) return false; -@@ -206,6 +239,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - return "meta"; - } - -+ function pointerHook(_stream, state) { -+ if (state.prevToken == "variable-3") return "variable-3"; -+ return false; -+ } -+ - function cpp11StringHook(stream, state) { - stream.backUp(1); - // Raw strings. -@@ -263,6 +301,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - words.push(prop); - } - add(mode.keywords); -+ add(mode.types); - add(mode.builtin); - add(mode.atoms); - if (words.length) { -@@ -277,9 +316,14 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - def(["text/x-csrc", "text/x-c", "text/x-chdr"], { - name: "clike", - keywords: words(cKeywords), -+ types: words(cTypes + " 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: words("case do else for if switch while struct"), -+ defKeywords: words("struct"), -+ typeFirstDefinitions: true, - atoms: words("null"), -- hooks: {"#": cppHook}, -+ hooks: {"#": cppHook, "*": pointerHook}, - modeProps: {fold: ["brace", "include"]} - }); - -@@ -290,10 +334,14 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - "this using const_cast inline public throw virtual delete mutable protected " + - "wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final " + - "static_assert override"), -+ types: words(cTypes + "bool wchar_t"), - blockKeywords: words("catch class do else finally for if struct switch try while"), -+ defKeywords: words("class namespace struct enum union"), -+ typeFirstDefinitions: true, - atoms: words("true false null"), - hooks: { - "#": cppHook, -+ "*": pointerHook, - "u": cpp11StringHook, - "U": cpp11StringHook, - "L": cpp11StringHook, -@@ -304,12 +352,16 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - - def("text/x-java", { - name: "clike", -- keywords: words("abstract assert boolean break byte case catch char class const continue default " + -- "do double else enum extends final finally float for goto if implements import " + -- "instanceof int interface long native new package private protected public " + -- "return short static strictfp super switch synchronized this throw throws transient " + -- "try void volatile while"), -+ keywords: words("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"), -+ types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " + -+ "Integer Long Number Object Short String StringBuffer StringBuilder Void"), - blockKeywords: words("catch class do else finally for if switch try while"), -+ defKeywords: words("class interface package enum"), -+ typeFirstDefinitions: true, - atoms: words("true false null"), - hooks: { - "@": function(stream) { -@@ -322,18 +374,20 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - - def("text/x-csharp", { - name: "clike", -- keywords: words("abstract as base break case catch checked class const continue" + -+ keywords: words("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: words("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: words("catch class do else finally for foreach if struct switch try while"), -- builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" + -- " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" + -- " UInt64 bool byte char decimal double short int long object" + -- " sbyte float string ushort uint ulong"), -+ defKeywords: words("class interface namespace struct var"), -+ typeFirstDefinitions: true, - atoms: words("true false null"), - hooks: { - "@": function(stream, state) { -@@ -366,18 +420,21 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - /* scala */ - "abstract case catch class def do else extends false final finally for forSome if " + - "implicit import lazy match new null object override package private protected return " + -- "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " + -+ "sealed super this throw trait try type val var while with yield _ : = => <- <: " + - "<% >: # @ " + - - /* package scala */ - "assert assume require print println printf readLine readBoolean readByte readShort " + - "readChar readInt readLong readFloat readDouble " + - -+ ":: #:: " -+ ), -+ types: words( - "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " + - "Enumeration Equiv Error Exception Fractional Function IndexedSeq 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 :: #:: " + -+ "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " + - - /* package java.lang */ - "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + -@@ -387,8 +444,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - ), - multiLineStrings: true, - blockKeywords: words("catch class do else finally for forSome if match switch try while"), -+ defKeywords: words("class def object package trait type val var"), - atoms: words("true false null"), - indentStatements: false, -+ indentSwitch: false, - hooks: { - "@": function(stream) { - stream.eatWhile(/[\w\$_]/); -@@ -403,20 +462,21 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - stream.eatWhile(/[\w\$_\xa1-\uffff]/); - return "atom"; - } -- } -+ }, -+ modeProps: {closeBrackets: {triples: '"'}} - }); - - def(["x-shader/x-vertex", "x-shader/x-fragment"], { - name: "clike", -- keywords: words("float int bool void " + -- "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " + -- "mat2 mat3 mat4 " + -- "sampler1D sampler2D sampler3D samplerCube " + -+ keywords: words("sampler1D sampler2D sampler3D samplerCube " + - "sampler1DShadow sampler2DShadow " + - "const attribute uniform varying " + - "break continue discard return " + - "for while do if else struct " + - "in out inout"), -+ types: words("float int bool void " + -+ "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " + -+ "mat2 mat3 mat4"), - blockKeywords: words("for while do if else struct"), - builtin: words("radians degrees sin cos tan asin acos atan " + - "pow exp log exp2 sqrt inversesqrt " + -@@ -460,6 +520,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " + - "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " + - "gl_MaxDrawBuffers"), -+ indentSwitch: false, - hooks: {"#": cppHook}, - modeProps: {fold: ["brace", "include"]} - }); -@@ -469,6 +530,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - keywords: words(cKeywords + "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: words(cTypes), - blockKeywords: words("case do else for if switch while struct"), - atoms: words("null"), - hooks: {"#": cppHook}, -@@ -479,6 +541,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { - name: "clike", - keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in " + - "inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"), -+ types: words(cTypes), - atoms: words("YES NO NULL NILL ON OFF"), - hooks: { - "@": function(stream) { -diff --git a/media/editors/codemirror/mode/clike/clike.min.js b/media/editors/codemirror/mode/clike/clike.min.js -index be18619..548e89e 100644 ---- a/media/editors/codemirror/mode/clike/clike.min.js -+++ b/media/editors/codemirror/mode/clike/clike.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=e.split(" "),n=0;n!?|\/]/;return{startState:function(e){return{tokenize:null,context:new i((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;c=null;var o=(t.tokenize||n)(e,t);if("comment"==o||"meta"==o)return o;if(null==r.align&&(r.align=!0),";"!=c&&":"!=c&&","!=c||"statement"!=r.type)if("{"==c)l(t,e.column(),"}");else if("["==c)l(t,e.column(),"]");else if("("==c)l(t,e.column(),")");else if("}"==c){for(;"statement"==r.type;)r=s(t);for("}"==r.type&&(r=s(t));"statement"==r.type;)r=s(t)}else c==r.type?s(t):b&&(("}"==r.type||"top"==r.type)&&";"!=c||"statement"==r.type&&"newstatement"==c)&&l(t,e.column(),"statement");else s(t);return t.startOfLine=!1,o},indent:function(t,r){if(t.tokenize!=n&&null!=t.tokenize)return e.Pass;var o=t.context,a=r&&r.charAt(0);"statement"==o.type&&"}"==a&&(o=o.prev);var i=a==o.type;return"statement"==o.type?o.indented+("{"==a?0:d):!o.align||f&&")"==o.type?")"!=o.type||i?o.indented+(i?0:u):o.indented+d:o.column+(i?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var s="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";i(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:t(s),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),i(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:t(s+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),blockKeywords:t("catch class do else finally for if struct switch try while"),atoms:t("true false null"),hooks:{"#":r,u:n,U:n,L:n,R:n},modeProps:{fold:["brace","include"]}}),i("text/x-java",{name:"clike",keywords:t("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:t("catch class do else finally for if switch try while"),atoms:t("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),i("text/x-csharp",{name:"clike",keywords:t("abstract as 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"),blockKeywords:t("catch class do else finally for foreach if struct switch try while"),builtin:t("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:t("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=o,o(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),i("text/x-scala",{name:"clike",keywords:t("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq 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:t("catch class do else finally for forSome if match switch try while"),atoms:t("true false null"),indentStatements:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return e.match('""')?(t.tokenize=l,t.tokenize(e,t)):!1},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}}}),i(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:t("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:t("for while do if else struct"),builtin:t("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:t("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"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),i("text/x-nesc",{name:"clike",keywords:t(s+"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"),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":r},modeProps:{fold:["brace","include"]}}),i("text/x-objectivec",{name:"clike",keywords:t(s+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),atoms:t("YES NO NULL NILL ON OFF"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":r},modeProps:{fold:"brace"}})}); -\ 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){for(var b={},c=a.split(" "),d=0;d*\]]\s*$|\*$/.test(a.string.slice(0,a.start))?!0:void 0}var l,m,n=b.indentUnit,o=c.statementIndentUnit||n,p=c.dontAlignCalls,q=c.keywords||{},r=c.types||{},s=c.builtin||{},t=c.blockKeywords||{},u=c.defKeywords||{},v=c.atoms||{},w=c.hooks||{},x=c.multiLineStrings,y=c.indentStatements!==!1,z=c.indentSwitch!==!1,A=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new g((a||0)-n,0,"top",!1),indented:0,startOfLine:!0,prevToken:null}},token:function(a,b){var e=b.context;if(a.sol()&&(null==e.align&&(e.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;l=m=null;var f=(b.tokenize||d)(a,b);if("comment"==f||"meta"==f)return f;if(null==e.align&&(e.align=!0),";"!=l&&":"!=l&&","!=l||!h(e)){if("{"==l)i(b,a.column(),"}");else if("["==l)i(b,a.column(),"]");else if("("==l)i(b,a.column(),")");else if("}"==l){for(;h(e);)e=j(b);for("}"==e.type&&(e=j(b));h(e);)e=j(b)}else if(l==e.type)j(b);else if(y&&(("}"==e.type||"top"==e.type)&&";"!=l||h(e)&&"newstatement"==l)){var g="statement";"newstatement"==l&&z&&"switch"==a.current()&&(g="switchstatement"),i(b,a.column(),g)}}else j(b);return"variable"==f&&("def"==b.prevToken||c.typeFirstDefinitions&&k(a,b)&&a.match(/^\s*\(/,!1))&&(f="def"),b.startOfLine=!1,b.prevToken=m?"def":f,f},indent:function(b,c){if(b.tokenize!=d&&null!=b.tokenize)return a.Pass;var e=b.context,f=c&&c.charAt(0);h(e)&&"}"==f&&(e=e.prev);var g=f==e.type,i=e.prev&&"switchstatement"==e.prev.type;return h(e)?e.indented+("{"==f?0:o):!e.align||p&&")"==e.type?")"!=e.type||g?e.indented+(g?0:n)+(g||!i||/^(?:case|default)\b/.test(c)?0:n):e.indented+o:e.column+(g?0:1)},electricInput:z?/^\s*(?:case .*?:|default:|\{|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var j="auto if break case register continue return default do sizeof static else struct switch extern typedef float union for goto while enum const volatile true false",k="int long char short double float unsigned signed void size_t ptrdiff_t";h(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:b(j),types:b(k+" 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:b("case do else for if switch while struct"),defKeywords:b("struct"),typeFirstDefinitions:!0,atoms:b("null"),hooks:{"#":c,"*":d},modeProps:{fold:["brace","include"]}}),h(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:b(j+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:b(k+"bool wchar_t"),blockKeywords:b("catch class do else finally for if struct switch try while"),defKeywords:b("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":c,"*":d,u:e,U:e,L:e,R:e},modeProps:{fold:["brace","include"]}}),h("text/x-java",{name:"clike",keywords:b("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"),types:b("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:b("catch class do else finally for if switch try while"),defKeywords:b("class interface package enum"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),h("text/x-csharp",{name:"clike",keywords:b("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:b("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:b("catch class do else finally for foreach if struct switch try while"),defKeywords:b("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=f,f(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),h("text/x-scala",{name:"clike",keywords:b("abstract case catch class def do else extends false 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:b("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq 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:b("catch class do else finally for forSome if match switch try while"),defKeywords:b("class def object package trait type val var"),atoms:b("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return a.match('""')?(b.tokenize=i,b.tokenize(a,b)):!1},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),h(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:b("for while do if else struct"),builtin:b("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:b("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:{"#":c},modeProps:{fold:["brace","include"]}}),h("text/x-nesc",{name:"clike",keywords:b(j+"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:b(k),blockKeywords:b("case do else for if switch while struct"),atoms:b("null"),hooks:{"#":c},modeProps:{fold:["brace","include"]}}),h("text/x-objectivec",{name:"clike",keywords:b(j+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:b(k),atoms:b("YES NO NULL NILL ON OFF"),hooks:{"@":function(a){return a.eatWhile(/[\w\$]/),"keyword"},"#":c},modeProps:{fold:"brace"}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/clike/scala.html b/media/editors/codemirror/mode/clike/scala.html -deleted file mode 100644 -index aa04cf0..0000000 ---- a/media/editors/codemirror/mode/clike/scala.html -+++ /dev/null -@@ -1,767 +0,0 @@ -- -- --CodeMirror: Scala mode -- -- -- -- -- -- -- -- -- -- --
    --

    Scala mode

    --
    -- --
    -- -- --
    -diff --git a/media/editors/codemirror/mode/clojure/clojure.js b/media/editors/codemirror/mode/clojure/clojure.js -index c334de7..d531022 100644 ---- a/media/editors/codemirror/mode/clojure/clojure.js -+++ b/media/editors/codemirror/mode/clojure/clojure.js -@@ -234,6 +234,7 @@ CodeMirror.defineMode("clojure", function (options) { - return state.indentStack.indent; - }, - -+ closeBrackets: {pairs: "()[]{}\"\""}, - lineComment: ";;" - }; - }); -diff --git a/media/editors/codemirror/mode/clojure/clojure.min.js b/media/editors/codemirror/mode/clojure/clojure.min.js -index b4be817..5342660 100644 ---- a/media/editors/codemirror/mode/clojure/clojure.min.js -+++ b/media/editors/codemirror/mode/clojure/clojure.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("clojure",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),v=t("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),w=t("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),x={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var q,j=!1;null!=(q=e.next());){if('"'==q&&!j){t.mode=!1;break}j=!j&&"\\"==q}n=c;break;default:var S=e.next();if('"'==S)t.mode="string",n=c;else if("\\"==S)i(e),n=l;else if("'"!=S||x.digit_or_colon.test(e.peek()))if(";"==S)e.skipToEnd(),n=d;else if(o(S,e))n=u;else if("("==S||"["==S||"{"==S){var z,E="",_=e.column();if("("==S)for(;null!=(z=e.eat(x.keyword_char));)E+=z;E.length>0&&(w.propertyIsEnumerable(E)||/^(?:def|with)/.test(E))?r(t,_+y,S):(e.eatSpace(),e.eol()||";"==e.peek()?r(t,_+b,S):r(t,_+e.current().length,S)),e.backUp(e.current().length-1),n=p}else if(")"==S||"]"==S||"}"==S)n=p,null!=t.indentStack&&t.indentStack.type==(")"==S?"(":"]"==S?"[":"{")&&a(t);else{if(":"==S)return e.eatWhile(x.symbol),f;e.eatWhile(x.symbol),n=k&&k.propertyIsEnumerable(e.current())?h:v&&v.propertyIsEnumerable(e.current())?s:g&&g.propertyIsEnumerable(e.current())?f:m}else n=f}return n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},lineComment:";;"}}),e.defineMIME("text/x-clojure","clojure")}); -\ 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("clojure",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),u=b("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),v=b("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),w={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(a,b){if(null==b.indentStack&&a.sol()&&(b.indentation=a.indentation()),a.eatSpace())return null;var c=null;switch(b.mode){case"string":for(var x,y=!1;null!=(x=a.next());){if('"'==x&&!y){b.mode=!1;break}y=!y&&"\\"==x}c=j;break;default:var z=a.next();if('"'==z)b.mode="string",c=j;else if("\\"==z)g(a),c=k;else if("'"!=z||w.digit_or_colon.test(a.peek()))if(";"==z)a.skipToEnd(),c=i;else if(f(z,a))c=m;else if("("==z||"["==z||"{"==z){var A,B="",C=a.column();if("("==z)for(;null!=(A=a.eat(w.keyword_char));)B+=A;B.length>0&&(v.propertyIsEnumerable(B)||/^(?:def|with)/.test(B))?d(b,C+q,z):(a.eatSpace(),a.eol()||";"==a.peek()?d(b,C+r,z):d(b,C+a.current().length,z)),a.backUp(a.current().length-1),c=n}else if(")"==z||"]"==z||"}"==z)c=n,null!=b.indentStack&&b.indentStack.type==(")"==z?"(":"]"==z?"[":"{")&&e(b);else{if(":"==z)return a.eatWhile(w.symbol),l;a.eatWhile(w.symbol),c=t&&t.propertyIsEnumerable(a.current())?o:u&&u.propertyIsEnumerable(a.current())?h:s&&s.propertyIsEnumerable(a.current())?l:p}else c=l}return c},indent:function(a){return null==a.indentStack?a.indentation:a.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:";;"}}),a.defineMIME("text/x-clojure","clojure")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/cmake/cmake.js b/media/editors/codemirror/mode/cmake/cmake.js -new file mode 100644 -index 0000000..9f9eda5 ---- /dev/null -+++ b/media/editors/codemirror/mode/cmake/cmake.js -@@ -0,0 +1,97 @@ -+// CodeMirror, copyright (c) by Marijn Haverbeke and others -+// Distributed under an MIT license: http://codemirror.net/LICENSE -+ -+(function(mod) { -+ if (typeof exports == "object" && typeof module == "object") -+ mod(require("../../lib/codemirror")); -+ else if (typeof define == "function" && define.amd) -+ define(["../../lib/codemirror"], mod); -+ else -+ mod(CodeMirror); -+})(function(CodeMirror) { -+"use strict"; -+ -+CodeMirror.defineMode("cmake", function () { -+ var variable_regex = /({)?[a-zA-Z0-9_]+(})?/; -+ -+ function tokenString(stream, state) { -+ var current, prev, found_var = false; -+ while (!stream.eol() && (current = stream.next()) != state.pending) { -+ if (current === '$' && prev != '\\' && state.pending == '"') { -+ found_var = true; -+ break; -+ } -+ prev = current; -+ } -+ if (found_var) { -+ stream.backUp(1); -+ } -+ if (current == state.pending) { -+ state.continueString = false; -+ } else { -+ state.continueString = true; -+ } -+ return "string"; -+ } -+ -+ function tokenize(stream, state) { -+ var ch = stream.next(); -+ -+ // Have we found a variable? -+ if (ch === '$') { -+ if (stream.match(variable_regex)) { -+ return 'variable-2'; -+ } -+ return 'variable'; -+ } -+ // Should we still be looking for the end of a string? -+ if (state.continueString) { -+ // If so, go through the loop again -+ stream.backUp(1); -+ return tokenString(stream, state); -+ } -+ // Do we just have a function on our hands? -+ // In 'cmake_minimum_required (VERSION 2.8.8)', 'cmake_minimum_required' is matched -+ if (stream.match(/(\s+)?\w+\(/) || stream.match(/(\s+)?\w+\ \(/)) { -+ stream.backUp(1); -+ return 'def'; -+ } -+ if (ch == "#") { -+ stream.skipToEnd(); -+ return "comment"; -+ } -+ // Have we found a string? -+ if (ch == "'" || ch == '"') { -+ // Store the type (single or double) -+ state.pending = ch; -+ // Perform the looping function to find the end -+ return tokenString(stream, state); -+ } -+ if (ch == '(' || ch == ')') { -+ return 'bracket'; -+ } -+ if (ch.match(/[0-9]/)) { -+ return 'number'; -+ } -+ stream.eatWhile(/[\w-]/); -+ return null; -+ } -+ return { -+ startState: function () { -+ var state = {}; -+ state.inDefinition = false; -+ state.inInclude = false; -+ state.continueString = false; -+ state.pending = false; -+ return state; -+ }, -+ token: function (stream, state) { -+ if (stream.eatSpace()) return null; -+ return tokenize(stream, state); -+ } -+ }; -+}); -+ -+CodeMirror.defineMIME("text/x-cmake", "cmake"); -+ -+}); -diff --git a/media/editors/codemirror/mode/cmake/cmake.min.js b/media/editors/codemirror/mode/cmake/cmake.min.js -new file mode 100644 -index 0000000..6d08346 ---- /dev/null -+++ b/media/editors/codemirror/mode/cmake/cmake.min.js -@@ -0,0 +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("cmake",function(){function a(a,b){for(var c,d,e=!1;!a.eol()&&(c=a.next())!=b.pending;){if("$"===c&&"\\"!=d&&'"'==b.pending){e=!0;break}d=c}return e&&a.backUp(1),c==b.pending?b.continueString=!1:b.continueString=!0,"string"}function b(b,d){var e=b.next();return"$"===e?b.match(c)?"variable-2":"variable":d.continueString?(b.backUp(1),a(b,d)):b.match(/(\s+)?\w+\(/)||b.match(/(\s+)?\w+\ \(/)?(b.backUp(1),"def"):"#"==e?(b.skipToEnd(),"comment"):"'"==e||'"'==e?(d.pending=e,a(b,d)):"("==e||")"==e?"bracket":e.match(/[0-9]/)?"number":(b.eatWhile(/[\w-]/),null)}var c=/({)?[a-zA-Z0-9_]+(})?/;return{startState:function(){var a={};return a.inDefinition=!1,a.inInclude=!1,a.continueString=!1,a.pending=!1,a},token:function(a,c){return a.eatSpace()?null:b(a,c)}}}),a.defineMIME("text/x-cmake","cmake")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/cobol/cobol.min.js b/media/editors/codemirror/mode/cobol/cobol.min.js -index 9283fc5..0e2014f 100644 ---- a/media/editors/codemirror/mode/cobol/cobol.min.js -+++ b/media/editors/codemirror/mode/cobol/cobol.min.js -@@ -1 +1 @@ --!function(E){"object"==typeof exports&&"object"==typeof module?E(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],E):E(CodeMirror)}(function(E){"use strict";E.defineMode("cobol",function(){function E(E){for(var T={},I=E.split(" "),N=0;N >= "),M={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(E,t){if(null==t.indentStack&&E.sol()&&(t.indentation=6),E.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var G=!1;null!=(G=E.next());)if('"'==G||"'"==G){t.mode=!1;break}n=R;break;default:var i=E.next(),B=E.column();if(B>=0&&5>=B)n=D;else if(B>=72&&79>=B)E.skipToEnd(),n=L;else if("*"==i&&6==B)E.skipToEnd(),n=N;else if('"'==i||"'"==i)t.mode="string",n=R;else if("'"!=i||M.digit_or_colon.test(E.peek()))if("."==i)n=S;else if(T(i,E))n=O;else{if(E.current().match(M.symbol))for(;71>B&&void 0!==E.eat(M.symbol);)B++;n=P&&P.propertyIsEnumerable(E.current().toUpperCase())?C:e&&e.propertyIsEnumerable(E.current().toUpperCase())?I:U&&U.propertyIsEnumerable(E.current().toUpperCase())?A:null}else n=A}return n},indent:function(E){return null==E.indentStack?E.indentation:E.indentStack.indent}}}),E.defineMIME("text/x-cobol","cobol")}); -\ 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("cobol",function(){function a(a){for(var b={},c=a.split(" "),d=0;d >= "),o={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(a,p){if(null==p.indentStack&&a.sol()&&(p.indentation=6),a.eatSpace())return null;var q=null;switch(p.mode){case"string":for(var r=!1;null!=(r=a.next());)if('"'==r||"'"==r){p.mode=!1;break}q=e;break;default:var s=a.next(),t=a.column();if(t>=0&&5>=t)q=j;else if(t>=72&&79>=t)a.skipToEnd(),q=i;else if("*"==s&&6==t)a.skipToEnd(),q=d;else if('"'==s||"'"==s)p.mode="string",q=e;else if("'"!=s||o.digit_or_colon.test(a.peek()))if("."==s)q=k;else if(b(s,a))q=g;else{if(a.current().match(o.symbol))for(;71>t&&void 0!==a.eat(o.symbol);)t++;q=m&&m.propertyIsEnumerable(a.current().toUpperCase())?h:n&&n.propertyIsEnumerable(a.current().toUpperCase())?c:l&&l.propertyIsEnumerable(a.current().toUpperCase())?f:null}else q=f}return q},indent:function(a){return null==a.indentStack?a.indentation:a.indentStack.indent}}}),a.defineMIME("text/x-cobol","cobol")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/coffeescript/coffeescript.min.js b/media/editors/codemirror/mode/coffeescript/coffeescript.min.js -index 6023522..b463469 100644 ---- a/media/editors/codemirror/mode/coffeescript/coffeescript.min.js -+++ b/media/editors/codemirror/mode/coffeescript/coffeescript.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("coffeescript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var n=t.scope.offset;if(e.eatSpace()){var r=e.indentation();return r>n&&"coffee"==t.scope.type?"indent":n>r?"dedent":null}n>0&&f(e,t)}if(e.eatSpace())return null;var c=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=i,t.tokenize(e,t);if("#"===c)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var a=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(a=!0),e.match(/^-?\d+\.\d*/)&&(a=!0),e.match(/^-?\.\d+/)&&(a=!0),a)return"."==e.peek()&&e.backUp(1),"number";var h=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(h=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(h=!0),e.match(/^-?0(?![\dx])/i)&&(h=!0),h)return"number"}if(e.match(y))return t.tokenize=o(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=o(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(s)||e.match(m)?"operator":e.match(u)?"punctuation":e.match(z)?"atom":e.match(k)?"keyword":e.match(l)?"variable":e.match(d)?"property":(e.next(),p)}function o(e,n,o){return function(i,c){for(;!i.eol();)if(i.eatWhile(/[^'"\/\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return o}else{if(i.match(e))return c.tokenize=r,o;i.eat(/['"\/]/)}return n&&(t.singleLineStringErrors?o=p:c.tokenize=r),o}}function i(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=r;break}e.eatWhile("#")}return"comment"}function c(t,n,r){r=r||"coffee";for(var o=0,i=!1,c=null,f=n.scope;f;f=f.prev)if("coffee"===f.type||"}"==f.type){o=f.offset+e.indentUnit;break}"coffee"!==r?(i=null,c=t.column()+t.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:o,type:r,prev:n.scope,align:i,alignOffset:c}}function f(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var n=e.indentation(),r=!1,o=t.scope;o;o=o.prev)if(n===o.offset){r=!0;break}if(!r)return!0;for(;t.scope.prev&&t.scope.offset!==n;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function a(e,t){var n=t.tokenize(e,t),r=e.current();if("."===r)return n=t.tokenize(e,t),r=e.current(),/^\.[\w$]+$/.test(r)?"variable":p;"return"===r&&(t.dedent=!0),("->"!==r&&"=>"!==r||t.lambda||e.peek())&&"indent"!==n||c(e,t);var o="[({".indexOf(r);if(-1!==o&&c(e,t,"])}".slice(o,o+1)),h.exec(r)&&c(e,t),"then"==r&&f(e,t),"dedent"===n&&f(e,t))return p;if(o="])}".indexOf(r),-1!==o){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==r&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),n}var p="error",s=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,u=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,l=/^[_A-Za-z$][_A-Za-z$0-9]*/,d=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,m=n(["and","or","not","is","isnt","in","instanceof","typeof"]),h=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],v=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],k=n(h.concat(v));h=n(h);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,g=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],z=n(g),x={startState:function(e){return{tokenize:r,scope:{offset:e||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=null===t.scope.align&&t.scope;n&&e.sol()&&(n.align=!1);var r=a(e,t);return n&&r&&"comment"!=r&&(n.align=!0),t.lastToken={style:r,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),r},indent:function(e,t){if(e.tokenize!=r)return 0;var n=e.scope,o=t&&"])}".indexOf(t.charAt(0))>-1;if(o)for(;"coffee"==n.type&&n.prev;)n=n.prev;var i=o&&n.type===t.charAt(0);return n.align?n.alignOffset-(i?1:0):(i?n.prev:n).offset},lineComment:"#",fold:"indent"};return x}),e.defineMIME("text/x-coffeescript","coffeescript")}); -\ 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("coffeescript",function(a,b){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function d(a,b){if(a.sol()){null===b.scope.align&&(b.scope.align=!1);var c=b.scope.offset;if(a.eatSpace()){var d=a.indentation();return d>c&&"coffee"==b.scope.type?"indent":c>d?"dedent":null}c>0&&h(a,b)}if(a.eatSpace())return null;var g=a.peek();if(a.match("####"))return a.skipToEnd(),"comment";if(a.match("###"))return b.tokenize=f,b.tokenize(a,b);if("#"===g)return a.skipToEnd(),"comment";if(a.match(/^-?[0-9\.]/,!1)){var i=!1;if(a.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),a.match(/^-?\d+\.\d*/)&&(i=!0),a.match(/^-?\.\d+/)&&(i=!0),i)return"."==a.peek()&&a.backUp(1),"number";var p=!1;if(a.match(/^-?0x[0-9a-f]+/i)&&(p=!0),a.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(p=!0),a.match(/^-?0(?![\dx])/i)&&(p=!0),p)return"number"}if(a.match(s))return b.tokenize=e(a.current(),!1,"string"),b.tokenize(a,b);if(a.match(t)){if("/"!=a.current()||a.match(/^.*\//,!1))return b.tokenize=e(a.current(),!0,"string-2"),b.tokenize(a,b);a.backUp(1)}return a.match(k)||a.match(o)?"operator":a.match(l)?"punctuation":a.match(v)?"atom":a.match(r)?"keyword":a.match(m)?"variable":a.match(n)?"property":(a.next(),j)}function e(a,c,e){return function(f,g){for(;!f.eol();)if(f.eatWhile(/[^'"\/\\]/),f.eat("\\")){if(f.next(),c&&f.eol())return e}else{if(f.match(a))return g.tokenize=d,e;f.eat(/['"\/]/)}return c&&(b.singleLineStringErrors?e=j:g.tokenize=d),e}}function f(a,b){for(;!a.eol();){if(a.eatWhile(/[^#]/),a.match("###")){b.tokenize=d;break}a.eatWhile("#")}return"comment"}function g(b,c,d){d=d||"coffee";for(var e=0,f=!1,g=null,h=c.scope;h;h=h.prev)if("coffee"===h.type||"}"==h.type){e=h.offset+a.indentUnit;break}"coffee"!==d?(f=null,g=b.column()+b.current().length):c.scope.align&&(c.scope.align=!1),c.scope={offset:e,type:d,prev:c.scope,align:f,alignOffset:g}}function h(a,b){if(b.scope.prev){if("coffee"===b.scope.type){for(var c=a.indentation(),d=!1,e=b.scope;e;e=e.prev)if(c===e.offset){d=!0;break}if(!d)return!0;for(;b.scope.prev&&b.scope.offset!==c;)b.scope=b.scope.prev;return!1}return b.scope=b.scope.prev,!1}}function i(a,b){var c=b.tokenize(a,b),d=a.current();if("."===d)return c=b.tokenize(a,b),d=a.current(),/^\.[\w$]+$/.test(d)?"variable":j;"return"===d&&(b.dedent=!0),("->"!==d&&"=>"!==d||b.lambda||a.peek())&&"indent"!==c||g(a,b);var e="[({".indexOf(d);if(-1!==e&&g(a,b,"])}".slice(e,e+1)),p.exec(d)&&g(a,b),"then"==d&&h(a,b),"dedent"===c&&h(a,b))return j;if(e="])}".indexOf(d),-1!==e){for(;"coffee"==b.scope.type&&b.scope.prev;)b.scope=b.scope.prev;b.scope.type==d&&(b.scope=b.scope.prev)}return b.dedent&&a.eol()&&("coffee"==b.scope.type&&b.scope.prev&&(b.scope=b.scope.prev),b.dedent=!1),c}var j="error",k=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,l=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,m=/^[_A-Za-z$][_A-Za-z$0-9]*/,n=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,o=c(["and","or","not","is","isnt","in","instanceof","typeof"]),p=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],q=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],r=c(p.concat(q));p=c(p);var s=/^('{3}|\"{3}|['\"])/,t=/^(\/{3}|\/)/,u=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],v=c(u),w={startState:function(a){return{tokenize:d,scope:{offset:a||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=null===b.scope.align&&b.scope;c&&a.sol()&&(c.align=!1);var d=i(a,b);return c&&d&&"comment"!=d&&(c.align=!0),b.lastToken={style:d,content:a.current()},a.eol()&&a.lambda&&(b.lambda=!1),d},indent:function(a,b){if(a.tokenize!=d)return 0;var c=a.scope,e=b&&"])}".indexOf(b.charAt(0))>-1;if(e)for(;"coffee"==c.type&&c.prev;)c=c.prev;var f=e&&c.type===b.charAt(0);return c.align?c.alignOffset-(f?1:0):(f?c.prev:c).offset},lineComment:"#",fold:"indent"};return w}),a.defineMIME("text/x-coffeescript","coffeescript")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/commonlisp/commonlisp.js b/media/editors/codemirror/mode/commonlisp/commonlisp.js -index 5f50b35..fb1f99c 100644 ---- a/media/editors/codemirror/mode/commonlisp/commonlisp.js -+++ b/media/editors/codemirror/mode/commonlisp/commonlisp.js -@@ -111,6 +111,7 @@ CodeMirror.defineMode("commonlisp", function (config) { - return typeof i == "number" ? i : state.ctx.start + 1; - }, - -+ closeBrackets: {pairs: "()[]{}\"\""}, - lineComment: ";;", - blockCommentStart: "#|", - blockCommentEnd: "|#" -diff --git a/media/editors/codemirror/mode/commonlisp/commonlisp.min.js b/media/editors/codemirror/mode/commonlisp/commonlisp.min.js -index a3cea6f..3e2e47d 100644 ---- a/media/editors/codemirror/mode/commonlisp/commonlisp.min.js -+++ b/media/editors/codemirror/mode/commonlisp/commonlisp.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("commonlisp",function(t){function e(t){for(var e;e=t.next();)if("\\"==e)t.next();else if(!a.test(e)){t.backUp(1);break}return t.current()}function n(t,n){if(t.eatSpace())return i="ws",null;if(t.match(u))return"number";var a=t.next();if("\\"==a&&(a=t.next()),'"'==a)return(n.tokenize=r)(t,n);if("("==a)return i="open","bracket";if(")"==a||"]"==a)return i="close","bracket";if(";"==a)return t.skipToEnd(),i="ws","comment";if(/['`,@]/.test(a))return null;if("|"==a)return t.skipTo("|")?(t.next(),"symbol"):(t.skipToEnd(),"error");if("#"==a){var a=t.next();return"["==a?(i="open","bracket"):/[+\-=\.']/.test(a)?null:/\d/.test(a)&&t.match(/^\d*#/)?null:"|"==a?(n.tokenize=o)(t,n):":"==a?(e(t),"meta"):"error"}var f=e(t);return"."==f?null:(i="symbol","nil"==f||"t"==f||":"==f.charAt(0)?"atom":"open"==n.lastType&&(l.test(f)||c.test(f))?"keyword":"&"==f.charAt(0)?"variable-2":"variable")}function r(t,e){for(var r,o=!1;r=t.next();){if('"'==r&&!o){e.tokenize=n;break}o=!o&&"\\"==r}return"string"}function o(t,e){for(var r,o;r=t.next();){if("#"==r&&"|"==o){e.tokenize=n;break}o=r}return i="ws","comment"}var i,l=/^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/,c=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,u=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,a=/[^\s'`,@()\[\]";]/;return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastType:null,tokenize:n}},token:function(e,n){e.sol()&&"number"!=typeof n.ctx.indentTo&&(n.ctx.indentTo=n.ctx.start+1),i=null;var r=n.tokenize(e,n);return"ws"!=i&&(null==n.ctx.indentTo?n.ctx.indentTo="symbol"==i&&c.test(e.current())?n.ctx.start+t.indentUnit:"next":"next"==n.ctx.indentTo&&(n.ctx.indentTo=e.column()),n.lastType=i),"open"==i?n.ctx={prev:n.ctx,start:e.column(),indentTo:null}:"close"==i&&(n.ctx=n.ctx.prev||n.ctx),r},indent:function(t){var e=t.ctx.indentTo;return"number"==typeof e?e:t.ctx.start+1},lineComment:";;",blockCommentStart:"#|",blockCommentEnd:"|#"}}),t.defineMIME("text/x-common-lisp","commonlisp")}); -\ 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("commonlisp",function(a){function b(a){for(var b;b=a.next();)if("\\"==b)a.next();else if(!j.test(b)){a.backUp(1);break}return a.current()}function c(a,c){if(a.eatSpace())return f="ws",null;if(a.match(i))return"number";var j=a.next();if("\\"==j&&(j=a.next()),'"'==j)return(c.tokenize=d)(a,c);if("("==j)return f="open","bracket";if(")"==j||"]"==j)return f="close","bracket";if(";"==j)return a.skipToEnd(),f="ws","comment";if(/['`,@]/.test(j))return null;if("|"==j)return a.skipTo("|")?(a.next(),"symbol"):(a.skipToEnd(),"error");if("#"==j){var j=a.next();return"["==j?(f="open","bracket"):/[+\-=\.']/.test(j)?null:/\d/.test(j)&&a.match(/^\d*#/)?null:"|"==j?(c.tokenize=e)(a,c):":"==j?(b(a),"meta"):"error"}var k=b(a);return"."==k?null:(f="symbol","nil"==k||"t"==k||":"==k.charAt(0)?"atom":"open"==c.lastType&&(g.test(k)||h.test(k))?"keyword":"&"==k.charAt(0)?"variable-2":"variable")}function d(a,b){for(var d,e=!1;d=a.next();){if('"'==d&&!e){b.tokenize=c;break}e=!e&&"\\"==d}return"string"}function e(a,b){for(var d,e;d=a.next();){if("#"==d&&"|"==e){b.tokenize=c;break}e=d}return f="ws","comment"}var f,g=/^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/,h=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,i=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,j=/[^\s'`,@()\[\]";]/;return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastType:null,tokenize:c}},token:function(b,c){b.sol()&&"number"!=typeof c.ctx.indentTo&&(c.ctx.indentTo=c.ctx.start+1),f=null;var d=c.tokenize(b,c);return"ws"!=f&&(null==c.ctx.indentTo?"symbol"==f&&h.test(b.current())?c.ctx.indentTo=c.ctx.start+a.indentUnit:c.ctx.indentTo="next":"next"==c.ctx.indentTo&&(c.ctx.indentTo=b.column()),c.lastType=f),"open"==f?c.ctx={prev:c.ctx,start:b.column(),indentTo:null}:"close"==f&&(c.ctx=c.ctx.prev||c.ctx),d},indent:function(a,b){var c=a.ctx.indentTo;return"number"==typeof c?c:a.ctx.start+1},closeBrackets:{pairs:'()[]{}""'},lineComment:";;",blockCommentStart:"#|",blockCommentEnd:"|#"}}),a.defineMIME("text/x-common-lisp","commonlisp")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/css/css.js b/media/editors/codemirror/mode/css/css.js -index 34355aa..1e6d2dd 100644 ---- a/media/editors/codemirror/mode/css/css.js -+++ b/media/editors/codemirror/mode/css/css.js -@@ -239,6 +239,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { - if (type == "{" || type == "}") return popAndPass(type, stream, state); - if (type == ")") return popContext(state); - if (type == "(") return pushContext(state, stream, "parens"); -+ if (type == "interpolation") return pushContext(state, stream, "interpolation"); - if (type == "word") wordAsValue(stream); - return "parens"; - }; -@@ -327,7 +328,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) { - states.interpolation = function(type, stream, state) { - if (type == "}") return popContext(state); - if (type == "{" || type == ";") return popAndPass(type, stream, state); -- if (type != "variable") override = "error"; -+ if (type == "word") override = "variable"; -+ else if (type != "variable" && type != "(" && type != ")") override = "error"; - return "interpolation"; - }; - -@@ -651,16 +653,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) { - return ["comment", "comment"]; - } - -- function tokenSGMLComment(stream, state) { -- if (stream.skipTo("-->")) { -- stream.match("-->"); -- state.tokenize = null; -- } else { -- stream.skipToEnd(); -- } -- return ["comment", "comment"]; -- } -- - CodeMirror.defineMIME("text/css", { - documentTypes: documentTypes, - mediaTypes: mediaTypes, -@@ -672,11 +664,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) { - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - tokenHooks: { -- "<": function(stream, state) { -- if (!stream.match("!--")) return false; -- state.tokenize = tokenSGMLComment; -- return tokenSGMLComment(stream, state); -- }, - "/": function(stream, state) { - if (!stream.eat("*")) return false; - state.tokenize = tokenCComment; -@@ -749,6 +736,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { - } - }, - "@": function(stream) { -+ if (stream.eat("{")) return [null, "interpolation"]; - if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false; - stream.eatWhile(/[\w\\\-]/); - if (stream.match(/^\s*:/, false)) -diff --git a/media/editors/codemirror/mode/css/css.min.js b/media/editors/codemirror/mode/css/css.min.js -index e819816..7257db3 100644 ---- a/media/editors/codemirror/mode/css/css.min.js -+++ b/media/editors/codemirror/mode/css/css.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r")?(e.match("-->"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}e.defineMode("css",function(t,r){function o(e,t){return m=t,e}function a(e,t){var r=e.next();if(b[r]){var a=b[r](e,t);if(a!==!1)return a}return"@"==r?(e.eatWhile(/[\w\\\-]/),o("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?o(null,"compare"):'"'==r||"'"==r?(t.tokenize=i(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),o("atom","hash")):"!"==r?(e.match(/^\s*\w*/),o("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),o("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?o(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?o(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=n,o("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),o("property","word")):o(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),o("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?o("variable-2","variable-definition"):o("variable-2","variable")):e.match(/^\w+-/)?o("meta","meta"):void 0}function i(e){return function(t,r){for(var a,i=!1;null!=(a=t.next());){if(a==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==a}return(a==e||!i&&")"!=e)&&(r.tokenize=null),o("string","string")}}function n(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:i(")"),o(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r){return e.context=new l(r,t.indentation()+g,e.context),r}function c(e){return e.context=e.context.prev,e.context.type}function d(e,t,r){return K[r.context.type](e,t,r)}function u(e,t,r,o){for(var a=o||1;a>0;a--)r.context=r.context.prev;return d(e,t,r)}function p(e){var t=e.current().toLowerCase();h=j.hasOwnProperty(t)?"atom":q.hasOwnProperty(t)?"keyword":"variable"}r.propertyKeywords||(r=e.resolveMode("text/css"));var m,h,g=t.indentUnit,b=r.tokenHooks,f=r.documentTypes||{},k=r.mediaTypes||{},y=r.mediaFeatures||{},w=r.propertyKeywords||{},v=r.nonStandardPropertyKeywords||{},x=r.fontProperties||{},z=r.counterDescriptors||{},q=r.colorKeywords||{},j=r.valueKeywords||{},P=r.allowNested,K={};return K.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(/@(media|supports|(-moz-)?document)/.test(e))return s(r,t,"atBlock");if(/@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(P&&"("==e)return s(r,t,"parens")}return r.context.type},K.block=function(e,t,r){if("word"==e){var o=t.current().toLowerCase();return w.hasOwnProperty(o)?(h="property","maybeprop"):v.hasOwnProperty(o)?(h="string-2","maybeprop"):P?(h=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(h+=" error","maybeprop")}return"meta"==e?"block":P||"hash"!=e&&"qualifier"!=e?K.top(e,t,r):(h="error","block")},K.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):d(e,t,r)},K.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&P)return s(r,t,"propBlock");if("}"==e||"{"==e)return u(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)p(t);else if("interpolation"==e)return s(r,t,"interpolation")}else h+=" error";return"prop"},K.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(h="property","maybeprop"):r.context.type},K.parens=function(e,t,r){return"{"==e||"}"==e?u(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):("word"==e&&p(t),"parens")},K.pseudo=function(e,t,r){return"word"==e?(h="variable-3",r.context.type):d(e,t,r)},K.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e)return u(e,t,r);if("{"==e)return c(r)&&s(r,t,P?"block":"top");if("word"==e){var o=t.current().toLowerCase();h="only"==o||"not"==o||"and"==o||"or"==o?"keyword":f.hasOwnProperty(o)?"tag":k.hasOwnProperty(o)?"attribute":y.hasOwnProperty(o)?"property":w.hasOwnProperty(o)?"property":v.hasOwnProperty(o)?"string-2":j.hasOwnProperty(o)?"atom":"error"}return r.context.type},K.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?u(e,t,r,2):K.atBlock(e,t,r)},K.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(h="variable","restricted_atBlock_before"):d(e,t,r)},K.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(h="@font-face"==r.stateArg&&!x.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!z.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},K.keyframes=function(e,t,r){return"word"==e?(h="variable","keyframes"):"{"==e?s(r,t,"top"):d(e,t,r)},K.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?u(e,t,r):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},K.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?u(e,t,r):("variable"!=e&&(h="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:"top",stateArg:null,context:new l("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||a)(e,t);return r&&"object"==typeof r&&(m=r[1],r=r[0]),h=r,t.state=K[t.state](m,e,t),h},indent:function(e,t){var r=e.context,o=t&&t.charAt(0),a=r.indent;return"prop"!=r.type||"}"!=o&&")"!=o||(r=r.prev),!r.prev||("}"!=o||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type)&&(")"!=o||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=o||"at"!=r.type&&"atBlock"!=r.type)||(a=r.indent-g,r=r.prev),a},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var a=["domain","regexp","url","url-prefix"],i=t(a),n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],l=t(n),s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],c=t(s),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=t(d),p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],m=t(p),h=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(h),b=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],f=t(b),k=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(k),w=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],v=t(w),x=a.concat(n).concat(s).concat(d).concat(p).concat(k).concat(w);e.registerHelper("hintWords","css",x),e.defineMIME("text/css",{documentTypes:i,mediaTypes:l,mediaFeatures:c,propertyKeywords:u,nonStandardPropertyKeywords:m,fontProperties:g,counterDescriptors:f,colorKeywords:y,valueKeywords:v,tokenHooks:{"<":function(e,t){return e.match("!--")?(t.tokenize=o,o(e,t)):!1},"/":function(e,t){return e.eat("*")?(t.tokenize=r,r(e,t)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:l,mediaFeatures:c,propertyKeywords:u,nonStandardPropertyKeywords:m,colorKeywords:y,valueKeywords:v,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/)?[null,"{"]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:l,mediaFeatures:c,propertyKeywords:u,nonStandardPropertyKeywords:m,colorKeywords:y,valueKeywords:v,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}); -\ 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){for(var b={},c=0;c*\/]/.test(c)?d(null,"select-op"):"."==c&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?d("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(c)?d(null,c):"u"==c&&a.match(/rl(-prefix)?\(/)||"d"==c&&a.match("omain(")||"r"==c&&a.match("egexp(")?(a.backUp(1),b.tokenize=g,d("property","word")):/[\w\\\-]/.test(c)?(a.eatWhile(/[\w\\\-]/),d("property","word")):d(null,null):/[\d.]/.test(a.peek())?(a.eatWhile(/[\w.%]/),d("number","unit")):a.match(/^-[\w\\\-]+/)?(a.eatWhile(/[\w\\\-]/),a.match(/^\s*:/,!1)?d("variable-2","variable-definition"):d("variable-2","variable")):a.match(/^\w+-/)?d("meta","meta"):void 0}function f(a){return function(b,c){for(var e,f=!1;null!=(e=b.next());){if(e==a&&!f){")"==a&&b.backUp(1);break}f=!f&&"\\"==e}return(e==a||!f&&")"!=a)&&(c.tokenize=null),d("string","string")}}function g(a,b){return a.next(),a.match(/\s*[\"\')]/,!1)?b.tokenize=null:b.tokenize=f(")"),d(null,"(")}function h(a,b,c){this.type=a,this.indent=b,this.prev=c}function i(a,b,c){return a.context=new h(c,b.indentation()+p,a.context),c}function j(a){return a.context=a.context.prev,a.context.type}function k(a,b,c){return B[c.context.type](a,b,c)}function l(a,b,c,d){for(var e=d||1;e>0;e--)c.context=c.context.prev;return k(a,b,c)}function m(a){var b=a.current().toLowerCase();o=z.hasOwnProperty(b)?"atom":y.hasOwnProperty(b)?"keyword":"variable"}c.propertyKeywords||(c=a.resolveMode("text/css"));var n,o,p=b.indentUnit,q=c.tokenHooks,r=c.documentTypes||{},s=c.mediaTypes||{},t=c.mediaFeatures||{},u=c.propertyKeywords||{},v=c.nonStandardPropertyKeywords||{},w=c.fontProperties||{},x=c.counterDescriptors||{},y=c.colorKeywords||{},z=c.valueKeywords||{},A=c.allowNested,B={};return B.top=function(a,b,c){if("{"==a)return i(c,b,"block");if("}"==a&&c.context.prev)return j(c);if(/@(media|supports|(-moz-)?document)/.test(a))return i(c,b,"atBlock");if(/@(font-face|counter-style)/.test(a))return c.stateArg=a,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(a))return"keyframes";if(a&&"@"==a.charAt(0))return i(c,b,"at");if("hash"==a)o="builtin";else if("word"==a)o="tag";else{if("variable-definition"==a)return"maybeprop";if("interpolation"==a)return i(c,b,"interpolation");if(":"==a)return"pseudo";if(A&&"("==a)return i(c,b,"parens")}return c.context.type},B.block=function(a,b,c){if("word"==a){var d=b.current().toLowerCase();return u.hasOwnProperty(d)?(o="property","maybeprop"):v.hasOwnProperty(d)?(o="string-2","maybeprop"):A?(o=b.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==a?"block":A||"hash"!=a&&"qualifier"!=a?B.top(a,b,c):(o="error","block")},B.maybeprop=function(a,b,c){return":"==a?i(c,b,"prop"):k(a,b,c)},B.prop=function(a,b,c){if(";"==a)return j(c);if("{"==a&&A)return i(c,b,"propBlock");if("}"==a||"{"==a)return l(a,b,c);if("("==a)return i(c,b,"parens");if("hash"!=a||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(b.current())){if("word"==a)m(b);else if("interpolation"==a)return i(c,b,"interpolation")}else o+=" error";return"prop"},B.propBlock=function(a,b,c){return"}"==a?j(c):"word"==a?(o="property","maybeprop"):c.context.type},B.parens=function(a,b,c){return"{"==a||"}"==a?l(a,b,c):")"==a?j(c):"("==a?i(c,b,"parens"):"interpolation"==a?i(c,b,"interpolation"):("word"==a&&m(b),"parens")},B.pseudo=function(a,b,c){return"word"==a?(o="variable-3",c.context.type):k(a,b,c)},B.atBlock=function(a,b,c){if("("==a)return i(c,b,"atBlock_parens");if("}"==a)return l(a,b,c);if("{"==a)return j(c)&&i(c,b,A?"block":"top");if("word"==a){var d=b.current().toLowerCase();o="only"==d||"not"==d||"and"==d||"or"==d?"keyword":r.hasOwnProperty(d)?"tag":s.hasOwnProperty(d)?"attribute":t.hasOwnProperty(d)?"property":u.hasOwnProperty(d)?"property":v.hasOwnProperty(d)?"string-2":z.hasOwnProperty(d)?"atom":"error"}return c.context.type},B.atBlock_parens=function(a,b,c){return")"==a?j(c):"{"==a||"}"==a?l(a,b,c,2):B.atBlock(a,b,c)},B.restricted_atBlock_before=function(a,b,c){return"{"==a?i(c,b,"restricted_atBlock"):"word"==a&&"@counter-style"==c.stateArg?(o="variable","restricted_atBlock_before"):k(a,b,c)},B.restricted_atBlock=function(a,b,c){return"}"==a?(c.stateArg=null,j(c)):"word"==a?(o="@font-face"==c.stateArg&&!w.hasOwnProperty(b.current().toLowerCase())||"@counter-style"==c.stateArg&&!x.hasOwnProperty(b.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},B.keyframes=function(a,b,c){return"word"==a?(o="variable","keyframes"):"{"==a?i(c,b,"top"):k(a,b,c)},B.at=function(a,b,c){return";"==a?j(c):"{"==a||"}"==a?l(a,b,c):("word"==a?o="tag":"hash"==a&&(o="builtin"),"at")},B.interpolation=function(a,b,c){return"}"==a?j(c):"{"==a||";"==a?l(a,b,c):("word"==a?o="variable":"variable"!=a&&"("!=a&&")"!=a&&(o="error"),"interpolation")},{startState:function(a){return{tokenize:null,state:"top",stateArg:null,context:new h("top",a||0,null)}},token:function(a,b){if(!b.tokenize&&a.eatSpace())return null;var c=(b.tokenize||e)(a,b);return c&&"object"==typeof c&&(n=c[1],c=c[0]),o=c,b.state=B[b.state](n,a,b),o},indent:function(a,b){var c=a.context,d=b&&b.charAt(0),e=c.indent;return"prop"!=c.type||"}"!=d&&")"!=d||(c=c.prev),!c.prev||("}"!=d||"block"!=c.type&&"top"!=c.type&&"interpolation"!=c.type&&"restricted_atBlock"!=c.type)&&(")"!=d||"parens"!=c.type&&"atBlock_parens"!=c.type)&&("{"!=d||"at"!=c.type&&"atBlock"!=c.type)||(e=c.indent-p,c=c.prev),e},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var d=["domain","regexp","url","url-prefix"],e=b(d),f=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],g=b(f),h=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],i=b(h),j=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],k=b(j),l=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],m=b(l),n=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],o=b(n),p=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],q=b(p),r=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],s=b(r),t=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],u=b(t),v=d.concat(f).concat(h).concat(j).concat(l).concat(r).concat(t);a.registerHelper("hintWords","css",v),a.defineMIME("text/css",{documentTypes:e,mediaTypes:g,mediaFeatures:i,propertyKeywords:k,nonStandardPropertyKeywords:m,fontProperties:o,counterDescriptors:q,colorKeywords:s,valueKeywords:u,tokenHooks:{"/":function(a,b){return a.eat("*")?(b.tokenize=c,c(a,b)):!1}},name:"css"}),a.defineMIME("text/x-scss",{mediaTypes:g,mediaFeatures:i,propertyKeywords:k,nonStandardPropertyKeywords:m,colorKeywords:s,valueKeywords:u,fontProperties:o,allowNested:!0,tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=c,c(a,b)):["operator","operator"]},":":function(a){return a.match(/\s*\{/)?[null,"{"]:!1},$:function(a){return a.match(/^[\w-]+/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(a){return a.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),a.defineMIME("text/x-less",{mediaTypes:g,mediaFeatures:i,propertyKeywords:k,nonStandardPropertyKeywords:m,colorKeywords:s,valueKeywords:u,fontProperties:o,allowNested:!0,tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=c,c(a,b)):["operator","operator"]},"@":function(a){return a.eat("{")?[null,"interpolation"]:a.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(a.eatWhile(/[\w\\\-]/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/css/less.html b/media/editors/codemirror/mode/css/less.html -deleted file mode 100644 -index 6ccb721..0000000 ---- a/media/editors/codemirror/mode/css/less.html -+++ /dev/null -@@ -1,152 +0,0 @@ -- -- --CodeMirror: LESS mode -- -- -- -- -- -- -- -- -- -- --
    --

    LESS mode

    --
    -- -- --

    The LESS mode is a sub-mode of the CSS mode (defined in css.js.

    -- --

    Parsing/Highlighting Tests: normal, verbose.

    --
    -diff --git a/media/editors/codemirror/mode/css/less_test.js b/media/editors/codemirror/mode/css/less_test.js -deleted file mode 100644 -index 2ba6998..0000000 ---- a/media/editors/codemirror/mode/css/less_test.js -+++ /dev/null -@@ -1,51 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- "use strict"; -- -- var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); } -- -- MT("variable", -- "[variable-2 @base]: [atom #f04615];", -- "[qualifier .class] {", -- " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]", -- " [property color]: [variable saturate]([variable-2 @base], [number 5%]);", -- "}"); -- -- MT("amp", -- "[qualifier .child], [qualifier .sibling] {", -- " [qualifier .parent] [atom &] {", -- " [property color]: [keyword black];", -- " }", -- " [atom &] + [atom &] {", -- " [property color]: [keyword red];", -- " }", -- "}"); -- -- MT("mixin", -- "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {", -- " [property color]: [variable darken]([variable-2 @color], [number 10%]);", -- "}", -- "[qualifier .mixin] ([variable light]; [variable-2 @color]) {", -- " [property color]: [variable lighten]([variable-2 @color], [number 10%]);", -- "}", -- "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {", -- " [property display]: [atom block];", -- "}", -- "[variable-2 @switch]: [variable light];", -- "[qualifier .class] {", -- " [qualifier .mixin]([variable-2 @switch]; [atom #888]);", -- "}"); -- -- MT("nest", -- "[qualifier .one] {", -- " [def @media] ([property width]: [number 400px]) {", -- " [property font-size]: [number 1.2em];", -- " [def @media] [attribute print] [keyword and] [property color] {", -- " [property color]: [keyword blue];", -- " }", -- " }", -- "}"); --})(); -diff --git a/media/editors/codemirror/mode/css/less_test.min.js b/media/editors/codemirror/mode/css/less_test.min.js -deleted file mode 100644 -index 8e8ca99..0000000 ---- a/media/editors/codemirror/mode/css/less_test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){"use strict";function r(r){test.mode(r,e,Array.prototype.slice.call(arguments,1),"less")}var e=CodeMirror.getMode({indentUnit:2},"text/x-less");r("variable","[variable-2 @base]: [atom #f04615];","[qualifier .class] {"," [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]"," [property color]: [variable saturate]([variable-2 @base], [number 5%]);","}"),r("amp","[qualifier .child], [qualifier .sibling] {"," [qualifier .parent] [atom &] {"," [property color]: [keyword black];"," }"," [atom &] + [atom &] {"," [property color]: [keyword red];"," }","}"),r("mixin","[qualifier .mixin] ([variable dark]; [variable-2 @color]) {"," [property color]: [variable darken]([variable-2 @color], [number 10%]);","}","[qualifier .mixin] ([variable light]; [variable-2 @color]) {"," [property color]: [variable lighten]([variable-2 @color], [number 10%]);","}","[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {"," [property display]: [atom block];","}","[variable-2 @switch]: [variable light];","[qualifier .class] {"," [qualifier .mixin]([variable-2 @switch]; [atom #888]);","}"),r("nest","[qualifier .one] {"," [def @media] ([property width]: [number 400px]) {"," [property font-size]: [number 1.2em];"," [def @media] [attribute print] [keyword and] [property color] {"," [property color]: [keyword blue];"," }"," }","}")}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/css/scss.html b/media/editors/codemirror/mode/css/scss.html -deleted file mode 100644 -index 21f20e0..0000000 ---- a/media/editors/codemirror/mode/css/scss.html -+++ /dev/null -@@ -1,157 +0,0 @@ -- -- --CodeMirror: SCSS mode -- -- -- -- -- -- -- -- -- --
    --

    SCSS mode

    --
    -- -- --

    The SCSS mode is a sub-mode of the CSS mode (defined in css.js.

    -- --

    Parsing/Highlighting Tests: normal, verbose.

    -- --
    -diff --git a/media/editors/codemirror/mode/css/scss_test.js b/media/editors/codemirror/mode/css/scss_test.js -deleted file mode 100644 -index 8dcea9e..0000000 ---- a/media/editors/codemirror/mode/css/scss_test.js -+++ /dev/null -@@ -1,110 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); } -- -- MT('url_with_quotation', -- "[tag foo] { [property background]:[atom url]([string test.jpg]) }"); -- -- MT('url_with_double_quotes', -- "[tag foo] { [property background]:[atom url]([string \"test.jpg\"]) }"); -- -- MT('url_with_single_quotes', -- "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) }"); -- -- MT('string', -- "[def @import] [string \"compass/css3\"]"); -- -- MT('important_keyword', -- "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) [keyword !important] }"); -- -- MT('variable', -- "[variable-2 $blue]:[atom #333]"); -- -- MT('variable_as_attribute', -- "[tag foo] { [property color]:[variable-2 $blue] }"); -- -- MT('numbers', -- "[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }"); -- -- MT('number_percentage', -- "[tag foo] { [property width]:[number 80%] }"); -- -- MT('selector', -- "[builtin #hello][qualifier .world]{}"); -- -- MT('singleline_comment', -- "[comment // this is a comment]"); -- -- MT('multiline_comment', -- "[comment /*foobar*/]"); -- -- MT('attribute_with_hyphen', -- "[tag foo] { [property font-size]:[number 10px] }"); -- -- MT('string_after_attribute', -- "[tag foo] { [property content]:[string \"::\"] }"); -- -- MT('directives', -- "[def @include] [qualifier .mixin]"); -- -- MT('basic_structure', -- "[tag p] { [property background]:[keyword red]; }"); -- -- MT('nested_structure', -- "[tag p] { [tag a] { [property color]:[keyword red]; } }"); -- -- MT('mixin', -- "[def @mixin] [tag table-base] {}"); -- -- MT('number_without_semicolon', -- "[tag p] {[property width]:[number 12]}", -- "[tag a] {[property color]:[keyword red];}"); -- -- MT('atom_in_nested_block', -- "[tag p] { [tag a] { [property color]:[atom #000]; } }"); -- -- MT('interpolation_in_property', -- "[tag foo] { #{[variable-2 $hello]}:[number 2]; }"); -- -- MT('interpolation_in_selector', -- "[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }"); -- -- MT('interpolation_error', -- "[tag foo]#{[error foo]} { [property color]:[atom #000]; }"); -- -- MT("divide_operator", -- "[tag foo] { [property width]:[number 4] [operator /] [number 2] }"); -- -- MT('nested_structure_with_id_selector', -- "[tag p] { [builtin #hello] { [property color]:[keyword red]; } }"); -- -- MT('indent_mixin', -- "[def @mixin] [tag container] (", -- " [variable-2 $a]: [number 10],", -- " [variable-2 $b]: [number 10])", -- "{}"); -- -- MT('indent_nested', -- "[tag foo] {", -- " [tag bar] {", -- " }", -- "}"); -- -- MT('indent_parentheses', -- "[tag foo] {", -- " [property color]: [variable darken]([variable-2 $blue],", -- " [number 9%]);", -- "}"); -- -- MT('indent_vardef', -- "[variable-2 $name]:", -- " [string 'val'];", -- "[tag tag] {", -- " [tag inner] {", -- " [property margin]: [number 3px];", -- " }", -- "}"); --})(); -diff --git a/media/editors/codemirror/mode/css/scss_test.min.js b/media/editors/codemirror/mode/css/scss_test.min.js -deleted file mode 100644 -index f81e79a..0000000 ---- a/media/editors/codemirror/mode/css/scss_test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function r(r){test.mode(r,t,Array.prototype.slice.call(arguments,1),"scss")}var t=CodeMirror.getMode({indentUnit:2},"text/x-scss");r("url_with_quotation","[tag foo] { [property background]:[atom url]([string test.jpg]) }"),r("url_with_double_quotes",'[tag foo] { [property background]:[atom url]([string "test.jpg"]) }'),r("url_with_single_quotes","[tag foo] { [property background]:[atom url]([string 'test.jpg']) }"),r("string",'[def @import] [string "compass/css3"]'),r("important_keyword","[tag foo] { [property background]:[atom url]([string 'test.jpg']) [keyword !important] }"),r("variable","[variable-2 $blue]:[atom #333]"),r("variable_as_attribute","[tag foo] { [property color]:[variable-2 $blue] }"),r("numbers","[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }"),r("number_percentage","[tag foo] { [property width]:[number 80%] }"),r("selector","[builtin #hello][qualifier .world]{}"),r("singleline_comment","[comment // this is a comment]"),r("multiline_comment","[comment /*foobar*/]"),r("attribute_with_hyphen","[tag foo] { [property font-size]:[number 10px] }"),r("string_after_attribute",'[tag foo] { [property content]:[string "::"] }'),r("directives","[def @include] [qualifier .mixin]"),r("basic_structure","[tag p] { [property background]:[keyword red]; }"),r("nested_structure","[tag p] { [tag a] { [property color]:[keyword red]; } }"),r("mixin","[def @mixin] [tag table-base] {}"),r("number_without_semicolon","[tag p] {[property width]:[number 12]}","[tag a] {[property color]:[keyword red];}"),r("atom_in_nested_block","[tag p] { [tag a] { [property color]:[atom #000]; } }"),r("interpolation_in_property","[tag foo] { #{[variable-2 $hello]}:[number 2]; }"),r("interpolation_in_selector","[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }"),r("interpolation_error","[tag foo]#{[error foo]} { [property color]:[atom #000]; }"),r("divide_operator","[tag foo] { [property width]:[number 4] [operator /] [number 2] }"),r("nested_structure_with_id_selector","[tag p] { [builtin #hello] { [property color]:[keyword red]; } }"),r("indent_mixin","[def @mixin] [tag container] ("," [variable-2 $a]: [number 10],"," [variable-2 $b]: [number 10])","{}"),r("indent_nested","[tag foo] {"," [tag bar] {"," }","}"),r("indent_parentheses","[tag foo] {"," [property color]: [variable darken]([variable-2 $blue],"," [number 9%]);","}"),r("indent_vardef","[variable-2 $name]:"," [string 'val'];","[tag tag] {"," [tag inner] {"," [property margin]: [number 3px];"," }","}")}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/css/test.js b/media/editors/codemirror/mode/css/test.js -deleted file mode 100644 -index bef7156..0000000 ---- a/media/editors/codemirror/mode/css/test.js -+++ /dev/null -@@ -1,195 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({indentUnit: 2}, "css"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- -- // Error, because "foobarhello" is neither a known type or property, but -- // property was expected (after "and"), and it should be in parenthese. -- MT("atMediaUnknownType", -- "[def @media] [attribute screen] [keyword and] [error foobarhello] { }"); -- -- // Soft error, because "foobarhello" is not a known property or type. -- MT("atMediaUnknownProperty", -- "[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }"); -- -- // Make sure nesting works with media queries -- MT("atMediaMaxWidthNested", -- "[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"); -- -- MT("tagSelector", -- "[tag foo] { }"); -- -- MT("classSelector", -- "[qualifier .foo-bar_hello] { }"); -- -- MT("idSelector", -- "[builtin #foo] { [error #foo] }"); -- -- MT("tagSelectorUnclosed", -- "[tag foo] { [property margin]: [number 0] } [tag bar] { }"); -- -- MT("tagStringNoQuotes", -- "[tag foo] { [property font-family]: [variable hello] [variable world]; }"); -- -- MT("tagStringDouble", -- "[tag foo] { [property font-family]: [string \"hello world\"]; }"); -- -- MT("tagStringSingle", -- "[tag foo] { [property font-family]: [string 'hello world']; }"); -- -- MT("tagColorKeyword", -- "[tag foo] {", -- " [property color]: [keyword black];", -- " [property color]: [keyword navy];", -- " [property color]: [keyword yellow];", -- "}"); -- -- MT("tagColorHex3", -- "[tag foo] { [property background]: [atom #fff]; }"); -- -- MT("tagColorHex6", -- "[tag foo] { [property background]: [atom #ffffff]; }"); -- -- MT("tagColorHex4", -- "[tag foo] { [property background]: [atom&error #ffff]; }"); -- -- MT("tagColorHexInvalid", -- "[tag foo] { [property background]: [atom&error #ffg]; }"); -- -- MT("tagNegativeNumber", -- "[tag foo] { [property margin]: [number -5px]; }"); -- -- MT("tagPositiveNumber", -- "[tag foo] { [property padding]: [number 5px]; }"); -- -- MT("tagVendor", -- "[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }"); -- -- MT("tagBogusProperty", -- "[tag foo] { [property&error barhelloworld]: [number 0]; }"); -- -- MT("tagTwoProperties", -- "[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }"); -- -- MT("tagTwoPropertiesURL", -- "[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }"); -- -- MT("commentSGML", -- "[comment ]"); -- -- MT("commentSGML2", -- "[comment ] [tag div] {}"); -- -- MT("indent_tagSelector", -- "[tag strong], [tag em] {", -- " [property background]: [atom rgba](", -- " [number 255], [number 255], [number 0], [number .2]", -- " );", -- "}"); -- -- MT("indent_atMedia", -- "[def @media] {", -- " [tag foo] {", -- " [property color]:", -- " [keyword yellow];", -- " }", -- "}"); -- -- MT("indent_comma", -- "[tag foo] {", -- " [property font-family]: [variable verdana],", -- " [atom sans-serif];", -- "}"); -- -- MT("indent_parentheses", -- "[tag foo]:[variable-3 before] {", -- " [property background]: [atom url](", -- "[string blahblah]", -- "[string etc]", -- "[string ]) [keyword !important];", -- "}"); -- -- MT("font_face", -- "[def @font-face] {", -- " [property font-family]: [string 'myfont'];", -- " [error nonsense]: [string 'abc'];", -- " [property src]: [atom url]([string http://blah]),", -- " [atom url]([string http://foo]);", -- "}"); -- -- MT("empty_url", -- "[def @import] [tag url]() [tag screen];"); -- -- MT("parens", -- "[qualifier .foo] {", -- " [property background-image]: [variable fade]([atom #000], [number 20%]);", -- " [property border-image]: [atom linear-gradient](", -- " [atom to] [atom bottom],", -- " [variable fade]([atom #000], [number 20%]) [number 0%],", -- " [variable fade]([atom #000], [number 20%]) [number 100%]", -- " );", -- "}"); -- -- MT("css_variable", -- ":[variable-3 root] {", -- " [variable-2 --main-color]: [atom #06c];", -- "}", -- "[tag h1][builtin #foo] {", -- " [property color]: [atom var]([variable-2 --main-color]);", -- "}"); -- -- MT("supports", -- "[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {", -- " [property text-align-last]: [atom justify];", -- "}"); -- -- MT("document", -- "[def @document] [tag url]([string http://blah]),", -- " [tag url-prefix]([string https://]),", -- " [tag domain]([string blah.com]),", -- " [tag regexp]([string \".*blah.+\"]) {", -- " [builtin #id] {", -- " [property background-color]: [keyword white];", -- " }", -- " [tag foo] {", -- " [property font-family]: [variable Verdana], [atom sans-serif];", -- " }", -- " }"); -- -- MT("document_url", -- "[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }"); -- -- MT("document_urlPrefix", -- "[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }"); -- -- MT("document_domain", -- "[def @document] [tag domain]([string blah.com]) { [tag foo] { } }"); -- -- MT("document_regexp", -- "[def @document] [tag regexp]([string \".*blah.+\"]) { [builtin #id] { } }"); -- -- MT("counter-style", -- "[def @counter-style] [variable binary] {", -- " [property system]: [atom numeric];", -- " [property symbols]: [number 0] [number 1];", -- " [property suffix]: [string \".\"];", -- " [property range]: [atom infinite];", -- " [property speak-as]: [atom numeric];", -- "}"); -- -- MT("counter-style-additive-symbols", -- "[def @counter-style] [variable simple-roman] {", -- " [property system]: [atom additive];", -- " [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];", -- " [property range]: [number 1] [number 49];", -- "}"); -- -- MT("counter-style-use", -- "[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }"); -- -- MT("counter-style-symbols", -- "[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }"); --})(); -diff --git a/media/editors/codemirror/mode/css/test.min.js b/media/editors/codemirror/mode/css/test.min.js -deleted file mode 100644 -index c9cff95..0000000 ---- a/media/editors/codemirror/mode/css/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function r(r){test.mode(r,o,Array.prototype.slice.call(arguments,1))}var o=CodeMirror.getMode({indentUnit:2},"css");r("atMediaUnknownType","[def @media] [attribute screen] [keyword and] [error foobarhello] { }"),r("atMediaUnknownProperty","[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }"),r("atMediaMaxWidthNested","[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"),r("tagSelector","[tag foo] { }"),r("classSelector","[qualifier .foo-bar_hello] { }"),r("idSelector","[builtin #foo] { [error #foo] }"),r("tagSelectorUnclosed","[tag foo] { [property margin]: [number 0] } [tag bar] { }"),r("tagStringNoQuotes","[tag foo] { [property font-family]: [variable hello] [variable world]; }"),r("tagStringDouble",'[tag foo] { [property font-family]: [string "hello world"]; }'),r("tagStringSingle","[tag foo] { [property font-family]: [string 'hello world']; }"),r("tagColorKeyword","[tag foo] {"," [property color]: [keyword black];"," [property color]: [keyword navy];"," [property color]: [keyword yellow];","}"),r("tagColorHex3","[tag foo] { [property background]: [atom #fff]; }"),r("tagColorHex6","[tag foo] { [property background]: [atom #ffffff]; }"),r("tagColorHex4","[tag foo] { [property background]: [atom&error #ffff]; }"),r("tagColorHexInvalid","[tag foo] { [property background]: [atom&error #ffg]; }"),r("tagNegativeNumber","[tag foo] { [property margin]: [number -5px]; }"),r("tagPositiveNumber","[tag foo] { [property padding]: [number 5px]; }"),r("tagVendor","[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }"),r("tagBogusProperty","[tag foo] { [property&error barhelloworld]: [number 0]; }"),r("tagTwoProperties","[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }"),r("tagTwoPropertiesURL","[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }"),r("commentSGML","[comment ]"),r("commentSGML2","[comment ] [tag div] {}"),r("indent_tagSelector","[tag strong], [tag em] {"," [property background]: [atom rgba]("," [number 255], [number 255], [number 0], [number .2]"," );","}"),r("indent_atMedia","[def @media] {"," [tag foo] {"," [property color]:"," [keyword yellow];"," }","}"),r("indent_comma","[tag foo] {"," [property font-family]: [variable verdana],"," [atom sans-serif];","}"),r("indent_parentheses","[tag foo]:[variable-3 before] {"," [property background]: [atom url](","[string blahblah]","[string etc]","[string ]) [keyword !important];","}"),r("font_face","[def @font-face] {"," [property font-family]: [string 'myfont'];"," [error nonsense]: [string 'abc'];"," [property src]: [atom url]([string http://blah]),"," [atom url]([string http://foo]);","}"),r("empty_url","[def @import] [tag url]() [tag screen];"),r("parens","[qualifier .foo] {"," [property background-image]: [variable fade]([atom #000], [number 20%]);"," [property border-image]: [atom linear-gradient]("," [atom to] [atom bottom],"," [variable fade]([atom #000], [number 20%]) [number 0%],"," [variable fade]([atom #000], [number 20%]) [number 100%]"," );","}"),r("css_variable",":[variable-3 root] {"," [variable-2 --main-color]: [atom #06c];","}","[tag h1][builtin #foo] {"," [property color]: [atom var]([variable-2 --main-color]);","}"),r("supports","[def @supports] ([keyword not] (([property text-align-last]: [atom justify]) [keyword or] ([meta -moz-][property text-align-last]: [atom justify])) {"," [property text-align-last]: [atom justify];","}"),r("document","[def @document] [tag url]([string http://blah]),"," [tag url-prefix]([string https://]),"," [tag domain]([string blah.com]),",' [tag regexp]([string ".*blah.+"]) {'," [builtin #id] {"," [property background-color]: [keyword white];"," }"," [tag foo] {"," [property font-family]: [variable Verdana], [atom sans-serif];"," }"," }"),r("document_url","[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }"),r("document_urlPrefix","[def @document] [tag url-prefix]([string https://]) { [builtin #id] { } }"),r("document_domain","[def @document] [tag domain]([string blah.com]) { [tag foo] { } }"),r("document_regexp",'[def @document] [tag regexp]([string ".*blah.+"]) { [builtin #id] { } }'),r("counter-style","[def @counter-style] [variable binary] {"," [property system]: [atom numeric];"," [property symbols]: [number 0] [number 1];",' [property suffix]: [string "."];'," [property range]: [atom infinite];"," [property speak-as]: [atom numeric];","}"),r("counter-style-additive-symbols","[def @counter-style] [variable simple-roman] {"," [property system]: [atom additive];"," [property additive-symbols]: [number 10] [variable X], [number 5] [variable V], [number 1] [variable I];"," [property range]: [number 1] [number 49];","}"),r("counter-style-use","[tag ol][qualifier .roman] { [property list-style]: [variable simple-roman]; }"),r("counter-style-symbols",'[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string "*"] [string "\\2020"] [string "\\2021"] [string "\\A7"]); }')}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/cypher/cypher.js b/media/editors/codemirror/mode/cypher/cypher.js -index 9decf30..e218d47 100644 ---- a/media/editors/codemirror/mode/cypher/cypher.js -+++ b/media/editors/codemirror/mode/cypher/cypher.js -@@ -19,7 +19,7 @@ - - CodeMirror.defineMode("cypher", function(config) { - var tokenBase = function(stream/*, state*/) { -- var ch = stream.next(), curPunc = null; -+ var ch = stream.next(); - if (ch === "\"" || ch === "'") { - stream.match(/.+?["']/); - return "string"; -diff --git a/media/editors/codemirror/mode/cypher/cypher.min.js b/media/editors/codemirror/mode/cypher/cypher.min.js -index ec5b3cd..ec9c8ea 100644 ---- a/media/editors/codemirror/mode/cypher/cypher.min.js -+++ b/media/editors/codemirror/mode/cypher/cypher.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=function(e){return new RegExp("^(?:"+e.join("|")+")$","i")};e.defineMode("cypher",function(n){var r,i=function(e){var t=e.next(),n=null;if('"'===t||"'"===t)return e.match(/.+?["']/),"string";if(/[{}\(\),\.;\[\]]/.test(t))return n=t,"node";if("/"===t&&e.eat("/"))return e.skipToEnd(),"comment";if(u.test(t))return e.eatWhile(u),null;if(e.eatWhile(/[_\w\d]/),e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var r=e.current();return l.test(r)?"builtin":s.test(r)?"def":d.test(r)?"keyword":"variable"},o=function(e,t,n){return e.context={prev:e.context,indent:e.indent,col:n,type:t}},a=function(e){return e.indent=e.context.indent,e.context=e.context.prev},c=n.indentUnit,l=t(["abs","acos","allShortestPaths","asin","atan","atan2","avg","ceil","coalesce","collect","cos","cot","count","degrees","e","endnode","exp","extract","filter","floor","haversin","head","id","keys","labels","last","left","length","log","log10","lower","ltrim","max","min","node","nodes","percentileCont","percentileDisc","pi","radians","rand","range","reduce","rel","relationship","relationships","replace","right","round","rtrim","shortestPath","sign","sin","split","sqrt","startnode","stdev","stdevp","str","substring","sum","tail","tan","timestamp","toFloat","toInt","trim","type","upper"]),s=t(["all","and","any","has","in","none","not","or","single","xor"]),d=t(["as","asc","ascending","assert","by","case","commit","constraint","create","csv","cypher","delete","desc","descending","distinct","drop","else","end","explain","false","fieldterminator","foreach","from","headers","in","index","is","limit","load","match","merge","null","on","optional","order","periodic","profile","remove","return","scan","set","skip","start","then","true","union","unique","unwind","using","when","where","with"]),u=/[*+\-<>=&|~%^]/;return{startState:function(){return{tokenize:i,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"!==n&&t.context&&null==t.context.align&&"pattern"!==t.context.type&&(t.context.align=!0),"("===r)o(t,")",e.column());else if("["===r)o(t,"]",e.column());else if("{"===r)o(t,"}",e.column());else if(/[\]\}\)]/.test(r)){for(;t.context&&"pattern"===t.context.type;)a(t);t.context&&r===t.context.type&&a(t)}else"."===r&&t.context&&"pattern"===t.context.type?a(t):/atom|string|variable/.test(n)&&t.context&&(/[\}\]]/.test(t.context.type)?o(t,"pattern",e.column()):"pattern"!==t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return n},indent:function(t,n){var r=n&&n.charAt(0),i=t.context;if(/[\]\}]/.test(r))for(;i&&"pattern"===i.type;)i=i.prev;var o=i&&r===i.type;return i?"keywords"===i.type?e.commands.newlineAndIndent:i.align?i.col+(o?0:1):i.indent+(o?0:c):0}}}),e.modeExtensions.cypher={autoFormatLineBreaks:function(e){for(var t,n,r,n=e.split("\n"),r=/\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g,t=0;t=&|~%^]/;return{startState:function(){return{tokenize:e,context:null,indent:0,col:0}},token:function(a,b){if(a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);if("comment"!==c&&b.context&&null==b.context.align&&"pattern"!==b.context.type&&(b.context.align=!0),"("===d)f(b,")",a.column());else if("["===d)f(b,"]",a.column());else if("{"===d)f(b,"}",a.column());else if(/[\]\}\)]/.test(d)){for(;b.context&&"pattern"===b.context.type;)g(b);b.context&&d===b.context.type&&g(b)}else"."===d&&b.context&&"pattern"===b.context.type?g(b):/atom|string|variable/.test(c)&&b.context&&(/[\}\]]/.test(b.context.type)?f(b,"pattern",a.column()):"pattern"!==b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return c},indent:function(b,c){var d=c&&c.charAt(0),e=b.context;if(/[\]\}]/.test(d))for(;e&&"pattern"===e.type;)e=e.prev;var f=e&&d===e.type;return e?"keywords"===e.type?a.commands.newlineAndIndent:e.align?e.col+(f?0:1):e.indent+(f?0:h):0}}}),a.modeExtensions.cypher={autoFormatLineBreaks:function(a){for(var b,c,d,c=a.split("\n"),d=/\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g,b=0;b!?|\/]/;return{startState:function(e){return{tokenize:null,context:new u((e||0)-f,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;c=null;var i=(t.tokenize||r)(e,t);if("comment"==i||"meta"==i)return i;if(null==n.align&&(n.align=!0),";"!=c&&":"!=c&&","!=c||"statement"!=n.type)if("{"==c)l(t,e.column(),"}");else if("["==c)l(t,e.column(),"]");else if("("==c)l(t,e.column(),")");else if("}"==c){for(;"statement"==n.type;)n=s(t);for("}"==n.type&&(n=s(t));"statement"==n.type;)n=s(t)}else c==n.type?s(t):(("}"==n.type||"top"==n.type)&&";"!=c||"statement"==n.type&&"newstatement"==c)&&l(t,e.column(),"statement");else s(t);return t.startOfLine=!1,i},indent:function(t,n){if(t.tokenize!=r&&null!=t.tokenize)return e.Pass;var i=t.context,o=n&&n.charAt(0);"statement"==i.type&&"}"==o&&(i=i.prev);var a=o==i.type;return"statement"==i.type?i.indented+("{"==o?0:d):i.align?i.column+(a?0:1):i.indented+(a?0:f)},electricChars:"{}"}});var n="body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with";e.defineMIME("text/x-d",{name:"d",keywords:t("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters "+n),blockKeywords:t(n),builtin:t("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t"),atoms:t("exit failure success true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}}})}); -\ 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){for(var b={},c=a.split(" "),d=0;d!?|\/]/;return{startState:function(a){return{tokenize:null,context:new h((a||0)-l,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;k=null;var e=(b.tokenize||d)(a,b);if("comment"==e||"meta"==e)return e;if(null==c.align&&(c.align=!0),";"!=k&&":"!=k&&","!=k||"statement"!=c.type)if("{"==k)i(b,a.column(),"}");else if("["==k)i(b,a.column(),"]");else if("("==k)i(b,a.column(),")");else if("}"==k){for(;"statement"==c.type;)c=j(b);for("}"==c.type&&(c=j(b));"statement"==c.type;)c=j(b)}else k==c.type?j(b):(("}"==c.type||"top"==c.type)&&";"!=k||"statement"==c.type&&"newstatement"==k)&&i(b,a.column(),"statement");else j(b);return b.startOfLine=!1,e},indent:function(b,c){if(b.tokenize!=d&&null!=b.tokenize)return a.Pass;var e=b.context,f=c&&c.charAt(0);"statement"==e.type&&"}"==f&&(e=e.prev);var g=f==e.type;return"statement"==e.type?e.indented+("{"==f?0:m):e.align?e.column+(g?0:1):e.indented+(g?0:l)},electricChars:"{}"}});var c="body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with";a.defineMIME("text/x-d",{name:"d",keywords:b("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters "+c),blockKeywords:b(c),builtin:b("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t"),atoms:b("exit failure success true false null"),hooks:{"@":function(a,b){return a.eatWhile(/[\w\$_]/),"meta"}}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/dart/dart.min.js b/media/editors/codemirror/mode/dart/dart.min.js -index dc9c335..5e5f1ed 100644 ---- a/media/editors/codemirror/mode/dart/dart.min.js -+++ b/media/editors/codemirror/mode/dart/dart.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},i=0;i", "<=", ">=", "in", "not", "or", "and"]; - -+ keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b"); -+ filters = new RegExp("^\\b(" + filters.join("|") + ")\\b"); -+ operators = new RegExp("^\\b(" + operators.join("|") + ")\\b"); -+ -+ // We have to return "null" instead of null, in order to avoid string -+ // styling as the default, when using Django templates inside HTML -+ // element attributes - function tokenBase (stream, state) { -- stream.eatWhile(/[^\{]/); -- var ch = stream.next(); -- if (ch == "{") { -- if (ch = stream.eat(/\{|%|#/)) { -- state.tokenize = inTag(ch); -- return "tag"; -+ // Attempt to identify a variable, template or comment tag respectively -+ if (stream.match("{{")) { -+ state.tokenize = inVariable; -+ return "tag"; -+ } else if (stream.match("{%")) { -+ state.tokenize = inTag; -+ return "tag"; -+ } else if (stream.match("{#")) { -+ state.tokenize = inComment; -+ return "comment"; -+ } -+ -+ // Ignore completely any stream series that do not match the -+ // Django template opening tags. -+ while (stream.next() != null && !stream.match("{{", false) && !stream.match("{%", false)) {} -+ return null; -+ } -+ -+ // A string can be included in either single or double quotes (this is -+ // the delimeter). Mark everything as a string until the start delimeter -+ // occurs again. -+ function inString (delimeter, previousTokenizer) { -+ return function (stream, state) { -+ if (!state.escapeNext && stream.eat(delimeter)) { -+ state.tokenize = previousTokenizer; -+ } else { -+ if (state.escapeNext) { -+ state.escapeNext = false; -+ } -+ -+ var ch = stream.next(); -+ -+ // Take into account the backslash for escaping characters, such as -+ // the string delimeter. -+ if (ch == "\\") { -+ state.escapeNext = true; -+ } -+ } -+ -+ return "string"; -+ }; -+ } -+ -+ // Apply Django template variable syntax highlighting -+ function inVariable (stream, state) { -+ // Attempt to match a dot that precedes a property -+ if (state.waitDot) { -+ state.waitDot = false; -+ -+ if (stream.peek() != ".") { -+ return "null"; -+ } -+ -+ // Dot folowed by a non-word character should be considered an error. -+ if (stream.match(/\.\W+/)) { -+ return "error"; -+ } else if (stream.eat(".")) { -+ state.waitProperty = true; -+ return "null"; -+ } else { -+ throw Error ("Unexpected error while waiting for property."); -+ } -+ } -+ -+ // Attempt to match a pipe that precedes a filter -+ if (state.waitPipe) { -+ state.waitPipe = false; -+ -+ if (stream.peek() != "|") { -+ return "null"; -+ } -+ -+ // Pipe folowed by a non-word character should be considered an error. -+ if (stream.match(/\.\W+/)) { -+ return "error"; -+ } else if (stream.eat("|")) { -+ state.waitFilter = true; -+ return "null"; -+ } else { -+ throw Error ("Unexpected error while waiting for filter."); -+ } -+ } -+ -+ // Highlight properties -+ if (state.waitProperty) { -+ state.waitProperty = false; -+ if (stream.match(/\b(\w+)\b/)) { -+ state.waitDot = true; // A property can be followed by another property -+ state.waitPipe = true; // A property can be followed by a filter -+ return "property"; - } - } -+ -+ // Highlight filters -+ if (state.waitFilter) { -+ state.waitFilter = false; -+ if (stream.match(filters)) { -+ return "variable-2"; -+ } -+ } -+ -+ // Ignore all white spaces -+ if (stream.eatSpace()) { -+ state.waitProperty = false; -+ return "null"; -+ } -+ -+ // Identify numbers -+ if (stream.match(/\b\d+(\.\d+)?\b/)) { -+ return "number"; -+ } -+ -+ // Identify strings -+ if (stream.match("'")) { -+ state.tokenize = inString("'", state.tokenize); -+ return "string"; -+ } else if (stream.match('"')) { -+ state.tokenize = inString('"', state.tokenize); -+ return "string"; -+ } -+ -+ // Attempt to find the variable -+ if (stream.match(/\b(\w+)\b/) && !state.foundVariable) { -+ state.waitDot = true; -+ state.waitPipe = true; // A property can be followed by a filter -+ return "variable"; -+ } -+ -+ // If found closing tag reset -+ if (stream.match("}}")) { -+ state.waitProperty = null; -+ state.waitFilter = null; -+ state.waitDot = null; -+ state.waitPipe = null; -+ state.tokenize = tokenBase; -+ return "tag"; -+ } -+ -+ // If nothing was found, advance to the next character -+ stream.next(); -+ return "null"; - } -- function inTag (close) { -- if (close == "{") { -- close = "}"; -+ -+ function inTag (stream, state) { -+ // Attempt to match a dot that precedes a property -+ if (state.waitDot) { -+ state.waitDot = false; -+ -+ if (stream.peek() != ".") { -+ return "null"; -+ } -+ -+ // Dot folowed by a non-word character should be considered an error. -+ if (stream.match(/\.\W+/)) { -+ return "error"; -+ } else if (stream.eat(".")) { -+ state.waitProperty = true; -+ return "null"; -+ } else { -+ throw Error ("Unexpected error while waiting for property."); -+ } - } -- return function (stream, state) { -- var ch = stream.next(); -- if ((ch == close) && stream.eat("}")) { -- state.tokenize = tokenBase; -- return "tag"; -+ -+ // Attempt to match a pipe that precedes a filter -+ if (state.waitPipe) { -+ state.waitPipe = false; -+ -+ if (stream.peek() != "|") { -+ return "null"; - } -- if (stream.match(keywords)) { -- return "keyword"; -+ -+ // Pipe folowed by a non-word character should be considered an error. -+ if (stream.match(/\.\W+/)) { -+ return "error"; -+ } else if (stream.eat("|")) { -+ state.waitFilter = true; -+ return "null"; -+ } else { -+ throw Error ("Unexpected error while waiting for filter."); - } -- return close == "#" ? "comment" : "string"; -- }; -+ } -+ -+ // Highlight properties -+ if (state.waitProperty) { -+ state.waitProperty = false; -+ if (stream.match(/\b(\w+)\b/)) { -+ state.waitDot = true; // A property can be followed by another property -+ state.waitPipe = true; // A property can be followed by a filter -+ return "property"; -+ } -+ } -+ -+ // Highlight filters -+ if (state.waitFilter) { -+ state.waitFilter = false; -+ if (stream.match(filters)) { -+ return "variable-2"; -+ } -+ } -+ -+ // Ignore all white spaces -+ if (stream.eatSpace()) { -+ state.waitProperty = false; -+ return "null"; -+ } -+ -+ // Identify numbers -+ if (stream.match(/\b\d+(\.\d+)?\b/)) { -+ return "number"; -+ } -+ -+ // Identify strings -+ if (stream.match("'")) { -+ state.tokenize = inString("'", state.tokenize); -+ return "string"; -+ } else if (stream.match('"')) { -+ state.tokenize = inString('"', state.tokenize); -+ return "string"; -+ } -+ -+ // Attempt to match an operator -+ if (stream.match(operators)) { -+ return "operator"; -+ } -+ -+ // Attempt to match a keyword -+ var keywordMatch = stream.match(keywords); -+ if (keywordMatch) { -+ if (keywordMatch[0] == "comment") { -+ state.blockCommentTag = true; -+ } -+ return "keyword"; -+ } -+ -+ // Attempt to match a variable -+ if (stream.match(/\b(\w+)\b/)) { -+ state.waitDot = true; -+ state.waitPipe = true; // A property can be followed by a filter -+ return "variable"; -+ } -+ -+ // If found closing tag reset -+ if (stream.match("%}")) { -+ state.waitProperty = null; -+ state.waitFilter = null; -+ state.waitDot = null; -+ state.waitPipe = null; -+ // If the tag that closes is a block comment tag, we want to mark the -+ // following code as comment, until the tag closes. -+ if (state.blockCommentTag) { -+ state.blockCommentTag = false; // Release the "lock" -+ state.tokenize = inBlockComment; -+ } else { -+ state.tokenize = tokenBase; -+ } -+ return "tag"; -+ } -+ -+ // If nothing was found, advance to the next character -+ stream.next(); -+ return "null"; -+ } -+ -+ // Mark everything as comment inside the tag and the tag itself. -+ function inComment (stream, state) { -+ if (stream.match("#}")) { -+ state.tokenize = tokenBase; -+ } -+ return "comment"; -+ } -+ -+ // Mark everything as a comment until the `blockcomment` tag closes. -+ function inBlockComment (stream, state) { -+ if (stream.match(/\{%\s*endcomment\s*%\}/, false)) { -+ state.tokenize = inTag; -+ stream.match("{%"); -+ return "tag"; -+ } else { -+ stream.next(); -+ return "comment"; -+ } - } -+ - return { - startState: function () { - return {tokenize: tokenBase}; - }, - token: function (stream, state) { - return state.tokenize(stream, state); -- } -+ }, -+ blockCommentStart: "{% comment %}", -+ blockCommentEnd: "{% endcomment %}" - }; - }); - -diff --git a/media/editors/codemirror/mode/django/django.min.js b/media/editors/codemirror/mode/django/django.min.js -index 6d6aa79..9f0ba66 100644 ---- a/media/editors/codemirror/mode/django/django.min.js -+++ b/media/editors/codemirror/mode/django/django.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("django:inner",function(){function e(e,t){e.eatWhile(/[^\{]/);var o=e.next();return"{"==o&&(o=e.eat(/\{|%|#/))?(t.tokenize=n(o),"tag"):void 0}function n(n){return"{"==n&&(n="}"),function(o,i){var r=o.next();return r==n&&o.eat("}")?(i.tokenize=e,"tag"):o.match(t)?"keyword":"#"==n?"comment":"string"}}var t=["block","endblock","for","endfor","in","true","false","loop","none","self","super","if","endif","as","not","and","else","import","with","endwith","without","context","ifequal","endifequal","ifnotequal","endifnotequal","extends","include","load","length","comment","endcomment","empty"];return t=new RegExp("^(("+t.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,n){return n.tokenize(e,n)}}}),e.defineMode("django",function(n){var t=e.getMode(n,"text/html"),o=e.getMode(n,"django:inner");return e.overlayMode(t,o)}),e.defineMIME("text/x-django","django")}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("django:inner",function(){function a(a,b){if(a.match("{{"))return b.tokenize=c,"tag";if(a.match("{%"))return b.tokenize=d,"tag";if(a.match("{#"))return b.tokenize=e,"comment";for(;null!=a.next()&&!a.match("{{",!1)&&!a.match("{%",!1););return null}function b(a,b){return function(c,d){if(!d.escapeNext&&c.eat(a))d.tokenize=b;else{d.escapeNext&&(d.escapeNext=!1);var e=c.next();"\\"==e&&(d.escapeNext=!0)}return"string"}}function c(c,d){if(d.waitDot){if(d.waitDot=!1,"."!=c.peek())return"null";if(c.match(/\.\W+/))return"error";if(c.eat("."))return d.waitProperty=!0,"null";throw Error("Unexpected error while waiting for property.")}if(d.waitPipe){if(d.waitPipe=!1,"|"!=c.peek())return"null";if(c.match(/\.\W+/))return"error";if(c.eat("|"))return d.waitFilter=!0,"null";throw Error("Unexpected error while waiting for filter.")}return d.waitProperty&&(d.waitProperty=!1,c.match(/\b(\w+)\b/))?(d.waitDot=!0,d.waitPipe=!0,"property"):d.waitFilter&&(d.waitFilter=!1,c.match(h))?"variable-2":c.eatSpace()?(d.waitProperty=!1,"null"):c.match(/\b\d+(\.\d+)?\b/)?"number":c.match("'")?(d.tokenize=b("'",d.tokenize),"string"):c.match('"')?(d.tokenize=b('"',d.tokenize),"string"):c.match(/\b(\w+)\b/)&&!d.foundVariable?(d.waitDot=!0,d.waitPipe=!0,"variable"):c.match("}}")?(d.waitProperty=null,d.waitFilter=null,d.waitDot=null,d.waitPipe=null,d.tokenize=a,"tag"):(c.next(),"null")}function d(c,d){if(d.waitDot){if(d.waitDot=!1,"."!=c.peek())return"null";if(c.match(/\.\W+/))return"error";if(c.eat("."))return d.waitProperty=!0,"null";throw Error("Unexpected error while waiting for property.")}if(d.waitPipe){if(d.waitPipe=!1,"|"!=c.peek())return"null";if(c.match(/\.\W+/))return"error";if(c.eat("|"))return d.waitFilter=!0,"null";throw Error("Unexpected error while waiting for filter.")}if(d.waitProperty&&(d.waitProperty=!1,c.match(/\b(\w+)\b/)))return d.waitDot=!0,d.waitPipe=!0,"property";if(d.waitFilter&&(d.waitFilter=!1,c.match(h)))return"variable-2";if(c.eatSpace())return d.waitProperty=!1,"null";if(c.match(/\b\d+(\.\d+)?\b/))return"number";if(c.match("'"))return d.tokenize=b("'",d.tokenize),"string";if(c.match('"'))return d.tokenize=b('"',d.tokenize),"string";if(c.match(i))return"operator";var e=c.match(g);return e?("comment"==e[0]&&(d.blockCommentTag=!0),"keyword"):c.match(/\b(\w+)\b/)?(d.waitDot=!0,d.waitPipe=!0,"variable"):c.match("%}")?(d.waitProperty=null,d.waitFilter=null,d.waitDot=null,d.waitPipe=null,d.blockCommentTag?(d.blockCommentTag=!1,d.tokenize=f):d.tokenize=a,"tag"):(c.next(),"null")}function e(b,c){return b.match("#}")&&(c.tokenize=a),"comment"}function f(a,b){return a.match(/\{%\s*endcomment\s*%\}/,!1)?(b.tokenize=d,a.match("{%"),"tag"):(a.next(),"comment")}var g=["block","endblock","for","endfor","true","false","loop","none","self","super","if","endif","as","else","import","with","endwith","without","context","ifequal","endifequal","ifnotequal","endifnotequal","extends","include","load","comment","endcomment","empty","url","static","trans","blocktrans","now","regroup","lorem","ifchanged","endifchanged","firstof","debug","cycle","csrf_token","autoescape","endautoescape","spaceless","ssi","templatetag","verbatim","endverbatim","widthratio"],h=["add","addslashes","capfirst","center","cut","date","default","default_if_none","dictsort","dictsortreversed","divisibleby","escape","escapejs","filesizeformat","first","floatformat","force_escape","get_digit","iriencode","join","last","length","length_is","linebreaks","linebreaksbr","linenumbers","ljust","lower","make_list","phone2numeric","pluralize","pprint","random","removetags","rjust","safe","safeseq","slice","slugify","stringformat","striptags","time","timesince","timeuntil","title","truncatechars","truncatechars_html","truncatewords","truncatewords_html","unordered_list","upper","urlencode","urlize","urlizetrunc","wordcount","wordwrap","yesno"],i=["==","!=","<",">","<=",">=","in","not","or","and"];return g=new RegExp("^\\b("+g.join("|")+")\\b"),h=new RegExp("^\\b("+h.join("|")+")\\b"),i=new RegExp("^\\b("+i.join("|")+")\\b"),{startState:function(){return{tokenize:a}},token:function(a,b){return b.tokenize(a,b)},blockCommentStart:"{% comment %}",blockCommentEnd:"{% endcomment %}"}}),a.defineMode("django",function(b){var c=a.getMode(b,"text/html"),d=a.getMode(b,"django:inner");return a.overlayMode(c,d)}),a.defineMIME("text/x-django","django")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/dockerfile/dockerfile.min.js b/media/editors/codemirror/mode/dockerfile/dockerfile.min.js -index 609af6f..13ef61e 100644 ---- a/media/editors/codemirror/mode/dockerfile/dockerfile.min.js -+++ b/media/editors/codemirror/mode/dockerfile/dockerfile.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],e):e(CodeMirror)}(function(e){"use strict";var n=["from","maintainer","run","cmd","expose","env","add","copy","entrypoint","volume","user","workdir","onbuild"],r="("+n.join("|")+")",o=new RegExp(r+"\\s*$","i"),t=new RegExp(r+"(\\s+)","i");e.defineSimpleMode("dockerfile",{start:[{regex:/#.*$/,token:"comment"},{regex:o,token:"variable-2"},{regex:t,token:["variable-2",null],next:"arguments"},{regex:/./,token:null}],arguments:[{regex:/#.*$/,token:"error",next:"start"},{regex:/[^#]+\\$/,token:null},{regex:/[^#]+/,token:null,next:"start"},{regex:/$/,token:null,next:"start"},{token:null,next:"start"}]}),e.defineMIME("text/x-dockerfile","dockerfile")}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],a):a(CodeMirror)}(function(a){"use strict";var b=["from","maintainer","run","cmd","expose","env","add","copy","entrypoint","volume","user","workdir","onbuild"],c="("+b.join("|")+")",d=new RegExp(c+"\\s*$","i"),e=new RegExp(c+"(\\s+)","i");a.defineSimpleMode("dockerfile",{start:[{regex:/#.*$/,token:"comment"},{regex:d,token:"variable-2"},{regex:e,token:["variable-2",null],next:"arguments"},{regex:/./,token:null}],arguments:[{regex:/#.*$/,token:"error",next:"start"},{regex:/[^#]+\\$/,token:null},{regex:/[^#]+/,token:null,next:"start"},{regex:/$/,token:null,next:"start"},{token:null,next:"start"}]}),a.defineMIME("text/x-dockerfile","dockerfile")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/dtd/dtd.min.js b/media/editors/codemirror/mode/dtd/dtd.min.js -index 5ebf52c..4197455 100644 ---- a/media/editors/codemirror/mode/dtd/dtd.min.js -+++ b/media/editors/codemirror/mode/dtd/dtd.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("dtd",function(t){function e(t,e){return a=e,t}function n(t,n){var a=t.next();if("<"!=a||!t.eat("!")){if("<"==a&&t.eat("?"))return n.tokenize=u("meta","?>"),e("meta",a);if("#"==a&&t.eatWhile(/[\w]/))return e("atom","tag");if("|"==a)return e("keyword","seperator");if(a.match(/[\(\)\[\]\-\.,\+\?>]/))return e(null,a);if(a.match(/[\[\]]/))return e("rule",a);if('"'==a||"'"==a)return n.tokenize=i(a),n.tokenize(t,n);if(t.eatWhile(/[a-zA-Z\?\+\d]/)){var o=t.current();return null!==o.substr(o.length-1,o.length).match(/\?|\+/)&&t.backUp(1),e("tag","tag")}return"%"==a||"*"==a?e("number","number"):(t.eatWhile(/[\w\\\-_%.{,]/),e(null,null))}return t.eatWhile(/[\-]/)?(n.tokenize=r,r(t,n)):t.eatWhile(/[\w]/)?e("keyword","doindent"):void 0}function r(t,r){for(var i,u=0;null!=(i=t.next());){if(u>=2&&">"==i){r.tokenize=n;break}u="-"==i?u+1:0}return e("comment","comment")}function i(t){return function(r,i){for(var u,a=!1;null!=(u=r.next());){if(u==t&&!a){i.tokenize=n;break}a=!a&&"\\"==u}return e("string","tag")}}function u(t,e){return function(r,i){for(;!r.eol();){if(r.match(e)){i.tokenize=n;break}r.next()}return t}}var a,o=t.indentUnit;return{startState:function(t){return{tokenize:n,baseIndent:t||0,stack:[]}},token:function(t,e){if(t.eatSpace())return null;var n=e.tokenize(t,e),r=e.stack[e.stack.length-1];return"["==t.current()||"doindent"===a||"["==a?e.stack.push("rule"):"endtag"===a?e.stack[e.stack.length-1]="endtag":"]"==t.current()||"]"==a||">"==a&&"rule"==r?e.stack.pop():"["==a&&e.stack.push("["),n},indent:function(t,e){var n=t.stack.length;return e.match(/\]\s+|\]/)?n-=1:">"===e.substr(e.length-1,e.length)&&("<"===e.substr(0,1)||"doindent"==a&&e.length>1||("doindent"==a?n--:">"==a&&e.length>1||"tag"==a&&">"!==e||("tag"==a&&"rule"==t.stack[t.stack.length-1]?n--:"tag"==a?n++:">"===e&&"rule"==t.stack[t.stack.length-1]&&">"===a?n--:">"===e&&"rule"==t.stack[t.stack.length-1]||("<"!==e.substr(0,1)&&">"===e.substr(0,1)?n-=1:">"===e||(n-=1)))),(null==a||"]"==a)&&n--),t.baseIndent+n*o},electricChars:"]>"}}),t.defineMIME("application/xml-dtd","dtd")}); -\ 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("dtd",function(a){function b(a,b){return g=b,a}function c(a,c){var g=a.next();if("<"!=g||!a.eat("!")){if("<"==g&&a.eat("?"))return c.tokenize=f("meta","?>"),b("meta",g);if("#"==g&&a.eatWhile(/[\w]/))return b("atom","tag");if("|"==g)return b("keyword","seperator");if(g.match(/[\(\)\[\]\-\.,\+\?>]/))return b(null,g);if(g.match(/[\[\]]/))return b("rule",g);if('"'==g||"'"==g)return c.tokenize=e(g),c.tokenize(a,c);if(a.eatWhile(/[a-zA-Z\?\+\d]/)){var h=a.current();return null!==h.substr(h.length-1,h.length).match(/\?|\+/)&&a.backUp(1),b("tag","tag")}return"%"==g||"*"==g?b("number","number"):(a.eatWhile(/[\w\\\-_%.{,]/),b(null,null))}return a.eatWhile(/[\-]/)?(c.tokenize=d,d(a,c)):a.eatWhile(/[\w]/)?b("keyword","doindent"):void 0}function d(a,d){for(var e,f=0;null!=(e=a.next());){if(f>=2&&">"==e){d.tokenize=c;break}f="-"==e?f+1:0}return b("comment","comment")}function e(a){return function(d,e){for(var f,g=!1;null!=(f=d.next());){if(f==a&&!g){e.tokenize=c;break}g=!g&&"\\"==f}return b("string","tag")}}function f(a,b){return function(d,e){for(;!d.eol();){if(d.match(b)){e.tokenize=c;break}d.next()}return a}}var g,h=a.indentUnit;return{startState:function(a){return{tokenize:c,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b),d=b.stack[b.stack.length-1];return"["==a.current()||"doindent"===g||"["==g?b.stack.push("rule"):"endtag"===g?b.stack[b.stack.length-1]="endtag":"]"==a.current()||"]"==g||">"==g&&"rule"==d?b.stack.pop():"["==g&&b.stack.push("["),c},indent:function(a,b){var c=a.stack.length;return b.match(/\]\s+|\]/)?c-=1:">"===b.substr(b.length-1,b.length)&&("<"===b.substr(0,1)||"doindent"==g&&b.length>1||("doindent"==g?c--:">"==g&&b.length>1||"tag"==g&&">"!==b||("tag"==g&&"rule"==a.stack[a.stack.length-1]?c--:"tag"==g?c++:">"===b&&"rule"==a.stack[a.stack.length-1]&&">"===g?c--:">"===b&&"rule"==a.stack[a.stack.length-1]||("<"!==b.substr(0,1)&&">"===b.substr(0,1)?c-=1:">"===b||(c-=1)))),(null==g||"]"==g)&&c--),a.baseIndent+c*h},electricChars:"]>"}}),a.defineMIME("application/xml-dtd","dtd")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/dylan/dylan.js b/media/editors/codemirror/mode/dylan/dylan.js -index be2986a..85f0166 100644 ---- a/media/editors/codemirror/mode/dylan/dylan.js -+++ b/media/editors/codemirror/mode/dylan/dylan.js -@@ -154,20 +154,12 @@ CodeMirror.defineMode("dylan", function(_config) { - return f(stream, state); - } - -- var type, content; -- -- function ret(_type, style, _content) { -- type = _type; -- content = _content; -- return style; -- } -- - function tokenBase(stream, state) { - // String - var ch = stream.peek(); - if (ch == "'" || ch == '"') { - stream.next(); -- return chain(stream, state, tokenString(ch, "string", "string")); -+ return chain(stream, state, tokenString(ch, "string")); - } - // Comment - else if (ch == "/") { -@@ -176,16 +168,16 @@ CodeMirror.defineMode("dylan", function(_config) { - return chain(stream, state, tokenComment); - } else if (stream.eat("/")) { - stream.skipToEnd(); -- return ret("comment", "comment"); -+ return "comment"; - } else { - stream.skipTo(" "); -- return ret("operator", "operator"); -+ return "operator"; - } - } - // Decimal - else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/); -- return ret("number", "number"); -+ return "number"; - } - // Hash - else if (ch == "#") { -@@ -194,33 +186,33 @@ CodeMirror.defineMode("dylan", function(_config) { - ch = stream.peek(); - if (ch == '"') { - stream.next(); -- return chain(stream, state, tokenString('"', "symbol", "string-2")); -+ return chain(stream, state, tokenString('"', "string-2")); - } - // Binary number - else if (ch == "b") { - stream.next(); - stream.eatWhile(/[01]/); -- return ret("number", "number"); -+ return "number"; - } - // Hex number - else if (ch == "x") { - stream.next(); - stream.eatWhile(/[\da-f]/i); -- return ret("number", "number"); -+ return "number"; - } - // Octal number - else if (ch == "o") { - stream.next(); - stream.eatWhile(/[0-7]/); -- return ret("number", "number"); -+ return "number"; - } - // Hash symbol - else { - stream.eatWhile(/[-a-zA-Z]/); -- return ret("hash", "keyword"); -+ return "keyword"; - } - } else if (stream.match("end")) { -- return ret("end", "keyword"); -+ return "keyword"; - } - for (var name in patterns) { - if (patterns.hasOwnProperty(name)) { -@@ -228,21 +220,21 @@ CodeMirror.defineMode("dylan", function(_config) { - if ((pattern instanceof Array && pattern.some(function(p) { - return stream.match(p); - })) || stream.match(pattern)) -- return ret(name, patternStyles[name], stream.current()); -+ return patternStyles[name]; - } - } - if (stream.match("define")) { -- return ret("definition", "def"); -+ return "def"; - } else { - stream.eatWhile(/[\w\-]/); - // Keyword - if (wordLookup[stream.current()]) { -- return ret(wordLookup[stream.current()], styleLookup[stream.current()], stream.current()); -+ return styleLookup[stream.current()]; - } else if (stream.current().match(symbol)) { -- return ret("variable", "variable"); -+ return "variable"; - } else { - stream.next(); -- return ret("other", "variable-2"); -+ return "variable-2"; - } - } - } -@@ -257,10 +249,10 @@ CodeMirror.defineMode("dylan", function(_config) { - } - maybeEnd = (ch == "*"); - } -- return ret("comment", "comment"); -+ return "comment"; - } - -- function tokenString(quote, type, style) { -+ function tokenString(quote, style) { - return function(stream, state) { - var next, end = false; - while ((next = stream.next()) != null) { -@@ -271,7 +263,7 @@ CodeMirror.defineMode("dylan", function(_config) { - } - if (end) - state.tokenize = tokenBase; -- return ret(type, style); -+ return style; - }; - } - -diff --git a/media/editors/codemirror/mode/dylan/dylan.min.js b/media/editors/codemirror/mode/dylan/dylan.min.js -index 2abfa10..550880b 100644 ---- a/media/editors/codemirror/mode/dylan/dylan.min.js -+++ b/media/editors/codemirror/mode/dylan/dylan.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("dylan",function(){function e(e,n,t){return n.tokenize=t,t(e,n)}function n(e,n,t){return b=e,p=t,n}function t(t,o){var a=t.peek();if("'"==a||'"'==a)return t.next(),e(t,o,r(a,"string","string"));if("/"==a)return t.next(),t.eat("*")?e(t,o,i):t.eat("/")?(t.skipToEnd(),n("comment","comment")):(t.skipTo(" "),n("operator","operator"));if(/\d/.test(a))return t.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/),n("number","number");if("#"==a)return t.next(),a=t.peek(),'"'==a?(t.next(),e(t,o,r('"',"symbol","string-2"))):"b"==a?(t.next(),t.eatWhile(/[01]/),n("number","number")):"x"==a?(t.next(),t.eatWhile(/[\da-f]/i),n("number","number")):"o"==a?(t.next(),t.eatWhile(/[0-7]/),n("number","number")):(t.eatWhile(/[-a-zA-Z]/),n("hash","keyword"));if(t.match("end"))return n("end","keyword");for(var m in c)if(c.hasOwnProperty(m)){var u=c[m];if(u instanceof Array&&u.some(function(e){return t.match(e)})||t.match(u))return n(m,f[m],t.current())}return t.match("define")?n("definition","def"):(t.eatWhile(/[\w\-]/),s[t.current()]?n(s[t.current()],d[t.current()],t.current()):t.current().match(l)?n("variable","variable"):(t.next(),n("other","variable-2")))}function i(e,i){for(var r,o=!1;r=e.next();){if("/"==r&&o){i.tokenize=t;break}o="*"==r}return n("comment","comment")}function r(e,i,r){return function(o,a){for(var l,c=!1;null!=(l=o.next());)if(l==e){c=!0;break}return c&&(a.tokenize=t),n(i,r)}}var o={unnamedDefinition:["interface"],namedDefinition:["module","library","macro","C-struct","C-union","C-function","C-callable-wrapper"],typeParameterizedDefinition:["class","C-subtype","C-mapped-subtype"],otherParameterizedDefinition:["method","function","C-variable","C-address"],constantSimpleDefinition:["constant"],variableSimpleDefinition:["variable"],otherSimpleDefinition:["generic","domain","C-pointer-type","table"],statement:["if","block","begin","method","case","for","select","when","unless","until","while","iterate","profiling","dynamic-bind"],separator:["finally","exception","cleanup","else","elseif","afterwards"],other:["above","below","by","from","handler","in","instance","let","local","otherwise","slot","subclass","then","to","keyed-by","virtual"],signalingCalls:["signal","error","cerror","break","check-type","abort"]};o.otherDefinition=o.unnamedDefinition.concat(o.namedDefinition).concat(o.otherParameterizedDefinition),o.definition=o.typeParameterizedDefinition.concat(o.otherDefinition),o.parameterizedDefinition=o.typeParameterizedDefinition.concat(o.otherParameterizedDefinition),o.simpleDefinition=o.constantSimpleDefinition.concat(o.variableSimpleDefinition).concat(o.otherSimpleDefinition),o.keyword=o.statement.concat(o.separator).concat(o.other);var a="[-_a-zA-Z?!*@<>$%]+",l=new RegExp("^"+a),c={symbolKeyword:a+":",symbolClass:"<"+a+">",symbolGlobal:"\\*"+a+"\\*",symbolConstant:"\\$"+a},f={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variable-2",symbolConstant:"variable-3"};for(var m in c)c.hasOwnProperty(m)&&(c[m]=new RegExp("^"+c[m]));c.keyword=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var u={};u.keyword="keyword",u.definition="def",u.simpleDefinition="def",u.signalingCalls="builtin";var s={},d={};["keyword","definition","simpleDefinition","signalingCalls"].forEach(function(e){o[e].forEach(function(n){s[n]=e,d[n]=u[e]})});var b,p;return{startState:function(){return{tokenize:t,currentIndent:0}},token:function(e,n){if(e.eatSpace())return null;var t=n.tokenize(e,n);return t},blockCommentStart:"/*",blockCommentEnd:"*/"}}),e.defineMIME("text/x-dylan","dylan")}); -\ 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("dylan",function(a){function b(a,b,c){return b.tokenize=c,c(a,b)}function c(a,c){var f=a.peek();if("'"==f||'"'==f)return a.next(),b(a,c,e(f,"string"));if("/"==f)return a.next(),a.eat("*")?b(a,c,d):a.eat("/")?(a.skipToEnd(),"comment"):(a.skipTo(" "),"operator");if(/\d/.test(f))return a.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/),"number";if("#"==f)return a.next(),f=a.peek(),'"'==f?(a.next(),b(a,c,e('"',"string-2"))):"b"==f?(a.next(),a.eatWhile(/[01]/),"number"):"x"==f?(a.next(),a.eatWhile(/[\da-f]/i),"number"):"o"==f?(a.next(),a.eatWhile(/[0-7]/),"number"):(a.eatWhile(/[-a-zA-Z]/),"keyword");if(a.match("end"))return"keyword";for(var g in i)if(i.hasOwnProperty(g)){var k=i[g];if(k instanceof Array&&k.some(function(b){return a.match(b)})||a.match(k))return j[g]}return a.match("define")?"def":(a.eatWhile(/[\w\-]/),m[a.current()]?n[a.current()]:a.current().match(h)?"variable":(a.next(),"variable-2"))}function d(a,b){for(var d,e=!1;d=a.next();){if("/"==d&&e){b.tokenize=c;break}e="*"==d}return"comment"}function e(a,b){return function(d,e){for(var f,g=!1;null!=(f=d.next());)if(f==a){g=!0;break}return g&&(e.tokenize=c),b}}var f={unnamedDefinition:["interface"],namedDefinition:["module","library","macro","C-struct","C-union","C-function","C-callable-wrapper"],typeParameterizedDefinition:["class","C-subtype","C-mapped-subtype"],otherParameterizedDefinition:["method","function","C-variable","C-address"],constantSimpleDefinition:["constant"],variableSimpleDefinition:["variable"],otherSimpleDefinition:["generic","domain","C-pointer-type","table"],statement:["if","block","begin","method","case","for","select","when","unless","until","while","iterate","profiling","dynamic-bind"],separator:["finally","exception","cleanup","else","elseif","afterwards"],other:["above","below","by","from","handler","in","instance","let","local","otherwise","slot","subclass","then","to","keyed-by","virtual"],signalingCalls:["signal","error","cerror","break","check-type","abort"]};f.otherDefinition=f.unnamedDefinition.concat(f.namedDefinition).concat(f.otherParameterizedDefinition),f.definition=f.typeParameterizedDefinition.concat(f.otherDefinition),f.parameterizedDefinition=f.typeParameterizedDefinition.concat(f.otherParameterizedDefinition),f.simpleDefinition=f.constantSimpleDefinition.concat(f.variableSimpleDefinition).concat(f.otherSimpleDefinition),f.keyword=f.statement.concat(f.separator).concat(f.other);var g="[-_a-zA-Z?!*@<>$%]+",h=new RegExp("^"+g),i={symbolKeyword:g+":",symbolClass:"<"+g+">",symbolGlobal:"\\*"+g+"\\*",symbolConstant:"\\$"+g},j={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variable-2",symbolConstant:"variable-3"};for(var k in i)i.hasOwnProperty(k)&&(i[k]=new RegExp("^"+i[k]));i.keyword=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var l={};l.keyword="keyword",l.definition="def",l.simpleDefinition="def",l.signalingCalls="builtin";var m={},n={};return["keyword","definition","simpleDefinition","signalingCalls"].forEach(function(a){f[a].forEach(function(b){m[b]=a,n[b]=l[a]})}),{startState:function(){return{tokenize:c,currentIndent:0}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c},blockCommentStart:"/*",blockCommentEnd:"*/"}}),a.defineMIME("text/x-dylan","dylan")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/ebnf/ebnf.min.js b/media/editors/codemirror/mode/ebnf/ebnf.min.js -index 01bf41b..8c0cfbb 100644 ---- a/media/editors/codemirror/mode/ebnf/ebnf.min.js -+++ b/media/editors/codemirror/mode/ebnf/ebnf.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ebnf",function(t){var a={slash:0,parenthesis:1},r={comment:0,_string:1,characterClass:2},c=null;return t.bracesMode&&(c=e.getMode(t,t.bracesMode)),{startState:function(){return{stringType:null,commentType:null,braced:0,lhs:!0,localState:null,stack:[],inDefinition:!1}},token:function(e,t){if(e){switch(0===t.stack.length&&('"'==e.peek()||"'"==e.peek()?(t.stringType=e.peek(),e.next(),t.stack.unshift(r._string)):e.match(/^\/\*/)?(t.stack.unshift(r.comment),t.commentType=a.slash):e.match(/^\(\*/)&&(t.stack.unshift(r.comment),t.commentType=a.parenthesis)),t.stack[0]){case r._string:for(;t.stack[0]===r._string&&!e.eol();)e.peek()===t.stringType?(e.next(),t.stack.shift()):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string";case r.comment:for(;t.stack[0]===r.comment&&!e.eol();)t.commentType===a.slash&&e.match(/\*\//)?(t.stack.shift(),t.commentType=null):t.commentType===a.parenthesis&&e.match(/\*\)/)?(t.stack.shift(),t.commentType=null):e.match(/^.[^\*]*/);return"comment";case r.characterClass:for(;t.stack[0]===r.characterClass&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(/^\\./)||t.stack.shift();return"operator"}var n=e.peek();if(null!==c&&(t.braced||"{"===n)){null===t.localState&&(t.localState=c.startState());var s=c.token(e,t.localState),i=e.current();if(!s)for(var o=0;o>/))return"builtin"}return e.match(/^\/\//)?(e.skipToEnd(),"comment"):e.match(/return/)?"operator":e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)?e.match(/(?=[\(.])/)?"variable":e.match(/(?=[\s\n]*[:=])/)?"def":"variable-2":-1!=["[","]","(",")"].indexOf(e.peek())?(e.next(),"bracket"):(e.eatSpace()||e.next(),null)}}}}),e.defineMIME("text/x-ebnf","ebnf")}); -\ 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("ebnf",function(b){var c={slash:0,parenthesis:1},d={comment:0,_string:1,characterClass:2},e=null;return b.bracesMode&&(e=a.getMode(b,b.bracesMode)),{startState:function(){return{stringType:null,commentType:null,braced:0,lhs:!0,localState:null,stack:[],inDefinition:!1}},token:function(a,b){if(a){switch(0===b.stack.length&&('"'==a.peek()||"'"==a.peek()?(b.stringType=a.peek(),a.next(),b.stack.unshift(d._string)):a.match(/^\/\*/)?(b.stack.unshift(d.comment),b.commentType=c.slash):a.match(/^\(\*/)&&(b.stack.unshift(d.comment),b.commentType=c.parenthesis)),b.stack[0]){case d._string:for(;b.stack[0]===d._string&&!a.eol();)a.peek()===b.stringType?(a.next(),b.stack.shift()):"\\"===a.peek()?(a.next(),a.next()):a.match(/^.[^\\\"\']*/);return b.lhs?"property string":"string";case d.comment:for(;b.stack[0]===d.comment&&!a.eol();)b.commentType===c.slash&&a.match(/\*\//)?(b.stack.shift(),b.commentType=null):b.commentType===c.parenthesis&&a.match(/\*\)/)?(b.stack.shift(),b.commentType=null):a.match(/^.[^\*]*/);return"comment";case d.characterClass:for(;b.stack[0]===d.characterClass&&!a.eol();)a.match(/^[^\]\\]+/)||a.match(/^\\./)||b.stack.shift();return"operator"}var f=a.peek();if(null!==e&&(b.braced||"{"===f)){null===b.localState&&(b.localState=e.startState());var g=e.token(a,b.localState),h=a.current();if(!g)for(var i=0;i>/))return"builtin"}return a.match(/^\/\//)?(a.skipToEnd(),"comment"):a.match(/return/)?"operator":a.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)?a.match(/(?=[\(.])/)?"variable":a.match(/(?=[\s\n]*[:=])/)?"def":"variable-2":-1!=["[","]","(",")"].indexOf(a.peek())?(a.next(),"bracket"):(a.eatSpace()||a.next(),null)}}}}),a.defineMIME("text/x-ebnf","ebnf")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/ecl/ecl.js b/media/editors/codemirror/mode/ecl/ecl.js -index 18778f1..8df7ebe 100644 ---- a/media/editors/codemirror/mode/ecl/ecl.js -+++ b/media/editors/codemirror/mode/ecl/ecl.js -@@ -34,7 +34,6 @@ CodeMirror.defineMode("ecl", function(config) { - var blockKeywords = words("catch class do else finally for if switch try while"); - var atoms = words("true false null"); - var hooks = {"#": metaHook}; -- var multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - var curPunc; -@@ -112,7 +111,7 @@ CodeMirror.defineMode("ecl", function(config) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } -- if (end || !(escaped || multiLineStrings)) -+ if (end || !escaped) - state.tokenize = tokenBase; - return "string"; - }; -diff --git a/media/editors/codemirror/mode/ecl/ecl.min.js b/media/editors/codemirror/mode/ecl/ecl.min.js -index 31a372f..1858461 100644 ---- a/media/editors/codemirror/mode/ecl/ecl.min.js -+++ b/media/editors/codemirror/mode/ecl/ecl.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ecl",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r=0&&(!isNaN(a[l])||"_"==a[l]);)--l;if(l>0){var s=a.substr(0,l+1);if(h.propertyIsEnumerable(s))return b.propertyIsEnumerable(s)&&(u="newstatement"),"variable-3"}return g.propertyIsEnumerable(a)?"atom":null}function o(e){return function(t,n){for(var o,i=!1,a=!1;null!=(o=t.next());){if(o==e&&!i){a=!0;break}i=!i&&"\\"==o}return(a||!i&&!c)&&(n.tokenize=r),"string"}}function i(e,t){for(var n,o=!1;n=e.next();){if("/"==n&&o){t.tokenize=r;break}o="*"==n}return"comment"}function a(e,t,n,r,o){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=o}function l(e,t,n){return e.context=new a(e.indented,t,n,null,e.context)}function s(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var c,u,d=e.indentUnit,p=t("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"),f=t("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"),m=t("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"),h=t("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"),y=t("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"),b=t("catch class do else finally for if switch try while"),g=t("true false null"),v={"#":n},x=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new a((e||0)-d,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;u=null;var o=(t.tokenize||r)(e,t);if("comment"==o||"meta"==o)return o;if(null==n.align&&(n.align=!0),";"!=u&&":"!=u||"statement"!=n.type)if("{"==u)l(t,e.column(),"}");else if("["==u)l(t,e.column(),"]");else if("("==u)l(t,e.column(),")");else if("}"==u){for(;"statement"==n.type;)n=s(t);for("}"==n.type&&(n=s(t));"statement"==n.type;)n=s(t)}else u==n.type?s(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==u)&&l(t,e.column(),"statement");else s(t);return t.startOfLine=!1,o},indent:function(e,t){if(e.tokenize!=r&&null!=e.tokenize)return 0;var n=e.context,o=t&&t.charAt(0);"statement"==n.type&&"}"==o&&(n=n.prev);var i=o==n.type;return"statement"==n.type?n.indented+("{"==o?0:d):n.align?n.column+(i?0:1):n.indented+(i?0:d)},electricChars:"{}"}}),e.defineMIME("text/x-ecl","ecl")}); -\ 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("ecl",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d=0&&(!isNaN(g[h])||"_"==g[h]);)--h;if(h>0){var i=g.substr(0,h+1);if(o.propertyIsEnumerable(i))return q.propertyIsEnumerable(i)&&(j="newstatement"),"variable-3"}return r.propertyIsEnumerable(g)?"atom":null}function e(a){return function(b,c){for(var e,f=!1,g=!1;null!=(e=b.next());){if(e==a&&!f){g=!0;break}f=!f&&"\\"==e}return(g||!f)&&(c.tokenize=d),"string"}}function f(a,b){for(var c,e=!1;c=a.next();){if("/"==c&&e){b.tokenize=d;break}e="*"==c}return"comment"}function g(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function h(a,b,c){return a.context=new g(a.indented,b,c,null,a.context)}function i(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var j,k=a.indentUnit,l=b("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"),m=b("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"),n=b("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"),o=b("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"),p=b("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"),q=b("catch class do else finally for if switch try while"),r=b("true false null"),s={"#":c},t=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new g((a||0)-k,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;j=null;var e=(b.tokenize||d)(a,b);if("comment"==e||"meta"==e)return e;if(null==c.align&&(c.align=!0),";"!=j&&":"!=j||"statement"!=c.type)if("{"==j)h(b,a.column(),"}");else if("["==j)h(b,a.column(),"]");else if("("==j)h(b,a.column(),")");else if("}"==j){for(;"statement"==c.type;)c=i(b);for("}"==c.type&&(c=i(b));"statement"==c.type;)c=i(b)}else j==c.type?i(b):("}"==c.type||"top"==c.type||"statement"==c.type&&"newstatement"==j)&&h(b,a.column(),"statement");else i(b);return b.startOfLine=!1,e},indent:function(a,b){if(a.tokenize!=d&&null!=a.tokenize)return 0;var c=a.context,e=b&&b.charAt(0);"statement"==c.type&&"}"==e&&(c=c.prev);var f=e==c.type;return"statement"==c.type?c.indented+("{"==e?0:k):c.align?c.column+(f?0:1):c.indented+(f?0:k)},electricChars:"{}"}}),a.defineMIME("text/x-ecl","ecl")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/eiffel/eiffel.js b/media/editors/codemirror/mode/eiffel/eiffel.js -index fcdf295..b8b70e36 100644 ---- a/media/editors/codemirror/mode/eiffel/eiffel.js -+++ b/media/editors/codemirror/mode/eiffel/eiffel.js -@@ -84,7 +84,6 @@ CodeMirror.defineMode("eiffel", function() { - 'or' - ]); - var operators = wordObj([":=", "and then","and", "or","<<",">>"]); -- var curPunc; - - function chain(newtok, stream, state) { - state.tokenize.push(newtok); -@@ -92,7 +91,6 @@ CodeMirror.defineMode("eiffel", function() { - } - - function tokenBase(stream, state) { -- curPunc = null; - if (stream.eatSpace()) return null; - var ch = stream.next(); - if (ch == '"'||ch == "'") { -diff --git a/media/editors/codemirror/mode/eiffel/eiffel.min.js b/media/editors/codemirror/mode/eiffel/eiffel.min.js -index 7d8843e..59d7d0a 100644 ---- a/media/editors/codemirror/mode/eiffel/eiffel.min.js -+++ b/media/editors/codemirror/mode/eiffel/eiffel.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("eiffel",function(){function e(e){for(var t={},r=0,n=e.length;n>r;++r)t[e[r]]=!0;return t}function t(e,t,r){return r.tokenize.push(e),e(t,r)}function r(e,r){if(i=null,e.eatSpace())return null;var o=e.next();return'"'==o||"'"==o?t(n(o,"string"),e,r):"-"==o&&e.eat("-")?(e.skipToEnd(),"comment"):":"==o&&e.eat("=")?"operator":/[0-9]/.test(o)?(e.eatWhile(/[xXbBCc0-9\.]/),e.eat(/[\?\!]/),"ident"):/[a-zA-Z_0-9]/.test(o)?(e.eatWhile(/[a-zA-Z_0-9]/),e.eat(/[\?\!]/),"ident"):/[=+\-\/*^%<>~]/.test(o)?(e.eatWhile(/[=+\-\/*^%<>~]/),"operator"):null}function n(e,t,r){return function(n,i){for(var o,a=!1;null!=(o=n.next());){if(o==e&&(r||!a)){i.tokenize.pop();break}a=!a&&"%"==o}return t}}var i,o=e(["note","across","when","variant","until","unique","undefine","then","strip","select","retry","rescue","require","rename","reference","redefine","prefix","once","old","obsolete","loop","local","like","is","inspect","infix","include","if","frozen","from","external","export","ensure","end","elseif","else","do","creation","create","check","alias","agent","separate","invariant","inherit","indexing","feature","expanded","deferred","class","Void","True","Result","Precursor","False","Current","create","attached","detachable","as","and","implies","not","or"]),a=e([":=","and then","and","or","<<",">>"]);return{startState:function(){return{tokenize:[r]}},token:function(e,t){var r=t.tokenize[t.tokenize.length-1](e,t);if("ident"==r){var n=e.current();r=o.propertyIsEnumerable(e.current())?"keyword":a.propertyIsEnumerable(e.current())?"operator":/^[A-Z][A-Z_0-9]*$/g.test(n)?"tag":/^0[bB][0-1]+$/g.test(n)?"number":/^0[cC][0-7]+$/g.test(n)?"number":/^0[xX][a-fA-F0-9]+$/g.test(n)?"number":/^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(n)?"number":/^[0-9]+$/g.test(n)?"number":"variable"}return r},lineComment:"--"}}),e.defineMIME("text/x-eiffel","eiffel")}); -\ 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("eiffel",function(){function a(a){for(var b={},c=0,d=a.length;d>c;++c)b[a[c]]=!0;return b}function b(a,b,c){return c.tokenize.push(a),a(b,c)}function c(a,c){if(a.eatSpace())return null;var e=a.next();return'"'==e||"'"==e?b(d(e,"string"),a,c):"-"==e&&a.eat("-")?(a.skipToEnd(),"comment"):":"==e&&a.eat("=")?"operator":/[0-9]/.test(e)?(a.eatWhile(/[xXbBCc0-9\.]/),a.eat(/[\?\!]/),"ident"):/[a-zA-Z_0-9]/.test(e)?(a.eatWhile(/[a-zA-Z_0-9]/),a.eat(/[\?\!]/),"ident"):/[=+\-\/*^%<>~]/.test(e)?(a.eatWhile(/[=+\-\/*^%<>~]/),"operator"):null}function d(a,b,c){return function(d,e){for(var f,g=!1;null!=(f=d.next());){if(f==a&&(c||!g)){e.tokenize.pop();break}g=!g&&"%"==f}return b}}var e=a(["note","across","when","variant","until","unique","undefine","then","strip","select","retry","rescue","require","rename","reference","redefine","prefix","once","old","obsolete","loop","local","like","is","inspect","infix","include","if","frozen","from","external","export","ensure","end","elseif","else","do","creation","create","check","alias","agent","separate","invariant","inherit","indexing","feature","expanded","deferred","class","Void","True","Result","Precursor","False","Current","create","attached","detachable","as","and","implies","not","or"]),f=a([":=","and then","and","or","<<",">>"]);return{startState:function(){return{tokenize:[c]}},token:function(a,b){var c=b.tokenize[b.tokenize.length-1](a,b);if("ident"==c){var d=a.current();c=e.propertyIsEnumerable(a.current())?"keyword":f.propertyIsEnumerable(a.current())?"operator":/^[A-Z][A-Z_0-9]*$/g.test(d)?"tag":/^0[bB][0-1]+$/g.test(d)?"number":/^0[cC][0-7]+$/g.test(d)?"number":/^0[xX][a-fA-F0-9]+$/g.test(d)?"number":/^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(d)?"number":/^[0-9]+$/g.test(d)?"number":"variable"}return c},lineComment:"--"}}),a.defineMIME("text/x-eiffel","eiffel")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/erlang/erlang.min.js b/media/editors/codemirror/mode/erlang/erlang.min.js -index 40744bd..963bd25 100644 ---- a/media/editors/codemirror/mode/erlang/erlang.min.js -+++ b/media/editors/codemirror/mode/erlang/erlang.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMIME("text/x-erlang","erlang"),e.defineMode("erlang",function(t){function n(e,t){if(t.in_string)return t.in_string=!i(e),l(t,e,"string");if(t.in_atom)return t.in_atom=!a(e),l(t,e,"atom");if(e.eatSpace())return l(t,e,"whitespace");if(!m(t)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return s(e.current(),W)?l(t,e,"type"):l(t,e,"attribute");var n=e.next();if("%"==n)return e.skipToEnd(),l(t,e,"comment");if(":"==n)return l(t,e,"colon");if("?"==n)return e.eatSpace(),e.eatWhile($),l(t,e,"macro");if("#"==n)return e.eatSpace(),e.eatWhile($),l(t,e,"record");if("$"==n)return"\\"!=e.next()||e.match(B)?l(t,e,"number"):l(t,e,"error");if("."==n)return l(t,e,"dot");if("'"==n){if(!(t.in_atom=!a(e))){if(e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),l(t,e,"fun");if(e.match(/\s*\(/,!1)||e.match(/\s*:/,!1))return l(t,e,"function")}return l(t,e,"atom")}if('"'==n)return t.in_string=!i(e),l(t,e,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(n))return e.eatWhile($),l(t,e,"variable");if(/[a-z_ß-öø-ÿ]/.test(n)){if(e.eatWhile($),e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),l(t,e,"fun");var c=e.current();return s(c,U)?l(t,e,"keyword"):s(c,Z)?l(t,e,"operator"):e.match(/\s*\(/,!1)?!s(c,T)||":"==m(t).token&&"erlang"!=m(t,2).token?s(c,O)?l(t,e,"guard"):l(t,e,"function"):l(t,e,"builtin"):s(c,Z)?l(t,e,"operator"):":"==u(e)?"erlang"==c?l(t,e,"builtin"):l(t,e,"function"):s(c,["true","false"])?l(t,e,"boolean"):s(c,["true","false"])?l(t,e,"boolean"):l(t,e,"atom")}var _=/[0-9]/,f=/[0-9a-zA-Z]/;return _.test(n)?(e.eatWhile(_),e.eat("#")?e.eatWhile(f)||e.backUp(1):e.eat(".")&&(e.eatWhile(_)?e.eat(/[eE]/)&&(e.eat(/[-+]/)?e.eatWhile(_)||e.backUp(2):e.eatWhile(_)||e.backUp(1)):e.backUp(1)),l(t,e,"number")):r(e,P,j)?l(t,e,"open_paren"):r(e,C,I)?l(t,e,"close_paren"):o(e,E,A)?l(t,e,"separator"):o(e,M,q)?l(t,e,"operator"):l(t,e,null)}function r(e,t,n){if(1==e.current().length&&t.test(e.current())){for(e.backUp(1);t.test(e.peek());)if(e.next(),s(e.current(),n))return!0;e.backUp(e.current().length-1)}return!1}function o(e,t,n){if(1==e.current().length&&t.test(e.current())){for(;t.test(e.peek());)e.next();for(;0n?!1:e.tokenStack[n-r]}function d(e,t){"comment"!=t.type&&"whitespace"!=t.type&&(e.tokenStack=b(e.tokenStack,t),e.tokenStack=g(e.tokenStack))}function b(e,t){var n=e.length-1;return n>0&&"record"===e[n].type&&"dot"===t.type?e.pop():n>0&&"group"===e[n].type?(e.pop(),e.push(t)):e.push(t),e}function g(e){var t=e.length-1;if("dot"===e[t].type)return[];if("fun"===e[t].type&&"fun"===e[t-1].token)return e.slice(0,t-1);switch(e[e.length-1].token){case"}":return k(e,{g:["{"]});case"]":return k(e,{i:["["]});case")":return k(e,{i:["("]});case">>":return k(e,{i:["<<"]});case"end":return k(e,{i:["begin","case","fun","if","receive","try"]});case",":return k(e,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return k(e,{r:["when"],m:["try","if","case","receive"]});case";":return k(e,{E:["case","fun","if","receive","try","when"]});case"catch":return k(e,{e:["try"]});case"of":return k(e,{e:["case"]});case"after":return k(e,{e:["receive","try"]});default:return e}}function k(e,t){for(var n in t)for(var r=e.length-1,o=t[n],i=r-1;i>-1;i--)if(s(e[i].token,o)){var a=e.slice(0,i);switch(n){case"m":return a.concat(e[i]).concat(e[r]);case"r":return a.concat(e[r]);case"i":return a;case"g":return a.concat(p("group"));case"E":return a.concat(e[i]);case"e":return a.concat(e[i])}}return"E"==n?[]:e}function h(n,r){var o,i=t.indentUnit,a=y(r),c=m(n,1),u=m(n,2);return n.in_string||n.in_atom?e.Pass:u?"when"==c.token?c.column+i:"when"===a&&"function"===u.type?u.indent+i:"("===a&&"fun"===c.token?c.column+3:"catch"===a&&(o=x(n,["try"]))?o.column:s(a,["end","after","of"])?(o=x(n,["begin","case","fun","if","receive","try"]),o?o.column:e.Pass):s(a,I)?(o=x(n,j),o?o.column:e.Pass):s(c.token,[",","|","||"])||s(a,[",","|","||"])?(o=v(n),o?o.column+o.token.length:i):"->"==c.token?s(u.token,["receive","case","if","try"])?u.column+i+i:u.column+i:s(c.token,j)?c.column+c.token.length:(o=w(n),z(o)?o.column+i:0):0}function y(e){var t=e.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return z(t)&&0===t.index?t[0]:""}function v(e){var t=e.tokenStack.slice(0,-1),n=S(t,"type",["open_paren"]);return z(t[n])?t[n]:!1}function w(e){var t=e.tokenStack,n=S(t,"type",["open_paren","separator","keyword"]),r=S(t,"type",["operator"]);return z(n)&&z(r)&&r>n?t[n+1]:z(n)?t[n]:!1}function x(e,t){var n=e.tokenStack,r=S(n,"token",t);return z(n[r])?n[r]:!1}function S(e,t,n){for(var r=e.length-1;r>-1;r--)if(s(e[r][t],n))return r;return!1}function z(e){return e!==!1&&null!=e}var W=["-type","-spec","-export_type","-opaque"],U=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],E=/[\->,;]/,A=["->",";",","],Z=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],M=/[\+\-\*\/<>=\|:!]/,q=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],P=/[<\(\[\{]/,j=["<<","(","[","{"],C=/[>\)\]\}]/,I=["}","]",")",">>"],O=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],T=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],$=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,B=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(e,t){return n(e,t)},indent:function(e,t){return h(e,t)},lineComment:"%"}})}); -\ 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.defineMIME("text/x-erlang","erlang"),a.defineMode("erlang",function(b){function c(a,b){if(b.in_string)return b.in_string=!f(a),k(b,a,"string");if(b.in_atom)return b.in_atom=!g(a),k(b,a,"atom");if(a.eatSpace())return k(b,a,"whitespace");if(!o(b)&&a.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return j(a.current(),A)?k(b,a,"type"):k(b,a,"attribute");var c=a.next();if("%"==c)return a.skipToEnd(),k(b,a,"comment");if(":"==c)return k(b,a,"colon");if("?"==c)return a.eatSpace(),a.eatWhile(N),k(b,a,"macro");if("#"==c)return a.eatSpace(),a.eatWhile(N),k(b,a,"record");if("$"==c)return"\\"!=a.next()||a.match(O)?k(b,a,"number"):k(b,a,"error");if("."==c)return k(b,a,"dot");if("'"==c){if(!(b.in_atom=!g(a))){if(a.match(/\s*\/\s*[0-9]/,!1))return a.match(/\s*\/\s*[0-9]/,!0),k(b,a,"fun");if(a.match(/\s*\(/,!1)||a.match(/\s*:/,!1))return k(b,a,"function")}return k(b,a,"atom")}if('"'==c)return b.in_string=!f(a),k(b,a,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(c))return a.eatWhile(N),k(b,a,"variable");if(/[a-z_ß-öø-ÿ]/.test(c)){if(a.eatWhile(N),a.match(/\s*\/\s*[0-9]/,!1))return a.match(/\s*\/\s*[0-9]/,!0),k(b,a,"fun");var h=a.current();return j(h,B)?k(b,a,"keyword"):j(h,E)?k(b,a,"operator"):a.match(/\s*\(/,!1)?!j(h,M)||":"==o(b).token&&"erlang"!=o(b,2).token?j(h,L)?k(b,a,"guard"):k(b,a,"function"):k(b,a,"builtin"):j(h,E)?k(b,a,"operator"):":"==i(a)?"erlang"==h?k(b,a,"builtin"):k(b,a,"function"):j(h,["true","false"])?k(b,a,"boolean"):j(h,["true","false"])?k(b,a,"boolean"):k(b,a,"atom")}var l=/[0-9]/,m=/[0-9a-zA-Z]/;return l.test(c)?(a.eatWhile(l),a.eat("#")?a.eatWhile(m)||a.backUp(1):a.eat(".")&&(a.eatWhile(l)?a.eat(/[eE]/)&&(a.eat(/[-+]/)?a.eatWhile(l)||a.backUp(2):a.eatWhile(l)||a.backUp(1)):a.backUp(1)),k(b,a,"number")):d(a,H,I)?k(b,a,"open_paren"):d(a,J,K)?k(b,a,"close_paren"):e(a,C,D)?k(b,a,"separator"):e(a,F,G)?k(b,a,"operator"):k(b,a,null)}function d(a,b,c){if(1==a.current().length&&b.test(a.current())){for(a.backUp(1);b.test(a.peek());)if(a.next(),j(a.current(),c))return!0;a.backUp(a.current().length-1)}return!1}function e(a,b,c){if(1==a.current().length&&b.test(a.current())){for(;b.test(a.peek());)a.next();for(;0c?!1:a.tokenStack[c-d]}function p(a,b){"comment"!=b.type&&"whitespace"!=b.type&&(a.tokenStack=q(a.tokenStack,b),a.tokenStack=r(a.tokenStack))}function q(a,b){var c=a.length-1;return c>0&&"record"===a[c].type&&"dot"===b.type?a.pop():c>0&&"group"===a[c].type?(a.pop(),a.push(b)):a.push(b),a}function r(a){var b=a.length-1;if("dot"===a[b].type)return[];if("fun"===a[b].type&&"fun"===a[b-1].token)return a.slice(0,b-1);switch(a[a.length-1].token){case"}":return s(a,{g:["{"]});case"]":return s(a,{i:["["]});case")":return s(a,{i:["("]});case">>":return s(a,{i:["<<"]});case"end":return s(a,{i:["begin","case","fun","if","receive","try"]});case",":return s(a,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return s(a,{r:["when"],m:["try","if","case","receive"]});case";":return s(a,{E:["case","fun","if","receive","try","when"]});case"catch":return s(a,{e:["try"]});case"of":return s(a,{e:["case"]});case"after":return s(a,{e:["receive","try"]});default:return a}}function s(a,b){for(var c in b)for(var d=a.length-1,e=b[c],f=d-1;f>-1;f--)if(j(a[f].token,e)){var g=a.slice(0,f);switch(c){case"m":return g.concat(a[f]).concat(a[d]);case"r":return g.concat(a[d]);case"i":return g;case"g":return g.concat(n("group"));case"E":return g.concat(a[f]);case"e":return g.concat(a[f])}}return"E"==c?[]:a}function t(c,d){var e,f=b.indentUnit,g=u(d),h=o(c,1),i=o(c,2);return c.in_string||c.in_atom?a.Pass:i?"when"==h.token?h.column+f:"when"===g&&"function"===i.type?i.indent+f:"("===g&&"fun"===h.token?h.column+3:"catch"===g&&(e=x(c,["try"]))?e.column:j(g,["end","after","of"])?(e=x(c,["begin","case","fun","if","receive","try"]),e?e.column:a.Pass):j(g,K)?(e=x(c,I),e?e.column:a.Pass):j(h.token,[",","|","||"])||j(g,[",","|","||"])?(e=v(c),e?e.column+e.token.length:f):"->"==h.token?j(i.token,["receive","case","if","try"])?i.column+f+f:i.column+f:j(h.token,I)?h.column+h.token.length:(e=w(c),z(e)?e.column+f:0):0}function u(a){var b=a.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return z(b)&&0===b.index?b[0]:""}function v(a){var b=a.tokenStack.slice(0,-1),c=y(b,"type",["open_paren"]);return z(b[c])?b[c]:!1}function w(a){var b=a.tokenStack,c=y(b,"type",["open_paren","separator","keyword"]),d=y(b,"type",["operator"]);return z(c)&&z(d)&&d>c?b[c+1]:z(c)?b[c]:!1}function x(a,b){var c=a.tokenStack,d=y(c,"token",b);return z(c[d])?c[d]:!1}function y(a,b,c){for(var d=a.length-1;d>-1;d--)if(j(a[d][b],c))return d;return!1}function z(a){return a!==!1&&null!=a}var A=["-type","-spec","-export_type","-opaque"],B=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],C=/[\->,;]/,D=["->",";",","],E=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],F=/[\+\-\*\/<>=\|:!]/,G=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],H=/[<\(\[\{]/,I=["<<","(","[","{"],J=/[>\)\]\}]/,K=["}","]",")",">>"],L=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],M=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],N=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,O=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(a,b){return c(a,b)},indent:function(a,b){return t(a,b)},lineComment:"%"}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/forth/forth.min.js b/media/editors/codemirror/mode/forth/forth.min.js -index cbc6ae1..3afd7ae 100644 ---- a/media/editors/codemirror/mode/forth/forth.min.js -+++ b/media/editors/codemirror/mode/forth/forth.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t){var e=[];return t.split(" ").forEach(function(t){e.push({name:t})}),e}var E=e("INVERT AND OR XOR 2* 2/ LSHIFT RSHIFT 0= = 0< < > U< MIN MAX 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP >R R> R@ + - 1+ 1- ABS NEGATE S>D * M* UM* FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2! ALIGN ALIGNED +! ALLOT CHAR [CHAR] [ ] BL FIND EXECUTE IMMEDIATE COUNT LITERAL STATE ; DOES> >BODY EVALUATE SOURCE >IN <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL FILL MOVE . CR EMIT SPACE SPACES TYPE U. .R U.R ACCEPT TRUE FALSE <> U> 0<> 0> NIP TUCK ROLL PICK 2>R 2R@ 2R> WITHIN UNUSED MARKER I J TO COMPILE, [COMPILE] SAVE-INPUT RESTORE-INPUT PAD ERASE 2LITERAL DNEGATE D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS M+ M*/ D. D.R 2ROT DU< CATCH THROW FREE RESIZE ALLOCATE CS-PICK CS-ROLL GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL"),i=e("IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE");t.defineMode("forth",function(){function t(t,e){var E;for(E=t.length-1;E>=0;E--)if(t[E].name===e.toUpperCase())return t[E];return void 0}return{startState:function(){return{state:"",base:10,coreWordList:E,immediateWordList:i,wordList:[]}},token:function(e,E){var i;if(e.eatSpace())return null;if(""===E.state){if(e.match(/^(\]|:NONAME)(\s|$)/i))return E.state=" compilation","builtin compilation";if(i=e.match(/^(\:)\s+(\S+)(\s|$)+/))return E.wordList.push({name:i[2].toUpperCase()}),E.state=" compilation","def"+E.state;if(i=e.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i))return E.wordList.push({name:i[2].toUpperCase()}),"def"+E.state;if(i=e.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/))return"builtin"+E.state}else{if(e.match(/^(\;|\[)(\s)/))return E.state="",e.backUp(1),"builtin compilation";if(e.match(/^(\;|\[)($)/))return E.state="","builtin compilation";if(e.match(/^(POSTPONE)\s+\S+(\s|$)+/))return"builtin"}return i=e.match(/^(\S+)(\s+|$)/),i?void 0!==t(E.wordList,i[1])?"variable"+E.state:"\\"===i[1]?(e.skipToEnd(),"comment"+E.state):void 0!==t(E.coreWordList,i[1])?"builtin"+E.state:void 0!==t(E.immediateWordList,i[1])?"keyword"+E.state:"("===i[1]?(e.eatWhile(function(t){return")"!==t}),e.eat(")"),"comment"+E.state):".("===i[1]?(e.eatWhile(function(t){return")"!==t}),e.eat(")"),"string"+E.state):'S"'===i[1]||'."'===i[1]||'C"'===i[1]?(e.eatWhile(function(t){return'"'!==t}),e.eat('"'),"string"+E.state):i[1]-68719476735?"number"+E.state:"atom"+E.state:void 0}}}),t.defineMIME("text/x-forth","forth")}); -\ 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){var b=[];return a.split(" ").forEach(function(a){b.push({name:a})}),b}var c=b("INVERT AND OR XOR 2* 2/ LSHIFT RSHIFT 0= = 0< < > U< MIN MAX 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP >R R> R@ + - 1+ 1- ABS NEGATE S>D * M* UM* FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2! ALIGN ALIGNED +! ALLOT CHAR [CHAR] [ ] BL FIND EXECUTE IMMEDIATE COUNT LITERAL STATE ; DOES> >BODY EVALUATE SOURCE >IN <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL FILL MOVE . CR EMIT SPACE SPACES TYPE U. .R U.R ACCEPT TRUE FALSE <> U> 0<> 0> NIP TUCK ROLL PICK 2>R 2R@ 2R> WITHIN UNUSED MARKER I J TO COMPILE, [COMPILE] SAVE-INPUT RESTORE-INPUT PAD ERASE 2LITERAL DNEGATE D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS M+ M*/ D. D.R 2ROT DU< CATCH THROW FREE RESIZE ALLOCATE CS-PICK CS-ROLL GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL"),d=b("IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE");a.defineMode("forth",function(){function a(a,b){var c;for(c=a.length-1;c>=0;c--)if(a[c].name===b.toUpperCase())return a[c];return void 0}return{startState:function(){return{state:"",base:10,coreWordList:c,immediateWordList:d,wordList:[]}},token:function(b,c){var d;if(b.eatSpace())return null;if(""===c.state){if(b.match(/^(\]|:NONAME)(\s|$)/i))return c.state=" compilation","builtin compilation";if(d=b.match(/^(\:)\s+(\S+)(\s|$)+/))return c.wordList.push({name:d[2].toUpperCase()}),c.state=" compilation","def"+c.state;if(d=b.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i))return c.wordList.push({name:d[2].toUpperCase()}),"def"+c.state;if(d=b.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/))return"builtin"+c.state}else{if(b.match(/^(\;|\[)(\s)/))return c.state="",b.backUp(1),"builtin compilation";if(b.match(/^(\;|\[)($)/))return c.state="","builtin compilation";if(b.match(/^(POSTPONE)\s+\S+(\s|$)+/))return"builtin"}return d=b.match(/^(\S+)(\s+|$)/),d?void 0!==a(c.wordList,d[1])?"variable"+c.state:"\\"===d[1]?(b.skipToEnd(),"comment"+c.state):void 0!==a(c.coreWordList,d[1])?"builtin"+c.state:void 0!==a(c.immediateWordList,d[1])?"keyword"+c.state:"("===d[1]?(b.eatWhile(function(a){return")"!==a}),b.eat(")"),"comment"+c.state):".("===d[1]?(b.eatWhile(function(a){return")"!==a}),b.eat(")"),"string"+c.state):'S"'===d[1]||'."'===d[1]||'C"'===d[1]?(b.eatWhile(function(a){return'"'!==a}),b.eat('"'),"string"+c.state):d[1]-68719476735?"number"+c.state:"atom"+c.state:void 0}}}),a.defineMIME("text/x-forth","forth")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/fortran/fortran.min.js b/media/editors/codemirror/mode/fortran/fortran.min.js -index 33cfbbc..dfc2098 100644 ---- a/media/editors/codemirror/mode/fortran/fortran.min.js -+++ b/media/editors/codemirror/mode/fortran/fortran.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("fortran",function(){function e(e){for(var t={},n=0;n\/\:]/,c=new RegExp("(.and.|.or.|.eq.|.lt.|.le.|.gt.|.ge.|.ne.|.not.|.eqv.|.neqv.)","i");return{startState:function(){return{tokenize:null}},token:function(e,n){if(e.eatSpace())return null;var i=(n.tokenize||t)(e,n);return"comment"==i||"meta"==i?i:i}}}),e.defineMIME("text/x-fortran","fortran")}); -\ 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("fortran",function(){function a(a){for(var b={},c=0;c\/\:]/,h=new RegExp("(.and.|.or.|.eq.|.lt.|.le.|.gt.|.ge.|.ne.|.not.|.eqv.|.neqv.)","i");return{startState:function(){return{tokenize:null}},token:function(a,c){if(a.eatSpace())return null;var d=(c.tokenize||b)(a,c);return"comment"==d||"meta"==d?d:d}}}),a.defineMIME("text/x-fortran","fortran")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/gas/gas.min.js b/media/editors/codemirror/mode/gas/gas.min.js -index c39035a..e4890ca 100644 ---- a/media/editors/codemirror/mode/gas/gas.min.js -+++ b/media/editors/codemirror/mode/gas/gas.min.js -@@ -1 +1 @@ --!function(i){"object"==typeof exports&&"object"==typeof module?i(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],i):i(CodeMirror)}(function(i){"use strict";i.defineMode("gas",function(i,t){function l(){u="#",o.ax="variable",o.eax="variable-2",o.rax="variable-3",o.bx="variable",o.ebx="variable-2",o.rbx="variable-3",o.cx="variable",o.ecx="variable-2",o.rcx="variable-3",o.dx="variable",o.edx="variable-2",o.rdx="variable-3",o.si="variable",o.esi="variable-2",o.rsi="variable-3",o.di="variable",o.edi="variable-2",o.rdi="variable-3",o.sp="variable",o.esp="variable-2",o.rsp="variable-3",o.bp="variable",o.ebp="variable-2",o.rbp="variable-3",o.ip="variable",o.eip="variable-2",o.rip="variable-3",o.cs="keyword",o.ds="keyword",o.ss="keyword",o.es="keyword",o.fs="keyword",o.gs="keyword"}function n(){u="@",a.syntax="builtin",o.r0="variable",o.r1="variable",o.r2="variable",o.r3="variable",o.r4="variable",o.r5="variable",o.r6="variable",o.r7="variable",o.r8="variable",o.r9="variable",o.r10="variable",o.r11="variable",o.r12="variable",o.sp="variable-2",o.lr="variable-2",o.pc="variable-2",o.r13=o.sp,o.r14=o.lr,o.r15=o.pc,b.push(function(i,t){return"#"===i?(t.eatWhile(/\w/),"number"):void 0})}function e(i,t){for(var l,n=!1;null!=(l=i.next());){if(l===t&&!n)return!1;n=!n&&"\\"===l}return n}function r(i,t){for(var l,n=!1;null!=(l=i.next());){if("/"===l&&n){t.tokenize=null;break}n="*"===l}return"comment"}var b=[],u="",a={".abort":"builtin",".align":"builtin",".altmacro":"builtin",".ascii":"builtin",".asciz":"builtin",".balign":"builtin",".balignw":"builtin",".balignl":"builtin",".bundle_align_mode":"builtin",".bundle_lock":"builtin",".bundle_unlock":"builtin",".byte":"builtin",".cfi_startproc":"builtin",".comm":"builtin",".data":"builtin",".def":"builtin",".desc":"builtin",".dim":"builtin",".double":"builtin",".eject":"builtin",".else":"builtin",".elseif":"builtin",".end":"builtin",".endef":"builtin",".endfunc":"builtin",".endif":"builtin",".equ":"builtin",".equiv":"builtin",".eqv":"builtin",".err":"builtin",".error":"builtin",".exitm":"builtin",".extern":"builtin",".fail":"builtin",".file":"builtin",".fill":"builtin",".float":"builtin",".func":"builtin",".global":"builtin",".gnu_attribute":"builtin",".hidden":"builtin",".hword":"builtin",".ident":"builtin",".if":"builtin",".incbin":"builtin",".include":"builtin",".int":"builtin",".internal":"builtin",".irp":"builtin",".irpc":"builtin",".lcomm":"builtin",".lflags":"builtin",".line":"builtin",".linkonce":"builtin",".list":"builtin",".ln":"builtin",".loc":"builtin",".loc_mark_labels":"builtin",".local":"builtin",".long":"builtin",".macro":"builtin",".mri":"builtin",".noaltmacro":"builtin",".nolist":"builtin",".octa":"builtin",".offset":"builtin",".org":"builtin",".p2align":"builtin",".popsection":"builtin",".previous":"builtin",".print":"builtin",".protected":"builtin",".psize":"builtin",".purgem":"builtin",".pushsection":"builtin",".quad":"builtin",".reloc":"builtin",".rept":"builtin",".sbttl":"builtin",".scl":"builtin",".section":"builtin",".set":"builtin",".short":"builtin",".single":"builtin",".size":"builtin",".skip":"builtin",".sleb128":"builtin",".space":"builtin",".stab":"builtin",".string":"builtin",".struct":"builtin",".subsection":"builtin",".symver":"builtin",".tag":"builtin",".text":"builtin",".title":"builtin",".type":"builtin",".uleb128":"builtin",".val":"builtin",".version":"builtin",".vtable_entry":"builtin",".vtable_inherit":"builtin",".warning":"builtin",".weak":"builtin",".weakref":"builtin",".word":"builtin"},o={},c=(t.architecture||"x86").toLowerCase();return"x86"===c?l(t):("arm"===c||"armv6"===c)&&n(t),{startState:function(){return{tokenize:null}},token:function(i,t){if(t.tokenize)return t.tokenize(i,t);if(i.eatSpace())return null;var l,n,c=i.next();if("/"===c&&i.eat("*"))return t.tokenize=r,r(i,t);if(c===u)return i.skipToEnd(),"comment";if('"'===c)return e(i,'"'),"string";if("."===c)return i.eatWhile(/\w/),n=i.current().toLowerCase(),l=a[n],l||null;if("="===c)return i.eatWhile(/\w/),"tag";if("{"===c)return"braket";if("}"===c)return"braket";if(/\d/.test(c))return"0"===c&&i.eat("x")?(i.eatWhile(/[0-9a-fA-F]/),"number"):(i.eatWhile(/\d/),"number");if(/\w/.test(c))return i.eatWhile(/\w/),i.eat(":")?"tag":(n=i.current().toLowerCase(),l=o[n],l||null);for(var s=0;s]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(o.combineTokens=!0,"link"):(e.next(),null)},blankLine:r},c={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var d in n)c[d]=n[d];return c.name="markdown",e.defineMIME("gfmBase",c),e.overlayMode(e.getMode(o,"gfmBase"),a)},"markdown")}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("gfm",function(b,c){function d(a){return a.code=!1,null}var e=0,f={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(a){return{code:a.code,codeBlock:a.codeBlock,ateSpace:a.ateSpace}},token:function(a,b){if(b.combineTokens=null,b.codeBlock)return a.match(/^```/)?(b.codeBlock=!1,null):(a.skipToEnd(),null);if(a.sol()&&(b.code=!1),a.sol()&&a.match(/^```/))return a.skipToEnd(),b.codeBlock=!0,null;if("`"===a.peek()){a.next();var c=a.pos;a.eatWhile("`");var d=1+a.pos-c;return b.code?d===e&&(b.code=!1):(e=d,b.code=!0),null}if(b.code)return a.next(),null;if(a.eatSpace())return b.ateSpace=!0,null;if(a.sol()||b.ateSpace){if(b.ateSpace=!1,a.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return b.combineTokens=!0,"link";if(a.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return b.combineTokens=!0,"link"}return a.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=a.string.slice(a.start-2,a.start)?(b.combineTokens=!0,"link"):(a.next(),null)},blankLine:d},g={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var h in c)g[h]=c[h];return g.name="markdown",a.defineMIME("gfmBase",g),a.overlayMode(a.getMode(b,"gfmBase"),f)},"markdown")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/gfm/test.js b/media/editors/codemirror/mode/gfm/test.js -deleted file mode 100644 -index c2bc38f..0000000 ---- a/media/editors/codemirror/mode/gfm/test.js -+++ /dev/null -@@ -1,213 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({tabSize: 4}, "gfm"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "gfm", highlightFormatting: true}); -- function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } -- -- FT("codeBackticks", -- "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); -- -- FT("doubleBackticks", -- "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); -- -- FT("codeBlock", -- "[comment&formatting&formatting-code-block ```css]", -- "[tag foo]", -- "[comment&formatting&formatting-code-block ```]"); -- -- FT("taskList", -- "[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]", -- "[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]"); -- -- FT("formatting_strikethrough", -- "[strikethrough&formatting&formatting-strikethrough ~~][strikethrough foo][strikethrough&formatting&formatting-strikethrough ~~]"); -- -- FT("formatting_strikethrough", -- "foo [strikethrough&formatting&formatting-strikethrough ~~][strikethrough bar][strikethrough&formatting&formatting-strikethrough ~~]"); -- -- MT("emInWordAsterisk", -- "foo[em *bar*]hello"); -- -- MT("emInWordUnderscore", -- "foo_bar_hello"); -- -- MT("emStrongUnderscore", -- "[strong __][em&strong _foo__][em _] bar"); -- -- MT("fencedCodeBlocks", -- "[comment ```]", -- "[comment foo]", -- "", -- "[comment ```]", -- "bar"); -- -- MT("fencedCodeBlockModeSwitching", -- "[comment ```javascript]", -- "[variable foo]", -- "", -- "[comment ```]", -- "bar"); -- -- MT("taskListAsterisk", -- "[variable-2 * []] foo]", // Invalid; must have space or x between [] -- "[variable-2 * [ ]]bar]", // Invalid; must have space after ] -- "[variable-2 * [x]]hello]", // Invalid; must have space after ] -- "[variable-2 * ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links -- " [variable-3 * ][property [x]]][variable-3 foo]"); // Valid; can be nested -- -- MT("taskListPlus", -- "[variable-2 + []] foo]", // Invalid; must have space or x between [] -- "[variable-2 + [ ]]bar]", // Invalid; must have space after ] -- "[variable-2 + [x]]hello]", // Invalid; must have space after ] -- "[variable-2 + ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links -- " [variable-3 + ][property [x]]][variable-3 foo]"); // Valid; can be nested -- -- MT("taskListDash", -- "[variable-2 - []] foo]", // Invalid; must have space or x between [] -- "[variable-2 - [ ]]bar]", // Invalid; must have space after ] -- "[variable-2 - [x]]hello]", // Invalid; must have space after ] -- "[variable-2 - ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links -- " [variable-3 - ][property [x]]][variable-3 foo]"); // Valid; can be nested -- -- MT("taskListNumber", -- "[variable-2 1. []] foo]", // Invalid; must have space or x between [] -- "[variable-2 2. [ ]]bar]", // Invalid; must have space after ] -- "[variable-2 3. [x]]hello]", // Invalid; must have space after ] -- "[variable-2 4. ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links -- " [variable-3 1. ][property [x]]][variable-3 foo]"); // Valid; can be nested -- -- MT("SHA", -- "foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar"); -- -- MT("SHAEmphasis", -- "[em *foo ][em&link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); -- -- MT("shortSHA", -- "foo [link be6a8cc] bar"); -- -- MT("tooShortSHA", -- "foo be6a8c bar"); -- -- MT("longSHA", -- "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar"); -- -- MT("badSHA", -- "foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar"); -- -- MT("userSHA", -- "foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello"); -- -- MT("userSHAEmphasis", -- "[em *foo ][em&link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); -- -- MT("userProjectSHA", -- "foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world"); -- -- MT("userProjectSHAEmphasis", -- "[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"); -- -- MT("num", -- "foo [link #1] bar"); -- -- MT("numEmphasis", -- "[em *foo ][em&link #1][em *]"); -- -- MT("badNum", -- "foo #1bar hello"); -- -- MT("userNum", -- "foo [link bar#1] hello"); -- -- MT("userNumEmphasis", -- "[em *foo ][em&link bar#1][em *]"); -- -- MT("userProjectNum", -- "foo [link bar/hello#1] world"); -- -- MT("userProjectNumEmphasis", -- "[em *foo ][em&link bar/hello#1][em *]"); -- -- MT("vanillaLink", -- "foo [link http://www.example.com/] bar"); -- -- MT("vanillaLinkPunctuation", -- "foo [link http://www.example.com/]. bar"); -- -- MT("vanillaLinkExtension", -- "foo [link http://www.example.com/index.html] bar"); -- -- MT("vanillaLinkEmphasis", -- "foo [em *][em&link http://www.example.com/index.html][em *] bar"); -- -- MT("notALink", -- "[comment ```css]", -- "[tag foo] {[property color]:[keyword black];}", -- "[comment ```][link http://www.example.com/]"); -- -- MT("notALink", -- "[comment ``foo `bar` http://www.example.com/``] hello"); -- -- MT("notALink", -- "[comment `foo]", -- "[link http://www.example.com/]", -- "[comment `foo]", -- "", -- "[link http://www.example.com/]"); -- -- MT("headerCodeBlockGithub", -- "[header&header-1 # heading]", -- "", -- "[comment ```]", -- "[comment code]", -- "[comment ```]", -- "", -- "Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]", -- "Issue: [link #1]", -- "Link: [link http://www.example.com/]"); -- -- MT("strikethrough", -- "[strikethrough ~~foo~~]"); -- -- MT("strikethroughWithStartingSpace", -- "~~ foo~~"); -- -- MT("strikethroughUnclosedStrayTildes", -- "[strikethrough ~~foo~~~]"); -- -- MT("strikethroughUnclosedStrayTildes", -- "[strikethrough ~~foo ~~]"); -- -- MT("strikethroughUnclosedStrayTildes", -- "[strikethrough ~~foo ~~ bar]"); -- -- MT("strikethroughUnclosedStrayTildes", -- "[strikethrough ~~foo ~~ bar~~]hello"); -- -- MT("strikethroughOneLetter", -- "[strikethrough ~~a~~]"); -- -- MT("strikethroughWrapped", -- "[strikethrough ~~foo]", -- "[strikethrough foo~~]"); -- -- MT("strikethroughParagraph", -- "[strikethrough ~~foo]", -- "", -- "foo[strikethrough ~~bar]"); -- -- MT("strikethroughEm", -- "[strikethrough ~~foo][em&strikethrough *bar*][strikethrough ~~]"); -- -- MT("strikethroughEm", -- "[em *][em&strikethrough ~~foo~~][em *]"); -- -- MT("strikethroughStrong", -- "[strikethrough ~~][strong&strikethrough **foo**][strikethrough ~~]"); -- -- MT("strikethroughStrong", -- "[strong **][strong&strikethrough ~~foo~~][strong **]"); -- --})(); -diff --git a/media/editors/codemirror/mode/gfm/test.min.js b/media/editors/codemirror/mode/gfm/test.min.js -deleted file mode 100644 -index d229c46..0000000 ---- a/media/editors/codemirror/mode/gfm/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function o(o){test.mode(o,t,Array.prototype.slice.call(arguments,1))}function e(o){test.mode(o,r,Array.prototype.slice.call(arguments,1))}var t=CodeMirror.getMode({tabSize:4},"gfm"),r=CodeMirror.getMode({tabSize:4},{name:"gfm",highlightFormatting:!0});e("codeBackticks","[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"),e("doubleBackticks","[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"),e("codeBlock","[comment&formatting&formatting-code-block ```css]","[tag foo]","[comment&formatting&formatting-code-block ```]"),e("taskList","[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]","[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]"),e("formatting_strikethrough","[strikethrough&formatting&formatting-strikethrough ~~][strikethrough foo][strikethrough&formatting&formatting-strikethrough ~~]"),e("formatting_strikethrough","foo [strikethrough&formatting&formatting-strikethrough ~~][strikethrough bar][strikethrough&formatting&formatting-strikethrough ~~]"),o("emInWordAsterisk","foo[em *bar*]hello"),o("emInWordUnderscore","foo_bar_hello"),o("emStrongUnderscore","[strong __][em&strong _foo__][em _] bar"),o("fencedCodeBlocks","[comment ```]","[comment foo]","","[comment ```]","bar"),o("fencedCodeBlockModeSwitching","[comment ```javascript]","[variable foo]","","[comment ```]","bar"),o("taskListAsterisk","[variable-2 * []] foo]","[variable-2 * [ ]]bar]","[variable-2 * [x]]hello]","[variable-2 * ][meta [ ]]][variable-2 [world]]]"," [variable-3 * ][property [x]]][variable-3 foo]"),o("taskListPlus","[variable-2 + []] foo]","[variable-2 + [ ]]bar]","[variable-2 + [x]]hello]","[variable-2 + ][meta [ ]]][variable-2 [world]]]"," [variable-3 + ][property [x]]][variable-3 foo]"),o("taskListDash","[variable-2 - []] foo]","[variable-2 - [ ]]bar]","[variable-2 - [x]]hello]","[variable-2 - ][meta [ ]]][variable-2 [world]]]"," [variable-3 - ][property [x]]][variable-3 foo]"),o("taskListNumber","[variable-2 1. []] foo]","[variable-2 2. [ ]]bar]","[variable-2 3. [x]]hello]","[variable-2 4. ][meta [ ]]][variable-2 [world]]]"," [variable-3 1. ][property [x]]][variable-3 foo]"),o("SHA","foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar"),o("SHAEmphasis","[em *foo ][em&link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"),o("shortSHA","foo [link be6a8cc] bar"),o("tooShortSHA","foo be6a8c bar"),o("longSHA","foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar"),o("badSHA","foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar"),o("userSHA","foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello"),o("userSHAEmphasis","[em *foo ][em&link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"),o("userProjectSHA","foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world"),o("userProjectSHAEmphasis","[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]"),o("num","foo [link #1] bar"),o("numEmphasis","[em *foo ][em&link #1][em *]"),o("badNum","foo #1bar hello"),o("userNum","foo [link bar#1] hello"),o("userNumEmphasis","[em *foo ][em&link bar#1][em *]"),o("userProjectNum","foo [link bar/hello#1] world"),o("userProjectNumEmphasis","[em *foo ][em&link bar/hello#1][em *]"),o("vanillaLink","foo [link http://www.example.com/] bar"),o("vanillaLinkPunctuation","foo [link http://www.example.com/]. bar"),o("vanillaLinkExtension","foo [link http://www.example.com/index.html] bar"),o("vanillaLinkEmphasis","foo [em *][em&link http://www.example.com/index.html][em *] bar"),o("notALink","[comment ```css]","[tag foo] {[property color]:[keyword black];}","[comment ```][link http://www.example.com/]"),o("notALink","[comment ``foo `bar` http://www.example.com/``] hello"),o("notALink","[comment `foo]","[link http://www.example.com/]","[comment `foo]","","[link http://www.example.com/]"),o("headerCodeBlockGithub","[header&header-1 # heading]","","[comment ```]","[comment code]","[comment ```]","","Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]","Issue: [link #1]","Link: [link http://www.example.com/]"),o("strikethrough","[strikethrough ~~foo~~]"),o("strikethroughWithStartingSpace","~~ foo~~"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo~~~]"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo ~~]"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo ~~ bar]"),o("strikethroughUnclosedStrayTildes","[strikethrough ~~foo ~~ bar~~]hello"),o("strikethroughOneLetter","[strikethrough ~~a~~]"),o("strikethroughWrapped","[strikethrough ~~foo]","[strikethrough foo~~]"),o("strikethroughParagraph","[strikethrough ~~foo]","","foo[strikethrough ~~bar]"),o("strikethroughEm","[strikethrough ~~foo][em&strikethrough *bar*][strikethrough ~~]"),o("strikethroughEm","[em *][em&strikethrough ~~foo~~][em *]"),o("strikethroughStrong","[strikethrough ~~][strong&strikethrough **foo**][strikethrough ~~]"),o("strikethroughStrong","[strong **][strong&strikethrough ~~foo~~][strong **]")}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/gherkin/gherkin.min.js b/media/editors/codemirror/mode/gherkin/gherkin.min.js -index 873b25c..4033dda 100644 ---- a/media/editors/codemirror/mode/gherkin/gherkin.min.js -+++ b/media/editors/codemirror/mode/gherkin/gherkin.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("gherkin",function(){return{startState:function(){return{lineNumber:0,tableHeaderLine:!1,allowFeature:!0,allowBackground:!1,allowScenario:!1,allowSteps:!1,allowPlaceholders:!1,allowMultilineArgument:!1,inMultilineString:!1,inMultilineTable:!1,inKeywordLine:!1}},token:function(e,a){if(e.sol()&&(a.lineNumber++,a.inKeywordLine=!1,a.inMultilineTable&&(a.tableHeaderLine=!1,e.match(/\s*\|/,!1)||(a.allowMultilineArgument=!1,a.inMultilineTable=!1))),e.eatSpace(),a.allowMultilineArgument){if(a.inMultilineString)return e.match('"""')?(a.inMultilineString=!1,a.allowMultilineArgument=!1):e.match(/.*/),"string";if(a.inMultilineTable)return e.match(/\|\s*/)?"bracket":(e.match(/[^\|]*/),a.tableHeaderLine?"header":"string");if(e.match('"""'))return a.inMultilineString=!0,"string";if(e.match("|"))return a.inMultilineTable=!0,a.tableHeaderLine=!0,"bracket"}return e.match(/#.*/)?"comment":!a.inKeywordLine&&e.match(/@\S+/)?"tag":!a.inKeywordLine&&a.allowFeature&&e.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)?(a.allowScenario=!0,a.allowBackground=!0,a.allowPlaceholders=!1,a.allowSteps=!1,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):!a.inKeywordLine&&a.allowBackground&&e.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)?(a.allowPlaceholders=!1,a.allowSteps=!0,a.allowBackground=!1,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):!a.inKeywordLine&&a.allowScenario&&e.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)?(a.allowPlaceholders=!0,a.allowSteps=!0,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):a.allowScenario&&e.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)?(a.allowPlaceholders=!1,a.allowSteps=!0,a.allowBackground=!1,a.allowMultilineArgument=!0,"keyword"):!a.inKeywordLine&&a.allowScenario&&e.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)?(a.allowPlaceholders=!1,a.allowSteps=!0,a.allowBackground=!1,a.allowMultilineArgument=!1,a.inKeywordLine=!0,"keyword"):!a.inKeywordLine&&a.allowSteps&&e.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)?(a.inStep=!0,a.allowPlaceholders=!0,a.allowMultilineArgument=!0,a.inKeywordLine=!0,"keyword"):e.match(/"[^"]*"?/)?"string":a.allowPlaceholders&&e.match(/<[^>]*>?/)?"variable":(e.next(),e.eatWhile(/[^@"<#]/),null)}}}),e.defineMIME("text/x-feature","gherkin")}); -\ 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("gherkin",function(){return{startState:function(){return{lineNumber:0,tableHeaderLine:!1,allowFeature:!0,allowBackground:!1,allowScenario:!1,allowSteps:!1,allowPlaceholders:!1,allowMultilineArgument:!1,inMultilineString:!1,inMultilineTable:!1,inKeywordLine:!1}},token:function(a,b){if(a.sol()&&(b.lineNumber++,b.inKeywordLine=!1,b.inMultilineTable&&(b.tableHeaderLine=!1,a.match(/\s*\|/,!1)||(b.allowMultilineArgument=!1,b.inMultilineTable=!1))),a.eatSpace(),b.allowMultilineArgument){if(b.inMultilineString)return a.match('"""')?(b.inMultilineString=!1,b.allowMultilineArgument=!1):a.match(/.*/),"string";if(b.inMultilineTable)return a.match(/\|\s*/)?"bracket":(a.match(/[^\|]*/),b.tableHeaderLine?"header":"string");if(a.match('"""'))return b.inMultilineString=!0,"string";if(a.match("|"))return b.inMultilineTable=!0,b.tableHeaderLine=!0,"bracket"}return a.match(/#.*/)?"comment":!b.inKeywordLine&&a.match(/@\S+/)?"tag":!b.inKeywordLine&&b.allowFeature&&a.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)?(b.allowScenario=!0,b.allowBackground=!0,b.allowPlaceholders=!1,b.allowSteps=!1,b.allowMultilineArgument=!1,b.inKeywordLine=!0,"keyword"):!b.inKeywordLine&&b.allowBackground&&a.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)?(b.allowPlaceholders=!1,b.allowSteps=!0,b.allowBackground=!1,b.allowMultilineArgument=!1,b.inKeywordLine=!0,"keyword"):!b.inKeywordLine&&b.allowScenario&&a.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)?(b.allowPlaceholders=!0,b.allowSteps=!0,b.allowMultilineArgument=!1,b.inKeywordLine=!0,"keyword"):b.allowScenario&&a.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)?(b.allowPlaceholders=!1,b.allowSteps=!0,b.allowBackground=!1,b.allowMultilineArgument=!0,"keyword"):!b.inKeywordLine&&b.allowScenario&&a.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)?(b.allowPlaceholders=!1,b.allowSteps=!0,b.allowBackground=!1,b.allowMultilineArgument=!1,b.inKeywordLine=!0,"keyword"):!b.inKeywordLine&&b.allowSteps&&a.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)?(b.inStep=!0,b.allowPlaceholders=!0,b.allowMultilineArgument=!0,b.inKeywordLine=!0,"keyword"):a.match(/"[^"]*"?/)?"string":b.allowPlaceholders&&a.match(/<[^>]*>?/)?"variable":(a.next(),a.eatWhile(/[^@"<#]/),null)}}}),a.defineMIME("text/x-feature","gherkin")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/go/go.min.js b/media/editors/codemirror/mode/go/go.min.js -index c52396e..88a7335 100644 ---- a/media/editors/codemirror/mode/go/go.min.js -+++ b/media/editors/codemirror/mode/go/go.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("go",function(e){function t(e,t){var i=e.next();if('"'==i||"'"==i||"`"==i)return t.tokenize=n(i),t.tokenize(e,t);if(/[\d\.]/.test(i))return"."==i?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==i?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(i))return c=i,null;if("/"==i){if(e.eat("*"))return t.tokenize=r,r(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(d.test(i))return e.eatWhile(d),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var o=e.current();return l.propertyIsEnumerable(o)?(("case"==o||"default"==o)&&(c="case"),"keyword"):f.propertyIsEnumerable(o)?"atom":"variable"}function n(e){return function(n,r){for(var i,o=!1,a=!1;null!=(i=n.next());){if(i==e&&!o){a=!0;break}o=!o&&"\\"==i}return(a||!o&&"`"!=e)&&(r.tokenize=t),"string"}}function r(e,n){for(var r,i=!1;r=e.next();){if("/"==r&&i){n.tokenize=t;break}i="*"==r}return"comment"}function i(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function o(e,t,n){return e.context=new i(e.indented,t,n,null,e.context)}function a(e){if(e.context.prev){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}}var c,u=e.indentUnit,l={"break":!0,"case":!0,chan:!0,"const":!0,"continue":!0,"default":!0,defer:!0,"else":!0,fallthrough:!0,"for":!0,func:!0,go:!0,"goto":!0,"if":!0,"import":!0,"interface":!0,map:!0,"package":!0,range:!0,"return":!0,select:!0,struct:!0,"switch":!0,type:!0,"var":!0,bool:!0,"byte":!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,"int":!0,uint:!0,uintptr:!0},f={"true":!0,"false":!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,"new":!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},d=/[+\-*&^%:=<>!|\/]/;return{startState:function(e){return{tokenize:null,context:new i((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,n){var r=n.context;if(e.sol()&&(null==r.align&&(r.align=!1),n.indented=e.indentation(),n.startOfLine=!0,"case"==r.type&&(r.type="}")),e.eatSpace())return null;c=null;var i=(n.tokenize||t)(e,n);return"comment"==i?i:(null==r.align&&(r.align=!0),"{"==c?o(n,e.column(),"}"):"["==c?o(n,e.column(),"]"):"("==c?o(n,e.column(),")"):"case"==c?r.type="case":"}"==c&&"}"==r.type?r=a(n):c==r.type&&a(n),n.startOfLine=!1,i)},indent:function(e,n){if(e.tokenize!=t&&null!=e.tokenize)return 0;var r=e.context,i=n&&n.charAt(0);if("case"==r.type&&/^(?:case|default)\b/.test(n))return e.context.type="}",r.indented;var o=i==r.type;return r.align?r.column+(o?0:1):r.indented+(o?0:u)},electricChars:"{}):",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-go","go")}); -\ 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("go",function(a){function b(a,b){var e=a.next();if('"'==e||"'"==e||"`"==e)return b.tokenize=c(e),b.tokenize(a,b);if(/[\d\.]/.test(e))return"."==e?a.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==e?a.match(/^[xX][0-9a-fA-F]+/)||a.match(/^0[0-7]+/):a.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(e))return h=e,null;if("/"==e){if(a.eat("*"))return b.tokenize=d,d(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(l.test(e))return a.eatWhile(l),"operator";a.eatWhile(/[\w\$_\xa1-\uffff]/);var f=a.current();return j.propertyIsEnumerable(f)?(("case"==f||"default"==f)&&(h="case"),"keyword"):k.propertyIsEnumerable(f)?"atom":"variable"}function c(a){return function(c,d){for(var e,f=!1,g=!1;null!=(e=c.next());){if(e==a&&!f){g=!0;break}f=!f&&"\\"==e}return(g||!f&&"`"!=a)&&(d.tokenize=b),"string"}}function d(a,c){for(var d,e=!1;d=a.next();){if("/"==d&&e){c.tokenize=b;break}e="*"==d}return"comment"}function e(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function f(a,b,c){return a.context=new e(a.indented,b,c,null,a.context)}function g(a){if(a.context.prev){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}}var h,i=a.indentUnit,j={"break":!0,"case":!0,chan:!0,"const":!0,"continue":!0,"default":!0,defer:!0,"else":!0,fallthrough:!0,"for":!0,func:!0,go:!0,"goto":!0,"if":!0,"import":!0,"interface":!0,map:!0,"package":!0,range:!0,"return":!0,select:!0,struct:!0,"switch":!0,type:!0,"var":!0,bool:!0,"byte":!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,"int":!0,uint:!0,uintptr:!0},k={"true":!0,"false":!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,"new":!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},l=/[+\-*&^%:=<>!|\/]/;return{startState:function(a){return{tokenize:null,context:new e((a||0)-i,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,c){var d=c.context;if(a.sol()&&(null==d.align&&(d.align=!1),c.indented=a.indentation(),c.startOfLine=!0,"case"==d.type&&(d.type="}")),a.eatSpace())return null;h=null;var e=(c.tokenize||b)(a,c);return"comment"==e?e:(null==d.align&&(d.align=!0),"{"==h?f(c,a.column(),"}"):"["==h?f(c,a.column(),"]"):"("==h?f(c,a.column(),")"):"case"==h?d.type="case":"}"==h&&"}"==d.type?d=g(c):h==d.type&&g(c),c.startOfLine=!1,e)},indent:function(a,c){if(a.tokenize!=b&&null!=a.tokenize)return 0;var d=a.context,e=c&&c.charAt(0);if("case"==d.type&&/^(?:case|default)\b/.test(c))return a.context.type="}",d.indented;var f=e==d.type;return d.align?d.column+(f?0:1):d.indented+(f?0:i)},electricChars:"{}):",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),a.defineMIME("text/x-go","go")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/groovy/groovy.js b/media/editors/codemirror/mode/groovy/groovy.js -index 89b8224..e3a1db8 100644 ---- a/media/editors/codemirror/mode/groovy/groovy.js -+++ b/media/editors/codemirror/mode/groovy/groovy.js -@@ -217,6 +217,7 @@ CodeMirror.defineMode("groovy", function(config) { - }, - - electricChars: "{}", -+ closeBrackets: {triples: "'\""}, - fold: "brace" - }; - }); -diff --git a/media/editors/codemirror/mode/groovy/groovy.min.js b/media/editors/codemirror/mode/groovy/groovy.min.js -index a251b5e..8d9e7cd 100644 ---- a/media/editors/codemirror/mode/groovy/groovy.min.js -+++ b/media/editors/codemirror/mode/groovy/groovy.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("groovy",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r"))return f="->",null;if(/[+\-*&%=<>!?|\/~]/.test(n))return e.eatWhile(/[+\-*&%=<>|~]/),"operator";if(e.eatWhile(/[\w\$_]/),"@"==n)return e.eatWhile(/[\w\$_\.]/),"meta";if("."==t.lastToken)return"property";if(e.eat(":"))return f="proplabel","property";var i=e.current();return d.propertyIsEnumerable(i)?"atom":c.propertyIsEnumerable(i)?(p.propertyIsEnumerable(i)&&(f="newstatement"),"keyword"):"variable"}function r(e,t,n){function r(t,n){for(var r,a=!1,l=!o;null!=(r=t.next());){if(r==e&&!a){if(!o)break;if(t.match(e+e)){l=!0;break}}if('"'==e&&"$"==r&&!a&&t.eat("{"))return n.tokenize.push(i()),"string";a=!a&&"\\"==r}return l&&n.tokenize.pop(),"string"}var o=!1;if("/"!=e&&t.eat(e)){if(!t.eat(e))return"string";o=!0}return n.tokenize.push(r),r(t,n)}function i(){function e(e,r){if("}"==e.peek()){if(t--,0==t)return r.tokenize.pop(),r.tokenize[r.tokenize.length-1](e,r)}else"{"==e.peek()&&t++;return n(e,r)}var t=1;return e.isBase=!0,e}function o(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize.pop();break}r="*"==n}return"comment"}function a(e){return!e||"operator"==e||"->"==e||/[\.\[\{\(,;:]/.test(e)||"newstatement"==e||"keyword"==e||"proplabel"==e}function l(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function s(e,t,n){return e.context=new l(e.indented,t,n,null,e.context)}function u(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var f,c=t("abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws transient try void volatile while"),p=t("catch class do else finally for if switch try while enum interface def"),d=t("null true false this");return n.isBase=!0,{startState:function(t){return{tokenize:[n],context:new l((t||0)-e.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"statement"!=n.type||a(t.lastToken)||(u(t),n=t.context)),e.eatSpace())return null;f=null;var r=t.tokenize[t.tokenize.length-1](e,t);if("comment"==r)return r;if(null==n.align&&(n.align=!0),";"!=f&&":"!=f||"statement"!=n.type)if("->"==f&&"statement"==n.type&&"}"==n.prev.type)u(t),t.context.align=!1;else if("{"==f)s(t,e.column(),"}");else if("["==f)s(t,e.column(),"]");else if("("==f)s(t,e.column(),")");else if("}"==f){for(;"statement"==n.type;)n=u(t);for("}"==n.type&&(n=u(t));"statement"==n.type;)n=u(t)}else f==n.type?u(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==f)&&s(t,e.column(),"statement");else u(t);return t.startOfLine=!1,t.lastToken=f||r,r},indent:function(t,n){if(!t.tokenize[t.tokenize.length-1].isBase)return 0;var r=n&&n.charAt(0),i=t.context;"statement"!=i.type||a(t.lastToken)||(i=i.prev);var o=r==i.type;return"statement"==i.type?i.indented+("{"==r?0:e.indentUnit):i.align?i.column+(o?0:1):i.indented+(o?0:e.indentUnit)},electricChars:"{}",fold:"brace"}}),e.defineMIME("text/x-groovy","groovy")}); -\ 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("groovy",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d"))return k="->",null;if(/[+\-*&%=<>!?|\/~]/.test(c))return a.eatWhile(/[+\-*&%=<>|~]/),"operator";if(a.eatWhile(/[\w\$_]/),"@"==c)return a.eatWhile(/[\w\$_\.]/),"meta";if("."==b.lastToken)return"property";if(a.eat(":"))return k="proplabel","property";var e=a.current();return n.propertyIsEnumerable(e)?"atom":l.propertyIsEnumerable(e)?(m.propertyIsEnumerable(e)&&(k="newstatement"),"keyword"):"variable"}function d(a,b,c){function d(b,c){for(var d,g=!1,h=!f;null!=(d=b.next());){if(d==a&&!g){if(!f)break;if(b.match(a+a)){h=!0;break}}if('"'==a&&"$"==d&&!g&&b.eat("{"))return c.tokenize.push(e()),"string";g=!g&&"\\"==d}return h&&c.tokenize.pop(),"string"}var f=!1;if("/"!=a&&b.eat(a)){if(!b.eat(a))return"string";f=!0}return c.tokenize.push(d),d(b,c)}function e(){function a(a,d){if("}"==a.peek()){if(b--,0==b)return d.tokenize.pop(),d.tokenize[d.tokenize.length-1](a,d)}else"{"==a.peek()&&b++;return c(a,d)}var b=1;return a.isBase=!0,a}function f(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize.pop();break}d="*"==c}return"comment"}function g(a){return!a||"operator"==a||"->"==a||/[\.\[\{\(,;:]/.test(a)||"newstatement"==a||"keyword"==a||"proplabel"==a}function h(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function i(a,b,c){return a.context=new h(a.indented,b,c,null,a.context)}function j(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var k,l=b("abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws transient try void volatile while"),m=b("catch class do else finally for if switch try while enum interface def"),n=b("null true false this");return c.isBase=!0,{startState:function(b){return{tokenize:[c],context:new h((b||0)-a.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0,"statement"!=c.type||g(b.lastToken)||(j(b),c=b.context)),a.eatSpace())return null;k=null;var d=b.tokenize[b.tokenize.length-1](a,b);if("comment"==d)return d;if(null==c.align&&(c.align=!0),";"!=k&&":"!=k||"statement"!=c.type)if("->"==k&&"statement"==c.type&&"}"==c.prev.type)j(b),b.context.align=!1;else if("{"==k)i(b,a.column(),"}");else if("["==k)i(b,a.column(),"]");else if("("==k)i(b,a.column(),")");else if("}"==k){for(;"statement"==c.type;)c=j(b);for("}"==c.type&&(c=j(b));"statement"==c.type;)c=j(b)}else k==c.type?j(b):("}"==c.type||"top"==c.type||"statement"==c.type&&"newstatement"==k)&&i(b,a.column(),"statement");else j(b);return b.startOfLine=!1,b.lastToken=k||d,d},indent:function(b,c){if(!b.tokenize[b.tokenize.length-1].isBase)return 0;var d=c&&c.charAt(0),e=b.context;"statement"!=e.type||g(b.lastToken)||(e=e.prev);var f=d==e.type;return"statement"==e.type?e.indented+("{"==d?0:a.indentUnit):e.align?e.column+(f?0:1):e.indented+(f?0:a.indentUnit)},electricChars:"{}",closeBrackets:{triples:"'\""},fold:"brace"}}),a.defineMIME("text/x-groovy","groovy")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/haml/haml.min.js b/media/editors/codemirror/mode/haml/haml.min.js -index 8fe9598..7ae4029 100644 ---- a/media/editors/codemirror/mode/haml/haml.min.js -+++ b/media/editors/codemirror/mode/haml/haml.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("haml",function(t){function n(e){return function(t,n){var o=t.peek();return o==e&&1==n.rubyState.tokenize.length?(t.next(),n.tokenize=r,"closeAttributeTag"):i(t,n)}}function i(e,t){return e.match("-#")?(e.skipToEnd(),"comment"):u.token(e,t.rubyState)}function r(e,t){var r=e.peek();if("comment"==t.previousToken.style&&t.indented>t.previousToken.indented)return e.skipToEnd(),"commentLine";if(t.startOfLine){if("!"==r&&e.match("!!"))return e.skipToEnd(),"tag";if(e.match(/^%[\w:#\.]+=/))return t.tokenize=i,"hamlTag";if(e.match(/^%[\w:]+/))return"hamlTag";if("/"==r)return e.skipToEnd(),"comment"}if((t.startOfLine||"hamlTag"==t.previousToken.style)&&("#"==r||"."==r))return e.match(/[\w-#\.]*/),"hamlAttribute";if(t.startOfLine&&!e.match("-->",!1)&&("="==r||"-"==r))return t.tokenize=i,t.tokenize(e,t);if("hamlTag"==t.previousToken.style||"closeAttributeTag"==t.previousToken.style||"hamlAttribute"==t.previousToken.style){if("("==r)return t.tokenize=n(")"),t.tokenize(e,t);if("{"==r)return t.tokenize=n("}"),t.tokenize(e,t)}return o.token(e,t.htmlState)}var o=e.getMode(t,{name:"htmlmixed"}),u=e.getMode(t,"ruby");return{startState:function(){var e=o.startState(),t=u.startState();return{htmlState:e,rubyState:t,indented:0,previousToken:{style:null,indented:0},tokenize:r}},copyState:function(t){return{htmlState:e.copyState(o,t.htmlState),rubyState:e.copyState(u,t.rubyState),indented:t.indented,previousToken:t.previousToken,tokenize:t.tokenize}},token:function(e,t){if(e.sol()&&(t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;var n=t.tokenize(e,t);if(t.startOfLine=!1,n&&"commentLine"!=n&&(t.previousToken={style:n,indented:t.indented}),e.eol()&&t.tokenize==i){e.backUp(1);var o=e.peek();e.next(),o&&","!=o&&(t.tokenize=r)}return"hamlTag"==n?n="tag":"commentLine"==n?n="comment":"hamlAttribute"==n?n="attribute":"closeAttributeTag"==n&&(n=null),n}}},"htmlmixed","ruby"),e.defineMIME("text/x-haml","haml")}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("haml",function(b){function c(a){return function(b,c){var f=b.peek();return f==a&&1==c.rubyState.tokenize.length?(b.next(),c.tokenize=e,"closeAttributeTag"):d(b,c)}}function d(a,b){return a.match("-#")?(a.skipToEnd(),"comment"):g.token(a,b.rubyState)}function e(a,b){var e=a.peek();if("comment"==b.previousToken.style&&b.indented>b.previousToken.indented)return a.skipToEnd(),"commentLine";if(b.startOfLine){if("!"==e&&a.match("!!"))return a.skipToEnd(),"tag";if(a.match(/^%[\w:#\.]+=/))return b.tokenize=d,"hamlTag";if(a.match(/^%[\w:]+/))return"hamlTag";if("/"==e)return a.skipToEnd(),"comment"}if((b.startOfLine||"hamlTag"==b.previousToken.style)&&("#"==e||"."==e))return a.match(/[\w-#\.]*/),"hamlAttribute";if(b.startOfLine&&!a.match("-->",!1)&&("="==e||"-"==e))return b.tokenize=d,b.tokenize(a,b);if("hamlTag"==b.previousToken.style||"closeAttributeTag"==b.previousToken.style||"hamlAttribute"==b.previousToken.style){if("("==e)return b.tokenize=c(")"),b.tokenize(a,b);if("{"==e)return b.tokenize=c("}"),b.tokenize(a,b)}return f.token(a,b.htmlState)}var f=a.getMode(b,{name:"htmlmixed"}),g=a.getMode(b,"ruby");return{startState:function(){var a=f.startState(),b=g.startState();return{htmlState:a,rubyState:b,indented:0,previousToken:{style:null,indented:0},tokenize:e}},copyState:function(b){return{htmlState:a.copyState(f,b.htmlState),rubyState:a.copyState(g,b.rubyState),indented:b.indented,previousToken:b.previousToken,tokenize:b.tokenize}},token:function(a,b){if(a.sol()&&(b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;var c=b.tokenize(a,b);if(b.startOfLine=!1,c&&"commentLine"!=c&&(b.previousToken={style:c,indented:b.indented}),a.eol()&&b.tokenize==d){a.backUp(1);var f=a.peek();a.next(),f&&","!=f&&(b.tokenize=e)}return"hamlTag"==c?c="tag":"commentLine"==c?c="comment":"hamlAttribute"==c?c="attribute":"closeAttributeTag"==c&&(c=null),c}}},"htmlmixed","ruby"),a.defineMIME("text/x-haml","haml")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/haml/test.js b/media/editors/codemirror/mode/haml/test.js -deleted file mode 100644 -index 508458a..0000000 ---- a/media/editors/codemirror/mode/haml/test.js -+++ /dev/null -@@ -1,97 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "haml"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- -- // Requires at least one media query -- MT("elementName", -- "[tag %h1] Hey There"); -- -- MT("oneElementPerLine", -- "[tag %h1] Hey There %h2"); -- -- MT("idSelector", -- "[tag %h1][attribute #test] Hey There"); -- -- MT("classSelector", -- "[tag %h1][attribute .hello] Hey There"); -- -- MT("docType", -- "[tag !!! XML]"); -- -- MT("comment", -- "[comment / Hello WORLD]"); -- -- MT("notComment", -- "[tag %h1] This is not a / comment "); -- -- MT("attributes", -- "[tag %a]([variable title][operator =][string \"test\"]){[atom :title] [operator =>] [string \"test\"]}"); -- -- MT("htmlCode", -- "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"); -- -- MT("rubyBlock", -- "[operator =][variable-2 @item]"); -- -- MT("selectorRubyBlock", -- "[tag %a.selector=] [variable-2 @item]"); -- -- MT("nestedRubyBlock", -- "[tag %a]", -- " [operator =][variable puts] [string \"test\"]"); -- -- MT("multilinePlaintext", -- "[tag %p]", -- " Hello,", -- " World"); -- -- MT("multilineRuby", -- "[tag %p]", -- " [comment -# this is a comment]", -- " [comment and this is a comment too]", -- " Date/Time", -- " [operator -] [variable now] [operator =] [tag DateTime][operator .][property now]", -- " [tag %strong=] [variable now]", -- " [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])", -- " [operator =][string \"Happy\"]", -- " [operator =][string \"Belated\"]", -- " [operator =][string \"Birthday\"]"); -- -- MT("multilineComment", -- "[comment /]", -- " [comment Multiline]", -- " [comment Comment]"); -- -- MT("hamlComment", -- "[comment -# this is a comment]"); -- -- MT("multilineHamlComment", -- "[comment -# this is a comment]", -- " [comment and this is a comment too]"); -- -- MT("multilineHTMLComment", -- "[comment ]"); -- -- MT("hamlAfterRubyTag", -- "[attribute .block]", -- " [tag %strong=] [variable now]", -- " [attribute .test]", -- " [operator =][variable now]", -- " [attribute .right]"); -- -- MT("stretchedRuby", -- "[operator =] [variable puts] [string \"Hello\"],", -- " [string \"World\"]"); -- -- MT("interpolationInHashAttribute", -- //"[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); -- "[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); -- -- MT("interpolationInHTMLAttribute", -- "[tag %div]([variable title][operator =][string \"#{][variable test][string }_#{][variable ting]()[string }\"]) Test"); --})(); -diff --git a/media/editors/codemirror/mode/haml/test.min.js b/media/editors/codemirror/mode/haml/test.min.js -deleted file mode 100644 -index 281a376..0000000 ---- a/media/editors/codemirror/mode/haml/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4,indentUnit:2},"haml");t("elementName","[tag %h1] Hey There"),t("oneElementPerLine","[tag %h1] Hey There %h2"),t("idSelector","[tag %h1][attribute #test] Hey There"),t("classSelector","[tag %h1][attribute .hello] Hey There"),t("docType","[tag !!! XML]"),t("comment","[comment / Hello WORLD]"),t("notComment","[tag %h1] This is not a / comment "),t("attributes",'[tag %a]([variable title][operator =][string "test"]){[atom :title] [operator =>] [string "test"]}'),t("htmlCode","[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"),t("rubyBlock","[operator =][variable-2 @item]"),t("selectorRubyBlock","[tag %a.selector=] [variable-2 @item]"),t("nestedRubyBlock","[tag %a]",' [operator =][variable puts] [string "test"]'),t("multilinePlaintext","[tag %p]"," Hello,"," World"),t("multilineRuby","[tag %p]"," [comment -# this is a comment]"," [comment and this is a comment too]"," Date/Time"," [operator -] [variable now] [operator =] [tag DateTime][operator .][property now]"," [tag %strong=] [variable now]",' [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string "December 31, 2006"])',' [operator =][string "Happy"]',' [operator =][string "Belated"]',' [operator =][string "Birthday"]'),t("multilineComment","[comment /]"," [comment Multiline]"," [comment Comment]"),t("hamlComment","[comment -# this is a comment]"),t("multilineHamlComment","[comment -# this is a comment]"," [comment and this is a comment too]"),t("multilineHTMLComment","[comment ]"),t("hamlAfterRubyTag","[attribute .block]"," [tag %strong=] [variable now]"," [attribute .test]"," [operator =][variable now]"," [attribute .right]"),t("stretchedRuby",'[operator =] [variable puts] [string "Hello"],',' [string "World"]'),t("interpolationInHashAttribute",'[tag %div]{[atom :id] [operator =>] [string "#{][variable test][string }_#{][variable ting][string }"]} test'),t("interpolationInHTMLAttribute",'[tag %div]([variable title][operator =][string "#{][variable test][string }_#{][variable ting]()[string }"]) Test')}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/handlebars/handlebars.js b/media/editors/codemirror/mode/handlebars/handlebars.js -new file mode 100644 -index 0000000..40dfea4 ---- /dev/null -+++ b/media/editors/codemirror/mode/handlebars/handlebars.js -@@ -0,0 +1,53 @@ -+// CodeMirror, copyright (c) by Marijn Haverbeke and others -+// Distributed under an MIT license: http://codemirror.net/LICENSE -+ -+(function(mod) { -+ if (typeof exports == "object" && typeof module == "object") // CommonJS -+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); -+ else if (typeof define == "function" && define.amd) // AMD -+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod); -+ else // Plain browser env -+ mod(CodeMirror); -+})(function(CodeMirror) { -+ "use strict"; -+ -+ CodeMirror.defineSimpleMode("handlebars", { -+ start: [ -+ { regex: /\{\{!--/, push: "dash_comment", token: "comment" }, -+ { regex: /\{\{!/, push: "comment", token: "comment" }, -+ { regex: /\{\{/, push: "handlebars", token: "tag" } -+ ], -+ handlebars: [ -+ { regex: /\}\}/, pop: true, token: "tag" }, -+ -+ // Double and single quotes -+ { regex: /"(?:[^\\]|\\.)*?"/, token: "string" }, -+ { regex: /'(?:[^\\]|\\.)*?'/, token: "string" }, -+ -+ // Handlebars keywords -+ { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" }, -+ { regex: /(?:else|this)\b/, token: "keyword" }, -+ -+ // Numeral -+ { regex: /\d+/i, token: "number" }, -+ -+ // Atoms like = and . -+ { regex: /=|~|@|true|false/, token: "atom" }, -+ -+ // Paths -+ { regex: /(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/, token: "variable-2" } -+ ], -+ dash_comment: [ -+ { regex: /--\}\}/, pop: true, token: "comment" }, -+ -+ // Commented code -+ { regex: /./, token: "comment"} -+ ], -+ comment: [ -+ { regex: /\}\}/, pop: true, token: "comment" }, -+ { regex: /./, token: "comment" } -+ ] -+ }); -+ -+ CodeMirror.defineMIME("text/x-handlebars-template", "handlebars"); -+}); -diff --git a/media/editors/codemirror/mode/handlebars/handlebars.min.js b/media/editors/codemirror/mode/handlebars/handlebars.min.js -new file mode 100644 -index 0000000..11ce1cb ---- /dev/null -+++ b/media/editors/codemirror/mode/handlebars/handlebars.min.js -@@ -0,0 +1 @@ -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],a):a(CodeMirror)}(function(a){"use strict";a.defineSimpleMode("handlebars",{start:[{regex:/\{\{!--/,push:"dash_comment",token:"comment"},{regex:/\{\{!/,push:"comment",token:"comment"},{regex:/\{\{/,push:"handlebars",token:"tag"}],handlebars:[{regex:/\}\}/,pop:!0,token:"tag"},{regex:/"(?:[^\\]|\\.)*?"/,token:"string"},{regex:/'(?:[^\\]|\\.)*?'/,token:"string"},{regex:/>|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}]}),a.defineMIME("text/x-handlebars-template","handlebars")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/haskell/haskell.min.js b/media/editors/codemirror/mode/haskell/haskell.min.js -index dae7756..c44c3d6 100644 ---- a/media/editors/codemirror/mode/haskell/haskell.min.js -+++ b/media/editors/codemirror/mode/haskell/haskell.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("haskell",function(e,r){function t(e,r,t){return r(t),t(e,r)}function n(e,r){if(e.eatWhile(p))return null;var n=e.next();if(h.test(n)){if("{"==n&&e.eat("-")){var o="comment";return e.eat("#")&&(o="meta"),t(e,r,a(o,1))}return null}if("'"==n)return e.eat("\\"),e.next(),e.eat("'")?"string":"error";if('"'==n)return t(e,r,i);if(l.test(n))return e.eatWhile(d),e.eat(".")?"qualifier":"variable-2";if(u.test(n))return e.eatWhile(d),"variable";if(f.test(n)){if("0"==n){if(e.eat(/[xX]/))return e.eatWhile(s),"integer";if(e.eat(/[oO]/))return e.eatWhile(c),"number"}e.eatWhile(f);var o="number";return e.match(/^\.\d+/)&&(o="number"),e.eat(/[eE]/)&&(o="number",e.eat(/[-+]/),e.eatWhile(f)),o}if("."==n&&e.eat("."))return"keyword";if(m.test(n)){if("-"==n&&e.eat(/-/)&&(e.eatWhile(/-/),!e.eat(m)))return e.skipToEnd(),"comment";var o="variable";return":"==n&&(o="variable-2"),e.eatWhile(m),o}return"error"}function a(e,r){return 0==r?n:function(t,i){for(var o=r;!t.eol();){var u=t.next();if("{"==u&&t.eat("-"))++o;else if("-"==u&&t.eat("}")&&(--o,0==o))return i(n),e}return i(a(e,o)),e}}function i(e,r){for(;!e.eol();){var t=e.next();if('"'==t)return r(n),"string";if("\\"==t){if(e.eol()||e.eat(p))return r(o),"string";e.eat("&")||e.next()}}return r(n),"error"}function o(e,r){return e.eat("\\")?t(e,r,i):(e.next(),r(n),"error")}var u=/[a-z_]/,l=/[A-Z]/,f=/\d/,s=/[0-9A-Fa-f]/,c=/[0-7]/,d=/[a-z_A-Z0-9'\xa1-\uffff]/,m=/[-!#$%&*+.\/<=>?@\\^|~:]/,h=/[(),;[\]`{}]/,p=/[ \t\v\f]/,g=function(){function e(e){return function(){for(var r=0;r","@","~","=>"),e("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**"),e("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),e("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3");var n=r.overrideKeywords;if(n)for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return t}();return{startState:function(){return{f:n}},copyState:function(e){return{f:e.f}},token:function(e,r){var t=r.f(e,function(e){r.f=e}),n=e.current();return g.hasOwnProperty(n)?g[n]:t},blockCommentStart:"{-",blockCommentEnd:"-}",lineComment:"--"}}),e.defineMIME("text/x-haskell","haskell")}); -\ 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("haskell",function(a,b){function c(a,b,c){return b(c),c(a,b)}function d(a,b){if(a.eatWhile(p))return null;var d=a.next();if(o.test(d)){if("{"==d&&a.eat("-")){var g="comment";return a.eat("#")&&(g="meta"),c(a,b,e(g,1))}return null}if("'"==d)return a.eat("\\")?a.next():a.next(),a.eat("'")?"string":"error";if('"'==d)return c(a,b,f);if(i.test(d))return a.eatWhile(m),a.eat(".")?"qualifier":"variable-2";if(h.test(d))return a.eatWhile(m),"variable";if(j.test(d)){if("0"==d){if(a.eat(/[xX]/))return a.eatWhile(k),"integer";if(a.eat(/[oO]/))return a.eatWhile(l),"number"}a.eatWhile(j);var g="number";return a.match(/^\.\d+/)&&(g="number"),a.eat(/[eE]/)&&(g="number",a.eat(/[-+]/),a.eatWhile(j)),g}if("."==d&&a.eat("."))return"keyword";if(n.test(d)){if("-"==d&&a.eat(/-/)&&(a.eatWhile(/-/),!a.eat(n)))return a.skipToEnd(),"comment";var g="variable";return":"==d&&(g="variable-2"),a.eatWhile(n),g}return"error"}function e(a,b){return 0==b?d:function(c,f){for(var g=b;!c.eol();){var h=c.next();if("{"==h&&c.eat("-"))++g;else if("-"==h&&c.eat("}")&&(--g,0==g))return f(d),a}return f(e(a,g)),a}}function f(a,b){for(;!a.eol();){var c=a.next();if('"'==c)return b(d),"string";if("\\"==c){if(a.eol()||a.eat(p))return b(g),"string";a.eat("&")||a.next()}}return b(d),"error"}function g(a,b){return a.eat("\\")?c(a,b,f):(a.next(),b(d),"error")}var h=/[a-z_]/,i=/[A-Z]/,j=/\d/,k=/[0-9A-Fa-f]/,l=/[0-7]/,m=/[a-z_A-Z0-9'\xa1-\uffff]/,n=/[-!#$%&*+.\/<=>?@\\^|~:]/,o=/[(),;[\]`{}]/,p=/[ \t\v\f]/,q=function(){function a(a){return function(){for(var b=0;b","@","~","=>"),a("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**"),a("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),a("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3");var d=b.overrideKeywords;if(d)for(var e in d)d.hasOwnProperty(e)&&(c[e]=d[e]);return c}();return{startState:function(){return{f:d}},copyState:function(a){return{f:a.f}},token:function(a,b){var c=b.f(a,function(a){b.f=a}),d=a.current();return q.hasOwnProperty(d)?q[d]:c},blockCommentStart:"{-",blockCommentEnd:"-}",lineComment:"--"}}),a.defineMIME("text/x-haskell","haskell")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/haxe/haxe.min.js b/media/editors/codemirror/mode/haxe/haxe.min.js -index 6474056..7bdf741 100644 ---- a/media/editors/codemirror/mode/haxe/haxe.min.js -+++ b/media/editors/codemirror/mode/haxe/haxe.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("haxe",function(e,t){function n(e,t,n){return t.tokenize=n,n(e,t)}function r(e,t){for(var n,r=!1;null!=(n=e.next());){if(n==t&&!r)return!1;r=!r&&"\\"==n}return r}function i(e,t,n){return G=e,H=n,t}function a(e,t){var a=e.next();if('"'==a||"'"==a)return n(e,t,o(a));if(/[\[\]{}\(\),;\:\.]/.test(a))return i(a);if("0"==a&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(a)||"-"==a&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if(t.reAllowed&&"~"==a&&e.eat(/\//))return r(e,"/"),e.eatWhile(/[gimsu]/),i("regexp","string-2");if("/"==a)return e.eat("*")?n(e,t,u):e.eat("/")?(e.skipToEnd(),i("comment","comment")):(e.eatWhile(L),i("operator",null,e.current()));if("#"==a)return e.skipToEnd(),i("conditional","meta");if("@"==a)return e.eat(/:/),e.eatWhile(/[\w_]/),i("metadata","meta");if(L.test(a))return e.eatWhile(L),i("operator",null,e.current());var c;if(/[A-Z]/.test(a))return e.eatWhile(/[\w_<>]/),c=e.current(),i("type","variable-3",c);e.eatWhile(/[\w_]/);var c=e.current(),l=K.propertyIsEnumerable(c)&&K[c];return l&&t.kwAllowed?i(l.type,l.style,c):i("variable","variable",c)}function o(e){return function(t,n){return r(t,e)||(n.tokenize=a),i("string","string")}}function u(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=a;break}r="*"==n}return i("comment","comment")}function c(e,t,n,r,i,a){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=a,null!=r&&(this.align=r)}function l(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function f(e,t,n,r,i){var a=e.cc;for(Q.state=e,Q.stream=i,Q.marked=null,Q.cc=a,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=a.length?a.pop():w;if(o(n,r)){for(;a.length&&a[a.length-1].lex;)a.pop()();return Q.marked?Q.marked:"variable"==n&&l(e,r)?"variable-2":"variable"==n&&d(e,r)?"variable-3":t}}}function d(e,t){if(/[a-z]/.test(t.charAt(0)))return!1;for(var n=e.importedtypes.length,r=0;n>r;r++)if(e.importedtypes[r]==t)return!0}function s(e){for(var t=Q.state,n=t.importedtypes;n;n=n.next)if(n.name==e)return;t.importedtypes={name:e,next:t.importedtypes}}function m(){for(var e=arguments.length-1;e>=0;e--)Q.cc.push(arguments[e])}function p(){return m.apply(null,arguments),!0}function v(e){var t=Q.state;if(t.context){Q.marked="def";for(var n=t.localVars;n;n=n.next)if(n.name==e)return;t.localVars={name:e,next:t.localVars}}}function y(){Q.state.context||(Q.state.localVars=R),Q.state.context={prev:Q.state.context,vars:Q.state.localVars}}function x(){Q.state.localVars=Q.state.context.vars,Q.state.context=Q.state.context.prev}function h(e,t){var n=function(){var n=Q.state;n.lexical=new c(n.indented,Q.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function b(){var e=Q.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function k(e){function t(n){return n==e?p():";"==e?m():p(t)}return t}function w(e){return"@"==e?p(E):"var"==e?p(h("vardef"),P,k(";"),b):"keyword a"==e?p(h("form"),g,w,b):"keyword b"==e?p(h("form"),w,b):"{"==e?p(h("}"),y,O,b,x):";"==e?p():"attribute"==e?p(S):"function"==e?p(q):"for"==e?p(h("form"),k("("),h(")"),D,k(")"),b,w,b):"variable"==e?p(h("stat"),C):"switch"==e?p(h("form"),g,h("}","switch"),k("{"),O,b,b):"case"==e?p(g,k(":")):"default"==e?p(k(":")):"catch"==e?p(h("form"),y,k("("),$,k(")"),w,b,x):"import"==e?p(z,k(";")):"typedef"==e?p(M):m(h("stat"),g,k(";"),b)}function g(e){return N.hasOwnProperty(e)?p(V):"function"==e?p(q):"keyword c"==e?p(A):"("==e?p(h(")"),A,k(")"),b,V):"operator"==e?p(g):"["==e?p(h("]"),I(g,"]"),b,V):"{"==e?p(h("}"),I(Z,"}"),b,V):p()}function A(e){return e.match(/[;\}\)\],]/)?m():m(g)}function V(e,t){if("operator"==e&&/\+\+|--/.test(t))return p(V);if("operator"==e||":"==e)return p(g);if(";"!=e)return"("==e?p(h(")"),I(g,")"),b,V):"."==e?p(T,V):"["==e?p(h("]"),g,k("]"),b,V):void 0}function S(e){return"attribute"==e?p(S):"function"==e?p(q):"var"==e?p(P):void 0}function E(e){return":"==e?p(E):"variable"==e?p(E):"("==e?p(h(")"),I(W,")"),b,w):void 0}function W(e){return"variable"==e?p():void 0}function z(e,t){return"variable"==e&&/[A-Z]/.test(t.charAt(0))?(s(t),p()):"variable"==e||"property"==e||"."==e||"*"==t?p(z):void 0}function M(e,t){return"variable"==e&&/[A-Z]/.test(t.charAt(0))?(s(t),p()):"type"==e&&/[A-Z]/.test(t.charAt(0))?p():void 0}function C(e){return":"==e?p(b,w):m(V,k(";"),b)}function T(e){return"variable"==e?(Q.marked="property",p()):void 0}function Z(e){return"variable"==e&&(Q.marked="property"),N.hasOwnProperty(e)?p(k(":"),g):void 0}function I(e,t){function n(r){return","==r?p(e,n):r==t?p():p(k(t))}return function(r){return r==t?p():m(e,n)}}function O(e){return"}"==e?p():m(w,O)}function P(e,t){return"variable"==e?(v(t),p(B,_)):p()}function _(e,t){return"="==t?p(g,_):","==e?p(P):void 0}function D(e,t){return"variable"==e&&v(t),p(h(")"),y,j,g,b,w,x)}function j(e,t){return"in"==t?p():void 0}function q(e,t){return"variable"==e?(v(t),p(q)):"new"==t?p(q):"("==e?p(h(")"),y,I($,")"),b,B,w,x):void 0}function B(e){return":"==e?p(F):void 0}function F(e){return"type"==e?p():"variable"==e?p():"{"==e?p(h("}"),I(U,"}"),b):void 0}function U(e){return"variable"==e?p(B):void 0}function $(e,t){return"variable"==e?(v(t),p(B)):void 0}var G,H,J=e.indentUnit,K=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),a={type:"atom",style:"atom"},o={type:"attribute",style:"attribute"},u=e("typedef");return{"if":t,"while":t,"else":n,"do":n,"try":n,"return":r,"break":r,"continue":r,"new":r,"throw":r,"var":e("var"),inline:o,"static":o,using:e("import"),"public":o,"private":o,cast:e("cast"),"import":e("import"),macro:e("macro"),"function":e("function"),"catch":e("catch"),untyped:e("untyped"),callback:e("cb"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,never:e("property_access"),trace:e("trace"),"class":u,"abstract":u,"enum":u,"interface":u,typedef:u,"extends":u,"implements":u,dynamic:u,"true":a,"false":a,"null":a}}(),L=/[+\-*&%=<>!?|]/,N={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},Q={state:null,column:null,marked:null,cc:null},R={name:"this",next:null};return b.lex=!0,{startState:function(e){var n=["Int","Float","String","Void","Std","Bool","Dynamic","Array"];return{tokenize:a,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new c((e||0)-J,0,"block",!1),localVars:t.localVars,importedtypes:n,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==G?n:(t.reAllowed=!("operator"!=G&&"keyword c"!=G&&!G.match(/^[\[{}\(,;:]$/)),t.kwAllowed="."!=G,f(t,n,G,H,e))},indent:function(e,t){if(e.tokenize!=a)return 0;var n=t&&t.charAt(0),r=e.lexical;"stat"==r.type&&"}"==n&&(r=r.prev);var i=r.type,o=n==i;return"vardef"==i?r.indented+4:"form"==i&&"{"==n?r.indented:"stat"==i||"form"==i?r.indented+J:"switch"!=r.info||o?r.align?r.column+(o?0:1):r.indented+(o?0:J):r.indented+(/^(?:case|default)\b/.test(t)?J:2*J)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-haxe","haxe"),e.defineMode("hxml",function(){return{startState:function(){return{define:!1,inString:!1}},token:function(e,t){var n=e.peek(),r=e.sol();if("#"==n)return e.skipToEnd(),"comment";if(r&&"-"==n){var i="variable-2";return e.eat(/-/),"-"==e.peek()&&(e.eat(/-/),i="keyword a"),"D"==e.peek()&&(e.eat(/[D]/),i="keyword c",t.define=!0),e.eatWhile(/[A-Z]/i),i}var n=e.peek();return 0==t.inString&&"'"==n&&(t.inString=!0,n=e.next()),1==t.inString?(e.skipTo("'")||e.skipToEnd(),"'"==e.peek()&&(e.next(),t.inString=!1),"string"):(e.next(),null)},lineComment:"#"}}),e.defineMIME("text/x-hxml","hxml")}); -\ 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("haxe",function(a,b){function c(a,b,c){return b.tokenize=c,c(a,b)}function d(a,b){for(var c,d=!1;null!=(c=a.next());){if(c==b&&!d)return!1;d=!d&&"\\"==c}return d}function e(a,b,c){return S=a,T=c,b}function f(a,b){var f=a.next();if('"'==f||"'"==f)return c(a,b,g(f));if(/[\[\]{}\(\),;\:\.]/.test(f))return e(f);if("0"==f&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),e("number","number");if(/\d/.test(f)||"-"==f&&a.eat(/\d/))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),e("number","number");if(b.reAllowed&&"~"==f&&a.eat(/\//))return d(a,"/"),a.eatWhile(/[gimsu]/),e("regexp","string-2");if("/"==f)return a.eat("*")?c(a,b,h):a.eat("/")?(a.skipToEnd(),e("comment","comment")):(a.eatWhile(W),e("operator",null,a.current()));if("#"==f)return a.skipToEnd(),e("conditional","meta");if("@"==f)return a.eat(/:/),a.eatWhile(/[\w_]/),e("metadata","meta");if(W.test(f))return a.eatWhile(W),e("operator",null,a.current());var i;if(/[A-Z]/.test(f))return a.eatWhile(/[\w_<>]/),i=a.current(),e("type","variable-3",i);a.eatWhile(/[\w_]/);var i=a.current(),j=V.propertyIsEnumerable(i)&&V[i];return j&&b.kwAllowed?e(j.type,j.style,i):e("variable","variable",i)}function g(a){return function(b,c){return d(b,a)||(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,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 j(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function k(a,b,c,d,e){var f=a.cc;for(Y.state=a,Y.stream=e,Y.marked=null,Y.cc=f,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var g=f.length?f.pop():v;if(g(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return Y.marked?Y.marked:"variable"==c&&j(a,d)?"variable-2":"variable"==c&&l(a,d)?"variable-3":b}}}function l(a,b){if(/[a-z]/.test(b.charAt(0)))return!1;for(var c=a.importedtypes.length,d=0;c>d;d++)if(a.importedtypes[d]==b)return!0}function m(a){for(var b=Y.state,c=b.importedtypes;c;c=c.next)if(c.name==a)return;b.importedtypes={name:a,next:b.importedtypes}}function n(){for(var a=arguments.length-1;a>=0;a--)Y.cc.push(arguments[a])}function o(){return n.apply(null,arguments),!0}function p(a){var b=Y.state;if(b.context){Y.marked="def";for(var c=b.localVars;c;c=c.next)if(c.name==a)return;b.localVars={name:a,next:b.localVars}}}function q(){Y.state.context||(Y.state.localVars=Z),Y.state.context={prev:Y.state.context,vars:Y.state.localVars}}function r(){Y.state.localVars=Y.state.context.vars,Y.state.context=Y.state.context.prev}function s(a,b){var c=function(){var c=Y.state;c.lexical=new i(c.indented,Y.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function t(){var a=Y.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function u(a){function b(c){return c==a?o():";"==a?n():o(b)}return b}function v(a){return"@"==a?o(A):"var"==a?o(s("vardef"),J,u(";"),t):"keyword a"==a?o(s("form"),w,v,t):"keyword b"==a?o(s("form"),v,t):"{"==a?o(s("}"),q,I,t,r):";"==a?o():"attribute"==a?o(z):"function"==a?o(N):"for"==a?o(s("form"),u("("),s(")"),L,u(")"),t,v,t):"variable"==a?o(s("stat"),E):"switch"==a?o(s("form"),w,s("}","switch"),u("{"),I,t,t):"case"==a?o(w,u(":")):"default"==a?o(u(":")):"catch"==a?o(s("form"),q,u("("),R,u(")"),v,t,r):"import"==a?o(C,u(";")):"typedef"==a?o(D):n(s("stat"),w,u(";"),t)}function w(a){return X.hasOwnProperty(a)?o(y):"function"==a?o(N):"keyword c"==a?o(x):"("==a?o(s(")"),x,u(")"),t,y):"operator"==a?o(w):"["==a?o(s("]"),H(w,"]"),t,y):"{"==a?o(s("}"),H(G,"}"),t,y):o()}function x(a){return a.match(/[;\}\)\],]/)?n():n(w)}function y(a,b){if("operator"==a&&/\+\+|--/.test(b))return o(y);if("operator"==a||":"==a)return o(w);if(";"!=a)return"("==a?o(s(")"),H(w,")"),t,y):"."==a?o(F,y):"["==a?o(s("]"),w,u("]"),t,y):void 0}function z(a){return"attribute"==a?o(z):"function"==a?o(N):"var"==a?o(J):void 0}function A(a){return":"==a?o(A):"variable"==a?o(A):"("==a?o(s(")"),H(B,")"),t,v):void 0}function B(a){return"variable"==a?o():void 0}function C(a,b){return"variable"==a&&/[A-Z]/.test(b.charAt(0))?(m(b),o()):"variable"==a||"property"==a||"."==a||"*"==b?o(C):void 0}function D(a,b){return"variable"==a&&/[A-Z]/.test(b.charAt(0))?(m(b),o()):"type"==a&&/[A-Z]/.test(b.charAt(0))?o():void 0}function E(a){return":"==a?o(t,v):n(y,u(";"),t)}function F(a){return"variable"==a?(Y.marked="property",o()):void 0}function G(a){return"variable"==a&&(Y.marked="property"),X.hasOwnProperty(a)?o(u(":"),w):void 0}function H(a,b){function c(d){return","==d?o(a,c):d==b?o():o(u(b))}return function(d){return d==b?o():n(a,c)}}function I(a){return"}"==a?o():n(v,I)}function J(a,b){return"variable"==a?(p(b),o(O,K)):o()}function K(a,b){return"="==b?o(w,K):","==a?o(J):void 0}function L(a,b){return"variable"==a&&p(b),o(s(")"),q,M,w,t,v,r)}function M(a,b){return"in"==b?o():void 0}function N(a,b){return"variable"==a?(p(b),o(N)):"new"==b?o(N):"("==a?o(s(")"),q,H(R,")"),t,O,v,r):void 0}function O(a){return":"==a?o(P):void 0}function P(a){return"type"==a?o():"variable"==a?o():"{"==a?o(s("}"),H(Q,"}"),t):void 0}function Q(a){return"variable"==a?o(O):void 0}function R(a,b){return"variable"==a?(p(b),o(O)):void 0}var S,T,U=a.indentUnit,V=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"atom"},g={type:"attribute",style:"attribute"},h=a("typedef");return{"if":b,"while":b,"else":c,"do":c,"try":c,"return":d,"break":d,"continue":d,"new":d,"throw":d,"var":a("var"),inline:g,"static":g,using:a("import"),"public":g,"private":g,cast:a("cast"),"import":a("import"),macro:a("macro"),"function":a("function"),"catch":a("catch"),untyped:a("untyped"),callback:a("cb"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,never:a("property_access"),trace:a("trace"),"class":h,"abstract":h,"enum":h,"interface":h,typedef:h,"extends":h,"implements":h,dynamic:h,"true":f,"false":f,"null":f}}(),W=/[+\-*&%=<>!?|]/,X={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},Y={state:null,column:null,marked:null,cc:null},Z={name:"this",next:null};return t.lex=!0,{startState:function(a){var c=["Int","Float","String","Void","Std","Bool","Dynamic","Array"];return{tokenize:f,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new i((a||0)-U,0,"block",!1),localVars:b.localVars,importedtypes:c,context:b.localVars&&{vars:b.localVars},indented:0}},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==S?c:(b.reAllowed=!("operator"!=S&&"keyword c"!=S&&!S.match(/^[\[{}\(,;:]$/)),b.kwAllowed="."!=S,k(b,c,S,T,a))},indent:function(a,b){if(a.tokenize!=f)return 0;var c=b&&b.charAt(0),d=a.lexical;"stat"==d.type&&"}"==c&&(d=d.prev);var e=d.type,g=c==e;return"vardef"==e?d.indented+4:"form"==e&&"{"==c?d.indented:"stat"==e||"form"==e?d.indented+U:"switch"!=d.info||g?d.align?d.column+(g?0:1):d.indented+(g?0:U):d.indented+(/^(?:case|default)\b/.test(b)?U:2*U)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),a.defineMIME("text/x-haxe","haxe"),a.defineMode("hxml",function(){return{startState:function(){return{define:!1,inString:!1}},token:function(a,b){var c=a.peek(),d=a.sol();if("#"==c)return a.skipToEnd(),"comment";if(d&&"-"==c){var e="variable-2";return a.eat(/-/),"-"==a.peek()&&(a.eat(/-/),e="keyword a"),"D"==a.peek()&&(a.eat(/[D]/),e="keyword c",b.define=!0),a.eatWhile(/[A-Z]/i),e}var c=a.peek();return 0==b.inString&&"'"==c&&(b.inString=!0,c=a.next()),1==b.inString?(a.skipTo("'")||a.skipToEnd(),"'"==a.peek()&&(a.next(),b.inString=!1),"string"):(a.next(),null)},lineComment:"#"}}),a.defineMIME("text/x-hxml","hxml")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/htmlembedded/htmlembedded.js b/media/editors/codemirror/mode/htmlembedded/htmlembedded.js -index e8f7ba8..464dc57 100644 ---- a/media/editors/codemirror/mode/htmlembedded/htmlembedded.js -+++ b/media/editors/codemirror/mode/htmlembedded/htmlembedded.js -@@ -3,84 +3,26 @@ - - (function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS -- mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed")); -+ mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), -+ require("../../addon/mode/multiplex")); - else if (typeof define == "function" && define.amd) // AMD -- define(["../../lib/codemirror", "../htmlmixed/htmlmixed"], mod); -+ define(["../../lib/codemirror", "../htmlmixed/htmlmixed", -+ "../../addon/mode/multiplex"], mod); - else // Plain browser env - mod(CodeMirror); - })(function(CodeMirror) { --"use strict"; -- --CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { -- -- //config settings -- var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, -- scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; -- -- //inner modes -- var scriptingMode, htmlMixedMode; -- -- //tokenizer when in html mode -- function htmlDispatch(stream, state) { -- if (stream.match(scriptStartRegex, false)) { -- state.token=scriptingDispatch; -- return scriptingMode.token(stream, state.scriptState); -- } -- else -- return htmlMixedMode.token(stream, state.htmlState); -- } -- -- //tokenizer when in scripting mode -- function scriptingDispatch(stream, state) { -- if (stream.match(scriptEndRegex, false)) { -- state.token=htmlDispatch; -- return htmlMixedMode.token(stream, state.htmlState); -- } -- else -- return scriptingMode.token(stream, state.scriptState); -- } -- -- -- return { -- startState: function() { -- scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); -- htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); -- return { -- token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, -- htmlState : CodeMirror.startState(htmlMixedMode), -- scriptState : CodeMirror.startState(scriptingMode) -- }; -- }, -- -- token: function(stream, state) { -- return state.token(stream, state); -- }, -- -- indent: function(state, textAfter) { -- if (state.token == htmlDispatch) -- return htmlMixedMode.indent(state.htmlState, textAfter); -- else if (scriptingMode.indent) -- return scriptingMode.indent(state.scriptState, textAfter); -- }, -- -- copyState: function(state) { -- return { -- token : state.token, -- htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), -- scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) -- }; -- }, -- -- innerMode: function(state) { -- if (state.token == scriptingDispatch) return {state: state.scriptState, mode: scriptingMode}; -- else return {state: state.htmlState, mode: htmlMixedMode}; -- } -- }; --}, "htmlmixed"); -- --CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); --CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); --CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); --CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingModeSpec:"ruby"}); -- -+ "use strict"; -+ -+ CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { -+ return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { -+ open: parserConfig.open || parserConfig.scriptStartRegex || "<%", -+ close: parserConfig.close || parserConfig.scriptEndRegex || "%>", -+ mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) -+ }); -+ }, "htmlmixed"); -+ -+ CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); -+ CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); -+ CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); -+ CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); - }); -diff --git a/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js b/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js -index d93535f..5483b7d 100644 ---- a/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js -+++ b/media/editors/codemirror/mode/htmlembedded/htmlembedded.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("htmlembedded",function(e,n){function i(t,e){return t.match(a,!1)?(e.token=o,r.token(t,e.scriptState)):d.token(t,e.htmlState)}function o(t,e){return t.match(c,!1)?(e.token=i,d.token(t,e.htmlState)):r.token(t,e.scriptState)}var r,d,a=n.scriptStartRegex||/^<%/i,c=n.scriptEndRegex||/^%>/i;return{startState:function(){return r=r||t.getMode(e,n.scriptingModeSpec),d=d||t.getMode(e,"htmlmixed"),{token:n.startOpen?o:i,htmlState:t.startState(d),scriptState:t.startState(r)}},token:function(t,e){return e.token(t,e)},indent:function(t,e){return t.token==i?d.indent(t.htmlState,e):r.indent?r.indent(t.scriptState,e):void 0},copyState:function(e){return{token:e.token,htmlState:t.copyState(d,e.htmlState),scriptState:t.copyState(r,e.scriptState)}},innerMode:function(t){return t.token==o?{state:t.scriptState,mode:r}:{state:t.htmlState,mode:d}}}},"htmlmixed"),t.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),t.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),t.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),t.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("htmlembedded",function(b,c){return a.multiplexingMode(a.getMode(b,"htmlmixed"),{open:c.open||c.scriptStartRegex||"<%",close:c.close||c.scriptEndRegex||"%>",mode:a.getMode(b,c.scriptingModeSpec)})},"htmlmixed"),a.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),a.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),a.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),a.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/htmlmixed/htmlmixed.js b/media/editors/codemirror/mode/htmlmixed/htmlmixed.js -index 1cc438f..24552e2 100644 ---- a/media/editors/codemirror/mode/htmlmixed/htmlmixed.js -+++ b/media/editors/codemirror/mode/htmlmixed/htmlmixed.js -@@ -57,9 +57,9 @@ CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { - } - function maybeBackup(stream, pat, style) { - var cur = stream.current(); -- var close = cur.search(pat), m; -+ var close = cur.search(pat); - if (close > -1) stream.backUp(cur.length - close); -- else if (m = cur.match(/<\/?$/)) { -+ else if (cur.match(/<\/?$/)) { - stream.backUp(cur.length); - if (!stream.match(pat, false)) stream.match(cur); - } -diff --git a/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js b/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js -index 2734acd..47aa4aa 100644 ---- a/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js -+++ b/media/editors/codemirror/mode/htmlmixed/htmlmixed.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("htmlmixed",function(e,a){function o(t,e){var a=e.htmlState.tagName;a&&(a=a.toLowerCase());var o=r.token(t,e.htmlState);if("script"==a&&/\btag\b/.test(o)&&">"==t.current()){var l=t.string.slice(Math.max(0,t.pos-100),t.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);l=l?l[1]:"",l&&/[\"\']/.test(l.charAt(0))&&(l=l.slice(1,l.length-1));for(var m=0;m"==t.current()&&(e.token=c,e.localMode=s,e.localState=s.startState(r.indent(e.htmlState,"")));return o}function l(t,e,a){var o,l=t.current(),n=l.search(e);return n>-1?t.backUp(l.length-n):(o=l.match(/<\/?$/))&&(t.backUp(l.length),t.match(e,!1)||t.match(l)),a}function n(t,e){return t.match(/^<\/\s*script\s*>/i,!1)?(e.token=o,e.localState=e.localMode=null,null):l(t,/<\/\s*script\s*>/,e.localMode.token(t,e.localState))}function c(t,e){return t.match(/^<\/\s*style\s*>/i,!1)?(e.token=o,e.localState=e.localMode=null,null):l(t,/<\/\s*style\s*>/,s.token(t,e.localState))}var r=t.getMode(e,{name:"xml",htmlMode:!0,multilineTagIndentFactor:a.multilineTagIndentFactor,multilineTagIndentPastTag:a.multilineTagIndentPastTag}),s=t.getMode(e,"css"),i=[],m=a&&a.scriptTypes;if(i.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:t.getMode(e,"javascript")}),m)for(var d=0;d"==a.current()){var e=a.string.slice(Math.max(0,a.pos-100),a.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);e=e?e[1]:"",e&&/[\"\']/.test(e.charAt(0))&&(e=e.slice(1,e.length-1));for(var k=0;k"==a.current()&&(b.token=g,b.localMode=i,b.localState=i.startState(h.indent(b.htmlState,"")));return d}function e(a,b,c){var d=a.current(),e=d.search(b);return e>-1?a.backUp(d.length-e):d.match(/<\/?$/)&&(a.backUp(d.length),a.match(b,!1)||a.match(d)),c}function f(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=d,b.localState=b.localMode=null,null):e(a,/<\/\s*script\s*>/,b.localMode.token(a,b.localState))}function g(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=d,b.localState=b.localMode=null,null):e(a,/<\/\s*style\s*>/,i.token(a,b.localState))}var h=a.getMode(b,{name:"xml",htmlMode:!0,multilineTagIndentFactor:c.multilineTagIndentFactor,multilineTagIndentPastTag:c.multilineTagIndentPastTag}),i=a.getMode(b,"css"),j=[],k=c&&c.scriptTypes;if(j.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:a.getMode(b,"javascript")}),k)for(var l=0;l=100&&200>i?"positive informational":i>=200&&300>i?"positive success":i>=300&&400>i?"positive redirect":i>=400&&500>i?"negative client-error":i>=500&&600>i?"negative server-error":"error"}function n(r,e){return r.skipToEnd(),e.cur=u,null}function o(r,e){return r.eatWhile(/\S/),e.cur=i,"string-2"}function i(e,t){return e.match(/^HTTP\/\d\.\d$/)?(t.cur=u,"keyword"):r(e,t)}function u(r){return r.sol()&&!r.eat(/[ \t]/)?r.match(/^.*?:/)?"atom":(r.skipToEnd(),"error"):(r.skipToEnd(),"string")}function c(r){return r.skipToEnd(),null}return{token:function(r,e){var t=e.cur;return t!=u&&t!=c&&r.eatSpace()?null:t(r,e)},blankLine:function(r){r.cur=c},startState:function(){return{cur:e}}}}),r.defineMIME("message/http","http")}); -\ 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("http",function(){function a(a,b){return a.skipToEnd(),b.cur=g,"error"}function b(b,d){return b.match(/^HTTP\/\d\.\d/)?(d.cur=c,"keyword"):b.match(/^[A-Z]+/)&&/[ \t]/.test(b.peek())?(d.cur=e,"keyword"):a(b,d)}function c(b,c){var e=b.match(/^\d+/);if(!e)return a(b,c);c.cur=d;var f=Number(e[0]);return f>=100&&200>f?"positive informational":f>=200&&300>f?"positive success":f>=300&&400>f?"positive redirect":f>=400&&500>f?"negative client-error":f>=500&&600>f?"negative server-error":"error"}function d(a,b){return a.skipToEnd(),b.cur=g,null}function e(a,b){return a.eatWhile(/\S/),b.cur=f,"string-2"}function f(b,c){return b.match(/^HTTP\/\d\.\d$/)?(c.cur=g,"keyword"):a(b,c)}function g(a){return a.sol()&&!a.eat(/[ \t]/)?a.match(/^.*?:/)?"atom":(a.skipToEnd(),"error"):(a.skipToEnd(),"string")}function h(a){return a.skipToEnd(),null}return{token:function(a,b){var c=b.cur;return c!=g&&c!=h&&a.eatSpace()?null:c(a,b)},blankLine:function(a){a.cur=h},startState:function(){return{cur:b}}}}),a.defineMIME("message/http","http")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/idl/idl.min.js b/media/editors/codemirror/mode/idl/idl.min.js -index 7decde6..b332bdf 100644 ---- a/media/editors/codemirror/mode/idl/idl.min.js -+++ b/media/editors/codemirror/mode/idl/idl.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e){if(e.eatSpace())return null;if(e.match(";"))return e.skipToEnd(),"comment";if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return"number";if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return"number"}return e.match(/^"([^"]|(""))*"/)?"string":e.match(/^'([^']|(''))*'/)?"string":e.match(o)?"keyword":e.match(a)?"builtin":e.match(l)?"variable":e.match(s)||e.match(n)?"operator":(e.next(),null)}var i=["a_correlate","abs","acos","adapt_hist_equal","alog","alog2","alog10","amoeba","annotate","app_user_dir","app_user_dir_query","arg_present","array_equal","array_indices","arrow","ascii_template","asin","assoc","atan","axis","axis","bandpass_filter","bandreject_filter","barplot","bar_plot","beseli","beselj","beselk","besely","beta","biginteger","bilinear","bin_date","binary_template","bindgen","binomial","bit_ffs","bit_population","blas_axpy","blk_con","boolarr","boolean","boxplot","box_cursor","breakpoint","broyden","bubbleplot","butterworth","bytarr","byte","byteorder","bytscl","c_correlate","calendar","caldat","call_external","call_function","call_method","call_procedure","canny","catch","cd","cdf","ceil","chebyshev","check_math","chisqr_cvf","chisqr_pdf","choldc","cholsol","cindgen","cir_3pnt","clipboard","close","clust_wts","cluster","cluster_tree","cmyk_convert","code_coverage","color_convert","color_exchange","color_quan","color_range_map","colorbar","colorize_sample","colormap_applicable","colormap_gradient","colormap_rotation","colortable","comfit","command_line_args","common","compile_opt","complex","complexarr","complexround","compute_mesh_normals","cond","congrid","conj","constrained_min","contour","contour","convert_coord","convol","convol_fft","coord2to3","copy_lun","correlate","cos","cosh","cpu","cramer","createboxplotdata","create_cursor","create_struct","create_view","crossp","crvlength","ct_luminance","cti_test","cursor","curvefit","cv_coord","cvttobm","cw_animate","cw_animate_getp","cw_animate_load","cw_animate_run","cw_arcball","cw_bgroup","cw_clr_index","cw_colorsel","cw_defroi","cw_field","cw_filesel","cw_form","cw_fslider","cw_light_editor","cw_light_editor_get","cw_light_editor_set","cw_orient","cw_palette_editor","cw_palette_editor_get","cw_palette_editor_set","cw_pdmenu","cw_rgbslider","cw_tmpl","cw_zoom","db_exists","dblarr","dcindgen","dcomplex","dcomplexarr","define_key","define_msgblk","define_msgblk_from_file","defroi","defsysv","delvar","dendro_plot","dendrogram","deriv","derivsig","determ","device","dfpmin","diag_matrix","dialog_dbconnect","dialog_message","dialog_pickfile","dialog_printersetup","dialog_printjob","dialog_read_image","dialog_write_image","dictionary","digital_filter","dilate","dindgen","dissolve","dist","distance_measure","dlm_load","dlm_register","doc_library","double","draw_roi","edge_dog","efont","eigenql","eigenvec","ellipse","elmhes","emboss","empty","enable_sysrtn","eof","eos","erase","erf","erfc","erfcx","erode","errorplot","errplot","estimator_filter","execute","exit","exp","expand","expand_path","expint","extrac","extract_slice","f_cvf","f_pdf","factorial","fft","file_basename","file_chmod","file_copy","file_delete","file_dirname","file_expand_path","file_gunzip","file_gzip","file_info","file_lines","file_link","file_mkdir","file_move","file_poll_input","file_readlink","file_same","file_search","file_tar","file_test","file_untar","file_unzip","file_which","file_zip","filepath","findgen","finite","fix","flick","float","floor","flow3","fltarr","flush","format_axis_values","forward_function","free_lun","fstat","fulstr","funct","function","fv_test","fx_root","fz_roots","gamma","gamma_ct","gauss_cvf","gauss_pdf","gauss_smooth","gauss2dfit","gaussfit","gaussian_function","gaussint","get_drive_list","get_dxf_objects","get_kbrd","get_login_info","get_lun","get_screen_size","getenv","getwindows","greg2jul","grib","grid_input","grid_tps","grid3","griddata","gs_iter","h_eq_ct","h_eq_int","hanning","hash","hdf","hdf5","heap_free","heap_gc","heap_nosave","heap_refcount","heap_save","help","hilbert","hist_2d","hist_equal","histogram","hls","hough","hqr","hsv","i18n_multibytetoutf8","i18n_multibytetowidechar","i18n_utf8tomultibyte","i18n_widechartomultibyte","ibeta","icontour","iconvertcoord","idelete","identity","idl_base64","idl_container","idl_validname","idlexbr_assistant","idlitsys_createtool","idlunit","iellipse","igamma","igetcurrent","igetdata","igetid","igetproperty","iimage","image","image_cont","image_statistics","image_threshold","imaginary","imap","indgen","int_2d","int_3d","int_tabulated","intarr","interpol","interpolate","interval_volume","invert","ioctl","iopen","ir_filter","iplot","ipolygon","ipolyline","iputdata","iregister","ireset","iresolve","irotate","isa","isave","iscale","isetcurrent","isetproperty","ishft","isocontour","isosurface","isurface","itext","itranslate","ivector","ivolume","izoom","journal","json_parse","json_serialize","jul2greg","julday","keyword_set","krig2d","kurtosis","kw_test","l64indgen","la_choldc","la_cholmprove","la_cholsol","la_determ","la_eigenproblem","la_eigenql","la_eigenvec","la_elmhes","la_gm_linear_model","la_hqr","la_invert","la_least_square_equality","la_least_squares","la_linear_equation","la_ludc","la_lumprove","la_lusol","la_svd","la_tridc","la_trimprove","la_triql","la_trired","la_trisol","label_date","label_region","ladfit","laguerre","lambda","lambdap","lambertw","laplacian","least_squares_filter","leefilt","legend","legendre","linbcg","lindgen","linfit","linkimage","list","ll_arc_distance","lmfit","lmgr","lngamma","lnp_test","loadct","locale_get","logical_and","logical_or","logical_true","lon64arr","lonarr","long","long64","lsode","lu_complex","ludc","lumprove","lusol","m_correlate","machar","make_array","make_dll","make_rt","map","mapcontinents","mapgrid","map_2points","map_continents","map_grid","map_image","map_patch","map_proj_forward","map_proj_image","map_proj_info","map_proj_init","map_proj_inverse","map_set","matrix_multiply","matrix_power","max","md_test","mean","meanabsdev","mean_filter","median","memory","mesh_clip","mesh_decimate","mesh_issolid","mesh_merge","mesh_numtriangles","mesh_obj","mesh_smooth","mesh_surfacearea","mesh_validate","mesh_volume","message","min","min_curve_surf","mk_html_help","modifyct","moment","morph_close","morph_distance","morph_gradient","morph_hitormiss","morph_open","morph_thin","morph_tophat","multi","n_elements","n_params","n_tags","ncdf","newton","noise_hurl","noise_pick","noise_scatter","noise_slur","norm","obj_class","obj_destroy","obj_hasmethod","obj_isa","obj_new","obj_valid","objarr","on_error","on_ioerror","online_help","openr","openu","openw","oplot","oploterr","orderedhash","p_correlate","parse_url","particle_trace","path_cache","path_sep","pcomp","plot","plot3d","plot","plot_3dbox","plot_field","ploterr","plots","polar_contour","polar_surface","polyfill","polyshade","pnt_line","point_lun","polarplot","poly","poly_2d","poly_area","poly_fit","polyfillv","polygon","polyline","polywarp","popd","powell","pref_commit","pref_get","pref_set","prewitt","primes","print","printf","printd","pro","product","profile","profiler","profiles","project_vol","ps_show_fonts","psafm","pseudo","ptr_free","ptr_new","ptr_valid","ptrarr","pushd","qgrid3","qhull","qromb","qromo","qsimp","query_*","query_ascii","query_bmp","query_csv","query_dicom","query_gif","query_image","query_jpeg","query_jpeg2000","query_mrsid","query_pict","query_png","query_ppm","query_srf","query_tiff","query_video","query_wav","r_correlate","r_test","radon","randomn","randomu","ranks","rdpix","read","readf","read_ascii","read_binary","read_bmp","read_csv","read_dicom","read_gif","read_image","read_interfile","read_jpeg","read_jpeg2000","read_mrsid","read_pict","read_png","read_ppm","read_spr","read_srf","read_sylk","read_tiff","read_video","read_wav","read_wave","read_x11_bitmap","read_xwd","reads","readu","real_part","rebin","recall_commands","recon3","reduce_colors","reform","region_grow","register_cursor","regress","replicate","replicate_inplace","resolve_all","resolve_routine","restore","retall","return","reverse","rk4","roberts","rot","rotate","round","routine_filepath","routine_info","rs_test","s_test","save","savgol","scale3","scale3d","scatterplot","scatterplot3d","scope_level","scope_traceback","scope_varfetch","scope_varname","search2d","search3d","sem_create","sem_delete","sem_lock","sem_release","set_plot","set_shading","setenv","sfit","shade_surf","shade_surf_irr","shade_volume","shift","shift_diff","shmdebug","shmmap","shmunmap","shmvar","show3","showfont","signum","simplex","sin","sindgen","sinh","size","skewness","skip_lun","slicer3","slide_image","smooth","sobel","socket","sort","spawn","sph_4pnt","sph_scat","spher_harm","spl_init","spl_interp","spline","spline_p","sprsab","sprsax","sprsin","sprstp","sqrt","standardize","stddev","stop","strarr","strcmp","strcompress","streamline","streamline","stregex","stretch","string","strjoin","strlen","strlowcase","strmatch","strmessage","strmid","strpos","strput","strsplit","strtrim","struct_assign","struct_hide","strupcase","surface","surface","surfr","svdc","svdfit","svsol","swap_endian","swap_endian_inplace","symbol","systime","t_cvf","t_pdf","t3d","tag_names","tan","tanh","tek_color","temporary","terminal_size","tetra_clip","tetra_surface","tetra_volume","text","thin","thread","threed","tic","time_test2","timegen","timer","timestamp","timestamptovalues","tm_test","toc","total","trace","transpose","tri_surf","triangulate","trigrid","triql","trired","trisol","truncate_lun","ts_coef","ts_diff","ts_fcast","ts_smooth","tv","tvcrs","tvlct","tvrd","tvscl","typename","uindgen","uint","uintarr","ul64indgen","ulindgen","ulon64arr","ulonarr","ulong","ulong64","uniq","unsharp_mask","usersym","value_locate","variance","vector","vector_field","vel","velovect","vert_t3d","voigt","volume","voronoi","voxel_proj","wait","warp_tri","watershed","wdelete","wf_draw","where","widget_base","widget_button","widget_combobox","widget_control","widget_displaycontextmenu","widget_draw","widget_droplist","widget_event","widget_info","widget_label","widget_list","widget_propertysheet","widget_slider","widget_tab","widget_table","widget_text","widget_tree","widget_tree_move","widget_window","wiener_filter","window","window","write_bmp","write_csv","write_gif","write_image","write_jpeg","write_jpeg2000","write_nrif","write_pict","write_png","write_ppm","write_spr","write_srf","write_sylk","write_tiff","write_video","write_wav","write_wave","writeu","wset","wshow","wtn","wv_applet","wv_cwt","wv_cw_wavelet","wv_denoise","wv_dwt","wv_fn_coiflet","wv_fn_daubechies","wv_fn_gaussian","wv_fn_haar","wv_fn_morlet","wv_fn_paul","wv_fn_symlet","wv_import_data","wv_import_wavelet","wv_plot3d_wps","wv_plot_multires","wv_pwt","wv_tool_denoise","xbm_edit","xdisplayfile","xdxf","xfont","xinteranimate","xloadct","xmanager","xmng_tmpl","xmtool","xobjview","xobjview_rotate","xobjview_write_image","xpalette","xpcolor","xplot3d","xregistered","xroi","xsq_test","xsurface","xvaredit","xvolume","xvolume_rotate","xvolume_write_image","xyouts","zlib_compress","zlib_uncompress","zoom","zoom_24"],a=t(i),_=["begin","end","endcase","endfor","endwhile","endif","endrep","endforeach","break","case","continue","for","foreach","goto","if","then","else","repeat","until","switch","while","do","pro","function"],o=t(_);e.registerHelper("hintWords","idl",i.concat(_));var l=new RegExp("^[_a-z¡-￿][_a-z0-9¡-￿]*","i"),s=/[+\-*&=<>\/@#~$]/,n=new RegExp("(and|or|eq|lt|le|gt|ge|ne|not)","i");e.defineMode("idl",function(){return{token:function(e){return r(e)}}}),e.defineMIME("text/x-idl","idl")}); -\ 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){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function c(a){if(a.eatSpace())return null;if(a.match(";"))return a.skipToEnd(),"comment";if(a.match(/^[0-9\.+-]/,!1)){if(a.match(/^[+-]?0x[0-9a-fA-F]+/))return"number";if(a.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return"number";if(a.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return"number"}return a.match(/^"([^"]|(""))*"/)?"string":a.match(/^'([^']|(''))*'/)?"string":a.match(g)?"keyword":a.match(e)?"builtin":a.match(h)?"variable":a.match(i)||a.match(j)?"operator":(a.next(),null)}var d=["a_correlate","abs","acos","adapt_hist_equal","alog","alog2","alog10","amoeba","annotate","app_user_dir","app_user_dir_query","arg_present","array_equal","array_indices","arrow","ascii_template","asin","assoc","atan","axis","axis","bandpass_filter","bandreject_filter","barplot","bar_plot","beseli","beselj","beselk","besely","beta","biginteger","bilinear","bin_date","binary_template","bindgen","binomial","bit_ffs","bit_population","blas_axpy","blk_con","boolarr","boolean","boxplot","box_cursor","breakpoint","broyden","bubbleplot","butterworth","bytarr","byte","byteorder","bytscl","c_correlate","calendar","caldat","call_external","call_function","call_method","call_procedure","canny","catch","cd","cdf","ceil","chebyshev","check_math","chisqr_cvf","chisqr_pdf","choldc","cholsol","cindgen","cir_3pnt","clipboard","close","clust_wts","cluster","cluster_tree","cmyk_convert","code_coverage","color_convert","color_exchange","color_quan","color_range_map","colorbar","colorize_sample","colormap_applicable","colormap_gradient","colormap_rotation","colortable","comfit","command_line_args","common","compile_opt","complex","complexarr","complexround","compute_mesh_normals","cond","congrid","conj","constrained_min","contour","contour","convert_coord","convol","convol_fft","coord2to3","copy_lun","correlate","cos","cosh","cpu","cramer","createboxplotdata","create_cursor","create_struct","create_view","crossp","crvlength","ct_luminance","cti_test","cursor","curvefit","cv_coord","cvttobm","cw_animate","cw_animate_getp","cw_animate_load","cw_animate_run","cw_arcball","cw_bgroup","cw_clr_index","cw_colorsel","cw_defroi","cw_field","cw_filesel","cw_form","cw_fslider","cw_light_editor","cw_light_editor_get","cw_light_editor_set","cw_orient","cw_palette_editor","cw_palette_editor_get","cw_palette_editor_set","cw_pdmenu","cw_rgbslider","cw_tmpl","cw_zoom","db_exists","dblarr","dcindgen","dcomplex","dcomplexarr","define_key","define_msgblk","define_msgblk_from_file","defroi","defsysv","delvar","dendro_plot","dendrogram","deriv","derivsig","determ","device","dfpmin","diag_matrix","dialog_dbconnect","dialog_message","dialog_pickfile","dialog_printersetup","dialog_printjob","dialog_read_image","dialog_write_image","dictionary","digital_filter","dilate","dindgen","dissolve","dist","distance_measure","dlm_load","dlm_register","doc_library","double","draw_roi","edge_dog","efont","eigenql","eigenvec","ellipse","elmhes","emboss","empty","enable_sysrtn","eof","eos","erase","erf","erfc","erfcx","erode","errorplot","errplot","estimator_filter","execute","exit","exp","expand","expand_path","expint","extrac","extract_slice","f_cvf","f_pdf","factorial","fft","file_basename","file_chmod","file_copy","file_delete","file_dirname","file_expand_path","file_gunzip","file_gzip","file_info","file_lines","file_link","file_mkdir","file_move","file_poll_input","file_readlink","file_same","file_search","file_tar","file_test","file_untar","file_unzip","file_which","file_zip","filepath","findgen","finite","fix","flick","float","floor","flow3","fltarr","flush","format_axis_values","forward_function","free_lun","fstat","fulstr","funct","function","fv_test","fx_root","fz_roots","gamma","gamma_ct","gauss_cvf","gauss_pdf","gauss_smooth","gauss2dfit","gaussfit","gaussian_function","gaussint","get_drive_list","get_dxf_objects","get_kbrd","get_login_info","get_lun","get_screen_size","getenv","getwindows","greg2jul","grib","grid_input","grid_tps","grid3","griddata","gs_iter","h_eq_ct","h_eq_int","hanning","hash","hdf","hdf5","heap_free","heap_gc","heap_nosave","heap_refcount","heap_save","help","hilbert","hist_2d","hist_equal","histogram","hls","hough","hqr","hsv","i18n_multibytetoutf8","i18n_multibytetowidechar","i18n_utf8tomultibyte","i18n_widechartomultibyte","ibeta","icontour","iconvertcoord","idelete","identity","idl_base64","idl_container","idl_validname","idlexbr_assistant","idlitsys_createtool","idlunit","iellipse","igamma","igetcurrent","igetdata","igetid","igetproperty","iimage","image","image_cont","image_statistics","image_threshold","imaginary","imap","indgen","int_2d","int_3d","int_tabulated","intarr","interpol","interpolate","interval_volume","invert","ioctl","iopen","ir_filter","iplot","ipolygon","ipolyline","iputdata","iregister","ireset","iresolve","irotate","isa","isave","iscale","isetcurrent","isetproperty","ishft","isocontour","isosurface","isurface","itext","itranslate","ivector","ivolume","izoom","journal","json_parse","json_serialize","jul2greg","julday","keyword_set","krig2d","kurtosis","kw_test","l64indgen","la_choldc","la_cholmprove","la_cholsol","la_determ","la_eigenproblem","la_eigenql","la_eigenvec","la_elmhes","la_gm_linear_model","la_hqr","la_invert","la_least_square_equality","la_least_squares","la_linear_equation","la_ludc","la_lumprove","la_lusol","la_svd","la_tridc","la_trimprove","la_triql","la_trired","la_trisol","label_date","label_region","ladfit","laguerre","lambda","lambdap","lambertw","laplacian","least_squares_filter","leefilt","legend","legendre","linbcg","lindgen","linfit","linkimage","list","ll_arc_distance","lmfit","lmgr","lngamma","lnp_test","loadct","locale_get","logical_and","logical_or","logical_true","lon64arr","lonarr","long","long64","lsode","lu_complex","ludc","lumprove","lusol","m_correlate","machar","make_array","make_dll","make_rt","map","mapcontinents","mapgrid","map_2points","map_continents","map_grid","map_image","map_patch","map_proj_forward","map_proj_image","map_proj_info","map_proj_init","map_proj_inverse","map_set","matrix_multiply","matrix_power","max","md_test","mean","meanabsdev","mean_filter","median","memory","mesh_clip","mesh_decimate","mesh_issolid","mesh_merge","mesh_numtriangles","mesh_obj","mesh_smooth","mesh_surfacearea","mesh_validate","mesh_volume","message","min","min_curve_surf","mk_html_help","modifyct","moment","morph_close","morph_distance","morph_gradient","morph_hitormiss","morph_open","morph_thin","morph_tophat","multi","n_elements","n_params","n_tags","ncdf","newton","noise_hurl","noise_pick","noise_scatter","noise_slur","norm","obj_class","obj_destroy","obj_hasmethod","obj_isa","obj_new","obj_valid","objarr","on_error","on_ioerror","online_help","openr","openu","openw","oplot","oploterr","orderedhash","p_correlate","parse_url","particle_trace","path_cache","path_sep","pcomp","plot","plot3d","plot","plot_3dbox","plot_field","ploterr","plots","polar_contour","polar_surface","polyfill","polyshade","pnt_line","point_lun","polarplot","poly","poly_2d","poly_area","poly_fit","polyfillv","polygon","polyline","polywarp","popd","powell","pref_commit","pref_get","pref_set","prewitt","primes","print","printf","printd","pro","product","profile","profiler","profiles","project_vol","ps_show_fonts","psafm","pseudo","ptr_free","ptr_new","ptr_valid","ptrarr","pushd","qgrid3","qhull","qromb","qromo","qsimp","query_*","query_ascii","query_bmp","query_csv","query_dicom","query_gif","query_image","query_jpeg","query_jpeg2000","query_mrsid","query_pict","query_png","query_ppm","query_srf","query_tiff","query_video","query_wav","r_correlate","r_test","radon","randomn","randomu","ranks","rdpix","read","readf","read_ascii","read_binary","read_bmp","read_csv","read_dicom","read_gif","read_image","read_interfile","read_jpeg","read_jpeg2000","read_mrsid","read_pict","read_png","read_ppm","read_spr","read_srf","read_sylk","read_tiff","read_video","read_wav","read_wave","read_x11_bitmap","read_xwd","reads","readu","real_part","rebin","recall_commands","recon3","reduce_colors","reform","region_grow","register_cursor","regress","replicate","replicate_inplace","resolve_all","resolve_routine","restore","retall","return","reverse","rk4","roberts","rot","rotate","round","routine_filepath","routine_info","rs_test","s_test","save","savgol","scale3","scale3d","scatterplot","scatterplot3d","scope_level","scope_traceback","scope_varfetch","scope_varname","search2d","search3d","sem_create","sem_delete","sem_lock","sem_release","set_plot","set_shading","setenv","sfit","shade_surf","shade_surf_irr","shade_volume","shift","shift_diff","shmdebug","shmmap","shmunmap","shmvar","show3","showfont","signum","simplex","sin","sindgen","sinh","size","skewness","skip_lun","slicer3","slide_image","smooth","sobel","socket","sort","spawn","sph_4pnt","sph_scat","spher_harm","spl_init","spl_interp","spline","spline_p","sprsab","sprsax","sprsin","sprstp","sqrt","standardize","stddev","stop","strarr","strcmp","strcompress","streamline","streamline","stregex","stretch","string","strjoin","strlen","strlowcase","strmatch","strmessage","strmid","strpos","strput","strsplit","strtrim","struct_assign","struct_hide","strupcase","surface","surface","surfr","svdc","svdfit","svsol","swap_endian","swap_endian_inplace","symbol","systime","t_cvf","t_pdf","t3d","tag_names","tan","tanh","tek_color","temporary","terminal_size","tetra_clip","tetra_surface","tetra_volume","text","thin","thread","threed","tic","time_test2","timegen","timer","timestamp","timestamptovalues","tm_test","toc","total","trace","transpose","tri_surf","triangulate","trigrid","triql","trired","trisol","truncate_lun","ts_coef","ts_diff","ts_fcast","ts_smooth","tv","tvcrs","tvlct","tvrd","tvscl","typename","uindgen","uint","uintarr","ul64indgen","ulindgen","ulon64arr","ulonarr","ulong","ulong64","uniq","unsharp_mask","usersym","value_locate","variance","vector","vector_field","vel","velovect","vert_t3d","voigt","volume","voronoi","voxel_proj","wait","warp_tri","watershed","wdelete","wf_draw","where","widget_base","widget_button","widget_combobox","widget_control","widget_displaycontextmenu","widget_draw","widget_droplist","widget_event","widget_info","widget_label","widget_list","widget_propertysheet","widget_slider","widget_tab","widget_table","widget_text","widget_tree","widget_tree_move","widget_window","wiener_filter","window","window","write_bmp","write_csv","write_gif","write_image","write_jpeg","write_jpeg2000","write_nrif","write_pict","write_png","write_ppm","write_spr","write_srf","write_sylk","write_tiff","write_video","write_wav","write_wave","writeu","wset","wshow","wtn","wv_applet","wv_cwt","wv_cw_wavelet","wv_denoise","wv_dwt","wv_fn_coiflet","wv_fn_daubechies","wv_fn_gaussian","wv_fn_haar","wv_fn_morlet","wv_fn_paul","wv_fn_symlet","wv_import_data","wv_import_wavelet","wv_plot3d_wps","wv_plot_multires","wv_pwt","wv_tool_denoise","xbm_edit","xdisplayfile","xdxf","xfont","xinteranimate","xloadct","xmanager","xmng_tmpl","xmtool","xobjview","xobjview_rotate","xobjview_write_image","xpalette","xpcolor","xplot3d","xregistered","xroi","xsq_test","xsurface","xvaredit","xvolume","xvolume_rotate","xvolume_write_image","xyouts","zlib_compress","zlib_uncompress","zoom","zoom_24"],e=b(d),f=["begin","end","endcase","endfor","endwhile","endif","endrep","endforeach","break","case","continue","for","foreach","goto","if","then","else","repeat","until","switch","while","do","pro","function"],g=b(f);a.registerHelper("hintWords","idl",d.concat(f));var h=new RegExp("^[_a-z¡-￿][_a-z0-9¡-￿]*","i"),i=/[+\-*&=<>\/@#~$]/,j=new RegExp("(and|or|eq|lt|le|gt|ge|ne|not)","i");a.defineMode("idl",function(){return{token:function(a){return c(a)}}}),a.defineMIME("text/x-idl","idl")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/jade/jade.min.js b/media/editors/codemirror/mode/jade/jade.min.js -index eb17b96..5c11a7b 100644 ---- a/media/editors/codemirror/mode/jade/jade.min.js -+++ b/media/editors/codemirror/mode/jade/jade.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("jade",function(e){function n(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=X.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function i(t,e){if(t.sol()&&(e.javaScriptLine=!1,e.javaScriptLineExcludesColon=!1),e.javaScriptLine){if(e.javaScriptLineExcludesColon&&":"===t.peek())return e.javaScriptLine=!1,void(e.javaScriptLineExcludesColon=!1);var n=X.token(t,e.jsState);return t.eol()&&(e.javaScriptLine=!1),n||!0}}function r(t,e){if(e.javaScriptArguments){if(0===e.javaScriptArgumentsDepth&&"("!==t.peek())return void(e.javaScriptArguments=!1);if("("===t.peek()?e.javaScriptArgumentsDepth++:")"===t.peek()&&e.javaScriptArgumentsDepth--,0===e.javaScriptArgumentsDepth)return void(e.javaScriptArguments=!1);var n=X.token(t,e.jsState);return n||!0}}function a(t){return t.match(/^yield\b/)?"keyword":void 0}function s(t){return t.match(/^(?:doctype) *([^\n]+)?/)?P:void 0}function o(t,e){return t.match("#{")?(e.isInterpolating=!0,e.interpolationNesting=0,"punctuation"):void 0}function c(t,e){if(e.isInterpolating){if("}"===t.peek()){if(e.interpolationNesting--,e.interpolationNesting<0)return t.next(),e.isInterpolating=!1,"puncutation"}else"{"===t.peek()&&e.interpolationNesting++;return X.token(t,e.jsState)||!0}}function u(t,e){return t.match(/^case\b/)?(e.javaScriptLine=!0,K):void 0}function p(t,e){return t.match(/^when\b/)?(e.javaScriptLine=!0,e.javaScriptLineExcludesColon=!0,K):void 0}function d(t){return t.match(/^default\b/)?K:void 0}function l(t,e){return t.match(/^extends?\b/)?(e.restOfLine="string",K):void 0}function h(t,e){return t.match(/^append\b/)?(e.restOfLine="variable",K):void 0}function f(t,e){return t.match(/^prepend\b/)?(e.restOfLine="variable",K):void 0}function v(t,e){return t.match(/^block\b *(?:(prepend|append)\b)?/)?(e.restOfLine="variable",K):void 0}function m(t,e){return t.match(/^include\b/)?(e.restOfLine="string",K):void 0}function S(t,e){return t.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&t.match("include")?(e.isIncludeFiltered=!0,K):void 0}function j(t,e){if(e.isIncludeFiltered){var n=x(t,e);return e.isIncludeFiltered=!1,e.restOfLine="string",n}}function g(t,e){return t.match(/^mixin\b/)?(e.javaScriptLine=!0,K):void 0}function b(t,e){return t.match(/^\+([-\w]+)/)?(t.match(/^\( *[-\w]+ *=/,!1)||(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0),"variable"):t.match(/^\+#{/,!1)?(t.next(),e.mixinCallAfter=!0,o(t,e)):void 0}function L(t,e){return e.mixinCallAfter?(e.mixinCallAfter=!1,t.match(/^\( *[-\w]+ *=/,!1)||(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0),!0):void 0}function A(t,e){return t.match(/^(if|unless|else if|else)\b/)?(e.javaScriptLine=!0,K):void 0}function k(t,e){return t.match(/^(- *)?(each|for)\b/)?(e.isEach=!0,K):void 0}function y(t,e){if(e.isEach){if(t.match(/^ in\b/))return e.javaScriptLine=!0,e.isEach=!1,K;if(t.sol()||t.eol())e.isEach=!1;else if(t.next()){for(;!t.match(/^ in\b/,!1)&&t.next(););return"variable"}}}function T(t,e){return t.match(/^while\b/)?(e.javaScriptLine=!0,K):void 0}function M(t,e){var n;return(n=t.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(e.lastTag=n[1].toLowerCase(),"script"===e.lastTag&&(e.scriptType="application/javascript"),"tag"):void 0}function x(n,i){if(n.match(/^:([\w\-]+)/)){var r;return e&&e.innerModes&&(r=e.innerModes(n.current().substring(1))),r||(r=n.current().substring(1)),"string"==typeof r&&(r=t.getMode(e,r)),Z(n,i,r),"atom"}}function N(t,e){return t.match(/^(!?=|-)/)?(e.javaScriptLine=!0,"punctuation"):void 0}function O(t){return t.match(/^#([\w-]+)/)?Q:void 0}function w(t){return t.match(/^\.([\w-]+)/)?R:void 0}function I(t,e){return"("==t.peek()?(t.next(),e.isAttrs=!0,e.attrsNest=[],e.inAttributeName=!0,e.attrValue="",e.attributeIsType=!1,"punctuation"):void 0}function E(t,e){if(e.isAttrs){if(W[t.peek()]&&e.attrsNest.push(W[t.peek()]),e.attrsNest[e.attrsNest.length-1]===t.peek())e.attrsNest.pop();else if(t.eat(")"))return e.isAttrs=!1,"punctuation";if(e.inAttributeName&&t.match(/^[^=,\)!]+/))return("="===t.peek()||"!"===t.peek())&&(e.inAttributeName=!1,e.jsState=X.startState(),e.attributeIsType="script"===e.lastTag&&"type"===t.current().trim().toLowerCase()?!0:!1),"attribute";var n=X.token(t,e.jsState);if(e.attributeIsType&&"string"===n&&(e.scriptType=t.current().toString()),0===e.attrsNest.length&&("string"===n||"variable"===n||"keyword"===n))try{return Function("","var x "+e.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),e.inAttributeName=!0,e.attrValue="",t.backUp(t.current().length),E(t,e)}catch(i){}return e.attrValue+=t.current(),n||!0}}function C(t,e){return t.match(/^&attributes\b/)?(e.javaScriptArguments=!0,e.javaScriptArgumentsDepth=0,"keyword"):void 0}function F(t){return t.sol()&&t.eatSpace()?"indent":void 0}function D(t,e){return t.match(/^ *\/\/(-)?([^\n]*)/)?(e.indentOf=t.indentation(),e.indentToken="comment","comment"):void 0}function V(t){return t.match(/^: */)?"colon":void 0}function q(t,e){return t.match(/^(?:\| ?| )([^\n]+)/)?"string":t.match(/^(<[^\n]*)/,!1)?(Z(t,e,"htmlmixed"),e.innerModeForLine=!0,$(t,e,!0)):void 0}function z(t,e){if(t.eat(".")){var n=null;return"script"===e.lastTag&&-1!=e.scriptType.toLowerCase().indexOf("javascript")?n=e.scriptType.toLowerCase().replace(/"|'/g,""):"style"===e.lastTag&&(n="css"),Z(t,e,n),"dot"}}function U(t){return t.next(),null}function Z(n,i,r){r=t.mimeModes[r]||r,r=e.innerModes?e.innerModes(r)||r:r,r=t.mimeModes[r]||r,r=t.getMode(e,r),i.indentOf=n.indentation(),r&&"null"!==r.name?i.innerMode=r:i.indentToken="string"}function $(t,e,n){return t.indentation()>e.indentOf||e.innerModeForLine&&!t.sol()||n?e.innerMode?(e.innerState||(e.innerState=e.innerMode.startState?e.innerMode.startState(t.indentation()):{}),t.hideFirstChars(e.indentOf+2,function(){return e.innerMode.token(t,e.innerState)||!0})):(t.skipToEnd(),e.indentToken):void(t.sol()&&(e.indentOf=1/0,e.indentToken=null,e.innerMode=null,e.innerState=null))}function B(t,e){if(t.sol()&&(e.restOfLine=""),e.restOfLine){t.skipToEnd();var n=e.restOfLine;return e.restOfLine="",n}}function G(){return new n}function H(t){return t.copy()}function J(t,e){var n=$(t,e)||B(t,e)||c(t,e)||j(t,e)||y(t,e)||E(t,e)||i(t,e)||r(t,e)||L(t,e)||a(t,e)||s(t,e)||o(t,e)||u(t,e)||p(t,e)||d(t,e)||l(t,e)||h(t,e)||f(t,e)||v(t,e)||m(t,e)||S(t,e)||g(t,e)||b(t,e)||A(t,e)||k(t,e)||T(t,e)||M(t,e)||x(t,e)||N(t,e)||O(t,e)||w(t,e)||I(t,e)||C(t,e)||F(t,e)||q(t,e)||D(t,e)||V(t,e)||z(t,e)||U(t,e);return n===!0?null:n}var K="keyword",P="meta",Q="builtin",R="qualifier",W={"{":"}","(":")","[":"]"},X=t.getMode(e,"javascript");return n.prototype.copy=function(){var e=new n;return e.javaScriptLine=this.javaScriptLine,e.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,e.javaScriptArguments=this.javaScriptArguments,e.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,e.isInterpolating=this.isInterpolating,e.interpolationNesting=this.intpolationNesting,e.jsState=t.copyState(X,this.jsState),e.innerMode=this.innerMode,this.innerMode&&this.innerState&&(e.innerState=t.copyState(this.innerMode,this.innerState)),e.restOfLine=this.restOfLine,e.isIncludeFiltered=this.isIncludeFiltered,e.isEach=this.isEach,e.lastTag=this.lastTag,e.scriptType=this.scriptType,e.isAttrs=this.isAttrs,e.attrsNest=this.attrsNest.slice(),e.inAttributeName=this.inAttributeName,e.attributeIsType=this.attributeIsType,e.attrValue=this.attrValue,e.indentOf=this.indentOf,e.indentToken=this.indentToken,e.innerModeForLine=this.innerModeForLine,e},{startState:G,copyState:H,token:J}}),t.defineMIME("text/x-jade","jade")}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("jade",function(b){function c(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=Z.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function d(a,b){if(a.sol()&&(b.javaScriptLine=!1,b.javaScriptLineExcludesColon=!1),b.javaScriptLine){if(b.javaScriptLineExcludesColon&&":"===a.peek())return b.javaScriptLine=!1,void(b.javaScriptLineExcludesColon=!1);var c=Z.token(a,b.jsState);return a.eol()&&(b.javaScriptLine=!1),c||!0}}function e(a,b){if(b.javaScriptArguments){if(0===b.javaScriptArgumentsDepth&&"("!==a.peek())return void(b.javaScriptArguments=!1);if("("===a.peek()?b.javaScriptArgumentsDepth++:")"===a.peek()&&b.javaScriptArgumentsDepth--,0===b.javaScriptArgumentsDepth)return void(b.javaScriptArguments=!1);var c=Z.token(a,b.jsState);return c||!0}}function f(a){return a.match(/^yield\b/)?"keyword":void 0}function g(a){return a.match(/^(?:doctype) *([^\n]+)?/)?V:void 0}function h(a,b){return a.match("#{")?(b.isInterpolating=!0,b.interpolationNesting=0,"punctuation"):void 0}function i(a,b){if(b.isInterpolating){if("}"===a.peek()){if(b.interpolationNesting--,b.interpolationNesting<0)return a.next(),b.isInterpolating=!1,"puncutation"}else"{"===a.peek()&&b.interpolationNesting++;return Z.token(a,b.jsState)||!0}}function j(a,b){return a.match(/^case\b/)?(b.javaScriptLine=!0,U):void 0}function k(a,b){return a.match(/^when\b/)?(b.javaScriptLine=!0,b.javaScriptLineExcludesColon=!0,U):void 0}function l(a){return a.match(/^default\b/)?U:void 0}function m(a,b){return a.match(/^extends?\b/)?(b.restOfLine="string",U):void 0}function n(a,b){return a.match(/^append\b/)?(b.restOfLine="variable",U):void 0}function o(a,b){return a.match(/^prepend\b/)?(b.restOfLine="variable",U):void 0}function p(a,b){return a.match(/^block\b *(?:(prepend|append)\b)?/)?(b.restOfLine="variable",U):void 0}function q(a,b){return a.match(/^include\b/)?(b.restOfLine="string",U):void 0}function r(a,b){return a.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&a.match("include")?(b.isIncludeFiltered=!0,U):void 0}function s(a,b){if(b.isIncludeFiltered){var c=B(a,b);return b.isIncludeFiltered=!1,b.restOfLine="string",c}}function t(a,b){return a.match(/^mixin\b/)?(b.javaScriptLine=!0,U):void 0}function u(a,b){return a.match(/^\+([-\w]+)/)?(a.match(/^\( *[-\w]+ *=/,!1)||(b.javaScriptArguments=!0,b.javaScriptArgumentsDepth=0),"variable"):a.match(/^\+#{/,!1)?(a.next(),b.mixinCallAfter=!0,h(a,b)):void 0}function v(a,b){return b.mixinCallAfter?(b.mixinCallAfter=!1,a.match(/^\( *[-\w]+ *=/,!1)||(b.javaScriptArguments=!0,b.javaScriptArgumentsDepth=0),!0):void 0}function w(a,b){return a.match(/^(if|unless|else if|else)\b/)?(b.javaScriptLine=!0,U):void 0}function x(a,b){return a.match(/^(- *)?(each|for)\b/)?(b.isEach=!0,U):void 0}function y(a,b){if(b.isEach){if(a.match(/^ in\b/))return b.javaScriptLine=!0,b.isEach=!1,U;if(a.sol()||a.eol())b.isEach=!1;else if(a.next()){for(;!a.match(/^ in\b/,!1)&&a.next(););return"variable"}}}function z(a,b){return a.match(/^while\b/)?(b.javaScriptLine=!0,U):void 0}function A(a,b){var c;return(c=a.match(/^(\w(?:[-:\w]*\w)?)\/?/))?(b.lastTag=c[1].toLowerCase(),"script"===b.lastTag&&(b.scriptType="application/javascript"),"tag"):void 0}function B(c,d){if(c.match(/^:([\w\-]+)/)){var e;return b&&b.innerModes&&(e=b.innerModes(c.current().substring(1))),e||(e=c.current().substring(1)),"string"==typeof e&&(e=a.getMode(b,e)),O(c,d,e),"atom"}}function C(a,b){return a.match(/^(!?=|-)/)?(b.javaScriptLine=!0,"punctuation"):void 0}function D(a){return a.match(/^#([\w-]+)/)?W:void 0}function E(a){return a.match(/^\.([\w-]+)/)?X:void 0}function F(a,b){return"("==a.peek()?(a.next(),b.isAttrs=!0,b.attrsNest=[],b.inAttributeName=!0,b.attrValue="",b.attributeIsType=!1,"punctuation"):void 0}function G(a,b){if(b.isAttrs){if(Y[a.peek()]&&b.attrsNest.push(Y[a.peek()]),b.attrsNest[b.attrsNest.length-1]===a.peek())b.attrsNest.pop();else if(a.eat(")"))return b.isAttrs=!1,"punctuation";if(b.inAttributeName&&a.match(/^[^=,\)!]+/))return("="===a.peek()||"!"===a.peek())&&(b.inAttributeName=!1,b.jsState=Z.startState(),"script"===b.lastTag&&"type"===a.current().trim().toLowerCase()?b.attributeIsType=!0:b.attributeIsType=!1),"attribute";var c=Z.token(a,b.jsState);if(b.attributeIsType&&"string"===c&&(b.scriptType=a.current().toString()),0===b.attrsNest.length&&("string"===c||"variable"===c||"keyword"===c))try{return Function("","var x "+b.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),b.inAttributeName=!0,b.attrValue="",a.backUp(a.current().length),G(a,b)}catch(d){}return b.attrValue+=a.current(),c||!0}}function H(a,b){return a.match(/^&attributes\b/)?(b.javaScriptArguments=!0,b.javaScriptArgumentsDepth=0,"keyword"):void 0}function I(a){return a.sol()&&a.eatSpace()?"indent":void 0}function J(a,b){return a.match(/^ *\/\/(-)?([^\n]*)/)?(b.indentOf=a.indentation(),b.indentToken="comment","comment"):void 0}function K(a){return a.match(/^: */)?"colon":void 0}function L(a,b){return a.match(/^(?:\| ?| )([^\n]+)/)?"string":a.match(/^(<[^\n]*)/,!1)?(O(a,b,"htmlmixed"),b.innerModeForLine=!0,P(a,b,!0)):void 0}function M(a,b){if(a.eat(".")){var c=null;return"script"===b.lastTag&&-1!=b.scriptType.toLowerCase().indexOf("javascript")?c=b.scriptType.toLowerCase().replace(/"|'/g,""):"style"===b.lastTag&&(c="css"),O(a,b,c),"dot"}}function N(a){return a.next(),null}function O(c,d,e){e=a.mimeModes[e]||e,e=b.innerModes?b.innerModes(e)||e:e,e=a.mimeModes[e]||e,e=a.getMode(b,e),d.indentOf=c.indentation(),e&&"null"!==e.name?d.innerMode=e:d.indentToken="string"}function P(a,b,c){return a.indentation()>b.indentOf||b.innerModeForLine&&!a.sol()||c?b.innerMode?(b.innerState||(b.innerState=b.innerMode.startState?b.innerMode.startState(a.indentation()):{}),a.hideFirstChars(b.indentOf+2,function(){return b.innerMode.token(a,b.innerState)||!0})):(a.skipToEnd(),b.indentToken):void(a.sol()&&(b.indentOf=1/0,b.indentToken=null,b.innerMode=null,b.innerState=null))}function Q(a,b){if(a.sol()&&(b.restOfLine=""),b.restOfLine){a.skipToEnd();var c=b.restOfLine;return b.restOfLine="",c}}function R(){return new c}function S(a){return a.copy()}function T(a,b){var c=P(a,b)||Q(a,b)||i(a,b)||s(a,b)||y(a,b)||G(a,b)||d(a,b)||e(a,b)||v(a,b)||f(a,b)||g(a,b)||h(a,b)||j(a,b)||k(a,b)||l(a,b)||m(a,b)||n(a,b)||o(a,b)||p(a,b)||q(a,b)||r(a,b)||t(a,b)||u(a,b)||w(a,b)||x(a,b)||z(a,b)||A(a,b)||B(a,b)||C(a,b)||D(a,b)||E(a,b)||F(a,b)||H(a,b)||I(a,b)||L(a,b)||J(a,b)||K(a,b)||M(a,b)||N(a,b);return c===!0?null:c}var U="keyword",V="meta",W="builtin",X="qualifier",Y={"{":"}","(":")","[":"]"},Z=a.getMode(b,"javascript");return c.prototype.copy=function(){var b=new c;return b.javaScriptLine=this.javaScriptLine,b.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,b.javaScriptArguments=this.javaScriptArguments,b.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,b.isInterpolating=this.isInterpolating,b.interpolationNesting=this.intpolationNesting,b.jsState=a.copyState(Z,this.jsState),b.innerMode=this.innerMode,this.innerMode&&this.innerState&&(b.innerState=a.copyState(this.innerMode,this.innerState)),b.restOfLine=this.restOfLine,b.isIncludeFiltered=this.isIncludeFiltered,b.isEach=this.isEach,b.lastTag=this.lastTag,b.scriptType=this.scriptType,b.isAttrs=this.isAttrs,b.attrsNest=this.attrsNest.slice(),b.inAttributeName=this.inAttributeName,b.attributeIsType=this.attributeIsType,b.attrValue=this.attrValue,b.indentOf=this.indentOf,b.indentToken=this.indentToken,b.innerModeForLine=this.innerModeForLine,b},{startState:R,copyState:S,token:T}}),a.defineMIME("text/x-jade","jade")}); -\ 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 3f05ac4..ef01847 100644 ---- a/media/editors/codemirror/mode/javascript/javascript.js -+++ b/media/editors/codemirror/mode/javascript/javascript.js -@@ -549,6 +549,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { - } - function classBody(type, value) { - if (type == "variable" || cx.style == "keyword") { -+ if (value == "static") { -+ cx.marked = "keyword"; -+ return cont(classBody); -+ } - cx.marked = "property"; - if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody); - return cont(functiondef, classBody); -@@ -581,7 +585,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { - function importSpec(type, value) { - if (type == "{") return contCommasep(importSpec, "}"); - if (type == "variable") register(value); -- return cont(); -+ if (value == "*") cx.marked = "keyword"; -+ return cont(maybeAs); -+ } -+ function maybeAs(_type, value) { -+ if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } - } - function maybeFrom(_type, value) { - if (value == "from") { cx.marked = "keyword"; return cont(expression); } -@@ -669,6 +677,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { - blockCommentEnd: jsonMode ? null : "*/", - lineComment: jsonMode ? null : "//", - fold: "brace", -+ closeBrackets: "()[]{}''\"\"``", - - helperType: jsonMode ? "json" : "javascript", - jsonldMode: jsonldMode, -diff --git a/media/editors/codemirror/mode/javascript/javascript.min.js b/media/editors/codemirror/mode/javascript/javascript.min.js -index e031cf7..bd5d8d4 100644 ---- a/media/editors/codemirror/mode/javascript/javascript.min.js -+++ b/media/editors/codemirror/mode/javascript/javascript.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,r){function n(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function a(e,t,r){return mt=e,yt=r,t}function i(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=o(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return a("number","number");if("."==r&&e.match(".."))return a("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return a(r);if("="==r&&e.eat(">"))return a("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),a("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),a("number","number");if("/"==r)return e.eat("*")?(t.tokenize=c,c(e,t)):e.eat("/")?(e.skipToEnd(),a("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(n(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),a("regexp","string-2")):(e.eatWhile(Mt),a("operator","operator",e.current()));if("`"==r)return t.tokenize=u,u(e,t);if("#"==r)return e.skipToEnd(),a("error","error");if(Mt.test(r))return e.eatWhile(Mt),a("operator","operator",e.current());if(wt.test(r)){e.eatWhile(wt);var i=e.current(),l=jt.propertyIsEnumerable(i)&&jt[i];return l&&"."!=t.lastType?a(l.type,l.style,i):a("variable","variable",i)}}function o(e){return function(t,r){var n,o=!1;if(xt&&"@"==t.peek()&&t.match(Vt))return r.tokenize=i,a("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||o);)o=!o&&"\\"==n;return o||(r.tokenize=i),a("string","string")}}function c(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=i;break}n="*"==r}return a("comment","comment")}function u(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=i;break}n=!n&&"\\"==r}return a("quasi","string-2",e.current())}function l(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(0>r)){for(var n=0,a=!1,i=r-1;i>=0;--i){var o=e.string.charAt(i),c=Et.indexOf(o);if(c>=0&&3>c){if(!n){++i;break}if(0==--n)break}else if(c>=3&&6>c)++n;else if(wt.test(o))a=!0;else{if(/["'\/]/.test(o))return;if(a&&!n){++i;break}}}a&&!n&&(t.fatArrowAt=i)}}function s(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function f(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function d(e,t,r,n,a){var i=e.cc;for(zt.state=e,zt.stream=a,zt.marked=null,zt.cc=i,zt.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var o=i.length?i.pop():ht?w:g;if(o(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return zt.marked?zt.marked:"variable"==r&&f(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)zt.cc.push(arguments[e])}function v(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var n=zt.state;if(n.context){if(zt.marked="def",t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function y(){zt.state.context={prev:zt.state.context,vars:zt.state.localVars},zt.state.localVars=Tt}function b(){zt.state.localVars=zt.state.context.vars,zt.state.context=zt.state.context.prev}function k(e,t){var r=function(){var r=zt.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new s(n,zt.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function x(){var e=zt.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function h(e){function t(r){return r==e?v():";"==e?p():v(t)}return t}function g(e,t){return"var"==e?v(k("vardef",t.length),F,h(";"),x):"keyword a"==e?v(k("form"),w,g,x):"keyword b"==e?v(k("form"),g,x):"{"==e?v(k("}"),U,x):";"==e?v():"if"==e?("else"==zt.state.lexical.info&&zt.state.cc[zt.state.cc.length-1]==x&&zt.state.cc.pop()(),v(k("form"),w,g,x,Q)):"function"==e?v(et):"for"==e?v(k("form"),R,g,x):"variable"==e?v(k("stat"),q):"switch"==e?v(k("form"),w,k("}","switch"),h("{"),U,x,x):"case"==e?v(w,h(":")):"default"==e?v(h(":")):"catch"==e?v(k("form"),y,h("("),tt,h(")"),g,x,b):"module"==e?v(k("form"),y,ot,b,x):"class"==e?v(k("form"),rt,x):"export"==e?v(k("form"),ct,x):"import"==e?v(k("form"),ut,x):p(k("stat"),w,h(";"),x)}function w(e){return M(e,!1)}function j(e){return M(e,!0)}function M(e,t){if(zt.state.fatArrowAt==zt.stream.start){var r=t?$:C;if("("==e)return v(y,k(")"),N(G,")"),x,h("=>"),r,b);if("variable"==e)return p(y,G,h("=>"),r,b)}var n=t?z:I;return It.hasOwnProperty(e)?v(n):"function"==e?v(et,n):"keyword c"==e?v(t?E:V):"("==e?v(k(")"),V,pt,h(")"),x,n):"operator"==e||"spread"==e?v(t?j:w):"["==e?v(k("]"),ft,x,n):"{"==e?H(P,"}",null,n):"quasi"==e?p(T,n):v()}function V(e){return e.match(/[;\}\)\],]/)?p():p(w)}function E(e){return e.match(/[;\}\)\],]/)?p():p(j)}function I(e,t){return","==e?v(w):z(e,t,!1)}function z(e,t,r){var n=0==r?I:z,a=0==r?w:j;return"=>"==e?v(y,r?$:C,b):"operator"==e?/\+\+|--/.test(t)?v(n):"?"==t?v(w,h(":"),a):v(a):"quasi"==e?p(T,n):";"!=e?"("==e?H(j,")","call",n):"."==e?v(O,n):"["==e?v(k("]"),V,h("]"),x,n):void 0:void 0}function T(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?v(T):v(w,A)}function A(e){return"}"==e?(zt.marked="string-2",zt.state.tokenize=u,v(T)):void 0}function C(e){return l(zt.stream,zt.state),p("{"==e?g:w)}function $(e){return l(zt.stream,zt.state),p("{"==e?g:j)}function q(e){return":"==e?v(x,g):p(I,h(";"),x)}function O(e){return"variable"==e?(zt.marked="property",v()):void 0}function P(e,t){return"variable"==e||"keyword"==zt.style?(zt.marked="property",v("get"==t||"set"==t?S:W)):"number"==e||"string"==e?(zt.marked=xt?"property":zt.style+" property",v(W)):"jsonld-keyword"==e?v(W):"["==e?v(w,h("]"),W):void 0}function S(e){return"variable"!=e?p(W):(zt.marked="property",v(et))}function W(e){return":"==e?v(j):"("==e?p(et):void 0}function N(e,t){function r(n){if(","==n){var a=zt.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),v(e,r)}return n==t?v():v(h(t))}return function(n){return n==t?v():p(e,r)}}function H(e,t,r){for(var n=3;n!?|~^]/,Vt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Et="([{}])",It={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},zt={state:null,column:null,marked:null,cc:null},Tt={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:i,lastType:"sof",cc:[],lexical:new s((e||0)-bt,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),l(e,t)),t.tokenize!=c&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==mt?r:(t.lastType="operator"!=mt||"++"!=yt&&"--"!=yt?mt:"incdec",d(t,r,mt,yt,e))},indent:function(t,n){if(t.tokenize==c)return e.Pass;if(t.tokenize!=i)return 0;var a=n&&n.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var l=t.cc[u];if(l==x)o=o.prev;else if(l!=Q)break}"stat"==o.type&&"}"==a&&(o=o.prev),kt&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var s=o.type,f=a==s;return"vardef"==s?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==s&&"{"==a?o.indented:"form"==s?o.indented+bt:"stat"==s?o.indented+(vt(t,n)?kt||bt:0):"switch"!=o.info||f||0==r.doubleIndentSwitch?o.align?o.column+(f?0:1):o.indented+(f?0:bt):o.indented+(/^(?:case|default)\b/.test(n)?bt:2*bt)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:ht?null:"/*",blockCommentEnd:ht?null:"*/",lineComment:ht?null:"//",fold:"brace",helperType:ht?"json":"javascript",jsonldMode:xt,jsonMode:ht}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.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 qa=a,ra=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(/\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")):"operator"==b.lastType||"keyword c"==b.lastType||"sof"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(d(a),a.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),e("regexp","string-2")):(a.eatWhile(za),e("operator","operator",a.current()));if("`"==c)return b.tokenize=i,i(a,b);if("#"==c)return a.skipToEnd(),e("error","error");if(za.test(c))return a.eatWhile(za),e("operator","operator",a.current());if(xa.test(c)){a.eatWhile(xa);var f=a.current(),j=ya.propertyIsEnumerable(f)&&ya[f];return j&&"."!=b.lastType?e(j.type,j.style,f):e("variable","variable",f)}}function g(a){return function(b,c){var d,g=!1;if(ua&&"@"==b.peek()&&b.match(Aa))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(!(0>c)){for(var d=0,e=!1,f=c-1;f>=0;--f){var g=a.string.charAt(f),h=Ba.indexOf(g);if(h>=0&&3>h){if(!d){++f;break}if(0==--d)break}else if(h>=3&&6>h)++d;else if(xa.test(g))e=!0;else{if(/["'\/]/.test(g))return;if(e&&!d){++f;break}}}e&&!d&&(b.fatArrowAt=f)}}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(Da.state=a,Da.stream=e,Da.marked=null,Da.cc=f,Da.style=b,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var g=f.length?f.pop():va?w:v;if(g(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return Da.marked?Da.marked:"variable"==c&&l(a,d)?"variable-2":b}}}function n(){for(var a=arguments.length-1;a>=0;a--)Da.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=Da.state;if(d.context){if(Da.marked="def",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(){Da.state.context={prev:Da.state.context,vars:Da.state.localVars},Da.state.localVars=Ea}function r(){Da.state.localVars=Da.state.context.vars,Da.state.context=Da.state.context.prev}function s(a,b){var c=function(){var c=Da.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,Da.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function t(){var a=Da.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function u(a){function b(c){return c==a?o():";"==a?n():o(b)}return b}function v(a,b){return"var"==a?o(s("vardef",b.length),R,u(";"),t):"keyword a"==a?o(s("form"),w,v,t):"keyword b"==a?o(s("form"),v,t):"{"==a?o(s("}"),O,t):";"==a?o():"if"==a?("else"==Da.state.lexical.info&&Da.state.cc[Da.state.cc.length-1]==t&&Da.state.cc.pop()(),o(s("form"),w,v,t,W)):"function"==a?o(aa):"for"==a?o(s("form"),X,v,t):"variable"==a?o(s("stat"),H):"switch"==a?o(s("form"),w,s("}","switch"),u("{"),O,t,t):"case"==a?o(w,u(":")):"default"==a?o(u(":")):"catch"==a?o(s("form"),q,u("("),ba,u(")"),v,t,r):"module"==a?o(s("form"),q,ga,r,t):"class"==a?o(s("form"),ca,t):"export"==a?o(s("form"),ha,t):"import"==a?o(s("form"),ia,t):n(s("stat"),w,u(";"),t)}function w(a){return y(a,!1)}function x(a){return y(a,!0)}function y(a,b){if(Da.state.fatArrowAt==Da.stream.start){var c=b?G:F;if("("==a)return o(q,s(")"),M(S,")"),t,u("=>"),c,r);if("variable"==a)return n(q,S,u("=>"),c,r)}var d=b?C:B;return Ca.hasOwnProperty(a)?o(d):"function"==a?o(aa,d):"keyword c"==a?o(b?A:z):"("==a?o(s(")"),z,oa,u(")"),t,d):"operator"==a||"spread"==a?o(b?x:w):"["==a?o(s("]"),ma,t,d):"{"==a?N(J,"}",null,d):"quasi"==a?n(D,d):o()}function z(a){return a.match(/[;\}\)\],]/)?n():n(w)}function A(a){return a.match(/[;\}\)\],]/)?n():n(x)}function B(a,b){return","==a?o(w):C(a,b,!1)}function C(a,b,c){var d=0==c?B:C,e=0==c?w:x;return"=>"==a?o(q,c?G:F,r):"operator"==a?/\+\+|--/.test(b)?o(d):"?"==b?o(w,u(":"),e):o(e):"quasi"==a?n(D,d):";"!=a?"("==a?N(x,")","call",d):"."==a?o(I,d):"["==a?o(s("]"),z,u("]"),t,d):void 0:void 0}function D(a,b){return"quasi"!=a?n():"${"!=b.slice(b.length-2)?o(D):o(w,E)}function E(a){return"}"==a?(Da.marked="string-2",Da.state.tokenize=i,o(D)):void 0}function F(a){return j(Da.stream,Da.state),n("{"==a?v:w)}function G(a){return j(Da.stream,Da.state),n("{"==a?v:x)}function H(a){return":"==a?o(t,v):n(B,u(";"),t)}function I(a){return"variable"==a?(Da.marked="property",o()):void 0}function J(a,b){return"variable"==a||"keyword"==Da.style?(Da.marked="property",o("get"==b||"set"==b?K:L)):"number"==a||"string"==a?(Da.marked=ua?"property":Da.style+" property",o(L)):"jsonld-keyword"==a?o(L):"["==a?o(w,u("]"),L):void 0}function K(a){return"variable"!=a?n(L):(Da.marked="property",o(aa))}function L(a){return":"==a?o(x):"("==a?n(aa):void 0}function M(a,b){function c(d){if(","==d){var e=Da.state.lexical;return"call"==e.info&&(e.pos=(e.pos||0)+1),o(a,c)}return d==b?o():o(u(b))}return function(d){return d==b?o():n(a,c)}}function N(a,b,c){for(var d=3;d!?|~^]/,Aa=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ba="([{}])",Ca={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Da={state:null,column:null,marked:null,cc:null},Ea={name:"this",next:{name:"arguments"}};return t.lex=!0,{startState:function(a){var b={tokenize:f,lastType:"sof",cc:[],lexical:new k((a||0)-sa,0,"block",!1),localVars:c.localVars,context:c.localVars&&{vars:c.localVars},indented: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"==qa?c:(b.lastType="operator"!=qa||"++"!=ra&&"--"!=ra?qa:"incdec",m(b,c,qa,ra,a))},indent:function(b,d){if(b.tokenize==h)return a.Pass;if(b.tokenize!=f)return 0;var e=d&&d.charAt(0),g=b.lexical;if(!/^\s*else\b/.test(d))for(var i=b.cc.length-1;i>=0;--i){var j=b.cc[i];if(j==t)g=g.prev;else if(j!=W)break}"stat"==g.type&&"}"==e&&(g=g.prev),ta&&")"==g.type&&"stat"==g.prev.type&&(g=g.prev);var k=g.type,l=e==k;return"vardef"==k?g.indented+("operator"==b.lastType||","==b.lastType?g.info+1:0):"form"==k&&"{"==e?g.indented:"form"==k?g.indented+sa:"stat"==k?g.indented+(pa(b,d)?ta||sa:0):"switch"!=g.info||l||0==c.doubleIndentSwitch?g.align?g.column+(l?0:1):g.indented+(l?0:sa):g.indented+(/^(?:case|default)\b/.test(d)?sa:2*sa)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:va?null:"/*",blockCommentEnd:va?null:"*/",lineComment:va?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:va?"json":"javascript",jsonldMode:ua,jsonMode:va}}),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/javascript/json-ld.html b/media/editors/codemirror/mode/javascript/json-ld.html -deleted file mode 100644 -index 3a37f0b..0000000 ---- a/media/editors/codemirror/mode/javascript/json-ld.html -+++ /dev/null -@@ -1,72 +0,0 @@ -- -- --CodeMirror: JSON-LD mode -- -- -- -- -- -- -- -- -- -- -- -- --
    --

    JSON-LD mode

    -- -- --
    -- -- -- --

    This is a specialization of the JavaScript mode.

    --
    -diff --git a/media/editors/codemirror/mode/javascript/test.js b/media/editors/codemirror/mode/javascript/test.js -deleted file mode 100644 -index 91b0e89..0000000 ---- a/media/editors/codemirror/mode/javascript/test.js -+++ /dev/null -@@ -1,200 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({indentUnit: 2}, "javascript"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- -- MT("locals", -- "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"); -- -- MT("comma-and-binop", -- "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"); -- -- MT("destructuring", -- "([keyword function]([def a], [[[def b], [def c] ]]) {", -- " [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);", -- " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];", -- "})();"); -- -- MT("class_body", -- "[keyword class] [variable Foo] {", -- " [property constructor]() {}", -- " [property sayName]() {", -- " [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];", -- " }", -- "}"); -- -- MT("class", -- "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {", -- " [property get] [property prop]() { [keyword return] [number 24]; }", -- " [property constructor]([def x], [def y]) {", -- " [keyword super]([string 'something']);", -- " [keyword this].[property x] [operator =] [variable-2 x];", -- " }", -- "}"); -- -- MT("module", -- "[keyword module] [string 'foo'] {", -- " [keyword export] [keyword let] [def x] [operator =] [number 42];", -- " [keyword export] [keyword *] [keyword from] [string 'somewhere'];", -- "}"); -- -- MT("import", -- "[keyword function] [variable foo]() {", -- " [keyword import] [def $] [keyword from] [string 'jquery'];", -- " [keyword module] [def crypto] [keyword from] [string 'crypto'];", -- " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];", -- "}"); -- -- MT("const", -- "[keyword function] [variable f]() {", -- " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];", -- "}"); -- -- MT("for/of", -- "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}"); -- -- MT("generator", -- "[keyword function*] [variable repeat]([def n]) {", -- " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])", -- " [keyword yield] [variable-2 i];", -- "}"); -- -- MT("quotedStringAddition", -- "[keyword let] [variable f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];"); -- -- MT("quotedFatArrow", -- "[keyword let] [variable f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];"); -- -- MT("fatArrow", -- "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);", -- "[variable a];", // No longer in scope -- "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];", -- "[variable c];"); -- -- MT("spread", -- "[keyword function] [variable f]([def a], [meta ...][def b]) {", -- " [variable something]([variable-2 a], [meta ...][variable-2 b]);", -- "}"); -- -- MT("comprehension", -- "[keyword function] [variable f]() {", -- " [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];", -- " ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));", -- "}"); -- -- MT("quasi", -- "[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); -- -- MT("quasi_no_function", -- "[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); -- -- MT("indent_statement", -- "[keyword var] [variable x] [operator =] [number 10]", -- "[variable x] [operator +=] [variable y] [operator +]", -- " [atom Infinity]", -- "[keyword debugger];"); -- -- MT("indent_if", -- "[keyword if] ([number 1])", -- " [keyword break];", -- "[keyword else] [keyword if] ([number 2])", -- " [keyword continue];", -- "[keyword else]", -- " [number 10];", -- "[keyword if] ([number 1]) {", -- " [keyword break];", -- "} [keyword else] [keyword if] ([number 2]) {", -- " [keyword continue];", -- "} [keyword else] {", -- " [number 10];", -- "}"); -- -- MT("indent_for", -- "[keyword for] ([keyword var] [variable i] [operator =] [number 0];", -- " [variable i] [operator <] [number 100];", -- " [variable i][operator ++])", -- " [variable doSomething]([variable i]);", -- "[keyword debugger];"); -- -- MT("indent_c_style", -- "[keyword function] [variable foo]()", -- "{", -- " [keyword debugger];", -- "}"); -- -- MT("indent_else", -- "[keyword for] (;;)", -- " [keyword if] ([variable foo])", -- " [keyword if] ([variable bar])", -- " [number 1];", -- " [keyword else]", -- " [number 2];", -- " [keyword else]", -- " [number 3];"); -- -- MT("indent_funarg", -- "[variable foo]([number 10000],", -- " [keyword function]([def a]) {", -- " [keyword debugger];", -- "};"); -- -- MT("indent_below_if", -- "[keyword for] (;;)", -- " [keyword if] ([variable foo])", -- " [number 1];", -- "[number 2];"); -- -- MT("multilinestring", -- "[keyword var] [variable x] [operator =] [string 'foo\\]", -- "[string bar'];"); -- -- MT("scary_regexp", -- "[string-2 /foo[[/]]bar/];"); -- -- MT("indent_strange_array", -- "[keyword var] [variable x] [operator =] [[", -- " [number 1],,", -- " [number 2],", -- "]];", -- "[number 10];"); -- -- var jsonld_mode = CodeMirror.getMode( -- {indentUnit: 2}, -- {name: "javascript", jsonld: true} -- ); -- function LD(name) { -- test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1)); -- } -- -- LD("json_ld_keywords", -- '{', -- ' [meta "@context"]: {', -- ' [meta "@base"]: [string "http://example.com"],', -- ' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],', -- ' [property "likesFlavor"]: {', -- ' [meta "@container"]: [meta "@list"]', -- ' [meta "@reverse"]: [string "@beFavoriteOf"]', -- ' },', -- ' [property "nick"]: { [meta "@container"]: [meta "@set"] },', -- ' [property "nick"]: { [meta "@container"]: [meta "@index"] }', -- ' },', -- ' [meta "@graph"]: [[ {', -- ' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],', -- ' [property "name"]: [string "John Lennon"],', -- ' [property "modified"]: {', -- ' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],', -- ' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]', -- ' }', -- ' } ]]', -- '}'); -- -- LD("json_ld_fake", -- '{', -- ' [property "@fake"]: [string "@fake"],', -- ' [property "@contextual"]: [string "@identifier"],', -- ' [property "user@domain.com"]: [string "@graphical"],', -- ' [property "@ID"]: [string "@@ID"]', -- '}'); --})(); -diff --git a/media/editors/codemirror/mode/javascript/test.min.js b/media/editors/codemirror/mode/javascript/test.min.js -deleted file mode 100644 -index 24c2a2d..0000000 ---- a/media/editors/codemirror/mode/javascript/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function r(r){test.mode(r,o,Array.prototype.slice.call(arguments,1))}function e(r){test.mode(r,a,Array.prototype.slice.call(arguments,1))}var o=CodeMirror.getMode({indentUnit:2},"javascript");r("locals","[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"),r("comma-and-binop","[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"),r("destructuring","([keyword function]([def a], [[[def b], [def c] ]]) {"," [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);"," [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];","})();"),r("class_body","[keyword class] [variable Foo] {"," [property constructor]() {}"," [property sayName]() {"," [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];"," }","}"),r("class","[keyword class] [variable Point] [keyword extends] [variable SuperThing] {"," [property get] [property prop]() { [keyword return] [number 24]; }"," [property constructor]([def x], [def y]) {"," [keyword super]([string 'something']);"," [keyword this].[property x] [operator =] [variable-2 x];"," }","}"),r("module","[keyword module] [string 'foo'] {"," [keyword export] [keyword let] [def x] [operator =] [number 42];"," [keyword export] [keyword *] [keyword from] [string 'somewhere'];","}"),r("import","[keyword function] [variable foo]() {"," [keyword import] [def $] [keyword from] [string 'jquery'];"," [keyword module] [def crypto] [keyword from] [string 'crypto'];"," [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];","}"),r("const","[keyword function] [variable f]() {"," [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];","}"),r("for/of","[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}"),r("generator","[keyword function*] [variable repeat]([def n]) {"," [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])"," [keyword yield] [variable-2 i];","}"),r("quotedStringAddition","[keyword let] [variable f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];"),r("quotedFatArrow","[keyword let] [variable f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];"),r("fatArrow","[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);","[variable a];","[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];","[variable c];"),r("spread","[keyword function] [variable f]([def a], [meta ...][def b]) {"," [variable something]([variable-2 a], [meta ...][variable-2 b]);","}"),r("comprehension","[keyword function] [variable f]() {"," [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];"," ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));","}"),r("quasi","[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"),r("quasi_no_function","[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"),r("indent_statement","[keyword var] [variable x] [operator =] [number 10]","[variable x] [operator +=] [variable y] [operator +]"," [atom Infinity]","[keyword debugger];"),r("indent_if","[keyword if] ([number 1])"," [keyword break];","[keyword else] [keyword if] ([number 2])"," [keyword continue];","[keyword else]"," [number 10];","[keyword if] ([number 1]) {"," [keyword break];","} [keyword else] [keyword if] ([number 2]) {"," [keyword continue];","} [keyword else] {"," [number 10];","}"),r("indent_for","[keyword for] ([keyword var] [variable i] [operator =] [number 0];"," [variable i] [operator <] [number 100];"," [variable i][operator ++])"," [variable doSomething]([variable i]);","[keyword debugger];"),r("indent_c_style","[keyword function] [variable foo]()","{"," [keyword debugger];","}"),r("indent_else","[keyword for] (;;)"," [keyword if] ([variable foo])"," [keyword if] ([variable bar])"," [number 1];"," [keyword else]"," [number 2];"," [keyword else]"," [number 3];"),r("indent_funarg","[variable foo]([number 10000],"," [keyword function]([def a]) {"," [keyword debugger];","};"),r("indent_below_if","[keyword for] (;;)"," [keyword if] ([variable foo])"," [number 1];","[number 2];"),r("multilinestring","[keyword var] [variable x] [operator =] [string 'foo\\]","[string bar'];"),r("scary_regexp","[string-2 /foo[[/]]bar/];"),r("indent_strange_array","[keyword var] [variable x] [operator =] [["," [number 1],,"," [number 2],","]];","[number 10];");var a=CodeMirror.getMode({indentUnit:2},{name:"javascript",jsonld:!0});e("json_ld_keywords","{",' [meta "@context"]: {',' [meta "@base"]: [string "http://example.com"],',' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],',' [property "likesFlavor"]: {',' [meta "@container"]: [meta "@list"]',' [meta "@reverse"]: [string "@beFavoriteOf"]'," },",' [property "nick"]: { [meta "@container"]: [meta "@set"] },',' [property "nick"]: { [meta "@container"]: [meta "@index"] }'," },",' [meta "@graph"]: [[ {',' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],',' [property "name"]: [string "John Lennon"],',' [property "modified"]: {',' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],',' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]'," }"," } ]]","}"),e("json_ld_fake","{",' [property "@fake"]: [string "@fake"],',' [property "@contextual"]: [string "@identifier"],',' [property "user@domain.com"]: [string "@graphical"],',' [property "@ID"]: [string "@@ID"]',"}")}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/javascript/typescript.html b/media/editors/codemirror/mode/javascript/typescript.html -deleted file mode 100644 -index 2cfc538..0000000 ---- a/media/editors/codemirror/mode/javascript/typescript.html -+++ /dev/null -@@ -1,61 +0,0 @@ -- -- --CodeMirror: TypeScript mode -- -- -- -- -- -- -- -- -- --
    --

    TypeScript mode

    -- -- --
    -- -- -- --

    This is a specialization of the JavaScript mode.

    --
    -diff --git a/media/editors/codemirror/mode/jinja2/jinja2.min.js b/media/editors/codemirror/mode/jinja2/jinja2.min.js -index 0e22461..be1cba2 100644 ---- a/media/editors/codemirror/mode/jinja2/jinja2.min.js -+++ b/media/editors/codemirror/mode/jinja2/jinja2.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("jinja2",function(){function e(e,a){var c=e.peek();if(a.incomment)return e.skipTo("#}")?(e.eatWhile(/\#|}/),a.incomment=!1):e.skipToEnd(),"comment";if(a.intag){if(a.operator){if(a.operator=!1,e.match(i))return"atom";if(e.match(o))return"number"}if(a.sign){if(a.sign=!1,e.match(i))return"atom";if(e.match(o))return"number"}if(a.instring)return c==a.instring&&(a.instring=!1),e.next(),"string";if("'"==c||'"'==c)return a.instring=c,e.next(),"string";if(e.match(a.intag+"}")||e.eat("-")&&e.match(a.intag+"}"))return a.intag=!1,"tag";if(e.match(t))return a.operator=!0,"operator";if(e.match(r))a.sign=!0;else if(e.eat(" ")||e.sol()){if(e.match(n))return"keyword";if(e.match(i))return"atom";if(e.match(o))return"number";e.sol()&&e.next()}else e.next();return"variable"}if(e.eat("{")){if(c=e.eat("#"))return a.incomment=!0,e.skipTo("#}")?(e.eatWhile(/\#|}/),a.incomment=!1):e.skipToEnd(),"comment";if(c=e.eat(/\{|%/))return a.intag=c,"{"==c&&(a.intag="}"),e.eat("-"),"tag"}e.next()}var n=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","plural"],t=/^[+\-*&%=<>!?|~^]/,r=/^[:\[\(\{]/,i=["true","false"],o=/^(\d[+\-\*\/])?\d+(\.\d+)?/;return n=new RegExp("(("+n.join(")|(")+"))\\b"),i=new RegExp("(("+i.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,n){return n.tokenize(e,n)}}})}); -\ 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("jinja2",function(){function a(a,g){var h=a.peek();if(g.incomment)return a.skipTo("#}")?(a.eatWhile(/\#|}/),g.incomment=!1):a.skipToEnd(),"comment";if(g.intag){if(g.operator){if(g.operator=!1,a.match(e))return"atom";if(a.match(f))return"number"}if(g.sign){if(g.sign=!1,a.match(e))return"atom";if(a.match(f))return"number"}if(g.instring)return h==g.instring&&(g.instring=!1),a.next(),"string";if("'"==h||'"'==h)return g.instring=h,a.next(),"string";if(a.match(g.intag+"}")||a.eat("-")&&a.match(g.intag+"}"))return g.intag=!1,"tag";if(a.match(c))return g.operator=!0,"operator";if(a.match(d))g.sign=!0;else if(a.eat(" ")||a.sol()){if(a.match(b))return"keyword";if(a.match(e))return"atom";if(a.match(f))return"number";a.sol()&&a.next()}else a.next();return"variable"}if(a.eat("{")){if(h=a.eat("#"))return g.incomment=!0,a.skipTo("#}")?(a.eatWhile(/\#|}/),g.incomment=!1):a.skipToEnd(),"comment";if(h=a.eat(/\{|%/))return g.intag=h,"{"==h&&(g.intag="}"),a.eat("-"),"tag"}a.next()}var b=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","plural"],c=/^[+\-*&%=<>!?|~^]/,d=/^[:\[\(\{]/,e=["true","false"],f=/^(\d[+\-\*\/])?\d+(\.\d+)?/;return b=new RegExp("(("+b.join(")|(")+"))\\b"),e=new RegExp("(("+e.join(")|(")+"))\\b"),{startState:function(){return{tokenize:a}},token:function(a,b){return b.tokenize(a,b)}}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/julia/julia.js b/media/editors/codemirror/mode/julia/julia.js -index e854988..d0a74ce 100644 ---- a/media/editors/codemirror/mode/julia/julia.js -+++ b/media/editors/codemirror/mode/julia/julia.js -@@ -34,7 +34,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { - var closers = wordRegexp(blockClosers); - var macro = /^@[_A-Za-z][_A-Za-z0-9]*/; - var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/; -- var indentInfo = null; - - function in_array(state) { - var ch = cur_scope(state); -@@ -247,7 +246,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { - } - - function tokenLexer(stream, state) { -- indentInfo = null; - var style = state.tokenize(stream, state); - var current = stream.current(); - -diff --git a/media/editors/codemirror/mode/julia/julia.min.js b/media/editors/codemirror/mode/julia/julia.min.js -index 644eb80..e91312d 100644 ---- a/media/editors/codemirror/mode/julia/julia.min.js -+++ b/media/editors/codemirror/mode/julia/julia.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("julia",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e){var t=i(e);return"["==t||"{"==t?!0:!1}function i(e){return 0==e.scopes.length?null:e.scopes[e.scopes.length-1]}function a(e,t){var n=t.leaving_expr;if(e.sol()&&(n=!1),t.leaving_expr=!1,n&&e.match(/^'+/))return"operator";if(e.match(/^\.{2,3}/))return"operator";if(e.eatSpace())return null;var a=e.peek();if("#"===a)return e.skipToEnd(),"comment";"["===a&&t.scopes.push("["),"{"===a&&t.scopes.push("{");var l=i(t);"["===l&&"]"===a&&(t.scopes.pop(),t.leaving_expr=!0),"{"===l&&"}"===a&&(t.scopes.pop(),t.leaving_expr=!0),")"===a&&(t.leaving_expr=!0);var m;if(!r(t)&&(m=e.match(x,!1))&&t.scopes.push(m),!r(t)&&e.match(y,!1)&&t.scopes.pop(),r(t)&&e.match(/^end/))return"number";if(e.match(/^=>/))return"operator";if(e.match(/^[0-9\.]/,!1)){var p=RegExp(/^im\b/),h=!1;if(e.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)&&(h=!0),e.match(/^\d+\.(?!\.)\d*/)&&(h=!0),e.match(/^\.\d+/)&&(h=!0),h)return e.match(p),t.leaving_expr=!0,"number";var d=!1;if(e.match(/^0x[0-9a-f]+/i)&&(d=!0),e.match(/^0b[01]+/i)&&(d=!0),e.match(/^0o[0-7]+/i)&&(d=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(d=!0),e.match(/^0(?![\dx])/i)&&(d=!0),d)return e.match(p),t.leaving_expr=!0,"number"}return e.match(/^(::)|(<:)/)?"operator":!n&&e.match(z)?"string":e.match(u)?"operator":e.match(g)?(t.tokenize=o(e.current()),t.tokenize(e,t)):e.match(_)?"meta":e.match(f)?null:e.match(b)?"keyword":e.match(v)?"builtin":e.match(s)?(t.leaving_expr=!0,"variable"):(e.next(),c)}function o(e){function n(n,o){for(;!n.eol();)if(n.eatWhile(/[^'"\\]/),n.eat("\\")){if(n.next(),r&&n.eol())return i}else{if(n.match(e))return o.tokenize=a,i;n.eat(/['"]/)}if(r){if(t.singleLineStringErrors)return c;o.tokenize=a}return i}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var r=1==e.length,i="string";return n.isString=!0,n}function l(e,t){F=null;var n=t.tokenize(e,t),r=e.current();return"."===r?(n=e.match(s,!1)?null:c,null===n&&"meta"===t.lastStyle&&(n="meta"),n):n}var c="error",u=t.operators||/^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/,f=t.delimiters||/^[;,()[\]{}]/,s=t.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/,m=["begin","function","type","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"],p=["end","else","elseif","catch","finally"],h=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","macro","module","baremodule","type","immutable","quote","typealias","abstract","bitstype","ccall"],d=["true","false","enumerate","open","close","nothing","NaN","Inf","print","println","Int","Int8","Uint8","Int16","Uint16","Int32","Uint32","Int64","Uint64","Int128","Uint128","Bool","Char","Float16","Float32","Float64","Array","Vector","Matrix","String","UTF8String","ASCIIString","error","warn","info","@printf"],g=/^(`|'|"{3}|([br]?"))/,b=n(h),v=n(d),x=n(m),y=n(p),_=/^@[_A-Za-z][_A-Za-z0-9]*/,z=/^:[_A-Za-z][_A-Za-z0-9]*/,F=null,k={startState:function(){return{tokenize:a,scopes:[],leaving_expr:!1}},token:function(e,t){var n=l(e,t);return t.lastStyle=n,n},indent:function(e,t){var n=0;return("end"==t||"]"==t||"}"==t||"else"==t||"elseif"==t||"catch"==t||"finally"==t)&&(n=-1),4*(e.scopes.length+n)},lineComment:"#",fold:"indent",electricChars:"edlsifyh]}"};return k}),e.defineMIME("text/x-julia","julia")}); -\ 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("julia",function(a,b){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function d(a){var b=e(a);return"["==b||"{"==b?!0:!1}function e(a){return 0==a.scopes.length?null:a.scopes[a.scopes.length-1]}function f(a,b){var c=b.leaving_expr;if(a.sol()&&(c=!1),b.leaving_expr=!1,c&&a.match(/^'+/))return"operator";if(a.match(/^\.{2,3}/))return"operator";if(a.eatSpace())return null;var f=a.peek();if("#"===f)return a.skipToEnd(),"comment";"["===f&&b.scopes.push("["),"{"===f&&b.scopes.push("{");var h=e(b);"["===h&&"]"===f&&(b.scopes.pop(),b.leaving_expr=!0),"{"===h&&"}"===f&&(b.scopes.pop(),b.leaving_expr=!0),")"===f&&(b.leaving_expr=!0);var m;if(!d(b)&&(m=a.match(t,!1))&&b.scopes.push(m),!d(b)&&a.match(u,!1)&&b.scopes.pop(),d(b)&&a.match(/^end/))return"number";if(a.match(/^=>/))return"operator";if(a.match(/^[0-9\.]/,!1)){var n=RegExp(/^im\b/),o=!1;if(a.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)&&(o=!0),a.match(/^\d+\.(?!\.)\d*/)&&(o=!0),a.match(/^\.\d+/)&&(o=!0),o)return a.match(n),b.leaving_expr=!0,"number";var p=!1;if(a.match(/^0x[0-9a-f]+/i)&&(p=!0),a.match(/^0b[01]+/i)&&(p=!0),a.match(/^0o[0-7]+/i)&&(p=!0),a.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(p=!0),a.match(/^0(?![\dx])/i)&&(p=!0),p)return a.match(n),b.leaving_expr=!0,"number"}return a.match(/^(::)|(<:)/)?"operator":!c&&a.match(w)?"string":a.match(j)?"operator":a.match(q)?(b.tokenize=g(a.current()),b.tokenize(a,b)):a.match(v)?"meta":a.match(k)?null:a.match(r)?"keyword":a.match(s)?"builtin":a.match(l)?(b.leaving_expr=!0,"variable"):(a.next(),i)}function g(a){function c(c,g){for(;!c.eol();)if(c.eatWhile(/[^'"\\]/),c.eat("\\")){if(c.next(),d&&c.eol())return e}else{if(c.match(a))return g.tokenize=f,e;c.eat(/['"]/)}if(d){if(b.singleLineStringErrors)return i;g.tokenize=f}return e}for(;"rub".indexOf(a.charAt(0).toLowerCase())>=0;)a=a.substr(1);var d=1==a.length,e="string";return c.isString=!0,c}function h(a,b){var c=b.tokenize(a,b),d=a.current();return"."===d?(c=a.match(l,!1)?null:i,null===c&&"meta"===b.lastStyle&&(c="meta"),c):c}var i="error",j=b.operators||/^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/,k=b.delimiters||/^[;,()[\]{}]/,l=b.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/,m=["begin","function","type","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"],n=["end","else","elseif","catch","finally"],o=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","macro","module","baremodule","type","immutable","quote","typealias","abstract","bitstype","ccall"],p=["true","false","enumerate","open","close","nothing","NaN","Inf","print","println","Int","Int8","Uint8","Int16","Uint16","Int32","Uint32","Int64","Uint64","Int128","Uint128","Bool","Char","Float16","Float32","Float64","Array","Vector","Matrix","String","UTF8String","ASCIIString","error","warn","info","@printf"],q=/^(`|'|"{3}|([br]?"))/,r=c(o),s=c(p),t=c(m),u=c(n),v=/^@[_A-Za-z][_A-Za-z0-9]*/,w=/^:[_A-Za-z][_A-Za-z0-9]*/,x={startState:function(){return{tokenize:f,scopes:[],leaving_expr:!1}},token:function(a,b){var c=h(a,b);return b.lastStyle=c,c},indent:function(a,b){var c=0;return("end"==b||"]"==b||"}"==b||"else"==b||"elseif"==b||"catch"==b||"finally"==b)&&(c=-1),4*(a.scopes.length+c)},lineComment:"#",fold:"indent",electricChars:"edlsifyh]}"};return x}),a.defineMIME("text/x-julia","julia")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/kotlin/kotlin.js b/media/editors/codemirror/mode/kotlin/kotlin.js -index 73c84f6..1efec85 100644 ---- a/media/editors/codemirror/mode/kotlin/kotlin.js -+++ b/media/editors/codemirror/mode/kotlin/kotlin.js -@@ -271,6 +271,7 @@ CodeMirror.defineMode("kotlin", function (config, parserConfig) { - else return ctx.indented + (closing ? 0 : config.indentUnit); - }, - -+ closeBrackets: {triples: "'\""}, - electricChars: "{}" - }; - }); -diff --git a/media/editors/codemirror/mode/kotlin/kotlin.min.js b/media/editors/codemirror/mode/kotlin/kotlin.min.js -index 4fbf7b9..b008678 100644 ---- a/media/editors/codemirror/mode/kotlin/kotlin.min.js -+++ b/media/editors/codemirror/mode/kotlin/kotlin.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("kotlin",function(e,t){function n(e){for(var t={},n=e.split(" "),r=0;r"))return c="->",null;if(/[\-+*&%=<>!?|\/~]/.test(n))return e.eatWhile(/[\-+*&%=<>|~]/),"operator";e.eatWhile(/[\w\$_]/);var r=e.current();return h.propertyIsEnumerable(r)?"atom":k.propertyIsEnumerable(r)?(y.propertyIsEnumerable(r)&&(c="newstatement"),"softKeyword"):m.propertyIsEnumerable(r)?(y.propertyIsEnumerable(r)&&(c="newstatement"),"keyword"):"word"}function i(e,t,n){function r(t,n){for(var u,l=!1,s=!i;null!=(u=t.next());){if(u==e&&!l){if(!i)break;if(t.match(e+e)){s=!0;break}}if('"'==e&&"$"==u&&!l&&t.eat("{"))return n.tokenize.push(o()),"string";if("$"==u&&!l&&!t.eat(" "))return n.tokenize.push(a()),"string";l=!l&&"\\"==u}return d&&n.tokenize.push(r),s&&n.tokenize.pop(),"string"}var i=!1;if("/"!=e&&t.eat(e)){if(!t.eat(e))return"string";i=!0}return n.tokenize.push(r),r(t,n)}function o(){function e(e,n){if("}"==e.peek()){if(t--,0==t)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](e,n)}else"{"==e.peek()&&t++;return r(e,n)}var t=1;return e.isBase=!0,e}function a(){function e(e,t){if(e.eat(/[\w]/)){var n=e.eatWhile(/[\w]/);if(n)return t.tokenize.pop(),"word"}return t.tokenize.pop(),"string"}return e.isBase=!0,e}function u(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize.pop();break}r="*"==n}return"comment"}function l(e){return!e||"operator"==e||"->"==e||/[\.\[\{\(,;:]/.test(e)||"newstatement"==e||"keyword"==e||"proplabel"==e}function s(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function f(e,t,n){return e.context=new s(e.indented,t,n,null,e.context)}function p(e){var t=e.context.type;return(")"==t||"]"==t||"}"==t)&&(e.indented=e.context.indented),e.context=e.context.prev}var c,d=t.multiLineStrings,m=n("package continue return object while break class data trait throw super when type this else This try val var fun for is in if do as true false null get set"),k=n("import where by get set abstract enum open annotation override private public internal protected catch out vararg inline finally final ref"),y=n("catch class do else finally for if where try while enum"),h=n("null true false this");return r.isBase=!0,{startState:function(t){return{tokenize:[r],context:new s((t||0)-e.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(e,t){var n=t.context;if(e.sol()&&(null==n.align&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0,"statement"!=n.type||l(t.lastToken)||(p(t),n=t.context)),e.eatSpace())return null;c=null;var r=t.tokenize[t.tokenize.length-1](e,t);if("comment"==r)return r;if(null==n.align&&(n.align=!0),";"!=c&&":"!=c||"statement"!=n.type)if("->"==c&&"statement"==n.type&&"}"==n.prev.type)p(t),t.context.align=!1;else if("{"==c)f(t,e.column(),"}");else if("["==c)f(t,e.column(),"]");else if("("==c)f(t,e.column(),")");else if("}"==c){for(;"statement"==n.type;)n=p(t);for("}"==n.type&&(n=p(t));"statement"==n.type;)n=p(t)}else c==n.type?p(t):("}"==n.type||"top"==n.type||"statement"==n.type&&"newstatement"==c)&&f(t,e.column(),"statement");else p(t);return t.startOfLine=!1,t.lastToken=c||r,r},indent:function(t,n){if(!t.tokenize[t.tokenize.length-1].isBase)return 0;var r=n&&n.charAt(0),i=t.context;"statement"!=i.type||l(t.lastToken)||(i=i.prev);var o=r==i.type;return"statement"==i.type?i.indented+("{"==r?0:e.indentUnit):i.align?i.column+(o?0:1):i.indented+(o?0:e.indentUnit)},electricChars:"{}"}}),e.defineMIME("text/x-kotlin","kotlin")}); -\ 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("kotlin",function(a,b){function c(a){for(var b={},c=a.split(" "),d=0;d"))return m="->",null;if(/[\-+*&%=<>!?|\/~]/.test(c))return a.eatWhile(/[\-+*&%=<>|~]/),"operator";a.eatWhile(/[\w\$_]/);var d=a.current();return r.propertyIsEnumerable(d)?"atom":p.propertyIsEnumerable(d)?(q.propertyIsEnumerable(d)&&(m="newstatement"),"softKeyword"):o.propertyIsEnumerable(d)?(q.propertyIsEnumerable(d)&&(m="newstatement"),"keyword"):"word"}function e(a,b,c){function d(b,c){for(var h,i=!1,j=!e;null!=(h=b.next());){if(h==a&&!i){if(!e)break;if(b.match(a+a)){j=!0;break}}if('"'==a&&"$"==h&&!i&&b.eat("{"))return c.tokenize.push(f()),"string";if("$"==h&&!i&&!b.eat(" "))return c.tokenize.push(g()),"string";i=!i&&"\\"==h}return n&&c.tokenize.push(d),j&&c.tokenize.pop(),"string"}var e=!1;if("/"!=a&&b.eat(a)){if(!b.eat(a))return"string";e=!0}return c.tokenize.push(d),d(b,c)}function f(){function a(a,c){if("}"==a.peek()){if(b--,0==b)return c.tokenize.pop(),c.tokenize[c.tokenize.length-1](a,c)}else"{"==a.peek()&&b++;return d(a,c)}var b=1;return a.isBase=!0,a}function g(){function a(a,b){if(a.eat(/[\w]/)){var c=a.eatWhile(/[\w]/);if(c)return b.tokenize.pop(),"word"}return b.tokenize.pop(),"string"}return a.isBase=!0,a}function h(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize.pop();break}d="*"==c}return"comment"}function i(a){return!a||"operator"==a||"->"==a||/[\.\[\{\(,;:]/.test(a)||"newstatement"==a||"keyword"==a||"proplabel"==a}function j(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function k(a,b,c){return a.context=new j(a.indented,b,c,null,a.context)}function l(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var m,n=b.multiLineStrings,o=c("package continue return object while break class data trait throw super when type this else This try val var fun for is in if do as true false null get set"),p=c("import where by get set abstract enum open annotation override private public internal protected catch out vararg inline finally final ref"),q=c("catch class do else finally for if where try while enum"),r=c("null true false this");return d.isBase=!0,{startState:function(b){return{tokenize:[d],context:new j((b||0)-a.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0,"statement"!=c.type||i(b.lastToken)||(l(b),c=b.context)),a.eatSpace())return null;m=null;var d=b.tokenize[b.tokenize.length-1](a,b);if("comment"==d)return d;if(null==c.align&&(c.align=!0),";"!=m&&":"!=m||"statement"!=c.type)if("->"==m&&"statement"==c.type&&"}"==c.prev.type)l(b),b.context.align=!1;else if("{"==m)k(b,a.column(),"}");else if("["==m)k(b,a.column(),"]");else if("("==m)k(b,a.column(),")");else if("}"==m){for(;"statement"==c.type;)c=l(b);for("}"==c.type&&(c=l(b));"statement"==c.type;)c=l(b)}else m==c.type?l(b):("}"==c.type||"top"==c.type||"statement"==c.type&&"newstatement"==m)&&k(b,a.column(),"statement");else l(b);return b.startOfLine=!1,b.lastToken=m||d,d},indent:function(b,c){if(!b.tokenize[b.tokenize.length-1].isBase)return 0;var d=c&&c.charAt(0),e=b.context;"statement"!=e.type||i(b.lastToken)||(e=e.prev);var f=d==e.type;return"statement"==e.type?e.indented+("{"==d?0:a.indentUnit):e.align?e.column+(f?0:1):e.indented+(f?0:a.indentUnit)},closeBrackets:{triples:"'\""},electricChars:"{}"}}),a.defineMIME("text/x-kotlin","kotlin")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/livescript/livescript.js b/media/editors/codemirror/mode/livescript/livescript.js -index 55882ef..4b26e04 100644 ---- a/media/editors/codemirror/mode/livescript/livescript.js -+++ b/media/editors/codemirror/mode/livescript/livescript.js -@@ -24,8 +24,8 @@ - var nr = Rules[next_rule]; - if (nr.splice) { - for (var i$ = 0; i$ < nr.length; ++i$) { -- var r = nr[i$], m; -- if (r.regex && (m = stream.match(r.regex))) { -+ var r = nr[i$]; -+ if (r.regex && stream.match(r.regex)) { - state.next = r.next || state.next; - return r.token; - } -diff --git a/media/editors/codemirror/mode/livescript/livescript.min.js b/media/editors/codemirror/mode/livescript/livescript.min.js -index ca302a9..eae94dc 100644 ---- a/media/editors/codemirror/mode/livescript/livescript.min.js -+++ b/media/editors/codemirror/mode/livescript/livescript.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("livescript",function(){var e=function(e,t){var r=t.next||"start";if(r){t.next=t.next;var n=g[r];if(n.splice){for(var o=0;o|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+t+")?))\\s*$"),n="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",o={token:"string",regex:".+"},g={start:[{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)"+n},{token:"constant.language",regex:"(?:true|false|yes|no|on|off|null|void|undefined)"+n},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+n},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+n},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+n},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+n},{token:"identifier",regex:t+"\\s*:(?![:=])"},{token:"variable",regex:t},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:t,next:"start"},{token:"text",regex:"",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},o],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},o],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},o],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},o],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},o],words:[{token:"string",regex:".*?\\]>",next:"key"},o]};for(var x in g){var i=g[x];if(i.splice)for(var a=0,s=i.length;s>a;++a){var k=i[a];"string"==typeof k.regex&&(g[x][a].regex=new RegExp("^"+k.regex))}else"string"==typeof k.regex&&(g[x].regex=new RegExp("^"+i.regex))}e.defineMIME("text/x-livescript","livescript")}); -\ 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("livescript",function(){var a=function(a,b){var c=b.next||"start";if(c){b.next=b.next;var d=f[c];if(d.splice){for(var e=0;e|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+b+")?))\\s*$"),d="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",e={token:"string",regex:".+"},f={start:[{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)"+d},{token:"constant.language",regex:"(?:true|false|yes|no|on|off|null|void|undefined)"+d},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+d},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+d},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+d},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+d},{token:"identifier",regex:b+"\\s*:(?![:=])"},{token:"variable",regex:b},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:b,next:"start"},{token:"text",regex:"",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},e],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},e],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},e],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},e],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},e],words:[{token:"string",regex:".*?\\]>",next:"key"},e]};for(var g in f){var h=f[g];if(h.splice)for(var i=0,j=h.length;j>i;++i){var k=h[i];"string"==typeof k.regex&&(f[g][i].regex=new RegExp("^"+k.regex))}else"string"==typeof k.regex&&(f[g].regex=new RegExp("^"+h.regex))}a.defineMIME("text/x-livescript","livescript")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/lua/lua.min.js b/media/editors/codemirror/mode/lua/lua.min.js -index c5151cd..de751af 100644 ---- a/media/editors/codemirror/mode/lua/lua.min.js -+++ b/media/editors/codemirror/mode/lua/lua.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("lua",function(e,t){function n(e){return new RegExp("^(?:"+e.join("|")+")","i")}function a(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function r(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var n=e.next();return"-"==n&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=i(r(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==n||"'"==n?(t.cur=u(n))(e,t):"["==n&&/[\[=]/.test(e.peek())?(t.cur=i(r(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function i(e,t){return function(n,a){for(var r,i=null;null!=(r=n.next());)if(null==i)"]"==r&&(i=0);else if("="==r)++i;else{if("]"==r&&i==e){a.cur=o;break}i=null}return t}}function u(e){return function(t,n){for(var a,r=!1;null!=(a=t.next())&&(a!=e||r);)r=!r&&"\\"==a;return r||(n.cur=o),"string"}}var l=e.indentUnit,s=a(t.specials||[]),c=a(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),m=a(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),d=a(["function","if","repeat","do","\\(","{"]),g=a(["end","until","\\)","}"]),f=n(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),a=e.current();return"variable"==n&&(m.test(a)?n="keyword":c.test(a)?n="builtin":s.test(a)&&(n="variable-2")),"comment"!=n&&"string"!=n&&(d.test(a)?++t.indentDepth:g.test(a)&&--t.indentDepth),n},indent:function(e,t){var n=f.test(t);return e.basecol+l*(e.indentDepth-(n?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}); -\ 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("lua",function(a,b){function c(a){return new RegExp("^(?:"+a.join("|")+")","i")}function d(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function e(a){for(var b=0;a.eat("=");)++b;return a.eat("["),b}function f(a,b){var c=a.next();return"-"==c&&a.eat("-")?a.eat("[")&&a.eat("[")?(b.cur=g(e(a),"comment"))(a,b):(a.skipToEnd(),"comment"):'"'==c||"'"==c?(b.cur=h(c))(a,b):"["==c&&/[\[=]/.test(a.peek())?(b.cur=g(e(a),"string"))(a,b):/\d/.test(c)?(a.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(c)?(a.eatWhile(/[\w\\\-_.]/),"variable"):null}function g(a,b){return function(c,d){for(var e,g=null;null!=(e=c.next());)if(null==g)"]"==e&&(g=0);else if("="==e)++g;else{if("]"==e&&g==a){d.cur=f;break}g=null}return b}}function h(a){return function(b,c){for(var d,e=!1;null!=(d=b.next())&&(d!=a||e);)e=!e&&"\\"==d;return e||(c.cur=f),"string"}}var i=a.indentUnit,j=d(b.specials||[]),k=d(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),l=d(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),m=d(["function","if","repeat","do","\\(","{"]),n=d(["end","until","\\)","}"]),o=c(["end","until","\\)","}","else","elseif"]);return{startState:function(a){return{basecol:a||0,indentDepth:0,cur:f}},token:function(a,b){if(a.eatSpace())return null;var c=b.cur(a,b),d=a.current();return"variable"==c&&(l.test(d)?c="keyword":k.test(d)?c="builtin":j.test(d)&&(c="variable-2")),"comment"!=c&&"string"!=c&&(m.test(d)?++b.indentDepth:n.test(d)&&--b.indentDepth),c},indent:function(a,b){var c=o.test(b);return a.basecol+i*(a.indentDepth-(c?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),a.defineMIME("text/x-lua","lua")}); -\ 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 3c80311..bc5314f 100644 ---- a/media/editors/codemirror/mode/markdown/markdown.js -+++ b/media/editors/codemirror/mode/markdown/markdown.js -@@ -72,7 +72,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { - , ulRE = /^[*\-+]\s+/ - , olRE = /^[0-9]+\.\s+/ - , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE -- , atxHeaderRE = /^#+/ -+ , atxHeaderRE = /^#+ ?/ - , setextHeaderRE = /^(?:\={1,}|-{1,})$/ - , textRE = /^[^#!\[\]*_\\<>` "'(~]+/; - -@@ -116,18 +116,20 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { - - var sol = stream.sol(); - -- var prevLineIsList = (state.list !== false); -- if (state.list !== false && state.indentationDiff >= 0) { // Continued list -- if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block -- state.indentation -= state.indentationDiff; -+ var prevLineIsList = state.list !== false; -+ if (prevLineIsList) { -+ if (state.indentationDiff >= 0) { // Continued list -+ if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block -+ state.indentation -= state.indentationDiff; -+ } -+ state.list = null; -+ } else if (state.indentation > 0) { -+ state.list = null; -+ state.listDepth = Math.floor(state.indentation / 4); -+ } else { // No longer a list -+ state.list = false; -+ state.listDepth = 0; - } -- state.list = null; -- } else if (state.list !== false && state.indentation > 0) { -- state.list = null; -- state.listDepth = Math.floor(state.indentation / 4); -- } else if (state.list !== false) { // No longer a list -- state.list = false; -- state.listDepth = 0; - } - - var match = null; -@@ -138,7 +140,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { - } else if (stream.eatSpace()) { - return null; - } else if (match = stream.match(atxHeaderRE)) { -- state.header = match[0].length <= 6 ? match[0].length : 6; -+ state.header = Math.min(6, match[0].indexOf(" ") !== -1 ? match[0].length - 1 : match[0].length); - if (modeCfg.highlightFormatting) state.formatting = "header"; - state.f = state.inline; - return getType(state); -diff --git a/media/editors/codemirror/mode/markdown/markdown.min.js b/media/editors/codemirror/mode/markdown/markdown.min.js -index efd4af7..6e14ce0 100644 ---- a/media/editors/codemirror/mode/markdown/markdown.min.js -+++ b/media/editors/codemirror/mode/markdown/markdown.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("markdown",function(e,i){function n(i){if(t.findModeByName){var n=t.findModeByName(i);n&&(i=n.mime||n.mimes[0])}var r=t.getMode(e,i);return"null"==r.name?null:r}function r(t,e,i){return e.f=e.inline=i,i(t,e)}function a(t,e,i){return e.f=e.block=i,i(t,e)}function o(t){return t.linkTitle=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,L||t.f!=h||(t.f=m,t.block=l),t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.thisLineHasContent=!1,null}function l(t,e){var a=t.sol(),o=e.list!==!1;e.list!==!1&&e.indentationDiff>=0?(e.indentationDiff<4&&(e.indentation-=e.indentationDiff),e.list=null):e.list!==!1&&e.indentation>0?(e.list=null,e.listDepth=Math.floor(e.indentation/4)):e.list!==!1&&(e.list=!1,e.listDepth=0);var l=null;if(e.indentationDiff>=4)return e.indentation-=4,t.skipToEnd(),M;if(t.eatSpace())return null;if(l=t.match(P))return e.header=l[0].length<=6?l[0].length:6,i.highlightFormatting&&(e.formatting="header"),e.f=e.inline,f(e);if(e.prevLineHasContent&&(l=t.match(z)))return e.header="="==l[0].charAt(0)?1:2,i.highlightFormatting&&(e.formatting="header"),e.f=e.inline,f(e);if(t.eat(">"))return e.indentation++,e.quote=a?1:e.quote+1,i.highlightFormatting&&(e.formatting="quote"),t.eatSpace(),f(e);if("["===t.peek())return r(t,e,p);if(t.match(U,!0))return T;if((!e.prevLineHasContent||o)&&(t.match(R,!1)||t.match(A,!1))){var h=null;return t.match(R,!0)?h="ul":(t.match(A,!0),h="ol"),e.indentation+=4,e.list=!0,e.listDepth++,i.taskLists&&t.match(I,!1)&&(e.taskList=!0),e.f=e.inline,i.highlightFormatting&&(e.formatting=["list","list-"+h]),f(e)}return i.fencedCodeBlocks&&t.match(/^```[ \t]*([\w+#]*)/,!0)?(e.localMode=n(RegExp.$1),e.localMode&&(e.localState=e.localMode.startState()),e.f=e.block=g,i.highlightFormatting&&(e.formatting="code-block"),e.code=!0,f(e)):r(t,e,e.inline)}function h(t,e){var i=F.token(t,e.htmlState);return(L&&null===e.htmlState.tagStart&&!e.htmlState.context||e.md_inside&&t.current().indexOf(">")>-1)&&(e.f=m,e.block=l,e.htmlState=null),i}function g(t,e){return t.sol()&&t.match("```",!1)?(e.localMode=e.localState=null,e.f=e.block=s,null):e.localMode?e.localMode.token(t,e.localState):(t.skipToEnd(),M)}function s(t,e){t.match("```"),e.block=l,e.f=m,i.highlightFormatting&&(e.formatting="code-block"),e.code=!0;var n=f(e);return e.code=!1,n}function f(t){var e=[];if(t.formatting){e.push(y),"string"==typeof t.formatting&&(t.formatting=[t.formatting]);for(var n=0;n=t.quote?y+"-"+t.formatting[n]+"-"+t.quote:"error")}if(t.taskOpen)return e.push("meta"),e.length?e.join(" "):null;if(t.taskClosed)return e.push("property"),e.length?e.join(" "):null;if(t.linkHref)return e.push(O),e.length?e.join(" "):null;if(t.strong&&e.push(E),t.em&&e.push(j),t.strikethrough&&e.push(W),t.linkText&&e.push(N),t.code&&e.push(M),t.header&&(e.push(q),e.push(q+"-"+t.header)),t.quote&&(e.push(w),e.push(!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=t.quote?w+"-"+t.quote:w+"-"+i.maxBlockquoteDepth)),t.list!==!1){var r=(t.listDepth-1)%3;e.push(r?1===r?D:H:C)}return t.trailingSpaceNewLine?e.push("trailing-space-new-line"):t.trailingSpace&&e.push("trailing-space-"+(t.trailingSpace%2?"a":"b")),e.length?e.join(" "):null}function u(t,e){return t.match(G,!0)?f(e):void 0}function m(e,n){var r=n.text(e,n);if("undefined"!=typeof r)return r;if(n.list)return n.list=null,f(n);if(n.taskList){var o="x"!==e.match(I,!0)[1];return o?n.taskOpen=!0:n.taskClosed=!0,i.highlightFormatting&&(n.formatting="task"),n.taskList=!1,f(n)}if(n.taskOpen=!1,n.taskClosed=!1,n.header&&e.match(/^#+$/,!0))return i.highlightFormatting&&(n.formatting="header"),f(n);var l=e.sol(),g=e.next();if("\\"===g&&(e.next(),i.highlightFormatting)){var s=f(n);return s?s+" formatting-escape":"formatting-escape"}if(n.linkTitle){n.linkTitle=!1;var u=g;"("===g&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var m="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(e.match(new RegExp(m),!0))return O}if("`"===g){var k=n.formatting;i.highlightFormatting&&(n.formatting="code");var p=f(n),v=e.pos;e.eatWhile("`");var x=1+e.pos-v;return n.code?x===b?(n.code=!1,p):(n.formatting=k,f(n)):(b=x,n.code=!0,f(n))}if(n.code)return f(n);if("!"===g&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return e.match(/\[[^\]]*\]/),n.inline=n.f=d,B;if("["===g&&e.match(/.*\](\(.*\)| ?\[.*\])/,!1))return n.linkText=!0,i.highlightFormatting&&(n.formatting="link"),f(n);if("]"===g&&n.linkText&&e.match(/\(.*\)| ?\[.*\]/,!1)){i.highlightFormatting&&(n.formatting="link");var s=f(n);return n.linkText=!1,n.inline=n.f=d,s}if("<"===g&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=c,i.highlightFormatting&&(n.formatting="link");var s=f(n);return s?s+=" ":s="",s+_}if("<"===g&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=c,i.highlightFormatting&&(n.formatting="link");var s=f(n);return s?s+=" ":s="",s+$}if("<"===g&&e.match(/^\w/,!1)){if(-1!=e.string.indexOf(">")){var S=e.string.substring(1,e.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(S)&&(n.md_inside=!0)}return e.backUp(1),n.htmlState=t.startState(F),a(e,n,h)}if("<"===g&&e.match(/^\/\w*?>/))return n.md_inside=!1,"tag";var L=!1;if(!i.underscoresBreakWords&&"_"===g&&"_"!==e.peek()&&e.match(/(\w)/,!1)){var q=e.pos-2;if(q>=0){var M=e.string.charAt(q);"_"!==M&&M.match(/(\w)/,!1)&&(L=!0)}}if("*"===g||"_"===g&&!L)if(l&&" "===e.peek());else{if(n.strong===g&&e.eat(g)){i.highlightFormatting&&(n.formatting="strong");var p=f(n);return n.strong=!1,p}if(!n.strong&&e.eat(g))return n.strong=g,i.highlightFormatting&&(n.formatting="strong"),f(n);if(n.em===g){i.highlightFormatting&&(n.formatting="em");var p=f(n);return n.em=!1,p}if(!n.em)return n.em=g,i.highlightFormatting&&(n.formatting="em"),f(n)}else if(" "===g&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return f(n);e.backUp(1)}if(i.strikethrough)if("~"===g&&e.eatWhile(g)){if(n.strikethrough){i.highlightFormatting&&(n.formatting="strikethrough");var p=f(n);return n.strikethrough=!1,p}if(e.match(/^[^\s]/,!1))return n.strikethrough=!0,i.highlightFormatting&&(n.formatting="strikethrough"),f(n)}else if(" "===g&&e.match(/^~~/,!0)){if(" "===e.peek())return f(n);e.backUp(2)}return" "===g&&(e.match(/ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),f(n)}function c(t,e){var n=t.next();if(">"===n){e.f=e.inline=m,i.highlightFormatting&&(e.formatting="link");var r=f(e);return r?r+=" ":r="",r+_}return t.match(/^[^>]+/,!0),_}function d(t,e){if(t.eatSpace())return null;var n=t.next();return"("===n||"["===n?(e.f=e.inline=k("("===n?")":"]"),i.highlightFormatting&&(e.formatting="link-string"),e.linkHref=!0,f(e)):"error"}function k(t){return function(e,n){var r=e.next();if(r===t){n.f=n.inline=m,i.highlightFormatting&&(n.formatting="link-string");var a=f(n);return n.linkHref=!1,a}return e.match(S(t),!0)&&e.backUp(1),n.linkHref=!0,f(n)}}function p(t,e){return t.match(/^[^\]]*\]:/,!1)?(e.f=v,t.next(),i.highlightFormatting&&(e.formatting="link"),e.linkText=!0,f(e)):r(t,e,m)}function v(t,e){if(t.match(/^\]:/,!0)){e.f=e.inline=x,i.highlightFormatting&&(e.formatting="link");var n=f(e);return e.linkText=!1,n}return t.match(/^[^\]]+/,!0),N}function x(t,e){return t.eatSpace()?null:(t.match(/^[^\s]+/,!0),void 0===t.peek()?e.linkTitle=!0:t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),e.f=e.inline=m,O)}function S(t){return J[t]||(t=(t+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),J[t]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+t+")")),J[t]}var L=t.modes.hasOwnProperty("xml"),F=t.getMode(e,L?{name:"xml",htmlMode:!0}:"text/plain");void 0===i.highlightFormatting&&(i.highlightFormatting=!1),void 0===i.maxBlockquoteDepth&&(i.maxBlockquoteDepth=0),void 0===i.underscoresBreakWords&&(i.underscoresBreakWords=!0),void 0===i.fencedCodeBlocks&&(i.fencedCodeBlocks=!1),void 0===i.taskLists&&(i.taskLists=!1),void 0===i.strikethrough&&(i.strikethrough=!1);var b=0,q="header",M="comment",w="quote",C="variable-2",D="variable-3",H="keyword",T="hr",B="tag",y="formatting",_="link",$="link",N="link",O="string",j="em",E="strong",W="strikethrough",U=/^([*\-=_])(?:\s*\1){2,}\s*$/,R=/^[*\-+]\s+/,A=/^[0-9]+\.\s+/,I=/^\[(x| )\](?=\s)/,P=/^#+/,z=/^(?:\={1,}|-{1,})$/,G=/^[^#!\[\]*_\\<>` "'(~]+/,J=[],K={startState:function(){return{f:l,prevLineHasContent:!1,thisLineHasContent:!1,block:l,htmlState:null,indentation:0,inline:m,text:u,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(e){return{f:e.f,prevLineHasContent:e.prevLineHasContent,thisLineHasContent:e.thisLineHasContent,block:e.block,htmlState:e.htmlState&&t.copyState(F,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkTitle:e.linkTitle,em:e.em,strong:e.strong,strikethrough:e.strikethrough,header:e.header,taskList:e.taskList,list:e.list,listDepth:e.listDepth,quote:e.quote,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside}},token:function(t,e){if(e.formatting=!1,t.sol()){var i=!!e.header;if(e.header=0,t.match(/^\s*$/,!0)||i)return e.prevLineHasContent=!1,o(e),i?this.token(t,e):null;e.prevLineHasContent=e.thisLineHasContent,e.thisLineHasContent=!0,e.taskList=!1,e.code=!1,e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.f=e.block;var n=t.match(/^\s*/,!0)[0].replace(/\t/g," ").length,r=4*Math.floor((n-e.indentation)/4);r>4&&(r=4);var a=e.indentation+r;if(e.indentationDiff=a-e.indentation,e.indentation=a,n>0)return null}return e.f(t,e)},innerMode:function(t){return t.block==h?{state:t.htmlState,mode:F}:t.localState?{state:t.localState,mode:t.localMode}:{state:t,mode:K}},blankLine:o,getType:f,fold:"markdown"};return K},"xml"),t.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.linkTitle=!1,a.em=!1,a.strong=!1,a.strikethrough=!1,a.quote=0,v||a.f!=i||(a.f=n,a.block=h),a.trailingSpace=0,a.trailingSpaceNewLine=!1,a.thisLineHasContent=!1,null}function h(a,b){var f=a.sol(),g=b.list!==!1;g&&(b.indentationDiff>=0?(b.indentationDiff<4&&(b.indentation-=b.indentationDiff),b.list=null):b.indentation>0?(b.list=null,b.listDepth=Math.floor(b.indentation/4)):(b.list=!1,b.listDepth=0));var h=null;if(b.indentationDiff>=4)return b.indentation-=4,a.skipToEnd(),z;if(a.eatSpace())return null;if(h=a.match(S))return b.header=Math.min(6,-1!==h[0].indexOf(" ")?h[0].length-1:h[0].length),c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,l(b);if(b.prevLineHasContent&&(h=a.match(T)))return b.header="="==h[0].charAt(0)?1:2,c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,l(b);if(a.eat(">"))return b.indentation++,b.quote=f?1:b.quote+1,c.highlightFormatting&&(b.formatting="quote"),a.eatSpace(),l(b);if("["===a.peek())return e(a,b,r);if(a.match(O,!0))return E;if((!b.prevLineHasContent||g)&&(a.match(P,!1)||a.match(Q,!1))){var i=null;return a.match(P,!0)?i="ul":(a.match(Q,!0),i="ol"),b.indentation+=4,b.list=!0,b.listDepth++,c.taskLists&&a.match(R,!1)&&(b.taskList=!0),b.f=b.inline,c.highlightFormatting&&(b.formatting=["list","list-"+i]),l(b)}return c.fencedCodeBlocks&&a.match(/^```[ \t]*([\w+#]*)/,!0)?(b.localMode=d(RegExp.$1),b.localMode&&(b.localState=b.localMode.startState()),b.f=b.block=j,c.highlightFormatting&&(b.formatting="code-block"),b.code=!0,l(b)):e(a,b,b.inline)}function i(a,b){var c=w.token(a,b.htmlState);return(v&&null===b.htmlState.tagStart&&!b.htmlState.context||b.md_inside&&a.current().indexOf(">")>-1)&&(b.f=n,b.block=h,b.htmlState=null),c}function j(a,b){return a.sol()&&a.match("```",!1)?(b.localMode=b.localState=null,b.f=b.block=k,null):b.localMode?b.localMode.token(a,b.localState):(a.skipToEnd(),z)}function k(a,b){a.match("```"),b.block=h,b.f=n,c.highlightFormatting&&(b.formatting="code-block"),b.code=!0;var d=l(b);return b.code=!1,d}function l(a){var b=[];if(a.formatting){b.push(G),"string"==typeof a.formatting&&(a.formatting=[a.formatting]);for(var d=0;d=a.quote?b.push(G+"-"+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)return b.push(K),b.length?b.join(" "):null;if(a.strong&&b.push(M),a.em&&b.push(L),a.strikethrough&&b.push(N),a.linkText&&b.push(J),a.code&&b.push(z),a.header&&(b.push(y),b.push(y+"-"+a.header)),a.quote&&(b.push(A),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=a.quote?b.push(A+"-"+a.quote):b.push(A+"-"+c.maxBlockquoteDepth)),a.list!==!1){var e=(a.listDepth-1)%3;e?1===e?b.push(C):b.push(D):b.push(B)}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){return a.match(U,!0)?l(b):void 0}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="x"!==b.match(R,!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.sol(),j=b.next();if("\\"===j&&(b.next(),c.highlightFormatting)){var k=l(d);return k?k+" formatting-escape":"formatting-escape"}if(d.linkTitle){d.linkTitle=!1;var m=j;"("===j&&(m=")"),m=(m+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var n="^\\s*(?:[^"+m+"\\\\]+|\\\\\\\\|\\\\.)"+m;if(b.match(new RegExp(n),!0))return K}if("`"===j){var q=d.formatting;c.highlightFormatting&&(d.formatting="code");var r=l(d),s=b.pos;b.eatWhile("`");var t=1+b.pos-s;return d.code?t===x?(d.code=!1,r):(d.formatting=q,l(d)):(x=t,d.code=!0,l(d))}if(d.code)return l(d);if("!"===j&&b.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.match(/\[[^\]]*\]/),d.inline=d.f=p,F;if("["===j&&b.match(/.*\](\(.*\)| ?\[.*\])/,!1))return d.linkText=!0,c.highlightFormatting&&(d.formatting="link"),l(d);if("]"===j&&d.linkText&&b.match(/\(.*\)| ?\[.*\]/,!1)){c.highlightFormatting&&(d.formatting="link");var k=l(d);return d.linkText=!1,d.inline=d.f=p,k}if("<"===j&&b.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link");var k=l(d);return k?k+=" ":k="",k+H}if("<"===j&&b.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link");var k=l(d);return k?k+=" ":k="",k+I}if("<"===j&&b.match(/^\w/,!1)){if(-1!=b.string.indexOf(">")){var u=b.string.substring(1,b.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(u)&&(d.md_inside=!0)}return b.backUp(1),d.htmlState=a.startState(w),f(b,d,i)}if("<"===j&&b.match(/^\/\w*?>/))return d.md_inside=!1,"tag";var v=!1;if(!c.underscoresBreakWords&&"_"===j&&"_"!==b.peek()&&b.match(/(\w)/,!1)){var y=b.pos-2;if(y>=0){var z=b.string.charAt(y);"_"!==z&&z.match(/(\w)/,!1)&&(v=!0)}}if("*"===j||"_"===j&&!v)if(h&&" "===b.peek());else{if(d.strong===j&&b.eat(j)){c.highlightFormatting&&(d.formatting="strong");var r=l(d);return d.strong=!1,r}if(!d.strong&&b.eat(j))return d.strong=j,c.highlightFormatting&&(d.formatting="strong"),l(d);if(d.em===j){c.highlightFormatting&&(d.formatting="em");var r=l(d);return d.em=!1,r}if(!d.em)return d.em=j,c.highlightFormatting&&(d.formatting="em"),l(d)}else if(" "===j&&(b.eat("*")||b.eat("_"))){if(" "===b.peek())return l(d);b.backUp(1)}if(c.strikethrough)if("~"===j&&b.eatWhile(j)){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(" "===j&&b.match(/^~~/,!0)){if(" "===b.peek())return l(d);b.backUp(2)}return" "===j&&(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+H}return a.match(/^[^>]+/,!0),H}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(u(a),!0)&&b.backUp(1),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),J}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,K)}function u(a){return V[a]||(a=(a+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),V[a]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+a+")")),V[a]}var v=a.modes.hasOwnProperty("xml"),w=a.getMode(b,v?{name:"xml",htmlMode:!0}:"text/plain");void 0===c.highlightFormatting&&(c.highlightFormatting=!1),void 0===c.maxBlockquoteDepth&&(c.maxBlockquoteDepth=0),void 0===c.underscoresBreakWords&&(c.underscoresBreakWords=!0),void 0===c.fencedCodeBlocks&&(c.fencedCodeBlocks=!1),void 0===c.taskLists&&(c.taskLists=!1),void 0===c.strikethrough&&(c.strikethrough=!1);var x=0,y="header",z="comment",A="quote",B="variable-2",C="variable-3",D="keyword",E="hr",F="tag",G="formatting",H="link",I="link",J="link",K="string",L="em",M="strong",N="strikethrough",O=/^([*\-=_])(?:\s*\1){2,}\s*$/,P=/^[*\-+]\s+/,Q=/^[0-9]+\.\s+/,R=/^\[(x| )\](?=\s)/,S=/^#+ ?/,T=/^(?:\={1,}|-{1,})$/,U=/^[^#!\[\]*_\\<>` "'(~]+/,V=[],W={startState:function(){return{f:h,prevLineHasContent:!1,thisLineHasContent:!1,block:h,htmlState:null,indentation:0,inline:n,text:m,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(b){return{f:b.f,prevLineHasContent:b.prevLineHasContent,thisLineHasContent:b.thisLineHasContent,block:b.block,htmlState:b.htmlState&&a.copyState(w,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,linkTitle:b.linkTitle,em:b.em,strong:b.strong,strikethrough:b.strikethrough,header:b.header,taskList:b.taskList,list:b.list,listDepth:b.listDepth,quote:b.quote,trailingSpace:b.trailingSpace,trailingSpaceNewLine:b.trailingSpaceNewLine,md_inside:b.md_inside}},token:function(a,b){if(b.formatting=!1,a.sol()){var c=!!b.header;if(b.header=0,a.match(/^\s*$/,!0)||c)return b.prevLineHasContent=!1,g(b),c?this.token(a,b):null;b.prevLineHasContent=b.thisLineHasContent,b.thisLineHasContent=!0,b.taskList=!1,b.code=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,b.f=b.block;var d=a.match(/^\s*/,!0)[0].replace(/\t/g," ").length,e=4*Math.floor((d-b.indentation)/4);e>4&&(e=4);var f=b.indentation+e;if(b.indentationDiff=f-b.indentation,b.indentation=f,d>0)return null}return b.f(a,b)},innerMode:function(a){return a.block==i?{state:a.htmlState,mode:w}:a.localState?{state:a.localState,mode:a.localMode}:{state:a,mode:W}},blankLine:g,getType:l,fold:"markdown"};return W},"xml"),a.defineMIME("text/x-markdown","markdown")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/markdown/test.js b/media/editors/codemirror/mode/markdown/test.js -deleted file mode 100644 -index 96ca1ae..0000000 ---- a/media/editors/codemirror/mode/markdown/test.js -+++ /dev/null -@@ -1,754 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({tabSize: 4}, "markdown"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true}); -- function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } -- -- FT("formatting_emAsterisk", -- "[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]"); -- -- FT("formatting_emUnderscore", -- "[em&formatting&formatting-em _][em foo][em&formatting&formatting-em _]"); -- -- FT("formatting_strongAsterisk", -- "[strong&formatting&formatting-strong **][strong foo][strong&formatting&formatting-strong **]"); -- -- FT("formatting_strongUnderscore", -- "[strong&formatting&formatting-strong __][strong foo][strong&formatting&formatting-strong __]"); -- -- FT("formatting_codeBackticks", -- "[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"); -- -- FT("formatting_doubleBackticks", -- "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"); -- -- FT("formatting_atxHeader", -- "[header&header-1&formatting&formatting-header&formatting-header-1 #][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]"); -- -- FT("formatting_setextHeader", -- "foo", -- "[header&header-1&formatting&formatting-header&formatting-header-1 =]"); -- -- FT("formatting_blockquote", -- "[quote"e-1&formatting&formatting-quote&formatting-quote-1 > ][quote"e-1 foo]"); -- -- FT("formatting_list", -- "[variable-2&formatting&formatting-list&formatting-list-ul - ][variable-2 foo]"); -- FT("formatting_list", -- "[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]"); -- -- FT("formatting_link", -- "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]"); -- -- FT("formatting_linkReference", -- "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]", -- "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]"); -- -- FT("formatting_linkWeb", -- "[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]"); -- -- FT("formatting_linkEmail", -- "[link&formatting&formatting-link <][link user@example.com][link&formatting&formatting-link >]"); -- -- FT("formatting_escape", -- "[formatting-escape \\*]"); -- -- MT("plainText", -- "foo"); -- -- // Don't style single trailing space -- MT("trailingSpace1", -- "foo "); -- -- // Two or more trailing spaces should be styled with line break character -- MT("trailingSpace2", -- "foo[trailing-space-a ][trailing-space-new-line ]"); -- -- MT("trailingSpace3", -- "foo[trailing-space-a ][trailing-space-b ][trailing-space-new-line ]"); -- -- MT("trailingSpace4", -- "foo[trailing-space-a ][trailing-space-b ][trailing-space-a ][trailing-space-new-line ]"); -- -- // Code blocks using 4 spaces (regardless of CodeMirror.tabSize value) -- MT("codeBlocksUsing4Spaces", -- " [comment foo]"); -- -- // Code blocks using 4 spaces with internal indentation -- MT("codeBlocksUsing4SpacesIndentation", -- " [comment bar]", -- " [comment hello]", -- " [comment world]", -- " [comment foo]", -- "bar"); -- -- // Code blocks using 4 spaces with internal indentation -- MT("codeBlocksUsing4SpacesIndentation", -- " foo", -- " [comment bar]", -- " [comment hello]", -- " [comment world]"); -- -- // Code blocks should end even after extra indented lines -- MT("codeBlocksWithTrailingIndentedLine", -- " [comment foo]", -- " [comment bar]", -- " [comment baz]", -- " ", -- "hello"); -- -- // Code blocks using 1 tab (regardless of CodeMirror.indentWithTabs value) -- MT("codeBlocksUsing1Tab", -- "\t[comment foo]"); -- -- // Inline code using backticks -- MT("inlineCodeUsingBackticks", -- "foo [comment `bar`]"); -- -- // Block code using single backtick (shouldn't work) -- MT("blockCodeSingleBacktick", -- "[comment `]", -- "foo", -- "[comment `]"); -- -- // Unclosed backticks -- // Instead of simply marking as CODE, it would be nice to have an -- // incomplete flag for CODE, that is styled slightly different. -- MT("unclosedBackticks", -- "foo [comment `bar]"); -- -- // Per documentation: "To include a literal backtick character within a -- // code span, you can use multiple backticks as the opening and closing -- // delimiters" -- MT("doubleBackticks", -- "[comment ``foo ` bar``]"); -- -- // Tests based on Dingus -- // http://daringfireball.net/projects/markdown/dingus -- // -- // Multiple backticks within an inline code block -- MT("consecutiveBackticks", -- "[comment `foo```bar`]"); -- -- // Multiple backticks within an inline code block with a second code block -- MT("consecutiveBackticks", -- "[comment `foo```bar`] hello [comment `world`]"); -- -- // Unclosed with several different groups of backticks -- MT("unclosedBackticks", -- "[comment ``foo ``` bar` hello]"); -- -- // Closed with several different groups of backticks -- MT("closedBackticks", -- "[comment ``foo ``` bar` hello``] world"); -- -- // atx headers -- // http://daringfireball.net/projects/markdown/syntax#header -- -- MT("atxH1", -- "[header&header-1 # foo]"); -- -- MT("atxH2", -- "[header&header-2 ## foo]"); -- -- MT("atxH3", -- "[header&header-3 ### foo]"); -- -- MT("atxH4", -- "[header&header-4 #### foo]"); -- -- MT("atxH5", -- "[header&header-5 ##### foo]"); -- -- MT("atxH6", -- "[header&header-6 ###### foo]"); -- -- // H6 - 7x '#' should still be H6, per Dingus -- // http://daringfireball.net/projects/markdown/dingus -- MT("atxH6NotH7", -- "[header&header-6 ####### foo]"); -- -- // Inline styles should be parsed inside headers -- MT("atxH1inline", -- "[header&header-1 # foo ][header&header-1&em *bar*]"); -- -- // Setext headers - H1, H2 -- // Per documentation, "Any number of underlining =’s or -’s will work." -- // http://daringfireball.net/projects/markdown/syntax#header -- // Ideally, the text would be marked as `header` as well, but this is -- // not really feasible at the moment. So, instead, we're testing against -- // what works today, to avoid any regressions. -- // -- // Check if single underlining = works -- MT("setextH1", -- "foo", -- "[header&header-1 =]"); -- -- // Check if 3+ ='s work -- MT("setextH1", -- "foo", -- "[header&header-1 ===]"); -- -- // Check if single underlining - works -- MT("setextH2", -- "foo", -- "[header&header-2 -]"); -- -- // Check if 3+ -'s work -- MT("setextH2", -- "foo", -- "[header&header-2 ---]"); -- -- // Single-line blockquote with trailing space -- MT("blockquoteSpace", -- "[quote"e-1 > foo]"); -- -- // Single-line blockquote -- MT("blockquoteNoSpace", -- "[quote"e-1 >foo]"); -- -- // No blank line before blockquote -- MT("blockquoteNoBlankLine", -- "foo", -- "[quote"e-1 > bar]"); -- -- // Nested blockquote -- MT("blockquoteSpace", -- "[quote"e-1 > foo]", -- "[quote"e-1 >][quote"e-2 > foo]", -- "[quote"e-1 >][quote"e-2 >][quote"e-3 > foo]"); -- -- // Single-line blockquote followed by normal paragraph -- MT("blockquoteThenParagraph", -- "[quote"e-1 >foo]", -- "", -- "bar"); -- -- // Multi-line blockquote (lazy mode) -- MT("multiBlockquoteLazy", -- "[quote"e-1 >foo]", -- "[quote"e-1 bar]"); -- -- // Multi-line blockquote followed by normal paragraph (lazy mode) -- MT("multiBlockquoteLazyThenParagraph", -- "[quote"e-1 >foo]", -- "[quote"e-1 bar]", -- "", -- "hello"); -- -- // Multi-line blockquote (non-lazy mode) -- MT("multiBlockquote", -- "[quote"e-1 >foo]", -- "[quote"e-1 >bar]"); -- -- // Multi-line blockquote followed by normal paragraph (non-lazy mode) -- MT("multiBlockquoteThenParagraph", -- "[quote"e-1 >foo]", -- "[quote"e-1 >bar]", -- "", -- "hello"); -- -- // Check list types -- -- MT("listAsterisk", -- "foo", -- "bar", -- "", -- "[variable-2 * foo]", -- "[variable-2 * bar]"); -- -- MT("listPlus", -- "foo", -- "bar", -- "", -- "[variable-2 + foo]", -- "[variable-2 + bar]"); -- -- MT("listDash", -- "foo", -- "bar", -- "", -- "[variable-2 - foo]", -- "[variable-2 - bar]"); -- -- MT("listNumber", -- "foo", -- "bar", -- "", -- "[variable-2 1. foo]", -- "[variable-2 2. bar]"); -- -- // Lists require a preceding blank line (per Dingus) -- MT("listBogus", -- "foo", -- "1. bar", -- "2. hello"); -- -- // List after header -- MT("listAfterHeader", -- "[header&header-1 # foo]", -- "[variable-2 - bar]"); -- -- // Formatting in lists (*) -- MT("listAsteriskFormatting", -- "[variable-2 * ][variable-2&em *foo*][variable-2 bar]", -- "[variable-2 * ][variable-2&strong **foo**][variable-2 bar]", -- "[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", -- "[variable-2 * ][variable-2&comment `foo`][variable-2 bar]"); -- -- // Formatting in lists (+) -- MT("listPlusFormatting", -- "[variable-2 + ][variable-2&em *foo*][variable-2 bar]", -- "[variable-2 + ][variable-2&strong **foo**][variable-2 bar]", -- "[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", -- "[variable-2 + ][variable-2&comment `foo`][variable-2 bar]"); -- -- // Formatting in lists (-) -- MT("listDashFormatting", -- "[variable-2 - ][variable-2&em *foo*][variable-2 bar]", -- "[variable-2 - ][variable-2&strong **foo**][variable-2 bar]", -- "[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", -- "[variable-2 - ][variable-2&comment `foo`][variable-2 bar]"); -- -- // Formatting in lists (1.) -- MT("listNumberFormatting", -- "[variable-2 1. ][variable-2&em *foo*][variable-2 bar]", -- "[variable-2 2. ][variable-2&strong **foo**][variable-2 bar]", -- "[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]", -- "[variable-2 4. ][variable-2&comment `foo`][variable-2 bar]"); -- -- // Paragraph lists -- MT("listParagraph", -- "[variable-2 * foo]", -- "", -- "[variable-2 * bar]"); -- -- // Multi-paragraph lists -- // -- // 4 spaces -- MT("listMultiParagraph", -- "[variable-2 * foo]", -- "", -- "[variable-2 * bar]", -- "", -- " [variable-2 hello]"); -- -- // 4 spaces, extra blank lines (should still be list, per Dingus) -- MT("listMultiParagraphExtra", -- "[variable-2 * foo]", -- "", -- "[variable-2 * bar]", -- "", -- "", -- " [variable-2 hello]"); -- -- // 4 spaces, plus 1 space (should still be list, per Dingus) -- MT("listMultiParagraphExtraSpace", -- "[variable-2 * foo]", -- "", -- "[variable-2 * bar]", -- "", -- " [variable-2 hello]", -- "", -- " [variable-2 world]"); -- -- // 1 tab -- MT("listTab", -- "[variable-2 * foo]", -- "", -- "[variable-2 * bar]", -- "", -- "\t[variable-2 hello]"); -- -- // No indent -- MT("listNoIndent", -- "[variable-2 * foo]", -- "", -- "[variable-2 * bar]", -- "", -- "hello"); -- -- // Blockquote -- MT("blockquote", -- "[variable-2 * foo]", -- "", -- "[variable-2 * bar]", -- "", -- " [variable-2"e"e-1 > hello]"); -- -- // Code block -- MT("blockquoteCode", -- "[variable-2 * foo]", -- "", -- "[variable-2 * bar]", -- "", -- " [comment > hello]", -- "", -- " [variable-2 world]"); -- -- // Code block followed by text -- MT("blockquoteCodeText", -- "[variable-2 * foo]", -- "", -- " [variable-2 bar]", -- "", -- " [comment hello]", -- "", -- " [variable-2 world]"); -- -- // Nested list -- -- MT("listAsteriskNested", -- "[variable-2 * foo]", -- "", -- " [variable-3 * bar]"); -- -- MT("listPlusNested", -- "[variable-2 + foo]", -- "", -- " [variable-3 + bar]"); -- -- MT("listDashNested", -- "[variable-2 - foo]", -- "", -- " [variable-3 - bar]"); -- -- MT("listNumberNested", -- "[variable-2 1. foo]", -- "", -- " [variable-3 2. bar]"); -- -- MT("listMixed", -- "[variable-2 * foo]", -- "", -- " [variable-3 + bar]", -- "", -- " [keyword - hello]", -- "", -- " [variable-2 1. world]"); -- -- MT("listBlockquote", -- "[variable-2 * foo]", -- "", -- " [variable-3 + bar]", -- "", -- " [quote"e-1&variable-3 > hello]"); -- -- MT("listCode", -- "[variable-2 * foo]", -- "", -- " [variable-3 + bar]", -- "", -- " [comment hello]"); -- -- // Code with internal indentation -- MT("listCodeIndentation", -- "[variable-2 * foo]", -- "", -- " [comment bar]", -- " [comment hello]", -- " [comment world]", -- " [comment foo]", -- " [variable-2 bar]"); -- -- // List nesting edge cases -- MT("listNested", -- "[variable-2 * foo]", -- "", -- " [variable-3 * bar]", -- "", -- " [variable-2 hello]" -- ); -- MT("listNested", -- "[variable-2 * foo]", -- "", -- " [variable-3 * bar]", -- "", -- " [variable-3 * foo]" -- ); -- -- // Code followed by text -- MT("listCodeText", -- "[variable-2 * foo]", -- "", -- " [comment bar]", -- "", -- "hello"); -- -- // Following tests directly from official Markdown documentation -- // http://daringfireball.net/projects/markdown/syntax#hr -- -- MT("hrSpace", -- "[hr * * *]"); -- -- MT("hr", -- "[hr ***]"); -- -- MT("hrLong", -- "[hr *****]"); -- -- MT("hrSpaceDash", -- "[hr - - -]"); -- -- MT("hrDashLong", -- "[hr ---------------------------------------]"); -- -- // Inline link with title -- MT("linkTitle", -- "[link [[foo]]][string (http://example.com/ \"bar\")] hello"); -- -- // Inline link without title -- MT("linkNoTitle", -- "[link [[foo]]][string (http://example.com/)] bar"); -- -- // Inline link with image -- MT("linkImage", -- "[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar"); -- -- // Inline link with Em -- MT("linkEm", -- "[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar"); -- -- // Inline link with Strong -- MT("linkStrong", -- "[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar"); -- -- // Inline link with EmStrong -- MT("linkEmStrong", -- "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar"); -- -- // Image with title -- MT("imageTitle", -- "[tag ![[foo]]][string (http://example.com/ \"bar\")] hello"); -- -- // Image without title -- MT("imageNoTitle", -- "[tag ![[foo]]][string (http://example.com/)] bar"); -- -- // Image with asterisks -- MT("imageAsterisks", -- "[tag ![[*foo*]]][string (http://example.com/)] bar"); -- -- // Not a link. Should be normal text due to square brackets being used -- // regularly in text, especially in quoted material, and no space is allowed -- // between square brackets and parentheses (per Dingus). -- MT("notALink", -- "[[foo]] (bar)"); -- -- // Reference-style links -- MT("linkReference", -- "[link [[foo]]][string [[bar]]] hello"); -- -- // Reference-style links with Em -- MT("linkReferenceEm", -- "[link [[][link&em *foo*][link ]]][string [[bar]]] hello"); -- -- // Reference-style links with Strong -- MT("linkReferenceStrong", -- "[link [[][link&strong **foo**][link ]]][string [[bar]]] hello"); -- -- // Reference-style links with EmStrong -- MT("linkReferenceEmStrong", -- "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello"); -- -- // Reference-style links with optional space separator (per docuentation) -- // "You can optionally use a space to separate the sets of brackets" -- MT("linkReferenceSpace", -- "[link [[foo]]] [string [[bar]]] hello"); -- -- // Should only allow a single space ("...use *a* space...") -- MT("linkReferenceDoubleSpace", -- "[[foo]] [[bar]] hello"); -- -- // Reference-style links with implicit link name -- MT("linkImplicit", -- "[link [[foo]]][string [[]]] hello"); -- -- // @todo It would be nice if, at some point, the document was actually -- // checked to see if the referenced link exists -- -- // Link label, for reference-style links (taken from documentation) -- -- MT("labelNoTitle", -- "[link [[foo]]:] [string http://example.com/]"); -- -- MT("labelIndented", -- " [link [[foo]]:] [string http://example.com/]"); -- -- MT("labelSpaceTitle", -- "[link [[foo bar]]:] [string http://example.com/ \"hello\"]"); -- -- MT("labelDoubleTitle", -- "[link [[foo bar]]:] [string http://example.com/ \"hello\"] \"world\""); -- -- MT("labelTitleDoubleQuotes", -- "[link [[foo]]:] [string http://example.com/ \"bar\"]"); -- -- MT("labelTitleSingleQuotes", -- "[link [[foo]]:] [string http://example.com/ 'bar']"); -- -- MT("labelTitleParenthese", -- "[link [[foo]]:] [string http://example.com/ (bar)]"); -- -- MT("labelTitleInvalid", -- "[link [[foo]]:] [string http://example.com/] bar"); -- -- MT("labelLinkAngleBrackets", -- "[link [[foo]]:] [string \"bar\"]"); -- -- MT("labelTitleNextDoubleQuotes", -- "[link [[foo]]:] [string http://example.com/]", -- "[string \"bar\"] hello"); -- -- MT("labelTitleNextSingleQuotes", -- "[link [[foo]]:] [string http://example.com/]", -- "[string 'bar'] hello"); -- -- MT("labelTitleNextParenthese", -- "[link [[foo]]:] [string http://example.com/]", -- "[string (bar)] hello"); -- -- MT("labelTitleNextMixed", -- "[link [[foo]]:] [string http://example.com/]", -- "(bar\" hello"); -- -- MT("linkWeb", -- "[link ] foo"); -- -- MT("linkWebDouble", -- "[link ] foo [link ]"); -- -- MT("linkEmail", -- "[link ] foo"); -- -- MT("linkEmailDouble", -- "[link ] foo [link ]"); -- -- MT("emAsterisk", -- "[em *foo*] bar"); -- -- MT("emUnderscore", -- "[em _foo_] bar"); -- -- MT("emInWordAsterisk", -- "foo[em *bar*]hello"); -- -- MT("emInWordUnderscore", -- "foo[em _bar_]hello"); -- -- // Per documentation: "...surround an * or _ with spaces, it’ll be -- // treated as a literal asterisk or underscore." -- -- MT("emEscapedBySpaceIn", -- "foo [em _bar _ hello_] world"); -- -- MT("emEscapedBySpaceOut", -- "foo _ bar[em _hello_]world"); -- -- MT("emEscapedByNewline", -- "foo", -- "_ bar[em _hello_]world"); -- -- // Unclosed emphasis characters -- // Instead of simply marking as EM / STRONG, it would be nice to have an -- // incomplete flag for EM and STRONG, that is styled slightly different. -- MT("emIncompleteAsterisk", -- "foo [em *bar]"); -- -- MT("emIncompleteUnderscore", -- "foo [em _bar]"); -- -- MT("strongAsterisk", -- "[strong **foo**] bar"); -- -- MT("strongUnderscore", -- "[strong __foo__] bar"); -- -- MT("emStrongAsterisk", -- "[em *foo][em&strong **bar*][strong hello**] world"); -- -- MT("emStrongUnderscore", -- "[em _foo][em&strong __bar_][strong hello__] world"); -- -- // "...same character must be used to open and close an emphasis span."" -- MT("emStrongMixed", -- "[em _foo][em&strong **bar*hello__ world]"); -- -- MT("emStrongMixed", -- "[em *foo][em&strong __bar_hello** world]"); -- -- // These characters should be escaped: -- // \ backslash -- // ` backtick -- // * asterisk -- // _ underscore -- // {} curly braces -- // [] square brackets -- // () parentheses -- // # hash mark -- // + plus sign -- // - minus sign (hyphen) -- // . dot -- // ! exclamation mark -- -- MT("escapeBacktick", -- "foo \\`bar\\`"); -- -- MT("doubleEscapeBacktick", -- "foo \\\\[comment `bar\\\\`]"); -- -- MT("escapeAsterisk", -- "foo \\*bar\\*"); -- -- MT("doubleEscapeAsterisk", -- "foo \\\\[em *bar\\\\*]"); -- -- MT("escapeUnderscore", -- "foo \\_bar\\_"); -- -- MT("doubleEscapeUnderscore", -- "foo \\\\[em _bar\\\\_]"); -- -- MT("escapeHash", -- "\\# foo"); -- -- MT("doubleEscapeHash", -- "\\\\# foo"); -- -- MT("escapeNewline", -- "\\", -- "[em *foo*]"); -- -- -- // Tests to make sure GFM-specific things aren't getting through -- -- MT("taskList", -- "[variable-2 * [ ]] bar]"); -- -- MT("fencedCodeBlocks", -- "[comment ```]", -- "foo", -- "[comment ```]"); -- -- // Tests that require XML mode -- -- MT("xmlMode", -- "[tag&bracket <][tag div][tag&bracket >]", -- "*foo*", -- "[tag&bracket <][tag http://github.com][tag&bracket />]", -- "[tag&bracket ]", -- "[link ]"); -- -- MT("xmlModeWithMarkdownInside", -- "[tag&bracket <][tag div] [attribute markdown]=[string 1][tag&bracket >]", -- "[em *foo*]", -- "[link ]", -- "[tag ]", -- "[link ]", -- "[tag&bracket <][tag div][tag&bracket >]", -- "[tag&bracket ]"); -- --})(); -diff --git a/media/editors/codemirror/mode/markdown/test.min.js b/media/editors/codemirror/mode/markdown/test.min.js -deleted file mode 100644 -index 2de7c7a..0000000 ---- a/media/editors/codemirror/mode/markdown/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function e(e){test.mode(e,a,Array.prototype.slice.call(arguments,1))}function o(e){test.mode(e,t,Array.prototype.slice.call(arguments,1))}var a=CodeMirror.getMode({tabSize:4},"markdown"),t=CodeMirror.getMode({tabSize:4},{name:"markdown",highlightFormatting:!0});o("formatting_emAsterisk","[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]"),o("formatting_emUnderscore","[em&formatting&formatting-em _][em foo][em&formatting&formatting-em _]"),o("formatting_strongAsterisk","[strong&formatting&formatting-strong **][strong foo][strong&formatting&formatting-strong **]"),o("formatting_strongUnderscore","[strong&formatting&formatting-strong __][strong foo][strong&formatting&formatting-strong __]"),o("formatting_codeBackticks","[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]"),o("formatting_doubleBackticks","[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]"),o("formatting_atxHeader","[header&header-1&formatting&formatting-header&formatting-header-1 #][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]"),o("formatting_setextHeader","foo","[header&header-1&formatting&formatting-header&formatting-header-1 =]"),o("formatting_blockquote","[quote"e-1&formatting&formatting-quote&formatting-quote-1 > ][quote"e-1 foo]"),o("formatting_list","[variable-2&formatting&formatting-list&formatting-list-ul - ][variable-2 foo]"),o("formatting_list","[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]"),o("formatting_link","[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]"),o("formatting_linkReference","[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]","[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]"),o("formatting_linkWeb","[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]"),o("formatting_linkEmail","[link&formatting&formatting-link <][link user@example.com][link&formatting&formatting-link >]"),o("formatting_escape","[formatting-escape \\*]"),e("plainText","foo"),e("trailingSpace1","foo "),e("trailingSpace2","foo[trailing-space-a ][trailing-space-new-line ]"),e("trailingSpace3","foo[trailing-space-a ][trailing-space-b ][trailing-space-new-line ]"),e("trailingSpace4","foo[trailing-space-a ][trailing-space-b ][trailing-space-a ][trailing-space-new-line ]"),e("codeBlocksUsing4Spaces"," [comment foo]"),e("codeBlocksUsing4SpacesIndentation"," [comment bar]"," [comment hello]"," [comment world]"," [comment foo]","bar"),e("codeBlocksUsing4SpacesIndentation"," foo"," [comment bar]"," [comment hello]"," [comment world]"),e("codeBlocksWithTrailingIndentedLine"," [comment foo]"," [comment bar]"," [comment baz]"," ","hello"),e("codeBlocksUsing1Tab"," [comment foo]"),e("inlineCodeUsingBackticks","foo [comment `bar`]"),e("blockCodeSingleBacktick","[comment `]","foo","[comment `]"),e("unclosedBackticks","foo [comment `bar]"),e("doubleBackticks","[comment ``foo ` bar``]"),e("consecutiveBackticks","[comment `foo```bar`]"),e("consecutiveBackticks","[comment `foo```bar`] hello [comment `world`]"),e("unclosedBackticks","[comment ``foo ``` bar` hello]"),e("closedBackticks","[comment ``foo ``` bar` hello``] world"),e("atxH1","[header&header-1 # foo]"),e("atxH2","[header&header-2 ## foo]"),e("atxH3","[header&header-3 ### foo]"),e("atxH4","[header&header-4 #### foo]"),e("atxH5","[header&header-5 ##### foo]"),e("atxH6","[header&header-6 ###### foo]"),e("atxH6NotH7","[header&header-6 ####### foo]"),e("atxH1inline","[header&header-1 # foo ][header&header-1&em *bar*]"),e("setextH1","foo","[header&header-1 =]"),e("setextH1","foo","[header&header-1 ===]"),e("setextH2","foo","[header&header-2 -]"),e("setextH2","foo","[header&header-2 ---]"),e("blockquoteSpace","[quote"e-1 > foo]"),e("blockquoteNoSpace","[quote"e-1 >foo]"),e("blockquoteNoBlankLine","foo","[quote"e-1 > bar]"),e("blockquoteSpace","[quote"e-1 > foo]","[quote"e-1 >][quote"e-2 > foo]","[quote"e-1 >][quote"e-2 >][quote"e-3 > foo]"),e("blockquoteThenParagraph","[quote"e-1 >foo]","","bar"),e("multiBlockquoteLazy","[quote"e-1 >foo]","[quote"e-1 bar]"),e("multiBlockquoteLazyThenParagraph","[quote"e-1 >foo]","[quote"e-1 bar]","","hello"),e("multiBlockquote","[quote"e-1 >foo]","[quote"e-1 >bar]"),e("multiBlockquoteThenParagraph","[quote"e-1 >foo]","[quote"e-1 >bar]","","hello"),e("listAsterisk","foo","bar","","[variable-2 * foo]","[variable-2 * bar]"),e("listPlus","foo","bar","","[variable-2 + foo]","[variable-2 + bar]"),e("listDash","foo","bar","","[variable-2 - foo]","[variable-2 - bar]"),e("listNumber","foo","bar","","[variable-2 1. foo]","[variable-2 2. bar]"),e("listBogus","foo","1. bar","2. hello"),e("listAfterHeader","[header&header-1 # foo]","[variable-2 - bar]"),e("listAsteriskFormatting","[variable-2 * ][variable-2&em *foo*][variable-2 bar]","[variable-2 * ][variable-2&strong **foo**][variable-2 bar]","[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 * ][variable-2&comment `foo`][variable-2 bar]"),e("listPlusFormatting","[variable-2 + ][variable-2&em *foo*][variable-2 bar]","[variable-2 + ][variable-2&strong **foo**][variable-2 bar]","[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 + ][variable-2&comment `foo`][variable-2 bar]"),e("listDashFormatting","[variable-2 - ][variable-2&em *foo*][variable-2 bar]","[variable-2 - ][variable-2&strong **foo**][variable-2 bar]","[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 - ][variable-2&comment `foo`][variable-2 bar]"),e("listNumberFormatting","[variable-2 1. ][variable-2&em *foo*][variable-2 bar]","[variable-2 2. ][variable-2&strong **foo**][variable-2 bar]","[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2 bar]","[variable-2 4. ][variable-2&comment `foo`][variable-2 bar]"),e("listParagraph","[variable-2 * foo]","","[variable-2 * bar]"),e("listMultiParagraph","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2 hello]"),e("listMultiParagraphExtra","[variable-2 * foo]","","[variable-2 * bar]","",""," [variable-2 hello]"),e("listMultiParagraphExtraSpace","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2 hello]",""," [variable-2 world]"),e("listTab","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2 hello]"),e("listNoIndent","[variable-2 * foo]","","[variable-2 * bar]","","hello"),e("blockquote","[variable-2 * foo]","","[variable-2 * bar]",""," [variable-2"e"e-1 > hello]"),e("blockquoteCode","[variable-2 * foo]","","[variable-2 * bar]",""," [comment > hello]",""," [variable-2 world]"),e("blockquoteCodeText","[variable-2 * foo]",""," [variable-2 bar]",""," [comment hello]",""," [variable-2 world]"),e("listAsteriskNested","[variable-2 * foo]",""," [variable-3 * bar]"),e("listPlusNested","[variable-2 + foo]",""," [variable-3 + bar]"),e("listDashNested","[variable-2 - foo]",""," [variable-3 - bar]"),e("listNumberNested","[variable-2 1. foo]",""," [variable-3 2. bar]"),e("listMixed","[variable-2 * foo]",""," [variable-3 + bar]",""," [keyword - hello]",""," [variable-2 1. world]"),e("listBlockquote","[variable-2 * foo]",""," [variable-3 + bar]",""," [quote"e-1&variable-3 > hello]"),e("listCode","[variable-2 * foo]",""," [variable-3 + bar]",""," [comment hello]"),e("listCodeIndentation","[variable-2 * foo]",""," [comment bar]"," [comment hello]"," [comment world]"," [comment foo]"," [variable-2 bar]"),e("listNested","[variable-2 * foo]",""," [variable-3 * bar]",""," [variable-2 hello]"),e("listNested","[variable-2 * foo]",""," [variable-3 * bar]",""," [variable-3 * foo]"),e("listCodeText","[variable-2 * foo]",""," [comment bar]","","hello"),e("hrSpace","[hr * * *]"),e("hr","[hr ***]"),e("hrLong","[hr *****]"),e("hrSpaceDash","[hr - - -]"),e("hrDashLong","[hr ---------------------------------------]"),e("linkTitle",'[link [[foo]]][string (http://example.com/ "bar")] hello'),e("linkNoTitle","[link [[foo]]][string (http://example.com/)] bar"),e("linkImage","[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar"),e("linkEm","[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar"),e("linkStrong","[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar"),e("linkEmStrong","[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar"),e("imageTitle",'[tag ![[foo]]][string (http://example.com/ "bar")] hello'),e("imageNoTitle","[tag ![[foo]]][string (http://example.com/)] bar"),e("imageAsterisks","[tag ![[*foo*]]][string (http://example.com/)] bar"),e("notALink","[[foo]] (bar)"),e("linkReference","[link [[foo]]][string [[bar]]] hello"),e("linkReferenceEm","[link [[][link&em *foo*][link ]]][string [[bar]]] hello"),e("linkReferenceStrong","[link [[][link&strong **foo**][link ]]][string [[bar]]] hello"),e("linkReferenceEmStrong","[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello"),e("linkReferenceSpace","[link [[foo]]] [string [[bar]]] hello"),e("linkReferenceDoubleSpace","[[foo]] [[bar]] hello"),e("linkImplicit","[link [[foo]]][string [[]]] hello"),e("labelNoTitle","[link [[foo]]:] [string http://example.com/]"),e("labelIndented"," [link [[foo]]:] [string http://example.com/]"),e("labelSpaceTitle",'[link [[foo bar]]:] [string http://example.com/ "hello"]'),e("labelDoubleTitle",'[link [[foo bar]]:] [string http://example.com/ "hello"] "world"'),e("labelTitleDoubleQuotes",'[link [[foo]]:] [string http://example.com/ "bar"]'),e("labelTitleSingleQuotes","[link [[foo]]:] [string http://example.com/ 'bar']"),e("labelTitleParenthese","[link [[foo]]:] [string http://example.com/ (bar)]"),e("labelTitleInvalid","[link [[foo]]:] [string http://example.com/] bar"),e("labelLinkAngleBrackets",'[link [[foo]]:] [string "bar"]'),e("labelTitleNextDoubleQuotes","[link [[foo]]:] [string http://example.com/]",'[string "bar"] hello'),e("labelTitleNextSingleQuotes","[link [[foo]]:] [string http://example.com/]","[string 'bar'] hello"),e("labelTitleNextParenthese","[link [[foo]]:] [string http://example.com/]","[string (bar)] hello"),e("labelTitleNextMixed","[link [[foo]]:] [string http://example.com/]",'(bar" hello'),e("linkWeb","[link ] foo"),e("linkWebDouble","[link ] foo [link ]"),e("linkEmail","[link ] foo"),e("linkEmailDouble","[link ] foo [link ]"),e("emAsterisk","[em *foo*] bar"),e("emUnderscore","[em _foo_] bar"),e("emInWordAsterisk","foo[em *bar*]hello"),e("emInWordUnderscore","foo[em _bar_]hello"),e("emEscapedBySpaceIn","foo [em _bar _ hello_] world"),e("emEscapedBySpaceOut","foo _ bar[em _hello_]world"),e("emEscapedByNewline","foo","_ bar[em _hello_]world"),e("emIncompleteAsterisk","foo [em *bar]"),e("emIncompleteUnderscore","foo [em _bar]"),e("strongAsterisk","[strong **foo**] bar"),e("strongUnderscore","[strong __foo__] bar"),e("emStrongAsterisk","[em *foo][em&strong **bar*][strong hello**] world"),e("emStrongUnderscore","[em _foo][em&strong __bar_][strong hello__] world"),e("emStrongMixed","[em _foo][em&strong **bar*hello__ world]"),e("emStrongMixed","[em *foo][em&strong __bar_hello** world]"),e("escapeBacktick","foo \\`bar\\`"),e("doubleEscapeBacktick","foo \\\\[comment `bar\\\\`]"),e("escapeAsterisk","foo \\*bar\\*"),e("doubleEscapeAsterisk","foo \\\\[em *bar\\\\*]"),e("escapeUnderscore","foo \\_bar\\_"),e("doubleEscapeUnderscore","foo \\\\[em _bar\\\\_]"),e("escapeHash","\\# foo"),e("doubleEscapeHash","\\\\# foo"),e("escapeNewline","\\","[em *foo*]"),e("taskList","[variable-2 * [ ]] bar]"),e("fencedCodeBlocks","[comment ```]","foo","[comment ```]"),e("xmlMode","[tag&bracket <][tag div][tag&bracket >]","*foo*","[tag&bracket <][tag http://github.com][tag&bracket />]","[tag&bracket ]","[link ]"),e("xmlModeWithMarkdownInside","[tag&bracket <][tag div] [attribute markdown]=[string 1][tag&bracket >]","[em *foo*]","[link ]","[tag ]","[link ]","[tag&bracket <][tag div][tag&bracket >]","[tag&bracket ]")}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/mathematica/mathematica.js b/media/editors/codemirror/mode/mathematica/mathematica.js -new file mode 100644 -index 0000000..5ae6f55 ---- /dev/null -+++ b/media/editors/codemirror/mode/mathematica/mathematica.js -@@ -0,0 +1,175 @@ -+// CodeMirror, copyright (c) by Marijn Haverbeke and others -+// Distributed under an MIT license: http://codemirror.net/LICENSE -+ -+// Mathematica mode copyright (c) 2015 by Calin Barbat -+// Based on code by Patrick Scheibe (halirutan) -+// See: https://github.com/halirutan/Mathematica-Source-Highlighting/tree/master/src/lang-mma.js -+ -+(function(mod) { -+ if (typeof exports == "object" && typeof module == "object") // CommonJS -+ mod(require("../../lib/codemirror")); -+ else if (typeof define == "function" && define.amd) // AMD -+ define(["../../lib/codemirror"], mod); -+ else // Plain browser env -+ mod(CodeMirror); -+})(function(CodeMirror) { -+"use strict"; -+ -+CodeMirror.defineMode('mathematica', function(_config, _parserConfig) { -+ -+ // used pattern building blocks -+ var Identifier = '[a-zA-Z\\$][a-zA-Z0-9\\$]*'; -+ var pBase = "(?:\\d+)"; -+ var pFloat = "(?:\\.\\d+|\\d+\\.\\d*|\\d+)"; -+ var pFloatBase = "(?:\\.\\w+|\\w+\\.\\w*|\\w+)"; -+ var pPrecision = "(?:`(?:`?"+pFloat+")?)"; -+ -+ // regular expressions -+ var reBaseForm = new RegExp('(?:'+pBase+'(?:\\^\\^'+pFloatBase+pPrecision+'?(?:\\*\\^[+-]?\\d+)?))'); -+ var reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\*\\^[+-]?\\d+)?)'); -+ var reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)'); -+ -+ function tokenBase(stream, state) { -+ var ch; -+ -+ // get next character -+ ch = stream.next(); -+ -+ // string -+ if (ch === '"') { -+ state.tokenize = tokenString; -+ return state.tokenize(stream, state); -+ } -+ -+ // comment -+ if (ch === '(') { -+ if (stream.eat('*')) { -+ state.commentLevel++; -+ state.tokenize = tokenComment; -+ return state.tokenize(stream, state); -+ } -+ } -+ -+ // go back one character -+ stream.backUp(1); -+ -+ // look for numbers -+ // Numbers in a baseform -+ if (stream.match(reBaseForm, true, false)) { -+ return 'number'; -+ } -+ -+ // Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition -+ // (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow. -+ if (stream.match(reFloatForm, true, false)) { -+ return 'number'; -+ } -+ -+ /* In[23] and Out[34] */ -+ if (stream.match(/(?:In|Out)\[[0-9]*\]/, true, false)) { -+ return 'atom'; -+ } -+ -+ // usage -+ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) { -+ return 'meta'; -+ } -+ -+ // message -+ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) { -+ return 'string-2'; -+ } -+ -+ // this makes a look-ahead match for something like variable:{_Integer} -+ // the match is then forwarded to the mma-patterns tokenizer. -+ if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/, true, false)) { -+ return 'variable-2'; -+ } -+ -+ // catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___) -+ // Cannot start with a number, but can have numbers at any other position. Examples -+ // blub__Integer, a1_, b34_Integer32 -+ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) { -+ return 'variable-2'; -+ } -+ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/, true, false)) { -+ return 'variable-2'; -+ } -+ if (stream.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) { -+ return 'variable-2'; -+ } -+ -+ // Named characters in Mathematica, like \[Gamma]. -+ if (stream.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/, true, false)) { -+ return 'variable-3'; -+ } -+ -+ // Match all braces separately -+ if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) { -+ return 'bracket'; -+ } -+ -+ // Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match -+ // only one. -+ if (stream.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/, true, false)) { -+ return 'variable-2'; -+ } -+ -+ // Literals like variables, keywords, functions -+ if (stream.match(reIdInContext, true, false)) { -+ return 'keyword'; -+ } -+ -+ // operators. Note that operators like @@ or /; are matched separately for each symbol. -+ if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) { -+ return 'operator'; -+ } -+ -+ // everything else is an error -+ return 'error'; -+ } -+ -+ function tokenString(stream, state) { -+ var next, end = false, escaped = false; -+ while ((next = stream.next()) != null) { -+ if (next === '"' && !escaped) { -+ end = true; -+ break; -+ } -+ escaped = !escaped && next === '\\'; -+ } -+ if (end && !escaped) { -+ state.tokenize = tokenBase; -+ } -+ return 'string'; -+ }; -+ -+ function tokenComment(stream, state) { -+ var prev, next; -+ while(state.commentLevel > 0 && (next = stream.next()) != null) { -+ if (prev === '(' && next === '*') state.commentLevel++; -+ if (prev === '*' && next === ')') state.commentLevel--; -+ prev = next; -+ } -+ if (state.commentLevel <= 0) { -+ state.tokenize = tokenBase; -+ } -+ return 'comment'; -+ } -+ -+ return { -+ startState: function() {return {tokenize: tokenBase, commentLevel: 0};}, -+ token: function(stream, state) { -+ if (stream.eatSpace()) return null; -+ return state.tokenize(stream, state); -+ }, -+ blockCommentStart: "(*", -+ blockCommentEnd: "*)" -+ }; -+}); -+ -+CodeMirror.defineMIME('text/x-mathematica', { -+ name: 'mathematica' -+}); -+ -+}); -diff --git a/media/editors/codemirror/mode/mathematica/mathematica.min.js b/media/editors/codemirror/mode/mathematica/mathematica.min.js -new file mode 100644 -index 0000000..a5872ae ---- /dev/null -+++ b/media/editors/codemirror/mode/mathematica/mathematica.min.js -@@ -0,0 +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("mathematica",function(a,b){function c(a,b){var c;return c=a.next(),'"'===c?(b.tokenize=d,b.tokenize(a,b)):"("===c&&a.eat("*")?(b.commentLevel++,b.tokenize=e,b.tokenize(a,b)):(a.backUp(1),a.match(k,!0,!1)?"number":a.match(l,!0,!1)?"number":a.match(/(?:In|Out)\[[0-9]*\]/,!0,!1)?"atom":a.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/,!0,!1)?"meta":a.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/,!0,!1)?"string-2":a.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/,!0,!1)?"variable-2":a.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)?"variable-2":a.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/,!0,!1)?"variable-2":a.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)?"variable-2":a.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/,!0,!1)?"variable-3":a.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)?"bracket":a.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/,!0,!1)?"variable-2":a.match(m,!0,!1)?"keyword":a.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/,!0,!1)?"operator":"error")}function d(a,b){for(var d,e=!1,f=!1;null!=(d=a.next());){if('"'===d&&!f){e=!0;break}f=!f&&"\\"===d}return e&&!f&&(b.tokenize=c),"string"}function e(a,b){for(var d,e;b.commentLevel>0&&null!=(e=a.next());)"("===d&&"*"===e&&b.commentLevel++,"*"===d&&")"===e&&b.commentLevel--,d=e;return b.commentLevel<=0&&(b.tokenize=c),"comment"}var f="[a-zA-Z\\$][a-zA-Z0-9\\$]*",g="(?:\\d+)",h="(?:\\.\\d+|\\d+\\.\\d*|\\d+)",i="(?:\\.\\w+|\\w+\\.\\w*|\\w+)",j="(?:`(?:`?"+h+")?)",k=new RegExp("(?:"+g+"(?:\\^\\^"+i+j+"?(?:\\*\\^[+-]?\\d+)?))"),l=new RegExp("(?:"+h+j+"?(?:\\*\\^[+-]?\\d+)?)"),m=new RegExp("(?:`?)(?:"+f+")(?:`(?:"+f+"))*(?:`?)");return{startState:function(){return{tokenize:c,commentLevel:0}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)},blockCommentStart:"(*",blockCommentEnd:"*)"}}),a.defineMIME("text/x-mathematica",{name:"mathematica"})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/meta.js b/media/editors/codemirror/mode/meta.js -index e110288..44e0dbf 100644 ---- a/media/editors/codemirror/mode/meta.js -+++ b/media/editors/codemirror/mode/meta.js -@@ -13,12 +13,14 @@ - - CodeMirror.modeInfo = [ - {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]}, -+ {name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]}, - {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i}, - {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]}, - {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]}, - {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]}, - {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]}, - {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]}, -+ {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/}, - {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]}, - {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]}, - {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]}, -@@ -70,7 +72,9 @@ - {name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]}, - {name: "mIRC", mime: "text/mirc", mode: "mirc"}, - {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"}, -+ {name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]}, - {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]}, -+ {name: "MUMPS", mime: "text/x-mumps", mode: "mumps"}, - {name: "MS SQL", mime: "text/x-mssql", mode: "sql"}, - {name: "MySQL", mime: "text/x-mysql", mode: "sql"}, - {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i}, -@@ -104,7 +108,6 @@ - {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]}, - {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]}, - {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]}, -- {name: "SmartyMixed", mime: "text/x-smarty", mode: "smartymixed"}, - {name: "Solr", mime: "text/x-solr", mode: "solr"}, - {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]}, - {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]}, -@@ -120,6 +123,7 @@ - {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"}, - {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]}, - {name: "Tornado", mime: "text/x-tornado", mode: "tornado"}, -+ {name: "troff", mime: "troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]}, - {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]}, - {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]}, - {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]}, -@@ -128,7 +132,7 @@ - {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]}, - {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]}, - {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]}, -- {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml"], alias: ["yml"]}, -+ {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]}, - {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]} - ]; - // Ensure all modes have a mime property for backwards compatibility -diff --git a/media/editors/codemirror/mode/meta.min.js b/media/editors/codemirror/mode/meta.min.js -index fb300fd..cb85f2f 100644 ---- a/media/editors/codemirror/mode/meta.min.js -+++ b/media/editors/codemirror/mode/meta.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj"]},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"kotlin",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["py","pyw"]},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"]},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"SmartyMixed",mime:"text/x-smarty",mode:"smartymixed"},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"MariaDB",mime:"text/x-mariadb",mode:"sql"},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]}];for(var m=0;m-1&&m.substring(i+1,m.length);return x?e.findModeByExtension(x):void 0},e.findModeByName=function(m){m=m.toLowerCase();for(var t=0;t-1&&b.substring(e+1,b.length);return f?a.findModeByExtension(f):void 0},a.findModeByName=function(b){b=b.toLowerCase();for(var c=0;c!?^\/\|]/;return{startState:function(){return{tokenize:$,beforeParams:!1,inParams:!1}},token:function(e,i){return e.eatSpace()?null:i.tokenize(e,i)}}})}); -\ 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.defineMIME("text/mirc","mirc"),a.defineMode("mirc",function(){function a(a){for(var b={},c=a.split(" "),d=0;d!?^\/\|]/;return{startState:function(){return{tokenize:c,beforeParams:!1,inParams:!1}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)}}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/mllike/mllike.js b/media/editors/codemirror/mode/mllike/mllike.js -index 04ab1c9..bf0b8a6 100644 ---- a/media/editors/codemirror/mode/mllike/mllike.js -+++ b/media/editors/codemirror/mode/mllike/mllike.js -@@ -85,7 +85,7 @@ CodeMirror.defineMode('mllike', function(_config, parserConfig) { - } - stream.eatWhile(/\w/); - var cur = stream.current(); -- return words[cur] || 'variable'; -+ return words.hasOwnProperty(cur) ? words[cur] : 'variable'; - } - - function tokenString(stream, state) { -diff --git a/media/editors/codemirror/mode/mllike/mllike.min.js b/media/editors/codemirror/mode/mllike/mllike.min.js -index df8d59d..dbb4409 100644 ---- a/media/editors/codemirror/mode/mllike/mllike.min.js -+++ b/media/editors/codemirror/mode/mllike/mllike.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("mllike",function(e,r){function t(e,t){var d=e.next();if('"'===d)return t.tokenize=o,t.tokenize(e,t);if("("===d&&e.eat("*"))return t.commentLevel++,t.tokenize=n,t.tokenize(e,t);if("~"===d)return e.eatWhile(/\w/),"variable-2";if("`"===d)return e.eatWhile(/\w/),"quote";if("/"===d&&r.slashComments&&e.eat("/"))return e.skipToEnd(),"comment";if(/\d/.test(d))return e.eatWhile(/[\d]/),e.eat(".")&&e.eatWhile(/[\d]/),"number";if(/[+\-*&%=<>!?|]/.test(d))return"operator";e.eatWhile(/\w/);var l=e.current();return i[l]||"variable"}function o(e,r){for(var o,n=!1,i=!1;null!=(o=e.next());){if('"'===o&&!i){n=!0;break}i=!i&&"\\"===o}return n&&!i&&(r.tokenize=t),"string"}function n(e,r){for(var o,n;r.commentLevel>0&&null!=(n=e.next());)"("===o&&"*"===n&&r.commentLevel++,"*"===o&&")"===n&&r.commentLevel--,o=n;return r.commentLevel<=0&&(r.tokenize=t),"comment"}var i={let:"keyword",rec:"keyword","in":"keyword",of:"keyword",and:"keyword","if":"keyword",then:"keyword","else":"keyword","for":"keyword",to:"keyword","while":"keyword","do":"keyword",done:"keyword",fun:"keyword","function":"keyword",val:"keyword",type:"keyword",mutable:"keyword",match:"keyword","with":"keyword","try":"keyword",open:"builtin",ignore:"builtin",begin:"keyword",end:"keyword"},d=r.extraWords||{};for(var l in d)d.hasOwnProperty(l)&&(i[l]=r.extraWords[l]);return{startState:function(){return{tokenize:t,commentLevel:0}},token:function(e,r){return e.eatSpace()?null:r.tokenize(e,r)},blockCommentStart:"(*",blockCommentEnd:"*)",lineComment:r.slashComments?"//":null}}),e.defineMIME("text/x-ocaml",{name:"mllike",extraWords:{succ:"keyword",trace:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin","true":"atom","false":"atom",raise:"keyword"}}),e.defineMIME("text/x-fsharp",{name:"mllike",extraWords:{"abstract":"keyword",as:"keyword",assert:"keyword",base:"keyword","class":"keyword","default":"keyword",delegate:"keyword",downcast:"keyword",downto:"keyword",elif:"keyword",exception:"keyword",extern:"keyword","finally":"keyword",global:"keyword",inherit:"keyword",inline:"keyword","interface":"keyword",internal:"keyword",lazy:"keyword","let!":"keyword",member:"keyword",module:"keyword",namespace:"keyword","new":"keyword","null":"keyword",override:"keyword","private":"keyword","public":"keyword","return":"keyword","return!":"keyword",select:"keyword","static":"keyword",struct:"keyword",upcast:"keyword",use:"keyword","use!":"keyword",val:"keyword",when:"keyword","yield":"keyword","yield!":"keyword",List:"builtin",Seq:"builtin",Map:"builtin",Set:"builtin","int":"builtin",string:"builtin",raise:"builtin",failwith:"builtin",not:"builtin","true":"builtin","false":"builtin"},slashComments:!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("mllike",function(a,b){function c(a,c){var g=a.next();if('"'===g)return c.tokenize=d,c.tokenize(a,c);if("("===g&&a.eat("*"))return c.commentLevel++,c.tokenize=e,c.tokenize(a,c);if("~"===g)return a.eatWhile(/\w/),"variable-2";if("`"===g)return a.eatWhile(/\w/),"quote";if("/"===g&&b.slashComments&&a.eat("/"))return a.skipToEnd(),"comment";if(/\d/.test(g))return a.eatWhile(/[\d]/),a.eat(".")&&a.eatWhile(/[\d]/),"number";if(/[+\-*&%=<>!?|]/.test(g))return"operator";a.eatWhile(/\w/);var h=a.current();return f.hasOwnProperty(h)?f[h]:"variable"}function d(a,b){for(var d,e=!1,f=!1;null!=(d=a.next());){if('"'===d&&!f){e=!0;break}f=!f&&"\\"===d}return e&&!f&&(b.tokenize=c),"string"}function e(a,b){for(var d,e;b.commentLevel>0&&null!=(e=a.next());)"("===d&&"*"===e&&b.commentLevel++,"*"===d&&")"===e&&b.commentLevel--,d=e;return b.commentLevel<=0&&(b.tokenize=c),"comment"}var f={let:"keyword",rec:"keyword","in":"keyword",of:"keyword",and:"keyword","if":"keyword",then:"keyword","else":"keyword","for":"keyword",to:"keyword","while":"keyword","do":"keyword",done:"keyword",fun:"keyword","function":"keyword",val:"keyword",type:"keyword",mutable:"keyword",match:"keyword","with":"keyword","try":"keyword",open:"builtin",ignore:"builtin",begin:"keyword",end:"keyword"},g=b.extraWords||{};for(var h in g)g.hasOwnProperty(h)&&(f[h]=b.extraWords[h]);return{startState:function(){return{tokenize:c,commentLevel:0}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)},blockCommentStart:"(*",blockCommentEnd:"*)",lineComment:b.slashComments?"//":null}}),a.defineMIME("text/x-ocaml",{name:"mllike",extraWords:{succ:"keyword",trace:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin","true":"atom","false":"atom",raise:"keyword"}}),a.defineMIME("text/x-fsharp",{name:"mllike",extraWords:{"abstract":"keyword",as:"keyword",assert:"keyword",base:"keyword","class":"keyword","default":"keyword",delegate:"keyword",downcast:"keyword",downto:"keyword",elif:"keyword",exception:"keyword",extern:"keyword","finally":"keyword",global:"keyword",inherit:"keyword",inline:"keyword","interface":"keyword",internal:"keyword",lazy:"keyword","let!":"keyword",member:"keyword",module:"keyword",namespace:"keyword","new":"keyword","null":"keyword",override:"keyword","private":"keyword","public":"keyword","return":"keyword","return!":"keyword",select:"keyword","static":"keyword",struct:"keyword",upcast:"keyword",use:"keyword","use!":"keyword",val:"keyword",when:"keyword","yield":"keyword","yield!":"keyword",List:"builtin",Seq:"builtin",Map:"builtin",Set:"builtin","int":"builtin",string:"builtin",raise:"builtin",failwith:"builtin",not:"builtin","true":"builtin","false":"builtin"},slashComments:!0})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/modelica/modelica.min.js b/media/editors/codemirror/mode/modelica/modelica.min.js -index bd9f492..348ae9f 100644 ---- a/media/editors/codemirror/mode/modelica/modelica.min.js -+++ b/media/editors/codemirror/mode/modelica/modelica.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r0&&t.level--:t.level++,t.tokenize=null,t.sol=!1,c.propertyIsEnumerable(n)?"keyword":f.propertyIsEnumerable(n)?"builtin":p.propertyIsEnumerable(n)?"atom":"variable"}function a(e,t){for(;e.eat(/[^']/););return t.tokenize=null,t.sol=!1,e.eat("'")?"variable":"error"}function u(e,t){return e.eatWhile(k),e.eat(".")&&e.eatWhile(k),(e.eat("e")||e.eat("E"))&&(e.eat("-")||e.eat("+"),e.eatWhile(k)),t.tokenize=null,t.sol=!1,"number"}var s=t.indentUnit,c=n.keywords||{},f=n.builtin||{},p=n.atoms||{},d=/[;=\(:\),{}.*<>+\-\/^\[\]]/,m=/(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/,k=/[0-9]/,b=/[_a-zA-Z]/;return{startState:function(){return{tokenize:null,level:0,sol:!0}},token:function(e,t){if(null!=t.tokenize)return t.tokenize(e,t);if(e.sol()&&(t.sol=!0),e.eatSpace())return t.tokenize=null,null;var n=e.next();if("/"==n&&e.eat("/"))t.tokenize=r;else if("/"==n&&e.eat("*"))t.tokenize=o;else{if(m.test(n+e.peek()))return e.next(),t.tokenize=null,"operator";if(d.test(n))return t.tokenize=null,"operator";if(b.test(n))t.tokenize=l;else if("'"==n&&e.peek()&&"'"!=e.peek())t.tokenize=a;else if('"'==n)t.tokenize=i;else{if(!k.test(n))return t.tokenize=null,"error";t.tokenize=u}}return t.tokenize(e,t)},indent:function(t,n){if(null!=t.tokenize)return e.Pass;var r=t.level;return/(algorithm)/.test(n)&&r--,/(equation)/.test(n)&&r--,/(initial algorithm)/.test(n)&&r--,/(initial equation)/.test(n)&&r--,/(end)/.test(n)&&r--,r>0?s*r:0},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});var r="algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within",o="abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh",i="Real Boolean Integer String";n(["text/x-modelica"],{name:"modelica",keywords:t(r),builtin:t(o),atoms:t(i)})}); -\ 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){for(var b={},c=a.split(" "),d=0;d0&&b.level--:b.level++,b.tokenize=null,b.sol=!1,k.propertyIsEnumerable(c)?"keyword":l.propertyIsEnumerable(c)?"builtin":m.propertyIsEnumerable(c)?"atom":"variable"}function h(a,b){for(;a.eat(/[^']/););return b.tokenize=null,b.sol=!1,a.eat("'")?"variable":"error"}function i(a,b){return a.eatWhile(p),a.eat(".")&&a.eatWhile(p),(a.eat("e")||a.eat("E"))&&(a.eat("-")||a.eat("+"),a.eatWhile(p)),b.tokenize=null,b.sol=!1,"number"}var j=b.indentUnit,k=c.keywords||{},l=c.builtin||{},m=c.atoms||{},n=/[;=\(:\),{}.*<>+\-\/^\[\]]/,o=/(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/,p=/[0-9]/,q=/[_a-zA-Z]/;return{startState:function(){return{tokenize:null,level:0,sol:!0}},token:function(a,b){if(null!=b.tokenize)return b.tokenize(a,b);if(a.sol()&&(b.sol=!0),a.eatSpace())return b.tokenize=null,null;var c=a.next();if("/"==c&&a.eat("/"))b.tokenize=d;else if("/"==c&&a.eat("*"))b.tokenize=e;else{if(o.test(c+a.peek()))return a.next(),b.tokenize=null,"operator";if(n.test(c))return b.tokenize=null,"operator";if(q.test(c))b.tokenize=g;else if("'"==c&&a.peek()&&"'"!=a.peek())b.tokenize=h;else if('"'==c)b.tokenize=f;else{if(!p.test(c))return b.tokenize=null,"error";b.tokenize=i}}return b.tokenize(a,b)},indent:function(b,c){if(null!=b.tokenize)return a.Pass;var d=b.level;return/(algorithm)/.test(c)&&d--,/(equation)/.test(c)&&d--,/(initial algorithm)/.test(c)&&d--,/(initial equation)/.test(c)&&d--,/(end)/.test(c)&&d--,d>0?j*d:0},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});var d="algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within",e="abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh",f="Real Boolean Integer String";c(["text/x-modelica"],{name:"modelica",keywords:b(d),builtin:b(e),atoms:b(f)})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/mumps/mumps.js b/media/editors/codemirror/mode/mumps/mumps.js -new file mode 100644 -index 0000000..469f8c3 ---- /dev/null -+++ b/media/editors/codemirror/mode/mumps/mumps.js -@@ -0,0 +1,148 @@ -+// CodeMirror, copyright (c) by Marijn Haverbeke and others -+// Distributed under an MIT license: http://codemirror.net/LICENSE -+ -+/* -+ This MUMPS Language script was constructed using vbscript.js as a template. -+*/ -+ -+(function(mod) { -+ if (typeof exports == "object" && typeof module == "object") // CommonJS -+ mod(require("../../lib/codemirror")); -+ else if (typeof define == "function" && define.amd) // AMD -+ define(["../../lib/codemirror"], mod); -+ else // Plain browser env -+ mod(CodeMirror); -+})(function(CodeMirror) { -+ "use strict"; -+ -+ CodeMirror.defineMode("mumps", function() { -+ function wordRegexp(words) { -+ return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); -+ } -+ -+ var singleOperators = new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]"); -+ var doubleOperators = new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))"); -+ var singleDelimiters = new RegExp("^[\\.,:]"); -+ var brackets = new RegExp("[()]"); -+ var identifiers = new RegExp("^[%A-Za-z][A-Za-z0-9]*"); -+ var commandKeywords = ["break","close","do","else","for","goto", "halt", "hang", "if", "job","kill","lock","merge","new","open", "quit", "read", "set", "tcommit", "trollback", "tstart", "use", "view", "write", "xecute", "b","c","d","e","f","g", "h", "i", "j","k","l","m","n","o", "q", "r", "s", "tc", "tro", "ts", "u", "v", "w", "x"]; -+ // The following list includes instrinsic functions _and_ special variables -+ var intrinsicFuncsWords = ["\\$ascii", "\\$char", "\\$data", "\\$ecode", "\\$estack", "\\$etrap", "\\$extract", "\\$find", "\\$fnumber", "\\$get", "\\$horolog", "\\$io", "\\$increment", "\\$job", "\\$justify", "\\$length", "\\$name", "\\$next", "\\$order", "\\$piece", "\\$qlength", "\\$qsubscript", "\\$query", "\\$quit", "\\$random", "\\$reverse", "\\$select", "\\$stack", "\\$test", "\\$text", "\\$translate", "\\$view", "\\$x", "\\$y", "\\$a", "\\$c", "\\$d", "\\$e", "\\$ec", "\\$es", "\\$et", "\\$f", "\\$fn", "\\$g", "\\$h", "\\$i", "\\$j", "\\$l", "\\$n", "\\$na", "\\$o", "\\$p", "\\$q", "\\$ql", "\\$qs", "\\$r", "\\$re", "\\$s", "\\$st", "\\$t", "\\$tr", "\\$v", "\\$z"]; -+ var intrinsicFuncs = wordRegexp(intrinsicFuncsWords); -+ var command = wordRegexp(commandKeywords); -+ -+ function tokenBase(stream, state) { -+ if (stream.sol()) { -+ state.label = true; -+ state.commandMode = 0; -+ } -+ -+ // The character has meaning in MUMPS. Ignoring consecutive -+ // spaces would interfere with interpreting whether the next non-space -+ // character belongs to the command or argument context. -+ -+ // Examine each character and update a mode variable whose interpretation is: -+ // >0 => command 0 => argument <0 => command post-conditional -+ var ch = stream.peek(); -+ -+ if (ch == " " || ch == "\t") { // Pre-process -+ state.label = false; -+ if (state.commandMode == 0) -+ state.commandMode = 1; -+ else if ((state.commandMode < 0) || (state.commandMode == 2)) -+ state.commandMode = 0; -+ } else if ((ch != ".") && (state.commandMode > 0)) { -+ if (ch == ":") -+ state.commandMode = -1; // SIS - Command post-conditional -+ else -+ state.commandMode = 2; -+ } -+ -+ // Do not color parameter list as line tag -+ if ((ch === "(") || (ch === "\u0009")) -+ state.label = false; -+ -+ // MUMPS comment starts with ";" -+ if (ch === ";") { -+ stream.skipToEnd(); -+ return "comment"; -+ } -+ -+ // Number Literals // SIS/RLM - MUMPS permits canonic number followed by concatenate operator -+ if (stream.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/)) -+ return "number"; -+ -+ // Handle Strings -+ if (ch == '"') { -+ if (stream.skipTo('"')) { -+ stream.next(); -+ return "string"; -+ } else { -+ stream.skipToEnd(); -+ return "error"; -+ } -+ } -+ -+ // Handle operators and Delimiters -+ if (stream.match(doubleOperators) || stream.match(singleOperators)) -+ return "operator"; -+ -+ // Prevents leading "." in DO block from falling through to error -+ if (stream.match(singleDelimiters)) -+ return null; -+ -+ if (brackets.test(ch)) { -+ stream.next(); -+ return "bracket"; -+ } -+ -+ if (state.commandMode > 0 && stream.match(command)) -+ return "variable-2"; -+ -+ if (stream.match(intrinsicFuncs)) -+ return "builtin"; -+ -+ if (stream.match(identifiers)) -+ return "variable"; -+ -+ // Detect dollar-sign when not a documented intrinsic function -+ // "^" may introduce a GVN or SSVN - Color same as function -+ if (ch === "$" || ch === "^") { -+ stream.next(); -+ return "builtin"; -+ } -+ -+ // MUMPS Indirection -+ if (ch === "@") { -+ stream.next(); -+ return "string-2"; -+ } -+ -+ if (/[\w%]/.test(ch)) { -+ stream.eatWhile(/[\w%]/); -+ return "variable"; -+ } -+ -+ // Handle non-detected items -+ stream.next(); -+ return "error"; -+ } -+ -+ return { -+ startState: function() { -+ return { -+ label: false, -+ commandMode: 0 -+ }; -+ }, -+ -+ token: function(stream, state) { -+ var style = tokenBase(stream, state); -+ if (state.label) return "tag"; -+ return style; -+ } -+ }; -+ }); -+ -+ CodeMirror.defineMIME("text/x-mumps", "mumps"); -+}); -diff --git a/media/editors/codemirror/mode/mumps/mumps.min.js b/media/editors/codemirror/mode/mumps/mumps.min.js -new file mode 100644 -index 0000000..fd075fb ---- /dev/null -+++ b/media/editors/codemirror/mode/mumps/mumps.min.js -@@ -0,0 +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("mumps",function(){function a(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function b(a,b){a.sol()&&(b.label=!0,b.commandMode=0);var h=a.peek();return" "==h||" "==h?(b.label=!1,0==b.commandMode?b.commandMode=1:(b.commandMode<0||2==b.commandMode)&&(b.commandMode=0)):"."!=h&&b.commandMode>0&&(":"==h?b.commandMode=-1:b.commandMode=2),("("===h||" "===h)&&(b.label=!1),";"===h?(a.skipToEnd(),"comment"):a.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/)?"number":'"'==h?a.skipTo('"')?(a.next(),"string"):(a.skipToEnd(),"error"):a.match(d)||a.match(c)?"operator":a.match(e)?null:f.test(h)?(a.next(),"bracket"):b.commandMode>0&&a.match(k)?"variable-2":a.match(j)?"builtin":a.match(g)?"variable":"$"===h||"^"===h?(a.next(),"builtin"):"@"===h?(a.next(),"string-2"):/[\w%]/.test(h)?(a.eatWhile(/[\w%]/),"variable"):(a.next(),"error")}var c=new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]"),d=new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))"),e=new RegExp("^[\\.,:]"),f=new RegExp("[()]"),g=new RegExp("^[%A-Za-z][A-Za-z0-9]*"),h=["break","close","do","else","for","goto","halt","hang","if","job","kill","lock","merge","new","open","quit","read","set","tcommit","trollback","tstart","use","view","write","xecute","b","c","d","e","f","g","h","i","j","k","l","m","n","o","q","r","s","tc","tro","ts","u","v","w","x"],i=["\\$ascii","\\$char","\\$data","\\$ecode","\\$estack","\\$etrap","\\$extract","\\$find","\\$fnumber","\\$get","\\$horolog","\\$io","\\$increment","\\$job","\\$justify","\\$length","\\$name","\\$next","\\$order","\\$piece","\\$qlength","\\$qsubscript","\\$query","\\$quit","\\$random","\\$reverse","\\$select","\\$stack","\\$test","\\$text","\\$translate","\\$view","\\$x","\\$y","\\$a","\\$c","\\$d","\\$e","\\$ec","\\$es","\\$et","\\$f","\\$fn","\\$g","\\$h","\\$i","\\$j","\\$l","\\$n","\\$na","\\$o","\\$p","\\$q","\\$ql","\\$qs","\\$r","\\$re","\\$s","\\$st","\\$t","\\$tr","\\$v","\\$z"],j=a(i),k=a(h);return{startState:function(){return{label:!1,commandMode:0}},token:function(a,c){var d=b(a,c);return c.label?"tag":d}}}),a.defineMIME("text/x-mumps","mumps")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/nginx/nginx.min.js b/media/editors/codemirror/mode/nginx/nginx.min.js -index 9aaa18c..54f2824 100644 ---- a/media/editors/codemirror/mode/nginx/nginx.min.js -+++ b/media/editors/codemirror/mode/nginx/nginx.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("nginx",function(e){function _(e){for(var _={},t=e.split(" "),i=0;i*\/]/.test(o)?t(null,"select-op"):/[;{}:\[\]]/.test(o)?t(null,o):(e.eatWhile(/[\w\\\-]/),t("variable","variable")):t(null,"compare"):void t(null,"compare")}function r(e,_){for(var r,s=!1;null!=(r=e.next());){if(s&&"/"==r){_.tokenize=i;break}s="*"==r}return t("comment","comment")}function s(e,_){for(var r,s=0;null!=(r=e.next());){if(s>=2&&">"==r){_.tokenize=i;break}s="-"==r?s+1:0}return t("comment","comment")}function a(e){return function(_,r){for(var s,a=!1;null!=(s=_.next())&&(s!=e||a);)a=!a&&"\\"==s;return a||(r.tokenize=i),t("string","string")}}var o,n=_("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=_("http mail events server types location upstream charset_map limit_except if geo map"),l=_("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),p=e.indentUnit;return{startState:function(e){return{tokenize:i,baseIndent:e||0,stack:[]}},token:function(e,_){if(e.eatSpace())return null;o=null;var t=_.tokenize(e,_),i=_.stack[_.stack.length-1];return"hash"==o&&"rule"==i?t="atom":"variable"==t&&("rule"==i?t="number":i&&"@media{"!=i||(t="tag")),"rule"==i&&/^[\{\};]$/.test(o)&&_.stack.pop(),"{"==o?"@media"==i?_.stack[_.stack.length-1]="@media{":_.stack.push("{"):"}"==o?_.stack.pop():"@media"==o?_.stack.push("@media"):"{"==i&&"comment"!=o&&_.stack.push("rule"),t},indent:function(e,_){var t=e.stack.length;return/^\}/.test(_)&&(t-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+t*p},electricChars:"}"}}),e.defineMIME("text/nginx","text/x-nginx-conf")}); -\ 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("nginx",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d*\/]/.test(h)?c(null,"select-op"):/[;{}:\[\]]/.test(h)?c(null,h):(a.eatWhile(/[\w\\\-]/),c("variable","variable")):c(null,"compare"):void c(null,"compare")}function e(a,b){for(var e,f=!1;null!=(e=a.next());){if(f&&"/"==e){b.tokenize=d;break}f="*"==e}return c("comment","comment")}function f(a,b){for(var e,f=0;null!=(e=a.next());){if(f>=2&&">"==e){b.tokenize=d;break}f="-"==e?f+1:0}return c("comment","comment")}function g(a){return function(b,e){for(var f,g=!1;null!=(f=b.next())&&(f!=a||g);)g=!g&&"\\"==f;return g||(e.tokenize=d),c("string","string")}}var h,i=b("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),j=b("http mail events server types location upstream charset_map limit_except if geo map"),k=b("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),l=a.indentUnit;return{startState:function(a){return{tokenize:d,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;h=null;var c=b.tokenize(a,b),d=b.stack[b.stack.length-1];return"hash"==h&&"rule"==d?c="atom":"variable"==c&&("rule"==d?c="number":d&&"@media{"!=d||(c="tag")),"rule"==d&&/^[\{\};]$/.test(h)&&b.stack.pop(),"{"==h?"@media"==d?b.stack[b.stack.length-1]="@media{":b.stack.push("{"):"}"==h?b.stack.pop():"@media"==h?b.stack.push("@media"):"{"==d&&"comment"!=h&&b.stack.push("rule"),c},indent:function(a,b){var c=a.stack.length;return/^\}/.test(b)&&(c-="rule"==a.stack[a.stack.length-1]?2:1),a.baseIndent+c*l},electricChars:"}"}}),a.defineMIME("text/nginx","text/x-nginx-conf")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/ntriples/ntriples.min.js b/media/editors/codemirror/mode/ntriples/ntriples.min.js -index 2f03eed..80b8f11 100644 ---- a/media/editors/codemirror/mode/ntriples/ntriples.min.js -+++ b/media/editors/codemirror/mode/ntriples/ntriples.min.js -@@ -1 +1 @@ --!function(_){"object"==typeof exports&&"object"==typeof module?_(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],_):_(CodeMirror)}(function(_){"use strict";_.defineMode("ntriples",function(){function _(_,I){var R,n=_.location;R=n==e.PRE_SUBJECT&&"<"==I?e.WRITING_SUB_URI:n==e.PRE_SUBJECT&&"_"==I?e.WRITING_BNODE_URI:n==e.PRE_PRED&&"<"==I?e.WRITING_PRED_URI:n==e.PRE_OBJ&&"<"==I?e.WRITING_OBJ_URI:n==e.PRE_OBJ&&"_"==I?e.WRITING_OBJ_BNODE:n==e.PRE_OBJ&&'"'==I?e.WRITING_OBJ_LITERAL:n==e.WRITING_SUB_URI&&">"==I?e.PRE_PRED:n==e.WRITING_BNODE_URI&&" "==I?e.PRE_PRED:n==e.WRITING_PRED_URI&&">"==I?e.PRE_OBJ:n==e.WRITING_OBJ_URI&&">"==I?e.POST_OBJ:n==e.WRITING_OBJ_BNODE&&" "==I?e.POST_OBJ:n==e.WRITING_OBJ_LITERAL&&'"'==I?e.POST_OBJ:n==e.WRITING_LIT_LANG&&" "==I?e.POST_OBJ:n==e.WRITING_LIT_TYPE&&">"==I?e.POST_OBJ:n==e.WRITING_OBJ_LITERAL&&"@"==I?e.WRITING_LIT_LANG:n==e.WRITING_OBJ_LITERAL&&"^"==I?e.WRITING_LIT_TYPE:" "!=I||n!=e.PRE_SUBJECT&&n!=e.PRE_PRED&&n!=e.PRE_OBJ&&n!=e.POST_OBJ?n==e.POST_OBJ&&"."==I?e.PRE_SUBJECT:e.ERROR:n,_.location=R}var e={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};return{startState:function(){return{location:e.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(e,I){var R=e.next();if("<"==R){_(I,R);var n="";return e.eatWhile(function(_){return"#"!=_&&">"!=_?(n+=_,!0):!1}),I.uris.push(n),e.match("#",!1)?"variable":(e.next(),_(I,">"),"variable")}if("#"==R){var t="";return e.eatWhile(function(_){return">"!=_&&" "!=_?(t+=_,!0):!1}),I.anchors.push(t),"variable-2"}if(">"==R)return _(I,">"),"variable";if("_"==R){_(I,R);var r="";return e.eatWhile(function(_){return" "!=_?(r+=_,!0):!1}),I.bnodes.push(r),e.next(),_(I," "),"builtin"}if('"'==R)return _(I,R),e.eatWhile(function(_){return'"'!=_}),e.next(),"@"!=e.peek()&&"^"!=e.peek()&&_(I,'"'),"string";if("@"==R){_(I,"@");var i="";return e.eatWhile(function(_){return" "!=_?(i+=_,!0):!1}),I.langs.push(i),e.next(),_(I," "),"string-2"}if("^"==R){e.next(),_(I,"^");var T="";return e.eatWhile(function(_){return">"!=_?(T+=_,!0):!1}),I.types.push(T),e.next(),_(I,">"),"variable"}" "==R&&_(I,R),"."==R&&_(I,R)}}}),_.defineMIME("text/n-triples","ntriples")}); -\ 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("ntriples",function(){function a(a,c){var d,e=a.location;d=e==b.PRE_SUBJECT&&"<"==c?b.WRITING_SUB_URI:e==b.PRE_SUBJECT&&"_"==c?b.WRITING_BNODE_URI:e==b.PRE_PRED&&"<"==c?b.WRITING_PRED_URI:e==b.PRE_OBJ&&"<"==c?b.WRITING_OBJ_URI:e==b.PRE_OBJ&&"_"==c?b.WRITING_OBJ_BNODE:e==b.PRE_OBJ&&'"'==c?b.WRITING_OBJ_LITERAL:e==b.WRITING_SUB_URI&&">"==c?b.PRE_PRED:e==b.WRITING_BNODE_URI&&" "==c?b.PRE_PRED:e==b.WRITING_PRED_URI&&">"==c?b.PRE_OBJ:e==b.WRITING_OBJ_URI&&">"==c?b.POST_OBJ:e==b.WRITING_OBJ_BNODE&&" "==c?b.POST_OBJ:e==b.WRITING_OBJ_LITERAL&&'"'==c?b.POST_OBJ:e==b.WRITING_LIT_LANG&&" "==c?b.POST_OBJ:e==b.WRITING_LIT_TYPE&&">"==c?b.POST_OBJ:e==b.WRITING_OBJ_LITERAL&&"@"==c?b.WRITING_LIT_LANG:e==b.WRITING_OBJ_LITERAL&&"^"==c?b.WRITING_LIT_TYPE:" "!=c||e!=b.PRE_SUBJECT&&e!=b.PRE_PRED&&e!=b.PRE_OBJ&&e!=b.POST_OBJ?e==b.POST_OBJ&&"."==c?b.PRE_SUBJECT:b.ERROR:e,a.location=d}var b={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};return{startState:function(){return{location:b.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(b,c){var d=b.next();if("<"==d){a(c,d);var e="";return b.eatWhile(function(a){return"#"!=a&&">"!=a?(e+=a,!0):!1}),c.uris.push(e),b.match("#",!1)?"variable":(b.next(),a(c,">"),"variable")}if("#"==d){var f="";return b.eatWhile(function(a){return">"!=a&&" "!=a?(f+=a,!0):!1}),c.anchors.push(f),"variable-2"}if(">"==d)return a(c,">"),"variable";if("_"==d){a(c,d);var g="";return b.eatWhile(function(a){return" "!=a?(g+=a,!0):!1}),c.bnodes.push(g),b.next(),a(c," "),"builtin"}if('"'==d)return a(c,d),b.eatWhile(function(a){return'"'!=a}),b.next(),"@"!=b.peek()&&"^"!=b.peek()&&a(c,'"'),"string";if("@"==d){a(c,"@");var h="";return b.eatWhile(function(a){return" "!=a?(h+=a,!0):!1}),c.langs.push(h),b.next(),a(c," "),"string-2"}if("^"==d){b.next(),a(c,"^");var i="";return b.eatWhile(function(a){return">"!=a?(i+=a,!0):!1}),c.types.push(i),b.next(),a(c,">"),"variable"}" "==d&&a(c,d),"."==d&&a(c,d)}}}),a.defineMIME("text/n-triples","ntriples")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/octave/octave.min.js b/media/editors/codemirror/mode/octave/octave.min.js -index 622383a..4525e3d 100644 ---- a/media/editors/codemirror/mode/octave/octave.min.js -+++ b/media/editors/codemirror/mode/octave/octave.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("octave",function(){function e(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e,n){return e.sol()||"'"!==e.peek()?(n.tokenize=r,r(e,n)):(e.next(),n.tokenize=r,"operator")}function t(e,n){return e.match(/^.*%}/)?(n.tokenize=r,"comment"):(e.skipToEnd(),"comment")}function r(d,p){if(d.eatSpace())return null;if(d.match("%{"))return p.tokenize=t,d.skipToEnd(),"comment";if(d.match(/^[%#]/))return d.skipToEnd(),"comment";if(d.match(/^[0-9\.+-]/,!1)){if(d.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return d.tokenize=r,"number";if(d.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/))return"number";if(d.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}return d.match(e(["nan","NaN","inf","Inf"]))?"number":d.match(/^"([^"]|(""))*"/)?"string":d.match(/^'([^']|(''))*'/)?"string":d.match(l)?"keyword":d.match(s)?"builtin":d.match(u)?"variable":d.match(i)||d.match(a)?"operator":d.match(o)||d.match(c)||d.match(m)?null:d.match(f)?(p.tokenize=n,null):(d.next(),"error")}var i=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),o=new RegExp("^[\\(\\[\\{\\},:=;]"),a=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),c=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),m=new RegExp("^((>>=)|(<<=))"),f=new RegExp("^[\\]\\)]"),u=new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*"),s=e(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),l=e(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);return{startState:function(){return{tokenize:r}},token:function(e,t){var r=t.tokenize(e,t);return("number"===r||"variable"===r)&&(t.tokenize=n),r}}}),e.defineMIME("text/x-octave","octave")}); -\ 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("octave",function(){function a(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function b(a,b){return a.sol()||"'"!==a.peek()?(b.tokenize=d,d(a,b)):(a.next(),b.tokenize=d,"operator")}function c(a,b){return a.match(/^.*%}/)?(b.tokenize=d,"comment"):(a.skipToEnd(),"comment")}function d(n,o){if(n.eatSpace())return null;if(n.match("%{"))return o.tokenize=c,n.skipToEnd(),"comment";if(n.match(/^[%#]/))return n.skipToEnd(),"comment";if(n.match(/^[0-9\.+-]/,!1)){if(n.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return n.tokenize=d,"number";if(n.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/))return"number";if(n.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}return n.match(a(["nan","NaN","inf","Inf"]))?"number":n.match(/^"([^"]|(""))*"/)?"string":n.match(/^'([^']|(''))*'/)?"string":n.match(m)?"keyword":n.match(l)?"builtin":n.match(k)?"variable":n.match(e)||n.match(g)?"operator":n.match(f)||n.match(h)||n.match(i)?null:n.match(j)?(o.tokenize=b,null):(n.next(),"error")}var e=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),f=new RegExp("^[\\(\\[\\{\\},:=;]"),g=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),h=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),i=new RegExp("^((>>=)|(<<=))"),j=new RegExp("^[\\]\\)]"),k=new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*"),l=a(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),m=a(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);return{startState:function(){return{tokenize:d}},token:function(a,c){var d=c.tokenize(a,c);return("number"===d||"variable"===d)&&(c.tokenize=b),d}}}),a.defineMIME("text/x-octave","octave")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/pascal/pascal.min.js b/media/editors/codemirror/mode/pascal/pascal.min.js -index a58c8bd..3291170 100644 ---- a/media/editors/codemirror/mode/pascal/pascal.min.js -+++ b/media/editors/codemirror/mode/pascal/pascal.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("pascal",function(){function e(e){for(var t={},r=e.split(" "),n=0;n!?|\/]/;return{startState:function(){return{tokenize:null}},token:function(e,r){if(e.eatSpace())return null;var n=(r.tokenize||t)(e,r);return"comment"==n||"meta"==n?n:n},electricChars:"{}"}}),e.defineMIME("text/x-pascal","pascal")}); -\ 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("pascal",function(){function a(a){for(var b={},c=a.split(" "),d=0;d!?|\/]/;return{startState:function(){return{tokenize:null}},token:function(a,c){if(a.eatSpace())return null;var d=(c.tokenize||b)(a,c);return"comment"==d||"meta"==d?d:d},electricChars:"{}"}}),a.defineMIME("text/x-pascal","pascal")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/pegjs/pegjs.min.js b/media/editors/codemirror/mode/pegjs/pegjs.min.js -index af0359e..4e2ab05 100644 ---- a/media/editors/codemirror/mode/pegjs/pegjs.min.js -+++ b/media/editors/codemirror/mode/pegjs/pegjs.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("pegjs",function(t){function n(e){return e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)}var r=e.getMode(t,"javascript");return{startState:function(){return{inString:!1,stringType:null,inComment:!1,inChracterClass:!1,braced:0,lhs:!0,localState:null}},token:function(e,t){if(e&&(t.inString||t.inComment||'"'!=e.peek()&&"'"!=e.peek()||(t.stringType=e.peek(),e.next(),t.inString=!0)),t.inString||t.inComment||!e.match(/^\/\*/)||(t.inComment=!0),t.inString){for(;t.inString&&!e.eol();)e.peek()===t.stringType?(e.next(),t.inString=!1):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string"}if(t.inComment){for(;t.inComment&&!e.eol();)e.match(/\*\//)?t.inComment=!1:e.match(/^.[^\*]*/);return"comment"}if(t.inChracterClass)for(;t.inChracterClass&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(/^\\./)||(t.inChracterClass=!1);else{if("["===e.peek())return e.next(),t.inChracterClass=!0,"bracket";if(e.match(/^\/\//))return e.skipToEnd(),"comment";if(t.braced||"{"===e.peek()){null===t.localState&&(t.localState=r.startState());var i=r.token(e,t.localState),a=e.current();if(!i)for(var o=0;o=0?r:0,t)}return e.string.substr(0,e.pos-1)}function n(e,t){var r=e.string.length,n=r-e.pos+1;return e.string.substr(e.pos,t&&r>t?t:n)}function i(e,t){var r,n=e.pos+t;e.pos=0>=n?0:n>=(r=e.string.length-1)?r:n}e.defineMode("perl",function(){function e(e,t,r,n,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var s,o=!1,u=0;s=e.next();){if(s===r[u]&&!o)return void 0!==r[++u]?(t.chain=r[u],t.style=n,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,n;o=!o&&"\\"==s}return n},t.tokenize(e,t)}function s(e,t,r){return t.tokenize=function(e,t){return e.string==r&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,l){if(a.eatSpace())return null;if(l.chain)return e(a,l,l.chain,l.style,l.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),s(a,l,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return s(a,l,"=cut");var f=a.next();if('"'==f||"'"==f){if(r(a,3)=="<<"+f){var E=a.pos;a.eatWhile(/\w/);var R=a.current().substr(1);if(R&&a.eat(f))return s(a,l,R);a.pos=E}return e(a,l,[f],"string")}if("q"==f){var c=t(a,-2);if(!c||!/\w/.test(c))if(c=t(a,0),"x"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],u,$);if("["==c)return i(a,2),e(a,l,["]"],u,$);if("{"==c)return i(a,2),e(a,l,["}"],u,$);if("<"==c)return i(a,2),e(a,l,[">"],u,$);if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],u,$)}else if("q"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],"string");if("["==c)return i(a,2),e(a,l,["]"],"string");if("{"==c)return i(a,2),e(a,l,["}"],"string");if("<"==c)return i(a,2),e(a,l,[">"],"string");if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],"string")}else if("w"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],"bracket");if("["==c)return i(a,2),e(a,l,["]"],"bracket");if("{"==c)return i(a,2),e(a,l,["}"],"bracket");if("<"==c)return i(a,2),e(a,l,[">"],"bracket");if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],"bracket")}else if("r"==c){if(c=t(a,1),"("==c)return i(a,2),e(a,l,[")"],u,$);if("["==c)return i(a,2),e(a,l,["]"],u,$);if("{"==c)return i(a,2),e(a,l,["}"],u,$);if("<"==c)return i(a,2),e(a,l,[">"],u,$);if(/[\^'"!~\/]/.test(c))return i(a,1),e(a,l,[a.eat(c)],u,$)}else if(/[\^'"!~\/(\[{<]/.test(c)){if("("==c)return i(a,1),e(a,l,[")"],"string");if("["==c)return i(a,1),e(a,l,["]"],"string");if("{"==c)return i(a,1),e(a,l,["}"],"string");if("<"==c)return i(a,1),e(a,l,[">"],"string");if(/[\^'"!~\/]/.test(c))return e(a,l,[a.eat(c)],"string")}}if("m"==f){var c=t(a,-2);if((!c||!/\w/.test(c))&&(c=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(c))return e(a,l,[c],u,$);if("("==c)return e(a,l,[")"],u,$);if("["==c)return e(a,l,["]"],u,$);if("{"==c)return e(a,l,["}"],u,$);if("<"==c)return e(a,l,[">"],u,$)}}if("s"==f){var c=/[\/>\]})\w]/.test(t(a,-2));if(!c&&(c=a.eat(/[(\[{<\^'"!~\/]/)))return"["==c?e(a,l,["]","]"],u,$):"{"==c?e(a,l,["}","}"],u,$):"<"==c?e(a,l,[">",">"],u,$):"("==c?e(a,l,[")",")"],u,$):e(a,l,[c,c],u,$)}if("y"==f){var c=/[\/>\]})\w]/.test(t(a,-2));if(!c&&(c=a.eat(/[(\[{<\^'"!~\/]/)))return"["==c?e(a,l,["]","]"],u,$):"{"==c?e(a,l,["}","}"],u,$):"<"==c?e(a,l,[">",">"],u,$):"("==c?e(a,l,[")",")"],u,$):e(a,l,[c,c],u,$)}if("t"==f){var c=/[\/>\]})\w]/.test(t(a,-2));if(!c&&(c=a.eat("r"),c&&(c=a.eat(/[(\[{<\^'"!~\/]/))))return"["==c?e(a,l,["]","]"],u,$):"{"==c?e(a,l,["}","}"],u,$):"<"==c?e(a,l,[">",">"],u,$):"("==c?e(a,l,[")",")"],u,$):e(a,l,[c,c],u,$)}if("`"==f)return e(a,l,[f],"variable-2");if("/"==f)return/~\s*$/.test(r(a))?e(a,l,[f],u,$):"operator";if("$"==f){var E=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=E}if(/[$@%]/.test(f)){var E=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(t(a,-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var c=a.current();if(o[c])return"variable-2"}a.pos=E}if(/[$@%&]/.test(f)&&(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}"))){var c=a.current();return o[c]?"variable-2":"variable"}if("#"==f&&"$"!=t(a,-2))return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(f)){var E=a.pos;if(a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),o[a.current()])return"operator";a.pos=E}if("_"==f&&1==a.pos){if("_END__"==n(a,6))return e(a,l,["\x00"],"comment");if("_DATA__"==n(a,7))return e(a,l,["\x00"],"variable-2");if("_C__"==n(a,7))return e(a,l,["\x00"],"string")}if(/\w/.test(f)){var E=a.pos;if("{"==t(a,-2)&&("}"==t(a,0)||a.eatWhile(/\w/)&&"}"==t(a,0)))return"string";a.pos=E}if(/[A-Z]/.test(f)){var p=t(a,-2),E=a.pos;if(a.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(a,0))){var c=o[a.current()];return c?(c[1]&&(c=c[0]),":"!=p?1==c?"keyword":2==c?"def":3==c?"atom":4==c?"operator":5==c?"variable-2":"meta":"meta"):"meta"}a.pos=E}if(/[a-zA-Z_]/.test(f)){var p=t(a,-2);a.eatWhile(/\w/);var c=o[a.current()];return c?(c[1]&&(c=c[0]),":"!=p?1==c?"keyword":2==c?"def":3==c?"atom":4==c?"operator":5==c?"variable-2":"meta":"meta"):"meta"}return null}var o={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},u="string-2",$=/[goseximacplud]/;return{startState:function(){return{tokenize:a,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||a)(e,t)},lineComment:"#"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}); -\ 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.string.charAt(a.pos+(b||0))}function c(a,b){if(b){var c=a.pos-b;return a.string.substr(c>=0?c:0,b)}return a.string.substr(0,a.pos-1)}function d(a,b){var c=a.string.length,d=c-a.pos+1;return a.string.substr(a.pos,b&&c>b?b:d)}function e(a,b){var c,d=a.pos+b;0>=d?a.pos=0:d>=(c=a.string.length-1)?a.pos=c:a.pos=d}a.defineMode("perl",function(){function a(a,b,c,d,e){return b.chain=null,b.style=null,b.tail=null,b.tokenize=function(a,b){for(var f,h=!1,i=0;f=a.next();){if(f===c[i]&&!h)return void 0!==c[++i]?(b.chain=c[i],b.style=d,b.tail=e):e&&a.eatWhile(e),b.tokenize=g,d;h=!h&&"\\"==f}return d},b.tokenize(a,b)}function f(a,b,c){return b.tokenize=function(a,b){return a.string==c&&(b.tokenize=g),a.skipToEnd(),"string"},b.tokenize(a,b)}function g(g,k){if(g.eatSpace())return null;if(k.chain)return a(g,k,k.chain,k.style,k.tail);if(g.match(/^\-?[\d\.]/,!1)&&g.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(g.match(/^<<(?=\w)/))return g.eatWhile(/\w/),f(g,k,g.current().substr(2));if(g.sol()&&g.match(/^\=item(?!\w)/))return f(g,k,"=cut");var l=g.next();if('"'==l||"'"==l){if(c(g,3)=="<<"+l){var m=g.pos;g.eatWhile(/\w/);var n=g.current().substr(1);if(n&&g.eat(l))return f(g,k,n);g.pos=m}return a(g,k,[l],"string")}if("q"==l){var o=b(g,-2);if(!o||!/\w/.test(o))if(o=b(g,0),"x"==o){if(o=b(g,1),"("==o)return e(g,2),a(g,k,[")"],i,j);if("["==o)return e(g,2),a(g,k,["]"],i,j);if("{"==o)return e(g,2),a(g,k,["}"],i,j);if("<"==o)return e(g,2),a(g,k,[">"],i,j);if(/[\^'"!~\/]/.test(o))return e(g,1),a(g,k,[g.eat(o)],i,j)}else if("q"==o){if(o=b(g,1),"("==o)return e(g,2),a(g,k,[")"],"string");if("["==o)return e(g,2),a(g,k,["]"],"string");if("{"==o)return e(g,2),a(g,k,["}"],"string");if("<"==o)return e(g,2),a(g,k,[">"],"string");if(/[\^'"!~\/]/.test(o))return e(g,1),a(g,k,[g.eat(o)],"string")}else if("w"==o){if(o=b(g,1),"("==o)return e(g,2),a(g,k,[")"],"bracket");if("["==o)return e(g,2),a(g,k,["]"],"bracket");if("{"==o)return e(g,2),a(g,k,["}"],"bracket");if("<"==o)return e(g,2),a(g,k,[">"],"bracket");if(/[\^'"!~\/]/.test(o))return e(g,1),a(g,k,[g.eat(o)],"bracket")}else if("r"==o){if(o=b(g,1),"("==o)return e(g,2),a(g,k,[")"],i,j);if("["==o)return e(g,2),a(g,k,["]"],i,j);if("{"==o)return e(g,2),a(g,k,["}"],i,j);if("<"==o)return e(g,2),a(g,k,[">"],i,j);if(/[\^'"!~\/]/.test(o))return e(g,1),a(g,k,[g.eat(o)],i,j)}else if(/[\^'"!~\/(\[{<]/.test(o)){if("("==o)return e(g,1),a(g,k,[")"],"string");if("["==o)return e(g,1),a(g,k,["]"],"string");if("{"==o)return e(g,1),a(g,k,["}"],"string");if("<"==o)return e(g,1),a(g,k,[">"],"string");if(/[\^'"!~\/]/.test(o))return a(g,k,[g.eat(o)],"string")}}if("m"==l){var o=b(g,-2);if((!o||!/\w/.test(o))&&(o=g.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(o))return a(g,k,[o],i,j);if("("==o)return a(g,k,[")"],i,j);if("["==o)return a(g,k,["]"],i,j);if("{"==o)return a(g,k,["}"],i,j);if("<"==o)return a(g,k,[">"],i,j)}}if("s"==l){var o=/[\/>\]})\w]/.test(b(g,-2));if(!o&&(o=g.eat(/[(\[{<\^'"!~\/]/)))return"["==o?a(g,k,["]","]"],i,j):"{"==o?a(g,k,["}","}"],i,j):"<"==o?a(g,k,[">",">"],i,j):"("==o?a(g,k,[")",")"],i,j):a(g,k,[o,o],i,j)}if("y"==l){var o=/[\/>\]})\w]/.test(b(g,-2));if(!o&&(o=g.eat(/[(\[{<\^'"!~\/]/)))return"["==o?a(g,k,["]","]"],i,j):"{"==o?a(g,k,["}","}"],i,j):"<"==o?a(g,k,[">",">"],i,j):"("==o?a(g,k,[")",")"],i,j):a(g,k,[o,o],i,j)}if("t"==l){var o=/[\/>\]})\w]/.test(b(g,-2));if(!o&&(o=g.eat("r"),o&&(o=g.eat(/[(\[{<\^'"!~\/]/))))return"["==o?a(g,k,["]","]"],i,j):"{"==o?a(g,k,["}","}"],i,j):"<"==o?a(g,k,[">",">"],i,j):"("==o?a(g,k,[")",")"],i,j):a(g,k,[o,o],i,j)}if("`"==l)return a(g,k,[l],"variable-2");if("/"==l)return/~\s*$/.test(c(g))?a(g,k,[l],i,j):"operator";if("$"==l){var m=g.pos;if(g.eatWhile(/\d/)||g.eat("{")&&g.eatWhile(/\d/)&&g.eat("}"))return"variable-2";g.pos=m}if(/[$@%]/.test(l)){var m=g.pos;if(g.eat("^")&&g.eat(/[A-Z]/)||!/[@$%&]/.test(b(g,-2))&&g.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var o=g.current();if(h[o])return"variable-2"}g.pos=m}if(/[$@%&]/.test(l)&&(g.eatWhile(/[\w$\[\]]/)||g.eat("{")&&g.eatWhile(/[\w$\[\]]/)&&g.eat("}"))){var o=g.current();return h[o]?"variable-2":"variable"}if("#"==l&&"$"!=b(g,-2))return g.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(l)){var m=g.pos;if(g.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),h[g.current()])return"operator";g.pos=m}if("_"==l&&1==g.pos){if("_END__"==d(g,6))return a(g,k,["\x00"],"comment");if("_DATA__"==d(g,7))return a(g,k,["\x00"],"variable-2");if("_C__"==d(g,7))return a(g,k,["\x00"],"string")}if(/\w/.test(l)){var m=g.pos;if("{"==b(g,-2)&&("}"==b(g,0)||g.eatWhile(/\w/)&&"}"==b(g,0)))return"string";g.pos=m}if(/[A-Z]/.test(l)){var p=b(g,-2),m=g.pos;if(g.eatWhile(/[A-Z_]/),!/[\da-z]/.test(b(g,0))){var o=h[g.current()];return o?(o[1]&&(o=o[0]),":"!=p?1==o?"keyword":2==o?"def":3==o?"atom":4==o?"operator":5==o?"variable-2":"meta":"meta"):"meta"}g.pos=m}if(/[a-zA-Z_]/.test(l)){var p=b(g,-2);g.eatWhile(/\w/);var o=h[g.current()];return o?(o[1]&&(o=o[0]),":"!=p?1==o?"keyword":2==o?"def":3==o?"atom":4==o?"operator":5==o?"variable-2":"meta":"meta"):"meta"}return null}var h={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},i="string-2",j=/[goseximacplud]/;return{startState:function(){return{tokenize:g,chain:null,style:null,tail:null}},token:function(a,b){return(b.tokenize||g)(a,b)},lineComment:"#"}}),a.registerHelper("wordChars","perl",/[\w$]/),a.defineMIME("text/x-perl","perl")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/php/php.js b/media/editors/codemirror/mode/php/php.js -index e112d91..1c62eb4 100644 ---- a/media/editors/codemirror/mode/php/php.js -+++ b/media/editors/codemirror/mode/php/php.js -@@ -94,6 +94,7 @@ - helperType: "php", - keywords: keywords(phpKeywords), - blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"), -+ defKeywords: keywords("class function interface namespace trait"), - atoms: keywords(phpAtoms), - builtin: keywords(phpBuiltin), - multiLineStrings: true, -diff --git a/media/editors/codemirror/mode/php/php.min.js b/media/editors/codemirror/mode/php/php.min.js -index 9e87aa4..bedd3d6 100644 ---- a/media/editors/codemirror/mode/php/php.min.js -+++ b/media/editors/codemirror/mode/php/php.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},_=e.split(" "),r=0;r<_.length;++r)t[_[r]]=!0;return t}function _(e,t){return 0==e.length?r(t):function(s,i){for(var l=e[0],n=0;n\w/,!1)&&(t.tokenize=_([[["->",null]],[[/[\w]+/,"variable"]]],r)),"variable-2";for(var s=!1;!e.eol()&&(s||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!s&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}s="\\"==e.next()&&!s}return"string"}var i="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",l="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",n="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[i,l,n].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var a={name:"clike",helperType:"php",keywords:t(i),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),atoms:t(l),builtin:t(n),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){if(e.match(/<",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,_){function r(e,t){var _=t.curMode==i;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),_)return _&&null==t.php.tokenize&&e.match("?>")?(t.curMode=s,t.curState=t.html,"meta"):i.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=i,t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var r="string"}else if(t.pending&&e.pos/.test(n)?l[0]:{end:e.pos,style:r},e.backUp(n.length-a)),r}var s=e.getMode(t,"text/html"),i=e.getMode(t,a);return{startState:function(){var t=e.startState(s),r=e.startState(i);return{html:t,php:r,curMode:_.startOpen?i:s,curState:_.startOpen?r:t,pending:null}},copyState:function(t){var _,r=t.html,l=e.copyState(s,r),n=t.php,a=e.copyState(i,n);return _=t.curMode==s?l:a,{html:l,php:a,curMode:t.curMode,curState:_,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=i&&/^\s*<\//.test(t)||e.curMode==i&&/^\?>/.test(t)?s.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",a)}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d\w/,!1)&&(b.tokenize=c([[["->",null]],[[/[\w]+/,"variable"]]],d)),"variable-2";for(var e=!1;!a.eol()&&(e||!a.match("{$",!1)&&!a.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!e&&a.match(d)){b.tokenize=null,b.tokStack.pop(),b.tokStack.pop();break}e="\\"==a.next()&&!e}return"string"}var f="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",g="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",h="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";a.registerHelper("hintWords","php",[f,g,h].join(" ").split(" ")),a.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:b(f),blockKeywords:b("catch do else elseif for foreach if switch try while finally"),defKeywords:b("class function interface namespace trait"),atoms:b(g),builtin:b(h),multiLineStrings:!0,hooks:{$:function(a){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,b){if(a.match(/<",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1},'"':function(a,b){return(b.tokStack||(b.tokStack=[])).push('"',0),b.tokenize=d('"'),"string"},"{":function(a,b){return b.tokStack&&b.tokStack.length&&b.tokStack[b.tokStack.length-1]++,!1},"}":function(a,b){return b.tokStack&&b.tokStack.length>0&&!--b.tokStack[b.tokStack.length-1]&&(b.tokenize=d(b.tokStack[b.tokStack.length-2])),!1}}};a.defineMode("php",function(b,c){function d(a,b){var c=b.curMode==f;if(a.sol()&&b.pending&&'"'!=b.pending&&"'"!=b.pending&&(b.pending=null),c)return c&&null==b.php.tokenize&&a.match("?>")?(b.curMode=e,b.curState=b.html,"meta"):f.token(a,b.curState);if(a.match(/^<\?\w*/))return b.curMode=f,b.curState=b.php,"meta";if('"'==b.pending||"'"==b.pending){for(;!a.eol()&&a.next()!=b.pending;);var d="string"}else if(b.pending&&a.pos/.test(h)?b.pending=g[0]:b.pending={end:a.pos,style:d},a.backUp(h.length-i)),d}var e=a.getMode(b,"text/html"),f=a.getMode(b,i);return{startState:function(){var b=a.startState(e),d=a.startState(f);return{html:b,php:d,curMode:c.startOpen?f:e,curState:c.startOpen?d:b,pending:null}},copyState:function(b){var c,d=b.html,g=a.copyState(e,d),h=b.php,i=a.copyState(f,h);return c=b.curMode==e?g:i,{html:g,php:i,curMode:b.curMode,curState:c,pending:b.pending}},token:d,indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?e.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",i)}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/php/test.js b/media/editors/codemirror/mode/php/test.js -deleted file mode 100644 -index e2ecefc..0000000 ---- a/media/editors/codemirror/mode/php/test.js -+++ /dev/null -@@ -1,154 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({indentUnit: 2}, "php"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- -- MT('simple_test', -- '[meta ]'); -- -- MT('variable_interpolation_non_alphanumeric', -- '[meta $/$\\$}$\\\"$:$;$?$|$[[$]]$+$=aaa"]', -- '[meta ?>]'); -- -- MT('variable_interpolation_digits', -- '[meta ]'); -- -- MT('variable_interpolation_simple_syntax_1', -- '[meta ]'); -- -- MT('variable_interpolation_simple_syntax_2', -- '[meta ]'); -- -- MT('variable_interpolation_simple_syntax_3', -- '[meta [variable aaaaa][string .aaaaaa"];', -- '[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];', -- '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];', -- '[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];', -- '[meta ?>]'); -- -- MT('variable_interpolation_escaping', -- '[meta aaa.aaa"];', -- '[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];', -- '[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];', -- '[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];', -- '[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];', -- '[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];', -- '[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];', -- '[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];', -- '[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];', -- '[meta ?>]'); -- -- MT('variable_interpolation_complex_syntax_1', -- '[meta aaa.aaa"];', -- '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];', -- '[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][[',' [number 42]',']]}[string ->aaa.aaa"];', -- '[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa'); -- -- MT('variable_interpolation_complex_syntax_2', -- '[meta } $aaaaaa.aaa"];', -- '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];', -- '[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];'); -- -- -- function build_recursive_monsters(nt, t, n){ -- var monsters = [t]; -- for (var i = 1; i <= n; ++i) -- monsters[i] = nt.join(monsters[i - 1]); -- return monsters; -- } -- -- var m1 = build_recursive_monsters( -- ['[string "][variable-2 $]{[variable aaa] [operator +] ', '}[string "]'], -- '[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]', -- 10 -- ); -- -- MT('variable_interpolation_complex_syntax_3_1', -- '[meta ]'); -- -- var m2 = build_recursive_monsters( -- ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', '}[string .a"]'], -- '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', -- 5 -- ); -- -- MT('variable_interpolation_complex_syntax_3_2', -- '[meta ]'); -- -- function build_recursive_monsters_2(mf1, mf2, nt, t, n){ -- var monsters = [t]; -- for (var i = 1; i <= n; ++i) -- monsters[i] = nt[0] + mf1[i - 1] + nt[1] + mf2[i - 1] + nt[2] + monsters[i - 1] + nt[3]; -- return monsters; -- } -- -- var m3 = build_recursive_monsters_2( -- m1, -- m2, -- ['[string "a][variable-2 $]{[variable aaa] [operator +] ', ' [operator +] ', ' [operator +] ', '}[string .a"]'], -- '[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]', -- 4 -- ); -- -- MT('variable_interpolation_complex_syntax_3_3', -- '[meta ]'); -- -- MT("variable_interpolation_heredoc", -- "[meta =i;++i)o[i]=a.join(o[i-1]);return o}function r(a,e,r,o,i){for(var t=[o],n=1;i>=n;++n)t[n]=r[0]+a[n-1]+r[1]+e[n-1]+r[2]+t[n-1]+r[3];return t}var o=CodeMirror.getMode({indentUnit:2},"php");a("simple_test",'[meta ]'),a("variable_interpolation_non_alphanumeric","[meta $/$\\$}$\\"$:$;$?$|$[[$]]$+$=aaa"]',"[meta ?>]"),a("variable_interpolation_digits","[meta ]"),a("variable_interpolation_simple_syntax_1","[meta ]"),a("variable_interpolation_simple_syntax_2","[meta ]"),a("variable_interpolation_simple_syntax_3","[meta [variable aaaaa][string .aaaaaa"];','[keyword echo] [string "aaa][variable-2 $aaaa][string ->][variable-2 $aaaaa][string .aaaaaa"];','[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string [[2]].aaaaaa"];','[keyword echo] [string "aaa][variable-2 $aaaa]->[variable aaaaa][string ->aaaa2.aaaaaa"];',"[meta ?>]"),a("variable_interpolation_escaping","[meta aaa.aaa"];','[keyword echo] [string "aaa\\$aaaa[[2]]aaa.aaa"];','[keyword echo] [string "aaa\\$aaaa[[asd]]aaa.aaa"];','[keyword echo] [string "aaa{\\$aaaa->aaa.aaa"];','[keyword echo] [string "aaa{\\$aaaa[[2]]aaa.aaa"];','[keyword echo] [string "aaa{\\aaaaa[[asd]]aaa.aaa"];','[keyword echo] [string "aaa\\${aaaa->aaa.aaa"];','[keyword echo] [string "aaa\\${aaaa[[2]]aaa.aaa"];','[keyword echo] [string "aaa\\${aaaa[[asd]]aaa.aaa"];',"[meta ?>]"),a("variable_interpolation_complex_syntax_1","[meta aaa.aaa"];','[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa]}[string ->aaa.aaa"];','[keyword echo] [string "aaa][variable-2 $]{[variable-2 $aaaa][['," [number 42]",']]}[string ->aaa.aaa"];','[keyword echo] [string "aaa][variable-2 $]{[variable aaaa][meta ?>]aaaaaa'),a("variable_interpolation_complex_syntax_2","[meta } $aaaaaa.aaa"];','[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*}?>*/][[',' [string "aaa][variable-2 $aaa][string {}][variable-2 $]{[variable aaa]}[string "]',']]}[string ->aaa.aaa"];','[keyword echo] [string "][variable-2 $]{[variable aaa][comment /*} } $aaa } */]}[string ->aaa.aaa"];');var i=e(['[string "][variable-2 $]{[variable aaa] [operator +] ','}[string "]'],'[comment /* }?>} */] [string "aaa][variable-2 $aaa][string .aaa"]',10);a("variable_interpolation_complex_syntax_3_1","[meta ]");var t=e(['[string "a][variable-2 $]{[variable aaa] [operator +] '," [operator +] ",'}[string .a"]'],'[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]',5);a("variable_interpolation_complex_syntax_3_2","[meta ]");var n=r(i,t,['[string "a][variable-2 $]{[variable aaa] [operator +] '," [operator +] "," [operator +] ",'}[string .a"]'],'[comment /* }?>{{ */] [string "a?>}{{aa][variable-2 $aaa][string .a}a?>a"]',4);a("variable_interpolation_complex_syntax_3_3","[meta ]"),a("variable_interpolation_heredoc","[meta =&?:\/!|]/;return{startState:function(){return{tokenize:I,startOfLine:!0}},token:function(e,O){if(e.eatSpace())return null;var T=O.tokenize(e,O);return T}}}),function(){function O(e){for(var O={},T=e.split(" "),E=0;E=&?:\/!|]/;return{startState:function(){return{tokenize:f,startOfLine:!0}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c}}}),function(){function b(a){for(var b={},c=a.split(" "),d=0;d.*/,!1),s=e.match(/(\s+)?[\w:_]+(\s+)?{/,!1),c=e.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/,!1),u=e.next();if("$"===u)return e.match(o)?t.continueString?"variable-2":"variable":"error";if(t.continueString)return e.backUp(1),n(e,t);if(t.inDefinition){if(e.match(/(\s+)?[\w:_]+(\s+)?/))return"def";e.match(/\s+{/),t.inDefinition=!1}return t.inInclude?(e.match(/(\s+)?\S+(\s+)?/),t.inInclude=!1,"def"):e.match(/(\s+)?\w+\(/)?(e.backUp(1),"def"):r?(e.match(/(\s+)?\w+/),"tag"):a&&i.hasOwnProperty(a)?(e.backUp(1),e.match(/[\w]+/),e.match(/\s+\S+\s+{/,!1)&&(t.inDefinition=!0),"include"==a&&(t.inInclude=!0),i[a]):/(^|\s+)[A-Z][\w:_]+/.test(a)?(e.backUp(1),e.match(/(^|\s+)[A-Z][\w:_]+/),"def"):s?(e.match(/(\s+)?[\w:_]+/),"def"):c?(e.match(/(\s+)?[@]{1,2}/),"special"):"#"==u?(e.skipToEnd(),"comment"):"'"==u||'"'==u?(t.pending=u,n(e,t)):"{"==u||"}"==u?"bracket":"/"==u?(e.match(/.*?\//),"variable-3"):u.match(/[0-9]/)?(e.eatWhile(/[0-9]+/),"number"):"="==u?(">"==e.peek()&&e.next(),"operator"):(e.eatWhile(/[\w-]/),null)}var i={},o=/({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;return e("keyword","class define site node include import inherits"),e("keyword","case if else in and elsif default or"),e("atom","false true running present absent file directory undef"),e("builtin","action augeas burst chain computer cron destination dport exec file filebucket group host icmp iniface interface jump k5login limit log_level log_prefix macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod name notify outiface package proto reject resources router schedule scheduled_task selboolean selmodule service source sport ssh_authorized_key sshkey stage state table tidy todest toports tosource user vlan yumrepo zfs zone zpool"),{startState:function(){var e={};return e.inDefinition=!1,e.inInclude=!1,e.continueString=!1,e.pending=!1,e},token:function(e,n){return e.eatSpace()?null:t(e,n)}}}),e.defineMIME("text/x-puppet","puppet")}); -\ 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("puppet",function(){function a(a,b){for(var c=b.split(" "),e=0;e.*/,!1),h=a.match(/(\s+)?[\w:_]+(\s+)?{/,!1),i=a.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/,!1),j=a.next();if("$"===j)return a.match(e)?c.continueString?"variable-2":"variable":"error";if(c.continueString)return a.backUp(1),b(a,c);if(c.inDefinition){if(a.match(/(\s+)?[\w:_]+(\s+)?/))return"def";a.match(/\s+{/),c.inDefinition=!1}return c.inInclude?(a.match(/(\s+)?\S+(\s+)?/),c.inInclude=!1,"def"):a.match(/(\s+)?\w+\(/)?(a.backUp(1),"def"):g?(a.match(/(\s+)?\w+/),"tag"):f&&d.hasOwnProperty(f)?(a.backUp(1),a.match(/[\w]+/),a.match(/\s+\S+\s+{/,!1)&&(c.inDefinition=!0),"include"==f&&(c.inInclude=!0),d[f]):/(^|\s+)[A-Z][\w:_]+/.test(f)?(a.backUp(1),a.match(/(^|\s+)[A-Z][\w:_]+/),"def"):h?(a.match(/(\s+)?[\w:_]+/),"def"):i?(a.match(/(\s+)?[@]{1,2}/),"special"):"#"==j?(a.skipToEnd(),"comment"):"'"==j||'"'==j?(c.pending=j,b(a,c)):"{"==j||"}"==j?"bracket":"/"==j?(a.match(/.*?\//),"variable-3"):j.match(/[0-9]/)?(a.eatWhile(/[0-9]+/),"number"):"="==j?(">"==a.peek()&&a.next(),"operator"):(a.eatWhile(/[\w-]/),null)}var d={},e=/({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;return a("keyword","class define site node include import inherits"),a("keyword","case if else in and elsif default or"),a("atom","false true running present absent file directory undef"),a("builtin","action augeas burst chain computer cron destination dport exec file filebucket group host icmp iniface interface jump k5login limit log_level log_prefix macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod name notify outiface package proto reject resources router schedule scheduled_task selboolean selmodule service source sport ssh_authorized_key sshkey stage state table tidy todest toports tosource user vlan yumrepo zfs zone zpool"),{startState:function(){var a={};return a.inDefinition=!1,a.inInclude=!1,a.continueString=!1,a.pending=!1,a},token:function(a,b){return a.eatSpace()?null:c(a,b)}}}),a.defineMIME("text/x-puppet","puppet")}); -\ 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 98c0409..cdb58bb 100644 ---- a/media/editors/codemirror/mode/python/python.js -+++ b/media/editors/codemirror/mode/python/python.js -@@ -162,15 +162,13 @@ - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) - return null; - -- if (stream.match(doubleOperators) -- || stream.match(singleOperators) -- || stream.match(wordOperators)) -+ if (stream.match(doubleOperators) || stream.match(singleOperators)) - return "operator"; - - if (stream.match(singleDelimiters)) - return null; - -- if (stream.match(keywords)) -+ if (stream.match(keywords) || stream.match(wordOperators)) - return "keyword"; - - if (stream.match(builtins)) -@@ -339,6 +337,7 @@ - return scope.offset; - }, - -+ closeBrackets: {triples: "'\""}, - lineComment: "#", - fold: "indent" - }; -diff --git a/media/editors/codemirror/mode/python/python.min.js b/media/editors/codemirror/mode/python/python.min.js -index 76d5058..c8bed71 100644 ---- a/media/editors/codemirror/mode/python/python.min.js -+++ b/media/editors/codemirror/mode/python/python.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e){return e.scopes[e.scopes.length-1]}var r=t(["and","or","not","is"]),i=["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"],a=["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__"],o={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},s={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};e.registerHelper("hintWords","python",i.concat(a)),e.defineMode("python",function(l,c){function p(e,t){if(e.sol()&&"py"==n(t).type){var r=n(t).offset;if(e.eatSpace()){var i=e.indentation();return i>r?d(e,t,"py"):r>i&&m(e,t)&&(t.errorToken=!0),null}var a=u(e,t);return r>0&&m(e,t)&&(a+=" "+h),a}return u(e,t)}function u(e,t){if(e.eatSpace())return null;var n=e.peek();if("#"==n)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var a=!1;if(e.match(/^0x[0-9a-f]+/i)&&(a=!0),e.match(/^0b[01]+/i)&&(a=!0),e.match(/^0o[0-7]+/i)&&(a=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),a=!0),e.match(/^0(?![\dx])/i)&&(a=!0),a)return e.eat(/L/i),"number"}return e.match(R)?(t.tokenize=f(e.current()),t.tokenize(e,t)):e.match(x)||e.match(v)?null:e.match(g)||e.match(k)||e.match(r)?"operator":e.match(b)?null:e.match(S)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(w)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),h)}function f(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=p,r;t.eat(/['"]/)}if(n){if(c.singleLineStringErrors)return h;i.tokenize=p}return r}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function d(e,t,r){var i=0,a=null;if("py"==r)for(;"py"!=n(t).type;)t.scopes.pop();i=n(t).offset+("py"==r?l.indentUnit:E),"py"==r||e.match(/^(\s|#.*)*$/,!1)||(a=e.column()+1),t.scopes.push({offset:i,type:r,align:a})}function m(e,t){for(var r=e.indentation();n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function y(e,t){var r=t.tokenize(e,t),i=e.current();if("."==i)return r=e.match(w,!1)?null:h,null==r&&"meta"==t.lastStyle&&(r="meta"),r;if("@"==i)return c.version&&3==parseInt(c.version,10)?e.match(w,!1)?"meta":"operator":e.match(w,!1)?"meta":h;"variable"!=r&&"builtin"!=r||"meta"!=t.lastStyle||(r="meta"),("pass"==i||"return"==i)&&(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||d(e,t,"py");var a=1==i.length?"[({".indexOf(i):-1;if(-1!=a&&d(e,t,"])}".slice(a,a+1)),a="])}".indexOf(i),-1!=a){if(n(t).type!=i)return h;t.scopes.pop()}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var h="error",b=c.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),g=c.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),v=c.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),x=c.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(c.version&&3==parseInt(c.version,10))var k=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"),w=c.identifiers||new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*");else var k=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),w=c.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*");var E=c.hangingIndent||l.indentUnit,_=i,z=a;if(void 0!=c.extra_keywords&&(_=_.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(z=z.concat(c.extra_builtins)),c.version&&3==parseInt(c.version,10)){_=_.concat(s.keywords),z=z.concat(s.builtins);var R=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{_=_.concat(o.keywords),z=z.concat(o.builtins);var R=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var S=t(_),T=t(z),I={startState:function(e){return{tokenize:p,scopes:[{offset:e||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=y(e,t);t.lastStyle=r;var i=e.current();return i&&r&&(t.lastToken=i),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+h:r},indent:function(t,r){if(t.tokenize!=p)return t.tokenize.isString?e.Pass:0;var i=n(t),a=r&&r.charAt(0)==i.type;return null!=i.align?i.align-(a?1:0):a&&t.scopes.length>1?t.scopes[t.scopes.length-2].offset:i.offset},lineComment:"#",fold:"indent"};return I}),e.defineMIME("text/x-python","python");var l=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:l("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}); -\ 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){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__"],g={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},h={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};a.registerHelper("hintWords","python",e.concat(f)),a.defineMode("python",function(i,j){function k(a,b){if(a.sol()&&"py"==c(b).type){var d=c(b).offset;if(a.eatSpace()){var e=a.indentation();return e>d?n(a,b,"py"):d>e&&o(a,b)&&(b.errorToken=!0),null}var f=l(a,b);return d>0&&o(a,b)&&(f+=" "+q),f}return l(a,b)}function l(a,b){if(a.eatSpace())return null;var c=a.peek();if("#"==c)return a.skipToEnd(),"comment";if(a.match(/^[0-9\.]/,!1)){var e=!1;if(a.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(e=!0),a.match(/^\d+\.\d*/)&&(e=!0),a.match(/^\.\d+/)&&(e=!0),e)return a.eat(/J/i),"number";var f=!1;if(a.match(/^0x[0-9a-f]+/i)&&(f=!0),a.match(/^0b[01]+/i)&&(f=!0),a.match(/^0o[0-7]+/i)&&(f=!0),a.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(a.eat(/J/i),f=!0),a.match(/^0(?![\dx])/i)&&(f=!0),f)return a.eat(/L/i),"number"}return a.match(A)?(b.tokenize=m(a.current()),b.tokenize(a,b)):a.match(u)||a.match(t)?null:a.match(s)||a.match(v)?"operator":a.match(r)?null:a.match(B)||a.match(d)?"keyword":a.match(C)?"builtin":a.match(/^(self|cls)\b/)?"variable-2":a.match(w)?"def"==b.lastToken||"class"==b.lastToken?"def":"variable":(a.next(),q)}function m(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=k,d;b.eat(/['"]/)}if(c){if(j.singleLineStringErrors)return q;e.tokenize=k}return d}for(;"rub".indexOf(a.charAt(0).toLowerCase())>=0;)a=a.substr(1);var c=1==a.length,d="string";return b.isString=!0,b}function n(a,b,d){var e=0,f=null;if("py"==d)for(;"py"!=c(b).type;)b.scopes.pop();e=c(b).offset+("py"==d?i.indentUnit:x),"py"==d||a.match(/^(\s|#.*)*$/,!1)||(f=a.column()+1),b.scopes.push({offset:e,type:d,align:f})}function o(a,b){for(var d=a.indentation();c(b).offset>d;){if("py"!=c(b).type)return!0;b.scopes.pop()}return c(b).offset!=d}function p(a,b){var d=b.tokenize(a,b),e=a.current();if("."==e)return d=a.match(w,!1)?null:q,null==d&&"meta"==b.lastStyle&&(d="meta"),d;if("@"==e)return j.version&&3==parseInt(j.version,10)?a.match(w,!1)?"meta":"operator":a.match(w,!1)?"meta":q;"variable"!=d&&"builtin"!=d||"meta"!=b.lastStyle||(d="meta"),("pass"==e||"return"==e)&&(b.dedent+=1),"lambda"==e&&(b.lambda=!0),":"!=e||b.lambda||"py"!=c(b).type||n(a,b,"py");var f=1==e.length?"[({".indexOf(e):-1;if(-1!=f&&n(a,b,"])}".slice(f,f+1)),f="])}".indexOf(e),-1!=f){if(c(b).type!=e)return q;b.scopes.pop()}return b.dedent>0&&a.eol()&&"py"==c(b).type&&(b.scopes.length>1&&b.scopes.pop(),b.dedent-=1),d}var q="error",r=j.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),s=j.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),t=j.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),u=j.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(j.version&&3==parseInt(j.version,10))var v=j.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"),w=j.identifiers||new RegExp("^[_A-Za-z¡-￿][_A-Za-z0-9¡-￿]*");else var v=j.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),w=j.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*");var x=j.hangingIndent||i.indentUnit,y=e,z=f;if(void 0!=j.extra_keywords&&(y=y.concat(j.extra_keywords)),void 0!=j.extra_builtins&&(z=z.concat(j.extra_builtins)),j.version&&3==parseInt(j.version,10)){y=y.concat(h.keywords),z=z.concat(h.builtins);var A=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{y=y.concat(g.keywords),z=z.concat(g.builtins);var A=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var B=b(y),C=b(z),D={startState:function(a){return{tokenize:k,scopes:[{offset:a||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=b.errorToken;c&&(b.errorToken=!1);var d=p(a,b);b.lastStyle=d;var e=a.current();return e&&d&&(b.lastToken=e),a.eol()&&b.lambda&&(b.lambda=!1),c?d+" "+q:d},indent:function(b,d){if(b.tokenize!=k)return b.tokenize.isString?a.Pass:0;var e=c(b),f=d&&d.charAt(0)==e.type;return null!=e.align?e.align-(f?1:0):f&&b.scopes.length>1?b.scopes[b.scopes.length-2].offset:e.offset},closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"};return D}),a.defineMIME("text/x-python","python");var i=function(a){return a.split(" ")};a.defineMIME("text/x-cython",{name:"python",extra_keywords:i("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/q/q.min.js b/media/editors/codemirror/mode/q/q.min.js -index 9703566..2395a93 100644 ---- a/media/editors/codemirror/mode/q/q.min.js -+++ b/media/editors/codemirror/mode/q/q.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("q",function(e){function t(e){return new RegExp("^("+e.join("|")+")$")}function n(e,t){var r=e.sol(),s=e.next();if(l=null,r){if("/"==s)return(t.tokenize=o)(e,t);if("\\"==s)return e.eol()||/\s/.test(e.peek())?(e.skipToEnd(),/^\\\s*$/.test(e.current())?(t.tokenize=i)(e,t):t.tokenize=n,"comment"):(t.tokenize=n,"builtin")}if(/\s/.test(s))return"/"==e.peek()?(e.skipToEnd(),"comment"):"whitespace";if('"'==s)return(t.tokenize=c)(e,t);if("`"==s)return e.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";if("."==s&&/\d/.test(e.peek())||/\d/.test(s)){var a=null;return e.backUp(1),e.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)||e.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)||e.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)||e.match(/^\d+[ptuv]{1}/)?a="temporal":(e.match(/^0[NwW]{1}/)||e.match(/^0x[\d|a-f|A-F]*/)||e.match(/^[0|1]+[b]{1}/)||e.match(/^\d+[chijn]{1}/)||e.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))&&(a="number"),!a||(s=e.peek())&&!m.test(s)?(e.next(),"error"):a}return/[A-Z|a-z]|\./.test(s)?(e.eatWhile(/[A-Z|a-z|\.|_|\d]/),u.test(e.current())?"keyword":"variable"):/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(s)?null:/[{}\(\[\]\)]/.test(s)?null:"error"}function o(e,t){return e.skipToEnd(),/\/\s*$/.test(e.current())?(t.tokenize=r)(e,t):t.tokenize=n,"comment"}function r(e,t){var o=e.sol()&&"\\"==e.peek();return e.skipToEnd(),o&&/^\\\s*$/.test(e.current())&&(t.tokenize=n),"comment"}function i(e){return e.skipToEnd(),"comment"}function c(e,t){for(var o,r=!1,i=!1;o=e.next();){if('"'==o&&!r){i=!0;break}r=!r&&"\\"==o}return i&&(t.tokenize=n),"string"}function s(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function a(e){e.indent=e.context.indent,e.context=e.context.prev}var l,d=e.indentUnit,u=t(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),m=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&null==t.context.align&&(t.context.align=!1),t.indent=e.indentation());var n=t.tokenize(e,t);if("comment"!=n&&t.context&&null==t.context.align&&"pattern"!=t.context.type&&(t.context.align=!0),"("==l)s(t,")",e.column());else if("["==l)s(t,"]",e.column());else if("{"==l)s(t,"}",e.column());else if(/[\]\}\)]/.test(l)){for(;t.context&&"pattern"==t.context.type;)a(t);t.context&&l==t.context.type&&a(t)}else"."==l&&t.context&&"pattern"==t.context.type?a(t):/atom|string|variable/.test(n)&&t.context&&(/[\}\]]/.test(t.context.type)?s(t,"pattern",e.column()):"pattern"!=t.context.type||t.context.align||(t.context.align=!0,t.context.col=e.column()));return n},indent:function(e,t){var n=t&&t.charAt(0),o=e.context;if(/[\]\}]/.test(n))for(;o&&"pattern"==o.type;)o=o.prev;var r=o&&n==o.type;return o?"pattern"==o.type?o.col:o.align?o.col+(r?0:1):o.indent+(r?0:d):0}}}),e.defineMIME("text/x-q","q")}); -\ 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("q",function(a){function b(a){return new RegExp("^("+a.join("|")+")$")}function c(a,b){var e=a.sol(),h=a.next();if(j=null,e){if("/"==h)return(b.tokenize=d)(a,b);if("\\"==h)return a.eol()||/\s/.test(a.peek())?(a.skipToEnd(),/^\\\s*$/.test(a.current())?(b.tokenize=f)(a,b):b.tokenize=c,"comment"):(b.tokenize=c,"builtin")}if(/\s/.test(h))return"/"==a.peek()?(a.skipToEnd(),"comment"):"whitespace";if('"'==h)return(b.tokenize=g)(a,b);if("`"==h)return a.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";if("."==h&&/\d/.test(a.peek())||/\d/.test(h)){var i=null;return a.backUp(1),a.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)||a.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)||a.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)||a.match(/^\d+[ptuv]{1}/)?i="temporal":(a.match(/^0[NwW]{1}/)||a.match(/^0x[\d|a-f|A-F]*/)||a.match(/^[0|1]+[b]{1}/)||a.match(/^\d+[chijn]{1}/)||a.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))&&(i="number"),!i||(h=a.peek())&&!m.test(h)?(a.next(),"error"):i}return/[A-Z|a-z]|\./.test(h)?(a.eatWhile(/[A-Z|a-z|\.|_|\d]/),l.test(a.current())?"keyword":"variable"):/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(h)?null:/[{}\(\[\]\)]/.test(h)?null:"error"}function d(a,b){return a.skipToEnd(),/\/\s*$/.test(a.current())?(b.tokenize=e)(a,b):b.tokenize=c,"comment"}function e(a,b){var d=a.sol()&&"\\"==a.peek();return a.skipToEnd(),d&&/^\\\s*$/.test(a.current())&&(b.tokenize=c),"comment"}function f(a){return a.skipToEnd(),"comment"}function g(a,b){for(var d,e=!1,f=!1;d=a.next();){if('"'==d&&!e){f=!0;break}e=!e&&"\\"==d}return f&&(b.tokenize=c),"string"}function h(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function i(a){a.indent=a.context.indent,a.context=a.context.prev}var j,k=a.indentUnit,l=b(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),m=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;return{startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(a,b){a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation());var c=b.tokenize(a,b);if("comment"!=c&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==j)h(b,")",a.column());else if("["==j)h(b,"]",a.column());else if("{"==j)h(b,"}",a.column());else if(/[\]\}\)]/.test(j)){for(;b.context&&"pattern"==b.context.type;)i(b);b.context&&j==b.context.type&&i(b)}else"."==j&&b.context&&"pattern"==b.context.type?i(b):/atom|string|variable/.test(c)&&b.context&&(/[\}\]]/.test(b.context.type)?h(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return c},indent:function(a,b){var c=b&&b.charAt(0),d=a.context;if(/[\]\}]/.test(c))for(;d&&"pattern"==d.type;)d=d.prev;var e=d&&c==d.type;return d?"pattern"==d.type?d.col:d.align?d.col+(e?0:1):d.indent+(e?0:k):0}}}),a.defineMIME("text/x-q","q")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/r/r.min.js b/media/editors/codemirror/mode/r/r.min.js -index b2eb957..f4fe531 100644 ---- a/media/editors/codemirror/mode/r/r.min.js -+++ b/media/editors/codemirror/mode/r/r.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),n={},r=0;r=!&|~$:]/;return{startState:function(){return{tokenize:n,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);"comment"!=n&&null==t.ctx.align&&(t.ctx.align=!0);var r=t.ctx.type;return";"!=o&&"{"!=o&&"}"!=o||"block"!=r||a(t),"{"==o?i(t,"}",e):"("==o?(i(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==o?i(t,"]",e):"block"==o?i(t,"block",e):o==r&&a(t),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(t,r){if(t.tokenize!=n)return 0;var i=r&&r.charAt(0),a=t.ctx,o=i==a.type;return"block"==a.type?a.indent+("{"==i?0:e.indentUnit):a.align?a.column+(o?0:1):a.indent+(o?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}); -\ 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("r",function(a){function b(a){for(var b=a.split(" "),c={},d=0;d=!&|~$:]/;return{startState:function(){return{tokenize:c,ctx:{type:"top",indent:-a.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(a,b){if(a.sol()&&(null==b.ctx.align&&(b.ctx.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);"comment"!=c&&null==b.ctx.align&&(b.ctx.align=!0);var d=b.ctx.type;return";"!=g&&"{"!=g&&"}"!=g||"block"!=d||f(b),"{"==g?e(b,"}",a):"("==g?(e(b,")",a),b.afterIdent&&(b.ctx.argList=!0)):"["==g?e(b,"]",a):"block"==g?e(b,"block",a):g==d&&f(b),b.afterIdent="variable"==c||"keyword"==c,c},indent:function(b,d){if(b.tokenize!=c)return 0;var e=d&&d.charAt(0),f=b.ctx,g=e==f.type;return"block"==f.type?f.indent+("{"==e?0:a.indentUnit):f.align?f.column+(g?0:1):f.indent+(g?0:a.indentUnit)},lineComment:"#"}}),a.defineMIME("text/x-rsrc","r")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/rpm/rpm.min.js b/media/editors/codemirror/mode/rpm/rpm.min.js -index 6dd1814..2c77060 100644 ---- a/media/editors/codemirror/mode/rpm/rpm.min.js -+++ b/media/editors/codemirror/mode/rpm/rpm.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("rpm-changes",function(){var e=/^-+$/,r=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /,t=/^[\w+.-]+@[\w.-]+/;return{token:function(n){if(n.sol()){if(n.match(e))return"tag";if(n.match(r))return"tag"}return n.match(t)?"string":(n.next(),null)}}}),e.defineMIME("text/x-rpm-changes","rpm-changes"),e.defineMode("rpm-spec",function(){var e=/^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/,r=/^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/,t=/^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/,n=/^%(ifnarch|ifarch|if)/,i=/^%(else|endif)/,o=/^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;return{startState:function(){return{controlFlow:!1,macroParameters:!1,section:!1}},token:function(c,a){var u=c.peek();if("#"==u)return c.skipToEnd(),"comment";if(c.sol()){if(c.match(r))return"preamble";if(c.match(t))return"section"}if(c.match(/^\$\w+/))return"def";if(c.match(/^\$\{\w+\}/))return"def";if(c.match(i))return"keyword";if(c.match(n))return a.controlFlow=!0,"keyword";if(a.controlFlow){if(c.match(o))return"operator";if(c.match(/^(\d+)/))return"number";c.eol()&&(a.controlFlow=!1)}if(c.match(e))return"number";if(c.match(/^%[\w]+/))return c.match(/^\(/)&&(a.macroParameters=!0),"macro";if(a.macroParameters){if(c.match(/^\d+/))return"number";if(c.match(/^\)/))return a.macroParameters=!1,"macro"}return c.match(/^%\{\??[\w \-]+\}/)?"macro":(c.next(),null)}}}),e.defineMIME("text/x-rpm-spec","rpm-spec")}); -\ 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("rpm-changes",function(){var a=/^-+$/,b=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /,c=/^[\w+.-]+@[\w.-]+/;return{token:function(d){if(d.sol()){if(d.match(a))return"tag";if(d.match(b))return"tag"}return d.match(c)?"string":(d.next(),null)}}}),a.defineMIME("text/x-rpm-changes","rpm-changes"),a.defineMode("rpm-spec",function(){var a=/^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/,b=/^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/,c=/^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/,d=/^%(ifnarch|ifarch|if)/,e=/^%(else|endif)/,f=/^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;return{startState:function(){return{controlFlow:!1,macroParameters:!1,section:!1}},token:function(g,h){var i=g.peek();if("#"==i)return g.skipToEnd(),"comment";if(g.sol()){if(g.match(b))return"preamble";if(g.match(c))return"section"}if(g.match(/^\$\w+/))return"def";if(g.match(/^\$\{\w+\}/))return"def";if(g.match(e))return"keyword";if(g.match(d))return h.controlFlow=!0,"keyword";if(h.controlFlow){if(g.match(f))return"operator";if(g.match(/^(\d+)/))return"number";g.eol()&&(h.controlFlow=!1)}if(g.match(a))return"number";if(g.match(/^%[\w]+/))return g.match(/^\(/)&&(h.macroParameters=!0),"macro";if(h.macroParameters){if(g.match(/^\d+/))return"number";if(g.match(/^\)/))return h.macroParameters=!1,"macro"}return g.match(/^%\{\??[\w \-]+\}/)?"macro":(g.next(),null)}}}),a.defineMIME("text/x-rpm-spec","rpm-spec")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/rst/rst.min.js b/media/editors/codemirror/mode/rst/rst.min.js -index ca19d9a..4dd8fb8 100644 ---- a/media/editors/codemirror/mode/rst/rst.min.js -+++ b/media/editors/codemirror/mode/rst/rst.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../python/python"),require("../stex/stex"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../python/python","../stex/stex","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("rst",function(t,a){var c=/^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/,n=/^\*[^\*\s](?:[^\*]*[^\*\s])?\*/,r=/^``[^`\s](?:[^`]*[^`\s])``/,m=/^(?:[\d]+(?:[\.,]\d+)*)/,o=/^(?:\s\+[\d]+(?:[\.,]\d+)*)/,s=/^(?:\s\-[\d]+(?:[\.,]\d+)*)/,h="[Hh][Tt][Tt][Pp][Ss]?://",l="(?:[\\d\\w.-]+)\\.(?:\\w{2,6})",i="(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*",p=new RegExp("^"+h+l+i),d={token:function(e){if(e.match(c)&&e.match(/\W+|$/,!1))return"strong";if(e.match(n)&&e.match(/\W+|$/,!1))return"em";if(e.match(r)&&e.match(/\W+|$/,!1))return"string-2";if(e.match(m))return"number";if(e.match(o))return"positive";if(e.match(s))return"negative";if(e.match(p))return"link";for(;!(null==e.next()||e.match(c,!1)||e.match(n,!1)||e.match(r,!1)||e.match(m,!1)||e.match(o,!1)||e.match(s,!1)||e.match(p,!1)););return null}},u=e.getMode(t,a.backdrop||"rst-base");return e.overlayMode(u,d,!0)},"python","stex"),e.defineMode("rst-base",function(t){function a(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,a){return"undefined"!=typeof t[a]?t[a]:e})}function c(t,a){var r=null;if(t.sol()&&t.match(V,!1))l(a,s,{mode:d,local:e.startState(d)});else if(t.sol()&&t.match($))l(a,n),r="meta";else if(t.sol()&&t.match(v))l(a,c),r="header";else if(p(a)==P||t.match(P,!1))switch(i(a)){case 0:l(a,c,h(P,1)),t.match(/^:/),r="meta";break;case 1:l(a,c,h(P,2)),t.match(b),r="keyword",t.current().match(/^(?:math|latex)/)&&(a.tmp_stex=!0);break;case 2:l(a,c,h(P,3)),t.match(/^:`/),r="meta";break;case 3:if(a.tmp_stex&&(a.tmp_stex=void 0,a.tmp={mode:u,local:e.startState(u)}),a.tmp){if("`"==t.peek()){l(a,c,h(P,4)),a.tmp=void 0;break}r=a.tmp.mode.token(t,a.tmp.local);break}l(a,c,h(P,4)),t.match(_),r="string";break;case 4:l(a,c,h(P,5)),t.match(/^`/),r="meta";break;case 5:l(a,c,h(P,6)),t.match(k);break;default:l(a,c)}else if(p(a)==z||t.match(z,!1))switch(i(a)){case 0:l(a,c,h(z,1)),t.match(/^`/),r="meta";break;case 1:l(a,c,h(z,2)),t.match(_),r="string";break;case 2:l(a,c,h(z,3)),t.match(/^`:/),r="meta";break;case 3:l(a,c,h(z,4)),t.match(b),r="keyword";break;case 4:l(a,c,h(z,5)),t.match(/^:/),r="meta";break;case 5:l(a,c,h(z,6)),t.match(k);break;default:l(a,c)}else if(p(a)==B||t.match(B,!1))switch(i(a)){case 0:l(a,c,h(B,1)),t.match(/^:/),r="meta";break;case 1:l(a,c,h(B,2)),t.match(b),r="keyword";break;case 2:l(a,c,h(B,3)),t.match(/^:/),r="meta";break;case 3:l(a,c,h(B,4)),t.match(k);break;default:l(a,c)}else if(p(a)==j||t.match(j,!1))switch(i(a)){case 0:l(a,c,h(j,1)),t.match(G),r="variable-2";break;case 1:l(a,c,h(j,2)),t.match(/^_?_?/)&&(r="link");break;default:l(a,c)}else if(t.match(I))l(a,c),r="quote";else if(t.match(A))l(a,c),r="quote";else if(t.match(C))l(a,c),(!t.peek()||t.peek().match(/^\W$/))&&(r="link");else if(p(a)==H||t.match(H,!1))switch(i(a)){case 0:!t.peek()||t.peek().match(/^\W$/)?l(a,c,h(H,1)):t.match(H);break;case 1:l(a,c,h(H,2)),t.match(/^`/),r="link";break;case 2:l(a,c,h(H,3)),t.match(_);break;case 3:l(a,c,h(H,4)),t.match(/^`_/),r="link";break;default:l(a,c)}else t.match(U)?l(a,m):t.next()&&l(a,c);return r}function n(t,a){var m=null;if(p(a)==W||t.match(W,!1))switch(i(a)){case 0:l(a,n,h(W,1)),t.match(G),m="variable-2";break;case 1:l(a,n,h(W,2)),t.match(J);break;case 2:l(a,n,h(W,3)),t.match(K),m="keyword";break;case 3:l(a,n,h(W,4)),t.match(L),m="meta";break;default:l(a,c)}else if(p(a)==M||t.match(M,!1))switch(i(a)){case 0:l(a,n,h(M,1)),t.match(D),m="keyword",t.current().match(/^(?:math|latex)/)?a.tmp_stex=!0:t.current().match(/^python/)&&(a.tmp_py=!0);break;case 1:l(a,n,h(M,2)),t.match(F),m="meta",(t.match(/^latex\s*$/)||a.tmp_stex)&&(a.tmp_stex=void 0,l(a,s,{mode:u,local:e.startState(u)}));break;case 2:l(a,n,h(M,3)),(t.match(/^python\s*$/)||a.tmp_py)&&(a.tmp_py=void 0,l(a,s,{mode:d,local:e.startState(d)}));break;default:l(a,c)}else if(p(a)==S||t.match(S,!1))switch(i(a)){case 0:l(a,n,h(S,1)),t.match(N),t.match(O),m="link";break;case 1:l(a,n,h(S,2)),t.match(Q),m="meta";break;default:l(a,c)}else t.match(q)?(l(a,c),m="quote"):t.match(T)?(l(a,c),m="quote"):(t.eatSpace(),t.eol()?l(a,c):(t.skipToEnd(),l(a,r),m="comment"));return m}function r(e,t){return o(e,t,"comment")}function m(e,t){return o(e,t,"meta")}function o(e,t,a){return e.eol()||e.eatSpace()?(e.skipToEnd(),a):(l(t,c),null)}function s(e,t){return t.ctx.mode&&t.ctx.local?e.sol()?(e.eatSpace()||l(t,c),null):t.ctx.mode.token(e,t.ctx.local):(l(t,c),null)}function h(e,t,a,c){return{phase:e,stage:t,mode:a,local:c}}function l(e,t,a){e.tok=t,e.ctx=a||{}}function i(e){return e.ctx.stage||0}function p(e){return e.ctx.phase}var d=e.getMode(t,"python"),u=e.getMode(t,"stex"),f="\\s+",x="(?:\\s*|\\W|$)",k=new RegExp(a("^{0}",x)),w="(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",b=new RegExp(a("^{0}",w)),g="(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",E=a("(?:{0}|`{1}`)",w,g),R="(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)",y="(?:[^\\`]+)",_=new RegExp(a("^{0}",y)),v=new RegExp("^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"),$=new RegExp(a("^\\.\\.{0}",f)),S=new RegExp(a("^_{0}:{1}|^__:{1}",E,x)),M=new RegExp(a("^{0}::{1}",E,x)),W=new RegExp(a("^\\|{0}\\|{1}{2}::{3}",R,f,E,x)),q=new RegExp(a("^\\[(?:\\d+|#{0}?|\\*)]{1}",E,x)),T=new RegExp(a("^\\[{0}\\]{1}",E,x)),j=new RegExp(a("^\\|{0}\\|",R)),I=new RegExp(a("^\\[(?:\\d+|#{0}?|\\*)]_",E)),A=new RegExp(a("^\\[{0}\\]_",E)),C=new RegExp(a("^{0}__?",E)),H=new RegExp(a("^`{0}`_",y)),P=new RegExp(a("^:{0}:`{1}`{2}",w,y,x)),z=new RegExp(a("^`{1}`:{0}:{2}",w,y,x)),B=new RegExp(a("^:{0}:{1}",w,x)),D=new RegExp(a("^{0}",E)),F=new RegExp(a("^::{0}",x)),G=new RegExp(a("^\\|{0}\\|",R)),J=new RegExp(a("^{0}",f)),K=new RegExp(a("^{0}",E)),L=new RegExp(a("^::{0}",x)),N=new RegExp("^_"),O=new RegExp(a("^{0}|_",E)),Q=new RegExp(a("^:{0}",x)),U=new RegExp("^::\\s*$"),V=new RegExp("^\\s+(?:>>>|In \\[\\d+\\]:)\\s");return{startState:function(){return{tok:c,ctx:h(void 0,0)}},copyState:function(t){var a=t.ctx,c=t.tmp;return a.local&&(a={mode:a.mode,local:e.copyState(a.mode,a.local)}),c&&(c={mode:c.mode,local:e.copyState(c.mode,c.local)}),{tok:t.tok,ctx:a,tmp:c}},innerMode:function(e){return e.tmp?{state:e.tmp.local,mode:e.tmp.mode}:e.ctx.mode?{state:e.ctx.local,mode:e.ctx.mode}:null},token:function(e,t){return t.tok(e,t)}}},"python","stex"),e.defineMIME("text/x-rst","rst")}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../python/python"),require("../stex/stex"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../python/python","../stex/stex","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("rst",function(b,c){var d=/^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/,e=/^\*[^\*\s](?:[^\*]*[^\*\s])?\*/,f=/^``[^`\s](?:[^`]*[^`\s])``/,g=/^(?:[\d]+(?:[\.,]\d+)*)/,h=/^(?:\s\+[\d]+(?:[\.,]\d+)*)/,i=/^(?:\s\-[\d]+(?:[\.,]\d+)*)/,j="[Hh][Tt][Tt][Pp][Ss]?://",k="(?:[\\d\\w.-]+)\\.(?:\\w{2,6})",l="(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*",m=new RegExp("^"+j+k+l),n={token:function(a){if(a.match(d)&&a.match(/\W+|$/,!1))return"strong";if(a.match(e)&&a.match(/\W+|$/,!1))return"em";if(a.match(f)&&a.match(/\W+|$/,!1))return"string-2";if(a.match(g))return"number";if(a.match(h))return"positive";if(a.match(i))return"negative";if(a.match(m))return"link";for(;!(null==a.next()||a.match(d,!1)||a.match(e,!1)||a.match(f,!1)||a.match(g,!1)||a.match(h,!1)||a.match(i,!1)||a.match(m,!1)););return null}},o=a.getMode(b,c.backdrop||"rst-base");return a.overlayMode(o,n,!0)},"python","stex"),a.defineMode("rst-base",function(b){function c(a){var b=Array.prototype.slice.call(arguments,1);return a.replace(/{(\d+)}/g,function(a,c){return"undefined"!=typeof b[c]?b[c]:a})}function d(b,c){var f=null;if(b.sol()&&b.match(Y,!1))k(c,i,{mode:n,local:a.startState(n)});else if(b.sol()&&b.match(A))k(c,e),f="meta";else if(b.sol()&&b.match(z))k(c,d),f="header";else if(m(c)==L||b.match(L,!1))switch(l(c)){case 0:k(c,d,j(L,1)),b.match(/^:/),f="meta";break;case 1:k(c,d,j(L,2)),b.match(t),f="keyword",b.current().match(/^(?:math|latex)/)&&(c.tmp_stex=!0);break;case 2:k(c,d,j(L,3)),b.match(/^:`/),f="meta";break;case 3:if(c.tmp_stex&&(c.tmp_stex=void 0,c.tmp={mode:o,local:a.startState(o)}),c.tmp){if("`"==b.peek()){k(c,d,j(L,4)),c.tmp=void 0;break}f=c.tmp.mode.token(b,c.tmp.local);break}k(c,d,j(L,4)),b.match(y),f="string";break;case 4:k(c,d,j(L,5)),b.match(/^`/),f="meta";break;case 5:k(c,d,j(L,6)),b.match(r);break;default:k(c,d)}else if(m(c)==M||b.match(M,!1))switch(l(c)){case 0:k(c,d,j(M,1)),b.match(/^`/),f="meta";break;case 1:k(c,d,j(M,2)),b.match(y),f="string";break;case 2:k(c,d,j(M,3)),b.match(/^`:/),f="meta";break;case 3:k(c,d,j(M,4)),b.match(t),f="keyword";break;case 4:k(c,d,j(M,5)),b.match(/^:/),f="meta";break;case 5:k(c,d,j(M,6)),b.match(r);break;default:k(c,d)}else if(m(c)==N||b.match(N,!1))switch(l(c)){case 0:k(c,d,j(N,1)),b.match(/^:/),f="meta";break;case 1:k(c,d,j(N,2)),b.match(t),f="keyword";break;case 2:k(c,d,j(N,3)),b.match(/^:/),f="meta";break;case 3:k(c,d,j(N,4)),b.match(r);break;default:k(c,d)}else if(m(c)==G||b.match(G,!1))switch(l(c)){case 0:k(c,d,j(G,1)),b.match(Q),f="variable-2";break;case 1:k(c,d,j(G,2)),b.match(/^_?_?/)&&(f="link");break;default:k(c,d)}else if(b.match(H))k(c,d),f="quote";else if(b.match(I))k(c,d),f="quote";else if(b.match(J))k(c,d),(!b.peek()||b.peek().match(/^\W$/))&&(f="link");else if(m(c)==K||b.match(K,!1))switch(l(c)){case 0:!b.peek()||b.peek().match(/^\W$/)?k(c,d,j(K,1)):b.match(K);break;case 1:k(c,d,j(K,2)),b.match(/^`/),f="link";break;case 2:k(c,d,j(K,3)),b.match(y);break;case 3:k(c,d,j(K,4)),b.match(/^`_/),f="link";break;default:k(c,d)}else b.match(X)?k(c,g):b.next()&&k(c,d);return f}function e(b,c){var g=null;if(m(c)==D||b.match(D,!1))switch(l(c)){case 0:k(c,e,j(D,1)),b.match(Q),g="variable-2";break;case 1:k(c,e,j(D,2)),b.match(R);break;case 2:k(c,e,j(D,3)),b.match(S),g="keyword";break;case 3:k(c,e,j(D,4)),b.match(T),g="meta";break;default:k(c,d)}else if(m(c)==C||b.match(C,!1))switch(l(c)){case 0:k(c,e,j(C,1)),b.match(O),g="keyword",b.current().match(/^(?:math|latex)/)?c.tmp_stex=!0:b.current().match(/^python/)&&(c.tmp_py=!0);break;case 1:k(c,e,j(C,2)),b.match(P),g="meta",(b.match(/^latex\s*$/)||c.tmp_stex)&&(c.tmp_stex=void 0,k(c,i,{mode:o,local:a.startState(o)}));break;case 2:k(c,e,j(C,3)),(b.match(/^python\s*$/)||c.tmp_py)&&(c.tmp_py=void 0,k(c,i,{mode:n,local:a.startState(n)}));break;default:k(c,d)}else if(m(c)==B||b.match(B,!1))switch(l(c)){case 0:k(c,e,j(B,1)),b.match(U),b.match(V),g="link";break;case 1:k(c,e,j(B,2)),b.match(W),g="meta";break;default:k(c,d)}else b.match(E)?(k(c,d),g="quote"):b.match(F)?(k(c,d),g="quote"):(b.eatSpace(),b.eol()?k(c,d):(b.skipToEnd(),k(c,f),g="comment"));return g}function f(a,b){return h(a,b,"comment")}function g(a,b){return h(a,b,"meta")}function h(a,b,c){return a.eol()||a.eatSpace()?(a.skipToEnd(),c):(k(b,d),null)}function i(a,b){return b.ctx.mode&&b.ctx.local?a.sol()?(a.eatSpace()||k(b,d),null):b.ctx.mode.token(a,b.ctx.local):(k(b,d),null)}function j(a,b,c,d){return{phase:a,stage:b,mode:c,local:d}}function k(a,b,c){a.tok=b,a.ctx=c||{}}function l(a){return a.ctx.stage||0}function m(a){return a.ctx.phase}var n=a.getMode(b,"python"),o=a.getMode(b,"stex"),p="\\s+",q="(?:\\s*|\\W|$)",r=new RegExp(c("^{0}",q)),s="(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",t=new RegExp(c("^{0}",s)),u="(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",v=c("(?:{0}|`{1}`)",s,u),w="(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)",x="(?:[^\\`]+)",y=new RegExp(c("^{0}",x)),z=new RegExp("^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"),A=new RegExp(c("^\\.\\.{0}",p)),B=new RegExp(c("^_{0}:{1}|^__:{1}",v,q)),C=new RegExp(c("^{0}::{1}",v,q)),D=new RegExp(c("^\\|{0}\\|{1}{2}::{3}",w,p,v,q)),E=new RegExp(c("^\\[(?:\\d+|#{0}?|\\*)]{1}",v,q)),F=new RegExp(c("^\\[{0}\\]{1}",v,q)),G=new RegExp(c("^\\|{0}\\|",w)),H=new RegExp(c("^\\[(?:\\d+|#{0}?|\\*)]_",v)),I=new RegExp(c("^\\[{0}\\]_",v)),J=new RegExp(c("^{0}__?",v)),K=new RegExp(c("^`{0}`_",x)),L=new RegExp(c("^:{0}:`{1}`{2}",s,x,q)),M=new RegExp(c("^`{1}`:{0}:{2}",s,x,q)),N=new RegExp(c("^:{0}:{1}",s,q)),O=new RegExp(c("^{0}",v)),P=new RegExp(c("^::{0}",q)),Q=new RegExp(c("^\\|{0}\\|",w)),R=new RegExp(c("^{0}",p)),S=new RegExp(c("^{0}",v)),T=new RegExp(c("^::{0}",q)),U=new RegExp("^_"),V=new RegExp(c("^{0}|_",v)),W=new RegExp(c("^:{0}",q)),X=new RegExp("^::\\s*$"),Y=new RegExp("^\\s+(?:>>>|In \\[\\d+\\]:)\\s");return{startState:function(){return{tok:d,ctx:j(void 0,0)}},copyState:function(b){var c=b.ctx,d=b.tmp;return c.local&&(c={mode:c.mode,local:a.copyState(c.mode,c.local)}),d&&(d={mode:d.mode,local:a.copyState(d.mode,d.local)}),{tok:b.tok,ctx:c,tmp:d}},innerMode:function(a){return a.tmp?{state:a.tmp.local,mode:a.tmp.mode}:a.ctx.mode?{state:a.ctx.local,mode:a.ctx.mode}:null},token:function(a,b){return b.tok(a,b)}}},"python","stex"),a.defineMIME("text/x-rst","rst")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/ruby/ruby.min.js b/media/editors/codemirror/mode/ruby/ruby.min.js -index e2a5a7b..ee29fca 100644 ---- a/media/editors/codemirror/mode/ruby/ruby.min.js -+++ b/media/editors/codemirror/mode/ruby/ruby.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;r>n;++n)t[e[n]]=!0;return t}function n(e,t,n){return n.tokenize.push(e),e(t,n)}function r(e,t){if(l=null,e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(f),"comment";if(e.eatSpace())return null;var r,i=e.next();if("`"==i||"'"==i||'"'==i)return n(a(i,"string",'"'==i||"`"==i),e,t);if("/"==i){var o=e.current().length;if(e.skipTo("/")){var d=e.current().length;e.backUp(e.current().length-o);for(var c=0;e.current().lengthc)break}if(e.backUp(e.current().length-o),0==c)return n(a(i,"string-2",!0),e,t)}return"operator"}if("%"==i){var k="string",h=!0;e.eat("s")?k="atom":e.eat(/[WQ]/)?k="string":e.eat(/[r]/)?k="string-2":e.eat(/[wxq]/)&&(k="string",h=!1);var m=e.eat(/[^\w\s=]/);return m?(p.propertyIsEnumerable(m)&&(m=p[m]),n(a(m,k,h,!0),e,t)):"operator"}if("#"==i)return e.skipToEnd(),"comment";if("<"==i&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return n(u(r[1]),e,t);if("0"==i)return e.eatWhile(e.eat("x")?/[\da-fA-F]/:e.eat("b")?/[01]/:/[0-7]/),"number";if(/\d/.test(i))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==i){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==i)return e.eat("'")?n(a("'","atom",!1),e,t):e.eat('"')?n(a('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return l=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var x=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||x||(l="."),"operator"}return null}return l="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,u){var f,l=!1;for("read-quoted-paused"===u.context.type&&(u.context=u.context.prev,a.eat("}"));null!=(f=a.next());){if(f==e&&(r||!l)){u.tokenize.pop();break}if(n&&"#"==f&&!l){if(a.eat("{")){"}"==e&&(u.context={prev:u.context,type:"read-quoted-paused"}),u.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){u.tokenize.push(o());break}}l=!l&&"\\"==f}return t}}function u(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function f(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var l,d=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),c=t(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),s=t(["end","until"]),p={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=l;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":d.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,c.propertyIsEnumerable(o)?n="indent":s.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indentedc;++c)b[a[c]]=!0;return b}function c(a,b,c){return c.tokenize.push(a),a(b,c)}function d(a,b){if(j=null,a.sol()&&a.match("=begin")&&a.eol())return b.tokenize.push(i),"comment";if(a.eatSpace())return null;var d,e=a.next();if("`"==e||"'"==e||'"'==e)return c(g(e,"string",'"'==e||"`"==e),a,b);if("/"==e){var f=a.current().length;if(a.skipTo("/")){var k=a.current().length;a.backUp(a.current().length-f);for(var l=0;a.current().lengthl)break}if(a.backUp(a.current().length-f),0==l)return c(g(e,"string-2",!0),a,b)}return"operator"}if("%"==e){var o="string",p=!0;a.eat("s")?o="atom":a.eat(/[WQ]/)?o="string":a.eat(/[r]/)?o="string-2":a.eat(/[wxq]/)&&(o="string",p=!1);var q=a.eat(/[^\w\s=]/);return q?(n.propertyIsEnumerable(q)&&(q=n[q]),c(g(q,o,p,!0),a,b)):"operator"}if("#"==e)return a.skipToEnd(),"comment";if("<"==e&&(d=a.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return c(h(d[1]),a,b);if("0"==e)return a.eat("x")?a.eatWhile(/[\da-fA-F]/):a.eat("b")?a.eatWhile(/[01]/):a.eatWhile(/[0-7]/),"number";if(/\d/.test(e))return a.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==e){for(;a.match(/^\\[CM]-/););return a.eat("\\")?a.eatWhile(/\w/):a.next(),"string"}if(":"==e)return a.eat("'")?c(g("'","atom",!1),a,b):a.eat('"')?c(g('"',"atom",!0),a,b):a.eat(/[\<\>]/)?(a.eat(/[\<\>]/),"atom"):a.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":a.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(a.eatWhile(/[\w$\xa1-\uffff]/),a.eat(/[\?\!\=]/),"atom"):"operator";if("@"==e&&a.match(/^@?[a-zA-Z_\xa1-\uffff]/))return a.eat("@"),a.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==e)return a.eat(/[a-zA-Z_]/)?a.eatWhile(/[\w]/):a.eat(/\d/)?a.eat(/\d/):a.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(e))return a.eatWhile(/[\w\xa1-\uffff]/),a.eat(/[\?\!]/),a.eat(":")?"atom":"ident";if("|"!=e||!b.varList&&"{"!=b.lastTok&&"do"!=b.lastTok){if(/[\(\)\[\]{}\\;]/.test(e))return j=e,null;if("-"==e&&a.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(e)){var r=a.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=e||r||(j="."),"operator"}return null}return j="|",null}function e(a){return a||(a=1),function(b,c){if("}"==b.peek()){if(1==a)return c.tokenize.pop(),c.tokenize[c.tokenize.length-1](b,c);c.tokenize[c.tokenize.length-1]=e(a-1)}else"{"==b.peek()&&(c.tokenize[c.tokenize.length-1]=e(a+1));return d(b,c)}}function f(){var a=!1;return function(b,c){return a?(c.tokenize.pop(),c.tokenize[c.tokenize.length-1](b,c)):(a=!0,d(b,c))}}function g(a,b,c,d){return function(g,h){var i,j=!1;for("read-quoted-paused"===h.context.type&&(h.context=h.context.prev,g.eat("}"));null!=(i=g.next());){if(i==a&&(d||!j)){h.tokenize.pop();break}if(c&&"#"==i&&!j){if(g.eat("{")){"}"==a&&(h.context={prev:h.context,type:"read-quoted-paused"}),h.tokenize.push(e());break}if(/[@\$]/.test(g.peek())){h.tokenize.push(f());break}}j=!j&&"\\"==i}return b}}function h(a){return function(b,c){return b.match(a)?c.tokenize.pop():b.skipToEnd(),"string"}}function i(a,b){return a.sol()&&a.match("=end")&&a.eol()&&b.tokenize.pop(),a.skipToEnd(),"comment"}var j,k=b(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),l=b(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),m=b(["end","until"]),n={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[d],indented:0,context:{type:"top",indented:-a.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(a,b){a.sol()&&(b.indented=a.indentation());var c,d=b.tokenize[b.tokenize.length-1](a,b),e=j;if("ident"==d){var f=a.current();d="."==b.lastTok?"property":k.propertyIsEnumerable(a.current())?"keyword":/^[A-Z]/.test(f)?"tag":"def"==b.lastTok||"class"==b.lastTok||b.varList?"def":"variable","keyword"==d&&(e=f,l.propertyIsEnumerable(f)?c="indent":m.propertyIsEnumerable(f)?c="dedent":"if"!=f&&"unless"!=f||a.column()!=a.indentation()?"do"==f&&b.context.indented")?e("->",null):a.match(V)?(t.eatWhile(V),e("op",null)):(t.eatWhile(/\w/),K=t.current(),t.match(/^::\w/)?(t.backUp(1),e("prefix","variable-2")):o.keywords.propertyIsEnumerable(K)?e(o.keywords[K],K.match(/true|false/)?"atom":"keyword"):e("name","variable"))}function n(n,r){for(var o,a=!1;o=n.next();){if('"'==o&&!a)return r.tokenize=t,e("atom","string");a=!a&&"\\"==o}return e("op","string")}function r(e){return function(n,o){for(var a,i=null;a=n.next();){if("/"==a&&"*"==i){if(1==e){o.tokenize=t;break}return o.tokenize=r(e-1),o.tokenize(n,o)}if("*"==a&&"/"==i)return o.tokenize=r(e+1),o.tokenize(n,o);i=a}return"comment"}}function o(){for(var e=arguments.length-1;e>=0;e--)X.cc.push(arguments[e])}function a(){return o.apply(null,arguments),!0}function i(e,t){var n=function(){var n=X.state;n.lexical={indented:n.indented,column:X.stream.column(),type:e,prev:n.lexical,info:t}};return n.lex=!0,n}function u(){var e=X.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function l(){X.state.keywords=R}function c(){X.state.keywords=Q}function f(e,t){function n(r){return","==r?a(e,n):r==t?a():a(n)}return function(r){return r==t?a():o(e,n)}}function m(e,t){return a(i("stat",t),e,u,d)}function d(e){return"}"==e?a():"let"==e?m(w,"let"):"fn"==e?m(j):"type"==e?a(i("stat"),C,s,u,d):"enum"==e?m(W):"mod"==e?m(M):"iface"==e?m($):"impl"==e?m(S):"open-attr"==e?a(i("]"),f(k,"]"),u):"ignore"==e||e.match(/[\]\);,]/)?a(d):o(i("stat"),k,u,s,d)}function s(e){return";"==e?a():o()}function k(e){return"atom"==e||"name"==e?a(p):"{"==e?a(i("}"),y,u):e.match(/[\[\(]/)?G(e,k):e.match(/[\]\)\};,]/)?o():"if-style"==e?a(k,k):"else-style"==e||"op"==e?a(k):"for"==e?a(A,v,z,k,k):"alt"==e?a(k,_):"fn"==e?a(j):"macro"==e?a(F):a()}function p(e){return"."==K?a(h):"::<"==K?a(I,p):"op"==e||":"==K?a(k):"("==e||"["==e?G(e,k):o()}function h(){return K.match(/^\w+$/)?(X.marked="variable",a(p)):o(k)}function y(e){if("op"==e){if("|"==K)return a(b,u,i("}","block"),d);if("||"==K)return a(u,i("}","block"),d)}return o("mutable"==K||K.match(/^\w+$/)&&":"==X.stream.peek()&&!X.stream.match("::",!1)?x(k):d)}function x(e){function t(n){return"mutable"==K||"with"==K?(X.marked="keyword",a(t)):K.match(/^\w*$/)?(X.marked="variable",a(t)):":"==n?a(e,t):"}"==n?a():a(t)}return t}function b(e){return"name"==e?(X.marked="def",a(b)):"op"==e&&"|"==K?a():a(b)}function w(e){return e.match(/[\]\)\};]/)?a():"="==K?a(k,g):","==e?a(w):o(A,v,w)}function g(e){return e.match(/[\]\)\};,]/)?o(w):o(k,g)}function v(e){return":"==e?a(l,P,c):o()}function z(e){return"name"==e&&"in"==K?(X.marked="keyword",a()):o()}function j(e){return"@"==K||"~"==K?(X.marked="keyword",a(j)):"name"==e?(X.marked="def",a(j)):"<"==K?a(I,j):"{"==e?o(k):"("==e?a(i(")"),f(O,")"),u,j):"->"==e?a(l,P,c,j):";"==e?a():a(j)}function C(e){return"name"==e?(X.marked="def",a(C)):"<"==K?a(I,C):"="==K?a(l,P,c):a(C)}function W(e){return"name"==e?(X.marked="def",a(W)):"<"==K?a(I,W):"="==K?a(l,P,c,s):"{"==e?a(i("}"),l,E,c,u):a(W)}function E(e){return"}"==e?a():"("==e?a(i(")"),f(P,")"),u,E):(K.match(/^\w+$/)&&(X.marked="def"),a(E))}function M(e){return"name"==e?(X.marked="def",a(M)):"{"==e?a(i("}"),d,u):o()}function $(e){return"name"==e?(X.marked="def",a($)):"<"==K?a(I,$):"{"==e?a(i("}"),d,u):o()}function S(e){return"<"==K?a(I,S):"of"==K||"for"==K?(X.marked="keyword",a(P,S)):"name"==e?(X.marked="def",a(S)):"{"==e?a(i("}"),d,u):o()}function I(){return">"==K?a():","==K?a(I):":"==K?a(P,I):o(P,I)}function O(e){return"name"==e?(X.marked="def",a(O)):":"==e?a(l,P,c):o()}function P(e){return"name"==e?(X.marked="variable-3",a(T)):"mutable"==K?(X.marked="keyword",a(P)):"atom"==e?a(T):"op"==e||"obj"==e?a(P):"fn"==e?a(q):"{"==e?a(i("{"),x(P),u):G(e,P)}function T(){return"<"==K?a(I):o()}function q(e){return"("==e?a(i("("),f(P,")"),u,q):"->"==e?a(P):o()}function A(e){return"name"==e?(X.marked="def",a(U)):"atom"==e?a(U):"op"==e?a(A):e.match(/[\]\)\};,]/)?o():G(e,A)}function U(e){return"op"==e&&"."==K?a():"to"==K?(X.marked="keyword",a(A)):o()}function _(e){return"{"==e?a(i("}","alt"),B,u):o()}function B(e){return"}"==e?a():"|"==e?a(B):"when"==K?(X.marked="keyword",a(k,D)):e.match(/[\]\);,]/)?a(B):o(A,D)}function D(e){return"{"==e?a(i("}","alt"),d,u,B):o(B)}function F(e){return e.match(/[\[\(\{]/)?G(e,k):o()}function G(e,t){return"["==e?a(i("]"),f(t,"]"),u):"("==e?a(i(")"),f(t,")"),u):"{"==e?a(i("}"),f(t,"}"),u):a()}function H(e,t,n){var r=e.cc;for(X.state=e,X.stream=t,X.marked=null,X.cc=r;;){var o=r.length?r.pop():d;if(o(J)){for(;r.length&&r[r.length-1].lex;)r.pop()();return X.marked||n}}}var J,K,L=4,N=2,Q={"if":"if-style","while":"if-style",loop:"else-style","else":"else-style","do":"else-style",ret:"else-style",fail:"else-style","break":"atom",cont:"atom","const":"let",resource:"fn",let:"let",fn:"fn","for":"for",alt:"alt",iface:"iface",impl:"impl",type:"type","enum":"enum",mod:"mod",as:"op","true":"atom","false":"atom",assert:"op",check:"op",claim:"op","native":"ignore",unsafe:"ignore","import":"else-style","export":"else-style",copy:"op",log:"op",log_err:"op",use:"op",bind:"op",self:"atom",struct:"enum"},R=function(){for(var e={fn:"fn",block:"fn",obj:"obj"},t="bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "),n=0,r=t.length;r>n;++n)e[t[n]]="atom";return e}(),V=/[+\-*&%=<>!?|\.@]/,X={state:null,stream:null,marked:null,cc:null};return u.lex=l.lex=c.lex=!0,{startState:function(){return{tokenize:t,cc:[],lexical:{indented:-L,column:0,type:"top",align:!1},keywords:Q,indented:0}},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation()),e.eatSpace())return null;J=K=null;var n=t.tokenize(e,t);return"comment"==n?n:(t.lexical.hasOwnProperty("align")||(t.lexical.align=!0),"prefix"==J?n:(K||(K=e.current()),H(t,e,n)))},indent:function(e,n){if(e.tokenize!=t)return 0;var r=n&&n.charAt(0),o=e.lexical,a=o.type,i=r==a;return"stat"==a?o.indented+L:o.align?o.column+(i?0:1):o.indented+(i?0:"alt"==o.info?N:L)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),e.defineMIME("text/x-rustsrc","rust")}); -\ 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("rust",function(){function a(a,b){return S=a,b}function b(b,e){var f=b.next();if('"'==f)return e.tokenize=c,e.tokenize(b,e);if("'"==f)return S="atom",b.eat("\\")?b.skipTo("'")?(b.next(),"string"):"error":(b.next(),b.eat("'")?"string":"error");if("/"==f){if(b.eat("/"))return b.skipToEnd(),"comment";if(b.eat("*"))return e.tokenize=d(1),e.tokenize(b,e)}if("#"==f)return b.eat("[")?(S="open-attr",null):(b.eatWhile(/\w/),a("macro","meta"));if(":"==f&&b.match(":<"))return a("op",null);if(f.match(/\d/)||"."==f&&b.eat(/\d/)){var g=!1;return b.match(/^x[\da-f]+/i)||b.match(/^b[01]+/)||(b.eatWhile(/\d/),b.eat(".")&&(g=!0,b.eatWhile(/\d/)),b.match(/^e[+\-]?\d+/i)&&(g=!0)),g?b.match(/^f(?:32|64)/):b.match(/^[ui](?:8|16|32|64)/),a("atom","number")}return f.match(/[()\[\]{}:;,]/)?a(f,null):"-"==f&&b.eat(">")?a("->",null):f.match(Y)?(b.eatWhile(Y),a("op",null)):(b.eatWhile(/\w/),T=b.current(),b.match(/^::\w/)?(b.backUp(1),a("prefix","variable-2")):e.keywords.propertyIsEnumerable(T)?a(e.keywords[T],T.match(/true|false/)?"atom":"keyword"):a("name","variable"))}function c(c,d){for(var e,f=!1;e=c.next();){if('"'==e&&!f)return d.tokenize=b,a("atom","string");f=!f&&"\\"==e}return a("op","string")}function d(a){return function(c,e){for(var f,g=null;f=c.next();){if("/"==f&&"*"==g){if(1==a){e.tokenize=b;break}return e.tokenize=d(a-1),e.tokenize(c,e)}if("*"==f&&"/"==g)return e.tokenize=d(a+1),e.tokenize(c,e);g=f}return"comment"}}function e(){for(var a=arguments.length-1;a>=0;a--)Z.cc.push(arguments[a])}function f(){return e.apply(null,arguments),!0}function g(a,b){var c=function(){var c=Z.state;c.lexical={indented:c.indented,column:Z.stream.column(),type:a,prev:c.lexical,info:b}};return c.lex=!0,c}function h(){var a=Z.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function i(){Z.state.keywords=X}function j(){Z.state.keywords=W}function k(a,b){function c(d){return","==d?f(a,c):d==b?f():f(c)}return function(d){return d==b?f():e(a,c)}}function l(a,b){return f(g("stat",b),a,h,m)}function m(a){return"}"==a?f():"let"==a?l(u,"let"):"fn"==a?l(y):"type"==a?f(g("stat"),z,n,h,m):"enum"==a?l(A):"mod"==a?l(C):"iface"==a?l(D):"impl"==a?l(E):"open-attr"==a?f(g("]"),k(o,"]"),h):"ignore"==a||a.match(/[\]\);,]/)?f(m):e(g("stat"),o,h,n,m)}function n(a){return";"==a?f():e()}function o(a){return"atom"==a||"name"==a?f(p):"{"==a?f(g("}"),r,h):a.match(/[\[\(]/)?Q(a,o):a.match(/[\]\)\};,]/)?e():"if-style"==a?f(o,o):"else-style"==a||"op"==a?f(o):"for"==a?f(K,w,x,o,o):"alt"==a?f(o,M):"fn"==a?f(y):"macro"==a?f(P):f()}function p(a){return"."==T?f(q):"::<"==T?f(F,p):"op"==a||":"==T?f(o):"("==a||"["==a?Q(a,o):e()}function q(){return T.match(/^\w+$/)?(Z.marked="variable",f(p)):e(o)}function r(a){if("op"==a){if("|"==T)return f(t,h,g("}","block"),m);if("||"==T)return f(h,g("}","block"),m)}return e("mutable"==T||T.match(/^\w+$/)&&":"==Z.stream.peek()&&!Z.stream.match("::",!1)?s(o):m)}function s(a){function b(c){return"mutable"==T||"with"==T?(Z.marked="keyword",f(b)):T.match(/^\w*$/)?(Z.marked="variable",f(b)):":"==c?f(a,b):"}"==c?f():f(b)}return b}function t(a){return"name"==a?(Z.marked="def",f(t)):"op"==a&&"|"==T?f():f(t)}function u(a){return a.match(/[\]\)\};]/)?f():"="==T?f(o,v):","==a?f(u):e(K,w,u)}function v(a){return a.match(/[\]\)\};,]/)?e(u):e(o,v)}function w(a){return":"==a?f(i,H,j):e()}function x(a){return"name"==a&&"in"==T?(Z.marked="keyword",f()):e()}function y(a){return"@"==T||"~"==T?(Z.marked="keyword",f(y)):"name"==a?(Z.marked="def",f(y)):"<"==T?f(F,y):"{"==a?e(o):"("==a?f(g(")"),k(G,")"),h,y):"->"==a?f(i,H,j,y):";"==a?f():f(y)}function z(a){return"name"==a?(Z.marked="def",f(z)):"<"==T?f(F,z):"="==T?f(i,H,j):f(z)}function A(a){return"name"==a?(Z.marked="def",f(A)):"<"==T?f(F,A):"="==T?f(i,H,j,n):"{"==a?f(g("}"),i,B,j,h):f(A)}function B(a){return"}"==a?f():"("==a?f(g(")"),k(H,")"),h,B):(T.match(/^\w+$/)&&(Z.marked="def"),f(B))}function C(a){return"name"==a?(Z.marked="def",f(C)):"{"==a?f(g("}"),m,h):e()}function D(a){return"name"==a?(Z.marked="def",f(D)):"<"==T?f(F,D):"{"==a?f(g("}"),m,h):e()}function E(a){return"<"==T?f(F,E):"of"==T||"for"==T?(Z.marked="keyword",f(H,E)):"name"==a?(Z.marked="def",f(E)):"{"==a?f(g("}"),m,h):e()}function F(){return">"==T?f():","==T?f(F):":"==T?f(H,F):e(H,F)}function G(a){return"name"==a?(Z.marked="def",f(G)):":"==a?f(i,H,j):e()}function H(a){return"name"==a?(Z.marked="variable-3",f(I)):"mutable"==T?(Z.marked="keyword",f(H)):"atom"==a?f(I):"op"==a||"obj"==a?f(H):"fn"==a?f(J):"{"==a?f(g("{"),s(H),h):Q(a,H)}function I(){return"<"==T?f(F):e()}function J(a){return"("==a?f(g("("),k(H,")"),h,J):"->"==a?f(H):e()}function K(a){return"name"==a?(Z.marked="def",f(L)):"atom"==a?f(L):"op"==a?f(K):a.match(/[\]\)\};,]/)?e():Q(a,K)}function L(a){return"op"==a&&"."==T?f():"to"==T?(Z.marked="keyword",f(K)):e()}function M(a){return"{"==a?f(g("}","alt"),N,h):e()}function N(a){return"}"==a?f():"|"==a?f(N):"when"==T?(Z.marked="keyword",f(o,O)):a.match(/[\]\);,]/)?f(N):e(K,O)}function O(a){return"{"==a?f(g("}","alt"),m,h,N):e(N)}function P(a){return a.match(/[\[\(\{]/)?Q(a,o):e()}function Q(a,b){return"["==a?f(g("]"),k(b,"]"),h):"("==a?f(g(")"),k(b,")"),h):"{"==a?f(g("}"),k(b,"}"),h):f()}function R(a,b,c){var d=a.cc;for(Z.state=a,Z.stream=b,Z.marked=null,Z.cc=d;;){var e=d.length?d.pop():m;if(e(S)){for(;d.length&&d[d.length-1].lex;)d.pop()();return Z.marked||c}}}var S,T,U=4,V=2,W={"if":"if-style","while":"if-style",loop:"else-style","else":"else-style","do":"else-style",ret:"else-style",fail:"else-style","break":"atom",cont:"atom","const":"let",resource:"fn",let:"let",fn:"fn","for":"for",alt:"alt",iface:"iface",impl:"impl",type:"type","enum":"enum",mod:"mod",as:"op","true":"atom","false":"atom",assert:"op",check:"op",claim:"op","native":"ignore",unsafe:"ignore","import":"else-style","export":"else-style",copy:"op",log:"op",log_err:"op",use:"op",bind:"op",self:"atom",struct:"enum"},X=function(){for(var a={fn:"fn",block:"fn",obj:"obj"},b="bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "),c=0,d=b.length;d>c;++c)a[b[c]]="atom";return a}(),Y=/[+\-*&%=<>!?|\.@]/,Z={state:null,stream:null,marked:null,cc:null};return h.lex=i.lex=j.lex=!0,{startState:function(){return{tokenize:b,cc:[],lexical:{indented:-U,column:0,type:"top",align:!1},keywords:W,indented:0}},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation()),a.eatSpace())return null;S=T=null;var c=b.tokenize(a,b);return"comment"==c?c:(b.lexical.hasOwnProperty("align")||(b.lexical.align=!0),"prefix"==S?c:(T||(T=a.current()),R(b,a,c)))},indent:function(a,c){if(a.tokenize!=b)return 0;var d=c&&c.charAt(0),e=a.lexical,f=e.type,g=d==f;return"stat"==f?e.indented+U:e.align?e.column+(g?0:1):e.indented+(g?0:"alt"==e.info?V:U)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),a.defineMIME("text/x-rustsrc","rust")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/sass/sass.js b/media/editors/codemirror/mode/sass/sass.js -index 52a66829..6973ece 100644 ---- a/media/editors/codemirror/mode/sass/sass.js -+++ b/media/editors/codemirror/mode/sass/sass.js -@@ -232,7 +232,7 @@ CodeMirror.defineMode("sass", function(config) { - - if (stream.eatWhile(/[\w-]/)){ - if(stream.match(/ *: *[\w-\+\$#!\("']/,false)){ -- return "propery"; -+ return "property"; - } - else if(stream.match(/ *:/,false)){ - indent(state); -diff --git a/media/editors/codemirror/mode/sass/sass.min.js b/media/editors/codemirror/mode/sass/sass.min.js -index 756676e..5d7d218 100644 ---- a/media/editors/codemirror/mode/sass/sass.min.js -+++ b/media/editors/codemirror/mode/sass/sass.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sass",function(e){function t(e){return new RegExp("^"+e.join("|"))}function r(e,t){var r=e.peek();return")"===r?(e.next(),t.tokenizer=f,"operator"):"("===r?(e.next(),e.eatSpace(),"operator"):"'"===r||'"'===r?(t.tokenizer=o(e.next()),"string"):(t.tokenizer=o(")",!1),"string")}function n(e,t){return function(r,n){return r.sol()&&r.indentation()<=e?(n.tokenizer=f,f(r,n)):(t&&r.skipTo("*/")?(r.next(),r.next(),n.tokenizer=f):r.skipToEnd(),"comment")}}function o(e,t){function r(n,o){var a=n.next(),u=n.peek(),c=n.string.charAt(n.pos-2),s="\\"!==a&&u===e||a===e&&"\\"!==c;return s?(a!==e&&t&&n.next(),o.tokenizer=f,"string"):"#"===a&&"{"===u?(o.tokenizer=i(r),n.next(),"operator"):"string"}return null==t&&(t=!0),r}function i(e){return function(t,r){return"}"===t.peek()?(t.next(),r.tokenizer=e,"operator"):f(t,r)}}function a(t){if(0==t.indentCount){t.indentCount++;var r=t.scopes[0].offset,n=r+e.indentUnit;t.scopes.unshift({offset:n})}}function u(e){1!=e.scopes.length&&e.scopes.shift()}function f(e,t){var c=e.peek();if(e.match("/*"))return t.tokenizer=n(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=n(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=i(f),"operator";if('"'===c||"'"===c)return e.next(),t.tokenizer=o(c),"string";if(t.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(t.cursorHalf=0),"unit";if(e.match(p))return e.peek()||(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=r,e.peek()||(t.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(t.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(t.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(l))return e.peek()||(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(t.cursorHalf=0),"attribute";if(!e.peek())return t.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(p))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=r,"atom";if("="===c&&e.match(/^=[\w-]+/))return a(t),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||u(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return a(t),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"propery":e.match(/ *:/,!1)?(a(t),t.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(a(t),"atom");if(":"===c)return e.match(k)?"keyword":(e.next(),t.cursorHalf=1,"operator")}return e.match(l)?"operator":(e.next(),null)}function c(t,r){t.sol()&&(r.indentCount=0);var n=r.tokenizer(t,r),o=t.current();if(("@return"===o||"}"===o)&&u(r),null!==n){for(var i=t.pos-o.length,a=i+e.indentUnit*r.indentCount,f=[],c=0;c","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],l=t(m),k=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:f,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var r=c(e,t);return t.lastToken={style:r,content:e.current()},r},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}); -\ 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("sass",function(a){function b(a){return new RegExp("^"+a.join("|"))}function c(a,b){var c=a.peek();return")"===c?(a.next(),b.tokenizer=i,"operator"):"("===c?(a.next(),a.eatSpace(),"operator"):"'"===c||'"'===c?(b.tokenizer=e(a.next()),"string"):(b.tokenizer=e(")",!1),"string")}function d(a,b){return function(c,d){return c.sol()&&c.indentation()<=a?(d.tokenizer=i,i(c,d)):(b&&c.skipTo("*/")?(c.next(),c.next(),d.tokenizer=i):c.skipToEnd(),"comment")}}function e(a,b){function c(d,e){var g=d.next(),h=d.peek(),j=d.string.charAt(d.pos-2),k="\\"!==g&&h===a||g===a&&"\\"!==j;return k?(g!==a&&b&&d.next(),e.tokenizer=i,"string"):"#"===g&&"{"===h?(e.tokenizer=f(c),d.next(),"operator"):"string"}return null==b&&(b=!0),c}function f(a){return function(b,c){return"}"===b.peek()?(b.next(),c.tokenizer=a,"operator"):i(b,c)}}function g(b){if(0==b.indentCount){b.indentCount++;var c=b.scopes[0].offset,d=c+a.indentUnit;b.scopes.unshift({offset:d})}}function h(a){1!=a.scopes.length&&a.scopes.shift()}function i(a,b){var j=a.peek();if(a.match("/*"))return b.tokenizer=d(a.indentation(),!0),b.tokenizer(a,b);if(a.match("//"))return b.tokenizer=d(a.indentation(),!1),b.tokenizer(a,b);if(a.match("#{"))return b.tokenizer=f(i),"operator";if('"'===j||"'"===j)return a.next(),b.tokenizer=e(j),"string";if(b.cursorHalf){if("#"===j&&(a.next(),a.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return a.peek()||(b.cursorHalf=0),"number";if(a.match(/^-?[0-9\.]+/))return a.peek()||(b.cursorHalf=0),"number";if(a.match(/^(px|em|in)\b/))return a.peek()||(b.cursorHalf=0),"unit";if(a.match(l))return a.peek()||(b.cursorHalf=0),"keyword";if(a.match(/^url/)&&"("===a.peek())return b.tokenizer=c,a.peek()||(b.cursorHalf=0),"atom";if("$"===j)return a.next(),a.eatWhile(/[\w-]/),a.peek()||(b.cursorHalf=0),"variable-3";if("!"===j)return a.next(),a.peek()||(b.cursorHalf=0),a.match(/^[\w]+/)?"keyword":"operator";if(a.match(n))return a.peek()||(b.cursorHalf=0),"operator";if(a.eatWhile(/[\w-]/))return a.peek()||(b.cursorHalf=0),"attribute";if(!a.peek())return b.cursorHalf=0,null}else{if("."===j){if(a.next(),a.match(/^[\w-]+/))return g(b),"atom";if("#"===a.peek())return g(b),"atom"}if("#"===j){if(a.next(),a.match(/^[\w-]+/))return g(b),"atom";if("#"===a.peek())return g(b),"atom"}if("$"===j)return a.next(),a.eatWhile(/[\w-]/),"variable-2";if(a.match(/^-?[0-9\.]+/))return"number";if(a.match(/^(px|em|in)\b/))return"unit";if(a.match(l))return"keyword";if(a.match(/^url/)&&"("===a.peek())return b.tokenizer=c,"atom";if("="===j&&a.match(/^=[\w-]+/))return g(b),"meta";if("+"===j&&a.match(/^\+[\w-]+/))return"variable-3";if("@"===j&&a.match(/@extend/)&&(a.match(/\s*[\w]/)||h(b)),a.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return g(b),"meta";if("@"===j)return a.next(),a.eatWhile(/[\w-]/),"meta";if(a.eatWhile(/[\w-]/))return a.match(/ *: *[\w-\+\$#!\("']/,!1)?"property":a.match(/ *:/,!1)?(g(b),b.cursorHalf=1,"atom"):a.match(/ *,/,!1)?"atom":(g(b),"atom");if(":"===j)return a.match(o)?"keyword":(a.next(),b.cursorHalf=1,"operator")}return a.match(n)?"operator":(a.next(),null)}function j(b,c){b.sol()&&(c.indentCount=0);var d=c.tokenizer(b,c),e=b.current();if(("@return"===e||"}"===e)&&h(c),null!==d){for(var f=b.pos-e.length,g=f+a.indentUnit*c.indentCount,i=[],j=0;j","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],n=b(m),o=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:i,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(a,b){var c=j(a,b);return b.lastToken={style:c,content:a.current()},c},indent:function(a){return a.scopes[0].offset}}}),a.defineMIME("text/x-sass","sass")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/scheme/scheme.js b/media/editors/codemirror/mode/scheme/scheme.js -index 979edc0..2234645 100644 ---- a/media/editors/codemirror/mode/scheme/scheme.js -+++ b/media/editors/codemirror/mode/scheme/scheme.js -@@ -239,6 +239,7 @@ CodeMirror.defineMode("scheme", function () { - return state.indentStack.indent; - }, - -+ closeBrackets: {pairs: "()[]{}\"\""}, - lineComment: ";;" - }; - }); -diff --git a/media/editors/codemirror/mode/scheme/scheme.min.js b/media/editors/codemirror/mode/scheme/scheme.min.js -index b2ef963..f65d002 100644 ---- a/media/editors/codemirror/mode/scheme/scheme.min.js -+++ b/media/editors/codemirror/mode/scheme/scheme.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("scheme",function(){function e(e){for(var t={},n=e.split(" "),r=0;rinteger char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),g=e("define let letrec let* lambda"),x=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),b=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),v=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),k=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),e.eatSpace())return null;var x=null;switch(t.mode){case"string":for(var b,v=!1;null!=(b=e.next());){if('"'==b&&!v){t.mode=!1;break}v=!v&&"\\"==b}x=s;break;case"comment":for(var b,k=!1;null!=(b=e.next());){if("#"==b&&k){t.mode=!1;break}k="|"==b}x=d;break;case"s-expr-comment":if(t.mode=!1,"("!=e.peek()&&"["!=e.peek()){e.eatWhile(/[^/s]/),x=d;break}t.sExprComment=0;default:var y=e.next();if('"'==y)t.mode="string",x=s;else if("'"==y)x=u;else if("#"==y)if(e.eat("|"))t.mode="comment",x=d;else if(e.eat(/[tf]/i))x=u;else if(e.eat(";"))t.mode="s-expr-comment",x=d;else{var w=null,E=!1,q=!0;e.eat(/[ei]/i)?E=!0:e.backUp(1),e.match(/^#b/i)?w=i:e.match(/^#o/i)?w=a:e.match(/^#x/i)?w=o:e.match(/^#d/i)?w=c:e.match(/^[-+0-9.]/,!1)?(q=!1,w=c):E||e.eat("#"),null!=w&&(q&&!E&&e.match(/^#[ei]/i),w(e)&&(x=m))}else if(/^[-+0-9.]/.test(y)&&c(e,!0))x=m;else if(";"==y)e.skipToEnd(),x=d;else if("("==y||"["==y){for(var S,C="",$=e.column();null!=(S=e.eat(/[^\s\(\[\;\)\]]/));)C+=S;C.length>0&&g.propertyIsEnumerable(C)?n(t,$+f,y):(e.eatSpace(),e.eol()||";"==e.peek()?n(t,$+1,y):n(t,$+e.current().length,y)),e.backUp(e.current().length-1),"number"==typeof t.sExprComment&&t.sExprComment++,x=p}else")"==y||"]"==y?(x=p,null!=t.indentStack&&t.indentStack.type==(")"==y?"(":"[")&&(r(t),"number"==typeof t.sExprComment&&0==--t.sExprComment&&(x=d,t.sExprComment=!1))):(e.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/),x=h&&h.propertyIsEnumerable(e.current())?l:"variable")}return"number"==typeof t.sExprComment?d:x},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},lineComment:";;"}}),e.defineMIME("text/x-scheme","scheme")}); -\ 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("scheme",function(){function a(a){for(var b={},c=a.split(" "),d=0;dinteger char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),q=a("define let letrec let* lambda"),r=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),s=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),t=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),u=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(a,b){if(null==b.indentStack&&a.sol()&&(b.indentation=a.indentation()),a.eatSpace())return null;var r=null;switch(b.mode){case"string":for(var s,t=!1;null!=(s=a.next());){if('"'==s&&!t){b.mode=!1;break}t=!t&&"\\"==s}r=k;break;case"comment":for(var s,u=!1;null!=(s=a.next());){if("#"==s&&u){b.mode=!1;break}u="|"==s}r=j;break;case"s-expr-comment":if(b.mode=!1,"("!=a.peek()&&"["!=a.peek()){a.eatWhile(/[^/s]/),r=j;break}b.sExprComment=0;default:var v=a.next();if('"'==v)b.mode="string",r=k;else if("'"==v)r=l;else if("#"==v)if(a.eat("|"))b.mode="comment",r=j;else if(a.eat(/[tf]/i))r=l;else if(a.eat(";"))b.mode="s-expr-comment",r=j;else{var w=null,x=!1,y=!0;a.eat(/[ei]/i)?x=!0:a.backUp(1),a.match(/^#b/i)?w=e:a.match(/^#o/i)?w=f:a.match(/^#x/i)?w=h:a.match(/^#d/i)?w=g:a.match(/^[-+0-9.]/,!1)?(y=!1,w=g):x||a.eat("#"),null!=w&&(y&&!x&&a.match(/^#[ei]/i),w(a)&&(r=m))}else if(/^[-+0-9.]/.test(v)&&g(a,!0))r=m;else if(";"==v)a.skipToEnd(),r=j;else if("("==v||"["==v){for(var z,A="",B=a.column();null!=(z=a.eat(/[^\s\(\[\;\)\]]/));)A+=z;A.length>0&&q.propertyIsEnumerable(A)?c(b,B+o,v):(a.eatSpace(),a.eol()||";"==a.peek()?c(b,B+1,v):c(b,B+a.current().length,v)),a.backUp(a.current().length-1),"number"==typeof b.sExprComment&&b.sExprComment++,r=n}else")"==v||"]"==v?(r=n,null!=b.indentStack&&b.indentStack.type==(")"==v?"(":"[")&&(d(b),"number"==typeof b.sExprComment&&0==--b.sExprComment&&(r=j,b.sExprComment=!1))):(a.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/),r=p&&p.propertyIsEnumerable(a.current())?i:"variable")}return"number"==typeof b.sExprComment?j:r},indent:function(a){return null==a.indentStack?a.indentation:a.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:";;"}}),a.defineMIME("text/x-scheme","scheme")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/shell/shell.min.js b/media/editors/codemirror/mode/shell/shell.min.js -index 08b6fe2..b9904fa 100644 ---- a/media/editors/codemirror/mode/shell/shell.min.js -+++ b/media/editors/codemirror/mode/shell/shell.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}); -\ 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("shell",function(){function a(a,b){for(var c=b.split(" "),d=0;d1&&a.eat("$");var e=a.next(),f=/\w/;return"{"===e&&(f=/[^}]/),"("===e?(b.tokens[0]=c(")"),d(a,b)):(/\d/.test(e)||(a.eatWhile(f),a.eat("}")),b.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(a,b){return d(a,b)},lineComment:"#",fold:"brace"}}),a.defineMIME("text/x-sh","shell")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/shell/test.js b/media/editors/codemirror/mode/shell/test.js -deleted file mode 100644 -index a413b5a..0000000 ---- a/media/editors/codemirror/mode/shell/test.js -+++ /dev/null -@@ -1,58 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({}, "shell"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- -- MT("var", -- "text [def $var] text"); -- MT("varBraces", -- "text[def ${var}]text"); -- MT("varVar", -- "text [def $a$b] text"); -- MT("varBracesVarBraces", -- "text[def ${a}${b}]text"); -- -- MT("singleQuotedVar", -- "[string 'text $var text']"); -- MT("singleQuotedVarBraces", -- "[string 'text ${var} text']"); -- -- MT("doubleQuotedVar", -- '[string "text ][def $var][string text"]'); -- MT("doubleQuotedVarBraces", -- '[string "text][def ${var}][string text"]'); -- MT("doubleQuotedVarPunct", -- '[string "text ][def $@][string text"]'); -- MT("doubleQuotedVarVar", -- '[string "][def $a$b][string "]'); -- MT("doubleQuotedVarBracesVarBraces", -- '[string "][def ${a}${b}][string "]'); -- -- MT("notAString", -- "text\\'text"); -- MT("escapes", -- "outside\\'\\\"\\`\\\\[string \"inside\\`\\'\\\"\\\\`\\$notAVar\"]outside\\$\\(notASubShell\\)"); -- -- MT("subshell", -- "[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."); -- MT("doubleQuotedSubshell", -- "[builtin echo] [string \"][quote $(whoami)][string 's log, stardate `date`.\"]"); -- -- MT("hashbang", -- "[meta #!/bin/bash]"); -- MT("comment", -- "text [comment # Blurb]"); -- -- MT("numbers", -- "[number 0] [number 1] [number 2]"); -- MT("keywords", -- "[keyword while] [atom true]; [keyword do]", -- " [builtin sleep] [number 3]", -- "[keyword done]"); -- MT("options", -- "[builtin ls] [attribute -l] [attribute --human-readable]"); -- MT("operator", -- "[def var][operator =]value"); --})(); -diff --git a/media/editors/codemirror/mode/shell/test.min.js b/media/editors/codemirror/mode/shell/test.min.js -deleted file mode 100644 -index cc88c5b..0000000 ---- a/media/editors/codemirror/mode/shell/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({},"shell");t("var","text [def $var] text"),t("varBraces","text[def ${var}]text"),t("varVar","text [def $a$b] text"),t("varBracesVarBraces","text[def ${a}${b}]text"),t("singleQuotedVar","[string 'text $var text']"),t("singleQuotedVarBraces","[string 'text ${var} text']"),t("doubleQuotedVar",'[string "text ][def $var][string text"]'),t("doubleQuotedVarBraces",'[string "text][def ${var}][string text"]'),t("doubleQuotedVarPunct",'[string "text ][def $@][string text"]'),t("doubleQuotedVarVar",'[string "][def $a$b][string "]'),t("doubleQuotedVarBracesVarBraces",'[string "][def ${a}${b}][string "]'),t("notAString","text\\'text"),t("escapes",'outside\\\'\\"\\`\\\\[string "inside\\`\\\'\\"\\\\`\\$notAVar"]outside\\$\\(notASubShell\\)'),t("subshell","[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."),t("doubleQuotedSubshell",'[builtin echo] [string "][quote $(whoami)][string \'s log, stardate `date`."]'),t("hashbang","[meta #!/bin/bash]"),t("comment","text [comment # Blurb]"),t("numbers","[number 0] [number 1] [number 2]"),t("keywords","[keyword while] [atom true]; [keyword do]"," [builtin sleep] [number 3]","[keyword done]"),t("options","[builtin ls] [attribute -l] [attribute --human-readable]"),t("operator","[def var][operator =]value")}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/sieve/sieve.min.js b/media/editors/codemirror/mode/sieve/sieve.min.js -index 255c236..94db61c 100644 ---- a/media/editors/codemirror/mode/sieve/sieve.min.js -+++ b/media/editors/codemirror/mode/sieve/sieve.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sieve",function(e){function n(e){for(var n={},t=e.split(" "),r=0;rt&&(t=0),t*f},electricChars:"}"}}),e.defineMIME("application/sieve","sieve")}); -\ 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("sieve",function(a){function b(a){for(var b={},c=a.split(" "),d=0;dc&&(c=0),c*i},electricChars:"}"}}),a.defineMIME("application/sieve","sieve")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/slim/slim.min.js b/media/editors/codemirror/mode/slim/slim.min.js -index e759bef..e1f94af 100644 ---- a/media/editors/codemirror/mode/slim/slim.min.js -+++ b/media/editors/codemirror/mode/slim/slim.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("slim",function(e){function n(t,e,n){var i=function(i,r){return r.tokenize=e,i.pos-1&&(e.tokenize=n(t.pos,e.tokenize,o),t.backUp(u.length-a-r)),o}function r(t,e){t.stack={parent:t.stack,style:"continuation",indented:e,tokenize:t.line},t.line=t.tokenize}function o(t){t.line==t.tokenize&&(t.line=t.stack.tokenize,t.stack=t.stack.parent)}function u(t,e){return function(n,i){if(o(i),n.match(/^\\$/))return r(i,t),"lineContinuation";var u=e(n,i);return n.eol()&&n.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)&&n.backUp(1),u}}function a(t,e){return function(n,i){o(i);var u=e(n,i);return n.eol()&&n.current().match(/,$/)&&r(i,t),u}}function c(t,e){return function(n,i){var r=n.peek();return r==t&&1==i.rubyState.tokenize.length?(n.next(),i.tokenize=e,"closeAttributeTag"):s(n,i)}}function l(t){var e,n=function(n,i){if(1==i.rubyState.tokenize.length&&!i.rubyState.context.prev){if(n.backUp(1),n.eatSpace())return i.rubyState=e,i.tokenize=t,t(n,i);n.next()}return s(n,i)};return function(t,i){return e=i.rubyState,i.rubyState=Z.startState(),i.tokenize=n,s(t,i)}}function s(t,e){return Z.token(t,e.rubyState)}function k(t,e){return t.match(/^\\$/)?"lineContinuation":d(t,e)}function d(t,e){return t.match(/^#\{/)?(e.tokenize=c("}",e.tokenize),null):i(t,e,/[^\\]#\{/,1,P.token(t,e.htmlState))}function m(t){return function(e,n){var i=k(e,n);return e.eol()&&(n.tokenize=t),i}}function f(t,e,n){return e.stack={parent:e.stack,style:"html",indented:t.column()+n,tokenize:e.line},e.line=e.tokenize=d,null}function b(t,e){return t.skipToEnd(),e.stack.style}function z(t,e){return e.stack={parent:e.stack,style:"comment",indented:e.indented+1,tokenize:e.line},e.line=b,b(t,e)}function p(t,e){return t.eat(e.stack.endQuote)?(e.line=e.stack.line,e.tokenize=e.stack.tokenize,e.stack=e.stack.parent,null):t.match(K)?(e.tokenize=x,"slimAttribute"):(t.next(),null)}function x(t,e){return t.match(/^==?/)?(e.tokenize=h,null):p(t,e)}function h(t,e){var n=t.peek();return'"'==n||"'"==n?(e.tokenize=q(n,"string",!0,!1,p),t.next(),e.tokenize(t,e)):"["==n?l(p)(t,e):t.match(/^(true|false|nil)\b/)?(e.tokenize=p,"keyword"):l(p)(t,e)}function y(t,e,n){return t.stack={parent:t.stack,style:"wrapper",indented:t.indented+1,tokenize:n,line:t.line,endQuote:e},t.line=t.tokenize=p,null}function S(e,n){if(e.match(/^#\{/))return n.tokenize=c("}",n.tokenize),null;var i=new t.StringStream(e.string.slice(n.stack.indented),e.tabSize);i.pos=e.pos-n.stack.indented,i.start=e.start-n.stack.indented,i.lastColumnPos=e.lastColumnPos-n.stack.indented,i.lastColumnValue=e.lastColumnValue-n.stack.indented;var r=n.subMode.token(i,n.subState);return e.pos=i.pos+n.stack.indented,r}function v(t,e){return e.stack.indented=t.column(),e.line=e.tokenize=S,e.tokenize(t,e)}function w(n){var i=D[n],r=t.mimeModes[i];if(r)return t.getMode(e,r);var o=t.modes[i];return o?o(e,{name:i}):t.getMode(e,"null")}function g(t){return _.hasOwnProperty(t)?_[t]:_[t]=w(t)}function M(t,e){var n=g(t),i=n.startState&&n.startState();return e.subMode=n,e.subState=i,e.stack={parent:e.stack,style:"sub",indented:e.indented+1,tokenize:e.line},e.line=e.tokenize=v,"slimSubmode"}function C(t){return t.skipToEnd(),"slimDoctype"}function E(t,e){var n=t.peek();if("<"==n)return(e.tokenize=m(e.tokenize))(t,e);if(t.match(/^[|']/))return f(t,e,1);if(t.match(/^\/(!|\[\w+])?/))return z(t,e);if(t.match(/^(-|==?[<>]?)/))return e.tokenize=u(t.column(),a(t.column(),s)),"slimSwitch";if(t.match(/^doctype\b/))return e.tokenize=C,"keyword";var i=t.match(Q);return i?M(i[1],e):L(t,e)}function A(t,e){return e.startOfLine?E(t,e):L(t,e)}function L(t,e){return t.eat("*")?(e.tokenize=l($),null):t.match(H)?(e.tokenize=$,"slimTag"):T(t,e)}function $(t,e){return t.match(/^(<>?|>e.indented&&"slimSubmode"!=e.last;)e.line=e.tokenize=e.stack.tokenize,e.stack=e.stack.parent,e.subMode=null,e.subState=null;if(t.eatSpace())return null;var n=e.tokenize(t,e);return e.startOfLine=!1,n&&(e.last=n),V.hasOwnProperty(n)?V[n]:n},blankLine:function(t){return t.subMode&&t.subMode.blankLine?t.subMode.blankLine(t.subState):void 0},innerMode:function(t){return t.subMode?{state:t.subState,mode:t.subMode}:{state:t,mode:X}}};return X},"htmlmixed","ruby"),t.defineMIME("text/x-slim","slim"),t.defineMIME("application/x-slim","slim")}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("slim",function(b){function c(a,b,c){var d=function(d,e){return e.tokenize=b,d.pos-1&&(b.tokenize=c(a.pos,b.tokenize,f),a.backUp(g.length-h-e)),f}function e(a,b){a.stack={parent:a.stack,style:"continuation",indented:b,tokenize:a.line},a.line=a.tokenize}function f(a){a.line==a.tokenize&&(a.line=a.stack.tokenize,a.stack=a.stack.parent)}function g(a,b){return function(c,d){if(f(d),c.match(/^\\$/))return e(d,a),"lineContinuation";var g=b(c,d);return c.eol()&&c.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)&&c.backUp(1),g}}function h(a,b){return function(c,d){f(d);var g=b(c,d);return c.eol()&&c.current().match(/,$/)&&e(d,a),g}}function i(a,b){return function(c,d){var e=c.peek();return e==a&&1==d.rubyState.tokenize.length?(c.next(),d.tokenize=b,"closeAttributeTag"):k(c,d)}}function j(a){var b,c=function(c,d){if(1==d.rubyState.tokenize.length&&!d.rubyState.context.prev){if(c.backUp(1),c.eatSpace())return d.rubyState=b,d.tokenize=a,a(c,d);c.next()}return k(c,d)};return function(a,d){return b=d.rubyState,d.rubyState=N.startState(),d.tokenize=c,k(a,d)}}function k(a,b){return N.token(a,b.rubyState)}function l(a,b){return a.match(/^\\$/)?"lineContinuation":m(a,b)}function m(a,b){return a.match(/^#\{/)?(b.tokenize=i("}",b.tokenize),null):d(a,b,/[^\\]#\{/,1,M.token(a,b.htmlState))}function n(a){return function(b,c){var d=l(b,c);return b.eol()&&(c.tokenize=a),d}}function o(a,b,c){return b.stack={parent:b.stack,style:"html",indented:a.column()+c,tokenize:b.line},b.line=b.tokenize=m,null}function p(a,b){return a.skipToEnd(),b.stack.style}function q(a,b){return b.stack={parent:b.stack,style:"comment",indented:b.indented+1,tokenize:b.line},b.line=p,p(a,b)}function r(a,b){return a.eat(b.stack.endQuote)?(b.line=b.stack.line,b.tokenize=b.stack.tokenize,b.stack=b.stack.parent,null):a.match(X)?(b.tokenize=s,"slimAttribute"):(a.next(),null)}function s(a,b){return a.match(/^==?/)?(b.tokenize=t,null):r(a,b)}function t(a,b){var c=a.peek();return'"'==c||"'"==c?(b.tokenize=K(c,"string",!0,!1,r),a.next(),b.tokenize(a,b)):"["==c?j(r)(a,b):a.match(/^(true|false|nil)\b/)?(b.tokenize=r,"keyword"):j(r)(a,b)}function u(a,b,c){return a.stack={parent:a.stack,style:"wrapper",indented:a.indented+1,tokenize:c,line:a.line,endQuote:b},a.line=a.tokenize=r,null}function v(b,c){if(b.match(/^#\{/))return c.tokenize=i("}",c.tokenize),null;var d=new a.StringStream(b.string.slice(c.stack.indented),b.tabSize);d.pos=b.pos-c.stack.indented,d.start=b.start-c.stack.indented,d.lastColumnPos=b.lastColumnPos-c.stack.indented,d.lastColumnValue=b.lastColumnValue-c.stack.indented;var e=c.subMode.token(d,c.subState);return b.pos=d.pos+c.stack.indented,e}function w(a,b){return b.stack.indented=a.column(),b.line=b.tokenize=v,b.tokenize(a,b)}function x(c){var d=P[c],e=a.mimeModes[d];if(e)return a.getMode(b,e);var f=a.modes[d];return f?f(b,{name:d}):a.getMode(b,"null")}function y(a){return O.hasOwnProperty(a)?O[a]:O[a]=x(a)}function z(a,b){var c=y(a),d=c.startState&&c.startState();return b.subMode=c,b.subState=d,b.stack={parent:b.stack,style:"sub",indented:b.indented+1,tokenize:b.line},b.line=b.tokenize=w,"slimSubmode"}function A(a,b){return a.skipToEnd(),"slimDoctype"}function B(a,b){var c=a.peek();if("<"==c)return(b.tokenize=n(b.tokenize))(a,b);if(a.match(/^[|']/))return o(a,b,1);if(a.match(/^\/(!|\[\w+])?/))return q(a,b);if(a.match(/^(-|==?[<>]?)/))return b.tokenize=g(a.column(),h(a.column(),k)),"slimSwitch";if(a.match(/^doctype\b/))return b.tokenize=A,"keyword";var d=a.match(Q);return d?z(d[1],b):D(a,b)}function C(a,b){return b.startOfLine?B(a,b):D(a,b)}function D(a,b){return a.eat("*")?(b.tokenize=j(E),null):a.match(V)?(b.tokenize=E,"slimTag"):F(a,b)}function E(a,b){return a.match(/^(<>?|>b.indented&&"slimSubmode"!=b.last;)b.line=b.tokenize=b.stack.tokenize,b.stack=b.stack.parent,b.subMode=null,b.subState=null;if(a.eatSpace())return null;var c=b.tokenize(a,b);return b.startOfLine=!1,c&&(b.last=c),R.hasOwnProperty(c)?R[c]:c},blankLine:function(a){return a.subMode&&a.subMode.blankLine?a.subMode.blankLine(a.subState):void 0},innerMode:function(a){return a.subMode?{state:a.subState,mode:a.subMode}:{state:a,mode:$}}};return $},"htmlmixed","ruby"),a.defineMIME("text/x-slim","slim"),a.defineMIME("application/x-slim","slim")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/slim/test.js b/media/editors/codemirror/mode/slim/test.js -deleted file mode 100644 -index be4ddac..0000000 ---- a/media/editors/codemirror/mode/slim/test.js -+++ /dev/null -@@ -1,96 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh -- --(function() { -- var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "slim"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- -- // Requires at least one media query -- MT("elementName", -- "[tag h1] Hey There"); -- -- MT("oneElementPerLine", -- "[tag h1] Hey There .h2"); -- -- MT("idShortcut", -- "[attribute&def #test] Hey There"); -- -- MT("tagWithIdShortcuts", -- "[tag h1][attribute&def #test] Hey There"); -- -- MT("classShortcut", -- "[attribute&qualifier .hello] Hey There"); -- -- MT("tagWithIdAndClassShortcuts", -- "[tag h1][attribute&def #test][attribute&qualifier .hello] Hey There"); -- -- MT("docType", -- "[keyword doctype] xml"); -- -- MT("comment", -- "[comment / Hello WORLD]"); -- -- MT("notComment", -- "[tag h1] This is not a / comment "); -- -- MT("attributes", -- "[tag a]([attribute title]=[string \"test\"]) [attribute href]=[string \"link\"]}"); -- -- MT("multiLineAttributes", -- "[tag a]([attribute title]=[string \"test\"]", -- " ) [attribute href]=[string \"link\"]}"); -- -- MT("htmlCode", -- "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"); -- -- MT("rubyBlock", -- "[operator&special =][variable-2 @item]"); -- -- MT("selectorRubyBlock", -- "[tag a][attribute&qualifier .test][operator&special =] [variable-2 @item]"); -- -- MT("nestedRubyBlock", -- "[tag a]", -- " [operator&special =][variable puts] [string \"test\"]"); -- -- MT("multilinePlaintext", -- "[tag p]", -- " | Hello,", -- " World"); -- -- MT("multilineRuby", -- "[tag p]", -- " [comment /# this is a comment]", -- " [comment and this is a comment too]", -- " | Date/Time", -- " [operator&special -] [variable now] [operator =] [tag DateTime][operator .][property now]", -- " [tag strong][operator&special =] [variable now]", -- " [operator&special -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])", -- " [operator&special =][string \"Happy\"]", -- " [operator&special =][string \"Belated\"]", -- " [operator&special =][string \"Birthday\"]"); -- -- MT("multilineComment", -- "[comment /]", -- " [comment Multiline]", -- " [comment Comment]"); -- -- MT("hamlAfterRubyTag", -- "[attribute&qualifier .block]", -- " [tag strong][operator&special =] [variable now]", -- " [attribute&qualifier .test]", -- " [operator&special =][variable now]", -- " [attribute&qualifier .right]"); -- -- MT("stretchedRuby", -- "[operator&special =] [variable puts] [string \"Hello\"],", -- " [string \"World\"]"); -- -- MT("interpolationInHashAttribute", -- "[tag div]{[attribute id] = [string \"]#{[variable test]}[string _]#{[variable ting]}[string \"]} test"); -- -- MT("interpolationInHTMLAttribute", -- "[tag div]([attribute title]=[string \"]#{[variable test]}[string _]#{[variable ting]()}[string \"]) Test"); --})(); -diff --git a/media/editors/codemirror/mode/slim/test.min.js b/media/editors/codemirror/mode/slim/test.min.js -deleted file mode 100644 -index 60f0661..0000000 ---- a/media/editors/codemirror/mode/slim/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4,indentUnit:2},"slim");t("elementName","[tag h1] Hey There"),t("oneElementPerLine","[tag h1] Hey There .h2"),t("idShortcut","[attribute&def #test] Hey There"),t("tagWithIdShortcuts","[tag h1][attribute&def #test] Hey There"),t("classShortcut","[attribute&qualifier .hello] Hey There"),t("tagWithIdAndClassShortcuts","[tag h1][attribute&def #test][attribute&qualifier .hello] Hey There"),t("docType","[keyword doctype] xml"),t("comment","[comment / Hello WORLD]"),t("notComment","[tag h1] This is not a / comment "),t("attributes",'[tag a]([attribute title]=[string "test"]) [attribute href]=[string "link"]}'),t("multiLineAttributes",'[tag a]([attribute title]=[string "test"]',' ) [attribute href]=[string "link"]}'),t("htmlCode","[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket ]"),t("rubyBlock","[operator&special =][variable-2 @item]"),t("selectorRubyBlock","[tag a][attribute&qualifier .test][operator&special =] [variable-2 @item]"),t("nestedRubyBlock","[tag a]",' [operator&special =][variable puts] [string "test"]'),t("multilinePlaintext","[tag p]"," | Hello,"," World"),t("multilineRuby","[tag p]"," [comment /# this is a comment]"," [comment and this is a comment too]"," | Date/Time"," [operator&special -] [variable now] [operator =] [tag DateTime][operator .][property now]"," [tag strong][operator&special =] [variable now]",' [operator&special -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string "December 31, 2006"])',' [operator&special =][string "Happy"]',' [operator&special =][string "Belated"]',' [operator&special =][string "Birthday"]'),t("multilineComment","[comment /]"," [comment Multiline]"," [comment Comment]"),t("hamlAfterRubyTag","[attribute&qualifier .block]"," [tag strong][operator&special =] [variable now]"," [attribute&qualifier .test]"," [operator&special =][variable now]"," [attribute&qualifier .right]"),t("stretchedRuby",'[operator&special =] [variable puts] [string "Hello"],',' [string "World"]'),t("interpolationInHashAttribute",'[tag div]{[attribute id] = [string "]#{[variable test]}[string _]#{[variable ting]}[string "]} test'),t("interpolationInHTMLAttribute",'[tag div]([attribute title]=[string "]#{[variable test]}[string _]#{[variable ting]()}[string "]) Test')}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/smalltalk/smalltalk.min.js b/media/editors/codemirror/mode/smalltalk/smalltalk.min.js -index cf3f1f0..e11cbcd 100644 ---- a/media/editors/codemirror/mode/smalltalk/smalltalk.min.js -+++ b/media/editors/codemirror/mode/smalltalk/smalltalk.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("smalltalk",function(e){var t=/[+\-\/\\*~<>=@%|&?!.,:;^]/,n=/true|false|nil|self|super|thisContext/,i=function(e,t){this.next=e,this.parent=t},a=function(e,t,n){this.name=e,this.context=t,this.eos=n},r=function(){this.context=new i(o,null),this.expectVariable=!0,this.indentation=0,this.userIndentationDelta=0};r.prototype.userIndent=function(t){this.userIndentationDelta=t>0?t/e.indentUnit-this.indentation:0};var o=function(e,r,o){var d=new a(null,r,!1),f=e.next();return'"'===f?d=s(e,new i(s,r)):"'"===f?d=u(e,new i(u,r)):"#"===f?"'"===e.peek()?(e.next(),d=c(e,new i(c,r))):d.name=e.eatWhile(/[^\s.{}\[\]()]/)?"string-2":"meta":"$"===f?("<"===e.next()&&(e.eatWhile(/[^\s>]/),e.next()),d.name="string-2"):"|"===f&&o.expectVariable?d.context=new i(l,r):/[\[\]{}()]/.test(f)?(d.name="bracket",d.eos=/[\[{(]/.test(f),"["===f?o.indentation++:"]"===f&&(o.indentation=Math.max(0,o.indentation-1))):t.test(f)?(e.eatWhile(t),d.name="operator",d.eos=";"!==f):/\d/.test(f)?(e.eatWhile(/[\w\d]/),d.name="number"):/[\w_]/.test(f)?(e.eatWhile(/[\w\d_]/),d.name=o.expectVariable?n.test(e.current())?"keyword":"variable":null):d.eos=o.expectVariable,d},s=function(e,t){return e.eatWhile(/[^"]/),new a("comment",e.eat('"')?t.parent:t,!0)},u=function(e,t){return e.eatWhile(/[^']/),new a("string",e.eat("'")?t.parent:t,!1)},c=function(e,t){return e.eatWhile(/[^']/),new a("string-2",e.eat("'")?t.parent:t,!1)},l=function(e,t){var n=new a(null,t,!1),i=e.next();return"|"===i?(n.context=t.parent,n.eos=!0):(e.eatWhile(/[^|]/),n.name="variable"),n};return{startState:function(){return new r},token:function(e,t){if(t.userIndent(e.indentation()),e.eatSpace())return null;var n=t.context.next(e,t.context,t);return t.context=n.context,t.expectVariable=n.eos,n.name},blankLine:function(e){e.userIndent(0)},indent:function(t,n){var i=t.context.next===o&&n&&"]"===n.charAt(0)?-1:t.userIndentationDelta;return(t.indentation+i)*e.indentUnit},electricChars:"]"}}),e.defineMIME("text/x-stsrc",{name:"smalltalk"})}); -\ 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("smalltalk",function(a){var b=/[+\-\/\\*~<>=@%|&?!.,:;^]/,c=/true|false|nil|self|super|thisContext/,d=function(a,b){this.next=a,this.parent=b},e=function(a,b,c){this.name=a,this.context=b,this.eos=c},f=function(){this.context=new d(g,null),this.expectVariable=!0,this.indentation=0,this.userIndentationDelta=0};f.prototype.userIndent=function(b){this.userIndentationDelta=b>0?b/a.indentUnit-this.indentation:0};var g=function(a,f,g){var l=new e(null,f,!1),m=a.next();return'"'===m?l=h(a,new d(h,f)):"'"===m?l=i(a,new d(i,f)):"#"===m?"'"===a.peek()?(a.next(),l=j(a,new d(j,f))):a.eatWhile(/[^\s.{}\[\]()]/)?l.name="string-2":l.name="meta":"$"===m?("<"===a.next()&&(a.eatWhile(/[^\s>]/),a.next()),l.name="string-2"):"|"===m&&g.expectVariable?l.context=new d(k,f):/[\[\]{}()]/.test(m)?(l.name="bracket",l.eos=/[\[{(]/.test(m),"["===m?g.indentation++:"]"===m&&(g.indentation=Math.max(0,g.indentation-1))):b.test(m)?(a.eatWhile(b),l.name="operator",l.eos=";"!==m):/\d/.test(m)?(a.eatWhile(/[\w\d]/),l.name="number"):/[\w_]/.test(m)?(a.eatWhile(/[\w\d_]/),l.name=g.expectVariable?c.test(a.current())?"keyword":"variable":null):l.eos=g.expectVariable,l},h=function(a,b){return a.eatWhile(/[^"]/),new e("comment",a.eat('"')?b.parent:b,!0)},i=function(a,b){return a.eatWhile(/[^']/),new e("string",a.eat("'")?b.parent:b,!1)},j=function(a,b){return a.eatWhile(/[^']/),new e("string-2",a.eat("'")?b.parent:b,!1)},k=function(a,b){var c=new e(null,b,!1),d=a.next();return"|"===d?(c.context=b.parent,c.eos=!0):(a.eatWhile(/[^|]/),c.name="variable"),c};return{startState:function(){return new f},token:function(a,b){if(b.userIndent(a.indentation()),a.eatSpace())return null;var c=b.context.next(a,b.context,b);return b.context=c.context,b.expectVariable=c.eos,c.name},blankLine:function(a){a.userIndent(0)},indent:function(b,c){var d=b.context.next===g&&c&&"]"===c.charAt(0)?-1:b.userIndentationDelta;return(b.indentation+d)*a.indentUnit},electricChars:"]"}}),a.defineMIME("text/x-stsrc",{name:"smalltalk"})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/smarty/smarty.js b/media/editors/codemirror/mode/smarty/smarty.js -index bb05324..6e0fbed 100644 ---- a/media/editors/codemirror/mode/smarty/smarty.js -+++ b/media/editors/codemirror/mode/smarty/smarty.js -@@ -13,134 +13,123 @@ - else // Plain browser env - mod(CodeMirror); - })(function(CodeMirror) { --"use strict"; -- --CodeMirror.defineMode("smarty", function(config) { - "use strict"; - -- // our default settings; check to see if they're overridden -- var settings = { -- rightDelimiter: '}', -- leftDelimiter: '{', -- smartyVersion: 2 // for backward compatibility -- }; -- if (config.hasOwnProperty("leftDelimiter")) { -- settings.leftDelimiter = config.leftDelimiter; -- } -- if (config.hasOwnProperty("rightDelimiter")) { -- settings.rightDelimiter = config.rightDelimiter; -- } -- if (config.hasOwnProperty("smartyVersion") && config.smartyVersion === 3) { -- settings.smartyVersion = 3; -- } -- -- var keyFunctions = ["debug", "extends", "function", "include", "literal"]; -- var last; -- var regs = { -- operatorChars: /[+\-*&%=<>!?]/, -- validIdentifier: /[a-zA-Z0-9_]/, -- stringChar: /['"]/ -- }; -- -- var helpers = { -- cont: function(style, lastType) { -+ CodeMirror.defineMode("smarty", function(config, parserConf) { -+ var rightDelimiter = parserConf.rightDelimiter || "}"; -+ var leftDelimiter = parserConf.leftDelimiter || "{"; -+ var version = parserConf.version || 2; -+ var baseMode = CodeMirror.getMode(config, parserConf.baseMode || "null"); -+ -+ var keyFunctions = ["debug", "extends", "function", "include", "literal"]; -+ var regs = { -+ operatorChars: /[+\-*&%=<>!?]/, -+ validIdentifier: /[a-zA-Z0-9_]/, -+ stringChar: /['"]/ -+ }; -+ -+ var last; -+ function cont(style, lastType) { - last = lastType; - return style; -- }, -- chain: function(stream, state, parser) { -+ } -+ -+ function chain(stream, state, parser) { - state.tokenize = parser; - return parser(stream, state); - } -- }; - -+ // Smarty 3 allows { and } surrounded by whitespace to NOT slip into Smarty mode -+ function doesNotCount(stream, pos) { -+ if (pos == null) pos = stream.pos; -+ return version === 3 && leftDelimiter == "{" && -+ (pos == stream.string.length || /\s/.test(stream.string.charAt(pos))); -+ } - -- // our various parsers -- var parsers = { -- -- // the main tokenizer -- tokenizer: function(stream, state) { -- if (stream.match(settings.leftDelimiter, true)) { -+ function tokenTop(stream, state) { -+ var string = stream.string; -+ for (var scan = stream.pos;;) { -+ var nextMatch = string.indexOf(leftDelimiter, scan); -+ scan = nextMatch + leftDelimiter.length; -+ if (nextMatch == -1 || !doesNotCount(stream, nextMatch + leftDelimiter.length)) break; -+ } -+ if (nextMatch == stream.pos) { -+ stream.match(leftDelimiter); - if (stream.eat("*")) { -- return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter)); -+ return chain(stream, state, tokenBlock("comment", "*" + rightDelimiter)); - } else { -- // Smarty 3 allows { and } surrounded by whitespace to NOT slip into Smarty mode - state.depth++; -- var isEol = stream.eol(); -- var isFollowedByWhitespace = /\s/.test(stream.peek()); -- if (settings.smartyVersion === 3 && settings.leftDelimiter === "{" && (isEol || isFollowedByWhitespace)) { -- state.depth--; -- return null; -- } else { -- state.tokenize = parsers.smarty; -- last = "startTag"; -- return "tag"; -- } -+ state.tokenize = tokenSmarty; -+ last = "startTag"; -+ return "tag"; - } -- } else { -- stream.next(); -- return null; - } -- }, -+ -+ if (nextMatch > -1) stream.string = string.slice(0, nextMatch); -+ var token = baseMode.token(stream, state.base); -+ if (nextMatch > -1) stream.string = string; -+ return token; -+ } - - // parsing Smarty content -- smarty: function(stream, state) { -- if (stream.match(settings.rightDelimiter, true)) { -- if (settings.smartyVersion === 3) { -+ function tokenSmarty(stream, state) { -+ if (stream.match(rightDelimiter, true)) { -+ if (version === 3) { - state.depth--; - if (state.depth <= 0) { -- state.tokenize = parsers.tokenizer; -+ state.tokenize = tokenTop; - } - } else { -- state.tokenize = parsers.tokenizer; -+ state.tokenize = tokenTop; - } -- return helpers.cont("tag", null); -+ return cont("tag", null); - } - -- if (stream.match(settings.leftDelimiter, true)) { -+ if (stream.match(leftDelimiter, true)) { - state.depth++; -- return helpers.cont("tag", "startTag"); -+ return cont("tag", "startTag"); - } - - var ch = stream.next(); - if (ch == "$") { - stream.eatWhile(regs.validIdentifier); -- return helpers.cont("variable-2", "variable"); -+ return cont("variable-2", "variable"); - } else if (ch == "|") { -- return helpers.cont("operator", "pipe"); -+ return cont("operator", "pipe"); - } else if (ch == ".") { -- return helpers.cont("operator", "property"); -+ return cont("operator", "property"); - } else if (regs.stringChar.test(ch)) { -- state.tokenize = parsers.inAttribute(ch); -- return helpers.cont("string", "string"); -+ state.tokenize = tokenAttribute(ch); -+ return cont("string", "string"); - } else if (regs.operatorChars.test(ch)) { - stream.eatWhile(regs.operatorChars); -- return helpers.cont("operator", "operator"); -+ return cont("operator", "operator"); - } else if (ch == "[" || ch == "]") { -- return helpers.cont("bracket", "bracket"); -+ return cont("bracket", "bracket"); - } else if (ch == "(" || ch == ")") { -- return helpers.cont("bracket", "operator"); -+ return cont("bracket", "operator"); - } else if (/\d/.test(ch)) { - stream.eatWhile(/\d/); -- return helpers.cont("number", "number"); -+ return cont("number", "number"); - } else { - - if (state.last == "variable") { - if (ch == "@") { - stream.eatWhile(regs.validIdentifier); -- return helpers.cont("property", "property"); -+ return cont("property", "property"); - } else if (ch == "|") { - stream.eatWhile(regs.validIdentifier); -- return helpers.cont("qualifier", "modifier"); -+ return cont("qualifier", "modifier"); - } - } else if (state.last == "pipe") { - stream.eatWhile(regs.validIdentifier); -- return helpers.cont("qualifier", "modifier"); -+ return cont("qualifier", "modifier"); - } else if (state.last == "whitespace") { - stream.eatWhile(regs.validIdentifier); -- return helpers.cont("attribute", "modifier"); -+ return cont("attribute", "modifier"); - } if (state.last == "property") { - stream.eatWhile(regs.validIdentifier); -- return helpers.cont("property", null); -+ return cont("property", null); - } else if (/\s/.test(ch)) { - last = "whitespace"; - return null; -@@ -156,37 +145,37 @@ CodeMirror.defineMode("smarty", function(config) { - } - for (var i=0, j=keyFunctions.length; i!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/},o={cont:function(e,t){return r=t,e},chain:function(e,t,r){return t.tokenize=r,r(e,t)}},a={tokenizer:function(e,i){if(e.match(t.leftDelimiter,!0)){if(e.eat("*"))return o.chain(e,i,a.inBlock("comment","*"+t.rightDelimiter));i.depth++;var n=e.eol(),l=/\s/.test(e.peek());return 3===t.smartyVersion&&"{"===t.leftDelimiter&&(n||l)?(i.depth--,null):(i.tokenize=a.smarty,r="startTag","tag")}return e.next(),null},smarty:function(e,l){if(e.match(t.rightDelimiter,!0))return 3===t.smartyVersion?(l.depth--,l.depth<=0&&(l.tokenize=a.tokenizer)):l.tokenize=a.tokenizer,o.cont("tag",null);if(e.match(t.leftDelimiter,!0))return l.depth++,o.cont("tag","startTag");var f=e.next();if("$"==f)return e.eatWhile(n.validIdentifier),o.cont("variable-2","variable");if("|"==f)return o.cont("operator","pipe");if("."==f)return o.cont("operator","property");if(n.stringChar.test(f))return l.tokenize=a.inAttribute(f),o.cont("string","string");if(n.operatorChars.test(f))return e.eatWhile(n.operatorChars),o.cont("operator","operator");if("["==f||"]"==f)return o.cont("bracket","bracket");if("("==f||")"==f)return o.cont("bracket","operator");if(/\d/.test(f))return e.eatWhile(/\d/),o.cont("number","number");if("variable"==l.last){if("@"==f)return e.eatWhile(n.validIdentifier),o.cont("property","property");if("|"==f)return e.eatWhile(n.validIdentifier),o.cont("qualifier","modifier")}else{if("pipe"==l.last)return e.eatWhile(n.validIdentifier),o.cont("qualifier","modifier");if("whitespace"==l.last)return e.eatWhile(n.validIdentifier),o.cont("attribute","modifier")}if("property"==l.last)return e.eatWhile(n.validIdentifier),o.cont("property",null);if(/\s/.test(f))return r="whitespace",null;var u="";"/"!=f&&(u+=f);for(var s=null;s=e.eat(n.validIdentifier);)u+=s;for(var c=0,d=i.length;d>c;c++)if(i[c]==u)return o.cont("keyword","keyword");return/\s/.test(f)?null:o.cont("tag","tag")},inAttribute:function(e){return function(t,r){for(var i=null,n=null;!t.eol();){if(n=t.peek(),t.next()==e&&"\\"!==i){r.tokenize=a.smarty;break}i=n}return"string"}},inBlock:function(e,t){return function(r,i){for(;!r.eol();){if(r.match(t)){i.tokenize=a.tokenizer;break}r.next()}return e}}};return{startState:function(){return{tokenize:a.tokenizer,mode:"smarty",last:null,depth:0}},token:function(e,t){var i=t.tokenize(e,t);return t.last=r,i},electricChars:""}}),e.defineMIME("text/x-smarty","smarty")}); -\ 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("smarty",function(b,c){function d(a,b){return k=b,a}function e(a,b,c){return b.tokenize=c,c(a,b)}function f(a,b){return null==b&&(b=a.pos),3===n&&"{"==m&&(b==a.string.length||/\s/.test(a.string.charAt(b)))}function g(a,b){for(var c=a.string,d=a.pos;;){var g=c.indexOf(m,d);if(d=g+m.length,-1==g||!f(a,g+m.length))break}if(g==a.pos)return a.match(m),a.eat("*")?e(a,b,j("comment","*"+l)):(b.depth++,b.tokenize=h,k="startTag","tag");g>-1&&(a.string=c.slice(0,g));var i=o.token(a,b.base);return g>-1&&(a.string=c),i}function h(a,b){if(a.match(l,!0))return 3===n?(b.depth--,b.depth<=0&&(b.tokenize=g)):b.tokenize=g,d("tag",null);if(a.match(m,!0))return b.depth++,d("tag","startTag");var c=a.next();if("$"==c)return a.eatWhile(q.validIdentifier),d("variable-2","variable");if("|"==c)return d("operator","pipe");if("."==c)return d("operator","property");if(q.stringChar.test(c))return b.tokenize=i(c),d("string","string");if(q.operatorChars.test(c))return a.eatWhile(q.operatorChars),d("operator","operator");if("["==c||"]"==c)return d("bracket","bracket");if("("==c||")"==c)return d("bracket","operator");if(/\d/.test(c))return a.eatWhile(/\d/),d("number","number");if("variable"==b.last){if("@"==c)return a.eatWhile(q.validIdentifier),d("property","property");if("|"==c)return a.eatWhile(q.validIdentifier),d("qualifier","modifier")}else{if("pipe"==b.last)return a.eatWhile(q.validIdentifier),d("qualifier","modifier");if("whitespace"==b.last)return a.eatWhile(q.validIdentifier),d("attribute","modifier")}if("property"==b.last)return a.eatWhile(q.validIdentifier),d("property",null);if(/\s/.test(c))return k="whitespace",null;var e="";"/"!=c&&(e+=c);for(var f=null;f=a.eat(q.validIdentifier);)e+=f;for(var h=0,j=p.length;j>h;h++)if(p[h]==e)return d("keyword","keyword");return/\s/.test(c)?null:d("tag","tag")}function i(a){return function(b,c){for(var d=null,e=null;!b.eol();){if(e=b.peek(),b.next()==a&&"\\"!==d){c.tokenize=h;break}d=e}return"string"}}function j(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=g;break}c.next()}return a}}var k,l=c.rightDelimiter||"}",m=c.leftDelimiter||"{",n=c.version||2,o=a.getMode(b,c.baseMode||"null"),p=["debug","extends","function","include","literal"],q={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/};return{startState:function(){return{base:a.startState(o),tokenize:g,last:null,depth:0}},copyState:function(b){return{base:a.copyState(o,b.base),tokenize:b.tokenize,last:b.last,depth:b.depth}},innerMode:function(a){return a.tokenize==g?{mode:o,state:a.base}:void 0},token:function(a,b){var c=b.tokenize(a,b);return b.last=k,c},indent:function(b,c){return b.tokenize==g&&o.indent?o.indent(b.base,c):a.Pass},blockCommentStart:m+"*",blockCommentEnd:"*"+l}}),a.defineMIME("text/x-smarty","smarty")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/smartymixed/smartymixed.js b/media/editors/codemirror/mode/smartymixed/smartymixed.js -deleted file mode 100644 -index 4fc7ca4..0000000 ---- a/media/editors/codemirror/mode/smartymixed/smartymixed.js -+++ /dev/null -@@ -1,197 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --/** --* @file smartymixed.js --* @brief Smarty Mixed Codemirror mode (Smarty + Mixed HTML) --* @author Ruslan Osmanov --* @version 3.0 --* @date 05.07.2013 --*/ -- --// Warning: Don't base other modes on this one. This here is a --// terrible way to write a mixed mode. -- --(function(mod) { -- if (typeof exports == "object" && typeof module == "object") // CommonJS -- mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../smarty/smarty")); -- else if (typeof define == "function" && define.amd) // AMD -- define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../smarty/smarty"], mod); -- else // Plain browser env -- mod(CodeMirror); --})(function(CodeMirror) { --"use strict"; -- --CodeMirror.defineMode("smartymixed", function(config) { -- var htmlMixedMode = CodeMirror.getMode(config, "htmlmixed"); -- var smartyMode = CodeMirror.getMode(config, "smarty"); -- -- var settings = { -- rightDelimiter: '}', -- leftDelimiter: '{' -- }; -- -- if (config.hasOwnProperty("leftDelimiter")) { -- settings.leftDelimiter = config.leftDelimiter; -- } -- if (config.hasOwnProperty("rightDelimiter")) { -- settings.rightDelimiter = config.rightDelimiter; -- } -- -- function reEsc(str) { return str.replace(/[^\s\w]/g, "\\$&"); } -- -- var reLeft = reEsc(settings.leftDelimiter), reRight = reEsc(settings.rightDelimiter); -- var regs = { -- smartyComment: new RegExp("^" + reRight + "\\*"), -- literalOpen: new RegExp(reLeft + "literal" + reRight), -- literalClose: new RegExp(reLeft + "\/literal" + reRight), -- hasLeftDelimeter: new RegExp(".*" + reLeft), -- htmlHasLeftDelimeter: new RegExp("[^<>]*" + reLeft) -- }; -- -- var helpers = { -- chain: function(stream, state, parser) { -- state.tokenize = parser; -- return parser(stream, state); -- }, -- -- cleanChain: function(stream, state, parser) { -- state.tokenize = null; -- state.localState = null; -- state.localMode = null; -- return (typeof parser == "string") ? (parser ? parser : null) : parser(stream, state); -- }, -- -- maybeBackup: function(stream, pat, style) { -- var cur = stream.current(); -- var close = cur.search(pat), -- m; -- if (close > - 1) stream.backUp(cur.length - close); -- else if (m = cur.match(/<\/?$/)) { -- stream.backUp(cur.length); -- if (!stream.match(pat, false)) stream.match(cur[0]); -- } -- return style; -- } -- }; -- -- var parsers = { -- html: function(stream, state) { -- var htmlTagName = state.htmlMixedState.htmlState.context && state.htmlMixedState.htmlState.context.tagName -- ? state.htmlMixedState.htmlState.context.tagName -- : null; -- -- if (!state.inLiteral && stream.match(regs.htmlHasLeftDelimeter, false) && htmlTagName === null) { -- state.tokenize = parsers.smarty; -- state.localMode = smartyMode; -- state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, "")); -- return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState)); -- } else if (!state.inLiteral && stream.match(settings.leftDelimiter, false)) { -- state.tokenize = parsers.smarty; -- state.localMode = smartyMode; -- state.localState = smartyMode.startState(htmlMixedMode.indent(state.htmlMixedState, "")); -- return helpers.maybeBackup(stream, settings.leftDelimiter, smartyMode.token(stream, state.localState)); -- } -- return htmlMixedMode.token(stream, state.htmlMixedState); -- }, -- -- smarty: function(stream, state) { -- if (stream.match(settings.leftDelimiter, false)) { -- if (stream.match(regs.smartyComment, false)) { -- return helpers.chain(stream, state, parsers.inBlock("comment", "*" + settings.rightDelimiter)); -- } -- } else if (stream.match(settings.rightDelimiter, false)) { -- stream.eat(settings.rightDelimiter); -- state.tokenize = parsers.html; -- state.localMode = htmlMixedMode; -- state.localState = state.htmlMixedState; -- return "tag"; -- } -- -- return helpers.maybeBackup(stream, settings.rightDelimiter, smartyMode.token(stream, state.localState)); -- }, -- -- inBlock: function(style, terminator) { -- return function(stream, state) { -- while (!stream.eol()) { -- if (stream.match(terminator)) { -- helpers.cleanChain(stream, state, ""); -- break; -- } -- stream.next(); -- } -- return style; -- }; -- } -- }; -- -- return { -- startState: function() { -- var state = htmlMixedMode.startState(); -- return { -- token: parsers.html, -- localMode: null, -- localState: null, -- htmlMixedState: state, -- tokenize: null, -- inLiteral: false -- }; -- }, -- -- copyState: function(state) { -- var local = null, tok = (state.tokenize || state.token); -- if (state.localState) { -- local = CodeMirror.copyState((tok != parsers.html ? smartyMode : htmlMixedMode), state.localState); -- } -- return { -- token: state.token, -- tokenize: state.tokenize, -- localMode: state.localMode, -- localState: local, -- htmlMixedState: CodeMirror.copyState(htmlMixedMode, state.htmlMixedState), -- inLiteral: state.inLiteral -- }; -- }, -- -- token: function(stream, state) { -- if (stream.match(settings.leftDelimiter, false)) { -- if (!state.inLiteral && stream.match(regs.literalOpen, true)) { -- state.inLiteral = true; -- return "keyword"; -- } else if (state.inLiteral && stream.match(regs.literalClose, true)) { -- state.inLiteral = false; -- return "keyword"; -- } -- } -- if (state.inLiteral && state.localState != state.htmlMixedState) { -- state.tokenize = parsers.html; -- state.localMode = htmlMixedMode; -- state.localState = state.htmlMixedState; -- } -- -- var style = (state.tokenize || state.token)(stream, state); -- return style; -- }, -- -- indent: function(state, textAfter) { -- if (state.localMode == smartyMode -- || (state.inLiteral && !state.localMode) -- || regs.hasLeftDelimeter.test(textAfter)) { -- return CodeMirror.Pass; -- } -- return htmlMixedMode.indent(state.htmlMixedState, textAfter); -- }, -- -- innerMode: function(state) { -- return { -- state: state.localState || state.htmlMixedState, -- mode: state.localMode || htmlMixedMode -- }; -- } -- }; --}, "htmlmixed", "smarty"); -- --CodeMirror.defineMIME("text/x-smarty", "smartymixed"); --// vim: et ts=2 sts=2 sw=2 -- --}); -diff --git a/media/editors/codemirror/mode/smartymixed/smartymixed.min.js b/media/editors/codemirror/mode/smartymixed/smartymixed.min.js -deleted file mode 100644 -index e038748..0000000 ---- a/media/editors/codemirror/mode/smartymixed/smartymixed.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../smarty/smarty")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../smarty/smarty"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("smartymixed",function(e){function l(t){return t.replace(/[^\s\w]/g,"\\$&")}var i=t.getMode(e,"htmlmixed"),a=t.getMode(e,"smarty"),r={rightDelimiter:"}",leftDelimiter:"{"};e.hasOwnProperty("leftDelimiter")&&(r.leftDelimiter=e.leftDelimiter),e.hasOwnProperty("rightDelimiter")&&(r.rightDelimiter=e.rightDelimiter);var n=l(r.leftDelimiter),o=l(r.rightDelimiter),m={smartyComment:new RegExp("^"+o+"\\*"),literalOpen:new RegExp(n+"literal"+o),literalClose:new RegExp(n+"/literal"+o),hasLeftDelimeter:new RegExp(".*"+n),htmlHasLeftDelimeter:new RegExp("[^<>]*"+n)},c={chain:function(t,e,l){return e.tokenize=l,l(t,e)},cleanChain:function(t,e,l){return e.tokenize=null,e.localState=null,e.localMode=null,"string"==typeof l?l?l:null:l(t,e)},maybeBackup:function(t,e,l){var i,a=t.current(),r=a.search(e);return r>-1?t.backUp(a.length-r):(i=a.match(/<\/?$/))&&(t.backUp(a.length),t.match(e,!1)||t.match(a[0])),l}},h={html:function(t,e){var l=e.htmlMixedState.htmlState.context&&e.htmlMixedState.htmlState.context.tagName?e.htmlMixedState.htmlState.context.tagName:null;return!e.inLiteral&&t.match(m.htmlHasLeftDelimeter,!1)&&null===l?(e.tokenize=h.smarty,e.localMode=a,e.localState=a.startState(i.indent(e.htmlMixedState,"")),c.maybeBackup(t,r.leftDelimiter,a.token(t,e.localState))):!e.inLiteral&&t.match(r.leftDelimiter,!1)?(e.tokenize=h.smarty,e.localMode=a,e.localState=a.startState(i.indent(e.htmlMixedState,"")),c.maybeBackup(t,r.leftDelimiter,a.token(t,e.localState))):i.token(t,e.htmlMixedState)},smarty:function(t,e){if(t.match(r.leftDelimiter,!1)){if(t.match(m.smartyComment,!1))return c.chain(t,e,h.inBlock("comment","*"+r.rightDelimiter))}else if(t.match(r.rightDelimiter,!1))return t.eat(r.rightDelimiter),e.tokenize=h.html,e.localMode=i,e.localState=e.htmlMixedState,"tag";return c.maybeBackup(t,r.rightDelimiter,a.token(t,e.localState))},inBlock:function(t,e){return function(l,i){for(;!l.eol();){if(l.match(e)){c.cleanChain(l,i,"");break}l.next()}return t}}};return{startState:function(){var t=i.startState();return{token:h.html,localMode:null,localState:null,htmlMixedState:t,tokenize:null,inLiteral:!1}},copyState:function(e){var l=null,r=e.tokenize||e.token;return e.localState&&(l=t.copyState(r!=h.html?a:i,e.localState)),{token:e.token,tokenize:e.tokenize,localMode:e.localMode,localState:l,htmlMixedState:t.copyState(i,e.htmlMixedState),inLiteral:e.inLiteral}},token:function(t,e){if(t.match(r.leftDelimiter,!1)){if(!e.inLiteral&&t.match(m.literalOpen,!0))return e.inLiteral=!0,"keyword";if(e.inLiteral&&t.match(m.literalClose,!0))return e.inLiteral=!1,"keyword"}e.inLiteral&&e.localState!=e.htmlMixedState&&(e.tokenize=h.html,e.localMode=i,e.localState=e.htmlMixedState);var l=(e.tokenize||e.token)(t,e);return l},indent:function(e,l){return e.localMode==a||e.inLiteral&&!e.localMode||m.hasLeftDelimeter.test(l)?t.Pass:i.indent(e.htmlMixedState,l)},innerMode:function(t){return{state:t.localState||t.htmlMixedState,mode:t.localMode||i}}}},"htmlmixed","smarty"),t.defineMIME("text/x-smarty","smartymixed")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/solr/solr.min.js b/media/editors/codemirror/mode/solr/solr.min.js -index e7af1e6..8927782 100644 ---- a/media/editors/codemirror/mode/solr/solr.min.js -+++ b/media/editors/codemirror/mode/solr/solr.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("solr",function(){function e(e){return parseFloat(e,10).toString()===e}function t(e){return function(t,n){for(var r,i=!1;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=o),"string"}}function n(e){return function(t,n){var r="operator";return"+"==e?r+=" positive":"-"==e?r+=" negative":"|"==e?t.eat(/\|/):"&"==e?t.eat(/\&/):"^"==e&&(r+=" boost"),n.tokenize=o,r}}function r(t){return function(n,r){for(var u=t;(t=n.peek())&&null!=t.match(i);)u+=n.next();return r.tokenize=o,f.test(u)?"operator":e(u)?"number":":"==n.peek()?"field":"string"}}function o(e,f){var c=e.next();return'"'==c?f.tokenize=t(c):u.test(c)?f.tokenize=n(c):i.test(c)&&(f.tokenize=r(c)),f.tokenize!=o?f.tokenize(e,f):null}var i=/[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/,u=/[\|\!\+\-\*\?\~\^\&]/,f=/^(OR|AND|NOT|TO)$/i;return{startState:function(){return{tokenize:o}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)}}}),e.defineMIME("text/x-solr","solr")}); -\ 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("solr",function(){function a(a){return parseFloat(a,10).toString()===a}function b(a){return function(b,c){for(var d,f=!1;null!=(d=b.next())&&(d!=a||f);)f=!f&&"\\"==d;return f||(c.tokenize=e),"string"}}function c(a){return function(b,c){var d="operator";return"+"==a?d+=" positive":"-"==a?d+=" negative":"|"==a?b.eat(/\|/):"&"==a?b.eat(/\&/):"^"==a&&(d+=" boost"),c.tokenize=e,d}}function d(b){return function(c,d){for(var g=b;(b=c.peek())&&null!=b.match(f);)g+=c.next();return d.tokenize=e,h.test(g)?"operator":a(g)?"number":":"==c.peek()?"field":"string"}}function e(a,h){var i=a.next();return'"'==i?h.tokenize=b(i):g.test(i)?h.tokenize=c(i):f.test(i)&&(h.tokenize=d(i)),h.tokenize!=e?h.tokenize(a,h):null}var f=/[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/,g=/[\|\!\+\-\*\?\~\^\&]/,h=/^(OR|AND|NOT|TO)$/i;return{startState:function(){return{tokenize:e}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)}}}),a.defineMIME("text/x-solr","solr")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/soy/soy.js b/media/editors/codemirror/mode/soy/soy.js -index 7e81e8d..79bfc24 100644 ---- a/media/editors/codemirror/mode/soy/soy.js -+++ b/media/editors/codemirror/mode/soy/soy.js -@@ -96,7 +96,7 @@ - else state.indent -= (stream.current() == "/}" || indentingTags.indexOf(state.tag) == -1 ? 2 : 1) * config.indentUnit; - state.soyState.pop(); - return "keyword"; -- } else if (stream.match(/^(\w+)(?==)/)) { -+ } else if (stream.match(/^([\w?]+)(?==)/)) { - if (stream.current() == "kind" && (match = stream.match(/^="([^"]+)/, false))) { - var kind = match[1]; - state.kind.push(kind); -@@ -134,7 +134,7 @@ - return "comment"; - } else if (stream.match(stream.sol() ? /^\s*\/\/.*/ : /^\s+\/\/.*/)) { - return "comment"; -- } else if (stream.match(/^\{\$\w*/)) { -+ } else if (stream.match(/^\{\$[\w?]*/)) { - state.indent += 2 * config.indentUnit; - state.soyState.push("variable"); - return "variable-2"; -@@ -142,7 +142,7 @@ - state.indent += config.indentUnit; - state.soyState.push("literal"); - return "keyword"; -- } else if (match = stream.match(/^\{([\/@\\]?\w*)/)) { -+ } else if (match = stream.match(/^\{([\/@\\]?[\w?]*)/)) { - if (match[1] != "/switch") - state.indent += (/^(\/|(else|elseif|case|default)$)/.test(match[1]) && state.tag != "switch" ? 1 : 2) * config.indentUnit; - state.tag = match[1]; -diff --git a/media/editors/codemirror/mode/soy/soy.min.js b/media/editors/codemirror/mode/soy/soy.min.js -index aef317f..f176f29 100644 ---- a/media/editors/codemirror/mode/soy/soy.min.js -+++ b/media/editors/codemirror/mode/soy/soy.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],t):t(CodeMirror)}(function(t){"use strict";var e=["template","literal","msg","fallbackmsg","let","if","elseif","else","switch","case","default","foreach","ifempty","for","call","param","deltemplate","delcall","log"];t.defineMode("soy",function(n){function a(t){return t[t.length-1]}function i(t,e,n){var a=t.string,i=n.exec(a.substr(t.pos));i&&(t.string=a.substr(0,t.pos+i.index));var l=t.hideFirstChars(e.indent,function(){return e.localMode.token(t,e.localState)});return t.string=a,l}var l=t.getMode(n,"text/plain"),o={html:t.getMode(n,{name:"text/html",multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:l,text:l,uri:l,css:t.getMode(n,"text/css"),js:t.getMode(n,{name:"text/javascript",statementIndent:2*n.indentUnit})};return{startState:function(){return{kind:[],kindTag:[],soyState:[],indent:0,localMode:o.html,localState:t.startState(o.html)}},copyState:function(e){return{tag:e.tag,kind:e.kind.concat([]),kindTag:e.kindTag.concat([]),soyState:e.soyState.concat([]),indent:e.indent,localMode:e.localMode,localState:t.copyState(e.localMode,e.localState)}},token:function(l,s){var r;switch(a(s.soyState)){case"comment":return l.match(/^.*?\*\//)?s.soyState.pop():l.skipToEnd(),"comment";case"variable":return l.match(/^}/)?(s.indent-=2*n.indentUnit,s.soyState.pop(),"variable-2"):(l.next(),null);case"tag":if(l.match(/^\/?}/))return"/template"==s.tag||"/deltemplate"==s.tag?s.indent=0:s.indent-=("/}"==l.current()||-1==e.indexOf(s.tag)?2:1)*n.indentUnit,s.soyState.pop(),"keyword";if(l.match(/^(\w+)(?==)/)){if("kind"==l.current()&&(r=l.match(/^="([^"]+)/,!1))){var c=r[1];s.kind.push(c),s.kindTag.push(s.tag),s.localMode=o[c]||o.html,s.localState=t.startState(s.localMode)}return"attribute"}return l.match(/^"/)?(s.soyState.push("string"),"string"):(l.next(),null);case"literal":return l.match(/^(?=\{\/literal})/)?(s.indent-=n.indentUnit,s.soyState.pop(),this.token(l,s)):i(l,s,/\{\/literal}/);case"string":return l.match(/^.*?"/)?s.soyState.pop():l.skipToEnd(),"string"}return l.match(/^\/\*/)?(s.soyState.push("comment"),"comment"):l.match(l.sol()?/^\s*\/\/.*/:/^\s+\/\/.*/)?"comment":l.match(/^\{\$\w*/)?(s.indent+=2*n.indentUnit,s.soyState.push("variable"),"variable-2"):l.match(/^\{literal}/)?(s.indent+=n.indentUnit,s.soyState.push("literal"),"keyword"):(r=l.match(/^\{([\/@\\]?\w*)/))?("/switch"!=r[1]&&(s.indent+=(/^(\/|(else|elseif|case|default)$)/.test(r[1])&&"switch"!=s.tag?1:2)*n.indentUnit),s.tag=r[1],s.tag=="/"+a(s.kindTag)&&(s.kind.pop(),s.kindTag.pop(),s.localMode=o[a(s.kind)]||o.html,s.localState=t.startState(s.localMode)),s.soyState.push("tag"),"keyword"):i(l,s,/\{|\s+\/\/|\/\*/)},indent:function(e,i){var l=e.indent,o=a(e.soyState);if("comment"==o)return t.Pass;if("literal"==o)/^\{\/literal}/.test(i)&&(l-=n.indentUnit);else{if(/^\s*\{\/(template|deltemplate)\b/.test(i))return 0;/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(i)&&(l-=n.indentUnit),"switch"!=e.tag&&/^\{(case|default)\b/.test(i)&&(l-=n.indentUnit),/^\{\/switch\b/.test(i)&&(l-=n.indentUnit)}return l&&e.localMode.indent&&(l+=e.localMode.indent(e.localState,i)),l},innerMode:function(t){return t.soyState.length&&"literal"!=a(t.soyState)?null:{state:t.localState,mode:t.localMode}},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",fold:"indent"}},"htmlmixed"),t.registerHelper("hintWords","soy",e.concat(["delpackage","namespace","alias","print","css","debugger"])),t.defineMIME("text/x-soy","soy")}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],a):a(CodeMirror)}(function(a){"use strict";var b=["template","literal","msg","fallbackmsg","let","if","elseif","else","switch","case","default","foreach","ifempty","for","call","param","deltemplate","delcall","log"];a.defineMode("soy",function(c){function d(a){return a[a.length-1]}function e(a,b,c){var d=a.string,e=c.exec(d.substr(a.pos));e&&(a.string=d.substr(0,a.pos+e.index));var f=a.hideFirstChars(b.indent,function(){return b.localMode.token(a,b.localState)});return a.string=d,f}var f=a.getMode(c,"text/plain"),g={html:a.getMode(c,{name:"text/html",multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:f,text:f,uri:f,css:a.getMode(c,"text/css"),js:a.getMode(c,{name:"text/javascript",statementIndent:2*c.indentUnit})};return{startState:function(){return{kind:[],kindTag:[],soyState:[],indent:0,localMode:g.html,localState:a.startState(g.html)}},copyState:function(b){return{tag:b.tag,kind:b.kind.concat([]),kindTag:b.kindTag.concat([]),soyState:b.soyState.concat([]),indent:b.indent,localMode:b.localMode,localState:a.copyState(b.localMode,b.localState)}},token:function(f,h){var i;switch(d(h.soyState)){case"comment":return f.match(/^.*?\*\//)?h.soyState.pop():f.skipToEnd(),"comment";case"variable":return f.match(/^}/)?(h.indent-=2*c.indentUnit,h.soyState.pop(),"variable-2"):(f.next(),null);case"tag":if(f.match(/^\/?}/))return"/template"==h.tag||"/deltemplate"==h.tag?h.indent=0:h.indent-=("/}"==f.current()||-1==b.indexOf(h.tag)?2:1)*c.indentUnit,h.soyState.pop(),"keyword";if(f.match(/^([\w?]+)(?==)/)){if("kind"==f.current()&&(i=f.match(/^="([^"]+)/,!1))){var j=i[1];h.kind.push(j),h.kindTag.push(h.tag),h.localMode=g[j]||g.html,h.localState=a.startState(h.localMode)}return"attribute"}return f.match(/^"/)?(h.soyState.push("string"),"string"):(f.next(),null);case"literal":return f.match(/^(?=\{\/literal})/)?(h.indent-=c.indentUnit,h.soyState.pop(),this.token(f,h)):e(f,h,/\{\/literal}/);case"string":return f.match(/^.*?"/)?h.soyState.pop():f.skipToEnd(),"string"}return f.match(/^\/\*/)?(h.soyState.push("comment"),"comment"):f.match(f.sol()?/^\s*\/\/.*/:/^\s+\/\/.*/)?"comment":f.match(/^\{\$[\w?]*/)?(h.indent+=2*c.indentUnit,h.soyState.push("variable"),"variable-2"):f.match(/^\{literal}/)?(h.indent+=c.indentUnit,h.soyState.push("literal"),"keyword"):(i=f.match(/^\{([\/@\\]?[\w?]*)/))?("/switch"!=i[1]&&(h.indent+=(/^(\/|(else|elseif|case|default)$)/.test(i[1])&&"switch"!=h.tag?1:2)*c.indentUnit),h.tag=i[1],h.tag=="/"+d(h.kindTag)&&(h.kind.pop(),h.kindTag.pop(),h.localMode=g[d(h.kind)]||g.html,h.localState=a.startState(h.localMode)),h.soyState.push("tag"),"keyword"):e(f,h,/\{|\s+\/\/|\/\*/)},indent:function(b,e){var f=b.indent,g=d(b.soyState);if("comment"==g)return a.Pass;if("literal"==g)/^\{\/literal}/.test(e)&&(f-=c.indentUnit);else{if(/^\s*\{\/(template|deltemplate)\b/.test(e))return 0;/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(e)&&(f-=c.indentUnit),"switch"!=b.tag&&/^\{(case|default)\b/.test(e)&&(f-=c.indentUnit),/^\{\/switch\b/.test(e)&&(f-=c.indentUnit)}return f&&b.localMode.indent&&(f+=b.localMode.indent(b.localState,e)),f},innerMode:function(a){return a.soyState.length&&"literal"!=d(a.soyState)?null:{state:a.localState,mode:a.localMode}},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",fold:"indent"}},"htmlmixed"),a.registerHelper("hintWords","soy",b.concat(["delpackage","namespace","alias","print","css","debugger"])),a.defineMIME("text/x-soy","soy")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/sparql/sparql.min.js b/media/editors/codemirror/mode/sparql/sparql.min.js -index ed0d471..bad2eef 100644 ---- a/media/editors/codemirror/mode/sparql/sparql.min.js -+++ b/media/editors/codemirror/mode/sparql/sparql.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("sparql",function(t){function e(t){return new RegExp("^(?:"+t.join("|")+")$","i")}function n(t,e){var n=t.next();if(a=null,"$"==n||"?"==n)return"?"==n&&t.match(/\s/,!1)?"operator":(t.match(/^[\w\d]*/),"variable-2");if("<"!=n||t.match(/^[\s\u00a0=]/,!1)){if('"'==n||"'"==n)return e.tokenize=r(n),e.tokenize(t,e);if(/[{}\(\),\.;\[\]]/.test(n))return a=n,"bracket";if("#"==n)return t.skipToEnd(),"comment";if(l.test(n))return t.eatWhile(l),"operator";if(":"==n)return t.eatWhile(/[\w\d\._\-]/),"atom";if("@"==n)return t.eatWhile(/[a-z\d\-]/i),"meta";if(t.eatWhile(/[_\w\d]/),t.eat(":"))return t.eatWhile(/[\w\d_\-]/),"atom";var i=t.current();return s.test(i)?"builtin":u.test(i)?"keyword":"variable"}return t.match(/^[^\s\u00a0>]*>?/),"atom"}function r(t){return function(e,r){for(var i,o=!1;null!=(i=e.next());){if(i==t&&!o){r.tokenize=n;break}o=!o&&"\\"==i}return"string"}}function i(t,e,n){t.context={prev:t.context,indent:t.indent,col:n,type:e}}function o(t){t.indent=t.context.indent,t.context=t.context.prev}var a,c=t.indentUnit,s=e(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","iri","uri","bnode","count","sum","min","max","avg","sample","group_concat","rand","abs","ceil","floor","round","concat","substr","strlen","replace","ucase","lcase","encode_for_uri","contains","strstarts","strends","strbefore","strafter","year","month","day","hours","minutes","seconds","timezone","tz","now","uuid","struuid","md5","sha1","sha256","sha384","sha512","coalesce","if","strlang","strdt","isnumeric","regex","exists","isblank","isliteral","a"]),u=e(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc","as","having","undef","values","group","minus","in","not","service","silent","using","insert","delete","union","true","false","with","data","copy","to","move","add","create","drop","clear","load"]),l=/[*+\-<>=&|\^\/!\?]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(t,e){if(t.sol()&&(e.context&&null==e.context.align&&(e.context.align=!1),e.indent=t.indentation()),t.eatSpace())return null;var n=e.tokenize(t,e);if("comment"!=n&&e.context&&null==e.context.align&&"pattern"!=e.context.type&&(e.context.align=!0),"("==a)i(e,")",t.column());else if("["==a)i(e,"]",t.column());else if("{"==a)i(e,"}",t.column());else if(/[\]\}\)]/.test(a)){for(;e.context&&"pattern"==e.context.type;)o(e);e.context&&a==e.context.type&&o(e)}else"."==a&&e.context&&"pattern"==e.context.type?o(e):/atom|string|variable/.test(n)&&e.context&&(/[\}\]]/.test(e.context.type)?i(e,"pattern",t.column()):"pattern"!=e.context.type||e.context.align||(e.context.align=!0,e.context.col=t.column()));return n},indent:function(t,e){var n=e&&e.charAt(0),r=t.context;if(/[\]\}]/.test(n))for(;r&&"pattern"==r.type;)r=r.prev;var i=r&&n==r.type;return r?"pattern"==r.type?r.col:r.align?r.col+(i?0:1):r.indent+(i?0:c):0}}}),t.defineMIME("application/sparql-query","sparql")}); -\ 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("sparql",function(a){function b(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function c(a,b){var c=a.next();if(g=null,"$"==c||"?"==c)return"?"==c&&a.match(/\s/,!1)?"operator":(a.match(/^[\w\d]*/),"variable-2");if("<"!=c||a.match(/^[\s\u00a0=]/,!1)){if('"'==c||"'"==c)return b.tokenize=d(c),b.tokenize(a,b);if(/[{}\(\),\.;\[\]]/.test(c))return g=c,"bracket";if("#"==c)return a.skipToEnd(),"comment";if(k.test(c))return a.eatWhile(k),"operator";if(":"==c)return a.eatWhile(/[\w\d\._\-]/),"atom";if("@"==c)return a.eatWhile(/[a-z\d\-]/i),"meta";if(a.eatWhile(/[_\w\d]/),a.eat(":"))return a.eatWhile(/[\w\d_\-]/),"atom";var e=a.current();return i.test(e)?"builtin":j.test(e)?"keyword":"variable"}return a.match(/^[^\s\u00a0>]*>?/),"atom"}function d(a){return function(b,d){for(var e,f=!1;null!=(e=b.next());){if(e==a&&!f){d.tokenize=c;break}f=!f&&"\\"==e}return"string"}}function e(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function f(a){a.indent=a.context.indent,a.context=a.context.prev}var g,h=a.indentUnit,i=b(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","iri","uri","bnode","count","sum","min","max","avg","sample","group_concat","rand","abs","ceil","floor","round","concat","substr","strlen","replace","ucase","lcase","encode_for_uri","contains","strstarts","strends","strbefore","strafter","year","month","day","hours","minutes","seconds","timezone","tz","now","uuid","struuid","md5","sha1","sha256","sha384","sha512","coalesce","if","strlang","strdt","isnumeric","regex","exists","isblank","isliteral","a"]),j=b(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc","as","having","undef","values","group","minus","in","not","service","silent","using","insert","delete","union","true","false","with","data","copy","to","move","add","create","drop","clear","load"]),k=/[*+\-<>=&|\^\/!\?]/;return{startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(a,b){if(a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);if("comment"!=c&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==g)e(b,")",a.column());else if("["==g)e(b,"]",a.column());else if("{"==g)e(b,"}",a.column());else if(/[\]\}\)]/.test(g)){for(;b.context&&"pattern"==b.context.type;)f(b);b.context&&g==b.context.type&&f(b)}else"."==g&&b.context&&"pattern"==b.context.type?f(b):/atom|string|variable/.test(c)&&b.context&&(/[\}\]]/.test(b.context.type)?e(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return c},indent:function(a,b){var c=b&&b.charAt(0),d=a.context;if(/[\]\}]/.test(c))for(;d&&"pattern"==d.type;)d=d.prev;var e=d&&c==d.type;return d?"pattern"==d.type?d.col:d.align?d.col+(e?0:1):d.indent+(e?0:h):0}}}),a.defineMIME("application/sparql-query","sparql")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js b/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js -index b782706..7ed51e3 100644 ---- a/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js -+++ b/media/editors/codemirror/mode/spreadsheet/spreadsheet.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("spreadsheet",function(){return{startState:function(){return{stringType:null,stack:[]}},token:function(e,t){if(e){switch(0===t.stack.length&&('"'==e.peek()||"'"==e.peek())&&(t.stringType=e.peek(),e.next(),t.stack.unshift("string")),t.stack[0]){case"string":for(;"string"===t.stack[0]&&!e.eol();)e.peek()===t.stringType?(e.next(),t.stack.shift()):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return"string";case"characterClass":for(;"characterClass"===t.stack[0]&&!e.eol();)e.match(/^[^\]\\]+/)||e.match(/^\\./)||t.stack.shift();return"operator"}var r=e.peek();switch(r){case"[":return e.next(),t.stack.unshift("characterClass"),"bracket";case":":return e.next(),"operator";case"\\":return e.match(/\\[a-z]+/)?"string-2":null;case".":case",":case";":case"*":case"-":case"+":case"^":case"<":case"/":case"=":return e.next(),"atom";case"$":return e.next(),"builtin"}return e.match(/\d+/)?e.match(/^\w+/)?"error":"number":e.match(/^[a-zA-Z_]\w*/)?e.match(/(?=[\(.])/,!1)?"keyword":"variable-2":-1!=["[","]","(",")","{","}"].indexOf(r)?(e.next(),"bracket"):(e.eatSpace()||e.next(),null)}}}}),e.defineMIME("text/x-spreadsheet","spreadsheet")}); -\ 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("spreadsheet",function(){return{startState:function(){return{stringType:null,stack:[]}},token:function(a,b){if(a){switch(0===b.stack.length&&('"'==a.peek()||"'"==a.peek())&&(b.stringType=a.peek(),a.next(),b.stack.unshift("string")),b.stack[0]){case"string":for(;"string"===b.stack[0]&&!a.eol();)a.peek()===b.stringType?(a.next(),b.stack.shift()):"\\"===a.peek()?(a.next(),a.next()):a.match(/^.[^\\\"\']*/);return"string";case"characterClass":for(;"characterClass"===b.stack[0]&&!a.eol();)a.match(/^[^\]\\]+/)||a.match(/^\\./)||b.stack.shift();return"operator"}var c=a.peek();switch(c){case"[":return a.next(),b.stack.unshift("characterClass"),"bracket";case":":return a.next(),"operator";case"\\":return a.match(/\\[a-z]+/)?"string-2":null;case".":case",":case";":case"*":case"-":case"+":case"^":case"<":case"/":case"=":return a.next(),"atom";case"$":return a.next(),"builtin"}return a.match(/\d+/)?a.match(/^\w+/)?"error":"number":a.match(/^[a-zA-Z_]\w*/)?a.match(/(?=[\(.])/,!1)?"keyword":"variable-2":-1!=["[","]","(",")","{","}"].indexOf(c)?(a.next(),"bracket"):(a.eatSpace()||a.next(),null)}}}}),a.defineMIME("text/x-spreadsheet","spreadsheet")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/sql/sql.js b/media/editors/codemirror/mode/sql/sql.js -index ee6c194..a908277 100644 ---- a/media/editors/codemirror/mode/sql/sql.js -+++ b/media/editors/codemirror/mode/sql/sql.js -@@ -257,7 +257,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { - } - - // these keywords are used by all SQL dialects (however, a mode can still overwrite it) -- var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where "; -+ var sqlKeywords = "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 "; - - // turn a space-separated list into an array - function set(str) { -@@ -280,7 +280,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { - CodeMirror.defineMIME("text/x-mssql", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), -- keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"), -+ keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"), - builtin: set("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: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=]/, -@@ -293,7 +293,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { - CodeMirror.defineMIME("text/x-mysql", { - name: "sql", - client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), -- keywords: set(sqlKeywords + "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 groupby_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"), -+ keywords: set(sqlKeywords + "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: set("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: set("false true null unknown"), - operatorChars: /^[*+\-%<>!=&|^]/, -@@ -327,9 +327,9 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { - CodeMirror.defineMIME("text/x-cassandra", { - name: "sql", - client: { }, -- keywords: set("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"), -- builtin: set("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"), -- atoms: set("false true"), -+ keywords: set("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: set("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"), -+ atoms: set("false true infinity NaN"), - operatorChars: /^[<>=]/, - dateSQL: { }, - support: set("commentSlashSlash decimallessFloat"), -diff --git a/media/editors/codemirror/mode/sql/sql.min.js b/media/editors/codemirror/mode/sql/sql.min.js -index d88b691..de95e20 100644 ---- a/media/editors/codemirror/mode/sql/sql.min.js -+++ b/media/editors/codemirror/mode/sql/sql.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,r){function a(e,t){var r=e.next();if(b[r]){var a=b[r](e,t);if(a!==!1)return a}if(1==p.hexNumber&&("0"==r&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==r||"X"==r)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==r||"B"==r)&&e.match(/^'[01]+'/)||"0"==r&&e.match(/^b[01]+/)))return"number";if(r.charCodeAt(0)>47&&r.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==r&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==r||'"'==r&&p.doubleQuote)return t.tokenize=n(r),t.tokenize(e,t);if((1==p.nCharCast&&("n"==r||"N"==r)||1==p.charsetCast&&"_"==r&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(r))return null;if(p.commentSlashSlash&&"/"==r&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==r||"-"==r&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==r&&e.eat("*"))return t.tokenize=i,t.tokenize(e,t);if("."!=r){if(m.test(r))return e.eatWhile(m),null;if("{"==r&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var o=e.current().toLowerCase();return h.hasOwnProperty(o)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(o)?"atom":u.hasOwnProperty(o)?"builtin":d.hasOwnProperty(o)?"keyword":l.hasOwnProperty(o)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function n(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){r.tokenize=a;break}i=!i&&"\\"==n}return"string"}}function i(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=a;break}}return"comment"}function o(e,t,r){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:r}}function s(e){e.indent=e.context.indent,e.context=e.context.prev}var l=r.client||{},c=r.atoms||{"false":!0,"true":!0,"null":!0},u=r.builtin||{},d=r.keywords||{},m=r.operatorChars||/^[*+\-%<>!=&|~^]/,p=r.support||{},b=r.hooks||{},h=r.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:a,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var r=t.tokenize(e,t);if("comment"==r)return r;t.context&&null==t.context.align&&(t.context.align=!0);var a=e.current();return"("==a?o(e,t,")"):"["==a?o(e,t,"]"):t.context&&t.context.type==a&&s(t),r},indent:function(r,a){var n=r.context;if(!n)return e.Pass;var i=a.charAt(0)==n.type;return n.align?n.col+(i?0:1):n.indent+(i?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function r(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function a(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function n(e){for(var t={},r=e.split(" "),a=0;a!=]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),builtin:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:n("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":r}}),e.defineMIME("text/x-mysql",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"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 groupby_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:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":a}}),e.defineMIME("text/x-mariadb",{name:"sql",client:n("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:n(i+"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:n("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:n("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:n("date time timestamp"),support:n("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":r,"`":t,"\\":a}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:n("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"),builtin:n("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"),atoms:n("false true"),operatorChars:/^[<>=]/,dateSQL:{},support:n("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:n("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:n("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:n("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 lenght lenghtb 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:n("date time timestamp"),support:n("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:n("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:n("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:n("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:n("date timestamp"),support:n("ODBCdotTable doubleQuote 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(1==n.hexNumber&&("0"==c&&a.match(/^[xX][0-9a-fA-F]+/)||("x"==c||"X"==c)&&a.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==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]+)?/),1==n.decimallessFloat&&a.eat("."),"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((1==n.nCharCast&&("n"==c||"N"==c)||1==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,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 1==n.zerolessFloat&&a.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==n.ODBCdotTable&&a.match(/^[a-zA-Z_]+/)?"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=!f&&"\\"==e}return"string"}}function f(a,b){for(;;){if(!a.skipTo("*")){a.skipToEnd();break}if(a.next(),a.eat("/")){b.tokenize=d;break}}return"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};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),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 d=a.current();return"("==d?g(a,b,")"):"["==d?g(a,b,"]"):b.context&&b.context.type==d&&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?"#":null}}),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){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 d(a){return a.eat("N")?"atom":a.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function e(a){for(var b={},c=a.split(" "),d=0;d!=]/,dateSQL:e("date time timestamp"),support:e("ODBCdotTable doubleQuote binaryNumber hexNumber")}),a.defineMIME("text/x-mssql",{name:"sql",client:e("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:e(f+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"),builtin:e("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:e("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:e("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":c}}),a.defineMIME("text/x-mysql",{name:"sql",client:e("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:e(f+"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:e("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:e("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:e("date time timestamp"),support:e("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":c,"`":b,"\\":d}}),a.defineMIME("text/x-mariadb",{name:"sql",client:e("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:e(f+"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:e("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:e("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:e("date time timestamp"),support:e("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":c,"`":b,"\\":d}}),a.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:e("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:e("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:e("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:e("commentSlashSlash decimallessFloat"),hooks:{}}),a.defineMIME("text/x-plsql",{name:"sql",client:e("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:e("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:e("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 lenght lenghtb 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:e("date time timestamp"),support:e("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),a.defineMIME("text/x-hive",{name:"sql",keywords:e("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:e("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:e("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:e("date timestamp"),support:e("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/stex/stex.min.js b/media/editors/codemirror/mode/stex/stex.min.js -index 66b9ba2..c58e9cd 100644 ---- a/media/editors/codemirror/mode/stex/stex.min.js -+++ b/media/editors/codemirror/mode/stex/stex.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("stex",function(){function t(t,e){t.cmdState.push(e)}function e(t){return t.cmdState.length>0?t.cmdState[t.cmdState.length-1]:null}function n(t){var e=t.cmdState.pop();e&&e.closeBracket()}function r(t){for(var e=t.cmdState,n=e.length-1;n>=0;n--){var r=e[n];if("DEFAULT"!=r.name)return r}return{styleIdentifier:function(){return null}}}function i(t,e,n){return function(){this.name=t,this.bracketNo=0,this.style=e,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}function a(t,e){t.f=e}function c(n,i){var c;if(n.match(/^\\[a-zA-Z@]+/)){var s=n.current().slice(1);return c=f[s]||f.DEFAULT,c=new c,t(i,c),a(i,o),c.style}if(n.match(/^\\[$&%#{}_]/))return"tag";if(n.match(/^\\[,;!\/\\]/))return"tag";if(n.match("\\["))return a(i,function(t,e){return u(t,e,"\\]")}),"keyword";if(n.match("$$"))return a(i,function(t,e){return u(t,e,"$$")}),"keyword";if(n.match("$"))return a(i,function(t,e){return u(t,e,"$")}),"keyword";var m=n.next();return"%"==m?(n.skipToEnd(),"comment"):"}"==m||"]"==m?(c=e(i))?(c.closeBracket(m),a(i,o),"bracket"):"error":"{"==m||"["==m?(c=f.DEFAULT,c=new c,t(i,c),"bracket"):/\d/.test(m)?(n.eatWhile(/[\w.%]/),"atom"):(n.eatWhile(/[\w\-_]/),c=r(i),"begin"==c.name&&(c.argument=n.current()),c.styleIdentifier())}function u(t,e,n){if(t.eatSpace())return null;if(t.match(n))return a(e,c),"keyword";if(t.match(/^\\[a-zA-Z@]+/))return"tag";if(t.match(/^[a-zA-Z]+/))return"variable-2";if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/]/))return"tag";if(t.match(/^[\^_&]/))return"tag";if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=t.next();return"{"==r||"}"==r||"["==r||"]"==r||"("==r||")"==r?"bracket":"%"==r?(t.skipToEnd(),"comment"):"error"}function o(t,r){var i,u=t.peek();return"{"==u||"["==u?(i=e(r),i.openBracket(u),t.eat(u),a(r,c),"bracket"):/[ \t\r]/.test(u)?(t.eat(u),null):(a(r,c),n(r),c(t,r))}var f={};return f.importmodule=i("importmodule","tag",["string","builtin"]),f.documentclass=i("documentclass","tag",["","atom"]),f.usepackage=i("usepackage","tag",["atom"]),f.begin=i("begin","tag",["atom"]),f.end=i("end","tag",["atom"]),f.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:c}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=c,t.cmdState.length=0},lineComment:"%"}}),t.defineMIME("text/x-stex","stex"),t.defineMIME("text/x-latex","stex")}); -\ 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("stex",function(){function a(a,b){a.cmdState.push(b)}function b(a){return a.cmdState.length>0?a.cmdState[a.cmdState.length-1]:null}function c(a){var b=a.cmdState.pop();b&&b.closeBracket()}function d(a){for(var b=a.cmdState,c=b.length-1;c>=0;c--){var d=b[c];if("DEFAULT"!=d.name)return d}return{styleIdentifier:function(){return null}}}function e(a,b,c){return function(){this.name=a,this.bracketNo=0,this.style=b,this.styles=c,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}function f(a,b){a.f=b}function g(c,e){var g;if(c.match(/^\\[a-zA-Z@]+/)){var k=c.current().slice(1);return g=j[k]||j.DEFAULT,g=new g,a(e,g),f(e,i),g.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return f(e,function(a,b){return h(a,b,"\\]")}),"keyword";if(c.match("$$"))return f(e,function(a,b){return h(a,b,"$$")}),"keyword";if(c.match("$"))return f(e,function(a,b){return h(a,b,"$")}),"keyword";var l=c.next();return"%"==l?(c.skipToEnd(),"comment"):"}"==l||"]"==l?(g=b(e))?(g.closeBracket(l),f(e,i),"bracket"):"error":"{"==l||"["==l?(g=j.DEFAULT,g=new g,a(e,g),"bracket"):/\d/.test(l)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),g=d(e),"begin"==g.name&&(g.argument=c.current()),g.styleIdentifier())}function h(a,b,c){if(a.eatSpace())return null;if(a.match(c))return f(b,g),"keyword";if(a.match(/^\\[a-zA-Z@]+/))return"tag";if(a.match(/^[a-zA-Z]+/))return"variable-2";if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/]/))return"tag";if(a.match(/^[\^_&]/))return"tag";if(a.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(a.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var d=a.next();return"{"==d||"}"==d||"["==d||"]"==d||"("==d||")"==d?"bracket":"%"==d?(a.skipToEnd(),"comment"):"error"}function i(a,d){var e,h=a.peek();return"{"==h||"["==h?(e=b(d),e.openBracket(h),a.eat(h),f(d,g),"bracket"):/[ \t\r]/.test(h)?(a.eat(h),null):(f(d,g),c(d),g(a,d))}var j={};return j.importmodule=e("importmodule","tag",["string","builtin"]),j.documentclass=e("documentclass","tag",["","atom"]),j.usepackage=e("usepackage","tag",["atom"]),j.begin=e("begin","tag",["atom"]),j.end=e("end","tag",["atom"]),j.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:g}},copyState:function(a){return{cmdState:a.cmdState.slice(),f:a.f}},token:function(a,b){return b.f(a,b)},blankLine:function(a){a.f=g,a.cmdState.length=0},lineComment:"%"}}),a.defineMIME("text/x-stex","stex"),a.defineMIME("text/x-latex","stex")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/stex/test.js b/media/editors/codemirror/mode/stex/test.js -deleted file mode 100644 -index 22f027e..0000000 ---- a/media/editors/codemirror/mode/stex/test.js -+++ /dev/null -@@ -1,123 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({tabSize: 4}, "stex"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- -- MT("word", -- "foo"); -- -- MT("twoWords", -- "foo bar"); -- -- MT("beginEndDocument", -- "[tag \\begin][bracket {][atom document][bracket }]", -- "[tag \\end][bracket {][atom document][bracket }]"); -- -- MT("beginEndEquation", -- "[tag \\begin][bracket {][atom equation][bracket }]", -- " E=mc^2", -- "[tag \\end][bracket {][atom equation][bracket }]"); -- -- MT("beginModule", -- "[tag \\begin][bracket {][atom module][bracket }[[]]]"); -- -- MT("beginModuleId", -- "[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]"); -- -- MT("importModule", -- "[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]"); -- -- MT("importModulePath", -- "[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]"); -- -- MT("psForPDF", -- "[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]"); -- -- MT("comment", -- "[comment % foo]"); -- -- MT("tagComment", -- "[tag \\item][comment % bar]"); -- -- MT("commentTag", -- " [comment % \\item]"); -- -- MT("commentLineBreak", -- "[comment %]", -- "foo"); -- -- MT("tagErrorCurly", -- "[tag \\begin][error }][bracket {]"); -- -- MT("tagErrorSquare", -- "[tag \\item][error ]]][bracket {]"); -- -- MT("commentCurly", -- "[comment % }]"); -- -- MT("tagHash", -- "the [tag \\#] key"); -- -- MT("tagNumber", -- "a [tag \\$][atom 5] stetson"); -- -- MT("tagPercent", -- "[atom 100][tag \\%] beef"); -- -- MT("tagAmpersand", -- "L [tag \\&] N"); -- -- MT("tagUnderscore", -- "foo[tag \\_]bar"); -- -- MT("tagBracketOpen", -- "[tag \\emph][bracket {][tag \\{][bracket }]"); -- -- MT("tagBracketClose", -- "[tag \\emph][bracket {][tag \\}][bracket }]"); -- -- MT("tagLetterNumber", -- "section [tag \\S][atom 1]"); -- -- MT("textTagNumber", -- "para [tag \\P][atom 2]"); -- -- MT("thinspace", -- "x[tag \\,]y"); -- -- MT("thickspace", -- "x[tag \\;]y"); -- -- MT("negativeThinspace", -- "x[tag \\!]y"); -- -- MT("periodNotSentence", -- "J.\\ L.\\ is"); -- -- MT("periodSentence", -- "X[tag \\@]. The"); -- -- MT("italicCorrection", -- "[bracket {][tag \\em] If[tag \\/][bracket }] I"); -- -- MT("tagBracket", -- "[tag \\newcommand][bracket {][tag \\pop][bracket }]"); -- -- MT("inlineMathTagFollowedByNumber", -- "[keyword $][tag \\pi][number 2][keyword $]"); -- -- MT("inlineMath", -- "[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text"); -- -- MT("displayMath", -- "More [keyword $$]\t[variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text"); -- -- MT("mathWithComment", -- "[keyword $][variable-2 x] [comment % $]", -- "[variable-2 y][keyword $] other text"); -- -- MT("lineBreakArgument", -- "[tag \\\\][bracket [[][atom 1cm][bracket ]]]"); --})(); -diff --git a/media/editors/codemirror/mode/stex/test.min.js b/media/editors/codemirror/mode/stex/test.min.js -deleted file mode 100644 -index 3ca4b62..0000000 ---- a/media/editors/codemirror/mode/stex/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function t(t){test.mode(t,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4},"stex");t("word","foo"),t("twoWords","foo bar"),t("beginEndDocument","[tag \\begin][bracket {][atom document][bracket }]","[tag \\end][bracket {][atom document][bracket }]"),t("beginEndEquation","[tag \\begin][bracket {][atom equation][bracket }]"," E=mc^2","[tag \\end][bracket {][atom equation][bracket }]"),t("beginModule","[tag \\begin][bracket {][atom module][bracket }[[]]]"),t("beginModuleId","[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]"),t("importModule","[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]"),t("importModulePath","[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]"),t("psForPDF","[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]"),t("comment","[comment % foo]"),t("tagComment","[tag \\item][comment % bar]"),t("commentTag"," [comment % \\item]"),t("commentLineBreak","[comment %]","foo"),t("tagErrorCurly","[tag \\begin][error }][bracket {]"),t("tagErrorSquare","[tag \\item][error ]]][bracket {]"),t("commentCurly","[comment % }]"),t("tagHash","the [tag \\#] key"),t("tagNumber","a [tag \\$][atom 5] stetson"),t("tagPercent","[atom 100][tag \\%] beef"),t("tagAmpersand","L [tag \\&] N"),t("tagUnderscore","foo[tag \\_]bar"),t("tagBracketOpen","[tag \\emph][bracket {][tag \\{][bracket }]"),t("tagBracketClose","[tag \\emph][bracket {][tag \\}][bracket }]"),t("tagLetterNumber","section [tag \\S][atom 1]"),t("textTagNumber","para [tag \\P][atom 2]"),t("thinspace","x[tag \\,]y"),t("thickspace","x[tag \\;]y"),t("negativeThinspace","x[tag \\!]y"),t("periodNotSentence","J.\\ L.\\ is"),t("periodSentence","X[tag \\@]. The"),t("italicCorrection","[bracket {][tag \\em] If[tag \\/][bracket }] I"),t("tagBracket","[tag \\newcommand][bracket {][tag \\pop][bracket }]"),t("inlineMathTagFollowedByNumber","[keyword $][tag \\pi][number 2][keyword $]"),t("inlineMath","[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text"),t("displayMath","More [keyword $$] [variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text"),t("mathWithComment","[keyword $][variable-2 x] [comment % $]","[variable-2 y][keyword $] other text"),t("lineBreakArgument","[tag \\\\][bracket [[][atom 1cm][bracket ]]]")}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/stylus/stylus.js b/media/editors/codemirror/mode/stylus/stylus.js -index 6f7c754..fc46a01 100644 ---- a/media/editors/codemirror/mode/stylus/stylus.js -+++ b/media/editors/codemirror/mode/stylus/stylus.js -@@ -1,6 +1,8 @@ - // CodeMirror, copyright (c) by Marijn Haverbeke and others - // Distributed under an MIT license: http://codemirror.net/LICENSE - -+// Stylus mode created by Dmitry Kiselyov http://git.io/AaRB -+ - (function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); -@@ -12,433 +14,755 @@ - "use strict"; - - CodeMirror.defineMode("stylus", function(config) { -- -- var operatorsRegexp = /^(\?:?|\+[+=]?|-[\-=]?|\*[\*=]?|\/=?|[=!:\?]?=|<=?|>=?|%=?|&&|\|=?|\~|!|\^|\\)/, -- delimitersRegexp = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/, -- wordOperatorsRegexp = wordRegexp(wordOperators), -- commonKeywordsRegexp = wordRegexp(commonKeywords), -- commonAtomsRegexp = wordRegexp(commonAtoms), -- commonDefRegexp = wordRegexp(commonDef), -- vendorPrefixesRegexp = new RegExp(/^\-(moz|ms|o|webkit)-/), -- cssValuesWithBracketsRegexp = new RegExp("^(" + cssValuesWithBrackets_.join("|") + ")\\([\\w\-\\#\\,\\.\\%\\s\\(\\)]*\\)"); -- -- var tokenBase = function(stream, state) { -- -- if (stream.eatSpace()) return null; -- -- var ch = stream.peek(); -- -- // Single line Comment -- if (stream.match('//')) { -+ var indentUnit = config.indentUnit, -+ tagKeywords = keySet(tagKeywords_), -+ tagVariablesRegexp = /^(a|b|i|s|col|em)$/i, -+ propertyKeywords = keySet(propertyKeywords_), -+ nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_), -+ valueKeywords = keySet(valueKeywords_), -+ colorKeywords = keySet(colorKeywords_), -+ documentTypes = keySet(documentTypes_), -+ documentTypesRegexp = wordRegexp(documentTypes_), -+ mediaFeatures = keySet(mediaFeatures_), -+ mediaTypes = keySet(mediaTypes_), -+ fontProperties = keySet(fontProperties_), -+ operatorsRegexp = /^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/, -+ wordOperatorKeywordsRegexp = wordRegexp(wordOperatorKeywords_), -+ blockKeywords = keySet(blockKeywords_), -+ vendorPrefixesRegexp = new RegExp(/^\-(moz|ms|o|webkit)-/i), -+ commonAtoms = keySet(commonAtoms_), -+ firstWordMatch = "", -+ states = {}, -+ ch, -+ style, -+ type, -+ override; -+ -+ /** -+ * Tokenizers -+ */ -+ function tokenBase(stream, state) { -+ firstWordMatch = stream.string.match(/(^[\w-]+\s*=\s*$)|(^\s*[\w-]+\s*=\s*[\w-])|(^\s*(\.|#|@|\$|\&|\[|\d|\+|::?|\{|\>|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/); -+ state.context.line.firstWord = firstWordMatch ? firstWordMatch[0].replace(/^\s*/, "") : ""; -+ state.context.line.indent = stream.indentation(); -+ ch = stream.peek(); -+ -+ // Line comment -+ if (stream.match("//")) { - stream.skipToEnd(); -- return "comment"; -+ return ["comment", "comment"]; - } -- -- // Multiline Comment -- if (stream.match('/*')) { -- state.tokenizer = multilineComment; -- return state.tokenizer(stream, state); -+ // Block comment -+ if (stream.match("/*")) { -+ state.tokenize = tokenCComment; -+ return tokenCComment(stream, state); - } -- -- // Strings -- if (ch === '"' || ch === "'") { -+ // String -+ if (ch == "\"" || ch == "'") { - stream.next(); -- state.tokenizer = buildStringTokenizer(ch); -- return "string"; -+ state.tokenize = tokenString(ch); -+ return state.tokenize(stream, state); - } -- - // Def -- if (ch === "@") { -+ if (ch == "@") { - stream.next(); -- if (stream.match(/extend/)) { -- dedent(state); // remove indentation after selectors -- } else if (stream.match(/media[\w-\s]*[\w-]/)) { -- indent(state); -- } else if(stream.eatWhile(/[\w-]/)) { -- if(stream.current().match(commonDefRegexp)) { -- indent(state); -- } -- } -- return "def"; -- } -- -- // Number -- if (stream.match(/^-?[0-9\.]/, false)) { -- -- // Floats -- if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i) || stream.match(/^-?\d+\.\d*/)) { -- -- // Prevent from getting extra . on 1.. -- if (stream.peek() == ".") { -- stream.backUp(1); -- } -- // Units -- stream.eatWhile(/[a-z%]/i); -- return "number"; -- } -- // Integers -- if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/) || stream.match(/^-?0(?![\dx])/i)) { -- // Units -- stream.eatWhile(/[a-z%]/i); -- return "number"; -- } -+ stream.eatWhile(/[\w\\-]/); -+ return ["def", stream.current()]; - } -- -- // Hex color and id selector -- if (ch === "#") { -+ // ID selector or Hex color -+ if (ch == "#") { - stream.next(); -- - // Hex color - if (stream.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i)) { -- return "atom"; -+ return ["atom", "atom"]; - } -- - // ID selector -- if (stream.match(/^[\w-]+/i)) { -- indent(state); -- return "builtin"; -+ if (stream.match(/^[a-z][\w-]*/i)) { -+ return ["builtin", "hash"]; - } - } -- - // Vendor prefixes - if (stream.match(vendorPrefixesRegexp)) { -- return "meta"; -+ return ["meta", "vendor-prefixes"]; - } -- -- // Gradients and animation as CSS value -- if (stream.match(cssValuesWithBracketsRegexp)) { -- return "atom"; -+ // Numbers -+ if (stream.match(/^-?[0-9]?\.?[0-9]/)) { -+ stream.eatWhile(/[a-z%]/i); -+ return ["number", "unit"]; - } -- -- // Mixins / Functions with indentation -- if (stream.sol() && stream.match(/^\.?[a-z][\w-]*\(/i)) { -- stream.backUp(1); -- indent(state); -- return "keyword"; -+ // !important|optional -+ if (ch == "!") { -+ stream.next(); -+ return [stream.match(/^(important|optional)/i) ? "keyword": "operator", "important"]; -+ } -+ // Class -+ if (ch == "." && stream.match(/^\.[a-z][\w-]*/i)) { -+ return ["qualifier", "qualifier"]; -+ } -+ // url url-prefix domain regexp -+ if (stream.match(documentTypesRegexp)) { -+ if (stream.peek() == "(") state.tokenize = tokenParenthesized; -+ return ["property", "word"]; - } -- - // Mixins / Functions -- if (stream.match(/^\.?[a-z][\w-]*\(/i)) { -+ if (stream.match(/^[a-z][\w-]*\(/i)) { - stream.backUp(1); -- return "keyword"; -+ return ["keyword", "mixin"]; - } -- -- // +Block mixins -- if (stream.match(/^(\+|\-)[a-z][\w-]+\(/i)) { -+ // Block mixins -+ if (stream.match(/^(\+|-)[a-z][\w-]*\(/i)) { - stream.backUp(1); -- indent(state); -- return "keyword"; -+ return ["keyword", "block-mixin"]; - } -- -- // url tokens -- if (stream.match(/^url/) && stream.peek() === "(") { -- state.tokenizer = urlTokens; -- if(!stream.peek()) { -- state.cursorHalf = 0; -+ // Parent Reference BEM naming -+ if (stream.string.match(/^\s*&/) && stream.match(/^[-_]+[a-z][\w-]*/)) { -+ return ["qualifier", "qualifier"]; -+ } -+ // / Root Reference & Parent Reference -+ if (stream.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)) { -+ stream.backUp(1); -+ return ["variable-3", "reference"]; -+ } -+ if (stream.match(/^&{1}\s*$/)) { -+ return ["variable-3", "reference"]; -+ } -+ // Variable -+ if (ch == "$" && stream.match(/^\$[\w-]+/i)) { -+ return ["variable-2", "variable-name"]; -+ } -+ // Word operator -+ if (stream.match(wordOperatorKeywordsRegexp)) { -+ return ["operator", "operator"]; -+ } -+ // Word -+ if (stream.match(/^[-_]*[a-z0-9]+[\w-]*/i)) { -+ if (stream.match(/^(\.|\[)[\w-\'\"\]]+/i, false)) { -+ if (!wordIsTag(stream.current())) { -+ stream.match(/[\w-]+/); -+ return ["variable-2", "variable-name"]; -+ } - } -- return "atom"; -+ return ["variable-2", "word"]; - } -- -- // Class -- if (stream.match(/^\.[a-z][\w-]*/i)) { -- indent(state); -- return "qualifier"; -+ // Operators -+ if (stream.match(operatorsRegexp)) { -+ return ["operator", stream.current()]; - } -- -- // & Parent Reference with BEM naming -- if (stream.match(/^(_|__|-|--)[a-z0-9-]+/)) { -- return "qualifier"; -+ // Delimiters -+ if (/[:;,{}\[\]\(\)]/.test(ch)) { -+ stream.next(); -+ return [null, ch]; - } -+ // Non-detected items -+ stream.next(); -+ return [null, null]; -+ } - -- // Pseudo elements/classes -- if (ch == ':' && stream.match(/^::?[\w-]+/)) { -- indent(state); -- return "variable-3"; -+ /** -+ * Token comment -+ */ -+ function tokenCComment(stream, state) { -+ var maybeEnd = false, ch; -+ while ((ch = stream.next()) != null) { -+ if (maybeEnd && ch == "/") { -+ state.tokenize = null; -+ break; -+ } -+ maybeEnd = (ch == "*"); - } -+ return ["comment", "comment"]; -+ } - -- // Conditionals -- if (stream.match(wordRegexp(["for", "if", "else", "unless"]))) { -- indent(state); -- return "keyword"; -- } -+ /** -+ * Token string -+ */ -+ function tokenString(quote) { -+ return function(stream, state) { -+ var escaped = false, ch; -+ while ((ch = stream.next()) != null) { -+ if (ch == quote && !escaped) { -+ if (quote == ")") stream.backUp(1); -+ break; -+ } -+ escaped = !escaped && ch == "\\"; -+ } -+ if (ch == quote || !escaped && quote != ")") state.tokenize = null; -+ return ["string", "string"]; -+ }; -+ } - -- // Keywords -- if (stream.match(commonKeywordsRegexp)) { -- return "keyword"; -- } -+ /** -+ * Token parenthesized -+ */ -+ function tokenParenthesized(stream, state) { -+ stream.next(); // Must be "(" -+ if (!stream.match(/\s*[\"\')]/, false)) -+ state.tokenize = tokenString(")"); -+ else -+ state.tokenize = null; -+ return [null, "("]; -+ } - -- // Atoms -- if (stream.match(commonAtomsRegexp)) { -- return "atom"; -- } -+ /** -+ * Context management -+ */ -+ function Context(type, indent, prev, line) { -+ this.type = type; -+ this.indent = indent; -+ this.prev = prev; -+ this.line = line || {firstWord: "", indent: 0}; -+ } - -- // Variables -- if (stream.match(/^\$?[a-z][\w-]+\s?=(\s|[\w-'"\$])/i)) { -- stream.backUp(2); -- var cssPropertie = stream.current().toLowerCase().match(/[\w-]+/)[0]; -- return cssProperties[cssPropertie] === undefined ? "variable-2" : "property"; -- } else if (stream.match(/\$[\w-\.]+/i)) { -- return "variable-2"; -- } else if (stream.match(/\$?[\w-]+\.[\w-]+/i)) { -- var cssTypeSelector = stream.current().toLowerCase().match(/[\w]+/)[0]; -- if(cssTypeSelectors[cssTypeSelector] === undefined) { -- return "variable-2"; -- } else stream.backUp(stream.current().length); -- } -+ function pushContext(state, stream, type, indent) { -+ indent = indent >= 0 ? indent : indentUnit; -+ state.context = new Context(type, stream.indentation() + indent, state.context); -+ return type; -+ } - -- // !important -- if (ch === "!") { -- stream.next(); -- return stream.match(/^[\w]+/) ? "keyword": "operator"; -- } -+ function popContext(state, currentIndent) { -+ var contextIndent = state.context.indent - indentUnit; -+ currentIndent = currentIndent || false; -+ state.context = state.context.prev; -+ if (currentIndent) state.context.indent = contextIndent; -+ return state.context.type; -+ } - -- // / Root Reference -- if (stream.match(/^\/(:|\.|#|[a-z])/)) { -- stream.backUp(1); -- return "variable-3"; -- } -+ function pass(type, stream, state) { -+ return states[state.context.type](type, stream, state); -+ } - -- // Operators and delimiters -- if (stream.match(operatorsRegexp) || stream.match(wordOperatorsRegexp)) { -- return "operator"; -- } -- if (stream.match(delimitersRegexp)) { -- return null; -- } -+ function popAndPass(type, stream, state, n) { -+ for (var i = n || 1; i > 0; i--) -+ state.context = state.context.prev; -+ return pass(type, stream, state); -+ } - -- // & Parent Reference -- if (ch === "&") { -- stream.next(); -- return "variable-3"; -- } -+ -+ /** -+ * Parser -+ */ -+ function wordIsTag(word) { -+ return word.toLowerCase() in tagKeywords; -+ } -+ -+ function wordIsProperty(word) { -+ word = word.toLowerCase(); -+ return word in propertyKeywords || word in fontProperties; -+ } -+ -+ function wordIsBlock(word) { -+ return word.toLowerCase() in blockKeywords; -+ } -+ -+ function wordIsVendorPrefix(word) { -+ return word.toLowerCase().match(vendorPrefixesRegexp); -+ } -+ -+ function wordAsValue(word) { -+ var wordLC = word.toLowerCase(); -+ var override = "variable-2"; -+ if (wordIsTag(word)) override = "tag"; -+ else if (wordIsBlock(word)) override = "block-keyword"; -+ else if (wordIsProperty(word)) override = "property"; -+ else if (wordLC in valueKeywords || wordLC in commonAtoms) override = "atom"; -+ else if (wordLC == "return" || wordLC in colorKeywords) override = "keyword"; - - // Font family -- if (stream.match(/^[A-Z][a-z0-9-]+/)) { -- return "string"; -- } -+ else if (word.match(/^[A-Z]/)) override = "string"; -+ return override; -+ } - -- // CSS rule -- // NOTE: Some css selectors and property values have the same name -- // (embed, menu, pre, progress, sub, table), -- // so they will have the same color (.cm-atom). -- if (stream.match(/[\w-]*/i)) { -+ function typeIsBlock(type, stream) { -+ return ((endOfLine(stream) && (type == "{" || type == "]" || type == "hash" || type == "qualifier")) || type == "block-mixin"); -+ } - -- var word = stream.current().toLowerCase(); -+ function typeIsInterpolation(type, stream) { -+ return type == "{" && stream.match(/^\s*\$?[\w-]+/i, false); -+ } - -- if(cssProperties[word] !== undefined) { -- // CSS property -- if(!stream.eol()) -- return "property"; -- else -- return "variable-2"; -- -- } else if(cssValues[word] !== undefined) { -- // CSS value -- return "atom"; -- -- } else if(cssTypeSelectors[word] !== undefined) { -- // CSS type selectors -- indent(state); -- return "tag"; -- -- } else if(word) { -- // By default variable-2 -- return "variable-2"; -- } -- } -+ function typeIsPseudo(type, stream) { -+ return type == ":" && stream.match(/^[a-z-]+/, false); -+ } - -- // Handle non-detected items -- stream.next(); -- return null; -+ function startOfLine(stream) { -+ return stream.sol() || stream.string.match(new RegExp("^\\s*" + escapeRegExp(stream.current()))); -+ } - -- }; -+ function endOfLine(stream) { -+ return stream.eol() || stream.match(/^\s*$/, false); -+ } -+ -+ function firstWordOfLine(line) { -+ var re = /^\s*[-_]*[a-z0-9]+[\w-]*/i; -+ var result = typeof line == "string" ? line.match(re) : line.string.match(re); -+ return result ? result[0].replace(/^\s*/, "") : ""; -+ } - -- var tokenLexer = function(stream, state) { - -- if (stream.sol()) { -- state.indentCount = 0; -+ /** -+ * Block -+ */ -+ states.block = function(type, stream, state) { -+ if ((type == "comment" && startOfLine(stream)) || -+ (type == "," && endOfLine(stream)) || -+ type == "mixin") { -+ return pushContext(state, stream, "block", 0); -+ } -+ if (typeIsInterpolation(type, stream)) { -+ return pushContext(state, stream, "interpolation"); -+ } -+ if (endOfLine(stream) && type == "]") { -+ if (!/^\s*(\.|#|:|\[|\*|&)/.test(stream.string) && !wordIsTag(firstWordOfLine(stream))) { -+ return pushContext(state, stream, "block", 0); -+ } -+ } -+ if (typeIsBlock(type, stream, state)) { -+ return pushContext(state, stream, "block"); -+ } -+ if (type == "}" && endOfLine(stream)) { -+ return pushContext(state, stream, "block", 0); -+ } -+ if (type == "variable-name") { -+ if ((stream.indentation() == 0 && startOfLine(stream)) || wordIsBlock(firstWordOfLine(stream))) { -+ return pushContext(state, stream, "variableName"); -+ } -+ else { -+ return pushContext(state, stream, "variableName", 0); -+ } -+ } -+ if (type == "=") { -+ if (!endOfLine(stream) && !wordIsBlock(firstWordOfLine(stream))) { -+ return pushContext(state, stream, "block", 0); -+ } -+ return pushContext(state, stream, "block"); -+ } -+ if (type == "*") { -+ if (endOfLine(stream) || stream.match(/\s*(,|\.|#|\[|:|{)/,false)) { -+ override = "tag"; -+ return pushContext(state, stream, "block"); -+ } -+ } -+ if (typeIsPseudo(type, stream)) { -+ return pushContext(state, stream, "pseudo"); -+ } -+ if (/@(font-face|media|supports|(-moz-)?document)/.test(type)) { -+ return pushContext(state, stream, endOfLine(stream) ? "block" : "atBlock"); -+ } -+ if (/@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { -+ return pushContext(state, stream, "keyframes"); -+ } -+ if (/@extends?/.test(type)) { -+ return pushContext(state, stream, "extend", 0); - } -+ if (type && type.charAt(0) == "@") { - -- var style = state.tokenizer(stream, state); -- var current = stream.current(); -+ // Property Lookup -+ if (stream.indentation() > 0 && wordIsProperty(stream.current().slice(1))) { -+ override = "variable-2"; -+ return "block"; -+ } -+ if (/(@import|@require|@charset)/.test(type)) { -+ return pushContext(state, stream, "block", 0); -+ } -+ return pushContext(state, stream, "block"); -+ } -+ if (type == "reference" && endOfLine(stream)) { -+ return pushContext(state, stream, "block"); -+ } -+ if (type == "(") { -+ return pushContext(state, stream, "parens"); -+ } - -- if (stream.eol() && (current === "}" || current === ",")) { -- dedent(state); -+ if (type == "vendor-prefixes") { -+ return pushContext(state, stream, "vendorPrefixes"); - } -+ if (type == "word") { -+ var word = stream.current(); -+ override = wordAsValue(word); -+ -+ if (override == "property") { -+ if (startOfLine(stream)) { -+ return pushContext(state, stream, "block", 0); -+ } else { -+ override = "atom"; -+ return "block"; -+ } -+ } - -- if (style !== null) { -- var startOfToken = stream.pos - current.length; -- var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); -+ if (override == "tag") { - -- var newScopes = []; -+ // tag is a css value -+ if (/embed|menu|pre|progress|sub|table/.test(word)) { -+ if (wordIsProperty(firstWordOfLine(stream))) { -+ override = "atom"; -+ return "block"; -+ } -+ } - -- for (var i = 0; i < state.scopes.length; i++) { -- var scope = state.scopes[i]; -+ // tag is an attribute -+ if (stream.string.match(new RegExp("\\[\\s*" + word + "|" + word +"\\s*\\]"))) { -+ override = "atom"; -+ return "block"; -+ } - -- if (scope.offset <= withCurrentIndent) { -- newScopes.push(scope); -+ // tag is a variable -+ if (tagVariablesRegexp.test(word)) { -+ if ((startOfLine(stream) && stream.string.match(/=/)) || -+ (!startOfLine(stream) && -+ !stream.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/) && -+ !wordIsTag(firstWordOfLine(stream)))) { -+ override = "variable-2"; -+ if (wordIsBlock(firstWordOfLine(stream))) return "block"; -+ return pushContext(state, stream, "block", 0); -+ } - } -+ -+ if (endOfLine(stream)) return pushContext(state, stream, "block"); - } -+ if (override == "block-keyword") { -+ override = "keyword"; - -- state.scopes = newScopes; -+ // Postfix conditionals -+ if (stream.current(/(if|unless)/) && !startOfLine(stream)) { -+ return "block"; -+ } -+ return pushContext(state, stream, "block"); -+ } -+ if (word == "return") return pushContext(state, stream, "block", 0); - } -- -- return style; -+ return state.context.type; - }; - -- return { -- startState: function() { -- return { -- tokenizer: tokenBase, -- scopes: [{offset: 0, type: 'styl'}] -- }; -- }, - -- token: function(stream, state) { -- var style = tokenLexer(stream, state); -- state.lastToken = { style: style, content: stream.current() }; -- return style; -- }, -+ /** -+ * Parens -+ */ -+ states.parens = function(type, stream, state) { -+ if (type == "(") return pushContext(state, stream, "parens"); -+ if (type == ")") { -+ if (state.context.prev.type == "parens") { -+ return popContext(state); -+ } -+ if ((stream.string.match(/^[a-z][\w-]*\(/i) && endOfLine(stream)) || -+ wordIsBlock(firstWordOfLine(stream)) || -+ /(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(firstWordOfLine(stream)) || -+ (!stream.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/) && -+ wordIsTag(firstWordOfLine(stream)))) { -+ return pushContext(state, stream, "block"); -+ } -+ if (stream.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/) || -+ stream.string.match(/^\s*(\(|\)|[0-9])/) || -+ stream.string.match(/^\s+[a-z][\w-]*\(/i) || -+ stream.string.match(/^\s+[\$-]?[a-z]/i)) { -+ return pushContext(state, stream, "block", 0); -+ } -+ if (endOfLine(stream)) return pushContext(state, stream, "block"); -+ else return pushContext(state, stream, "block", 0); -+ } -+ if (type && type.charAt(0) == "@" && wordIsProperty(stream.current().slice(1))) { -+ override = "variable-2"; -+ } -+ if (type == "word") { -+ var word = stream.current(); -+ override = wordAsValue(word); -+ if (override == "tag" && tagVariablesRegexp.test(word)) { -+ override = "variable-2"; -+ } -+ if (override == "property" || word == "to") override = "atom"; -+ } -+ if (type == "variable-name") { -+ return pushContext(state, stream, "variableName"); -+ } -+ if (typeIsPseudo(type, stream)) { -+ return pushContext(state, stream, "pseudo"); -+ } -+ return state.context.type; -+ }; - -- indent: function(state) { -- return state.scopes[0].offset; -- }, -- -- lineComment: "//", -- fold: "indent" - -+ /** -+ * Vendor prefixes -+ */ -+ states.vendorPrefixes = function(type, stream, state) { -+ if (type == "word") { -+ override = "property"; -+ return pushContext(state, stream, "block", 0); -+ } -+ return popContext(state); - }; - -- function urlTokens(stream, state) { -- var ch = stream.peek(); - -- if (ch === ")") { -- stream.next(); -- state.tokenizer = tokenBase; -- return "operator"; -- } else if (ch === "(") { -- stream.next(); -- stream.eatSpace(); -+ /** -+ * Pseudo -+ */ -+ states.pseudo = function(type, stream, state) { -+ if (!wordIsProperty(firstWordOfLine(stream.string))) { -+ stream.match(/^[a-z-]+/); -+ override = "variable-3"; -+ if (endOfLine(stream)) return pushContext(state, stream, "block"); -+ return popContext(state); -+ } -+ return popAndPass(type, stream, state); -+ }; -+ - -- return "operator"; -- } else if (ch === "'" || ch === '"') { -- state.tokenizer = buildStringTokenizer(stream.next()); -- return "string"; -- } else { -- state.tokenizer = buildStringTokenizer(")", false); -- return "string"; -+ /** -+ * atBlock -+ */ -+ states.atBlock = function(type, stream, state) { -+ if (type == "(") return pushContext(state, stream, "atBlock_parens"); -+ if (typeIsBlock(type, stream, state)) { -+ return pushContext(state, stream, "block"); - } -- } -+ if (typeIsInterpolation(type, stream)) { -+ return pushContext(state, stream, "interpolation"); -+ } -+ if (type == "word") { -+ var word = stream.current().toLowerCase(); -+ if (/^(only|not|and|or)$/.test(word)) -+ override = "keyword"; -+ else if (documentTypes.hasOwnProperty(word)) -+ override = "tag"; -+ else if (mediaTypes.hasOwnProperty(word)) -+ override = "attribute"; -+ else if (mediaFeatures.hasOwnProperty(word)) -+ override = "property"; -+ else if (nonStandardPropertyKeywords.hasOwnProperty(word)) -+ override = "string-2"; -+ else override = wordAsValue(stream.current()); -+ if (override == "tag" && endOfLine(stream)) { -+ return pushContext(state, stream, "block"); -+ } -+ } -+ if (type == "operator" && /^(not|and|or)$/.test(stream.current())) { -+ override = "keyword"; -+ } -+ return state.context.type; -+ }; - -- function multilineComment(stream, state) { -- if (stream.skipTo("*/")) { -- stream.next(); -- stream.next(); -- state.tokenizer = tokenBase; -- } else { -- stream.next(); -+ states.atBlock_parens = function(type, stream, state) { -+ if (type == "{" || type == "}") return state.context.type; -+ if (type == ")") { -+ if (endOfLine(stream)) return pushContext(state, stream, "block"); -+ else return pushContext(state, stream, "atBlock"); - } -- return "comment"; -- } -+ if (type == "word") { -+ var word = stream.current().toLowerCase(); -+ override = wordAsValue(word); -+ if (/^(max|min)/.test(word)) override = "property"; -+ if (override == "tag") { -+ tagVariablesRegexp.test(word) ? override = "variable-2" : override = "atom"; -+ } -+ return state.context.type; -+ } -+ return states.atBlock(type, stream, state); -+ }; - -- function buildStringTokenizer(quote, greedy) { - -- if(greedy == null) { -- greedy = true; -+ /** -+ * Keyframes -+ */ -+ states.keyframes = function(type, stream, state) { -+ if (stream.indentation() == "0" && ((type == "}" && startOfLine(stream)) || type == "]" || type == "hash" -+ || type == "qualifier" || wordIsTag(stream.current()))) { -+ return popAndPass(type, stream, state); - } -+ if (type == "{") return pushContext(state, stream, "keyframes"); -+ if (type == "}") { -+ if (startOfLine(stream)) return popContext(state, true); -+ else return pushContext(state, stream, "keyframes"); -+ } -+ if (type == "unit" && /^[0-9]+\%$/.test(stream.current())) { -+ return pushContext(state, stream, "keyframes"); -+ } -+ if (type == "word") { -+ override = wordAsValue(stream.current()); -+ if (override == "block-keyword") { -+ override = "keyword"; -+ return pushContext(state, stream, "keyframes"); -+ } -+ } -+ if (/@(font-face|media|supports|(-moz-)?document)/.test(type)) { -+ return pushContext(state, stream, endOfLine(stream) ? "block" : "atBlock"); -+ } -+ if (type == "mixin") { -+ return pushContext(state, stream, "block", 0); -+ } -+ return state.context.type; -+ }; - -- function stringTokenizer(stream, state) { -- var nextChar = stream.next(); -- var peekChar = stream.peek(); -- var previousChar = stream.string.charAt(stream.pos-2); -- -- var endingString = ((nextChar !== "\\" && peekChar === quote) || -- (nextChar === quote && previousChar !== "\\")); - -- if (endingString) { -- if (nextChar !== quote && greedy) { -- stream.next(); -- } -- state.tokenizer = tokenBase; -- return "string"; -- } else if (nextChar === "#" && peekChar === "{") { -- state.tokenizer = buildInterpolationTokenizer(stringTokenizer); -- stream.next(); -- return "operator"; -- } else { -- return "string"; -+ /** -+ * Interpolation -+ */ -+ states.interpolation = function(type, stream, state) { -+ if (type == "{") popContext(state) && pushContext(state, stream, "block"); -+ if (type == "}") { -+ if (stream.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i) || -+ (stream.string.match(/^\s*[a-z]/i) && wordIsTag(firstWordOfLine(stream)))) { -+ return pushContext(state, stream, "block"); - } -+ if (!stream.string.match(/^(\{|\s*\&)/) || -+ stream.match(/\s*[\w-]/,false)) { -+ return pushContext(state, stream, "block", 0); -+ } -+ return pushContext(state, stream, "block"); -+ } -+ if (type == "variable-name") { -+ return pushContext(state, stream, "variableName", 0); -+ } -+ if (type == "word") { -+ override = wordAsValue(stream.current()); -+ if (override == "tag") override = "atom"; - } -+ return state.context.type; -+ }; - -- return stringTokenizer; -- } - -- function buildInterpolationTokenizer(currentTokenizer) { -- return function(stream, state) { -- if (stream.peek() === "}") { -- stream.next(); -- state.tokenizer = currentTokenizer; -- return "operator"; -- } else { -- return tokenBase(stream, state); -- } -- }; -- } -+ /** -+ * Extend/s -+ */ -+ states.extend = function(type, stream, state) { -+ if (type == "[" || type == "=") return "extend"; -+ if (type == "]") return popContext(state); -+ if (type == "word") { -+ override = wordAsValue(stream.current()); -+ return "extend"; -+ } -+ return popContext(state); -+ }; -+ - -- function indent(state) { -- if (state.indentCount == 0) { -- state.indentCount++; -- var lastScopeOffset = state.scopes[0].offset; -- var currentOffset = lastScopeOffset + config.indentUnit; -- state.scopes.unshift({ offset:currentOffset }); -+ /** -+ * Variable name -+ */ -+ states.variableName = function(type, stream, state) { -+ if (type == "string" || type == "[" || type == "]" || stream.current().match(/^(\.|\$)/)) { -+ if (stream.current().match(/^\.[\w-]+/i)) override = "variable-2"; -+ if (endOfLine(stream)) return popContext(state); -+ return "variableName"; - } -- } -+ return popAndPass(type, stream, state); -+ }; - -- function dedent(state) { -- if (state.scopes.length == 1) { return true; } -- state.scopes.shift(); -- } - -+ return { -+ startState: function(base) { -+ return { -+ tokenize: null, -+ state: "block", -+ context: new Context("block", base || 0, null) -+ }; -+ }, -+ token: function(stream, state) { -+ if (!state.tokenize && stream.eatSpace()) return null; -+ style = (state.tokenize || tokenBase)(stream, state); -+ if (style && typeof style == "object") { -+ type = style[1]; -+ style = style[0]; -+ } -+ override = style; -+ state.state = states[state.state](type, stream, state); -+ return override; -+ }, -+ indent: function(state, textAfter, line) { -+ -+ var cx = state.context, -+ ch = textAfter && textAfter.charAt(0), -+ indent = cx.indent, -+ lineFirstWord = firstWordOfLine(textAfter), -+ lineIndent = line.length - line.replace(/^\s*/, "").length, -+ prevLineFirstWord = state.context.prev ? state.context.prev.line.firstWord : "", -+ prevLineIndent = state.context.prev ? state.context.prev.line.indent : lineIndent; -+ -+ if (cx.prev && -+ (ch == "}" && (cx.type == "block" || cx.type == "atBlock" || cx.type == "keyframes") || -+ ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || -+ ch == "{" && (cx.type == "at"))) { -+ indent = cx.indent - indentUnit; -+ cx = cx.prev; -+ } else if (!(/(\})/.test(ch))) { -+ if (/@|\$|\d/.test(ch) || -+ /^\{/.test(textAfter) || -+/^\s*\/(\/|\*)/.test(textAfter) || -+ /^\s*\/\*/.test(prevLineFirstWord) || -+ /^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(textAfter) || -+/^(\+|-)?[a-z][\w-]*\(/i.test(textAfter) || -+/^return/.test(textAfter) || -+ wordIsBlock(lineFirstWord)) { -+ indent = lineIndent; -+ } else if (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(ch) || wordIsTag(lineFirstWord)) { -+ if (/\,\s*$/.test(prevLineFirstWord)) { -+ indent = prevLineIndent; -+ } else if (/^\s+/.test(line) && (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(prevLineFirstWord) || wordIsTag(prevLineFirstWord))) { -+ indent = lineIndent <= prevLineIndent ? prevLineIndent : prevLineIndent + indentUnit; -+ } else { -+ indent = lineIndent; -+ } -+ } else if (!/,\s*$/.test(line) && (wordIsVendorPrefix(lineFirstWord) || wordIsProperty(lineFirstWord))) { -+ if (wordIsBlock(prevLineFirstWord)) { -+ indent = lineIndent <= prevLineIndent ? prevLineIndent : prevLineIndent + indentUnit; -+ } else if (/^\{/.test(prevLineFirstWord)) { -+ indent = lineIndent <= prevLineIndent ? lineIndent : prevLineIndent + indentUnit; -+ } else if (wordIsVendorPrefix(prevLineFirstWord) || wordIsProperty(prevLineFirstWord)) { -+ indent = lineIndent >= prevLineIndent ? prevLineIndent : lineIndent; -+ } else if (/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(prevLineFirstWord) || -+ /=\s*$/.test(prevLineFirstWord) || -+ wordIsTag(prevLineFirstWord) || -+ /^\$[\w-\.\[\]\'\"]/.test(prevLineFirstWord)) { -+ indent = prevLineIndent + indentUnit; -+ } else { -+ indent = lineIndent; -+ } -+ } -+ } -+ return indent; -+ }, -+ electricChars: "}", -+ lineComment: "//", -+ fold: "indent" -+ }; - }); - -- // https://developer.mozilla.org/en-US/docs/Web/HTML/Element -- var cssTypeSelectors_ = ["a","abbr","address","area","article","aside","audio", "b", "base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]; -- // https://github.com/csscomb/csscomb.js/blob/master/config/zen.json -- var cssProperties_ = ["position","top","right","bottom","left","z-index","display","visibility","flex-direction","flex-order","flex-pack","float","clear","flex-align","overflow","overflow-x","overflow-y","overflow-scrolling","clip","box-sizing","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","min-width","min-height","max-width","max-height","width","height","outline","outline-width","outline-style","outline-color","outline-offset","border","border-spacing","border-collapse","border-width","border-style","border-color","border-top","border-top-width","border-top-style","border-top-color","border-right","border-right-width","border-right-style","border-right-color","border-bottom","border-bottom-width","border-bottom-style","border-bottom-color","border-left","border-left-width","border-left-style","border-left-color","border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-image","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat","border-top-image","border-right-image","border-bottom-image","border-left-image","border-corner-image","border-top-left-image","border-top-right-image","border-bottom-right-image","border-bottom-left-image","background","filter:progid:DXImageTransform\\.Microsoft\\.AlphaImageLoader","background-color","background-image","background-attachment","background-position","background-position-x","background-position-y","background-clip","background-origin","background-size","background-repeat","box-decoration-break","box-shadow","color","table-layout","caption-side","empty-cells","list-style","list-style-position","list-style-type","list-style-image","quotes","content","counter-increment","counter-reset","writing-mode","vertical-align","text-align","text-align-last","text-decoration","text-emphasis","text-emphasis-position","text-emphasis-style","text-emphasis-color","text-indent","-ms-text-justify","text-justify","text-outline","text-transform","text-wrap","text-overflow","text-overflow-ellipsis","text-overflow-mode","text-size-adjust","text-shadow","white-space","word-spacing","word-wrap","word-break","tab-size","hyphens","letter-spacing","font","font-weight","font-style","font-variant","font-size-adjust","font-stretch","font-size","font-family","src","line-height","opacity","filter:\\\\\\\\'progid:DXImageTransform.Microsoft.Alpha","filter:progid:DXImageTransform.Microsoft.Alpha\\(Opacity","interpolation-mode","filter","resize","cursor","nav-index","nav-up","nav-right","nav-down","nav-left","transition","transition-delay","transition-timing-function","transition-duration","transition-property","transform","transform-origin","animation","animation-name","animation-duration","animation-play-state","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","pointer-events","unicode-bidi","direction","columns","column-span","column-width","column-count","column-fill","column-gap","column-rule","column-rule-width","column-rule-style","column-rule-color","break-before","break-inside","break-after","page-break-before","page-break-inside","page-break-after","orphans","widows","zoom","max-zoom","min-zoom","user-zoom","orientation","text-rendering","speak","animation-fill-mode","backface-visibility","user-drag","user-select","appearance"]; -- // https://github.com/codemirror/CodeMirror/blob/master/mode/css/css.js#L501 -- var cssValues_ = ["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale"]; -- var cssColorValues_ = ["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]; -- var cssValuesWithBrackets_ = ["gradient","linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","cubic-bezier","translateX","translateY","translate3d","rotate3d","scale","scale3d","perspective","skewX"]; -- -- var wordOperators = ["in", "and", "or", "not", "is a", "is", "isnt", "defined", "if unless"], -- commonKeywords = ["for", "if", "else", "unless", "return"], -- commonAtoms = ["null", "true", "false", "href", "title", "type", "not-allowed", "readonly", "disabled"], -- commonDef = ["@font-face", "@keyframes", "@media", "@viewport", "@page", "@host", "@supports", "@block", "@css"], -- cssTypeSelectors = keySet(cssTypeSelectors_), -- cssProperties = keySet(cssProperties_), -- cssValues = keySet(cssValues_.concat(cssColorValues_)), -- hintWords = wordOperators.concat(commonKeywords, -- commonAtoms, -- commonDef, -- cssTypeSelectors_, -- cssProperties_, -- cssValues_, -- cssValuesWithBrackets_, -- cssColorValues_); -+ // developer.mozilla.org/en-US/docs/Web/HTML/Element -+ var tagKeywords_ = ["a","abbr","address","area","article","aside","audio", "b", "base","bdi", "bdo","bgsound","blockquote","body","br","button","canvas","caption","cite", "code","col","colgroup","data","datalist","dd","del","details","dfn","div", "dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1", "h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe", "img","input","ins","kbd","keygen","label","legend","li","link","main","map", "mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes", "noscript","object","ol","optgroup","option","output","p","param","pre", "progress","q","rp","rt","ruby","s","samp","script","section","select", "small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track", "u","ul","var","video"]; -+ -+ // github.com/codemirror/CodeMirror/blob/master/mode/css/css.js -+ var documentTypes_ = ["domain", "regexp", "url", "url-prefix"]; -+ var mediaTypes_ = ["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]; -+ var mediaFeatures_ = ["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"]; -+ var propertyKeywords_ = ["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"]; -+ var nonStandardPropertyKeywords_ = ["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"]; -+ var fontProperties_ = ["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]; -+ var colorKeywords_ = ["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]; -+ var valueKeywords_ = ["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale"]; -+ -+ var wordOperatorKeywords_ = ["in","and","or","not","is not","is a","is","isnt","defined","if unless"], -+ blockKeywords_ = ["for","if","else","unless", "from", "to"], -+ commonAtoms_ = ["null","true","false","href","title","type","not-allowed","readonly","disabled"], -+ commonDef_ = ["@font-face", "@keyframes", "@media", "@viewport", "@page", "@host", "@supports", "@block", "@css"]; -+ -+ var hintWords = tagKeywords_.concat(documentTypes_,mediaTypes_,mediaFeatures_, -+ propertyKeywords_,nonStandardPropertyKeywords_, -+ colorKeywords_,valueKeywords_,fontProperties_, -+ wordOperatorKeywords_,blockKeywords_, -+ commonAtoms_,commonDef_); - - function wordRegexp(words) { -+ words = words.sort(function(a,b){return b > a;}); - return new RegExp("^((" + words.join(")|(") + "))\\b"); -- }; -+ } - - function keySet(array) { - var keys = {}; -- for (var i = 0; i < array.length; ++i) { -- keys[array[i]] = true; -- } -+ for (var i = 0; i < array.length; ++i) keys[array[i]] = true; - return keys; -- }; -+ } -+ -+ function escapeRegExp(text) { -+ return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); -+ } - - CodeMirror.registerHelper("hintWords", "stylus", hintWords); - CodeMirror.defineMIME("text/x-styl", "stylus"); -- - }); -diff --git a/media/editors/codemirror/mode/stylus/stylus.min.js b/media/editors/codemirror/mode/stylus/stylus.min.js -index 9f470c9..b7c1f34 100644 ---- a/media/editors/codemirror/mode/stylus/stylus.min.js -+++ b/media/editors/codemirror/mode/stylus/stylus.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e){for(var t={},r=0;r=?|%=?|&&|\|=?|\~|!|\^|\\)/,f=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,w=t(s),k=t(d),y=t(c),v=t(u),x=new RegExp(/^\-(moz|ms|o|webkit)-/),z=new RegExp("^("+l.join("|")+")\\([\\w-\\#\\,\\.\\%\\s\\(\\)]*\\)"),q=function(e,o){if(e.eatSpace())return null;var l=e.peek();if(e.match("//"))return e.skipToEnd(),"comment";if(e.match("/*"))return o.tokenizer=i,o.tokenizer(e,o);if('"'===l||"'"===l)return e.next(),o.tokenizer=a(l),"string";if("@"===l)return e.next(),e.match(/extend/)?b(o):e.match(/media[\w-\s]*[\w-]/)?n(o):e.eatWhile(/[\w-]/)&&e.current().match(v)&&n(o),"def";if(e.match(/^-?[0-9\.]/,!1)){if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)||e.match(/^-?\d+\.\d*/))return"."==e.peek()&&e.backUp(1),e.eatWhile(/[a-z%]/i),"number";if(e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)||e.match(/^-?0(?![\dx])/i))return e.eatWhile(/[a-z%]/i),"number"}if("#"===l){if(e.next(),e.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i))return"atom";if(e.match(/^[\w-]+/i))return n(o),"builtin"}if(e.match(x))return"meta";if(e.match(z))return"atom";if(e.sol()&&e.match(/^\.?[a-z][\w-]*\(/i))return e.backUp(1),n(o),"keyword";if(e.match(/^\.?[a-z][\w-]*\(/i))return e.backUp(1),"keyword";if(e.match(/^(\+|\-)[a-z][\w-]+\(/i))return e.backUp(1),n(o),"keyword";if(e.match(/^url/)&&"("===e.peek())return o.tokenizer=r,e.peek()||(o.cursorHalf=0),"atom";if(e.match(/^\.[a-z][\w-]*/i))return n(o),"qualifier";if(e.match(/^(_|__|-|--)[a-z0-9-]+/))return"qualifier";if(":"==l&&e.match(/^::?[\w-]+/))return n(o),"variable-3";if(e.match(t(["for","if","else","unless"])))return n(o),"keyword";if(e.match(k))return"keyword";if(e.match(y))return"atom";if(e.match(/^\$?[a-z][\w-]+\s?=(\s|[\w-'"\$])/i)){e.backUp(2);var s=e.current().toLowerCase().match(/[\w-]+/)[0];return void 0===p[s]?"variable-2":"property"}if(e.match(/\$[\w-\.]+/i))return"variable-2";if(e.match(/\$?[\w-]+\.[\w-]+/i)){var d=e.current().toLowerCase().match(/[\w]+/)[0];if(void 0===m[d])return"variable-2";e.backUp(e.current().length)}if("!"===l)return e.next(),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(/^\/(:|\.|#|[a-z])/))return e.backUp(1),"variable-3";if(e.match(g)||e.match(w))return"operator";if(e.match(f))return null;if("&"===l)return e.next(),"variable-3";if(e.match(/^[A-Z][a-z0-9-]+/))return"string";if(e.match(/[\w-]*/i)){var c=e.current().toLowerCase();if(void 0!==p[c])return e.eol()?"variable-2":"property";if(void 0!==h[c])return"atom";if(void 0!==m[c])return n(o),"tag";if(c)return"variable-2"}return e.next(),null},j=function(t,r){t.sol()&&(r.indentCount=0);var i=r.tokenizer(t,r),a=t.current();if(!t.eol()||"}"!==a&&","!==a||b(r),null!==i){for(var o=t.pos-a.length,n=o+e.indentUnit*r.indentCount,l=[],s=0;sa}),new RegExp("^(("+a.join(")|(")+"))\\b")}function c(a){for(var b={},c=0;c|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/),b.context.line.firstWord=da?da[0].replace(/^\s*/,""):"",b.context.line.indent=a.indentation(),K=a.peek(),a.match("//"))return a.skipToEnd(),["comment","comment"];if(a.match("/*"))return b.tokenize=r,r(a,b);if('"'==K||"'"==K)return a.next(),b.tokenize=s(K),b.tokenize(a,b);if("@"==K)return a.next(),a.eatWhile(/[\w\\-]/),["def",a.current()];if("#"==K){if(a.next(),a.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i))return["atom","atom"];if(a.match(/^[a-z][\w-]*/i))return["builtin","hash"]}return a.match(ba)?["meta","vendor-prefixes"]:a.match(/^-?[0-9]?\.?[0-9]/)?(a.eatWhile(/[a-z%]/i),["number","unit"]):"!"==K?(a.next(),[a.match(/^(important|optional)/i)?"keyword":"operator","important"]):"."==K&&a.match(/^\.[a-z][\w-]*/i)?["qualifier","qualifier"]:a.match(W)?("("==a.peek()&&(b.tokenize=t),["property","word"]):a.match(/^[a-z][\w-]*\(/i)?(a.backUp(1),["keyword","mixin"]):a.match(/^(\+|-)[a-z][\w-]*\(/i)?(a.backUp(1),["keyword","block-mixin"]):a.string.match(/^\s*&/)&&a.match(/^[-_]+[a-z][\w-]*/)?["qualifier","qualifier"]:a.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)?(a.backUp(1),["variable-3","reference"]):a.match(/^&{1}\s*$/)?["variable-3","reference"]:"$"==K&&a.match(/^\$[\w-]+/i)?["variable-2","variable-name"]:a.match(_)?["operator","operator"]:a.match(/^[-_]*[a-z0-9]+[\w-]*/i)?a.match(/^(\.|\[)[\w-\'\"\]]+/i,!1)&&!z(a.current())?(a.match(/[\w-]+/),["variable-2","variable-name"]):["variable-2","word"]:a.match($)?["operator",a.current()]:/[:;,{}\[\]\(\)]/.test(K)?(a.next(),[null,K]):(a.next(),[null,null])}function r(a,b){for(var c,d=!1;null!=(c=a.next());){if(d&&"/"==c){b.tokenize=null;break}d="*"==c}return["comment","comment"]}function s(a){return function(b,c){for(var d,e=!1;null!=(d=b.next());){if(d==a&&!e){")"==a&&b.backUp(1);break}e=!e&&"\\"==d}return(d==a||!e&&")"!=a)&&(c.tokenize=null),["string","string"]}}function t(a,b){return a.next(),a.match(/\s*[\"\')]/,!1)?b.tokenize=null:b.tokenize=s(")"),[null,"("]}function u(a,b,c,d){this.type=a,this.indent=b,this.prev=c,this.line=d||{firstWord:"",indent:0}}function v(a,b,c,d){return d=d>=0?d:O,a.context=new u(c,b.indentation()+d,a.context),c}function w(a,b){var c=a.context.indent-O;return b=b||!1,a.context=a.context.prev,b&&(a.context.indent=c),a.context.type}function x(a,b,c){return ea[c.context.type](a,b,c)}function y(a,b,c,d){for(var e=d||1;e>0;e--)c.context=c.context.prev;return x(a,b,c)}function z(a){return a.toLowerCase()in P}function A(a){return a=a.toLowerCase(),a in R||a in Z}function B(a){return a.toLowerCase()in aa}function C(a){return a.toLowerCase().match(ba)}function D(a){var b=a.toLowerCase(),c="variable-2";return z(a)?c="tag":B(a)?c="block-keyword":A(a)?c="property":b in T||b in ca?c="atom":"return"==b||b in U?c="keyword":a.match(/^[A-Z]/)&&(c="string"),c}function E(a,b){return I(b)&&("{"==a||"]"==a||"hash"==a||"qualifier"==a)||"block-mixin"==a}function F(a,b){return"{"==a&&b.match(/^\s*\$?[\w-]+/i,!1)}function G(a,b){return":"==a&&b.match(/^[a-z-]+/,!1)}function H(a){return a.sol()||a.string.match(new RegExp("^\\s*"+d(a.current())))}function I(a){return a.eol()||a.match(/^\s*$/,!1)}function J(a){var b=/^\s*[-_]*[a-z0-9]+[\w-]*/i,c="string"==typeof a?a.match(b):a.string.match(b);return c?c[0].replace(/^\s*/,""):""}var K,L,M,N,O=a.indentUnit,P=c(e),Q=/^(a|b|i|s|col|em)$/i,R=c(i),S=c(j),T=c(m),U=c(l),V=c(f),W=b(f),X=c(h),Y=c(g),Z=c(k),$=/^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/,_=b(n),aa=c(o),ba=new RegExp(/^\-(moz|ms|o|webkit)-/i),ca=c(p),da="",ea={};return ea.block=function(a,b,c){if("comment"==a&&H(b)||","==a&&I(b)||"mixin"==a)return v(c,b,"block",0);if(F(a,b))return v(c,b,"interpolation");if(I(b)&&"]"==a&&!/^\s*(\.|#|:|\[|\*|&)/.test(b.string)&&!z(J(b)))return v(c,b,"block",0);if(E(a,b,c))return v(c,b,"block");if("}"==a&&I(b))return v(c,b,"block",0);if("variable-name"==a)return 0==b.indentation()&&H(b)||B(J(b))?v(c,b,"variableName"):v(c,b,"variableName",0);if("="==a)return I(b)||B(J(b))?v(c,b,"block"):v(c,b,"block",0);if("*"==a&&(I(b)||b.match(/\s*(,|\.|#|\[|:|{)/,!1)))return N="tag",v(c,b,"block");if(G(a,b))return v(c,b,"pseudo");if(/@(font-face|media|supports|(-moz-)?document)/.test(a))return v(c,b,I(b)?"block":"atBlock");if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test(a))return v(c,b,"keyframes");if(/@extends?/.test(a))return v(c,b,"extend",0);if(a&&"@"==a.charAt(0))return b.indentation()>0&&A(b.current().slice(1))?(N="variable-2","block"):/(@import|@require|@charset)/.test(a)?v(c,b,"block",0):v(c,b,"block");if("reference"==a&&I(b))return v(c,b,"block");if("("==a)return v(c,b,"parens");if("vendor-prefixes"==a)return v(c,b,"vendorPrefixes");if("word"==a){var d=b.current();if(N=D(d),"property"==N)return H(b)?v(c,b,"block",0):(N="atom","block");if("tag"==N){if(/embed|menu|pre|progress|sub|table/.test(d)&&A(J(b)))return N="atom","block";if(b.string.match(new RegExp("\\[\\s*"+d+"|"+d+"\\s*\\]")))return N="atom","block";if(Q.test(d)&&(H(b)&&b.string.match(/=/)||!H(b)&&!b.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!z(J(b))))return N="variable-2",B(J(b))?"block":v(c,b,"block",0);if(I(b))return v(c,b,"block")}if("block-keyword"==N)return N="keyword",b.current(/(if|unless)/)&&!H(b)?"block":v(c,b,"block");if("return"==d)return v(c,b,"block",0)}return c.context.type},ea.parens=function(a,b,c){if("("==a)return v(c,b,"parens");if(")"==a)return"parens"==c.context.prev.type?w(c):b.string.match(/^[a-z][\w-]*\(/i)&&I(b)||B(J(b))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(J(b))||!b.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/)&&z(J(b))?v(c,b,"block"):b.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/)||b.string.match(/^\s*(\(|\)|[0-9])/)||b.string.match(/^\s+[a-z][\w-]*\(/i)||b.string.match(/^\s+[\$-]?[a-z]/i)?v(c,b,"block",0):I(b)?v(c,b,"block"):v(c,b,"block",0);if(a&&"@"==a.charAt(0)&&A(b.current().slice(1))&&(N="variable-2"),"word"==a){var d=b.current();N=D(d),"tag"==N&&Q.test(d)&&(N="variable-2"),("property"==N||"to"==d)&&(N="atom")}return"variable-name"==a?v(c,b,"variableName"):G(a,b)?v(c,b,"pseudo"):c.context.type},ea.vendorPrefixes=function(a,b,c){return"word"==a?(N="property",v(c,b,"block",0)):w(c)},ea.pseudo=function(a,b,c){return A(J(b.string))?y(a,b,c):(b.match(/^[a-z-]+/),N="variable-3",I(b)?v(c,b,"block"):w(c))},ea.atBlock=function(a,b,c){if("("==a)return v(c,b,"atBlock_parens");if(E(a,b,c))return v(c,b,"block");if(F(a,b))return v(c,b,"interpolation");if("word"==a){var d=b.current().toLowerCase();if(N=/^(only|not|and|or)$/.test(d)?"keyword":V.hasOwnProperty(d)?"tag":Y.hasOwnProperty(d)?"attribute":X.hasOwnProperty(d)?"property":S.hasOwnProperty(d)?"string-2":D(b.current()),"tag"==N&&I(b))return v(c,b,"block")}return"operator"==a&&/^(not|and|or)$/.test(b.current())&&(N="keyword"),c.context.type},ea.atBlock_parens=function(a,b,c){if("{"==a||"}"==a)return c.context.type;if(")"==a)return I(b)?v(c,b,"block"):v(c,b,"atBlock");if("word"==a){var d=b.current().toLowerCase();return N=D(d),/^(max|min)/.test(d)&&(N="property"),"tag"==N&&(N=Q.test(d)?"variable-2":"atom"),c.context.type}return ea.atBlock(a,b,c)},ea.keyframes=function(a,b,c){return"0"==b.indentation()&&("}"==a&&H(b)||"]"==a||"hash"==a||"qualifier"==a||z(b.current()))?y(a,b,c):"{"==a?v(c,b,"keyframes"):"}"==a?H(b)?w(c,!0):v(c,b,"keyframes"):"unit"==a&&/^[0-9]+\%$/.test(b.current())?v(c,b,"keyframes"):"word"==a&&(N=D(b.current()),"block-keyword"==N)?(N="keyword",v(c,b,"keyframes")):/@(font-face|media|supports|(-moz-)?document)/.test(a)?v(c,b,I(b)?"block":"atBlock"):"mixin"==a?v(c,b,"block",0):c.context.type},ea.interpolation=function(a,b,c){return"{"==a&&w(c)&&v(c,b,"block"),"}"==a?b.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||b.string.match(/^\s*[a-z]/i)&&z(J(b))?v(c,b,"block"):!b.string.match(/^(\{|\s*\&)/)||b.match(/\s*[\w-]/,!1)?v(c,b,"block",0):v(c,b,"block"):"variable-name"==a?v(c,b,"variableName",0):("word"==a&&(N=D(b.current()),"tag"==N&&(N="atom")),c.context.type)},ea.extend=function(a,b,c){return"["==a||"="==a?"extend":"]"==a?w(c):"word"==a?(N=D(b.current()),"extend"):w(c)},ea.variableName=function(a,b,c){return"string"==a||"["==a||"]"==a||b.current().match(/^(\.|\$)/)?(b.current().match(/^\.[\w-]+/i)&&(N="variable-2"),I(b)?w(c):"variableName"):y(a,b,c)},{startState:function(a){return{tokenize:null,state:"block",context:new u("block",a||0,null)}},token:function(a,b){return!b.tokenize&&a.eatSpace()?null:(L=(b.tokenize||q)(a,b),L&&"object"==typeof L&&(M=L[1],L=L[0]),N=L,b.state=ea[b.state](M,a,b),N)},indent:function(a,b,c){var d=a.context,e=b&&b.charAt(0),f=d.indent,g=J(b),h=c.length-c.replace(/^\s*/,"").length,i=a.context.prev?a.context.prev.line.firstWord:"",j=a.context.prev?a.context.prev.line.indent:h;return d.prev&&("}"==e&&("block"==d.type||"atBlock"==d.type||"keyframes"==d.type)||")"==e&&("parens"==d.type||"atBlock_parens"==d.type)||"{"==e&&"at"==d.type)?(f=d.indent-O,d=d.prev):/(\})/.test(e)||(/@|\$|\d/.test(e)||/^\{/.test(b)||/^\s*\/(\/|\*)/.test(b)||/^\s*\/\*/.test(i)||/^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(b)||/^(\+|-)?[a-z][\w-]*\(/i.test(b)||/^return/.test(b)||B(g)?f=h:/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(e)||z(g)?f=/\,\s*$/.test(i)?j:/^\s+/.test(c)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(i)||z(i))?j>=h?j:j+O:h:/,\s*$/.test(c)||!C(g)&&!A(g)||(f=B(i)?j>=h?j:j+O:/^\{/.test(i)?j>=h?h:j+O:C(i)||A(i)?h>=j?j:h:/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(i)||/=\s*$/.test(i)||z(i)||/^\$[\w-\.\[\]\'\"]/.test(i)?j+O:h)),f},electricChars:"}",lineComment:"//",fold:"indent"}});var e=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video"],f=["domain","regexp","url","url-prefix"],g=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],h=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],i=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"],j=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],k=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],l=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],m=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale"],n=["in","and","or","not","is not","is a","is","isnt","defined","if unless"],o=["for","if","else","unless","from","to"],p=["null","true","false","href","title","type","not-allowed","readonly","disabled"],q=["@font-face","@keyframes","@media","@viewport","@page","@host","@supports","@block","@css"],r=e.concat(f,g,h,i,j,l,m,k,n,o,p,q);a.registerHelper("hintWords","stylus",r),a.defineMIME("text/x-styl","stylus")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/tcl/tcl.min.js b/media/editors/codemirror/mode/tcl/tcl.min.js -index 144ca1a..49b0831 100644 ---- a/media/editors/codemirror/mode/tcl/tcl.min.js -+++ b/media/editors/codemirror/mode/tcl/tcl.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tcl",function(){function e(e){for(var r={},t=e.split(" "),n=0;n!?^\/\|]/;return{startState:function(){return{tokenize:t,beforeParams:!1,inParams:!1}},token:function(e,r){return e.eatSpace()?null:r.tokenize(e,r)}}}),e.defineMIME("text/x-tcl","tcl")}); -\ 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("tcl",function(){function a(a){for(var b={},c=a.split(" "),d=0;d!?^\/\|]/;return{startState:function(){return{tokenize:c,beforeParams:!1,inParams:!1}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)}}}),a.defineMIME("text/x-tcl","tcl")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/textile/test.js b/media/editors/codemirror/mode/textile/test.js -deleted file mode 100644 -index 49cdaf9..0000000 ---- a/media/editors/codemirror/mode/textile/test.js -+++ /dev/null -@@ -1,417 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({tabSize: 4}, 'textile'); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- -- MT('simpleParagraphs', -- 'Some text.', -- '', -- 'Some more text.'); -- -- /* -- * Phrase Modifiers -- */ -- -- MT('em', -- 'foo [em _bar_]'); -- -- MT('emBoogus', -- 'code_mirror'); -- -- MT('strong', -- 'foo [strong *bar*]'); -- -- MT('strongBogus', -- '3 * 3 = 9'); -- -- MT('italic', -- 'foo [em __bar__]'); -- -- MT('italicBogus', -- 'code__mirror'); -- -- MT('bold', -- 'foo [strong **bar**]'); -- -- MT('boldBogus', -- '3 ** 3 = 27'); -- -- MT('simpleLink', -- '[link "CodeMirror":http://codemirror.net]'); -- -- MT('referenceLink', -- '[link "CodeMirror":code_mirror]', -- 'Normal Text.', -- '[link [[code_mirror]]http://codemirror.net]'); -- -- MT('footCite', -- 'foo bar[qualifier [[1]]]'); -- -- MT('footCiteBogus', -- 'foo bar[[1a2]]'); -- -- MT('special-characters', -- 'Registered [tag (r)], ' + -- 'Trademark [tag (tm)], and ' + -- 'Copyright [tag (c)] 2008'); -- -- MT('cite', -- "A book is [keyword ??The Count of Monte Cristo??] by Dumas."); -- -- MT('additionAndDeletion', -- 'The news networks declared [negative -Al Gore-] ' + -- '[positive +George W. Bush+] the winner in Florida.'); -- -- MT('subAndSup', -- 'f(x, n) = log [builtin ~4~] x [builtin ^n^]'); -- -- MT('spanAndCode', -- 'A [quote %span element%] and [atom @code element@]'); -- -- MT('spanBogus', -- 'Percentage 25% is not a span.'); -- -- MT('citeBogus', -- 'Question? is not a citation.'); -- -- MT('codeBogus', -- 'user@example.com'); -- -- MT('subBogus', -- '~username'); -- -- MT('supBogus', -- 'foo ^ bar'); -- -- MT('deletionBogus', -- '3 - 3 = 0'); -- -- MT('additionBogus', -- '3 + 3 = 6'); -- -- MT('image', -- 'An image: [string !http://www.example.com/image.png!]'); -- -- MT('imageWithAltText', -- 'An image: [string !http://www.example.com/image.png (Alt Text)!]'); -- -- MT('imageWithUrl', -- 'An image: [string !http://www.example.com/image.png!:http://www.example.com/]'); -- -- /* -- * Headers -- */ -- -- MT('h1', -- '[header&header-1 h1. foo]'); -- -- MT('h2', -- '[header&header-2 h2. foo]'); -- -- MT('h3', -- '[header&header-3 h3. foo]'); -- -- MT('h4', -- '[header&header-4 h4. foo]'); -- -- MT('h5', -- '[header&header-5 h5. foo]'); -- -- MT('h6', -- '[header&header-6 h6. foo]'); -- -- MT('h7Bogus', -- 'h7. foo'); -- -- MT('multipleHeaders', -- '[header&header-1 h1. Heading 1]', -- '', -- 'Some text.', -- '', -- '[header&header-2 h2. Heading 2]', -- '', -- 'More text.'); -- -- MT('h1inline', -- '[header&header-1 h1. foo ][header&header-1&em _bar_][header&header-1 baz]'); -- -- /* -- * Lists -- */ -- -- MT('ul', -- 'foo', -- 'bar', -- '', -- '[variable-2 * foo]', -- '[variable-2 * bar]'); -- -- MT('ulNoBlank', -- 'foo', -- 'bar', -- '[variable-2 * foo]', -- '[variable-2 * bar]'); -- -- MT('ol', -- 'foo', -- 'bar', -- '', -- '[variable-2 # foo]', -- '[variable-2 # bar]'); -- -- MT('olNoBlank', -- 'foo', -- 'bar', -- '[variable-2 # foo]', -- '[variable-2 # bar]'); -- -- MT('ulFormatting', -- '[variable-2 * ][variable-2&em _foo_][variable-2 bar]', -- '[variable-2 * ][variable-2&strong *][variable-2&em&strong _foo_]' + -- '[variable-2&strong *][variable-2 bar]', -- '[variable-2 * ][variable-2&strong *foo*][variable-2 bar]'); -- -- MT('olFormatting', -- '[variable-2 # ][variable-2&em _foo_][variable-2 bar]', -- '[variable-2 # ][variable-2&strong *][variable-2&em&strong _foo_]' + -- '[variable-2&strong *][variable-2 bar]', -- '[variable-2 # ][variable-2&strong *foo*][variable-2 bar]'); -- -- MT('ulNested', -- '[variable-2 * foo]', -- '[variable-3 ** bar]', -- '[keyword *** bar]', -- '[variable-2 **** bar]', -- '[variable-3 ** bar]'); -- -- MT('olNested', -- '[variable-2 # foo]', -- '[variable-3 ## bar]', -- '[keyword ### bar]', -- '[variable-2 #### bar]', -- '[variable-3 ## bar]'); -- -- MT('ulNestedWithOl', -- '[variable-2 * foo]', -- '[variable-3 ## bar]', -- '[keyword *** bar]', -- '[variable-2 #### bar]', -- '[variable-3 ** bar]'); -- -- MT('olNestedWithUl', -- '[variable-2 # foo]', -- '[variable-3 ** bar]', -- '[keyword ### bar]', -- '[variable-2 **** bar]', -- '[variable-3 ## bar]'); -- -- MT('definitionList', -- '[number - coffee := Hot ][number&em _and_][number black]', -- '', -- 'Normal text.'); -- -- MT('definitionListSpan', -- '[number - coffee :=]', -- '', -- '[number Hot ][number&em _and_][number black =:]', -- '', -- 'Normal text.'); -- -- MT('boo', -- '[number - dog := woof woof]', -- '[number - cat := meow meow]', -- '[number - whale :=]', -- '[number Whale noises.]', -- '', -- '[number Also, ][number&em _splashing_][number . =:]'); -- -- /* -- * Attributes -- */ -- -- MT('divWithAttribute', -- '[punctuation div][punctuation&attribute (#my-id)][punctuation . foo bar]'); -- -- MT('divWithAttributeAnd2emRightPadding', -- '[punctuation div][punctuation&attribute (#my-id)((][punctuation . foo bar]'); -- -- MT('divWithClassAndId', -- '[punctuation div][punctuation&attribute (my-class#my-id)][punctuation . foo bar]'); -- -- MT('paragraphWithCss', -- 'p[attribute {color:red;}]. foo bar'); -- -- MT('paragraphNestedStyles', -- 'p. [strong *foo ][strong&em _bar_][strong *]'); -- -- MT('paragraphWithLanguage', -- 'p[attribute [[fr]]]. Parlez-vous français?'); -- -- MT('paragraphLeftAlign', -- 'p[attribute <]. Left'); -- -- MT('paragraphRightAlign', -- 'p[attribute >]. Right'); -- -- MT('paragraphRightAlign', -- 'p[attribute =]. Center'); -- -- MT('paragraphJustified', -- 'p[attribute <>]. Justified'); -- -- MT('paragraphWithLeftIndent1em', -- 'p[attribute (]. Left'); -- -- MT('paragraphWithRightIndent1em', -- 'p[attribute )]. Right'); -- -- MT('paragraphWithLeftIndent2em', -- 'p[attribute ((]. Left'); -- -- MT('paragraphWithRightIndent2em', -- 'p[attribute ))]. Right'); -- -- MT('paragraphWithLeftIndent3emRightIndent2em', -- 'p[attribute ((())]. Right'); -- -- MT('divFormatting', -- '[punctuation div. ][punctuation&strong *foo ]' + -- '[punctuation&strong&em _bar_][punctuation&strong *]'); -- -- MT('phraseModifierAttributes', -- 'p[attribute (my-class)]. This is a paragraph that has a class and' + -- ' this [em _][em&attribute (#special-phrase)][em emphasized phrase_]' + -- ' has an id.'); -- -- MT('linkWithClass', -- '[link "(my-class). This is a link with class":http://redcloth.org]'); -- -- /* -- * Layouts -- */ -- -- MT('paragraphLayouts', -- 'p. This is one paragraph.', -- '', -- 'p. This is another.'); -- -- MT('div', -- '[punctuation div. foo bar]'); -- -- MT('pre', -- '[operator pre. Text]'); -- -- MT('bq.', -- '[bracket bq. foo bar]', -- '', -- 'Normal text.'); -- -- MT('footnote', -- '[variable fn123. foo ][variable&strong *bar*]'); -- -- /* -- * Spanning Layouts -- */ -- -- MT('bq..ThenParagraph', -- '[bracket bq.. foo bar]', -- '', -- '[bracket More quote.]', -- 'p. Normal Text'); -- -- MT('bq..ThenH1', -- '[bracket bq.. foo bar]', -- '', -- '[bracket More quote.]', -- '[header&header-1 h1. Header Text]'); -- -- MT('bc..ThenParagraph', -- '[atom bc.. # Some ruby code]', -- '[atom obj = {foo: :bar}]', -- '[atom puts obj]', -- '', -- '[atom obj[[:love]] = "*love*"]', -- '[atom puts obj.love.upcase]', -- '', -- 'p. Normal text.'); -- -- MT('fn1..ThenParagraph', -- '[variable fn1.. foo bar]', -- '', -- '[variable More.]', -- 'p. Normal Text'); -- -- MT('pre..ThenParagraph', -- '[operator pre.. foo bar]', -- '', -- '[operator More.]', -- 'p. Normal Text'); -- -- /* -- * Tables -- */ -- -- MT('table', -- '[variable-3&operator |_. name |_. age|]', -- '[variable-3 |][variable-3&strong *Walter*][variable-3 | 5 |]', -- '[variable-3 |Florence| 6 |]', -- '', -- 'p. Normal text.'); -- -- MT('tableWithAttributes', -- '[variable-3&operator |_. name |_. age|]', -- '[variable-3 |][variable-3&attribute /2.][variable-3 Jim |]', -- '[variable-3 |][variable-3&attribute \\2{color: red}.][variable-3 Sam |]'); -- -- /* -- * HTML -- */ -- -- MT('html', -- '[comment
    ]', -- '[comment
    ]', -- '', -- '[header&header-1 h1. Welcome]', -- '', -- '[variable-2 * Item one]', -- '[variable-2 * Item two]', -- '', -- '[comment Example]', -- '', -- '[comment
    ]', -- '[comment
    ]'); -- -- MT('inlineHtml', -- 'I can use HTML directly in my [comment Textile].'); -- -- /* -- * No-Textile -- */ -- -- MT('notextile', -- '[string-2 notextile. *No* formatting]'); -- -- MT('notextileInline', -- 'Use [string-2 ==*asterisks*==] for [strong *strong*] text.'); -- -- MT('notextileWithPre', -- '[operator pre. *No* formatting]'); -- -- MT('notextileWithSpanningPre', -- '[operator pre.. *No* formatting]', -- '', -- '[operator *No* formatting]'); -- -- /* Only toggling phrases between non-word chars. */ -- -- MT('phrase-in-word', -- 'foo_bar_baz'); -- -- MT('phrase-non-word', -- '[negative -x-] aaa-bbb ccc-ddd [negative -eee-] fff [negative -ggg-]'); -- -- MT('phrase-lone-dash', -- 'foo - bar - baz'); --})(); -diff --git a/media/editors/codemirror/mode/textile/test.min.js b/media/editors/codemirror/mode/textile/test.min.js -deleted file mode 100644 -index d15f50b..0000000 ---- a/media/editors/codemirror/mode/textile/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function a(a){test.mode(a,e,Array.prototype.slice.call(arguments,1))}var e=CodeMirror.getMode({tabSize:4},"textile");a("simpleParagraphs","Some text.","","Some more text."),a("em","foo [em _bar_]"),a("emBoogus","code_mirror"),a("strong","foo [strong *bar*]"),a("strongBogus","3 * 3 = 9"),a("italic","foo [em __bar__]"),a("italicBogus","code__mirror"),a("bold","foo [strong **bar**]"),a("boldBogus","3 ** 3 = 27"),a("simpleLink",'[link "CodeMirror":http://codemirror.net]'),a("referenceLink",'[link "CodeMirror":code_mirror]',"Normal Text.","[link [[code_mirror]]http://codemirror.net]"),a("footCite","foo bar[qualifier [[1]]]"),a("footCiteBogus","foo bar[[1a2]]"),a("special-characters","Registered [tag (r)], Trademark [tag (tm)], and Copyright [tag (c)] 2008"),a("cite","A book is [keyword ??The Count of Monte Cristo??] by Dumas."),a("additionAndDeletion","The news networks declared [negative -Al Gore-] [positive +George W. Bush+] the winner in Florida."),a("subAndSup","f(x, n) = log [builtin ~4~] x [builtin ^n^]"),a("spanAndCode","A [quote %span element%] and [atom @code element@]"),a("spanBogus","Percentage 25% is not a span."),a("citeBogus","Question? is not a citation."),a("codeBogus","user@example.com"),a("subBogus","~username"),a("supBogus","foo ^ bar"),a("deletionBogus","3 - 3 = 0"),a("additionBogus","3 + 3 = 6"),a("image","An image: [string !http://www.example.com/image.png!]"),a("imageWithAltText","An image: [string !http://www.example.com/image.png (Alt Text)!]"),a("imageWithUrl","An image: [string !http://www.example.com/image.png!:http://www.example.com/]"),a("h1","[header&header-1 h1. foo]"),a("h2","[header&header-2 h2. foo]"),a("h3","[header&header-3 h3. foo]"),a("h4","[header&header-4 h4. foo]"),a("h5","[header&header-5 h5. foo]"),a("h6","[header&header-6 h6. foo]"),a("h7Bogus","h7. foo"),a("multipleHeaders","[header&header-1 h1. Heading 1]","","Some text.","","[header&header-2 h2. Heading 2]","","More text."),a("h1inline","[header&header-1 h1. foo ][header&header-1&em _bar_][header&header-1 baz]"),a("ul","foo","bar","","[variable-2 * foo]","[variable-2 * bar]"),a("ulNoBlank","foo","bar","[variable-2 * foo]","[variable-2 * bar]"),a("ol","foo","bar","","[variable-2 # foo]","[variable-2 # bar]"),a("olNoBlank","foo","bar","[variable-2 # foo]","[variable-2 # bar]"),a("ulFormatting","[variable-2 * ][variable-2&em _foo_][variable-2 bar]","[variable-2 * ][variable-2&strong *][variable-2&em&strong _foo_][variable-2&strong *][variable-2 bar]","[variable-2 * ][variable-2&strong *foo*][variable-2 bar]"),a("olFormatting","[variable-2 # ][variable-2&em _foo_][variable-2 bar]","[variable-2 # ][variable-2&strong *][variable-2&em&strong _foo_][variable-2&strong *][variable-2 bar]","[variable-2 # ][variable-2&strong *foo*][variable-2 bar]"),a("ulNested","[variable-2 * foo]","[variable-3 ** bar]","[keyword *** bar]","[variable-2 **** bar]","[variable-3 ** bar]"),a("olNested","[variable-2 # foo]","[variable-3 ## bar]","[keyword ### bar]","[variable-2 #### bar]","[variable-3 ## bar]"),a("ulNestedWithOl","[variable-2 * foo]","[variable-3 ## bar]","[keyword *** bar]","[variable-2 #### bar]","[variable-3 ** bar]"),a("olNestedWithUl","[variable-2 # foo]","[variable-3 ** bar]","[keyword ### bar]","[variable-2 **** bar]","[variable-3 ## bar]"),a("definitionList","[number - coffee := Hot ][number&em _and_][number black]","","Normal text."),a("definitionListSpan","[number - coffee :=]","","[number Hot ][number&em _and_][number black =:]","","Normal text."),a("boo","[number - dog := woof woof]","[number - cat := meow meow]","[number - whale :=]","[number Whale noises.]","","[number Also, ][number&em _splashing_][number . =:]"),a("divWithAttribute","[punctuation div][punctuation&attribute (#my-id)][punctuation . foo bar]"),a("divWithAttributeAnd2emRightPadding","[punctuation div][punctuation&attribute (#my-id)((][punctuation . foo bar]"),a("divWithClassAndId","[punctuation div][punctuation&attribute (my-class#my-id)][punctuation . foo bar]"),a("paragraphWithCss","p[attribute {color:red;}]. foo bar"),a("paragraphNestedStyles","p. [strong *foo ][strong&em _bar_][strong *]"),a("paragraphWithLanguage","p[attribute [[fr]]]. Parlez-vous français?"),a("paragraphLeftAlign","p[attribute <]. Left"),a("paragraphRightAlign","p[attribute >]. Right"),a("paragraphRightAlign","p[attribute =]. Center"),a("paragraphJustified","p[attribute <>]. Justified"),a("paragraphWithLeftIndent1em","p[attribute (]. Left"),a("paragraphWithRightIndent1em","p[attribute )]. Right"),a("paragraphWithLeftIndent2em","p[attribute ((]. Left"),a("paragraphWithRightIndent2em","p[attribute ))]. Right"),a("paragraphWithLeftIndent3emRightIndent2em","p[attribute ((())]. Right"),a("divFormatting","[punctuation div. ][punctuation&strong *foo ][punctuation&strong&em _bar_][punctuation&strong *]"),a("phraseModifierAttributes","p[attribute (my-class)]. This is a paragraph that has a class and this [em _][em&attribute (#special-phrase)][em emphasized phrase_] has an id."),a("linkWithClass",'[link "(my-class). This is a link with class":http://redcloth.org]'),a("paragraphLayouts","p. This is one paragraph.","","p. This is another."),a("div","[punctuation div. foo bar]"),a("pre","[operator pre. Text]"),a("bq.","[bracket bq. foo bar]","","Normal text."),a("footnote","[variable fn123. foo ][variable&strong *bar*]"),a("bq..ThenParagraph","[bracket bq.. foo bar]","","[bracket More quote.]","p. Normal Text"),a("bq..ThenH1","[bracket bq.. foo bar]","","[bracket More quote.]","[header&header-1 h1. Header Text]"),a("bc..ThenParagraph","[atom bc.. # Some ruby code]","[atom obj = {foo: :bar}]","[atom puts obj]","",'[atom obj[[:love]] = "*love*"]',"[atom puts obj.love.upcase]","","p. Normal text."),a("fn1..ThenParagraph","[variable fn1.. foo bar]","","[variable More.]","p. Normal Text"),a("pre..ThenParagraph","[operator pre.. foo bar]","","[operator More.]","p. Normal Text"),a("table","[variable-3&operator |_. name |_. age|]","[variable-3 |][variable-3&strong *Walter*][variable-3 | 5 |]","[variable-3 |Florence| 6 |]","","p. Normal text."),a("tableWithAttributes","[variable-3&operator |_. name |_. age|]","[variable-3 |][variable-3&attribute /2.][variable-3 Jim |]","[variable-3 |][variable-3&attribute \\2{color: red}.][variable-3 Sam |]"),a("html",'[comment
    ]','[comment
    ]',"","[header&header-1 h1. Welcome]","","[variable-2 * Item one]","[variable-2 * Item two]","",'[comment Example]',"","[comment
    ]","[comment
    ]"),a("inlineHtml",'I can use HTML directly in my [comment Textile].'),a("notextile","[string-2 notextile. *No* formatting]"),a("notextileInline","Use [string-2 ==*asterisks*==] for [strong *strong*] text."),a("notextileWithPre","[operator pre. *No* formatting]"),a("notextileWithSpanningPre","[operator pre.. *No* formatting]","","[operator *No* formatting]"),a("phrase-in-word","foo_bar_baz"),a("phrase-non-word","[negative -x-] aaa-bbb ccc-ddd [negative -eee-] fff [negative -ggg-]"),a("phrase-lone-dash","foo - bar - baz")}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/textile/textile.min.js b/media/editors/codemirror/mode/textile/textile.min.js -index 1700000..77bd0ba 100644 ---- a/media/editors/codemirror/mode/textile/textile.min.js -+++ b/media/editors/codemirror/mode/textile/textile.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";function e(t,e){e.mode=f.newLayout,e.tableHeading=!1,"definitionList"===e.layoutType&&e.spanningLayout&&t.match(s("definitionListEnd"),!1)&&(e.spanningLayout=!1)}function n(t,e,n){if("_"===n)return t.eat("_")?i(t,e,"italic",/__/,2):i(t,e,"em",/_/,1);if("*"===n)return t.eat("*")?i(t,e,"bold",/\*\*/,2):i(t,e,"strong",/\*/,1);if("["===n)return t.match(/\d+\]/)&&(e.footCite=!0),a(e);if("("===n){var r=t.match(/^(r|tm|c)\)/);if(r)return l(e,c.specialChar)}if("<"===n&&t.match(/(\w+)[^>]+>[^<]+<\/\1>/))return l(e,c.html);if("?"===n&&t.eat("?"))return i(t,e,"cite",/\?\?/,2);if("="===n&&t.eat("="))return i(t,e,"notextile",/==/,2);if("-"===n&&!t.eat("-"))return i(t,e,"deletion",/-/,1);if("+"===n)return i(t,e,"addition",/\+/,1);if("~"===n)return i(t,e,"sub",/~/,1);if("^"===n)return i(t,e,"sup",/\^/,1);if("%"===n)return i(t,e,"span",/%/,1);if("@"===n)return i(t,e,"code",/@/,1);if("!"===n){var o=i(t,e,"image",/(?:\([^\)]+\))?!/,1);return t.match(/^:\S+/),o}return a(e)}function i(t,e,n,i,r){var l=t.pos>r?t.string.charAt(t.pos-r-1):null,o=t.peek();if(e[n]){if((!o||/\W/.test(o))&&l&&/\S/.test(l)){var u=a(e);return e[n]=!1,u}}else(!l||/\W/.test(l))&&o&&/\S/.test(o)&&t.match(new RegExp("^.*\\S"+i.source+"(?:\\W|$)"),!1)&&(e[n]=!0,e.mode=f.attributes);return a(e)}function a(t){var e=r(t);if(e)return e;var n=[];return t.layoutType&&n.push(c[t.layoutType]),n=n.concat(o(t,"addition","bold","cite","code","deletion","em","footCite","image","italic","link","span","strong","sub","sup","table","tableHeading")),"header"===t.layoutType&&n.push(c.header+"-"+t.header),n.length?n.join(" "):null}function r(t){var e=t.layoutType;switch(e){case"notextile":case"code":case"pre":return c[e];default:return t.notextile?c.notextile+(e?" "+c[e]:""):null}}function l(t,e){var n=r(t);if(n)return n;var i=a(t);return e?i?i+" "+e:e:i}function o(t){for(var e=[],n=1;n]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(t){switch(t){case"drawTable":return d.makeRe("^",d.single.drawTable,"$");case"html":return d.makeRe("^",d.single.html,"(?:",d.single.html,")*","$");case"linkDefinition":return d.makeRe("^",d.single.linkDefinition,"$");case"listLayout":return d.makeRe("^",d.single.list,s("allAttributes"),"*\\s+");case"tableCellAttributes":return d.makeRe("^",d.choiceRe(d.single.tableCellAttributes,s("allAttributes")),"+\\.");case"type":return d.makeRe("^",s("allTypes"));case"typeLayout":return d.makeRe("^",s("allTypes"),s("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return d.makeRe("^",s("allAttributes"),"+");case"allTypes":return d.choiceRe(d.single.div,d.single.foot,d.single.header,d.single.bc,d.single.bq,d.single.notextile,d.single.pre,d.single.table,d.single.para);case"allAttributes":return d.choiceRe(d.attributes.selector,d.attributes.css,d.attributes.lang,d.attributes.align,d.attributes.pad);default:return d.makeRe("^",d.single[t])}},makeRe:function(){for(var t="",e=0;e]+>[^<]+<\/\1>/))return g(b,k.html);if("?"===c&&a.eat("?"))return d(a,b,"cite",/\?\?/,2);if("="===c&&a.eat("="))return d(a,b,"notextile",/==/,2);if("-"===c&&!a.eat("-"))return d(a,b,"deletion",/-/,1);if("+"===c)return d(a,b,"addition",/\+/,1);if("~"===c)return d(a,b,"sub",/~/,1);if("^"===c)return d(a,b,"sup",/\^/,1);if("%"===c)return d(a,b,"span",/%/,1);if("@"===c)return d(a,b,"code",/@/,1);if("!"===c){var h=d(a,b,"image",/(?:\([^\)]+\))?!/,1);return a.match(/^:\S+/),h}return e(b)}function d(a,b,c,d,f){var g=a.pos>f?a.string.charAt(a.pos-f-1):null,h=a.peek();if(b[c]){if((!h||/\W/.test(h))&&g&&/\S/.test(g)){var i=e(b);return b[c]=!1,i}}else(!g||/\W/.test(g))&&h&&/\S/.test(h)&&a.match(new RegExp("^.*\\S"+d.source+"(?:\\W|$)"),!1)&&(b[c]=!0,b.mode=m.attributes);return e(b)}function e(a){var b=f(a);if(b)return b;var c=[];return a.layoutType&&c.push(k[a.layoutType]),c=c.concat(h(a,"addition","bold","cite","code","deletion","em","footCite","image","italic","link","span","strong","sub","sup","table","tableHeading")),"header"===a.layoutType&&c.push(k.header+"-"+a.header),c.length?c.join(" "):null}function f(a){var b=a.layoutType;switch(b){case"notextile":case"code":case"pre":return k[b];default:return a.notextile?k.notextile+(b?" "+k[b]:""):null}}function g(a,b){var c=f(a);if(c)return c;var d=e(a);return b?d?d+" "+b:b:d}function h(a){for(var b=[],c=1;c]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(a){switch(a){case"drawTable":return l.makeRe("^",l.single.drawTable,"$");case"html":return l.makeRe("^",l.single.html,"(?:",l.single.html,")*","$");case"linkDefinition":return l.makeRe("^",l.single.linkDefinition,"$");case"listLayout":return l.makeRe("^",l.single.list,j("allAttributes"),"*\\s+");case"tableCellAttributes":return l.makeRe("^",l.choiceRe(l.single.tableCellAttributes,j("allAttributes")),"+\\.");case"type":return l.makeRe("^",j("allTypes"));case"typeLayout":return l.makeRe("^",j("allTypes"),j("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return l.makeRe("^",j("allAttributes"),"+");case"allTypes":return l.choiceRe(l.single.div,l.single.foot,l.single.header,l.single.bc,l.single.bq,l.single.notextile,l.single.pre,l.single.table,l.single.para);case"allAttributes":return l.choiceRe(l.attributes.selector,l.attributes.css,l.attributes.lang,l.attributes.align,l.attributes.pad);default:return l.makeRe("^",l.single[a])}},makeRe:function(){for(var a="",b=0;b|]/.test(ch)) { - if (ch == "!") { // tw header - stream.skipToEnd(); -- return ret("header", "header"); -+ return "header"; - } - if (ch == "*") { // tw list - stream.eatWhile('*'); -- return ret("list", "comment"); -+ return "comment"; - } - if (ch == "#") { // tw numbered list - stream.eatWhile('#'); -- return ret("list", "comment"); -+ return "comment"; - } - if (ch == ";") { // definition list, term - stream.eatWhile(';'); -- return ret("list", "comment"); -+ return "comment"; - } - if (ch == ":") { // definition list, description - stream.eatWhile(':'); -- return ret("list", "comment"); -+ return "comment"; - } - if (ch == ">") { // single line quote - stream.eatWhile(">"); -- return ret("quote", "quote"); -+ return "quote"; - } - if (ch == '|') { -- return ret('table', 'header'); -+ return 'header'; - } - } - -@@ -146,29 +136,29 @@ CodeMirror.defineMode("tiddlywiki", function () { - // rudimentary html:// file:// link matching. TW knows much more ... - if (/[hf]/i.test(ch)) { - if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { -- return ret("link", "link"); -+ return "link"; - } - } - // just a little string indicator, don't want to have the whole string covered - if (ch == '"') { -- return ret('string', 'string'); -+ return 'string'; - } - if (ch == '~') { // _no_ CamelCase indicator should be bold -- return ret('text', 'brace'); -+ return 'brace'; - } - if (/[\[\]]/.test(ch)) { // check for [[..]] - if (stream.peek() == ch) { - stream.next(); -- return ret('brace', 'brace'); -+ return 'brace'; - } - } - if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting - stream.eatWhile(isSpaceName); -- return ret("link", "link"); -+ return "link"; - } - if (/\d/.test(ch)) { // numbers - stream.eatWhile(/\d/); -- return ret("number", "number"); -+ return "number"; - } - if (ch == "/") { // tw invisible comment - if (stream.eat("%")) { -@@ -191,7 +181,7 @@ CodeMirror.defineMode("tiddlywiki", function () { - return chain(stream, state, twTokenStrike); - // mdash - if (stream.peek() == ' ') -- return ret('text', 'brace'); -+ return 'brace'; - } - } - if (ch == "'") { // tw bold -@@ -205,7 +195,7 @@ CodeMirror.defineMode("tiddlywiki", function () { - } - } - else { -- return ret(ch); -+ return null; - } - - // core macro handling -@@ -213,8 +203,7 @@ CodeMirror.defineMode("tiddlywiki", function () { - var word = stream.current(), - known = textwords.propertyIsEnumerable(word) && textwords[word]; - -- return known ? ret(known.type, known.style, word) : ret("text", null, word); -- -+ return known ? known.style : null; - } // jsTokenBase() - - // tw invisible comment -@@ -228,7 +217,7 @@ CodeMirror.defineMode("tiddlywiki", function () { - } - maybeEnd = (ch == "%"); - } -- return ret("comment", "comment"); -+ return "comment"; - } - - // tw strong / bold -@@ -242,29 +231,29 @@ CodeMirror.defineMode("tiddlywiki", function () { - } - maybeEnd = (ch == "'"); - } -- return ret("text", "strong"); -+ return "strong"; - } - - // tw code - function twTokenCode(stream, state) { -- var ch, sb = state.block; -+ var sb = state.block; - - if (sb && stream.current()) { -- return ret("code", "comment"); -+ return "comment"; - } - - if (!sb && stream.match(reUntilCodeStop)) { - state.tokenize = jsTokenBase; -- return ret("code", "comment"); -+ return "comment"; - } - - if (sb && stream.sol() && stream.match(reCodeBlockStop)) { - state.tokenize = jsTokenBase; -- return ret("code", "comment"); -+ return "comment"; - } - -- ch = stream.next(); -- return (sb) ? ret("code", "comment") : ret("code", "comment"); -+ stream.next(); -+ return "comment"; - } - - // tw em / italic -@@ -278,7 +267,7 @@ CodeMirror.defineMode("tiddlywiki", function () { - } - maybeEnd = (ch == "/"); - } -- return ret("text", "em"); -+ return "em"; - } - - // tw underlined text -@@ -292,7 +281,7 @@ CodeMirror.defineMode("tiddlywiki", function () { - } - maybeEnd = (ch == "_"); - } -- return ret("text", "underlined"); -+ return "underlined"; - } - - // tw strike through text looks ugly -@@ -307,7 +296,7 @@ CodeMirror.defineMode("tiddlywiki", function () { - } - maybeEnd = (ch == "-"); - } -- return ret("text", "strikethrough"); -+ return "strikethrough"; - } - - // macro -@@ -315,19 +304,19 @@ CodeMirror.defineMode("tiddlywiki", function () { - var ch, word, known; - - if (stream.current() == '<<') { -- return ret('brace', 'macro'); -+ return 'macro'; - } - - ch = stream.next(); - if (!ch) { - state.tokenize = jsTokenBase; -- return ret(ch); -+ return null; - } - if (ch == ">") { - if (stream.peek() == '>') { - stream.next(); - state.tokenize = jsTokenBase; -- return ret("brace", "macro"); -+ return "macro"; - } - } - -@@ -336,10 +325,10 @@ CodeMirror.defineMode("tiddlywiki", function () { - known = keywords.propertyIsEnumerable(word) && keywords[word]; - - if (known) { -- return ret(known.type, known.style, word); -+ return known.style, word; - } - else { -- return ret("macro", null, word); -+ return null, word; - } - } - -diff --git a/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.css b/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.css -index 8ab7cb1..0311c95 100644 ---- a/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.css -+++ b/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.css -@@ -1 +1 @@ --span.cm-underlined{text-decoration:underline}span.cm-strikethrough{text-decoration:line-through}span.cm-brace{color:#170;font-weight:bold}span.cm-table{color:blue;font-weight:bold} -\ No newline at end of file -+span.cm-underlined{text-decoration:underline}span.cm-strikethrough{text-decoration:line-through}span.cm-brace{color:#170;font-weight:700}span.cm-table{color:#00f;font-weight:700} -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.js b/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.js -index 9233859..320c353 100644 ---- a/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.js -+++ b/media/editors/codemirror/mode/tiddlywiki/tiddlywiki.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tiddlywiki",function(){function e(e,t,r){return t.tokenize=r,r(e,t)}function t(e,t,r){return l=e,m=r,t}function r(r,l){var m,d=r.sol();if(l.block=!1,m=r.peek(),d&&/[<\/\*{}\-]/.test(m)){if(r.match($))return l.block=!0,e(r,l,o);if(r.match(x))return t("quote","quote");if(r.match(b)||r.match(p))return t("code","comment");if(r.match(g)||r.match(v)||r.match(y)||r.match(w))return t("code","comment");if(r.match(k))return t("hr","hr")}if(m=r.next(),d&&/[\/\*!#;:>|]/.test(m)){if("!"==m)return r.skipToEnd(),t("header","header");if("*"==m)return r.eatWhile("*"),t("list","comment");if("#"==m)return r.eatWhile("#"),t("list","comment");if(";"==m)return r.eatWhile(";"),t("list","comment");if(":"==m)return r.eatWhile(":"),t("list","comment");if(">"==m)return r.eatWhile(">"),t("quote","quote");if("|"==m)return t("table","header")}if("{"==m&&r.match(/\{\{/))return e(r,l,o);if(/[hf]/i.test(m)&&/[ti]/i.test(r.peek())&&r.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return t("link","link");if('"'==m)return t("string","string");if("~"==m)return t("text","brace");if(/[\[\]]/.test(m)&&r.peek()==m)return r.next(),t("brace","brace");if("@"==m)return r.eatWhile(h),t("link","link");if(/\d/.test(m))return r.eatWhile(/\d/),t("number","number");if("/"==m){if(r.eat("%"))return e(r,l,n);if(r.eat("/"))return e(r,l,a)}if("_"==m&&r.eat("_"))return e(r,l,u);if("-"==m&&r.eat("-")){if(" "!=r.peek())return e(r,l,c);if(" "==r.peek())return t("text","brace")}if("'"==m&&r.eat("'"))return e(r,l,i);if("<"!=m)return t(m);if(r.eat("<"))return e(r,l,f);r.eatWhile(/[\w\$_]/);var z=r.current(),W=s.propertyIsEnumerable(z)&&s[z];return W?t(W.type,W.style,z):t("text",null,z)}function n(e,n){for(var i,o=!1;i=e.next();){if("/"==i&&o){n.tokenize=r;break}o="%"==i}return t("comment","comment")}function i(e,n){for(var i,o=!1;i=e.next();){if("'"==i&&o){n.tokenize=r;break}o="'"==i}return t("text","strong")}function o(e,n){var i,o=n.block;return o&&e.current()?t("code","comment"):!o&&e.match(W)?(n.tokenize=r,t("code","comment")):o&&e.sol()&&e.match(z)?(n.tokenize=r,t("code","comment")):(i=e.next(),o?t("code","comment"):t("code","comment"))}function a(e,n){for(var i,o=!1;i=e.next();){if("/"==i&&o){n.tokenize=r;break}o="/"==i}return t("text","em")}function u(e,n){for(var i,o=!1;i=e.next();){if("_"==i&&o){n.tokenize=r;break}o="_"==i}return t("text","underlined")}function c(e,n){for(var i,o=!1;i=e.next();){if("-"==i&&o){n.tokenize=r;break}o="-"==i}return t("text","strikethrough")}function f(e,n){var i,o,a;return"<<"==e.current()?t("brace","macro"):(i=e.next())?">"==i&&">"==e.peek()?(e.next(),n.tokenize=r,t("brace","macro")):(e.eatWhile(/[\w\$_]/),o=e.current(),a=d.propertyIsEnumerable(o)&&d[o],a?t(a.type,a.style,o):t("macro",null,o)):(n.tokenize=r,t(i))}var l,m,s={},d=function(){function e(e){return{type:e,style:"macro"}}return{allTags:e("allTags"),closeAll:e("closeAll"),list:e("list"),newJournal:e("newJournal"),newTiddler:e("newTiddler"),permaview:e("permaview"),saveChanges:e("saveChanges"),search:e("search"),slider:e("slider"),tabs:e("tabs"),tag:e("tag"),tagging:e("tagging"),tags:e("tags"),tiddler:e("tiddler"),timeline:e("timeline"),today:e("today"),version:e("version"),option:e("option"),"with":e("with"),filter:e("filter")}}(),h=/[\w_\-]/i,k=/^\-\-\-\-+$/,b=/^\/\*\*\*$/,p=/^\*\*\*\/$/,x=/^<<<$/,g=/^\/\/\{\{\{$/,v=/^\/\/\}\}\}$/,y=/^$/,w=/^$/,$=/^\{\{\{$/,z=/^\}\}\}$/,W=/.*?\}\}\}/;return{startState:function(){return{tokenize:r,indented:0,level:0}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t);return r},electricChars:""}}),e.defineMIME("text/x-tiddlywiki","tiddlywiki")}); -\ 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("tiddlywiki",function(){function a(a,b,c){return b.tokenize=c,c(a,b)}function b(b,k){var v,w=b.sol();if(k.block=!1,v=b.peek(),w&&/[<\/\*{}\-]/.test(v)){if(b.match(u))return k.block=!0,a(b,k,e);if(b.match(p))return"quote";if(b.match(n)||b.match(o))return"comment";if(b.match(q)||b.match(r)||b.match(s)||b.match(t))return"comment";if(b.match(m))return"hr"}if(v=b.next(),w&&/[\/\*!#;:>|]/.test(v)){if("!"==v)return b.skipToEnd(),"header";if("*"==v)return b.eatWhile("*"),"comment";if("#"==v)return b.eatWhile("#"),"comment";if(";"==v)return b.eatWhile(";"),"comment";if(":"==v)return b.eatWhile(":"),"comment";if(">"==v)return b.eatWhile(">"),"quote";if("|"==v)return"header"}if("{"==v&&b.match(/\{\{/))return a(b,k,e);if(/[hf]/i.test(v)&&/[ti]/i.test(b.peek())&&b.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return"link";if('"'==v)return"string";if("~"==v)return"brace";if(/[\[\]]/.test(v)&&b.peek()==v)return b.next(),"brace";if("@"==v)return b.eatWhile(l),"link";if(/\d/.test(v))return b.eatWhile(/\d/),"number";if("/"==v){if(b.eat("%"))return a(b,k,c);if(b.eat("/"))return a(b,k,f)}if("_"==v&&b.eat("_"))return a(b,k,g);if("-"==v&&b.eat("-")){if(" "!=b.peek())return a(b,k,h);if(" "==b.peek())return"brace"}if("'"==v&&b.eat("'"))return a(b,k,d);if("<"!=v)return null;if(b.eat("<"))return a(b,k,i);b.eatWhile(/[\w\$_]/);var x=b.current(),y=j.propertyIsEnumerable(x)&&j[x];return y?y.style:null}function c(a,c){for(var d,e=!1;d=a.next();){if("/"==d&&e){c.tokenize=b;break}e="%"==d}return"comment"}function d(a,c){for(var d,e=!1;d=a.next();){if("'"==d&&e){c.tokenize=b;break}e="'"==d}return"strong"}function e(a,c){var d=c.block;return d&&a.current()?"comment":!d&&a.match(w)?(c.tokenize=b,"comment"):d&&a.sol()&&a.match(v)?(c.tokenize=b,"comment"):(a.next(),"comment")}function f(a,c){for(var d,e=!1;d=a.next();){if("/"==d&&e){c.tokenize=b;break}e="/"==d}return"em"}function g(a,c){for(var d,e=!1;d=a.next();){if("_"==d&&e){c.tokenize=b;break}e="_"==d}return"underlined"}function h(a,c){for(var d,e=!1;d=a.next();){if("-"==d&&e){c.tokenize=b;break}e="-"==d}return"strikethrough"}function i(a,c){var d,e,f;return"<<"==a.current()?"macro":(d=a.next())?">"==d&&">"==a.peek()?(a.next(),c.tokenize=b,"macro"):(a.eatWhile(/[\w\$_]/),e=a.current(),f=k.propertyIsEnumerable(e)&&k[e],f?(f.style,e):e):(c.tokenize=b,null)}var j={},k=function(){function a(a){return{type:a,style:"macro"}}return{allTags:a("allTags"),closeAll:a("closeAll"),list:a("list"),newJournal:a("newJournal"),newTiddler:a("newTiddler"),permaview:a("permaview"),saveChanges:a("saveChanges"),search:a("search"),slider:a("slider"),tabs:a("tabs"),tag:a("tag"),tagging:a("tagging"),tags:a("tags"),tiddler:a("tiddler"),timeline:a("timeline"),today:a("today"),version:a("version"),option:a("option"),"with":a("with"),filter:a("filter")}}(),l=/[\w_\-]/i,m=/^\-\-\-\-+$/,n=/^\/\*\*\*$/,o=/^\*\*\*\/$/,p=/^<<<$/,q=/^\/\/\{\{\{$/,r=/^\/\/\}\}\}$/,s=/^$/,t=/^$/,u=/^\{\{\{$/,v=/^\}\}\}$/,w=/.*?\}\}\}/;return{startState:function(){return{tokenize:b,indented:0,level:0}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c},electricChars:""}}),a.defineMIME("text/x-tiddlywiki","tiddlywiki")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/tiki/tiki.js b/media/editors/codemirror/mode/tiki/tiki.js -index c90aac9..5e05b1f 100644 ---- a/media/editors/codemirror/mode/tiki/tiki.js -+++ b/media/editors/codemirror/mode/tiki/tiki.js -@@ -52,35 +52,27 @@ CodeMirror.defineMode('tiki', function(config) { - case "{": //plugin - stream.eat("/"); - stream.eatSpace(); -- var tagName = ""; -- var c; -- while ((c = stream.eat(/[^\s\u00a0=\"\'\/?(}]/))) tagName += c; -+ stream.eatWhile(/[^\s\u00a0=\"\'\/?(}]/); - state.tokenize = inPlugin; - return "tag"; -- break; - case "_": //bold -- if (stream.eat("_")) { -+ if (stream.eat("_")) - return chain(inBlock("strong", "__", inText)); -- } - break; - case "'": //italics -- if (stream.eat("'")) { -- // Italic text -+ if (stream.eat("'")) - return chain(inBlock("em", "''", inText)); -- } - break; - case "(":// Wiki Link -- if (stream.eat("(")) { -+ if (stream.eat("(")) - return chain(inBlock("variable-2", "))", inText)); -- } - break; - case "[":// Weblink - return chain(inBlock("variable-3", "]", inText)); - break; - case "|": //table -- if (stream.eat("|")) { -+ if (stream.eat("|")) - return chain(inBlock("comment", "||")); -- } - break; - case "-": - if (stream.eat("=")) {//titleBar -@@ -90,22 +82,19 @@ CodeMirror.defineMode('tiki', function(config) { - } - break; - case "=": //underline -- if (stream.match("==")) { -+ if (stream.match("==")) - return chain(inBlock("tw-underline", "===", inText)); -- } - break; - case ":": -- if (stream.eat(":")) { -+ if (stream.eat(":")) - return chain(inBlock("comment", "::")); -- } - break; - case "^": //box - return chain(inBlock("tw-box", "^")); - break; - case "~": //np -- if (stream.match("np~")) { -+ if (stream.match("np~")) - return chain(inBlock("meta", "~/np~")); -- } - break; - } - -diff --git a/media/editors/codemirror/mode/tiki/tiki.min.css b/media/editors/codemirror/mode/tiki/tiki.min.css -index c52ac19..fdd7f4a 100644 ---- a/media/editors/codemirror/mode/tiki/tiki.min.css -+++ b/media/editors/codemirror/mode/tiki/tiki.min.css -@@ -1 +1 @@ --.cm-tw-syntaxerror{color:#FFF;background-color:#900}.cm-tw-deleted{text-decoration:line-through}.cm-tw-header5{font-weight:bold}.cm-tw-listitem:first-child{padding-left:10px}.cm-tw-box{border-top-width:0!important;border-style:solid;border-width:1px;border-color:inherit}.cm-tw-underline{text-decoration:underline} -\ No newline at end of file -+.cm-tw-syntaxerror{color:#FFF;background-color:#900}.cm-tw-deleted{text-decoration:line-through}.cm-tw-header5{font-weight:700}.cm-tw-listitem:first-child{padding-left:10px}.cm-tw-box{border-top-width:0!important;border-style:solid;border-width:1px;border-color:inherit}.cm-tw-underline{text-decoration:underline} -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/tiki/tiki.min.js b/media/editors/codemirror/mode/tiki/tiki.min.js -index 5841226..4bff4d7 100644 ---- a/media/editors/codemirror/mode/tiki/tiki.min.js -+++ b/media/editors/codemirror/mode/tiki/tiki.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tiki",function(e){function t(e,t,n){return function(i,o){for(;!i.eol();){if(i.match(t)){o.tokenize=r;break}i.next()}return n&&(o.tokenize=n),e}}function n(e){return function(t,n){for(;!t.eol();)t.next();return n.tokenize=r,e}}function r(e,o){function a(t){return o.tokenize=t,t(e,o)}var u=e.sol(),c=e.next();switch(c){case"{":e.eat("/"),e.eatSpace();for(var f,s="";f=e.eat(/[^\s\u00a0=\"\'\/?(}]/);)s+=f;return o.tokenize=i,"tag";case"_":if(e.eat("_"))return a(t("strong","__",r));break;case"'":if(e.eat("'"))return a(t("em","''",r));break;case"(":if(e.eat("("))return a(t("variable-2","))",r));break;case"[":return a(t("variable-3","]",r));case"|":if(e.eat("|"))return a(t("comment","||"));break;case"-":if(e.eat("="))return a(t("header string","=-",r));if(e.eat("-"))return a(t("error tw-deleted","--",r));break;case"=":if(e.match("=="))return a(t("tw-underline","===",r));break;case":":if(e.eat(":"))return a(t("comment","::"));break;case"^":return a(t("tw-box","^"));case"~":if(e.match("np~"))return a(t("meta","~/np~"))}if(u)switch(c){case"!":return a(e.match("!!!!!")?n("header string"):e.match("!!!!")?n("header string"):e.match("!!!")?n("header string"):e.match("!!")?n("header string"):n("header string"));case"*":case"#":case"+":return a(n("tw-listitem bracket"))}return null}function i(e,t){var n=e.next(),i=e.peek();return"}"==n?(t.tokenize=r,"tag"):"("==n||")"==n?"bracket":"="==n?(b="equals",">"==i&&(n=e.next(),i=e.peek()),/[\'\"]/.test(i)||(t.tokenize=a()),"operator"):/[\'\"]/.test(n)?(t.tokenize=o(n),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=\"\'\/?]/),"keyword")}function o(e){return function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=i;break}return"string"}}function a(){return function(e,t){for(;!e.eol();){var n=e.next(),r=e.peek();if(" "==n||","==n||/[ )}]/.test(r)){t.tokenize=i;break}}return"string"}}function u(){for(var e=arguments.length-1;e>=0;e--)h.cc.push(arguments[e])}function c(){return u.apply(null,arguments),!0}function f(e,t){var n=h.context&&h.context.noIndent;h.context={prev:h.context,pluginName:e,indent:h.indented,startOfLine:t,noIndent:n}}function s(){h.context&&(h.context=h.context.prev)}function l(e){if("openPlugin"==e)return h.pluginName=x,c(g,d(h.startOfLine));if("closePlugin"==e){var t=!1;return h.context?(t=h.context.pluginName!=x,s()):t=!0,t&&(v="error"),c(k(t))}return"string"==e?(h.context&&"!cdata"==h.context.name||f("!cdata"),h.tokenize==r&&s(),c()):c()}function d(e){return function(t){return"selfclosePlugin"==t||"endPlugin"==t?c():"endPlugin"==t?(f(h.pluginName,e),c()):c()}}function k(e){return function(t){return e&&(v="error"),"endPlugin"==t?c():u()}}function g(e){return"keyword"==e?(v="attribute",c(g)):"equals"==e?c(m,g):u()}function m(e){return"keyword"==e?(v="string",c()):"string"==e?c(p):u()}function p(e){return"string"==e?c(p):u()}var x,b,h,v,z=e.indentUnit;return{startState:function(){return{tokenize:r,cc:[],indented:0,startOfLine:!0,pluginName:null,context:null}},token:function(e,t){if(e.sol()&&(t.startOfLine=!0,t.indented=e.indentation()),e.eatSpace())return null;v=b=x=null;var n=t.tokenize(e,t);if((n||b)&&"comment"!=n)for(h=t;;){var r=t.cc.pop()||l;if(r(b||n))break}return t.startOfLine=!1,v||n},indent:function(e,t){var n=e.context;if(n&&n.noIndent)return 0;for(n&&/^{\//.test(t)&&(n=n.prev);n&&!n.startOfLine;)n=n.prev;return n?n.indent+z:0},electricChars:"/"}}),e.defineMIME("text/tiki","tiki")}); -\ 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("tiki",function(a){function b(a,b,c){return function(e,f){for(;!e.eol();){if(e.match(b)){f.tokenize=d;break}e.next()}return c&&(f.tokenize=c),a}}function c(a){return function(b,c){for(;!b.eol();)b.next();return c.tokenize=d,a}}function d(a,f){function g(b){return f.tokenize=b,b(a,f)}var h=a.sol(),i=a.next();switch(i){case"{":return a.eat("/"),a.eatSpace(),a.eatWhile(/[^\s\u00a0=\"\'\/?(}]/),f.tokenize=e,"tag";case"_":if(a.eat("_"))return g(b("strong","__",d));break;case"'":if(a.eat("'"))return g(b("em","''",d));break;case"(":if(a.eat("("))return g(b("variable-2","))",d));break;case"[":return g(b("variable-3","]",d));case"|":if(a.eat("|"))return g(b("comment","||"));break;case"-":if(a.eat("="))return g(b("header string","=-",d));if(a.eat("-"))return g(b("error tw-deleted","--",d));break;case"=":if(a.match("=="))return g(b("tw-underline","===",d));break;case":":if(a.eat(":"))return g(b("comment","::"));break;case"^":return g(b("tw-box","^"));case"~":if(a.match("np~"))return g(b("meta","~/np~"))}if(h)switch(i){case"!":return g(a.match("!!!!!")?c("header string"):a.match("!!!!")?c("header string"):a.match("!!!")?c("header string"):a.match("!!")?c("header string"):c("header string"));case"*":case"#":case"+":return g(c("tw-listitem bracket"))}return null}function e(a,b){var c=a.next(),e=a.peek();return"}"==c?(b.tokenize=d,"tag"):"("==c||")"==c?"bracket":"="==c?(s="equals",">"==e&&(c=a.next(),e=a.peek()),/[\'\"]/.test(e)||(b.tokenize=g()),"operator"):/[\'\"]/.test(c)?(b.tokenize=f(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=\"\'\/?]/),"keyword")}function f(a){return function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=e;break}return"string"}}function g(){return function(a,b){for(;!a.eol();){var c=a.next(),d=a.peek();if(" "==c||","==c||/[ )}]/.test(d)){b.tokenize=e;break}}return"string"}}function h(){for(var a=arguments.length-1;a>=0;a--)t.cc.push(arguments[a])}function i(){return h.apply(null,arguments),!0}function j(a,b){var c=t.context&&t.context.noIndent;t.context={prev:t.context,pluginName:a,indent:t.indented,startOfLine:b,noIndent:c}}function k(){t.context&&(t.context=t.context.prev)}function l(a){if("openPlugin"==a)return t.pluginName=r,i(o,m(t.startOfLine));if("closePlugin"==a){var b=!1;return t.context?(b=t.context.pluginName!=r,k()):b=!0,b&&(u="error"),i(n(b))}return"string"==a?(t.context&&"!cdata"==t.context.name||j("!cdata"),t.tokenize==d&&k(),i()):i()}function m(a){return function(b){return"selfclosePlugin"==b||"endPlugin"==b?i():"endPlugin"==b?(j(t.pluginName,a),i()):i()}}function n(a){return function(b){return a&&(u="error"),"endPlugin"==b?i():h()}}function o(a){return"keyword"==a?(u="attribute",i(o)):"equals"==a?i(p,o):h()}function p(a){return"keyword"==a?(u="string",i()):"string"==a?i(q):h()}function q(a){return"string"==a?i(q):h()}var r,s,t,u,v=a.indentUnit;return{startState:function(){return{tokenize:d,cc:[],indented:0,startOfLine:!0,pluginName:null,context:null}},token:function(a,b){if(a.sol()&&(b.startOfLine=!0,b.indented=a.indentation()),a.eatSpace())return null;u=s=r=null;var c=b.tokenize(a,b);if((c||s)&&"comment"!=c)for(t=b;;){var d=b.cc.pop()||l;if(d(s||c))break}return b.startOfLine=!1,u||c},indent:function(a,b){var c=a.context;if(c&&c.noIndent)return 0;for(c&&/^{\//.test(b)&&(c=c.prev);c&&!c.startOfLine;)c=c.prev;return c?c.indent+v:0},electricChars:"/"}}),a.defineMIME("text/tiki","tiki")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/toml/toml.min.js b/media/editors/codemirror/mode/toml/toml.min.js -index 1b8beba..e6e3e2b 100644 ---- a/media/editors/codemirror/mode/toml/toml.min.js -+++ b/media/editors/codemirror/mode/toml/toml.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("toml",function(){return{startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(e,t){if(t.inString||'"'!=e.peek()&&"'"!=e.peek()||(t.stringType=e.peek(),e.next(),t.inString=!0),e.sol()&&0===t.inArray&&(t.lhs=!0),t.inString){for(;t.inString&&!e.eol();)e.peek()===t.stringType?(e.next(),t.inString=!1):"\\"===e.peek()?(e.next(),e.next()):e.match(/^.[^\\\"\']*/);return t.lhs?"property string":"string"}return t.inArray&&"]"===e.peek()?(e.next(),t.inArray--,"bracket"):t.lhs&&"["===e.peek()&&e.skipTo("]")?(e.next(),"]"===e.peek()&&e.next(),"atom"):"#"===e.peek()?(e.skipToEnd(),"comment"):e.eatSpace()?null:t.lhs&&e.eatWhile(function(e){return"="!=e&&" "!=e})?"property":t.lhs&&"="===e.peek()?(e.next(),t.lhs=!1,null):!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/)?"atom":t.lhs||!e.match("true")&&!e.match("false")?t.lhs||"["!==e.peek()?!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/)?"number":(e.eatSpace()||e.next(),null):(t.inArray++,e.next(),"bracket"):"atom"}}}),e.defineMIME("text/x-toml","toml")}); -\ 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("toml",function(){return{startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(a,b){if(b.inString||'"'!=a.peek()&&"'"!=a.peek()||(b.stringType=a.peek(),a.next(),b.inString=!0),a.sol()&&0===b.inArray&&(b.lhs=!0),b.inString){for(;b.inString&&!a.eol();)a.peek()===b.stringType?(a.next(),b.inString=!1):"\\"===a.peek()?(a.next(),a.next()):a.match(/^.[^\\\"\']*/);return b.lhs?"property string":"string"}return b.inArray&&"]"===a.peek()?(a.next(),b.inArray--,"bracket"):b.lhs&&"["===a.peek()&&a.skipTo("]")?(a.next(),"]"===a.peek()&&a.next(),"atom"):"#"===a.peek()?(a.skipToEnd(),"comment"):a.eatSpace()?null:b.lhs&&a.eatWhile(function(a){return"="!=a&&" "!=a})?"property":b.lhs&&"="===a.peek()?(a.next(),b.lhs=!1,null):!b.lhs&&a.match(/^\d\d\d\d[\d\-\:\.T]*Z/)?"atom":b.lhs||!a.match("true")&&!a.match("false")?b.lhs||"["!==a.peek()?!b.lhs&&a.match(/^\-?\d+(?:\.\d+)?/)?"number":(a.eatSpace()||a.next(),null):(b.inArray++,a.next(),"bracket"):"atom"}}}),a.defineMIME("text/x-toml","toml")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/tornado/tornado.min.js b/media/editors/codemirror/mode/tornado/tornado.min.js -index e0d6090..7677ff9 100644 ---- a/media/editors/codemirror/mode/tornado/tornado.min.js -+++ b/media/editors/codemirror/mode/tornado/tornado.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tornado:inner",function(){function e(e,n){e.eatWhile(/[^\{]/);var o=e.next();return"{"==o&&(o=e.eat(/\{|%|#/))?(n.tokenize=t(o),"tag"):void 0}function t(t){return"{"==t&&(t="}"),function(o,r){var i=o.next();return i==t&&o.eat("}")?(r.tokenize=e,"tag"):o.match(n)?"keyword":"#"==t?"comment":"string"}}var n=["and","as","assert","autoescape","block","break","class","comment","context","continue","datetime","def","del","elif","else","end","escape","except","exec","extends","false","finally","for","from","global","if","import","in","include","is","json_encode","lambda","length","linkify","load","module","none","not","or","pass","print","put","raise","raw","return","self","set","squeeze","super","true","try","url_escape","while","with","without","xhtml_escape","yield"];return n=new RegExp("^(("+n.join(")|(")+"))\\b"),{startState:function(){return{tokenize:e}},token:function(e,t){return t.tokenize(e,t)}}}),e.defineMode("tornado",function(t){var n=e.getMode(t,"text/html"),o=e.getMode(t,"tornado:inner");return e.overlayMode(n,o)}),e.defineMIME("text/x-tornado","tornado")}); -\ No newline at end of file -+!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("tornado:inner",function(){function a(a,c){a.eatWhile(/[^\{]/);var d=a.next();return"{"==d&&(d=a.eat(/\{|%|#/))?(c.tokenize=b(d),"tag"):void 0}function b(b){return"{"==b&&(b="}"),function(d,e){var f=d.next();return f==b&&d.eat("}")?(e.tokenize=a,"tag"):d.match(c)?"keyword":"#"==b?"comment":"string"}}var c=["and","as","assert","autoescape","block","break","class","comment","context","continue","datetime","def","del","elif","else","end","escape","except","exec","extends","false","finally","for","from","global","if","import","in","include","is","json_encode","lambda","length","linkify","load","module","none","not","or","pass","print","put","raise","raw","return","self","set","squeeze","super","true","try","url_escape","while","with","without","xhtml_escape","yield"];return c=new RegExp("^(("+c.join(")|(")+"))\\b"),{startState:function(){return{tokenize:a}},token:function(a,b){return b.tokenize(a,b)}}}),a.defineMode("tornado",function(b){var c=a.getMode(b,"text/html"),d=a.getMode(b,"tornado:inner");return a.overlayMode(c,d)}),a.defineMIME("text/x-tornado","tornado")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/troff/troff.js b/media/editors/codemirror/mode/troff/troff.js -new file mode 100644 -index 0000000..beca778 ---- /dev/null -+++ b/media/editors/codemirror/mode/troff/troff.js -@@ -0,0 +1,82 @@ -+// CodeMirror, copyright (c) by Marijn Haverbeke and others -+// Distributed under an MIT license: http://codemirror.net/LICENSE -+ -+(function(mod) { -+ if (typeof exports == "object" && typeof module == "object") -+ mod(require("../../lib/codemirror")); -+ else if (typeof define == "function" && define.amd) -+ define(["../../lib/codemirror"], mod); -+ else -+ mod(CodeMirror); -+})(function(CodeMirror) { -+"use strict"; -+ -+CodeMirror.defineMode('troff', function() { -+ -+ var words = {}; -+ -+ function tokenBase(stream) { -+ if (stream.eatSpace()) return null; -+ -+ var sol = stream.sol(); -+ var ch = stream.next(); -+ -+ if (ch === '\\') { -+ if (stream.match('fB') || stream.match('fR') || stream.match('fI') || -+ stream.match('u') || stream.match('d') || -+ stream.match('%') || stream.match('&')) { -+ return 'string'; -+ } -+ if (stream.match('m[')) { -+ stream.skipTo(']'); -+ stream.next(); -+ return 'string'; -+ } -+ if (stream.match('s+') || stream.match('s-')) { -+ stream.eatWhile(/[\d-]/); -+ return 'string'; -+ } -+ if (stream.match('\(') || stream.match('*\(')) { -+ stream.eatWhile(/[\w-]/); -+ return 'string'; -+ } -+ return 'string'; -+ } -+ if (sol && (ch === '.' || ch === '\'')) { -+ if (stream.eat('\\') && stream.eat('\"')) { -+ stream.skipToEnd(); -+ return 'comment'; -+ } -+ } -+ if (sol && ch === '.') { -+ if (stream.match('B ') || stream.match('I ') || stream.match('R ')) { -+ return 'attribute'; -+ } -+ if (stream.match('TH ') || stream.match('SH ') || stream.match('SS ') || stream.match('HP ')) { -+ stream.skipToEnd(); -+ return 'quote'; -+ } -+ if ((stream.match(/[A-Z]/) && stream.match(/[A-Z]/)) || (stream.match(/[a-z]/) && stream.match(/[a-z]/))) { -+ return 'attribute'; -+ } -+ } -+ stream.eatWhile(/[\w-]/); -+ var cur = stream.current(); -+ return words.hasOwnProperty(cur) ? words[cur] : null; -+ } -+ -+ function tokenize(stream, state) { -+ return (state.tokens[0] || tokenBase) (stream, state); -+ }; -+ -+ return { -+ startState: function() {return {tokens:[]};}, -+ token: function(stream, state) { -+ return tokenize(stream, state); -+ } -+ }; -+}); -+ -+CodeMirror.defineMIME('troff', 'troff'); -+ -+}); -diff --git a/media/editors/codemirror/mode/troff/troff.min.js b/media/editors/codemirror/mode/troff/troff.min.js -new file mode 100644 -index 0000000..3fd4353 ---- /dev/null -+++ b/media/editors/codemirror/mode/troff/troff.min.js -@@ -0,0 +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("troff",function(){function a(a){if(a.eatSpace())return null;var b=a.sol(),d=a.next();if("\\"===d)return a.match("fB")||a.match("fR")||a.match("fI")||a.match("u")||a.match("d")||a.match("%")||a.match("&")?"string":a.match("m[")?(a.skipTo("]"),a.next(),"string"):a.match("s+")||a.match("s-")?(a.eatWhile(/[\d-]/),"string"):a.match("(")||a.match("*(")?(a.eatWhile(/[\w-]/),"string"):"string";if(b&&("."===d||"'"===d)&&a.eat("\\")&&a.eat('"'))return a.skipToEnd(),"comment";if(b&&"."===d){if(a.match("B ")||a.match("I ")||a.match("R "))return"attribute";if(a.match("TH ")||a.match("SH ")||a.match("SS ")||a.match("HP "))return a.skipToEnd(),"quote";if(a.match(/[A-Z]/)&&a.match(/[A-Z]/)||a.match(/[a-z]/)&&a.match(/[a-z]/))return"attribute"}a.eatWhile(/[\w-]/);var e=a.current();return c.hasOwnProperty(e)?c[e]:null}function b(b,c){return(c.tokens[0]||a)(b,c)}var c={};return{startState:function(){return{tokens:[]}},token:function(a,c){return b(a,c)}}}),a.defineMIME("troff","troff")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.js b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.js -new file mode 100644 -index 0000000..e108051 ---- /dev/null -+++ b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.js -@@ -0,0 +1,214 @@ -+// CodeMirror, copyright (c) by Marijn Haverbeke and others -+// Distributed under an MIT license: http://codemirror.net/LICENSE -+ -+(function(mod) { -+ if (typeof exports == "object" && typeof module == "object") // CommonJS -+ mod(require("../../lib/codemirror")); -+ else if (typeof define == "function" && define.amd) // AMD -+ define(["../../lib/codemirror"], mod); -+ else // Plain browser env -+ mod(CodeMirror); -+})(function(CodeMirror) { -+ "use strict"; -+ -+ CodeMirror.defineMode("ttcn-cfg", function(config, parserConfig) { -+ var indentUnit = config.indentUnit, -+ keywords = parserConfig.keywords || {}, -+ fileNCtrlMaskOptions = parserConfig.fileNCtrlMaskOptions || {}, -+ externalCommands = parserConfig.externalCommands || {}, -+ multiLineStrings = parserConfig.multiLineStrings, -+ indentStatements = parserConfig.indentStatements !== false; -+ var isOperatorChar = /[\|]/; -+ var curPunc; -+ -+ function tokenBase(stream, state) { -+ var ch = stream.next(); -+ if (ch == '"' || ch == "'") { -+ state.tokenize = tokenString(ch); -+ return state.tokenize(stream, state); -+ } -+ if (/[:=]/.test(ch)) { -+ curPunc = ch; -+ return "punctuation"; -+ } -+ if (ch == "#"){ -+ stream.skipToEnd(); -+ return "comment"; -+ } -+ if (/\d/.test(ch)) { -+ stream.eatWhile(/[\w\.]/); -+ return "number"; -+ } -+ if (isOperatorChar.test(ch)) { -+ stream.eatWhile(isOperatorChar); -+ return "operator"; -+ } -+ if (ch == "["){ -+ stream.eatWhile(/[\w_\]]/); -+ return "number sectionTitle"; -+ } -+ -+ stream.eatWhile(/[\w\$_]/); -+ var cur = stream.current(); -+ if (keywords.propertyIsEnumerable(cur)) return "keyword"; -+ if (fileNCtrlMaskOptions.propertyIsEnumerable(cur)) -+ return "negative fileNCtrlMaskOptions"; -+ if (externalCommands.propertyIsEnumerable(cur)) return "negative externalCommands"; -+ -+ return "variable"; -+ } -+ -+ function tokenString(quote) { -+ return function(stream, state) { -+ var escaped = false, next, end = false; -+ while ((next = stream.next()) != null) { -+ if (next == quote && !escaped){ -+ var afterNext = stream.peek(); -+ //look if the character if the quote is like the B in '10100010'B -+ if (afterNext){ -+ afterNext = afterNext.toLowerCase(); -+ if(afterNext == "b" || afterNext == "h" || afterNext == "o") -+ stream.next(); -+ } -+ end = true; break; -+ } -+ escaped = !escaped && next == "\\"; -+ } -+ if (end || !(escaped || multiLineStrings)) -+ state.tokenize = null; -+ return "string"; -+ }; -+ } -+ -+ function Context(indented, column, type, align, prev) { -+ this.indented = indented; -+ this.column = column; -+ this.type = type; -+ this.align = align; -+ this.prev = prev; -+ } -+ function pushContext(state, col, type) { -+ var indent = state.indented; -+ if (state.context && state.context.type == "statement") -+ indent = state.context.indented; -+ return state.context = new Context(indent, col, type, null, state.context); -+ } -+ function popContext(state) { -+ var t = state.context.type; -+ if (t == ")" || t == "]" || t == "}") -+ state.indented = state.context.indented; -+ return state.context = state.context.prev; -+ } -+ -+ //Interface -+ return { -+ startState: function(basecolumn) { -+ return { -+ tokenize: null, -+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), -+ indented: 0, -+ startOfLine: true -+ }; -+ }, -+ -+ token: function(stream, state) { -+ var ctx = state.context; -+ if (stream.sol()) { -+ if (ctx.align == null) ctx.align = false; -+ state.indented = stream.indentation(); -+ state.startOfLine = true; -+ } -+ if (stream.eatSpace()) return null; -+ curPunc = null; -+ var style = (state.tokenize || tokenBase)(stream, state); -+ if (style == "comment") return style; -+ if (ctx.align == null) ctx.align = true; -+ -+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") -+ && ctx.type == "statement"){ -+ popContext(state); -+ } -+ else if (curPunc == "{") pushContext(state, stream.column(), "}"); -+ else if (curPunc == "[") pushContext(state, stream.column(), "]"); -+ else if (curPunc == "(") pushContext(state, stream.column(), ")"); -+ else if (curPunc == "}") { -+ while (ctx.type == "statement") ctx = popContext(state); -+ if (ctx.type == "}") ctx = popContext(state); -+ while (ctx.type == "statement") ctx = popContext(state); -+ } -+ else if (curPunc == ctx.type) popContext(state); -+ else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") -+ && curPunc != ';') || (ctx.type == "statement" -+ && curPunc == "newstatement"))) -+ pushContext(state, stream.column(), "statement"); -+ state.startOfLine = false; -+ return style; -+ }, -+ -+ electricChars: "{}", -+ lineComment: "#", -+ fold: "brace" -+ }; -+ }); -+ -+ function words(str) { -+ var obj = {}, words = str.split(" "); -+ for (var i = 0; i < words.length; ++i) -+ obj[words[i]] = true; -+ return obj; -+ } -+ -+ CodeMirror.defineMIME("text/x-ttcn-cfg", { -+ name: "ttcn-cfg", -+ keywords: words("Yes No LogFile FileMask ConsoleMask AppendFile" + -+ " TimeStampFormat LogEventTypes SourceInfoFormat" + -+ " LogEntityName LogSourceInfo DiskFullAction" + -+ " LogFileNumber LogFileSize MatchingHints Detailed" + -+ " Compact SubCategories Stack Single None Seconds" + -+ " DateTime Time Stop Error Retry Delete TCPPort KillTimer" + -+ " NumHCs UnixSocketsEnabled LocalAddress"), -+ fileNCtrlMaskOptions: words("TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING" + -+ " TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP" + -+ " TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION" + -+ " TTCN_USER TTCN_FUNCTION TTCN_STATISTICS" + -+ " TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG" + -+ " EXECUTOR ERROR WARNING PORTEVENT TIMEROP" + -+ " VERDICTOP DEFAULTOP TESTCASE ACTION USER" + -+ " FUNCTION STATISTICS PARALLEL MATCHING DEBUG" + -+ " LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED" + -+ " DEBUG_ENCDEC DEBUG_TESTPORT" + -+ " DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE" + -+ " DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT" + -+ " DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED" + -+ " EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA" + -+ " EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS" + -+ " EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED" + -+ " FUNCTION_RND FUNCTION_UNQUALIFIED" + -+ " MATCHING_DONE MATCHING_MCSUCCESS" + -+ " MATCHING_MCUNSUCC MATCHING_MMSUCCESS" + -+ " MATCHING_MMUNSUCC MATCHING_PCSUCCESS" + -+ " MATCHING_PCUNSUCC MATCHING_PMSUCCESS" + -+ " MATCHING_PMUNSUCC MATCHING_PROBLEM" + -+ " MATCHING_TIMEOUT MATCHING_UNQUALIFIED" + -+ " PARALLEL_PORTCONN PARALLEL_PORTMAP" + -+ " PARALLEL_PTC PARALLEL_UNQUALIFIED" + -+ " PORTEVENT_DUALRECV PORTEVENT_DUALSEND" + -+ " PORTEVENT_MCRECV PORTEVENT_MCSEND" + -+ " PORTEVENT_MMRECV PORTEVENT_MMSEND" + -+ " PORTEVENT_MQUEUE PORTEVENT_PCIN" + -+ " PORTEVENT_PCOUT PORTEVENT_PMIN" + -+ " PORTEVENT_PMOUT PORTEVENT_PQUEUE" + -+ " PORTEVENT_STATE PORTEVENT_UNQUALIFIED" + -+ " STATISTICS_UNQUALIFIED STATISTICS_VERDICT" + -+ " TESTCASE_FINISH TESTCASE_START" + -+ " TESTCASE_UNQUALIFIED TIMEROP_GUARD" + -+ " TIMEROP_READ TIMEROP_START TIMEROP_STOP" + -+ " TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED" + -+ " USER_UNQUALIFIED VERDICTOP_FINAL" + -+ " VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT" + -+ " VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED"), -+ externalCommands: words("BeginControlPart EndControlPart BeginTestCase" + -+ " EndTestCase"), -+ multiLineStrings: true -+ }); -+}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js -new file mode 100644 -index 0000000..9903f74 ---- /dev/null -+++ b/media/editors/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js -@@ -0,0 +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){for(var b={},c=a.split(" "),d=0;d!\/]/; -+ var curPunc; -+ -+ function tokenBase(stream, state) { -+ var ch = stream.next(); -+ -+ if (ch == '"' || ch == "'") { -+ state.tokenize = tokenString(ch); -+ return state.tokenize(stream, state); -+ } -+ if (/[\[\]{}\(\),;\\:\?\.]/.test(ch)) { -+ curPunc = ch; -+ return "punctuation"; -+ } -+ if (ch == "#"){ -+ stream.skipToEnd(); -+ return "atom preprocessor"; -+ } -+ if (ch == "%"){ -+ stream.eatWhile(/\b/); -+ return "atom ttcn3Macros"; -+ } -+ if (/\d/.test(ch)) { -+ stream.eatWhile(/[\w\.]/); -+ return "number"; -+ } -+ if (ch == "/") { -+ if (stream.eat("*")) { -+ state.tokenize = tokenComment; -+ return tokenComment(stream, state); -+ } -+ if (stream.eat("/")) { -+ stream.skipToEnd(); -+ return "comment"; -+ } -+ } -+ if (isOperatorChar.test(ch)) { -+ if(ch == "@"){ -+ if(stream.match("try") || stream.match("catch") -+ || stream.match("lazy")){ -+ return "keyword"; -+ } -+ } -+ stream.eatWhile(isOperatorChar); -+ return "operator"; -+ } -+ stream.eatWhile(/[\w\$_\xa1-\uffff]/); -+ var cur = stream.current(); -+ -+ if (keywords.propertyIsEnumerable(cur)) return "keyword"; -+ if (builtin.propertyIsEnumerable(cur)) return "builtin"; -+ -+ if (timerOps.propertyIsEnumerable(cur)) return "def timerOps"; -+ if (configOps.propertyIsEnumerable(cur)) return "def configOps"; -+ if (verdictOps.propertyIsEnumerable(cur)) return "def verdictOps"; -+ if (portOps.propertyIsEnumerable(cur)) return "def portOps"; -+ if (sutOps.propertyIsEnumerable(cur)) return "def sutOps"; -+ if (functionOps.propertyIsEnumerable(cur)) return "def functionOps"; -+ -+ if (verdictConsts.propertyIsEnumerable(cur)) return "string verdictConsts"; -+ if (booleanConsts.propertyIsEnumerable(cur)) return "string booleanConsts"; -+ if (otherConsts.propertyIsEnumerable(cur)) return "string otherConsts"; -+ -+ if (types.propertyIsEnumerable(cur)) return "builtin types"; -+ if (visibilityModifiers.propertyIsEnumerable(cur)) -+ return "builtin visibilityModifiers"; -+ if (templateMatch.propertyIsEnumerable(cur)) return "atom templateMatch"; -+ -+ return "variable"; -+ } -+ -+ function tokenString(quote) { -+ return function(stream, state) { -+ var escaped = false, next, end = false; -+ while ((next = stream.next()) != null) { -+ if (next == quote && !escaped){ -+ var afterQuote = stream.peek(); -+ //look if the character after the quote is like the B in '10100010'B -+ if (afterQuote){ -+ afterQuote = afterQuote.toLowerCase(); -+ if(afterQuote == "b" || afterQuote == "h" || afterQuote == "o") -+ stream.next(); -+ } -+ end = true; break; -+ } -+ escaped = !escaped && next == "\\"; -+ } -+ if (end || !(escaped || multiLineStrings)) -+ state.tokenize = null; -+ return "string"; -+ }; -+ } -+ -+ function tokenComment(stream, state) { -+ var maybeEnd = false, ch; -+ while (ch = stream.next()) { -+ if (ch == "/" && maybeEnd) { -+ state.tokenize = null; -+ break; -+ } -+ maybeEnd = (ch == "*"); -+ } -+ return "comment"; -+ } -+ -+ function Context(indented, column, type, align, prev) { -+ this.indented = indented; -+ this.column = column; -+ this.type = type; -+ this.align = align; -+ this.prev = prev; -+ } -+ -+ function pushContext(state, col, type) { -+ var indent = state.indented; -+ if (state.context && state.context.type == "statement") -+ indent = state.context.indented; -+ return state.context = new Context(indent, col, type, null, state.context); -+ } -+ -+ function popContext(state) { -+ var t = state.context.type; -+ if (t == ")" || t == "]" || t == "}") -+ state.indented = state.context.indented; -+ return state.context = state.context.prev; -+ } -+ -+ //Interface -+ return { -+ startState: function(basecolumn) { -+ return { -+ tokenize: null, -+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), -+ indented: 0, -+ startOfLine: true -+ }; -+ }, -+ -+ token: function(stream, state) { -+ var ctx = state.context; -+ if (stream.sol()) { -+ if (ctx.align == null) ctx.align = false; -+ state.indented = stream.indentation(); -+ state.startOfLine = true; -+ } -+ if (stream.eatSpace()) return null; -+ curPunc = null; -+ var style = (state.tokenize || tokenBase)(stream, state); -+ if (style == "comment") return style; -+ if (ctx.align == null) ctx.align = true; -+ -+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") -+ && ctx.type == "statement"){ -+ popContext(state); -+ } -+ else if (curPunc == "{") pushContext(state, stream.column(), "}"); -+ else if (curPunc == "[") pushContext(state, stream.column(), "]"); -+ else if (curPunc == "(") pushContext(state, stream.column(), ")"); -+ else if (curPunc == "}") { -+ while (ctx.type == "statement") ctx = popContext(state); -+ if (ctx.type == "}") ctx = popContext(state); -+ while (ctx.type == "statement") ctx = popContext(state); -+ } -+ else if (curPunc == ctx.type) popContext(state); -+ else if (indentStatements && -+ (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || -+ (ctx.type == "statement" && curPunc == "newstatement"))) -+ pushContext(state, stream.column(), "statement"); -+ -+ state.startOfLine = false; -+ -+ return style; -+ }, -+ -+ electricChars: "{}", -+ blockCommentStart: "/*", -+ blockCommentEnd: "*/", -+ lineComment: "//", -+ fold: "brace" -+ }; -+ }); -+ -+ function words(str) { -+ var obj = {}, words = str.split(" "); -+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true; -+ return obj; -+ } -+ -+ function def(mimes, mode) { -+ if (typeof mimes == "string") mimes = [mimes]; -+ var words = []; -+ function add(obj) { -+ if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) -+ words.push(prop); -+ } -+ -+ add(mode.keywords); -+ add(mode.builtin); -+ add(mode.timerOps); -+ add(mode.portOps); -+ -+ if (words.length) { -+ mode.helperType = mimes[0]; -+ CodeMirror.registerHelper("hintWords", mimes[0], words); -+ } -+ -+ for (var i = 0; i < mimes.length; ++i) -+ CodeMirror.defineMIME(mimes[i], mode); -+ } -+ -+ def(["text/x-ttcn", "text/x-ttcn3", "text/x-ttcnpp"], { -+ name: "ttcn", -+ keywords: words("activate address alive all alt altstep and and4b any" + -+ " break case component const continue control deactivate" + -+ " display do else encode enumerated except exception" + -+ " execute extends extension external for from function" + -+ " goto group if import in infinity inout interleave" + -+ " label language length log match message mixed mod" + -+ " modifies module modulepar mtc noblock not not4b nowait" + -+ " of on optional or or4b out override param pattern port" + -+ " procedure record recursive rem repeat return runs select" + -+ " self sender set signature system template testcase to" + -+ " type union value valueof var variant while with xor xor4b"), -+ builtin: words("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue" + -+ " decomp decvalue float2int float2str hex2bit hex2int" + -+ " hex2oct hex2str int2bit int2char int2float int2hex" + -+ " int2oct int2str int2unichar isbound ischosen ispresent" + -+ " isvalue lengthof log2str oct2bit oct2char oct2hex oct2int" + -+ " oct2str regexp replace rnd sizeof str2bit str2float" + -+ " str2hex str2int str2oct substr unichar2int unichar2char" + -+ " enum2int"), -+ types: words("anytype bitstring boolean char charstring default float" + -+ " hexstring integer objid octetstring universal verdicttype timer"), -+ timerOps: words("read running start stop timeout"), -+ portOps: words("call catch check clear getcall getreply halt raise receive" + -+ " reply send trigger"), -+ configOps: words("create connect disconnect done kill killed map unmap"), -+ verdictOps: words("getverdict setverdict"), -+ sutOps: words("action"), -+ functionOps: words("apply derefers refers"), -+ -+ verdictConsts: words("error fail inconc none pass"), -+ booleanConsts: words("true false"), -+ otherConsts: words("null NULL omit"), -+ -+ visibilityModifiers: words("private public friend"), -+ templateMatch: words("complement ifpresent subset superset permutation"), -+ multiLineStrings: true -+ }); -+}); -diff --git a/media/editors/codemirror/mode/ttcn/ttcn.min.js b/media/editors/codemirror/mode/ttcn/ttcn.min.js -new file mode 100644 -index 0000000..afa666d ---- /dev/null -+++ b/media/editors/codemirror/mode/ttcn/ttcn.min.js -@@ -0,0 +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){for(var b={},c=a.split(" "),d=0;d!\/]/;return{startState:function(a){return{tokenize:null,context:new f((a||0)-j,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var d=b.context;if(a.sol()&&(null==d.align&&(d.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;i=null;var e=(b.tokenize||c)(a,b);if("comment"==e)return e;if(null==d.align&&(d.align=!0),";"!=i&&":"!=i&&","!=i||"statement"!=d.type)if("{"==i)g(b,a.column(),"}");else if("["==i)g(b,a.column(),"]");else if("("==i)g(b,a.column(),")");else if("}"==i){for(;"statement"==d.type;)d=h(b);for("}"==d.type&&(d=h(b));"statement"==d.type;)d=h(b)}else i==d.type?h(b):z&&(("}"==d.type||"top"==d.type)&&";"!=i||"statement"==d.type&&"newstatement"==i)&&g(b,a.column(),"statement");else h(b);return b.startOfLine=!1,e},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),c(["text/x-ttcn","text/x-ttcn3","text/x-ttcnpp"],{name:"ttcn",keywords:b("activate address alive all alt altstep and and4b any break case component const continue control deactivate display do else encode enumerated except exception execute extends extension external for from function goto group if import in infinity inout interleave label language length log match message mixed mod modifies module modulepar mtc noblock not not4b nowait of on optional or or4b out override param pattern port procedure record recursive rem repeat return runs select self sender set signature system template testcase to type union value valueof var variant while with xor xor4b"),builtin:b("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue decomp decvalue float2int float2str hex2bit hex2int hex2oct hex2str int2bit int2char int2float int2hex int2oct int2str int2unichar isbound ischosen ispresent isvalue lengthof log2str oct2bit oct2char oct2hex oct2int oct2str regexp replace rnd sizeof str2bit str2float str2hex str2int str2oct substr unichar2int unichar2char enum2int"),types:b("anytype bitstring boolean char charstring default float hexstring integer objid octetstring universal verdicttype timer"),timerOps:b("read running start stop timeout"),portOps:b("call catch check clear getcall getreply halt raise receive reply send trigger"),configOps:b("create connect disconnect done kill killed map unmap"),verdictOps:b("getverdict setverdict"),sutOps:b("action"),functionOps:b("apply derefers refers"),verdictConsts:b("error fail inconc none pass"),booleanConsts:b("true false"),otherConsts:b("null NULL omit"),visibilityModifiers:b("private public friend"),templateMatch:b("complement ifpresent subset superset permutation"),multiLineStrings:!0})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/turtle/turtle.min.js b/media/editors/codemirror/mode/turtle/turtle.min.js -index 7d202be..e3df23e 100644 ---- a/media/editors/codemirror/mode/turtle/turtle.min.js -+++ b/media/editors/codemirror/mode/turtle/turtle.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("turtle",function(t){function e(t){return new RegExp("^(?:"+t.join("|")+")$","i")}function n(t,e){var n=t.next();if(c=null,"<"==n&&!t.match(/^[\s\u00a0=]/,!1))return t.match(/^[^\s\u00a0>]*>?/),"atom";if('"'==n||"'"==n)return e.tokenize=o(n),e.tokenize(t,e);if(/[{}\(\),\.;\[\]]/.test(n))return c=n,null;if("#"==n)return t.skipToEnd(),"comment";if(a.test(n))return t.eatWhile(a),null;if(":"==n)return"operator";if(t.eatWhile(/[_\w\d]/),":"==t.peek())return"variable-3";var r=t.current();return l.test(r)?"meta":n>="A"&&"Z">=n?"comment":"keyword";var r}function o(t){return function(e,o){for(var r,i=!1;null!=(r=e.next());){if(r==t&&!i){o.tokenize=n;break}i=!i&&"\\"==r}return"string"}}function r(t,e,n){t.context={prev:t.context,indent:t.indent,col:n,type:e}}function i(t){t.indent=t.context.indent,t.context=t.context.prev}var c,u=t.indentUnit,l=(e([]),e(["@prefix","@base","a"])),a=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(t,e){if(t.sol()&&(e.context&&null==e.context.align&&(e.context.align=!1),e.indent=t.indentation()),t.eatSpace())return null;var n=e.tokenize(t,e);if("comment"!=n&&e.context&&null==e.context.align&&"pattern"!=e.context.type&&(e.context.align=!0),"("==c)r(e,")",t.column());else if("["==c)r(e,"]",t.column());else if("{"==c)r(e,"}",t.column());else if(/[\]\}\)]/.test(c)){for(;e.context&&"pattern"==e.context.type;)i(e);e.context&&c==e.context.type&&i(e)}else"."==c&&e.context&&"pattern"==e.context.type?i(e):/atom|string|variable/.test(n)&&e.context&&(/[\}\]]/.test(e.context.type)?r(e,"pattern",t.column()):"pattern"!=e.context.type||e.context.align||(e.context.align=!0,e.context.col=t.column()));return n},indent:function(t,e){var n=e&&e.charAt(0),o=t.context;if(/[\]\}]/.test(n))for(;o&&"pattern"==o.type;)o=o.prev;var r=o&&n==o.type;return o?"pattern"==o.type?o.col:o.align?o.col+(r?0:1):o.indent+(r?0:u):0},lineComment:"#"}}),t.defineMIME("text/turtle","turtle")}); -\ 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("turtle",function(a){function b(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function c(a,b){var c=a.next();if(g=null,"<"==c&&!a.match(/^[\s\u00a0=]/,!1))return a.match(/^[^\s\u00a0>]*>?/),"atom";if('"'==c||"'"==c)return b.tokenize=d(c),b.tokenize(a,b);if(/[{}\(\),\.;\[\]]/.test(c))return g=c,null;if("#"==c)return a.skipToEnd(),"comment";if(j.test(c))return a.eatWhile(j),null;if(":"==c)return"operator";if(a.eatWhile(/[_\w\d]/),":"==a.peek())return"variable-3";var e=a.current();return i.test(e)?"meta":c>="A"&&"Z">=c?"comment":"keyword";var e}function d(a){return function(b,d){for(var e,f=!1;null!=(e=b.next());){if(e==a&&!f){d.tokenize=c;break}f=!f&&"\\"==e}return"string"}}function e(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function f(a){a.indent=a.context.indent,a.context=a.context.prev}var g,h=a.indentUnit,i=(b([]),b(["@prefix","@base","a"])),j=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(a,b){if(a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);if("comment"!=c&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==g)e(b,")",a.column());else if("["==g)e(b,"]",a.column());else if("{"==g)e(b,"}",a.column());else if(/[\]\}\)]/.test(g)){for(;b.context&&"pattern"==b.context.type;)f(b);b.context&&g==b.context.type&&f(b)}else"."==g&&b.context&&"pattern"==b.context.type?f(b):/atom|string|variable/.test(c)&&b.context&&(/[\}\]]/.test(b.context.type)?e(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return c},indent:function(a,b){var c=b&&b.charAt(0),d=a.context;if(/[\]\}]/.test(c))for(;d&&"pattern"==d.type;)d=d.prev;var e=d&&c==d.type;return d?"pattern"==d.type?d.col:d.align?d.col+(e?0:1):d.indent+(e?0:h):0},lineComment:"#"}}),a.defineMIME("text/turtle","turtle")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/vb/vb.js b/media/editors/codemirror/mode/vb/vb.js -index 902203e..665248f 100644 ---- a/media/editors/codemirror/mode/vb/vb.js -+++ b/media/editors/codemirror/mode/vb/vb.js -@@ -29,13 +29,14 @@ CodeMirror.defineMode("vb", function(conf, parserConf) { - var middleKeywords = ['else','elseif','case', 'catch']; - var endKeywords = ['next','loop']; - -- var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'in']); -- var commonkeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until', -+ var operatorKeywords = ['and', 'or', 'not', 'xor', 'in']; -+ var wordOperators = wordRegexp(operatorKeywords); -+ var commonKeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until', - 'goto', 'byval','byref','new','handles','property', 'return', - 'const','private', 'protected', 'friend', 'public', 'shared', 'static', 'true','false']; - var commontypes = ['integer','string','double','decimal','boolean','short','char', 'float','single']; - -- var keywords = wordRegexp(commonkeywords); -+ var keywords = wordRegexp(commonKeywords); - var types = wordRegexp(commontypes); - var stringPrefixes = '"'; - -@@ -47,8 +48,8 @@ CodeMirror.defineMode("vb", function(conf, parserConf) { - - var indentInfo = null; - -- -- -+ CodeMirror.registerHelper("hintWords", "vb", openingKeywords.concat(middleKeywords).concat(endKeywords) -+ .concat(operatorKeywords).concat(commonKeywords).concat(commontypes)); - - function indent(_stream, state) { - state.currentIndent++; -diff --git a/media/editors/codemirror/mode/vb/vb.min.js b/media/editors/codemirror/mode/vb/vb.min.js -index 784a7a7..174963b 100644 ---- a/media/editors/codemirror/mode/vb/vb.min.js -+++ b/media/editors/codemirror/mode/vb/vb.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("vb",function(e,n){function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e,n){n.currentIndent++}function i(e,n){n.currentIndent--}function o(e,n){if(e.eatSpace())return null;var t=e.peek();if("'"===t)return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var o=!1;if(e.match(/^\d*\.\d+F?/i)?o=!0:e.match(/^\d+\.\d*F?/)?o=!0:e.match(/^\.\d+F?/)&&(o=!0),o)return e.eat(/J/i),"number";var c=!1;if(e.match(/^&H[0-9a-f]+/i)?c=!0:e.match(/^&O[0-7]+/i)?c=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),c=!0):e.match(/^0(?![\dx])/i)&&(c=!0),c)return e.eat(/L/i),"number"}return e.match(I)?(n.tokenize=a(e.current()),n.tokenize(e,n)):e.match(h)||e.match(m)?null:e.match(l)||e.match(d)||e.match(x)?"operator":e.match(f)?null:e.match(R)?(r(e,n),n.doInCurrentLine=!0,"keyword"):e.match(E)?(n.doInCurrentLine?n.doInCurrentLine=!1:r(e,n),"keyword"):e.match(L)?"keyword":e.match(C)?(i(e,n),i(e,n),"keyword"):e.match(z)?(i(e,n),"keyword"):e.match(y)?"keyword":e.match(w)?"keyword":e.match(s)?"variable":(e.next(),u)}function a(e){var t=1==e.length,r="string";return function(i,a){for(;!i.eol();){if(i.eatWhile(/[^'"]/),i.match(e))return a.tokenize=o,r;i.eat(/['"]/)}if(t){if(n.singleLineStringErrors)return u;a.tokenize=o}return r}}function c(e,n){var t=n.tokenize(e,n),o=e.current();if("."===o)return t=n.tokenize(e,n),o=e.current(),"variable"===t?"variable":u;var a="[({".indexOf(o);return-1!==a&&r(e,n),"dedent"===F&&i(e,n)?u:(a="])}".indexOf(o),-1!==a&&i(e,n)?u:t)}var u="error",d=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),f=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),l=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),m=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),h=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),s=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),p=["class","module","sub","enum","select","while","if","function","get","set","property","try"],b=["else","elseif","case","catch"],k=["next","loop"],x=t(["and","or","not","xor","in"]),g=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],v=["integer","string","double","decimal","boolean","short","char","float","single"],w=t(g),y=t(v),I='"',E=t(p),L=t(b),z=t(k),C=t(["end"]),R=t(["do"]),F=null,M={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:o,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,n){e.sol()&&(n.currentIndent+=n.nextLineIndent,n.nextLineIndent=0,n.doInCurrentLine=0);var t=c(e,n);return n.lastToken={style:t,content:e.current()},t},indent:function(n,t){var r=t.replace(/^\s+|\s+$/g,"");return r.match(z)||r.match(C)||r.match(L)?e.indentUnit*(n.currentIndent-1):n.currentIndent<0?0:n.currentIndent*e.indentUnit}};return M}),e.defineMIME("text/x-vb","vb")}); -\ 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("vb",function(b,c){function d(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function e(a,b){b.currentIndent++}function f(a,b){b.currentIndent--}function g(a,b){if(a.eatSpace())return null;var c=a.peek();if("'"===c)return a.skipToEnd(),"comment";if(a.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var d=!1;if(a.match(/^\d*\.\d+F?/i)?d=!0:a.match(/^\d+\.\d*F?/)?d=!0:a.match(/^\.\d+F?/)&&(d=!0),d)return a.eat(/J/i),"number";var g=!1;if(a.match(/^&H[0-9a-f]+/i)?g=!0:a.match(/^&O[0-7]+/i)?g=!0:a.match(/^[1-9]\d*F?/)?(a.eat(/J/i),g=!0):a.match(/^0(?![\dx])/i)&&(g=!0),g)return a.eat(/L/i),"number"}return a.match(z)?(b.tokenize=h(a.current()),b.tokenize(a,b)):a.match(o)||a.match(n)?null:a.match(m)||a.match(k)||a.match(u)?"operator":a.match(l)?null:a.match(E)?(e(a,b),b.doInCurrentLine=!0,"keyword"):a.match(A)?(b.doInCurrentLine?b.doInCurrentLine=!1:e(a,b),"keyword"):a.match(B)?"keyword":a.match(D)?(f(a,b),f(a,b),"keyword"):a.match(C)?(f(a,b),"keyword"):a.match(y)?"keyword":a.match(x)?"keyword":a.match(p)?"variable":(a.next(),j)}function h(a){var b=1==a.length,d="string";return function(e,f){for(;!e.eol();){if(e.eatWhile(/[^'"]/),e.match(a))return f.tokenize=g,d;e.eat(/['"]/)}if(b){if(c.singleLineStringErrors)return j;f.tokenize=g}return d}}function i(a,b){var c=b.tokenize(a,b),d=a.current();if("."===d)return c=b.tokenize(a,b),d=a.current(),"variable"===c?"variable":j;var g="[({".indexOf(d);return-1!==g&&e(a,b),"dedent"===F&&f(a,b)?j:(g="])}".indexOf(d),-1!==g&&f(a,b)?j:c)}var j="error",k=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),l=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),m=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),n=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),o=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),p=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),q=["class","module","sub","enum","select","while","if","function","get","set","property","try"],r=["else","elseif","case","catch"],s=["next","loop"],t=["and","or","not","xor","in"],u=d(t),v=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],w=["integer","string","double","decimal","boolean","short","char","float","single"],x=d(v),y=d(w),z='"',A=d(q),B=d(r),C=d(s),D=d(["end"]),E=d(["do"]),F=null;a.registerHelper("hintWords","vb",q.concat(r).concat(s).concat(t).concat(v).concat(w));var G={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:g,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(a,b){a.sol()&&(b.currentIndent+=b.nextLineIndent,b.nextLineIndent=0,b.doInCurrentLine=0);var c=i(a,b);return b.lastToken={style:c,content:a.current()},c},indent:function(a,c){var d=c.replace(/^\s+|\s+$/g,"");return d.match(C)||d.match(D)||d.match(B)?b.indentUnit*(a.currentIndent-1):a.currentIndent<0?0:a.currentIndent*b.indentUnit}};return G}),a.defineMIME("text/x-vb","vb")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/vbscript/vbscript.min.js b/media/editors/codemirror/mode/vbscript/vbscript.min.js -index 4d021e1..6ec685d 100644 ---- a/media/editors/codemirror/mode/vbscript/vbscript.min.js -+++ b/media/editors/codemirror/mode/vbscript/vbscript.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("vbscript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function r(e,t){t.currentIndent++}function a(e,t){t.currentIndent--}function i(e,t){if(e.eatSpace())return"space";var n=e.peek();if("'"===n)return e.skipToEnd(),"comment";if(e.match(K))return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var i=!1;if(e.match(/^\d*\.\d+/i)?i=!0:e.match(/^\d+\.\d*/)?i=!0:e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var c=!1;if(e.match(/^&H[0-9a-f]+/i)?c=!0:e.match(/^&O[0-7]+/i)?c=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),c=!0):e.match(/^0(?![\dx])/i)&&(c=!0),c)return e.eat(/L/i),"number"}return e.match(R)?(t.tokenize=o(e.current()),t.tokenize(e,t)):e.match(l)||e.match(s)||e.match(h)?"operator":e.match(u)?null:e.match(d)?"bracket":e.match(W)?(t.doInCurrentLine=!0,"keyword"):e.match(q)?(r(e,t),t.doInCurrentLine=!0,"keyword"):e.match(B)?(t.doInCurrentLine?t.doInCurrentLine=!1:r(e,t),"keyword"):e.match(M)?"keyword":e.match(N)?(a(e,t),a(e,t),"keyword"):e.match(A)?(t.doInCurrentLine?t.doInCurrentLine=!1:a(e,t),"keyword"):e.match(T)?"keyword":e.match(j)?"atom":e.match(F)?"variable-2":e.match(O)?"builtin":e.match(z)?"variable-2":e.match(v)?"variable":(e.next(),b)}function o(e){var n=1==e.length,r="string";return function(a,o){for(;!a.eol();){if(a.eatWhile(/[^'"]/),a.match(e))return o.tokenize=i,r;a.eat(/['"]/)}if(n){if(t.singleLineStringErrors)return b;o.tokenize=i}return r}}function c(e,t){var n=t.tokenize(e,t),r=e.current();return"."===r?(n=t.tokenize(e,t),r=e.current(),!n||"variable"!==n.substr(0,8)&&"builtin"!==n&&"keyword"!==n?b:(("builtin"===n||"keyword"===n)&&(n="variable"),S.indexOf(r.substr(1))>-1&&(n="variable-2"),n)):n}var b="error",s=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),l=new RegExp("^((<>)|(<=)|(>=))"),u=new RegExp("^[\\.,]"),d=new RegExp("^[\\(\\)]"),v=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),m=["class","sub","select","while","if","function","property","with","for"],p=["else","elseif","case"],f=["next","loop","wend"],h=n(["and","or","not","xor","is","mod","eqv","imp"]),y=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],g=["true","false","nothing","empty","null"],x=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],k=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],w=["WScript","err","debug","RegExp"],I=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],C=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],L=["server","response","request","session","application"],E=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],D=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],S=C.concat(I);w=w.concat(k),e.isASP&&(w=w.concat(L),S=S.concat(D,E));var T=n(y),j=n(g),O=n(x),z=n(w),F=n(S),R='"',B=n(m),M=n(p),A=n(f),N=n(["end"]),q=n(["do"]),W=n(["on error resume next","exit"]),K=n(["rem"]),U={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:i,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var n=c(e,t);return t.lastToken={style:n,content:e.current()},"space"===n&&(n=null),n},indent:function(t,n){var r=n.replace(/^\s+|\s+$/g,"");return r.match(A)||r.match(N)||r.match(M)?e.indentUnit*(t.currentIndent-1):t.currentIndent<0?0:t.currentIndent*e.indentUnit}};return U}),e.defineMIME("text/vbscript","vbscript")}); -\ 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("vbscript",function(a,b){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function d(a,b){b.currentIndent++}function e(a,b){b.currentIndent--}function f(a,b){if(a.eatSpace())return"space";var c=a.peek();if("'"===c)return a.skipToEnd(),"comment";if(a.match(P))return a.skipToEnd(),"comment";if(a.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!a.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var f=!1;if(a.match(/^\d*\.\d+/i)?f=!0:a.match(/^\d+\.\d*/)?f=!0:a.match(/^\.\d+/)&&(f=!0),f)return a.eat(/J/i),"number";var h=!1;if(a.match(/^&H[0-9a-f]+/i)?h=!0:a.match(/^&O[0-7]+/i)?h=!0:a.match(/^[1-9]\d*F?/)?(a.eat(/J/i),h=!0):a.match(/^0(?![\dx])/i)&&(h=!0),h)return a.eat(/L/i),"number"}return a.match(I)?(b.tokenize=g(a.current()),b.tokenize(a,b)):a.match(k)||a.match(j)||a.match(r)?"operator":a.match(l)?null:a.match(m)?"bracket":a.match(O)?(b.doInCurrentLine=!0,"keyword"):a.match(N)?(d(a,b),b.doInCurrentLine=!0,"keyword"):a.match(J)?(b.doInCurrentLine?b.doInCurrentLine=!1:d(a,b),"keyword"):a.match(K)?"keyword":a.match(M)?(e(a,b),e(a,b),"keyword"):a.match(L)?(b.doInCurrentLine?b.doInCurrentLine=!1:e(a,b),"keyword"):a.match(D)?"keyword":a.match(E)?"atom":a.match(H)?"variable-2":a.match(F)?"builtin":a.match(G)?"variable-2":a.match(n)?"variable":(a.next(),i)}function g(a){var c=1==a.length,d="string";return function(e,g){for(;!e.eol();){if(e.eatWhile(/[^'"]/),e.match(a))return g.tokenize=f,d;e.eat(/['"]/)}if(c){if(b.singleLineStringErrors)return i;g.tokenize=f}return d}}function h(a,b){var c=b.tokenize(a,b),d=a.current();return"."===d?(c=b.tokenize(a,b),d=a.current(),!c||"variable"!==c.substr(0,8)&&"builtin"!==c&&"keyword"!==c?i:(("builtin"===c||"keyword"===c)&&(c="variable"),C.indexOf(d.substr(1))>-1&&(c="variable-2"),c)):c}var i="error",j=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),k=new RegExp("^((<>)|(<=)|(>=))"),l=new RegExp("^[\\.,]"),m=new RegExp("^[\\(\\)]"),n=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),o=["class","sub","select","while","if","function","property","with","for"],p=["else","elseif","case"],q=["next","loop","wend"],r=c(["and","or","not","xor","is","mod","eqv","imp"]),s=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],t=["true","false","nothing","empty","null"],u=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],v=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],w=["WScript","err","debug","RegExp"],x=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],y=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],z=["server","response","request","session","application"],A=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],B=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],C=y.concat(x);w=w.concat(v),a.isASP&&(w=w.concat(z),C=C.concat(B,A));var D=c(s),E=c(t),F=c(u),G=c(w),H=c(C),I='"',J=c(o),K=c(p),L=c(q),M=c(["end"]),N=c(["do"]),O=c(["on error resume next","exit"]),P=c(["rem"]),Q={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:f,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(a,b){a.sol()&&(b.currentIndent+=b.nextLineIndent,b.nextLineIndent=0,b.doInCurrentLine=0);var c=h(a,b);return b.lastToken={style:c,content:a.current()},"space"===c&&(c=null),c},indent:function(b,c){var d=c.replace(/^\s+|\s+$/g,"");return d.match(L)||d.match(M)||d.match(K)?a.indentUnit*(b.currentIndent-1):b.currentIndent<0?0:b.currentIndent*a.indentUnit}};return Q}),a.defineMIME("text/vbscript","vbscript")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/velocity/velocity.min.js b/media/editors/codemirror/mode/velocity/velocity.min.js -index 0d64e640..08735aa 100644 ---- a/media/editors/codemirror/mode/velocity/velocity.min.js -+++ b/media/editors/codemirror/mode/velocity/velocity.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("velocity",function(){function e(e){for(var t={},n=e.split(" "),r=0;rk.length&&"."==e.string.charAt(e.pos-k.length-1)&&n.lastTokenWasBuiltin?"builtin":(n.lastTokenWasBuiltin=!1,null)}return n.lastTokenWasBuiltin=!1,n.inString?(n.inString=!1,"string"):n.inParams?t(e,n,r(c)):void 0}function r(e){return function(t,r){for(var i,a=!1,o=!1;null!=(i=t.next());){if(i==e&&!a){o=!0;break}if('"'==e&&"$"==t.peek()&&!a){r.inString=!0,o=!0;break}a=!a&&"\\"==i}return o&&(r.tokenize=n),"string"}}function i(e,t){for(var r,i=!1;r=e.next();){if("#"==r&&i){t.tokenize=n;break}i="*"==r}return"comment"}function a(e,t){for(var r,i=0;r=e.next();){if("#"==r&&2==i){t.tokenize=n;break}"]"==r?i++:" "!=r&&(i=0)}return"meta"}var o=e("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"),s=e("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"),l=e("$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"),u=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:n,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},blockCommentStart:"#*",blockCommentEnd:"*#",lineComment:"##",fold:"velocity"}}),e.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/mode/verilog/test.js b/media/editors/codemirror/mode/verilog/test.js -deleted file mode 100644 -index 9c8c094..0000000 ---- a/media/editors/codemirror/mode/verilog/test.js -+++ /dev/null -@@ -1,273 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({indentUnit: 4}, "verilog"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- -- MT("binary_literals", -- "[number 1'b0]", -- "[number 1'b1]", -- "[number 1'bx]", -- "[number 1'bz]", -- "[number 1'bX]", -- "[number 1'bZ]", -- "[number 1'B0]", -- "[number 1'B1]", -- "[number 1'Bx]", -- "[number 1'Bz]", -- "[number 1'BX]", -- "[number 1'BZ]", -- "[number 1'b0]", -- "[number 1'b1]", -- "[number 2'b01]", -- "[number 2'bxz]", -- "[number 2'b11]", -- "[number 2'b10]", -- "[number 2'b1Z]", -- "[number 12'b0101_0101_0101]", -- "[number 1'b 0]", -- "[number 'b0101]" -- ); -- -- MT("octal_literals", -- "[number 3'o7]", -- "[number 3'O7]", -- "[number 3'so7]", -- "[number 3'SO7]" -- ); -- -- MT("decimal_literals", -- "[number 0]", -- "[number 1]", -- "[number 7]", -- "[number 123_456]", -- "[number 'd33]", -- "[number 8'd255]", -- "[number 8'D255]", -- "[number 8'sd255]", -- "[number 8'SD255]", -- "[number 32'd123]", -- "[number 32 'd123]", -- "[number 32 'd 123]" -- ); -- -- MT("hex_literals", -- "[number 4'h0]", -- "[number 4'ha]", -- "[number 4'hF]", -- "[number 4'hx]", -- "[number 4'hz]", -- "[number 4'hX]", -- "[number 4'hZ]", -- "[number 32'hdc78]", -- "[number 32'hDC78]", -- "[number 32 'hDC78]", -- "[number 32'h DC78]", -- "[number 32 'h DC78]", -- "[number 32'h44x7]", -- "[number 32'hFFF?]" -- ); -- -- MT("real_number_literals", -- "[number 1.2]", -- "[number 0.1]", -- "[number 2394.26331]", -- "[number 1.2E12]", -- "[number 1.2e12]", -- "[number 1.30e-2]", -- "[number 0.1e-0]", -- "[number 23E10]", -- "[number 29E-2]", -- "[number 236.123_763_e-12]" -- ); -- -- MT("operators", -- "[meta ^]" -- ); -- -- MT("keywords", -- "[keyword logic]", -- "[keyword logic] [variable foo]", -- "[keyword reg] [variable abc]" -- ); -- -- MT("variables", -- "[variable _leading_underscore]", -- "[variable _if]", -- "[number 12] [variable foo]", -- "[variable foo] [number 14]" -- ); -- -- MT("tick_defines", -- "[def `FOO]", -- "[def `foo]", -- "[def `FOO_bar]" -- ); -- -- MT("system_calls", -- "[meta $display]", -- "[meta $vpi_printf]" -- ); -- -- MT("line_comment", "[comment // Hello world]"); -- -- // Alignment tests -- MT("align_port_map_style1", -- /** -- * mod mod(.a(a), -- * .b(b) -- * ); -- */ -- "[variable mod] [variable mod][bracket (].[variable a][bracket (][variable a][bracket )],", -- " .[variable b][bracket (][variable b][bracket )]", -- " [bracket )];", -- "" -- ); -- -- MT("align_port_map_style2", -- /** -- * mod mod( -- * .a(a), -- * .b(b) -- * ); -- */ -- "[variable mod] [variable mod][bracket (]", -- " .[variable a][bracket (][variable a][bracket )],", -- " .[variable b][bracket (][variable b][bracket )]", -- "[bracket )];", -- "" -- ); -- -- // Indentation tests -- MT("indent_single_statement_if", -- "[keyword if] [bracket (][variable foo][bracket )]", -- " [keyword break];", -- "" -- ); -- -- MT("no_indent_after_single_line_if", -- "[keyword if] [bracket (][variable foo][bracket )] [keyword break];", -- "" -- ); -- -- MT("indent_after_if_begin_same_line", -- "[keyword if] [bracket (][variable foo][bracket )] [keyword begin]", -- " [keyword break];", -- " [keyword break];", -- "[keyword end]", -- "" -- ); -- -- MT("indent_after_if_begin_next_line", -- "[keyword if] [bracket (][variable foo][bracket )]", -- " [keyword begin]", -- " [keyword break];", -- " [keyword break];", -- " [keyword end]", -- "" -- ); -- -- MT("indent_single_statement_if_else", -- "[keyword if] [bracket (][variable foo][bracket )]", -- " [keyword break];", -- "[keyword else]", -- " [keyword break];", -- "" -- ); -- -- MT("indent_if_else_begin_same_line", -- "[keyword if] [bracket (][variable foo][bracket )] [keyword begin]", -- " [keyword break];", -- " [keyword break];", -- "[keyword end] [keyword else] [keyword begin]", -- " [keyword break];", -- " [keyword break];", -- "[keyword end]", -- "" -- ); -- -- MT("indent_if_else_begin_next_line", -- "[keyword if] [bracket (][variable foo][bracket )]", -- " [keyword begin]", -- " [keyword break];", -- " [keyword break];", -- " [keyword end]", -- "[keyword else]", -- " [keyword begin]", -- " [keyword break];", -- " [keyword break];", -- " [keyword end]", -- "" -- ); -- -- MT("indent_if_nested_without_begin", -- "[keyword if] [bracket (][variable foo][bracket )]", -- " [keyword if] [bracket (][variable foo][bracket )]", -- " [keyword if] [bracket (][variable foo][bracket )]", -- " [keyword break];", -- "" -- ); -- -- MT("indent_case", -- "[keyword case] [bracket (][variable state][bracket )]", -- " [variable FOO]:", -- " [keyword break];", -- " [variable BAR]:", -- " [keyword break];", -- "[keyword endcase]", -- "" -- ); -- -- MT("unindent_after_end_with_preceding_text", -- "[keyword begin]", -- " [keyword break]; [keyword end]", -- "" -- ); -- -- MT("export_function_one_line_does_not_indent", -- "[keyword export] [string \"DPI-C\"] [keyword function] [variable helloFromSV];", -- "" -- ); -- -- MT("export_task_one_line_does_not_indent", -- "[keyword export] [string \"DPI-C\"] [keyword task] [variable helloFromSV];", -- "" -- ); -- -- MT("export_function_two_lines_indents_properly", -- "[keyword export]", -- " [string \"DPI-C\"] [keyword function] [variable helloFromSV];", -- "" -- ); -- -- MT("export_task_two_lines_indents_properly", -- "[keyword export]", -- " [string \"DPI-C\"] [keyword task] [variable helloFromSV];", -- "" -- ); -- -- MT("import_function_one_line_does_not_indent", -- "[keyword import] [string \"DPI-C\"] [keyword function] [variable helloFromC];", -- "" -- ); -- -- MT("import_task_one_line_does_not_indent", -- "[keyword import] [string \"DPI-C\"] [keyword task] [variable helloFromC];", -- "" -- ); -- -- MT("import_package_single_line_does_not_indent", -- "[keyword import] [variable p]::[variable x];", -- "[keyword import] [variable p]::[variable y];", -- "" -- ); -- -- MT("covergoup_with_function_indents_properly", -- "[keyword covergroup] [variable cg] [keyword with] [keyword function] [variable sample][bracket (][keyword bit] [variable b][bracket )];", -- " [variable c] : [keyword coverpoint] [variable c];", -- "[keyword endgroup]: [variable cg]", -- "" -- ); -- --})(); -diff --git a/media/editors/codemirror/mode/verilog/test.min.js b/media/editors/codemirror/mode/verilog/test.min.js -deleted file mode 100644 -index 37f74d0..0000000 ---- a/media/editors/codemirror/mode/verilog/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function e(e){test.mode(e,r,Array.prototype.slice.call(arguments,1))}var r=CodeMirror.getMode({indentUnit:4},"verilog");e("binary_literals","[number 1'b0]","[number 1'b1]","[number 1'bx]","[number 1'bz]","[number 1'bX]","[number 1'bZ]","[number 1'B0]","[number 1'B1]","[number 1'Bx]","[number 1'Bz]","[number 1'BX]","[number 1'BZ]","[number 1'b0]","[number 1'b1]","[number 2'b01]","[number 2'bxz]","[number 2'b11]","[number 2'b10]","[number 2'b1Z]","[number 12'b0101_0101_0101]","[number 1'b 0]","[number 'b0101]"),e("octal_literals","[number 3'o7]","[number 3'O7]","[number 3'so7]","[number 3'SO7]"),e("decimal_literals","[number 0]","[number 1]","[number 7]","[number 123_456]","[number 'd33]","[number 8'd255]","[number 8'D255]","[number 8'sd255]","[number 8'SD255]","[number 32'd123]","[number 32 'd123]","[number 32 'd 123]"),e("hex_literals","[number 4'h0]","[number 4'ha]","[number 4'hF]","[number 4'hx]","[number 4'hz]","[number 4'hX]","[number 4'hZ]","[number 32'hdc78]","[number 32'hDC78]","[number 32 'hDC78]","[number 32'h DC78]","[number 32 'h DC78]","[number 32'h44x7]","[number 32'hFFF?]"),e("real_number_literals","[number 1.2]","[number 0.1]","[number 2394.26331]","[number 1.2E12]","[number 1.2e12]","[number 1.30e-2]","[number 0.1e-0]","[number 23E10]","[number 29E-2]","[number 236.123_763_e-12]"),e("operators","[meta ^]"),e("keywords","[keyword logic]","[keyword logic] [variable foo]","[keyword reg] [variable abc]"),e("variables","[variable _leading_underscore]","[variable _if]","[number 12] [variable foo]","[variable foo] [number 14]"),e("tick_defines","[def `FOO]","[def `foo]","[def `FOO_bar]"),e("system_calls","[meta $display]","[meta $vpi_printf]"),e("line_comment","[comment // Hello world]"),e("align_port_map_style1","[variable mod] [variable mod][bracket (].[variable a][bracket (][variable a][bracket )],"," .[variable b][bracket (][variable b][bracket )]"," [bracket )];",""),e("align_port_map_style2","[variable mod] [variable mod][bracket (]"," .[variable a][bracket (][variable a][bracket )],"," .[variable b][bracket (][variable b][bracket )]","[bracket )];",""),e("indent_single_statement_if","[keyword if] [bracket (][variable foo][bracket )]"," [keyword break];",""),e("no_indent_after_single_line_if","[keyword if] [bracket (][variable foo][bracket )] [keyword break];",""),e("indent_after_if_begin_same_line","[keyword if] [bracket (][variable foo][bracket )] [keyword begin]"," [keyword break];"," [keyword break];","[keyword end]",""),e("indent_after_if_begin_next_line","[keyword if] [bracket (][variable foo][bracket )]"," [keyword begin]"," [keyword break];"," [keyword break];"," [keyword end]",""),e("indent_single_statement_if_else","[keyword if] [bracket (][variable foo][bracket )]"," [keyword break];","[keyword else]"," [keyword break];",""),e("indent_if_else_begin_same_line","[keyword if] [bracket (][variable foo][bracket )] [keyword begin]"," [keyword break];"," [keyword break];","[keyword end] [keyword else] [keyword begin]"," [keyword break];"," [keyword break];","[keyword end]",""),e("indent_if_else_begin_next_line","[keyword if] [bracket (][variable foo][bracket )]"," [keyword begin]"," [keyword break];"," [keyword break];"," [keyword end]","[keyword else]"," [keyword begin]"," [keyword break];"," [keyword break];"," [keyword end]",""),e("indent_if_nested_without_begin","[keyword if] [bracket (][variable foo][bracket )]"," [keyword if] [bracket (][variable foo][bracket )]"," [keyword if] [bracket (][variable foo][bracket )]"," [keyword break];",""),e("indent_case","[keyword case] [bracket (][variable state][bracket )]"," [variable FOO]:"," [keyword break];"," [variable BAR]:"," [keyword break];","[keyword endcase]",""),e("unindent_after_end_with_preceding_text","[keyword begin]"," [keyword break]; [keyword end]",""),e("export_function_one_line_does_not_indent",'[keyword export] [string "DPI-C"] [keyword function] [variable helloFromSV];',""),e("export_task_one_line_does_not_indent",'[keyword export] [string "DPI-C"] [keyword task] [variable helloFromSV];',""),e("export_function_two_lines_indents_properly","[keyword export]",' [string "DPI-C"] [keyword function] [variable helloFromSV];',""),e("export_task_two_lines_indents_properly","[keyword export]",' [string "DPI-C"] [keyword task] [variable helloFromSV];',""),e("import_function_one_line_does_not_indent",'[keyword import] [string "DPI-C"] [keyword function] [variable helloFromC];',""),e("import_task_one_line_does_not_indent",'[keyword import] [string "DPI-C"] [keyword task] [variable helloFromC];',""),e("import_package_single_line_does_not_indent","[keyword import] [variable p]::[variable x];","[keyword import] [variable p]::[variable y];",""),e("covergoup_with_function_indents_properly","[keyword covergroup] [variable cg] [keyword with] [keyword function] [variable sample][bracket (][keyword bit] [variable b][bracket )];"," [variable c] : [keyword coverpoint] [variable c];","[keyword endgroup]: [variable cg]","")}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/verilog/verilog.js b/media/editors/codemirror/mode/verilog/verilog.js -index 96b9f24..9d2a4cd 100644 ---- a/media/editors/codemirror/mode/verilog/verilog.js -+++ b/media/editors/codemirror/mode/verilog/verilog.js -@@ -375,73 +375,73 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { - name: "verilog" - }); - -- // SVXVerilog mode -+ // TLVVerilog mode - -- var svxchScopePrefixes = { -+ var tlvchScopePrefixes = { - ">": "property", "->": "property", "-": "hr", "|": "link", "?$": "qualifier", "?*": "qualifier", - "@-": "variable-3", "@": "variable-3", "?": "qualifier" - }; - -- function svxGenIndent(stream, state) { -- var svxindentUnit = 2; -+ function tlvGenIndent(stream, state) { -+ var tlvindentUnit = 2; - var rtnIndent = -1, indentUnitRq = 0, curIndent = stream.indentation(); -- switch (state.svxCurCtlFlowChar) { -+ switch (state.tlvCurCtlFlowChar) { - case "\\": - curIndent = 0; - break; - case "|": -- if (state.svxPrevPrevCtlFlowChar == "@") { -+ if (state.tlvPrevPrevCtlFlowChar == "@") { - indentUnitRq = -2; //-2 new pipe rq after cur pipe - break; - } -- if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) -+ if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar]) - indentUnitRq = 1; // +1 new scope - break; - case "M": // m4 -- if (state.svxPrevPrevCtlFlowChar == "@") { -+ if (state.tlvPrevPrevCtlFlowChar == "@") { - indentUnitRq = -2; //-2 new inst rq after pipe - break; - } -- if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) -+ if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar]) - indentUnitRq = 1; // +1 new scope - break; - case "@": -- if (state.svxPrevCtlFlowChar == "S") -+ if (state.tlvPrevCtlFlowChar == "S") - indentUnitRq = -1; // new pipe stage after stmts -- if (state.svxPrevCtlFlowChar == "|") -+ if (state.tlvPrevCtlFlowChar == "|") - indentUnitRq = 1; // 1st pipe stage - break; - case "S": -- if (state.svxPrevCtlFlowChar == "@") -+ if (state.tlvPrevCtlFlowChar == "@") - indentUnitRq = 1; // flow in pipe stage -- if (svxchScopePrefixes[state.svxPrevCtlFlowChar]) -+ if (tlvchScopePrefixes[state.tlvPrevCtlFlowChar]) - indentUnitRq = 1; // +1 new scope - break; - } -- var statementIndentUnit = svxindentUnit; -+ var statementIndentUnit = tlvindentUnit; - rtnIndent = curIndent + (indentUnitRq*statementIndentUnit); - return rtnIndent >= 0 ? rtnIndent : curIndent; - } - -- CodeMirror.defineMIME("text/x-svx", { -+ CodeMirror.defineMIME("text/x-tlv", { - name: "verilog", - hooks: { - "\\": function(stream, state) { - var vxIndent = 0, style = false; - var curPunc = stream.string; -- if ((stream.sol()) && (/\\SV/.test(stream.string))) { -- curPunc = (/\\SVX_version/.test(stream.string)) -- ? "\\SVX_version" : stream.string; -+ if ((stream.sol()) && ((/\\SV/.test(stream.string)) || (/\\TLV/.test(stream.string)))) { -+ curPunc = (/\\TLV_version/.test(stream.string)) -+ ? "\\TLV_version" : stream.string; - stream.skipToEnd(); - if (curPunc == "\\SV" && state.vxCodeActive) {state.vxCodeActive = false;}; -- if ((/\\SVX/.test(curPunc) && !state.vxCodeActive) -- || (curPunc=="\\SVX_version" && state.vxCodeActive)) {state.vxCodeActive = true;}; -+ if ((/\\TLV/.test(curPunc) && !state.vxCodeActive) -+ || (curPunc=="\\TLV_version" && state.vxCodeActive)) {state.vxCodeActive = true;}; - style = "keyword"; -- state.svxCurCtlFlowChar = state.svxPrevPrevCtlFlowChar -- = state.svxPrevCtlFlowChar = ""; -+ state.tlvCurCtlFlowChar = state.tlvPrevPrevCtlFlowChar -+ = state.tlvPrevCtlFlowChar = ""; - if (state.vxCodeActive == true) { -- state.svxCurCtlFlowChar = "\\"; -- vxIndent = svxGenIndent(stream, state); -+ state.tlvCurCtlFlowChar = "\\"; -+ vxIndent = tlvGenIndent(stream, state); - } - state.vxIndentRq = vxIndent; - } -@@ -449,12 +449,12 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { - }, - tokenBase: function(stream, state) { - var vxIndent = 0, style = false; -- var svxisOperatorChar = /[\[\]=:]/; -- var svxkpScopePrefixs = { -+ var tlvisOperatorChar = /[\[\]=:]/; -+ var tlvkpScopePrefixs = { - "**":"variable-2", "*":"variable-2", "$$":"variable", "$":"variable", - "^^":"attribute", "^":"attribute"}; - var ch = stream.peek(); -- var vxCurCtlFlowCharValueAtStart = state.svxCurCtlFlowChar; -+ var vxCurCtlFlowCharValueAtStart = state.tlvCurCtlFlowChar; - if (state.vxCodeActive == true) { - if (/[\[\]{}\(\);\:]/.test(ch)) { - // bypass nesting and 1 char punc -@@ -465,70 +465,70 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) { - if (stream.eat("/")) { - stream.skipToEnd(); - style = "comment"; -- state.svxCurCtlFlowChar = "S"; -+ state.tlvCurCtlFlowChar = "S"; - } else { - stream.backUp(1); - } - } else if (ch == "@") { - // pipeline stage -- style = svxchScopePrefixes[ch]; -- state.svxCurCtlFlowChar = "@"; -+ style = tlvchScopePrefixes[ch]; -+ state.tlvCurCtlFlowChar = "@"; - stream.next(); - stream.eatWhile(/[\w\$_]/); - } else if (stream.match(/\b[mM]4+/, true)) { // match: function(pattern, consume, caseInsensitive) - // m4 pre proc - stream.skipTo("("); - style = "def"; -- state.svxCurCtlFlowChar = "M"; -+ state.tlvCurCtlFlowChar = "M"; - } else if (ch == "!" && stream.sol()) { -- // v stmt in svx region -- // state.svxCurCtlFlowChar = "S"; -+ // v stmt in tlv region -+ // state.tlvCurCtlFlowChar = "S"; - style = "comment"; - stream.next(); -- } else if (svxisOperatorChar.test(ch)) { -+ } else if (tlvisOperatorChar.test(ch)) { - // operators -- stream.eatWhile(svxisOperatorChar); -+ stream.eatWhile(tlvisOperatorChar); - style = "operator"; - } else if (ch == "#") { - // phy hier -- state.svxCurCtlFlowChar = (state.svxCurCtlFlowChar == "") -- ? ch : state.svxCurCtlFlowChar; -+ state.tlvCurCtlFlowChar = (state.tlvCurCtlFlowChar == "") -+ ? ch : state.tlvCurCtlFlowChar; - stream.next(); - stream.eatWhile(/[+-]\d/); - style = "tag"; -- } else if (svxkpScopePrefixs.propertyIsEnumerable(ch)) { -- // special SVX operators -- style = svxkpScopePrefixs[ch]; -- state.svxCurCtlFlowChar = state.svxCurCtlFlowChar == "" ? "S" : state.svxCurCtlFlowChar; // stmt -+ } else if (tlvkpScopePrefixs.propertyIsEnumerable(ch)) { -+ // special TLV operators -+ style = tlvkpScopePrefixs[ch]; -+ state.tlvCurCtlFlowChar = state.tlvCurCtlFlowChar == "" ? "S" : state.tlvCurCtlFlowChar; // stmt - stream.next(); - stream.match(/[a-zA-Z_0-9]+/); -- } else if (style = svxchScopePrefixes[ch] || false) { -- // special SVX operators -- state.svxCurCtlFlowChar = state.svxCurCtlFlowChar == "" ? ch : state.svxCurCtlFlowChar; -+ } else if (style = tlvchScopePrefixes[ch] || false) { -+ // special TLV operators -+ state.tlvCurCtlFlowChar = state.tlvCurCtlFlowChar == "" ? ch : state.tlvCurCtlFlowChar; - stream.next(); - stream.match(/[a-zA-Z_0-9]+/); - } -- if (state.svxCurCtlFlowChar != vxCurCtlFlowCharValueAtStart) { // flow change -- vxIndent = svxGenIndent(stream, state); -+ if (state.tlvCurCtlFlowChar != vxCurCtlFlowCharValueAtStart) { // flow change -+ vxIndent = tlvGenIndent(stream, state); - state.vxIndentRq = vxIndent; - } - } - return style; - }, - token: function(stream, state) { -- if (state.vxCodeActive == true && stream.sol() && state.svxCurCtlFlowChar != "") { -- state.svxPrevPrevCtlFlowChar = state.svxPrevCtlFlowChar; -- state.svxPrevCtlFlowChar = state.svxCurCtlFlowChar; -- state.svxCurCtlFlowChar = ""; -+ if (state.vxCodeActive == true && stream.sol() && state.tlvCurCtlFlowChar != "") { -+ state.tlvPrevPrevCtlFlowChar = state.tlvPrevCtlFlowChar; -+ state.tlvPrevCtlFlowChar = state.tlvCurCtlFlowChar; -+ state.tlvCurCtlFlowChar = ""; - } - }, - indent: function(state) { - return (state.vxCodeActive == true) ? state.vxIndentRq : -1; - }, - startState: function(state) { -- state.svxCurCtlFlowChar = ""; -- state.svxPrevCtlFlowChar = ""; -- state.svxPrevPrevCtlFlowChar = ""; -+ state.tlvCurCtlFlowChar = ""; -+ state.tlvPrevCtlFlowChar = ""; -+ state.tlvPrevPrevCtlFlowChar = ""; - state.vxCodeActive = true; - state.vxIndentRq = 0; - } -diff --git a/media/editors/codemirror/mode/verilog/verilog.min.js b/media/editors/codemirror/mode/verilog/verilog.min.js -index 1f4e320..037ddcf 100644 ---- a/media/editors/codemirror/mode/verilog/verilog.min.js -+++ b/media/editors/codemirror/mode/verilog/verilog.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){var r=2,i=-1,a=0,o=e.indentation();switch(t.svxCurCtlFlowChar){case"\\":o=0;break;case"|":if("@"==t.svxPrevPrevCtlFlowChar){a=-2;break}n[t.svxPrevCtlFlowChar]&&(a=1);break;case"M":if("@"==t.svxPrevPrevCtlFlowChar){a=-2;break}n[t.svxPrevCtlFlowChar]&&(a=1);break;case"@":"S"==t.svxPrevCtlFlowChar&&(a=-1),"|"==t.svxPrevCtlFlowChar&&(a=1);break;case"S":"@"==t.svxPrevCtlFlowChar&&(a=1),n[t.svxPrevCtlFlowChar]&&(a=1)}var l=r;return i=o+a*l,i>=0?i:o}e.defineMode("verilog",function(t,n){function r(e){for(var t={},n=e.split(" "),r=0;r=0)return r}var a=t.context,o=n&&n.charAt(0);"statement"==a.type&&"}"==o&&(a=a.prev);var l=!1,s=n.match(q);return s&&(l=u(s[0],a.type)),"statement"==a.type?a.indented+("{"==o?0:C):A.test(a.type)&&a.align&&!m?a.column+(l?0:1):")"!=a.type||l?a.indented+(l?0:p):a.indented+C},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-verilog",{name:"verilog"}),e.defineMIME("text/x-systemverilog",{name:"verilog"});var n={">":"property","->":"property","-":"hr","|":"link","?$":"qualifier","?*":"qualifier","@-":"variable-3","@":"variable-3","?":"qualifier"};e.defineMIME("text/x-svx",{name:"verilog",hooks:{"\\":function(e,n){var r=0,i=!1,a=e.string;return e.sol()&&/\\SV/.test(e.string)&&(a=/\\SVX_version/.test(e.string)?"\\SVX_version":e.string,e.skipToEnd(),"\\SV"==a&&n.vxCodeActive&&(n.vxCodeActive=!1),(/\\SVX/.test(a)&&!n.vxCodeActive||"\\SVX_version"==a&&n.vxCodeActive)&&(n.vxCodeActive=!0),i="keyword",n.svxCurCtlFlowChar=n.svxPrevPrevCtlFlowChar=n.svxPrevCtlFlowChar="",1==n.vxCodeActive&&(n.svxCurCtlFlowChar="\\",r=t(e,n)),n.vxIndentRq=r),i},tokenBase:function(e,r){var i=0,a=!1,o=/[\[\]=:]/,l={"**":"variable-2","*":"variable-2",$$:"variable",$:"variable","^^":"attribute","^":"attribute"},s=e.peek(),c=r.svxCurCtlFlowChar;return 1==r.vxCodeActive&&(/[\[\]{}\(\);\:]/.test(s)?(a="meta",e.next()):"/"==s?(e.next(),e.eat("/")?(e.skipToEnd(),a="comment",r.svxCurCtlFlowChar="S"):e.backUp(1)):"@"==s?(a=n[s],r.svxCurCtlFlowChar="@",e.next(),e.eatWhile(/[\w\$_]/)):e.match(/\b[mM]4+/,!0)?(e.skipTo("("),a="def",r.svxCurCtlFlowChar="M"):"!"==s&&e.sol()?(a="comment",e.next()):o.test(s)?(e.eatWhile(o),a="operator"):"#"==s?(r.svxCurCtlFlowChar=""==r.svxCurCtlFlowChar?s:r.svxCurCtlFlowChar,e.next(),e.eatWhile(/[+-]\d/),a="tag"):l.propertyIsEnumerable(s)?(a=l[s],r.svxCurCtlFlowChar=""==r.svxCurCtlFlowChar?"S":r.svxCurCtlFlowChar,e.next(),e.match(/[a-zA-Z_0-9]+/)):(a=n[s]||!1)&&(r.svxCurCtlFlowChar=""==r.svxCurCtlFlowChar?s:r.svxCurCtlFlowChar,e.next(),e.match(/[a-zA-Z_0-9]+/)),r.svxCurCtlFlowChar!=c&&(i=t(e,r),r.vxIndentRq=i)),a},token:function(e,t){1==t.vxCodeActive&&e.sol()&&""!=t.svxCurCtlFlowChar&&(t.svxPrevPrevCtlFlowChar=t.svxPrevCtlFlowChar,t.svxPrevCtlFlowChar=t.svxCurCtlFlowChar,t.svxCurCtlFlowChar="")},indent:function(e){return 1==e.vxCodeActive?e.vxIndentRq:-1},startState:function(e){e.svxCurCtlFlowChar="",e.svxPrevCtlFlowChar="",e.svxPrevPrevCtlFlowChar="",e.vxCodeActive=!0,e.vxIndentRq=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";function b(a,b){var d=2,e=-1,f=0,g=a.indentation();switch(b.tlvCurCtlFlowChar){case"\\":g=0;break;case"|":if("@"==b.tlvPrevPrevCtlFlowChar){f=-2;break}c[b.tlvPrevCtlFlowChar]&&(f=1);break;case"M":if("@"==b.tlvPrevPrevCtlFlowChar){f=-2;break}c[b.tlvPrevCtlFlowChar]&&(f=1);break;case"@":"S"==b.tlvPrevCtlFlowChar&&(f=-1),"|"==b.tlvPrevCtlFlowChar&&(f=1);break;case"S":"@"==b.tlvPrevCtlFlowChar&&(f=1),c[b.tlvPrevCtlFlowChar]&&(f=1)}var h=d;return e=g+f*h,e>=0?e:g}a.defineMode("verilog",function(b,c){function d(a){for(var b={},c=a.split(" "),d=0;d=0)return d}var f=b.context,g=c&&c.charAt(0);"statement"==f.type&&"}"==g&&(f=f.prev);var h=!1,i=c.match(D);return i&&(h=k(i[0],f.type)),"statement"==f.type?f.indented+("{"==g?0:p):E.test(f.type)&&f.align&&!q?f.column+(h?0:1):")"!=f.type||h?f.indented+(h?0:o):f.indented+p},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),a.defineMIME("text/x-verilog",{name:"verilog"}),a.defineMIME("text/x-systemverilog",{name:"verilog"});var c={">":"property","->":"property","-":"hr","|":"link","?$":"qualifier","?*":"qualifier","@-":"variable-3","@":"variable-3","?":"qualifier"};a.defineMIME("text/x-tlv",{name:"verilog",hooks:{"\\":function(a,c){var d=0,e=!1,f=a.string;return a.sol()&&(/\\SV/.test(a.string)||/\\TLV/.test(a.string))&&(f=/\\TLV_version/.test(a.string)?"\\TLV_version":a.string,a.skipToEnd(),"\\SV"==f&&c.vxCodeActive&&(c.vxCodeActive=!1),(/\\TLV/.test(f)&&!c.vxCodeActive||"\\TLV_version"==f&&c.vxCodeActive)&&(c.vxCodeActive=!0),e="keyword",c.tlvCurCtlFlowChar=c.tlvPrevPrevCtlFlowChar=c.tlvPrevCtlFlowChar="",1==c.vxCodeActive&&(c.tlvCurCtlFlowChar="\\",d=b(a,c)),c.vxIndentRq=d),e},tokenBase:function(a,d){var e=0,f=!1,g=/[\[\]=:]/,h={"**":"variable-2","*":"variable-2",$$:"variable",$:"variable","^^":"attribute","^":"attribute"},i=a.peek(),j=d.tlvCurCtlFlowChar;return 1==d.vxCodeActive&&(/[\[\]{}\(\);\:]/.test(i)?(f="meta",a.next()):"/"==i?(a.next(),a.eat("/")?(a.skipToEnd(),f="comment",d.tlvCurCtlFlowChar="S"):a.backUp(1)):"@"==i?(f=c[i],d.tlvCurCtlFlowChar="@",a.next(),a.eatWhile(/[\w\$_]/)):a.match(/\b[mM]4+/,!0)?(a.skipTo("("),f="def",d.tlvCurCtlFlowChar="M"):"!"==i&&a.sol()?(f="comment",a.next()):g.test(i)?(a.eatWhile(g),f="operator"):"#"==i?(d.tlvCurCtlFlowChar=""==d.tlvCurCtlFlowChar?i:d.tlvCurCtlFlowChar,a.next(),a.eatWhile(/[+-]\d/),f="tag"):h.propertyIsEnumerable(i)?(f=h[i],d.tlvCurCtlFlowChar=""==d.tlvCurCtlFlowChar?"S":d.tlvCurCtlFlowChar,a.next(),a.match(/[a-zA-Z_0-9]+/)):(f=c[i]||!1)&&(d.tlvCurCtlFlowChar=""==d.tlvCurCtlFlowChar?i:d.tlvCurCtlFlowChar,a.next(),a.match(/[a-zA-Z_0-9]+/)),d.tlvCurCtlFlowChar!=j&&(e=b(a,d),d.vxIndentRq=e)),f},token:function(a,b){1==b.vxCodeActive&&a.sol()&&""!=b.tlvCurCtlFlowChar&&(b.tlvPrevPrevCtlFlowChar=b.tlvPrevCtlFlowChar,b.tlvPrevCtlFlowChar=b.tlvCurCtlFlowChar,b.tlvCurCtlFlowChar="")},indent:function(a){return 1==a.vxCodeActive?a.vxIndentRq:-1},startState:function(a){a.tlvCurCtlFlowChar="",a.tlvPrevCtlFlowChar="",a.tlvPrevPrevCtlFlowChar="",a.vxCodeActive=!0,a.vxIndentRq=0}}})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/xml/test.js b/media/editors/codemirror/mode/xml/test.js -deleted file mode 100644 -index f48156b..0000000 ---- a/media/editors/codemirror/mode/xml/test.js -+++ /dev/null -@@ -1,51 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --(function() { -- var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } -- -- MT("matching", -- "[tag&bracket <][tag top][tag&bracket >]", -- " text", -- " [tag&bracket <][tag inner][tag&bracket />]", -- "[tag&bracket ]"); -- -- MT("nonmatching", -- "[tag&bracket <][tag top][tag&bracket >]", -- " [tag&bracket <][tag inner][tag&bracket />]", -- " [tag&bracket ]"); -- -- MT("doctype", -- "[meta ]", -- "[tag&bracket <][tag top][tag&bracket />]"); -- -- MT("cdata", -- "[tag&bracket <][tag top][tag&bracket >]", -- " [atom ]", -- "[tag&bracket ]"); -- -- // HTML tests -- mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); -- -- MT("selfclose", -- "[tag&bracket <][tag html][tag&bracket >]", -- " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", -- "[tag&bracket ]"); -- -- MT("list", -- "[tag&bracket <][tag ol][tag&bracket >]", -- " [tag&bracket <][tag li][tag&bracket >]one", -- " [tag&bracket <][tag li][tag&bracket >]two", -- "[tag&bracket ]"); -- -- MT("valueless", -- "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); -- -- MT("pThenArticle", -- "[tag&bracket <][tag p][tag&bracket >]", -- " foo", -- "[tag&bracket <][tag article][tag&bracket >]bar"); -- --})(); -diff --git a/media/editors/codemirror/mode/xml/test.min.js b/media/editors/codemirror/mode/xml/test.min.js -deleted file mode 100644 -index 6fe19d3..0000000 ---- a/media/editors/codemirror/mode/xml/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function t(t){test.mode(t,a,Array.prototype.slice.call(arguments,1),e)}var a=CodeMirror.getMode({indentUnit:2},"xml"),e="xml";t("matching","[tag&bracket <][tag top][tag&bracket >]"," text"," [tag&bracket <][tag inner][tag&bracket />]","[tag&bracket ]"),t("nonmatching","[tag&bracket <][tag top][tag&bracket >]"," [tag&bracket <][tag inner][tag&bracket />]"," [tag&bracket ]"),t("doctype","[meta ]","[tag&bracket <][tag top][tag&bracket />]"),t("cdata","[tag&bracket <][tag top][tag&bracket >]"," [atom ]","[tag&bracket ]"),a=CodeMirror.getMode({indentUnit:2},"text/html"),t("selfclose","[tag&bracket <][tag html][tag&bracket >]",' [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string "/foobar"][tag&bracket >]',"[tag&bracket ]"),t("list","[tag&bracket <][tag ol][tag&bracket >]"," [tag&bracket <][tag li][tag&bracket >]one"," [tag&bracket <][tag li][tag&bracket >]two","[tag&bracket ]"),t("valueless","[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"),t("pThenArticle","[tag&bracket <][tag p][tag&bracket >]"," foo","[tag&bracket <][tag article][tag&bracket >]bar")}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/xml/xml.min.js b/media/editors/codemirror/mode/xml/xml.min.js -index fd99f66..8d92fba 100644 ---- a/media/editors/codemirror/mode/xml/xml.min.js -+++ b/media/editors/codemirror/mode/xml/xml.min.js -@@ -1 +1 @@ --!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}(function(t){"use strict";t.defineMode("xml",function(e,n){function r(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();if("<"==r)return t.eat("!")?t.eat("[")?t.match("CDATA[")?n(i("atom","]]>")):null:t.match("--")?n(i("comment","-->")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(l(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=i("meta","?>"),"meta"):(z=t.eat("/")?"closeTag":"openTag",e.tokenize=o,"tag bracket");if("&"==r){var a;return a=t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"),a?"atom":"error"}return t.eatWhile(/[^&<]/),null}function o(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=r,z=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return z="equals",null;if("<"==n){e.tokenize=r,e.state=f,e.tagName=e.tagStart=null;var o=e.tokenize(t,e);return o?o+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=a(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=o;break}return"string"};return e.isInAttribute=!0,e}function i(t,e){return function(n,o){for(;!n.eol();){if(n.match(e)){o.tokenize=r;break}n.next()}return t}}function l(t){return function(e,n){for(var o;null!=(o=e.next());){if("<"==o)return n.tokenize=l(t+1),n.tokenize(e,n);if(">"==o){if(1==t){n.tokenize=r;break}return n.tokenize=l(t-1),n.tokenize(e,n)}}return"meta"}}function u(t,e,n){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=n,(T.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function d(t){t.context&&(t.context=t.context.prev)}function c(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!T.contextGrabbers.hasOwnProperty(n)||!T.contextGrabbers[n].hasOwnProperty(e))return;d(t)}}function f(t,e,n){return"openTag"==t?(n.tagStart=e.column(),s):"closeTag"==t?m:f}function s(t,e,n){return"word"==t?(n.tagName=e.current(),N="tag",h):(N="error",s)}function m(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&T.implicitlyClosed.hasOwnProperty(n.context.tagName)&&d(n),n.context&&n.context.tagName==r?(N="tag",g):(N="tag error",p)}return N="error",p}function g(t,e,n){return"endTag"!=t?(N="error",g):(d(n),f)}function p(t,e,n){return N="error",g(t,e,n)}function h(t,e,n){if("word"==t)return N="attribute",x;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||T.autoSelfClosers.hasOwnProperty(r)?c(n,r):(c(n,r),n.context=new u(n,r,o==n.indented)),f}return N="error",h}function x(t,e,n){return"equals"==t?b:(T.allowMissing||(N="error"),h(t,e,n))}function b(t,e,n){return"string"==t?k:"word"==t&&T.allowUnquoted?(N="string",h):(N="error",h(t,e,n))}function k(t,e,n){return"string"==t?k:h(t,e,n)}var w=e.indentUnit,v=n.multilineTagIndentFactor||1,y=n.multilineTagIndentPastTag;null==y&&(y=!0);var z,N,T=n.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},C=n.alignCDATA;return{startState:function(){return{tokenize:r,state:f,indented:0,tagName:null,tagStart:null,context:null}},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;z=null;var n=e.tokenize(t,e);return(n||z)&&"comment"!=n&&(N=null,e.state=e.state(z||n,t,e),N&&(n="error"==N?n+" error":N)),n},indent:function(e,n,a){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+w;if(i&&i.noIndent)return t.Pass;if(e.tokenize!=o&&e.tokenize!=r)return a?a.match(/^(\s*)/)[0].length:0;if(e.tagName)return y?e.tagStart+e.tagName.length+2:e.tagStart+w*v;if(C&&/$/,blockCommentStart:"",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml"}}),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!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("xml",function(b,c){function d(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if("<"==d)return a.eat("!")?a.eat("[")?a.match("CDATA[")?c(g("atom","]]>")):null:a.match("--")?c(g("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(h(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=g("meta","?>"),"meta"):(x=a.eat("/")?"closeTag":"openTag",b.tokenize=e,"tag bracket");if("&"==d){var f;return f=a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),f?"atom":"error"}return a.eatWhile(/[^&<]/),null}function e(a,b){var c=a.next();if(">"==c||"/"==c&&a.eat(">"))return b.tokenize=d,x=">"==c?"endTag":"selfcloseTag","tag bracket";if("="==c)return x="equals",null;if("<"==c){b.tokenize=d,b.state=l,b.tagName=b.tagStart=null;var e=b.tokenize(a,b);return e?e+" tag error":"tag error"}return/[\'\"]/.test(c)?(b.tokenize=f(c),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(a){var b=function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=e;break}return"string"};return b.isInAttribute=!0,b}function g(a,b){return function(c,e){for(;!c.eol();){if(c.match(b)){e.tokenize=d;break}c.next()}return a}}function h(a){return function(b,c){for(var e;null!=(e=b.next());){if("<"==e)return c.tokenize=h(a+1),c.tokenize(b,c);if(">"==e){if(1==a){c.tokenize=d;break}return c.tokenize=h(a-1),c.tokenize(b,c)}}return"meta"}}function i(a,b,c){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=c,(z.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function j(a){a.context&&(a.context=a.context.prev)}function k(a,b){for(var c;;){if(!a.context)return;if(c=a.context.tagName,!z.contextGrabbers.hasOwnProperty(c)||!z.contextGrabbers[c].hasOwnProperty(b))return;j(a)}}function l(a,b,c){return"openTag"==a?(c.tagStart=b.column(),m):"closeTag"==a?n:l}function m(a,b,c){return"word"==a?(c.tagName=b.current(),y="tag",q):(y="error",m)}function n(a,b,c){if("word"==a){var d=b.current();return c.context&&c.context.tagName!=d&&z.implicitlyClosed.hasOwnProperty(c.context.tagName)&&j(c),c.context&&c.context.tagName==d?(y="tag",o):(y="tag error",p)}return y="error",p}function o(a,b,c){return"endTag"!=a?(y="error",o):(j(c),l)}function p(a,b,c){return y="error",o(a,b,c)}function q(a,b,c){if("word"==a)return y="attribute",r;if("endTag"==a||"selfcloseTag"==a){var d=c.tagName,e=c.tagStart;return c.tagName=c.tagStart=null,"selfcloseTag"==a||z.autoSelfClosers.hasOwnProperty(d)?k(c,d):(k(c,d),c.context=new i(c,d,e==c.indented)),l}return y="error",q}function r(a,b,c){return"equals"==a?s:(z.allowMissing||(y="error"),q(a,b,c))}function s(a,b,c){return"string"==a?t:"word"==a&&z.allowUnquoted?(y="string",q):(y="error",q(a,b,c))}function t(a,b,c){return"string"==a?t:q(a,b,c)}var u=b.indentUnit,v=c.multilineTagIndentFactor||1,w=c.multilineTagIndentPastTag;null==w&&(w=!0);var x,y,z=c.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},A=c.alignCDATA;return{startState:function(){return{tokenize:d,state:l,indented:0,tagName:null,tagStart:null,context:null}},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;x=null;var c=b.tokenize(a,b);return(c||x)&&"comment"!=c&&(y=null,b.state=b.state(x||c,a,b),y&&(c="error"==y?c+" error":y)),c},indent:function(b,c,f){var g=b.context;if(b.tokenize.isInAttribute)return b.tagStart==b.indented?b.stringStartCol+1:b.indented+u;if(g&&g.noIndent)return a.Pass;if(b.tokenize!=e&&b.tokenize!=d)return f?f.match(/^(\s*)/)[0].length:0;if(b.tagName)return w?b.tagStart+b.tagName.length+2:b.tagStart+u*v;if(A&&/$/,blockCommentStart:"",configuration:c.htmlMode?"html":"xml",helperType:c.htmlMode?"html":"xml"}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/xquery/test.js b/media/editors/codemirror/mode/xquery/test.js -deleted file mode 100644 -index 1f148cd..0000000 ---- a/media/editors/codemirror/mode/xquery/test.js -+++ /dev/null -@@ -1,67 +0,0 @@ --// CodeMirror, copyright (c) by Marijn Haverbeke and others --// Distributed under an MIT license: http://codemirror.net/LICENSE -- --// Don't take these too seriously -- the expected results appear to be --// based on the results of actual runs without any serious manual --// verification. If a change you made causes them to fail, the test is --// as likely to wrong as the code. -- --(function() { -- var mode = CodeMirror.getMode({tabSize: 4}, "xquery"); -- function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } -- -- MT("eviltest", -- "[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a \"comment\" :)]", -- " [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]", -- " [keyword let] [variable $joe][keyword :=][atom 1]", -- " [keyword return] [keyword element] [variable element] {", -- " [keyword attribute] [variable attribute] { [atom 1] },", -- " [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },", -- " [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],", -- " [keyword //][variable x] } [comment (: a more 'evil' test :)]", -- " [comment (: Modified Blakeley example (: with nested comment :) ... :)]", -- " [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]", -- " [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]", -- " [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]", -- " [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]", -- " [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]", -- " [keyword return] [keyword element] [variable element] {", -- " [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },", -- " [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },", -- " [keyword element] [variable text] { [keyword text] { [variable "text"] } },", -- " [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],", -- " [keyword //][variable fn:doc]", -- " }"); -- -- MT("testEmptySequenceKeyword", -- "[string \"foo\"] [keyword instance] [keyword of] [keyword empty-sequence]()"); -- -- MT("testMultiAttr", -- "[tag

    ][variable hello] [variable world][tag

    ]"); -- -- MT("test namespaced variable", -- "[keyword declare] [keyword namespace] [variable e] [keyword =] [string \"http://example.com/ANamespace\"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]"); -- -- MT("test EQName variable", -- "[keyword declare] [keyword variable] [variable $\"http://www.example.com/ns/my\":var] [keyword :=] [atom 12][variable ;]", -- "[tag ]{[variable $\"http://www.example.com/ns/my\":var]}[tag ]"); -- -- MT("test EQName function", -- "[keyword declare] [keyword function] [def&variable \"http://www.example.com/ns/my\":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", -- " [variable $a] [keyword +] [atom 2]", -- "}[variable ;]", -- "[tag ]{[def&variable \"http://www.example.com/ns/my\":fn]([atom 12])}[tag ]"); -- -- MT("test EQName function with single quotes", -- "[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {", -- " [variable $a] [keyword +] [atom 2]", -- "}[variable ;]", -- "[tag ]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag ]"); -- -- MT("testProcessingInstructions", -- "[def&variable data]([comment&meta ]) [keyword instance] [keyword of] [atom xs:string]"); -- -- MT("testQuoteEscapeDouble", -- "[keyword let] [variable $rootfolder] [keyword :=] [string \"c:\\builds\\winnt\\HEAD\\qa\\scripts\\\"]", -- "[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string \"keys\\\"])"); --})(); -diff --git a/media/editors/codemirror/mode/xquery/test.min.js b/media/editors/codemirror/mode/xquery/test.min.js -deleted file mode 100644 -index 9fa2f91..0000000 ---- a/media/editors/codemirror/mode/xquery/test.min.js -+++ /dev/null -@@ -1 +0,0 @@ --!function(){function e(e){test.mode(e,a,Array.prototype.slice.call(arguments,1))}var a=CodeMirror.getMode({tabSize:4},"xquery");e("eviltest",'[keyword xquery] [keyword version] [variable "1][keyword .][atom 0][keyword -][variable ml"][def&variable ;] [comment (: this is : a "comment" :)]'," [keyword let] [variable $let] [keyword :=] [variable <x] [variable attr][keyword =][variable "value">"test"<func>][def&variable ;function]() [variable $var] {[keyword function]()} {[variable $var]}[variable <][keyword /][variable func><][keyword /][variable x>]"," [keyword let] [variable $joe][keyword :=][atom 1]"," [keyword return] [keyword element] [variable element] {"," [keyword attribute] [variable attribute] { [atom 1] },"," [keyword element] [variable test] { [variable 'a'] }, [keyword attribute] [variable foo] { [variable "bar"] },"," [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],"," [keyword //][variable x] } [comment (: a more 'evil' test :)]"," [comment (: Modified Blakeley example (: with nested comment :) ... :)]"," [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]"," [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]"," [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]"," [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]"," [keyword let] [variable $let] [keyword :=] [variable <let>let] [variable $let] [keyword :=] [variable "let"<][keyword /let][variable >]"," [keyword return] [keyword element] [variable element] {"," [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },"," [keyword attribute] [variable fn:doc] { [variable "bar"] [variable castable] [keyword as] [atom xs:string] },"," [keyword element] [variable text] { [keyword text] { [variable "text"] } },"," [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],"," [keyword //][variable fn:doc]"," }"),e("testEmptySequenceKeyword",'[string "foo"] [keyword instance] [keyword of] [keyword empty-sequence]()'),e("testMultiAttr",'[tag

    ][variable hello] [variable world][tag

    ]'),e("test namespaced variable",'[keyword declare] [keyword namespace] [variable e] [keyword =] [string "http://example.com/ANamespace"][variable ;declare] [keyword variable] [variable $e:exampleComThisVarIsNotRecognized] [keyword as] [keyword element]([keyword *]) [variable external;]'),e("test EQName variable",'[keyword declare] [keyword variable] [variable $"http://www.example.com/ns/my":var] [keyword :=] [atom 12][variable ;]','[tag ]{[variable $"http://www.example.com/ns/my":var]}[tag ]'),e("test EQName function",'[keyword declare] [keyword function] [def&variable "http://www.example.com/ns/my":fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {'," [variable $a] [keyword +] [atom 2]","}[variable ;]",'[tag ]{[def&variable "http://www.example.com/ns/my":fn]([atom 12])}[tag ]'),e("test EQName function with single quotes","[keyword declare] [keyword function] [def&variable 'http://www.example.com/ns/my':fn] ([variable $a] [keyword as] [atom xs:integer]) [keyword as] [atom xs:integer] {"," [variable $a] [keyword +] [atom 2]","}[variable ;]","[tag ]{[def&variable 'http://www.example.com/ns/my':fn]([atom 12])}[tag ]"),e("testProcessingInstructions","[def&variable data]([comment&meta ]) [keyword instance] [keyword of] [atom xs:string]"),e("testQuoteEscapeDouble",'[keyword let] [variable $rootfolder] [keyword :=] [string "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"]','[keyword let] [variable $keysfolder] [keyword :=] [def&variable concat]([variable $rootfolder], [string "keys\\"])')}(); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/xquery/xquery.js b/media/editors/codemirror/mode/xquery/xquery.js -index c8f3d90..c642ee5 100644 ---- a/media/editors/codemirror/mode/xquery/xquery.js -+++ b/media/editors/codemirror/mode/xquery/xquery.js -@@ -68,15 +68,6 @@ CodeMirror.defineMode("xquery", function() { - return kwObj; - }(); - -- // Used as scratch variables to communicate multiple values without -- // consing up tons of objects. -- var type, content; -- -- function ret(tp, style, cont) { -- type = tp; content = cont; -- return style; -- } -- - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); -@@ -95,7 +86,7 @@ CodeMirror.defineMode("xquery", function() { - - if(stream.match("![CDATA", false)) { - state.tokenize = tokenCDATA; -- return ret("tag", "tag"); -+ return "tag"; - } - - if(stream.match("?", false)) { -@@ -112,28 +103,28 @@ CodeMirror.defineMode("xquery", function() { - // start code block - else if(ch == "{") { - pushStateStack(state,{ type: "codeblock"}); -- return ret("", null); -+ return null; - } - // end code block - else if(ch == "}") { - popStateStack(state); -- return ret("", null); -+ return null; - } - // if we're in an XML block - else if(isInXmlBlock(state)) { - if(ch == ">") -- return ret("tag", "tag"); -+ return "tag"; - else if(ch == "/" && stream.eat(">")) { - popStateStack(state); -- return ret("tag", "tag"); -+ return "tag"; - } - else -- return ret("word", "variable"); -+ return "variable"; - } - // if a number - else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/); -- return ret("number", "atom"); -+ return "atom"; - } - // comment start - else if (ch === "(" && stream.eat(":")) { -@@ -149,27 +140,27 @@ CodeMirror.defineMode("xquery", function() { - } - // assignment - else if(ch ===":" && stream.eat("=")) { -- return ret("operator", "keyword"); -+ return "keyword"; - } - // open paren - else if(ch === "(") { - pushStateStack(state, { type: "paren"}); -- return ret("", null); -+ return null; - } - // close paren - else if(ch === ")") { - popStateStack(state); -- return ret("", null); -+ return null; - } - // open paren - else if(ch === "[") { - pushStateStack(state, { type: "bracket"}); -- return ret("", null); -+ return null; - } - // close paren - else if(ch === "]") { - popStateStack(state); -- return ret("", null); -+ return null; - } - else { - var known = keywords.propertyIsEnumerable(ch) && keywords[ch]; -@@ -204,15 +195,14 @@ CodeMirror.defineMode("xquery", function() { - // if the previous word was element, attribute, axis specifier, this word should be the name of that - if(isInXmlConstructor(state)) { - popStateStack(state); -- return ret("word", "variable", word); -+ return "variable"; - } - // as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and - // push the stack so we know to look for it on the next word - if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"}); - - // if the word is known, return the details of that else just call this a generic 'word' -- return known ? ret(known.type, known.style, word) : -- ret("word", "variable", word); -+ return known ? known.style : "variable"; - } - } - -@@ -235,7 +225,7 @@ CodeMirror.defineMode("xquery", function() { - maybeNested = (ch == "("); - } - -- return ret("comment", "comment"); -+ return "comment"; - } - - // tokenizer for string literals -@@ -247,7 +237,7 @@ CodeMirror.defineMode("xquery", function() { - if(isInString(state) && stream.current() == quote) { - popStateStack(state); - if(f) state.tokenize = f; -- return ret("string", "string"); -+ return "string"; - } - - pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) }); -@@ -255,7 +245,7 @@ CodeMirror.defineMode("xquery", function() { - // if we're in a string and in an XML block, allow an embedded code block - if(stream.match("{", false) && isInXmlAttributeBlock(state)) { - state.tokenize = tokenBase; -- return ret("string", "string"); -+ return "string"; - } - - -@@ -269,13 +259,13 @@ CodeMirror.defineMode("xquery", function() { - // if we're in a string and in an XML block, allow an embedded code block in an attribute - if(stream.match("{", false) && isInXmlAttributeBlock(state)) { - state.tokenize = tokenBase; -- return ret("string", "string"); -+ return "string"; - } - - } - } - -- return ret("string", "string"); -+ return "string"; - }; - } - -@@ -293,7 +283,7 @@ CodeMirror.defineMode("xquery", function() { - } - stream.eatWhile(isVariableChar); - state.tokenize = tokenBase; -- return ret("variable", "variable"); -+ return "variable"; - } - - // tokenizer for XML tags -@@ -303,19 +293,19 @@ CodeMirror.defineMode("xquery", function() { - if(isclose && stream.eat(">")) { - popStateStack(state); - state.tokenize = tokenBase; -- return ret("tag", "tag"); -+ return "tag"; - } - // self closing tag without attributes? - if(!stream.eat("/")) - pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase}); - if(!stream.eat(">")) { - state.tokenize = tokenAttribute; -- return ret("tag", "tag"); -+ return "tag"; - } - else { - state.tokenize = tokenBase; - } -- return ret("tag", "tag"); -+ return "tag"; - }; - } - -@@ -326,14 +316,14 @@ CodeMirror.defineMode("xquery", function() { - if(ch == "/" && stream.eat(">")) { - if(isInXmlAttributeBlock(state)) popStateStack(state); - if(isInXmlBlock(state)) popStateStack(state); -- return ret("tag", "tag"); -+ return "tag"; - } - if(ch == ">") { - if(isInXmlAttributeBlock(state)) popStateStack(state); -- return ret("tag", "tag"); -+ return "tag"; - } - if(ch == "=") -- return ret("", null); -+ return null; - // quoted string - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch, tokenAttribute)); -@@ -351,7 +341,7 @@ CodeMirror.defineMode("xquery", function() { - state.tokenize = tokenBase; - } - -- return ret("attribute", "attribute"); -+ return "attribute"; - } - - // handle comments, including nested -@@ -360,7 +350,7 @@ CodeMirror.defineMode("xquery", function() { - while (ch = stream.next()) { - if (ch == "-" && stream.match("->", true)) { - state.tokenize = tokenBase; -- return ret("comment", "comment"); -+ return "comment"; - } - } - } -@@ -372,7 +362,7 @@ CodeMirror.defineMode("xquery", function() { - while (ch = stream.next()) { - if (ch == "]" && stream.match("]", true)) { - state.tokenize = tokenBase; -- return ret("comment", "comment"); -+ return "comment"; - } - } - } -@@ -383,7 +373,7 @@ CodeMirror.defineMode("xquery", function() { - while (ch = stream.next()) { - if (ch == "?" && stream.match(">", true)) { - state.tokenize = tokenBase; -- return ret("comment", "comment meta"); -+ return "comment meta"; - } - } - } -diff --git a/media/editors/codemirror/mode/xquery/xquery.min.js b/media/editors/codemirror/mode/xquery/xquery.min.js -index b5ee70cb..0332102 100644 ---- a/media/editors/codemirror/mode/xquery/xquery.min.js -+++ b/media/editors/codemirror/mode/xquery/xquery.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("xquery",function(){function e(e,t,n){return b=e,k=n,t}function t(e,t,n){return t.tokenize=n,n(e,t)}function n(n,c){var m=n.next(),p=!1,y=g(n);if("<"==m){if(n.match("!--",!0))return t(n,c,u);if(n.match("![CDATA",!1))return c.tokenize=s,e("tag","tag");if(n.match("?",!1))return t(n,c,f);var b=n.eat("/");n.eatSpace();for(var k,z="";k=n.eat(/[^\s\u00a0=<>\"\'\/?]/);)z+=k;return t(n,c,o(z,b))}if("{"==m)return h(c,{type:"codeblock"}),e("",null);if("}"==m)return x(c),e("",null);if(l(c))return">"==m?e("tag","tag"):"/"==m&&n.eat(">")?(x(c),e("tag","tag")):e("word","variable");if(/\d/.test(m))return n.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),e("number","atom");if("("===m&&n.eat(":"))return h(c,{type:"comment"}),t(n,c,r);if(y||'"'!==m&&"'"!==m){if("$"===m)return t(n,c,i);if(":"===m&&n.eat("="))return e("operator","keyword");if("("===m)return h(c,{type:"paren"}),e("",null);if(")"===m)return x(c),e("",null);if("["===m)return h(c,{type:"bracket"}),e("",null);if("]"===m)return x(c),e("",null);var w=v.propertyIsEnumerable(m)&&v[m];if(y&&'"'===m)for(;'"'!==n.next(););if(y&&"'"===m)for(;"'"!==n.next(););w||n.eatWhile(/[\w\$_-]/);var q=n.eat(":");!n.eat(":")&&q&&n.eatWhile(/[\w\$_-]/),n.match(/^[ \t]*\(/,!1)&&(p=!0);var _=n.current();return w=v.propertyIsEnumerable(_)&&v[_],p&&!w&&(w={type:"function_call",style:"variable def"}),d(c)?(x(c),e("word","variable",_)):(("element"==_||"attribute"==_||"axis_specifier"==w.type)&&h(c,{type:"xmlconstructor"}),w?e(w.type,w.style,_):e("word","variable",_))}return t(n,c,a(m))}function r(t,n){for(var r,a=!1,i=!1,o=0;r=t.next();){if(")"==r&&a){if(!(o>0)){x(n);break}o--}else":"==r&&i&&o++;a=":"==r,i="("==r}return e("comment","comment")}function a(t,r){return function(i,o){var c;if(p(o)&&i.current()==t)return x(o),r&&(o.tokenize=r),e("string","string");if(h(o,{type:"string",name:t,tokenize:a(t,r)}),i.match("{",!1)&&m(o))return o.tokenize=n,e("string","string");for(;c=i.next();){if(c==t){x(o),r&&(o.tokenize=r);break}if(i.match("{",!1)&&m(o))return o.tokenize=n,e("string","string")}return e("string","string")}}function i(t,r){var a=/[\w\$_-]/;if(t.eat('"')){for(;'"'!==t.next(););t.eat(":")}else t.eatWhile(a),t.match(":=",!1)||t.eat(":");return t.eatWhile(a),r.tokenize=n,e("variable","variable")}function o(t,r){return function(a,i){return a.eatSpace(),r&&a.eat(">")?(x(i),i.tokenize=n,e("tag","tag")):(a.eat("/")||h(i,{type:"tag",name:t,tokenize:n}),a.eat(">")?(i.tokenize=n,e("tag","tag")):(i.tokenize=c,e("tag","tag")))}}function c(r,i){var o=r.next();return"/"==o&&r.eat(">")?(m(i)&&x(i),l(i)&&x(i),e("tag","tag")):">"==o?(m(i)&&x(i),e("tag","tag")):"="==o?e("",null):'"'==o||"'"==o?t(r,i,a(o,c)):(m(i)||h(i,{type:"attribute",tokenize:c}),r.eat(/[a-zA-Z_:]/),r.eatWhile(/[-a-zA-Z0-9_:.]/),r.eatSpace(),(r.match(">",!1)||r.match("/",!1))&&(x(i),i.tokenize=n),e("attribute","attribute"))}function u(t,r){for(var a;a=t.next();)if("-"==a&&t.match("->",!0))return r.tokenize=n,e("comment","comment")}function s(t,r){for(var a;a=t.next();)if("]"==a&&t.match("]",!0))return r.tokenize=n,e("comment","comment")}function f(t,r){for(var a;a=t.next();)if("?"==a&&t.match(">",!0))return r.tokenize=n,e("comment","comment meta")}function l(e){return y(e,"tag")}function m(e){return y(e,"attribute")}function d(e){return y(e,"xmlconstructor")}function p(e){return y(e,"string")}function g(e){return'"'===e.current()?e.match(/^[^\"]+\"\:/,!1):"'"===e.current()?e.match(/^[^\"]+\'\:/,!1):!1}function y(e,t){return e.stack.length&&e.stack[e.stack.length-1].type==t}function h(e,t){e.stack.push(t)}function x(e){e.stack.pop();var t=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=t||n}var b,k,v=function(){function e(e){return{type:e,style:"keyword"}}for(var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),a=e("operator"),i={type:"atom",style:"atom"},o={type:"punctuation",style:null},c={type:"axis_specifier",style:"qualifier"},u={"if":t,"switch":t,"while":t,"for":t,"else":n,then:n,"try":n,"finally":n,"catch":n,element:r,attribute:r,let:r,"implements":r,"import":r,module:r,namespace:r,"return":r,"super":r,"this":r,"throws":r,where:r,"private":r,",":o,"null":i,"fn:false()":i,"fn:true()":i},s=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"],f=0,l=s.length;l>f;f++)u[s[f]]=e(s[f]);for(var m=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"],f=0,l=m.length;l>f;f++)u[m[f]]=i;for(var d=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"],f=0,l=d.length;l>f;f++)u[d[f]]=a;for(var p=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"],f=0,l=p.length;l>f;f++)u[p[f]]=c;return u}();return{startState:function(){return{tokenize:n,cc:[],stack:[]}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},blockCommentStart:"(:",blockCommentEnd:":)"}}),e.defineMIME("application/xquery","xquery")}); -\ 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("xquery",function(){function a(a,b,c){return b.tokenize=c,c(a,b)}function b(b,g){var l=b.next(),n=!1,p=o(b);if("<"==l){if(b.match("!--",!0))return a(b,g,h);if(b.match("![CDATA",!1))return g.tokenize=i,"tag";if(b.match("?",!1))return a(b,g,j);var t=b.eat("/");b.eatSpace();for(var u,v="";u=b.eat(/[^\s\u00a0=<>\"\'\/?]/);)v+=u;return a(b,g,f(v,t))}if("{"==l)return q(g,{type:"codeblock"}),null;if("}"==l)return r(g),null;if(k(g))return">"==l?"tag":"/"==l&&b.eat(">")?(r(g),"tag"):"variable";if(/\d/.test(l))return b.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),"atom";if("("===l&&b.eat(":"))return q(g,{type:"comment"}),a(b,g,c);if(p||'"'!==l&&"'"!==l){if("$"===l)return a(b,g,e);if(":"===l&&b.eat("="))return"keyword";if("("===l)return q(g,{type:"paren"}),null;if(")"===l)return r(g),null;if("["===l)return q(g,{type:"bracket"}),null;if("]"===l)return r(g),null;var w=s.propertyIsEnumerable(l)&&s[l];if(p&&'"'===l)for(;'"'!==b.next(););if(p&&"'"===l)for(;"'"!==b.next(););w||b.eatWhile(/[\w\$_-]/);var x=b.eat(":");!b.eat(":")&&x&&b.eatWhile(/[\w\$_-]/),b.match(/^[ \t]*\(/,!1)&&(n=!0);var y=b.current();return w=s.propertyIsEnumerable(y)&&s[y],n&&!w&&(w={type:"function_call",style:"variable def"}),m(g)?(r(g),"variable"):(("element"==y||"attribute"==y||"axis_specifier"==w.type)&&q(g,{type:"xmlconstructor"}),w?w.style:"variable")}return a(b,g,d(l))}function c(a,b){for(var c,d=!1,e=!1,f=0;c=a.next();){if(")"==c&&d){if(!(f>0)){r(b);break}f--}else":"==c&&e&&f++;d=":"==c,e="("==c}return"comment"}function d(a,c){return function(e,f){var g;if(n(f)&&e.current()==a)return r(f),c&&(f.tokenize=c),"string";if(q(f,{type:"string",name:a,tokenize:d(a,c)}),e.match("{",!1)&&l(f))return f.tokenize=b,"string";for(;g=e.next();){if(g==a){r(f),c&&(f.tokenize=c);break}if(e.match("{",!1)&&l(f))return f.tokenize=b,"string"}return"string"}}function e(a,c){var d=/[\w\$_-]/;if(a.eat('"')){for(;'"'!==a.next(););a.eat(":")}else a.eatWhile(d),a.match(":=",!1)||a.eat(":");return a.eatWhile(d),c.tokenize=b,"variable"}function f(a,c){return function(d,e){return d.eatSpace(),c&&d.eat(">")?(r(e),e.tokenize=b,"tag"):(d.eat("/")||q(e,{type:"tag",name:a,tokenize:b}),d.eat(">")?(e.tokenize=b,"tag"):(e.tokenize=g,"tag"))}}function g(c,e){var f=c.next();return"/"==f&&c.eat(">")?(l(e)&&r(e),k(e)&&r(e),"tag"):">"==f?(l(e)&&r(e),"tag"):"="==f?null:'"'==f||"'"==f?a(c,e,d(f,g)):(l(e)||q(e,{type:"attribute",tokenize:g}),c.eat(/[a-zA-Z_:]/),c.eatWhile(/[-a-zA-Z0-9_:.]/),c.eatSpace(),(c.match(">",!1)||c.match("/",!1))&&(r(e),e.tokenize=b),"attribute")}function h(a,c){for(var d;d=a.next();)if("-"==d&&a.match("->",!0))return c.tokenize=b,"comment"}function i(a,c){for(var d;d=a.next();)if("]"==d&&a.match("]",!0))return c.tokenize=b,"comment"}function j(a,c){for(var d;d=a.next();)if("?"==d&&a.match(">",!0))return c.tokenize=b,"comment meta"}function k(a){return p(a,"tag")}function l(a){return p(a,"attribute")}function m(a){return p(a,"xmlconstructor")}function n(a){return p(a,"string")}function o(a){return'"'===a.current()?a.match(/^[^\"]+\"\:/,!1):"'"===a.current()?a.match(/^[^\"]+\'\:/,!1):!1}function p(a,b){return a.stack.length&&a.stack[a.stack.length-1].type==b}function q(a,b){a.stack.push(b)}function r(a){a.stack.pop();var c=a.stack.length&&a.stack[a.stack.length-1].tokenize;a.tokenize=c||b}var s=function(){function a(a){return{type:a,style:"keyword"}}for(var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"atom"},g={type:"punctuation",style:null},h={type:"axis_specifier",style:"qualifier"},i={"if":b,"switch":b,"while":b,"for":b,"else":c,then:c,"try":c,"finally":c,"catch":c,element:d,attribute:d,let:d,"implements":d,"import":d,module:d,namespace:d,"return":d,"super":d,"this":d,"throws":d,where:d,"private":d,",":g,"null":f,"fn:false()":f,"fn:true()":f},j=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"],k=0,l=j.length;l>k;k++)i[j[k]]=a(j[k]);for(var m=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"],k=0,l=m.length;l>k;k++)i[m[k]]=f;for(var n=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"],k=0,l=n.length;l>k;k++)i[n[k]]=e;for(var o=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"],k=0,l=o.length;l>k;k++)i[o[k]]=h;return i}();return{startState:function(){return{tokenize:b,cc:[],stack:[]}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c},blockCommentStart:"(:",blockCommentEnd:":)"}}),a.defineMIME("application/xquery","xquery")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/yaml/yaml.min.js b/media/editors/codemirror/mode/yaml/yaml.min.js -index d435782..1d44a82 100644 ---- a/media/editors/codemirror/mode/yaml/yaml.min.js -+++ b/media/editors/codemirror/mode/yaml/yaml.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],i=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,t){var r=e.peek(),n=t.escaped;if(t.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(t.literal&&e.indentation()>t.keyCol)return e.skipToEnd(),"string";if(t.literal&&(t.literal=!1),e.sol()){if(t.keyCol=0,t.pair=!1,t.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?t.inlinePairs++:"}"==r?t.inlinePairs--:"["==r?t.inlineList++:t.inlineList--,"meta";if(t.inlineList>0&&!n&&","==r)return e.next(),"meta";if(t.inlinePairs>0&&!n&&","==r)return t.keyCol=0,t.pair=!1,t.pairStart=!1,e.next(),"meta";if(t.pairStart){if(e.match(/^\s*(\||\>)\s*/))return t.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==t.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(t.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(i))return"keyword"}return!t.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(t.pair=!0,t.keyCol=e.indentation(),"atom"):t.pair&&e.match(/^:\s*/)?(t.pairStart=!0,"meta"):(t.pairStart=!1,t.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}); -\ 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("yaml",function(){var a=["true","false","on","off","yes","no"],b=new RegExp("\\b(("+a.join(")|(")+"))$","i");return{token:function(a,c){var d=a.peek(),e=c.escaped;if(c.escaped=!1,"#"==d&&(0==a.pos||/\s/.test(a.string.charAt(a.pos-1))))return a.skipToEnd(),"comment";if(a.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(c.literal&&a.indentation()>c.keyCol)return a.skipToEnd(),"string";if(c.literal&&(c.literal=!1),a.sol()){if(c.keyCol=0,c.pair=!1,c.pairStart=!1,a.match(/---/))return"def";if(a.match(/\.\.\./))return"def";if(a.match(/\s*-\s+/))return"meta"}if(a.match(/^(\{|\}|\[|\])/))return"{"==d?c.inlinePairs++:"}"==d?c.inlinePairs--:"["==d?c.inlineList++:c.inlineList--,"meta";if(c.inlineList>0&&!e&&","==d)return a.next(),"meta";if(c.inlinePairs>0&&!e&&","==d)return c.keyCol=0,c.pair=!1,c.pairStart=!1,a.next(),"meta";if(c.pairStart){if(a.match(/^\s*(\||\>)\s*/))return c.literal=!0,"meta";if(a.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==c.inlinePairs&&a.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(c.inlinePairs>0&&a.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(a.match(b))return"keyword"}return!c.pair&&a.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(c.pair=!0,c.keyCol=a.indentation(),"atom"):c.pair&&a.match(/^:\s*/)?(c.pairStart=!0,"meta"):(c.pairStart=!1,c.escaped="\\"==d,a.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),a.defineMIME("text/x-yaml","yaml")}); -\ No newline at end of file -diff --git a/media/editors/codemirror/mode/z80/z80.js b/media/editors/codemirror/mode/z80/z80.js -index ec41d05..aae7021 100644 ---- a/media/editors/codemirror/mode/z80/z80.js -+++ b/media/editors/codemirror/mode/z80/z80.js -@@ -3,26 +3,35 @@ - - (function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS -- mod(require("../../lib/codemirror")); -+ mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD -- define(["../../lib/codemirror"], mod); -+ define(["../../lib/codemirror"], mod); - else // Plain browser env -- mod(CodeMirror); -+ mod(CodeMirror); - })(function(CodeMirror) { - "use strict"; - --CodeMirror.defineMode('z80', function() { -- var keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; -- var keywords2 = /^(call|j[pr]|ret[in]?)\b/i; -- var keywords3 = /^b_?(call|jump)\b/i; -+CodeMirror.defineMode('z80', function(_config, parserConfig) { -+ var ez80 = parserConfig.ez80; -+ var keywords1, keywords2; -+ if (ez80) { -+ keywords1 = /^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i; -+ keywords2 = /^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i; -+ } else { -+ keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; -+ keywords2 = /^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i; -+ } -+ - var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i; - var variables2 = /^(n?[zc]|p[oe]?|m)\b/i; - var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i; -- var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i; -+ var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i; - - return { - startState: function() { -- return {context: 0}; -+ return { -+ context: 0 -+ }; - }, - token: function(stream, state) { - if (!stream.column()) -@@ -34,14 +43,21 @@ CodeMirror.defineMode('z80', function() { - var w; - - if (stream.eatWhile(/\w/)) { -+ if (ez80 && stream.eat('.')) { -+ stream.eatWhile(/\w/); -+ } - w = stream.current(); - - if (stream.indentation()) { -- if (state.context == 1 && variables1.test(w)) -- return 'variable-2'; -+ if ((state.context == 1 || state.context == 4) && variables1.test(w)) { -+ state.context = 4; -+ return 'var2'; -+ } - -- if (state.context == 2 && variables2.test(w)) -- return 'variable-3'; -+ if (state.context == 2 && variables2.test(w)) { -+ state.context = 4; -+ return 'var3'; -+ } - - if (keywords1.test(w)) { - state.context = 1; -@@ -49,14 +65,13 @@ CodeMirror.defineMode('z80', function() { - } else if (keywords2.test(w)) { - state.context = 2; - return 'keyword'; -- } else if (keywords3.test(w)) { -- state.context = 3; -- return 'keyword'; -+ } else if (state.context == 4 && numbers.test(w)) { -+ return 'number'; - } - - if (errors.test(w)) - return 'error'; -- } else if (numbers.test(w)) { -+ } else if (stream.match(numbers)) { - return 'number'; - } else { - return null; -@@ -77,7 +92,7 @@ CodeMirror.defineMode('z80', function() { - if (stream.match(/\\?.'/)) - return 'number'; - } else if (stream.eat('.') || stream.sol() && stream.eat('#')) { -- state.context = 4; -+ state.context = 5; - - if (stream.eatWhile(/\w/)) - return 'def'; -@@ -96,5 +111,6 @@ CodeMirror.defineMode('z80', function() { - }); - - CodeMirror.defineMIME("text/x-z80", "z80"); -+CodeMirror.defineMIME("text/x-ez80", { name: "z80", ez80: true }); - - }); -diff --git a/media/editors/codemirror/mode/z80/z80.min.js b/media/editors/codemirror/mode/z80/z80.min.js -index 8c8b86c..d8eaea4 100644 ---- a/media/editors/codemirror/mode/z80/z80.min.js -+++ b/media/editors/codemirror/mode/z80/z80.min.js -@@ -1 +1 @@ --!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("z80",function(){var e=/^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i,t=/^(call|j[pr]|ret[in]?)\b/i,r=/^b_?(call|jump)\b/i,n=/^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i,i=/^(n?[zc]|p[oe]?|m)\b/i,o=/^([hl][xy]|i[xy][hl]|slia|sll)\b/i,l=/^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i;return{startState:function(){return{context:0}},token:function(f,u){if(f.column()||(u.context=0),f.eatSpace())return null;var c;if(f.eatWhile(/\w/)){if(c=f.current(),!f.indentation())return l.test(c)?"number":null;if(1==u.context&&n.test(c))return"variable-2";if(2==u.context&&i.test(c))return"variable-3";if(e.test(c))return u.context=1,"keyword";if(t.test(c))return u.context=2,"keyword";if(r.test(c))return u.context=3,"keyword";if(o.test(c))return"error"}else{if(f.eat(";"))return f.skipToEnd(),"comment";if(f.eat('"')){for(;(c=f.next())&&'"'!=c;)"\\"==c&&f.next();return"string"}if(f.eat("'")){if(f.match(/\\?.'/))return"number"}else if(f.eat(".")||f.sol()&&f.eat("#")){if(u.context=4,f.eatWhile(/\w/))return"def"}else if(f.eat("$")){if(f.eatWhile(/[\da-f]/i))return"number"}else if(f.eat("%")){if(f.eatWhile(/[01]/))return"number"}else f.next()}return null}}}),e.defineMIME("text/x-z80","z80")}); -\ 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("z80",function(a,b){var c,d,e=b.ez80;e?(c=/^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i,d=/^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i):(c=/^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i,d=/^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i);var f=/^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i,g=/^(n?[zc]|p[oe]?|m)\b/i,h=/^([hl][xy]|i[xy][hl]|slia|sll)\b/i,i=/^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i;return{startState:function(){return{context:0}},token:function(a,b){if(a.column()||(b.context=0),a.eatSpace())return null;var j;if(a.eatWhile(/\w/)){if(e&&a.eat(".")&&a.eatWhile(/\w/),j=a.current(),!a.indentation())return a.match(i)?"number":null;if((1==b.context||4==b.context)&&f.test(j))return b.context=4,"var2";if(2==b.context&&g.test(j))return b.context=4,"var3";if(c.test(j))return b.context=1,"keyword";if(d.test(j))return b.context=2,"keyword";if(4==b.context&&i.test(j))return"number";if(h.test(j))return"error"}else{if(a.eat(";"))return a.skipToEnd(),"comment";if(a.eat('"')){for(;(j=a.next())&&'"'!=j;)"\\"==j&&a.next();return"string"}if(a.eat("'")){if(a.match(/\\?.'/))return"number"}else if(a.eat(".")||a.sol()&&a.eat("#")){if(b.context=5,a.eatWhile(/\w/))return"def"}else if(a.eat("$")){if(a.eatWhile(/[\da-f]/i))return"number"}else if(a.eat("%")){if(a.eatWhile(/[01]/))return"number"}else a.next()}return null}}}),a.defineMIME("text/x-z80","z80"),a.defineMIME("text/x-ez80",{name:"z80",ez80:!0})}); -\ No newline at end of file -diff --git a/media/editors/codemirror/theme/liquibyte.css b/media/editors/codemirror/theme/liquibyte.css -new file mode 100644 -index 0000000..a6e070c ---- /dev/null -+++ b/media/editors/codemirror/theme/liquibyte.css -@@ -0,0 +1,95 @@ -+.cm-s-liquibyte.CodeMirror { -+ background-color: #000; -+ color: #fff; -+ line-height: 1.2em; -+ font-size: 1em; -+} -+.CodeMirror-focused .cm-matchhighlight { -+ text-decoration: underline; -+ text-decoration-color: #0f0; -+ text-decoration-style: wavy; -+} -+.cm-trailingspace { -+ text-decoration: line-through; -+ text-decoration-color: #f00; -+ text-decoration-style: dotted; -+} -+.cm-tab { -+ text-decoration: line-through; -+ text-decoration-color: #404040; -+ text-decoration-style: dotted; -+} -+.cm-s-liquibyte .CodeMirror-gutters { background-color: #262626; border-right: 1px solid #505050; padding-right: 0.8em; } -+.cm-s-liquibyte .CodeMirror-gutter-elt div{ font-size: 1.2em; } -+.cm-s-liquibyte .CodeMirror-guttermarker { } -+.cm-s-liquibyte .CodeMirror-guttermarker-subtle { } -+.cm-s-liquibyte .CodeMirror-linenumber { color: #606060; padding-left: 0;} -+.cm-s-liquibyte .CodeMirror-cursor { border-left: 1px solid #eee !important; } -+ -+.cm-s-liquibyte span.cm-comment { color: #008000; } -+.cm-s-liquibyte span.cm-def { color: #ffaf40; font-weight: bold; } -+.cm-s-liquibyte span.cm-keyword { color: #c080ff; font-weight: bold; } -+.cm-s-liquibyte span.cm-builtin { color: #ffaf40; font-weight: bold; } -+.cm-s-liquibyte span.cm-variable { color: #5967ff; font-weight: bold; } -+.cm-s-liquibyte span.cm-string { color: #ff8000; } -+.cm-s-liquibyte span.cm-number { color: #0f0; font-weight: bold; } -+.cm-s-liquibyte span.cm-atom { color: #bf3030; font-weight: bold; } -+ -+.cm-s-liquibyte span.cm-variable-2 { color: #007f7f; font-weight: bold; } -+.cm-s-liquibyte span.cm-variable-3 { color: #c080ff; font-weight: bold; } -+.cm-s-liquibyte span.cm-property { color: #999; font-weight: bold; } -+.cm-s-liquibyte span.cm-operator { color: #fff; } -+ -+.cm-s-liquibyte span.cm-meta { color: #0f0; } -+.cm-s-liquibyte span.cm-qualifier { color: #fff700; font-weight: bold; } -+.cm-s-liquibyte span.cm-bracket { color: #cc7; } -+.cm-s-liquibyte span.cm-tag { color: #ff0; font-weight: bold; } -+.cm-s-liquibyte span.cm-attribute { color: #c080ff; font-weight: bold; } -+.cm-s-liquibyte span.cm-error { color: #f00; } -+ -+.cm-s-liquibyte .CodeMirror-selected { background-color: rgba(255, 0, 0, 0.25) !important; } -+ -+.cm-s-liquibyte span.cm-compilation { background-color: rgba(255, 255, 255, 0.12); } -+ -+.cm-s-liquibyte .CodeMirror-activeline-background {background-color: rgba(0, 255, 0, 0.15) !important;} -+ -+/* Default styles for common addons */ -+div.CodeMirror span.CodeMirror-matchingbracket { color: #0f0; font-weight: bold; } -+div.CodeMirror span.CodeMirror-nonmatchingbracket { color: #f00; font-weight: bold; } -+.CodeMirror-matchingtag { background-color: rgba(150, 255, 0, .3); } -+/* Scrollbars */ -+/* Simple */ -+div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover { -+ background-color: rgba(80, 80, 80, .7); -+} -+div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div { -+ background-color: rgba(80, 80, 80, .3); -+ border: 1px solid #404040; -+ border-radius: 5px; -+} -+div.CodeMirror-simplescroll-vertical div { -+ border-top: 1px solid #404040; -+ border-bottom: 1px solid #404040; -+} -+div.CodeMirror-simplescroll-horizontal div { -+ border-left: 1px solid #404040; -+ border-right: 1px solid #404040; -+} -+div.CodeMirror-simplescroll-vertical { -+ background-color: #262626; -+} -+div.CodeMirror-simplescroll-horizontal { -+ background-color: #262626; -+ border-top: 1px solid #404040; -+} -+/* Overlay */ -+div.CodeMirror-overlayscroll-horizontal div, div.CodeMirror-overlayscroll-vertical div { -+ background-color: #404040; -+ border-radius: 5px; -+} -+div.CodeMirror-overlayscroll-vertical div { -+ border: 1px solid #404040; -+} -+div.CodeMirror-overlayscroll-horizontal div { -+ border: 1px solid #404040; -+} -diff --git a/media/editors/codemirror/theme/mdn-like.css b/media/editors/codemirror/theme/mdn-like.css -index 93293c0..9c73dc2 100644 ---- a/media/editors/codemirror/theme/mdn-like.css -+++ b/media/editors/codemirror/theme/mdn-like.css -@@ -13,7 +13,7 @@ - .cm-s-mdn-like.CodeMirror ::-moz-selection { background: #cfc; } - - .cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; } --.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; margin-left: 3px; } -+.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; padding-left: 8px; } - div.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; } - - .cm-s-mdn-like .cm-keyword { color: #6262FF; } -diff --git a/media/editors/codemirror/theme/monokai.css b/media/editors/codemirror/theme/monokai.css -index 6dfcc73..9b9a6f3 100644 ---- a/media/editors/codemirror/theme/monokai.css -+++ b/media/editors/codemirror/theme/monokai.css -@@ -18,8 +18,9 @@ - .cm-s-monokai span.cm-keyword {color: #f92672;} - .cm-s-monokai span.cm-string {color: #e6db74;} - --.cm-s-monokai span.cm-variable {color: #a6e22e;} -+.cm-s-monokai span.cm-variable {color: #f8f8f2;} - .cm-s-monokai span.cm-variable-2 {color: #9effff;} -+.cm-s-monokai span.cm-variable-3 {color: #66d9ef;} - .cm-s-monokai span.cm-def {color: #fd971f;} - .cm-s-monokai span.cm-bracket {color: #f8f8f2;} - .cm-s-monokai span.cm-tag {color: #f92672;} -diff --git a/media/editors/codemirror/theme/solarized.css b/media/editors/codemirror/theme/solarized.css -index 4a10b7c..9db3951 100644 ---- a/media/editors/codemirror/theme/solarized.css -+++ b/media/editors/codemirror/theme/solarized.css -@@ -53,7 +53,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png - .cm-s-solarized .cm-number { color: #d33682; } - .cm-s-solarized .cm-def { color: #2aa198; } - --.cm-s-solarized .cm-variable { color: #268bd2; } -+.cm-s-solarized .cm-variable { color: #839496; } - .cm-s-solarized .cm-variable-2 { color: #b58900; } - .cm-s-solarized .cm-variable-3 { color: #6c71c4; } - -diff --git a/media/editors/codemirror/theme/ttcn.css b/media/editors/codemirror/theme/ttcn.css -new file mode 100644 -index 0000000..959c047 ---- /dev/null -+++ b/media/editors/codemirror/theme/ttcn.css -@@ -0,0 +1,66 @@ -+/* DEFAULT THEME */ -+.cm-atom {color: #219;} -+.cm-attribute {color: #00c;} -+.cm-bracket {color: #997;} -+.cm-comment {color: #333333;} -+.cm-def {color: #00f;} -+.cm-em {font-style: italic;} -+.cm-error {color: #f00;} -+.cm-header {color: #00f; font-weight: bold;} -+.cm-hr {color: #999;} -+.cm-invalidchar {color: #f00;} -+.cm-keyword {font-weight:bold} -+.cm-link {color: #00c; text-decoration: underline;} -+.cm-meta {color: #555;} -+.cm-negative {color: #d44;} -+.cm-positive {color: #292;} -+.cm-qualifier {color: #555;} -+.cm-quote {color: #090;} -+.cm-strikethrough {text-decoration: line-through;} -+.cm-string {color: #006400;} -+.cm-string-2 {color: #f50;} -+.cm-strong {font-weight: bold;} -+.cm-tag {color: #170;} -+.cm-variable {color: #8B2252;} -+.cm-variable-2 {color: #05a;} -+.cm-variable-3 {color: #085;} -+ -+.cm-negative {color: #d44;} -+.cm-positive {color: #292;} -+.cm-header, .cm-strong {font-weight: bold;} -+.cm-em {font-style: italic;} -+.cm-link {text-decoration: underline;} -+.cm-strikethrough {text-decoration: line-through;} -+ -+.cm-s-default .cm-error {color: #f00;} -+.cm-invalidchar {color: #f00;} -+ -+/* ASN */ -+.cm-s-ttcn .cm-accessTypes, -+.cm-s-ttcn .cm-compareTypes {color: #27408B} -+.cm-s-ttcn .cm-cmipVerbs {color: #8B2252} -+.cm-s-ttcn .cm-modifier {color:#D2691E} -+.cm-s-ttcn .cm-status {color:#8B4545} -+.cm-s-ttcn .cm-storage {color:#A020F0} -+.cm-s-ttcn .cm-tags {color:#006400} -+ -+/* CFG */ -+.cm-s-ttcn .cm-externalCommands {color: #8B4545; font-weight:bold} -+.cm-s-ttcn .cm-fileNCtrlMaskOptions, -+.cm-s-ttcn .cm-sectionTitle {color: #2E8B57; font-weight:bold} -+ -+/* TTCN */ -+.cm-s-ttcn .cm-booleanConsts, -+.cm-s-ttcn .cm-otherConsts, -+.cm-s-ttcn .cm-verdictConsts {color: #006400} -+.cm-s-ttcn .cm-configOps, -+.cm-s-ttcn .cm-functionOps, -+.cm-s-ttcn .cm-portOps, -+.cm-s-ttcn .cm-sutOps, -+.cm-s-ttcn .cm-timerOps, -+.cm-s-ttcn .cm-verdictOps {color: #0000FF} -+.cm-s-ttcn .cm-preprocessor, -+.cm-s-ttcn .cm-templateMatch, -+.cm-s-ttcn .cm-ttcn3Macros {color: #27408B} -+.cm-s-ttcn .cm-types {color: #A52A2A; font-weight:bold} -+.cm-s-ttcn .cm-visibilityModifiers {font-weight:bold} -diff --git a/plugins/editors/codemirror/codemirror.xml b/plugins/editors/codemirror/codemirror.xml -index 366605f..1255d17 100644 ---- a/plugins/editors/codemirror/codemirror.xml -+++ b/plugins/editors/codemirror/codemirror.xml -@@ -1,7 +1,7 @@ - - - plg_editors_codemirror -- 5.0 -+ 5.3 - 28 March 2011 - Marijn Haverbeke - marijnh@gmail.com From 2937b7376980c8e79c0bdaef34f13fb8e64073b4 Mon Sep 17 00:00:00 2001 From: "Nicholas K. Dionysopoulos" Date: Sat, 30 May 2015 21:32:39 +0200 Subject: [PATCH 443/809] Update FOF to 2.4.3 --- administrator/manifests/libraries/fof.xml | 8 +- language/en-GB/en-GB.lib_fof.ini | 8 + libraries/fof/LICENSE.txt | 345 -- libraries/fof/database/installer.php | 18 + libraries/fof/download/adapter/cacert.pem | 3869 ----------------- libraries/fof/download/adapter/curl.php | 62 +- libraries/fof/download/adapter/fopen.php | 4 +- libraries/fof/form/field/model.php | 2 +- libraries/fof/form/field/tag.php | 2 +- libraries/fof/form/header/model.php | 2 +- libraries/fof/include.php | 2 +- libraries/fof/utils/array/array.php | 4 +- .../fof/utils/installscript/installscript.php | 70 + libraries/fof/version.txt | 4 +- 14 files changed, 170 insertions(+), 4230 deletions(-) create mode 100755 language/en-GB/en-GB.lib_fof.ini delete mode 100644 libraries/fof/LICENSE.txt delete mode 100644 libraries/fof/download/adapter/cacert.pem diff --git a/administrator/manifests/libraries/fof.xml b/administrator/manifests/libraries/fof.xml index 3af14cc251c1e..80dc1d82aa9e7 100644 --- a/administrator/manifests/libraries/fof.xml +++ b/administrator/manifests/libraries/fof.xml @@ -3,16 +3,20 @@ FOF fof LIB_FOF_XML_DESCRIPTION - 2015-03-11 11:59:00 + 2015-04-22 13:15:32 Nicholas K. Dionysopoulos / Akeeba Ltd nicholas@akeebabackup.com https://www.akeebabackup.com (C)2011-2015 Nicholas K. Dionysopoulos GNU GPLv2 or later - 2.4.2 + 2.4.3 Akeeba Ltd https://www.AkeebaBackup.com/download.html + + en-GB/en-GB.lib_fof.ini + + autoloader config diff --git a/language/en-GB/en-GB.lib_fof.ini b/language/en-GB/en-GB.lib_fof.ini new file mode 100755 index 0000000000000..1a87982aa050c --- /dev/null +++ b/language/en-GB/en-GB.lib_fof.ini @@ -0,0 +1,8 @@ +; @package FrameworkOnFramework +; @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved. +; @license GNU General Public License version 2, or later + +LIB_FOF_DOWNLOAD_ERR_COULDNOTDOWNLOADFROMURL="Could not download from %s" +LIB_FOF_DOWNLOAD_ERR_COULDNOTWRITELOCALFILE="Local file %s is not writeable" +LIB_FOF_DOWNLOAD_ERR_CURL_ERROR="The download failed: cURL error %s: %s" +LIB_FOF_DOWNLOAD_ERR_HTTPERROR="Unexpected HTTP status %s" \ No newline at end of file diff --git a/libraries/fof/LICENSE.txt b/libraries/fof/LICENSE.txt deleted file mode 100644 index 56e598d43901e..0000000000000 --- a/libraries/fof/LICENSE.txt +++ /dev/null @@ -1,345 +0,0 @@ -================================================================================ -Historical note -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -On February 21st, 2013 FOF changed its license to GPLv2 or later. -================================================================================ - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. \ No newline at end of file diff --git a/libraries/fof/database/installer.php b/libraries/fof/database/installer.php index 481d053abab41..b14ea25eecac7 100644 --- a/libraries/fof/database/installer.php +++ b/libraries/fof/database/installer.php @@ -336,6 +336,7 @@ protected function findSchemaXml() $driverType = $this->db->name; $xml = null; + // And now look for the file foreach ($this->xmlFiles as $baseName) { // Remove any accidental whitespace @@ -383,6 +384,7 @@ protected function findSchemaXml() /** @var SimpleXMLElement $drivers */ $drivers = $xml->meta->drivers; + // Strict driver name match foreach ($drivers->children() as $driverTypeTag) { $thisDriverType = (string)$driverTypeTag; @@ -393,6 +395,22 @@ protected function findSchemaXml() } } + // Some custom database drivers use a non-standard $name variable. Let try a relaxed match. + foreach ($drivers->children() as $driverTypeTag) + { + $thisDriverType = (string)$driverTypeTag; + + if ( + // e.g. $driverType = 'mysqlistupid', $thisDriverType = 'mysqli' => driver matched + strpos($driverType, $thisDriverType) === 0 + // e.g. $driverType = 'stupidmysqli', $thisDriverType = 'mysqli' => driver matched + || (substr($driverType, -strlen($thisDriverType)) == $thisDriverType) + ) + { + return $xml; + } + } + $xml = null; } diff --git a/libraries/fof/download/adapter/cacert.pem b/libraries/fof/download/adapter/cacert.pem deleted file mode 100644 index 1a0aa6d3d6c7f..0000000000000 --- a/libraries/fof/download/adapter/cacert.pem +++ /dev/null @@ -1,3869 +0,0 @@ -## -## Bundle of CA Root Certificates -## -## Certificate data from Mozilla downloaded on: Wed Aug 13 21:49:32 2014 -## -## This is a bundle of X.509 certificates of public Certificate Authorities -## (CA). These were automatically extracted from Mozilla's root certificates -## file (certdata.txt). This file can be found in the mozilla source tree: -## http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt -## -## It contains the certificates in PEM format and therefore -## can be directly used with curl / libcurl / php_curl, or with -## an Apache+mod_ssl webserver for SSL client authentication. -## Just configure this file as the SSLCACertificateFile. -## -## Conversion done with mk-ca-bundle.pl verison 1.22. -## SHA1: bf2c15b3019e696660321d2227d942936dc50aa7 -## - - -GTE CyberTrust Global Root -========================== ------BEGIN CERTIFICATE----- -MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg -Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG -A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz -MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL -Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0 -IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u -sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql -HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID -AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW -M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF -NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ ------END CERTIFICATE----- - -Thawte Server CA -================ ------BEGIN CERTIFICATE----- -MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT -DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs -dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE -AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j -b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV -BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u -c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG -A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0 -ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl -/Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7 -1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J -GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ -GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc= ------END CERTIFICATE----- - -Thawte Premium Server CA -======================== ------BEGIN CERTIFICATE----- -MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT -DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs -dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE -AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl -ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT -AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU -VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 -aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ -cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2 -aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh -Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/ -qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm -SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf -8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t -UCemDaYj+bvLpgcUQg== ------END CERTIFICATE----- - -Equifax Secure CA -================= ------BEGIN CERTIFICATE----- -MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE -ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 -MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT -B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB -nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR -fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW -8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG -A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE -CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG -A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS -spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB -Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961 -zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB -BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95 -70+sB3c4 ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 -f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol -hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA -TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah -WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf -Tqj/ZA1k ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority - G2 -============================================================ ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO -FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71 -lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB -MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT -1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD -Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9 ------END CERTIFICATE----- - -GlobalSign Root CA -================== ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx -GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds -b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV -BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD -VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa -DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc -THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb -Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP -c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX -gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF -AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj -Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG -j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH -hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC -X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== ------END CERTIFICATE----- - -GlobalSign Root CA - R2 -======================= ------BEGIN CERTIFICATE----- -MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv -YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh -bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT -aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln -bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 -ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp -s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN -S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL -TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C -ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E -FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i -YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN -BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp -9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu -01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 -9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 -TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== ------END CERTIFICATE----- - -ValiCert Class 1 VA -=================== ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp -b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh -bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIy -MjM0OFoXDTE5MDYyNTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 -d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEg -UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 -LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9YLqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIi -GQj4/xEjm84H9b9pGib+TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCm -DuJWBQ8YTfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0LBwG -lN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLWI8sogTLDAHkY7FkX -icnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPwnXS3qT6gpf+2SQMT2iLM7XGCK5nP -Orf1LXLI ------END CERTIFICATE----- - -ValiCert Class 2 VA -=================== ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp -b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh -bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw -MTk1NFoXDTE5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 -d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIg -UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 -LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDOOnHK5avIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVC -CSRrCl6zfN1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7Rf -ZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9vUJSZ -SWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTuIYEZoDJJKPTEjlbV -UjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8 -W9ViH0Pd ------END CERTIFICATE----- - -RSA Root Certificate 1 -====================== ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp -b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh -bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw -MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 -d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg -UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 -LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td -3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H -BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs -3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF -V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r -on+jjBXu ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 -EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc -cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw -EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj -055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f -j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC -/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 -xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa -t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== ------END CERTIFICATE----- - -Verisign Class 4 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS -tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM -8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW -Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX -Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt -mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm -fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd -RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG -UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== ------END CERTIFICATE----- - -Entrust.net Secure Server CA -============================ ------BEGIN CERTIFICATE----- -MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV -BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg -cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl -ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv -cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG -A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi -eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1p -dGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQ -aO2f55M28Qpku0f1BBc/I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5 -gXpa0zf3wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OCAdcw -ggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHboIHYpIHVMIHSMQsw -CQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5l -dC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF -bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENl -cnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu -dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0MFqBDzIwMTkw -NTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0Bow -HQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAaMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA -BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyN -Ewr75Ji174z4xRAN95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9 -n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= ------END CERTIFICATE----- - -Entrust.net Premium 2048 Secure Server CA -========================================= ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u -ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp -bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV -BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx -NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 -d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl -MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u -ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL -Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr -hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW -nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi -VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ -KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy -T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf -zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT -J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e -nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= ------END CERTIFICATE----- - -Baltimore CyberTrust Root -========================= ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE -ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li -ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC -SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs -dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME -uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB -UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C -G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 -XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr -l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI -VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB -BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh -cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 -hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa -Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H -RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp ------END CERTIFICATE----- - -Equifax Secure Global eBusiness CA -================================== ------BEGIN CERTIFICATE----- -MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp -bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx -HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds -b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV -PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN -qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn -hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j -BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs -MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN -I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY -NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV ------END CERTIFICATE----- - -Equifax Secure eBusiness CA 1 -============================= ------BEGIN CERTIFICATE----- -MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB -LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE -ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz -IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ -1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a -IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk -MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kW -Nl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRKeDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQF -AAOBgQB1W6ibAxHm6VZMzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5 -lSE/9dR+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN/Bf+ -KpYrtWKmpj29f5JZzVoqgrI3eQ== ------END CERTIFICATE----- - -AddTrust Low-Value Services Root -================================ ------BEGIN CERTIFICATE----- -MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU -cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw -CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO -ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6 -54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr -oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1 -Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui -GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w -HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD -AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT -RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw -HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt -ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph -iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY -eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr -mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj -ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= ------END CERTIFICATE----- - -AddTrust External Root -====================== ------BEGIN CERTIFICATE----- -MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD -VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw -NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU -cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg -Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 -+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw -Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo -aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy -2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 -7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P -BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL -VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk -VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB -IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl -j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 -6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 -e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u -G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= ------END CERTIFICATE----- - -AddTrust Public Services Root -============================= ------BEGIN CERTIFICATE----- -MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU -cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ -BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l -dHdvcmsxIDAeBgNVBAMTFOFkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu -nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i -d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG -Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw -HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G -A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB -/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux -FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G -A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4 -JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL -+YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao -GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9 -Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H -EufOX1362KqxMy3ZdvJOOjMMK7MtkAY= ------END CERTIFICATE----- - -AddTrust Qualified Certificates Root -==================================== ------BEGIN CERTIFICATE----- -MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU -cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx -CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ -IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx -64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3 -KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o -L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR -wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU -MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/ -BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE -BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y -azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD -ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG -GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X -dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze -RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB -iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE= ------END CERTIFICATE----- - -Entrust Root Certification Authority -==================================== ------BEGIN CERTIFICATE----- -MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV -BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw -b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG -A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 -MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu -MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu -Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v -dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz -A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww -Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 -j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN -rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw -DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 -MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH -hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA -A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM -Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa -v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS -W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 -tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 ------END CERTIFICATE----- - -RSA Security 2048 v3 -==================== ------BEGIN CERTIFICATE----- -MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK -ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy -MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb -BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7 -Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb -WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH -KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP -+Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/ -MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E -FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY -v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj -0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj -VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395 -nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA -pKnXwiJPZ9d37CAFYd4= ------END CERTIFICATE----- - -GeoTrust Global CA -================== ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK -Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw -MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j -LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo -BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet -8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc -T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU -vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD -AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk -DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q -zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 -d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 -mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p -XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm -Mw== ------END CERTIFICATE----- - -GeoTrust Global CA 2 -==================== ------BEGIN CERTIFICATE----- -MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN -R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw -MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j -LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/ -NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k -LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA -Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b -HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF -MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH -K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7 -srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh -ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL -OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC -x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF -H4z1Ir+rzoPz4iIprn2DQKi6bA== ------END CERTIFICATE----- - -GeoTrust Universal CA -===================== ------BEGIN CERTIFICATE----- -MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN -R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 -MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu -Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP -ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t -JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e -RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs -7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d -8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V -qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga -Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB -Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu -KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 -ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 -XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB -hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc -aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 -qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL -oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK -xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF -KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 -DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK -xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU -p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI -P/rmMuGNG2+k5o7Y+SlIis5z/iw= ------END CERTIFICATE----- - -GeoTrust Universal CA 2 -======================= ------BEGIN CERTIFICATE----- -MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN -R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 -MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg -SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 -DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17 -j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q -JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a -QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2 -WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP -20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn -ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC -SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG -8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2 -+/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E -BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z -dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ -4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ -mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq -A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg -Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP -pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d -FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp -gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm -X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS ------END CERTIFICATE----- - -America Online Root Certification Authority 1 -============================================= ------BEGIN CERTIFICATE----- -MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkG -A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg -T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lkhsmj76CG -v2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym1BW32J/X3HGrfpq/m44z -DyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsWOqMFf6Dch9Wc/HKpoH145LcxVR5lu9Rh -sCFg7RAycsWSJR74kEoYeEfffjA3PlAb2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP -8c9GsEsPPt2IYriMqQkoO3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0T -AQH/BAUwAwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAUAK3Z -o/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQB8itEf -GDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkFZu90821fnZmv9ov761KyBZiibyrF -VL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAbLjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft -3OJvx8Fi8eNy1gTIdGcL+oiroQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43g -Kd8hdIaC2y+CMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds -sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 ------END CERTIFICATE----- - -America Online Root Certification Authority 2 -============================================= ------BEGIN CERTIFICATE----- -MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG -A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg -T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en -fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8 -f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO -qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN -RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0 -gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn -6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEqZ8A9W6Wa6897Gqid -FEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZo2C7HK2JNDJiuEMhBnIMoVxtRsX6 -Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnj -B453cMor9H124HhnAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3Op -aaEg5+31IqEjFNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE -AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmnxPBUlgtk87FY -T15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2LHo1YGwRgJfMqZJS5ivmae2p -+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzcccobGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXg -JXUjhx5c3LqdsKyzadsXg8n33gy8CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//Zoy -zH1kUQ7rVyZ2OuMeIjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgO -ZtMADjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2FAjgQ5ANh -1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUXOm/9riW99XJZZLF0Kjhf -GEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPbAZO1XB4Y3WRayhgoPmMEEf0cjQAPuDff -Z4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQlZvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuP -cX/9XhmgD0uRuMRUvAawRY8mkaKO/qk= ------END CERTIFICATE----- - -Visa eCommerce Root -=================== ------BEGIN CERTIFICATE----- -MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG -EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug -QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2 -WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm -VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv -bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL -F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b -RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0 -TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI -/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs -GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG -MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc -CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW -YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz -zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu -YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt -398znM/jra6O1I7mT1GvFpLgXPYHDw== ------END CERTIFICATE----- - -Certum Root CA -============== ------BEGIN CERTIFICATE----- -MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK -ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla -Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u -by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x -wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL -kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ -89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K -Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P -NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq -hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+ -GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg -GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/ -0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS -qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== ------END CERTIFICATE----- - -Comodo AAA Services root -======================== ------BEGIN CERTIFICATE----- -MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS -R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg -TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw -MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl -c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV -BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG -C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs -i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW -Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH -Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK -Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f -BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl -cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz -LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm -7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz -Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z -8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C -12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== ------END CERTIFICATE----- - -Comodo Secure Services root -=========================== ------BEGIN CERTIFICATE----- -MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS -R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg -TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw -MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu -Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi -BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP -9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc -rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC -oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V -p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E -FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w -gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj -YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm -aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm -4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj -Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL -DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw -pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H -RR3B7Hzs/Sk= ------END CERTIFICATE----- - -Comodo Trusted Services root -============================ ------BEGIN CERTIFICATE----- -MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS -R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg -TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw -MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h -bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw -IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7 -3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y -/9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6 -juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS -ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud -DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB -/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp -ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl -cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw -uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 -pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA -BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l -R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O -9y5Xt5hwXsjEeLBi ------END CERTIFICATE----- - -QuoVadis Root CA -================ ------BEGIN CERTIFICATE----- -MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE -ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz -MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp -cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD -EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk -J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL -F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL -YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen -AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w -PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y -ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 -MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj -YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs -ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh -Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW -Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu -BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw -FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 -tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo -fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul -LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x -gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi -5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi -5nrQNiOKSnQ2+Q== ------END CERTIFICATE----- - -QuoVadis Root CA 2 -================== ------BEGIN CERTIFICATE----- -MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT -EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx -ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM -aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC -DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 -XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk -lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB -lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy -lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt -66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn -wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh -D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy -BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie -J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud -DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU -a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT -ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv -Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 -UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm -VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK -+JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW -IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 -WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X -f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II -4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 -VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u ------END CERTIFICATE----- - -QuoVadis Root CA 3 -================== ------BEGIN CERTIFICATE----- -MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT -EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx -OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM -aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC -DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg -DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij -KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K -DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv -BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp -p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 -nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX -MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM -Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz -uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT -BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj -YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 -aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB -BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD -VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 -ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE -AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV -qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s -hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z -POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 -Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp -8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC -bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu -g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p -vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr -qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= ------END CERTIFICATE----- - -Security Communication Root CA -============================== ------BEGIN CERTIFICATE----- -MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP -U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw -HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP -U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw -8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM -DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX -5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd -DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 -JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw -DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g -0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a -mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ -s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ -6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi -FL39vmwLAw== ------END CERTIFICATE----- - -Sonera Class 2 Root CA -====================== ------BEGIN CERTIFICATE----- -MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG -U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw -NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh -IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 -/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT -dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG -f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P -tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH -nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT -XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt -0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI -cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph -Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx -EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH -llpwrN9M ------END CERTIFICATE----- - -Staat der Nederlanden Root CA -============================= ------BEGIN CERTIFICATE----- -MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE -ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g -Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w -HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh -bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt -vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P -jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca -C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth -vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6 -22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV -HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v -dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN -BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR -EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw -MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y -nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR -iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== ------END CERTIFICATE----- - -TDC Internet Root CA -==================== ------BEGIN CERTIFICATE----- -MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJESzEVMBMGA1UE -ChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTAeFw0wMTA0MDUx -NjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNVBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJu -ZXQxHTAbBgNVBAsTFFREQyBJbnRlcm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAxLhAvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20j -xsNuZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a0vnRrEvL -znWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc14izbSysseLlJ28TQx5yc -5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGNeGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6 -otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcDR0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZI -AYb4QgEBBAQDAgAHMGUGA1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMM -VERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxMEQ1JM -MTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3WjALBgNVHQ8EBAMC -AQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAwHQYDVR0OBBYEFGxkAcf9hW2syNqe -UAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJKoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0G -CSqGSIb3DQEBBQUAA4IBAQBOQ8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540m -gwV5dOy0uaOXwTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+ -2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm899qNLPg7kbWzb -O0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0jUNAE4z9mQNUecYu6oah9jrU -Cbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38aQNiuJkFBT1reBK9sG9l ------END CERTIFICATE----- - -UTN DATACorp SGC Root CA -======================== ------BEGIN CERTIFICATE----- -MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE -BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl -IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ -BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa -MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w -HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy -dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys -raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo -wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA -9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv -33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud -DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9 -BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD -LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3 -DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft -Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0 -I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx -EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP -DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI ------END CERTIFICATE----- - -UTN USERFirst Hardware Root CA -============================== ------BEGIN CERTIFICATE----- -MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE -BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl -IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd -BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx -OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0 -eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz -ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI -wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd -tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8 -i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf -Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw -gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF -lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF -UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF -BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM -//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW -XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2 -lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn -iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 -nfhmqA== ------END CERTIFICATE----- - -Camerfirma Chambers of Commerce Root -==================================== ------BEGIN CERTIFICATE----- -MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe -QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i -ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx -NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp -cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn -MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC -AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU -xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH -NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW -DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV -d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud -EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v -cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P -AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh -bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD -VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz -aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi -fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD -L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN -UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n -ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 -erfutGWaIZDgqtCYvDi1czyL+Nw= ------END CERTIFICATE----- - -Camerfirma Global Chambersign Root -================================== ------BEGIN CERTIFICATE----- -MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe -QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i -ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx -NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt -YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg -MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw -ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J -1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O -by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl -6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c -8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/ -BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j -aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B -Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj -aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y -ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh -bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA -PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y -gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ -PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4 -IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes -t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== ------END CERTIFICATE----- - -NetLock Notary (Class A) Root -============================= ------BEGIN CERTIFICATE----- -MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI -EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 -dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j -ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX -DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH -EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD -VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz -cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM -D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ -z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC -/tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7 -tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6 -4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG -A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC -Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv -bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu -IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn -LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0 -ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz -IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh -IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu -b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh -bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg -Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp -bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5 -ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP -ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB -CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr -KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM -8CgHrTwXZoi1/baI ------END CERTIFICATE----- - -NetLock Business (Class B) Root -=============================== ------BEGIN CERTIFICATE----- -MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT -CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV -BAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQDEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikg -VGFudXNpdHZhbnlraWFkbzAeFw05OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYD -VQQGEwJIVTERMA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRv -bnNhZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5ldExvY2sg -VXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB -iQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xKgZjupNTKihe5In+DCnVMm8Bp2GQ5o+2S -o/1bXHQawEfKOml2mrriRBf8TKPV/riXiK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr -1nGTLbO/CVRY7QbrqHvcQ7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV -HQ8BAf8EBAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZ -RUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRh -dGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQuIEEgaGl0 -ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRv -c2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUg -YXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh -c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBz -Oi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6ZXNA -bmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhl -IHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2 -YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBj -cHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06sPgzTEdM -43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR -stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI ------END CERTIFICATE----- - -NetLock Express (Class C) Root -============================== ------BEGIN CERTIFICATE----- -MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT -CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV -BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD -KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ -BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 -dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMrTmV0TG9j -ayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzANBgkqhkiG9w0BAQEFAAOB -jQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNAOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3Z -W3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63 -euyucYT2BDMIJTLrdKwWRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQw -DgYDVR0PAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEWggJN -RklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0YWxhbm9zIFN6b2xn -YWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBB -IGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBOZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1i -aXp0b3NpdGFzYSB2ZWRpLiBBIGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0 -ZWxlIGF6IGVsb2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs -ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25sYXBqYW4gYSBo -dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kga2VyaGV0byBheiBlbGxlbm9y -emVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4gSU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5k -IHRoZSB1c2Ugb2YgdGhpcyBjZXJ0aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQ -UyBhdmFpbGFibGUgYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwg -YXQgY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmYta3UzbM2 -xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2gpO0u9f38vf5NNwgMvOOW -gyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4Fp1hBWeAyNDYpQcCNJgEjTME1A== ------END CERTIFICATE----- - -XRamp Global CA Root -==================== ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE -BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj -dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx -HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg -U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu -IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx -foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE -zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs -AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry -xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud -EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap -oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC -AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc -/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt -qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n -nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz -8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= ------END CERTIFICATE----- - -Go Daddy Class 2 CA -=================== ------BEGIN CERTIFICATE----- -MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY -VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG -A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g -RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD -ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv -2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 -qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j -YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY -vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O -BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o -atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu -MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG -A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim -PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt -I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ -HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI -Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b -vZ8= ------END CERTIFICATE----- - -Starfield Class 2 CA -==================== ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc -U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo -MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG -A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG -SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY -bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ -JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm -epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN -F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF -MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f -hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo -bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g -QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs -afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM -PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl -xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD -KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 -QBFGmh95DmK/D5fs4C8fF5Q= ------END CERTIFICATE----- - -StartCom Certification Authority -================================ ------BEGIN CERTIFICATE----- -MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN -U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu -ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 -NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk -LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg -U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw -ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y -o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ -Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d -eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt -2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z -6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ -osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ -untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc -UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT -37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE -FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0 -Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj -YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH -AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw -Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg -U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5 -LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl -cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh -cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT -dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC -AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh -3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm -vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk -fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3 -fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ -EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq -yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl -1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/ -lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro -g14= ------END CERTIFICATE----- - -Taiwan GRCA -=========== ------BEGIN CERTIFICATE----- -MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG -EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X -DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv -dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN -w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 -BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O -1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO -htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov -J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7 -Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t -B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB -O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8 -lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV -HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2 -09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ -TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj -Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2 -Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU -D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz -DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk -Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk -7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ -CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy -+fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS ------END CERTIFICATE----- - -Swisscom Root CA 1 -================== ------BEGIN CERTIFICATE----- -MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG -EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy -dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4 -MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln -aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC -IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM -MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF -NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe -AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC -b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn -7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN -cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp -WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5 -haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY -MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw -HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j -BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9 -MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn -jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ -MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H -VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl -vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl -OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3 -1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq -nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy -x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW -NY6E0F/6MBr1mmz0DlP5OlvRHA== ------END CERTIFICATE----- - -DigiCert Assured ID Root CA -=========================== ------BEGIN CERTIFICATE----- -MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw -IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx -MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL -ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO -9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy -UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW -/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy -oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf -GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF -66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq -hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc -EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn -SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i -8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe -+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== ------END CERTIFICATE----- - -DigiCert Global Root CA -======================= ------BEGIN CERTIFICATE----- -MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw -HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw -MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 -dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn -TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 -BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H -4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y -7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB -o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm -8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF -BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr -EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt -tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 -UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk -CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= ------END CERTIFICATE----- - -DigiCert High Assurance EV Root CA -================================== ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw -KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw -MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ -MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu -Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t -Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS -OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 -MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ -NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe -h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB -Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY -JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ -V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp -myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK -mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe -vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K ------END CERTIFICATE----- - -Certplus Class 2 Primary CA -=========================== ------BEGIN CERTIFICATE----- -MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE -BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN -OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy -dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR -5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ -Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO -YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e -e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME -CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ -YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t -L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD -P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R -TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+ -7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW -//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 -l7+ijrRU ------END CERTIFICATE----- - -DST Root CA X3 -============== ------BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK -ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X -DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 -cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT -rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 -UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy -xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d -utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T -AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ -MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug -dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE -GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw -RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS -fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ ------END CERTIFICATE----- - -DST ACES CA X6 -============== ------BEGIN CERTIFICATE----- -MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG -EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT -MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha -MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE -CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI -DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa -pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow -GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy -MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu -Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy -dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU -CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2 -5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t -Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq -nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs -vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 -oKfN5XozNmr6mis= ------END CERTIFICATE----- - -TURKTRUST Certificate Services Provider Root 1 -============================================== ------BEGIN CERTIFICATE----- -MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP -MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0 -acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx -MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg -U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB -TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC -aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX -yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i -Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ -8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4 -W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME -BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46 -sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE -q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy -B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY -nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H ------END CERTIFICATE----- - -TURKTRUST Certificate Services Provider Root 2 -============================================== ------BEGIN CERTIFICATE----- -MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP -MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg -QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN -MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr -dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G -A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls -acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe -LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI -x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g -QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr -5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB -AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G -A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt -Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 -Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+ -hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P -9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5 -UrbnBEI= ------END CERTIFICATE----- - -SwissSign Gold CA - G2 -====================== ------BEGIN CERTIFICATE----- -MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw -EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN -MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp -c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq -t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C -jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg -vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF -ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR -AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend -jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO -peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR -7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi -GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 -OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov -L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm -5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr -44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf -Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m -Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp -mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk -vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf -KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br -NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj -viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ ------END CERTIFICATE----- - -SwissSign Silver CA - G2 -======================== ------BEGIN CERTIFICATE----- -MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT -BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X -DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 -aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG -9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 -N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm -+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH -6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu -MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h -qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 -FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs -ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc -celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X -CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ -BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB -tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 -cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P -4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F -kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L -3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx -/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa -DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP -e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu -WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ -DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub -DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u ------END CERTIFICATE----- - -GeoTrust Primary Certification Authority -======================================== ------BEGIN CERTIFICATE----- -MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD -ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx -CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ -cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN -b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 -nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge -RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt -tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD -AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI -hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K -Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN -NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa -Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG -1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= ------END CERTIFICATE----- - -thawte Primary Root CA -====================== ------BEGIN CERTIFICATE----- -MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE -BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 -aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 -MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg -SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv -KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT -FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs -oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ -1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc -q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K -aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p -afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD -VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF -AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE -uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX -xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 -jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH -z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== ------END CERTIFICATE----- - -VeriSign Class 3 Public Primary Certification Authority - G5 -============================================================ ------BEGIN CERTIFICATE----- -MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO -ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk -IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln -biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh -dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz -j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD -Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ -Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r -fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ -BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv -Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy -aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG -SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ -X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE -KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC -Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE -ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq ------END CERTIFICATE----- - -SecureTrust CA -============== ------BEGIN CERTIFICATE----- -MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG -EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy -dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe -BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC -ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX -OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t -DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH -GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b -01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH -ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ -BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj -aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ -KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu -SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf -mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ -nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR -3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= ------END CERTIFICATE----- - -Secure Global CA -================ ------BEGIN CERTIFICATE----- -MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG -EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH -bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg -MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg -Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx -YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ -bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g -8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV -HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi -0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud -EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn -oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA -MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ -OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn -CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 -3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc -f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW ------END CERTIFICATE----- - -COMODO Certification Authority -============================== ------BEGIN CERTIFICATE----- -MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE -BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG -A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb -MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD -T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH -+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww -xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV -4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA -1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI -rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k -b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC -AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP -OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ -RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc -IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN -+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== ------END CERTIFICATE----- - -Network Solutions Certificate Authority -======================================= ------BEGIN CERTIFICATE----- -MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG -EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr -IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx -MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu -MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx -jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT -aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT -crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc -/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB -AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP -BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv -bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA -A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q -4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ -GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv -wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD -ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey ------END CERTIFICATE----- - -WellsSecure Public Root Certificate Authority -============================================= ------BEGIN CERTIFICATE----- -MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM -F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw -NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN -MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl -bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD -VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1 -iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13 -i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8 -bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB -K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB -AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu -cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm -lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB -i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww -GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg -Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI -K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0 -bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj -qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es -E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ -tylv2G0xffX8oRAHh84vWdw+WNs= ------END CERTIFICATE----- - -COMODO ECC Certification Authority -================================== ------BEGIN CERTIFICATE----- -MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC -R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE -ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix -GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR -Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo -b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X -4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni -wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG -FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA -U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= ------END CERTIFICATE----- - -IGC/A -===== ------BEGIN CERTIFICATE----- -MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD -VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE -Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy -MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI -EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT -STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2 -TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW -So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy -HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd -frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ -tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB -egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC -iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK -q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q -MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg -Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI -lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF -0mBWWg== ------END CERTIFICATE----- - -Security Communication EV RootCA1 -================================= ------BEGIN CERTIFICATE----- -MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc -U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh -dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE -BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl -Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO -/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX -WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z -ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4 -bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK -9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG -SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm -iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG -Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW -mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW -T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 ------END CERTIFICATE----- - -OISTE WISeKey Global Root GA CA -=============================== ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE -BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG -A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH -bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD -VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw -IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 -IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 -Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg -Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD -d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ -/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R -LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ -KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm -MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 -+vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa -hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY -okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= ------END CERTIFICATE----- - -Microsec e-Szigno Root CA -========================= ------BEGIN CERTIFICATE----- -MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE -BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL -EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0 -MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz -dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT -GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG -d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N -oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc -QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ -PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb -MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG -IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD -VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3 -LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A -dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn -AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA -4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg -AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA -egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6 -Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO -PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv -c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h -cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw -IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT -WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV -MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER -MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp -Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal -HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT -nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE -aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a -86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK -yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB -S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU= ------END CERTIFICATE----- - -Certigna -======== ------BEGIN CERTIFICATE----- -MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw -EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 -MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI -Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q -XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH -GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p -ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg -DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf -Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ -tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ -BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J -SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA -hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ -ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu -PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY -1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw -WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== ------END CERTIFICATE----- - -AC Ra\xC3\xADz Certic\xC3\xA1mara S.A. -====================================== ------BEGIN CERTIFICATE----- -MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYT -AkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRpZmljYWNpw7NuIERpZ2l0YWwg -LSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwaQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4w -HhcNMDYxMTI3MjA0NjI5WhcNMzAwNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+ -U29jaWVkYWQgQ2FtZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJh -IFMuQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeGqentLhM0R7LQcNzJPNCN -yu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzLfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU -2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU3 -4ojC2I+GdV75LaeHM/J4Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP -2yYe68yQ54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+bMMCm -8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48jilSH5L887uvDdUhf -HjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++EjYfDIJss2yKHzMI+ko6Kh3VOz3vCa -Mh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/ztA/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK -5lw1omdMEWux+IBkAC1vImHFrEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1b -czwmPS9KvqfJpxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE -AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCBlTCBkgYEVR0g -ADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFyYS5jb20vZHBjLzBaBggrBgEF -BQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW507WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2Ug -cHVlZGVuIGVuY29udHJhciBlbiBsYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEf -AygPU3zmpFmps4p6xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuX -EpBcunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/Jre7Ir5v -/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dpezy4ydV/NgIlqmjCMRW3 -MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42gzmRkBDI8ck1fj+404HGIGQatlDCIaR4 -3NAvO2STdPCWkPHv+wlaNECW8DYSwaN0jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wk -eZBWN7PGKX6jD/EpOe9+XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f -/RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h -RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU -Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ== ------END CERTIFICATE----- - -TC TrustCenter Class 2 CA II -============================ ------BEGIN CERTIFICATE----- -MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy -IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw -MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 -c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE -AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw -IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2 -xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ -Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u -SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB -/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB -7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 -Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU -cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i -SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u -TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G -dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ -KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj -TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP -JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk -vQ== ------END CERTIFICATE----- - -TC TrustCenter Class 3 CA II -============================ ------BEGIN CERTIFICATE----- -MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy -IENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYw -MTEyMTQ0MTU3WhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 -c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UE -AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJWHt4bNwcwIi9v8Qbxq63W -yKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+QVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo -6SI7dYnWRBpl8huXJh0obazovVkdKyT21oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZ -uV3bOx4a+9P/FRQI2AlqukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk -2ZyqBwi1Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1UdEwEB -/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NXXAek0CSnwPIA1DCB -7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 -Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU -cnVzdENlbnRlciUyMENsYXNzJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i -SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u -TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE -O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8 -yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9 -IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal -092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc -5A== ------END CERTIFICATE----- - -TC TrustCenter Universal CA I -============================= ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy -IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN -MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg -VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw -JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC -qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv -xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw -ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O -gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j -BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG -1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy -vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3 -ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT -ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a -7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY ------END CERTIFICATE----- - -Deutsche Telekom Root CA 2 -========================== ------BEGIN CERTIFICATE----- -MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT -RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG -A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 -MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G -A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS -b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 -bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI -KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY -AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK -Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV -jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV -HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr -E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy -zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 -rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G -dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU -Cm26OWMohpLzGITY+9HPBVZkVw== ------END CERTIFICATE----- - -ComSign Secured CA -================== ------BEGIN CERTIFICATE----- -MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE -AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w -NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD -QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs -49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH -7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB -kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1 -9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw -AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t -U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA -j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC -AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a -BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp -FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP -51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz -OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== ------END CERTIFICATE----- - -Cybertrust Global Root -====================== ------BEGIN CERTIFICATE----- -MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li -ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 -MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD -ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA -+Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW -0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL -AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin -89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT -8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP -BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 -MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G -A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO -lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi -5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 -hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T -X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW -WL1WMRJOEcgh4LMRkWXbtKaIOM5V ------END CERTIFICATE----- - -ePKI Root Certification Authority -================================= ------BEGIN CERTIFICATE----- -MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG -EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg -Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx -MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq -MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs -IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi -lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv -qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX -12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O -WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ -ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao -lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ -vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi -Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi -MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH -ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 -1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq -KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV -xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP -NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r -GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE -xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx -gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy -sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD -BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= ------END CERTIFICATE----- - -T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 -============================================================================================================================= ------BEGIN CERTIFICATE----- -MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH -DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q -aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry -b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV -BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg -S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4 -MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl -IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF -n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl -IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft -dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl -cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO -Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1 -xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR -6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL -hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd -BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF -MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4 -N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT -y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh -LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M -dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI= ------END CERTIFICATE----- - -Buypass Class 2 CA 1 -==================== ------BEGIN CERTIFICATE----- -MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU -QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2 -MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh -c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M -cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83 -0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4 -0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R -uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P -AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV -1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt -7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2 -fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w -wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho ------END CERTIFICATE----- - -Buypass Class 3 CA 1 -==================== ------BEGIN CERTIFICATE----- -MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU -QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1 -MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh -c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx -ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0 -n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia -AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c -1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P -AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7 -pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA -EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5 -htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj -el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 ------END CERTIFICATE----- - -EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 -========================================================================== ------BEGIN CERTIFICATE----- -MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg -QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe -Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p -ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt -IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG -SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by -X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b -gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr -eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ -TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy -Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn -uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI -qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm -ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0 -Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB -/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW -Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t -FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm -zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k -XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT -bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU -RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK -1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt -2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ -Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9 -AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT ------END CERTIFICATE----- - -certSIGN ROOT CA -================ ------BEGIN CERTIFICATE----- -MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD -VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa -Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE -CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I -JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH -rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 -ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD -0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 -AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B -Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB -AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 -SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 -x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt -vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz -TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD ------END CERTIFICATE----- - -CNNIC ROOT -========== ------BEGIN CERTIFICATE----- -MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE -ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw -OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD -o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz -VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT -VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or -czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK -y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC -wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S -lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5 -Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM -O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8 -BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2 -G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m -mxE= ------END CERTIFICATE----- - -ApplicationCA - Japanese Government -=================================== ------BEGIN CERTIFICATE----- -MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT -SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw -MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl -cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4 -fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN -wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE -jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu -nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU -WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV -BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD -vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs -o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g -/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD -io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW -dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL -rosot4LKGAfmt1t06SAZf7IbiVQ= ------END CERTIFICATE----- - -GeoTrust Primary Certification Authority - G3 -============================================= ------BEGIN CERTIFICATE----- -MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE -BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 -IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz -NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo -YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT -LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j -K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE -c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C -IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu -dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr -2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 -cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE -Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD -AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s -t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt ------END CERTIFICATE----- - -thawte Primary Root CA - G2 -=========================== ------BEGIN CERTIFICATE----- -MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC -VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu -IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg -Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV -MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG -b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt -IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS -LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 -8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU -mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN -G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K -rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== ------END CERTIFICATE----- - -thawte Primary Root CA - G3 -=========================== ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE -BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 -aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w -ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh -d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD -VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG -A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At -P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC -+BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY -7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW -vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ -KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK -A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu -t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC -8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm -er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= ------END CERTIFICATE----- - -GeoTrust Primary Certification Authority - G2 -============================================= ------BEGIN CERTIFICATE----- -MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC -VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu -Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD -ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 -OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg -MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl -b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG -BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc -KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD -VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ -EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m -ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 -npaqBA+K ------END CERTIFICATE----- - -VeriSign Universal Root Certification Authority -=============================================== ------BEGIN CERTIFICATE----- -MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO -ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk -IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u -IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj -1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP -MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 -9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I -AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR -tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G -CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O -a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud -DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 -Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx -Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx -P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P -wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 -mJO37M2CYfE45k+XmCpajQ== ------END CERTIFICATE----- - -VeriSign Class 3 Public Primary Certification Authority - G4 -============================================================ ------BEGIN CERTIFICATE----- -MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC -VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 -b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz -ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU -cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo -b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 -Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz -rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB -/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw -HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u -Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD -A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx -AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== ------END CERTIFICATE----- - -NetLock Arany (Class Gold) Főtanúsítvány -============================================ ------BEGIN CERTIFICATE----- -MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G -A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 -dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB -cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx -MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO -ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 -c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu -0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw -/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk -H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw -fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 -neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB -BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW -qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta -YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC -bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna -NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu -dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= ------END CERTIFICATE----- - -Staat der Nederlanden Root CA - G2 -================================== ------BEGIN CERTIFICATE----- -MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE -CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g -Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC -TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l -ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ -5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn -vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj -CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil -e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR -OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI -CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 -48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi -trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737 -qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB -AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC -ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV -HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA -A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz -+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj -f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN -kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk -CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF -URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb -CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h -oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV -IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm -66+KAQ== ------END CERTIFICATE----- - -CA Disig -======== ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK -QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw -MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz -bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm -GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD -Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo -hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt -ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w -gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P -AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz -aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff -ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa -BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t -WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3 -mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ -CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K -ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA -4Z7CRneC9VkGjCFMhwnN5ag= ------END CERTIFICATE----- - -Juur-SK -======= ------BEGIN CERTIFICATE----- -MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA -c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw -DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG -SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy -aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf -TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC -+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw -UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa -Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF -MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD -HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh -AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA -cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr -AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw -cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE -FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G -A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo -ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL -abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678 -IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh -Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2 -yyqcjg== ------END CERTIFICATE----- - -Hongkong Post Root CA 1 -======================= ------BEGIN CERTIFICATE----- -MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT -DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx -NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n -IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 -ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr -auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh -qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY -V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV -HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i -h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio -l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei -IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps -T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT -c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== ------END CERTIFICATE----- - -SecureSign RootCA11 -=================== ------BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi -SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS -b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw -KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 -cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL -TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO -wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq -g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP -O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA -bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX -t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh -OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r -bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ -Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 -y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 -lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= ------END CERTIFICATE----- - -ACEDICOM Root -============= ------BEGIN CERTIFICATE----- -MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD -T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4 -MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG -A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF -AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk -WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD -YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew -MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb -m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk -HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT -xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2 -3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9 -2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq -TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz -4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU -9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv -bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg -aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP -eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk -zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 -ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI -KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq -nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE -I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp -MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o -tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 -f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol -hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky -CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX -bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/ -D/xwzoiQ ------END CERTIFICATE----- - -Microsec e-Szigno Root CA 2009 -============================== ------BEGIN CERTIFICATE----- -MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER -MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv -c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o -dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE -BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt -U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA -fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG -0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA -pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm -1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC -AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf -QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE -FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o -lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX -I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 -tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 -yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi -LXpUq3DDfSJlgnCW ------END CERTIFICATE----- - -E-Guven Kok Elektronik Sertifika Hizmet Saglayicisi -=================================================== ------BEGIN CERTIFICATE----- -MIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG -EwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxpZ2kgQS5TLjE8MDoGA1UEAxMz -ZS1HdXZlbiBLb2sgRWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhZ2xheWljaXNpMB4XDTA3 -MDEwNDExMzI0OFoXDTE3MDEwNDExMzI0OFowdTELMAkGA1UEBhMCVFIxKDAmBgNVBAoTH0VsZWt0 -cm9uaWsgQmlsZ2kgR3V2ZW5saWdpIEEuUy4xPDA6BgNVBAMTM2UtR3V2ZW4gS29rIEVsZWt0cm9u -aWsgU2VydGlmaWthIEhpem1ldCBTYWdsYXlpY2lzaTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAMMSIJ6wXgBljU5Gu4Bc6SwGl9XzcslwuedLZYDBS75+PNdUMZTe1RK6UxYC6lhj71vY -8+0qGqpxSKPcEC1fX+tcS5yWCEIlKBHMilpiAVDV6wlTL/jDj/6z/P2douNffb7tC+Bg62nsM+3Y -jfsSSYMAyYuXjDtzKjKzEve5TfL0TW3H5tYmNwjy2f1rXKPlSFxYvEK+A1qBuhw1DADT9SN+cTAI -JjjcJRFHLfO6IxClv7wC90Nex/6wN1CZew+TzuZDLMN+DfIcQ2Zgy2ExR4ejT669VmxMvLz4Bcpk -9Ok0oSy1c+HCPujIyTQlCFzz7abHlJ+tiEMl1+E5YP6sOVkCAwEAAaNCMEAwDgYDVR0PAQH/BAQD -AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ/uRLOU1fqRTy7ZVZoEVtstxNulMA0GCSqG -SIb3DQEBBQUAA4IBAQB/X7lTW2M9dTLn+sR0GstG30ZpHFLPqk/CaOv/gKlR6D1id4k9CnU58W5d -F4dvaAXBlGzZXd/aslnLpRCKysw5zZ/rTt5S/wzw9JKp8mxTq5vSR6AfdPebmvEvFZ96ZDAYBzwq -D2fK/A+JYZ1lpTzlvBNbCNvj/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4 -Vwpm+Vganf2XKWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq -fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX ------END CERTIFICATE----- - -GlobalSign Root CA - R3 -======================= ------BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv -YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh -bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT -aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln -bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt -iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ -0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 -rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl -OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 -xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE -FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 -lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 -EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E -bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 -YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r -kpeDMdmztcpHWD9f ------END CERTIFICATE----- - -Autoridad de Certificacion Firmaprofesional CIF A62634068 -========================================================= ------BEGIN CERTIFICATE----- -MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA -BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 -MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw -QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB -NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD -Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P -B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY -7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH -ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI -plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX -MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX -LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK -bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU -vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud -EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH -DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp -cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA -bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx -ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx -51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk -R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP -T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f -Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl -osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR -crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR -saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD -KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi -6Et8Vcad+qMUu2WFbm5PEn4KPJ2V ------END CERTIFICATE----- - -Izenpe.com -========== ------BEGIN CERTIFICATE----- -MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG -EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz -MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu -QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ -03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK -ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU -+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC -PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT -OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK -F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK -0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ -0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB -leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID -AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ -SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG -NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx -MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O -BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l -Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga -kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q -hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs -g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 -aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 -nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC -ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo -Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z -WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== ------END CERTIFICATE----- - -Chambers of Commerce Root - 2008 -================================ ------BEGIN CERTIFICATE----- -MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD -MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv -bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu -QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy -Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl -ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF -EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl -cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC -AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA -XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj -h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ -ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk -NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g -D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331 -lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ -0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj -ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2 -EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI -G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ -BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh -bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh -bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC -CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH -AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 -wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH -3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU -RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 -M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 -YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF -9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK -zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG -nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg -OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ ------END CERTIFICATE----- - -Global Chambersign Root - 2008 -============================== ------BEGIN CERTIFICATE----- -MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD -MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv -bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu -QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx -NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg -Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ -QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD -aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf -VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf -XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0 -ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB -/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA -TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M -H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe -Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF -HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh -wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB -AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT -BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE -BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm -aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm -aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp -1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 -dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG -/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 -ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s -dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg -9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH -foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du -qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr -P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq -c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z -09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B ------END CERTIFICATE----- - -Go Daddy Root Certificate Authority - G2 -======================================== ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT -B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu -MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 -MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 -b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G -A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq -9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD -+qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd -fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl -NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 -BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac -vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r -5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV -N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO -LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 ------END CERTIFICATE----- - -Starfield Root Certificate Authority - G2 -========================================= ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT -B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s -b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 -eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw -DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg -VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB -dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv -W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs -bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk -N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf -ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU -JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol -TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx -4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw -F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K -pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ -c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 ------END CERTIFICATE----- - -Starfield Services Root Certificate Authority - G2 -================================================== ------BEGIN CERTIFICATE----- -MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT -B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s -b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl -IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV -BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT -dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg -Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 -h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa -hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP -LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB -rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw -AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG -SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP -E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy -xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd -iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza -YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 ------END CERTIFICATE----- - -AffirmTrust Commercial -====================== ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS -BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw -MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly -bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb -DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV -C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 -BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww -MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV -HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG -hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi -qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv -0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh -sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= ------END CERTIFICATE----- - -AffirmTrust Networking -====================== ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS -BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw -MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly -bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE -Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI -dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 -/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb -h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV -HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu -UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 -12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 -WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 -/ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= ------END CERTIFICATE----- - -AffirmTrust Premium -=================== ------BEGIN CERTIFICATE----- -MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS -BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy -OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy -dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn -BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV -5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs -+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd -GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R -p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI -S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 -6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 -/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo -+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB -/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv -MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg -Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC -6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S -L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK -+4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV -BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg -IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 -g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb -zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== ------END CERTIFICATE----- - -AffirmTrust Premium ECC -======================= ------BEGIN CERTIFICATE----- -MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV -BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx -MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U -cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA -IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ -N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW -BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK -BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X -57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM -eQ== ------END CERTIFICATE----- - -Certum Trusted Network CA -========================= ------BEGIN CERTIFICATE----- -MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK -ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv -biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy -MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU -ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC -l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J -J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 -fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 -cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB -Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw -DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj -jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 -mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj -Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI -03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= ------END CERTIFICATE----- - -Certinomis - Autorité Racine -============================= ------BEGIN CERTIFICATE----- -MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK -Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg -LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG -A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw -JAYDVQQDDB1DZXJ0aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jYF1AMnmHa -wE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N8y4oH3DfVS9O7cdxbwly -Lu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWerP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw -2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92N -jMD2AR5vpTESOH2VwnHu7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9q -c1pkIuVC28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6lSTC -lrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1Enn1So2+WLhl+HPNb -xxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB0iSVL1N6aaLwD4ZFjliCK0wi1F6g -530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql095gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna -4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G -A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ -KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x -WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva -R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 -nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B -CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv -JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE -qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b -WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE -wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ -vgt2Fl43N+bYdJeimUV5 ------END CERTIFICATE----- - -Root CA Generalitat Valenciana -============================== ------BEGIN CERTIFICATE----- -MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE -ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290 -IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3 -WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE -CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+WmmmO3I2 -F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKjSgbwJ/BXufjpTjJ3Cj9B -ZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGlu6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQ -D0EbtFpKd71ng+CT516nDOeB0/RSrFOyA8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXte -JajCq+TA81yc477OMUxkHl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMB -AAGjggM7MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBraS5n -dmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIICIwYKKwYBBAG/VQIB -ADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBl -AHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIAYQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIA -YQBsAGkAdABhAHQAIABWAGEAbABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQBy -AGEAYwBpAPMAbgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA -aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMAaQBvAG4AYQBt -AGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQAZQAgAEEAdQB0AG8AcgBpAGQA -YQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu -AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA -OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0 -dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV -BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G -A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S -b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh -TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz -Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63 -NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH -iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt -+GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= ------END CERTIFICATE----- - -A-Trust-nQual-03 -================ ------BEGIN CERTIFICATE----- -MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJBVDFIMEYGA1UE -Cgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy -a2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5RdWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5R -dWFsLTAzMB4XDTA1MDgxNzIyMDAwMFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgw -RgYDVQQKDD9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0 -ZW52ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMMEEEtVHJ1 -c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtPWFuA/OQO8BBC4SA -zewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUjlUC5B3ilJfYKvUWG6Nm9wASOhURh73+n -yfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZznF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPE -SU7l0+m0iKsMrmKS1GWH2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4 -iHQF63n1k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs2e3V -cuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECERqlWdV -eRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAVdRU0VlIXLOThaq/Yy/kgM40 -ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fGKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmr -sQd7TZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd -JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS -mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6 -ahq97BvIxYSazQ== ------END CERTIFICATE----- - -TWCA Root Certification Authority -================================= ------BEGIN CERTIFICATE----- -MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ -VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG -EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB -IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK -AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx -QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC -oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP -4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r -y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB -BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG -9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC -mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW -QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY -T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny -Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== ------END CERTIFICATE----- - -Security Communication RootCA2 -============================== ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc -U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh -dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC -SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy -aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ -+T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R -3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV -spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K -EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 -QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB -CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj -u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk -3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q -tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29 -mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 ------END CERTIFICATE----- - -EC-ACC -====== ------BEGIN CERTIFICATE----- -MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE -BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w -ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD -VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UE -CxMsSmVyYXJxdWlhIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMT -BkVDLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQGEwJFUzE7 -MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8gKE5JRiBRLTA4MDExNzYt -SSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZl -Z2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQubmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJh -cnF1aWEgRW50aXRhdHMgZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUND -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R85iK -w5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm4CgPukLjbo73FCeT -ae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaVHMf5NLWUhdWZXqBIoH7nF2W4onW4 -HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNdQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0a -E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw -0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD -VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 -Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l -dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ -lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa -Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe -l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 -E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D -5EI= ------END CERTIFICATE----- - -Hellenic Academic and Research Institutions RootCA 2011 -======================================================= ------BEGIN CERTIFICATE----- -MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT -O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y -aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z -IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT -AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z -IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo -IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI -1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa -71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u -8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH -3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/ -MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8 -MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu -b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt -XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 -TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD -/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N -7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 ------END CERTIFICATE----- - -Actalis Authentication Root CA -============================== ------BEGIN CERTIFICATE----- -MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM -BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE -AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky -MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz -IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 -IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ -wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa -by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 -zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f -YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 -oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l -EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7 -hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4Fv6MGn8i1zeQf1xcGDXqVdFUNaBr8 -EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbnfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5 -jF66CyCU3nuDuP/jVo23Eek7jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLY -iDrIn3hm7YnzezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt -ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI -WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0 -JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx -K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+ -Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC -4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo -2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz -lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem -OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 -vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== ------END CERTIFICATE----- - -Trustis FPS Root CA -=================== ------BEGIN CERTIFICATE----- -MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG -EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 -IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV -BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ -RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk -H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa -cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt -o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA -AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd -BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c -GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC -yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P -8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV -l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl -iB6XzCGcKQENZetX2fNXlrtIzYE= ------END CERTIFICATE----- - -StartCom Certification Authority -================================ ------BEGIN CERTIFICATE----- -MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN -U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu -ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 -NjM3WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk -LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg -U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw -ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y -o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ -Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d -eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt -2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z -6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ -osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ -untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc -UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT -37uMdBNSSwIDAQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD -VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFulF2mHMMo0aEPQ -Qa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCCATgwLgYIKwYBBQUHAgEWImh0 -dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cu -c3RhcnRzc2wuY29tL2ludGVybWVkaWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENv -bW1lcmNpYWwgKFN0YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0 -aGUgc2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0aWZpY2F0 -aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93d3cuc3RhcnRzc2wuY29t -L3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBG -cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5 -fPGFf59Jb2vKXfuM/gTFwWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWm -N3PH/UvSTa0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst0OcN -Org+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNcpRJvkrKTlMeIFw6T -tn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKlCcWw0bdT82AUuoVpaiF8H3VhFyAX -e2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVFP0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA -2MFrLH9ZXF2RsXAiV+uKa0hK1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBs -HvUwyKMQ5bLmKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE -JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ8dCAWZvLMdib -D4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnmfyWl8kgAwKQB2j8= ------END CERTIFICATE----- - -StartCom Certification Authority G2 -=================================== ------BEGIN CERTIFICATE----- -MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMN -U3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg -RzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UE -ChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8O -o1XJJZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsDvfOpL9HG -4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnooD/Uefyf3lLE3PbfHkffi -Aez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/Q0kGi4xDuFby2X8hQxfqp0iVAXV16iul -Q5XqFYSdCI0mblWbq9zSOdIxHWDirMxWRST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbs -O+wmETRIjfaAKxojAuuKHDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8H -vKTlXcxNnw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM0D4L -nMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/iUUjXuG+v+E5+M5iS -FGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9Ha90OrInwMEePnWjFqmveiJdnxMa -z6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHgTuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJ -KoZIhvcNAQELBQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K -2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfXUfEpY9Z1zRbk -J4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl6/2o1PXWT6RbdejF0mCy2wl+ -JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG -/+gyRr61M3Z3qAFdlsHB1b6uJcDJHgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTc -nIhT76IxW1hPkWLIwpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/Xld -blhYXzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5lIxKVCCIc -l85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoohdVddLHRDiBYmxOlsGOm -7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulrso8uBtjRkcfGEvRM/TAXw8HaOFvjqerm -obp573PYtlNXLfbQ4ddI ------END CERTIFICATE----- - -Buypass Class 2 Root CA -======================= ------BEGIN CERTIFICATE----- -MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU -QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X -DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 -eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw -DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1 -g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn -9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b -/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU -CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff -awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI -zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn -Bkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRSP/TizPJhk9H9Z2vX -Uq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN9SG9dKpN6nIDSdvHXx1iY8f93ZHs -M+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxPAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD -VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF -AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s -A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI -osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S -aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd -DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD -LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 -oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC -wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS -CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN -rJgWVqA= ------END CERTIFICATE----- - -Buypass Class 3 Root CA -======================= ------BEGIN CERTIFICATE----- -MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU -QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X -DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 -eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw -DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH -sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR -5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh -7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ -ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH -2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV -/afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ -RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA -Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq -j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD -VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF -AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV -cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G -uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG -Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 -ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 -KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz -6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug -UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe -eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi -Cp/HuZc= ------END CERTIFICATE----- - -T-TeleSec GlobalRoot Class 3 -============================ ------BEGIN CERTIFICATE----- -MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM -IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU -cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx -MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz -dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD -ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK -9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU -NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF -iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W -0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA -MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr -AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb -fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT -ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h -P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml -e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== ------END CERTIFICATE----- - -EE Certification Centre Root CA -=============================== ------BEGIN CERTIFICATE----- -MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG -EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy -dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw -MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB -UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy -ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM -TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2 -rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw -93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN -P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T -AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ -MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF -BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj -xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM -lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u -uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU -3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM -dcGWxZ0= ------END CERTIFICATE----- - -TURKTRUST Certificate Services Provider Root 2007 -================================================= ------BEGIN CERTIFICATE----- -MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP -MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg -QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X -DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxl -a3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMCVFIxDzAN -BgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp -bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4gKGMpIEFyYWzEsWsgMjAwNzCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9N -YvDdE3ePYakqtdTyuTFYKTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQv -KUmi8wUG+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveGHtya -KhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6PIzdezKKqdfcYbwnT -rqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M733WB2+Y8a+xwXrXgTW4qhe04MsC -AwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHkYb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAP -BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/s -Px+EnWVUXKgWAkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I -aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5mxRZNTZPz/OO -Xl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsaXRik7r4EW5nVcV9VZWRi1aKb -BFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAK -poRq0Tl9 ------END CERTIFICATE----- - -D-TRUST Root Class 3 CA 2 2009 -============================== ------BEGIN CERTIFICATE----- -MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK -DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe -Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE -LVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOAD -ER03UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42tSHKXzlA -BF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9RySPocq60vFYJfxLLHLGv -KZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsMlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7z -p+hnUquVH+BGPtikw8paxTGA6Eian5Rp/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUC -AwEAAaOCARowggEWMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ -4PGEMA4GA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVjdG9y -eS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUyMENBJTIwMiUyMDIw -MDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3QwQ6BBoD+G -PWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3JsL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw -OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm -2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 -o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV -dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph -X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= ------END CERTIFICATE----- - -D-TRUST Root Class 3 CA 2 EV 2009 -================================= ------BEGIN CERTIFICATE----- -MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK -DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw -OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK -DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw -OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS -egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh -zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T -7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 -sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35 -11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv -cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFwOi8v -ZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xhc3MlMjAzJTIwQ0El -MjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1ERT9jZXJ0aWZpY2F0ZXJldm9jYXRp -b25saXN0MEagRKBChkBodHRwOi8vd3d3LmQtdHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xh -c3NfM19jYV8yX2V2XzIwMDkuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+ -PPoeUSbrh/Yp3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 -nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNFCSuGdXzfX2lX -ANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7naxpeG0ILD5EJt/rDiZE4OJudA -NCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqXKVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVv -w9y4AyHqnxbxLFS1 ------END CERTIFICATE----- - -PSCProcert -========== ------BEGIN CERTIFICATE----- -MIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1dG9yaWRhZCBk -ZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9sYW5vMQswCQYDVQQGEwJWRTEQ -MA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlzdHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lz -dGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBl -cmludGVuZGVuY2lhIGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUw -IwYJKoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyODE2NTEwMFoXDTIw -MTIyNTIzNTk1OVowgdExJjAkBgkqhkiG9w0BCQEWF2NvbnRhY3RvQHByb2NlcnQubmV0LnZlMQ8w -DQYDVQQHEwZDaGFjYW8xEDAOBgNVBAgTB01pcmFuZGExKjAoBgNVBAsTIVByb3ZlZWRvciBkZSBD -ZXJ0aWZpY2Fkb3MgUFJPQ0VSVDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZp -Y2FjaW9uIEVsZWN0cm9uaWNhMQswCQYDVQQGEwJWRTETMBEGA1UEAxMKUFNDUHJvY2VydDCCAiIw -DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANW39KOUM6FGqVVhSQ2oh3NekS1wwQYalNo97BVC -wfWMrmoX8Yqt/ICV6oNEolt6Vc5Pp6XVurgfoCfAUFM+jbnADrgV3NZs+J74BCXfgI8Qhd19L3uA -3VcAZCP4bsm+lU/hdezgfl6VzbHvvnpC2Mks0+saGiKLt38GieU89RLAu9MLmV+QfI4tL3czkkoh -RqipCKzx9hEC2ZUWno0vluYC3XXCFCpa1sl9JcLB/KpnheLsvtF8PPqv1W7/U0HU9TI4seJfxPmO -EO8GqQKJ/+MMbpfg353bIdD0PghpbNjU5Db4g7ayNo+c7zo3Fn2/omnXO1ty0K+qP1xmk6wKImG2 -0qCZyFSTXai20b1dCl53lKItwIKOvMoDKjSuc/HUtQy9vmebVOvh+qBa7Dh+PsHMosdEMXXqP+UH -0quhJZb25uSgXTcYOWEAM11G1ADEtMo88aKjPvM6/2kwLkDd9p+cJsmWN63nOaK/6mnbVSKVUyqU -td+tFjiBdWbjxywbk5yqjKPK2Ww8F22c3HxT4CAnQzb5EuE8XL1mv6JpIzi4mWCZDlZTOpx+FIyw -Bm/xhnaQr/2v/pDGj59/i5IjnOcVdo/Vi5QTcmn7K2FjiO/mpF7moxdqWEfLcU8UC17IAggmosvp -r2uKGcfLFFb14dq12fy/czja+eevbqQ34gcnAgMBAAGjggMXMIIDEzASBgNVHRMBAf8ECDAGAQH/ -AgEBMDcGA1UdEgQwMC6CD3N1c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAz -Ni0wMB0GA1UdDgQWBBRBDxk4qpl/Qguk1yeYVKIXTC1RVDCCAVAGA1UdIwSCAUcwggFDgBStuyId -xuDSAaj9dlBSk+2YwU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0b3JpZGFkIGRlIENlcnRp -ZmljYWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xhbm8xCzAJBgNVBAYTAlZFMRAwDgYDVQQH -EwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0cml0byBDYXBpdGFsMTYwNAYDVQQKEy1TaXN0ZW1hIE5h -Y2lvbmFsIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5k -ZW5jaWEgZGUgU2VydmljaW9zIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkqhkiG -9w0BCQEWFmFjcmFpekBzdXNjZXJ0ZS5nb2IudmWCAQowDgYDVR0PAQH/BAQDAgEGME0GA1UdEQRG -MESCDnByb2NlcnQubmV0LnZloBUGBWCGXgIBoAwMClBTQy0wMDAwMDKgGwYFYIZeAgKgEgwQUklG -LUotMzE2MzUzNzMtNzB2BgNVHR8EbzBtMEagRKBChkBodHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52 -ZS9sY3IvQ0VSVElGSUNBRE8tUkFJWi1TSEEzODRDUkxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNy -YWl6LnN1c2NlcnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v -Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsGAQUFBwIBFh5o -dHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcNAQELBQADggIBACtZ6yKZu4Sq -T96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmN -g7+mvTV+LFwxNG9s2/NkAZiqlCxB3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4q -uxtxj7mkoP3YldmvWb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1 -n8GhHVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHmpHmJWhSn -FFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXzsOfIt+FTvZLm8wyWuevo -5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bEqCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq -3TNWOByyrYDT13K9mmyZY+gAu0F2BbdbmRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5 -poLWccret9W6aAjtmcz9opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y -eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km ------END CERTIFICATE----- - -China Internet Network Information Center EV Certificates Root -============================================================== ------BEGIN CERTIFICATE----- -MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCQ04xMjAwBgNV -BAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyMUcwRQYDVQQDDD5D -aGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0aW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMg -Um9vdDAeFw0xMDA4MzEwNzExMjVaFw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAG -A1UECgwpQ2hpbmEgSW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMM -PkNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRpZmljYXRl -cyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z7r07eKpkQ0H1UN+U8i6y -jUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA//DdmEEbK40ctb3B75aDFk4Zv6dOtouSCV -98YPjUesWgbdYavi7NifFy2cyjw1l1VxzUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2H -klY0bBoQCxfVWhyXWIQ8hBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23 -KzhmBsUs4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54ugQEC -7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6oYNJKiyoOCWTAPBgNV -HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUfHJLOcfA22KlT5uqGDSSosqD -glkwDQYJKoZIhvcNAQEFBQADggEBACrDx0M3j92tpLIM7twUbY8opJhJywyA6vPtI2Z1fcXTIWd5 -0XPFtQO3WKwMVC/GVhMPMdoG52U7HW8228gd+f2ABsqjPWYWqJ1MFn3AlUa1UeTiH9fqBk1jjZaM -7+czV0I664zBechNdn3e9rG3geCg+aF4RhcaVpjwTj2rHO3sOdwHSPdj/gauwqRcalsyiMXHM4Ws -ZkJHwlgkmeHlPuV1LI5D1l08eB6olYIpUNHRFrrvwb562bTYzB5MRuF3sTGrvSrIzo9uoV1/A3U0 -5K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATywy39FCqQmbkHzJ8= ------END CERTIFICATE----- - -Swisscom Root CA 2 -================== ------BEGIN CERTIFICATE----- -MIIF2TCCA8GgAwIBAgIQHp4o6Ejy5e/DfEoeWhhntjANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQG -EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy -dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMjAeFw0xMTA2MjQwODM4MTRaFw0zMTA2 -MjUwNzM4MTRaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln -aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAyMIIC -IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlUJOhJ1R5tMJ6HJaI2nbeHCOFvErjw0DzpPM -LgAIe6szjPTpQOYXTKueuEcUMncy3SgM3hhLX3af+Dk7/E6J2HzFZ++r0rk0X2s682Q2zsKwzxNo -ysjL67XiPS4h3+os1OD5cJZM/2pYmLcX5BtS5X4HAB1f2uY+lQS3aYg5oUFgJWFLlTloYhyxCwWJ -wDaCFCE/rtuh/bxvHGCGtlOUSbkrRsVPACu/obvLP+DHVxxX6NZp+MEkUp2IVd3Chy50I9AU/SpH -Wrumnf2U5NGKpV+GY3aFy6//SSj8gO1MedK75MDvAe5QQQg1I3ArqRa0jG6F6bYRzzHdUyYb3y1a -SgJA/MTAtukxGggo5WDDH8SQjhBiYEQN7Aq+VRhxLKX0srwVYv8c474d2h5Xszx+zYIdkeNL6yxS -NLCK/RJOlrDrcH+eOfdmQrGrrFLadkBXeyq96G4DsguAhYidDMfCd7Camlf0uPoTXGiTOmekl9Ab -mbeGMktg2M7v0Ax/lZ9vh0+Hio5fCHyqW/xavqGRn1V9TrALacywlKinh/LTSlDcX3KwFnUey7QY -Ypqwpzmqm59m2I2mbJYV4+by+PGDYmy7Velhk6M99bFXi08jsJvllGov34zflVEpYKELKeRcVVi3 -qPyZ7iVNTA6z00yPhOgpD/0QVAKFyPnlw4vP5w8CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw -HQYDVR0hBBYwFDASBgdghXQBUwIBBgdghXQBUwIBMBIGA1UdEwEB/wQIMAYBAf8CAQcwHQYDVR0O -BBYEFE0mICKJS9PVpAqhb97iEoHF8TwuMB8GA1UdIwQYMBaAFE0mICKJS9PVpAqhb97iEoHF8Twu -MA0GCSqGSIb3DQEBCwUAA4ICAQAyCrKkG8t9voJXiblqf/P0wS4RfbgZPnm3qKhyN2abGu2sEzsO -v2LwnN+ee6FTSA5BesogpxcbtnjsQJHzQq0Qw1zv/2BZf82Fo4s9SBwlAjxnffUy6S8w5X2lejjQ -82YqZh6NM4OKb3xuqFp1mrjX2lhIREeoTPpMSQpKwhI3qEAMw8jh0FcNlzKVxzqfl9NX+Ave5XLz -o9v/tdhZsnPdTSpxsrpJ9csc1fV5yJmz/MFMdOO0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcs -a0vvaGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciATwoCqISxx -OQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99nBjx8Oto0QuFmtEYE3saW -mA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5Wt6NlUe07qxS/TFED6F+KBZvuim6c779o -+sjaC+NCydAXFJy3SuCvkychVSa1ZC+N8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TC -rvJcwhbtkj6EPnNgiLx29CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX -5OfNeOI5wSsSnqaeG8XmDtkx2Q== ------END CERTIFICATE----- - -Swisscom Root EV CA 2 -===================== ------BEGIN CERTIFICATE----- -MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UE -BhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdpdGFsIENlcnRpZmljYXRlIFNl -cnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcN -MzEwNjI1MDg0NTA4WjBnMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsT -HERpZ2l0YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYg -Q0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7BxUglgRCgz -o3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD1ycfMQ4jFrclyxy0uYAy -Xhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPHoCE2G3pXKSinLr9xJZDzRINpUKTk4Rti -GZQJo/PDvO/0vezbE53PnUgJUmfANykRHvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8Li -qG12W0OfvrSdsyaGOx9/5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaH -Za0zKcQvidm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHLOdAG -alNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaCNYGu+HuB5ur+rPQa -m3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f46Fq9mDU5zXNysRojddxyNMkM3Ox -bPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCBUWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDi -xzgHcgplwLa7JSnaFp6LNYth7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/ -BAQDAgGGMB0GA1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED -MB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWBbj2ITY1x0kbB -bkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6xXCX5145v9Ydkn+0UjrgEjihL -j6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98TPLr+flaYC/NUn81ETm484T4VvwYmneTwkLbU -wp4wLh/vx3rEUMfqe9pQy3omywC0Wqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7 -XwgiG/W9mR4U9s70WBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH -59yLGn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm7JFe3VE/ -23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4Snr8PyQUQ3nqjsTzyP6Wq -J3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VNvBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyA -HmBR3NdUIR7KYndP+tiPsys6DXhyyWhBWkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/gi -uMod89a2GQ+fYWVq6nTIfI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuW -l8PVP3wbI+2ksx0WckNLIOFZfsLorSa/ovc= ------END CERTIFICATE----- - -CA Disig Root R1 -================ ------BEGIN CERTIFICATE----- -MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNVBAYTAlNLMRMw -EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp -ZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQyMDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sx -EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp -c2lnIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy -3QRkD2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/oOI7bm+V8 -u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3AfQ+lekLZWnDZv6fXARz2 -m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJeIgpFy4QxTaz+29FHuvlglzmxZcfe+5nk -CiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8noc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTa -YVKvJrT1cU/J19IG32PK/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6 -vpmumwKjrckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD3AjL -LhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE7cderVC6xkGbrPAX -ZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkCyC2fg69naQanMVXVz0tv/wQFx1is -XxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLdqvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNV -HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ -04IwDQYJKoZIhvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR -xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaASfX8MPWbTx9B -LxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXoHqJPYNcHKfyyo6SdbhWSVhlM -CrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpBemOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5Gfb -VSUZP/3oNn6z4eGBrxEWi1CXYBmCAMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85 -YmLLW1AL14FABZyb7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKS -ds+xDzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvkF7mGnjix -lAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqFa3qdnom2piiZk4hA9z7N -UaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsTQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJ -a7+h89n07eLw4+1knj0vllJPgFOL ------END CERTIFICATE----- - -CA Disig Root R2 -================ ------BEGIN CERTIFICATE----- -MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw -EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp -ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sx -EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp -c2lnIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbC -w3OeNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNHPWSb6Wia -xswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3Ix2ymrdMxp7zo5eFm1tL7 -A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbeQTg06ov80egEFGEtQX6sx3dOy1FU+16S -GBsEWmjGycT6txOgmLcRK7fWV8x8nhfRyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqV -g8NTEQxzHQuyRpDRQjrOQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa -5Beny912H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJQfYE -koopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUDi/ZnWejBBhG93c+A -Ak9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORsnLMOPReisjQS1n6yqEm70XooQL6i -Fh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNV -HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5u -Qu0wDQYJKoZIhvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM -tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqfGopTpti72TVV -sRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkblvdhuDvEK7Z4bLQjb/D907Je -dR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W8 -1k/BfDxujRNt+3vrMNDcTa/F1balTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjx -mHHEt38OFdAlab0inSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01 -utI3gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18DrG5gPcFw0 -sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3OszMOl6W8KjptlwlCFtaOg -UxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8xL4ysEr3vQCj8KWefshNPZiTEUxnpHikV -7+ZtsH8tZ/3zbBt1RqPlShfppNcL ------END CERTIFICATE----- - -ACCVRAIZ1 -========= ------BEGIN CERTIFICATE----- -MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UEAwwJQUNDVlJB -SVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQswCQYDVQQGEwJFUzAeFw0xMTA1 -MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQBgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwH -UEtJQUNDVjENMAsGA1UECgwEQUNDVjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4IC -DwAwggIKAoICAQCbqau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gM -jmoYHtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWoG2ioPej0 -RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpAlHPrzg5XPAOBOp0KoVdD -aaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhrIA8wKFSVf+DuzgpmndFALW4ir50awQUZ -0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDG -WuzndN9wrqODJerWx5eHk6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs7 -8yM2x/474KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMOm3WR -5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpacXpkatcnYGMN285J -9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPluUsXQA+xtrn13k/c4LOsOxFwYIRK -Q26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYIKwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRw -Oi8vd3d3LmFjY3YuZXMvZmlsZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEu -Y3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 -VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeTVfZW6oHlNsyM -Hj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIGCCsGAQUFBwICMIIBFB6CARAA -QQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUAcgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBh -AO0AegAgAGQAZQAgAGwAYQAgAEEAQwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUA -YwBuAG8AbABvAGcA7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBj -AHQAcgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAAQwBQAFMA -IABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUAczAwBggrBgEFBQcCARYk -aHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2MuaHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0 -dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRtaW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2 -MV9kZXIuY3JsMA4GA1UdDwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZI -hvcNAQEFBQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdpD70E -R9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gUJyCpZET/LtZ1qmxN -YEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+mAM/EKXMRNt6GGT6d7hmKG9Ww7Y49 -nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepDvV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJ -TS+xJlsndQAJxGJ3KQhfnlmstn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3 -sCPdK6jT2iWH7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h -I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szAh1xA2syVP1Xg -Nce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xFd3+YJ5oyXSrjhO7FmGYvliAd -3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2HpPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3p -EfbRD0tVNEYqi4Y7 ------END CERTIFICATE----- - -TWCA Global Root CA -=================== ------BEGIN CERTIFICATE----- -MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcxEjAQBgNVBAoT -CVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMTVFdDQSBHbG9iYWwgUm9vdCBD -QTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQK -EwlUQUlXQU4tQ0ExEDAOBgNVBAsTB1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3Qg -Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2C -nJfF10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz0ALfUPZV -r2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfChMBwqoJimFb3u/Rk28OKR -Q4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbHzIh1HrtsBv+baz4X7GGqcXzGHaL3SekV -tTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1W -KKD+u4ZqyPpcC1jcxkt2yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99 -sy2sbZCilaLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYPoA/p -yJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQABDzfuBSO6N+pjWxn -kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI -zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC -AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g -cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn -LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M -8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg -/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg -lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP -A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m -i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 -EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 -zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= ------END CERTIFICATE----- - -TeliaSonera Root CA v1 -====================== ------BEGIN CERTIFICATE----- -MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE -CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcNMDcxMDE4 -MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwW -VGVsaWFTb25lcmEgUm9vdCBDQSB2MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+ -6yfwIaPzaSZVfp3FVRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA -3GV17CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+XZ75Ljo1k -B1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+/jXh7VB7qTCNGdMJjmhn -Xb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxH -oLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkmdtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3 -F0fUTPHSiXk+TT2YqGHeOh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJ -oWjiUIMusDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4pgd7 -gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fsslESl1MpWtTwEhDc -TwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQarMCpgKIv7NHfirZ1fpoeDVNAgMB -AAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qW -DNXr+nuqF+gTEjANBgkqhkiG9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNm -zqjMDfz1mgbldxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx -0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW -pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV -G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc -c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT -JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 -qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 -Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems -WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= ------END CERTIFICATE----- - -E-Tugra Certification Authority -=============================== ------BEGIN CERTIFICATE----- -MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w -DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls -ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN -ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw -NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx -QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl -cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD -DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd -hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5K -CKpbknSFQ9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEoq1+g -ElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3Dk14opz8n8Y4e0ypQ -BaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcHfC425lAcP9tDJMW/hkd5s3kc91r0 -E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsutdEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gz -rt48Ue7LE3wBf4QOXVGUnhMMti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAq -jqFGOjGY5RH8zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn -rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUXU8u3Zg5mTPj5 -dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6Jyr+zE7S6E5UMA8GA1UdEwEB -/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG -MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK -kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO -XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 -VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo -a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc -dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV -KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT -Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 -8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G -C7TbO6Orb1wdtn7os4I07QZcJA== ------END CERTIFICATE----- - -T-TeleSec GlobalRoot Class 2 -============================ ------BEGIN CERTIFICATE----- -MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM -IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU -cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx -MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz -dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD -ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ -SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F -vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970 -2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV -WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA -MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy -YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4 -r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf -vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR -3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN -9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== ------END CERTIFICATE----- - -Atos TrustedRoot 2011 -===================== ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU -cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 -MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG -A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV -hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr -54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ -DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 -HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR -z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R -l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ -bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB -CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h -k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kPDpFrdRbhIfzYJsdHt6bPWHJxfrrh -TZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pcmaHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a9 -61qn8FYiqTxlVMYVqL2Gns2Dlmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G -3mB/ufNPRJLvKrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed ------END CERTIFICATE----- \ No newline at end of file diff --git a/libraries/fof/download/adapter/curl.php b/libraries/fof/download/adapter/curl.php index 04260c8e00d2c..3f6af8f92c8f5 100644 --- a/libraries/fof/download/adapter/curl.php +++ b/libraries/fof/download/adapter/curl.php @@ -13,6 +13,8 @@ */ class FOFDownloadAdapterCurl extends FOFDownloadAdapterAbstract implements FOFDownloadInterface { + protected $headers = array(); + public function __construct() { $this->priority = 110; @@ -75,7 +77,8 @@ public function downloadAndReturn($url, $from = null, $to = null, array $params CURLOPT_BINARYTRANSFER => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT_FOLLOWLOCATION => 1, - CURLOPT_CAINFO => __DIR__ . '/cacert.pem' + CURLOPT_CAINFO => JPATH_LIBRARIES . 'joomla/http/transport/cacert.pem', + CURLOPT_HEADERFUNCTION => array($this, 'reponseHeaderCallback') ); if (!(empty($from) && empty($to))) @@ -89,6 +92,8 @@ public function downloadAndReturn($url, $from = null, $to = null, array $params @curl_setopt_array($ch, $options); + $this->headers = array(); + $result = curl_exec($ch); $errno = curl_errno($ch); @@ -99,7 +104,11 @@ public function downloadAndReturn($url, $from = null, $to = null, array $params { $error = JText::sprintf('LIB_FOF_DOWNLOAD_ERR_CURL_ERROR', $errno, $errmsg); } - elseif ($http_status > 299) + elseif (($http_status >= 300) && ($http_status <= 399) && isset($this->headers['Location']) && !empty($this->headers['Location'])) + { + return $this->downloadAndReturn($this->headers['Location'], $from, $to, $params); + } + elseif ($http_status > 399) { $result = false; $errno = $http_status; @@ -141,7 +150,7 @@ public function getFileSize($url) curl_setopt($ch, CURLOPT_HEADER, true ); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true ); - @curl_setopt($ch, CURLOPT_CAINFO, __DIR__ . '/cacert.pem'); + @curl_setopt($ch, CURLOPT_CAINFO, JPATH_LIBRARIES . 'joomla/http/transport/cacert.pem'); $data = curl_exec($ch); curl_close($ch); @@ -150,6 +159,7 @@ public function getFileSize($url) { $content_length = "unknown"; $status = "unknown"; + $redirection = null; if (preg_match( "/^HTTP\/1\.[01] (\d\d\d)/", $data, $matches)) { @@ -161,12 +171,56 @@ public function getFileSize($url) $content_length = (int)$matches[1]; } - if( $status == 200 || ($status > 300 && $status <= 308) ) + if (preg_match( "/Location: (.*)/", $data, $matches)) + { + $redirection = (int)$matches[1]; + } + + if ($status == 200) { $result = $content_length; } + + if (($status > 300) && ($status <= 308)) + { + if (!empty($redirection)) + { + return $this->getFileSize($redirection); + } + + return -1; + } } return $result; } + + /** + * Handles the HTTP headers returned by cURL + * + * @param resource $ch cURL resource handle (unused) + * @param string $data Each header line, as returned by the server + * + * @return int The length of the $data string + */ + protected function reponseHeaderCallback(&$ch, &$data) + { + $strlen = strlen($data); + + if (($strlen) <= 2) + { + return $strlen; + } + + if (substr($data, 0, 4) == 'HTTP') + { + return $strlen; + } + + list($header, $value) = explode(': ', trim($data), 2); + + $this->headers[$header] = $value; + + return $strlen; + } } \ No newline at end of file diff --git a/libraries/fof/download/adapter/fopen.php b/libraries/fof/download/adapter/fopen.php index 0fe035ab3abe8..ffbef825651da 100644 --- a/libraries/fof/download/adapter/fopen.php +++ b/libraries/fof/download/adapter/fopen.php @@ -81,7 +81,7 @@ public function downloadAndReturn($url, $from = null, $to = null, array $params ), 'ssl' => array( 'verify_peer' => true, - 'cafile' => __DIR__ . '/cacert.pem', + 'cafile' => JPATH_LIBRARIES . 'joomla/http/transport/cacert.pem', 'verify_depth' => 5, ) ); @@ -99,7 +99,7 @@ public function downloadAndReturn($url, $from = null, $to = null, array $params ), 'ssl' => array( 'verify_peer' => true, - 'cafile' => __DIR__ . '/cacert.pem', + 'cafile' => JPATH_LIBRARIES . 'joomla/http/transport/cacert.pem', 'verify_depth' => 5, ) ); diff --git a/libraries/fof/form/field/model.php b/libraries/fof/form/field/model.php index 81bfbb39d532a..53f0d8b7f89b6 100644 --- a/libraries/fof/form/field/model.php +++ b/libraries/fof/form/field/model.php @@ -187,7 +187,7 @@ protected function getOptions() if (!empty($nonePlaceholder)) { - $options[] = JHtml::_('select.option', JText::_($nonePlaceholder), null); + $options[] = JHtml::_('select.option', null, JText::_($nonePlaceholder)); } // Process field atrtibutes diff --git a/libraries/fof/form/field/tag.php b/libraries/fof/form/field/tag.php index 513eac7f10c21..17e8b6957151c 100644 --- a/libraries/fof/form/field/tag.php +++ b/libraries/fof/form/field/tag.php @@ -241,7 +241,7 @@ public function getRepeatable() $html .= '
    '; } - return '' . + return '' . $html . ''; } diff --git a/libraries/fof/form/header/model.php b/libraries/fof/form/header/model.php index ebce52d440442..de1a9981f483d 100644 --- a/libraries/fof/form/header/model.php +++ b/libraries/fof/form/header/model.php @@ -42,7 +42,7 @@ protected function getOptions() if (!empty($nonePlaceholder)) { - $options[] = JHtml::_('select.option', JText::_($nonePlaceholder), null); + $options[] = JHtml::_('select.option', null, JText::_($nonePlaceholder)); } // Process field atrtibutes diff --git a/libraries/fof/include.php b/libraries/fof/include.php index 17e3781fabe0f..3f07c4982356d 100644 --- a/libraries/fof/include.php +++ b/libraries/fof/include.php @@ -12,7 +12,7 @@ if (!defined('FOF_INCLUDED')) { - define('FOF_INCLUDED', '2.4.2'); + define('FOF_INCLUDED', '2.4.3'); // Register the FOF autoloader require_once __DIR__ . '/autoloader/fof.php'; diff --git a/libraries/fof/utils/array/array.php b/libraries/fof/utils/array/array.php index a57ed3a2ebe02..9f5b2808b382e 100644 --- a/libraries/fof/utils/array/array.php +++ b/libraries/fof/utils/array/array.php @@ -521,8 +521,8 @@ protected static function _sortObjects(&$a, &$b) $locale = self::$sortLocale[$i]; } - $va = $a->$key[$i]; - $vb = $b->$key[$i]; + $va = $a->{$key[$i]}; + $vb = $b->{$key[$i]}; if ((is_bool($va) || is_numeric($va)) && (is_bool($vb) || is_numeric($vb))) { diff --git a/libraries/fof/utils/installscript/installscript.php b/libraries/fof/utils/installscript/installscript.php index f17f9df91de8f..d97479cef2101 100644 --- a/libraries/fof/utils/installscript/installscript.php +++ b/libraries/fof/utils/installscript/installscript.php @@ -779,6 +779,76 @@ protected function bugfixCantBuildAdminMenus() } } } + + // Remove #__menu records for good measure! –– I think this is not necessary and causes the menu item to + // disappear on extension update. + /** + $query = $db->getQuery(true); + $query->select('id') + ->from('#__menu') + ->where($db->qn('type') . ' = ' . $db->q('component')) + ->where($db->qn('menutype') . ' = ' . $db->q('main')) + ->where($db->qn('link') . ' LIKE ' . $db->q('index.php?option=' . $this->componentName)); + $db->setQuery($query); + + try + { + $ids1 = $db->loadColumn(); + } + catch (Exception $exc) + { + $ids1 = array(); + } + + if (empty($ids1)) + { + $ids1 = array(); + } + + $query = $db->getQuery(true); + $query->select('id') + ->from('#__menu') + ->where($db->qn('type') . ' = ' . $db->q('component')) + ->where($db->qn('menutype') . ' = ' . $db->q('main')) + ->where($db->qn('link') . ' LIKE ' . $db->q('index.php?option=' . $this->componentName . '&%')); + $db->setQuery($query); + + try + { + $ids2 = $db->loadColumn(); + } + catch (Exception $exc) + { + $ids2 = array(); + } + + if (empty($ids2)) + { + $ids2 = array(); + } + + $ids = array_merge($ids1, $ids2); + + if (!empty($ids)) + { + foreach ($ids as $id) + { + $query = $db->getQuery(true); + $query->delete('#__menu') + ->where($db->qn('id') . ' = ' . $db->q($id)); + $db->setQuery($query); + + try + { + $db->execute(); + } + catch (Exception $exc) + { + // Nothing + } + } + } + /**/ } /** diff --git a/libraries/fof/version.txt b/libraries/fof/version.txt index a7d3e3ef2bbcb..71a2b24a23f6b 100644 --- a/libraries/fof/version.txt +++ b/libraries/fof/version.txt @@ -1,2 +1,2 @@ -2.4.2 -2015-03-02 16:26:53 \ No newline at end of file +2.4.3 +2015-04-22 13:15:32 \ No newline at end of file From d96818215991f47e24f417ca61e1ad59f290c6aa Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Sun, 31 May 2015 00:05:11 +0200 Subject: [PATCH 444/809] fix #7080 fix the #7080 issue --- installation/model/database.php | 34 ++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/installation/model/database.php b/installation/model/database.php index d84303c05e92c..7b9592033d46d 100644 --- a/installation/model/database.php +++ b/installation/model/database.php @@ -316,10 +316,38 @@ public function createDatabase($options) } // PostgreSQL database older than version 9.0.0 needs to run 'CREATE LANGUAGE' to create function. - if (($options->db_type == 'postgresql') && (version_compare($db_version, '9.0.0', '<'))) + if (($options->db_type == 'postgresql') && (!version_compare($db_version, '9.0.0', '>='))) { - $db->setQuery("CREATE LANGUAGE plpgsql"); - $db->execute(); + $db->setQuery("select lanpltrusted from pg_language where lanname='plpgsql'"); + + try + { + $db->execute(); + } + catch (RuntimeException $e) + { + $app->enqueueMessage(JText::_('JLIB_DATABASE_ERROR_DATABASE_QUERY'), 'notice'); + + return false; + } + + $column = $db->loadResult(); + + if ($column != 't') + { + $db->setQuery("CREATE LANGUAGE plpgsql"); + + try + { + $db->execute(); + } + catch (RuntimeException $e) + { + $app->enqueueMessage(JText::_('JLIB_DATABASE_ERROR_DATABASE_QUERY'), 'notice'); + + return false; + } + } } // Get database's UTF support. From b20b908eb32b2fe7c63c4680f80bd8f60812b708 Mon Sep 17 00:00:00 2001 From: dgt41 Date: Sun, 31 May 2015 00:17:34 +0100 Subject: [PATCH 445/809] Reduce mootools dependency in hathor Fixes #5245 --- administrator/templates/hathor/component.php | 3 + .../hathor/html/com_admin/profile/edit.php | 11 +- .../hathor/html/com_banners/banner/edit.php | 12 +- .../html/com_banners/banners/default.php | 2 - .../hathor/html/com_banners/client/edit.php | 11 +- .../com_categories/categories/default.php | 20 +- .../categories/default_batch.php | 63 ------ .../html/com_categories/category/edit.php | 17 +- .../html/com_config/application/default.php | 10 +- .../html/com_config/component/default.php | 11 +- .../hathor/html/com_contact/contact/edit.php | 13 +- .../html/com_contact/contacts/default.php | 17 +- .../hathor/html/com_content/article/edit.php | 14 +- .../html/com_content/articles/default.php | 17 +- .../html/com_finder/filters/default.php | 6 +- .../hathor/html/com_finder/index/default.php | 49 ++--- .../hathor/html/com_finder/maps/default.php | 29 +-- .../com_installer/install/default_form.php | 19 +- .../hathor/html/com_menus/item/edit.php | 109 +++++---- .../hathor/html/com_menus/items/default.php | 11 +- .../hathor/html/com_menus/menu/edit.php | 23 +- .../hathor/html/com_menus/menus/default.php | 19 +- .../html/com_menus/menutypes/default.php | 27 ++- .../hathor/html/com_messages/message/edit.php | 12 +- .../hathor/html/com_modules/module/edit.php | 2 +- .../com_modules/module/edit_assignment.php | 51 ++--- .../html/com_newsfeeds/newsfeed/edit.php | 10 +- .../html/com_newsfeeds/newsfeeds/default.php | 17 +- .../hathor/html/com_plugins/plugin/edit.php | 11 +- .../html/com_redirect/links/default.php | 15 ++ .../hathor/html/com_tags/tag/edit.php | 14 +- .../hathor/html/com_tags/tags/default.php | 17 +- .../html/com_tags/tags/default_batch.php | 44 ---- .../hathor/html/com_templates/style/edit.php | 11 +- .../html/com_templates/template/default.php | 206 +++++++++--------- .../hathor/html/com_users/groups/default.php | 49 +++-- .../hathor/html/com_users/user/edit.php | 10 +- .../hathor/html/com_users/users/default.php | 1 - .../hathor/html/com_weblinks/weblink/edit.php | 11 +- administrator/templates/hathor/index.php | 3 + administrator/templates/hathor/js/template.js | 80 +++---- administrator/templates/hathor/login.php | 3 + 42 files changed, 536 insertions(+), 544 deletions(-) delete mode 100644 administrator/templates/hathor/html/com_categories/categories/default_batch.php delete mode 100644 administrator/templates/hathor/html/com_tags/tags/default_batch.php diff --git a/administrator/templates/hathor/component.php b/administrator/templates/hathor/component.php index 3d62b434dadb7..c672b967cdfc7 100644 --- a/administrator/templates/hathor/component.php +++ b/administrator/templates/hathor/component.php @@ -18,6 +18,9 @@ $app = JFactory::getApplication(); $doc = JFactory::getDocument(); +// jQuery needed by template.js +JHtml::_('jquery.framework'); + // Load optional RTL Bootstrap CSS JHtml::_('bootstrap.loadCss', false, $this->direction); diff --git a/administrator/templates/hathor/html/com_admin/profile/edit.php b/administrator/templates/hathor/html/com_admin/profile/edit.php index 426eca9f63f83..364249e1ccb56 100644 --- a/administrator/templates/hathor/html/com_admin/profile/edit.php +++ b/administrator/templates/hathor/html/com_admin/profile/edit.php @@ -12,22 +12,21 @@ // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidation'); +JHtml::_('behavior.formvalidator'); // Get the form fieldsets. $fieldsets = $this->form->getFieldsets(); -?> - - +"); +?>
    diff --git a/administrator/templates/hathor/html/com_banners/banner/edit.php b/administrator/templates/hathor/html/com_banners/banner/edit.php index 6b98c7e2a6bcd..f5b1830124d78 100644 --- a/administrator/templates/hathor/html/com_banners/banner/edit.php +++ b/administrator/templates/hathor/html/com_banners/banner/edit.php @@ -11,18 +11,18 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); -JHtml::_('behavior.formvalidation'); -?> - - +"); +?>
    diff --git a/administrator/templates/hathor/html/com_banners/banners/default.php b/administrator/templates/hathor/html/com_banners/banners/default.php index b6cb203a1b66f..8852105995582 100644 --- a/administrator/templates/hathor/html/com_banners/banners/default.php +++ b/administrator/templates/hathor/html/com_banners/banners/default.php @@ -224,8 +224,6 @@ 'collapseModal', array( 'title' => JText::_('COM_BANNERS_BATCH_OPTIONS'), - 'width' => '800px', - 'height' => '300px', 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') diff --git a/administrator/templates/hathor/html/com_banners/client/edit.php b/administrator/templates/hathor/html/com_banners/client/edit.php index 3ba67c2151602..8616623d358d7 100644 --- a/administrator/templates/hathor/html/com_banners/client/edit.php +++ b/administrator/templates/hathor/html/com_banners/client/edit.php @@ -11,17 +11,18 @@ JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidation'); -?> - +"); +?> diff --git a/administrator/templates/hathor/html/com_categories/categories/default.php b/administrator/templates/hathor/html/com_categories/categories/default.php index 0c540a8f6b2c5..adb42ad6a9e03 100644 --- a/administrator/templates/hathor/html/com_categories/categories/default.php +++ b/administrator/templates/hathor/html/com_categories/categories/default.php @@ -13,7 +13,6 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHtml::_('behavior.multiselect'); -JHtml::_('behavior.modal'); $app = JFactory::getApplication(); $user = JFactory::getUser(); @@ -23,7 +22,6 @@ $listDirn = $this->escape($this->state->get('list.direction')); $ordering = ($listOrder == 'a.lft'); $saveOrder = ($listOrder == 'a.lft' && $listDirn == 'asc'); -$assoc = JLanguageAssociations::isEnabled(); ?>
    @@ -101,7 +99,7 @@ - + assoc) : ?> @@ -165,7 +163,7 @@ escape($item->access_level); ?> - + assoc) : ?> association): ?> id, $extension); ?> @@ -192,7 +190,19 @@
    - loadTemplate('batch'); ?> + authorise('core.create', $extension) + && $user->authorise('core.edit', $extension) + && $user->authorise('core.edit.state', $extension)) : ?> + JText::_('COM_CATEGORIES_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + diff --git a/administrator/templates/hathor/html/com_categories/categories/default_batch.php b/administrator/templates/hathor/html/com_categories/categories/default_batch.php deleted file mode 100644 index e672b6828da51..0000000000000 --- a/administrator/templates/hathor/html/com_categories/categories/default_batch.php +++ /dev/null @@ -1,63 +0,0 @@ -state->get('filter.published'); -$extension = $this->escape($this->state->get('filter.extension')); -?> - diff --git a/administrator/templates/hathor/html/com_categories/category/edit.php b/administrator/templates/hathor/html/com_categories/category/edit.php index bd07019ecfb4b..ce8029278985d 100644 --- a/administrator/templates/hathor/html/com_categories/category/edit.php +++ b/administrator/templates/hathor/html/com_categories/category/edit.php @@ -16,22 +16,21 @@ $saveHistory = $this->state->get('params')->get('save_history', 0); -JHtml::_('behavior.formvalidation'); JHtml::_('behavior.keepalive'); +JHtml::_('behavior.formvalidator'); -$assoc = JLanguageAssociations::isEnabled(); - -?> - - +"); +$assoc = JLanguageAssociations::isEnabled(); + +?>
    diff --git a/administrator/templates/hathor/html/com_config/application/default.php b/administrator/templates/hathor/html/com_config/application/default.php index 03ec6d030731f..9de28a7bb0a76 100644 --- a/administrator/templates/hathor/html/com_config/application/default.php +++ b/administrator/templates/hathor/html/com_config/application/default.php @@ -9,21 +9,21 @@ defined('_JEXEC') or die; -JHtml::_('behavior.formvalidation'); +JHtml::_('behavior.formvalidator'); JHtml::_('behavior.switcher'); // Load submenu template, using element id 'submenu' as needed by behavior.switcher $this->document->setBuffer($this->loadTemplate('navigation'), 'modules', 'submenu'); -?> - +"); +?> ftp) : ?> diff --git a/administrator/templates/hathor/html/com_config/component/default.php b/administrator/templates/hathor/html/com_config/component/default.php index cdd9c0f6392c7..9e6350ea2e28d 100644 --- a/administrator/templates/hathor/html/com_config/component/default.php +++ b/administrator/templates/hathor/html/com_config/component/default.php @@ -12,17 +12,18 @@ $app = JFactory::getApplication(); $template = $app->getTemplate(); -JHtml::_('behavior.formvalidation'); +JHtml::_('behavior.formvalidator'); JHtml::_('bootstrap.framework'); -?> - +"); +?> component->option . '_configuration', array('useCookie' => 1)); diff --git a/administrator/templates/hathor/html/com_contact/contact/edit.php b/administrator/templates/hathor/html/com_contact/contact/edit.php index 64284002b1078..581b1b11807a1 100644 --- a/administrator/templates/hathor/html/com_contact/contact/edit.php +++ b/administrator/templates/hathor/html/com_contact/contact/edit.php @@ -12,7 +12,7 @@ // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidation'); +JHtml::_('behavior.formvalidator'); $app = JFactory::getApplication(); $input = $app->input; @@ -21,18 +21,17 @@ $assoc = JLanguageAssociations::isEnabled(); -?> - - +"); +?>
    diff --git a/administrator/templates/hathor/html/com_contact/contacts/default.php b/administrator/templates/hathor/html/com_contact/contacts/default.php index 51866e0d551a8..ca72a8404464d 100644 --- a/administrator/templates/hathor/html/com_contact/contacts/default.php +++ b/administrator/templates/hathor/html/com_contact/contacts/default.php @@ -12,7 +12,6 @@ JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.multiselect'); -JHtml::_('behavior.modal'); $app = JFactory::getApplication(); $user = JFactory::getUser(); @@ -219,8 +218,20 @@ - - loadTemplate('batch'); ?> + + authorise('core.create', 'com_contact') + && $user->authorise('core.edit', 'com_contact') + && $user->authorise('core.edit.state', 'com_contact')) : ?> + JText::_('COM_CONTACT_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + pagination->getListFooter(); ?> diff --git a/administrator/templates/hathor/html/com_content/article/edit.php b/administrator/templates/hathor/html/com_content/article/edit.php index c81f50d0ee48f..42a1b795bdb3b 100644 --- a/administrator/templates/hathor/html/com_content/article/edit.php +++ b/administrator/templates/hathor/html/com_content/article/edit.php @@ -12,7 +12,7 @@ // Include the component HTML helpers. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidation'); +JHtml::_('behavior.formvalidator'); JHtml::_('behavior.keepalive'); // Create shortcut to parameters. @@ -45,19 +45,17 @@ $assoc = JLanguageAssociations::isEnabled(); -?> - - - +"); +?>
    diff --git a/administrator/templates/hathor/html/com_content/articles/default.php b/administrator/templates/hathor/html/com_content/articles/default.php index 753edc4905f7e..788ea7e082705 100644 --- a/administrator/templates/hathor/html/com_content/articles/default.php +++ b/administrator/templates/hathor/html/com_content/articles/default.php @@ -12,7 +12,6 @@ JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.multiselect'); -JHtml::_('behavior.modal'); $app = JFactory::getApplication(); $user = JFactory::getUser(); @@ -232,8 +231,20 @@ - - loadTemplate('batch'); ?> + + authorise('core.create', 'com_content') + && $user->authorise('core.edit', 'com_content') + && $user->authorise('core.edit.state', 'com_content')) : ?> + JText::_('COM_CONTENT_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + pagination->getListFooter(); ?> diff --git a/administrator/templates/hathor/html/com_finder/filters/default.php b/administrator/templates/hathor/html/com_finder/filters/default.php index 580e17fe0f768..0d2d684fca133 100644 --- a/administrator/templates/hathor/html/com_finder/filters/default.php +++ b/administrator/templates/hathor/html/com_finder/filters/default.php @@ -15,9 +15,8 @@ $listDirn = $this->escape($this->state->get('list.direction')); JText::script('COM_FINDER_INDEX_CONFIRM_DELETE_PROMPT'); -?> - +"); +?> sidebar)) : ?> diff --git a/administrator/templates/hathor/html/com_finder/index/default.php b/administrator/templates/hathor/html/com_finder/index/default.php index d9f285597d3ba..08319d4316693 100644 --- a/administrator/templates/hathor/html/com_finder/index/default.php +++ b/administrator/templates/hathor/html/com_finder/index/default.php @@ -17,38 +17,37 @@ $lang = JFactory::getLanguage(); JText::script('COM_FINDER_INDEX_CONFIRM_PURGE_PROMPT'); JText::script('COM_FINDER_INDEX_CONFIRM_DELETE_PROMPT'); -?> - + Joomla.submitform(pressbutton); + } +"); +?> sidebar)) : ?>
    diff --git a/administrator/templates/hathor/html/com_finder/maps/default.php b/administrator/templates/hathor/html/com_finder/maps/default.php index ce6c26a394ba7..381de5a5c5632 100644 --- a/administrator/templates/hathor/html/com_finder/maps/default.php +++ b/administrator/templates/hathor/html/com_finder/maps/default.php @@ -16,25 +16,26 @@ $lang = JFactory::getLanguage(); JText::script('COM_FINDER_MAPS_CONFIRM_DELETE_PROMPT'); -?> - +"); +?> + sidebar)) : ?>
    diff --git a/administrator/templates/hathor/html/com_installer/install/default_form.php b/administrator/templates/hathor/html/com_installer/install/default_form.php index faccc90774ba0..fa3bb0dc06d3a 100644 --- a/administrator/templates/hathor/html/com_installer/install/default_form.php +++ b/administrator/templates/hathor/html/com_installer/install/default_form.php @@ -13,15 +13,14 @@ JHtml::_('behavior.framework', true); JHtml::_('bootstrap.tooltip'); -?> - - +"); +?> sidebar)) : ?>
    diff --git a/administrator/templates/hathor/html/com_menus/item/edit.php b/administrator/templates/hathor/html/com_menus/item/edit.php index f87dd6ef93619..b7b64b60f71e9 100644 --- a/administrator/templates/hathor/html/com_menus/item/edit.php +++ b/administrator/templates/hathor/html/com_menus/item/edit.php @@ -13,67 +13,66 @@ JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); JHtml::_('behavior.framework'); -JHtml::_('behavior.formvalidation'); +JHtml::_('behavior.formvalidator'); JHtml::_('behavior.modal'); -//Ajax for parent items -$script = "jQuery(document).ready(function ($){ - $('#jform_menutype').change(function(){ - var menutype = $(this).val(); - $.ajax({ - url: 'index.php?option=com_menus&task=item.getParentItem&menutype=' + menutype, - dataType: 'json' - }).done(function(data) { - $('#jform_parent_id option').each(function() { - if ($(this).val() != '1') { - $(this).remove(); - } - }); - - $.each(data, function (i, val) { - var option = $('
    @@ -488,7 +517,7 @@ class="well" > - +
    @@ -499,6 +528,7 @@ class="well" >
    +
    diff --git a/administrator/components/com_templates/views/template/tmpl/readonly.php b/administrator/components/com_templates/views/template/tmpl/readonly.php new file mode 100644 index 0000000000000..2da41dad0dfd8 --- /dev/null +++ b/administrator/components/com_templates/views/template/tmpl/readonly.php @@ -0,0 +1,27 @@ +input; +?> +
    + 'description')); ?> + + loadTemplate('description');?> + + + + +
    diff --git a/administrator/components/com_templates/views/template/view.html.php b/administrator/components/com_templates/views/template/view.html.php index 63d91e1a4b656..ab603259bc3f0 100644 --- a/administrator/components/com_templates/views/template/view.html.php +++ b/administrator/components/com_templates/views/template/view.html.php @@ -151,6 +151,11 @@ public function display($tpl = null) $this->addToolbar(); + if (!JFactory::getUser()->authorise('core.admin')) + { + $this->setLayout('readonly'); + } + return parent::display($tpl); } @@ -164,17 +169,11 @@ public function display($tpl = null) protected function addToolbar() { $app = JFactory::getApplication(); + $user = JFactory::getUser(); $app->input->set('hidemainmenu', true); - $canDo = JHelperContent::getActions('com_templates'); - if ($canDo->get('core.edit') && $canDo->get('core.create') && $canDo->get('core.admin')) - { - $showButton = true; - } - else - { - $showButton = false; - } + // User is global SuperUser + $isSuperUser = $user->authorise('core.admin'); // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); @@ -183,38 +182,29 @@ protected function addToolbar() JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'eye thememanager'); - // Add a Apply and save button - if ($this->type == 'file') + // Only show file edit buttons for global SuperUser + if ($isSuperUser) { - if ($showButton) + // Add a Apply and save button + if ($this->type == 'file') { JToolbarHelper::apply('template.apply'); JToolbarHelper::save('template.save'); } - } - // Add a Crop and Resize button - elseif ($this->type == 'image') - { - if ($showButton) + // Add a Crop and Resize button + elseif ($this->type == 'image') { JToolbarHelper::custom('template.cropImage', 'move', 'move', 'COM_TEMPLATES_BUTTON_CROP', false, false); - JToolbarHelper::modal('resizeModal', 'icon-refresh', 'COM_TEMPLATES_BUTTON_RESIZE'); } - } - // Add an extract button - elseif ($this->type == 'archive') - { - if ($showButton) + // Add an extract button + elseif ($this->type == 'archive') { JToolbarHelper::custom('template.extractArchive', 'arrow-down', 'arrow-down', 'COM_TEMPLATES_BUTTON_EXTRACT_ARCHIVE', false, false); } - } - // Add a copy template button (Hathor override doesn't need the button) - if ($app->getTemplate() != 'hathor') - { - if ($showButton) + // Add a copy template button (Hathor override doesn't need the button) + if ($app->getTemplate() != 'hathor') { JToolbarHelper::modal('collapseModal', 'icon-copy', 'COM_TEMPLATES_BUTTON_COPY_TEMPLATE'); } @@ -226,36 +216,28 @@ protected function addToolbar() $bar->appendButton('Popup', 'picture', 'COM_TEMPLATES_BUTTON_PREVIEW', JUri::root() . 'index.php?tp=1&templateStyle=' . $this->preview->id, 800, 520); } - // Add Manage folders button - if ($showButton) + // Only show file manage buttons for global SuperUser + if ($isSuperUser) { + // Add Manage folders button JToolbarHelper::modal('folderModal', 'icon-folder icon white', 'COM_TEMPLATES_BUTTON_FOLDERS'); - } - // Add a new file button - if ($showButton) - { + // Add a new file button JToolbarHelper::modal('fileModal', 'icon-file', 'COM_TEMPLATES_BUTTON_FILE'); - } - // Add a Rename file Button (Hathor override doesn't need the button) - if ($app->getTemplate() != 'hathor') - { - if ($showButton && $this->type != 'home') + // Add a Rename file Button (Hathor override doesn't need the button) + if ($app->getTemplate() != 'hathor' && $this->type != 'home') { JToolbarHelper::modal('renameModal', 'icon-refresh', 'COM_TEMPLATES_BUTTON_RENAME_FILE'); } - } - // Add a Delete file Button - if ($showButton && $this->type != 'home') - { - JToolbarHelper::modal('deleteModal', 'icon-remove', 'COM_TEMPLATES_BUTTON_DELETE_FILE'); - } + // Add a Delete file Button + if ($this->type != 'home') + { + JToolbarHelper::modal('deleteModal', 'icon-remove', 'COM_TEMPLATES_BUTTON_DELETE_FILE'); + } - // Add a Compile Button - if ($showButton) - { + // Add a Compile Button if ($ext == 'less') { JToolbarHelper::custom('template.less', 'play', 'play', 'COM_TEMPLATES_BUTTON_LESS', false, false); diff --git a/administrator/includes/framework.php b/administrator/includes/framework.php index 01088014e3f81..dc1019d853536 100644 --- a/administrator/includes/framework.php +++ b/administrator/includes/framework.php @@ -13,7 +13,7 @@ // Installation check, and check on removal of the install directory. if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') - || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) /*|| file_exists(JPATH_INSTALLATION . '/index.php')*/) + || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) || file_exists(JPATH_INSTALLATION . '/index.php')) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 1229b30ca8bb4..4da1b34a5a542 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2005 - 2015 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.4.2-rc2-dev + 3.4.2 June 2015 FILES_JOOMLA_XML_DESCRIPTION diff --git a/components/com_config/controller/canceladmin.php b/components/com_config/controller/canceladmin.php index dad1733a17b48..09d3fd494ca18 100644 --- a/components/com_config/controller/canceladmin.php +++ b/components/com_config/controller/canceladmin.php @@ -67,6 +67,12 @@ public function execute() if (!empty($this->redirect)) { + // Don't redirect to an external URL. + if (!JUri::isInternal($this->redirect)) + { + $this->redirect = JUri::base(); + } + $this->app->redirect($this->redirect); } else diff --git a/components/com_config/controller/modules/display.php b/components/com_config/controller/modules/display.php index 1e72f0503a624..9aa62954361b2 100644 --- a/components/com_config/controller/modules/display.php +++ b/components/com_config/controller/modules/display.php @@ -40,11 +40,15 @@ public function execute() $returnUri = $this->input->get->get('return', null, 'base64'); // Construct redirect URI - $redirect = ''; - if (!empty($returnUri)) { $redirect = base64_decode(urldecode($returnUri)); + + // Don't redirect to an external URL. + if (!JUri::isInternal($redirect)) + { + $redirect = JUri::base(); + } } else { diff --git a/components/com_config/controller/modules/save.php b/components/com_config/controller/modules/save.php index 16f8450672fd5..c6e08774dde5d 100644 --- a/components/com_config/controller/modules/save.php +++ b/components/com_config/controller/modules/save.php @@ -104,6 +104,12 @@ public function execute() if (!empty($returnUri)) { $redirect = base64_decode(urldecode($returnUri)); + + // Don't redirect to an external URL. + if (!JUri::isInternal($redirect)) + { + $redirect = JUri::base(); + } } else { diff --git a/components/com_users/controllers/profile.php b/components/com_users/controllers/profile.php index 4e413096e32a9..045794e719668 100644 --- a/components/com_users/controllers/profile.php +++ b/components/com_users/controllers/profile.php @@ -174,6 +174,12 @@ public function save() $redirect = $app->getUserState('com_users.edit.profile.redirect'); + // Don't redirect to an external URL. + if (!JUri::isInternal($redirect)) + { + $redirect = null; + } + if (!$redirect) { $redirect = 'index.php?option=com_users&view=profile&layout=edit&hidemainmenu=1'; @@ -194,14 +200,22 @@ public function save() // Clear the profile id from the session. $app->setUserState('com_users.edit.profile.id', null); + $redirect = $app->getUserState('com_users.edit.profile.redirect'); + + // Don't redirect to an external URL. + if (!JUri::isInternal($redirect)) + { + $redirect = null; + } + + if (!$redirect) + { + $redirect = 'index.php?option=com_users&view=profile&user_id=' . $return; + } + // Redirect to the list screen. $this->setMessage(JText::_('COM_USERS_PROFILE_SAVE_SUCCESS')); - $this->setRedirect( - JRoute::_( - ($redirect = $app->getUserState('com_users.edit.profile.redirect')) ? $redirect : 'index.php?option=com_users&view=profile&user_id=' . $return, - false - ) - ); + $this->setRedirect(JRoute::_($redirect, false)); break; } diff --git a/components/com_users/controllers/user.php b/components/com_users/controllers/user.php index 92e43b3740b99..4293ed8b1138c 100644 --- a/components/com_users/controllers/user.php +++ b/components/com_users/controllers/user.php @@ -41,6 +41,12 @@ public function login() $data['password'] = $input->$method->get('password', '', 'RAW'); $data['secretkey'] = $input->$method->get('secretkey', '', 'RAW'); + // Don't redirect to an external URL. + if (!JUri::isInternal($data['return'])) + { + $data['return'] = ''; + } + // Set the return URL if empty. if (empty($data['return'])) { diff --git a/includes/framework.php b/includes/framework.php index a3bea7e030fcc..d07c075dc8f7d 100644 --- a/includes/framework.php +++ b/includes/framework.php @@ -13,7 +13,7 @@ // Installation check, and check on removal of the install directory. if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') - || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) /*|| file_exists(JPATH_INSTALLATION . '/index.php')*/) + || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) || file_exists(JPATH_INSTALLATION . '/index.php')) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { diff --git a/libraries/cms/version/version.php b/libraries/cms/version/version.php index 8ebfb8a7944a8..cf3db7ff14d56 100644 --- a/libraries/cms/version/version.php +++ b/libraries/cms/version/version.php @@ -23,10 +23,10 @@ final class JVersion public $RELEASE = '3.4'; /** @var string Maintenance version. */ - public $DEV_LEVEL = '2-rc2-dev'; + public $DEV_LEVEL = '2'; /** @var string Development STATUS. */ - public $DEV_STATUS = 'Release Candidate'; + public $DEV_STATUS = 'Stable'; /** @var string Build number. */ public $BUILD = ''; @@ -35,10 +35,10 @@ final class JVersion public $CODENAME = 'Ember'; /** @var string Release date. */ - public $RELDATE = '20-June-2015'; + public $RELDATE = '30-June-2015'; /** @var string Release time. */ - public $RELTIME = '23:30'; + public $RELTIME = '12:00'; /** @var string Release timezone. */ public $RELTZ = 'GMT'; From 4b433dc95163cbf57af83daafc9b6e911f258c63 Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Tue, 30 Jun 2015 17:22:06 +0200 Subject: [PATCH 542/809] Reset for development --- administrator/includes/framework.php | 2 +- administrator/manifests/files/joomla.xml | 2 +- includes/framework.php | 2 +- libraries/cms/version/version.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/administrator/includes/framework.php b/administrator/includes/framework.php index dc1019d853536..bf66c9c6e5ab7 100644 --- a/administrator/includes/framework.php +++ b/administrator/includes/framework.php @@ -13,7 +13,7 @@ // Installation check, and check on removal of the install directory. if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') - || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) || file_exists(JPATH_INSTALLATION . '/index.php')) + || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) /* || file_exists(JPATH_INSTALLATION . '/index.php')*/) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 4da1b34a5a542..712c23a15630e 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2005 - 2015 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.4.2 + 3.4.3-dev June 2015 FILES_JOOMLA_XML_DESCRIPTION diff --git a/includes/framework.php b/includes/framework.php index d07c075dc8f7d..a3bea7e030fcc 100644 --- a/includes/framework.php +++ b/includes/framework.php @@ -13,7 +13,7 @@ // Installation check, and check on removal of the install directory. if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') - || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) || file_exists(JPATH_INSTALLATION . '/index.php')) + || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) /*|| file_exists(JPATH_INSTALLATION . '/index.php')*/) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { diff --git a/libraries/cms/version/version.php b/libraries/cms/version/version.php index cf3db7ff14d56..6f4575818c0f6 100644 --- a/libraries/cms/version/version.php +++ b/libraries/cms/version/version.php @@ -23,10 +23,10 @@ final class JVersion public $RELEASE = '3.4'; /** @var string Maintenance version. */ - public $DEV_LEVEL = '2'; + public $DEV_LEVEL = '3-dev'; /** @var string Development STATUS. */ - public $DEV_STATUS = 'Stable'; + public $DEV_STATUS = 'development'; /** @var string Build number. */ public $BUILD = ''; From ca0c2f9d76e0b5e5873c311b0fce0c351a6b53bb Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 1 Jul 2015 12:32:26 +0200 Subject: [PATCH 543/809] Having a multilang-site should not override the option of JCategories --- libraries/legacy/categories/categories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/legacy/categories/categories.php b/libraries/legacy/categories/categories.php index 6e0e68692255a..9a847536ff74c 100644 --- a/libraries/legacy/categories/categories.php +++ b/libraries/legacy/categories/categories.php @@ -261,7 +261,7 @@ protected function _load($id) ->where('badcats.id is null'); // Note: i for item - if ($this->_options['currentlang'] !== 0 || $this->_options['countItems'] == 1) + if ($this->_options['countItems'] == 1) { $queryjoin = $db->quoteName($this->_table) . ' AS i ON i.' . $db->quoteName($this->_field) . ' = c.id'; From b75ab38b9f9cada8a1c16d60adc4d938975a74b4 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Wed, 1 Jul 2015 17:50:49 +0200 Subject: [PATCH 544/809] Updated japanese installation language files. --- installation/language/ja-JP/ja-JP.ini | 9 ++++++--- installation/language/ja-JP/ja-JP.xml | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/installation/language/ja-JP/ja-JP.ini b/installation/language/ja-JP/ja-JP.ini index 3f341431d8f3e..8379279d22969 100644 --- a/installation/language/ja-JP/ja-JP.ini +++ b/installation/language/ja-JP/ja-JP.ini @@ -3,8 +3,6 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt ; Note : All ini files need to be saved as UTF-8 - - ;Stepbar INSTL_STEP_COMPLETE_LABEL="完了" INSTL_STEP_DATABASE_LABEL="データベース" @@ -137,7 +135,6 @@ INSTL_LANGUAGES_DESC="Joomla!のインターフェイスは、いくつかの言 INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="完了までに言語ごとに最大10秒かかります。
    言語をダウンロードしてインストールが完了するまで、しばらくお待ちください..." INSTL_LANGUAGES_MORE_LANGUAGES="もっと多くの言語をインストールするには「前へ」ボタンを押してください。" INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="インストールする言語を選択してください。さらに言語を追加する場合は、「前へ」ボタンを押して一覧から言語を選んでください。" -INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="インストールする言語を選択してください。他の言語をインストールする必要がない場合は、「前へ」ボタンを押してください" INSTL_LANGUAGES_WARNING_NO_INTERNET="Joomla!の言語サーバに接続できませんでした。インストール作業を完了してください。" INSTL_LANGUAGES_WARNING_NO_INTERNET2="(注)後ほど管理画面から言語をインストールすることができます。" INSTL_LANGUAGES_WARNING_BACK_BUTTON="最後のインストール手順に戻る" @@ -181,6 +178,7 @@ INSTL_DEFAULTLANGUAGE_NATIVE_LANGUAGE_NAME="日本語" ;Database Model INSTL_DATABASE_COULD_NOT_CONNECT="データベースに接続できませんでした。コネクタから返された番号: %s" +INSTL_DATABASE_COULD_NOT_CREATE_DATABASE="インストーラは、指定されたデータベースに接続してデータベースを作成することができませんでした。設定を確認し、必要に応じて手動でデータベースを作成してください。" INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE="エクステンションのマニフェストキャッシュを更新できませんでした: %s" INSTL_DATABASE_EMPTY_NAME="" INSTL_DATABASE_ERROR_BACKINGUP="データベースのバックアップ中にいくつかのエラーが発生しました。" @@ -192,6 +190,8 @@ INSTL_DATABASE_FIX_TOO_LONG="The MySQLテーブルのプレフィックスは最 INSTL_DATABASE_INVALID_DB_DETAILS="提供されたデータベース情報に誤りがあるか、または空です。" INSTL_DATABASE_INVALID_MYSQL_VERSION="インストールを続行するにはMySQL 5.0.4以上が必要です。お使いのバージョンは %s です。" INSTL_DATABASE_INVALID_MYSQLI_VERSION="インストールを続行するにはMySQL 5.0.4以上が必要です。お使いのバージョンは %s です。" +INSTL_DATABASE_INVALID_PDOMYSQL_VERSION="インストールを継続するにはMySQL5.0.4以上が必要です。お使いのバージョンは %s です。" +INSTL_DATABASE_INVALID_POSTGRESQL_VERSION="インストールを継続するにはPostgreSQL 8.3.18以上が必要です。お使いのバージョンは %s です。" INSTL_DATABASE_INVALID_SQLSRV_VERSION="インストールを続行するにはSQLサーバ 2008 R2 (10.50.1600.1)以上が必要です。お使いのバージョンは %s です。" INSTL_DATABASE_INVALID_SQLZURE_VERSION="インストールを続行するにはSQLサーバ 2008 R2 (10.50.1600.1)以上が必要です。お使いのバージョンは %s です。" INSTL_DATABASE_INVALID_TYPE="データベースの種類を選択してください" @@ -248,6 +248,7 @@ INSTL_NOTICEYOUCANSTILLINSTALL="
    このままインストールを続行す INSTL_OUTPUT_BUFFERING="Output Buffering" INSTL_PARSE_INI_FILE_AVAILABLE="INI Parser Support" INSTL_PHP_VERSION="PHPのバージョン" +INSTL_PHP_VERSION_NEWER="PHP Version >= %s" INSTL_REGISTER_GLOBALS="Register Globals Off" INSTL_SAFE_MODE="Safe Mode" INSTL_SESSION_AUTO_START="Session Auto Start" @@ -289,6 +290,7 @@ JLIB_FORM_FIELD_INVALID="未入力箇所があります: " JLIB_FORM_VALIDATE_FIELD_REQUIRED="%s は入力必須です" JLIB_FORM_VALIDATE_FIELD_INVALID="無効な項目です: %s" JLIB_INSTALLER_ERROR_FAIL_COPY_FILE="JInstaller: :Install: ファイル %1$s を %2$s にコピーできませんでした" +JLIB_INSTALLER_NOT_ERROR="If the error is related to the installation of TinyMCE language files it has no effect on the installation of the language(s). Some language packs created prior to Joomla! 3.2.0 may try to install separate TinyMCE language files. As these are now included in the core they no longer need to be installed." JLIB_UTIL_ERROR_CONNECT_DATABASE="JDatabase: :getInstance: データベースに接続できませんでした
    joomla.library: %1$s - %2$s" ; Strings for the language debugger @@ -306,6 +308,7 @@ SITE_NAME="サイト名" MYSQL="MySQL" MYSQLI="MySQLi" ORACLE="Oracle" +PDOMYSQL="MySQL (PDO)" POSTGRESQL="PostgreSQL" SQLAZURE="Microsoft SQL Azure" SQLITE="SQLite" diff --git a/installation/language/ja-JP/ja-JP.xml b/installation/language/ja-JP/ja-JP.xml index 58921e2652b7a..316ccc787a82b 100644 --- a/installation/language/ja-JP/ja-JP.xml +++ b/installation/language/ja-JP/ja-JP.xml @@ -1,9 +1,9 @@ Japanese 日本語 (Japan) - 3.2.0 + 3.4.2 2012-09-24 Japanese Translation Team Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. From a2a1bb1d8a3ad9c793df64c21fa04c81650860d9 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Wed, 1 Jul 2015 19:12:58 -0400 Subject: [PATCH 545/809] [bug] Move JClassLoader to be autoloaded, delete old files. Fixes #7307 --- administrator/components/com_admin/script.php | 3 +++ build.xml | 2 +- build/phpcs/Joomla/ruleset.xml | 2 -- libraries/cms.php | 1 - libraries/{classloader.php => cms/class/loader.php} | 9 +++++---- 5 files changed, 9 insertions(+), 8 deletions(-) rename libraries/{classloader.php => cms/class/loader.php} (80%) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index cd0c4978f55b0..3014c0ed6088a 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -1377,6 +1377,9 @@ public function deleteUnexistingFiles() '/administrator/components/com_config/views', '/administrator/components/com_config/models/fields', '/administrator/components/com_config/models/forms', + // Joomla 3.4.3 + '/libraries/classloader.php', + '/libraries/ClassLoader.php', ); jimport('joomla.filesystem.file'); diff --git a/build.xml b/build.xml index 4bd25ce5189bb..183826660d2ef 100644 --- a/build.xml +++ b/build.xml @@ -78,7 +78,7 @@ - + diff --git a/build/phpcs/Joomla/ruleset.xml b/build/phpcs/Joomla/ruleset.xml index 476b8d8e4f639..3fca9711379bc 100644 --- a/build/phpcs/Joomla/ruleset.xml +++ b/build/phpcs/Joomla/ruleset.xml @@ -21,8 +21,6 @@ administrator/components/com_joomlaupdate/restore.php configuration.php - libraries/ClassLoader.php - libraries/composer_autoload.php plugins/captcha/recaptcha/recaptchalib.php diff --git a/libraries/cms.php b/libraries/cms.php index a23e8de60e2a2..c2309cc20e425 100644 --- a/libraries/cms.php +++ b/libraries/cms.php @@ -34,7 +34,6 @@ $loader->unregister(); // Decorate Composer autoloader -require_once JPATH_LIBRARIES . '/classloader.php'; spl_autoload_register(array(new JClassLoader($loader), 'loadClass'), true, true); // Register the class aliases for Framework classes that have replaced their Platform equivilents diff --git a/libraries/classloader.php b/libraries/cms/class/loader.php similarity index 80% rename from libraries/classloader.php rename to libraries/cms/class/loader.php index 1e6a5f1e00f67..94e662b7015e3 100644 --- a/libraries/classloader.php +++ b/libraries/cms/class/loader.php @@ -1,9 +1,10 @@ Date: Tue, 30 Jun 2015 21:41:43 +0200 Subject: [PATCH 546/809] Simplification for the release process Fixes #7292 --- administrator/includes/framework.php | 27 +++++++++++++++------------ includes/framework.php | 27 +++++++++++++++------------ libraries/cms/version/version.php | 14 +++++++++++++- 3 files changed, 43 insertions(+), 25 deletions(-) diff --git a/administrator/includes/framework.php b/administrator/includes/framework.php index bf66c9c6e5ab7..9180ba5764f58 100644 --- a/administrator/includes/framework.php +++ b/administrator/includes/framework.php @@ -11,9 +11,23 @@ // Joomla system checks. @ini_set('magic_quotes_runtime', 0); +// System includes +require_once JPATH_LIBRARIES . '/import.legacy.php'; + +// Set system error handling +JError::setErrorHandling(E_NOTICE, 'message'); +JError::setErrorHandling(E_WARNING, 'message'); +JError::setErrorHandling(E_ERROR, 'message', array('JError', 'customErrorPage')); + +// Bootstrap the CMS libraries. +require_once JPATH_LIBRARIES . '/cms.php'; + +$version = new JVersion; + // Installation check, and check on removal of the install directory. if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') - || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) /* || file_exists(JPATH_INSTALLATION . '/index.php')*/) + || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) + || (file_exists(JPATH_INSTALLATION . '/index.php') && (false === $version->isInDevelopmentState()))) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { @@ -29,17 +43,6 @@ } } -// System includes -require_once JPATH_LIBRARIES . '/import.legacy.php'; - -// Set system error handling -JError::setErrorHandling(E_NOTICE, 'message'); -JError::setErrorHandling(E_WARNING, 'message'); -JError::setErrorHandling(E_ERROR, 'message', array('JError', 'customErrorPage')); - -// Bootstrap the CMS libraries. -require_once JPATH_LIBRARIES . '/cms.php'; - // Pre-Load configuration. Don't remove the Output Buffering due to BOM issues, see JCode 26026 ob_start(); require_once JPATH_CONFIGURATION . '/configuration.php'; diff --git a/includes/framework.php b/includes/framework.php index a3bea7e030fcc..726b14a3b6c0e 100644 --- a/includes/framework.php +++ b/includes/framework.php @@ -11,9 +11,23 @@ // Joomla system checks. @ini_set('magic_quotes_runtime', 0); +// System includes +require_once JPATH_LIBRARIES . '/import.legacy.php'; + +// Set system error handling +JError::setErrorHandling(E_NOTICE, 'message'); +JError::setErrorHandling(E_WARNING, 'message'); +JError::setErrorHandling(E_ERROR, 'callback', array('JError', 'customErrorPage')); + +// Bootstrap the CMS libraries. +require_once JPATH_LIBRARIES . '/cms.php'; + +$version = new JVersion; + // Installation check, and check on removal of the install directory. if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') - || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) /*|| file_exists(JPATH_INSTALLATION . '/index.php')*/) + || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) + || (file_exists(JPATH_INSTALLATION . '/index.php') && (false === $version->isInDevelopmentState()))) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { @@ -29,17 +43,6 @@ } } -// System includes -require_once JPATH_LIBRARIES . '/import.legacy.php'; - -// Set system error handling -JError::setErrorHandling(E_NOTICE, 'message'); -JError::setErrorHandling(E_WARNING, 'message'); -JError::setErrorHandling(E_ERROR, 'callback', array('JError', 'customErrorPage')); - -// Bootstrap the CMS libraries. -require_once JPATH_LIBRARIES . '/cms.php'; - // Pre-Load configuration. Don't remove the Output Buffering due to BOM issues, see JCode 26026 ob_start(); require_once JPATH_CONFIGURATION . '/configuration.php'; diff --git a/libraries/cms/version/version.php b/libraries/cms/version/version.php index 6f4575818c0f6..a4f6a339880c7 100644 --- a/libraries/cms/version/version.php +++ b/libraries/cms/version/version.php @@ -49,12 +49,24 @@ final class JVersion /** @var string Link text. */ public $URL = 'Joomla! is Free Software released under the GNU General Public License.'; + /** + * Check if we are in development mode + * + * @return boolean + * + * @since 3.4.3 + */ + public function isInDevelopmentState() + { + return strtolower($this->DEV_STATUS) != 'stable'; + } + /** * Compares two a "PHP standardized" version number against the current Joomla version. * * @param string $minimum The minimum version of the Joomla which is compatible. * - * @return bool True if the version is compatible. + * @return boolean True if the version is compatible. * * @see http://www.php.net/version_compare * @since 1.0 From d6be3a5b24789f751e005668cbd6db76cc22c1cd Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Thu, 2 Jul 2015 10:08:10 +0200 Subject: [PATCH 547/809] [fix] Setting proper default values for access level --- administrator/components/com_categories/models/category.php | 2 +- administrator/components/com_content/models/article.php | 2 +- administrator/components/com_modules/models/module.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php index f5b866c09cafc..99c7c5f2311c6 100644 --- a/administrator/components/com_categories/models/category.php +++ b/administrator/components/com_categories/models/category.php @@ -325,7 +325,7 @@ protected function loadFormData() $data->set('published', $app->input->getInt('published', (isset($filters['published']) ? $filters['published'] : null))); $data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null))); - $data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : null))); + $data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); } } diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index 5ffca55b1df7c..51e5555850be9 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -426,7 +426,7 @@ protected function loadFormData() $data->set('state', $app->input->getInt('state', (isset($filters['published']) ? $filters['published'] : null))); $data->set('catid', $app->input->getInt('catid', (isset($filters['category_id']) ? $filters['category_id'] : null))); $data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null))); - $data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : null))); + $data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); } } diff --git a/administrator/components/com_modules/models/module.php b/administrator/components/com_modules/models/module.php index 6cd83d5a45a0e..614c7b581cce5 100644 --- a/administrator/components/com_modules/models/module.php +++ b/administrator/components/com_modules/models/module.php @@ -599,7 +599,7 @@ protected function loadFormData() $data->set('published', $app->input->getInt('published', (isset($filters['state']) ? $filters['state'] : null))); $data->set('position', $app->input->getInt('position', (isset($filters['position']) ? $filters['position'] : null))); $data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null))); - $data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : null))); + $data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); } // This allows us to inject parameter settings into a new module. From f4c5eb739dd014c036d0f311c4e06d6f29b2607f Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Thu, 2 Jul 2015 10:32:37 +0200 Subject: [PATCH 548/809] [fix] Change checks to !empty() instead of isset() --- .../components/com_categories/models/category.php | 6 +++--- administrator/components/com_content/models/article.php | 8 ++++---- administrator/components/com_modules/models/module.php | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php index 99c7c5f2311c6..4bd98e8b7495d 100644 --- a/administrator/components/com_categories/models/category.php +++ b/administrator/components/com_categories/models/category.php @@ -323,9 +323,9 @@ protected function loadFormData() $extension = substr($app->getUserState('com_categories.categories.filter.extension'), 4); $filters = (array) $app->getUserState('com_categories.categories.' . $extension . '.filter'); - $data->set('published', $app->input->getInt('published', (isset($filters['published']) ? $filters['published'] : null))); - $data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null))); - $data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); + $data->set('published', $app->input->getInt('published', (!empty($filters['published']) ? $filters['published'] : null))); + $data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null))); + $data->set('access', $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); } } diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index 51e5555850be9..d57721a75bc5e 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -423,10 +423,10 @@ protected function loadFormData() if ($this->getState('article.id') == 0) { $filters = (array) $app->getUserState('com_content.articles.filter'); - $data->set('state', $app->input->getInt('state', (isset($filters['published']) ? $filters['published'] : null))); - $data->set('catid', $app->input->getInt('catid', (isset($filters['category_id']) ? $filters['category_id'] : null))); - $data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null))); - $data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); + $data->set('state', $app->input->getInt('state', (!empty($filters['published']) ? $filters['published'] : null))); + $data->set('catid', $app->input->getInt('catid', (!empty($filters['category_id']) ? $filters['category_id'] : null))); + $data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null))); + $data->set('access', $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); } } diff --git a/administrator/components/com_modules/models/module.php b/administrator/components/com_modules/models/module.php index 614c7b581cce5..2d165b86c51ab 100644 --- a/administrator/components/com_modules/models/module.php +++ b/administrator/components/com_modules/models/module.php @@ -596,10 +596,10 @@ protected function loadFormData() if (!$data->id) { $filters = (array) $app->getUserState('com_modules.modules.filter'); - $data->set('published', $app->input->getInt('published', (isset($filters['state']) ? $filters['state'] : null))); - $data->set('position', $app->input->getInt('position', (isset($filters['position']) ? $filters['position'] : null))); - $data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null))); - $data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); + $data->set('published', $app->input->getInt('published', (!empty($filters['state']) ? $filters['state'] : null))); + $data->set('position', $app->input->getInt('position', (!empty($filters['position']) ? $filters['position'] : null))); + $data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null))); + $data->set('access', $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))); } // This allows us to inject parameter settings into a new module. From d2ba06bc63b46cf113f6460d04fd15ab5349b107 Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Thu, 2 Jul 2015 14:16:43 +0200 Subject: [PATCH 549/809] value is null so it doesn't match to the empty option null !== "" --- libraries/joomla/form/rule/options.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/joomla/form/rule/options.php b/libraries/joomla/form/rule/options.php index 7b98ffb5bef67..5418002ec2916 100644 --- a/libraries/joomla/form/rule/options.php +++ b/libraries/joomla/form/rule/options.php @@ -53,7 +53,9 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry } else { - return in_array($value, $options); + // In this case value must be a string + + return in_array((string) $value, $options); } } } From 142889b6df91f20cf7aac27e96d61482f7c12bb2 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Thu, 2 Jul 2015 15:12:21 +0200 Subject: [PATCH 550/809] Completing #7302 --- administrator/templates/isis/css/template-rtl.css | 1 - administrator/templates/isis/css/template.css | 1 - media/jui/less/modals.less | 1 - templates/protostar/css/template.css | 1 - 4 files changed, 4 deletions(-) diff --git a/administrator/templates/isis/css/template-rtl.css b/administrator/templates/isis/css/template-rtl.css index dbce892560191..22eaca765c8fc 100644 --- a/administrator/templates/isis/css/template-rtl.css +++ b/administrator/templates/isis/css/template-rtl.css @@ -3911,7 +3911,6 @@ input[type="submit"].btn.btn-mini { .modal-body { width: 98%; position: relative; - overflow-y: auto; max-height: 400px; padding: 1%; } diff --git a/administrator/templates/isis/css/template.css b/administrator/templates/isis/css/template.css index 701f9d4197b02..31ba2003c21c6 100644 --- a/administrator/templates/isis/css/template.css +++ b/administrator/templates/isis/css/template.css @@ -3911,7 +3911,6 @@ input[type="submit"].btn.btn-mini { .modal-body { width: 98%; position: relative; - overflow-y: auto; max-height: 400px; padding: 1%; } diff --git a/media/jui/less/modals.less b/media/jui/less/modals.less index aa8deb6252046..0932e0c8871e6 100644 --- a/media/jui/less/modals.less +++ b/media/jui/less/modals.less @@ -41,7 +41,6 @@ .modal-body { width: 98%; position: relative; - overflow-y: auto; max-height: 400px; padding: 1%; } diff --git a/templates/protostar/css/template.css b/templates/protostar/css/template.css index e7b1b8bf4ec66..a1dfadb3c0454 100644 --- a/templates/protostar/css/template.css +++ b/templates/protostar/css/template.css @@ -3911,7 +3911,6 @@ input[type="submit"].btn.btn-mini { .modal-body { width: 98%; position: relative; - overflow-y: auto; max-height: 400px; padding: 1%; } From 10f63a973df4ee2e706a076b267dc3819b86a835 Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Thu, 2 Jul 2015 16:12:10 +0200 Subject: [PATCH 551/809] Prepare 3.4.3 Release --- administrator/manifests/files/joomla.xml | 2 +- libraries/cms/version/version.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 712c23a15630e..cb45e581e57ca 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2005 - 2015 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.4.3-dev + 3.4.3 June 2015 FILES_JOOMLA_XML_DESCRIPTION diff --git a/libraries/cms/version/version.php b/libraries/cms/version/version.php index a4f6a339880c7..5bea32c1ccab5 100644 --- a/libraries/cms/version/version.php +++ b/libraries/cms/version/version.php @@ -23,10 +23,10 @@ final class JVersion public $RELEASE = '3.4'; /** @var string Maintenance version. */ - public $DEV_LEVEL = '3-dev'; + public $DEV_LEVEL = '3'; /** @var string Development STATUS. */ - public $DEV_STATUS = 'development'; + public $DEV_STATUS = 'Stable'; /** @var string Build number. */ public $BUILD = ''; @@ -35,10 +35,10 @@ final class JVersion public $CODENAME = 'Ember'; /** @var string Release date. */ - public $RELDATE = '30-June-2015'; + public $RELDATE = '2-July-2015'; /** @var string Release time. */ - public $RELTIME = '12:00'; + public $RELTIME = '16:00'; /** @var string Release timezone. */ public $RELTZ = 'GMT'; From 925c3fa5d512b9aff8c5b470804d282fb1b70afb Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Thu, 2 Jul 2015 16:12:10 +0200 Subject: [PATCH 552/809] Prepare 3.4.3 Release --- administrator/components/com_admin/script.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 3014c0ed6088a..34f8e0ae365eb 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -1292,6 +1292,9 @@ public function deleteUnexistingFiles() '/administrator/components/com_config/models/forms/index.html', // Joomla 3.4.2 '/libraries/composer_autoload.php', + // Joomla 3.4.3 + '/libraries/classloader.php', + '/libraries/ClassLoader.php', ); // TODO There is an issue while deleting folders using the ftp mode @@ -1377,9 +1380,6 @@ public function deleteUnexistingFiles() '/administrator/components/com_config/views', '/administrator/components/com_config/models/fields', '/administrator/components/com_config/models/forms', - // Joomla 3.4.3 - '/libraries/classloader.php', - '/libraries/ClassLoader.php', ); jimport('joomla.filesystem.file'); From d6f6cc45c199922811d46f3feffec9a6a309f74d Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Thu, 2 Jul 2015 21:54:40 +0200 Subject: [PATCH 553/809] set to development mode --- administrator/manifests/files/joomla.xml | 2 +- libraries/cms/version/version.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index cb45e581e57ca..22debd2a3d515 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2005 - 2015 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.4.3 + 3.4.4-dev June 2015 FILES_JOOMLA_XML_DESCRIPTION diff --git a/libraries/cms/version/version.php b/libraries/cms/version/version.php index 5bea32c1ccab5..5ac874d07ce75 100644 --- a/libraries/cms/version/version.php +++ b/libraries/cms/version/version.php @@ -23,10 +23,10 @@ final class JVersion public $RELEASE = '3.4'; /** @var string Maintenance version. */ - public $DEV_LEVEL = '3'; + public $DEV_LEVEL = '4-dev'; /** @var string Development STATUS. */ - public $DEV_STATUS = 'Stable'; + public $DEV_STATUS = 'development'; /** @var string Build number. */ public $BUILD = ''; From a3a8cefcfdc5d838397c31518fce749ca4d2ce8b Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Thu, 2 Jul 2015 19:50:47 +0200 Subject: [PATCH 554/809] Removes the duplicated update message in the quickicon Fixes #7323 --- media/plg_quickicon_joomlaupdate/js/jupdatecheck.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js b/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js index 416fc6eb97a5a..9f4ed469d748c 100644 --- a/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js +++ b/media/plg_quickicon_joomlaupdate/js/jupdatecheck.js @@ -25,7 +25,7 @@ jQuery(document).ready(function() { var updateInfo = updateInfoList.shift(); if (updateInfo.version != plg_quickicon_jupdatecheck_jversion) { var updateString = plg_quickicon_joomlaupdate_text.UPDATEFOUND.replace("%s", updateInfo.version + ""); - jQuery('#plg_quickicon_joomlaupdate').find('span').html(updateString); + jQuery('#plg_quickicon_joomlaupdate').find('.j-links-link').html(updateString); var updateString = plg_quickicon_joomlaupdate_text.UPDATEFOUND_MESSAGE.replace("%s", updateInfo.version + ""); if (jQuery('.alert-joomlaupdate').length == 0) { jQuery('#system-message-container').prepend( From d2cff0cb5926a1f4fc4385a7f52a3802c73bb80c Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Wed, 1 Jul 2015 14:40:44 +0100 Subject: [PATCH 555/809] Fix Hamburger menubutton on Mobile/Firefox/Android Fixes #7305 --- administrator/templates/isis/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/templates/isis/index.php b/administrator/templates/isis/index.php index ecd960465dba6..3a4dadea3aca4 100644 --- a/administrator/templates/isis/index.php +++ b/administrator/templates/isis/index.php @@ -151,7 +151,7 @@ function colorIsLight($color)
    + escape($item->title); ?> + + + + escape($item->access_level); ?> + + + language == '*'): ?> + + + language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> + + + + id; ?> + + + + + + From 78c0b42175689beafafe3fa08b5f62930be40147 Mon Sep 17 00:00:00 2001 From: Octavian Cinciu Date: Mon, 22 Jun 2015 11:41:55 +0300 Subject: [PATCH 566/809] Display Captcha using HTTPS only + URL encode & sign Fixes #7237 --- plugins/captcha/recaptcha/recaptcha.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/captcha/recaptcha/recaptcha.php b/plugins/captcha/recaptcha/recaptcha.php index 8d086590d34fe..a925c9aba8868 100644 --- a/plugins/captcha/recaptcha/recaptcha.php +++ b/plugins/captcha/recaptcha/recaptcha.php @@ -56,9 +56,8 @@ public function onInit($id = 'dynamic_recaptcha_1') { case '1.0': $theme = $this->params->get('theme', 'clean'); + $file = 'https://www.google.com/recaptcha/api/js/recaptcha_ajax.js'; - $file = $app->isSSLConnection() ? 'https' : 'http'; - $file .= '://www.google.com/recaptcha/api/js/recaptcha_ajax.js'; JHtml::_('script', $file); $document->addScriptDeclaration('jQuery( document ).ready(function() @@ -68,10 +67,7 @@ public function onInit($id = 'dynamic_recaptcha_1') break; case '2.0': $theme = $this->params->get('theme2', 'light'); - - $file = $app->isSSLConnection() ? 'https' : 'http'; - $file .= '://www.google.com/recaptcha/api.js?hl=' . JFactory::getLanguage() - ->getTag() . '&render=explicit'; + $file = 'https://www.google.com/recaptcha/api.js?hl=' . JFactory::getLanguage()->getTag() . '&render=explicit'; JHtml::_('script', $file, true, true); From 843e6407879d0b8a5b69632d731dddff8816c2a1 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Mon, 22 Jun 2015 09:28:33 +0100 Subject: [PATCH 567/809] Implementing "No Matching Results" in Users modal Fixes #7236 --- .../com_users/views/users/tmpl/modal.php | 88 ++++++++++--------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/administrator/components/com_users/views/users/tmpl/modal.php b/administrator/components/com_users/views/users/tmpl/modal.php index db1baba4aa033..aeada70d68efd 100644 --- a/administrator/components/com_users/views/users/tmpl/modal.php +++ b/administrator/components/com_users/views/users/tmpl/modal.php @@ -39,48 +39,54 @@
    + items)) : ?> +
    + +
    + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - items as $item) : ?> - - - - - - - -
    + + + + + +
    + pagination->getListFooter(); ?> +
    - - - - - -
    - pagination->getListFooter(); ?> -
    - - name; ?> - - username; ?> - - group_names); ?> -
    + foreach ($this->items as $item) : ?> + + + + name; ?> + + + + username; ?> + + + group_names); ?> + + + + + +
    From c8b0f35bc2b4342758bbabfa69e6ba8f8e354aa2 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Mon, 22 Jun 2015 09:02:17 +0100 Subject: [PATCH 568/809] Implementing "No Matching Results" in News Feed modal #7234 --- .../views/newsfeeds/tmpl/modal.php | 143 +++++++++--------- 1 file changed, 75 insertions(+), 68 deletions(-) diff --git a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/modal.php b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/modal.php index ac629e8323a43..60ea571ff5d23 100644 --- a/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/modal.php +++ b/administrator/components/com_newsfeeds/views/newsfeeds/tmpl/modal.php @@ -71,80 +71,87 @@
    - - - - - - - - - - - - - - - - - items as $i => $item) : ?> - language && JLanguageMultilang::isEnabled()) - { - $tag = strlen($item->language); - if ($tag == 5) + items)) : ?> +
    + +
    + + +
    - - - - - - - - - -
    - pagination->getListFooter(); ?> -
    + + + + + + + + + + + + + + + + items as $i => $item) : ?> + language && JLanguageMultilang::isEnabled()) { - $lang = substr($item->language, 0, 2); + $tag = strlen($item->language); + if ($tag == 5) + { + $lang = substr($item->language, 0, 2); + } + elseif ($tag == 6) + { + $lang = substr($item->language, 0, 3); + } + else { + $lang = ""; + } } - elseif ($tag == 6) + elseif (!JLanguageMultilang::isEnabled()) { - $lang = substr($item->language, 0, 3); - } - else { $lang = ""; } - } - elseif (!JLanguageMultilang::isEnabled()) - { - $lang = ""; - } - ?> - - - - - - - + ?> + + + + + + + - -
    + + + + + + + + + +
    + pagination->getListFooter(); ?> +
    - - escape($item->name); ?> - - escape($item->access_level); ?> - - escape($item->category_title); ?> - - language == '*'):?> - - - language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - - - id; ?> -
    + + escape($item->name); ?> + + escape($item->access_level); ?> + + escape($item->category_title); ?> + + language == '*'):?> + + + language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> + + + id; ?> +
    + + +
    From b515b2b0bb250520e1a4f1890ed2a5892c017cb9 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Mon, 22 Jun 2015 08:54:03 +0100 Subject: [PATCH 569/809] Implementing "No Matching Results" in Contacts modal Fixes #7232 --- .../com_contact/views/contacts/tmpl/modal.php | 159 +++++++++--------- 1 file changed, 82 insertions(+), 77 deletions(-) diff --git a/administrator/components/com_contact/views/contacts/tmpl/modal.php b/administrator/components/com_contact/views/contacts/tmpl/modal.php index bff9d7fea1a21..06d9a39c6ba24 100644 --- a/administrator/components/com_contact/views/contacts/tmpl/modal.php +++ b/administrator/components/com_contact/views/contacts/tmpl/modal.php @@ -71,89 +71,94 @@
    - - - - - - - - - - - - - - - - - - - items as $i => $item) : ?> - language && JLanguageMultilang::isEnabled()) - { - $tag = strlen($item->language); - if ($tag == 5) + items)) : ?> +
    + +
    + +
    - - - - - - - - - - - -
    - pagination->getListFooter(); ?> -
    + + + + + + + + + + + + + + + + + items as $i => $item) : ?> + language && JLanguageMultilang::isEnabled()) { - $lang = substr($item->language, 0, 2); + $tag = strlen($item->language); + if ($tag == 5) + { + $lang = substr($item->language, 0, 2); + } + elseif ($tag == 6) + { + $lang = substr($item->language, 0, 3); + } + else { + $lang = ""; + } } - elseif ($tag == 6) + elseif (!JLanguageMultilang::isEnabled()) { - $lang = substr($item->language, 0, 3); - } - else { $lang = ""; } - } - elseif (!JLanguageMultilang::isEnabled()) - { - $lang = ""; - } - ?> - - - - - - - - + ?> + + + + + + + + - -
    + + + + + + + + + + + +
    + pagination->getListFooter(); ?> +
    - - escape($item->name); ?> - - linked_user)) : ?> - linked_user;?> - - - escape($item->access_level); ?> - - escape($item->category_title); ?> - - language == '*'):?> - - - language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - - - id; ?> -
    + + escape($item->name); ?> + + linked_user)) : ?> + linked_user;?> + + + escape($item->access_level); ?> + + escape($item->category_title); ?> + + language == '*'):?> + + + language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> + + + id; ?> +
    + + + From b581e1b53fd71221de05dd435ea0d2fabfe3e509 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Mon, 22 Jun 2015 09:31:12 +0200 Subject: [PATCH 570/809] Implementing "No Matching Results" in Articles modal #7231 --- .../com_content/views/articles/tmpl/modal.php | 154 +++++++++--------- 1 file changed, 80 insertions(+), 74 deletions(-) diff --git a/administrator/components/com_content/views/articles/tmpl/modal.php b/administrator/components/com_content/views/articles/tmpl/modal.php index 28b27b236c3b3..cba1e5f2899c6 100644 --- a/administrator/components/com_content/views/articles/tmpl/modal.php +++ b/administrator/components/com_content/views/articles/tmpl/modal.php @@ -78,86 +78,92 @@ - - - - - - - - - - - - - - - - - - items as $i => $item) : ?> - language && JLanguageMultilang::isEnabled()) - { - $tag = strlen($item->language); - if ($tag == 5) + items)) : ?> +
    + +
    + +
    - - - - - - - - - - - -
    - pagination->getListFooter(); ?> -
    + + + + + + + + + + + + + + + + + items as $i => $item) : ?> + language && JLanguageMultilang::isEnabled()) { - $lang = substr($item->language, 0, 2); + $tag = strlen($item->language); + if ($tag == 5) + { + $lang = substr($item->language, 0, 2); + } + elseif ($tag == 6) + { + $lang = substr($item->language, 0, 3); + } + else { + $lang = ""; + } } - elseif ($tag == 6) + elseif (!JLanguageMultilang::isEnabled()) { - $lang = substr($item->language, 0, 3); - } - else { $lang = ""; } - } - elseif (!JLanguageMultilang::isEnabled()) - { - $lang = ""; - } - ?> - - - - - - - - + ?> + + + + + + + + - -
    + + + + + + + + + + + +
    + pagination->getListFooter(); ?> +
    - - escape($item->title); ?> - - escape($item->access_level); ?> - - escape($item->category_title); ?> - - language == '*'):?> - - - language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - - - created, JText::_('DATE_FORMAT_LC4')); ?> - - id; ?> -
    + + escape($item->title); ?> + + escape($item->access_level); ?> + + escape($item->category_title); ?> + + language == '*'):?> + + + language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> + + + created, JText::_('DATE_FORMAT_LC4')); ?> + + id; ?> +
    + + +
    From caa046146ea9e2a8c508df8afa9b5c61683a4154 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Sat, 20 Jun 2015 12:32:24 +0100 Subject: [PATCH 571/809] Show hide Fixes #7219 --- .../components/com_content/config.xml | 16 ++++++------- .../language/en-GB/en-GB.com_contact.ini | 24 +++++++++---------- .../language/en-GB/en-GB.com_content.ini | 8 +++---- .../language/en-GB/en-GB.com_menus.ini | 2 +- .../language/en-GB/en-GB.com_modules.ini | 2 +- .../language/en-GB/en-GB.com_weblinks.ini | 12 +++++----- .../language/en-GB/en-GB.com_wrapper.ini | 2 +- administrator/language/en-GB/en-GB.ini | 6 ++--- .../en-GB/en-GB.plg_content_pagebreak.ini | 2 +- .../en-GB/en-GB.plg_editors_tinymce.ini | 22 ++++++++--------- language/en-GB/en-GB.mod_articles_latest.ini | 2 +- language/en-GB/en-GB.mod_articles_popular.ini | 2 +- language/en-GB/en-GB.mod_breadcrumbs.ini | 6 ++--- language/en-GB/en-GB.mod_login.ini | 2 +- language/en-GB/en-GB.mod_related_items.ini | 2 +- language/en-GB/en-GB.mod_wrapper.ini | 2 +- 16 files changed, 56 insertions(+), 56 deletions(-) diff --git a/administrator/components/com_content/config.xml b/administrator/components/com_content/config.xml index a2ed3950473ae..a68dbc37cb979 100644 --- a/administrator/components/com_content/config.xml +++ b/administrator/components/com_content/config.xml @@ -305,8 +305,8 @@ label="COM_CONTENT_SHOW_PUBLISHING_OPTIONS_LABEL" description="COM_CONTENT_SHOW_PUBLISHING_OPTIONS_DESC" > - - + + - - + + - - + + - - + + Skin Creator" PLG_TINY_FIELD_SKIN_LABEL="Site Skin" -PLG_TINY_FIELD_SMILIES_DESC="Show/Hide the smilies buttons. Only applies in Extended mode." +PLG_TINY_FIELD_SMILIES_DESC="Show or hide the smilies buttons. Only applies in Extended mode." PLG_TINY_FIELD_SMILIES_LABEL="Smilies" -PLG_TINY_FIELD_TABLE_DESC="Show/Hide the table control buttons. Only applies in Extended mode." +PLG_TINY_FIELD_TABLE_DESC="Show or hide the table control buttons. Only applies in Extended mode." PLG_TINY_FIELD_TABLE_LABEL="Table" -PLG_TINY_FIELD_TEMPLATE_DESC="Show/Hide the Insert predefined template content button. Only applies in Extended mode." +PLG_TINY_FIELD_TEMPLATE_DESC="Show or hide the Insert predefined template content button. Only applies in Extended mode." PLG_TINY_FIELD_TEMPLATE_LABEL="Template" PLG_TINY_FIELD_URLS_DESC="URL behaviour." PLG_TINY_FIELD_URLS_LABEL="URLs" diff --git a/language/en-GB/en-GB.mod_articles_latest.ini b/language/en-GB/en-GB.mod_articles_latest.ini index c0c178dc729d9..ed75d055315e9 100644 --- a/language/en-GB/en-GB.mod_articles_latest.ini +++ b/language/en-GB/en-GB.mod_articles_latest.ini @@ -7,7 +7,7 @@ MOD_ARTICLES_LATEST="Articles - Latest" MOD_LATEST_NEWS_FIELD_CATEGORY_DESC="Selects Articles from one or more Categories. If no selection will show all categories as default." MOD_LATEST_NEWS_FIELD_COUNT_DESC="The number of Articles to display (the default is 5)." MOD_LATEST_NEWS_FIELD_COUNT_LABEL="Count" -MOD_LATEST_NEWS_FIELD_FEATURED_DESC="Show/Hide articles designated as featured." +MOD_LATEST_NEWS_FIELD_FEATURED_DESC="Show or hide articles designated as featured." MOD_LATEST_NEWS_FIELD_FEATURED_LABEL="Featured Articles" MOD_LATEST_NEWS_FIELD_ORDERING_DESC="Recently Added First: order the articles using their creation date
    Recently Modified First: order the articles using their modification date
    Recently Published First: order the articles using their publication date.
    Recently Touched First: order the articles using their modification or creation dates." MOD_LATEST_NEWS_FIELD_ORDERING_LABEL="Order" diff --git a/language/en-GB/en-GB.mod_articles_popular.ini b/language/en-GB/en-GB.mod_articles_popular.ini index 53919cf8d0bf3..1d936dc64ee4f 100644 --- a/language/en-GB/en-GB.mod_articles_popular.ini +++ b/language/en-GB/en-GB.mod_articles_popular.ini @@ -7,7 +7,7 @@ MOD_ARTICLES_POPULAR="Articles - Most Read" MOD_POPULAR_FIELD_CATEGORY_DESC="Select Articles from a specific Category or a set of Categories. If no selection will show all categories as default." MOD_POPULAR_FIELD_COUNT_DESC="The number of Articles to display (the default is 5)." MOD_POPULAR_FIELD_COUNT_LABEL="Count" -MOD_POPULAR_FIELD_FEATURED_DESC="Show/Hide Articles designated as Featured." +MOD_POPULAR_FIELD_FEATURED_DESC="Show or hide Articles designated as Featured." MOD_POPULAR_FIELD_FEATURED_LABEL="Featured Articles" MOD_POPULAR_XML_DESCRIPTION="This module shows a list of the currently published Articles which have the highest number of page views." MOD_POPULAR_FIELD_DATEFIELD_DESC="Select which date field you want the date filter to be applied to." diff --git a/language/en-GB/en-GB.mod_breadcrumbs.ini b/language/en-GB/en-GB.mod_breadcrumbs.ini index b59b246f9376f..aa826c78fc0cf 100644 --- a/language/en-GB/en-GB.mod_breadcrumbs.ini +++ b/language/en-GB/en-GB.mod_breadcrumbs.ini @@ -8,11 +8,11 @@ MOD_BREADCRUMBS_FIELD_HOMETEXT_DESC="This text will be shown as Home entry. If t MOD_BREADCRUMBS_FIELD_HOMETEXT_LABEL="Text for Home Entry" MOD_BREADCRUMBS_FIELD_SEPARATOR_DESC="A text separator." MOD_BREADCRUMBS_FIELD_SEPARATOR_LABEL="Text Separator" -MOD_BREADCRUMBS_FIELD_SHOWHERE_DESC="Show/Hide "You are here" text in the pathway." +MOD_BREADCRUMBS_FIELD_SHOWHERE_DESC="Show or hide "You are here" text in the pathway." MOD_BREADCRUMBS_FIELD_SHOWHERE_LABEL="Show "You are here"" -MOD_BREADCRUMBS_FIELD_SHOWHOME_DESC="Show/Hide the Home element in the pathway." +MOD_BREADCRUMBS_FIELD_SHOWHOME_DESC="Show or hide the Home element in the pathway." MOD_BREADCRUMBS_FIELD_SHOWHOME_LABEL="Show Home" -MOD_BREADCRUMBS_FIELD_SHOWLAST_DESC="Show/Hide the last element in the pathway." +MOD_BREADCRUMBS_FIELD_SHOWLAST_DESC="Show or hide the last element in the pathway." MOD_BREADCRUMBS_FIELD_SHOWLAST_LABEL="Show Last" MOD_BREADCRUMBS_HERE="You are here: " MOD_BREADCRUMBS_HOME="Home" diff --git a/language/en-GB/en-GB.mod_login.ini b/language/en-GB/en-GB.mod_login.ini index 4a152aad7b908..43a23f51d94d3 100644 --- a/language/en-GB/en-GB.mod_login.ini +++ b/language/en-GB/en-GB.mod_login.ini @@ -4,7 +4,7 @@ ; Note : All ini files need to be saved as UTF-8 MOD_LOGIN="Login" -MOD_LOGIN_FIELD_GREETING_DESC="Show/Hide the simple greeting text." +MOD_LOGIN_FIELD_GREETING_DESC="Show or hide the simple greeting text." MOD_LOGIN_FIELD_GREETING_LABEL="Show Greeting" MOD_LOGIN_FIELD_LOGIN_REDIRECTURL_DESC="Select the page the user will be redirected to after a successful login. Select from all the pages listed in the dropdown menu. Choosing "Default" will return to the same page." MOD_LOGIN_FIELD_LOGIN_REDIRECTURL_LABEL="Login Redirection Page" diff --git a/language/en-GB/en-GB.mod_related_items.ini b/language/en-GB/en-GB.mod_related_items.ini index d48f629afc22c..8bfba69cbd0cd 100644 --- a/language/en-GB/en-GB.mod_related_items.ini +++ b/language/en-GB/en-GB.mod_related_items.ini @@ -5,7 +5,7 @@ MOD_RELATED_FIELD_MAX_DESC="The maximum number of related articles to display (default is 5)." MOD_RELATED_FIELD_MAX_LABEL="Maximum Articles" -MOD_RELATED_FIELD_SHOWDATE_DESC="Show/Hide date." +MOD_RELATED_FIELD_SHOWDATE_DESC="Show or hide date." MOD_RELATED_FIELD_SHOWDATE_LABEL="Show Date" MOD_RELATED_ITEMS="Articles - Related" MOD_RELATED_XML_DESCRIPTION="This module displays other Articles that are related to the one currently being viewed. These relations are established by the Meta keywords.
    All the keywords of the current Article are searched against all the keywords of all other published Articles. For example, you may have an Article on "Breeding Parrots" and another on "Hand Raising Black Cockatoos". If you include the keyword "parrot" in both Articles, then the Related Items Module will list the "Breeding Parrots" Article when viewing "Hand Raising Black Cockatoos" and vice-versa." \ No newline at end of file diff --git a/language/en-GB/en-GB.mod_wrapper.ini b/language/en-GB/en-GB.mod_wrapper.ini index bba5d71f8950f..0986e076f2f9f 100644 --- a/language/en-GB/en-GB.mod_wrapper.ini +++ b/language/en-GB/en-GB.mod_wrapper.ini @@ -10,7 +10,7 @@ MOD_WRAPPER_FIELD_AUTOHEIGHT_DESC="The height will automatically be set to the s MOD_WRAPPER_FIELD_AUTOHEIGHT_LABEL="Auto Height" MOD_WRAPPER_FIELD_HEIGHT_DESC="Height of the iframe window." MOD_WRAPPER_FIELD_HEIGHT_LABEL="Height" -MOD_WRAPPER_FIELD_SCROLL_DESC="Show/Hide horizontal & vertical scroll bars." +MOD_WRAPPER_FIELD_SCROLL_DESC="Show or hide horizontal & vertical scroll bars." MOD_WRAPPER_FIELD_SCROLL_LABEL="Scroll Bars" MOD_WRAPPER_FIELD_TARGET_DESC="Name of the iframe when used as target." MOD_WRAPPER_FIELD_TARGET_LABEL="Target Name" From a56f1e896b8ce5e00825558e845497f111955b45 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Fri, 3 Jul 2015 16:13:53 +0200 Subject: [PATCH 572/809] Remove Gitter webhook We don't use Gitter anymore and the `on_start` command was wrong anyway. --- .travis.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index c31c6645d6b2c..c8a22487ff507 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,12 +40,3 @@ script: branches: except: - 2.5.x - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/18687d008d633d02aa84 - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: false # default: false - From c47d0150c6e98c96bdb2b75b38fe1c14db406802 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Fri, 3 Jul 2015 12:16:00 -0400 Subject: [PATCH 573/809] Change Travis build and Composer lock to track extra dev dependencies --- .travis.yml | 9 +- composer.json | 4 +- composer.lock | 219 +++++++++++++++++----- libraries/cms.php | 2 +- libraries/vendor/composer/ClassLoader.php | 8 +- 5 files changed, 180 insertions(+), 62 deletions(-) diff --git a/.travis.yml b/.travis.yml index c31c6645d6b2c..9a9793bde413c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,11 +16,8 @@ services: - redis-server before_script: - # - composer update - # Install PHPCS to validate code standards - - composer require squizlabs/php_codesniffer 1.5.6 - # Install Cache_Lite for testing - - composer require pear/cache_lite 1.7.16 + # Make sure all dev dependencies are installed + - composer install # Set up databases for testing - mysql -e 'create database joomla_ut;' - mysql joomla_ut < tests/unit/schema/mysql.sql @@ -34,7 +31,7 @@ before_script: - sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then phpenv config-add build/travis/phpenv/redis.ini; fi" script: - - phpunit --configuration travisci-phpunit.xml + - libraries/vendor/bin/phpunit --configuration travisci-phpunit.xml - sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then libraries/vendor/bin/phpcs --report=full --extensions=php -p --standard=build/phpcs/Joomla .; fi" branches: diff --git a/composer.json b/composer.json index 6bde779989852..5382b0e2e201e 100644 --- a/composer.json +++ b/composer.json @@ -23,6 +23,8 @@ }, "require-dev": { "phpunit/phpunit": "4.1.*", - "phpunit/dbunit": "~1.3" + "phpunit/dbunit": "~1.3", + "squizlabs/php_codesniffer": "~1.5", + "pear/cache_lite": "1.7.16" } } diff --git a/composer.lock b/composer.lock index 851ef2c8e375c..a492d8d63d3ac 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 http://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#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "385d58b11d816b21d0484b902310db7e", + "hash": "8405416de269468be2cedcc5d5c63462", "packages": [ { "name": "ircmaxell/password-compat", @@ -734,6 +734,56 @@ } ], "packages-dev": [ + { + "name": "pear/cache_lite", + "version": "v1.7.16", + "source": { + "type": "git", + "url": "https://github.com/pear/Cache_Lite.git", + "reference": "9fa08bd625f86946d41a6e7ff66f6f4ea5c0f0bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Cache_Lite/zipball/9fa08bd625f86946d41a6e7ff66f6f4ea5c0f0bb", + "reference": "9fa08bd625f86946d41a6e7ff66f6f4ea5c0f0bb", + "shasum": "" + }, + "require": { + "php": ">=4.0.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "Cache/Lite.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Markus Tacker", + "homepage": "http://pear.php.net/user/tacker" + }, + { + "name": "Fabien Marty", + "homepage": "http://pear.php.net/user/fab" + } + ], + "description": "Fast and safe little cache system", + "homepage": "https://github.com/pear/Cache_Lite", + "keywords": [ + "cache" + ], + "time": "2014-05-11 15:02:19" + }, { "name": "phpunit/dbunit", "version": "1.3.1", @@ -795,16 +845,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "2.0.15", + "version": "2.1.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "34cc484af1ca149188d0d9e91412191e398e0b67" + "reference": "07e27765596d72c378a6103e80da5d84e802f1e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/34cc484af1ca149188d0d9e91412191e398e0b67", - "reference": "34cc484af1ca149188d0d9e91412191e398e0b67", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/07e27765596d72c378a6103e80da5d84e802f1e4", + "reference": "07e27765596d72c378a6103e80da5d84e802f1e4", "shasum": "" }, "require": { @@ -827,7 +877,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -853,7 +903,7 @@ "testing", "xunit" ], - "time": "2015-01-24 10:06:35" + "time": "2015-06-30 06:52:35" }, { "name": "phpunit/php-file-iterator", @@ -902,16 +952,16 @@ }, { "name": "phpunit/php-text-template", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { @@ -920,20 +970,17 @@ "type": "library", "autoload": { "classmap": [ - "Text/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -942,20 +989,20 @@ "keywords": [ "template" ], - "time": "2014-01-30 17:20:04" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", - "version": "1.0.5", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/83fe1bdc5d47658b727595c14da140da92b3d66d", + "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d", "shasum": "" }, "require": { @@ -964,13 +1011,10 @@ "type": "library", "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -986,20 +1030,20 @@ "keywords": [ "timer" ], - "time": "2013-08-02 07:42:54" + "time": "2015-06-13 07:35:30" }, { "name": "phpunit/php-token-stream", - "version": "1.4.0", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74" + "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/db32c18eba00b121c145575fcbcd4d4d24e6db74", - "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9", + "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9", "shasum": "" }, "require": { @@ -1035,7 +1079,7 @@ "keywords": [ "tokenizer" ], - "time": "2015-01-17 09:51:32" + "time": "2015-06-19 03:43:16" }, { "name": "phpunit/phpunit", @@ -1234,16 +1278,16 @@ }, { "name": "sebastian/diff", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", "shasum": "" }, "require": { @@ -1255,7 +1299,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -1282,32 +1326,32 @@ "keywords": [ "diff" ], - "time": "2014-08-15 10:29:00" + "time": "2015-02-22 15:13:53" }, { "name": "sebastian/environment", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7" + "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7", - "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", + "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.3" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -1332,7 +1376,7 @@ "environment", "hhvm" ], - "time": "2014-10-25 08:00:45" + "time": "2015-01-01 10:01:08" }, { "name": "sebastian/exporter", @@ -1455,16 +1499,16 @@ }, { "name": "sebastian/version", - "version": "1.0.4", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b" + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/a77d9123f8e809db3fbdea15038c27a95da4058b", - "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, "type": "library", @@ -1486,7 +1530,82 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2014-12-15 14:25:24" + "time": "2015-06-21 13:59:46" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "1.5.6", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6f3e42d311b882b25b4d409d23a289f4d3b803d5", + "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.1.2" + }, + "suggest": { + "phpunit/php-timer": "dev-master" + }, + "bin": [ + "scripts/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-phpcs-fixer": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/CommentParser/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2014-12-04 22:32:15" } ], "aliases": [], diff --git a/libraries/cms.php b/libraries/cms.php index c2309cc20e425..e0a831699ed64 100644 --- a/libraries/cms.php +++ b/libraries/cms.php @@ -30,7 +30,7 @@ JLoader::registerPrefix('J', JPATH_PLATFORM . '/cms', false, true); // Create the Composer autoloader -$loader = require_once JPATH_LIBRARIES . '/vendor/autoload.php'; +$loader = require JPATH_LIBRARIES . '/vendor/autoload.php'; $loader->unregister(); // Decorate Composer autoloader diff --git a/libraries/vendor/composer/ClassLoader.php b/libraries/vendor/composer/ClassLoader.php index 5e1469e8307d9..4e05d3b158348 100644 --- a/libraries/vendor/composer/ClassLoader.php +++ b/libraries/vendor/composer/ClassLoader.php @@ -351,7 +351,7 @@ private function findFileWithExtension($class, $ext) foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { if (0 === strpos($class, $prefix)) { foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { return $file; } } @@ -361,7 +361,7 @@ private function findFileWithExtension($class, $ext) // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } @@ -380,7 +380,7 @@ private function findFileWithExtension($class, $ext) foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } @@ -390,7 +390,7 @@ private function findFileWithExtension($class, $ext) // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } From 986a2d7cfdecd41fbeb7942adca4d7b61bed6bf9 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Fri, 3 Jul 2015 18:20:42 +0200 Subject: [PATCH 574/809] Updating en-GB.xml language manifestfiles to version 3.4.3. --- administrator/language/en-GB/en-GB.xml | 2 +- language/en-GB/en-GB.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/administrator/language/en-GB/en-GB.xml b/administrator/language/en-GB/en-GB.xml index 7e0fbf8571157..67b089a52ba6d 100644 --- a/administrator/language/en-GB/en-GB.xml +++ b/administrator/language/en-GB/en-GB.xml @@ -1,7 +1,7 @@ English (en-GB) - 3.4.2 + 3.4.3 2013-03-07 Joomla! Project admin@joomla.org diff --git a/language/en-GB/en-GB.xml b/language/en-GB/en-GB.xml index 6a005ab45c8db..8b21fef13c134 100644 --- a/language/en-GB/en-GB.xml +++ b/language/en-GB/en-GB.xml @@ -1,7 +1,7 @@ English (en-GB) - 3.4.2 + 3.4.3 2013-03-07 Joomla! Project admin@joomla.org From 929baed7b23267f505fca1e2c61c3184783f9f68 Mon Sep 17 00:00:00 2001 From: dgt41 Date: Sat, 4 Jul 2015 03:46:41 +0300 Subject: [PATCH 575/809] eliminate strict error... --- .../components/com_media/layouts/toolbar/deletemedia.php | 2 +- media/media/js/mediamanager.js | 2 +- media/media/js/mediamanager.min.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_media/layouts/toolbar/deletemedia.php b/administrator/components/com_media/layouts/toolbar/deletemedia.php index 6cbb440969ea6..bc8d6369096ee 100644 --- a/administrator/components/com_media/layouts/toolbar/deletemedia.php +++ b/administrator/components/com_media/layouts/toolbar/deletemedia.php @@ -11,6 +11,6 @@ $title = JText::_('JTOOLBAR_DELETE'); ?> - diff --git a/media/media/js/mediamanager.js b/media/media/js/mediamanager.js index 40ba9e285e6a1..e058515574526 100644 --- a/media/media/js/mediamanager.js +++ b/media/media/js/mediamanager.js @@ -37,7 +37,7 @@ * @return void */ submit: function( task ) { - form = this.frame.document.getElementById( 'mediamanager-form' ); + var form = this.frame.document.getElementById( 'mediamanager-form' ); form.task.value = task; if ( $( '#username' ).length ) { diff --git a/media/media/js/mediamanager.min.js b/media/media/js/mediamanager.min.js index 3cb090c23759f..a84602364281a 100644 --- a/media/media/js/mediamanager.min.js +++ b/media/media/js/mediamanager.min.js @@ -1 +1 @@ -!function(e,t){"use strict";function r(t){var r={};return t=t||"",e.each(t.split(/[&;]/),function(e,t){var a=t.split("=");r[decodeURIComponent(a[0])]=2==a.length?decodeURIComponent(a[1]):null}),r}function a(t){var r={},a=t.match(/^(?:([^:\/?#.]+):)?(?:\/\/)?(([^:\/?#]*)(?::(\d*))?)((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[\?#]|$)))*\/?)?([^?#\/]*))?(?:\?([^#]*))?(?:#(.*))?/);return e.each(["uri","scheme","authority","domain","port","path","directory","file","query","fragment"],function(e,t){r[t]=a&&a[e]?a[e]:""}),r}function o(e){return e.scheme+"://"+e.domain+(e.port?":"+e.port:"")+(e.path?e.path:"/")+(e.query?"?"+e.query:"")+(e.fragment?"#"+e.fragment:"")}var n=t.MediaManager={initialize:function(){this.folderpath=e("#folderpath"),this.updatepaths=e("input.update-folder"),this.frame=window.frames.folderframe,this.frameurl=this.frame.location.href},submit:function(t){form=this.frame.document.getElementById("mediamanager-form"),form.task.value=t,e("#username").length&&(form.username.value=e("#username").val(),form.password.value=e("#password").val()),form.submit()},onloadframe:function(){this.frameurl=this.frame.location.href;var t,n,i=this.getFolder()||"",l=[],u=a(e("#uploadForm").attr("action")),f=r(u.query);this.updatepaths.each(function(e,t){t.value=i}),this.folderpath.value=basepath+(i?"/"+i:""),f.folder=i;for(t in f)f.hasOwnProperty(t)&&(n=f[t],l.push(t+(null===n?"":"="+n)));u.query=l.join("&"),u.fragment=null,e("#uploadForm").attr("action",o(u)),e("#"+viewstyle).addClass("active")},setViewType:function(t){e("#"+t).addClass("active"),e("#"+viewstyle).removeClass("active"),viewstyle=t;var r=this.getFolder();this.setFrameUrl("index.php?option=com_media&view=mediaList&tmpl=component&folder="+r+"&layout="+t)},refreshFrame:function(){this.setFrameUrl()},getFolder:function(){var e=r(this.frame.location.search.substring(1));return e.folder=void 0===e.folder?"":e.folder,e.folder},setFrameUrl:function(e){null!==e&&(this.frameurl=e),this.frame.location.href=this.frameurl}};e(function(){n.initialize(),document.updateUploader=function(){n.onloadframe()},n.onloadframe()})}(jQuery,window); \ No newline at end of file +!function(e,t){"use strict";function a(t){var a={};return t=t||"",e.each(t.split(/[&;]/),function(e,t){var r=t.split("=");a[decodeURIComponent(r[0])]=2==r.length?decodeURIComponent(r[1]):null}),a}function r(t){var a={},r=t.match(/^(?:([^:\/?#.]+):)?(?:\/\/)?(([^:\/?#]*)(?::(\d*))?)((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[\?#]|$)))*\/?)?([^?#\/]*))?(?:\?([^#]*))?(?:#(.*))?/);return e.each(["uri","scheme","authority","domain","port","path","directory","file","query","fragment"],function(e,t){a[t]=r&&r[e]?r[e]:""}),a}function n(e){return e.scheme+"://"+e.domain+(e.port?":"+e.port:"")+(e.path?e.path:"/")+(e.query?"?"+e.query:"")+(e.fragment?"#"+e.fragment:"")}var o=t.MediaManager={initialize:function(){this.folderpath=e("#folderpath"),this.updatepaths=e("input.update-folder"),this.frame=window.frames.folderframe,this.frameurl=this.frame.location.href},submit:function(t){var a=this.frame.document.getElementById("mediamanager-form");a.task.value=t,e("#username").length&&(a.username.value=e("#username").val(),a.password.value=e("#password").val()),a.submit()},onloadframe:function(){this.frameurl=this.frame.location.href;var t,o,i=this.getFolder()||"",l=[],u=r(e("#uploadForm").attr("action")),s=a(u.query);this.updatepaths.each(function(e,t){t.value=i}),this.folderpath.value=basepath+(i?"/"+i:""),s.folder=i;for(t in s)s.hasOwnProperty(t)&&(o=s[t],l.push(t+(null===o?"":"="+o)));u.query=l.join("&"),u.fragment=null,e("#uploadForm").attr("action",n(u)),e("#"+viewstyle).addClass("active")},setViewType:function(t){e("#"+t).addClass("active"),e("#"+viewstyle).removeClass("active"),viewstyle=t;var a=this.getFolder();this.setFrameUrl("index.php?option=com_media&view=mediaList&tmpl=component&folder="+a+"&layout="+t)},refreshFrame:function(){this.setFrameUrl()},getFolder:function(){var e=a(this.frame.location.search.substring(1));return e.folder=void 0===e.folder?"":e.folder,e.folder},setFrameUrl:function(e){null!==e&&(this.frameurl=e),this.frame.location.href=this.frameurl}};e(function(){o.initialize(),document.updateUploader=function(){o.onloadframe()},o.onloadframe()})}(jQuery,window); \ No newline at end of file From 3f9ee3b4edfef49465f468540d43ea6de6106e5a Mon Sep 17 00:00:00 2001 From: dgt41 Date: Sat, 4 Jul 2015 18:18:38 +0300 Subject: [PATCH 576/809] content area should be properly placed --- administrator/templates/isis/index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/administrator/templates/isis/index.php b/administrator/templates/isis/index.php index 3a4dadea3aca4..88a4e0253347b 100644 --- a/administrator/templates/isis/index.php +++ b/administrator/templates/isis/index.php @@ -309,6 +309,9 @@ function processScrollInit() if ($('.subhead').length) { navTop = $('.subhead').length && $('.subhead').offset().top - ; + // Fix the container top + $(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height()); + // Only apply the scrollspy when the toolbar is not collapsed if (document.body.clientWidth > 480) { @@ -325,6 +328,9 @@ function processScroll() if (scrollTop >= navTop && !isFixed) { isFixed = true; $('.subhead').addClass('subhead-fixed'); + + // Fix the container top + $(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height()); } else if (scrollTop <= navTop && isFixed) { isFixed = false; $('.subhead').removeClass('subhead-fixed'); From a878a6020119f45c941df281cc8e1ecc8afbc3a8 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Sat, 4 Jul 2015 10:24:38 +0200 Subject: [PATCH 577/809] Remove the doubled closing div in the "Date of Birth" layout Fixes #7340 --- layouts/plugins/user/profile/fields/dob.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/plugins/user/profile/fields/dob.php b/layouts/plugins/user/profile/fields/dob.php index d850e5025df73..0a988f80e235d 100644 --- a/layouts/plugins/user/profile/fields/dob.php +++ b/layouts/plugins/user/profile/fields/dob.php @@ -15,6 +15,6 @@ extract($displayData); // Closing the opening .control-group and .control-label div so we can add our info text on own line ?> -
    +
    From c3d18d48044a91c6b42dd0b1c9fd6854548a8e25 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Sun, 5 Jul 2015 08:56:51 +0200 Subject: [PATCH 578/809] Profile plugin: Display Date of Birth TIP only when editing + correcting alignment of display Fixes #7345 --- plugins/user/profile/fields/dob.php | 14 +++++++++++--- templates/protostar/css/template.css | 3 +++ templates/protostar/less/template.less | 5 +++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/plugins/user/profile/fields/dob.php b/plugins/user/profile/fields/dob.php index 73d92bb594d47..e42744f06066d 100644 --- a/plugins/user/profile/fields/dob.php +++ b/plugins/user/profile/fields/dob.php @@ -45,9 +45,17 @@ protected function getLabel() if ($text) { - $layout = new JLayoutFile('plugins.user.profile.fields.dob'); - $info = $layout->render(array('text' => $text)); - $label = $info . $label; + $app = JFactory::getApplication(); + $layout = new JLayoutFile('plugins.user.profile.fields.dob'); + $view = $app->input->getString('view', ''); + + // Only display the tip when editing profile + if ($app->isAdmin() || $view == 'profile' || $view == 'registration') + { + $layout = new JLayoutFile('plugins.user.profile.fields.dob'); + $info = $layout->render(array('text' => $text)); + $label = $info . $label; + } } return $label; diff --git a/templates/protostar/css/template.css b/templates/protostar/css/template.css index a1dfadb3c0454..0f2a6d2c12494 100644 --- a/templates/protostar/css/template.css +++ b/templates/protostar/css/template.css @@ -7477,3 +7477,6 @@ body.modal-open { overflow: hidden; -ms-overflow-style: none; } +#users-profile-custom label { + display: inline; +} diff --git a/templates/protostar/less/template.less b/templates/protostar/less/template.less index 56fcf25c953b5..40917f83039fc 100644 --- a/templates/protostar/less/template.less +++ b/templates/protostar/less/template.less @@ -605,4 +605,9 @@ code { body.modal-open { overflow: hidden; -ms-overflow-style: none; +} + +/* Align fields for the profile display */ +#users-profile-custom label { + display: inline; } \ No newline at end of file From 6b0ce1f1098a68ded08c1c2496f1175a5f606c52 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sun, 5 Jul 2015 00:54:47 +0200 Subject: [PATCH 579/809] Fix: Regression Notice: Undefined variable: link com_menus in 3.4.3 Fixes #7344 --- .../components/com_menus/views/menus/tmpl/default.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/administrator/components/com_menus/views/menus/tmpl/default.php b/administrator/components/com_menus/views/menus/tmpl/default.php index 06b901f3450aa..185b24fca45a9 100644 --- a/administrator/components/com_menus/views/menus/tmpl/default.php +++ b/administrator/components/com_menus/views/menus/tmpl/default.php @@ -198,8 +198,8 @@ - - + menutype); ?> + Date: Sat, 27 Jun 2015 17:04:37 -0400 Subject: [PATCH 580/809] System - Debug relies on __destruct which is never triggered (Fix #5826) Fixes #7279 --- plugins/system/debug/debug.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/system/debug/debug.php b/plugins/system/debug/debug.php index 12b2668fedce6..5b8f44c14e2fd 100644 --- a/plugins/system/debug/debug.php +++ b/plugins/system/debug/debug.php @@ -183,9 +183,11 @@ public function onAfterDispatch() /** * Show the debug info. * - * @since 1.6 + * @return void + * + * @since 1.6 */ - public function __destruct() + public function onAfterRespond() { // Do not render if debugging or language debug is not enabled. if (!JDEBUG && !$this->debugLang) From 6efe6253561aa0b1469a5ba033275937d6d1ff44 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Mon, 6 Jul 2015 15:38:04 +0200 Subject: [PATCH 581/809] [fix] Remove uneeded ACL checks --- administrator/components/com_templates/templates.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/administrator/components/com_templates/templates.php b/administrator/components/com_templates/templates.php index b97eb968c9dd2..2bc54b0a7d3bb 100644 --- a/administrator/components/com_templates/templates.php +++ b/administrator/components/com_templates/templates.php @@ -13,11 +13,7 @@ $app = JFactory::getApplication(); $user = JFactory::getUser(); -// ACL for hardening the access to the template manager. -if (!$user->authorise('core.manage', 'com_templates') - || !$user->authorise('core.edit', 'com_templates') - || !$user->authorise('core.create', 'com_templates') - || !$user->authorise('core.admin', 'com_templates')) +if (!$user->authorise('core.manage', 'com_templates')) { $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error'); From 72ac01539cc9fb279e5504943a12893035cecff5 Mon Sep 17 00:00:00 2001 From: maxvalentini77 Date: Thu, 23 Oct 2014 15:06:11 +0200 Subject: [PATCH 582/809] Fix behavior keepalive Fixes #4904 --- libraries/cms/html/behavior.php | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/libraries/cms/html/behavior.php b/libraries/cms/html/behavior.php index 769c80f249256..f9ebdbff8f863 100644 --- a/libraries/cms/html/behavior.php +++ b/libraries/cms/html/behavior.php @@ -634,28 +634,18 @@ public static function keepalive() return; } - $config = JFactory::getConfig(); - $lifetime = ($config->get('lifetime') * 60000); - $refreshTime = ($lifetime <= 60000) ? 30000 : $lifetime - 60000; + $url = JUri::base(true) . '/index.php?option=com_ajax&format=json'; - // Refresh time is 1 minute less than the lifetime assigned in the configuration.php file. - - // The longest refresh period is one hour to prevent integer overflow. - if ($refreshTime > 3600000 || $refreshTime <= 0) - { - $refreshTime = 3600000; - } - - $document = JFactory::getDocument(); $script = 'window.setInterval(function(){'; $script .= 'var r;'; $script .= 'try{'; $script .= 'r=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")'; $script .= '}catch(e){}'; - $script .= 'if(r){r.open("GET","./",true);r.send(null)}'; - $script .= '},' . $refreshTime . ');'; + $script .= 'if(r){r.open("GET","' . $url . '",true);r.send(null)}'; + $script .= '},45000);'; + + JFactory::getDocument()->addScriptDeclaration($script); - $document->addScriptDeclaration($script); static::$loaded[__METHOD__] = true; return; From 257ecfb01ebf759250eb377256bb2ee1f4506bfa Mon Sep 17 00:00:00 2001 From: Kubik-Rubik Date: Tue, 7 Jul 2015 11:04:13 +0200 Subject: [PATCH 583/809] Behavior Keepalive - Fixes #4904 --- libraries/cms/html/behavior.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libraries/cms/html/behavior.php b/libraries/cms/html/behavior.php index f9ebdbff8f863..a4f6c996c82b6 100644 --- a/libraries/cms/html/behavior.php +++ b/libraries/cms/html/behavior.php @@ -634,7 +634,16 @@ public static function keepalive() return; } - $url = JUri::base(true) . '/index.php?option=com_ajax&format=json'; + $life_time = JFactory::getConfig()->get('lifetime') * 60000; + $refresh_time = ($life_time <= 60000) ? 45000 : $life_time - 60000; + + // The longest refresh period is one hour to prevent integer overflow. + if ($refresh_time > 3600000 || $refresh_time <= 0) + { + $refresh_time = 3600000; + } + + $url = JUri::root(true) . '/index.php?option=com_ajax&format=json'; $script = 'window.setInterval(function(){'; $script .= 'var r;'; @@ -642,7 +651,7 @@ public static function keepalive() $script .= 'r=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")'; $script .= '}catch(e){}'; $script .= 'if(r){r.open("GET","' . $url . '",true);r.send(null)}'; - $script .= '},45000);'; + $script .= '},' . $refresh_time . ');'; JFactory::getDocument()->addScriptDeclaration($script); From 711e64cd0583171b67f96582f03d561dc13bcf6d Mon Sep 17 00:00:00 2001 From: Kubik-Rubik Date: Tue, 7 Jul 2015 15:18:36 +0200 Subject: [PATCH 584/809] Non-database handler + Ajax component integration --- libraries/cms/html/behavior.php | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/libraries/cms/html/behavior.php b/libraries/cms/html/behavior.php index a4f6c996c82b6..1c07cf22c1fbc 100644 --- a/libraries/cms/html/behavior.php +++ b/libraries/cms/html/behavior.php @@ -634,16 +634,32 @@ public static function keepalive() return; } - $life_time = JFactory::getConfig()->get('lifetime') * 60000; - $refresh_time = ($life_time <= 60000) ? 45000 : $life_time - 60000; - - // The longest refresh period is one hour to prevent integer overflow. - if ($refresh_time > 3600000 || $refresh_time <= 0) + // If the handler is not 'Database', we set a fixed, small refresh value (here: 5 min) + if (JFactory::getConfig()->get('session_handler') != 'database') + { + $refresh_time = 300000; + } + else { - $refresh_time = 3600000; + $life_time = JFactory::getConfig()->get('lifetime') * 60000; + $refresh_time = ($life_time <= 60000) ? 45000 : $life_time - 60000; + + // The longest refresh period is one hour to prevent integer overflow. + if ($refresh_time > 3600000 || $refresh_time <= 0) + { + $refresh_time = 3600000; + } } - $url = JUri::root(true) . '/index.php?option=com_ajax&format=json'; + // If we are in the frontend or logged in as a user, we can use the ajax component to reduce the load + if (JFactory::getApplication()->isSite() || !JFactory::getUser()->guest) + { + $url = JUri::base(true) . '/index.php?option=com_ajax&format=json'; + } + else + { + $url = JUri::base(true) . '/index.php'; + } $script = 'window.setInterval(function(){'; $script .= 'var r;'; From 0cf519323b3235807bb8cc9f8213ace682f51af5 Mon Sep 17 00:00:00 2001 From: Kubik-Rubik Date: Tue, 7 Jul 2015 16:17:31 +0200 Subject: [PATCH 585/809] Updated unit testing method - thanks @mbabker --- .../suites/libraries/cms/html/JHtmlBehaviorTest.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlBehaviorTest.php b/tests/unit/suites/libraries/cms/html/JHtmlBehaviorTest.php index 987b926ad6f69..31e23428a51c8 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlBehaviorTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlBehaviorTest.php @@ -630,17 +630,10 @@ public function testKeepalive() // We generate a random template name so that we don't collide or hit anything// $template = 'mytemplate' . rand(1, 10000); - // We create a stub (not a mock because we don't enforce whether it is called or not) - // to return a value from getTemplate - $mock = $this->getMock('myMockObject', array('getTemplate')); - $mock->expects($this->any()) + // We create a stub (not a mock because we don't enforce whether it is called or not) to return a value from getTemplate + JFactory::$application->expects($this->any()) ->method('getTemplate') - ->will($this->returnValue($template)); - - // @todo We need to mock this. - $mock->input = new JInput; - - JFactory::$application = $mock; + ->willReturn($template); JHtmlBehaviorInspector::keepalive(); $this->assertEquals( From 1e8b05d6b98b2d884108e3931af481de979c302b Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 4 Nov 2014 18:42:54 +0000 Subject: [PATCH 586/809] Standardize method for getting database object in models Fixes #4992 --- administrator/components/com_admin/models/sysinfo.php | 2 +- administrator/components/com_banners/models/banner.php | 2 +- administrator/components/com_categories/models/category.php | 2 +- administrator/components/com_contact/models/contact.php | 4 ++-- administrator/components/com_content/models/article.php | 2 +- administrator/components/com_installer/models/database.php | 6 +++--- administrator/components/com_installer/models/discover.php | 6 +++--- administrator/components/com_installer/models/manage.php | 2 +- administrator/components/com_installer/models/update.php | 4 ++-- .../components/com_joomlaupdate/models/default.php | 4 ++-- administrator/components/com_menus/models/item.php | 2 +- administrator/components/com_menus/models/menutypes.php | 2 +- administrator/components/com_newsfeeds/models/newsfeed.php | 4 ++-- administrator/components/com_plugins/models/plugin.php | 2 +- administrator/components/com_templates/models/style.php | 2 +- administrator/components/com_templates/models/template.php | 2 +- administrator/components/com_users/models/users.php | 2 +- components/com_content/models/article.php | 2 +- components/com_users/models/registration.php | 2 +- 19 files changed, 27 insertions(+), 27 deletions(-) diff --git a/administrator/components/com_admin/models/sysinfo.php b/administrator/components/com_admin/models/sysinfo.php index 324e352b6872a..8fbf28c547204 100644 --- a/administrator/components/com_admin/models/sysinfo.php +++ b/administrator/components/com_admin/models/sysinfo.php @@ -136,7 +136,7 @@ public function &getInfo() $this->info = array(); $version = new JVersion; $platform = new JPlatform; - $db = JFactory::getDbo(); + $db = $this->getDbo(); $this->info['php'] = php_uname(); $this->info['dbversion'] = $db->getVersion(); diff --git a/administrator/components/com_banners/models/banner.php b/administrator/components/com_banners/models/banner.php index fa129af04886f..57a108201260b 100644 --- a/administrator/components/com_banners/models/banner.php +++ b/administrator/components/com_banners/models/banner.php @@ -463,7 +463,7 @@ protected function prepareTable($table) // Set ordering to the last item if not set if (empty($table->ordering)) { - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('MAX(ordering)') ->from('#__banners'); diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php index 4bd98e8b7495d..736c7a8378b6f 100644 --- a/administrator/components/com_categories/models/category.php +++ b/administrator/components/com_categories/models/category.php @@ -580,7 +580,7 @@ public function save($data) $associations[$table->language] = $table->id; // Deleting old association for these items - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->delete('#__associations') ->where($db->quoteName('context') . ' = ' . $db->quote('com_categories.item')) diff --git a/administrator/components/com_contact/models/contact.php b/administrator/components/com_contact/models/contact.php index a764b2e0a2e90..9487a65dca72f 100644 --- a/administrator/components/com_contact/models/contact.php +++ b/administrator/components/com_contact/models/contact.php @@ -446,7 +446,7 @@ public function save($data) $associations[$item->language] = $item->id; // Deleting old association for these items - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->delete('#__associations') ->where('context=' . $db->quote('com_contact.item')) @@ -517,7 +517,7 @@ protected function prepareTable($table) // Set ordering to the last item if not set if (empty($table->ordering)) { - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('MAX(ordering)') ->from($db->quoteName('#__contact_details')); diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index d57721a75bc5e..ddd567642e8ae 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -571,7 +571,7 @@ public function save($data) $associations[$item->language] = $item->id; // Deleting old association for these items - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->delete('#__associations') ->where('context=' . $db->quote('com_content.item')) diff --git a/administrator/components/com_installer/models/database.php b/administrator/components/com_installer/models/database.php index 75165013a7b41..08fd48bcb8028 100644 --- a/administrator/components/com_installer/models/database.php +++ b/administrator/components/com_installer/models/database.php @@ -76,7 +76,7 @@ public function getItems() try { - $changeSet = JSchemaChangeset::getInstance(JFactory::getDbo(), $folder); + $changeSet = JSchemaChangeset::getInstance($this->getDbo(), $folder); } catch (RuntimeException $e) { @@ -108,7 +108,7 @@ public function getPagination() */ public function getSchemaVersion() { - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('version_id') ->from($db->quoteName('#__schemas')) @@ -130,7 +130,7 @@ public function fixSchemaVersion($changeSet) { // Get correct schema version -- last file in array. $schema = $changeSet->getSchema(); - $db = JFactory::getDbo(); + $db = $this->getDbo(); $result = false; // Check value. If ok, don't do update. diff --git a/administrator/components/com_installer/models/discover.php b/administrator/components/com_installer/models/discover.php index 85ca28dd32d62..c6fb694621647 100644 --- a/administrator/components/com_installer/models/discover.php +++ b/administrator/components/com_installer/models/discover.php @@ -68,7 +68,7 @@ protected function getListQuery() $client = $this->getState('filter.client_id'); $group = $this->getState('filter.group'); - $query = JFactory::getDbo()->getQuery(true) + $query = $this->getDbo()->getQuery(true) ->select('*') ->from('#__extensions') ->where('state=-1'); @@ -117,7 +117,7 @@ public function discover() $results = $installer->discover(); // Get all templates, including discovered ones - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('extension_id, element, folder, client_id, type') ->from('#__extensions'); @@ -209,7 +209,7 @@ public function discover_install() */ public function purge() { - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->delete('#__extensions') ->where('state = -1'); diff --git a/administrator/components/com_installer/models/manage.php b/administrator/components/com_installer/models/manage.php index 261c10989eedc..027b79c3be65c 100644 --- a/administrator/components/com_installer/models/manage.php +++ b/administrator/components/com_installer/models/manage.php @@ -290,7 +290,7 @@ protected function getListQuery() $type = $this->getState('filter.type'); $client = $this->getState('filter.client_id'); $group = $this->getState('filter.group'); - $query = JFactory::getDbo()->getQuery(true) + $query = $this->getDbo()->getQuery(true) ->select('*') ->select('2*protected+(1-protected)*enabled as status') ->from('#__extensions') diff --git a/administrator/components/com_installer/models/update.php b/administrator/components/com_installer/models/update.php index 3636fee4d90cd..f530482f3947d 100644 --- a/administrator/components/com_installer/models/update.php +++ b/administrator/components/com_installer/models/update.php @@ -190,7 +190,7 @@ public function findUpdates($eid = 0, $cache_timeout = 0, $minimum_stability = J */ public function purge() { - $db = JFactory::getDbo(); + $db = $this->getDbo(); // Note: TRUNCATE is a DDL operation // This may or may not mean depending on your database @@ -225,7 +225,7 @@ public function purge() */ public function enableSites() { - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->update('#__update_sites') ->set('enabled = 1') diff --git a/administrator/components/com_joomlaupdate/models/default.php b/administrator/components/com_joomlaupdate/models/default.php index dc897b8aae9a0..6b3ce1fa229b8 100644 --- a/administrator/components/com_joomlaupdate/models/default.php +++ b/administrator/components/com_joomlaupdate/models/default.php @@ -205,7 +205,7 @@ public function getFTPOptions() */ public function purge() { - $db = JFactory::getDbo(); + $db = $this->getDbo(); // Modify the database record $update_site = new stdClass; @@ -597,7 +597,7 @@ public function finaliseUpgrade() ob_end_clean(); // Get a database connector object. - $db = JFactory::getDbo(); + $db = $this->getDbo(); /* * Check to see if a file extension by the same name is already installed. diff --git a/administrator/components/com_menus/models/item.php b/administrator/components/com_menus/models/item.php index 839952a51ea23..036e7a1a4abc1 100644 --- a/administrator/components/com_menus/models/item.php +++ b/administrator/components/com_menus/models/item.php @@ -1285,7 +1285,7 @@ public function save($data) $associations[$table->language] = $table->id; // Deleting old association for these items - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->delete('#__associations') ->where('context=' . $db->quote('com_menus.item')) diff --git a/administrator/components/com_menus/models/menutypes.php b/administrator/components/com_menus/models/menutypes.php index 61122304f94f7..5586a267fe879 100644 --- a/administrator/components/com_menus/models/menutypes.php +++ b/administrator/components/com_menus/models/menutypes.php @@ -57,7 +57,7 @@ public function getTypeOptions() $list = array(); // Get the list of components. - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('name, element AS ' . $db->quoteName('option')) ->from('#__extensions') diff --git a/administrator/components/com_newsfeeds/models/newsfeed.php b/administrator/components/com_newsfeeds/models/newsfeed.php index abc141d8e255d..f966113cdb1ec 100644 --- a/administrator/components/com_newsfeeds/models/newsfeed.php +++ b/administrator/components/com_newsfeeds/models/newsfeed.php @@ -348,7 +348,7 @@ public function save($data) $associations[$item->language] = $item->id; // Deleting old association for these items - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->delete('#__associations') ->where($db->quoteName('context') . ' = ' . $db->quote('com_newsfeeds.item')) @@ -472,7 +472,7 @@ protected function prepareTable($table) // Set ordering to the last item if not set if (empty($table->ordering)) { - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('MAX(ordering)') ->from($db->quoteName('#__newsfeeds')); diff --git a/administrator/components/com_plugins/models/plugin.php b/administrator/components/com_plugins/models/plugin.php index 1928010292a75..4c98124113160 100644 --- a/administrator/components/com_plugins/models/plugin.php +++ b/administrator/components/com_plugins/models/plugin.php @@ -241,7 +241,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $lang = JFactory::getLanguage(); // Load the core and/or local language sys file(s) for the ordering field. - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('element')) ->from($db->quoteName('#__extensions')) diff --git a/administrator/components/com_templates/models/style.php b/administrator/components/com_templates/models/style.php index 1a2f652afc9c8..52ed4fc1aa161 100644 --- a/administrator/components/com_templates/models/style.php +++ b/administrator/components/com_templates/models/style.php @@ -533,7 +533,7 @@ public function save($data) if ($user->authorise('core.edit', 'com_menus') && $table->client_id == 0) { $n = 0; - $db = JFactory::getDbo(); + $db = $this->getDbo(); $user = JFactory::getUser(); if (!empty($data['assigned']) && is_array($data['assigned'])) diff --git a/administrator/components/com_templates/models/template.php b/administrator/components/com_templates/models/template.php index b88b615da9555..b83a5c82e5865 100644 --- a/administrator/components/com_templates/models/template.php +++ b/administrator/components/com_templates/models/template.php @@ -372,7 +372,7 @@ public function getForm($data = array(), $loadData = true) $app = JFactory::getApplication(); // Codemirror or Editor None should be enabled - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true) ->select('COUNT(*)') ->from('#__extensions as a') diff --git a/administrator/components/com_users/models/users.php b/administrator/components/com_users/models/users.php index 0c77001c39f28..ee1639caa371e 100644 --- a/administrator/components/com_users/models/users.php +++ b/administrator/components/com_users/models/users.php @@ -425,7 +425,7 @@ protected function getListQuery() */ protected function _getUserDisplayedGroups($user_id) { - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = "SELECT title FROM " . $db->quoteName('#__usergroups') . " ug left join " . $db->quoteName('#__user_usergroup_map') . " map on (ug.id = map.group_id)" . " WHERE map.user_id=" . (int) $user_id; diff --git a/components/com_content/models/article.php b/components/com_content/models/article.php index e5880741ab446..e1e2c3ea3efb3 100644 --- a/components/com_content/models/article.php +++ b/components/com_content/models/article.php @@ -284,7 +284,7 @@ public function storeVote($pk = 0, $rate = 0) $userIP = $_SERVER['REMOTE_ADDR']; // Initialize variables. - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query = $db->getQuery(true); // Create the base select statement. diff --git a/components/com_users/models/registration.php b/components/com_users/models/registration.php index 8847c40e4322d..e29893165dbac 100644 --- a/components/com_users/models/registration.php +++ b/components/com_users/models/registration.php @@ -565,7 +565,7 @@ public function register($temp) $this->setError(JText::_('COM_USERS_REGISTRATION_SEND_MAIL_FAILED')); // Send a system message to administrators receiving system mails - $db = JFactory::getDbo(); + $db = $this->getDbo(); $query->clear() ->select($db->quoteName(array('name', 'email', 'sendEmail', 'id'))) ->from($db->quoteName('#__users')) From 044953c2a0927d00531ccc6593212249b40779e5 Mon Sep 17 00:00:00 2001 From: Erftralle Date: Fri, 20 Feb 2015 14:21:26 +0100 Subject: [PATCH 587/809] Fix filtering in extension manager's manage view Fixes #6130 --- administrator/components/com_installer/models/manage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_installer/models/manage.php b/administrator/components/com_installer/models/manage.php index 027b79c3be65c..03f50e8d977a6 100644 --- a/administrator/components/com_installer/models/manage.php +++ b/administrator/components/com_installer/models/manage.php @@ -323,7 +323,7 @@ protected function getListQuery() $query->where('client_id=' . (int) $client); } - if ($group != '' && in_array($type, array('plugin', 'library', ''))) + if ($group != '') { $query->where('folder=' . $this->_db->quote($group == '*' ? '' : $group)); } From f11f4ebd140a2eedd508942cbdcaea0b2cf295fe Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sat, 28 Feb 2015 22:56:03 +0000 Subject: [PATCH 588/809] Add call to processLimit to appent the limit and offset to query Fixes #6234 --- libraries/joomla/database/driver/pdo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/joomla/database/driver/pdo.php b/libraries/joomla/database/driver/pdo.php index 588850b06d80a..9d9013dbff704 100644 --- a/libraries/joomla/database/driver/pdo.php +++ b/libraries/joomla/database/driver/pdo.php @@ -696,7 +696,7 @@ public function setQuery($query, $offset = null, $limit = null, $driverOptions = if ($query instanceof JDatabaseQueryLimitable && !is_null($offset) && !is_null($limit)) { - $query->setLimit($limit, $offset); + $query = $query->processLimit($query, $limit, $offset); } // Create a stringified version of the query (with prefixes replaced): From 860696dda0cbc7b09c8a8654e4ec2f110217ab01 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Fri, 19 Jun 2015 10:02:01 +0200 Subject: [PATCH 589/809] RTL, protostar: correcting sub-menu alignment Fixes #7200 --- templates/protostar/css/template.css | 12 ++++++++++++ templates/protostar/index.php | 1 + templates/protostar/less/template.less | 1 + templates/protostar/less/template_rtl.less | 15 +++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 templates/protostar/less/template_rtl.less diff --git a/templates/protostar/css/template.css b/templates/protostar/css/template.css index 0f2a6d2c12494..1768510ec095d 100644 --- a/templates/protostar/css/template.css +++ b/templates/protostar/css/template.css @@ -160,6 +160,18 @@ textarea { page-break-after: avoid; } } +.rtl .navigation .nav-child { + left: auto; + right: 0; +} +.rtl .navigation .nav > li > .nav-child:before { + left: auto; + right: 12px; +} +.rtl .navigation .nav > li > .nav-child:after { + left: auto; + right: 13px; +} .clearfix { *zoom: 1; } diff --git a/templates/protostar/index.php b/templates/protostar/index.php index cdbc58c019069..6de3447b651dd 100644 --- a/templates/protostar/index.php +++ b/templates/protostar/index.php @@ -127,6 +127,7 @@ . ($task ? ' task-' . $task : ' no-task') . ($itemid ? ' itemid-' . $itemid : '') . ($params->get('fluidContainer') ? ' fluid' : ''); + echo ($this->direction == 'rtl' ? ' rtl' : ''); ?>"> diff --git a/templates/protostar/less/template.less b/templates/protostar/less/template.less index 40917f83039fc..155c8627da3a7 100644 --- a/templates/protostar/less/template.less +++ b/templates/protostar/less/template.less @@ -3,6 +3,7 @@ // Core variables and mixins @import "variables.less"; // Custom for this template +@import "template_rtl.less"; // Specific for rtl @import "../../../media/jui/less/mixins.less"; // Grid system and page structure diff --git a/templates/protostar/less/template_rtl.less b/templates/protostar/less/template_rtl.less new file mode 100644 index 0000000000000..5f85b10505063 --- /dev/null +++ b/templates/protostar/less/template_rtl.less @@ -0,0 +1,15 @@ +// Specific RTL. rtl class is added to body tag + +// Fix for sub menu alignment +.rtl .navigation .nav-child { + left: auto; + right:0; +} +.rtl .navigation .nav > li > .nav-child:before { + left: auto; + right:12px; +} +.rtl .navigation .nav > li > .nav-child:after { + left: auto; + right:13px; +} \ No newline at end of file From b03f68dca95a0da28201ae68d9adec0a775e0540 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Wed, 8 Jul 2015 12:41:24 +0200 Subject: [PATCH 590/809] add missing dot from https://github.com/joomla/joomla-cms/pull/6234 --- libraries/joomla/database/driver/pdo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/joomla/database/driver/pdo.php b/libraries/joomla/database/driver/pdo.php index 588850b06d80a..64acd11db2a1e 100644 --- a/libraries/joomla/database/driver/pdo.php +++ b/libraries/joomla/database/driver/pdo.php @@ -676,7 +676,7 @@ public function select($database) * @param mixed $query The SQL statement to set either as a JDatabaseQuery object or a string. * @param integer $offset The affected row offset to set. * @param integer $limit The maximum affected rows to set. - * @param array $driverOptions The optional PDO driver options + * @param array $driverOptions The optional PDO driver options. * * @return JDatabaseDriver This object to support method chaining. * From 6f9a1314395288aca6a0a48a12dac96369d076ef Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Wed, 8 Jul 2015 10:08:44 +0200 Subject: [PATCH 591/809] Improve wording - Change Purge to Clear - Fixes #7376 --- administrator/language/en-GB/en-GB.com_admin.ini | 2 +- administrator/language/en-GB/en-GB.com_cache.ini | 14 +++++++------- administrator/language/en-GB/en-GB.com_finder.ini | 4 ++-- .../language/en-GB/en-GB.com_installer.ini | 6 +++--- .../language/en-GB/en-GB.com_messages.ini | 4 ++-- administrator/language/en-GB/en-GB.ini | 4 ++-- administrator/language/en-GB/en-GB.lib_joomla.ini | 4 ++-- administrator/language/en-GB/en-GB.mod_menu.ini | 2 +- language/en-GB/en-GB.finder_cli.ini | 6 +++--- language/en-GB/en-GB.lib_joomla.ini | 4 ++-- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_admin.ini b/administrator/language/en-GB/en-GB.com_admin.ini index d5f1082afa65e..ba68b765a1761 100644 --- a/administrator/language/en-GB/en-GB.com_admin.ini +++ b/administrator/language/en-GB/en-GB.com_admin.ini @@ -86,7 +86,7 @@ COM_ADMIN_HELP_MENUS_MENU_MANAGER_EDIT="Menu Manager - New/Edit" COM_ADMIN_HELP_SITE_GLOBAL_CONFIGURATION="Global Configuration" COM_ADMIN_HELP_SITE_MAINTENANCE_CLEAR_CACHE="Cache Manager: Clear Cache" COM_ADMIN_HELP_SITE_MAINTENANCE_GLOBAL_CHECK-IN="Global Check-in" -COM_ADMIN_HELP_SITE_MAINTENANCE_PURGE_EXPIRED_CACHE="Cache Manager: Purge Expired Cache" +COM_ADMIN_HELP_SITE_MAINTENANCE_PURGE_EXPIRED_CACHE="Cache Manager: Clear Expired Cache" COM_ADMIN_HELP_SITE_SYSTEM_INFORMATION="System Information" COM_ADMIN_HELP_START_HERE="Start Here" COM_ADMIN_HELP_USERS_ACCESS_LEVELS="User Manager: Access Levels" diff --git a/administrator/language/en-GB/en-GB.com_cache.ini b/administrator/language/en-GB/en-GB.com_cache.ini index a05cd50d548a6..ed2558e971b15 100644 --- a/administrator/language/en-GB/en-GB.com_cache.ini +++ b/administrator/language/en-GB/en-GB.com_cache.ini @@ -7,17 +7,17 @@ COM_CACHE="Cache Manager" COM_CACHE_BACK_CACHE_MANAGER="Return to Cache Manager" COM_CACHE_CLEAR_CACHE_ADMIN="Clear Cache Admin" COM_CACHE_CLEAR_CACHE="Maintenance: Clear Cache" -COM_CACHE_PURGE_EXPIRED_CACHE="Maintenance: Purge Expired Cache" +COM_CACHE_PURGE_EXPIRED_CACHE="Maintenance: Clear Expired Cache" COM_CACHE_CONFIGURATION="Cache Manager Settings" -COM_CACHE_EXPIRED_ITEMS_HAVE_BEEN_PURGED="Expired items have been purged." -COM_CACHE_EXPIRED_ITEMS_PURGING_ERROR="Error purging expired items." +COM_CACHE_EXPIRED_ITEMS_HAVE_BEEN_PURGED="Expired items have been cleared." +COM_CACHE_EXPIRED_ITEMS_PURGING_ERROR="Error clearing expired items." COM_CACHE_GROUP="Cache Group" COM_CACHE_MANAGER="Cache Manager" COM_CACHE_NUMBER_OF_FILES="Number of Files" -COM_CACHE_PURGE_CACHE_ADMIN="Purge Cache Admin" -COM_CACHE_PURGE_EXPIRED="Purge expired" -COM_CACHE_PURGE_EXPIRED_ITEMS="Purge expired items" -COM_CACHE_PURGE_INSTRUCTIONS="Click on the Purge Expired icon in the toolbar to delete all expired cache files. Note: Cache files that are still current will not be deleted." +COM_CACHE_PURGE_CACHE_ADMIN="Clear Cache Admin" +COM_CACHE_PURGE_EXPIRED="Clear Expired Cache" +COM_CACHE_PURGE_EXPIRED_ITEMS="Clear expired items" +COM_CACHE_PURGE_INSTRUCTIONS="Click on the Clear Expired Cache icon in the toolbar to delete all expired cache files. Note: Cache files that are still current will not be deleted." COM_CACHE_RESOURCE_INTENSIVE_WARNING="WARNING: This can be resource intensive on sites with a large number of items!" COM_CACHE_SIZE="Size" COM_CACHE_SELECT_CLIENT="- Select Location -" diff --git a/administrator/language/en-GB/en-GB.com_finder.ini b/administrator/language/en-GB/en-GB.com_finder.ini index 3b3821aa3fa8a..73215579f8dba 100644 --- a/administrator/language/en-GB/en-GB.com_finder.ini +++ b/administrator/language/en-GB/en-GB.com_finder.ini @@ -138,9 +138,9 @@ COM_FINDER_INDEX_NO_CONTENT="No content matches your search criteria." COM_FINDER_INDEX_NO_DATA="No content has been indexed." ; Change 'Content%20-%20Smart%20Search' to the value for PLG_CONTENT_FINDER in plg_content_finder.sys.ini for your language COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="Smart Search content plugin is not enabled. Changes to content will not update the Smart Search index if you do not enable this plugin." -COM_FINDER_INDEX_PURGE_SUCCESS="All items have been successfully purged." +COM_FINDER_INDEX_PURGE_SUCCESS="All items have been successfully deleted." COM_FINDER_INDEX_TIP="Start the indexer by pressing the Index button in the toolbar." -COM_FINDER_INDEX_TOOLBAR_PURGE="Purge" +COM_FINDER_INDEX_TOOLBAR_PURGE="Clear Index" COM_FINDER_INDEX_TOOLBAR_TITLE="Smart Search: Manage Indexed Content" COM_FINDER_INDEX_TYPE_FILTER="Any Type of Content" COM_FINDER_INDEXER_HEADER_COMPLETE="Indexing Complete" diff --git a/administrator/language/en-GB/en-GB.com_installer.ini b/administrator/language/en-GB/en-GB.com_installer.ini index 5cd54a23a8896..898e5ef126bd3 100644 --- a/administrator/language/en-GB/en-GB.com_installer.ini +++ b/administrator/language/en-GB/en-GB.com_installer.ini @@ -87,12 +87,12 @@ COM_INSTALLER_MSG_DATABASE_UPDATEVERSION_ERROR="Database update version (%s) doe COM_INSTALLER_MSG_DESCFTP="For installing or uninstalling Extensions, Joomla will most likely need your FTP account details. Please enter them in the form fields below." COM_INSTALLER_MSG_DESCFTPTITLE="FTP Login Details" COM_INSTALLER_MSG_DISCOVER_DESCRIPTION="This screen allows you to discover extensions that have not gone through the normal installation process.
    For example, some extensions are too large in file size to upload using the web interface due to limitations of the web hosting environment. Using this feature you can upload extension files directly to your web server using some other means such as FTP or SFTP and place those extension files into the appropriate directory.
    You can then use the discover feature to find the newly uploaded extension and activate it in your Joomla installation.
    Using the discover operation you can also discover and install multiple extensions at the same time." -COM_INSTALLER_MSG_DISCOVER_FAILEDTOPURGEEXTENSIONS="Failed to purge extensions" +COM_INSTALLER_MSG_DISCOVER_FAILEDTOPURGEEXTENSIONS="Failed to clear discovered extensions" COM_INSTALLER_MSG_DISCOVER_INSTALLFAILED="Discover install failed." COM_INSTALLER_MSG_DISCOVER_INSTALLSUCCESSFUL="Discover install successful." COM_INSTALLER_MSG_DISCOVER_NOEXTENSION="No extensions have been discovered. Click Discover to find new extensions that might be available for install." COM_INSTALLER_MSG_DISCOVER_NOEXTENSIONSELECTED="No extension selected." -COM_INSTALLER_MSG_DISCOVER_PURGEDDISCOVEREDEXTENSIONS="Purged discovered extensions." +COM_INSTALLER_MSG_DISCOVER_PURGEDDISCOVEREDEXTENSIONS="Cleared discovered extensions." COM_INSTALLER_MSG_INSTALL_ENTER_A_URL="Please enter a URL" COM_INSTALLER_MSG_INSTALL_INVALID_URL="Invalid URL" COM_INSTALLER_MSG_INSTALL_NO_FILE_SELECTED="No file selected." @@ -182,7 +182,7 @@ COM_INSTALLER_TOOLBAR_DISCOVER="Discover" COM_INSTALLER_TOOLBAR_FIND_LANGUAGES="Find languages" COM_INSTALLER_TOOLBAR_FIND_UPDATES="Find Updates" COM_INSTALLER_TOOLBAR_INSTALL="Install" -COM_INSTALLER_TOOLBAR_PURGE="Purge" +COM_INSTALLER_TOOLBAR_PURGE="Clear Cache" COM_INSTALLER_TOOLBAR_UPDATE="Update" COM_INSTALLER_TYPE_CLIENT="Location" COM_INSTALLER_TYPE_COMPONENT="Component" diff --git a/administrator/language/en-GB/en-GB.com_messages.ini b/administrator/language/en-GB/en-GB.com_messages.ini index 3442b0b108c05..2f988e911300c 100644 --- a/administrator/language/en-GB/en-GB.com_messages.ini +++ b/administrator/language/en-GB/en-GB.com_messages.ini @@ -13,8 +13,8 @@ COM_MESSAGES_ERROR_INVALID_FROM_USER="Invalid sender" COM_MESSAGES_ERROR_INVALID_MESSAGE="Invalid message content" COM_MESSAGES_ERROR_INVALID_SUBJECT="Invalid subject" COM_MESSAGES_ERROR_INVALID_TO_USER="Invalid recipient" -COM_MESSAGES_FIELD_AUTO_PURGE_DESC="Automatically purge private messages after the given number of days." -COM_MESSAGES_FIELD_AUTO_PURGE_LABEL="Auto-purge Messages (days)" +COM_MESSAGES_FIELD_AUTO_PURGE_DESC="Automatically delete private messages after the given number of days." +COM_MESSAGES_FIELD_AUTO_PURGE_LABEL="Auto-delete Messages (days)" COM_MESSAGES_FIELD_DATE_TIME_LABEL="Posted" COM_MESSAGES_FIELD_LOCK_DESC="Lock your private message inbox." COM_MESSAGES_FIELD_LOCK_LABEL="Lock Inbox" diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index 833a0d7d7310b..0132fd97d1d16 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -539,7 +539,7 @@ JGLOBAL_SUBHEADING_DESC="Optional text to show as a subheading." JGLOBAL_SUBHEADING_LABEL="Page Subheading" JGLOBAL_SUBMENU_CHECKIN="Check-in" JGLOBAL_SUBMENU_CLEAR_CACHE="Clear Cache" -JGLOBAL_SUBMENU_PURGE_EXPIRED_CACHE="Purge Expired Cache" +JGLOBAL_SUBMENU_PURGE_EXPIRED_CACHE="Clear Expired Cache" JGLOBAL_SUBSLIDER_BLOG_EXTENDED_LABEL="The option below gives the ability to include articles from subcategories in the Blog layout." JGLOBAL_SUBSLIDER_BLOG_LAYOUT_LABEL="If a field is left blank, global settings will be used." JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL="These options are also used when you click
    on one of the category links, on the first page and/or thereafter,
    unless they are changed for a specific menu item." @@ -853,7 +853,7 @@ JTOOLBAR_INSTALL="Install" JTOOLBAR_NEW="New" JTOOLBAR_OPTIONS="Options" JTOOLBAR_PUBLISH="Publish" -JTOOLBAR_PURGE_CACHE="Purge Cache" +JTOOLBAR_PURGE_CACHE="Clear Cache" JTOOLBAR_REBUILD="Rebuild" JTOOLBAR_REFRESH_CACHE="Refresh Cache" JTOOLBAR_REMOVE="Remove" diff --git a/administrator/language/en-GB/en-GB.lib_joomla.ini b/administrator/language/en-GB/en-GB.lib_joomla.ini index 1701ea6d06eb4..ec46732e161ab 100644 --- a/administrator/language/en-GB/en-GB.lib_joomla.ini +++ b/administrator/language/en-GB/en-GB.lib_joomla.ini @@ -509,8 +509,8 @@ JLIB_INSTALLER_ABORT_TPL_INSTALL_FAILED_CREATE_DIRECTORY="Template Install: Fail JLIB_INSTALLER_ABORT_TPL_INSTALL_ROLLBACK="Template Install: %s" JLIB_INSTALLER_ABORT_TPL_INSTALL_UNKNOWN_CLIENT="Template Install: Unknown client type [%s]" JLIB_INSTALLER_AVAILABLE_UPDATE_PHP_VERSION="For the extension %1$s version %2$s is available, but it requires at least PHP version %3$s while your system only has %4$s" -JLIB_INSTALLER_PURGED_UPDATES="Purged updates" -JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES="Failed to purge updates." +JLIB_INSTALLER_PURGED_UPDATES="Cleared updates" +JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES="Failed to clear updates." JLIB_INSTALLER_DEFAULT_STYLE="%s - Default" JLIB_INSTALLER_DISCOVER="Discover" JLIB_INSTALLER_ERROR_COMP_DISCOVER_STORE_DETAILS="Component Discover install: Failed to store component details." diff --git a/administrator/language/en-GB/en-GB.mod_menu.ini b/administrator/language/en-GB/en-GB.mod_menu.ini index edb251a7d92ad..5fdae2c0cbed1 100644 --- a/administrator/language/en-GB/en-GB.mod_menu.ini +++ b/administrator/language/en-GB/en-GB.mod_menu.ini @@ -67,7 +67,7 @@ MOD_MENU_MENU_MANAGER="Menu Manager" MOD_MENU_MENU_MANAGER_NEW_MENU="Add New Menu" MOD_MENU_MENU_MANAGER_NEW_MENU_ITEM="Add New Menu Item" MOD_MENU_NEW_PRIVATE_MESSAGE="New Private Message" -MOD_MENU_PURGE_EXPIRED_CACHE="Purge Expired Cache" +MOD_MENU_PURGE_EXPIRED_CACHE="Clear Expired Cache" MOD_MENU_READ_PRIVATE_MESSAGES="Read Private Messages" MOD_MENU_SETTINGS="Settings" MOD_MENU_MAINTENANCE="Maintenance" diff --git a/language/en-GB/en-GB.finder_cli.ini b/language/en-GB/en-GB.finder_cli.ini index cd03ee4653754..01e009c3ff21b 100644 --- a/language/en-GB/en-GB.finder_cli.ini +++ b/language/en-GB/en-GB.finder_cli.ini @@ -6,9 +6,9 @@ FINDER_CLI="Smart Search INDEXER" FINDER_CLI_BATCH_COMPLETE=" * Processed batch %s in %s seconds." FINDER_CLI_FILTER_RESTORE_WARNING="Warning: Did not find taxonomy %s/%s in filter %s" -FINDER_CLI_INDEX_PURGE="Purging index" -FINDER_CLI_INDEX_PURGE_FAILED="- index purge failed." -FINDER_CLI_INDEX_PURGE_SUCCESS="- index purge successful" +FINDER_CLI_INDEX_PURGE="Clear index" +FINDER_CLI_INDEX_PURGE_FAILED="- index clear failed." +FINDER_CLI_INDEX_PURGE_SUCCESS="- index clear successful" FINDER_CLI_PROCESS_COMPLETE="Total Processing Time: %s seconds." FINDER_CLI_RESTORE_FILTER_COMPLETED="- number of filters restored: %s" FINDER_CLI_RESTORE_FILTERS="Restoring filters" diff --git a/language/en-GB/en-GB.lib_joomla.ini b/language/en-GB/en-GB.lib_joomla.ini index debfbadbcc52b..6182fe54b5489 100644 --- a/language/en-GB/en-GB.lib_joomla.ini +++ b/language/en-GB/en-GB.lib_joomla.ini @@ -509,8 +509,8 @@ JLIB_INSTALLER_ABORT_TPL_INSTALL_FAILED_CREATE_DIRECTORY="Template Install: Fail JLIB_INSTALLER_ABORT_TPL_INSTALL_ROLLBACK="Template Install: %s" JLIB_INSTALLER_ABORT_TPL_INSTALL_UNKNOWN_CLIENT="Template Install: Unknown client type [%s]" JLIB_INSTALLER_AVAILABLE_UPDATE_PHP_VERSION="For the extension %1$s version %2$s is available, but it requires at least PHP version %3$s while your system only has %4$s" -JLIB_INSTALLER_PURGED_UPDATES="Purged updates" -JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES="Failed to purge updates." +JLIB_INSTALLER_PURGED_UPDATES="Cleared updates" +JLIB_INSTALLER_FAILED_TO_PURGE_UPDATES="Failed to clear updates." JLIB_INSTALLER_DEFAULT_STYLE="%s - Default" JLIB_INSTALLER_DISCOVER="Discover" JLIB_INSTALLER_ERROR_COMP_DISCOVER_STORE_DETAILS="Component Discover install: Failed to store component details." From 92cec05258cfdb9c4b715cb8deb4f4f3303ed1ed Mon Sep 17 00:00:00 2001 From: Andrey Aleksanyants Date: Tue, 7 Jul 2015 23:06:13 +0400 Subject: [PATCH 592/809] Update en-GB.com_banners.ini Fixes #7370 --- administrator/language/en-GB/en-GB.com_banners.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.com_banners.ini b/administrator/language/en-GB/en-GB.com_banners.ini index b602a14654e74..091b45469c383 100644 --- a/administrator/language/en-GB/en-GB.com_banners.ini +++ b/administrator/language/en-GB/en-GB.com_banners.ini @@ -136,7 +136,7 @@ COM_BANNERS_FIELD_VALUE_IMAGE="Image" COM_BANNERS_FIELD_VALUE_USECLIENTDEFAULT="-- Use Client Default --" COM_BANNERS_FIELD_VALUE_USECOMPONENTDEFAULT="-- Use Component Default --" COM_BANNERS_FIELD_VERSION_LABEL="Revision" -COM_BANNERS_FIELD_VERSION_DESC="A count of the number of times this article has been revised." +COM_BANNERS_FIELD_VERSION_DESC="A count of the number of times this banner has been revised." COM_BANNERS_FIELD_WIDTH_LABEL="Width" COM_BANNERS_FIELD_WIDTH_DESC="The width of the banner." COM_BANNERS_FIELDSET_CONFIG_BANNER_OPTIONS_DESC="These settings apply to version history for Banners, Banner Categories and Banner Clients." From 2f76e54df9f76b2cfd2cae71edc0184b75a1a149 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Thu, 5 Mar 2015 07:59:40 +0100 Subject: [PATCH 593/809] PostgreSQL - SQL error when add new tag Fixes #6314 --- .../components/com_tags/tables/tag.php | 46 +++++++++++++++++++ .../joomla/database/driver/postgresql.php | 8 ++++ libraries/joomla/database/driver/sqlsrv.php | 4 ++ 3 files changed, 58 insertions(+) diff --git a/administrator/components/com_tags/tables/tag.php b/administrator/components/com_tags/tables/tag.php index 966838b71856b..8d0a86cdf17ab 100644 --- a/administrator/components/com_tags/tables/tag.php +++ b/administrator/components/com_tags/tables/tag.php @@ -144,6 +144,52 @@ public function check() $bad_characters = array("\"", "<", ">"); $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); } + // Not Null sanity check + $date = JFactory::getDate(); + if (empty($this->params)) + { + $this->params = '{}'; + } + if (empty($this->metadesc)) + { + $this->metadesc = ' '; + } + if (empty($this->metakey)) + { + $this->metakey = ' '; + } + if (empty($this->metadata)) + { + $this->metadata = '{}'; + } + if (empty($this->urls)) + { + $this->urls = '{}'; + } + if (empty($this->images)) + { + $this->images = '{}'; + } + if (!(int) $this->checked_out_time) + { + $this->checked_out_time = $date->toSql(); + } + if (!(int) $this->modified_time) + { + $this->modified_time = $date->toSql(); + } + if (!(int) $this->modified_time) + { + $this->modified_time = $date->toSql(); + } + if (!(int) $this->publish_up) + { + $this->publish_up = $date->toSql(); + } + if (!(int) $this->publish_down) + { + $this->publish_down = $date->toSql(); + } return true; } diff --git a/libraries/joomla/database/driver/postgresql.php b/libraries/joomla/database/driver/postgresql.php index 1da95b5816346..346392cf0c3a9 100644 --- a/libraries/joomla/database/driver/postgresql.php +++ b/libraries/joomla/database/driver/postgresql.php @@ -393,6 +393,14 @@ public function getTableColumns($table, $typeOnly = true) { foreach ($fields as $field) { + if (stristr(strtolower($field->type), "character varying")) + { + $field->Default = ""; + } + if (stristr(strtolower($field->type), "text")) + { + $field->Default = ""; + } // Do some dirty translation to MySQL output. // TODO: Come up with and implement a standard across databases. $result[$field->column_name] = (object) array( diff --git a/libraries/joomla/database/driver/sqlsrv.php b/libraries/joomla/database/driver/sqlsrv.php index 8ba5d02c7a631..6cc04bb883cbd 100644 --- a/libraries/joomla/database/driver/sqlsrv.php +++ b/libraries/joomla/database/driver/sqlsrv.php @@ -362,6 +362,10 @@ public function getTableColumns($table, $typeOnly = true) { foreach ($fields as $field) { + if (stristr(strtolower($field->type), "nvarchar")) + { + $field->Default = ""; + } $result[$field->Field] = $field; } } From f1d39f46708ce336a486c9025e79152231522678 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Thu, 9 Jul 2015 08:17:42 +0200 Subject: [PATCH 594/809] Updated installation language file for hy-AM --- installation/language/hy-AM/hy-AM.ini | 332 +++++++++++++------------- installation/language/hy-AM/hy-AM.xml | 2 +- 2 files changed, 167 insertions(+), 167 deletions(-) diff --git a/installation/language/hy-AM/hy-AM.ini b/installation/language/hy-AM/hy-AM.ini index a898028f8926a..d3eba53e34a30 100644 --- a/installation/language/hy-AM/hy-AM.ini +++ b/installation/language/hy-AM/hy-AM.ini @@ -1,152 +1,152 @@ ; Joomla! Project ; Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php -; Note : All ini files need to be saved as UTF-8 - No BOM +; Note ։ All ini files need to be saved as UTF-8 ;Stepbar -INSTL_STEP_COMPLETE_LABEL="Ավարտ" -INSTL_STEP_DATABASE_LABEL="Տվյալների բազան" -INSTL_STEP_DEFAULTLANGUAGE_LABEL="Ընտրեք լռելյայն լեզուն" -INSTL_STEP_FTP_LABEL="FTP" -INSTL_STEP_LANGUAGES_LABEL="Տեղակայել լեզուներ" -INSTL_STEP_SITE_LABEL="Կազմաձև" +INSTL_STEP_COMPLETE_LABEL="Տեղակայման ավարտ" +INSTL_STEP_DATABASE_LABEL="ՏԲ-ի կազմաձևում" +INSTL_STEP_DEFAULTLANGUAGE_LABEL="Լռելյայն լեզվի ընտրություն" +INSTL_STEP_FTP_LABEL="FTP-ի կազմաձևում" +INSTL_STEP_LANGUAGES_LABEL="Լեզվային փաթեթների տեղակայում" +INSTL_STEP_SITE_LABEL="Կայքի կազմաձևում" INSTL_STEP_SUMMARY_LABEL="Թռուցքադիտում" ;Language view INSTL_SELECT_LANGUAGE_TITLE="Ընտրեք լեզուն" -INSTL_WARNJAVASCRIPT="Զգուշացում՝ JavaScript-ը պետք է միացրած լինի՝ Joomla!-ի ճիշտ տեղակայման համար:" -INSTL_WARNJSON="Ձեր PHP կարգավորումներում JSON-ը պետք է միացրած լինի՝ Joomla!-ի ճիշտ տեղակայման համար:" +INSTL_WARNJAVASCRIPT="ԶԳՈՒՇԱՑՈՒՄ՝ JavaScript-ը պետք է միացրած լինի՝ Joomla-ի պատշաճ տեղակայման համար։" +INSTL_WARNJSON="Ձեր սպասարկչի PHP կարգավորումներում անհրաժեշտ է միացնել JSON-ը՝ Joomla-ի պատշաճ տեղակայման համար։" ;Preinstall view -INSTL_PRECHECK_TITLE="Նախատեղակայման ստուգում" -INSTL_PRECHECK_DESC="Եթե այս միավորներից որևէ մեկը չի աջակցվում (նշված է որպես Ոչ), խնդրում ենք կատարել անհրաժեշտ գործողություններ՝ դրանք ուղղելու համար:
    Դուք չեք կարող տեղակայել Joomla!-ն մինչև ստորև նշված պահանջները չբավարարվեն:" -INSTL_PRECHECK_RECOMMENDED_SETTINGS_TITLE="Հանձնարարելի կայանքները:" -INSTL_PRECHECK_RECOMMENDED_SETTINGS_DESC="Այս կայանքները հանձնարարելի են PHP-ի համար՝ Joomla-ի հետ ամբողջական համատեղելիությունը ապահովելու նպատակով:
    Սակայն, Joomla!-ն կգործի անգամ եթեձեր կայանքները ամբողջությամբ չեն համապատասխանում հանձնարարելի կազմաձևին:" +INSTL_PRECHECK_TITLE="Նախնական ստուգում" +INSTL_PRECHECK_DESC="Եթե ստորև նշված կայանքներից որևէ մեկը չի աջակցվում (կողքը ցուցարդվում է Ոչ պիտակը), խնդրում ենք կատարել անհրաժեշտ գործողություններ՝ հայտնաբերված խնդիրները վերացնելու համար։
    Դուք չեք կարողանա տեղակայել Joomla-ն մինչև բոլոր այս պահանջները չբավարարվեն։" +INSTL_PRECHECK_RECOMMENDED_SETTINGS_TITLE="Հանձնարարելի կայանքները՝" +INSTL_PRECHECK_RECOMMENDED_SETTINGS_DESC="Այս կայանքները հանձնարարելի են PHP-ի համար՝ Joomla-ի հետ ամբողջական համատեղելիությունը ապահովելու նպատակով։
    Սակայն, Joomla-ն կգործի անգամ եթե ձեր կայանքները ամբողջությամբ չեն համապատասխանում հանձնարարելի կազմաձևմանը։" INSTL_PRECHECK_DIRECTIVE="Հրահանգ" INSTL_PRECHECK_RECOMMENDED="Հանձնարարելի" -INSTL_PRECHECK_ACTUAL="Փաստացի" +INSTL_PRECHECK_ACTUAL="Ընթացիկ" ; Database view -INSTL_DATABASE="Տվյալների բազայի կազմաձև" -INSTL_DATABASE_HOST_DESC="Սովորաբար՝ "localhost":" -INSTL_DATABASE_HOST_LABEL="Խնամորդի անունը" -INSTL_DATABASE_NAME_DESC="Որոշ խնամորդները տրամադրում են մեկ ՏԲ: Նման դեպքերում օգտագործեք աղյուսակների նախածանցները՝ Joomla-ի աղյուսակները նույն ՏԲ-ում տարբեկակելու համար:" +INSTL_DATABASE="ՏԲ-ի կազմաձևում" +INSTL_DATABASE_HOST_DESC="Սովորաբար՝ "localhost"։" +INSTL_DATABASE_HOST_LABEL="Խնամորդի անուն" +INSTL_DATABASE_NAME_DESC="Որոշ հոսթինգի մատակարարները տրամադրում են մեկ ՏԲ մի քանի կայքերի համար։ Նման դեպքերում օգտագործեք աղյուսակների նախածանցները՝ Joomla-ի աղյուսակները նույն ՏԲ-ում տարբեկակելու համար։" INSTL_DATABASE_NAME_LABEL="ՏԲ-ի անուն" -INSTL_DATABASE_NO_SCHEMA="Տվյալ ՏԲ-ի տեսակի համար ՏԲ-ի ուրվագիր գոյություն չունի:" -INSTL_DATABASE_OLD_PROCESS_DESC="Joomla!-ի նախորդ տեղակայումներից մնացած բոլոր պահուստավորված աղյուսակները կփոխարինվեն:" +INSTL_DATABASE_NO_SCHEMA="Տվյալ ՏԲ-ի տեսակի ուրվակազմը գոյություն չունի։" +INSTL_DATABASE_OLD_PROCESS_DESC="Joomla-ի նախորդ տեղակայումներից մնացած բոլոր պահուստավորված աղյուսակները կփոխարինվեն։" INSTL_DATABASE_OLD_PROCESS_LABEL="Հին ՏԲ-ի մշակում" -INSTL_DATABASE_PASSWORD_DESC="Կայքի անվտանգության համար ՏԲ-ի հաշվի գաղտնաբառի օգտագորշումը պարտադիր է:" +INSTL_DATABASE_PASSWORD_DESC="Կայքի անվտանգության համար ՏԲ-ին միանալու ժամանակ գաղտնաբառի օգտագործումը պարտադիր է։" INSTL_DATABASE_PASSWORD_LABEL="Գաղտնաբառ" -INSTL_DATABASE_PREFIX_DESC="Ընտրեք աղյուսակների նախածանցը կամ օգտագործեք պատահականորեն ստեղծվածը: Նախընտրելի ձևաչափը՝ 3-4 գրանշաններից բաղկացած, միայն այբբենաթվային նշանների պարունակությամբ, վերջում ՊԱՐՏԱԴԻՐ ըդնգծումով(_): Նախապես համոզվեք, որ նույն նախածանցը չի օգտագործվում այլ աղյուսակներում:" +INSTL_DATABASE_PREFIX_DESC="Նշեք աղյուսակների նախածանցը կամ օգտագործեք պատահականորեն ստեղծվածը։ Նախընտրելի ձևաչափը՝ այն պետք է բաղկացած լինի 3-4 գրանշաններից, սկսվի գրանշանով, պարունակի միայն այբբենաթվային նշաններ, և ՊԱՐՏԱԴԻՐ վերջանա ըդնգծումով('_')։ Նախապես համոզվեք, որ նույն նախածանցը չի օգտագործվում նույն ՏԲ-ի այլ աղյուսակներում։" INSTL_DATABASE_PREFIX_LABEL="Աղուսայկների նախածանց" -INSTL_DATABASE_PREFIX_MSG="Աղուսայկների նախածանցը պետք է սկսվի գրանշանով, շարունակվի այբբենաթվային նշաններով և վերջանա ըդնգծումով(_)" -INSTL_DATABASE_TYPE_DESC="Ենթադրվում է "MySQLi":" +INSTL_DATABASE_PREFIX_MSG="Աղուսայկների նախածանցը պետք է սկսվի գրանշանով, շարունակվի այբբենաթվային նշաններով և վերջանա ըդնգծումով('_')" +INSTL_DATABASE_TYPE_DESC="Ենթադրվում է "MySQLi"։" INSTL_DATABASE_TYPE_LABEL="ՏԲ-ի տեսակ" -INSTL_DATABASE_USER_DESC="Ենթադրվում է "root" կամ խնամորդի կողմից հատկացված օգտանուն:" +INSTL_DATABASE_USER_DESC="Ենթադրվում է "root" կամ խնամորդի կողմից հատկացված օգտանուն։" INSTL_DATABASE_USER_LABEL="Օգտանուն" ;FTP view -INSTL_AUTOFIND_FTP_PATH="Ինքնաբար FTP ուղու որոշում" -INSTL_FTP="FTP կազմաձև" -INSTL_FTP_DESC="

    Որոշ սպասարկիչների վրա հարկավոր է տրամադրել FTP հավատարմագրեր՝ տեղակայումը ավարտելու համար: Եթե դժվարանում եք ավարտել տեղեկայումը առանց այս հավատարմագրերի, ստուգեք ձեր խնամորդը՝ դրանց անհրաժեշտությունը ճշտելու համար:

    Անվտանգության ապահովման նպատակներով, նախընտրելի է ստեղծել առանձին FTP հաշիվ՝ միայն Joomla!ի տեղակայման մատչման համար:

    Տեղեկացում՝ Եթե տեղակայումը կարատվրում է Windows գործավար համակարգի վրա, FTP շերտը չի պահանջվում:

    " -INSTL_FTP_ENABLE_LABEL="Միացնել FTP շերտը" -INSTL_FTP_HOST_LABEL="FTP խնամորդ" -INSTL_FTP_PASSWORD_LABEL="FTP գաղտնաբառ" -INSTL_FTP_PORT_LABEL="FTP պորտ" -INSTL_FTP_ROOT_LABEL="FTP արմատի ուղին" +INSTL_AUTOFIND_FTP_PATH="FTP-ի ուղու ինքնաբացահայտում" +INSTL_FTP="FTP-ի կազմաձևում" +INSTL_FTP_DESC="

    Որոշ սպասարկիչներում առկա սահմանափակումների պատճառով հարկավոր է օգտագործել FTP հաղորդակարգը՝ Joomla-ի տեղակայումը պատշաճ ավարտելու համար։ Եթե տեղակայման ժամանակ հանդիպել եք մատչման անհամապատասխանությունների հետ կապված որևէ խնդիրների, այս քայլում տրամադրեք ձեր FTP մուտքի տվյալները։

    Անվտանգության նպատակով, նախընտրելի է ստեղծել առանձին FTP հաշիվ, որի արմատային պանակը հանդիսանա Joomla-ի տեղակայման պանակր։

    Տեղեկացում՝ Եթե տեղակայումը կատարվրում է Windows գործավար համակարգով սպասարկչի վրա, FTP-ն չի պահանջվում։

    " +INSTL_FTP_ENABLE_LABEL="Միացնել FTP-ն" +INSTL_FTP_HOST_LABEL="FTP խնամորդը" +INSTL_FTP_PASSWORD_LABEL="FTP գաղտնաբառը" +INSTL_FTP_PORT_LABEL="FTP միացքը" +INSTL_FTP_ROOT_LABEL="FTP արմատային ուղին" INSTL_FTP_SAVE_LABEL="Պահպանել FTP գաղտնաբառը" -INSTL_FTP_TITLE="FTP կազմաձևը (Optional - Most Users Can Skip This Step - Press Next to Skip)" -INSTL_FTP_USER_LABEL="FTP օգտանուն" +INSTL_FTP_TITLE="FTP կազմաձևում (Հայեցողական - Սովորաբար այս քայլը չի պահանջվում - Կտտացրեք Հաջորդ՝ առաջ անցնելու համար)" +INSTL_FTP_USER_LABEL="FTP օգտանունը" INSTL_VERIFY_FTP_SETTINGS="Հաստատեք FTP կայանքները" INSTL_FTP_SETTINGS_CORRECT="Կայանքները ճիշտ են" -INSTL_FTP_USER_DESC="Զգուշացում՝ հանձնարարելի թողնել այն դատարկ և մուտքագրել ձեր FTP օգտանունը ամեն անգամ եբր անհրաժեշտ է ֆայլերի փոխանցումը:" -INSTL_FTP_PASSWORD_DESC="Զգուշացում՝ հանձնարարելի թողնել այն դատարկ և մուտքագրել ձեր FTP գաղտնաբառը ամեն անգամ եբր անհրաժեշտ է ֆայլերի փոխանցումը:" +INSTL_FTP_USER_DESC="ԶԳՈՒՇԱՑՈՒՄ՝ անվտանգության նպատակով նախընրտելի է թողնել այն դատարկ և մուտքագրել ձեր FTP օգտանունը ամեն անգամ եբր անհրաժեշտ է ֆայլերի փոխանցումը։" +INSTL_FTP_PASSWORD_DESC="ԶԳՈՒՇԱՑՈՒՄ՝ անվտանգության նպատակով նախընրտելի է թողնել այն դատարկ և մուտքագրել ձեր FTP գաղտնաբառը ամեն անգամ եբր անհրաժեշտ է ֆայլերի փոխանցումը։" ;Site View -INSTL_SITE="Հիմնական կազմաձև" -INSTL_ADMIN_EMAIL_LABEL="Վարչական էլ. հասցեն" -INSTL_ADMIN_EMAIL_DESC="Մուտքագրեք էլ. հասցեն: Այն կհանդիսանա կայքի գերճգտվողի ել. հասցեն:" +INSTL_SITE="Ընդհանրական կազմաձևում" +INSTL_ADMIN_EMAIL_LABEL="Վարչական էլ-հասցեն" +INSTL_ADMIN_EMAIL_DESC="Մուտքագրեք էլ-փոստի հասցեն։ Այն կհանդիսանա կայքի գերօգտվողի էլ-փոստի հասցեն։" INSTL_ADMIN_PASSWORD_LABEL="Վարչական գաղտբաբառը" -INSTL_ADMIN_PASSWORD_DESC="Մուտքագրեք գաղտնաբառը ձեր գերօգտվողի հաշվի համար և հաստատեք այն ստորև գտվող դաշտում:" +INSTL_ADMIN_PASSWORD_DESC="Մուտքագրեք գաղտնաբառը ձեր գերօգտվողի հաշվի համար և հաստատեք այն՝ ստորև գտվող դաշտում։" INSTL_ADMIN_PASSWORD2_LABEL="Հաստատեք վարչական գաղտնաբառը" INSTL_ADMIN_USER_LABEL="Վարչական օգտանունը" -INSTL_ADMIN_USER_DESC="Մուտքագրեք օգտանունը ձեր գերօգտվողի հաշվի համար:" -INSTL_SITE_NAME_LABEL="Կայքի անուն" -INSTL_SITE_NAME_DESC="Մուտքագրեք ձեր Joomla!-ի կայքի անունը:" +INSTL_ADMIN_USER_DESC="Մուտքագրեք օգտանունը ձեր գերօգտվողի հաշվի համար։" +INSTL_SITE_NAME_LABEL="Կայքի անունը" +INSTL_SITE_NAME_DESC="Մուտքագրեք ձեր Joomla-ի կայքի անունը։" INSTL_SITE_METADESC_LABEL="Նկարագրություն" -INSTL_SITE_METADESC_TITLE_LABEL="Մուտքագրեք ձեր կայքի ամբողջական նկարագրումը՝ որոնման համակարգերում օգտագործման համար: Ընդհանուր առմամբ, այն պետք է պարունակի մինչև 20 բառ:" -INSTL_SITE_OFFLINE_LABEL="Տեխ. աշխատանքներ" -INSTL_SITE_OFFLINE_TITLE_LABEL="Տեղակայումը ավարտելուց հետո կայքը դնել անցանց: Կայքը հետագայում առցանց դարձնելը հնարավոր կլինի Համընդհանուր կազմաձևի միջոցով:" +INSTL_SITE_METADESC_TITLE_LABEL="Մուտքագրեք ձեր կայքի ամբողջական նկարագրությունը՝ որոնման համակարգերում օգտագործման համար։ Ընդհանուր առմամբ, այն պետք է պարունակի մինչև 20 բառ։" +INSTL_SITE_OFFLINE_LABEL="Անցանց կարգավիճակ (offline)" +INSTL_SITE_OFFLINE_TITLE_LABEL="Տեղակայումը ավարտելուց հետո կայքը դնել անցանց։ Կայքը հետագայում առցանց դնելու համար ձեզ անհրաժեշտ կլինի միացնել համապատասխան կայանքը՝ ընդհանրական կազմաձևման էջում։" INSTL_SITE_INSTALL_SAMPLE_LABEL="Տեղակայել նմուշային տվյալները" -INSTL_SITE_INSTALL_SAMPLE_DESC="Նմուշային տվյալների տեղակայումը հստակ հանձնարարելի սկսնակների համար:
    Այն տեղակայում է նմուշային բովադնդակությունը, որը ընդգրկված է Joomla!-ի տեղակայման փաթեթի մեջ:" -INSTL_SITE_INSTALL_SAMPLE_NONE="Ոչ մի (Պահանջվում է հիմնական բազմալեղու կայքի ստեղծման համար)" -INSTL_SAMPLE_BLOG_SET="Բլոգի Անգլերեն նմուշային տվյալները" -INSTL_SAMPLE_BROCHURE_SET="Բրոշյուրի Անգլերեն նմուշային տվյալները" -INSTL_SAMPLE_DATA_SET="Լռելյայն Անգլերեն նմուշային տվյալները" -INSTL_SAMPLE_LEARN_SET="Joomla սովորեցնող Անգլերեն նմուշային տվյալները" -INSTL_SAMPLE_TESTING_SET="Փորձակրկման Անգլերեն նմուշային տվյալները" -INSTL_SITE_INSTALL_SAMPLE_NONE_DESC="Տեղակայել Joomla-ն միայն մեկ ընտրացանկով և մուտքի ձևով, առանց որևէ բովանդակության:" -INSTL_SAMPLE_BLOG_SET_DESC="Տեղակայել Joomla-ն մի քանի հոդվածով և բլոգի վերաբերվող հանգույցներով (Ավելի հին հաղորդագրություններ, առավել հաճախ ընթերցվող հաղորդագրություններ և այլն):" -INSTL_SAMPLE_BROCHURE_SET_DESC="Տեղակայել Joomla-ն մի քանի էջերով (ընտրացանկ՝ Գլխավոր, Մեր մասին, Նորություններ, Հետադարձ կապ հուղմներով) և հանգույցներով (Որոնում, Ընտելեկան HTML, Մուտքի ձև):" -INSTL_SAMPLE_DATA_SET_DESC="Տեղակայել Joomla-ն մեկ էջով (ընտրացանկ՝ Գլխավոր հողւմով) և հանգույցներով (Վերջին հոդված, Մուտքի ձև):" -INSTL_SAMPLE_LEARN_SET_DESC="Տեղակայել Joomla-ն՝ Joomla-ի հետ աշխատանքը նկարագրող նմուշային հոդվածներով:" -INSTL_SAMPLE_TESTING_SET_DESC="Տեղակայել Joomla-ն բոլոր առկա ընտրացանկերի միավորներով՝ Joomla-ի փորձարկման համար:" +INSTL_SITE_INSTALL_SAMPLE_DESC="Joomla-ի սկսնակ օգտվողներին խորհուրդ է տրվում տեղակայել նմուշային տվյալները (Անգլերեն լեզվով)։
    Դրանց ծանոթանալով իրենք ավելի հեշտ կկարողանան սկսել Joomla-ի հետ իրենց աշխատանքը։" +INSTL_SITE_INSTALL_SAMPLE_NONE="Առանց նմուշային տվյալների" +INSTL_SAMPLE_BLOG_SET="Բլոգի նմուշային տվյալները (Անգլերեն)" +INSTL_SAMPLE_BROCHURE_SET="Այցեքարտի նմուշային տվյալները (Անգլերեն)" +INSTL_SAMPLE_DATA_SET="Լռելյայն նմուշային տվյալները (Անգլերեն)" +INSTL_SAMPLE_LEARN_SET="Joomla-ի ուսուցման նմուշային տվյալները (Անգլերեն)" +INSTL_SAMPLE_TESTING_SET="Փորձակրկման նմուշային տվյալները (Անգլերեն)" +INSTL_SITE_INSTALL_SAMPLE_NONE_DESC="Տեղակայել Joomla-ն միայն մեկ ընտրացանկով և մուտքի ձևով, առանց որևէհավելյալ բովանդակության։" +INSTL_SAMPLE_BLOG_SET_DESC="Տեղակայել Joomla-ն մի քանի հոդվածով և բլոգերում կիրառվող հանգույցներով (Վերջին հոդվածներ, Առավել ընթերցվող հոդվածներ և այլն)։" +INSTL_SAMPLE_BROCHURE_SET_DESC="Տեղակայել Joomla-ն մի քանի էջերով (Գլխավոր, Մեր մասին, Նորություններ, Հետադարձ կապ) և հանգույցներով (Որոնում, Ընտելեկան HTML, Մուտքի ձև)։" +INSTL_SAMPLE_DATA_SET_DESC="Տեղակայել Joomla-ն մեկ էջով (Գլխավոր) և հանգույցներով (Վերջին հոդվածներ, Մուտքի ձև)։" +INSTL_SAMPLE_LEARN_SET_DESC="Տեղակայել Joomla-ն՝ դրա հետ աշխատանքը նկարագրող մի քանի նմուշային հոդվածով։" +INSTL_SAMPLE_TESTING_SET_DESC="Տեղակայել Joomla-ն բոլոր առկա ընտրացանկերի տարրերով՝ այն փորձարկելու համար։" ;Summary view -INSTL_FINALISATION="Վերջնականացում" +INSTL_FINALISATION="Տեղակայման ավարտ" INSTL_SUMMARY_INSTALL="Տեղակայել" -INSTL_SUMMARY_EMAIL_LABEL="Ստանալ կազմաձևը" -INSTL_SUMMARY_EMAIL_DESC="Կազմաձևի կայանքները կուղարկվեն %s էլ. հասցեին՝ տեղակայումը ավարտելուց հետո:" +INSTL_SUMMARY_EMAIL_LABEL="Ստանալ կազմաձևը էլ-փոստով" +INSTL_SUMMARY_EMAIL_DESC="Կազմաձևի կայանքները կուղարկվեն %s էլ-հասցեին՝ տեղակայումը ավարտելուց հետո։" INSTL_SUMMARY_EMAIL_PASSWORDS_LABEL="Ընդգրկել գաղտնաբառերը ուղերձի մեջ" -INSTL_SUMMARY_EMAIL_PASSWORDS_DESC="Զգուծացում՝ հանձնարարելի է չընդգրկել գաղտնաբառերը ուղերձների մեջ:" +INSTL_SUMMARY_EMAIL_PASSWORDS_DESC="ԶԳՈՒՇԱՑՈՒՄ՝ անվտանգության նպատակով նախընտրելի է չընդգրկել գաղտնաբառերը ուղերձների մեջ։" ;Installing view -INSTL_INSTALLING="Տեղակայում.." +INSTL_INSTALLING="Տեղակայում …" INSTL_INSTALLING_DATABASE_BACKUP="ՏԲ-ի հին աղյուսակների պահուստավորում" -INSTL_INSTALLING_DATABASE_REMOVE="ՏԲ-ի հին աղյուսակների հեռացում" +INSTL_INSTALLING_DATABASE_REMOVE="ՏԲ-ի հին աղյուսակների ջնջում" INSTL_INSTALLING_DATABASE="ՏԲ-ի աղյուսակների ստեղծում" INSTL_INSTALLING_SAMPLE="Նմուշային տվյալների տեղակայում" INSTL_INSTALLING_CONFIG="Կազմաձևի ֆայլի ստեղծում" -INSTL_INSTALLING_EMAIL="Ուղերձի ուղարկում %s" +INSTL_INSTALLING_EMAIL="Ուղերձի ուղարկում %s էլ-հասցեին" ;Email -INSTL_EMAIL_SUBJECT="Կազմաձևի կայանքները՝ %s" -INSTL_EMAIL_HEADING="Ստորև կարող եք տեսնել կազմաձևի կայանքները ձեր նորաստեղծ Joomla! կայքի համար:" -INSTL_EMAIL_NOT_SENT="Ուղերձի ուղարկումը ձախողվեց:" +INSTL_EMAIL_SUBJECT="%s կայքի կազմաձևի կայանքները" +INSTL_EMAIL_HEADING="Ստորև կարող եք տեսնել կազմաձևի կայանքները՝ ձեր նորաստեղծ Joomla կայքի համար։" +INSTL_EMAIL_NOT_SENT="Ուղերձի ուղարկումը ձախողվեց։" ;Complete view INSTL_COMPLETE_ADMINISTRATION_LOGIN_DETAILS="Վարչական մուտքի տվյալները" -INSTL_COMPLETE_ERROR_FOLDER_ALREADY_REMOVED="Տեղակայման պանակը արդեն իսկ ջնջվել է:" -INSTL_COMPLETE_ERROR_FOLDER_DELETE="Տեղակայման պանակի ջնջումը ձախողվեց: Խնդրում ենք ջնջել այն ձեռքով:" -INSTL_COMPLETE_FOLDER_REMOVED="Տեղակայման պանակը հաջողությամբ ջնջվեց:" -INSTL_COMPLETE_LANGUAGE_1="Joomla!-ն ձեր մայրենի լեզվով և/կամ բազմալեզու կայքի ինքնաբար ստեղծումը" -INSTL_COMPLETE_LANGUAGE_DESC="Տեղակայման պանակը ջնջելուց առաջ դուք կարող եք տեղակայել հավելյալ լեզվային փաթեթներ: Եթե ցանկանում եք ավելացնել լեզուներ ձեր Joomla! գործադրին, կտտացրեք այս կոճակը:" -INSTL_COMPLETE_LANGUAGE_DESC2="Տեղեկացում՝ անհրաժեշտ է համացանցային մատչում՝ Joomla!-ի նոր լեզուներ ներբեռնելու և տեղակայելու համար:
    Որոշ սպասարկիչների կազմաձևը չի թույլատրում նոր լեզուների տեղակայումը: Եթե հանդիպեք նման խնդրին, մի անհանգստացեք: Դուք հետագայում հնարավորություն կունենաք տեղակայել դրանք Joomla!-ի վարչական մասից:" -INSTL_COMPLETE_REMOVE_FOLDER="Ջնջեք տեղակայման պանակը" -INSTL_COMPLETE_REMOVE_INSTALLATION="ՀԻՇԵՔ ՏԵՂԱԿԱՅՄԱՆ ՊԱՆԱԿԸ ՋՆՋԵԼՈՒ ԱՆՀՐԱԺԵՇՏՈՒԹՅԱՆ ՄԱՍԻՆ:
    Դուք չեք կարողանա շարունակել այստեղից մինչև տեղակայման պանակը չջնջվի: Սա՝ Joomla!-ի անվտանգության հատկությունն է:" -INSTL_COMPLETE_TITLE="Շնոհրավորանքներ: Joomla!-ն տեղակայվեց:" -INSTL_COMPLETE_INSTALL_LANGUAGES="Հավելյալ քայլեր. Լեզուների տեղակայում" +INSTL_COMPLETE_ERROR_FOLDER_ALREADY_REMOVED="'installation' պանակը արդեն իսկ ջնջված է։" +INSTL_COMPLETE_ERROR_FOLDER_DELETE="Չհաջողվեց ջնջել 'installation' պանակը։ Խնդրում ենք ջնջել այն ձեռքով։" +INSTL_COMPLETE_FOLDER_REMOVED="'installation' պանակը հաջողությամբ ջնջվեց։" +INSTL_COMPLETE_LANGUAGE_1="Ցանկանու՞մ եք փոխարկել Joomla-ի միջերեսը՝ ձեր մայրենի լեզվով" +INSTL_COMPLETE_LANGUAGE_DESC="'installation' պանակը ջնջելուց առաջ դուք կարող եք տեղակայել հավելյալ լեզվային փաթեթները։ Եթե ցանկանում եք ավելացնել լեզուներ, կտտացրեք Լեզվային փաթեթների տեղակայում կոճակը։" +INSTL_COMPLETE_LANGUAGE_DESC2="Տեղեկացում՝ նոր լեզուներ ներբեռնելու և տեղակայելու համար ձեզ անհրաժեշտ է միանալ համացանցին։
    Որոշ դեպքերում սպասարկչի կազմաձևը չի թույլատրում նոր լեզուների տեղակայումը։ Եթե հանդիպեք նման խնդրին, մի անհանգստացեք։ Դուք հետագայում հնարավորություն կունենաք տեղակայել դրանք՝ Joomla-ի վարչական մասում։" +INSTL_COMPLETE_REMOVE_FOLDER="Ջնջել 'installation' պանակը" +INSTL_COMPLETE_REMOVE_INSTALLATION="ՀԻՇԵՔ 'INSTALLATION' ՊԱՆԱԿԸ ՋՆՋԵԼՈՒ ԱՆՀՐԱԺԵՇՏՈՒԹՅԱՆ ՄԱՍԻՆ։
    Դուք չեք կարողանա շարունակել այստեղից մինչև տեղակայման պանակը չջնջվի։ Սա՝ Joomla-ի անվտանգության հատկությունն է։" +INSTL_COMPLETE_TITLE="Շնոհրավորանքնե՜ր։ Joomla-ն հաջողությամբ տեղակայվեց։" +INSTL_COMPLETE_INSTALL_LANGUAGES="Լեզվային փաթեթների տեղակայում" ;Languages view INSTL_LANGUAGES="Լեզվային փաթեթների տեղակայում" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE="Լեզու" INSTL_LANGUAGES_COLUMN_HEADER_VERSION="Տարբերակ" -INSTL_LANGUAGES_DESC="Joomla-ի միջերեսը առկա է բազմաթիվ լեզուներով: Նշեք ձեր նախընտրելոի լեզուները նշատուփերի օգնությամբ և տեղակայեք դրանք՝ կտտացնելով 'Հաջորդ' կոճակը:
    Տեղեկացում՝ այս գործողությունը կտևի մոտ 10 վարկյան՝ ամեն լեզվի ներբեռման և տեղակայման մասով: Ժամասպառումից խուսափելու համար խնդրում ենք ևնտրել մինչև 3 լեզու՝ տեղակայման համար:" -INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="Այս գործողությունը կտևի մոտ 10 վարկյան՝ ամեն լեզվի մասով:
    Խնդրում ենք սպասել մինչև լեզուները ներբեռնվեն և տեղակայվեն ..." -INSTL_LANGUAGES_MORE_LANGUAGES="Կտտացրեք 'Նախորդ' կոճակը, եթե ցանկանում եք տեղակայել ավել լեզուներ:" -INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="Տեղակայման համար որևէ լեզու չի ընտրվել: Եթե ցանկանում եք տեղակայել ավել լեզուներ, կտտացրեք 'Նախորդ' կոճակը և նշեք նախընտրելի լեզուները ցանկից:" -INSTL_LANGUAGES_WARNING_NO_INTERNET="Չհաջողվեց միանալ լեզվային սպասարկչին: Խնդրում ենք ավարտել տեղակայման գործընթացը:" -INSTL_LANGUAGES_WARNING_NO_INTERNET2="Տեղեկացում՝ դուք հետագայում հնարավորություն կունենաք տեղակայել լեզուները Joomla!-ի վարչական մասից:" +INSTL_LANGUAGES_DESC="Joomla-ի միջերեսը առկա է բազմաթիվ լեզուներով։ Նշեք ձեր նախընտրելոի լեզուները նշատուփերի օգնությամբ և տեղակայեք դրանք՝ կտտացնելով 'Հաջորդ' կոճակը։
    Տեղեկացում՝ այս գործողությունը կտևի մոտ 10 վարկյան՝ ամեն լեզվի ներբեռման և տեղակայման մասով։ Ժամասպառումից խուսափելու համար խնդրում ենք տեղակայման համար ընտրել առավելագույնը 3 լեզու։" +INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="Այս գործողությունը կտևի մոտ 10 վարկյան՝ ամեն լեզվի մասով։
    Խնդրում ենք սպասել մինչև լեզուները ներբեռնվեն և տեղակայվեն …" +INSTL_LANGUAGES_MORE_LANGUAGES="Կտտացրեք 'Նախորդ' կոճակը, եթե ցանկանում եք տեղակայել ավել լեզուներ։" +INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="Տեղակայման համար որևէ լեզու չի ընտրվել։ Եթե ցանկանում եք տեղակայել ավել լեզուներ, կտտացրեք 'Նախորդ' կոճակը և նշեք նախընտրելի լեզուները՝ ցանկից։" +INSTL_LANGUAGES_WARNING_NO_INTERNET="Չհաջողվեց միանալ լեզվային սպասարկչին։ Խնդրում ենք ավարտել տեղակայման գործընթացը։" +INSTL_LANGUAGES_WARNING_NO_INTERNET2="Տեղեկացում՝ դուք հետագայում հնարավորություն կունենաք տեղակայել լեզուները՝ Joomla-ի վարչական մասում։" INSTL_LANGUAGES_WARNING_BACK_BUTTON="Վերադառնալ տեղակայման վերջին քայլին" ;Default language view INSTL_DEFAULTLANGUAGE_ACTIVATE_MULTILANGUAGE="Ակտիվացնել բազմալեզու հատկությունը" -INSTL_DEFAULTLANGUAGE_ACTIVATE_MULTILANGUAGE_DESC="Ակտիվացնելու դեպքում, ձեր Joomla կայքը կլինի բազմալեզու՝ թարգմանված ընտրացանկերով անեմ տեղակայված լեզվի համար:" +INSTL_DEFAULTLANGUAGE_ACTIVATE_MULTILANGUAGE_DESC="Ակտիվացնելու դեպքում, ձեր Joomla կայքը կլինի բազմալեզու՝ թարգմանված ընտրացանկերով ամեն տեղակայված լեզվի համար։" INSTL_DEFAULTLANGUAGE_ACTIVATE_LANGUAGE_CODE_PLUGIN="Միացնել լեզվային կոդի խրվակը" -INSTL_DEFAULTLANGUAGE_ACTIVATE_LANGUAGE_CODE_PLUGIN_DESC="Միացնելու դեպքում, լեզվային կոդի խրվակը կապահովի ձեր էջերի լեզվային կոդը փոխելու հնարավորություն՝ SEO-ն լավացնելու նպատակով:" +INSTL_DEFAULTLANGUAGE_ACTIVATE_LANGUAGE_CODE_PLUGIN_DESC="Միացնելու դեպքում, լեզվային կոդի խրվակը կապահովի ձեր էջերի լեզվային կոդը փոխելու հնարավորությունը՝ SEO-ն լավացնելու նպատակով։" INSTL_DEFAULTLANGUAGE_ADMINISTRATOR="Լռելյայն վարչական լեզուն" -INSTL_DEFAULTLANGUAGE_ADMIN_COULDNT_SET_DEFAULT="Չհաջողվեց կայել այս լեզուն որպես լռելյայն: Կայքի վարչական մասում որպես լռելյայն լեզու դրա փոխարեն կկիրառվի Անգլերենը:" -INSTL_DEFAULTLANGUAGE_ADMIN_SET_DEFAULT="Joomla-ում %s-ը կայված է որպես ձեր լռելյայն ՎԱՐՉԱԿԱՆ լեզուն:" +INSTL_DEFAULTLANGUAGE_ADMIN_COULDNT_SET_DEFAULT="Չհաջողվեց կայել այս լեզուն որպես լռելյայն։ Կայքի վարչական մասում որպես լռելյայն լեզու դրա փոխարեն կկիրառվի Անգլերենը։" +INSTL_DEFAULTLANGUAGE_ADMIN_SET_DEFAULT="Joomla-ում %s-ը կայված է որպես ձեր լռելյայն ՎԱՐՉԱԿԱՆ լեզուն։" INSTL_DEFAULTLANGUAGE_COLUMN_HEADER_SELECT="Ընտրել" INSTL_DEFAULTLANGUAGE_COLUMN_HEADER_LANGUAGE="Լեզու" INSTL_DEFAULTLANGUAGE_COLUMN_HEADER_TAG="Պիտակ" @@ -156,119 +156,119 @@ INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_MENU_ITEM="%s ընտրացանկի 'Գլ INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_MENU_MODULE="%s ընտրացանկի հանգույցի ինքնաբար ստեղծումը ձախողվեց" INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_CATEGORY="%s բովանդակության կարգի ինքնաբար ստեղծումը ձախողվեց" INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_ARTICLE="%s հոդվածի ինքնաբար ստեղծումը ձախողվեց" -INSTL_DEFAULTLANGUAGE_COULD_NOT_ENABLE_MODULESWHITCHER_LANGUAGECODE="Չհաջողվեց ապահրատարակել լեզու փոխարկիչ հանգույցը:" -INSTL_DEFAULTLANGUAGE_COULD_NOT_ENABLE_PLG_LANGUAGECODE="Չհաջողվեց միացնել լեզվային կոդի խրվակը:" -INSTL_DEFAULTLANGUAGE_COULD_NOT_ENABLE_PLG_LANGUAGEFILTER="Չհաջողվեց միացնել լեզվային զտիչի խրվակը:" -INSTL_DEFAULTLANGUAGE_COULD_NOT_INSTALL_LANGUAGE="Չհաջողվեց տեղակայել %s լեզուն:" +INSTL_DEFAULTLANGUAGE_COULD_NOT_ENABLE_MODULESWHITCHER_LANGUAGECODE="Չհաջողվեց ապահրատարակել լեզու փոխարկիչ հանգույցը։" +INSTL_DEFAULTLANGUAGE_COULD_NOT_ENABLE_PLG_LANGUAGECODE="Չհաջողվեց միացնել լեզվային կոդի խրվակը։" +INSTL_DEFAULTLANGUAGE_COULD_NOT_ENABLE_PLG_LANGUAGEFILTER="Չհաջողվեց միացնել լեզվային զտիչի խրվակը։" +INSTL_DEFAULTLANGUAGE_COULD_NOT_INSTALL_LANGUAGE="Չհաջողվեց տեղակայել %s լեզուն։" INSTL_DEFAULTLANGUAGE_COULD_NOT_PUBLISH_MOD_MULTILANGSTATUS="Չհաջողվեց ապահրատարակել լեզվային կարգավիճակի հանգույցը" INSTL_DEFAULTLANGUAGE_COULD_NOT_UNPUBLISH_MOD_DEFAULTMENU="Չհաջողվեց ապահրատարակել լռելյայն ընտրացանկի հանգույցը" -INSTL_DEFAULTLANGUAGE_DESC="Հետևյալ լեզուները հաջողությամբ տեղակայվեցին: Խնդրում ենք նշել ձեր նախընտրելի լեզուն Joomla-ի վարչական մասի համար:" -INSTL_DEFAULTLANGUAGE_DESC_FRONTEND="Հետևյալ լեզուները հաջողությամբ տեղակայվեցին: Խնդրում ենք նշել ձեր նախընտրելի լեզուն Joomla-ի ճակատային մասի համար:" +INSTL_DEFAULTLANGUAGE_DESC="Հետևյալ լեզուները հաջողությամբ տեղակայվեցին։ Խնդրում ենք նշել ձեր նախընտրելի լեզուն Joomla-ի վարչական մասի համար։" +INSTL_DEFAULTLANGUAGE_DESC_FRONTEND="Հետևյալ լեզուները հաջողությամբ տեղակայվեցին։ Խնդրում ենք նշել ձեր նախընտրելի լեզուն Joomla-ի ճակատային մասի համար։" INSTL_DEFAULTLANGUAGE_FRONTEND="Կայքի լռելյայն լեզուն" -INSTL_DEFAULTLANGUAGE_FRONTEND_COULDNT_SET_DEFAULT="Չհաջողվեց կայել այս լեզուն որպես լռելյայն: Կայքի ճակատային մասում որպես լռելյայն լեզու դրա փոխարեն կկիրառվի Անգլերենը:" -INSTL_DEFAULTLANGUAGE_FRONTEND_SET_DEFAULT="%s լեզուն նշված է որպես ձեր լռելյայն լեզու:" +INSTL_DEFAULTLANGUAGE_FRONTEND_COULDNT_SET_DEFAULT="Չհաջողվեց կայել այս լեզուն որպես լռելյայն։ Կայքի ճակատային մասում որպես լռելյայն լեզու դրա փոխարեն կկիրառվի Անգլերենը։" +INSTL_DEFAULTLANGUAGE_FRONTEND_SET_DEFAULT="%s լեզուն նշված է որպես ձեր լռելյայն լեզու։" INSTL_DEFAULTLANGUAGE_INSTALL_LOCALISED_CONTENT="Տեղակայել բազմալեզու բովանդակությունը" -INSTL_DEFAULTLANGUAGE_INSTALL_LOCALISED_CONTENT_DESC="Ակտիվացնելու դեպքում, Joomla-ն ինքնաբար կստեղծի ամեն տեղակայված լեզվի համար մեկ բովանդակության կարգ: Բացի այդ, ամեն կարգում կստեղծվի նմուշային պարունակությամբ մեկ ընտրյալ հոդված:" +INSTL_DEFAULTLANGUAGE_INSTALL_LOCALISED_CONTENT_DESC="Ակտիվացնելու դեպքում, Joomla-ն ինքնաբար կստեղծի ամեն տեղակայված լեզվի համար մեկ բովանդակության կարգ։ Բացի այդ, ամեն կարգում կստեղծվի նմուշային պարունակությամբ մեկ ընտրյալ հոդված։" INSTL_DEFAULTLANGUAGE_MULTILANGUAGE_TITLE="Բազմալեզու" -INSTL_DEFAULTLANGUAGE_MULTILANGUAGE_DESC="Այս բաժինը թույլ է տալիս ինքնաբար ակտիվացնել Joomla!-ի բազմալեզու հատկությունը:" -INSTL_DEFAULTLANGUAGE_TRY_LATER="Դուք հետագայում հնարավորություն կունենաք տեղակայել այն Joomla!-ի վարչական մասից:" +INSTL_DEFAULTLANGUAGE_MULTILANGUAGE_DESC="Այս բաժինը թույլ է տալիս ինքնաբար գործունացնել Joomla-ի բազմալեզու հատկությունը։" +INSTL_DEFAULTLANGUAGE_TRY_LATER="Դուք հետագայում հնարավորություն կունենաք տեղակայել այն՝ Joomla-ի վարչական մասում։" -; IMPORTANT NOTE FOR TRANSLATORS: Do not literally translate this line, instead add the localised name of the language. For example Spanish will be Español +; IMPORTANT NOTE FOR TRANSLATORS։ Do not literally translate this line, instead add the localised name of the language. For example Spanish will be Español INSTL_DEFAULTLANGUAGE_NATIVE_LANGUAGE_NAME="Հայերեն" ;Database Model -INSTL_DATABASE_COULD_NOT_CONNECT="Տվյալների բազային միանալը ձախողվեց: Սխալի համարը՝ %s" -INSTL_DATABASE_COULD_NOT_CREATE_DATABASE="Տեղակայիչին չհաջողվեց միանալ նշված ՏԲ-ին և ստեղձել նոր ՏԲ: Խնդրում ենք ստուգել ձեր կայանքները և անհրաժեշտության դեպքում ստեղծել ՏԲ-ն ձեռքով:" -INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE="Չհաջողվեց թարմացնել ընդլայնման հայտի շտեմը. %s" +INSTL_DATABASE_COULD_NOT_CONNECT="Չհաջողվեց միանալ ՏԲ-ին՝ %s" +INSTL_DATABASE_COULD_NOT_CREATE_DATABASE="Չհաջողվեց միանալ նշված ՏԲ-ին և ստեղծել նոր ՏԲ։ Խնդրում ենք ստուգել ձեր կայանքները և անհրաժեշտության դեպքում ստեղծել ՏԲ-ն ձեռքով։" +INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE="Չհաջողվեց թարմացնել %s ընդլայնման հայտի շտեմը։" INSTL_DATABASE_EMPTY_NAME="" -INSTL_DATABASE_ERROR_BACKINGUP="ՏԲ-ի պահոստավորման ժամանակ առաջացել են որոշ սխալներ:" -INSTL_DATABASE_ERROR_CREATE="%s ԲՏ-ի ստեղծման ժամանակ առաջացել է սխալ:
    Հնարավոր է՝ օտգվողի չունի բավարար արտոնություններ՝ ՏԲ-ն ստեղծելու համար: Նման դեպքերում անհրաժեշտ է ստեղձել ՏԲ-ն առանձին մինչև Joomla!-ի տեղակայումը սկսելը:" -INSTL_DATABASE_ERROR_DELETE="ՏԲ-ի ջնջման ժամանակ առաջացել են որոշ սխալներ:" +INSTL_DATABASE_ERROR_BACKINGUP="ՏԲ-ի պահուստավորումը ձախողվեց։" +INSTL_DATABASE_ERROR_CREATE="%s ՏԲ-ի ստեղծումը ձախողվեց։
    Ամենայն հավանականությամբ, օտգվողը չունի բավարար արտոնություններ՝ ՏԲ ստեղծելու համար։ Նման դեպքերում անհրաժեշտ է ստեղծել ՏԲ-ն ձեռքով՝ Joomla-ն տեղակայելուց առաջ։" +INSTL_DATABASE_ERROR_DELETE="ՏԲ-ի ջնջման ժամանակ առաջացել են որոշ սխալներ։" INSTL_DATABASE_FIELD_VALUE_REMOVE="Վերացնել" INSTL_DATABASE_FIELD_VALUE_BACKUP="Պահուստավորել" -INSTL_DATABASE_FIX_TOO_LONG="MySQL աղյուսակի նախածանցը պետք է պարունակի առավելոգույնը 15 նշան:" -INSTL_DATABASE_INVALID_DB_DETAILS="Տրամադրված ՏԲ-ի տվյալները սխալ են կամ դատարկ:" -INSTL_DATABASE_INVALID_MYSQL_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է MySQL 5.0.4 կամ բարձր: Ձեր տարբերակը՝ %s" -INSTL_DATABASE_INVALID_MYSQLI_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է MySQL 5.0.4 կամ բարձր: Ձեր տարբերակը՝ %s" -INSTL_DATABASE_INVALID_PDOMYSQL_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է MySQL 5.0.4 կամ բարձր: Ձեր տարբերակը՝ %s" -INSTL_DATABASE_INVALID_POSTGRESQL_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է ostgreSQL 8.3.18 կամ բարձր: Ձեր տարբերակը՝ %s" -INSTL_DATABASE_INVALID_SQLSRV_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է SQL Server 2008 R2 (10.50.1600.1) կամ բարձր: Ձեր տարբերակը՝ %s" -INSTL_DATABASE_INVALID_SQLZURE_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է SQL Server 2008 R2 (10.50.1600.1) կամ բարձր: Ձեր տարբերակը՝ %s" +INSTL_DATABASE_FIX_TOO_LONG="MySQL աղյուսակի նախածանցը պետք է պարունակի առավելոգույնը 15 նշան։" +INSTL_DATABASE_INVALID_DB_DETAILS="Տրամադրված ՏԲ-ի տվյալները սխալ են կամ դատարկ։" +INSTL_DATABASE_INVALID_MYSQL_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է MySQL 5.0.4 կամ բարձր։ Ձեր ընթացիկ տարբերակը՝ %s" +INSTL_DATABASE_INVALID_MYSQLI_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է MySQL 5.0.4 կամ բարձր։ Ձեր ընթացիկ տարբերակը՝ %s" +INSTL_DATABASE_INVALID_PDOMYSQL_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է MySQL 5.0.4 կամ բարձր։ Ձեր ընթացիկ տարբերակը՝ %s" +INSTL_DATABASE_INVALID_POSTGRESQL_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է PostgreSQL 8.3.18 կամ բարձր։ Ձեր ընթացիկ տարբերակը՝ %s" +INSTL_DATABASE_INVALID_SQLSRV_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է SQL Server 2008 R2 (10.50.1600.1) կամ բարձր։ Ձեր ընթացիկ տարբերակը՝ %s" +INSTL_DATABASE_INVALID_SQLZURE_VERSION="Տեղակայումը շարունակելու համար ահնրաժեշտ է SQL Server 2008 R2 (10.50.1600.1) կամ բարձր։ Ձեր ընթացիկ տարբերակը՝ %s" INSTL_DATABASE_INVALID_TYPE="Խնդրում ենք ընտրել ՏԲ-ի տեսակը" -INSTL_DATABASE_NAME_TOO_LONG="MySQL ՏԲ-ի անունը պետք է պարունակի առավելոգույնը 64 նշան:" -INSTL_DATABASE_INVALID_NAME="MySQL տարբերակները 5.1.6-ից ցածր չեն թույլատրվում բացատներ կամ այլ "հատուկ" նշաններ անունների մեջ Ձեր տարբերակը՝ %s" +INSTL_DATABASE_NAME_TOO_LONG="MySQL ՏԲ-ի անունը պետք է պարունակի առավելոգույնը 64 նշան։" +INSTL_DATABASE_INVALID_NAME="MySQL տարբերակները 5.1.6-ից ցածր չեն աջակցում բացատներ կամ այլ "հատուկ" նշաններ անունների մեջ։ Ձեր ընթացիկ տարբերակը՝ %s" INSTL_DATABASE_NAME_INVALID_SPACES="MySQL ՏԲ-ի անունը և աղյուսակների անունները չեն կարող պարունակել բացատներ" -INSTL_DATABASE_NAME_INVALID_CHAR="MySQL նույնացուցիչը չի կարող պարունակել NULL ASCII(0x00):" +INSTL_DATABASE_NAME_INVALID_CHAR="MySQL նույնացուցիչը չի կարող պարունակել NULL ASCII(0x00)։" INSTL_DATABASE_FILE_DOES_NOT_EXIST="%s ֆայլը գոյություն չունի" ;controllers -INSTL_COOKIES_NOT_ENABLED="Ըստ երևույթի, թխուկները միացրած չեն ձեր դիտարկչում: Դուք չեք կարողանա տեղակայել գործադիրը՝ այս հատկությունը կասեցված կարգավիճակով: Այլ դեպքում, սա կարող է հանդիսանալ սպասարկչի session.save_path սխալ կայանքի հետևանք: Տվյալ դեպքում առաջարկում ենք կապ հաստատել ձեր հոստ ծառայության տրամադրողի հետ՝ այն շտկելու նպատակով:" +INSTL_COOKIES_NOT_ENABLED="Ամենայն հավանականությամբ, թխուկները միացրած չեն ձեր դիտարկչում։ Դուք չեք կարողանա տեղակայել ծրագրակազմը՝ այս հատկությունը կասեցված կարգավիճակում։ Բացի այդ, տվյալ սխալը կարող է հանդիսանալ սպասարկչի session.save_path սխալ կայանքի հետևանք։ Տվյալ դեպքում խորհուրդ ենք տալիս կապնվել ձեր հոսթինգի մատակարարի հետ՝ այն շտկելու նպատակով։" INSTL_HEADER_ERROR="Սխալ" ;Helpers -INSTL_PAGE_TITLE="Joomla!-ի առցանց տեղակայիչը" +INSTL_PAGE_TITLE="Joomla-ի տեղակայում" ;Configuration model -INSTL_ERROR_CONNECT_DB="Տվյալների բազային միանալը ձախողվեց: Սխալի համարը՝ %s" -INSTL_STD_OFFLINE_MSG="Կայքը ժամանակավորապես անհասանելի է տեխ. աշխատանքներ կատարելու պատճառով:
    Խնդրում ենք կրկին այցելել մի փոքր ուշ:" +INSTL_ERROR_CONNECT_DB="Չհաջողվեց միանալ ՏԲ-ին՝ %s" +INSTL_STD_OFFLINE_MSG="Կայքը ժամանակավորապես անհասանելի է՝ տեխնիկական աշխատանքներ իրականացնելու պատճառով։
    Խնդրում ենք կրկին այցելել մի փոքր ուշ։" ;FTP model -INSTL_FTP_INVALIDROOT="Նշված FTP պանակը չի հանդիասնում այս Joomla-ի տեղակայման պանակ:" -INSTL_FTP_NOCONNECT="FTP սպասարկչին միանալը ձախողվեց:" -INSTL_FTP_NODELE=""DELE" գործառույթը ձախողվեց:" -INSTL_FTP_NODIRECTORYLISTING="Չհաջողվեց ստանալ պանակների ցանկը FTP սպասարկչից:" -INSTL_FTP_NOLIST=""LIST" գործառույթը ձախողվեց:" -INSTL_FTP_NOLOGIN="Չհաջողվեց մուտք գործել FTP սպասարկիչ:" -INSTL_FTP_NOMKD=""MKD" գործառույթը ձախողվեց:" -INSTL_FTP_NONLST=""NLST" գործառույթը ձախողվեց:" -INSTL_FTP_NOPWD=""PWD" գործառույթը ձախողվեց:" -INSTL_FTP_NORETR=""RETR" գործառույթը ձախողվեց:" -INSTL_FTP_NORMD=""RMD" գործառույթը ձախողվեց:" -INSTL_FTP_NOROOT="Չհաջողվեց մատչել նշված FTP պանակը:" -INSTL_FTP_NOSTOR=""STOR" գործառույթը ձախողվեց:" -INSTL_FTP_NOSYST=""SYST" գործառույթը ձախողվեց:" -INSTL_FTP_UNABLE_DETECT_ROOT_FOLDER="FTP արմատային պանակի ինքնորոշումը ձախողվեց:" +INSTL_FTP_INVALIDROOT="Նշված FTP պանակը չի հանդիասնում այս Joomla-ի տեղակայման պանակ։" +INSTL_FTP_NOCONNECT="Չհաջողվեց միանալ FTP սպասարկչին։" +INSTL_FTP_NODELE=""DELE" գործառույթը ձախողվեց։" +INSTL_FTP_NODIRECTORYLISTING="Չհաջողվեց ստանալ պանակների ցանկը FTP սպասարկչից։" +INSTL_FTP_NOLIST=""LIST" գործառույթը ձախողվեց։" +INSTL_FTP_NOLOGIN="Չհաջողվեց մուտք գործել FTP սպասարկիչ։" +INSTL_FTP_NOMKD=""MKD" գործառույթը ձախողվեց։" +INSTL_FTP_NONLST=""NLST" գործառույթը ձախողվեց։" +INSTL_FTP_NOPWD=""PWD" գործառույթը ձախողվեց։" +INSTL_FTP_NORETR=""RETR" գործառույթը ձախողվեց։" +INSTL_FTP_NORMD=""RMD" գործառույթը ձախողվեց։" +INSTL_FTP_NOROOT="Չհաջողվեց մատչել նշված FTP պանակը։" +INSTL_FTP_NOSTOR=""STOR" գործառույթը ձախողվեց։" +INSTL_FTP_NOSYST=""SYST" գործառույթը ձախողվեց։" +INSTL_FTP_UNABLE_DETECT_ROOT_FOLDER="Չհաջողվեց ինքնաբացահայտել FTP արմատային պանակը։" ;others -INSTL_CONFPROBLEM="Ձեր կազմաձևի ֆայլը կամ պանակը գրվող չեն, կամ կազմաձևի ֆայլի ստեղծման ժամանակ առաջացել է մեկ այլ սխալ: Ձեզ անհրաժեշտ կլինի վերբեռնել հետևյալ կոդը ձեռքով: Կտտացրեք գրվածքի տարածքում՝ ամբողջական կոդը գունանշելու համար, և հետո մեջբերեք այն նոր ֆայլի մեջ: Անվանեք այս ֆայլը 'configuration.php' և վերբեռեք ձեր կայքի արմատային պանակի մեջ:" -INSTL_DATABASE_SUPPORT="ՏԲ-ի աջակցում." +INSTL_CONFPROBLEM="Ձեր կազմաձևի ֆայլը կամ պանակը գրվող չեն, կամ կազմաձևի ֆայլի ստեղծման ժամանակ առաջացել է մեկ այլ սխալ։ Ձեզ անհրաժեշտ կլինի վերբեռնել հետևյալ կոդը ձեռքով։ Կտտացրեք գրվածքի տարածքում՝ ամբողջական կոդը գունանշելու համար, և հետո մեջբերեք այն նոր ֆայլի մեջ։ Անվանեք այս ֆայլը 'configuration.php' և վերբեռնեք ձեր կայքի արմատային պանակի մեջ։" +INSTL_DATABASE_SUPPORT="ՏԲ-ի աջակցում՝" INSTL_DISPLAY_ERRORS="Ցուցադրել սխալները" -INSTL_ERROR_DB="ՏԲ-ի լրացման ժամանակ առաջացել են սխալներ՝ %s" +INSTL_ERROR_DB="ՏԲ-ն լրացնելու ժամանակ առաջացել են սխալներ՝ %s" INSTL_ERROR_INITIALISE_SCHEMA="Չհաջողվեց սկզբնավորել ՏԲ-ի ուրվակազմը" INSTL_FILE_UPLOADS="Ֆայլերի վերբեռնում" -INSTL_GNU_GPL_LICENSE="GNU GPL լիցենզիա" +INSTL_GNU_GPL_LICENSE="GNU GPL արտոնագիր" INSTL_JSON_SUPPORT_AVAILABLE="JSON աջակցում" INSTL_MAGIC_QUOTES_GPC="Magic Quotes GPC Off" INSTL_MAGIC_QUOTES_RUNTIME="Magic Quotes Runtime" INSTL_MB_LANGUAGE_IS_DEFAULT="MB Language is Default" INSTL_MB_STRING_OVERLOAD_OFF="MB String Overload Off" -INSTL_NOTICEMBLANGNOTDEFAULT="Ձեր PHP-ի կարգավորումներում mbstring language դրույթի արժեքը սահմանված չէ որպես 'neutral': Այն հնարավոր է սահմանել ձեր կայքի մասով՝ .htaccess ֆայլում php_value mbstring.language neutral տողը ավելացնելով:" -INSTL_NOTICEMBSTRINGOVERLOAD="Ձեր PHP-ի կարգավորումներում mbstring function overload դրույթը միացրած է: Այն հնարավոր է կասեցնել ձեր կայքի մասով՝ .htaccess ֆայլում php_value mbstring.func_overload 0 տողը ավելացնելով:" -INSTL_NOTICEYOUCANSTILLINSTALL="
    Դուք կարող եք ժարունակել տեղակայումը, քանի որ կազմաձևի կայանքները ցուցադրվելու են վերջում: Այդ ժամանակ ձեզ անհրաժեշտ կլինի ներբեռնել կոդը ձեռքով: Կտտացրեք քրվածքի դաշտի ներսում՝ ամբողջական կոդը գունանշելու համար, պատճենեք այն և զետեղեք նորաստեղծ ֆայլի մեջ, անվանեք այն configuration.php և ներնեռնեք ձեր կայքի արմատային պանակը:" +INSTL_NOTICEMBLANGNOTDEFAULT="Ձեր PHP-ի կարգավորումներում mbstring language դրույթի արժեքը սահմանված չէ որպես 'neutral'։ Այն հնարավոր է սահմանել ձեր կայքի մասով՝ .htaccess ֆայլում php_value mbstring.language neutral տողը ավելացնելով։" +INSTL_NOTICEMBSTRINGOVERLOAD="Ձեր PHP-ի կարգավորումներում mbstring function overload դրույթը միացրած է։ Այն հնարավոր է կասեցնել ձեր կայքի մասով՝ .htaccess ֆայլում php_value mbstring.func_overload 0 տողը ավելացնելով։" +INSTL_NOTICEYOUCANSTILLINSTALL="
    Դուք կարող եք շարունակել տեղակայումը։ Տեղակայման վերջում ձեզ կցուցադրվեն կազմաձևի կայանքները։ Այդ ժամանակ ձեզ անհրաժեշտ կլինի պատճենել կոդը ձեռքով։ Կտտացրեք գրվածքի դաշտի ներսում՝ ամբողջական կոդը գունանշելու համար, պատճենեք այն և մեջբերեք նորաստեղծ ֆայլի մեջ, անվանեք ֆայլը configuration.php և տեղադրեք ձեր կայքի արմատային պանակում։" INSTL_OUTPUT_BUFFERING="Արտահանման պահնակում" -INSTL_PARSE_INI_FILE_AVAILABLE="INI վերլուծիչի աջակցում" +INSTL_PARSE_INI_FILE_AVAILABLE="INI ֆայլերի վերլուծչի աջակցում" INSTL_PHP_VERSION="PHP-ի տարբերակը" INSTL_PHP_VERSION_NEWER="PHP-ի տարբերակը >= %s" INSTL_REGISTER_GLOBALS="Register Globals Off" -INSTL_SAFE_MODE="Ապահով եղանակ" +INSTL_SAFE_MODE="Safe Mode" INSTL_SESSION_AUTO_START="Աշխատաշրջանի ինքնաբար մեկնարկ" INSTL_WRITABLE="%s-ը գրվող է" INSTL_XML_SUPPORT="XML աջակցում" INSTL_ZIP_SUPPORT_AVAILABLE="ZIP մայրենի աջակցում" INSTL_ZLIB_COMPRESSION_SUPPORT="Zlib սեղման աջակցում" -INSTL_PROCESS_BUSY="Տեղակայման գործողությունը ընթացքի մեջ է: Խնդրում ենք սպասել ..." +INSTL_PROCESS_BUSY="Տեղակայման գործողությունը ընթացքի մեջ է։ Խնդրում ենք սպասել …" ;Global strings JADMINISTRATOR="Վարչական" JCHECK_AGAIN="Կրկին ստուգեք" JERROR="Սխալ" -JEMAIL="Ուղարկել էլ. փոստով" -JGLOBAL_ISFREESOFTWARE="%s -ն ազատ ծրագրաշար է, թողարկված %s լիցենզայի տակ:" -JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM="Լեզվային փաթեթը չի համապատասխանում տվյալ Joomla! տարբերակին: Որոշ տողերի թարգմանությունը կարող է բացակայել:" +JEMAIL="Ուղարկել էլ-փոստով" +JGLOBAL_ISFREESOFTWARE="%s՝ ազատ ծրագրաշար է, որը տարածվում է %s արտոնագրով։" +JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM="Լեզվային փաթեթը չի համապատասխանում տվյալ Joomla-ի տարբերակին։ Որոշ տողերի թարգմանությունը կարող է բացակայել։" JGLOBAL_SELECT_AN_OPTION="Ընտրեք կայանքը" -JGLOBAL_SELECT_NO_RESULTS_MATCH="Չկա համապատասխան արդյունք:" -JGLOBAL_SELECT_SOME_OPTIONS="Ընտրեք որոշ կայանքները" -JINVALID_TOKEN="Ամենավերջին հարցումը մերժվել է՝ անվավեր բնութագիրը պարունակելու պատճառով: Խնդրում ենք թարմացնել էջը և կրկին փորձել:" +JGLOBAL_SELECT_NO_RESULTS_MATCH="Չկա համապատասխան արդյունք։" +JGLOBAL_SELECT_SOME_OPTIONS="Ընտրեք որոշ կարգավորումները" +JINVALID_TOKEN="Ամենավերջին հարցումը մերժվել է՝ անվավեր բնութագիրը պարունակելու պատճառով։ Խնդրում ենք թարմացնել էջը և կրկին փորձել։" JNEXT="Հաջորդ" JNO="Ոչ" JNOTICE="Տեղեկացում" @@ -280,18 +280,18 @@ JUSERNAME="Օգտանուն" JYES="Այո" ; Framework strings necessary when no lang pack is available -JLIB_DATABASE_ERROR_CONNECT_MYSQL="MySQL-ին միանալը ձախողվեց:" -JLIB_DATABASE_ERROR_DATABASE="Տեղի է ունեցել ՏԲ-ի սխալ" -JLIB_DATABASE_ERROR_LOAD_DATABASE_DRIVER="Հնարավոր չէ բեռնել ՏԲ-ի սարքավարը՝ %s" -JLIB_ENVIRONMENT_SESSION_EXPIRED="Ձեր աշխատաշրջանը ավարտվեց, խնդրում ենք թարմացնել եջը:" -JLIB_FILESYSTEM_ERROR_COPY_FAILED="Պատճենումը ձախողվեց" -JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FILES="JFolder: :files: Հասցեն չի տանում դեպի պանակ: Հասցե՝ %s" -JLIB_FORM_FIELD_INVALID="Անվավեր դաշտ. " +JLIB_DATABASE_ERROR_CONNECT_MYSQL="Չհաջողվեց միանալ MySQL-ին։" +JLIB_DATABASE_ERROR_DATABASE="ՏԲ-ի սխալ" +JLIB_DATABASE_ERROR_LOAD_DATABASE_DRIVER="Չհաջողվեց բեռնել ՏԲ-ի սարքավարը՝ %s" +JLIB_ENVIRONMENT_SESSION_EXPIRED="Ձեր աշխատաշրջանը ավարտվեց, խնդրում ենք թարմացնել եջը։" +JLIB_FILESYSTEM_ERROR_COPY_FAILED="Կրկնապատկեւմը ձախողվեց" +JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FILES="JFolder: :files: Հասցեն չի տանում դեպի պանակ։ Հասցե՝ %s" +JLIB_FORM_FIELD_INVALID="Անվավեր դաշտ՝ " JLIB_FORM_VALIDATE_FIELD_INVALID="Անվավեր դաշտ՝ %s" JLIB_FORM_VALIDATE_FIELD_REQUIRED="Պահանջվող դաշտ՝ %s" -JLIB_INSTALLER_ERROR_FAIL_COPY_FILE="JInstaller: :Install: Ֆայլի պատճենումը %1$s -ից %2$s -ը ձախողվեց:" -JLIB_INSTALLER_NOT_ERROR="Եթե սխալը զեկուցվում է TinyMCE-ի լեզվի ֆայլերի տեղակայման վերաբերյալ, այն չունի որևէ ազդեցություն լեզուների տեղակայման վրա: Որոշ լեզվային փաթեթները, որոնց ստեղծվել են Joomla! 3.2.0-ից առաջ, կարող են պորջել տեղակայել TinyMCE-ի լեզվի ֆայլերը առանձին: Քանի որ դրանք վերջերս ընդգրկվել են հիմնական փաթեթի մեջ, դրանց տեղակայման կարիք այլևս չկա:" -JLIB_UTIL_ERROR_CONNECT_DATABASE="JDatabase: :getInstance: ձախողվեց միանալ տվյալների բազային
    joomla.library: %1$s - %2$s" +JLIB_INSTALLER_ERROR_FAIL_COPY_FILE="JInstaller: :Install: չհաջողվեց կրկնապատկել %1$s ֆայլը դեպի %2$s" +JLIB_INSTALLER_NOT_ERROR="Եթե սխալը զեկուցվում է TinyMCE-ի լեզվի ֆայլերի տեղակայման վերաբերյալ, այն չունի որևէ ազդեցություն լեզուների տեղակայման վրա։ Joomla-ի 3.2.0 տարբերակից առաջ ստեղծված որոշ լեզվային փաթեթները կարող են պորձել տեղակայել TinyMCE-ի լեզվի ֆայլերը առանձին։ Քանի որ դրանք վերջերս ընդգրկվել են հիմնական փաթեթի մեջ, դրանց տեղակայման կարիքը այլևս չկա։" +JLIB_UTIL_ERROR_CONNECT_DATABASE="JDatabase: :getInstance: չհաջողվեց միանալ տվյալների բազային
    joomla.library: %1$s - %2$s" ; Strings for the language debugger JDEBUG_LANGUAGE_FILES_IN_ERROR="Լեզվային ֆայլերում վերլուծման սխալներ" @@ -299,10 +299,10 @@ JDEBUG_LANGUAGE_UNTRANSLATED_STRING="Չթարգմանված տողեր" JNONE="Չկա" ; Necessary for errors -ADMIN_EMAIL="Վարչական էլ. հասցեն" +ADMIN_EMAIL="Վարչական էլ-հասցեն" ADMIN_PASSWORD="Վարչական գաղտնաբառը" ADMIN_PASSWORD2="Հաստատեք վարչական գաղտնաբառը" -SITE_NAME="Կայքի անուն" +SITE_NAME="Կայքի անունը" ; Database types (allows for a more descriptive label than the internal name) MYSQL="MySQL" diff --git a/installation/language/hy-AM/hy-AM.xml b/installation/language/hy-AM/hy-AM.xml index 222f5ec4ebbc7..b33413768dd0a 100644 --- a/installation/language/hy-AM/hy-AM.xml +++ b/installation/language/hy-AM/hy-AM.xml @@ -4,7 +4,7 @@ client="installation"> Armenian (hy-AM) 3.4.2 - 2015-06-20 + 2015-07-08 Andrey Aleksanyants Copyright (C) 2005 - 2015 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt From cdac60ab0520fe2c361e091c7a105893633d61c4 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Wed, 8 Jul 2015 13:20:54 +0100 Subject: [PATCH 595/809] [fix] Remove addLog calls to unexisting method in DatabaseImporter. Queries are already logged in the respective driver. Fixes #7373. --- libraries/joomla/database/importer.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libraries/joomla/database/importer.php b/libraries/joomla/database/importer.php index a46e471f46dc7..54ae50c289b3c 100644 --- a/libraries/joomla/database/importer.php +++ b/libraries/joomla/database/importer.php @@ -200,11 +200,8 @@ public function mergeStructure() } catch (RuntimeException $e) { - $this->addLog('Fail: ' . $this->db->getQuery()); throw $e; } - - $this->addLog('Pass: ' . $this->db->getQuery()); } } } @@ -221,11 +218,8 @@ public function mergeStructure() } catch (RuntimeException $e) { - $this->addLog('Fail: ' . $this->db->getQuery()); throw $e; } - - $this->addLog('Pass: ' . $this->db->getQuery()); } } } From a66be02e159b3ccdeec884a4fa9287ac8519d863 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Fri, 19 Jun 2015 10:35:49 +0200 Subject: [PATCH 596/809] Adding a Limit Box to Languages Manager: Installed languages Fixes #7201 --- .../views/installed/tmpl/default.php | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/administrator/components/com_languages/views/installed/tmpl/default.php b/administrator/components/com_languages/views/installed/tmpl/default.php index eda55d7f35b17..e75f9f4b32bad 100644 --- a/administrator/components/com_languages/views/installed/tmpl/default.php +++ b/administrator/components/com_languages/views/installed/tmpl/default.php @@ -11,21 +11,30 @@ // Add specific helper files for html generation JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); + +JHtml::_('formbehavior.chosen', 'select'); + $user = JFactory::getUser(); $userId = $user->get('id'); $client = $this->state->get('filter.client_id', 0) ? JText::_('JADMINISTRATOR') : JText::_('JSITE'); $clientId = $this->state->get('filter.client_id', 0); ?>
    - sidebar)) : ?> -
    - sidebar; ?> +sidebar)) : ?> +
    + sidebar; ?> +
    +
    + +
    + +
    +
    + + pagination->getLimitBox(); ?> +
    -
    - -
    - - +
    From 6fe3371a91750259e937d8045ac47550e78f0485 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Thu, 5 Mar 2015 20:37:14 +0100 Subject: [PATCH 597/809] PostgreSQL - sql error save category with tag Fixes #6326 --- libraries/cms/table/corecontent.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/cms/table/corecontent.php b/libraries/cms/table/corecontent.php index 417ae011d0fd4..5bf83679a9e3d 100644 --- a/libraries/cms/table/corecontent.php +++ b/libraries/cms/table/corecontent.php @@ -110,7 +110,15 @@ public function check() { $this->core_alias = JFactory::getDate()->format('Y-m-d-H-i-s'); } - + // Not Null sanity check + if (empty($this->core_images)) + { + $this->core_images = '{}'; + } + if (empty($this->core_urls)) + { + $this->core_urls = '{}'; + } // Check the publish down date is not earlier than publish up. if ($this->core_publish_down > $this->_db->getNullDate() && $this->core_publish_down < $this->core_publish_up) { From 6715323c69cf322e2ccc4e4e4de299f1e8ca2619 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Sat, 7 Mar 2015 07:51:46 +0100 Subject: [PATCH 598/809] PostgreSQL - redirect link not saved go to the Redirect manager and create a new link and Save the redirect link is saved SQL ERROR not null constraint violation PostgreSQL 9.3.5 Joomla 3.4.0 added a sanity check for NOT NULL FIELDS fix #6349 removed space as per @orware comment corrected a typo in the PR. --- administrator/components/com_redirect/tables/link.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/administrator/components/com_redirect/tables/link.php b/administrator/components/com_redirect/tables/link.php index 29b8dd154caae..071e16c28259d 100644 --- a/administrator/components/com_redirect/tables/link.php +++ b/administrator/components/com_redirect/tables/link.php @@ -47,6 +47,11 @@ public function check() return false; } + // Check for NOT NULL. + if (empty($this->referer)) + { + $this->referer = ''; + } // Check for valid name if not in advanced mode. if (empty($this->new_url) && JComponentHelper::getParams('com_redirect')->get('mode', 0) == false) From 4516a7f07bcfb680a63d1adda2025e222aad2c7b Mon Sep 17 00:00:00 2001 From: Elijah Madden Date: Tue, 16 Jun 2015 12:36:10 +0900 Subject: [PATCH 599/809] Fix up the 'core' javascript file Fixes #6512 --- media/system/js/core-uncompressed.js | 857 ++++++++++++++------------- media/system/js/core.js | 2 +- 2 files changed, 451 insertions(+), 408 deletions(-) diff --git a/media/system/js/core-uncompressed.js b/media/system/js/core-uncompressed.js index f3220c8d6ea6a..63295dceec165 100644 --- a/media/system/js/core-uncompressed.js +++ b/media/system/js/core-uncompressed.js @@ -6,454 +6,497 @@ // Only define the Joomla namespace if not defined. Joomla = window.Joomla || {}; -Joomla.editors = {}; -// An object to hold each editor instance on page -Joomla.editors.instances = {}; +// Only define editors if not defined +Joomla.editors = Joomla.editors || {}; -/** - * Generic submit form - */ -Joomla.submitform = function(task, form, validate) { - if (!form) { - form = document.getElementById('adminForm'); - } - - if (task) { - form.task.value = task; - } +// An object to hold each editor instance on page, only define if not defined. +Joomla.editors.instances = Joomla.editors.instances || {}; - // Toggle HTML5 validation - form.noValidate = !validate; +(function( Joomla, document ) { + "use strict"; - // Submit the form. - // Create the input type="submit" - var button = document.createElement('input'); - button.style.display = 'none'; - button.type = 'submit'; - - // Append it and click it - form.appendChild(button).click(); + /** + * Generic submit form + */ + Joomla.submitform = function(task, form, validate) { + if (!form) { + form = document.getElementById('adminForm'); + } - // If "submit" was prevented, make sure we don't get a build up of buttons - form.removeChild(button); -}; + if (task) { + form.task.value = task; + } -/** - * Default function. Usually would be overriden by the component - */ -Joomla.submitbutton = function(pressbutton) { - Joomla.submitform(pressbutton); -}; + // Toggle HTML5 validation + form.noValidate = !validate; + + // Submit the form. + // Create the input type="submit" + var button = document.createElement('input'); + button.style.display = 'none'; + button.type = 'submit'; + + // Append it and click it + form.appendChild(button).click(); + + // If "submit" was prevented, make sure we don't get a build up of buttons + form.removeChild(button); + }; + + /** + * Default function. Usually would be overriden by the component + */ + Joomla.submitbutton = function( pressbutton ) { + Joomla.submitform( pressbutton ); + }; + + /** + * Custom behavior for JavaScript I18N in Joomla! 1.6 + * + * Allows you to call Joomla.JText._() to get a translated JavaScript string pushed in with JText::script() in Joomla. + */ + Joomla.JText = { + strings: {}, + '_': function( key, def ) { + return typeof this.strings[ key.toUpperCase() ] !== 'undefined' ? this.strings[ key.toUpperCase() ] : def; + }, + load: function( object ) { + for ( var key in object ) { + if (!object.hasOwnProperty(key)) continue; + this.strings[ key.toUpperCase() ] = object[ key ]; + } + return this; + } + }; -/** - * Custom behavior for JavaScript I18N in Joomla! 1.6 - * - * Allows you to call Joomla.JText._() to get a translated JavaScript string pushed in with JText::script() in Joomla. - */ -Joomla.JText = { - strings: {}, - '_': function(key, def) { - return typeof this.strings[key.toUpperCase()] !== 'undefined' ? this.strings[key.toUpperCase()] : def; - }, - load: function(object) { - for (var key in object) { - this.strings[key.toUpperCase()] = object[key]; - } - return this; - } -}; + /** + * Method to replace all request tokens on the page with a new one. + * Probably not used anywhere + */ + Joomla.replaceTokens = function( newToken ) { + if (!/^[0-9A-F]{32}$/i.test(newToken)) { return; } -/** - * Method to replace all request tokens on the page with a new one. - */ -Joomla.replaceTokens = function(n) { - var els = document.getElementsByTagName('input'), i; - for (i = 0; i < els.length; i++) { - if ((els[i].type == 'hidden') && (els[i].name.length == 32) && els[i].value == '1') { - els[i].name = n; - } - } -}; + var els = document.getElementsByTagName( 'input' ), + i, el; -/** - * USED IN: administrator/components/com_banners/views/client/tmpl/default.php - * - * Verifies if the string is in a valid email format - * - * @param string - * @return boolean - */ -Joomla.isEmail = function(text) { - var regex = new RegExp("^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$"); - return regex.test(text); -}; + for ( i = 0, n = els.length; i < n; i++ ) { + el = els[i]; -/** - * USED IN: all list forms. - * - * Toggles the check state of a group of boxes - * - * Checkboxes must have an id attribute in the form cb0, cb1... - * - * @param mixed The number of box to 'check', for a checkbox element - * @param string An alternative field name - */ -Joomla.checkAll = function(checkbox, stub) { - if (!stub) { - stub = 'cb'; - } - if (checkbox.form) { - var c = 0, i, e; - for (i = 0, n = checkbox.form.elements.length; i < n; i++) { - e = checkbox.form.elements[i]; - if (e.type == checkbox.type) { - if ((stub && e.id.indexOf(stub) == 0) || !stub) { - e.checked = checkbox.checked; - c += (e.checked == true ? 1 : 0); - } - } - } - if (checkbox.form.boxchecked) { - checkbox.form.boxchecked.value = c; - } - return true; - } - return false; -}; - -/** - * Render messages send via JSON - * - * @param object messages JavaScript object containing the messages to render. Example: - * var messages = { - * "message": ["Message one", "Message two"], - * "error": ["Error one", "Error two"] - * }; - * @return void - */ -Joomla.renderMessages = function(messages) { - Joomla.removeMessages(); + if ( el.type == 'hidden' && el.value == '1' && el.name.length == 32 ) { + el.name = newToken; + } + } + }; + + /** + * USED IN: administrator/components/com_banners/views/client/tmpl/default.php + * Actually, probably not used anywhere. Can we deprecate in favor of ? + * + * Verifies if the string is in a valid email format + * + * @param string + * @return boolean + */ + Joomla.isEmail = function( text ) { + var regex = /^[\w.!#$%&’*+\/=?^`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9-]{2,})+$/i; + return regex.test( text ); + }; + + /** + * USED IN: all list forms. + * + * Toggles the check state of a group of boxes + * + * Checkboxes must have an id attribute in the form cb0, cb1... + * + * @param mixed The number of box to 'check', for a checkbox element + * @param string An alternative field name + */ + Joomla.checkAll = function( checkbox, stub ) { + if (!checkbox.form) return false; + + stub = stub ? stub : 'cb'; + + var c = 0, + i, e, n; + + for ( i = 0, n = checkbox.form.elements.length; i < n; i++ ) { + e = checkbox.form.elements[ i ]; + + if ( e.type == checkbox.type && e.id.indexOf( stub ) === 0 ) { + e.checked = checkbox.checked; + c += e.checked ? 1 : 0; + } + } - var messageContainer = document.getElementById('system-message-container'); - var messageInner = document.createElement('div'); - messageInner.id = 'system-message'; + if ( checkbox.form.boxchecked ) { + checkbox.form.boxchecked.value = c; + } - for (var type in messages) { - if (messages.hasOwnProperty(type)) { + return true; + }; + + /** + * Render messages send via JSON + * Used by some javascripts such as validate.js + * + * @param object messages JavaScript object containing the messages to render. Example: + * var messages = { + * "message": ["Message one", "Message two"], + * "error": ["Error one", "Error two"] + * }; + * @return void + */ + Joomla.renderMessages = function( messages ) { + Joomla.removeMessages(); + + var messageContainer = document.getElementById( 'system-message-container' ), + type, typeMessages, messagesBox, title, titleWrapper, i, messageWrapper; + + for ( type in messages ) { + if ( !messages.hasOwnProperty( type ) ) { continue; } // Array of messages of this type - var typeMessages = messages[type]; + typeMessages = messages[ type ]; // Create the alert box - var messagesBox = document.createElement('div'); + messagesBox = document.createElement( 'div' ); messagesBox.className = 'alert alert-' + type; // Title - var title = Joomla.JText._(type); + title = Joomla.JText._( type ); // Skip titles with untranslated strings - if (typeof title != 'undefined') { - var titleWrapper = document.createElement('h4'); + if ( typeof title != 'undefined' ) { + titleWrapper = document.createElement( 'h4' ); titleWrapper.className = 'alert-heading'; - titleWrapper.innerHTML = Joomla.JText._(type); + titleWrapper.innerHTML = Joomla.JText._( type ); - messagesBox.appendChild(titleWrapper); + messagesBox.appendChild( titleWrapper ); } // Add messages to the message box - for (var i = typeMessages.length - 1; i >= 0; i--) { - var messageWrapper = document.createElement('p'); - messageWrapper.innerHTML = typeMessages[i]; - messagesBox.appendChild(messageWrapper); + for ( i = typeMessages.length - 1; i >= 0; i-- ) { + messageWrapper = document.createElement( 'p' ); + messageWrapper.innerHTML = typeMessages[ i ]; + messagesBox.appendChild( messageWrapper ); } - messageInner.appendChild(messagesBox); + messageContainer.appendChild( messagesBox ); + } + }; + + + /** + * Remove messages + * + * @return void + */ + Joomla.removeMessages = function() { + var messageContainer = document.getElementById( 'system-message-container' ); + + // Empty container with a while for Chrome performance issues + while ( messageContainer.firstChild ) messageContainer.removeChild( messageContainer.firstChild ); + + // Fix Chrome bug not updating element height + messageContainer.style.display = 'none'; + messageContainer.offsetHeight; + messageContainer.style.display = ''; + }; + + /** + * USED IN: administrator/components/com_cache/views/cache/tmpl/default.php + * administrator/components/com_installer/views/discover/tmpl/default_item.php + * administrator/components/com_installer/views/update/tmpl/default_item.php + * administrator/components/com_languages/helpers/html/languages.php + * libraries/joomla/html/html/grid.php + * + * @param isitchecked + * @param form + * @return + */ + Joomla.isChecked = function( isitchecked, form ) { + if ( typeof form === 'undefined' ) { + form = document.getElementById( 'adminForm' ); } - } - messageContainer.appendChild(messageInner); -}; + form.boxchecked.value += isitchecked ? 1 : -1; + // If we don't have a checkall-toggle, done. + if ( !form.elements[ 'checkall-toggle' ] ) return; -/** - * Remove messages - * - * @return void - */ -Joomla.removeMessages = function() { - var messageContainer = document.getElementById('system-message-container'); + // Toggle main toggle checkbox depending on checkbox selection + var c = true, + i, e, n; - // Empty container with a while for Chrome performance issues - while (messageContainer.firstChild) messageContainer.removeChild(messageContainer.firstChild); + for ( i = 0, n = form.elements.length; i < n; i++ ) { + e = form.elements[ i ]; - // Fix Chrome bug not updating element height - messageContainer.style.display='none'; - messageContainer.offsetHeight; - messageContainer.style.display=''; -}; + if ( e.type == 'checkbox' && e.name != 'checkall-toggle' && !e.checked ) { + c = false; + break; + } + } -/** - * USED IN: administrator/components/com_cache/views/cache/tmpl/default.php - * administrator/components/com_installer/views/discover/tmpl/default_item.php - * administrator/components/com_installer/views/update/tmpl/default_item.php - * administrator/components/com_languages/helpers/html/languages.php - * libraries/joomla/html/html/grid.php - * - * @param isitchecked - * @param form - * @return - */ -Joomla.isChecked = function(isitchecked, form) { - if (typeof(form) === 'undefined') { - form = document.getElementById('adminForm'); - } - - if (isitchecked == true) { - form.boxchecked.value++; - } else { - form.boxchecked.value--; - } - - // Toggle main toggle checkbox depending on checkbox selection - var c = true, i, e; - for (i = 0, n = form.elements.length; i < n; i++) { - e = form.elements[i]; - if (e.type == 'checkbox') { - if (e.name != 'checkall-toggle' && e.checked == false) { - c = false; - break; - } - } - } - if (form.elements['checkall-toggle']) { - form.elements['checkall-toggle'].checked = c; - } -}; + form.elements[ 'checkall-toggle' ].checked = c; + }; + + /** + * USED IN: libraries/joomla/html/toolbar/button/help.php + * + * Pops up a new window in the middle of the screen + */ + Joomla.popupWindow = function( mypage, myname, w, h, scroll ) { + var winl = ( screen.width - w ) / 2, + wint = ( screen.height - h ) / 2, + winprops = 'height=' + h + + ',width=' + w + + ',top=' + wint + + ',left=' + winl + + ',scrollbars=' + scroll + + ',resizable'; + + window.open( mypage, myname, winprops ) + .window.focus(); + }; + + /** + * USED IN: libraries/joomla/html/html/grid.php + * In other words, on any reorderable table + */ + Joomla.tableOrdering = function( order, dir, task, form ) { + if ( typeof form === 'undefined' ) { + form = document.getElementById( 'adminForm' ); + } -/** - * USED IN: libraries/joomla/html/toolbar/button/help.php - * - * Pops up a new window in the middle of the screen - */ -Joomla.popupWindow = function(mypage, myname, w, h, scroll) { - var winl = (screen.width - w) / 2, wint, winprops, win; - wint = (screen.height - h) / 2; - winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl - + ',scrollbars=' + scroll + ',resizable'; - win = window.open(mypage, myname, winprops); - win.window.focus(); -}; + form.filter_order.value = order; + form.filter_order_Dir.value = dir; + Joomla.submitform( task, form ); + }; + + /** + * USED IN: administrator/components/com_modules/views/module/tmpl/default.php + * + * Writes a dynamically generated list + * + * @param string + * The parameters to insert into the ', + hasSelection = key == orig_key, + i = 0, + selected, x, item; + + for ( x in source ) { + if (!source.hasOwnProperty(x)) { continue; } + + item = source[ x ]; + + if ( item[ 0 ] != key ) { continue; } + + selected = ''; + + if ( ( hasSelection && orig_val == item[ 1 ] ) || ( !hasSelection && i === 0 ) ) { + selected = 'selected="selected"'; + } -/** - * USED IN: libraries/joomla/html/html/grid.php - */ -Joomla.tableOrdering = function(order, dir, task, form) { - if (typeof(form) === 'undefined') { - form = document.getElementById('adminForm'); - } + html += ''; - form.filter_order.value = order; - form.filter_order_Dir.value = dir; - Joomla.submitform(task, form); -}; + i++; + } + html += ''; + + document.writeln( html ); + }; + + /** + * USED IN: administrator/components/com_content/views/article/view.html.php + * actually, probably not used anywhere. + * + * Changes a dynamically generated list + * + * @param string + * The name of the list to change + * @param array + * A javascript array of list options in the form [key,value,text] + * @param string + * The key to display + * @param string + * The original key that was selected + * @param string + * The original item value that was selected + */ + window.changeDynaList = function ( listname, source, key, orig_key, orig_val ) { + var list = document.adminForm[ listname ], + hasSelection = key == orig_key, + i, x, item; + + // empty the list + while ( list.firstChild ) list.removeChild( list.firstChild ); + + i = 0; + + for ( x in source ) { + if (!source.hasOwnProperty(x)) { continue; } + + item = source[x]; + + if ( item[ 0 ] != key ) { continue; } + + opt = new Option(); + opt.value = item[ 1 ]; + opt.text = item[ 2 ]; + + if ( ( hasSelection && orig_val == opt.value ) || (!hasSelection && i === 0) ) { + opt.selected = true; + } -/** - * USED IN: administrator/components/com_modules/views/module/tmpl/default.php - * - * Writes a dynamically generated list - * - * @param string - * The parameters to insert into the ', i, selected; - i = 0; - for (x in source) { - if (source[x][0] == key) { - selected = ''; - if ((orig_key == key && orig_val == source[x][1]) - || (i == 0 && orig_key != key)) { - selected = 'selected="selected"'; - } - html += '\n '; - } - i++; - } - html += '\n '; - - document.writeln(html); -} + list.options[ i++ ] = opt; + } -/** - * USED IN: administrator/components/com_content/views/article/view.html.php - * - * Changes a dynamically generated list - * - * @param string - * The name of the list to change - * @param array - * A javascript array of list options in the form [key,value,text] - * @param string - * The key to display - * @param string - * The original key that was selected - * @param string - * The original item value that was selected - */ -function changeDynaList(listname, source, key, orig_key, orig_val) { - var list = document.adminForm[listname]; - - // empty the list - for (i in list.options.length) { - list.options[i] = null; - } - i = 0; - for (x in source) { - if (source[x][0] == key) { - opt = new Option(); - opt.value = source[x][1]; - opt.text = source[x][2]; - - if ((orig_key == key && orig_val == opt.value) || i == 0) { - opt.selected = true; - } - list.options[i++] = opt; - } - } - list.length = i; -} + list.length = i; + }; + + /** + * USED IN: administrator/components/com_menus/views/menus/tmpl/default.php + * Probably not used at all + * + * @param radioObj + * @return + */ + // return the value of the radio button that is checked + // return an empty string if none are checked, or + // there are no radio buttons + window.radioGetCheckedValue = function ( radioObj ) { + if ( !radioObj ) { return ''; } + + var n = radioObj.length, + i; + + if ( n === undefined ) { + return radioObj.checked ? radioObj.value : ''; + } -/** - * USED IN: administrator/components/com_menus/views/menus/tmpl/default.php - * - * @param radioObj - * @return - */ -// return the value of the radio button that is checked -// return an empty string if none are checked, or -// there are no radio buttons -function radioGetCheckedValue(radioObj) { - if (!radioObj) { - return ''; - } - var n = radioObj.length, i; - if (n == undefined) { - if (radioObj.checked) { - return radioObj.value; - } else { - return ''; - } - } - for (i = 0; i < n; i++) { - if (radioObj[i].checked) { - return radioObj[i].value; - } - } - return ''; -} + for ( i = 0; i < n; i++ ) { + if ( radioObj[ i ].checked ) { + return radioObj[ i ].value; + } + } -/** - * USED IN: administrator/components/com_banners/views/banner/tmpl/default/php - * administrator/components/com_categories/views/category/tmpl/default.php - * administrator/components/com_categories/views/copyselect/tmpl/default.php - * administrator/components/com_content/views/copyselect/tmpl/default.php - * administrator/components/com_massmail/views/massmail/tmpl/default.php - * administrator/components/com_menus/views/list/tmpl/copy.php - * administrator/components/com_menus/views/list/tmpl/move.php - * administrator/components/com_messages/views/message/tmpl/default_form.php - * administrator/components/com_newsfeeds/views/newsfeed/tmpl/default.php - * components/com_content/views/article/tmpl/form.php - * templates/beez/html/com_content/article/form.php - * - * @param frmName - * @param srcListName - * @return - */ -function getSelectedValue(frmName, srcListName) { - var form = document[frmName], - srcList = form[srcListName]; - - i = srcList.selectedIndex; - if (i != null && i > -1) { - return srcList.options[i].value; - } else { - return null; - } -} + return ''; + }; + + /** + * USED IN: administrator/components/com_users/views/mail/tmpl/default.php + * Let's get rid of this and kill it + * + * @param frmName + * @param srcListName + * @return + */ + window.getSelectedValue = function ( frmName, srcListName ) { + var srcList = document[ frmName ][ srcListName ], + i = srcList.selectedIndex; + + if ( i !== null && i > -1 ) { + return srcList.options[ i ].value; + } else { + return null; + } + }; -/** - * USED IN: all over :) - * - * @param id - * @param task - * @return - */ -function listItemTask(id, task) { - var f = document.adminForm, i, cbx, - cb = f[id]; - if (cb) { - for (i = 0; true; i++) { - cbx = f['cb'+i]; - if (!cbx) - break; - cbx.checked = false; - } // for - cb.checked = true; - f.boxchecked.value = 1; - submitbutton(task); - } - return false; -} + /** + * USED IN: all over :) + * + * @param id + * @param task + * @return + */ + window.listItemTask = function ( id, task ) { + var f = document.adminForm, + i = 0, cbx, + cb = f[ id ]; -/** - * Default function. Usually would be overriden by the component - * - * @deprecated 12.1 This function will be removed in a future version. Use Joomla.submitbutton() instead. - */ -function submitbutton(pressbutton) { - Joomla.submitform(pressbutton); -} + if ( !cb ) return false; -/** - * Submit the admin form - * - * @deprecated 12.1 This function will be removed in a future version. Use Joomla.submitform() instead. - */ -function submitform(pressbutton) { - Joomla.submitform(pressbutton); -} + while ( true ) { + cbx = f[ 'cb' + i ]; -// needed for Table Column ordering -/** - * USED IN: libraries/joomla/html/html/grid.php - */ -function saveorder(n, task) { - checkAll_button(n, task); -} - -function checkAll_button(n, task) { - if (!task) { - task = 'saveorder'; - } - var j, box; - for (j = 0; j <= n; j++) { - box = document.adminForm['cb'+j]; - if (box) { - if (box.checked == false) { - box.checked = true; - } - } else { - alert("You cannot change the order of items, as an item in the list is `Checked Out`"); - return; - } - } - submitform(task); -} + if ( !cbx ) break; + + cbx.checked = false; + + i++; + } + + cb.checked = true; + f.boxchecked.value = 1; + submitform( task ); + + return false; + }; + + /** + * Default function. Usually would be overriden by the component + * + * @deprecated 12.1 This function will be removed in a future version. Use Joomla.submitbutton() instead. + */ + window.submitbutton = function ( pressbutton ) { + Joomla.submitbutton( pressbutton ); + }; + + /** + * Submit the admin form + * + * @deprecated 12.1 This function will be removed in a future version. Use Joomla.submitform() instead. + */ + window.submitform = function ( pressbutton ) { + Joomla.submitform(pressbutton); + }; + + // needed for Table Column ordering + /** + * USED IN: libraries/joomla/html/html/grid.php + * There's a better way to do this now, can we try to kill it? + */ + window.saveorder = function ( n, task ) { + checkAll_button( n, task ); + }; + + /** + * Checks all the boxes unless one is missing then it assumes it's checked out. + * Weird. Probably only used by ^saveorder + * + * @param integer n The total number of checkboxes expected + * @param string task The task to perform + * + * @return void + */ + window.checkAll_button = function ( n, task ) { + task = task ? task : 'saveorder'; + + var j, box; + + for ( j = 0; j <= n; j++ ) { + box = document.adminForm[ 'cb' + j ]; + + if ( box ) { + box.checked = true; + } else { + alert( "You cannot change the order of items, as an item in the list is `Checked Out`" ); + return; + } + } + + Joomla.submitform( task ); + }; + +}( Joomla, document )); diff --git a/media/system/js/core.js b/media/system/js/core.js index 8cefe9db07afd..7f4ef29b68ec0 100644 --- a/media/system/js/core.js +++ b/media/system/js/core.js @@ -1 +1 @@ -function writeDynaList(e,t,n,o,i){var r,a,l="\n ",document.writeln(l)}function changeDynaList(e,t,n,o,r){var a=document.adminForm[e];for(i in a.options.length)a.options[i]=null;i=0;for(x in t)t[x][0]==n&&(opt=new Option,opt.value=t[x][1],opt.text=t[x][2],(o==n&&r==opt.value||0==i)&&(opt.selected=!0),a.options[i++]=opt);a.length=i}function radioGetCheckedValue(e){if(!e)return"";var t,n=e.length;if(void 0==n)return e.checked?e.value:"";for(t=0;n>t;t++)if(e[t].checked)return e[t].value;return""}function getSelectedValue(e,t){var n=document[e],o=n[t];return i=o.selectedIndex,null!=i&&i>-1?o.options[i].value:null}function listItemTask(e,t){var n,o,i=document.adminForm,r=i[e];if(r){for(n=0;!0&&(o=i["cb"+n],o);n++)o.checked=!1;r.checked=!0,i.boxchecked.value=1,submitbutton(t)}return!1}function submitbutton(e){Joomla.submitform(e)}function submitform(e){Joomla.submitform(e)}function saveorder(e,t){checkAll_button(e,t)}function checkAll_button(e,t){t||(t="saveorder");var n,o;for(n=0;e>=n;n++){if(o=document.adminForm["cb"+n],!o)return void alert("You cannot change the order of items, as an item in the list is `Checked Out`");0==o.checked&&(o.checked=!0)}submitform(t)}Joomla=window.Joomla||{},Joomla.editors={},Joomla.editors.instances={},Joomla.submitform=function(e,t,n){t||(t=document.getElementById("adminForm")),e&&(t.task.value=e),t.noValidate=!n;var o=document.createElement("input");o.style.display="none",o.type="submit",t.appendChild(o).click(),t.removeChild(o)},Joomla.submitbutton=function(e){Joomla.submitform(e)},Joomla.JText={strings:{},_:function(e,t){return"undefined"!=typeof this.strings[e.toUpperCase()]?this.strings[e.toUpperCase()]:t},load:function(e){for(var t in e)this.strings[t.toUpperCase()]=e[t];return this}},Joomla.replaceTokens=function(e){var t,n=document.getElementsByTagName("input");for(t=0;t=0;c--){var m=document.createElement("p");m.innerHTML=i[c],r.appendChild(m)}n.appendChild(r)}t.appendChild(n)},Joomla.removeMessages=function(){for(var e=document.getElementById("system-message-container");e.firstChild;)e.removeChild(e.firstChild);e.style.display="none",e.offsetHeight,e.style.display=""},Joomla.isChecked=function(e,t){"undefined"==typeof t&&(t=document.getElementById("adminForm")),1==e?t.boxchecked.value++:t.boxchecked.value--;var o,i,r=!0;for(o=0,n=t.elements.length;on;n++)o=e.form.elements[n],o.type==e.type&&0===o.id.indexOf(t)&&(o.checked=e.checked,r+=o.checked?1:0);return e.form.boxchecked&&(e.form.boxchecked.value=r),!0},e.renderMessages=function(n){e.removeMessages();var o,i,r,a,l,s,c,d=t.getElementById("system-message-container");for(o in n)if(n.hasOwnProperty(o)){for(i=n[o],r=t.createElement("div"),r.className="alert alert-"+o,a=e.JText._(o),"undefined"!=typeof a&&(l=t.createElement("h4"),l.className="alert-heading",l.innerHTML=e.JText._(o),r.appendChild(l)),s=i.length-1;s>=0;s--)c=t.createElement("p"),c.innerHTML=i[s],r.appendChild(c);d.appendChild(r)}},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.isChecked=function(e,n){if("undefined"==typeof n&&(n=t.getElementById("adminForm")),n.boxchecked.value+=e?1:-1,n.elements["checkall-toggle"]){var o,i,r,a=!0;for(o=0,r=n.elements.length;r>o;o++)if(i=n.elements[o],"checkbox"==i.type&&"checkall-toggle"!=i.name&&!i.checked){a=!1;break}n.elements["checkall-toggle"].checked=a}},e.popupWindow=function(e,t,n,o,i){var r=(screen.width-n)/2,a=(screen.height-o)/2,l="height="+o+",width="+n+",top="+a+",left="+r+",scrollbars="+i+",resizable";window.open(e,t,l).window.focus()},e.tableOrdering=function(n,o,i,r){"undefined"==typeof r&&(r=t.getElementById("adminForm")),r.filter_order.value=n,r.filter_order_Dir.value=o,e.submitform(i,r)},window.writeDynaList=function(e,n,o,i,r){var a,l,s,c="",t.writeln(c)},window.changeDynaList=function(e,n,o,i,r){for(var a,l,s,c=t.adminForm[e],d=o==i;c.firstChild;)c.removeChild(c.firstChild);a=0;for(l in n)n.hasOwnProperty(l)&&(s=n[l],s[0]==o&&(opt=new Option,opt.value=s[1],opt.text=s[2],(d&&r==opt.value||!d&&0===a)&&(opt.selected=!0),c.options[a++]=opt));c.length=a},window.radioGetCheckedValue=function(e){if(!e)return"";var t,n=e.length;if(void 0===n)return e.checked?e.value:"";for(t=0;n>t;t++)if(e[t].checked)return e[t].value;return""},window.getSelectedValue=function(e,n){var o=t[e][n],i=o.selectedIndex;return null!==i&&i>-1?o.options[i].value:null},window.listItemTask=function(e,n){var o,i=t.adminForm,r=0,a=i[e];if(!a)return!1;for(;;){if(o=i["cb"+r],!o)break;o.checked=!1,r++}return a.checked=!0,i.boxchecked.value=1,submitform(n),!1},window.submitbutton=function(t){e.submitbutton(t)},window.submitform=function(t){e.submitform(t)},window.saveorder=function(e,t){checkAll_button(e,t)},window.checkAll_button=function(n,o){o=o?o:"saveorder";var i,r;for(i=0;n>=i;i++){if(r=t.adminForm["cb"+i],!r)return void alert("You cannot change the order of items, as an item in the list is `Checked Out`");r.checked=!0}e.submitform(o)}}(Joomla,document); From d14f724c20f0624e78161212b2e48356f13155f8 Mon Sep 17 00:00:00 2001 From: Manoj Londhe Date: Thu, 9 Jul 2015 14:48:44 +0530 Subject: [PATCH 600/809] com_installer: Various cosmetic fixes regarding alignment --- .../views/discover/tmpl/default.php | 4 +-- .../views/manage/tmpl/default.php | 30 +++++++++---------- .../views/update/tmpl/default.php | 8 ++--- .../views/updatesites/tmpl/default.php | 14 +++++---- .../language/en-GB/en-GB.com_installer.ini | 2 +- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/administrator/components/com_installer/views/discover/tmpl/default.php b/administrator/components/com_installer/views/discover/tmpl/default.php index 49fb156b81ce4..d255a3fc37447 100644 --- a/administrator/components/com_installer/views/discover/tmpl/default.php +++ b/administrator/components/com_installer/views/discover/tmpl/default.php @@ -71,10 +71,10 @@ - - + - - - - - - + - diff --git a/administrator/components/com_installer/views/update/tmpl/default.php b/administrator/components/com_installer/views/update/tmpl/default.php index 73e18c30d9745..494795f9dc5ad 100644 --- a/administrator/components/com_installer/views/update/tmpl/default.php +++ b/administrator/components/com_installer/views/update/tmpl/default.php @@ -59,16 +59,16 @@ - - - - - - - - @@ -91,9 +91,11 @@ - - - - - - - - - - - - - - - - +
    + + diff --git a/administrator/components/com_installer/views/manage/tmpl/default.php b/administrator/components/com_installer/views/manage/tmpl/default.php index 98ef1a6aeb733..32f6920ef7048 100644 --- a/administrator/components/com_installer/views/manage/tmpl/default.php +++ b/administrator/components/com_installer/views/manage/tmpl/default.php @@ -59,28 +59,28 @@ + + + - - + + + + @@ -101,6 +101,13 @@ extension_id); ?> + element) : ?> + X + + status, $i, $item->status < 2, 'cb'); ?> + + client; ?> - element) : ?> - X - - status, $i, $item->status < 2, 'cb'); ?> - - type); ?> + + + @@ -102,7 +102,7 @@ extension_id ? JText::_('COM_INSTALLER_MSG_UPDATE_UPDATE') : JText::_('COM_INSTALLER_NEW_INSTALL') ?> + type) ?> diff --git a/administrator/components/com_installer/views/updatesites/tmpl/default.php b/administrator/components/com_installer/views/updatesites/tmpl/default.php index dac0c514d501d..dc8351fb2aca2 100644 --- a/administrator/components/com_installer/views/updatesites/tmpl/default.php +++ b/administrator/components/com_installer/views/updatesites/tmpl/default.php @@ -56,16 +56,16 @@ + + + +
    - update_site_name; ?> + + name; ?> diff --git a/administrator/language/en-GB/en-GB.com_installer.ini b/administrator/language/en-GB/en-GB.com_installer.ini index 898e5ef126bd3..4c7ad6f4cf8a7 100644 --- a/administrator/language/en-GB/en-GB.com_installer.ini +++ b/administrator/language/en-GB/en-GB.com_installer.ini @@ -42,7 +42,7 @@ COM_INSTALLER_HEADING_LOCATION="Location" COM_INSTALLER_HEADING_NAME="Name" COM_INSTALLER_HEADING_TYPE="Type" COM_INSTALLER_HEADING_UPDATESITE_NAME="Update Site" -COM_INSTALLER_HEADING_UPDATESITEID="Update Site ID" +COM_INSTALLER_HEADING_UPDATESITEID="ID" COM_INSTALLER_INSTALL_BUTTON="Install" COM_INSTALLER_INSTALL_DIRECTORY="Install Directory" COM_INSTALLER_INSTALL_ERROR="Error installing %s" From 38e828c41b29e7010887ad05be65dd408ad8b06a Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Thu, 9 Jul 2015 11:14:26 +0100 Subject: [PATCH 601/809] en-gb style for elipsis --- administrator/language/en-GB/en-GB.ini | 4 ++-- installation/language/en-GB/en-GB.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index 0132fd97d1d16..7e3d43a1ee185 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -495,7 +495,7 @@ JGLOBAL_SHOW_FEATURED_ARTICLES_DESC="Select to show, hide or only display featur JGLOBAL_SHOW_FEATURED_ARTICLES_LABEL="Featured Articles" JGLOBAL_SHOW_FEED_LINK_DESC="Show or hide an RSS Feed Link. (A Feed Link will show up as a feed icon in the address bar of most modern browsers)." JGLOBAL_SHOW_FEED_LINK_LABEL="Show Feed Link" -JGLOBAL_SHOW_FULL_DESCRIPTION="Show full description..." +JGLOBAL_SHOW_FULL_DESCRIPTION="Show full description ..." JGLOBAL_SHOW_HEADINGS_DESC="Show or hide the headings in list layouts." JGLOBAL_SHOW_HEADINGS_LABEL="Table Headings" JGLOBAL_SHOW_HITS_DESC="If set to Show, the number of Hits on a particular Article will be displayed. This is a global setting but can be changed at the Category, Menu and Article levels." @@ -514,7 +514,7 @@ JGLOBAL_SHOW_PRINT_ICON_DESC="Show or hide the Item Print button." JGLOBAL_SHOW_PRINT_ICON_LABEL="Show Print Icon" JGLOBAL_SHOW_PUBLISH_DATE_DESC="If set to Show, the date and time an Article was published will be displayed. This is a global setting but can be changed at the Category, Menu and Article levels." JGLOBAL_SHOW_PUBLISH_DATE_LABEL="Show Publish Date" -JGLOBAL_SHOW_READMORE_DESC="If set to Show, the Read more... Link will show if Main text has been provided for the Article." +JGLOBAL_SHOW_READMORE_DESC="If set to Show, the Read more ... Link will show if Main text has been provided for the Article." JGLOBAL_SHOW_READMORE_LABEL="Show "Read More"" JGLOBAL_SHOW_READMORE_TITLE_DESC="If set to show the title of the Article will be shown on the Read More button." JGLOBAL_SHOW_READMORE_TITLE_LABEL="Show Title with Read More" diff --git a/installation/language/en-GB/en-GB.ini b/installation/language/en-GB/en-GB.ini index 66f9477cf39a4..bf6b2aa4a9324 100644 --- a/installation/language/en-GB/en-GB.ini +++ b/installation/language/en-GB/en-GB.ini @@ -101,7 +101,7 @@ INSTL_SUMMARY_EMAIL_PASSWORDS_LABEL="Include Passwords in Email" INSTL_SUMMARY_EMAIL_PASSWORDS_DESC="Warning! It is recommended to not send and store your passwords in emails." ;Installing view -INSTL_INSTALLING="Installing..." +INSTL_INSTALLING="Installing ..." INSTL_INSTALLING_DATABASE_BACKUP="Backing up old database tables" INSTL_INSTALLING_DATABASE_REMOVE="Removing old database tables" INSTL_INSTALLING_DATABASE="Creating database tables" From cd729d3e4f13c62e58a47c8a77c68079788e3c6d Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Thu, 9 Jul 2015 12:15:23 +0200 Subject: [PATCH 602/809] Wrong Cambodian flag name --- media/mod_languages/images/{km_kr.gif => km_kh.gif} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename media/mod_languages/images/{km_kr.gif => km_kh.gif} (100%) diff --git a/media/mod_languages/images/km_kr.gif b/media/mod_languages/images/km_kh.gif similarity index 100% rename from media/mod_languages/images/km_kr.gif rename to media/mod_languages/images/km_kh.gif From edb6a8240fa12a89f90ec60ed00d738b4c879c1d Mon Sep 17 00:00:00 2001 From: Manoj Londhe Date: Thu, 9 Jul 2015 16:42:10 +0530 Subject: [PATCH 603/809] Extension, Module, Plugin, Language, Template Mangers: Removed center classes for text and number columns, added center class for columns with HTML controls for all list views --- .../views/discover/tmpl/default.php | 24 +++++++++---------- .../views/languages/tmpl/default.php | 10 ++++---- .../views/manage/tmpl/default.php | 24 +++++++++---------- .../views/update/tmpl/default.php | 18 +++++++------- .../views/updatesites/tmpl/default.php | 12 +++++----- .../views/installed/tmpl/default.php | 16 ++++++------- .../views/languages/tmpl/default.php | 14 +++++------ .../views/overrides/tmpl/default.php | 8 +++---- .../views/modules/tmpl/default.php | 4 ++-- .../views/plugins/tmpl/default.php | 4 ++-- .../views/styles/tmpl/default.php | 10 ++++---- .../views/templates/tmpl/default.php | 14 +++++------ 12 files changed, 79 insertions(+), 79 deletions(-) diff --git a/administrator/components/com_installer/views/discover/tmpl/default.php b/administrator/components/com_installer/views/discover/tmpl/default.php index d255a3fc37447..d052c3ccdb923 100644 --- a/administrator/components/com_installer/views/discover/tmpl/default.php +++ b/administrator/components/com_installer/views/discover/tmpl/default.php @@ -62,22 +62,22 @@ + + + + + + @@ -98,22 +98,22 @@ name; ?> - + type); ?> + version != '' ? $item->version : ' '; ?> + creationDate != '' ? $item->creationDate : ' '; ?> + folder != '' ? $item->folder : JText::_('COM_INSTALLER_TYPE_NONAPPLICABLE'); ?> + client; ?> + author != '' ? $item->author : ' '; ?> diff --git a/administrator/components/com_installer/views/languages/tmpl/default.php b/administrator/components/com_installer/views/languages/tmpl/default.php index d607c0f46a485..92f049f3e55d5 100644 --- a/administrator/components/com_installer/views/languages/tmpl/default.php +++ b/administrator/components/com_installer/views/languages/tmpl/default.php @@ -45,10 +45,10 @@ + + @@ -83,10 +83,10 @@ - + version; ?> + type)); ?> @@ -96,7 +96,7 @@ update_id; ?>
    diff --git a/administrator/components/com_installer/views/manage/tmpl/default.php b/administrator/components/com_installer/views/manage/tmpl/default.php index 32f6920ef7048..ac03ae97f7ff8 100644 --- a/administrator/components/com_installer/views/manage/tmpl/default.php +++ b/administrator/components/com_installer/views/manage/tmpl/default.php @@ -65,22 +65,22 @@ - + - + - + - + - + - + @@ -115,24 +115,24 @@ - + client; ?> - + type); ?> - + version != '' ? $item->version : ' '; ?> - + creationDate != '' ? $item->creationDate : ' '; ?> - + author != '' ? $item->author : ' '; ?> - + folder != '' ? $item->folder : JText::_('COM_INSTALLER_TYPE_NONAPPLICABLE'); ?> diff --git a/administrator/components/com_installer/views/update/tmpl/default.php b/administrator/components/com_installer/views/update/tmpl/default.php index 494795f9dc5ad..1a254b2d6e460 100644 --- a/administrator/components/com_installer/views/update/tmpl/default.php +++ b/administrator/components/com_installer/views/update/tmpl/default.php @@ -59,16 +59,16 @@ - + - + - + - + @@ -99,19 +99,19 @@ - + extension_id ? JText::_('COM_INSTALLER_MSG_UPDATE_UPDATE') : JText::_('COM_INSTALLER_NEW_INSTALL') ?> - + type) ?> - + version ?> - + folder != '' ? $item->folder : JText::_('COM_INSTALLER_TYPE_NONAPPLICABLE'); ?> - + detailsurl ?> diff --git a/administrator/components/com_installer/views/updatesites/tmpl/default.php b/administrator/components/com_installer/views/updatesites/tmpl/default.php index dc8351fb2aca2..b83f745b231f0 100644 --- a/administrator/components/com_installer/views/updatesites/tmpl/default.php +++ b/administrator/components/com_installer/views/updatesites/tmpl/default.php @@ -56,13 +56,13 @@ - + - + - + @@ -100,13 +100,13 @@ name; ?> - + client; ?> - + type); ?> - + folder != '' ? $item->folder : JText::_('COM_INSTALLER_TYPE_NONAPPLICABLE'); ?> diff --git a/administrator/components/com_languages/views/installed/tmpl/default.php b/administrator/components/com_languages/views/installed/tmpl/default.php index e75f9f4b32bad..1f502b55a5350 100644 --- a/administrator/components/com_languages/views/installed/tmpl/default.php +++ b/administrator/components/com_languages/views/installed/tmpl/default.php @@ -50,7 +50,7 @@ - + @@ -89,25 +89,25 @@ escape($row->name); ?> - + escape($row->language); ?> - + - + published, $i, 'installed.', !$row->published && $canChange);?> - + escape($row->version); ?> - + escape($row->creationDate); ?> - + escape($row->author); ?> - + escape($row->authorEmail)); ?> diff --git a/administrator/components/com_languages/views/languages/tmpl/default.php b/administrator/components/com_languages/views/languages/tmpl/default.php index 8020a5ae6eb71..57d6cf0575544 100644 --- a/administrator/components/com_languages/views/languages/tmpl/default.php +++ b/administrator/components/com_languages/views/languages/tmpl/default.php @@ -120,13 +120,13 @@ - + - + @@ -185,26 +185,26 @@ escape($item->title_native); ?> - + escape($item->lang_code); ?> - + escape($item->sef); ?> - + escape($item->image); ?> image . '.gif', $item->image, array('title' => $item->image), true); ?> escape($item->access_level); ?> - + home == '1') : ?> - + escape($item->lang_id); ?> diff --git a/administrator/components/com_languages/views/overrides/tmpl/default.php b/administrator/components/com_languages/views/overrides/tmpl/default.php index 27b7275ae8f05..df0ac07aac9be 100644 --- a/administrator/components/com_languages/views/overrides/tmpl/default.php +++ b/administrator/components/com_languages/views/overrides/tmpl/default.php @@ -57,10 +57,10 @@ - + - + @@ -90,10 +90,10 @@ escape($text); ?> - + - + diff --git a/administrator/components/com_modules/views/modules/tmpl/default.php b/administrator/components/com_modules/views/modules/tmpl/default.php index 963f14183ea87..860f945cb10b1 100644 --- a/administrator/components/com_modules/views/modules/tmpl/default.php +++ b/administrator/components/com_modules/views/modules/tmpl/default.php @@ -120,7 +120,7 @@ - + @@ -227,7 +227,7 @@ language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?> - + id; ?> diff --git a/administrator/components/com_plugins/views/plugins/tmpl/default.php b/administrator/components/com_plugins/views/plugins/tmpl/default.php index 25ea143c00e58..e38d8bd9fc636 100644 --- a/administrator/components/com_plugins/views/plugins/tmpl/default.php +++ b/administrator/components/com_plugins/views/plugins/tmpl/default.php @@ -114,7 +114,7 @@ - + @@ -179,7 +179,7 @@ escape($item->access_level); ?> - + extension_id;?> diff --git a/administrator/components/com_templates/views/styles/tmpl/default.php b/administrator/components/com_templates/views/styles/tmpl/default.php index 327974b2f41e8..05388e81b0a96 100644 --- a/administrator/components/com_templates/views/styles/tmpl/default.php +++ b/administrator/components/com_templates/views/styles/tmpl/default.php @@ -63,13 +63,13 @@ - + - + - + @@ -128,14 +128,14 @@ client_id == 0 ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); ?> - + - + id; ?> diff --git a/administrator/components/com_templates/views/templates/tmpl/default.php b/administrator/components/com_templates/views/templates/tmpl/default.php index 086ce527054a0..72ac0b6a23500 100644 --- a/administrator/components/com_templates/views/templates/tmpl/default.php +++ b/administrator/components/com_templates/views/templates/tmpl/default.php @@ -51,16 +51,16 @@ - + - + - + - + @@ -93,13 +93,13 @@

    - + client_id == 0 ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); ?> - + escape($item->xmldata->get('version')); ?> - + escape($item->xmldata->get('creationDate')); ?> From 151b61c7737eb09b54da50612aec65718bf9cbb4 Mon Sep 17 00:00:00 2001 From: Fedik Date: Thu, 9 Jul 2015 14:36:15 +0300 Subject: [PATCH 604/809] Fix some more undefined variables, for "strict mode" update description for Joomla.replaceTokens --- media/system/js/core-uncompressed.js | 10 +++++----- media/system/js/core.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/media/system/js/core-uncompressed.js b/media/system/js/core-uncompressed.js index 63295dceec165..e82f962ab64b0 100644 --- a/media/system/js/core-uncompressed.js +++ b/media/system/js/core-uncompressed.js @@ -71,13 +71,13 @@ Joomla.editors.instances = Joomla.editors.instances || {}; /** * Method to replace all request tokens on the page with a new one. - * Probably not used anywhere + * Used in Joomla Installation */ Joomla.replaceTokens = function( newToken ) { if (!/^[0-9A-F]{32}$/i.test(newToken)) { return; } var els = document.getElementsByTagName( 'input' ), - i, el; + i, el, n; for ( i = 0, n = els.length; i < n; i++ ) { el = els[i]; @@ -337,7 +337,7 @@ Joomla.editors.instances = Joomla.editors.instances || {}; window.changeDynaList = function ( listname, source, key, orig_key, orig_val ) { var list = document.adminForm[ listname ], hasSelection = key == orig_key, - i, x, item; + i, x, item, opt; // empty the list while ( list.firstChild ) list.removeChild( list.firstChild ); @@ -439,7 +439,7 @@ Joomla.editors.instances = Joomla.editors.instances || {}; cb.checked = true; f.boxchecked.value = 1; - submitform( task ); + window.submitform( task ); return false; }; @@ -468,7 +468,7 @@ Joomla.editors.instances = Joomla.editors.instances || {}; * There's a better way to do this now, can we try to kill it? */ window.saveorder = function ( n, task ) { - checkAll_button( n, task ); + window.checkAll_button( n, task ); }; /** diff --git a/media/system/js/core.js b/media/system/js/core.js index 7f4ef29b68ec0..b2383f6c3eb68 100644 --- a/media/system/js/core.js +++ b/media/system/js/core.js @@ -1 +1 @@ -Joomla=window.Joomla||{},Joomla.editors=Joomla.editors||{},Joomla.editors.instances=Joomla.editors.instances||{},function(e,t){"use strict";e.submitform=function(e,n,o){n||(n=t.getElementById("adminForm")),e&&(n.task.value=e),n.noValidate=!o;var i=t.createElement("input");i.style.display="none",i.type="submit",n.appendChild(i).click(),n.removeChild(i)},e.submitbutton=function(t){e.submitform(t)},e.JText={strings:{},_:function(e,t){return"undefined"!=typeof this.strings[e.toUpperCase()]?this.strings[e.toUpperCase()]:t},load:function(e){for(var t in e)e.hasOwnProperty(t)&&(this.strings[t.toUpperCase()]=e[t]);return this}},e.replaceTokens=function(e){if(/^[0-9A-F]{32}$/i.test(e)){var o,i,r=t.getElementsByTagName("input");for(o=0,n=r.length;on;n++)o=e.form.elements[n],o.type==e.type&&0===o.id.indexOf(t)&&(o.checked=e.checked,r+=o.checked?1:0);return e.form.boxchecked&&(e.form.boxchecked.value=r),!0},e.renderMessages=function(n){e.removeMessages();var o,i,r,a,l,s,c,d=t.getElementById("system-message-container");for(o in n)if(n.hasOwnProperty(o)){for(i=n[o],r=t.createElement("div"),r.className="alert alert-"+o,a=e.JText._(o),"undefined"!=typeof a&&(l=t.createElement("h4"),l.className="alert-heading",l.innerHTML=e.JText._(o),r.appendChild(l)),s=i.length-1;s>=0;s--)c=t.createElement("p"),c.innerHTML=i[s],r.appendChild(c);d.appendChild(r)}},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.isChecked=function(e,n){if("undefined"==typeof n&&(n=t.getElementById("adminForm")),n.boxchecked.value+=e?1:-1,n.elements["checkall-toggle"]){var o,i,r,a=!0;for(o=0,r=n.elements.length;r>o;o++)if(i=n.elements[o],"checkbox"==i.type&&"checkall-toggle"!=i.name&&!i.checked){a=!1;break}n.elements["checkall-toggle"].checked=a}},e.popupWindow=function(e,t,n,o,i){var r=(screen.width-n)/2,a=(screen.height-o)/2,l="height="+o+",width="+n+",top="+a+",left="+r+",scrollbars="+i+",resizable";window.open(e,t,l).window.focus()},e.tableOrdering=function(n,o,i,r){"undefined"==typeof r&&(r=t.getElementById("adminForm")),r.filter_order.value=n,r.filter_order_Dir.value=o,e.submitform(i,r)},window.writeDynaList=function(e,n,o,i,r){var a,l,s,c="",t.writeln(c)},window.changeDynaList=function(e,n,o,i,r){for(var a,l,s,c=t.adminForm[e],d=o==i;c.firstChild;)c.removeChild(c.firstChild);a=0;for(l in n)n.hasOwnProperty(l)&&(s=n[l],s[0]==o&&(opt=new Option,opt.value=s[1],opt.text=s[2],(d&&r==opt.value||!d&&0===a)&&(opt.selected=!0),c.options[a++]=opt));c.length=a},window.radioGetCheckedValue=function(e){if(!e)return"";var t,n=e.length;if(void 0===n)return e.checked?e.value:"";for(t=0;n>t;t++)if(e[t].checked)return e[t].value;return""},window.getSelectedValue=function(e,n){var o=t[e][n],i=o.selectedIndex;return null!==i&&i>-1?o.options[i].value:null},window.listItemTask=function(e,n){var o,i=t.adminForm,r=0,a=i[e];if(!a)return!1;for(;;){if(o=i["cb"+r],!o)break;o.checked=!1,r++}return a.checked=!0,i.boxchecked.value=1,submitform(n),!1},window.submitbutton=function(t){e.submitbutton(t)},window.submitform=function(t){e.submitform(t)},window.saveorder=function(e,t){checkAll_button(e,t)},window.checkAll_button=function(n,o){o=o?o:"saveorder";var i,r;for(i=0;n>=i;i++){if(r=t.adminForm["cb"+i],!r)return void alert("You cannot change the order of items, as an item in the list is `Checked Out`");r.checked=!0}e.submitform(o)}}(Joomla,document); +Joomla=window.Joomla||{},Joomla.editors=Joomla.editors||{},Joomla.editors.instances=Joomla.editors.instances||{},function(e,t){"use strict";e.submitform=function(e,n,r){n||(n=t.getElementById("adminForm")),e&&(n.task.value=e),n.noValidate=!r;var i=t.createElement("input");i.style.display="none",i.type="submit",n.appendChild(i).click(),n.removeChild(i)},e.submitbutton=function(t){e.submitform(t)},e.JText={strings:{},_:function(e,t){return typeof this.strings[e.toUpperCase()]!="undefined"?this.strings[e.toUpperCase()]:t},load:function(e){for(var t in e){if(!e.hasOwnProperty(t))continue;this.strings[t.toUpperCase()]=e[t]}return this}},e.replaceTokens=function(e){if(!/^[0-9A-F]{32}$/i.test(e))return;var n=t.getElementsByTagName("input"),r,i,s;for(r=0,s=n.length;r=0;f--)l=t.createElement("p"),l.innerHTML=s[f],o.appendChild(l);r.appendChild(o)}},e.removeMessages=function(){var e=t.getElementById("system-message-container");while(e.firstChild)e.removeChild(e.firstChild);e.style.display="none",e.offsetHeight,e.style.display=""},e.isChecked=function(e,n){typeof n=="undefined"&&(n=t.getElementById("adminForm")),n.boxchecked.value+=e?1:-1;if(!n.elements["checkall-toggle"])return;var r=!0,i,s,o;for(i=0,o=n.elements.length;i",u=r==i,a=0,f,l,c;for(l in n){if(!n.hasOwnProperty(l))continue;c=n[l];if(c[0]!=r)continue;f="";if(u&&s==c[1]||!u&&a===0)f='selected="selected"';o+='",a++}o+="",t.writeln(o)},window.changeDynaList=function(e,n,r,i,s){var o=t.adminForm[e],u=r==i,a,f,l,c;while(o.firstChild)o.removeChild(o.firstChild);a=0;for(f in n){if(!n.hasOwnProperty(f))continue;l=n[f];if(l[0]!=r)continue;c=new Option,c.value=l[1],c.text=l[2];if(u&&s==c.value||!u&&a===0)c.selected=!0;o.options[a++]=c}o.length=a},window.radioGetCheckedValue=function(e){if(!e)return"";var t=e.length,n;if(t===undefined)return e.checked?e.value:"";for(n=0;n-1?r.options[i].value:null},window.listItemTask=function(e,n){var r=t.adminForm,i=0,s,o=r[e];if(!o)return!1;for(;;){s=r["cb"+i];if(!s)break;s.checked=!1,i++}return o.checked=!0,r.boxchecked.value=1,window.submitform(n),!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(n,r){r=r?r:"saveorder";var i,s;for(i=0;i<=n;i++){s=t.adminForm["cb"+i];if(!s){alert("You cannot change the order of items, as an item in the list is `Checked Out`");return}s.checked=!0}e.submitform(r)}}(Joomla,document); \ No newline at end of file From ef9dbf150fe395914d29a6c491db756d9dcc4b01 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Mon, 22 Jun 2015 15:38:19 +0200 Subject: [PATCH 605/809] Remove CSS rules for specific icons Fixes #7242 --- administrator/templates/hathor/css/template.css | 8 -------- .../templates/isis/css/template-rtl.css | 16 ---------------- administrator/templates/isis/css/template.css | 8 -------- media/jui/css/bootstrap-rtl.css | 8 -------- media/jui/less/bootstrap-rtl.less | 8 -------- media/jui/less/icomoon.less | 9 --------- media/jui/less/sprites.less | 9 --------- templates/protostar/css/template.css | 8 -------- 8 files changed, 74 deletions(-) diff --git a/administrator/templates/hathor/css/template.css b/administrator/templates/hathor/css/template.css index a2fec511ed167..c900f7fe60c17 100644 --- a/administrator/templates/hathor/css/template.css +++ b/administrator/templates/hathor/css/template.css @@ -178,14 +178,6 @@ body.modal-open { margin-right: .25em; line-height: 14px; } -dd > span[class^="icon-"] + time, -dd > span[class*=" icon-"] + time { - margin-left: -0.25em; -} -dl.article-info dd.hits span[class^="icon-"], -dl.article-info dd.hits span[class*=" icon-"] { - margin-right: 0; -} [class^="icon-"]:before, [class*=" icon-"]:before { font-family: 'IcoMoon'; diff --git a/administrator/templates/isis/css/template-rtl.css b/administrator/templates/isis/css/template-rtl.css index 22eaca765c8fc..4333ca8b2d2bd 100644 --- a/administrator/templates/isis/css/template-rtl.css +++ b/administrator/templates/isis/css/template-rtl.css @@ -6265,14 +6265,6 @@ div.modal.fade.in { margin-right: .25em; line-height: 14px; } -dd > span[class^="icon-"] + time, -dd > span[class*=" icon-"] + time { - margin-left: -0.25em; -} -dl.article-info dd.hits span[class^="icon-"], -dl.article-info dd.hits span[class*=" icon-"] { - margin-right: 0; -} [class^="icon-"]:before, [class*=" icon-"]:before { font-family: 'IcoMoon'; @@ -8743,14 +8735,6 @@ input[type="url"] { [class*=" icon-"] { margin-left: .25em; } -dd > span[class^="icon-"] + time, -dd > span[class*=" icon-"] + time { - margin-left: -0.25em; -} -dl.article-info dd.hits span[class^="icon-"], -dl.article-info dd.hits span[class*=" icon-"] { - margin-right: 0; -} .navbar .admin-logo { float: right; padding: 7px 15px 0px 12px; diff --git a/administrator/templates/isis/css/template.css b/administrator/templates/isis/css/template.css index 31ba2003c21c6..49739320b22d8 100644 --- a/administrator/templates/isis/css/template.css +++ b/administrator/templates/isis/css/template.css @@ -6265,14 +6265,6 @@ div.modal.fade.in { margin-right: .25em; line-height: 14px; } -dd > span[class^="icon-"] + time, -dd > span[class*=" icon-"] + time { - margin-left: -0.25em; -} -dl.article-info dd.hits span[class^="icon-"], -dl.article-info dd.hits span[class*=" icon-"] { - margin-right: 0; -} [class^="icon-"]:before, [class*=" icon-"]:before { font-family: 'IcoMoon'; diff --git a/media/jui/css/bootstrap-rtl.css b/media/jui/css/bootstrap-rtl.css index c43524ac184d5..53eae1552d74b 100644 --- a/media/jui/css/bootstrap-rtl.css +++ b/media/jui/css/bootstrap-rtl.css @@ -617,11 +617,3 @@ input[type="url"] { [class*=" icon-"] { margin-left: .25em; } -dd > span[class^="icon-"] + time, -dd > span[class*=" icon-"] + time { - margin-left: -0.25em; -} -dl.article-info dd.hits span[class^="icon-"], -dl.article-info dd.hits span[class*=" icon-"] { - margin-right: 0; -} diff --git a/media/jui/less/bootstrap-rtl.less b/media/jui/less/bootstrap-rtl.less index 434f9990c6a0d..b3cd0cc0444e2 100644 --- a/media/jui/less/bootstrap-rtl.less +++ b/media/jui/less/bootstrap-rtl.less @@ -630,11 +630,3 @@ input[type="url"] { [class*=" icon-"] { margin-left: .25em; } -dd > span[class^="icon-"] + time, -dd > span[class*=" icon-"] + time{ - margin-left: -.25em; -} -dl.article-info dd.hits span[class^="icon-"], -dl.article-info dd.hits span[class*=" icon-"]{ - margin-right: 0; - } \ No newline at end of file diff --git a/media/jui/less/icomoon.less b/media/jui/less/icomoon.less index f4298c2454171..5aaf592489630 100644 --- a/media/jui/less/icomoon.less +++ b/media/jui/less/icomoon.less @@ -29,15 +29,6 @@ line-height: 14px; } -dd > span[class^="icon-"] + time, -dd > span[class*=" icon-"] + time{ - margin-left: -.25em; -} -dl.article-info dd.hits span[class^="icon-"], -dl.article-info dd.hits span[class*=" icon-"]{ - margin-right: 0; - } - /* Use the following CSS code if you want to have a class per icon */ [class^="icon-"]:before, [class*=" icon-"]:before { font-family: 'IcoMoon'; diff --git a/media/jui/less/sprites.less b/media/jui/less/sprites.less index f8ea6eb96a002..1687c67aaa83b 100644 --- a/media/jui/less/sprites.less +++ b/media/jui/less/sprites.less @@ -28,15 +28,6 @@ margin-top: 1px; } -dd > span[class^="icon-"] + time, -dd > span[class*=" icon-"] + time{ - margin-left: -.25em; -} -dl.article-info dd.hits span[class^="icon-"], -dl.article-info dd.hits span[class*=" icon-"]{ - margin-right: 0; - } - /* White icons with optional class, or on hover/focus/active states of certain elements */ .icon-white, .nav-pills > .active > a > [class^="icon-"], diff --git a/templates/protostar/css/template.css b/templates/protostar/css/template.css index 1768510ec095d..428bb13ae8f5d 100644 --- a/templates/protostar/css/template.css +++ b/templates/protostar/css/template.css @@ -6248,14 +6248,6 @@ div.modal.fade.in { margin-right: .25em; line-height: 14px; } -dd > span[class^="icon-"] + time, -dd > span[class*=" icon-"] + time { - margin-left: -0.25em; -} -dl.article-info dd.hits span[class^="icon-"], -dl.article-info dd.hits span[class*=" icon-"] { - margin-right: 0; -} [class^="icon-"]:before, [class*=" icon-"]:before { font-family: 'IcoMoon'; From 307df512ac554c434df39fde29a54d82addb052b Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Wed, 15 Apr 2015 08:19:44 +0200 Subject: [PATCH 606/809] [fix] getMessage doesn't exist, use getError instead. Fixes #6783 --- .../components/com_menus/controllers/menus.php | 2 +- administrator/components/com_menus/models/item.php | 13 ++++++++++++- administrator/language/en-GB/en-GB.ini | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_menus/controllers/menus.php b/administrator/components/com_menus/controllers/menus.php index 08bb44ec1336d..e75bce5d15d2d 100644 --- a/administrator/components/com_menus/controllers/menus.php +++ b/administrator/components/com_menus/controllers/menus.php @@ -115,7 +115,7 @@ public function rebuild() else { // Rebuild failed. - $this->setMessage(JText::sprintf('JTOOLBAR_REBUILD_FAILED', $model->getMessage())); + $this->setMessage(JText::sprintf('JTOOLBAR_REBUILD_FAILED', $model->getError()), 'error'); return false; } diff --git a/administrator/components/com_menus/models/item.php b/administrator/components/com_menus/models/item.php index 036e7a1a4abc1..d74b5ab829159 100644 --- a/administrator/components/com_menus/models/item.php +++ b/administrator/components/com_menus/models/item.php @@ -1090,7 +1090,18 @@ public function rebuild() $query = $db->getQuery(true); $table = $this->getTable(); - if (!$table->rebuild()) + try + { + $rebuildResult = $table->rebuild(); + } + catch (Exception $e) + { + $this->setError($e->getMessage()); + + return false; + } + + if (!$rebuildResult) { $this->setError($table->getError()); diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index 0132fd97d1d16..284cbc8a05b75 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -855,6 +855,8 @@ JTOOLBAR_OPTIONS="Options" JTOOLBAR_PUBLISH="Publish" JTOOLBAR_PURGE_CACHE="Clear Cache" JTOOLBAR_REBUILD="Rebuild" +JTOOLBAR_REBUILD_FAILED="Rebuild failed: %s" +JTOOLBAR_REBUILD_SUCCESS="Successfully rebuilt" JTOOLBAR_REFRESH_CACHE="Refresh Cache" JTOOLBAR_REMOVE="Remove" JTOOLBAR_SAVE="Save & Close" @@ -866,7 +868,6 @@ JTOOLBAR_UNPUBLISH="Unpublish" JTOOLBAR_UPLOAD="Upload" JTOOLBAR_TRASH="Trash" JTOOLBAR_UNTRASH="Untrash" -JTOOLBAR_REBUILD_SUCCESS="Successfully rebuilt" JTOOLBAR_VERSIONS="Versions" JWARNING_PUBLISH_MUST_SELECT="You must select at least one item to publish." From cc54b4cfff74de0173b9498a985ae726ac76fcf2 Mon Sep 17 00:00:00 2001 From: Peter van Westen Date: Fri, 10 Jul 2015 00:14:10 +0200 Subject: [PATCH 607/809] [CODE STYLE] Simple code style improvement Removed redundant else. --- libraries/joomla/language/text.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/joomla/language/text.php b/libraries/joomla/language/text.php index 7cc64f4a8c0cb..15b5870095111 100644 --- a/libraries/joomla/language/text.php +++ b/libraries/joomla/language/text.php @@ -99,10 +99,8 @@ public static function _($string, $jsSafe = false, $interpretBackSlashes = true, return $string; } - else - { - return $lang->_($string, $jsSafe, $interpretBackSlashes); - } + + return $lang->_($string, $jsSafe, $interpretBackSlashes); } /** From 73fb12b67914503e2d85c073248c372fd35b3c7f Mon Sep 17 00:00:00 2001 From: Peter van Westen Date: Fri, 10 Jul 2015 00:18:57 +0200 Subject: [PATCH 608/809] [CODE STYLE] Simple code style improvement Removed redundant if-else structure by rearranging ifs --- libraries/joomla/language/text.php | 79 +++++++++++++++--------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/libraries/joomla/language/text.php b/libraries/joomla/language/text.php index 7cc64f4a8c0cb..701f80ec77eef 100644 --- a/libraries/joomla/language/text.php +++ b/libraries/joomla/language/text.php @@ -169,60 +169,61 @@ public static function plural($string, $n) $args = func_get_args(); $count = count($args); - if ($count > 1) + if ($count < 1) { - // Try the key from the language plural potential suffixes - $found = false; - $suffixes = $lang->getPluralSuffixes((int) $n); - array_unshift($suffixes, (int) $n); + return ''; + } - foreach ($suffixes as $suffix) - { - $key = $string . '_' . $suffix; + if ($count == 1) + { + // Default to the normal sprintf handling. + $args[0] = $lang->_($string); - if ($lang->hasKey($key)) - { - $found = true; - break; - } - } + return call_user_func_array('sprintf', $args); + } + + // Try the key from the language plural potential suffixes + $found = false; + $suffixes = $lang->getPluralSuffixes((int) $n); + array_unshift($suffixes, (int) $n); - if (!$found) + foreach ($suffixes as $suffix) + { + $key = $string . '_' . $suffix; + + if ($lang->hasKey($key)) { - // Not found so revert to the original. - $key = $string; + $found = true; + break; } + } - if (is_array($args[$count - 1])) - { - $args[0] = $lang->_( - $key, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false, - array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true - ); + if (!$found) + { + // Not found so revert to the original. + $key = $string; + } - if (array_key_exists('script', $args[$count - 1]) && $args[$count - 1]['script']) - { - self::$strings[$key] = call_user_func_array('sprintf', $args); + if (is_array($args[$count - 1])) + { + $args[0] = $lang->_( + $key, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false, + array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true + ); - return $key; - } - } - else + if (array_key_exists('script', $args[$count - 1]) && $args[$count - 1]['script']) { - $args[0] = $lang->_($key); - } + self::$strings[$key] = call_user_func_array('sprintf', $args); - return call_user_func_array('sprintf', $args); + return $key; + } } - elseif ($count > 0) + else { - // Default to the normal sprintf handling. - $args[0] = $lang->_($string); - - return call_user_func_array('sprintf', $args); + $args[0] = $lang->_($key); } - return ''; + return call_user_func_array('sprintf', $args); } /** From 313a2b106c4f47b59399d68241afffb07567a1d1 Mon Sep 17 00:00:00 2001 From: Peter van Westen Date: Fri, 10 Jul 2015 00:21:02 +0200 Subject: [PATCH 609/809] [CODE STYLE] Simple code style improvement Removed redundant else. --- libraries/joomla/language/text.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/joomla/language/text.php b/libraries/joomla/language/text.php index 7cc64f4a8c0cb..7ff14eee577e5 100644 --- a/libraries/joomla/language/text.php +++ b/libraries/joomla/language/text.php @@ -128,12 +128,10 @@ public static function alt($string, $alt, $jsSafe = false, $interpretBackSlashes if ($lang->hasKey($string . '_' . $alt)) { - return self::_($string . '_' . $alt, $jsSafe, $interpretBackSlashes, $script); - } - else - { - return self::_($string, $jsSafe, $interpretBackSlashes, $script); + $string .= '_' . $alt; } + + return self::_($string, $jsSafe, $interpretBackSlashes, $script); } /** From e83a8aa264c4bc582d35e57429b2b4be90e57833 Mon Sep 17 00:00:00 2001 From: Peter van Westen Date: Fri, 10 Jul 2015 00:23:01 +0200 Subject: [PATCH 610/809] [CODE STYLE] Simple code style improvement Removed redundant nesting by using early return. --- libraries/joomla/language/text.php | 42 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/libraries/joomla/language/text.php b/libraries/joomla/language/text.php index 7cc64f4a8c0cb..6f42605f1fc6d 100644 --- a/libraries/joomla/language/text.php +++ b/libraries/joomla/language/text.php @@ -252,33 +252,33 @@ public static function sprintf($string) $args = func_get_args(); $count = count($args); - if ($count > 0) + if ($count < 1) { - if (is_array($args[$count - 1])) - { - $args[0] = $lang->_( - $string, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false, - array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true - ); - - if (array_key_exists('script', $args[$count - 1]) && $args[$count - 1]['script']) - { - self::$strings[$string] = call_user_func_array('sprintf', $args); + return ''; + } + + if (is_array($args[$count - 1])) + { + $args[0] = $lang->_( + $string, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false, + array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true + ); - return $string; - } - } - else + if (array_key_exists('script', $args[$count - 1]) && $args[$count - 1]['script']) { - $args[0] = $lang->_($string); - } + self::$strings[$string] = call_user_func_array('sprintf', $args); - $args[0] = preg_replace('/\[\[%([0-9]+):[^\]]*\]\]/', '%\1$s', $args[0]); - - return call_user_func_array('sprintf', $args); + return $string; + } + } + else + { + $args[0] = $lang->_($string); } - return ''; + $args[0] = preg_replace('/\[\[%([0-9]+):[^\]]*\]\]/', '%\1$s', $args[0]); + + return call_user_func_array('sprintf', $args); } /** From b627dff5b05854636de52b0e0f24b8e0249dae45 Mon Sep 17 00:00:00 2001 From: Peter van Westen Date: Fri, 10 Jul 2015 00:24:46 +0200 Subject: [PATCH 611/809] [CODE STYLE] Simple code style improvement Removed redundant nesting by using early return. --- libraries/joomla/language/text.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/libraries/joomla/language/text.php b/libraries/joomla/language/text.php index 7cc64f4a8c0cb..2d214bc8c40e4 100644 --- a/libraries/joomla/language/text.php +++ b/libraries/joomla/language/text.php @@ -298,24 +298,24 @@ public static function printf($string) $args = func_get_args(); $count = count($args); - if ($count > 0) + if ($count < 1) { - if (is_array($args[$count - 1])) - { - $args[0] = $lang->_( - $string, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false, - array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true - ); - } - else - { - $args[0] = $lang->_($string); - } - - return call_user_func_array('printf', $args); + return ''; + } + + if (is_array($args[$count - 1])) + { + $args[0] = $lang->_( + $string, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false, + array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true + ); + } + else + { + $args[0] = $lang->_($string); } - return ''; + return call_user_func_array('printf', $args); } /** From ed6efd927e00d0a1e5b19f085e348d5a7ab338c2 Mon Sep 17 00:00:00 2001 From: Peter van Westen Date: Fri, 10 Jul 2015 08:37:53 +0200 Subject: [PATCH 612/809] Removed redundant whitespace --- libraries/joomla/language/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/joomla/language/text.php b/libraries/joomla/language/text.php index 2d214bc8c40e4..9408cd193802e 100644 --- a/libraries/joomla/language/text.php +++ b/libraries/joomla/language/text.php @@ -302,7 +302,7 @@ public static function printf($string) { return ''; } - + if (is_array($args[$count - 1])) { $args[0] = $lang->_( From 188fa5267b60bd3e3ca65f9c509c57be2eabb033 Mon Sep 17 00:00:00 2001 From: Peter van Westen Date: Fri, 10 Jul 2015 08:39:51 +0200 Subject: [PATCH 613/809] Removed redundant whitespace --- libraries/joomla/language/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/joomla/language/text.php b/libraries/joomla/language/text.php index 6f42605f1fc6d..894a6e24df338 100644 --- a/libraries/joomla/language/text.php +++ b/libraries/joomla/language/text.php @@ -256,7 +256,7 @@ public static function sprintf($string) { return ''; } - + if (is_array($args[$count - 1])) { $args[0] = $lang->_( From 95c878f60e111357ac7aea3a280754573f8b682a Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Thu, 9 Jul 2015 17:44:37 +0200 Subject: [PATCH 614/809] Multilanguage: making Protostar logo link multilang aware Fixes #7394 --- templates/protostar/index.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/protostar/index.php b/templates/protostar/index.php index 6de3447b651dd..72ade3a91032c 100644 --- a/templates/protostar/index.php +++ b/templates/protostar/index.php @@ -76,6 +76,17 @@ { $logo = '' . $sitename . ''; } + +// Get the correct logo link in multilingual +if (JLanguageMultilang::isEnabled()) +{ + $homemenu = $app->getMenu()->getDefault(JFactory::getLanguage()->getTag()); + $logo_link = JRoute::_('index.php?Itemid=' . $homemenu->id); +} +else +{ + $logo_link = $this->baseurl; +} ?> @@ -136,7 +147,7 @@
    -
    - - -
    - lists['searchphrase']; ?> -
    -
    - - lists['ordering'];?> -
    -
    + params->get('search_phrases', 1)) : ?> +
    + + +
    + lists['searchphrase']; ?> +
    +
    + + lists['ordering'];?> +
    +
    + params->get('search_areas', 1)) : ?>
    - - searchareas['search'] as $val => $txt) : - $checked = is_array($this->searchareas['active']) && in_array($val, $this->searchareas['active']) ? 'checked="checked"' : ''; - ?> - - + + searchareas['search'] as $val => $txt) : + $checked = is_array($this->searchareas['active']) && in_array($val, $this->searchareas['active']) ? 'checked="checked"' : ''; + ?> + +
    diff --git a/language/en-GB/en-GB.com_search.ini b/language/en-GB/en-GB.com_search.ini index 2a8247c90da2d..23f3735486f19 100644 --- a/language/en-GB/en-GB.com_search.ini +++ b/language/en-GB/en-GB.com_search.ini @@ -10,6 +10,8 @@ COM_SEARCH_ERROR_ENTERKEYWORD="Enter a search keyword" COM_SEARCH_ERROR_IGNOREKEYWORD="One or more common words were ignored in the search." COM_SEARCH_ERROR_SEARCH_MESSAGE="Search term must be a minimum of %1$s characters and a maximum of %2$s characters." COM_SEARCH_EXACT_PHRASE="Exact Phrase" +COM_SEARCH_FIELD_SEARCH_PHRASES_DESC="Show the search options." +COM_SEARCH_FIELD_SEARCH_PHRASES_LABEL="Use Search Options" COM_SEARCH_FIELD_SEARCH_AREAS_DESC="Show the search areas checkboxes." COM_SEARCH_FIELD_SEARCH_AREAS_LABEL="Use Search Areas" COM_SEARCH_FOR="Search for:" From e8c12fb823a30140c522ec03e17697d5327fa7d5 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Fri, 10 Jul 2015 12:36:24 +0100 Subject: [PATCH 617/809] Logged in time --- administrator/modules/mod_logged/tmpl/default.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/modules/mod_logged/tmpl/default.php b/administrator/modules/mod_logged/tmpl/default.php index 2cff73b7ebbed..0ec33849ede00 100644 --- a/administrator/modules/mod_logged/tmpl/default.php +++ b/administrator/modules/mod_logged/tmpl/default.php @@ -41,7 +41,7 @@
    - time, JText::_('DATE_FORMAT_LC4')); ?> + time, JText::_('DATE_FORMAT_LC2')); ?>
    From ad266588e43931b83a2303898ee71866a4ca9698 Mon Sep 17 00:00:00 2001 From: Oleksandr Panasenko Date: Fri, 17 Apr 2015 11:10:27 +0300 Subject: [PATCH 618/809] Including core_params field in SELECT Fixes #6792 --- libraries/cms/helper/tags.php | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/cms/helper/tags.php b/libraries/cms/helper/tags.php index 8e0ab36e9eb1e..1177b2a7a63a1 100644 --- a/libraries/cms/helper/tags.php +++ b/libraries/cms/helper/tags.php @@ -544,6 +544,7 @@ public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = fals . ', ' . 'count(m.tag_id) AS match_count' . ', ' . 'MAX(m.tag_date) as tag_date' . ', ' . 'MAX(c.core_title) AS core_title' + . ', ' . 'MAX(c.core_params) AS core_params' ) ->select('MAX(c.core_alias) AS core_alias, MAX(c.core_body) AS core_body, MAX(c.core_state) AS core_state, MAX(c.core_access) AS core_access') ->select( From d9c8857cf705b49e00aa8c952c2b2ab9b8b32863 Mon Sep 17 00:00:00 2001 From: Octavian Cinciu Date: Mon, 23 Mar 2015 15:05:50 +0200 Subject: [PATCH 619/809] Allows long filenames for TAR archives Fixes #6554 --- libraries/joomla/archive/tar.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/libraries/joomla/archive/tar.php b/libraries/joomla/archive/tar.php index cb0bfe0513cb8..4479c61587c7d 100644 --- a/libraries/joomla/archive/tar.php +++ b/libraries/joomla/archive/tar.php @@ -33,7 +33,7 @@ class JArchiveTar implements JArchiveExtractable * @since 11.1 */ private $_types = array( - 0x0 => 'Unix file', + 0x0 => 'Unix file', 0x30 => 'File', 0x31 => 'Link', 0x32 => 'Symbolic link', @@ -183,6 +183,17 @@ protected function _getTarInfo(& $data) ); } + /** + * This variable has been set in the previous loop, + * meaning that the filename was present in the previous block + * to allow more than 100 characters - see below + */ + if (isset($longlinkfilename)) + { + $info['filename'] = $longlinkfilename; + unset($longlinkfilename); + } + if (!$info) { if (class_exists('JError')) @@ -211,7 +222,7 @@ protected function _getTarInfo(& $data) if (($info['typeflag'] == 0) || ($info['typeflag'] == 0x30) || ($info['typeflag'] == 0x35)) { - /* File or folder. */ + // File or folder. $file['data'] = $contents; $mode = hexdec(substr($info['mode'], 4, 3)); @@ -219,9 +230,18 @@ protected function _getTarInfo(& $data) (($mode & 0x100) ? 'x' : '-') . (($mode & 0x040) ? 'r' : '-') . (($mode & 0x020) ? 'w' : '-') . (($mode & 0x010) ? 'x' : '-') . (($mode & 0x004) ? 'r' : '-') . (($mode & 0x002) ? 'w' : '-') . (($mode & 0x001) ? 'x' : '-'); } + elseif (chr($info['typeflag']) == 'L' && $info['filename'] == '././@LongLink') + { + // GNU tar ././@LongLink support - the filename is actually in the contents, + // setting a variable here so we can test in the next loop + $longlinkfilename = $contents; + + // And the file contents are in the next block so we'll need to skip this + continue; + } else { - /* Some other type. */ + // Some other type. } $return_array[] = $file; From 9803210e8b018683a8ef6da49aa2bc99f84440b7 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Fri, 10 Jul 2015 16:45:20 +0100 Subject: [PATCH 620/809] Update en-GB.ini --- administrator/language/en-GB/en-GB.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index 7e3d43a1ee185..6a60c43c422de 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -514,7 +514,7 @@ JGLOBAL_SHOW_PRINT_ICON_DESC="Show or hide the Item Print button." JGLOBAL_SHOW_PRINT_ICON_LABEL="Show Print Icon" JGLOBAL_SHOW_PUBLISH_DATE_DESC="If set to Show, the date and time an Article was published will be displayed. This is a global setting but can be changed at the Category, Menu and Article levels." JGLOBAL_SHOW_PUBLISH_DATE_LABEL="Show Publish Date" -JGLOBAL_SHOW_READMORE_DESC="If set to Show, the Read more ... Link will show if Main text has been provided for the Article." +JGLOBAL_SHOW_READMORE_DESC="If set to Show, the Read more ...Link will show if Main text has been provided for the Article." JGLOBAL_SHOW_READMORE_LABEL="Show "Read More"" JGLOBAL_SHOW_READMORE_TITLE_DESC="If set to show the title of the Article will be shown on the Read More button." JGLOBAL_SHOW_READMORE_TITLE_LABEL="Show Title with Read More" From a61a2dcb4f8a4b203fe92bb964d2c406a2e3ec55 Mon Sep 17 00:00:00 2001 From: zero-24 Date: Sat, 11 Jul 2015 13:22:06 +0200 Subject: [PATCH 621/809] remove helper from the xml that is not there ;) --- administrator/modules/mod_submenu/mod_submenu.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/administrator/modules/mod_submenu/mod_submenu.xml b/administrator/modules/mod_submenu/mod_submenu.xml index 4d0f49fd65ca2..c8ab894eac07d 100644 --- a/administrator/modules/mod_submenu/mod_submenu.xml +++ b/administrator/modules/mod_submenu/mod_submenu.xml @@ -11,7 +11,6 @@ MOD_SUBMENU_XML_DESCRIPTION mod_submenu.php - helper.php tmpl From b95031b098a2fbe9978a73e8ab24e70a5c0d52e9 Mon Sep 17 00:00:00 2001 From: Peter van Westen Date: Sat, 11 Jul 2015 09:58:08 -0400 Subject: [PATCH 622/809] Non-language strings with commas being interpreted as sprintf format (Fix #6581) --- libraries/joomla/language/text.php | 102 +++++++++++++++++++---------- 1 file changed, 68 insertions(+), 34 deletions(-) diff --git a/libraries/joomla/language/text.php b/libraries/joomla/language/text.php index 3a4ba97ffc1cd..1da1ab47df9a3 100644 --- a/libraries/joomla/language/text.php +++ b/libraries/joomla/language/text.php @@ -17,7 +17,7 @@ class JText { /** - * javascript strings + * JavaScript strings * * @var array * @since 11.1 @@ -43,8 +43,6 @@ class JText */ public static function _($string, $jsSafe = false, $interpretBackSlashes = true, $script = false) { - $lang = JFactory::getLanguage(); - if (is_array($jsSafe)) { if (array_key_exists('interpretBackSlashes', $jsSafe)) @@ -57,50 +55,85 @@ public static function _($string, $jsSafe = false, $interpretBackSlashes = true, $script = (boolean) $jsSafe['script']; } - if (array_key_exists('jsSafe', $jsSafe)) - { - $jsSafe = (boolean) $jsSafe['jsSafe']; - } - else - { - $jsSafe = false; - } + $jsSafe = array_key_exists('jsSafe', $jsSafe) ? (boolean) $jsSafe['jsSafe'] : false; } - if (strpos($string, ',')) + if (self::passSprintf($string, $jsSafe, $interpretBackSlashes, $script)) { - $test = substr($string, strpos($string, ',')); + return $string; + } - if (strtoupper($test) === $test) - { - $strs = explode(',', $string); + $lang = JFactory::getLanguage(); - foreach ($strs as $i => $str) - { - $strs[$i] = $lang->_($str, $jsSafe, $interpretBackSlashes); + if ($script) + { + self::$strings[$string] = $lang->_($string, $jsSafe, $interpretBackSlashes); - if ($script) - { - self::$strings[$str] = $strs[$i]; - } - } + return $string; + } - $str = array_shift($strs); - $str = preg_replace('/\[\[%([0-9]+):[^\]]*\]\]/', '%\1$s', $str); - $str = vsprintf($str, $strs); + return $lang->_($string, $jsSafe, $interpretBackSlashes); + } - return $str; - } + /** + * Checks the string if it should be interpreted as sprintf and runs sprintf over it. + * + * @param string &$string The string to translate. + * @param mixed $jsSafe Boolean: Make the result javascript safe. + * @param boolean $interpretBackSlashes To interpret backslashes (\\=\, \n=carriage return, \t=tabulation) + * @param boolean $script To indicate that the string will be push in the javascript language store + * + * @return boolean Whether the string be interpreted as sprintf + * + * @since 3.4.4 + */ + private static function passSprintf(&$string, $jsSafe = false, $interpretBackSlashes = true, $script = false) + { + // Check if string contains a comma + if (strpos($string, ',') === false) + { + return false; } - if ($script) + $lang = JFactory::getLanguage(); + $string_parts = explode(',', $string); + + // Pass all parts through the JText translator + foreach ($string_parts as $i => $str) { - self::$strings[$string] = $lang->_($string, $jsSafe, $interpretBackSlashes); + $string_parts[$i] = $lang->_($str, $jsSafe, $interpretBackSlashes); + } - return $string; + $first_part = array_shift($string_parts); + + // Replace custom named placeholders with sprinftf style placeholders + $first_part = preg_replace('/\[\[%([0-9]+):[^\]]*\]\]/', '%\1$s', $first_part); + + // Check if string contains sprintf placeholders + if (!preg_match('/%([0-9]+\$)?s/', $first_part)) + { + return false; } - return $lang->_($string, $jsSafe, $interpretBackSlashes); + $final_string = vsprintf($first_part, $string_parts); + + // Return false if string hasn't changed + if ($first_part === $final_string) + { + return false; + } + + $string = $final_string; + + if ($script) + { + foreach ($string_parts as $i => $str) + { + self::$strings[$str] = $string_parts[$i]; + } + } + + return true; } /** @@ -273,6 +306,7 @@ public static function sprintf($string) $args[0] = $lang->_($string); } + // Replace custom named placeholders with sprintf style placeholders $args[0] = preg_replace('/\[\[%([0-9]+):[^\]]*\]\]/', '%\1$s', $args[0]); return call_user_func_array('sprintf', $args); @@ -351,7 +385,7 @@ public static function script($string = null, $jsSafe = false, $interpretBackSla // Normalize the key and translate the string. self::$strings[strtoupper($string)] = JFactory::getLanguage()->_($string, $jsSafe, $interpretBackSlashes); - // Load core.js dependence + // Load core.js dependency JHtml::_('behavior.core'); } From db7162730740243f5b5b31ace47d241d67441904 Mon Sep 17 00:00:00 2001 From: sovainfo Date: Sat, 11 Jul 2015 10:10:58 -0400 Subject: [PATCH 623/809] Make contentitem_tag_map uc_ItemnameTagid index consistent for all databases (Fix #6748) --- .../com_admin/sql/updates/postgresql/3.4.4-2015-07-11.sql | 1 + .../com_admin/sql/updates/sqlazure/3.4.4-2015-07-11.sql | 8 ++++++++ installation/sql/postgresql/joomla.sql | 2 +- installation/sql/sqlazure/joomla.sql | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 administrator/components/com_admin/sql/updates/postgresql/3.4.4-2015-07-11.sql create mode 100644 administrator/components/com_admin/sql/updates/sqlazure/3.4.4-2015-07-11.sql diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.4.4-2015-07-11.sql b/administrator/components/com_admin/sql/updates/postgresql/3.4.4-2015-07-11.sql new file mode 100644 index 0000000000000..fd15f849e41a5 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/3.4.4-2015-07-11.sql @@ -0,0 +1 @@ +ALTER TABLE "#__contentitem_tag_map" DROP CONSTRAINT "#__uc_ItemnameTagid", ADD CONSTRAINT "#__uc_ItemnameTagid" UNIQUE ("type_id", "content_item_id", "tag_id"); diff --git a/administrator/components/com_admin/sql/updates/sqlazure/3.4.4-2015-07-11.sql b/administrator/components/com_admin/sql/updates/sqlazure/3.4.4-2015-07-11.sql new file mode 100644 index 0000000000000..de9ce373a4d3f --- /dev/null +++ b/administrator/components/com_admin/sql/updates/sqlazure/3.4.4-2015-07-11.sql @@ -0,0 +1,8 @@ +ALTER TABLE [#__contentitem_tag_map] DROP CONSTRAINT [#__contentitem_tag_map$uc_ItemnameTagid]; + +ALTER TABLE [#__contentitem_tag_map] ADD CONSTRAINT [#__contentitem_tag_map$uc_ItemnameTagid] UNIQUE NONCLUSTERED +( + [type_id] ASC, + [content_item_id] ASC, + [tag_id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]; diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index 223ae0d4cbc11..ca199d90eb950 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -419,7 +419,7 @@ CREATE TABLE "#__contentitem_tag_map" ( "tag_id" integer NOT NULL, "tag_date" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, "type_id" integer NOT NULL, - CONSTRAINT "#__uc_ItemnameTagid" UNIQUE ("type_alias", "content_item_id", "tag_id") + CONSTRAINT "#__uc_ItemnameTagid" UNIQUE ("type_id", "content_item_id", "tag_id") ); CREATE INDEX "#__contentitem_tag_map_idx_tag_type" ON "#__contentitem_tag_map" ("tag_id", "type_id"); CREATE INDEX "#__contentitem_tag_map_idx_tag_name" ON "#__contentitem_tag_map" ("tag_id", "type_alias"); diff --git a/installation/sql/sqlazure/joomla.sql b/installation/sql/sqlazure/joomla.sql index 5bf801abbe324..7f99a9968d6db 100644 --- a/installation/sql/sqlazure/joomla.sql +++ b/installation/sql/sqlazure/joomla.sql @@ -667,7 +667,7 @@ CREATE TABLE [#__contentitem_tag_map]( [type_id] [int] NOT NULL, CONSTRAINT [#__contentitem_tag_map$uc_ItemnameTagid] UNIQUE NONCLUSTERED ( - [type_alias] ASC, + [type_id] ASC, [content_item_id] ASC, [tag_id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] From b8fc5b54a752e66f47ada7a46f062f09b4a7ded3 Mon Sep 17 00:00:00 2001 From: "Alex B." Date: Sat, 11 Jul 2015 18:37:54 +0300 Subject: [PATCH 624/809] code style mod_finder.xml --- modules/mod_finder/mod_finder.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mod_finder/mod_finder.xml b/modules/mod_finder/mod_finder.xml index 2bfc93fa0e5cf..7276e83a078c3 100644 --- a/modules/mod_finder/mod_finder.xml +++ b/modules/mod_finder/mod_finder.xml @@ -10,8 +10,8 @@ 3.0.0 MOD_FINDER_XML_DESCRIPTION - tmpl mod_finder.php + tmpl helper.php mod_finder.xml From 92470b74c4fbd5853d0cdaad146c2bbb68e77349 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Sun, 12 Jul 2015 08:03:13 +0200 Subject: [PATCH 625/809] Protostar: Missing slash in logo url for monolanguage sites (corrects #7394) --- templates/protostar/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/protostar/index.php b/templates/protostar/index.php index 72ade3a91032c..e438d3f59d791 100644 --- a/templates/protostar/index.php +++ b/templates/protostar/index.php @@ -85,7 +85,7 @@ } else { - $logo_link = $this->baseurl; + $logo_link = $this->baseurl . '/'; } ?> From 97537276831cb1fed8bd96729cedc52d284dba7f Mon Sep 17 00:00:00 2001 From: puneet0191 Date: Sun, 12 Jul 2015 12:54:27 +0200 Subject: [PATCH 626/809] Fixing Search Filter Changes in System Tests Now Filters appear when we click on Search Tool button, hence modified the function to work accordingly. Closes #7341 --- .../webdriver/Pages/System/AdminManagerPage.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/system/webdriver/Pages/System/AdminManagerPage.php b/tests/system/webdriver/Pages/System/AdminManagerPage.php index d7ad9ab73f68d..5809a536c538e 100644 --- a/tests/system/webdriver/Pages/System/AdminManagerPage.php +++ b/tests/system/webdriver/Pages/System/AdminManagerPage.php @@ -202,6 +202,18 @@ public function searchFor($search = false) public function setFilter($idOrLabel, $value) { + $el = $this->driver->findElements(By::xPath("//button")); + foreach($el as $element) + { + if ($element->getAttribute('data-original-title') == 'Filter the list items.') + { + $element->click(); + if($value == 'Select Status') + { + $element->click(); + } + } + } $filters = array_change_key_case($this->filters, CASE_LOWER); $idOrLabel = strtolower($idOrLabel); $filterId = ''; From a5fc821833513d2a699b5b5fe1bbf7729b9dd884 Mon Sep 17 00:00:00 2001 From: kshitij sharma Date: Sun, 12 Jul 2015 13:17:04 +0200 Subject: [PATCH 627/809] Solving Failures occuring in Webdriver system tests closes #6499 updating Page Objects --- tests/system/webdriver/Pages/Components/BannerEditPage.php | 2 +- tests/system/webdriver/Pages/Components/CategoryEditPage.php | 2 +- tests/system/webdriver/Pages/Components/ContactEditPage.php | 5 +++-- tests/system/webdriver/Pages/Components/NewsFeedEditPage.php | 4 ++-- tests/system/webdriver/tests/users/LevelManager0001Test.php | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/system/webdriver/Pages/Components/BannerEditPage.php b/tests/system/webdriver/Pages/Components/BannerEditPage.php index 9378350f7bcaa..1d87dfc99a33f 100644 --- a/tests/system/webdriver/Pages/Components/BannerEditPage.php +++ b/tests/system/webdriver/Pages/Components/BannerEditPage.php @@ -62,8 +62,8 @@ class BannerEditPage extends AdminEditPage array('label' => 'Alternative Text', 'id' => 'jform_params_alt', 'type' => 'input', 'tab' => 'details'), array('label' => 'Click URL', 'id' => 'jform_clickurl', 'type' => 'input', 'tab' => 'details'), array('label' => 'Description', 'id' => 'jform_description', 'type' => 'textarea', 'tab' => 'details'), - array('label' => 'Category', 'id' => 'jform_catid', 'type' => 'select', 'tab' => 'details'), array('label' => 'Status', 'id' => 'jform_state', 'type' => 'select', 'tab' => 'details'), + array('label' => 'Category', 'id' => 'jform_catid', 'type' => 'select', 'tab' => 'details'), array('label' => 'Pinned', 'id' => 'jform_sticky', 'type' => 'fieldset', 'tab' => 'details'), array('label' => 'Language', 'id' => 'jform_language', 'type' => 'select', 'tab' => 'details'), array('label' => 'Version Note', 'id' => 'jform_version_note', 'type' => 'input', 'tab' => 'details'), diff --git a/tests/system/webdriver/Pages/Components/CategoryEditPage.php b/tests/system/webdriver/Pages/Components/CategoryEditPage.php index cdc7cdcffa123..574df2ee6d43e 100644 --- a/tests/system/webdriver/Pages/Components/CategoryEditPage.php +++ b/tests/system/webdriver/Pages/Components/CategoryEditPage.php @@ -67,10 +67,10 @@ class CategoryEditPage extends AdminEditPage array('label' => 'Alias', 'id' => 'jform_alias', 'type' => 'input', 'tab' => 'header'), array('label' => 'Description', 'id' => 'jform_description', 'type' => 'textarea', 'tab' => 'general'), array('label' => 'Parent', 'id' => 'jform_parent_id', 'type' => 'select', 'tab' => 'general'), - array('label' => 'Tags', 'id' => 'jform_tags', 'type' => 'select', 'tab' => 'general'), array('label' => 'Status', 'id' => 'jform_published', 'type' => 'select', 'tab' => 'general'), array('label' => 'Access', 'id' => 'jform_access', 'type' => 'select', 'tab' => 'general'), array('label' => 'Language', 'id' => 'jform_language', 'type' => 'select', 'tab' => 'general'), + array('label' => 'Tags', 'id' => 'jform_tags', 'type' => 'select', 'tab' => 'general'), array('label' => 'Note', 'id' => 'jform_note', 'type' => 'input', 'tab' => 'general'), array('label' => 'Version Note', 'id' => 'jform_version_note', 'type' => 'input', 'tab' => 'general'), array('label' => 'Created Date', 'id' => 'jform_created_time', 'type' => 'input', 'tab' => 'publishing'), diff --git a/tests/system/webdriver/Pages/Components/ContactEditPage.php b/tests/system/webdriver/Pages/Components/ContactEditPage.php index b2ee224b5e36b..c78839b425d23 100644 --- a/tests/system/webdriver/Pages/Components/ContactEditPage.php +++ b/tests/system/webdriver/Pages/Components/ContactEditPage.php @@ -73,12 +73,12 @@ class ContactEditPage extends AdminEditPage array('label' => 'First Sort Field', 'id' => 'jform_sortname1', 'type' => 'input', 'tab' => 'details'), array('label' => 'Second Sort Field', 'id' => 'jform_sortname2', 'type' => 'input', 'tab' => 'details'), array('label' => 'Third Sort Field', 'id' => 'jform_sortname3', 'type' => 'input', 'tab' => 'details'), - array('label' => 'Category', 'id' => 'jform_catid', 'type' => 'select', 'tab' => 'details'), - array('label' => 'Tags', 'id' => 'jform_tags', 'type' => 'select', 'tab' => 'details'), array('label' => 'Status', 'id' => 'jform_published', 'type' => 'select', 'tab' => 'details'), + array('label' => 'Category', 'id' => 'jform_catid', 'type' => 'select', 'tab' => 'details'), array('label' => 'Featured', 'id' => 'jform_featured', 'type' => 'fieldset', 'tab' => 'details'), array('label' => 'Access', 'id' => 'jform_access', 'type' => 'select', 'tab' => 'details'), array('label' => 'Language', 'id' => 'jform_language', 'type' => 'select', 'tab' => 'details'), + array('label' => 'Tags', 'id' => 'jform_tags', 'type' => 'select', 'tab' => 'details'), array('label' => 'Version Note', 'id' => 'jform_version_note', 'type' => 'input', 'tab' => 'details'), array('label' => 'Miscellaneous Information', 'id' => 'jform_misc', 'type' => 'textarea', 'tab' => 'misc'), array('label' => 'Start Publishing', 'id' => 'jform_publish_up', 'type' => 'input', 'tab' => 'publishing'), @@ -115,6 +115,7 @@ class ContactEditPage extends AdminEditPage array('label' => 'Image', 'id' => 'jform_params_show_image', 'type' => 'select', 'tab' => 'attrib-display'), array('label' => 'vCard', 'id' => 'jform_params_allow_vcard', 'type' => 'select', 'tab' => 'attrib-display'), array('label' => 'Show User Articles', 'id' => 'jform_params_show_articles', 'type' => 'select', 'tab' => 'attrib-display'), + array('label' => '# Articles to List', 'id' => 'jform_params_articles_display_num', 'type' => 'select', 'tab' => 'attrib-display'), array('label' => 'Show Profile', 'id' => 'jform_params_show_profile', 'type' => 'select', 'tab' => 'attrib-display'), array('label' => 'Show Links', 'id' => 'jform_params_show_links', 'type' => 'select', 'tab' => 'attrib-display'), array('label' => 'Link A Label', 'id' => 'jform_params_linka_name', 'type' => 'input', 'tab' => 'attrib-display'), diff --git a/tests/system/webdriver/Pages/Components/NewsFeedEditPage.php b/tests/system/webdriver/Pages/Components/NewsFeedEditPage.php index d967af6a6437b..46be77bfd7806 100644 --- a/tests/system/webdriver/Pages/Components/NewsFeedEditPage.php +++ b/tests/system/webdriver/Pages/Components/NewsFeedEditPage.php @@ -59,11 +59,11 @@ class NewsFeedEditPage extends AdminEditPage array('label' => 'Alias', 'id' => 'jform_alias', 'type' => 'input', 'tab' => 'header'), array('label' => 'Link', 'id' => 'jform_link', 'type' => 'input', 'tab' => 'details'), array('label' => 'Description', 'id' => 'jform_description', 'type' => 'textarea', 'tab' => 'details'), - array('label' => 'Category', 'id' => 'jform_catid', 'type' => 'select', 'tab' => 'details'), - array('label' => 'Tags', 'id' => 'jform_tags', 'type' => 'select', 'tab' => 'details'), array('label' => 'Status', 'id' => 'jform_published', 'type' => 'select', 'tab' => 'details'), + array('label' => 'Category', 'id' => 'jform_catid', 'type' => 'select', 'tab' => 'details'), array('label' => 'Access', 'id' => 'jform_access', 'type' => 'select', 'tab' => 'details'), array('label' => 'Language', 'id' => 'jform_language', 'type' => 'select', 'tab' => 'details'), + array('label' => 'Tags', 'id' => 'jform_tags', 'type' => 'select', 'tab' => 'details'), array('label' => 'Version Note', 'id' => 'jform_version_note', 'type' => 'input', 'tab' => 'details'), array('label' => 'First Image', 'id' => 'jform_images_image_first', 'type' => 'input', 'tab' => 'images'), array('label' => 'Image Float', 'id' => 'jform_images_float_first', 'type' => 'select', 'tab' => 'images'), diff --git a/tests/system/webdriver/tests/users/LevelManager0001Test.php b/tests/system/webdriver/tests/users/LevelManager0001Test.php index 5331533d69e82..dfb6f69096190 100644 --- a/tests/system/webdriver/tests/users/LevelManager0001Test.php +++ b/tests/system/webdriver/tests/users/LevelManager0001Test.php @@ -107,7 +107,7 @@ public function add_WithFieldDefaults_Added() $this->levelManagerPage->addLevel(); $message = $this->levelManagerPage->getAlertMessage(); $this->assertTrue(strpos($message, 'Level successfully saved') >= 0, 'Level save should return success'); - $this->assertEquals(7, $this->levelManagerPage->getRowNumber('Test Level'), 'Test level should be in row 6'); + $this->assertGreaterThanOrEqual(1, $this->levelManagerPage->getRowNumber('Test Level'), 'Test level should be present'); $this->levelManagerPage->delete('Test Level'); $this->assertFalse($this->levelManagerPage->getRowNumber('Test Level'), 'Test level should not be present'); } From 2cc5a3482d21cce7102c07f5f65cda7a2ef1c8b2 Mon Sep 17 00:00:00 2001 From: Fedik Date: Sun, 12 Jul 2015 15:44:06 +0300 Subject: [PATCH 628/809] Strip tags for administrator page title --- administrator/includes/toolbar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/includes/toolbar.php b/administrator/includes/toolbar.php index 17fafd999a08f..4fbae7008dd62 100644 --- a/administrator/includes/toolbar.php +++ b/administrator/includes/toolbar.php @@ -37,7 +37,7 @@ public static function title($title, $icon = 'generic.png') $app = JFactory::getApplication(); $app->JComponentTitle = $html; - JFactory::getDocument()->setTitle($app->get('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - ' . $title); + JFactory::getDocument()->setTitle($app->get('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - ' . strip_tags($title)); } /** From ac3bd8ccb953ffa7f912b8fbf3b6f81352e0edd3 Mon Sep 17 00:00:00 2001 From: Jisse Reitsma Date: Fri, 10 Apr 2015 16:10:06 +0200 Subject: [PATCH 629/809] URL-encode at-sign in HTTP Basic Auth credentials Fixes #6734 --- libraries/joomla/github/object.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/joomla/github/object.php b/libraries/joomla/github/object.php index fd5a025853ad5..219c7a201442a 100644 --- a/libraries/joomla/github/object.php +++ b/libraries/joomla/github/object.php @@ -72,12 +72,16 @@ protected function fetchUrl($path, $page = 0, $limit = 0) // Use basic authentication if ($this->options->get('api.username', false)) { - $uri->setUser($this->options->get('api.username')); + $username = $this->options->get('api.username'); + $username = str_replace('@', '%40', $username); + $uri->setUser($username); } if ($this->options->get('api.password', false)) { - $uri->setPass($this->options->get('api.password')); + $password = $this->options->get('api.password'); + $password = str_replace('@', '%40', $password); + $uri->setPass($password); } } From 0e8778ad4336bbf326bd799b34b5c35308822250 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Mon, 13 Jul 2015 01:14:27 +0200 Subject: [PATCH 630/809] Fix JHtml::bootstrap unit tests on windows --- .../libraries/cms/html/JHtmlBootstrapTest.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlBootstrapTest.php b/tests/unit/suites/libraries/cms/html/JHtmlBootstrapTest.php index b8f9b1d7630be..7d974e029ab73 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlBootstrapTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlBootstrapTest.php @@ -91,7 +91,7 @@ public function testAlert() $this->assertEquals( $document->_script['text/javascript'], - "(function($){\n\t\t\t\t$('.alert').alert();\n\t\t\t\t})(jQuery);", + "(function($){" . PHP_EOL . "\t\t\t\t$('.alert').alert();" . PHP_EOL . "\t\t\t\t})(jQuery);", 'Verify that the alert script is initialised' ); } @@ -119,7 +119,7 @@ public function testButton() $this->assertEquals( $document->_script['text/javascript'], - "(function($){\n\t\t\t\t$('.button').button();\n\t\t\t\t})(jQuery);", + "(function($){" . PHP_EOL . "\t\t\t\t$('.button').button();" . PHP_EOL . "\t\t\t\t})(jQuery);", 'Verify that the button script is initialised' ); } @@ -147,7 +147,7 @@ public function testDropdown() $this->assertEquals( $document->_script['text/javascript'], - "(function($){\n\t\t\t\t$('.dropdown-toggle').dropdown();\n\t\t\t\t})(jQuery);", + "(function($){" . PHP_EOL . "\t\t\t\t$('.dropdown-toggle').dropdown();" . PHP_EOL . "\t\t\t\t})(jQuery);", 'Verify that the dropdown script is initialised' ); } @@ -219,9 +219,9 @@ public function testEndSlide() */ public function testEndTabSet() { - $this->assertThat( + $this->assertEquals( JHtml::_('bootstrap.endTabSet'), - $this->equalTo("\n
    ") + PHP_EOL . "
    " ); } @@ -234,9 +234,9 @@ public function testEndTabSet() */ public function testEndTab() { - $this->assertThat( + $this->assertEquals( JHtml::_('bootstrap.endTab'), - $this->equalTo("\n
    ") + PHP_EOL . "
    " ); } @@ -249,9 +249,9 @@ public function testEndTab() */ public function testEndPane() { - $this->assertThat( + $this->assertEquals( JHtml::_('bootstrap.endTabSet'), - $this->equalTo("\n") + PHP_EOL . "" ); } @@ -264,9 +264,9 @@ public function testEndPane() */ public function testEndPanel() { - $this->assertThat( + $this->assertEquals( JHtml::_('bootstrap.endTab'), - $this->equalTo("\n") + PHP_EOL . "" ); } From d83399c75181fbd6fbf3e3d24315b692fb913282 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Mon, 13 Jul 2015 01:29:21 +0200 Subject: [PATCH 631/809] Fix JGithub tests on windows --- tests/unit/suites/libraries/joomla/github/JGithubGistsTest.php | 2 +- .../suites/libraries/joomla/github/JGithubPackageGistsTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/suites/libraries/joomla/github/JGithubGistsTest.php b/tests/unit/suites/libraries/joomla/github/JGithubGistsTest.php index 741826cecf86c..371015ee5a24a 100644 --- a/tests/unit/suites/libraries/joomla/github/JGithubGistsTest.php +++ b/tests/unit/suites/libraries/joomla/github/JGithubGistsTest.php @@ -126,7 +126,7 @@ public function testCreateGistFromFile() $data = json_encode( array( 'files' => array( - 'gittest' => array('content' => 'GistContent' . "\n") + 'gittest' => array('content' => 'GistContent' . PHP_EOL) ), 'public' => true, 'description' => 'This is a gist' diff --git a/tests/unit/suites/libraries/joomla/github/JGithubPackageGistsTest.php b/tests/unit/suites/libraries/joomla/github/JGithubPackageGistsTest.php index b05aaa8b18a7e..939ba521cd171 100644 --- a/tests/unit/suites/libraries/joomla/github/JGithubPackageGistsTest.php +++ b/tests/unit/suites/libraries/joomla/github/JGithubPackageGistsTest.php @@ -123,7 +123,7 @@ public function testCreateGistFromFile() $data = json_encode( array( 'files' => array( - 'gittest' => array('content' => 'GistContent' . "\n") + 'gittest' => array('content' => 'GistContent' . PHP_EOL) ), 'public' => true, 'description' => 'This is a gist' From 37031f1b5852186a0b688da7eb4aeaf0bf7a0ebd Mon Sep 17 00:00:00 2001 From: George Wilson Date: Mon, 13 Jul 2015 01:55:37 +0200 Subject: [PATCH 632/809] Fix JToolbar unit tests in windows --- .../libraries/cms/toolbar/JToolbarButtonTest.php | 10 +++++----- .../cms/toolbar/button/JToolbarButtonConfirmTest.php | 6 +++--- .../cms/toolbar/button/JToolbarButtonHelpTest.php | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/unit/suites/libraries/cms/toolbar/JToolbarButtonTest.php b/tests/unit/suites/libraries/cms/toolbar/JToolbarButtonTest.php index cb08af99aa123..cbf665a39142e 100644 --- a/tests/unit/suites/libraries/cms/toolbar/JToolbarButtonTest.php +++ b/tests/unit/suites/libraries/cms/toolbar/JToolbarButtonTest.php @@ -121,11 +121,11 @@ public function testRender() { $type = array('Standard', 'test'); - $expected = "
    \n" - . "\t\n" - . "
    \n"; + $expected = "
    " . PHP_EOL + . "\t" . PHP_EOL + . "
    " . PHP_EOL; $this->assertEquals( $expected, diff --git a/tests/unit/suites/libraries/cms/toolbar/button/JToolbarButtonConfirmTest.php b/tests/unit/suites/libraries/cms/toolbar/button/JToolbarButtonConfirmTest.php index 9365618766382..d63e85e61da80 100644 --- a/tests/unit/suites/libraries/cms/toolbar/button/JToolbarButtonConfirmTest.php +++ b/tests/unit/suites/libraries/cms/toolbar/button/JToolbarButtonConfirmTest.php @@ -89,9 +89,9 @@ protected function tearDown() */ public function testFetchButton() { - $html = "\n"; + $html = "" . PHP_EOL; $this->assertEquals( $this->object->fetchButton('Confirm', 'Confirm action?', 'confirm-test', 'Confirm?', 'article.save'), diff --git a/tests/unit/suites/libraries/cms/toolbar/button/JToolbarButtonHelpTest.php b/tests/unit/suites/libraries/cms/toolbar/button/JToolbarButtonHelpTest.php index 8ac0411de5157..5e970382b82ce 100644 --- a/tests/unit/suites/libraries/cms/toolbar/button/JToolbarButtonHelpTest.php +++ b/tests/unit/suites/libraries/cms/toolbar/button/JToolbarButtonHelpTest.php @@ -92,9 +92,9 @@ protected function tearDown() */ public function testFetchButton() { - $html = "\n"; + $html = "" . PHP_EOL; $this->assertEquals( $this->object->fetchButton('Help', 'JHELP_CONTENT_ARTICLE_MANAGER'), From 9a92f26696efd2aa133bfda408aa04605bbb6668 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Mon, 13 Jul 2015 07:08:53 +0200 Subject: [PATCH 633/809] MSSQL - fix typo error on getTableColumns() #### Steps to reproduce the issue install current staging on MSSQL #### Expected result The installation goes well #### Actual result the installation process don't end #### System information (as much as possible) Windows 2008 R2 10.50.4033 Apache 2.4.7 PHP 5.5.9 Joomla! 3.4.4-dev #### Additional comments this error was introduced by this commit https://github.com/joomla/joomla-cms/commit/2f76e54df9f76b2cfd2cae71edc0184b75a1a149 #6314 there was a typo on function getTableColumns() accordingly to query ``` 'SELECT column_name as Field, data_type as Type, is_nullable as \'Null\', column_default as \'Default\'' . ' FROM information_schema.columns WHERE table_name = ' . $this->quote($table_temp) ``` should be ```$field->Type``` instead of ```$field->type``` sorry for this :innocent: --- libraries/joomla/database/driver/sqlsrv.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/joomla/database/driver/sqlsrv.php b/libraries/joomla/database/driver/sqlsrv.php index 6cc04bb883cbd..344e52f3883a8 100644 --- a/libraries/joomla/database/driver/sqlsrv.php +++ b/libraries/joomla/database/driver/sqlsrv.php @@ -362,7 +362,7 @@ public function getTableColumns($table, $typeOnly = true) { foreach ($fields as $field) { - if (stristr(strtolower($field->type), "nvarchar")) + if (stristr(strtolower($field->Type), "nvarchar")) { $field->Default = ""; } From b0ebd1056c8ec38b0333b1b838cd047c96704a09 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Mon, 13 Jul 2015 15:43:47 +0100 Subject: [PATCH 634/809] replace click --- .../language/en-GB/en-GB.com_banners.ini | 4 ++-- .../language/en-GB/en-GB.com_cache.ini | 4 ++-- .../language/en-GB/en-GB.com_categories.ini | 4 ++-- .../language/en-GB/en-GB.com_checkin.ini | 2 +- .../language/en-GB/en-GB.com_config.ini | 2 +- .../language/en-GB/en-GB.com_contact.ini | 2 +- .../language/en-GB/en-GB.com_content.ini | 6 +++--- .../en-GB/en-GB.com_contenthistory.ini | 18 +++++++++--------- .../language/en-GB/en-GB.com_cpanel.ini | 6 +++--- .../language/en-GB/en-GB.com_finder.ini | 4 ++-- .../language/en-GB/en-GB.com_installer.ini | 12 ++++++------ .../language/en-GB/en-GB.com_languages.ini | 6 +++--- .../language/en-GB/en-GB.com_media.ini | 2 +- .../language/en-GB/en-GB.com_menus.ini | 4 ++-- .../language/en-GB/en-GB.com_messages.ini | 2 +- .../language/en-GB/en-GB.com_modules.ini | 2 +- .../language/en-GB/en-GB.com_newsfeeds.ini | 2 +- .../language/en-GB/en-GB.com_plugins.ini | 2 +- .../language/en-GB/en-GB.com_postinstall.ini | 2 +- .../language/en-GB/en-GB.com_redirect.ini | 2 +- .../language/en-GB/en-GB.com_tags.ini | 2 +- .../language/en-GB/en-GB.com_templates.ini | 6 +++--- .../language/en-GB/en-GB.com_users.ini | 2 +- .../language/en-GB/en-GB.com_weblinks.ini | 4 ++-- administrator/language/en-GB/en-GB.ini | 8 ++++---- .../language/en-GB/en-GB.lib_joomla.ini | 16 ++++++++-------- .../en-GB/en-GB.plg_editors_tinymce.ini | 2 +- .../en-GB/en-GB.plg_twofactorauth_totp.ini | 4 ++-- .../en-GB/en-GB.plg_twofactorauth_yubikey.ini | 4 ++-- .../language/en-GB/en-GB.plg_user_joomla.ini | 2 +- installation/language/en-GB/en-GB.ini | 8 ++++---- language/en-GB/en-GB.com_users.ini | 18 +++++++++--------- language/en-GB/en-GB.ini | 2 +- language/en-GB/en-GB.lib_joomla.ini | 16 ++++++++-------- language/en-GB/en-GB.mod_banners.ini | 2 +- language/en-GB/en-GB.mod_random_image.ini | 2 +- language/en-GB/en-GB.mod_weblinks.ini | 2 +- language/en-GB/en-GB.tpl_beez3.ini | 4 ++-- .../beez3/language/en-GB/en-GB.tpl_beez3.ini | 4 ++-- 39 files changed, 98 insertions(+), 98 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_banners.ini b/administrator/language/en-GB/en-GB.com_banners.ini index 091b45469c383..1fe9228bcba07 100644 --- a/administrator/language/en-GB/en-GB.com_banners.ini +++ b/administrator/language/en-GB/en-GB.com_banners.ini @@ -66,7 +66,7 @@ COM_BANNERS_FIELD_BANNEROWNPREFIX_LABEL="Use Own Prefix" COM_BANNERS_FIELD_BASENAME_DESC="File name pattern which can contain
    __SITE__ for the site name
    __CATID__ for the category ID
    __CATNAME__ for the category name
    __CLIENTID__ for the client ID
    __CLIENTNAME__ for the client name
    __TYPE__ for the type
    __TYPENAME__ for the type name
    __BEGIN__ for the begin date
    __END__ for the end date." COM_BANNERS_FIELD_BASENAME_LABEL="File Name" COM_BANNERS_FIELD_CATEGORY_DESC="Choose a category for this banner." -COM_BANNERS_FIELD_CLICKS_DESC="Displays the number of clicks on the banner. Click on reset if desired." +COM_BANNERS_FIELD_CLICKS_DESC="Displays the number of clicks on the banner. Select reset if desired." COM_BANNERS_FIELD_CLICKS_LABEL="Total Clicks" COM_BANNERS_FIELD_CLICKURL_DESC="The URL used when the banner is clicked on." COM_BANNERS_FIELD_CLICKURL_LABEL="Click URL" @@ -218,5 +218,5 @@ COM_BANNERS_TYPE1="Impressions" COM_BANNERS_TYPE2="Clicks" COM_BANNERS_UNLIMITED="Unlimited" COM_BANNERS_XML_DESCRIPTION="This component manages banners and banner clients." -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_cache.ini b/administrator/language/en-GB/en-GB.com_cache.ini index ed2558e971b15..843324a3d0c5c 100644 --- a/administrator/language/en-GB/en-GB.com_cache.ini +++ b/administrator/language/en-GB/en-GB.com_cache.ini @@ -17,9 +17,9 @@ COM_CACHE_NUMBER_OF_FILES="Number of Files" COM_CACHE_PURGE_CACHE_ADMIN="Clear Cache Admin" COM_CACHE_PURGE_EXPIRED="Clear Expired Cache" COM_CACHE_PURGE_EXPIRED_ITEMS="Clear expired items" -COM_CACHE_PURGE_INSTRUCTIONS="Click on the Clear Expired Cache icon in the toolbar to delete all expired cache files. Note: Cache files that are still current will not be deleted." +COM_CACHE_PURGE_INSTRUCTIONS="Select the Clear Expired Cache icon in the toolbar to delete all expired cache files. Note: Cache files that are still current will not be deleted." COM_CACHE_RESOURCE_INTENSIVE_WARNING="WARNING: This can be resource intensive on sites with a large number of items!" COM_CACHE_SIZE="Size" COM_CACHE_SELECT_CLIENT="- Select Location -" COM_CACHE_XML_DESCRIPTION="Component for cache management." -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_categories.ini b/administrator/language/en-GB/en-GB.com_categories.ini index 840b76027aaf3..d146e3fba9a6c 100644 --- a/administrator/language/en-GB/en-GB.com_categories.ini +++ b/administrator/language/en-GB/en-GB.com_categories.ini @@ -73,5 +73,5 @@ COM_CATEGORIES_TIP_ASSOCIATION="Associated categories" COM_CATEGORIES_TIP_ASSOCIATED_LANGUAGE="%s %s" COM_CATEGORIES_XML_DESCRIPTION="This component manages categories." JGLOBAL_NO_ITEM_SELECTED="No categories selected." -JLIB_HTML_ACCESS_SUMMARY_DESC="Shown below is an overview of the permission settings for this category. Click the tabs above to customise these settings by action." -JLIB_RULES_SETTING_NOTES_ITEM="1. If you change the setting, it will apply to this and all child categories. Note that:
    Inherited means that the permissions from the parent category will be used if there is a parent category or those from the component if there is no parent category.
    Denied means that no matter what the parent category setting is, the group being edited can't take this action within this category.
    Allowed means that the group being edited will be able to take this action within this category (but if this is in conflict with the parent category setting or the component setting it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_HTML_ACCESS_SUMMARY_DESC="Shown below is an overview of the permission settings for this category. Select the tabs above to customise these settings by action." +JLIB_RULES_SETTING_NOTES_ITEM="1. If you change the setting, it will apply to this and all child categories. Note that:
    Inherited means that the permissions from the parent category will be used if there is a parent category or those from the component if there is no parent category.
    Denied means that no matter what the parent category setting is, the group being edited can't take this action within this category.
    Allowed means that the group being edited will be able to take this action within this category (but if this is in conflict with the parent category setting or the component setting it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_checkin.ini b/administrator/language/en-GB/en-GB.com_checkin.ini index ccbe91fb36d98..17465a569bd6f 100644 --- a/administrator/language/en-GB/en-GB.com_checkin.ini +++ b/administrator/language/en-GB/en-GB.com_checkin.ini @@ -14,4 +14,4 @@ COM_CHECKIN_N_ITEMS_CHECKED_IN_1="1 item checked in." COM_CHECKIN_N_ITEMS_CHECKED_IN_MORE="%s items checked in." COM_CHECKIN_TABLE="%s table" COM_CHECKIN_XML_DESCRIPTION="Check-in Component." -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_config.ini b/administrator/language/en-GB/en-GB.com_config.ini index 01880aa1a4c2e..2610df0b715bb 100644 --- a/administrator/language/en-GB/en-GB.com_config.ini +++ b/administrator/language/en-GB/en-GB.com_config.ini @@ -235,4 +235,4 @@ COM_CONFIG_TEXT_FILTER_SETTINGS="Text Filter Settings" COM_CONFIG_TEXT_FILTERS="Text Filters" COM_CONFIG_TEXT_FILTERS_DESC="These text filter settings will be applied to all text editor fields submitted by users in the selected groups.
    These filtering options give more control over the HTML your content providers submit. You can be as strict or as liberal as you require to suit your site needs. The filtering is opt-in and the default settings provide good protection against markup commonly associated with website attacks." COM_CONFIG_XML_DESCRIPTION="Configuration Manager" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this and all child groups, components and content. Note that:
    Inherited means that the permissions from the parent group will be used.
    Denied means that no matter what the parent group's setting is, the group being edited can't take this action.
    Allowed means that the group being edited will be able to take this action (but if this is in conflict with the parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    Not Set is used only for the Public group in global configuration. The Public group is the parent of all other groups. If a permission is not set, it is treated as deny but can be changed for child groups, components, categories and items.
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this and all child groups, components and content. Note that:
    Inherited means that the permissions from the parent group will be used.
    Denied means that no matter what the parent group's setting is, the group being edited can't take this action.
    Allowed means that the group being edited will be able to take this action (but if this is in conflict with the parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    Not Set is used only for the Public group in global configuration. The Public group is the parent of all other groups. If a permission is not set, it is treated as deny but can be changed for child groups, components, categories and items.
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_contact.ini b/administrator/language/en-GB/en-GB.com_contact.ini index 14c7d1cdde700..1955e8d65f9c5 100644 --- a/administrator/language/en-GB/en-GB.com_contact.ini +++ b/administrator/language/en-GB/en-GB.com_contact.ini @@ -286,4 +286,4 @@ COM_CONTACT_XML_DESCRIPTION="This component shows a listing of contact informati JGLOBAL_FIELDSET_MISCELLANEOUS="Miscellaneous Information" JGLOBAL_NEWITEMSLAST_DESC="New Contacts default to the last position. Ordering can be changed after this Contact is saved." JLIB_HTML_BATCH_USER_LABEL="Set Linked User" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_content.ini b/administrator/language/en-GB/en-GB.com_content.ini index 1e1d41ab8b501..477c60747bfe7 100644 --- a/administrator/language/en-GB/en-GB.com_content.ini +++ b/administrator/language/en-GB/en-GB.com_content.ini @@ -168,7 +168,7 @@ COM_CONTENT_TOGGLE_TO_FEATURE="Toggle to change article state to 'Featured'" COM_CONTENT_TOGGLE_TO_UNFEATURE="Toggle to change article state to 'Unfeatured'" COM_CONTENT_UNFEATURED="Unfeatured Article" COM_CONTENT_URL_FIELD_BROWSERNAV_LABEL="URL Target Window" -COM_CONTENT_URL_FIELD_BROWSERNAV_DESC="Target browser window when the menu item is clicked." +COM_CONTENT_URL_FIELD_BROWSERNAV_DESC="Target browser window when the menu item is selected." COM_CONTENT_URL_FIELD_A_BROWSERNAV_LABEL="URL A Target Window" COM_CONTENT_URL_FIELD_B_BROWSERNAV_LABEL="URL B Target Window" COM_CONTENT_URL_FIELD_C_BROWSERNAV_LABEL="URL C Target Window" @@ -178,5 +178,5 @@ COM_CONTENT_XML_DESCRIPTION="Article management component." JGLOBAL_NO_ITEM_SELECTED="No articles selected" JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE="You are not allowed to create new articles in this category." JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT="You are not allowed to edit one or more of these articles." -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." -JLIB_RULES_SETTING_NOTES_ITEM="1. If you change the setting, it will apply to this article. Note that:
    Inherited means that the permissions from global configuration, parent group and category will be used.
    Denied means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this article.
    Allowed means that the group being edited will be able to take this action for this article (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES_ITEM="1. If you change the setting, it will apply to this article. Note that:
    Inherited means that the permissions from global configuration, parent group and category will be used.
    Denied means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this article.
    Allowed means that the group being edited will be able to take this action for this article (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_contenthistory.ini b/administrator/language/en-GB/en-GB.com_contenthistory.ini index c4452ed5e4490..eea46207bc95a 100644 --- a/administrator/language/en-GB/en-GB.com_contenthistory.ini +++ b/administrator/language/en-GB/en-GB.com_contenthistory.ini @@ -3,21 +3,21 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -COM_CONTENTHISTORY_BUTTON_COMPARE_ALL_ROWS_DESC="Click to see all values for the item, including ones that haven't changed." +COM_CONTENTHISTORY_BUTTON_COMPARE_ALL_ROWS_DESC="Select to see all values for the item, including ones that haven't changed." COM_CONTENTHISTORY_BUTTON_COMPARE_ALL_ROWS="All Values" -COM_CONTENTHISTORY_BUTTON_COMPARE_CHANGED_ROWS_DESC="Click to see only those values that have changed." +COM_CONTENTHISTORY_BUTTON_COMPARE_CHANGED_ROWS_DESC="Select to see only those values that have changed." COM_CONTENTHISTORY_BUTTON_COMPARE_CHANGED_ROWS="Changed Values" -COM_CONTENTHISTORY_BUTTON_COMPARE_DESC="Select two versions and click to compare them." -COM_CONTENTHISTORY_BUTTON_COMPARE_HTML_DESC="Click to see the HTML source code for the changes." +COM_CONTENTHISTORY_BUTTON_COMPARE_DESC="Choose two versions and select to compare them." +COM_CONTENTHISTORY_BUTTON_COMPARE_HTML_DESC="Select to see the HTML source code for the changes." COM_CONTENTHISTORY_BUTTON_COMPARE_HTML="Show HTML Code" -COM_CONTENTHISTORY_BUTTON_COMPARE_TEXT_DESC="Click to see the item changes as text." +COM_CONTENTHISTORY_BUTTON_COMPARE_TEXT_DESC="Select to see the item changes as text." COM_CONTENTHISTORY_BUTTON_COMPARE_TEXT="Show Text" COM_CONTENTHISTORY_BUTTON_COMPARE="Compare" -COM_CONTENTHISTORY_BUTTON_DELETE_DESC="Select one or more versions and click to permanently delete them." +COM_CONTENTHISTORY_BUTTON_DELETE_DESC="Choose one or more versions and select to permanently delete them." COM_CONTENTHISTORY_BUTTON_DELETE="Delete" -COM_CONTENTHISTORY_BUTTON_KEEP_DESC="Select one or more versions and click to toggle the keep forever on or off." -COM_CONTENTHISTORY_BUTTON_KEEP_TOGGLE_OFF="Click to allow this version to be deleted automatically according to the delete schedule." -COM_CONTENTHISTORY_BUTTON_KEEP_TOGGLE_ON="Click to prevent this version being deleted automatically." +COM_CONTENTHISTORY_BUTTON_KEEP_DESC="Choose one or more versions and select to toggle the keep forever on or off." +COM_CONTENTHISTORY_BUTTON_KEEP_TOGGLE_OFF="Select to allow this version to be deleted automatically according to the delete schedule." +COM_CONTENTHISTORY_BUTTON_KEEP_TOGGLE_ON="Select to prevent this version being deleted automatically." COM_CONTENTHISTORY_BUTTON_KEEP="Keep On/Off" COM_CONTENTHISTORY_BUTTON_LOAD_DESC="This button loads the selected version into the edit form." COM_CONTENTHISTORY_BUTTON_LOAD="Restore" diff --git a/administrator/language/en-GB/en-GB.com_cpanel.ini b/administrator/language/en-GB/en-GB.com_cpanel.ini index a68536dbebacf..4dfcfc9abeac8 100644 --- a/administrator/language/en-GB/en-GB.com_cpanel.ini +++ b/administrator/language/en-GB/en-GB.com_cpanel.ini @@ -12,11 +12,11 @@ COM_CPANEL_LINK_DASHBOARD="Dashboard" COM_CPANEL_LINK_EXTENSIONS="Install Extensions" COM_CPANEL_LINK_GLOBAL_CONFIG="Global Configuration" COM_CPANEL_LINK_SYSINFO="System Information" -COM_CPANEL_MESSAGES_BODY_NOCLOSE="There are important post-installation messages that require your attention. To view those messages please click on the Review Messages button below." -COM_CPANEL_MESSAGES_BODYMORE_NOCLOSE="You can review the messages at any time by clicking on the Components, Post-installation messages menu item of your site's Administrator section. This information area won't appear when you have hidden all messages." +COM_CPANEL_MESSAGES_BODY_NOCLOSE="There are important post-installation messages that require your attention. To view those messages please select the Review Messages button below." +COM_CPANEL_MESSAGES_BODYMORE_NOCLOSE="You can review the messages at any time by selecting the Components, Post-installation messages menu item of your site's Administrator section. This information area won't appear when you have hidden all messages." COM_CPANEL_MESSAGES_REVIEW="Review Messages" COM_CPANEL_MESSAGES_TITLE="You have post-installation messages" -COM_CPANEL_MSG_EACCELERATOR_BODY="eAccelerator is not compatible with Joomla! By clicking on the Change to File Caching button below we will change the cache handler to file. If you want to use a different cache handler, please change it in the Global Configuration page." +COM_CPANEL_MSG_EACCELERATOR_BODY="eAccelerator is not compatible with Joomla! By selecting the Change to File Caching button below we will change the cache handler to file. If you want to use a different cache handler, please change it in the Global Configuration page." COM_CPANEL_MSG_EACCELERATOR_BUTTON="Change to File." COM_CPANEL_MSG_EACCELERATOR_TITLE="eAccelerator is not compatible with Joomla!" COM_CPANEL_MSG_HTACCESS_BODY="A change to the default .htaccess and web.config files was made in Joomla! 3.4 to disallow directory listings by default. Users are recommended to implement this change in their files. Please see
    this page for more information." diff --git a/administrator/language/en-GB/en-GB.com_finder.ini b/administrator/language/en-GB/en-GB.com_finder.ini index 73215579f8dba..094ae883e1db3 100644 --- a/administrator/language/en-GB/en-GB.com_finder.ini +++ b/administrator/language/en-GB/en-GB.com_finder.ini @@ -29,7 +29,7 @@ COM_FINDER_CONFIG_HILIGHT_CONTENT_SEARCH_TERMS_DESCRIPTION="Toggle whether searc COM_FINDER_CONFIG_HILIGHT_CONTENT_SEARCH_TERMS_LABEL="Highlight Search Terms" COM_FINDER_CONFIG_IMPORT_EXPORT="Import/Export" COM_FINDER_CONFIG_IMPORT_EXPORT_HELP="Help" -COM_FINDER_CONFIG_IMPORT_EXPORT_INSTRUCTIONS="To export your configuration options, click on the Export button in the toolbar above.

    To import an existing configuration, click on the browse button to select a file from your hard drive or copy/paste the data into the text field below and then click the Import button in the toolbar above." +COM_FINDER_CONFIG_IMPORT_EXPORT_INSTRUCTIONS="To export your configuration options, select the Export button in the toolbar above.

    To import an existing configuration, select the browse button to choose a file from your hard drive or copy/paste the data into the text field below and then select the Import button in the toolbar above." COM_FINDER_CONFIG_IMPORT_FROM_FILE="Import From File:" COM_FINDER_CONFIG_IMPORT_FROM_STRING="Import From Text:" COM_FINDER_CONFIG_IMPORT_TOOLBAR_TITLE="Smart Search: Import/Export Configuration" @@ -162,7 +162,7 @@ COM_FINDER_MAP_PUBLISH_SUCCESS="The selected map(s) were successfully published. COM_FINDER_MAP_UNPUBLISH_FAILED="The selected map(s) could not be unpublished. The returned error message is: %s." COM_FINDER_MAP_UNPUBLISH_SUCCESS="The selected map(s) were successfully unpublished." COM_FINDER_MAPS="Maps" -COM_FINDER_MAPS_BRANCH_LINK="Click to show the children in this branch." +COM_FINDER_MAPS_BRANCH_LINK="Select to show the children in this branch." COM_FINDER_MAPS_BRANCHES="Branches Only" COM_FINDER_MAPS_CONFIRM_DELETE_PROMPT="Are you sure you want to delete the selected maps(s)?" COM_FINDER_MAPS_MULTILANG="Note: Language filter system plugin has been enabled, so this branch will not be used." diff --git a/administrator/language/en-GB/en-GB.com_installer.ini b/administrator/language/en-GB/en-GB.com_installer.ini index 4c7ad6f4cf8a7..7248a90abcadd 100644 --- a/administrator/language/en-GB/en-GB.com_installer.ini +++ b/administrator/language/en-GB/en-GB.com_installer.ini @@ -51,7 +51,7 @@ COM_INSTALLER_INSTALL_FROM_URL="Install from URL" COM_INSTALLER_INSTALL_FROM_WEB="Install from Web" COM_INSTALLER_INSTALL_FROM_WEB_ADD_TAB="Add "Install from Web" tab" COM_INSTALLER_INSTALL_FROM_WEB_INFO="Joomla! Extensions Directory™ (JED) now available with Install from Web on this page." -COM_INSTALLER_INSTALL_FROM_WEB_TOS="By clicking "_QQ_"Add Install from Web tab"_QQ_" below, you agree to the JED Terms of Service and all applicable third party license terms." +COM_INSTALLER_INSTALL_FROM_WEB_TOS="By selecting "_QQ_"Add Install from Web tab"_QQ_" below, you agree to the JED Terms of Service and all applicable third party license terms." COM_INSTALLER_INSTALL_SUCCESS="Installation of the %s was successful." COM_INSTALLER_INSTALL_URL="Install URL" COM_INSTALLER_INVALID_EXTENSION_UPDATE="Invalid extension update" @@ -90,7 +90,7 @@ COM_INSTALLER_MSG_DISCOVER_DESCRIPTION="This screen allows you to discover exten COM_INSTALLER_MSG_DISCOVER_FAILEDTOPURGEEXTENSIONS="Failed to clear discovered extensions" COM_INSTALLER_MSG_DISCOVER_INSTALLFAILED="Discover install failed." COM_INSTALLER_MSG_DISCOVER_INSTALLSUCCESSFUL="Discover install successful." -COM_INSTALLER_MSG_DISCOVER_NOEXTENSION="No extensions have been discovered. Click Discover to find new extensions that might be available for install." +COM_INSTALLER_MSG_DISCOVER_NOEXTENSION="No extensions have been discovered. Select Discover to find new extensions that might be available for install." COM_INSTALLER_MSG_DISCOVER_NOEXTENSIONSELECTED="No extension selected." COM_INSTALLER_MSG_DISCOVER_PURGEDDISCOVEREDEXTENSIONS="Cleared discovered extensions." COM_INSTALLER_MSG_INSTALL_ENTER_A_URL="Please enter a URL" @@ -105,7 +105,7 @@ COM_INSTALLER_MSG_INSTALL_WARNINSTALLUPLOADERROR="There was an error uploading t COM_INSTALLER_MSG_INSTALL_WARNINSTALLZLIB="The installer can't continue until Zlib is installed." COM_INSTALLER_MSG_LANGUAGES_CANT_FIND_REMOTE_MANIFEST="The installer can't get the URL to the XML manifest file of the %s language." COM_INSTALLER_MSG_LANGUAGES_CANT_FIND_REMOTE_PACKAGE="The installer can't get the URL to the remote %s language." -COM_INSTALLER_MSG_LANGUAGES_NOLANGUAGES="There are no available languages to install at the moment. Please click on the "Find languages" button to check for updates on the Joomla! Languages server. You will need an internet connection for this to work." +COM_INSTALLER_MSG_LANGUAGES_NOLANGUAGES="There are no available languages to install at the moment. Please select the "Find languages" button to check for updates on the Joomla! Languages server. You will need an internet connection for this to work." COM_INSTALLER_MSG_LANGUAGES_TRY_LATER="Try again later or contact the language team coordinator" COM_INSTALLER_MSG_MANAGE_NOEXTENSION="There are no extensions installed matching your query." COM_INSTALLER_MSG_MANAGE_NOUPDATESITE="There are no update sites matching your query." @@ -216,11 +216,11 @@ COM_INSTALLER_VALUE_STATE_SELECT="- Select Status -" COM_INSTALLER_VALUE_TYPE_SELECT="- Select Type -" COM_INSTALLER_WEBINSTALLER_INSTALL_OBSOLETE="The Install from Web plugin has become obsolete and needs to be updated." COM_INSTALLER_WEBINSTALLER_INSTALL_UPDATE_AVAILABLE="There is a new update available for the Install from Web plugin. It is advisable that you update as soon as possible." -COM_INSTALLER_WEBINSTALLER_INSTALL_WEB_CONFIRM="Please confirm the installation by clicking on the Install button" +COM_INSTALLER_WEBINSTALLER_INSTALL_WEB_CONFIRM="Please confirm the installation by selecting the Install button" COM_INSTALLER_WEBINSTALLER_INSTALL_WEB_CONFIRM_NAME="Extension Name" COM_INSTALLER_WEBINSTALLER_INSTALL_WEB_CONFIRM_URL="Install from" COM_INSTALLER_WEBINSTALLER_INSTALL_WEB_LOADING="Loading ..." COM_INSTALLER_WEBINSTALLER_INSTALL_WEB_LOADING_ERROR="Can't connect to the Joomla! server. Please try again later." -COM_INSTALLER_WEBINSTALLER_LOAD_APPS="Click to load extensions browser" +COM_INSTALLER_WEBINSTALLER_LOAD_APPS="Select to load extensions browser" COM_INSTALLER_XML_DESCRIPTION="Installer component for adding, removing and upgrading extensions" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_languages.ini b/administrator/language/en-GB/en-GB.com_languages.ini index 1742d6372bb36..e8d97e98d39d3 100644 --- a/administrator/language/en-GB/en-GB.com_languages.ini +++ b/administrator/language/en-GB/en-GB.com_languages.ini @@ -25,7 +25,7 @@ COM_LANGUAGES_OVERRIDE_FIELD_FILE_DESC="Language overrides are stored in a speci COM_LANGUAGES_OVERRIDE_FIELD_LANGUAGE_LABEL="Language" COM_LANGUAGES_OVERRIDE_FIELD_LANGUAGE_DESC="Language for which the constant is overridden." COM_LANGUAGES_OVERRIDE_FIELD_KEY_LABEL="Language Constant" -COM_LANGUAGES_OVERRIDE_FIELD_KEY_DESC="The language constant of the string you want to override.
    All text on your site is identified by a specific language constant which you have to use for creating an override of the text.
    If you don't know the corresponding constant you can search for text you want to change on the right. By clicking on the desired result the correct constant will automatically be inserted into the form." +COM_LANGUAGES_OVERRIDE_FIELD_KEY_DESC="The language constant of the string you want to override.
    All text on your site is identified by a specific language constant which you have to use for creating an override of the text.
    If you don't know the corresponding constant you can search for text you want to change on the right. By selecting the desired result the correct constant will automatically be inserted into the form." COM_LANGUAGES_OVERRIDE_FIELD_OVERRIDE_LABEL="Text" COM_LANGUAGES_OVERRIDE_FIELD_OVERRIDE_DESC="Enter the text that you want to be displayed instead of the original one.
    Please note that there may be placeholders (eg %s, %d or %1$s) in the text which could be important (they will be replaced by other texts before displaying), so you should leave them in there." COM_LANGUAGES_OVERRIDE_FIELD_SEARCHSTRING_LABEL="Search Text" @@ -102,7 +102,7 @@ COM_LANGUAGES_VIEW_OVERRIDE_RESULTS_LEGEND="Search Results" COM_LANGUAGES_VIEW_OVERRIDE_SAVE_SUCCESS="Language Override was saved successfully." COM_LANGUAGES_VIEW_OVERRIDE_SEARCH_BUTTON="Search" COM_LANGUAGES_VIEW_OVERRIDE_SEARCH_LEGEND="Search text you want to change." -COM_LANGUAGES_VIEW_OVERRIDE_SEARCH_TIP="A language string is composed of two parts: a specific language constant and its value.
    For example, in the string: COM_CONTENT_READ_MORE="Read more: "
    'COM_CONTENT_READ_MORE' is the constant and 'Read more: ' is the value.
    You have to use the specific language constant in order to create an override of the value.
    Therefore, you can search for the constant or the value you want to change with the search field below.
    By clicking on the desired result the correct constant will automatically be inserted into the form." +COM_LANGUAGES_VIEW_OVERRIDE_SEARCH_TIP="A language string is composed of two parts: a specific language constant and its value.
    For example, in the string: COM_CONTENT_READ_MORE="Read more: "
    'COM_CONTENT_READ_MORE' is the constant and 'Read more: ' is the value.
    You have to use the specific language constant in order to create an override of the value.
    Therefore, you can search for the constant or the value you want to change with the search field below.
    By selecting the desired result the correct constant will automatically be inserted into the form." COM_LANGUAGES_VIEW_OVERRIDES_FILTER_SEARCH_DESC="Search constant or text." COM_LANGUAGES_VIEW_OVERRIDES_KEY="Constant" COM_LANGUAGES_VIEW_OVERRIDES_LANGUAGES_BOX_ITEM="%1$s - %2$s" @@ -112,4 +112,4 @@ COM_LANGUAGES_VIEW_OVERRIDES_NO_ITEM_SELECTED="You haven't selected any override COM_LANGUAGES_VIEW_OVERRIDES_TEXT="Text" COM_LANGUAGES_VIEW_OVERRIDES_TITLE="Language Manager: Language Overrides" COM_LANGUAGES_XML_DESCRIPTION="Component for language management" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_media.ini b/administrator/language/en-GB/en-GB.com_media.ini index a23c5b84bb403..45ba2aa26384d 100644 --- a/administrator/language/en-GB/en-GB.com_media.ini +++ b/administrator/language/en-GB/en-GB.com_media.ini @@ -97,5 +97,5 @@ COM_MEDIA_UPLOAD_SUCCESSFUL="Upload Successful" COM_MEDIA_UPLOAD="Upload" COM_MEDIA_UP="Up" COM_MEDIA_XML_DESCRIPTION="Component for managing site media" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_menus.ini b/administrator/language/en-GB/en-GB.com_menus.ini index 6aaf669258f61..058668f7ea20e 100644 --- a/administrator/language/en-GB/en-GB.com_menus.ini +++ b/administrator/language/en-GB/en-GB.com_menus.ini @@ -69,7 +69,7 @@ COM_MENUS_ITEM_FIELD_ANCHOR_TITLE_LABEL="Link Title Attribute" COM_MENUS_ITEM_FIELD_ASSIGNED_DESC="Shows which menu the link will appear in." COM_MENUS_ITEM_FIELD_ASSIGNED_LABEL=" Menu Location" COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE="- No association -" -COM_MENUS_ITEM_FIELD_BROWSERNAV_DESC="Target browser window when the menu item is clicked." +COM_MENUS_ITEM_FIELD_BROWSERNAV_DESC="Target browser window when the menu item is selected." COM_MENUS_ITEM_FIELD_BROWSERNAV_LABEL="Target Window" COM_MENUS_ITEM_FIELD_HIDE_UNASSIGNED="Hide Unassigned Modules" COM_MENUS_ITEM_FIELD_HIDE_UNASSIGNED_DESC="Shows or hide modules unassigned to this menu item." @@ -182,4 +182,4 @@ COM_MENUS_VIEW_MENUS_TITLE="Menu Manager: Menus" COM_MENUS_VIEW_NEW_ITEM_TITLE="Menu Manager: New Menu Item" COM_MENUS_VIEW_NEW_MENU_TITLE="Menu Manager: Add Menu" COM_MENUS_XML_DESCRIPTION="Component for creating menus." -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_messages.ini b/administrator/language/en-GB/en-GB.com_messages.ini index 2f988e911300c..8032ad35e2d42 100644 --- a/administrator/language/en-GB/en-GB.com_messages.ini +++ b/administrator/language/en-GB/en-GB.com_messages.ini @@ -61,4 +61,4 @@ COM_MESSAGES_VIEW_PRIVATE_MESSAGE="Private Messages Manager: View Message" COM_MESSAGES_WRITE_PRIVATE_MESSAGE="Private Messages Manager: Write Private Message" COM_MESSAGES_XML_DESCRIPTION="Component for private messaging support in Backend." JLIB_APPLICATION_SAVE_SUCCESS="Message successfully sent." -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_modules.ini b/administrator/language/en-GB/en-GB.com_modules.ini index 9ea29e00f9be2..77b875c1965cb 100644 --- a/administrator/language/en-GB/en-GB.com_modules.ini +++ b/administrator/language/en-GB/en-GB.com_modules.ini @@ -173,7 +173,7 @@ COM_MODULES_XML_DESCRIPTION="Component for module management in Backend" COM_MODULES_ADD_CUSTOM_POSITION="Add custom position" COM_MODULES_CUSTOM_POSITION="Active Positions" COM_MODULES_TYPE_OR_SELECT_POSITION="Type or Select a Position" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." COM_MODULES_DESELECT="Deselect" COM_MODULES_EXPAND="Expand" COM_MODULES_COLLAPSE="Collapse" diff --git a/administrator/language/en-GB/en-GB.com_newsfeeds.ini b/administrator/language/en-GB/en-GB.com_newsfeeds.ini index 1febce28c0853..540b9420b2a21 100644 --- a/administrator/language/en-GB/en-GB.com_newsfeeds.ini +++ b/administrator/language/en-GB/en-GB.com_newsfeeds.ini @@ -121,4 +121,4 @@ COM_NEWSFEEDS_UNPUBLISH_ITEM="Unpublish News Feed" COM_NEWSFEEDS_WARNING_PROVIDE_VALID_NAME="Please provide a valid name." COM_NEWSFEEDS_XML_DESCRIPTION="This component manages RSS and Atom news feeds." JGLOBAL_NEWITEMSLAST_DESC="New news feeds default to the last position. The ordering can be changed after this news feed has been saved." -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_plugins.ini b/administrator/language/en-GB/en-GB.com_plugins.ini index 6554b2f7f00b5..cc82907e1d796 100644 --- a/administrator/language/en-GB/en-GB.com_plugins.ini +++ b/administrator/language/en-GB/en-GB.com_plugins.ini @@ -38,4 +38,4 @@ COM_PLUGINS_XML_DESCRIPTION="This component manages Joomla plugins." COM_PLUGINS_XML_ERR="Plugins XML data not available." JLIB_HTML_PUBLISH_ITEM="Enable plugin" JLIB_HTML_UNPUBLISH_ITEM="Disable plugin" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_postinstall.ini b/administrator/language/en-GB/en-GB.com_postinstall.ini index 784351054c7a0..1e4df25a2bf5f 100644 --- a/administrator/language/en-GB/en-GB.com_postinstall.ini +++ b/administrator/language/en-GB/en-GB.com_postinstall.ini @@ -8,7 +8,7 @@ COM_POSTINSTALL_BTN_HIDE="Hide this message" COM_POSTINSTALL_BTN_RESET="Reset Messages" COM_POSTINSTALL_CONFIGURATION="Post-installation Messages Configuration" COM_POSTINSTALL_LBL_MESSAGES="Post-installation and Upgrade Messages" -COM_POSTINSTALL_LBL_NOMESSAGES_DESC="You have already seen and hidden all messages for the current version. If you want to reset the messages, meaning that all messages you have hidden will be displayed again, please click on the Reset Messages button below." +COM_POSTINSTALL_LBL_NOMESSAGES_DESC="You have already seen and hidden all messages for the current version. If you want to reset the messages, meaning that all messages you have hidden will be displayed again, please select the Reset Messages button below." COM_POSTINSTALL_LBL_NOMESSAGES_TITLE="No Messages" COM_POSTINSTALL_LBL_RELEASENEWS="Release news from the Joomla! Project" COM_POSTINSTALL_LBL_SINCEVERSION="Since version %s" diff --git a/administrator/language/en-GB/en-GB.com_redirect.ini b/administrator/language/en-GB/en-GB.com_redirect.ini index d79d404ea940f..c2202bf5aab94 100644 --- a/administrator/language/en-GB/en-GB.com_redirect.ini +++ b/administrator/language/en-GB/en-GB.com_redirect.ini @@ -63,4 +63,4 @@ COM_REDIRECT_REDIRECTED_ON="Redirected on: %s." COM_REDIRECT_SAVE_SUCCESS="Link successfully saved." COM_REDIRECT_SEARCH_LINKS="Search in link fields." COM_REDIRECT_XML_DESCRIPTION="This component implements link redirection." -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_tags.ini b/administrator/language/en-GB/en-GB.com_tags.ini index dee9a5d2d62d3..69e73d6f927c8 100644 --- a/administrator/language/en-GB/en-GB.com_tags.ini +++ b/administrator/language/en-GB/en-GB.com_tags.ini @@ -34,7 +34,7 @@ COM_TAGS_CONFIG_SHARED_SETTINGS_DESC="These settings apply to all tag layouts un COM_TAGS_CONFIG_SHARED_SETTINGS_LABEL="Shared Layout Options" COM_TAGS_CONFIG_TAG_SETTINGS_DESC="These settings apply for a Tagged Items List or Compact List of Tagged Items unless they are changed for a specific menu item." COM_TAGS_CONFIG_TAG_SETTINGS_LABEL="Tagged Items Options" -COM_TAGS_CONFIG_TAGGED_ITEMS_FIELD_LAYOUT_DESC="Choose a default layout for tagged items. This layout will be used when a user clicks on a tag that doesn't have a menu item defined." +COM_TAGS_CONFIG_TAGGED_ITEMS_FIELD_LAYOUT_DESC="Choose a default layout for tagged items. This layout will be used when a user selects a tag that doesn't have a menu item defined." COM_TAGS_CONFIG_TAGGED_ITEMS_FIELD_LAYOUT_LABEL="Default Tagged Items Layout" COM_TAGS_CONFIGURATION="Tags Configuration" COM_TAGS_DELETE_NOT_ALLOWED="Delete not allowed for tag %s." diff --git a/administrator/language/en-GB/en-GB.com_templates.ini b/administrator/language/en-GB/en-GB.com_templates.ini index f07245ec26d09..3cf2c5fcad188 100644 --- a/administrator/language/en-GB/en-GB.com_templates.ini +++ b/administrator/language/en-GB/en-GB.com_templates.ini @@ -26,7 +26,7 @@ COM_TEMPLATES_BUTTON_RENAME_FILE="Rename File" COM_TEMPLATES_BUTTON_RESIZE="Resize" COM_TEMPLATES_BUTTON_UPLOAD="Upload" COM_TEMPLATES_CHECK_FILE_OWNERSHIP="Check file ownership" -COM_TEMPLATES_CLICK_TO_ENLARGE="Click to enlarge." +COM_TEMPLATES_CLICK_TO_ENLARGE="Select to enlarge." COM_TEMPLATES_COMPILE_ERROR="An error occurred. Failed to compile." COM_TEMPLATES_COMPILE_LESS="You should compile %s to generate a CSS file." COM_TEMPLATES_COMPILE_SUCCESS="Successfully compiled LESS." @@ -48,7 +48,7 @@ COM_TEMPLATES_COPY_SUCCESS="New template called %s was installed successfully." COM_TEMPLATES_CROP_AREA_ERROR="Crop area not selected." COM_TEMPLATES_DIRECTORY_NOT_WRITABLE="The template directory is not writable. Some features may not work." COM_TEMPLATES_ERR_XML="Template XML data not available" -COM_TEMPLATES_ERROR_CANNOT_DELETE_LAST_STYLE="Can't delete the last style of a template. To uninstall/delete a template go to: Extensions-> Extension manager-> Manage-> Select template to be deleted-> Click 'Uninstall'." +COM_TEMPLATES_ERROR_CANNOT_DELETE_LAST_STYLE="Can't delete the last style of a template. To uninstall/delete a template go to: Extensions-> Extension manager-> Manage-> Select template to be deleted-> Select 'Uninstall'." COM_TEMPLATES_ERROR_CANNOT_UNSET_DEFAULT_STYLE="Can't unset default style." COM_TEMPLATES_ERROR_COULD_NOT_COPY="Unable to copy template files to temporary directory." COM_TEMPLATES_ERROR_COULD_NOT_INSTALL="Unable to install new template from temporary directory." @@ -220,4 +220,4 @@ COM_TEMPLATES_TEMPLATES_FILTER_SEARCH_DESC="Search in template name or folder na COM_TEMPLATES_TOGGLE_FULL_SCREEN="Press Ctrl-Q to toggle Full Screen editing." COM_TEMPLATES_TOOLBAR_SET_HOME="Default" COM_TEMPLATES_XML_DESCRIPTION="This component manages templates" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_users.ini b/administrator/language/en-GB/en-GB.com_users.ini index 812e7eeb3748f..6a1cd69bc71ff 100644 --- a/administrator/language/en-GB/en-GB.com_users.ini +++ b/administrator/language/en-GB/en-GB.com_users.ini @@ -313,4 +313,4 @@ COM_USERS_VIEW_NEW_USER_TITLE="User Manager: Add New User" COM_USERS_VIEW_NOTES_TITLE="User Notes" COM_USERS_VIEW_USERS_TITLE="User Manager: Users" COM_USERS_XML_DESCRIPTION="Component for managing users" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.com_weblinks.ini b/administrator/language/en-GB/en-GB.com_weblinks.ini index b36c318ef5df6..1d14225961aa1 100644 --- a/administrator/language/en-GB/en-GB.com_weblinks.ini +++ b/administrator/language/en-GB/en-GB.com_weblinks.ini @@ -66,7 +66,7 @@ COM_WEBLINKS_FIELD_SHOW_CAT_TAGS_LABEL="Show Tags" COM_WEBLINKS_FIELD_SHOW_TAGS_DESC="Show the tags for a web link." COM_WEBLINKS_FIELD_SHOW_TAGS_LABEL="Show Tags" COM_WEBLINKS_FIELD_STATE_DESC="Set publication status." -COM_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is clicked." +COM_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is selected." COM_WEBLINKS_FIELD_TARGET_LABEL="Target" COM_WEBLINKS_FIELD_TITLE_DESC="Web Link must have a title." COM_WEBLINKS_FIELD_URL_DESC="You must enter a URL. IDN (International) Links are converted to punycode when they are saved." @@ -118,4 +118,4 @@ JGLOBAL_NO_ITEM_SELECTED="No web links selected" JGLOBAL_NEWITEMSLAST_DESC="New Web links default to the last position. Ordering can be changed after this Web link is saved." JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE="You are not allowed to create new web links in this category." JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT="You are not allowed to edit one or more of these web links." -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this component. Note that:
    Inherited means that the permissions from global configuration and parent group will be used.
    Denied means that no matter what the global configuration or parent group settings are, the group being edited can't take this action on this component.
    Allowed means that the group being edited will be able to take this action for this component (but if this is in conflict with the global configuration or parent group it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index 4cf1d90dc6380..cb49f53c43858 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -293,8 +293,8 @@ JGLOBAL_CENTER="Center" JGLOBAL_CHECK_ALL="Check All" JGLOBAL_CHOOSE_CATEGORY_DESC="Choose a category from the list." JGLOBAL_CHOOSE_CATEGORY_LABEL="Choose a Category" -JGLOBAL_CLICK_TO_SORT_THIS_COLUMN="Click to sort by this column" -JGLOBAL_CLICK_TO_TOGGLE_STATE="Click on icon to toggle state." +JGLOBAL_CLICK_TO_SORT_THIS_COLUMN="Select to sort by this column" +JGLOBAL_CLICK_TO_TOGGLE_STATE="Select icon to toggle state." JGLOBAL_COPY="(copy)" JGLOBAL_CREATED="Created" JGLOBAL_CREATED_DATE="Created Date" @@ -542,7 +542,7 @@ JGLOBAL_SUBMENU_CLEAR_CACHE="Clear Cache" JGLOBAL_SUBMENU_PURGE_EXPIRED_CACHE="Clear Expired Cache" JGLOBAL_SUBSLIDER_BLOG_EXTENDED_LABEL="The option below gives the ability to include articles from subcategories in the Blog layout." JGLOBAL_SUBSLIDER_BLOG_LAYOUT_LABEL="If a field is left blank, global settings will be used." -JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL="These options are also used when you click
    on one of the category links, on the first page and/or thereafter,
    unless they are changed for a specific menu item." +JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL="These options are also used when you select
    one of the category links, on the first page and/or thereafter,
    unless they are changed for a specific menu item." JGLOBAL_TITLE="Title" JGLOBAL_TITLE_ASC="Title ascending" JGLOBAL_TITLE_DESC="Title descending" @@ -875,7 +875,7 @@ JWARNING_ARCHIVE_MUST_SELECT="You must select at least one item to archive." JWARNING_UNPUBLISH_MUST_SELECT="You must select at least one item to unpublish." JWARNING_TRASH_MUST_SELECT="You must select at least one item to remove." JWARNING_DELETE_MUST_SELECT="You must select at least one item to permanently delete." -JWARNING_REMOVE_ROOT_USER="You are logged-in using the emergency Root User setting in configuration.php.
    You should remove $root_user from configuration.php as soon as you have restored control to your site to avoid future security breaches.
    Click here to try to do it automatically." +JWARNING_REMOVE_ROOT_USER="You are logged-in using the emergency Root User setting in configuration.php.
    You should remove $root_user from configuration.php as soon as you have restored control to your site to avoid future security breaches.
    Select here to try to do it automatically." ; Date format diff --git a/administrator/language/en-GB/en-GB.lib_joomla.ini b/administrator/language/en-GB/en-GB.lib_joomla.ini index ec46732e161ab..878baf4adbddc 100644 --- a/administrator/language/en-GB/en-GB.lib_joomla.ini +++ b/administrator/language/en-GB/en-GB.lib_joomla.ini @@ -327,7 +327,7 @@ JLIB_FORM_VALUE_INHERITED="Inherited" JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_ACL="ACL" JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_TABLE="Table" JLIB_HTML_ACCESS_SUMMARY_DESC_CAPTION="ACL Summary Table" -JLIB_HTML_ACCESS_SUMMARY_DESC="Shown below is an overview of the permission settings for this article. Click the tabs above to customise these settings by action." +JLIB_HTML_ACCESS_SUMMARY_DESC="Shown below is an overview of the permission settings for this article. Select the tabs above to customise these settings by action." JLIB_HTML_ACCESS_SUMMARY="Summary." JLIB_HTML_ADD_TO_ROOT="Add to root." JLIB_HTML_ADD_TO_THIS_MENU="Add to this menu." @@ -356,12 +356,12 @@ JLIB_HTML_BEHAVIOR_GO_TODAY="Go to today" JLIB_HTML_BEHAVIOR_GREEN="Green" JLIB_HTML_BEHAVIOR_HOLD_MOUSE="- Hold mouse button on any of the above buttons for faster selection." JLIB_HTML_BEHAVIOR_MONTH_SELECT="- Use the < and > buttons to select month\n" -JLIB_HTML_BEHAVIOR_NEXT_MONTH_HOLD_FOR_MENU="Click to move to the next month. Click and hold for a list of the months." -JLIB_HTML_BEHAVIOR_NEXT_YEAR_HOLD_FOR_MENU="Click to move to the next year. Click and hold for a list of years." -JLIB_HTML_BEHAVIOR_PREV_MONTH_HOLD_FOR_MENU="Click to move to the previous month. Click and hold for a list of the months." -JLIB_HTML_BEHAVIOR_PREV_YEAR_HOLD_FOR_MENU="Click to move to the previous year. Click and hold for a list of years." +JLIB_HTML_BEHAVIOR_NEXT_MONTH_HOLD_FOR_MENU="Select to move to the next month. Select and hold for a list of the months." +JLIB_HTML_BEHAVIOR_NEXT_YEAR_HOLD_FOR_MENU="Select to move to the next year. Select and hold for a list of years." +JLIB_HTML_BEHAVIOR_PREV_MONTH_HOLD_FOR_MENU="Select to move to the previous month. Select and hold for a list of the months." +JLIB_HTML_BEHAVIOR_PREV_YEAR_HOLD_FOR_MENU="Select to move to the previous year. Select and hold for a list of years." JLIB_HTML_BEHAVIOR_SELECT_DATE="Select a date." -JLIB_HTML_BEHAVIOR_SHIFT_CLICK_OR_DRAG_TO_CHANGE_VALUE="(Shift-)Click or Drag to change the value." +JLIB_HTML_BEHAVIOR_SHIFT_CLICK_OR_DRAG_TO_CHANGE_VALUE="(Shift-)Select or Drag to change the value." JLIB_HTML_BEHAVIOR_TIME="Time:" JLIB_HTML_BEHAVIOR_TODAY="Today" JLIB_HTML_BEHAVIOR_TT_DATE_FORMAT="%a, %b %e" @@ -642,8 +642,8 @@ JLIB_RULES_NOT_ALLOWED_LOCKED="Not Allowed (Locked)" JLIB_RULES_NOT_SET="Not Set" JLIB_RULES_SELECT_ALLOW_DENY_GROUP="Allow or deny %s for users in the %s group." JLIB_RULES_SELECT_SETTING="Select New Setting 1" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this and all child groups, components and content. Note that Denied will overrule any inherited setting and also the setting in any child group, component or content. In the case of a setting conflict, Deny will take precedence. Not Set is equivalent to Denied but can be changed in child groups, components and content.
    2. If you select a new setting, click Save to refresh the calculated settings." -JLIB_RULES_SETTING_NOTES_ITEM="1. If you change the setting, it will apply to this item. Note that:
    Inherited means that the permissions from global configuration, parent group and category will be used.
    Denied means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this item.
    Allowed means that the group being edited will be able to take this action for this item (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this and all child groups, components and content. Note that Denied will overrule any inherited setting and also the setting in any child group, component or content. In the case of a setting conflict, Deny will take precedence. Not Set is equivalent to Denied but can be changed in child groups, components and content.
    2. If you select a new setting, select Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES_ITEM="1. If you change the setting, it will apply to this item. Note that:
    Inherited means that the permissions from global configuration, parent group and category will be used.
    Denied means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this item.
    Allowed means that the group being edited will be able to take this action for this item (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." JLIB_RULES_SETTINGS_DESC="Manage the permission settings for the user groups below. See notes at the bottom." JLIB_UNKNOWN="Unknown" diff --git a/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini b/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini index f749c66566af0..c1361ace6bf41 100644 --- a/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini +++ b/administrator/language/en-GB/en-GB.plg_editors_tinymce.ini @@ -54,7 +54,7 @@ PLG_TINY_FIELD_LANGCODE_DESC="Editor UI Language. The value will be used if Auto PLG_TINY_FIELD_LANGCODE_LABEL="Language Code" PLG_TINY_FIELD_LANGSELECT_DESC="If Yes, editor language will automatically match selected UI language. If the tiny language does not exist, the editor language will default to English." PLG_TINY_FIELD_LANGSELECT_LABEL="Automatic Language Selection" -PLG_TINY_FIELD_LINK_DESC="Click to enable the link icons. Only applies in Extended mode." +PLG_TINY_FIELD_LINK_DESC="Select to enable the link icons. Only applies in Extended mode." PLG_TINY_FIELD_LINK_LABEL="Links" PLG_TINY_FIELD_MEDIA_DESC="Show or hide the Media button. Only applies in Extended mode." PLG_TINY_FIELD_MEDIA_LABEL="Media" diff --git a/administrator/language/en-GB/en-GB.plg_twofactorauth_totp.ini b/administrator/language/en-GB/en-GB.plg_twofactorauth_totp.ini index 78aa2e8cdad6c..333b0accef31c 100644 --- a/administrator/language/en-GB/en-GB.plg_twofactorauth_totp.ini +++ b/administrator/language/en-GB/en-GB.plg_twofactorauth_totp.ini @@ -8,7 +8,7 @@ PLG_TWOFACTORAUTH_TOTP_ERR_VALIDATIONFAILED="You did not enter a valid security PLG_TWOFACTORAUTH_TOTP_INTRO="This feature allows you to use Google Authenticator, or a compatible application, for two factor authentication. In addition to your username and password you will also need to provide a six digit security code generated by Google Authenticator to be able to login to this site. The security code is rotated every 30 seconds. This provides extra protection against hackers logging in to your account even if they were able to get hold of your password." PLG_TWOFACTORAUTH_TOTP_METHOD_TITLE="Google Authenticator" PLG_TWOFACTORAUTH_TOTP_POSTINSTALL_TITLE="Two Factor Authentication is Available" -PLG_TWOFACTORAUTH_TOTP_POSTINSTALL_BODY="Joomla! comes with a built-in two factor authentication system. It secures your site login with a secondary secret code that's changing every 30 seconds. You can use your mobile device and the Google Authenticator app to produce that code.
    By clicking the button below:
    • Joomla! will enable the two factor authentication plugins
    • Two Factor Authentication is going to be available for all users.
    • Each user can configure Two Factor Authentication in User Details.
    • You can always disable Two Factor Authentication plugin, or configure it for Backend usage only.
    • You will be taken to your user profile page where you can find more information on two factor authentication and enable it for your user account.
    " +PLG_TWOFACTORAUTH_TOTP_POSTINSTALL_BODY="Joomla! comes with a built-in two factor authentication system. It secures your site login with a secondary secret code that's changing every 30 seconds. You can use your mobile device and the Google Authenticator app to produce that code.
    By selecting the button below:
    • Joomla! will enable the two factor authentication plugins
    • Two Factor Authentication is going to be available for all users.
    • Each user can configure Two Factor Authentication in User Details.
    • You can always disable Two Factor Authentication plugin, or configure it for Backend usage only.
    • You will be taken to your user profile page where you can find more information on two factor authentication and enable it for your user account.
    " PLG_TWOFACTORAUTH_TOTP_POSTINSTALL_ACTION="Enable two factor authentication" PLG_TWOFACTORAUTH_TOTP_SECTION_ADMIN="Administrator (Backend)" PLG_TWOFACTORAUTH_TOTP_SECTION_BOTH="Both" @@ -32,5 +32,5 @@ PLG_TWOFACTORAUTH_TOTP_STEP2_RESET="If you want to change the key, disable the t PLG_TWOFACTORAUTH_TOTP_STEP2_TEXT="You will need to enter the following information to Google Authenticator or a compatible app." PLG_TWOFACTORAUTH_TOTP_STEP3_HEAD="Step 3 - Activate Two Factor Authentication" PLG_TWOFACTORAUTH_TOTP_STEP3_SECURITYCODE="Security Code" -PLG_TWOFACTORAUTH_TOTP_STEP3_TEXT="In order to verify that everything is set up properly, please enter the security code displayed in Google Authenticator in the field below and click on the button. If the code is correct, the Two Factor Authentication feature will be enabled." +PLG_TWOFACTORAUTH_TOTP_STEP3_TEXT="In order to verify that everything is set up properly, please enter the security code displayed in Google Authenticator in the field below and select the button. If the code is correct, the Two Factor Authentication feature will be enabled." PLG_TWOFACTORAUTH_TOTP_XML_DESCRIPTION="Allows users on your site to use two factor authentication using Google Authenticator or other compatible time-based One Time Password generators. To use two factor authentication please edit the user profile and enable two factor authentication." diff --git a/administrator/language/en-GB/en-GB.plg_twofactorauth_yubikey.ini b/administrator/language/en-GB/en-GB.plg_twofactorauth_yubikey.ini index 8b29fd76200d7..7c4729baa565c 100644 --- a/administrator/language/en-GB/en-GB.plg_twofactorauth_yubikey.ini +++ b/administrator/language/en-GB/en-GB.plg_twofactorauth_yubikey.ini @@ -6,7 +6,7 @@ PLG_TWOFACTORAUTH_YUBIKEY="Two Factor Authentication - YubiKey" PLG_TWOFACTORAUTH_YUBIKEY_ERR_VALIDATIONFAILED="You did not enter a valid YubiKey secret code or the YubiCloud servers are unreachable at this time." -PLG_TWOFACTORAUTH_YUBIKEY_INTRO="This feature allows you to use a YubiKey secure hardware token for two factor authentication. In addition to your username and password you will also need to insert your YubiKey into your computer's USB port, click inside the Secret Key area of the site's login area and touch YubiKey's gold disk. The secret code generated by your YubiKey is unique to your device and changes constantly. This provides extra protection against hackers logging in to your account even if they were able to get hold of your password." +PLG_TWOFACTORAUTH_YUBIKEY_INTRO="This feature allows you to use a YubiKey secure hardware token for two factor authentication. In addition to your username and password you will also need to insert your YubiKey into your computer's USB port, select inside the Secret Key area of the site's login area and touch YubiKey's gold disk. The secret code generated by your YubiKey is unique to your device and changes constantly. This provides extra protection against hackers logging in to your account even if they were able to get hold of your password." PLG_TWOFACTORAUTH_YUBIKEY_METHOD_TITLE="YubiKey" PLG_TWOFACTORAUTH_TOTP_RESET_HEAD="Your YubiKey is already linked to your user account." PLG_TWOFACTORAUTH_TOTP_RESET_TEXT="Your YubiKey is already linked to your user account. If you want to unlink your YubiKey from your user account or use another YubiKey, please first disable two factor authentication and save your user profile. Then come back to this user profile page and re-activate two factor authentication with the YubiKey method." @@ -17,6 +17,6 @@ PLG_TWOFACTORAUTH_YUBIKEY_SECTION_LABEL="Site Section" PLG_TWOFACTORAUTH_YUBIKEY_SECTION_SITE="Site (Frontend)" PLG_TWOFACTORAUTH_YUBIKEY_SECURITYCODE="Security Code" PLG_TWOFACTORAUTH_YUBIKEY_STEP1_HEAD="Set up" -PLG_TWOFACTORAUTH_YUBIKEY_STEP1_TEXT="Please insert your YubiKey device into your computer's USB port. Click on the Security Code field below. Then touch the gold disk on your YubiKey device for one second. Afterwards, please save your user profile. If the code generated by your YubiKey is validated by YubiCloud the Two Factor Authentication feature will be enabled and this YubiKey will be linked with your user account." +PLG_TWOFACTORAUTH_YUBIKEY_STEP1_TEXT="Please insert your YubiKey device into your computer's USB port. Select the Security Code field below. Then touch the gold disk on your YubiKey device for one second. Afterwards, please save your user profile. If the code generated by your YubiKey is validated by YubiCloud the Two Factor Authentication feature will be enabled and this YubiKey will be linked with your user account." PLG_TWOFACTORAUTH_YUBIKEY_XML_DESCRIPTION="Allows users on your site to use two factor authentication using a YubiKey secure hardware token. Users need their own Yubikey available from http://www.yubico.com/. To use two factor authentication users have to edit their user profile and enable two factor authentication." diff --git a/administrator/language/en-GB/en-GB.plg_user_joomla.ini b/administrator/language/en-GB/en-GB.plg_user_joomla.ini index 39436f3ca5829..5383fa30e4c7d 100644 --- a/administrator/language/en-GB/en-GB.plg_user_joomla.ini +++ b/administrator/language/en-GB/en-GB.plg_user_joomla.ini @@ -15,6 +15,6 @@ PLG_USER_JOOMLA_FIELD_STRONG_PASSWORDS_LABEL="Strong Passwords" PLG_USER_JOOMLA_NEW_USER_EMAIL_BODY="Hello %s,\n\n\nYou have been added as a User to %s by an Administrator.\n\nThis email contains your username and password to log in to %s\n\nUsername: %s\nPassword: %s\n\n\nPlease do not respond to this message as it is automatically generated and is for information purposes only." PLG_USER_JOOMLA_NEW_USER_EMAIL_SUBJECT="New User Details" PLG_USER_JOOMLA_POSTINSTALL_STRONGPW_BTN="Enable Strong Password Encryption" -PLG_USER_JOOMLA_POSTINSTALL_STRONGPW_TEXT="As a security feature, Joomla allows you to switch to strong password encryption.
    To turn strong passwords on click on the button below. Alternatively you can edit the User - Joomla plugin and change the strong password setting to On.
    Before enabling you should verify that all third party registration/login, user management or bridge extensions installed on your site support this strong password encryption." +PLG_USER_JOOMLA_POSTINSTALL_STRONGPW_TEXT="As a security feature, Joomla allows you to switch to strong password encryption.
    To turn strong passwords on select the button below. Alternatively you can edit the User - Joomla plugin and change the strong password setting to On.
    Before enabling you should verify that all third party registration/login, user management or bridge extensions installed on your site support this strong password encryption." PLG_USER_JOOMLA_POSTINSTALL_STRONGPW_TITLE="Strong passwords" PLG_USER_JOOMLA_XML_DESCRIPTION="Handles Joomla's default User synchronisation." diff --git a/installation/language/en-GB/en-GB.ini b/installation/language/en-GB/en-GB.ini index bf6b2aa4a9324..23649c8da2bec 100644 --- a/installation/language/en-GB/en-GB.ini +++ b/installation/language/en-GB/en-GB.ini @@ -120,7 +120,7 @@ INSTL_COMPLETE_ERROR_FOLDER_ALREADY_REMOVED="The installation folder has already INSTL_COMPLETE_ERROR_FOLDER_DELETE="Installation folder could not be deleted. Please manually delete the folder." INSTL_COMPLETE_FOLDER_REMOVED="Installation folder successfully removed." INSTL_COMPLETE_LANGUAGE_1="Joomla! in your own language and/or automatic basic native multilingual site creation" -INSTL_COMPLETE_LANGUAGE_DESC="Before removing the installation folder you can install extra languages. If you want to add extra languages to your Joomla! application click the following button." +INSTL_COMPLETE_LANGUAGE_DESC="Before removing the installation folder you can install extra languages. If you want to add extra languages to your Joomla! application select the following button." INSTL_COMPLETE_LANGUAGE_DESC2="Note: you will need internet access for Joomla! to download and install the new languages.
    Some server configurations won't allow Joomla! to install the languages. If this is your case, don't worry, you will be able to install them later using the Joomla! Administrator." INSTL_COMPLETE_REMOVE_FOLDER="Remove installation folder" INSTL_COMPLETE_REMOVE_INSTALLATION="PLEASE REMEMBER TO COMPLETELY REMOVE THE INSTALLATION FOLDER.
    You will not be able to proceed beyond this point until the installation directory has been removed. This is a security feature of Joomla!" @@ -131,7 +131,7 @@ INSTL_COMPLETE_INSTALL_LANGUAGES="Extra steps: Install languages" INSTL_LANGUAGES="Install Language packages" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE="Language" INSTL_LANGUAGES_COLUMN_HEADER_VERSION="Version" -INSTL_LANGUAGES_DESC="The Joomla interface is available in several languages. Choose your preferred languages by clicking in the checkboxes and then install them by clicking on the Next button.
    Note: this operation will take about 10 seconds to download and install every language. To avoid timeouts please select no more than 3 languages to install." +INSTL_LANGUAGES_DESC="The Joomla interface is available in several languages. Choose your preferred languages by choosing the checkboxes and then install them by selecting the Next button.
    Note: this operation will take about 10 seconds to download and install every language. To avoid timeouts please select no more than 3 languages to install." INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="This operation will take up to 10 seconds per language to complete
    Please wait while we download and install the languages ..." INSTL_LANGUAGES_MORE_LANGUAGES="Press the 'Previous' button if you want to install more languages." INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="No languages have been selected to be installed. If you need to install more languages, press the 'Previous' button and choose the desired languages from the list." @@ -230,7 +230,7 @@ INSTL_FTP_NOSYST="The function "SYST" failed." INSTL_FTP_UNABLE_DETECT_ROOT_FOLDER="Unable to auto-detect the FTP root folder." ;others -INSTL_CONFPROBLEM="Your configuration file or directory is not writable or there was a problem creating the configuration file. You will have to upload the following code by hand. Click in the text area to highlight all of the code and then paste into a new text file. Name this file 'configuration.php' and upload it to your site root folder." +INSTL_CONFPROBLEM="Your configuration file or directory is not writable or there was a problem creating the configuration file. You will have to upload the following code by hand. Select in the text area to highlight all of the code and then paste into a new text file. Name this file 'configuration.php' and upload it to your site root folder." INSTL_DATABASE_SUPPORT="Database Support:" INSTL_DISPLAY_ERRORS="Display Errors" INSTL_ERROR_DB="Some errors occurred while populating the database: %s" @@ -244,7 +244,7 @@ INSTL_MB_LANGUAGE_IS_DEFAULT="MB Language is Default" INSTL_MB_STRING_OVERLOAD_OFF="MB String Overload Off" INSTL_NOTICEMBLANGNOTDEFAULT="PHP mbstring language is not set to neutral. This can be set locally by entering php_value mbstring.language neutral in your .htaccess file." INSTL_NOTICEMBSTRINGOVERLOAD="PHP mbstring function overload is set. This can be turned off locally by entering php_value mbstring.func_overload 0 in your .htaccess file." -INSTL_NOTICEYOUCANSTILLINSTALL="
    You can still continue the installation as the configuration settings will be displayed at the end. You will have to manually upload the code. Click in the text area to highlight all of the code and then paste into a new text file. Name this file 'configuration.php' and upload it to your site root folder." +INSTL_NOTICEYOUCANSTILLINSTALL="
    You can still continue the installation as the configuration settings will be displayed at the end. You will have to manually upload the code. Select in the text area to highlight all of the code and then paste into a new text file. Name this file 'configuration.php' and upload it to your site root folder." INSTL_OUTPUT_BUFFERING="Output Buffering" INSTL_PARSE_INI_FILE_AVAILABLE="INI Parser Support" INSTL_PHP_VERSION="PHP Version" diff --git a/language/en-GB/en-GB.com_users.ini b/language/en-GB/en-GB.com_users.ini index fd21f40377a2f..669f7edb30bc9 100644 --- a/language/en-GB/en-GB.com_users.ini +++ b/language/en-GB/en-GB.com_users.ini @@ -11,20 +11,20 @@ COM_USERS_DESIRED_PASSWORD="Enter your desired password." COM_USERS_DESIRED_USERNAME="Enter your desired username." COM_USERS_EDIT_PROFILE="Edit Profile" COM_USERS_EMAIL_ACCOUNT_DETAILS="Account Details for %s at %s" -COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY="Hello administrator,\n\nA new user has registered at %s.\nThe user has verified his email address and requests that you approve his account.\nThis email contains their details:\n\n Name : %s \n email: %s \n Username: %s \n\nYou can activate the user by clicking on the link below:\n %s \n" +COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_BODY="Hello administrator,\n\nA new user has registered at %s.\nThe user has verified his email address and requests that you approve his account.\nThis email contains their details:\n\n Name : %s \n email: %s \n Username: %s \n\nYou can activate the user by selecting on the link below:\n %s \n" COM_USERS_EMAIL_ACTIVATE_WITH_ADMIN_ACTIVATION_SUBJECT="Registration approval required for account of %s at %s" COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_BODY="Hello %s,\n\nYour account has been activated by an administrator. You can now login at %s using the username %s and the password you chose while registering." COM_USERS_EMAIL_ACTIVATED_BY_ADMIN_ACTIVATION_SUBJECT="Account activated for %s at %s" -COM_USERS_EMAIL_PASSWORD_RESET_BODY="Hello,\n\nA request has been made to reset your %s account password. To reset your password, you will need to submit this verification code in order to verify that the request was legitimate.\n\nThe verification code is %s\n\nClick on the URL below and proceed with resetting your password.\n\n %s \n\nThank you." +COM_USERS_EMAIL_PASSWORD_RESET_BODY="Hello,\n\nA request has been made to reset your %s account password. To reset your password, you will need to submit this verification code in order to verify that the request was legitimate.\n\nThe verification code is %s\n\nSelect the URL below and proceed with resetting your password.\n\n %s \n\nThank you." COM_USERS_EMAIL_PASSWORD_RESET_SUBJECT="Your %s password reset request" COM_USERS_EMAIL_REGISTERED_BODY="Hello %s,\n\nThank you for registering at %s.\n\nYou may now log in to %s using the following username and password:\n\nUsername: %s\nPassword: %s" COM_USERS_EMAIL_REGISTERED_BODY_NOPW="Hello %s,\n\nThank you for registering at %s.\n\nYou may now log in to %s using the username and password you registered with." COM_USERS_EMAIL_REGISTERED_NOTIFICATION_TO_ADMIN_BODY="Hello administrator, \n\nA new user '%s', username '%s', has registered at %s." -COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nTo activate the account click on the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the following username and password:\n\nUsername: %s\nPassword: %s" -COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nTo activate the account click on the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s" -COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nTo verify the account click on the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and password:\n\nUsername: %s\nPassword: %s" -COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nTo verify the account click on the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s" -COM_USERS_EMAIL_USERNAME_REMINDER_BODY="Hello,\n\nA username reminder has been requested for your %s account.\n\nYour username is %s.\n\nTo login to your account, click on the link below.\n\n%s \n\nThank you." +COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nTo activate the account select the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the following username and password:\n\nUsername: %s\nPassword: %s" +COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY_NOPW="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nTo activate the account select the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s" +COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nTo verify the account select the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and password:\n\nUsername: %s\nPassword: %s" +COM_USERS_EMAIL_REGISTERED_WITH_ADMIN_ACTIVATION_BODY_NOPW="Hello %s,\n\nThank you for registering at %s. Your account is created and must be verified before you can use it.\nTo verify the account select the following link or copy-paste it in your browser:\n %s \n\nAfter verification an administrator will be notified to activate your account. You'll receive a confirmation when it's done.\nOnce that account has been activated you may login to %s using the following username and the password you entered during registration:\n\nUsername: %s" +COM_USERS_EMAIL_USERNAME_REMINDER_BODY="Hello,\n\nA username reminder has been requested for your %s account.\n\nYour username is %s.\n\nTo login to your account, select the link below.\n\n%s \n\nThank you." COM_USERS_EMAIL_USERNAME_REMINDER_SUBJECT="Your %s username" COM_USERS_ERROR_SECRET_CODE_WITHOUT_TFA="You have entered a Secret Code but two factor authentication is not enabled in your user account. If you want to use a secret code to secure your login please edit your user profile and enable two factor authentication." COM_USERS_FIELD_PASSWORD_RESET_DESC="Please enter the email address associated with your User account.
    A verification code will be sent to you. Once you have received the verification code, you will be able to choose a new password for your account." @@ -119,8 +119,8 @@ COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED="An error was encounte COM_USERS_REGISTRATION_ACTIVATION_SAVE_FAILED="Failed to save activation data: %s" COM_USERS_REGISTRATION_ADMINACTIVATE_SUCCESS="The user's account has been successfully activated and the user has been notified about it." COM_USERS_REGISTRATION_BIND_FAILED="Failed to bind registration data: %s" -COM_USERS_REGISTRATION_COMPLETE_ACTIVATE="Your account has been created and an activation link has been sent to the email address you entered. Note that you must activate the account by clicking on the activation link when you get the email before you can login." -COM_USERS_REGISTRATION_COMPLETE_VERIFY="Your account has been created and a verification link has been sent to the email address you entered. Note that you must verify the account by clicking on the verification link when you get the email and then an administrator will activate your account before you can login." +COM_USERS_REGISTRATION_COMPLETE_ACTIVATE="Your account has been created and an activation link has been sent to the email address you entered. Note that you must activate the account by selecting the activation link when you get the email before you can login." +COM_USERS_REGISTRATION_COMPLETE_VERIFY="Your account has been created and a verification link has been sent to the email address you entered. Note that you must verify the account by selecting the verification link when you get the email and then an administrator will activate your account before you can login." COM_USERS_REGISTRATION_DEFAULT_LABEL="User Registration" COM_USERS_REGISTRATION_SAVE_FAILED="Registration failed: %s" COM_USERS_REGISTRATION_SAVE_SUCCESS="Thank you for registering. You may now log in using the username and password you registered with." diff --git a/language/en-GB/en-GB.ini b/language/en-GB/en-GB.ini index f0263c8dc182a..cccedcc362cbe 100644 --- a/language/en-GB/en-GB.ini +++ b/language/en-GB/en-GB.ini @@ -172,7 +172,7 @@ JGLOBAL_AUTO="Auto" JGLOBAL_CATEGORY_NOT_FOUND="Category not found" JGLOBAL_CENTER="Center" JGLOBAL_CHECK_ALL="Check All" -JGLOBAL_CLICK_TO_SORT_THIS_COLUMN="Click to sort by this column" +JGLOBAL_CLICK_TO_SORT_THIS_COLUMN="Select to sort by this column" JGLOBAL_CREATED_DATE_ON="Created on %s" JGLOBAL_DESCRIPTION="Description" JGLOBAL_DISPLAY_NUM="Display #" diff --git a/language/en-GB/en-GB.lib_joomla.ini b/language/en-GB/en-GB.lib_joomla.ini index 6182fe54b5489..7cfe833b73bd4 100644 --- a/language/en-GB/en-GB.lib_joomla.ini +++ b/language/en-GB/en-GB.lib_joomla.ini @@ -327,7 +327,7 @@ JLIB_FORM_VALUE_INHERITED="Inherited" JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_ACL="ACL" JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_TABLE="Table" JLIB_HTML_ACCESS_SUMMARY_DESC_CAPTION="ACL Summary Table" -JLIB_HTML_ACCESS_SUMMARY_DESC="Shown below is an overview of the permission settings for this article. Click the tabs above to customise these settings by action." +JLIB_HTML_ACCESS_SUMMARY_DESC="Shown below is an overview of the permission settings for this article. Select the tabs above to customise these settings by action." JLIB_HTML_ACCESS_SUMMARY="Summary" JLIB_HTML_ADD_TO_ROOT="Add to root" JLIB_HTML_ADD_TO_THIS_MENU="Add to this menu" @@ -356,12 +356,12 @@ JLIB_HTML_BEHAVIOR_GO_TODAY="Go to today" JLIB_HTML_BEHAVIOR_GREEN="Green" JLIB_HTML_BEHAVIOR_HOLD_MOUSE="- Hold mouse button on any of the buttons above for faster selection." JLIB_HTML_BEHAVIOR_MONTH_SELECT="- Use the < and > buttons to select month\n" -JLIB_HTML_BEHAVIOR_NEXT_MONTH_HOLD_FOR_MENU="Click to move to the next month. Click and hold for a list of the months." -JLIB_HTML_BEHAVIOR_NEXT_YEAR_HOLD_FOR_MENU="Click to move to the next year. Click and hold for a list of years." -JLIB_HTML_BEHAVIOR_PREV_MONTH_HOLD_FOR_MENU="Click to move to the previous month. Click and hold for a list of the months." -JLIB_HTML_BEHAVIOR_PREV_YEAR_HOLD_FOR_MENU="Click to move to the previous year. Click and hold for a list of years." +JLIB_HTML_BEHAVIOR_NEXT_MONTH_HOLD_FOR_MENU="Select to move to the next month. Select and hold for a list of the months." +JLIB_HTML_BEHAVIOR_NEXT_YEAR_HOLD_FOR_MENU="Select to move to the next year. Select and hold for a list of years." +JLIB_HTML_BEHAVIOR_PREV_MONTH_HOLD_FOR_MENU="Select to move to the previous month. Select and hold for a list of the months." +JLIB_HTML_BEHAVIOR_PREV_YEAR_HOLD_FOR_MENU="Select to move to the previous year. Select and hold for a list of years." JLIB_HTML_BEHAVIOR_SELECT_DATE="Select a date." -JLIB_HTML_BEHAVIOR_SHIFT_CLICK_OR_DRAG_TO_CHANGE_VALUE="(Shift-)Click or Drag to change the value." +JLIB_HTML_BEHAVIOR_SHIFT_CLICK_OR_DRAG_TO_CHANGE_VALUE="(Shift-)Select or Drag to change the value." JLIB_HTML_BEHAVIOR_TIME="Time:" JLIB_HTML_BEHAVIOR_TODAY="Today" JLIB_HTML_BEHAVIOR_TT_DATE_FORMAT="%a, %b %e" @@ -642,8 +642,8 @@ JLIB_RULES_NOT_ALLOWED_LOCKED="Not Allowed (Locked)." JLIB_RULES_NOT_SET="Not Set" JLIB_RULES_SELECT_ALLOW_DENY_GROUP="Allow or deny %s for users in the %s group." JLIB_RULES_SELECT_SETTING="Select New Setting 1" -JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this and all child groups, components and content. Note that Denied will overrule any inherited setting and also the setting in any child group, component or content. In the case of a setting conflict, Deny will take precedence. Not Set is equivalent to Denied but can be changed in child groups, components and content.
    2. If you select a new setting, click Save to refresh the calculated settings." -JLIB_RULES_SETTING_NOTES_ITEM="1. If you change the setting, it will apply to this item. Note that:
    Inherited means that the permissions from global configuration, parent group and category will be used.
    Denied means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this item.
    Allowed means that the group being edited will be able to take this action for this item (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, click Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES="1. If you change the setting, it will apply to this and all child groups, components and content. Note that Denied will overrule any inherited setting and also the setting in any child group, component or content. In the case of a setting conflict, Deny will take precedence. Not Set is equivalent to Denied but can be changed in child groups, components and content.
    2. If you select a new setting, select Save to refresh the calculated settings." +JLIB_RULES_SETTING_NOTES_ITEM="1. If you change the setting, it will apply to this item. Note that:
    Inherited means that the permissions from global configuration, parent group and category will be used.
    Denied means that no matter what the global configuration, parent group or category settings are, the group being edited can't take this action on this item.
    Allowed means that the group being edited will be able to take this action for this item (but if this is in conflict with the global configuration, parent group or category it will have no impact; a conflict will be indicated by Not Allowed (Locked) under Calculated Settings).
    2. If you select a new setting, select Save to refresh the calculated settings." JLIB_RULES_SETTINGS_DESC="Manage the permission settings for the user groups below. See notes at the bottom." JLIB_UNKNOWN="Unknown" diff --git a/language/en-GB/en-GB.mod_banners.ini b/language/en-GB/en-GB.mod_banners.ini index e7022444acb05..e8eda8ca71861 100644 --- a/language/en-GB/en-GB.mod_banners.ini +++ b/language/en-GB/en-GB.mod_banners.ini @@ -21,7 +21,7 @@ MOD_BANNERS_FIELD_RANDOMISE_DESC="Randomise the ordering of the banners." MOD_BANNERS_FIELD_RANDOMISE_LABEL="Randomise" MOD_BANNERS_FIELD_TAG_DESC="Banner is selected by matching the banner tags to the current document meta keywords." MOD_BANNERS_FIELD_TAG_LABEL="Search by Meta Keyword" -MOD_BANNERS_FIELD_TARGET_DESC="Target window when the link is clicked." +MOD_BANNERS_FIELD_TARGET_DESC="Target window when the link is selected." MOD_BANNERS_FIELD_TARGET_LABEL="Target" MOD_BANNERS_VALUE_STICKYORDERING="Pinned, Ordering" MOD_BANNERS_VALUE_STICKYRANDOMISE="Pinned, Randomise" diff --git a/language/en-GB/en-GB.mod_random_image.ini b/language/en-GB/en-GB.mod_random_image.ini index d616b6e4e52c0..b5d2cba015dfe 100644 --- a/language/en-GB/en-GB.mod_random_image.ini +++ b/language/en-GB/en-GB.mod_random_image.ini @@ -8,7 +8,7 @@ MOD_RANDOM_IMAGE_FIELD_FOLDER_DESC="Path to the image folder relative to the sit MOD_RANDOM_IMAGE_FIELD_FOLDER_LABEL="Image Folder" MOD_RANDOM_IMAGE_FIELD_HEIGHT_DESC="Image height forces all images to be displayed with the height in pixels." MOD_RANDOM_IMAGE_FIELD_HEIGHT_LABEL="Height (px)" -MOD_RANDOM_IMAGE_FIELD_LINK_DESC="A URL to redirect to if the image is clicked upon (eg http://www.joomla.org)." +MOD_RANDOM_IMAGE_FIELD_LINK_DESC="A URL to redirect to if the image is selected (eg http://www.joomla.org)." MOD_RANDOM_IMAGE_FIELD_LINK_LABEL="Link" MOD_RANDOM_IMAGE_FIELD_TYPE_DESC="Type of image PNG/GIF/JPG etc (the default is JPG)." MOD_RANDOM_IMAGE_FIELD_TYPE_LABEL="Image Type" diff --git a/language/en-GB/en-GB.mod_weblinks.ini b/language/en-GB/en-GB.mod_weblinks.ini index 32586d18eba8e..19233b5b5f420 100644 --- a/language/en-GB/en-GB.mod_weblinks.ini +++ b/language/en-GB/en-GB.mod_weblinks.ini @@ -19,7 +19,7 @@ MOD_WEBLINKS_FIELD_ORDERDIRECTION_DESC="Set the ordering direction." MOD_WEBLINKS_FIELD_ORDERDIRECTION_LABEL="Direction" MOD_WEBLINKS_FIELD_ORDERING_DESC="Ordering for the Web Links." MOD_WEBLINKS_FIELD_ORDERING_LABEL="Ordering" -MOD_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is clicked." +MOD_WEBLINKS_FIELD_TARGET_DESC="Target browser window when the link is selected." MOD_WEBLINKS_FIELD_TARGET_LABEL="Target Window" MOD_WEBLINKS_FIELD_VALUE_ASCENDING="Ascending" MOD_WEBLINKS_FIELD_VALUE_DESCENDING="Descending" diff --git a/language/en-GB/en-GB.tpl_beez3.ini b/language/en-GB/en-GB.tpl_beez3.ini index d518389a0b858..5eda6a9062548 100644 --- a/language/en-GB/en-GB.tpl_beez3.ini +++ b/language/en-GB/en-GB.tpl_beez3.ini @@ -7,7 +7,7 @@ TPL_BEEZ3_ADDITIONAL_INFORMATION="Additional information" TPL_BEEZ3_ALTCLOSE="is closed" TPL_BEEZ3_ALTOPEN="is open" TPL_BEEZ3_BIGGER="Bigger" -TPL_BEEZ3_CLICK="click" +TPL_BEEZ3_CLICK="select" TPL_BEEZ3_CLOSEMENU="Close Menu" TPL_BEEZ3_DECREASE_SIZE="Decrease size" TPL_BEEZ3_ERROR_JUMP_TO_NAV="Jump to navigation" @@ -19,7 +19,7 @@ TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_DESC="Choose a colour for the Background TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_LABEL="Background Colour" TPL_BEEZ3_FIELD_HEADER_IMAGE_DESC="Select or upload an image to be used as a header image when the custom colour option is selected." TPL_BEEZ3_FIELD_HEADER_IMAGE_LABEL="Header Image" -TPL_BEEZ3_FIELD_LOGO_DESC="Select or upload an image. If you do not want to display a logo, click on Clear and leave the field blank." +TPL_BEEZ3_FIELD_LOGO_DESC="Select or upload an image. If you do not want to display a logo, select Clear and leave the field blank." TPL_BEEZ3_FIELD_LOGO_LABEL="Logo" TPL_BEEZ3_FIELD_NAVPOSITION_DESC="Navigation before or after content." TPL_BEEZ3_FIELD_NAVPOSITION_LABEL="Position of Navigation" diff --git a/templates/beez3/language/en-GB/en-GB.tpl_beez3.ini b/templates/beez3/language/en-GB/en-GB.tpl_beez3.ini index 2629583ab943b..a769bade3e23c 100644 --- a/templates/beez3/language/en-GB/en-GB.tpl_beez3.ini +++ b/templates/beez3/language/en-GB/en-GB.tpl_beez3.ini @@ -7,7 +7,7 @@ TPL_BEEZ3_ADDITIONAL_INFORMATION="Additional information" TPL_BEEZ3_ALTCLOSE="is closed" TPL_BEEZ3_ALTOPEN="is open" TPL_BEEZ3_BIGGER="Bigger" -TPL_BEEZ3_CLICK="click" +TPL_BEEZ3_CLICK="select" TPL_BEEZ3_CLOSEMENU="Close Menu" TPL_BEEZ3_DECREASE_SIZE="Decrease size" TPL_BEEZ3_ERROR_JUMP_TO_NAV="Jump to navigation" @@ -19,7 +19,7 @@ TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_DESC="Choose a colour for the Background TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_LABEL="Background Colour" TPL_BEEZ3_FIELD_HEADER_IMAGE_DESC="Use the selected header image when Custom is selected as the Template Colour" TPL_BEEZ3_FIELD_HEADER_IMAGE_LABEL="Header Image" -TPL_BEEZ3_FIELD_LOGO_DESC="Please choose an image. If you do not want to display a logo, click on Clear and leave the field blank." +TPL_BEEZ3_FIELD_LOGO_DESC="Please choose an image. If you do not want to display a logo, select Clear and leave the field blank." TPL_BEEZ3_FIELD_LOGO_LABEL="Logo" TPL_BEEZ3_FIELD_NAVPOSITION_DESC="Navigation before or after content." TPL_BEEZ3_FIELD_NAVPOSITION_LABEL="Position of Navigation" From 8063135dbf71445349bc9b7be5bb6cfb8c9d3197 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Mon, 13 Jul 2015 23:40:07 +0100 Subject: [PATCH 635/809] Remove assertThat --- .../suites/libraries/cms/html/JHtmlTest.php | 419 ++++++++---------- 1 file changed, 190 insertions(+), 229 deletions(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlTest.php b/tests/unit/suites/libraries/cms/html/JHtmlTest.php index 0957f779ae7c9..735bf7551ba48 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlTest.php @@ -59,15 +59,15 @@ public function test_() JHtml::addIncludePath(array(__DIR__ . '/testfiles')); // Test the class method was called and the arguments passed correctly. - $this->assertThat( + $this->assertEquals( JHtml::_('inspector.method1', 'argument1', 'argument2'), - $this->equalTo('JHtmlInspector::method1'), + 'JHtmlInspector::method1', 'JHtmlInspector::method1 could not be called.' ); - $this->assertThat( + $this->assertEquals( JHtmlInspector::$arguments[0], - $this->equalTo(array('argument1', 'argument2')), + array('argument1', 'argument2'), 'The arguments where not correctly passed to JHtmlInspector::method1.' ); } @@ -87,9 +87,8 @@ public function test_WithMissingClass() // Test a class that doesn't exist. $this->setExpectedException('InvalidArgumentException'); - $this->assertThat( - JHtml::_('empty.anything'), - $this->isFalse() + $this->assertFalse( + JHtml::_('empty.anything') ); } @@ -108,9 +107,8 @@ public function test_WithMissingFile() // Test a file that doesn't exist. $this->setExpectedException('InvalidArgumentException'); - $this->assertThat( - JHtml::_('nofile.anything'), - $this->isFalse() + $this->assertFalse( + JHtml::_('nofile.anything') ); } @@ -129,9 +127,8 @@ public function test_WithMissingMethod() // Test a method that doesn't exist. $this->setExpectedException('InvalidArgumentException'); - $this->assertThat( - JHtml::_('inspector.nomethod'), - $this->isFalse() + $this->assertFalse( + JHtml::_('inspector.nomethod') ); } @@ -147,9 +144,8 @@ public function testRegister() $registered = $this->getMock('MyHtmlClass', array('mockFunction')); // Test that we can register the method - $this->assertThat( + $this->assertTrue( JHtml::register('prefix.register.testfunction', array($registered, 'mockFunction')), - $this->isTrue(), 'The class method did not register properly.' ); @@ -159,9 +155,8 @@ public function testRegister() JHtml::_('prefix.register.testfunction'); - $this->assertThat( + $this->assertFalse( JHtml::register('prefix.register.missingtestfunction', array($registered, 'missingFunction')), - $this->isFalse(), 'Registering a missing method should fail.' ); } @@ -180,15 +175,13 @@ public function testUnregister() JHtml::register('prefix.unregister.testfunction', array($registered, 'mockFunction')); - $this->assertThat( + $this->assertTrue( JHtml::unregister('prefix.unregister.testfunction'), - $this->isTrue(), 'The method was not unregistered.' ); - $this->assertThat( + $this->assertFalse( JHtml::unregister('prefix.unregister.testkeynotthere'), - $this->isFalse(), 'Unregistering a missing method should fail.' ); } @@ -207,15 +200,13 @@ public function testIsRegistered() // Test that we can register the method. JHtml::register('prefix.isregistered.method', array($registered, 'mockFunction')); - $this->assertThat( + $this->assertTrue( JHtml::isRegistered('prefix.isregistered.method'), - $this->isTrue(), 'Calling isRegistered on a valid method should pass.' ); - $this->assertThat( + $this->assertFalse( JHtml::isRegistered('prefix.isregistered.nomethod'), - $this->isFalse(), 'Calling isRegistered on a missing method should fail.' ); } @@ -264,7 +255,10 @@ public function dataTestLink() */ public function testLink($url, $text, $attribs, $expected) { - $this->assertThat(JHtml::link($url, $text, $attribs), $this->equalTo($expected)); + $this->assertEquals( + JHtml::link($url, $text, $attribs), + $expected + ); } /** @@ -311,17 +305,15 @@ public function testImage() file_put_contents(JPATH_THEMES . '/' . $template . '/images/' . $urlpath . $urlfilename, 'test'); // We do a test for the case that the image is in the templates directory. - $this->assertThat( + $this->assertEquals( JHtml::image($urlpath . $urlfilename, 'My Alt Text', null, true), - $this->equalTo( - 'My Alt Text' - ), + 'My Alt Text', 'JHtml::image failed when we should get it from the templates directory' ); - $this->assertThat( + $this->assertEquals( JHtml::image($urlpath . $urlfilename, 'My Alt Text', null, true, true), - $this->equalTo(JUri::base(true) . '/templates/' . $template . '/images/' . $urlpath . $urlfilename), + JUri::base(true) . '/templates/' . $template . '/images/' . $urlpath . $urlfilename, 'JHtml::image failed in URL only mode when it should come from the templates directory' ); @@ -338,15 +330,15 @@ public function testImage() file_put_contents(JPATH_ROOT . '/media/' . $urlpath . 'images/' . $urlfilename, 'test'); // We do a test for the case that the image is in the media directory. - $this->assertThat( + $this->assertEquals( JHtml::image($urlpath . $urlfilename, 'My Alt Text', null, true), - $this->equalTo('My Alt Text'), + 'My Alt Text', 'JHtml::image failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::image($urlpath . $urlfilename, 'My Alt Text', null, true, true), - $this->equalTo(JUri::base(true) . '/media/' . $urlpath . 'images/' . $urlfilename), + JUri::base(true) . '/media/' . $urlpath . 'images/' . $urlfilename, 'JHtml::image failed when we should get it from the media directory in path only mode' ); @@ -361,29 +353,28 @@ public function testImage() } file_put_contents(JPATH_ROOT . '/media/system/images/' . $urlfilename, 'test'); - $this->assertThat( + $this->assertEquals( JHtml::image($urlpath . $urlfilename, 'My Alt Text', null, true), - $this->equalTo('My Alt Text'), + 'My Alt Text', 'JHtml::image failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::image($urlpath . $urlfilename, 'My Alt Text', null, true, true), - $this->equalTo(JUri::base(true) . '/media/system/images/' . $urlfilename), + JUri::base(true) . '/media/system/images/' . $urlfilename, 'JHtml::image failed when we should get it from the media directory in path only mode' ); unlink(JPATH_ROOT . '/media/system/images/' . $urlfilename); - $this->assertThat( + $this->assertEquals( JHtml::image($urlpath . $urlfilename, 'My Alt Text', null, true), - $this->equalTo('My Alt Text'), + 'My Alt Text', 'JHtml::image failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertNull( JHtml::image($urlpath . $urlfilename, 'My Alt Text', null, true, true), - $this->equalTo(null), 'JHtml::image failed when we should get it from the media directory in path only mode' ); @@ -395,18 +386,16 @@ public function testImage() mkdir(JPATH_ROOT . '/media/' . $extension . '/' . $element . '/images/' . $urlpath, 0777, true); file_put_contents(JPATH_ROOT . '/media/' . $extension . '/' . $element . '/images/' . $urlpath . $urlfilename, 'test'); - $this->assertThat( + $this->assertEquals( JHtml::image($extension . '/' . $element . '/' . $urlpath . $urlfilename, 'My Alt Text', null, true), - $this->equalTo( - 'My Alt Text' - ), + 'My Alt Text', 'JHtml::image failed when we should get it from the media directory, with the plugin fix' ); - $this->assertThat( + $this->assertEquals( JHtml::image($extension . '/' . $element . '/' . $urlpath . $urlfilename, 'My Alt Text', null, true, true), - $this->equalTo(JUri::base(true) . '/media/' . $extension . '/' . $element . '/images/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/' . $extension . '/' . $element . '/images/' . $urlpath . $urlfilename, 'JHtml::image failed when we should get it from the media directory, with the plugin fix path only mode' ); @@ -420,17 +409,15 @@ public function testImage() mkdir(JPATH_ROOT . '/media/' . $extension . '/images/' . $element . '/' . $urlpath, 0777, true); file_put_contents(JPATH_ROOT . '/media/' . $extension . '/images/' . $element . '/' . $urlpath . $urlfilename, 'test'); - $this->assertThat( + $this->assertEquals( JHtml::image($extension . '/' . $element . '/' . $urlpath . $urlfilename, 'My Alt Text', null, true), - $this->equalTo( - 'My Alt Text' - ) + 'My Alt Text' ); - $this->assertThat( + $this->assertEquals( JHtml::image($extension . '/' . $element . '/' . $urlpath . $urlfilename, 'My Alt Text', null, true, true), - $this->equalTo(JUri::base(true) . '/media/' . $extension . '/images/' . $element . '/' . $urlpath . $urlfilename) + JUri::base(true) . '/media/' . $extension . '/images/' . $element . '/' . $urlpath . $urlfilename ); unlink(JPATH_ROOT . '/media/' . $extension . '/images/' . $element . '/' . $urlpath . $urlfilename); @@ -442,63 +429,60 @@ public function testImage() mkdir(JPATH_ROOT . '/media/system/images/' . $element . '/' . $urlpath, 0777, true); file_put_contents(JPATH_ROOT . '/media/system/images/' . $element . '/' . $urlpath . $urlfilename, 'test'); - $this->assertThat( + $this->assertEquals( JHtml::image($extension . '/' . $element . '/' . $urlpath . $urlfilename, 'My Alt Text', null, true), - $this->equalTo( - 'My Alt Text' - ) + 'My Alt Text' ); - $this->assertThat( + $this->assertEquals( JHtml::image( $extension . '/' . $element . '/' . $urlpath . $urlfilename, 'My Alt Text', null, true, true ), - $this->equalTo(JUri::base(true) . '/media/system/images/' . $element . '/' . $urlpath . $urlfilename) + JUri::base(true) . '/media/system/images/' . $element . '/' . $urlpath . $urlfilename ); unlink(JPATH_ROOT . '/media/system/images/' . $element . '/' . $urlpath . $urlfilename); rmdir(JPATH_ROOT . '/media/system/images/' . $element . '/' . $urlpath); rmdir(JPATH_ROOT . '/media/system/images/' . $element); - $this->assertThat( + $this->assertEquals( JHtml::image($extension . '/' . $element . '/' . $urlpath . $urlfilename, 'My Alt Text', null, true), - $this->equalTo('My Alt Text') + 'My Alt Text' ); - $this->assertThat( + $this->assertNull( JHtml::image( $extension . '/' . $element . '/' . $urlpath . $urlfilename, 'My Alt Text', null, true, true - ), - $this->equalTo(null) + ) ); - $this->assertThat( + $this->assertEquals( JHtml::image( 'http://www.example.com/test/image.jpg', 'My Alt Text', array( 'width' => 150, 'height' => 150 ) ), - $this->equalTo('My Alt Text'), + 'My Alt Text', 'JHtml::image with an absolute path' ); mkdir(JPATH_ROOT . '/test', 0777, true); file_put_contents(JPATH_ROOT . '/test/image.jpg', 'test'); - $this->assertThat( + $this->assertEquals( JHtml::image('test/image.jpg', 'My Alt Text', array('width' => 150, 'height' => 150), false), - $this->equalTo('My Alt Text'), + 'My Alt Text', 'JHtml::image with an absolute path, URL does not start with http' ); unlink(JPATH_ROOT . '/test/image.jpg'); rmdir(JPATH_ROOT . '/test'); - $this->assertThat( + $this->assertEquals( JHtml::image('test/image.jpg', 'My Alt Text', array('width' => 150, 'height' => 150), false), - $this->equalTo('My Alt Text'), + 'My Alt Text', 'JHtml::image with an absolute path, URL does not start with http' ); @@ -552,9 +536,9 @@ public function dataTestIFrame() */ public function testIframe($url, $name, $attribs, $noFrames, $expected) { - $this->assertThat( + $this->assertEquals( JHtml::iframe($url, $name, $attribs, $noFrames), - $this->equalTo($expected) + $expected ); } @@ -611,9 +595,9 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the templates directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script($urlpath . $urlfilename, false, true, true), - $this->equalTo(JUri::base(true) . '/templates/' . $template . '/js/' . $urlpath . $urlfilename), + JUri::base(true) . '/templates/' . $template . '/js/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the templates directory' ); @@ -639,9 +623,9 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script($urlpath . $urlfilename, false, true, true), - $this->equalTo(JUri::base(true) . '/media/' . $urlpath . 'js/' . $urlfilename), + JUri::base(true) . '/media/' . $urlpath . 'js/' . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -666,9 +650,9 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script($urlpath . $urlfilename, false, true, true), - $this->equalTo(JUri::base(true) . '/media/system/js/' . $urlfilename), + JUri::base(true) . '/media/system/js/' . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -678,15 +662,14 @@ public function testScript() // We do a test for the case that the js is in the media directory. JHtml::script($urlpath . $urlfilename, false, true); - $this->assertThat( + $this->assertArrayNotHasKey( JFactory::$document->_scripts, - $this->logicalNot($this->arrayHasKey('/media/system/js/' . $urlfilename)), + '/media/system/js/' . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEmpty( JHtml::script($urlpath . $urlfilename, false, true, true), - $this->equalTo(''), 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -705,9 +688,9 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script($extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true, true), - $this->equalTo(JUri::base(true) . '/media/' . $extension . '/' . $element . '/js/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/' . $extension . '/' . $element . '/js/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -729,9 +712,9 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script($extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true, true), - $this->equalTo(JUri::base(true) . '/media/' . $extension . '/js/' . $element . '/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/' . $extension . '/js/' . $element . '/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -751,9 +734,9 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script($extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true, true), - $this->equalTo(JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -770,9 +753,8 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEmpty( JHtml::script($extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true, true), - $this->equalTo(''), 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -797,22 +779,20 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script($extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true, true), - $this->equalTo( - array( - JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . $urlfilename, - JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1_mybrowser.js', - JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1_mybrowser_0.js', - JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1_mybrowser_0_0.js' - ) + array( + JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . $urlfilename, + JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1_mybrowser.js', + JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1_mybrowser_0.js', + JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1_mybrowser_0_0.js' ), 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script($extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true, true, false), - $this->equalTo(JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -838,15 +818,15 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertArrayNotHasKey( JFactory::$document->_scripts, - $this->logicalNot($this->arrayHasKey('/media/system/js/' . $element . '/' . $urlpath . $urlfilename)), + '/media/system/js/' . $element . '/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script($extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true, true), - $this->equalTo(JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js'), + JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js', 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -860,15 +840,15 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertArrayNotHasKey( JFactory::$document->_scripts, - $this->logicalNot($this->arrayHasKey('/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js')), + '/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js', 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script($extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true, true), - $this->equalTo(JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1.js'), + JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1.js', 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -882,18 +862,18 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertArrayNotHasKey( JFactory::$document->_scripts, - $this->logicalNot($this->arrayHasKey('/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js')), + '/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js', 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script( $extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true, true, true, false ), - $this->equalTo(JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -907,18 +887,18 @@ public function testScript() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertArrayNotHasKey( JFactory::$document->_scripts, - $this->logicalNot($this->arrayHasKey('/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js')), + '/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js', 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::script( $extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true, true, true, false ), - $this->equalTo(JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1.js'), + JUri::base(true) . '/media/system/js/' . $element . '/' . $urlpath . 'script1.js', 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -983,9 +963,9 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the templates directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($urlpath . $urlfilename, array(), true, true), - $this->equalTo(JUri::base(true) . '/templates/' . $template . '/css/' . $urlpath . $urlfilename), + JUri::base(true) . '/templates/' . $template . '/css/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the templates directory' ); @@ -1010,9 +990,9 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($urlpath . $urlfilename, array(), true, true), - $this->equalTo(JUri::base(true) . '/media/' . $urlpath . 'css/' . $urlfilename), + JUri::base(true) . '/media/' . $urlpath . 'css/' . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1037,9 +1017,9 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($urlpath . $urlfilename, array(), true, true), - $this->equalTo(JUri::base(true) . '/media/system/css/' . $urlfilename), + JUri::base(true) . '/media/system/css/' . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1049,15 +1029,14 @@ public function testStylesheet() // We do a test for the case that the css is in the media directory. JHtml::stylesheet($urlpath . $urlfilename, array(), true); - $this->assertThat( + $this->assertArrayNotHasKey( JFactory::$document->_styleSheets, - $this->logicalNot($this->arrayHasKey('/media/system/css/' . $urlfilename)), + '/media/system/css/' . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEmpty( JHtml::stylesheet($urlpath . $urlfilename, array(), true, true), - $this->equalTo(''), 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1076,9 +1055,9 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true, true), - $this->equalTo(JUri::base(true) . '/media/' . $extension . '/' . $element . '/css/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/' . $extension . '/' . $element . '/css/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1100,9 +1079,9 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true, true), - $this->equalTo(JUri::base(true) . '/media/' . $extension . '/css/' . $element . '/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/' . $extension . '/css/' . $element . '/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1127,9 +1106,9 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true, true), - $this->equalTo(JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1140,15 +1119,14 @@ public function testStylesheet() JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true); - $this->assertThat( + $this->assertArrayNotHasKey( JFactory::$document->_styleSheets, - $this->logicalNot($this->arrayHasKey('/media/system/css/' . $urlfilename)), + '/media/system/css/' . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEmpty( JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true, true), - $this->equalTo(''), 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1175,22 +1153,20 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true, true), - $this->equalTo( - array( - JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . $urlfilename, - JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1_mybrowser.css', - JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1_mybrowser_0.css', - JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1_mybrowser_0_0.css' - ) + array( + JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . $urlfilename, + JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1_mybrowser.css', + JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1_mybrowser_0.css', + JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1_mybrowser_0_0.css' ), 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true, true, false), - $this->equalTo(JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1216,15 +1192,15 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertArrayNotHasKey( JFactory::$document->_styleSheets, - $this->logicalNot($this->arrayHasKey('/media/system/css/' . $element . '/' . $urlpath . $urlfilename)), + '/media/system/css/' . $element . '/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true, true), - $this->equalTo(JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1-uncompressed.css'), + JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1-uncompressed.css', 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1238,15 +1214,15 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertArrayNotHasKey( JFactory::$document->_styleSheets, - $this->logicalNot($this->arrayHasKey('/media/system/css/' . $element . '/' . $urlpath . 'style1-uncompressed.css')), + '/media/system/css/' . $element . '/' . $urlpath . 'style1-uncompressed.css', 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true, true), - $this->equalTo(JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1.css'), + JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1.css', 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1266,9 +1242,9 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true, true, true, false), - $this->equalTo(JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . $urlfilename), + JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . $urlfilename, 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1282,15 +1258,15 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertArrayNotHasKey( JFactory::$document->_styleSheets, - $this->logicalNot($this->arrayHasKey('/media/system/css/' . $element . '/' . $urlpath . 'style1-uncompressed.css')), + '/media/system/css/' . $element . '/' . $urlpath . 'style1-uncompressed.css', 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertEquals( JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true, true, true, false), - $this->equalTo(JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1.css'), + JUri::base(true) . '/media/system/css/' . $element . '/' . $urlpath . 'style1.css', 'Line:' . __LINE__ . ' JHtml::script failed in URL only mode when it should come from the media directory' ); @@ -1359,109 +1335,94 @@ public function testTooltip() JFactory::$application = $mock; // Testing classical cases - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content'), - $this->equalTo( - 'Tooltip' - ), + 'Tooltip', 'Basic tooltip failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', 'Title'), - $this->equalTo( - 'Tooltip' ), + 'Tooltip', 'Tooltip with title and content failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', 'Title', null, 'Text'), - $this->equalTo('Text'), + 'Text', 'Tooltip with title and content and text failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', 'Title', null, 'Text', 'http://www.monsite.com'), - $this->equalTo('Text'), + 'Text', 'Tooltip with title and content and text and href failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', 'Title', 'tooltip.png', null, null, 'MyAlt'), - $this->equalTo( - 'MyAlt' - ), + 'MyAlt', 'Tooltip with title and content and alt failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', 'Title', 'tooltip.png', null, null, 'MyAlt', 'hasTooltip2'), - $this->equalTo( - 'MyAlt' - ), + 'MyAlt', 'Tooltip with title and content and alt and class failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', 'Title', null, 'Text', null, null, 'hasTip'), - $this->equalTo('Text'), + 'Text', 'Tooltip with hasTip class failed' ); // Testing where title is an array - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', array('title' => 'Title')), - $this->equalTo( - 'Tooltip' - ), + 'Tooltip', 'Tooltip with title and content failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', array('title' => 'Title', 'text' => 'Text')), - $this->equalTo('Text'), + 'Text', 'Tooltip with title and content and text failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', array('title' => 'Title', 'text' => 'Text', 'href' => 'http://www.monsite.com')), - $this->equalTo('Text'), + 'Text', 'Tooltip with title and content and text and href failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', array('title' => 'Title', 'alt' => 'MyAlt')), - $this->equalTo( - 'MyAlt' - ), + 'MyAlt', 'Tooltip with title and content and alt failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', array('title' => 'Title', 'class' => 'hasTooltip2')), - $this->equalTo( - 'Tooltip' - ), + 'Tooltip', 'Tooltip with title and content and class failed' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltip('Content', array()), - $this->equalTo( - 'Tooltip' - ), + 'Tooltip', 'Basic tooltip (array version) failed' ); } @@ -1506,9 +1467,9 @@ public function testCalendar() JFactory::$document = JDocument::getInstance('html', array('unique_key' => serialize($data))); $input = JHtml::calendar($data['date'], $data['name'], $data['id'], $data['format'], $data['attribs']); - $this->assertThat( + $this->assertGreaterThan( strlen($input), - $this->greaterThan(0), + 0, 'Line:' . __LINE__ . ' The calendar method should return something without error.' ); @@ -1637,27 +1598,27 @@ public function testCalendar() */ public function testTooltipText() { - $this->assertThat( + $this->assertEquals( JHtml::tooltipText('Title::Content'), - $this->equalTo('<strong>Title</strong><br />Content'), + '<strong>Title</strong><br />Content', 'A string with "::" should be converted' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltipText('Title:Content'), - $this->equalTo('Title:Content'), + 'Title:Content', 'A string without "::" should not be converted' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltipText('Title', 'Content'), - $this->equalTo('<strong>Title</strong><br />Content'), + '<strong>Title</strong><br />Content', 'A title and content should be combined' ); - $this->assertThat( + $this->assertEquals( JHtml::tooltipText('', 'Content'), - $this->equalTo('Content'), + 'Content', 'If no title is given, return content string' ); } From 1919c389b25dc0e26e7d35a3df2cecfdb1c66209 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 14 Jul 2015 08:59:54 +0100 Subject: [PATCH 636/809] Flip the param order for assertArrayNotHasKey --- tests/unit/suites/libraries/cms/html/JHtmlTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlTest.php b/tests/unit/suites/libraries/cms/html/JHtmlTest.php index 735bf7551ba48..0e3243c04740f 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlTest.php @@ -663,8 +663,8 @@ public function testScript() JHtml::script($urlpath . $urlfilename, false, true); $this->assertArrayNotHasKey( - JFactory::$document->_scripts, '/media/system/js/' . $urlfilename, + JFactory::$document->_scripts, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); @@ -819,8 +819,8 @@ public function testScript() ); $this->assertArrayNotHasKey( - JFactory::$document->_scripts, '/media/system/js/' . $element . '/' . $urlpath . $urlfilename, + JFactory::$document->_scripts, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); @@ -841,8 +841,8 @@ public function testScript() ); $this->assertArrayNotHasKey( - JFactory::$document->_scripts, '/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js', + JFactory::$document->_scripts, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); @@ -863,8 +863,8 @@ public function testScript() ); $this->assertArrayNotHasKey( - JFactory::$document->_scripts, '/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js', + JFactory::$document->_scripts, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); @@ -888,8 +888,8 @@ public function testScript() ); $this->assertArrayNotHasKey( - JFactory::$document->_scripts, '/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js', + JFactory::$document->_scripts, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); @@ -1030,8 +1030,8 @@ public function testStylesheet() JHtml::stylesheet($urlpath . $urlfilename, array(), true); $this->assertArrayNotHasKey( - JFactory::$document->_styleSheets, '/media/system/css/' . $urlfilename, + JFactory::$document->_styleSheets, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); @@ -1120,8 +1120,8 @@ public function testStylesheet() JHtml::stylesheet($extension . '/' . $element . '/' . $urlpath . $urlfilename, array(), true); $this->assertArrayNotHasKey( - JFactory::$document->_styleSheets, '/media/system/css/' . $urlfilename, + JFactory::$document->_styleSheets, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); From 2578b8a723e240220379655791370d1e171bf91d Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 14 Jul 2015 09:20:56 +0100 Subject: [PATCH 637/809] Fix test --- tests/unit/suites/libraries/cms/html/JHtmlTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlTest.php b/tests/unit/suites/libraries/cms/html/JHtmlTest.php index 0e3243c04740f..7653724ab3150 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlTest.php @@ -1193,8 +1193,8 @@ public function testStylesheet() ); $this->assertArrayNotHasKey( - JFactory::$document->_styleSheets, '/media/system/css/' . $element . '/' . $urlpath . $urlfilename, + JFactory::$document->_styleSheets, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); From b1e94005176af3f3a7011f1326d98c35c1b74bec Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 14 Jul 2015 09:29:04 +0100 Subject: [PATCH 638/809] Fix some more instances --- tests/unit/suites/libraries/cms/html/JHtmlTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlTest.php b/tests/unit/suites/libraries/cms/html/JHtmlTest.php index 7653724ab3150..cd087d5754f28 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlTest.php @@ -1215,8 +1215,8 @@ public function testStylesheet() ); $this->assertArrayNotHasKey( - JFactory::$document->_styleSheets, '/media/system/css/' . $element . '/' . $urlpath . 'style1-uncompressed.css', + JFactory::$document->_styleSheets, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); @@ -1236,9 +1236,9 @@ public function testStylesheet() 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); - $this->assertThat( + $this->assertArrayNotHasKey( + '/media/system/css/' . $element . '/' . $urlpath . 'style1-uncompressed.css', JFactory::$document->_styleSheets, - $this->logicalNot($this->arrayHasKey('/media/system/css/' . $element . '/' . $urlpath . 'style1-uncompressed.css')), 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); @@ -1259,8 +1259,8 @@ public function testStylesheet() ); $this->assertArrayNotHasKey( - JFactory::$document->_styleSheets, '/media/system/css/' . $element . '/' . $urlpath . 'style1-uncompressed.css', + JFactory::$document->_styleSheets, 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); From d0212af6e409f7dcc0a58977774bf334f1ea8a16 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 14 Jul 2015 09:36:02 +0100 Subject: [PATCH 639/809] Remove last use of assertThat --- tests/unit/suites/libraries/cms/html/JHtmlTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlTest.php b/tests/unit/suites/libraries/cms/html/JHtmlTest.php index cd087d5754f28..cd90ac569e2b9 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlTest.php @@ -747,9 +747,9 @@ public function testScript() JHtml::script($extension . '/' . $element . '/' . $urlpath . $urlfilename, false, true); - $this->assertThat( + $this->assertArrayNotHasKey( + '/media/system/js/' . $urlfilename, JFactory::$document->_scripts, - $this->logicalNot($this->arrayHasKey('/media/system/js/' . $urlfilename)), 'Line:' . __LINE__ . ' JHtml::script failed when we should get it from the media directory' ); From 13a01333c844f2b462babb0eec8980817427907b Mon Sep 17 00:00:00 2001 From: wilsonge Date: Tue, 14 Jul 2015 23:20:05 +0100 Subject: [PATCH 640/809] Use mock cms application --- .../suites/libraries/cms/html/JHtmlTest.php | 29 ++++--------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlTest.php b/tests/unit/suites/libraries/cms/html/JHtmlTest.php index cd90ac569e2b9..2978260c0967b 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlTest.php @@ -29,6 +29,8 @@ protected function setUp() parent::setUp(); $this->saveFactoryState(); + + JFactory::$application = $this->getMockCmsApp(); } /** @@ -290,13 +292,10 @@ public function testImage() // We create a stub (not a mock because we don't enforce whether it is called or not) // to return a value from getTemplate. - $mock = $this->getMock('myMockObject', array('getTemplate')); - $mock->expects($this->any()) + JFactory::$application->expects($this->any()) ->method('getTemplate') ->will($this->returnValue($template)); - JFactory::$application = $mock; - // We create the file that JHtml::image will look for. if (!is_dir(JPATH_THEMES . '/' . $template . '/images/' . $urlpath)) { @@ -572,16 +571,10 @@ public function testScript() // We create a stub (not a mock because we don't enforce whether it is called or not) // to return a value from getTemplate. - $mock = $this->getMock('myMockObject', array('getTemplate')); - $mock->expects($this->any()) + JFactory::$application->expects($this->any()) ->method('getTemplate') ->will($this->returnValue($template)); - // @todo We need to mock this. - $mock->input = new JInput; - - JFactory::$application = $mock; - // We create the file that JHtml::image will look for mkdir(JPATH_THEMES . '/' . $template . '/js/' . $urlpath, 0777, true); file_put_contents(JPATH_THEMES . '/' . $template . '/js/' . $urlpath . $urlfilename, 'test'); @@ -941,16 +934,10 @@ public function testStylesheet() // We create a stub (not a mock because we don't enforce whether it is called or not) // to return a value from getTemplate. - $mock = $this->getMock('myMockObject', array('getTemplate')); - $mock->expects($this->any()) + JFactory::$application->expects($this->any()) ->method('getTemplate') ->will($this->returnValue($template)); - // @todo We need to mock this. - $mock->input = new JInput; - - JFactory::$application = $mock; - // We create the file that JHtml::image will look for. mkdir(JPATH_THEMES . '/' . $template . '/css/' . $urlpath, 0777, true); file_put_contents(JPATH_THEMES . '/' . $template . '/css/' . $urlpath . $urlfilename, 'test'); @@ -1327,13 +1314,10 @@ public function testTooltip() // We create a stub (not a mock because we don't enforce whether it is called or not) // to return a value from getTemplate - $mock = $this->getMock('myMockObject', array('getTemplate')); - $mock->expects($this->any()) + JFactory::$application->expects($this->any()) ->method('getTemplate') ->will($this->returnValue($template)); - JFactory::$application = $mock; - // Testing classical cases $this->assertEquals( JHtml::tooltip('Content'), @@ -1441,7 +1425,6 @@ public function testCalendar() $cfg = new JObject; JFactory::$session = $this->getMockSession(); - JFactory::$application = $this->getMockCmsApp(); JFactory::$config = $cfg; JFactory::$application->expects($this->any()) From de968fae007841f94ea2f227890f774701735314 Mon Sep 17 00:00:00 2001 From: wilsonge Date: Tue, 14 Jul 2015 23:59:05 +0100 Subject: [PATCH 641/809] Set server variables in setUp and tearDown --- .../suites/libraries/cms/html/JHtmlTest.php | 86 +++++++------------ 1 file changed, 32 insertions(+), 54 deletions(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlTest.php b/tests/unit/suites/libraries/cms/html/JHtmlTest.php index 2978260c0967b..a826e498643a9 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlTest.php @@ -16,6 +16,30 @@ */ class JHtmlTest extends TestCase { + /** + * Value for test host. + * + * @var string + * @since 3.2 + */ + const TEST_HTTP_HOST = 'mydomain.com'; + + /** + * Value for test user agent. + * + * @var string + * @since 3.2 + */ + const TEST_REQUEST_URI = '/index.php'; + + /** + * Backup of the SERVER superglobal + * + * @var array + * @since 3.4 + */ + protected $backupServer; + /** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. @@ -31,6 +55,13 @@ protected function setUp() $this->saveFactoryState(); JFactory::$application = $this->getMockCmsApp(); + + $this->backupServer = $_SERVER; + + $_SERVER['HTTP_HOST'] = self::TEST_HTTP_HOST; + $_SERVER['SCRIPT_NAME'] = self::TEST_REQUEST_URI; + $_SERVER['REQUEST_URI'] = self::TEST_REQUEST_URI; + $_SERVER['HTTP_USER_AGENT'] = 'Test Browser'; } /** @@ -43,6 +74,7 @@ protected function setUp() */ protected function tearDown() { + $_SERVER = $this->backupServer; $this->restoreFactoryState(); parent::tearDown(); @@ -272,17 +304,6 @@ public function testLink($url, $text, $attribs, $expected) */ public function testImage() { - if (!is_array($_SERVER)) - { - $_SERVER = array(); - } - - // We save the state of $_SERVER for later and set it to appropriate values. - $http_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null; - $script_name = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : null; - $_SERVER['HTTP_HOST'] = 'example.com'; - $_SERVER['SCRIPT_NAME'] = '/index.php'; - // These are some paths to pass to JHtml for testing purposes. $urlpath = 'test1/'; $urlfilename = 'image1.jpg'; @@ -484,9 +505,6 @@ public function testImage() 'My Alt Text', 'JHtml::image with an absolute path, URL does not start with http' ); - - $_SERVER['HTTP_HOST'] = $http_host; - $_SERVER['SCRIPT_NAME'] = $script_name; } /** @@ -551,17 +569,6 @@ public function testIframe($url, $name, $attribs, $noFrames, $expected) */ public function testScript() { - if (!is_array($_SERVER)) - { - $_SERVER = array(); - } - - // We save the state of $_SERVER for later and set it to appropriate values - $http_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null; - $script_name = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : null; - $_SERVER['HTTP_HOST'] = 'example.com'; - $_SERVER['SCRIPT_NAME'] = '/index.php'; - // These are some paths to pass to JHtml for testing purposes. $urlpath = 'test1/'; $urlfilename = 'script1.js'; @@ -900,9 +907,6 @@ public function testScript() unlink(JPATH_ROOT . '/media/system/js/' . $element . '/' . $urlpath . 'script1-uncompressed.js'); rmdir(JPATH_ROOT . '/media/system/js/' . $element . '/' . $urlpath); rmdir(JPATH_ROOT . '/media/system/js/' . $element); - - $_SERVER['HTTP_HOST'] = $http_host; - $_SERVER['SCRIPT_NAME'] = $script_name; } /** @@ -914,17 +918,6 @@ public function testScript() */ public function testStylesheet() { - if (!is_array($_SERVER)) - { - $_SERVER = array(); - } - - // We save the state of $_SERVER for later and set it to appropriate values. - $http_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null; - $script_name = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : null; - $_SERVER['HTTP_HOST'] = 'example.com'; - $_SERVER['SCRIPT_NAME'] = '/index.php'; - // These are some paths to pass to JHtml for testing purposes. $urlpath = 'test1/'; $urlfilename = 'style1.css'; @@ -1284,9 +1277,6 @@ public function testStylesheet() unlink(JPATH_ROOT . '/media/system/css/' . $element . '/' . $urlpath . $urlfilename); rmdir(JPATH_ROOT . '/media/system/css/' . $element . '/' . $urlpath); rmdir(JPATH_ROOT . '/media/system/css/' . $element); - - $_SERVER['HTTP_HOST'] = $http_host; - $_SERVER['SCRIPT_NAME'] = $script_name; } /** @@ -1298,17 +1288,6 @@ public function testStylesheet() */ public function testTooltip() { - if (!is_array($_SERVER)) - { - $_SERVER = array(); - } - - // We save the state of $_SERVER for later and set it to appropriate values - $http_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null; - $script_name = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : null; - $_SERVER['HTTP_HOST'] = 'example.com'; - $_SERVER['SCRIPT_NAME'] = '/index.php'; - // We generate a random template name so that we don't collide or hit anything $template = 'mytemplate' . rand(1, 10000); @@ -1433,7 +1412,6 @@ public function testCalendar() $cfg->live_site = 'http://example.com'; $cfg->offset = 'Europe/Kiev'; - $_SERVER['HTTP_USER_AGENT'] = 'Test Browser'; // Two sets of test data $test_data = array( From 4b40645ecd2eff1995660f243e9fe1f8f8658221 Mon Sep 17 00:00:00 2001 From: wilsonge Date: Wed, 15 Jul 2015 00:06:06 +0100 Subject: [PATCH 642/809] Keep current HTTP_HOST the same as in the current tests --- tests/unit/suites/libraries/cms/html/JHtmlTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlTest.php b/tests/unit/suites/libraries/cms/html/JHtmlTest.php index a826e498643a9..43f1941ae5bc3 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlTest.php @@ -22,7 +22,7 @@ class JHtmlTest extends TestCase * @var string * @since 3.2 */ - const TEST_HTTP_HOST = 'mydomain.com'; + const TEST_HTTP_HOST = 'example.com'; /** * Value for test user agent. From 92c6ed9c623c18ae4c1fcc4ee58eb92207264ddb Mon Sep 17 00:00:00 2001 From: wilsonge Date: Wed, 15 Jul 2015 00:45:15 +0100 Subject: [PATCH 643/809] Move testTooltipText to use a data provider --- .../suites/libraries/cms/html/JHtmlTest.php | 66 ++++++++++++------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/tests/unit/suites/libraries/cms/html/JHtmlTest.php b/tests/unit/suites/libraries/cms/html/JHtmlTest.php index 43f1941ae5bc3..3db09f5211fb0 100644 --- a/tests/unit/suites/libraries/cms/html/JHtmlTest.php +++ b/tests/unit/suites/libraries/cms/html/JHtmlTest.php @@ -1551,36 +1551,56 @@ public function testCalendar() } /** - * Tests JHtml::prepareTooltip(). + * Gets the data for testing the JHtml::tooltipText method. * - * @return void + * @return array * - * @since 3.1 + * @since 3.4.4 */ - public function testTooltipText() + public function dataTestTooltipText() { - $this->assertEquals( - JHtml::tooltipText('Title::Content'), - '<strong>Title</strong><br />Content', - 'A string with "::" should be converted' - ); - - $this->assertEquals( - JHtml::tooltipText('Title:Content'), - 'Title:Content', - 'A string without "::" should not be converted' - ); - - $this->assertEquals( - JHtml::tooltipText('Title', 'Content'), - '<strong>Title</strong><br />Content', - 'A title and content should be combined' + return array( + array( + 'Title::Content', + '', + '<strong>Title</strong><br />Content', + 'A string with "::" should be converted', + ), + array( + 'Title:Content', + '', + 'Title:Content', + 'A string without "::" should not be converted', + ), + array( + 'Title', + 'Content', + '<strong>Title</strong><br />Content', + 'A title and content should be combined', + ), + array( + '', + 'Content', + 'Content', + 'If no title is given, return content string', + ), ); + } + /** + * Tests JHtml::tooltipText(). + * + * @return void + * + * @since 3.1 + * @dataProvider dataTestTooltipText + */ + public function testTooltipText($title, $content, $expected, $failureText) + { $this->assertEquals( - JHtml::tooltipText('', 'Content'), - 'Content', - 'If no title is given, return content string' + JHtml::tooltipText($title, $content), + $expected, + $failureText ); } } From 6f849c5591fc75a83f4362cc2e7bc6a459c6e273 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Mon, 13 Jul 2015 16:54:47 +0100 Subject: [PATCH 644/809] Stop using the abbreviation admin Fixes #7433 --- administrator/language/en-GB/en-GB.com_admin.ini | 2 +- .../language/en-GB/en-GB.com_admin.sys.ini | 2 +- administrator/language/en-GB/en-GB.com_cache.ini | 4 ++-- administrator/language/en-GB/en-GB.com_config.ini | 2 +- administrator/language/en-GB/en-GB.com_users.ini | 4 ++-- administrator/language/en-GB/en-GB.ini | 2 +- administrator/language/en-GB/en-GB.lib_joomla.ini | 10 +++++----- administrator/language/en-GB/en-GB.mod_menu.ini | 4 ++-- .../language/en-GB/en-GB.mod_menu.sys.ini | 2 +- .../language/en-GB/en-GB.mod_quickicon.ini | 2 +- .../language/en-GB/en-GB.mod_quickicon.sys.ini | 2 +- administrator/language/en-GB/en-GB.mod_status.ini | 6 +++--- administrator/language/en-GB/en-GB.mod_submenu.ini | 2 +- .../language/en-GB/en-GB.mod_submenu.sys.ini | 2 +- administrator/language/en-GB/en-GB.tpl_hathor.ini | 2 +- administrator/language/en-GB/en-GB.tpl_isis.ini | 6 +++--- .../language/en-GB/en-GB.tpl_isis.sys.ini | 2 +- .../hathor/language/en-GB/en-GB.tpl_hathor.ini | 2 +- .../isis/language/en-GB/en-GB.tpl_isis.ini | 6 +++--- .../isis/language/en-GB/en-GB.tpl_isis.sys.ini | 2 +- installation/language/en-GB/en-GB.ini | 14 +++++++------- language/en-GB/en-GB.com_config.ini | 6 +++--- language/en-GB/en-GB.ini | 2 +- language/en-GB/en-GB.lib_joomla.ini | 10 +++++----- 24 files changed, 49 insertions(+), 49 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_admin.ini b/administrator/language/en-GB/en-GB.com_admin.ini index ba68b765a1761..f3321c8663728 100644 --- a/administrator/language/en-GB/en-GB.com_admin.ini +++ b/administrator/language/en-GB/en-GB.com_admin.ini @@ -3,7 +3,7 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -COM_ADMIN="Admin - System Information" +COM_ADMIN="Administrator - System Information" COM_ADMIN_ALPHABETICAL_INDEX="Alphabetical Index" COM_ADMIN_CACHE_DIRECTORY="(Cache Directory)" COM_ADMIN_CLEAR_RESULTS="Clear results" diff --git a/administrator/language/en-GB/en-GB.com_admin.sys.ini b/administrator/language/en-GB/en-GB.com_admin.sys.ini index 627c0591e6814..1f054fe924af4 100644 --- a/administrator/language/en-GB/en-GB.com_admin.sys.ini +++ b/administrator/language/en-GB/en-GB.com_admin.sys.ini @@ -3,5 +3,5 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -COM_ADMIN="Admin - System Information" +COM_ADMIN="Administrator - System Information" COM_ADMIN_XML_DESCRIPTION="Administration system information component." diff --git a/administrator/language/en-GB/en-GB.com_cache.ini b/administrator/language/en-GB/en-GB.com_cache.ini index ed2558e971b15..75cbfeea883ff 100644 --- a/administrator/language/en-GB/en-GB.com_cache.ini +++ b/administrator/language/en-GB/en-GB.com_cache.ini @@ -5,7 +5,7 @@ COM_CACHE="Cache Manager" COM_CACHE_BACK_CACHE_MANAGER="Return to Cache Manager" -COM_CACHE_CLEAR_CACHE_ADMIN="Clear Cache Admin" +COM_CACHE_CLEAR_CACHE_ADMIN="Clear Cache Administrator" COM_CACHE_CLEAR_CACHE="Maintenance: Clear Cache" COM_CACHE_PURGE_EXPIRED_CACHE="Maintenance: Clear Expired Cache" COM_CACHE_CONFIGURATION="Cache Manager Settings" @@ -14,7 +14,7 @@ COM_CACHE_EXPIRED_ITEMS_PURGING_ERROR="Error clearing expired items." COM_CACHE_GROUP="Cache Group" COM_CACHE_MANAGER="Cache Manager" COM_CACHE_NUMBER_OF_FILES="Number of Files" -COM_CACHE_PURGE_CACHE_ADMIN="Clear Cache Admin" +COM_CACHE_PURGE_CACHE_ADMIN="Clear Cache Administrator" COM_CACHE_PURGE_EXPIRED="Clear Expired Cache" COM_CACHE_PURGE_EXPIRED_ITEMS="Clear expired items" COM_CACHE_PURGE_INSTRUCTIONS="Click on the Clear Expired Cache icon in the toolbar to delete all expired cache files. Note: Cache files that are still current will not be deleted." diff --git a/administrator/language/en-GB/en-GB.com_config.ini b/administrator/language/en-GB/en-GB.com_config.ini index 01880aa1a4c2e..294d378893bd5 100644 --- a/administrator/language/en-GB/en-GB.com_config.ini +++ b/administrator/language/en-GB/en-GB.com_config.ini @@ -76,7 +76,7 @@ COM_CONFIG_FIELD_FILTERS_WHITE_LIST="White List" COM_CONFIG_FRONTEDITING_DESC="Select if you want mouse-over edit icons for modules and menu items (support may depend on your template)." COM_CONFIG_FRONTEDITING_LABEL="Mouse-over Edit Icons for" COM_CONFIG_FRONTEDITING_MENUSANDMODULES="Modules & Menus" -COM_CONFIG_FRONTEDITING_MENUSANDMODULES_ADMIN_TOO="Modules & Menus (admin too)" +COM_CONFIG_FRONTEDITING_MENUSANDMODULES_ADMIN_TOO="Modules & Menus (administrator too)" COM_CONFIG_FRONTEDITING_MODULES="Modules" COM_CONFIG_FIELD_FORCE_SSL_DESC="Force site access to always occur under SSL (https) for selected areas. You will not be able to access selected areas under non-ssl. Note, you must have SSL enabled on your server to utilise this option." COM_CONFIG_FIELD_FORCE_SSL_LABEL="Force SSL" diff --git a/administrator/language/en-GB/en-GB.com_users.ini b/administrator/language/en-GB/en-GB.com_users.ini index 812e7eeb3748f..4460940c18f98 100644 --- a/administrator/language/en-GB/en-GB.com_users.ini +++ b/administrator/language/en-GB/en-GB.com_users.ini @@ -61,9 +61,9 @@ COM_USERS_CONFIG_FIELD_SENDPASSWORD_LABEL="Send Password" COM_USERS_CONFIG_FIELD_SENDPASSWORD_DESC="If set to Yes the user's initial password will be emailed to the user as part of the registration mail." COM_USERS_CONFIG_FIELD_SUBJECT_PREFIX_DESC="This is added in front of each mail subject." COM_USERS_CONFIG_FIELD_SUBJECT_PREFIX_LABEL="Subject Prefix" -COM_USERS_CONFIG_FIELD_USERACTIVATION_DESC="If set to None the user will be registered immediately. If set to Self the User will be emailed a link to activate their account before they can log in. If set to Admin the user will be emailed a link to verify their email address and then all users set to receive system emails and who have the permission to create users will be notified to activate the user's account." +COM_USERS_CONFIG_FIELD_USERACTIVATION_DESC="If set to None the user will be registered immediately. If set to Self the User will be emailed a link to activate their account before they can log in. If set to Administrator the user will be emailed a link to verify their email address and then all users set to receive system emails and who have the permission to create users will be notified to activate the user's account." COM_USERS_CONFIG_FIELD_USERACTIVATION_LABEL="New User Account Activation" -COM_USERS_CONFIG_FIELD_USERACTIVATION_OPTION_ADMINACTIVATION="Admin" +COM_USERS_CONFIG_FIELD_USERACTIVATION_OPTION_ADMINACTIVATION="Administrator" COM_USERS_CONFIG_FIELD_USERACTIVATION_OPTION_SELFACTIVATION="Self" COM_USERS_CONFIG_IMPORT_FAILED="An error was encountered while importing the configuration: %s." COM_USERS_CONFIG_SAVE_FAILED="An error was encountered while saving the configuration: %s." diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index 4cf1d90dc6380..543d5b187f6c2 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -138,7 +138,7 @@ JACTION_EDITOWN="Edit Own" JACTION_EDITOWN_COMPONENT_DESC="Allows users in the group to edit any content they submitted in this extension." JACTION_EDITSTATE="Edit State" JACTION_EDITSTATE_COMPONENT_DESC="Allows users in the group to change the state of any content in this extension." -JACTION_LOGIN_ADMIN="Admin Login" +JACTION_LOGIN_ADMIN="Administrator Login" JACTION_LOGIN_OFFLINE="Offline Access" JACTION_LOGIN_SITE="Site Login" JACTION_MANAGE="Access Administration Interface" diff --git a/administrator/language/en-GB/en-GB.lib_joomla.ini b/administrator/language/en-GB/en-GB.lib_joomla.ini index ec46732e161ab..4493730d97470 100644 --- a/administrator/language/en-GB/en-GB.lib_joomla.ini +++ b/administrator/language/en-GB/en-GB.lib_joomla.ini @@ -421,10 +421,10 @@ JLIB_HTML_UNSETDEFAULT_ITEM="Unset default" JLIB_INSTALLER_ABORT="Aborting language installation: %s" JLIB_INSTALLER_ABORT_ALREADYINSTALLED="Extension is already installed." JLIB_INSTALLER_ABORT_ALREADY_EXISTS="Extension %1$s: Extension %2$s already exists." -JLIB_INSTALLER_ABORT_COMP_BUILDADMINMENUS_FAILED="Error building Admin Menus." +JLIB_INSTALLER_ABORT_COMP_BUILDADMINMENUS_FAILED="Error building Administrator Menus." JLIB_INSTALLER_ABORT_COMP_COPY_MANIFEST="Component %1$s: Could not copy PHP manifest file." JLIB_INSTALLER_ABORT_COMP_COPY_SETUP="Component %1$s: Could not copy setup file." -JLIB_INSTALLER_ABORT_COMP_FAIL_ADMIN_FILES="Component %s: Failed to copy admin files." +JLIB_INSTALLER_ABORT_COMP_FAIL_ADMIN_FILES="Component %s: Failed to copy administrator files." JLIB_INSTALLER_ABORT_COMP_FAIL_SITE_FILES="Component %s: Failed to copy site files." JLIB_INSTALLER_ABORT_COMP_INSTALL_COPY_SETUP="Component Install: Could not copy setup file." JLIB_INSTALLER_ABORT_COMP_INSTALL_CUSTOM_INSTALL_FAILURE="Component Install: Custom install routine failure" @@ -518,7 +518,7 @@ JLIB_INSTALLER_ERROR_COMP_FAILED_TO_CREATE_DIRECTORY="Component %1$s: Failed to JLIB_INSTALLER_ERROR_COMP_INSTALL_ADMIN_ELEMENT="Component Install: The XML file did not contain an administration element" JLIB_INSTALLER_ERROR_COMP_INSTALL_DIR_ADMIN="Component Install: Another component is already using directory: %s" JLIB_INSTALLER_ERROR_COMP_INSTALL_DIR_SITE="Component Install: Another component is already using directory: %s" -JLIB_INSTALLER_ERROR_COMP_INSTALL_FAILED_TO_CREATE_DIRECTORY_ADMIN="Component Install: Failed to create admin directory: %s" +JLIB_INSTALLER_ERROR_COMP_INSTALL_FAILED_TO_CREATE_DIRECTORY_ADMIN="Component Install: Failed to create administrator directory: %s" JLIB_INSTALLER_ERROR_COMP_INSTALL_FAILED_TO_CREATE_DIRECTORY_SITE="Component Install: Failed to create site directory: %s" JLIB_INSTALLER_ERROR_COMP_REFRESH_MANIFEST_CACHE="Component Refresh manifest cache: Failed to store component details." JLIB_INSTALLER_ERROR_COMP_REMOVING_ADMIN_MENUS_FAILED="Could not delete the Administrator menus." @@ -526,12 +526,12 @@ JLIB_INSTALLER_ERROR_COMP_UNINSTALL_CUSTOM="Component Uninstall: Custom Uninstal JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_DELETE_CATEGORIES="Component Uninstall: Unable to delete the component categories." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_ERRORREMOVEMANUALLY="Component Uninstall: Can't uninstall. Please remove manually." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_ERRORUNKOWNEXTENSION="Component Uninstall: Unknown Extension." -JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_REMOVE_DIRECTORY_ADMIN="Component Uninstall: Unable to remove the component admin directory." +JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_REMOVE_DIRECTORY_ADMIN="Component Uninstall: Unable to remove the component administrator directory." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_REMOVE_DIRECTORY_SITE="Component Uninstall: Unable to remove the component site directory." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_NO_OPTION="Component Uninstall: Option field empty, can't remove files." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_SQL_ERROR="Component Uninstall: SQL error file %s" JLIB_INSTALLER_ERROR_COMP_UNINSTALL_WARNCORECOMPONENT="Component Uninstall: Trying to uninstall a core component." -JLIB_INSTALLER_ERROR_COMP_UPDATE_FAILED_TO_CREATE_DIRECTORY_ADMIN="Component Update: Failed to create admin directory: %s" +JLIB_INSTALLER_ERROR_COMP_UPDATE_FAILED_TO_CREATE_DIRECTORY_ADMIN="Component Update: Failed to create administrator directory: %s" JLIB_INSTALLER_ERROR_COMP_UPDATE_FAILED_TO_CREATE_DIRECTORY_SITE="Component Update: Failed to create site directory: %s" JLIB_INSTALLER_ERROR_CREATE_DIRECTORY="JInstaller: :Install: Failed to create directory: %s" JLIB_INSTALLER_ERROR_CREATE_FOLDER_FAILED="Failed to create directory [%s]" diff --git a/administrator/language/en-GB/en-GB.mod_menu.ini b/administrator/language/en-GB/en-GB.mod_menu.ini index 5fdae2c0cbed1..5eb606a552903 100644 --- a/administrator/language/en-GB/en-GB.mod_menu.ini +++ b/administrator/language/en-GB/en-GB.mod_menu.ini @@ -50,7 +50,7 @@ MOD_MENU_HELP_RESOURCES="Joomla! Resources" MOD_MENU_HELP_SECURITY="Security Centre" MOD_MENU_HELP_SHOP="Joomla! Shop" MOD_MENU_HELP_SUPPORT_OFFICIAL_FORUM="Official Support Forum" -; the string below will be used if the localised sample data contains a URL for the desired community forum or if the 'Custom Support Forum' field parameter in the Admin Menu module contains a URL +; the string below will be used if the localised sample data contains a URL for the desired community forum or if the 'Custom Support Forum' field parameter in the Administrator Menu module contains a URL MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM="Custom Support Forum" ; the string below will be used if MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE has a value, i.e the # of the specific language forum in forum.joomla.org MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM="Official [language] forum" @@ -75,4 +75,4 @@ MOD_MENU_SYSTEM_INFORMATION="System Information" MOD_MENU_SYSTEM="System" MOD_MENU_TOOLS="Tools" MOD_MENU_USER_PROFILE="My Profile" -MOD_MENU_XML_DESCRIPTION="This module shows the main admin navigation module." +MOD_MENU_XML_DESCRIPTION="This module shows the main administrator navigation module." diff --git a/administrator/language/en-GB/en-GB.mod_menu.sys.ini b/administrator/language/en-GB/en-GB.mod_menu.sys.ini index 352af0e6c8f8b..9620261d6a2c3 100644 --- a/administrator/language/en-GB/en-GB.mod_menu.sys.ini +++ b/administrator/language/en-GB/en-GB.mod_menu.sys.ini @@ -4,6 +4,6 @@ ; Note : All ini files need to be saved as UTF-8 MOD_MENU="Administrator Menu" -MOD_MENU_XML_DESCRIPTION="This module shows the main admin navigation module." +MOD_MENU_XML_DESCRIPTION="This module shows the main administrator navigation module." MOD_MENU_LAYOUT_DEFAULT="Default" diff --git a/administrator/language/en-GB/en-GB.mod_quickicon.ini b/administrator/language/en-GB/en-GB.mod_quickicon.ini index 8bdda7f284bc9..f86b3f2a350e3 100644 --- a/administrator/language/en-GB/en-GB.mod_quickicon.ini +++ b/administrator/language/en-GB/en-GB.mod_quickicon.ini @@ -30,4 +30,4 @@ MOD_QUICKICON_TEMPLATE_MANAGER="Template Manager" MOD_QUICKICON_TITLE="Quick Icons" MOD_QUICKICON_USER_MANAGER="User Manager" MOD_QUICKICON_USERS="Users" -MOD_QUICKICON_XML_DESCRIPTION="This module shows Quick Icons that are visible on the Control Panel (admin area home page)." +MOD_QUICKICON_XML_DESCRIPTION="This module shows Quick Icons that are visible on the Control Panel (administrator area home page)." diff --git a/administrator/language/en-GB/en-GB.mod_quickicon.sys.ini b/administrator/language/en-GB/en-GB.mod_quickicon.sys.ini index b521e30408c3e..87985c68ebb3e 100644 --- a/administrator/language/en-GB/en-GB.mod_quickicon.sys.ini +++ b/administrator/language/en-GB/en-GB.mod_quickicon.sys.ini @@ -4,6 +4,6 @@ ; Note : All ini files need to be saved as UTF-8 MOD_QUICKICON="Quick Icons" -MOD_QUICKICON_XML_DESCRIPTION="This module shows Quick Icons that are visible on the Control Panel (admin area home page)" +MOD_QUICKICON_XML_DESCRIPTION="This module shows Quick Icons that are visible on the Control Panel (administrator area home page)" MOD_QUICKICON_LAYOUT_DEFAULT="Default" diff --git a/administrator/language/en-GB/en-GB.mod_status.ini b/administrator/language/en-GB/en-GB.mod_status.ini index e3a65177822f0..a1105f66128db 100644 --- a/administrator/language/en-GB/en-GB.mod_status.ini +++ b/administrator/language/en-GB/en-GB.mod_status.ini @@ -4,9 +4,9 @@ ; Note : All ini files need to be saved as UTF-8 MOD_STATUS="User Status" -MOD_STATUS_BACKEND_USERS_0="Admins" -MOD_STATUS_BACKEND_USERS_1="Admin" -MOD_STATUS_BACKEND_USERS_MORE="Admins" +MOD_STATUS_BACKEND_USERS_0="Administrators" +MOD_STATUS_BACKEND_USERS_1="Administrator" +MOD_STATUS_BACKEND_USERS_MORE="Administrators" MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_ADMIN_DESC="Show the number of users logged-in to the Backend." MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_ADMIN_LABEL="Show Logged-in Backend Users" MOD_STATUS_FIELD_SHOW_LOGGEDIN_USERS_DESC="Show the number of users logged-in for both Frontend and Backend." diff --git a/administrator/language/en-GB/en-GB.mod_submenu.ini b/administrator/language/en-GB/en-GB.mod_submenu.ini index e15e57f1a00a1..18606b44a2ecb 100644 --- a/administrator/language/en-GB/en-GB.mod_submenu.ini +++ b/administrator/language/en-GB/en-GB.mod_submenu.ini @@ -3,6 +3,6 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -MOD_SUBMENU="Admin Sub-Menu" +MOD_SUBMENU="Administrator Sub-Menu" MOD_SUBMENU_XML_DESCRIPTION="This module shows the Sub-Menu Navigation Module." diff --git a/administrator/language/en-GB/en-GB.mod_submenu.sys.ini b/administrator/language/en-GB/en-GB.mod_submenu.sys.ini index a6606b701a026..dd8d9f7e97ba9 100644 --- a/administrator/language/en-GB/en-GB.mod_submenu.sys.ini +++ b/administrator/language/en-GB/en-GB.mod_submenu.sys.ini @@ -3,7 +3,7 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -MOD_SUBMENU="Admin Sub-Menu" +MOD_SUBMENU="Administrator Sub-Menu" MOD_SUBMENU_XML_DESCRIPTION="This module shows the Sub-Menu Navigation Module." MOD_SUBMENU_LAYOUT_DEFAULT="Default" diff --git a/administrator/language/en-GB/en-GB.tpl_hathor.ini b/administrator/language/en-GB/en-GB.tpl_hathor.ini index 0e7733674c7bb..e4ce2a8feb3a6 100644 --- a/administrator/language/en-GB/en-GB.tpl_hathor.ini +++ b/administrator/language/en-GB/en-GB.tpl_hathor.ini @@ -19,7 +19,7 @@ TPL_HATHOR_COM_MENUS_MENU="Menu" TPL_HATHOR_COM_MODULES_CUSTOM_POSITION_LABEL="Select" TPL_HATHOR_CPANEL_LINK_TEXT="Return to Control Panel" TPL_HATHOR_GO="Go" -TPL_HATHOR_LOGO_DESC="Select or upload a custom logo for the admin template." +TPL_HATHOR_LOGO_DESC="Select or upload a custom logo for the administrator template." TPL_HATHOR_LOGO_LABEL="Logo" TPL_HATHOR_MAIN_MENU="Main Menu" TPL_HATHOR_SHOW_SITE_NAME_DESC="Show the site name in the template header." diff --git a/administrator/language/en-GB/en-GB.tpl_isis.ini b/administrator/language/en-GB/en-GB.tpl_isis.ini index 8cc78fc62a3f5..0184e193de730 100644 --- a/administrator/language/en-GB/en-GB.tpl_isis.ini +++ b/administrator/language/en-GB/en-GB.tpl_isis.ini @@ -20,9 +20,9 @@ TPL_ISIS_HEADER_DESC="Optional display of header." TPL_ISIS_HEADER_LABEL="Display Header" TPL_ISIS_INSTALLER="Installer" TPL_ISIS_ISFREESOFTWARE="Joomla is free software released under the GNU General Public License." -TPL_ISIS_LOGIN_LOGO_DESC="Select or upload a custom logo for the login area of admin template." +TPL_ISIS_LOGIN_LOGO_DESC="Select or upload a custom logo for the login area of administrator template." TPL_ISIS_LOGIN_LOGO_LABEL="Login Logo" -TPL_ISIS_LOGO_DESC="Upload a custom logo for the admin template." +TPL_ISIS_LOGO_DESC="Upload a custom logo for the administrator template." TPL_ISIS_LOGO_LABEL="Logo" TPL_ISIS_LOGOUT="Logout" TPL_ISIS_PREVIEW="Preview %s" @@ -33,4 +33,4 @@ TPL_ISIS_STATUS_TOP="Top" TPL_ISIS_STICKY_DESC="Optionally set the toolbar to a fixed (pinned) location." TPL_ISIS_STICKY_LABEL="Pinned Toolbar" TPL_ISIS_TOOLBAR="Toolbar" -TPL_ISIS_XML_DESCRIPTION="Continuing the Egyptian god/goddess theme (Khepri from 1.5 and Hathor from 1.6), Isis is the Joomla 3 admin template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." +TPL_ISIS_XML_DESCRIPTION="Continuing the Egyptian god/goddess theme (Khepri from 1.5 and Hathor from 1.6), Isis is the Joomla 3 administrator template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." diff --git a/administrator/language/en-GB/en-GB.tpl_isis.sys.ini b/administrator/language/en-GB/en-GB.tpl_isis.sys.ini index 6d0e302b1cb5c..024b811c3bd42 100644 --- a/administrator/language/en-GB/en-GB.tpl_isis.sys.ini +++ b/administrator/language/en-GB/en-GB.tpl_isis.sys.ini @@ -17,4 +17,4 @@ TPL_ISIS_POSITION_STATUS="Status" TPL_ISIS_POSITION_SUBMENU="Submenu" TPL_ISIS_POSITION_TITLE="Title" TPL_ISIS_POSITION_TOOLBAR="Toolbar" -TPL_ISIS_XML_DESCRIPTION="Continuing the Egyptian god/goddess theme (Khepri from 1.5 and Hathor from 1.6), Isis is the Joomla 3 admin template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." +TPL_ISIS_XML_DESCRIPTION="Continuing the Egyptian god/goddess theme (Khepri from 1.5 and Hathor from 1.6), Isis is the Joomla 3 administrator template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." diff --git a/administrator/templates/hathor/language/en-GB/en-GB.tpl_hathor.ini b/administrator/templates/hathor/language/en-GB/en-GB.tpl_hathor.ini index 3b1fc36624874..85bb4ad0d31d5 100644 --- a/administrator/templates/hathor/language/en-GB/en-GB.tpl_hathor.ini +++ b/administrator/templates/hathor/language/en-GB/en-GB.tpl_hathor.ini @@ -19,7 +19,7 @@ TPL_HATHOR_COM_MENUS_MENU="Menu" TPL_HATHOR_COM_MODULES_CUSTOM_POSITION_LABEL="Select" TPL_HATHOR_CPANEL_LINK_TEXT="Return to Control Panel" TPL_HATHOR_GO="Go" -TPL_HATHOR_LOGO_DESC="Select or upload a custom logo for the admin template." +TPL_HATHOR_LOGO_DESC="Select or upload a custom logo for the administrator template." TPL_HATHOR_LOGO_LABEL="Logo" TPL_HATHOR_MAIN_MENU="Main Menu" TPL_HATHOR_SHOW_SITE_NAME_DESC="Show the site name in the template header." diff --git a/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini b/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini index 8cc78fc62a3f5..0184e193de730 100644 --- a/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini +++ b/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.ini @@ -20,9 +20,9 @@ TPL_ISIS_HEADER_DESC="Optional display of header." TPL_ISIS_HEADER_LABEL="Display Header" TPL_ISIS_INSTALLER="Installer" TPL_ISIS_ISFREESOFTWARE="Joomla is free software released under the GNU General Public License." -TPL_ISIS_LOGIN_LOGO_DESC="Select or upload a custom logo for the login area of admin template." +TPL_ISIS_LOGIN_LOGO_DESC="Select or upload a custom logo for the login area of administrator template." TPL_ISIS_LOGIN_LOGO_LABEL="Login Logo" -TPL_ISIS_LOGO_DESC="Upload a custom logo for the admin template." +TPL_ISIS_LOGO_DESC="Upload a custom logo for the administrator template." TPL_ISIS_LOGO_LABEL="Logo" TPL_ISIS_LOGOUT="Logout" TPL_ISIS_PREVIEW="Preview %s" @@ -33,4 +33,4 @@ TPL_ISIS_STATUS_TOP="Top" TPL_ISIS_STICKY_DESC="Optionally set the toolbar to a fixed (pinned) location." TPL_ISIS_STICKY_LABEL="Pinned Toolbar" TPL_ISIS_TOOLBAR="Toolbar" -TPL_ISIS_XML_DESCRIPTION="Continuing the Egyptian god/goddess theme (Khepri from 1.5 and Hathor from 1.6), Isis is the Joomla 3 admin template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." +TPL_ISIS_XML_DESCRIPTION="Continuing the Egyptian god/goddess theme (Khepri from 1.5 and Hathor from 1.6), Isis is the Joomla 3 administrator template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." diff --git a/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.sys.ini b/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.sys.ini index fd1aefec4c102..41f25471f7997 100644 --- a/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.sys.ini +++ b/administrator/templates/isis/language/en-GB/en-GB.tpl_isis.sys.ini @@ -17,4 +17,4 @@ TPL_ISIS_POSITION_STATUS="Status" TPL_ISIS_POSITION_SUBMENU="Submenu" TPL_ISIS_POSITION_TITLE="Title" TPL_ISIS_POSITION_TOOLBAR="Toolbar" -TPL_ISIS_XML_DESCRIPTION="Continuing the Egyptian god/goddess theme (Khepri from 1.5 and Hathor from 1.6), Isis is the Joomla 3 admin template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." \ No newline at end of file +TPL_ISIS_XML_DESCRIPTION="Continuing the Egyptian god/goddess theme (Khepri from 1.5 and Hathor from 1.6), Isis is the Joomla 3 administrator template based on Bootstrap from Twitter and the launch of the Joomla User Interface library (JUI)." \ No newline at end of file diff --git a/installation/language/en-GB/en-GB.ini b/installation/language/en-GB/en-GB.ini index bf6b2aa4a9324..5986888d25dcb 100644 --- a/installation/language/en-GB/en-GB.ini +++ b/installation/language/en-GB/en-GB.ini @@ -64,12 +64,12 @@ INSTL_FTP_PASSWORD_DESC="Warning! It is recommended to leave this blank and ente ;Site View INSTL_SITE="Main Configuration" -INSTL_ADMIN_EMAIL_LABEL="Admin Email" +INSTL_ADMIN_EMAIL_LABEL="Administrator Email" INSTL_ADMIN_EMAIL_DESC="Enter an email address. This will be the email address of the website Super User." -INSTL_ADMIN_PASSWORD_LABEL="Admin Password" +INSTL_ADMIN_PASSWORD_LABEL="Administrator Password" INSTL_ADMIN_PASSWORD_DESC="Set the password for your Super User account and confirm it in the field below." -INSTL_ADMIN_PASSWORD2_LABEL="Confirm Admin Password" -INSTL_ADMIN_USER_LABEL="Admin Username" +INSTL_ADMIN_PASSWORD2_LABEL="Confirm Administrator Password" +INSTL_ADMIN_USER_LABEL="Administrator Username" INSTL_ADMIN_USER_DESC="Set the username for your Super User account." INSTL_SITE_NAME_LABEL="Site Name" INSTL_SITE_NAME_DESC="Enter the name of your Joomla! site." @@ -299,9 +299,9 @@ JDEBUG_LANGUAGE_UNTRANSLATED_STRING="Untranslated strings" JNONE="None" ; Necessary for errors -ADMIN_EMAIL="Admin Email" -ADMIN_PASSWORD="Admin Password" -ADMIN_PASSWORD2="Confirm Admin Password" +ADMIN_EMAIL="Administrator Email" +ADMIN_PASSWORD="Administrator Password" +ADMIN_PASSWORD2="Confirm Administrator Password" SITE_NAME="Site Name" ; Database types (allows for a more descriptive label than the internal name) diff --git a/language/en-GB/en-GB.com_config.ini b/language/en-GB/en-GB.com_config.ini index e2d0bede93fcc..ff58c43680cf7 100644 --- a/language/en-GB/en-GB.com_config.ini +++ b/language/en-GB/en-GB.com_config.ini @@ -3,8 +3,8 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 -COM_CONFIG="Admin Services" -COM_CONFIG_CONFIGURATION="Admin Services Configuration" +COM_CONFIG="Administrator Services" +COM_CONFIG_CONFIGURATION="Administrator Services Configuration" COM_CONFIG_ERROR_CONTROLLER_NOT_FOUND="Controller Not found!" COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_DESC="Select the default access level for new content, menu items and other items created on your site." COM_CONFIG_FIELD_DEFAULT_ACCESS_LEVEL_LABEL="Default Access Level" @@ -33,4 +33,4 @@ COM_CONFIG_SAVE_SUCCESS="Configuration successfully saved." COM_CONFIG_SEO_SETTINGS="SEO Settings" COM_CONFIG_SITE_SETTINGS="Site Settings" COM_CONFIG_TEMPLATE_SETTINGS="Template Settings" -COM_CONFIG_XML_DESCRIPTION="Frontend Admin Services Configuration Manager." +COM_CONFIG_XML_DESCRIPTION="Frontend Administrator Services Configuration Manager." diff --git a/language/en-GB/en-GB.ini b/language/en-GB/en-GB.ini index f0263c8dc182a..de37598fb64e9 100644 --- a/language/en-GB/en-GB.ini +++ b/language/en-GB/en-GB.ini @@ -41,7 +41,7 @@ JACTION_DELETE="Delete" JACTION_EDIT="Edit" JACTION_EDITOWN="Edit Own" JACTION_EDITSTATE="Edit State" -JACTION_LOGIN_ADMIN="Admin Login" +JACTION_LOGIN_ADMIN="Administrator Login" JACTION_LOGIN_SITE="Site Login" JACTION_MANAGE="Access Administration Interface" diff --git a/language/en-GB/en-GB.lib_joomla.ini b/language/en-GB/en-GB.lib_joomla.ini index 6182fe54b5489..e28f40119e192 100644 --- a/language/en-GB/en-GB.lib_joomla.ini +++ b/language/en-GB/en-GB.lib_joomla.ini @@ -421,10 +421,10 @@ JLIB_HTML_UNSETDEFAULT_ITEM="Unset default" JLIB_INSTALLER_ABORT="Aborting language installation: %s" JLIB_INSTALLER_ABORT_ALREADYINSTALLED="Extension is already installed." JLIB_INSTALLER_ABORT_ALREADY_EXISTS="Extension %1$s: Extension %2$s already exists." -JLIB_INSTALLER_ABORT_COMP_BUILDADMINMENUS_FAILED="Error building Admin Menus." +JLIB_INSTALLER_ABORT_COMP_BUILDADMINMENUS_FAILED="Error building Administrator Menus." JLIB_INSTALLER_ABORT_COMP_COPY_MANIFEST="Component %1$s: Could not copy PHP manifest file." JLIB_INSTALLER_ABORT_COMP_COPY_SETUP="Component %1$s: Could not copy setup file." -JLIB_INSTALLER_ABORT_COMP_FAIL_ADMIN_FILES="Component %s: Failed to copy admin files." +JLIB_INSTALLER_ABORT_COMP_FAIL_ADMIN_FILES="Component %s: Failed to copy administrator files." JLIB_INSTALLER_ABORT_COMP_FAIL_SITE_FILES="Component %s: Failed to copy site files." JLIB_INSTALLER_ABORT_COMP_INSTALL_COPY_SETUP="Component Install: Could not copy setup file." JLIB_INSTALLER_ABORT_COMP_INSTALL_CUSTOM_INSTALL_FAILURE="Component Install: Custom install routine failure." @@ -518,7 +518,7 @@ JLIB_INSTALLER_ERROR_COMP_FAILED_TO_CREATE_DIRECTORY="Component %1$s: Failed to JLIB_INSTALLER_ERROR_COMP_INSTALL_ADMIN_ELEMENT="Component Install: The XML file did not contain an administration element." JLIB_INSTALLER_ERROR_COMP_INSTALL_DIR_ADMIN="Component Install: Another component is already using directory: %s" JLIB_INSTALLER_ERROR_COMP_INSTALL_DIR_SITE="Component Install: Another component is already using directory: %s" -JLIB_INSTALLER_ERROR_COMP_INSTALL_FAILED_TO_CREATE_DIRECTORY_ADMIN="Component Install: Failed to create admin directory: %s" +JLIB_INSTALLER_ERROR_COMP_INSTALL_FAILED_TO_CREATE_DIRECTORY_ADMIN="Component Install: Failed to create administrator directory: %s" JLIB_INSTALLER_ERROR_COMP_INSTALL_FAILED_TO_CREATE_DIRECTORY_SITE="Component Install: Failed to create site directory: %s" JLIB_INSTALLER_ERROR_COMP_REFRESH_MANIFEST_CACHE="Component Refresh manifest cache: Failed to store component details." JLIB_INSTALLER_ERROR_COMP_REMOVING_ADMIN_MENUS_FAILED="Could not delete the Administrator menus." @@ -526,12 +526,12 @@ JLIB_INSTALLER_ERROR_COMP_UNINSTALL_CUSTOM="Component Uninstall: Custom Uninstal JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_DELETE_CATEGORIES="Component Uninstall: Unable to delete the component categories." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_ERRORREMOVEMANUALLY="Component Uninstall: Can't uninstall. Please remove manually." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_ERRORUNKOWNEXTENSION="Component Uninstall: Unknown Extension." -JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_REMOVE_DIRECTORY_ADMIN="Component Uninstall: Unable to remove the component admin directory." +JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_REMOVE_DIRECTORY_ADMIN="Component Uninstall: Unable to remove the component administrator directory." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_FAILED_REMOVE_DIRECTORY_SITE="Component Uninstall: Unable to remove the component site directory." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_NO_OPTION="Component Uninstall: Option field empty, can't remove files." JLIB_INSTALLER_ERROR_COMP_UNINSTALL_SQL_ERROR="Component Uninstall: SQL error file %s" JLIB_INSTALLER_ERROR_COMP_UNINSTALL_WARNCORECOMPONENT="Component Uninstall: Trying to uninstall a core component." -JLIB_INSTALLER_ERROR_COMP_UPDATE_FAILED_TO_CREATE_DIRECTORY_ADMIN="Component Update: Failed to create admin directory: %s" +JLIB_INSTALLER_ERROR_COMP_UPDATE_FAILED_TO_CREATE_DIRECTORY_ADMIN="Component Update: Failed to create administrator directory: %s" JLIB_INSTALLER_ERROR_COMP_UPDATE_FAILED_TO_CREATE_DIRECTORY_SITE="Component Update: Failed to create site directory: %s" JLIB_INSTALLER_ERROR_CREATE_DIRECTORY="JInstaller: :Install: Failed to create directory: %s" JLIB_INSTALLER_ERROR_CREATE_FOLDER_FAILED="Failed to create directory [%s]" From 5e44e0a80df88001c26168155258cf3317bb7d6f Mon Sep 17 00:00:00 2001 From: jowi Date: Tue, 13 Jan 2015 22:15:37 +0100 Subject: [PATCH 645/809] Replaced inline JavaScript in wrapper Fixes #5716 --- .../com_wrapper/views/wrapper/tmpl/default.php | 16 +--------------- media/com_wrapper/js/iframe-height.js | 13 +++++++++++++ media/com_wrapper/js/iframe-height.min.js | 1 + modules/mod_wrapper/tmpl/default.php | 17 +---------------- 4 files changed, 16 insertions(+), 31 deletions(-) create mode 100644 media/com_wrapper/js/iframe-height.js create mode 100644 media/com_wrapper/js/iframe-height.min.js diff --git a/components/com_wrapper/views/wrapper/tmpl/default.php b/components/com_wrapper/views/wrapper/tmpl/default.php index 87f6d3d8b2fd0..db07f96c646b9 100644 --- a/components/com_wrapper/views/wrapper/tmpl/default.php +++ b/components/com_wrapper/views/wrapper/tmpl/default.php @@ -8,22 +8,8 @@ */ defined('_JEXEC') or die; +JHtml::script('com_wrapper/iframe-height.min.js', false, true); ?> -
    params->get('show_page_heading')) : ?>