=0;X-=1){if(!P[X]){continue}for(V=0;V-1){Z.splice(S,1);T-=1}}for(Q=0;Q-1){Q.splice(P,1);S=T}}if(Q.length!==0){N=false;break}}if(N){return true}}return false}function x(R){var O,N,Q,P=[];R=q(R);for(O=0;O"){if(U.length){R.push(U);U=""}if(R.length){N.push(R);R=[]}if(Q||O){throw new Error("Failed to parse key combo. Unexpected > at character index "+P+".")}Q=true;P+=1}else{if(P"||V.charAt(P+1)===","||V.charAt(P+1)==="+")){U+=V.charAt(P+1);Q=false;S=false;O=false;P+=2}else{if(P"&&V.charAt(P)!==","&&V.charAt(P)!==" "){if(Q===false&&S===true||O===true){if(U.length){R.push(U);U=""}if(R.length){N.push(R);R=[]}if(N.length){W.push(N);N=[]}}Q=false;S=false;O=false;while(P"&&V.charAt(P)!==","&&V.charAt(P)!==" "){U+=V.charAt(P);P+=1}}else{P+=1;continue}}}}}}if(P>=V.length){if(U.length){R.push(U);U=""}if(R.length){N.push(R);R=[]}if(N.length){W.push(N);N=[]}break}}return W}function y(N){var Q,P,O=[];if(typeof N==="string"){return N}if(typeof N!=="object"||typeof N.push!=="function"){throw new Error("Cannot stringify key combo.")}for(Q=0;Q ")}return O.join(" ")}function L(){return[].concat(l)}function J(N){if(N.match(/\s/)){throw new Error("Cannot add key name "+N+" to active keys because it contains whitespace.")}if(l.indexOf(N)>-1){return}l.push(N)}function k(N){var O=z(N);if(O==="91"||O==="92"){l=[]}else{l.splice(l.indexOf(N),1)}}function C(O,N){if(typeof O!=="string"){throw new Error("Cannot register new locale. The locale name must be a string.")}if(typeof N!=="object"){throw new Error("Cannot register "+O+" locale. The locale map must be an object.")}if(typeof N.map!=="object"){throw new Error("Cannot register "+O+" locale. The locale map is invalid.")}if(!N.macros){N.macros=[]}w[O]=N}function g(N){if(N){if(typeof N!=="string"){throw new Error("Cannot set locale. The locale name must be a string.")}if(!w[N]){throw new Error("Cannot set locale to "+N+" because it does not exist. If you would like to submit a "+N+" locale map for KeyboardJS please submit it at https://github.com/RobertWHurst/KeyboardJS/issues.")}u=w[N].map;B=w[N].macros;o=N}return o}});
\ No newline at end of file
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/utils.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/utils.js
deleted file mode 100644
index a6f3881..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/js/utils.js
+++ /dev/null
@@ -1,1620 +0,0 @@
-/**
- * @author Riccardo Strobbia
- * @version 1.4
- * @revision 18/01/2016 17:08
- */
-//Backbone.Model Overrides
-
-window.Toolset = window.Toolset || {};
-
-//Backbone.View Overrides
-if (Backbone && Backbone.View) {
- Backbone.View.prototype.eventDispatcher = _.extend({}, Backbone.Events);
-}
-
-
-if (typeof WPV_Toolset == 'undefined') {
- var WPV_Toolset = {};
- WPV_Toolset.message = {};
- WPV_Toolset.message.container = null;
-}
-
-if (typeof WPV_Toolset.Utils == 'undefined') WPV_Toolset.Utils = {};
-
-WPV_Toolset.Utils.eventDispatcher = _.extend({}, Backbone.Events);
-
-WPV_Toolset.Utils.restoreEventPropagation = function (event) {
- if (jQuery.browser.mozilla) {
- return event;
- }
- if (event.isImmediatePropagationStopped() === false && event.isPropagationStopped() === false) {
- return event;
- }
-
- if (typeof event.originalEvent === undefined) {
- return event;
- }
-
- var refEvent = event.originalEvent;
-
- try {
- refEvent.cancelBubble = false;
- refEvent.defaultPrevented = false;
- refEvent.returnValue = true;
- refEvent.timeStamp = ( new Date() ).getTime();
- } catch (e) {
- // console.log(e.message );
- return event;
- }
-
-
- if (event.target.dispatchEvent) {
-
- try {
- event.target.dispatchEvent(refEvent);
- } catch (e) {
-
- return;
- }
- } else if (event.target.fireEvent) {
-
- event.target.fireEvent(refEvent);
- }
-
- return refEvent;
-};
-
-WPV_Toolset.Utils.do_ajax_post = function (params, callback_object) {
- jQuery.post(ajaxurl, params, function (response) {
-
- if ((typeof(response) !== 'undefined') && response !== null && ( response.message || response.Data || response.data )) {
-
- if (callback_object && callback_object.success && typeof callback_object.success == 'function')
- callback_object.success.call(this, response, params);
- WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_success_' + params.action, response, params);
- }
- else if ((typeof(response) !== 'undefined') && response !== null && response.error) {
-
- if (callback_object && callback_object.error && typeof callback_object.error == 'function')
- callback_object.error.call(this, response, params);
- WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_error_' + params.action, response, params);
- }
- }, 'json')
- .fail(function (jqXHR, textStatus, errorThrown) {
- console.log('Ajax call failed', textStatus, errorThrown)
- if (callback_object && callback_object.fail && typeof callback_object.fail == 'function')
- callback_object.fail.call(this, errorThrown);
- WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_fail_' + params.action, textStatus, errorThrown, params);
- })
- .always(function () {
- //console.log( arguments );
- if (callback_object && callback_object.always && typeof callback_object.always == 'function')
- callback_object.always.call(this, arguments);
- WPV_Toolset.Utils.eventDispatcher.trigger('on_ajax_complete_' + params.action, arguments, params);
- });
-};
-
-;(function ($, window, document, undefined) {
-
- // Create the defaults once
- var pluginName = "wpvToolsetMessage",
- dataPlugin = "plugin_" + pluginName,
- defaults = {
- text: "Enter a customized text to be displayed",
- type: '',
- inline: false,
- position: "after",
- header: false,
- headerText: false,
- close: false,
- use_this: true,
- fadeIn: 100,
- fadeOut: 100,
- stay: false,
- onClose: false,
- onOpen: false,
- onDestroy: false,
- dontShowAgain: null,
- dontShowAgainText: '',
- args: [],
- referTo: null,
- offestX: -20,
- offsetY: 0,
- classname: '',
- stay_for: 1200, // Ignored when 'msPerCharacter is given.
- msPerCharacter: 50 // Ignered when 'stay_for' is given. This value is multiplied by the number of defaults.text characters count.
- },
- has_stay = false,
- is_open = false,
- prev = null,
- prev_text = '';
-
- // The actual plugin constructor
- function Plugin(element, options) {
- var self = this;
-
- self.container = $(element);
-
- self.prms = $.extend({}, defaults, options);
- self._defaults = defaults;
- self._name = pluginName;
-
- self.box = null;
- self.header = null;
- self.remove = null;
- self.tag = self.prms.inline ? 'span' : 'p';
- self.bool = false;
-
- if (typeof (options.stay_for) === 'undefined' && typeof(self.prms.msPerCharacter) === 'number') { // If stay_for parameter wasn't passes when the plugin wass called AND msPerCharacter has correct type
- self.prms.stay_for = self.prms.text.length * self.prms.msPerCharacter;
- }
-
- }
-
- Plugin.prototype = {
- init: function () {
- var self = this;
-
- if (self.container.data('has_message')) {
- self.destroy();
- }
-
- if (self.container.children().length > 0) {
- self.container.children().each(function (i) {
- if ($(this).text() == self.prms.text) {
- self.bool = true;
- }
- });
- }
-
- if (self.bool) return;
-
- if (has_stay) {
- if (prev) {
- var rem = prev;
- prev = null;
- has_stay = false;
- is_open = false;
- rem.fadeTo(0, 0, function () {
- rem.remove();
- rem = null;
- });
- }
- }
-
- if (self.prms.header && self.prms.headerText) {
- self.box = $('
');
- self.header = $('');
- self.box.append(self.header);
- self.header.text(self.prms.headerText);
- self.box.append('<' + self.tag + '>' + self.tag + '>');
- self.box.find(self.tag).html(self.prms.text);
- }
- else {
- self.box = $('<' + self.tag + ' class="toolset-alert toolset-alert-' + self.prms.type + ' ' + self.prms.classname + '" />');
- self.box.html(self.prms.text);
- }
-
- if (self.prms.dontShowAgain && typeof self.prms.dontShowAgain === 'function' && self.prms.dontShowAgainText !== '') {
- self.$dontContainer = $(' ')
- self.$dont_show = $(' ');
- self.$dont_label = $(' ');
- self.$dont_label.text(self.prms.dontShowAgainText);
- self.$dontContainer.append(self.$dont_show, self.$dont_label);
- self.box.append(self.$dontContainer);
-
- self.prms.dontShowAgain.call(self.$dont_show, self, self.prms.args);
- }
-
- if (self.prms.close) {
- self.remove = $(' ');
- self.box.append(self.remove);
- self.remove.on('click', function (event) {
- self.wpvMessageRemove();
- });
- }
-
-
- //if( is_open ) self.wpvMessageRemove();
- if (self.prms.position == 'before') {
- self.container.prepend(self.box);
- } else {
- self.container.append(self.box);
- }
- self.container.data('has_message', true);
- self.box.hide();
-
- if (null !== self.prms.referTo) {
- self.box.css({
- "position": "absolute",
- "z-index": 10000,
- "top": self.prms.referTo.position().top + self.prms.offestY + "px",
- "left": self.prms.referTo.position().left + self.prms.referTo.width() + self.prms.offestX + "px"
- });
- }
-
- self.container.data('message-box', self.box);
-
- self.box.fadeTo(null != prev ? 0 : self.prms.fadeIn, 1, function () {
- $(this).trigger('wpv-message-open');
- prev = $(this);
- prev_text = self.prms.text;
- is_open = true;
- if (self.prms.onOpen && typeof self.prms.onOpen == 'function') {
- self.prms.onOpen.apply(self, self.prms.args);
- }
- if (self.prms.stay) {
- has_stay = true;
- }
- else {
- var remove_message = _.bind(self.wpvMessageRemove, self);
- _.delay(remove_message, self.prms.stay_for);
- //self.wpvMessageRemove();
- }
- });
-
- return self;
- },
- wpvMessageRemove: function () {
-
- var self = this;
-
- if (self.box || self.container.data('message-box')) {
- var box = self.box || self.container.data('message-box');
-
- box.fadeTo(self.prms.fadeOut, 0, function () {
- $(this).trigger('wpv-message-remove');
- is_open = false;
- prev = null;
- prev_text = '';
- has_stay = false;
- if (self.prms.onClose && typeof self.prms.onClose == 'function') {
- self.prms.onClose.apply(self, self.prms.args);
- }
-
- $(this).remove();
- self.container.data('has_message', false);
- self.container.data('message-box', null);
- self.box = null;
- });
- }
-
- return self;
- },
- destroy: function () {
- $(this).trigger('wpv-message-remove');
- this.container.empty();
- if (this.prms.onDestroy && typeof this.prms.onDestroy == 'function') {
- this.prms.onDestroy.apply(this, this.prms.args);
- }
- this.box = null;
- this.container.data('message-box', null);
- this.container.data('has_message', false);
- },
- has_message: function () {
- return this.container.data('has_message');
- }
- };
-
-
- $.fn[pluginName] = function (arg) {
-
- return this.each(function () {
- var args, instance;
-
- if (!( $(this).data(dataPlugin) instanceof Plugin )) {
- // if no instance, create one
- $(this).data(dataPlugin, new Plugin($(this), arg));
- }
- // do not use this one if you want the plugin to be a singleton bound to the DOM element
- else {
- // if instance delete reference and do another one
- $(this).data(dataPlugin, null);
- $(this).data(dataPlugin, new Plugin($(this), arg));
- }
-
- instance = $(this).data(dataPlugin);
-
- instance.element = $(this);
-
- // call Plugin.init( arg )
- if (typeof arg === 'undefined' || typeof arg === 'object') {
-
- if (typeof instance['init'] === 'function') {
- instance.init(arg);
- }
-
- // checks that the requested public method exists
- } else if (typeof arg === 'string' && typeof instance[arg] === 'function') {
-
- // copy arguments & remove function name
- args = Array.prototype.slice.call(arguments, 1);
-
- // call the method
- return instance[arg].apply(instance, args);
-
- } else {
-
- $.error('Method ' + arg + ' does not exist on jQuery.' + pluginName);
-
- }
- });
- };
-})(jQuery, window, document);
-
-jQuery(function ($) {
- $.each($('.js-show-toolset-message:not(.js-show-toolset-message-inited)'), function () {
- $(this)
- .addClass('js-show-toolset-message-inited')
- .show()
- .wpvToolsetHelp();
- });
-});
-
-if (typeof jQuery.fn.wpvToolsetHelp === 'undefined') {
-
- /* Help messages */
- (function ($) {
-
- $.fn.wpvToolsetHelp = function (options) {
-
- var thiz = this;
-
- var $container = this;
- var prms = $.extend({
- content: ( thiz.contents().length !== 0 ) ? thiz.contents() : "Enter a customized text to be displayed",
- tutorialButtonText: ( typeof(thiz.data('tutorial-button-text')) !== 'undefined' ) ? thiz.data('tutorial-button-text') : null,
- tutorialButtonURL: ( typeof(thiz.data('tutorial-button-url')) !== 'undefined' ) ? thiz.data('tutorial-button-url') : null,
- linkText: ( typeof(thiz.data('link-text')) !== 'undefined' ) ? thiz.data('link-text') : null,
- linkURL: ( typeof(thiz.data('link-url')) !== 'undefined' ) ? thiz.data('link-url') : null,
- footer: ( typeof(thiz.data('footer')) !== 'undefined' ) ? thiz.data('footer') : false,
- classname: ( typeof(thiz.data('classname')) !== 'undefined' ) ? thiz.data('classname') : '',
- close: ( typeof(thiz.data('close')) !== 'undefined' ) ? thiz.data('close') : true,
- hidden: ( typeof(thiz.data('hidden')) !== 'undefined' ) ? thiz.data('hidden') : false,
- onClose: false,
- args: []
- }, options);
-
- if ($.type(prms.content) === 'string') {
- prms.content = $('' + prms.content + '
');
- }
-
- var $box = $('');
-
- var $footer = $('');
-
- if (prms.footer === true) {
- $footer.appendTo($box);
- }
-
- prms.content.appendTo($box.find('.toolset-help-content'));
-
- this.wpvHelpRemove = function () {
- if ($box)
- $box.fadeOut('fast', function () {
- // $(this).remove();
- if (prms.onClose && typeof prms.onClose === 'function') {
- prms.onClose.apply($container, prms.args);
- }
- });
- return this;
- };
-
- if ((prms.tutorialButtonText && prms.tutorialButtonURL) || (prms.linkText && prms.linkURL)) {
- var $toolbar = $('
');
- $toolbar.appendTo($box.find('.toolset-help-content'));
- if (prms.tutorialButtonText && prms.tutorialButtonURL) {
- $('' + prms.tutorialButtonText + ' ').appendTo($toolbar);
- }
- if (prms.linkText && prms.linkURL) {
- $('' + prms.linkText + ' ').appendTo($toolbar);
- }
- }
-
- if (prms.close === true) {
- $(' ').appendTo($box);
- }
-
- // bind close event to all close buttons
- var $closeButtons = $box.find('.js-toolset-help-close');
- if ($closeButtons.length !== 0) {
- $closeButtons.on('click', function () {
- $container.wpvHelpRemove();
- });
- }
-
- $box.appendTo($container).hide();
- if ($container.hasClass('js-show-toolset-message')) {
- $box.unwrap();
- }
- if (prms.hidden === false) {
- $box.fadeIn('fast');
- }
-
- return this;
- };
-
- })(jQuery);
-
-}
-
-(function ($) {
- $.fn.insertAtIndex = function (index, selector) {
- var opts = $.extend({
- index: 0,
- selector: '
'
- }, {index: index, selector: selector});
- return this.each(function () {
- var p = $(this);
- var i = ($.isNumeric(opts.index) ? parseInt(opts.index, 10) : 0);
- if (i <= 0)
- p.prepend(opts.selector);
- else if (i > p.children().length - 1)
- p.append(opts.selector);
- else
- p.children().eq(i).before(opts.selector);
- });
- };
-})(jQuery);
-
-(function ($) {
-
- $.fn.loaderOverlay = function (action, options)
- // action: 'show'|'hide' attributes are optional.
- // options: fadeInSpeed, fadeOutSpeed, displayOverlay, class. attributes are optional
- {
-
- var defaults = {
- fadeInSpeed: 'fast',
- fadeOutSpeed: 'fast',
- displayLoader: true,
- css: {
- "opacity": "0.4"
- },
- class: null
- };
-
- var prms = $.extend(defaults, options);
- var $overlayContainer = this;
- var $overlayEl = $('
');
-
- var showOverlay = function () {
- if (!$overlayContainer.data('has-overlay')) {
- $overlayEl
- .appendTo($overlayContainer)
- .css(prms.css)
- .hide()
- .fadeIn(prms.fadeInSpeed, function () {
- $overlayContainer.data('has-overlay', true);
- $overlayContainer.data('overlay-el', $overlayEl);
- if (_.isObject(options) && typeof options.onOpen === 'function') {
- options.onOpen.call(this, arguments);
- }
- });
- }
- };
-
- var hideOverlay = function () {
- if ($overlayContainer.data('has-overlay')) {
- $overlayContainer.data('overlay-el')
- .fadeOut(prms.fadeOutSpeed, function () {
- $overlayEl.detach().remove();
- $overlayContainer.data('has-overlay', false);
- if (options && typeof options.onRemove === 'function') {
- options.onRemove.call(this, arguments);
- }
- });
- }
- };
-
- if (prms.class !== null) {
- $overlayEl.addClass(prms.class);
- }
- if (prms.displayLoader) {
- $('
').appendTo($overlayEl);
- }
-
- if (typeof(action) !== 'undefined') { // When 'action' parameter is given
-
- if (action === 'show') {
- showOverlay();
- }
- else if (action === 'hide') {
- hideOverlay();
- }
-
- }
- else { // when the method is called without 'action' parameter
-
- if ($overlayContainer.data('has-overlay')) { // hide overlay if it's displayed
- hideOverlay();
- }
- else { // show overlay if not
- showOverlay();
- }
-
- }
-
- return this;
- };
-
-})(jQuery);
-
-(function ($) {
- /*
- Basic usage:
- $element.ddlWpPointer(); // will show a pointer if it's hidden OR hide a pointer if it's shown
-
- 1. $element have to be valid jQuery selector
- 2. data-toolipt-header HTML attribute is required to display the header
- 3. data-tooltip-content HTML attribute is required to display the content
-
- Customization:
- $element.ddlWpPointer('action', // action: 'show' | 'hide'
- {
- content: $element // $element have to be valid jQuery selector content element should contain H3 for the header and P for the content. Example:
- edge: 'left' // 'left' | 'right' | 'top' | 'bottom'
- align: 'center' // 'center' | 'right' | 'left'
- offset: 'x y' // example: '0 15'
- })
-
- */
- $.fn.ddlWpPointer = function (action, options) {
- var $el = this;
-
- //$.jStorage.flush();
-
- var defaults = {
- headerText: function () {
- var header = $el.data('tooltip-header');
- if (header) {
- return header;
- }
- else {
- return 'use data-tooltip-header="header text" attribute to create a header';
- }
- },
- contentText: function () {
- var content = $el.data('tooltip-content');
- if (content) {
- return content;
- }
- else {
- return 'use data-tooltip-content="content text" attribute to create a content';
- }
- },
- content: function () { // returns string by default (data-tooltip-header and data-tooltip-content attibutes), but can be overridden by jQuery obj
- return '' + defaults.headerText() + ' ' + defaults.contentText() + '
';
- },
- edge: 'left',
- align: 'center',
- offset: '0 0',
- stay_hidden: false
- };
-
- var prms = $.extend(defaults, options);
-
- var showPointer = function () {
-
- if (!$el.data('has-wppointer')) {
-
- if( typeof prms.onOpen === 'function' ){
- prms.onOpen.call( this, arguments );
- }
-
- $el
- .pointer({
- content: function () {
- return prms.content;
- },
- pointerClass: 'wp-toolset-pointer wp-toolset-layouts-pointer',
- position: {
- edge: prms.edge,
- align: prms.align,
- offset: prms.offset
- },
- close: function () {
-
- $el.data('has-wppointer', false);
- $el.trigger('help_tooltip_closes', options);
- }
- })
- .pointer('open');
-
- $el.data('has-wppointer', true);
-
- if( typeof prms.onComplete === 'function' ){
- prms.onComplete.call( this, arguments );
- }
-
- }
- };
-
- var hidePointer = function () {
-
- if ($el.data('has-wppointer')) {
-
- if( typeof prms.onClose === 'function' ){
- prms.onClose.call( this, arguments );
- }
-
- $el.pointer('close');
- $el.data('has-wppointer', false);
-
- }
- };
-
- if (typeof(action) !== 'undefined') { // When 'action' parameter is given
-
- if (action === 'show' && prms.stay_hidden !== true) {
- showPointer();
- }
- else if (action === 'hide') {
- hidePointer();
- }
-
- }
- else { // when the method is called without 'action' parameter
-
- if ($el.data('has-wppointer')) { // hide pointer if it's displayed
- hidePointer();
- }
- else if (prms.stay_hidden !== true) { // show it if not
- showPointer();
- }
-
- }
-
- return this;
- };
-
-})(jQuery);
-
-WPV_Toolset.Utils.Loader = function () {
- //fake comment
- var self = this;
-
- self.loading = false;
- self.el = null;
-
- self.loader = jQuery('
');
-
- self.loadShow = function (el, after) {
- self.el = el;
- self.loading = true;
-
- if (typeof after === 'undefined') {
- self.loader.prependTo(self.el).css('visibility', 'visible').show();
- }
- else {
- self.loader.insertAfter(self.el).css('visibility', 'visible').show();
- }
-
- return self.loader;
- };
- self.loadHide = function () {
- var $completeFlag = jQuery(' ')
-
- _.each(self.loader[0].attributes, function (attribute) {
- if (attribute.name === 'style') {
- $completeFlag.attr(attribute.name, attribute.value);
- }
- });
-
- var adjustPosition = function( positionName, position ) {
- position = parseInt(position);
-
- if (position < 0) {
- $completeFlag.css(positionName, '');
- } else {
- position += 8;
- $completeFlag.css(positionName, position.toString() + 'px');
- }
- };
-
- adjustPosition( 'left', self.loader.css('left') );
- adjustPosition( 'right', self.loader.css('right') );
-
- self.loader = $completeFlag.replaceAll(self.loader).css({
- color: 'green',
- fontSize: '22px'
- });
-
- self.loader.fadeOut(1800, function () {
- self.loader = jQuery('
').replaceAll( jQuery(this) );
- self.loading = false;
- self.loader.remove();
- jQuery(this).remove();
- });
-
- return self.loader;
- };
-};
-
-if (typeof _ != 'undefined') {
- WPV_Toolset.Utils.flatten = function (x, result, prefix) {
- if (_.isObject(x)) {
- _.each(x, function (v, k) {
- WPV_Toolset.Utils.flatten(v, result, prefix ? prefix + '_' + k : k)
- })
- } else {
- result[prefix] = x
- }
- return result
- };
- WPV_Toolset.Utils.flatten_filter_by_key = function (x, result, prefix, filter) {
- var res = [],
- find = WPV_Toolset.Utils.flatten(x, result, prefix);
-
- if (!filter) return _.values(find);
-
- _.each(find, function (element, index, list) {
- if (index.indexOf(prefix ? prefix + '_' + filter : filter) !== -1 || filter === index)
- res.push(element);
- });
-
- return res;
- }
- WPV_Toolset.Utils.containsObject = function (obj, list) {
- var res = _.find(list, function (val) {
- return _.isEqual(obj, val);
- });
- return (_.isObject(res)) ? true : false;
- };
-}
-;
-
-
-(function ($) {
- $.fn.textWidth = function () {
- var text = this.html() || this.text() || this.val();
- return ( $.textWidth(text) );
- };
- $.textWidth = function (text) {
- var div = $('#textWidth');
- if (div.length === 0)
- div = $('
').appendTo($('body'));
- div.html(text);
- return (div.width());
- };
-})(jQuery);
-
-//Courtesy from http://stackoverflow.com/questions/24816/escaping-html-strings-with-jquery
-WPV_Toolset.Utils.escapeHtml = function (str) {
- if (typeof(str) == "string") {
- try {
- var newStr = "";
- var nextCode = 0;
- for (var i = 0; i < str.length; i++) {
- nextCode = str.charCodeAt(i);
- if (nextCode > 0 && nextCode < 128) {
- newStr += "" + nextCode + ";";
- }
- else {
- newStr += "?";
- }
- }
- return newStr;
- }
- catch (err) {
- }
- }
- else {
- return str;
- }
-};
-
-WPV_Toolset.Utils.editor_decode64 = function (input) {
- var output = "",
- chr1, chr2, chr3 = "",
- enc1, enc2, enc3, enc4 = "",
- i = 0,
- keyStr = "ABCDEFGHIJKLMNOP" +
- "QRSTUVWXYZabcdef" +
- "ghijklmnopqrstuv" +
- "wxyz0123456789+/" +
- "=";
-
- // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
- var base64test = /[^A-Za-z0-9\+\/\=]/g;
- if (base64test.exec(input)) {
- alert("There were invalid base64 characters in the input text.\n" +
- "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" +
- "Expect errors in decoding.");
- }
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-
- do {
- enc1 = keyStr.indexOf(input.charAt(i++));
- enc2 = keyStr.indexOf(input.charAt(i++));
- enc3 = keyStr.indexOf(input.charAt(i++));
- enc4 = keyStr.indexOf(input.charAt(i++));
-
- chr1 = (enc1 << 2) | (enc2 >> 4);
- chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
- chr3 = ((enc3 & 3) << 6) | enc4;
-
- output = output + String.fromCharCode(chr1);
-
- if (enc3 != 64) {
- output = output + String.fromCharCode(chr2);
- }
- if (enc4 != 64) {
- output = output + String.fromCharCode(chr3);
- }
-
- chr1 = chr2 = chr3 = "";
- enc1 = enc2 = enc3 = enc4 = "";
-
- } while (i < input.length);
-
- return WPV_Toolset.Utils.editor_utf8_decode(output);
-};
-
-WPV_Toolset.Utils.editor_utf8_decode = function (utftext) {
- var string = "";
- var i = 0;
- var c = c1 = c2 = 0;
-
- while (i < utftext.length) {
-
- c = utftext.charCodeAt(i);
-
- if (c < 128) {
- string += String.fromCharCode(c);
- i++;
- }
- else if ((c > 191) && (c < 224)) {
- c2 = utftext.charCodeAt(i + 1);
- string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
- i += 2;
- }
- else {
- c2 = utftext.charCodeAt(i + 1);
- c3 = utftext.charCodeAt(i + 2);
- string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
- i += 3;
- }
-
- }
-
- return string;
-};
-
-// convert unicode character to its corresponding numeric entity
-WPV_Toolset.Utils.fixedCharCodeAt = function (str, idx) {
- // ex. fixedCharCodeAt ('\uD800\uDC00', 0); // 65536
- // ex. fixedCharCodeAt ('\uD800\uDC00', 1); // 65536
- idx = idx || 0;
- var code = str.charCodeAt(idx);
- var hi, low;
- if (0xD800 <= code && code <= 0xDBFF) { // High surrogate (could change last hex to 0xDB7F to treat high private surrogates as single characters)
- hi = code;
- low = str.charCodeAt(idx + 1);
- if (isNaN(low)) {
- throw 'High surrogate not followed by low surrogate in fixedCharCodeAt()';
- }
- return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;
- }
- if (0xDC00 <= code && code <= 0xDFFF) { // Low surrogate
- // We return false to allow loops to skip this iteration since should have already handled high surrogate above in the previous iteration
- return false;
- /*hi = str.charCodeAt(idx-1);
- low = code;
- return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;*/
- }
- return code;
-};
-
-WPV_Toolset.replace_unicode_characters = function (string) {
- // remove accents, swap ñ for n, etc
- var from = "ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;",
- to = "aaaaaeeeeeiiiiooooouuuunc------";
- for (var i = 0, l = from.length; i < l; i++) {
- string = string.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
- }
-
- var unicode = '!£$%&()=?^|#§';
-
- for (var i = 0; i < unicode.length; i++) {
- string = string.replace(new RegExp(unicode.charAt(i).regexEscape(), 'g'), WPV_Toolset.Utils.fixedCharCodeAt(unicode.charAt(i)));
- }
-
- return string;
-};
-
-// escapes regex characters for use in regex constructor
-String.prototype.regexEscape = function regexEscape() {
- return this.replace(/[\.\?\+\*\^\$\|\(\{\[\]\\)]/g, '\\$&');
-};
-
-// THE TOOLTIP //
-;
-(function ($, window, document, undefined) {
-
- // Create the defaults once
- var pluginName = "toolsetTooltip",
- dataPlugin = "plugin_" + pluginName,
- undefined,
- defaults = {
- top: undefined,
- text: '',
- close: null,
- open: null,
- additionalClass: ''
- };
-
- // The actual plugin constructor
- function Plugin(element, options) {
-
- this.$element = element;
- this.settings = $.extend({}, defaults, options);
- this._defaults = defaults;
- this._name = pluginName;
- this._remove_tooltip = null;
- }
-
- // Avoid Plugin.prototype conflicts
- $.extend(Plugin.prototype, {
- init: function () {
- var self = this;
- this.$element.on('mouseenter', function (event) {
- event.stopImmediatePropagation();
- self.show(event);
- jQuery(event.target).trigger('tooltip_show', event);
- });
- this.$element.on('mouseleave', function (event) {
- event.stopImmediatePropagation();
- self.hide(event);
- jQuery(event.target).trigger('tooltip_hide', event);
- });
- },
- show: function (event) {
- var self = this,
- $tooltip = $('
'),
- offset = self.$element.offset(),
- offset_top = typeof self.settings.top === 'undefined' ? 20 : self.settings.top;
-
- if (this.settings.additionalClass) {
- $tooltip.addClass(this.settings.additionalClass);
- }
-
- self._remove_tooltip = $tooltip;
-
- $tooltip
- .appendTo('body')
- .text(this.settings.text || self.$element.data('tooltip-text'))
- .css({
- 'top': offset.top - $tooltip.height() - offset_top,
- 'left': offset.left - ($tooltip.outerWidth() / 2) + (self.$element.outerWidth() / 2),
- 'zIndex': '9999999'
- })
- .fadeIn(100);
-
- // Probably $elem doesn't is removed before 'click' event takes place
- // So we need to call _manageCellTooltip( $elem, 'hide') somewhere... but i don't know where ;)
-
- self.$element.on('mousedown', function () {
-
- if (self._remove_tooltip) {
- self._remove_tooltip.remove();
- self._remove_tooltip = null;
- }
- });
-
- if (self.settings.open !== null && self.settings.open instanceof Function) {
- self.settings.open.call(self);
- }
-
- return $tooltip;
- },
- hide: function (event) {
- var self = this;
-
- if (self._remove_tooltip) {
- if (self.settings.close !== null && self.settings.close instanceof Function) {
- self.settings.close.call(self);
- }
- self._remove_tooltip.remove();
- self._remove_tooltip = null;
- }
- }
- });
-
- $.fn[pluginName] = function (arg) {
-
- return this.each(function () {
- var args, instance;
-
- if (!( $(this).data(dataPlugin) instanceof Plugin )) {
- // if no instance, create one
- $(this).data(dataPlugin, new Plugin($(this), arg));
- }
-
- instance = $(this).data(dataPlugin);
- instance.element = $(this);
-
- // call Plugin.init( arg )
- if (typeof arg === 'undefined' || typeof arg === 'object') {
-
- if (typeof instance['init'] === 'function') {
- instance.init(arg);
- }
-
- // checks that the requested public method exists
- } else if (typeof arg === 'string' && typeof instance[arg] === 'function') {
-
- // copy arguments & remove function name
- args = Array.prototype.slice.call(arguments, 1);
-
- // call the method
- return instance[arg].apply(instance, args);
-
- } else {
-
- $.error('Method ' + arg + ' does not exist on jQuery.' + pluginName);
-
- }
- });
- };
-
-})(jQuery, window, document);
-
-;(function ($, window, document, undefined) {
- /*
-
- highlight v3 !! Modified by Jon Raasch (http://jonraasch.com) to fix IE6 bug !!
-
- Highlights arbitrary terms.
-
-
-
- MIT license.
-
- Johann Burkard
-
-
-
- */
- var defaults = {
- className: 'highlighted'
- },
- options = {};
-
- jQuery.fn.highlight = function (pat, option) {
-
- options = jQuery.extend(options, defaults, option)
-
- function innerHighlight(node, pat) {
- var skip = 0;
-
- if (node.nodeType == 3) {
- var pos = node.data.toUpperCase().indexOf(pat);
- if (pos >= 0) {
- var spannode = document.createElement('span');
- spannode.className = options.className;
- var middlebit = node.splitText(pos);
- var endbit = middlebit.splitText(pat.length);
- var middleclone = middlebit.cloneNode(true);
- spannode.appendChild(middleclone);
- middlebit.parentNode.replaceChild(spannode, middlebit);
- skip = 1;
- }
- }
- else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
- for (var i = 0; i < node.childNodes.length; ++i) {
- i += innerHighlight(node.childNodes[i], pat);
- }
- }
- return skip;
- }
-
- return this.each(function () {
- innerHighlight(this, pat.toUpperCase());
- });
- };
-
- jQuery.fn.removeHighlight = function () {
- function newNormalize(node) {
- for (var i = 0, children = node.childNodes, nodeCount = children.length; i < nodeCount; i++) {
- var child = children[i];
- if (child.nodeType == 1) {
- newNormalize(child);
- continue;
- }
- if (child.nodeType != 3) {
- continue;
- }
- var next = child.nextSibling;
- if (next == null || next.nodeType != 3) {
- continue;
- }
- var combined_text = child.nodeValue + next.nodeValue;
- new_node = node.ownerDocument.createTextNode(combined_text);
- node.insertBefore(new_node, child);
- node.removeChild(child);
- node.removeChild(next);
- i--;
- nodeCount--;
- }
- }
-
- return this.find("span." + options.className).each(function () {
- var thisParent = this.parentNode;
- thisParent.replaceChild(this.firstChild, this);
- newNormalize(thisParent);
- }).end();
- };
-
-}(jQuery, window, document));
-
-var waitForFinalEvent = (function () {
- var timers = {};
- return function (callback, ms, uniqueId) {
- if (!uniqueId) {
- uniqueId = "Don't call this twice without a uniqueId";
- }
- if (timers[uniqueId]) {
- clearTimeout(timers[uniqueId]);
- }
-
- timers[uniqueId] = setTimeout(callback, ms);
- };
-})();
-
-
-WPV_Toolset.Utils._strip_scripts = function (data) {
-
- if (!data) return '';
-
- if (_.isString(data) === false) return '';
-
- data = data.replace(/</g, "|-lt-|");
- data = data.replace(/>/g, "|-gt-|");
- data = data.replace(/&(\w+);/g, "&$1;"); // Preserve entities (rafael.v)
-
- var out = data.replace(/<.*?script.*?>.*?<\/.*?script.*?>/igm, "");
- out = out.replace(/</g, "<");
- out = out.replace(/>/g, ">");
- out = out.replace(/&(\w+);/g, "&$1;"); // Preserve entities (rafael.v)
- out = out.replace(/\|-lt-\|/g, '<');
- out = out.replace(/\|-gt-\|/g, '>');
- return out;
-};
-
-if (!String.prototype.trim) {
- (function () {
- // Make sure we trim BOM and NBSP
- var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
- String.prototype.trim = function () {
- return this.replace(rtrim, '');
- };
- })();
-}
-
-
-/**
- * Strip known tags and escape the rest of the string.
- *
- * Warning! Since underscore.js 1.2.2 the _.escape() method got dumber and
- * now it double-escapes HTML entities (read: https://github.com/jashkenas/underscore/issues/350).
- * If you want to avoid double-escaping, you can do it by:
- *
- * WPV_Toolset.Utils._strip_tags_and_preserve_text(_.unescape(text))
- *
- * Note: Although the "_" prefix suggests this function is private, it's also used elsewhere.
- *
- * @param {string} text
- * @returns {string}
- * @since unknown
- */
-WPV_Toolset.Utils._strip_tags_and_preserve_text = function (text) {
- var rex = /<\/?(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|bgsound|big|blink|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|main|map|mark|marquee|menu|menuitem|meta|meter|nav|nobr|noframes|noscript|object|ol|optgroup|option|output|p|param|plaintext|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|spacer|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp)\b[^<>]*>/ig
- return _.escape(text.replace(rex, "")).trim();
-};
-
-
-/**
- * Setup the behaviour of browser when user tries to leave the page.
- *
- * When user tries to leave the page, check if confirmation is needed, and if so, displays a confirmation message and
- * runs custom action.
- *
- * WARNING: http://stackoverflow.com/a/37782307
- *
- * @param {function} checkIfConfirmationNeededCallback Should return true if confirmation should be shown (e.g. unsaved data).
- * @param {function|null} onBeforeUnloadCallback Will be called before showing the confirmation.
- * @param {string} confirmationMessage Confirmation message that should be shown by the browser.
- * @since unknown
- */
-WPV_Toolset.Utils.setConfirmUnload = function (checkIfConfirmationNeededCallback, onBeforeUnloadCallback, confirmationMessage) {
- window.onbeforeunload = function (e) {
- if (checkIfConfirmationNeededCallback()) {
-
- if(_.isFunction(onBeforeUnloadCallback)) {
- onBeforeUnloadCallback();
- }
-
- // For IE and Firefox prior to version 4
- if (e) {
- e.returnValue = confirmationMessage;
- }
- return confirmationMessage;
- }
- };
-};
-
-if (typeof _ !== 'undefined' && typeof _.capitalize === 'undefined') {
- _.mixin({
- capitalize: function (string) {
- return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
- }
- });
-}
-
-
-WPV_Toolset.Utils.has_shortcode = function (string) {
- var search = /\[(\[?)(\w*?\-*?\w*?)*?(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*(?:\[(?!\/\2\])[^\[]*)*)(\[\/\2\]))?)(\]?)/g;
- return decodeURIComponent(string).search(search) !== -1;
-};
-
-
-/**
- * Courtesy from: https://gist.github.com/alexey-bass/1115557
- * @param left
- * @param right
- * @returns int
- */
-WPV_Toolset.Utils.versionCompare = function (left, right) {
- if (typeof left + typeof right != 'stringstring')
- return false;
-
- var a = left.split('.')
- , b = right.split('.')
- , i = 0, len = Math.max(a.length, b.length);
-
- for (; i < len; i++) {
- if ((a[i] && !b[i] && parseInt(a[i]) > 0) || (parseInt(a[i]) > parseInt(b[i]))) {
- return 1;
- } else if ((b[i] && !a[i] && parseInt(b[i]) > 0) || (parseInt(a[i]) < parseInt(b[i]))) {
- return -1;
- }
- }
-
- return 0;
-};
-
-
-/**
- * Get a query argument value from a URL.
- *
- * @param {string} name Argument name.
- * @param {string} [url] Source URL. Optional. If missing, current page URL will be used.
- * @returns {string|null}
- * @since 2.1
- * @link http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
- */
-WPV_Toolset.Utils.getParameterByName = function (name, url) {
-
- if (!url) {
- url = window.location.href;
- }
-
- name = name.replace(/[\[\]]/g, "\\$&");
-
- var regex = new RegExp("[?&]" + name + "(=([^]*)|&|#|$)", "i");
-
- var results = regex.exec(url);
-
- if (!results) {
- return null;
- }
-
- if (!results[2]) {
- return '';
- }
-
- return decodeURIComponent(results[2].replace(/\+/g, " "));
-};
-
-
-/**
- * Add, update or remove query string argument.
- *
- * @param {string} key Argument name.
- * @param {string} [value] Argument value. Not supplying a value will remove the parameter, supplying one will
- * add/update the argument.
- * @param {string} [url] If no URL is supplied, it will be grabbed from window.location
- * @returns {string}
- * @link http://stackoverflow.com/a/11654596/3191395
- */
-WPV_Toolset.Utils.updateUrlQuery = function (key, value, url) {
- if (!url) {
- url = window.location.href;
- }
- var re = new RegExp("([?&])" + key + "=.*?(&|#|$)(.*)", "gi");
- var hash;
-
- if (re.test(url)) {
- if (typeof value !== 'undefined' && value !== null) {
- return url.replace(re, '$1' + key + "=" + value + '$2$3');
- } else {
- hash = url.split('#');
- url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
- if (typeof hash[1] !== 'undefined' && hash[1] !== null) {
- url += '#' + hash[1];
- }
- return url;
- }
- } else {
- if (typeof value !== 'undefined' && value !== null) {
- var separator = url.indexOf('?') !== -1 ? '&' : '?';
- hash = url.split('#');
- url = hash[0] + separator + key + '=' + value;
- if (typeof hash[1] !== 'undefined' && hash[1] !== null) {
- url += '#' + hash[1];
- }
- return url;
- } else {
- return url;
- }
- }
-};
-
-
-/**
- * Tools for manipulating spinners in a native WP way.
- *
- * If WP changes the behaviour, we'll need only to update this object.
- *
- * @type {{create: WPV_Toolset.Utils.Spinner.create, show: WPV_Toolset.Utils.Spinner.show, hide: WPV_Toolset.Utils.Spinner.hide, find: WPV_Toolset.Utils.Spinner.find}}
- */
-WPV_Toolset.Utils.Spinner = {
- create: function () {
- return jQuery(' ');
- },
- show: function (spinner, show) {
- if (typeof(show) === 'undefined') {
- show = true;
- }
-
- if (!show) {
- WPV_Toolset.Utils.Spinner.hide(spinner);
- return;
- }
-
- spinner.addClass('is-active');
- },
- hide: function (spinner) {
- spinner.removeClass('is-active');
- },
- find: function (parentElement) {
- return parentElement.find('.spinner');
- }
-};
-
-
-/**
- * AJAX call helper.
- *
- * WIP, to be merged with WPV_Toolset.Utils.do_ajax_post().
- *
- * @type {{parseResponse: WPV_Toolset.Utils.Ajax.parseResponse, call: WPV_Toolset.Utils.Ajax.call}}
- * @since 2.1
- */
-WPV_Toolset.Utils.Ajax = {
-
- /**
- * Ensure that response is always an object with the success property.
- *
- * If it's not, return a dummy object indicating a failure.
- *
- * @param response {*} Response from the AJAX call.
- * @returns {{success: boolean}} Sanitized response.
- *
- * @since 2.1
- */
- parseResponse: function (response) {
- if (typeof(response.success) === 'undefined') {
- console.log("parseResponse: no success value", response);
- return {success: false};
- } else {
- return response;
- }
- },
-
-
- /**
- * Perform an AJAX call on field definitions.
- *
- * @param {*} data AJAX call parameters. Needs to include 'action' and 'wpnonce'.
- * @param {function} successCallback Callback to be used after AJAX call is completed. It will get two parameters,
- * the complete AJAX response and the 'data' element for convenience.
- * @param {function} [failCallback] Analogous to successCallback for the case of failure. If missing,
- * successCallback will be used instead.
- *
- * @since 2.1
- */
- call: function (data, successCallback, failCallback) {
-
- if (typeof(failCallback) === 'undefined') {
- failCallback = successCallback;
- }
-
- jQuery.post({
- async: true,
- url: ajaxurl,
- data: data,
-
- success: function (originalResponse) {
- var response = WPV_Toolset.Utils.Ajax.parseResponse(originalResponse);
-
- if (response.success) {
- successCallback(response, response.data || {});
- } else {
- failCallback(response, response.data || {});
- }
- },
-
- error: function (ajaxContext) {
- console.log('Error:', ajaxContext.responseText);
- failCallback({success: false, data: {}}, {});
- }
- });
-
- }
-
-};
-
-
-WPV_Toolset.Utils._template = function (template, data, settings) {
- var options = _.defaults({}, settings, _.templateSettings),
- _template = null;
-
- if (WPV_Toolset.Utils.versionCompare(_.VERSION, '1.7') >= 0) {
- _template = _.template(template, options);
- return _template(data);
- } else {
- return _.template(template, data, options);
- }
-};
-
-// override dialog whenever toolset is active and take possession
-/**
- * @todo This should not be here:
- * dialogs with specific classnames should get it directly.
- * We should not be pre-setting all jQuery UI dialogs dialogClass setting,
- * we are not good players here.
- */
-if (jQuery && jQuery.ui && jQuery.ui.dialog) {
- jQuery.extend(jQuery.ui.dialog.prototype.options, {
- dialogClass: 'toolset-ui-dialog'
- });
-}
-
-
-if (typeof Toolset.add_qt_editor_buttons !== 'function') {
- Toolset.add_qt_editor_buttons = function (qt_instance, editor_instance) {
- var activeUrlEditor, html;
- QTags._buttonsInit();
- var editorInstance = {};
- editorInstance[qt_instance.id] = editor_instance;
-
- for (var button_name in qt_instance.theButtons) {
- if (qt_instance.theButtons.hasOwnProperty(button_name)) {
- qt_instance.theButtons[button_name].old_callback = qt_instance.theButtons[button_name].callback;
- if (qt_instance.theButtons[button_name].id == 'img') {
- qt_instance.theButtons[button_name].callback = function (element, canvas, ed) {
- var t = this,
- id = jQuery(canvas).attr('id'),
- selection = editorInstance[id].getSelection(),
- e = "http://",
- g = prompt(quicktagsL10n.enterImageURL, e),
- f = prompt(quicktagsL10n.enterImageDescription, "");
- t.tagStart = ' ';
- selection = t.tagStart;
- t.closeTag(element, ed);
- editorInstance[id].replaceSelection(selection, 'end');
- editorInstance[id].focus();
- }
- } else if (qt_instance.theButtons[button_name].id == 'close') {
-
- } else if (qt_instance.theButtons[button_name].id == 'link') {
- var t = this;
- qt_instance.theButtons[button_name].callback =
- function (b, c, d, e) {
- activeUrlEditor = c;
- var f, g = this;
- return "undefined" != typeof wpLink ? void wpLink.open(d.id) : (e || (e = "http://"), void(g.isOpen(d) === !1 ? (f = prompt(quicktagsL10n.enterURL, e), f && (g.tagStart = '', a.TagButton.prototype.callback.call(g, b, c, d))) : a.TagButton.prototype.callback.call(g, b, c, d)))
- };
- jQuery('#wp-link-submit').off();
- jQuery('#wp-link-submit').on('click', function (event) {
- event.preventDefault();
- if (wpLink.isMCE()) {
- wpLink.mceUpdate();
- } else {
- var id = jQuery(activeUrlEditor).attr('id'),
- selection = editorInstance[id].getSelection(),
- inputs = {},
- attrs, text, title, html;
- inputs.wrap = jQuery('#wp-link-wrap');
- inputs.backdrop = jQuery('#wp-link-backdrop');
- if (jQuery('#link-target-checkbox').length > 0) {
- // Backwards compatibility - before WordPress 4.2
- inputs.text = jQuery('#link-title-field');
- attrs = wpLink.getAttrs();
- text = inputs.text.val();
- if (!attrs.href) {
- return;
- }
- // Build HTML
- html = ' /g, '>').replace(/"/g, '"');
- html += ' title="' + title + '"';
- }
- html += '>';
- html += text || selection;
- html += '';
- t.tagStart = html;
- selection = t.tagStart;
- } else {
- // WordPress 4.2+
- inputs.text = jQuery('#wp-link-text');
- attrs = wpLink.getAttrs();
- text = inputs.text.val();
- if (!attrs.href) {
- return;
- }
- // Build HTML
- html = '';
- html += text || selection;
- html += ' ';
- selection = html;
- }
- jQuery(document.body).removeClass('modal-open');
- inputs.backdrop.hide();
- inputs.wrap.hide();
- jQuery(document).trigger('wplink-close', inputs.wrap);
- editorInstance[id].replaceSelection(selection, 'end');
- editorInstance[id].focus();
- return false;
- }
- });
- } else {
- qt_instance.theButtons[button_name].callback = function (element, canvas, ed) {
- var id = jQuery(canvas).attr('id'),
- t = this,
- selection = editorInstance[id].getSelection();
- if (selection.length > 0) {
- if (!t.tagEnd) {
- selection = selection + t.tagStart;
- } else {
- selection = t.tagStart + selection + t.tagEnd;
- }
- } else {
- if (!t.tagEnd) {
- selection = t.tagStart;
- } else if (t.isOpen(ed) === false) {
- selection = t.tagStart;
- t.openTag(element, ed);
- } else {
- selection = t.tagEnd;
- t.closeTag(element, ed);
- }
- }
- editorInstance[id].replaceSelection(selection, 'end');
- editorInstance[id].focus();
- }
- }
- }
- }
- }
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/singleton_factory.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/singleton_factory.php
deleted file mode 100644
index 0ad0d33..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/singleton_factory.php
+++ /dev/null
@@ -1,81 +0,0 @@
-newInstanceArgs( $arguments );
- } else {
- // no arguments, no extra magic needed
- self::$instances[ $class ] = new $class();
- }
-
-
- return self::$instances[ $class ];
- }
-}
\ No newline at end of file
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/utils.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/utils.php
deleted file mode 100644
index a137548..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/utility/utils.php
+++ /dev/null
@@ -1,867 +0,0 @@
- The content to show inside the help box.
- * tutorial-button-text => Optional button anchor text.
- * tutorial-button-url => Optional button url.
- * link-text => Optional link anchor text.
- * link-url => Optional link url.
- * footer => 'true'|'false' Whether the help box should have a footer with a Close button (managed) and a "dismiss forever" button (not managed). Defaults to 'false'.
- * classname => Additional classnames for the help box in a space-separated list.
- * close => 'true'|'false' Whether the help box should have a close button. Defaults to 'true'.
- * hidden => 'true'|'false' Whether the help box should be hidden by default. Defaults to 'false'.
- *
- * @since 1.7
- */
- public static function help_box( $data = array() ) {
- if ( is_array( $data ) && ! empty( $data ) ) {
- $data_attr = '';
- foreach ( $data as $key => $value ) {
- if ( 'text' != $key ) {
- $data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '"';
- }
- }
- ?>
- >
-
-
- $_wp_additional_image_sizes[ $_size ]['width'],
- 'height' => $_wp_additional_image_sizes[ $_size ]['height'],
- 'crop' => $_wp_additional_image_sizes[ $_size ]['crop'],
- );
- }
- }
-
- // Get only 1 size if found
- if ( $size ) {
-
- if ( isset( $sizes[ $size ] ) ) {
- return $sizes[ $size ];
- } else {
- return false;
- }
- }
-
- return $sizes;
- }
-
- /**
- * Check if a value is numeric and represents a non-negative number (zero is also ok, floats are ok).
- *
- * @param $value
- *
- * @return bool
- * @since m2m
- */
- public static function is_nonnegative_numeric( $value ) {
- return ( is_numeric( $value ) && ( 0 <= $value ) );
- }
-
-
- /**
- * Check if a value is numeric and represents an integer (not a float).
- *
- * @param $value
- *
- * @return bool
- * @since m2m
- */
- public static function is_integer( $value ) {
- // http://stackoverflow.com/questions/2559923/shortest-way-to-check-if-a-variable-contains-positive-integer-using-php
- return ( (int) $value == $value && is_numeric( $value ) );
- }
-
-
- /**
- * Check if a value is numeric, represents an integer, and is non-negative.
- *
- * @param $value
- *
- * @return bool
- */
- public static function is_nonnegative_integer( $value ) {
- return (
- self::is_nonnegative_numeric( $value )
- && self::is_integer( $value )
- );
- }
-
- /**
- * Check if a value is numeric, represents an integer (not a float) and positive.
- *
- * @param mixed $value
- *
- * @return bool
- * @since m2m
- */
- public static function is_natural_numeric( $value ) {
- return (
- self::is_nonnegative_integer( $value )
- && ( 0 < (int) $value )
- );
- }
-
-
- /**
- * Changes array of items into string of items, separated by comma and sql-escaped
- *
- * @see https://coderwall.com/p/zepnaw
- *
- * Taken from wpml_prepare_in().
- *
- * @param mixed|array $items item(s) to be joined into string
- * @param string $format %s or %d
- *
- * @return string Items separated by comma and sql-escaped
- * @since m2m
- */
- public static function prepare_mysql_in( $items, $format = '%s' ) {
- global $wpdb;
-
- $items = (array) $items;
- $how_many = count( $items );
- $prepared_in = '';
-
- if ( $how_many > 0 ) {
- $placeholders = array_fill( 0, $how_many, $format );
- $prepared_format = implode( ",", $placeholders );
- $prepared_in = $wpdb->prepare( $prepared_format, $items );
- }
-
- return $prepared_in;
- }
-
- /**
- * Check for a custom field value's "emptiness".
- *
- * "0" is also a valid value that we need to take into account.
- *
- * @param $field_value
- ** @return bool
- *
- * @since 2.2.3
- */
- public static function is_field_value_truly_empty( $field_value ) {
- $is_truly_empty = ( empty( $field_value ) && ! is_numeric( $field_value ) );
-
- return $is_truly_empty;
- }
-
-
- /**
- * Return an ID of an attachment by searching the database with the file URL.
- *
- * First checks to see if the $url is pointing to a file that exists in
- * the wp-content directory. If so, then we search the database for a
- * partial match consisting of the remaining path AFTER the wp-content
- * directory. Finally, if a match is found the attachment ID will be
- * returned.
- *
- * Taken from:
- *
- * @link http://frankiejarrett.com/get-an-attachment-id-by-url-in-wordpress/
- *
- * @param string $url URL of the file.
- *
- * @return int|null Attachment ID if it exists.
- * @since 2.2.9
- */
- public static function get_attachment_id_by_url( $url ) {
-
- // Split the $url into two parts with the wp-content directory as the separator.
- $parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );
-
- // Get the host of the current site and the host of the $url, ignoring www.
- $this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );
- $file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );
-
- // Return nothing if there aren't any $url parts or if the current host and $url host do not match.
- $attachment_path = toolset_getarr( $parsed_url, 1 );
- if ( ! isset( $attachment_path ) || empty( $attachment_path ) || ( $this_host != $file_host ) ) {
- return null;
- }
-
- // Now we're going to quickly search the DB for any attachment GUID with a partial path match.
- // Example: /uploads/2013/05/test-image.jpg
- global $wpdb;
-
- $query = $wpdb->prepare(
- "SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND guid LIKE %s",
- '%' . $attachment_path
- );
-
- $attachment = $wpdb->get_col( $query );
-
- if ( is_array( $attachment ) && ! empty( $attachment ) ) {
- return (int) array_shift( $attachment );
- }
-
- return null;
- }
-
-
- /**
- * Set a value in a nested array, creating the structure as needed.
- *
- * @param array &$array The array to be modified.
- * @param string[] $path Array of keys, each element means one level of nesting.
- * @param mixed $value The value to be assigned to the last level.
- *
- * Example:
- *
- * $result = Toolset_Utils::set_nested_value( $result, array( 'a', 'b', 'c' ), 'x' );
- *
- * Then $result would be:
- *
- * array(
- * 'a' => array(
- * 'b' => array(
- * 'c' => 'x'
- * )
- * )
- * );
- *
- * If there are any other elements set, they will not be touched.
- *
- * @return array
- */
- public static function set_nested_value( &$array, $path, $value ) {
- if ( ! is_array( $array ) || ! is_array( $path ) ) {
- throw new InvalidArgumentException();
- }
-
- if ( empty( $path ) ) {
- return $value;
- }
-
- $next_level = array_shift( $path );
-
- if ( ! array_key_exists( $next_level, $array ) ) {
- $array[ $next_level ] = array();
- }
-
- $array[ $next_level ] = self::set_nested_value( $array[ $next_level ], $path, $value );
-
- return $array;
- }
-
-
- /**
- * Safely resolve a lowercase callback name into a handler class name even if mb_convert_case() is not available.
- *
- * It will always work correctly with values that contain only alphabetic characters, numbers and underscores.
- * But nothing else should be used in callback names anyway.
- *
- * Example: "types_ajax_m2m_action" will become "Types_Ajax_M2M_Action"
- *
- * @param string $callback
- *
- * @return string Name of the handler class.
- * @since 3.0
- */
- public static function resolve_callback_class_name( $callback ) {
-
- // Use the native solution if available (which will happen in the vast majority of most cases).
- if( function_exists( 'mb_convert_case' ) && defined( 'MB_CASE_TITLE' ) ) {
- return mb_convert_case( $callback, MB_CASE_TITLE );
- }
-
- // mb_convert_case() works this way - it also capitalizes first letters after numbers
- $name_parts = preg_split( "/_|[0-9]/", $callback );
- $parts_ucfirst = array_map( function( $part ) { return ucfirst( $part ); }, $name_parts );
-
- $result = '';
- foreach( $parts_ucfirst as $part ) {
- $result .= $part;
- $delimiter_position = strlen( $result );
-
- // Put back the delimiter (it could be a number or an underscore)
- if( $delimiter_position < strlen( $callback ) ) {
- $result .= $callback[ $delimiter_position ];
- }
- }
-
- return $result;
- }
- }
-
-}
-
-if ( ! function_exists( 'wp_json_encode' ) ) {
-
- function wp_json_encode( $data, $options = 0, $depth = 512 ) {
- /*
- * json_encode() has had extra params added over the years.
- * $options was added in 5.3, and $depth in 5.5.
- * We need to make sure we call it with the correct arguments.
- */
- if ( version_compare( PHP_VERSION, '5.5', '>=' ) ) {
- $args = array( $data, $options, $depth );
- } elseif ( version_compare( PHP_VERSION, '5.3', '>=' ) ) {
- $args = array( $data, $options );
- } else {
- $args = array( $data );
- }
-
- $json = call_user_func_array( 'json_encode', $args );
-
- // If json_encode() was successful, no need to do more sanity checking.
- // ... unless we're in an old version of PHP, and json_encode() returned
- // a string containing 'null'. Then we need to do more sanity checking.
- if ( false !== $json && ( version_compare( PHP_VERSION, '5.5', '>=' ) || false === strpos( $json, 'null' ) ) ) {
- return $json;
- }
-
- try {
- $args[0] = _wp_json_sanity_check( $data, $depth );
- } catch ( Exception $e ) {
- return false;
- }
-
- return call_user_func_array( 'json_encode', $args );
- }
-
- if ( ! function_exists( '_wp_json_sanity_check' ) ) {
-
- function _wp_json_sanity_check( $data, $depth ) {
- if ( $depth < 0 ) {
- throw new Exception( 'Reached depth limit' );
- }
-
- if ( is_array( $data ) ) {
- $output = array();
- foreach ( $data as $id => $el ) {
- // Don't forget to sanitize the ID!
- if ( is_string( $id ) ) {
- $clean_id = _wp_json_convert_string( $id );
- } else {
- $clean_id = $id;
- }
-
- // Check the element type, so that we're only recursing if we really have to.
- if ( is_array( $el ) || is_object( $el ) ) {
- $output[ $clean_id ] = _wp_json_sanity_check( $el, $depth - 1 );
- } elseif ( is_string( $el ) ) {
- $output[ $clean_id ] = _wp_json_convert_string( $el );
- } else {
- $output[ $clean_id ] = $el;
- }
- }
- } elseif ( is_object( $data ) ) {
- $output = new stdClass;
- foreach ( $data as $id => $el ) {
- if ( is_string( $id ) ) {
- $clean_id = _wp_json_convert_string( $id );
- } else {
- $clean_id = $id;
- }
-
- if ( is_array( $el ) || is_object( $el ) ) {
- $output->$clean_id = _wp_json_sanity_check( $el, $depth - 1 );
- } elseif ( is_string( $el ) ) {
- $output->$clean_id = _wp_json_convert_string( $el );
- } else {
- $output->$clean_id = $el;
- }
- }
- } elseif ( is_string( $data ) ) {
- return _wp_json_convert_string( $data );
- } else {
- return $data;
- }
-
- return $output;
- }
-
- }
-
- if ( ! function_exists( '_wp_json_convert_string' ) ) {
-
- function _wp_json_convert_string( $string ) {
- static $use_mb = null;
- if ( is_null( $use_mb ) ) {
- $use_mb = function_exists( 'mb_convert_encoding' );
- }
-
- if ( $use_mb ) {
- $encoding = mb_detect_encoding( $string, mb_detect_order(), true );
- if ( $encoding ) {
- return mb_convert_encoding( $string, 'UTF-8', $encoding );
- } else {
- return mb_convert_encoding( $string, 'UTF-8', 'UTF-8' );
- }
- } else {
- return wp_check_invalid_utf8( $string, true );
- }
- }
-
- }
-}
-
-if ( ! class_exists( 'Toolset_ArrayUtils', false ) ) {
-
- Class Toolset_ArrayUtils {
-
- private $value = null;
- private $property = null;
-
- function __construct( $property = null, $value = null ) {
- $this->value = $value;
- $this->property = $property;
- }
-
- function filter_array( $element ) {
- if ( is_object( $element ) ) {
-
- if ( property_exists( $element, $this->property ) === false ) {
- return null;
- }
-
- return $element->{$this->property} === $this->value;
- } elseif ( is_array( $element ) ) {
-
- if ( isset( $element[ $this->property ] ) === false ) {
- return null;
- }
-
- return $element[ $this->property ] === $this->value;
- } else {
-
- throw new Exception( sprintf( "Element parameter should be an object or an array, %s given.", gettype( $element ) ) );
- }
- }
-
- public function remap_by_property( $data ) {
- return $data[ $this->property ];
- }
-
- function value_in_array( $array ) {
- if ( ! is_array( $array ) ) {
- return false;
- }
-
- return in_array( $this->value, array_values( $array ) );
- }
-
- function sort_string_ascendant( $a, $b ) {
- return strcmp( $a[ $this->property ], $b[ $this->property ] );
- }
-
- }
-
-}
-
-
-if ( ! class_exists( 'Toolset_ErrorHandler', false ) ) {
-
- /**
- * ErrorHandler that can be used to catch internal PHP errors
- * and convert to an ErrorException instance.
- */
- abstract class Toolset_ErrorHandler {
-
- /**
- * Active stack
- *
- * @var array
- */
- protected static $stack = array();
-
- /**
- * Check if this error handler is active
- *
- * @return bool
- */
- public static function started() {
- return (bool) self::getNestedLevel();
- }
-
- /**
- * Get the current nested level
- *
- * @return int
- */
- public static function getNestedLevel() {
- return count( self::$stack );
- }
-
- /**
- * Starting the error handler
- *
- * @param int $errorLevel
- */
- public static function start( $errorLevel = E_WARNING ) {
- if ( ! self::$stack ) {
- set_error_handler( array( get_called_class(), 'addError' ), $errorLevel );
- register_shutdown_function( array( get_called_class(), 'handle_shutdown' ), true );
- }
-
- self::$stack[] = null;
- }
-
- /**
- * Stopping the error handler
- *
- * @param bool $throw Throw the ErrorException if any
- *
- * @return null|ErrorException
- * @throws ErrorException If an error has been catched and $throw is true
- */
- public static function stop( $throw = false ) {
- $errorException = null;
-
- if ( self::$stack ) {
- $errorException = array_pop( self::$stack );
-
- if ( ! self::$stack ) {
- restore_error_handler();
- }
-
- if ( $errorException && $throw ) {
- throw $errorException;
- }
- }
-
- return $errorException;
- }
-
- public static function handle_shutdown() {
- if ( self::is_fatal() ) {
- do_action( 'toolset-shutdown-hander' );
- }
- exit;
- }
-
- public static function is_fatal() {
- $error = error_get_last();
- $ignore = E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_STRICT | E_DEPRECATED | E_USER_DEPRECATED;
- if ( ( $error['type'] & $ignore ) == 0 ) {
- return true;
- }
-
- return false;
- }
-
- /**
- * Stop all active handler
- *
- * @return void
- */
- public static function clean() {
- if ( self::$stack ) {
- restore_error_handler();
- }
-
- self::$stack = array();
- }
-
- /**
- * Add an error to the stack
- *
- * @param int $errno
- * @param string $errstr
- * @param string $errfile
- * @param int $errline
- *
- * @return void
- */
- public static function addError( $errno, $errstr = '', $errfile = '', $errline = 0 ) {
- if ( count( self::$stack ) ) {
- $stack = &self::$stack[ count( self::$stack ) - 1 ];
- } else {
- $stack = null;
- }
- $stack = new ErrorException( (string) $errstr, 0, (int) $errno, (string) $errfile, (int) $errline );
- }
-
- }
-
-}
-
-if ( ! function_exists( 'get_called_class' ) ) {
-
- /**
- * PHP 5.2 support.
- *
- * get_called_class() is only in PHP >= 5.3, this is a workaround.
- * This function is needed by WPDDL_Theme_Integration_Abstract (and others).
- */
- function get_called_class() {
- $bt = debug_backtrace();
- $l = 0;
- $matches = null;
- do {
- $l ++;
- if ( isset( $bt[ $l ]['file'] ) ) {
- $lines = file( $bt[ $l ]['file'] );
- $callerLine = $lines[ $bt[ $l ]['line'] - 1 ];
- preg_match( '/([a-zA-Z0-9\_]+)::' . $bt[ $l ]['function'] . '/', $callerLine, $matches );
- }
- } while ( isset( $matches[1] ) && $matches[1] === 'parent' );
-
- return isset( $matches[1] ) ? $matches[1] : "";
- }
-
-}
-
-
-if ( ! function_exists( 'toolset_getarr' ) ) {
-
-
- /**
- * Safely retrieve a key from given array (meant for $_POST, $_GET, etc).
- *
- * Checks if the key is set in the source array. If not, default value is returned. Optionally validates against array
- * of allowed values and returns default value if the validation fails.
- *
- * @param array $source The source array.
- * @param string $key The key to be retrieved from the source array.
- * @param mixed $default Default value to be returned if key is not set or the value is invalid. Optional.
- * Default is empty string.
- * @param null|array $valid If an array is provided, the value will be validated against it's elements.
- *
- * @return mixed The value of the given key or $default.
- *
- * @since 1.8
- */
- function toolset_getarr( &$source, $key, $default = '', $valid = null ) {
- if ( isset( $source[ $key ] ) ) {
- $val = $source[ $key ];
-
- if ( is_callable( $valid ) && ! call_user_func( $valid, $val ) ) {
- return $default;
- } elseif ( is_array( $valid ) && ! in_array( $val, $valid ) ) {
- return $default;
- }
-
- return $val;
- } else {
- return $default;
- }
- }
-
-}
-
-
-if ( ! function_exists( 'toolset_getget' ) ) {
-
- /**
- * Safely retrieve a key from $_GET variable.
- *
- * This is a wrapper for toolset_getarr(). See that for more information.
- *
- * @param string $key
- * @param mixed $default
- * @param null|array $valid
- *
- * @return mixed
- * @since 1.9
- */
- function toolset_getget( $key, $default = '', $valid = null ) {
- return toolset_getarr( $_GET, $key, $default, $valid );
- }
-
-}
-
-
-if ( ! function_exists( 'toolset_getpost' ) ) {
-
- /**
- * Safely retrieve a key from $_POST variable.
- *
- * This is a wrapper for toolset_getarr(). See that for more information.
- *
- * @param string $key
- * @param mixed $default
- * @param null|array $valid
- *
- * @return mixed
- * @since 1.9
- */
- function toolset_getpost( $key, $default = '', $valid = null ) {
- return toolset_getarr( $_POST, $key, $default, $valid );
- }
-
-}
-
-
-if ( ! function_exists( 'toolset_ensarr' ) ) {
-
- /**
- * Ensure that a variable is an array.
- *
- * @param mixed $array The original value.
- * @param array $default Default value to use when no array is provided. This one should definitely be an array,
- * otherwise the function doesn't make much sense.
- *
- * @return array The original array or a default value if no array is provided.
- *
- * @since 1.9
- */
- function toolset_ensarr( $array, $default = array() ) {
- return ( is_array( $array ) ? $array : $default );
- }
-
-}
-
-
-if ( ! function_exists( 'toolset_wraparr' ) ) {
-
- /**
- * Wrap a variable value in an array if it's not array already.
- *
- * @param mixed $input
- *
- * @return array
- * @since 1.9.1
- */
- function toolset_wraparr( $input ) {
- return ( is_array( $input ) ? $input : array( $input ) );
- }
-
-}
-
-
-if ( ! function_exists( 'toolset_getnest' ) ) {
-
- /**
- * Get a value from nested associative array.
- *
- * This function will try to traverse a nested associative array by the set of keys provided.
- *
- * E.g. if you have $source = array( 'a' => array( 'b' => array( 'c' => 'my_value' ) ) ) and want to reach 'my_value',
- * you need to write: $my_value = wpcf_getnest( $source, array( 'a', 'b', 'c' ) );
- *
- * @param mixed|array $source The source array.
- * @param string[] $keys Keys which will be used to access the final value.
- * @param null|mixed $default Default value to return when the keys cannot be followed.
- *
- * @return mixed|null Value in the nested structure defined by keys or default value.
- *
- * @since 1.9
- */
- function toolset_getnest( &$source, $keys = array(), $default = null ) {
-
- $current_value = $source;
-
- // For detecting if a value is missing in a sub-array, we'll use this temporary object.
- // We cannot just use $default on every level of the nesting, because if $default is an
- // (possibly nested) array itself, it might mess with the value retrieval in an unexpected way.
- $missing_value = new stdClass();
-
- while ( ! empty( $keys ) ) {
- $current_key = array_shift( $keys );
- $is_last_key = empty( $keys );
-
- $current_value = toolset_getarr( $current_value, $current_key, $missing_value );
-
- if ( $is_last_key ) {
- // Apply given default value.
- if ( $missing_value === $current_value ) {
- return $default;
- } else {
- return $current_value;
- }
- } elseif ( ! is_array( $current_value ) ) {
- return $default;
- }
- }
-
- return $default;
- }
-
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon-generic.class.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon-generic.class.php
deleted file mode 100644
index fea9aee..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon-generic.class.php
+++ /dev/null
@@ -1,221 +0,0 @@
-name = $name;
- $this->plugin_js_url = $plugin_js_url;
- $this->button_text = $button_text;
- $this->media_button_image = $media_button_image;
- $this->initialized = false;
- $this->icon_class = $icon_class;
-
-
- if ( ( $media_button_image != '' || $icon_class != '' ) && $print_button ) {
- // Media buttons
- //Adding "embed form" button
- // WP 3.3 changes
- global $wp_version;
- if ( version_compare( $wp_version, '3.1.4', '>' ) ) {
- add_action( 'media_buttons',
- array($this, 'add_form_button'), 10, 2 );
- } else {
- add_action( 'media_buttons_context',
- array($this, 'add_form_button'), 10, 2 );
- }
- }
-
- }
-
- public function __destruct() {
-
- }
-
-
- /**
- * Add a menu item that will insert the shortcode.
- *
- * To use sub menus, add a '-!-' separator between levels in the $menu parameter.
- * eg. Field-!-image
- * This will create/use a menu "Field" and add a sub menu "image"
- *
- * $function_name is the javascript function to call for the on-click
- * If it's left blank then a function will be created that just
- * inserts the shortcode.
- */
- public function add_insert_shortcode_menu( $text, $shortcode, $menu,
- $function_name = '' ) {
- $this->items[] = array($text, $shortcode, $menu, $function_name);
- }
-
-
- public function add_form_button( $context, $text_area, $standard_v, $add_views, $codemirror_button )
- {
- throw new Exception( 'You should implement this method '. __METHOD__ );
- }
-
-
- /**
- * @deprecated This doesn't seem to be used anywhere in Toolset, nor should it be. Consider removing it.
- *
- * @return array
- */
- public static function getWpForbiddenNames()
- {
- global $wp_post_types;
-
- $reserved_list = array(
- 'attachment', 'attachment_id', 'author', 'author_name', 'calendar', 'cat', 'category', 'category__and', 'category__in',
- 'category__not_in', 'category_name', 'comments_per_page', 'comments_popup', 'customize_messenger_channel',
- 'customized', 'cpage', 'day', 'debug', 'error', 'exact', 'feed', 'hour', 'link_category', 'm', 'minute',
- 'monthnum', 'more', 'name', 'nav_menu', 'nonce', 'nopaging', 'offset', 'order', 'orderby', 'p', 'page', 'page_id',
- 'paged', 'pagename', 'pb', 'perm', 'post', 'post__in', 'post__not_in', 'post_format', 'post_mime_type', 'post_status',
- 'post_tag', 'post_type', 'posts', 'posts_per_archive_page', 'posts_per_page', 'preview', 'robots', 's', 'search',
- 'second', 'sentence', 'showposts', 'static', 'subpost', 'subpost_id', 'tag', 'tag__and', 'tag__in', 'tag__not_in',
- 'tag_id', 'tag_slug__and', 'tag_slug__in', 'taxonomy', 'tb', 'term', 'theme', 'type', 'w', 'withcomments', 'withoutcomments',
- 'year '
- );
-
-
- $reserved_post_types = array_keys( $wp_post_types );
-
- $wpv_taxes = get_taxonomies();
- $reserved_taxonomies = array_keys( $wpv_taxes );
-
- $wpv_forbidden_parameters = array(
- 'wordpress' => $reserved_list,
- 'post_types' => $reserved_post_types,
- 'taxonomies' => $reserved_taxonomies,
- );
-
- return $wpv_forbidden_parameters;
- }
-
- }
-
-}
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon.class.php b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon.class.php
deleted file mode 100644
index 9394273..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/editor-addon.class.php
+++ /dev/null
@@ -1,824 +0,0 @@
-items );
- }
-
- /**
- * Adding a "V" button to the menu
- * @param string $context
- * @param string $text_area
- * @param boolean $standard_v is this a standard V button
- */
- function add_form_button( $context, $text_area = '', $standard_v = true, $add_views = false, $codemirror_button = false )
- {
- /**
- * turn off button
- */
- if ( !apply_filters('toolset_editor_add_form_buttons', true) ) {
- return;
- }
-
- global $wp_version;
-
- if ( empty($context) && $text_area == '' ){
- return;
- }
- // WP 3.3 changes ($context arg is actually a editor ID now)
- if ( version_compare( $wp_version, '3.1.4', '>' ) && !empty( $context ) ) {
- $text_area = $context;
- }
-
- // Apply filters
- $this->items = apply_filters( 'editor_addon_items_' . $this->name,
- $this->items );
-
- // add_filter('editor_addon_parent_items', array($this, 'wpv_add_parent_items'), 10, $this->items);
- // Apply filter parent items
- //apply_filters('editor_addon_parent_items', $this->items);
- // sort the items into menu levels.
-
- $menus = array();
- $sub_menus = array();
-
- if( $this->items )
- foreach ( $this->items as $item ) {
- $parts = explode( '-!-', $item[2] );
- $menu_level = &$menus;
- foreach ( $parts as $part ) {
- if ( $part != '' ) {
- if ( !array_key_exists( $part, $menu_level ) ) {
- $menu_level[$part] = array();
- }
- $menu_level = &$menu_level[$part];
- }
- }
- $menu_level[$item[0]] = $item;
- }
-
- // Apply filters
- $menus = apply_filters( 'editor_addon_menus_' . $this->name, $menus );
-
- // add View Template links to the "Add Field" button
- if ( !$standard_v ) {
- $this->add_view_type( $menus, 'view-template',
- __( 'Content Template', 'wpv-views' ) );
- $this->add_view_type( $menus, 'view',
- __( 'Post View', 'wpv-views' ) );
- $this->add_view_type( $menus, 'view',
- __( 'Taxonomy View', 'wpv-views' ) );
- $this->add_view_type( $menus, 'view',
- __( 'User View', 'wpv-views' ) );
- }
-
- if ( $standard_v && $add_views ) {
- $this->add_view_type( $menus, 'view',
- __( 'Post View', 'wpv-views' ) );
- $this->add_view_type( $menus, 'view',
- __( 'Taxonomy View', 'wpv-views' ) );
- $this->add_view_type( $menus, 'view',
- __( 'User View', 'wpv-views' ) );
- }
-
- // Sort menus
- if ( is_array( $menus ) ) {
- $menus = $this->sort_menus_alphabetically( $menus );
- }
-
- $this->_media_menu_direct_links = array();
- $menus_output = $this->_output_media_menu( $menus, $text_area, $standard_v );
-
- $direct_links = implode( ' ', $this->_media_menu_direct_links );
- $dropdown_class = 'js-editor_addon_dropdown-'.$this->name;
- $icon_class = 'js-wpv-shortcode-post-icon-'.$this->name;
- if ( $this->name == 'wpv-views' ) {
- $button_label = __( 'Fields and Views', 'wpv-views' );
- } else if ( $this->name == 'types' ) {
- $button_label = __( 'Types', 'wpv-views' );
- } else {
- $button_label = '';
- }
-
- if( '' !== $this->media_button_image )
- {
- $addon_button = ' ' . $button_label . ' ';
- }
- else if( '' !== $this->icon_class ){
-
- $addon_button = '' . $button_label . ' ';
- }
-
- if ( !$standard_v ) {
-
- if( '' !== $this->media_button_image )
- {
- $addon_button = ' ' . $button_label . ' ';
- }
- else if( '' !== $this->icon_class )
- {
- $addon_button = '' . $button_label . ' ';
- }
- }
- // Codemirror (new layout) button
- if ( $codemirror_button ){
- $addon_button = ''.
- ''. __('Fields and Views', 'wpv-views') .' ';
- }
- // add search box
- $searchbar = $this->get_search_bar();
-
-
- // generate output content
- $out = '' .
- $addon_button . '
-
-
' . $this->button_text . ' ';
- /**
- * Add text after popup header.
- *
- * @since 1.6.7
- *
- * @param string $context content
- */
- $out .= apply_filters('editor_addon_dropdown_after_title', '');
- $out .= '
-
- ' . apply_filters( 'editor_addon_dropdown_top_message_' . $this->name,
- '' ) . '
-
'. __('Go to','wpv-views') .':
-
- ' . $searchbar . '
- ' . $menus_output . '
- ' . apply_filters( 'editor_addon_dropdown_bottom_message' . $this->name,
- '' ) .
- '
-
-
';
-
- // WP 3.3 changes
- if ( version_compare( $wp_version, '3.1.4', '>' ) ) {
- echo apply_filters( 'wpv_add_media_buttons', $out );
- } else {
- return apply_filters( 'wpv_add_media_buttons', $context . $out );
- }
- }
-
- /**
- * Adding a "V" button to the menu (for user fields)
- *
- * @global object $wpdb
- *
- * @param string $context
- * @param string $text_area
- * @param boolean $standard_v is this a standard V button
- * DEPRECATED since Views 1.9, not used anywhere else :-)
- */
- function add_users_form_button( $context, $text_area = 'textarea#content', $codemirror_button = false ) {
- global $wp_version, $sitepress, $wpdb, $WP_Views;
- $standard_v = true;
- // WP 3.3 changes ($context arg is actually a editor ID now)
- if ( version_compare( $wp_version, '3.1.4', '>' ) && !empty( $context ) ) {
- $text_area = $context;
- }
- //print_r($this->items);exit;
- $this->items = array();
-
- $unused_field = array('comment_shortcuts','managenav-menuscolumnshidden','dismissed_wp_pointers','meta-box-order_dashboard','nav_menu_recently_edited',
- 'primary_blog','rich_editing','source_domain','use_ssl','user_level','user-settings-time'
- ,'user-settings','dashboard_quick_press_last_post_id','capabilities','new_date','show_admin_bar_front','show_welcome_panel','show_highlight','admin_color'
- ,'language_pairs','first_name','last_name','name','nickname','description','yim','jabber','aim');
- $exclude_these_hidden_var = '/('.implode('|', $unused_field).')/';
- $this->items = array(
- array(__('User ID', 'wpv-views'), 'wpv-user field="ID"',__('Basic', 'wpv-views'),''),
- array(__('User Email', 'wpv-views'), 'wpv-user field="user_email"',__('Basic', 'wpv-views'),''),
- array(__('User Login', 'wpv-views'), 'wpv-user field="user_login"',__('Basic', 'wpv-views'),''),
- array(__('First Name', 'wpv-views'), 'wpv-user field="user_firstname"',__('Basic', 'wpv-views'),''),
- array(__('Last Name', 'wpv-views'), 'wpv-user field="user_lastname"',__('Basic', 'wpv-views'),''),
- array(__('Nickname', 'wpv-views'), 'wpv-user field="nickname"',__('Basic', 'wpv-views'),''),
- array(__('Display Name', 'wpv-views'), 'wpv-user field="display_name"',__('Basic', 'wpv-views'),''),
- array(__('Description', 'wpv-views'), 'wpv-user field="description"',__('Basic', 'wpv-views'),''),
- array(__('Yahoo IM', 'wpv-views'), 'wpv-user field="yim"',__('Basic', 'wpv-views'),''),
- array(__('Jabber', 'wpv-views'), 'wpv-user field="jabber"',__('Basic', 'wpv-views'),''),
- array(__('AIM', 'wpv-views'), 'wpv-user field="aim"',__('Basic', 'wpv-views'),''),
- array(__('User Url', 'wpv-views'), 'wpv-user field="user_url"',__('Basic', 'wpv-views'),''),
- array(__('Registration Date', 'wpv-views'), 'wpv-user field="user_registered"',__('Basic', 'wpv-views'),''),
- array(__('User Status', 'wpv-views'), 'wpv-user field="user_status"',__('Basic', 'wpv-views'),''),
- array(__('User Spam Status', 'wpv-views'), 'wpv-user field="spam"',__('Basic', 'wpv-views'),'')
- );
-
- if ( isset( $sitepress ) && function_exists( 'wpml_string_shortcode' ) ) {
- $nonce = wp_create_nonce('wpv_editor_callback');
- $this->items[] = array(
- __('Translatable string', 'wpv-views'),
- 'wpml-string',
- __('Basic', 'wpv-views'),
- "WPViews.shortcodes_gui.wpv_insert_popup('wpml-string', '" . __( 'Translatable string', 'wpv-views' ) . "', {}, '" . $nonce . "', this )"
- );
- }
-
-
-
- $meta_keys = get_user_meta_keys();
- $all_types_fields = get_option( 'wpcf-fields', array() );
- foreach ($meta_keys as $key) {
- $key_nicename = '';
- if ( function_exists('wpcf_init') ){
- if (stripos($key, 'wpcf-') === 0) {
- //
- }
- else {
- if ( preg_match($exclude_these_hidden_var , $key) ){
- continue;
- }
- $this->items[] = array($key,
- 'wpv-user field="'.$key.'"',
- __('Users fields', 'wpv-views'),'');
- }
- }
- else{
- if ( preg_match($exclude_these_hidden_var , $key) ){
- continue;
- }
- $this->items[] = array($key,
- 'wpv-user field="'.$key.'"',
- __('User fields', 'wpv-views'),'');
- }
-
- }
-
- if ( function_exists('wpcf_init') ){
- //Get types groups and fields
- $groups = wpcf_admin_fields_get_groups( 'wp-types-user-group' );
- $user_id = wpcf_usermeta_get_user();
- $add = array();
- if ( !empty( $groups ) ) {
- foreach ( $groups as $group_id => $group ) {
- if ( empty( $group['is_active'] ) ) {
- continue;
- }
- $fields = wpcf_admin_fields_get_fields_by_group( $group['id'],
- 'slug', true, false, true, 'wp-types-user-group',
- 'wpcf-usermeta' );
- // @since m2m wpcf_admin_fields_get_fields_by_group returns strings for repeatng fields groups
- $fields = array_filter( $fields, 'is_array' );
-
- if ( !empty( $fields ) ) {
- foreach ( $fields as $field_id => $field ) {
- $add[] = $field['meta_key'];
- $callback = 'wpcfFieldsEditorCallback(\'' . $field['id'] . '\', \'views-usermeta\', -1)';
- $this->items[] = array($field['name'],
- 'types usermeta="'.$field['meta_key'].'"][/types',
- $group['name'],$callback);
-
-
- }
- }
- }
- }
-
- //Get unused types fields
- $cf_types = wpcf_admin_fields_get_fields( true, true, false, 'wpcf-usermeta' );
- foreach ( $cf_types as $cf_id => $cf ) {
- if ( !in_array( $cf['meta_key'], $add) ){
- $callback = 'wpcfFieldsEditorCallback(\'' . $cf['id'] . '\', \'views-usermeta\', -1)';
- $this->items[] = array($cf['name'],
- 'types usermeta="'.$cf['meta_key'].'"][/types',
- __('Types fields', 'wpv-views'),$callback);
-
- }
- }
- }
-
- $view_available = $wpdb->get_results("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_type='view' AND post_status in ('publish')");
- foreach($view_available as $view) {
-
- $view_settings = get_post_meta($view->ID, '_wpv_settings', true);
- if (isset($view_settings['query_type'][0]) && $view_settings['query_type'][0] == 'posts' && !$WP_Views->is_archive_view($view->ID)) {
-
- $this->items[] = array($view->post_title,
- $view->post_title,
- __('Post View', 'wpv-views'),
- ''
- );
- }
- }
-
- $out = array();
-
- $menus = array();
- $sub_menus = array();
-
- if( $this->items )
- foreach ( $this->items as $item ) {
- $parts = explode( '-!-', $item[2] );
- $menu_level = &$menus;
- foreach ( $parts as $part ) {
- if ( $part != '' ) {
- if ( !array_key_exists( $part, $menu_level ) ) {
- $menu_level[$part] = array();
- }
- $menu_level = &$menu_level[$part];
- }
- }
- $menu_level[$item[0]] = $item;
- }
-
-
-
-
- // Sort menus
- if ( is_array( $menus ) ) {
- $menus = $this->sort_menus_alphabetically( $menus );
- }
-
-
- $this->_media_menu_direct_links = array();
- $menus_output = $this->_output_media_menu( $menus, $text_area,
- $standard_v );
-
- $direct_links = implode( ' ', $this->_media_menu_direct_links );
- $dropdown_class = 'js-editor_addon_dropdown-'.$this->name;
- $icon_class = 'js-wpv-shortcode-post-icon-'.$this->name;
- if ( $this->name == 'wpv-views' ) {
- $button_label = __( 'Fields and Views', 'wpv-views' );
- } else if ( $this->name == 'types' ) {
- $button_label = __( 'Types', 'wpv-views' );
- } else {
- $button_label = '';
- }
- $addon_button = ' ' . $button_label . ' ';
- if ( !$standard_v ) {
- $addon_button = ' ' . $button_label . ' ';
- // $addon_button = ' ';
- //$addon_button = ''. __('Add field', 'wpv-views') .' ';
- }
- // Codemirrir (new layout) button
- if ( $codemirror_button ){
- $addon_button = ''.
- ''. __('Fields and Views', 'wpv-views') .' ';
- }
- // add search box
- $searchbar = $this->get_search_bar();
-
- // generate output content
- $out = '' .
- $addon_button . '
-
-
' . $this->button_text . ' ';
- $out .= apply_filters('editor_addon_dropdown_after_title', '');
- $out .= '
-
- ' . apply_filters( 'editor_addon_dropdown_top_message_' . $this->name,
- '' ) . '
-
'. __('Go to','wpv-views') .':
-
- ' . $searchbar . '
- ' . $menus_output . '
- ' . apply_filters( 'editor_addon_dropdown_bottom_message' . $this->name,
- '' ) .
- '
-
-
';
- // WP 3.3 changes
- if ( version_compare( $wp_version, '3.1.4', '>' ) ) {
- echo apply_filters( 'wpv_add_media_buttons', $out );
- } else {
- return apply_filters( 'wpv_add_media_buttons', $context . $out );
- }
-
- }
-
- /**
- * Output a single menu item
- * @param string $menu
- * @param string $text_area
- * @param boolean $standard_v
- * @return string media menu
- */
- function _output_media_menu( $menu, $text_area, $standard_v ) {
-
- /**
- * get current post id
- */
- $post_id = 0;
- global $post;
- if ( is_object($post) && isset($post->ID) ) {
- $post_id = $post->ID;
- }
-
- $all_post_types = implode( ' ',
- get_post_types( array('public' => true) ) );
-
- $out = '';
-
- if ( is_array( $menu ) ) {
- foreach ( $menu as $key => $menu_item ) {
- if ( isset( $menu_item[0] ) && !is_array( $menu_item[0] ) ) {
- if ( !isset( $menu_item[3] ) ) {
- break;
- }
- if ( $menu_item[3] != '' ) {
- if ( !($key == 'css') ) { // hide unnecessary elements from the V popup
- if ( !$standard_v && (strpos( $menu_item[3],
- 'wpcfFieldsEditorCallback' ) !== false ||
- strpos( $menu_item[3],
- 'wpcfFieldsEmailEditorCallback' ) !== false ||
- strpos( $menu_item[3],
- 'wpv_insert_view_form_popup' ) !== false) ) {
- $out .= $this->wpv_parse_menu_item_from_addfield( $menu_item );
- } else {
- $out .= sprintf(
- '%s ',
- $menu_item[3],
- $post_id,
- $menu_item[0]
- );
- }
- }
- } else {
- if ( $standard_v ) {
- $short_code = $menu_item[1];
- $link_text = $menu_item[0];
-
- if ( $menu_item[2] == __( 'Post View',
- 'wpv-views' ) || $menu_item[2] == __( 'Taxonomy View',
- 'wpv-views' ) || $menu_item[2] == __( 'User View',
- 'wpv-views' ) ) {
- $short_code = 'wpv-view name="' . $short_code . '"';
- $link_text = str_replace( ' - ' . __( 'Post View' ),
- '', $link_text );
- $link_text = str_replace( ' - ' . __( 'Taxonomy View' ),
- '', $link_text );
- $link_text = str_replace( ' - ' . __( 'User View' ),
- '', $link_text );
- }
- $short_code = '[' . $short_code . ']';
- $short_code = base64_encode( $short_code );
-
- $out .= '' . $link_text . " \n";
- } else {
- $out .= $this->wpv_parse_menu_item_from_addfield( $menu_item );
- }
- }
- } else {
- if ( 'wpcf' != $key && 'views' != $key ) { // for some reason it displays a group wpcf on sites with WPLANG different from ''
- // a sum menu.
- /*
- * SRDJAN
- * Avoid using all classes.
- * It will add generic classes that can messup our code.
- */
- $css_classes = '';
-// $css_classes = isset($menu_item['css']) ? $menu_item['css'] : '';
-// if($key == __('Taxonomy', 'wpv-views') || $key == __('Basic', 'wpv-views')) {
-// $css_classes = $all_post_types;
-// }
- $this->_media_menu_direct_links[] = '' . $key . ' ';
- /*
- * SRDJAN
- * Hmmmm, multiple IDs
- * Changed ID to class
- */
-// $out .= '' . $key . " \n
\n";
- $out .= '
' . $key . " ";
- $out .= '
';
- $out .= $this->_output_media_menu( $menu_item, $text_area, $standard_v );
- $out .= " ";
- $out .= "
";
- }
- }
- }
- }
-
- return $out;
- }
-
- /**
- * Parser for menu items in the add-field
- * @param unknown_type $key
- * @param unknown_type $menu_item
- * @return string
- */
- function wpv_parse_menu_item_from_addfield( $menu_item ) {
- $param1 = '';
- $slug = $menu_item[1];
-
- // search for wpv- starting fields first
- if ( strpos( $slug, 'wpv-' ) !== false ) {
- $menuitem_parts = explode( ' ', $slug );
- $slug = $menuitem_parts[0];
- }
- // find types fields
- else if ( (strpos( $menu_item[3], 'wpcfFieldsEditorCallback' ) !== false)
- || (strpos( $menu_item[3], 'wpcfFieldsEmailEditorCallback' ) !== false)
- || (strpos( $menu_item[3], 'wpv_insert_view_form_popup' ) !== false) ) {
- return '
' . $menu_item[0] . " \n";
- } else if ( (preg_match( '/types field="(.+)"/', $slug, $matches ) > 0)
- || (preg_match( '/type="(.+)"/', $slug, $matches ) > 0) ) {
- $types_slug = $matches[1];
- $types_slug = str_replace( '" class="" style="', '', $types_slug );
- // convert Types fields to Views fields
- $slug = $types_slug;
- $param1 = 'Types-!-wpcf';
- } else if ( preg_match( '/type="(.+)"/', $slug, $matches ) > 0 ) {
- $types_slug = $matches[1];
- $types_slug = str_replace( '" class="" style="', '', $types_slug );
- // convert field to Views field
- $slug = $types_slug;
- $param1 = 'Types-!-wpcf';
-
- // apply_filters() for Types shortcodes
- }
- // for Basic group fields
- if ( $menu_item[2] == __( 'Basic', 'wpv-views' ) ) {
- // don't use slug here, just field name.
- $slug = $menu_item[0];
- }
- // View Templates here
- if ( $menu_item[2] == __( 'Content Template', 'wpv-views' ) ) {
- $param1 = 'Content Template';
- }
- if ( $menu_item[2] == __( 'Post View', 'wpv-views' ) || $menu_item[2] == __( 'Taxonomy View',
- 'wpv-views' ) || $menu_item[2] == __( 'User View', 'wpv-views' ) ) {
- $param1 = 'Child View';
- }
- if ( strpos( $slug, 'wpv-post-field' ) !== false ) {
- $param1 = __('Field', 'wpv-views');
- $slug = $menu_item[0];
- }
- // Taxonomies
- if ( strpos( $menu_item[1], 'wpv-post-taxonomy' ) !== false ) {
- $slug = $menu_item[1];
- $param1 = 'Taxonomy';
- if ( preg_match( '/wpv-post-taxonomy type="([^"]*)"/', $slug,
- $matches ) > 0 ) {
- $slug = 'wpvtax-' . $matches[1]; // split up and pass text only
- } else {
- $slug = esc_html( $menu_item[1] );
- $slug = str_replace( 'wpv-post-taxonomy', 'wpv-taxonomy',
- $slug );
- }
- /* $slug = esc_html($menu_item[1]);
- $slug = str_replace('wpv-post-taxonomy', 'wpv-taxonomy', $slug); */
- }
-
- $link_text = $menu_item[0];
- if ( $param1 == 'Child View' ) {
- $link_text = str_replace( ' - ' . __( 'Post View' ), '',
- $link_text );
- $link_text = str_replace( ' - ' . __( 'Taxonomy View' ), '',
- $link_text );
- $link_text = str_replace( ' - ' . __( 'User View' ), '',
- $link_text );
- }
- return '
' . $link_text . " \n";
- }
-
- // add parent items for Views and Content Templates
- function wpv_add_parent_items( $items ) {
- global $post, $pagenow;
-
- // ct-editor-deprecate
- if ( $pagenow == 'post-new.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'view-template' ) {
- $this->add_view_template_parent_groups( $items );
- }
-
- // @todo this should be also deprecated, no?
- if ( $pagenow == 'post-new.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'view' ) {
-
- } else if ( $pagenow == 'post.php' && isset( $_GET['action'] ) && $_GET['action'] == 'edit' ) {
- $post_type = $post->post_type;
-
- // todo deprecate?
- // ct-editor-deprecate
- if ( $post_type == 'view' ) {
- $items = $this->add_view_parent_groups( $items );
- } else if ( $post_type == 'view-template' ) {
- $items = $this->add_view_template_parent_groups( $items );
- }
- }
-
- return $items;
- }
-
- function add_view_parent_groups( $items ) {
-
- }
-
- // add parent groups for vew templates
- function add_view_template_parent_groups( $items ) {
- global $post, $WPV_settings;
- // get current View ID
- $view_template_id = $post->ID;
-
- // get all view templates attached in the Settings page for single view
- $view_template_relations = $WPV_settings->get_view_template_settings();
-
- // find view template groups and get their parents
- $current_types = array();
- $parent_types = array();
- foreach ( $view_template_relations as $relation => $value ) {
- if ( $value == $view_template_id ) {
- $current_types[] = $relation;
- if ( function_exists( 'wpcf_pr_get_belongs' ) ) {
- $parent_types[] = wpcf_pr_get_belongs( $relation );
- }
- }
- }
-
- // get parent groups
- $all_parent_groups = array();
- foreach ( $parent_types as $type ) {
- foreach ( $type as $typename => $typeval ) {
- $parent_groups = wpcf_admin_get_groups_by_post_type( $typename );
- }
- }
-
-
- }
-
- /**
- *
- * Sort menus (and menu content) in an alphabetical order
- *
- * Still, keep Basic and Taxonomy on the top and Other Fields at the bottom
- *
- * @param array $menu menu reference
- */
- function sort_menus_alphabetically( $menus ) {
- // keep main references if set (not set on every screen)
- $menu_temp = array();
- $menu_names = array(
- __( 'User View', 'wpv-views' ),
- __( 'Taxonomy View', 'wpv-views' ),
- __( 'Post View', 'wpv-views' ),
- __( 'View', 'wpv-views' ),
- __( 'Content Template', 'wpv-views' ),
- __( 'Taxonomy', 'wpv-views' ),
- __( 'Basic', 'wpv-views' ),
- __( 'Other Fields', 'wpv-views' )
- );
-
- foreach ( $menu_names as $name ) {
- $menu_temp[$name] = isset( $menus[$name] ) ? $menus[$name] : array();
- }
-
- // remove them to preserve correct listing
- foreach ( $menu_names as $name ) {
- unset( $menus[$name] );
- }
-
- // sort all elements by key
- ksort( $menus );
-
- // add main elements in the correct order
- foreach ( $menu_names as $name ) {
- $menus = !empty( $menu_temp[$name] ) ? array_merge( array($name => $menu_temp[$name]),
- $menus ) : $menus;
- }
-
- // sort inner elements in the submenus
- foreach ( $menus as $key => $menu_group ) {
- if ( is_array( $menu_group ) ) {
- ksort( $menu_group );
- }
- }
-
- return $menus;
- }
-
- function get_search_bar() {
- $searchbar = '
';
- $searchbar .= '' . __( 'Search', 'wpv-views' ) . ': ';
- $searchbar .= ' ';
- $searchbar .= ' ';
- $searchbar .= '
';
- return $searchbar;
- }
-
- /**
- *
- * @global object $wpdb
- *
- */
- function add_view_type( &$menus, $post_type, $post_name ) {
- global $wpdb;
- $all_post_types = implode( ' ',
- get_post_types( array('public' => true) ) );
-
- $view_templates_available = $wpdb->get_results(
- $wpdb->prepare(
- "SELECT ID, post_title, post_name FROM {$wpdb->posts}
- WHERE post_type = %s
- AND post_status in (%s)",
- $post_type,
- 'publish'
- )
- );
- $menus[$post_name] = array();
- $menus[$post_name]['css'] = $all_post_types;
-
- $vtemplate_index = 0;
- foreach ( $view_templates_available as $vtemplate ) {
-
- $title = $vtemplate->post_title;
-
- if ( $post_type == 'view' ) {
- $view_settings = get_post_meta( $vtemplate->ID,
- '_wpv_settings', true );
- $title = $vtemplate->post_title . ' - ' . __( 'Post View',
- 'wpv-views' );
- if ( isset( $view_settings['query_type'] ) && isset( $view_settings['query_type'][0] ) && $view_settings['query_type'][0] == 'taxonomy' ) {
- $title = $vtemplate->post_title . ' - ' . __( 'Taxonomy View',
- 'wpv-views' );
- if ( $post_name == __( 'Post View', 'wpv-views' ) || $post_name == __( 'User View', 'wpv-views' ) ) {
- continue;
- }
- } elseif ( isset( $view_settings['query_type'] ) && isset( $view_settings['query_type'][0] ) && $view_settings['query_type'][0] == 'users' ) {
- $title = $vtemplate->post_title . ' - ' . __( 'User View',
- 'wpv-views' );
- if ( $post_name == __( 'Post View', 'wpv-views' ) || $post_name == __( 'Taxonomy View', 'wpv-views' ) ) {
- continue;
- }
- } else {
- if ( $post_name == __( 'Taxonomy View', 'wpv-views' ) || $post_name == __( 'User View', 'wpv-views' ) ) {
- continue;
- }
- }
- if ( isset( $view_settings['view-query-mode'] ) && $view_settings['view-query-mode'] =='archive' ){
- continue;
- }
- }
-
- $menus[$post_name][$vtemplate_index] = array();
- $menus[$post_name][$vtemplate_index][] = $title;
- $menus[$post_name][$vtemplate_index][] = $vtemplate->post_name;
- $menus[$post_name][$vtemplate_index][] = $post_name;
- $menus[$post_name][$vtemplate_index][] = '';
- $vtemplate_index++;
- }
- }
- }
-
-/*
- Add the wpv_views button to the toolbar.
- */
- function wpv_mce_add_button( $buttons )
- {
- array_push( $buttons, "separator", str_replace( '-', '_', $this->name ) );
- return $buttons;
- }
-
- /*
-
- Register this plugin as a mce 'addon'
- Tell the mce editor the url of the javascript file.
- */
- if( !function_exists('wpv_mce_register') )
- {
- function wpv_mce_register( $plugin_array )
- {
- $plugin_array[str_replace( '-', '_', $this->name )] = $this->plugin_js_url;
- return $plugin_array;
- }
- }
-
- /**
- * Renders JS for inserting shortcode from thickbox popup to editor.
- *
- * @param type $shortcode
- */
- if( !function_exists('editor_admin_popup_insert_shortcode_js') )
- {
- function editor_admin_popup_insert_shortcode_js( $shortcode ) { // Types now uses ColorBox, it's not used in Views anymore. Maybe DEPRECATED
-
- ?>
-
- 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
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/README.md b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/README.md
deleted file mode 100644
index 77824eb..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# CodeMirror
-[](https://travis-ci.org/codemirror/CodeMirror)
-[](https://www.npmjs.org/package/codemirror)
-[Funding status: ](https://marijnhaverbeke.nl/fund/)
-
-CodeMirror is a versatile text editor implemented in JavaScript for
-the browser. It is specialized for editing code, and comes with over
-100 language modes and various addons that implement more advanced
-editing functionality.
-
-A rich programming API and a CSS theming system are available for
-customizing CodeMirror to fit your application, and extending it with
-new functionality.
-
-You can find more information (and the
-[manual](http://codemirror.net/doc/manual.html)) on the [project
-page](http://codemirror.net). For questions and discussion, use the
-[discussion forum](http://discuss.codemirror.net/).
-
-See
-[CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md)
-for contributing guidelines.
-
-The CodeMirror community aims to be welcoming to everybody. We use the
-[Contributor Covenant
-(1.1)](http://contributor-covenant.org/version/1/1/0/) as our code of
-conduct.
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/comment.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/comment.js
deleted file mode 100644
index 2dd114d..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/comment.js
+++ /dev/null
@@ -1,183 +0,0 @@
-// 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 noOptions = {};
- var nonWS = /[^\s\u00a0]/;
- var Pos = CodeMirror.Pos;
-
- function firstNonWS(str) {
- var found = str.search(nonWS);
- return found == -1 ? 0 : found;
- }
-
- CodeMirror.commands.toggleComment = function(cm) {
- var minLine = Infinity, ranges = cm.listSelections(), mode = null;
- for (var i = ranges.length - 1; i >= 0; i--) {
- var from = ranges[i].from(), to = ranges[i].to();
- if (from.line >= minLine) continue;
- if (to.line >= minLine) to = Pos(minLine, 0);
- minLine = from.line;
- if (mode == null) {
- if (cm.uncomment(from, to)) mode = "un";
- else { cm.lineComment(from, to); mode = "line"; }
- } else if (mode == "un") {
- cm.uncomment(from, to);
- } else {
- cm.lineComment(from, to);
- }
- }
- };
-
- CodeMirror.defineExtension("lineComment", function(from, to, options) {
- if (!options) options = noOptions;
- var self = this, mode = self.getModeAt(from);
- var commentString = options.lineComment || mode.lineComment;
- if (!commentString) {
- if (options.blockCommentStart || mode.blockCommentStart) {
- options.fullLines = true;
- self.blockComment(from, to, options);
- }
- return;
- }
- var firstLine = self.getLine(from.line);
- if (firstLine == null) return;
- var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);
- var pad = options.padding == null ? " " : options.padding;
- var blankLines = options.commentBlankLines || from.line == to.line;
-
- self.operation(function() {
- if (options.indent) {
- var baseString = firstLine.slice(0, firstNonWS(firstLine));
- for (var i = from.line; i < end; ++i) {
- var line = self.getLine(i), cut = baseString.length;
- if (!blankLines && !nonWS.test(line)) continue;
- if (line.slice(0, cut) != baseString) cut = firstNonWS(line);
- self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));
- }
- } else {
- for (var i = from.line; i < end; ++i) {
- if (blankLines || nonWS.test(self.getLine(i)))
- self.replaceRange(commentString + pad, Pos(i, 0));
- }
- }
- });
- });
-
- CodeMirror.defineExtension("blockComment", function(from, to, options) {
- if (!options) options = noOptions;
- var self = this, mode = self.getModeAt(from);
- var startString = options.blockCommentStart || mode.blockCommentStart;
- var endString = options.blockCommentEnd || mode.blockCommentEnd;
- if (!startString || !endString) {
- if ((options.lineComment || mode.lineComment) && options.fullLines != false)
- self.lineComment(from, to, options);
- return;
- }
-
- var end = Math.min(to.line, self.lastLine());
- if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;
-
- var pad = options.padding == null ? " " : options.padding;
- if (from.line > end) return;
-
- self.operation(function() {
- if (options.fullLines != false) {
- var lastLineHasText = nonWS.test(self.getLine(end));
- self.replaceRange(pad + endString, Pos(end));
- self.replaceRange(startString + pad, Pos(from.line, 0));
- var lead = options.blockCommentLead || mode.blockCommentLead;
- if (lead != null) for (var i = from.line + 1; i <= end; ++i)
- if (i != end || lastLineHasText)
- self.replaceRange(lead + pad, Pos(i, 0));
- } else {
- self.replaceRange(endString, to);
- self.replaceRange(startString, from);
- }
- });
- });
-
- CodeMirror.defineExtension("uncomment", function(from, to, options) {
- if (!options) options = noOptions;
- var self = this, mode = self.getModeAt(from);
- var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end);
-
- // Try finding line comments
- var lineString = options.lineComment || mode.lineComment, lines = [];
- var pad = options.padding == null ? " " : options.padding, didSomething;
- lineComment: {
- if (!lineString) break lineComment;
- for (var i = start; i <= end; ++i) {
- var line = self.getLine(i);
- var found = line.indexOf(lineString);
- if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;
- if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment;
- if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
- lines.push(line);
- }
- self.operation(function() {
- for (var i = start; i <= end; ++i) {
- var line = lines[i - start];
- var pos = line.indexOf(lineString), endPos = pos + lineString.length;
- if (pos < 0) continue;
- if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;
- didSomething = true;
- self.replaceRange("", Pos(i, pos), Pos(i, endPos));
- }
- });
- if (didSomething) return true;
- }
-
- // Try block comments
- var startString = options.blockCommentStart || mode.blockCommentStart;
- var endString = options.blockCommentEnd || mode.blockCommentEnd;
- if (!startString || !endString) return false;
- var lead = options.blockCommentLead || mode.blockCommentLead;
- var startLine = self.getLine(start), endLine = end == start ? startLine : self.getLine(end);
- var open = startLine.indexOf(startString), close = endLine.lastIndexOf(endString);
- if (close == -1 && start != end) {
- endLine = self.getLine(--end);
- close = endLine.lastIndexOf(endString);
- }
- if (open == -1 || close == -1 ||
- !/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) ||
- !/comment/.test(self.getTokenTypeAt(Pos(end, close + 1))))
- return false;
-
- // Avoid killing block comments completely outside the selection.
- // Positions of the last startString before the start of the selection, and the first endString after it.
- var lastStart = startLine.lastIndexOf(startString, from.ch);
- var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length);
- if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false;
- // Positions of the first endString after the end of the selection, and the last startString before it.
- firstEnd = endLine.indexOf(endString, to.ch);
- var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch);
- lastStart = (firstEnd == -1 || almostLastStart == -1) ? -1 : to.ch + almostLastStart;
- if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false;
-
- self.operation(function() {
- self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),
- Pos(end, close + endString.length));
- var openEnd = open + startString.length;
- if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length;
- self.replaceRange("", Pos(start, open), Pos(start, openEnd));
- if (lead) for (var i = start + 1; i <= end; ++i) {
- var line = self.getLine(i), found = line.indexOf(lead);
- if (found == -1 || nonWS.test(line.slice(0, found))) continue;
- var foundEnd = found + lead.length;
- if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length;
- self.replaceRange("", Pos(i, found), Pos(i, foundEnd));
- }
- });
- return true;
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/continuecomment.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/continuecomment.js
deleted file mode 100644
index b11d51e..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/comment/continuecomment.js
+++ /dev/null
@@ -1,85 +0,0 @@
-// 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 modes = ["clike", "css", "javascript"];
-
- for (var i = 0; i < modes.length; ++i)
- CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "});
-
- function continueComment(cm) {
- if (cm.getOption("disableInput")) return CodeMirror.Pass;
- var ranges = cm.listSelections(), mode, inserts = [];
- for (var i = 0; i < ranges.length; i++) {
- var pos = ranges[i].head, token = cm.getTokenAt(pos);
- if (token.type != "comment") return CodeMirror.Pass;
- var modeHere = CodeMirror.innerMode(cm.getMode(), token.state).mode;
- if (!mode) mode = modeHere;
- else if (mode != modeHere) return CodeMirror.Pass;
-
- var insert = null;
- if (mode.blockCommentStart && mode.blockCommentContinue) {
- var end = token.string.indexOf(mode.blockCommentEnd);
- var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found;
- if (end != -1 && end == token.string.length - mode.blockCommentEnd.length && pos.ch >= end) {
- // Comment ended, don't continue it
- } else if (token.string.indexOf(mode.blockCommentStart) == 0) {
- insert = full.slice(0, token.start);
- if (!/^\s*$/.test(insert)) {
- insert = "";
- for (var j = 0; j < token.start; ++j) insert += " ";
- }
- } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&
- found + mode.blockCommentContinue.length > token.start &&
- /^\s*$/.test(full.slice(0, found))) {
- insert = full.slice(0, found);
- }
- if (insert != null) insert += mode.blockCommentContinue;
- }
- if (insert == null && mode.lineComment && continueLineCommentEnabled(cm)) {
- var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment);
- if (found > -1) {
- insert = line.slice(0, found);
- if (/\S/.test(insert)) insert = null;
- else insert += mode.lineComment + line.slice(found + mode.lineComment.length).match(/^\s*/)[0];
- }
- }
- if (insert == null) return CodeMirror.Pass;
- inserts[i] = "\n" + insert;
- }
-
- cm.operation(function() {
- for (var i = ranges.length - 1; i >= 0; i--)
- cm.replaceRange(inserts[i], ranges[i].from(), ranges[i].to(), "+insert");
- });
- }
-
- function continueLineCommentEnabled(cm) {
- var opt = cm.getOption("continueComments");
- if (opt && typeof opt == "object")
- return opt.continueLineComment !== false;
- return true;
- }
-
- CodeMirror.defineOption("continueComments", null, function(cm, val, prev) {
- if (prev && prev != CodeMirror.Init)
- cm.removeKeyMap("continueComment");
- if (val) {
- var key = "Enter";
- if (typeof val == "string")
- key = val;
- else if (typeof val == "object" && val.key)
- key = val.key;
- var map = {name: "continueComment"};
- map[key] = continueComment;
- cm.addKeyMap(map);
- }
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.css
deleted file mode 100644
index 677c078..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.css
+++ /dev/null
@@ -1,32 +0,0 @@
-.CodeMirror-dialog {
- position: absolute;
- left: 0; right: 0;
- background: inherit;
- z-index: 15;
- padding: .1em .8em;
- overflow: hidden;
- color: inherit;
-}
-
-.CodeMirror-dialog-top {
- border-bottom: 1px solid #eee;
- top: 0;
-}
-
-.CodeMirror-dialog-bottom {
- border-top: 1px solid #eee;
- bottom: 0;
-}
-
-.CodeMirror-dialog input {
- border: none;
- outline: none;
- background: transparent;
- width: 20em;
- color: inherit;
- font-family: monospace;
-}
-
-.CodeMirror-dialog button {
- font-size: 70%;
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.js
deleted file mode 100644
index 323b200..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/dialog/dialog.js
+++ /dev/null
@@ -1,157 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Open simple dialogs on top of an editor. Relies on dialog.css.
-
-(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) {
- function dialogDiv(cm, template, bottom) {
- var wrap = cm.getWrapperElement();
- var dialog;
- dialog = wrap.appendChild(document.createElement("div"));
- if (bottom)
- dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
- else
- dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
-
- if (typeof template == "string") {
- dialog.innerHTML = template;
- } else { // Assuming it's a detached DOM element.
- dialog.appendChild(template);
- }
- return dialog;
- }
-
- function closeNotification(cm, newVal) {
- if (cm.state.currentNotificationClose)
- cm.state.currentNotificationClose();
- cm.state.currentNotificationClose = newVal;
- }
-
- CodeMirror.defineExtension("openDialog", function(template, callback, options) {
- if (!options) options = {};
-
- closeNotification(this, null);
-
- var dialog = dialogDiv(this, template, options.bottom);
- var closed = false, me = this;
- function close(newVal) {
- if (typeof newVal == 'string') {
- inp.value = newVal;
- } else {
- if (closed) return;
- closed = true;
- dialog.parentNode.removeChild(dialog);
- me.focus();
-
- if (options.onClose) options.onClose(dialog);
- }
- }
-
- var inp = dialog.getElementsByTagName("input")[0], button;
- if (inp) {
- if (options.value) {
- inp.value = options.value;
- if (options.selectValueOnOpen !== false) {
- inp.select();
- }
- }
-
- if (options.onInput)
- CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);});
- if (options.onKeyUp)
- CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
-
- CodeMirror.on(inp, "keydown", function(e) {
- if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
- if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {
- inp.blur();
- CodeMirror.e_stop(e);
- close();
- }
- if (e.keyCode == 13) callback(inp.value, e);
- });
-
- if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
-
- inp.focus();
- } else if (button = dialog.getElementsByTagName("button")[0]) {
- CodeMirror.on(button, "click", function() {
- close();
- me.focus();
- });
-
- if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close);
-
- button.focus();
- }
- return close;
- });
-
- CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
- closeNotification(this, null);
- var dialog = dialogDiv(this, template, options && options.bottom);
- var buttons = dialog.getElementsByTagName("button");
- var closed = false, me = this, blurring = 1;
- function close() {
- if (closed) return;
- closed = true;
- dialog.parentNode.removeChild(dialog);
- me.focus();
- }
- buttons[0].focus();
- for (var i = 0; i < buttons.length; ++i) {
- var b = buttons[i];
- (function(callback) {
- CodeMirror.on(b, "click", function(e) {
- CodeMirror.e_preventDefault(e);
- close();
- if (callback) callback(me);
- });
- })(callbacks[i]);
- CodeMirror.on(b, "blur", function() {
- --blurring;
- setTimeout(function() { if (blurring <= 0) close(); }, 200);
- });
- CodeMirror.on(b, "focus", function() { ++blurring; });
- }
- });
-
- /*
- * openNotification
- * Opens a notification, that can be closed with an optional timer
- * (default 5000ms timer) and always closes on click.
- *
- * If a notification is opened while another is opened, it will close the
- * currently opened one and open the new one immediately.
- */
- CodeMirror.defineExtension("openNotification", function(template, options) {
- closeNotification(this, close);
- var dialog = dialogDiv(this, template, options && options.bottom);
- var closed = false, doneTimer;
- var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000;
-
- function close() {
- if (closed) return;
- closed = true;
- clearTimeout(doneTimer);
- dialog.parentNode.removeChild(dialog);
- }
-
- CodeMirror.on(dialog, 'click', function(e) {
- CodeMirror.e_preventDefault(e);
- close();
- });
-
- if (duration)
- doneTimer = setTimeout(close, duration);
-
- return close;
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.css
deleted file mode 100644
index 437acd8..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.CodeMirror-fullscreen {
- position: fixed;
- top: 0; left: 0; right: 0; bottom: 0;
- height: auto;
- z-index: 9;
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.js
deleted file mode 100644
index cd3673b..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/fullscreen.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// 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();
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/panel.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/panel.js
deleted file mode 100644
index ba29484..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/panel.js
+++ /dev/null
@@ -1,112 +0,0 @@
-// 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) {
- options = options || {};
-
- if (!this.state.panels) initPanels(this);
-
- var info = this.state.panels;
- 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++;
- 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();
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/placeholder.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/placeholder.js
deleted file mode 100644
index bb0c393..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/placeholder.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(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.defineOption("placeholder", "", function(cm, val, old) {
- var prev = old && old != CodeMirror.Init;
- if (val && !prev) {
- cm.on("blur", onBlur);
- cm.on("change", onChange);
- onChange(cm);
- } else if (!val && prev) {
- cm.off("blur", onBlur);
- cm.off("change", onChange);
- clearPlaceholder(cm);
- var wrapper = cm.getWrapperElement();
- wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
- }
-
- if (val && !cm.hasFocus()) onBlur(cm);
- });
-
- function clearPlaceholder(cm) {
- if (cm.state.placeholder) {
- cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
- cm.state.placeholder = null;
- }
- }
- function setPlaceholder(cm) {
- clearPlaceholder(cm);
- var elt = cm.state.placeholder = document.createElement("pre");
- elt.style.cssText = "height: 0; overflow: visible";
- elt.className = "CodeMirror-placeholder";
- elt.appendChild(document.createTextNode(cm.getOption("placeholder")));
- cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
- }
-
- function onBlur(cm) {
- if (isEmpty(cm)) setPlaceholder(cm);
- }
- function onChange(cm) {
- var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
- wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
-
- if (empty) setPlaceholder(cm);
- else clearPlaceholder(cm);
- }
-
- function isEmpty(cm) {
- return (cm.lineCount() === 1) && (cm.getLine(0) === "");
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/rulers.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/rulers.js
deleted file mode 100644
index 01f6566..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/display/rulers.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// 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("rulers", false, function(cm, val, old) {
- if (old && old != CodeMirror.Init) {
- clearRulers(cm);
- cm.off("refresh", refreshRulers);
- }
- if (val && val.length) {
- setRulers(cm);
- cm.on("refresh", refreshRulers);
- }
- });
-
- function clearRulers(cm) {
- for (var i = cm.display.lineSpace.childNodes.length - 1; i >= 0; i--) {
- var node = cm.display.lineSpace.childNodes[i];
- if (/(^|\s)CodeMirror-ruler($|\s)/.test(node.className))
- node.parentNode.removeChild(node);
- }
- }
-
- function setRulers(cm) {
- var val = cm.getOption("rulers");
- var cw = cm.defaultCharWidth();
- var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left;
- var minH = cm.display.scroller.offsetHeight + 30;
- for (var i = 0; i < val.length; i++) {
- var elt = document.createElement("div");
- elt.className = "CodeMirror-ruler";
- var col, conf = val[i];
- if (typeof conf == "number") {
- col = conf;
- } else {
- col = conf.column;
- if (conf.className) elt.className += " " + conf.className;
- if (conf.color) elt.style.borderColor = conf.color;
- if (conf.lineStyle) elt.style.borderLeftStyle = conf.lineStyle;
- if (conf.width) elt.style.borderLeftWidth = conf.width;
- }
- elt.style.left = (left + col * cw) + "px";
- elt.style.top = "-50px";
- elt.style.bottom = "-20px";
- elt.style.minHeight = minH + "px";
- cm.display.lineSpace.insertBefore(elt, cm.display.cursorDiv);
- }
- }
-
- function refreshRulers(cm) {
- clearRulers(cm);
- setRulers(cm);
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closebrackets.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closebrackets.js
deleted file mode 100644
index 7030268..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closebrackets.js
+++ /dev/null
@@ -1,185 +0,0 @@
-// 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 defaults = {
- pairs: "()[]{}''\"\"",
- triples: "",
- explode: "[]{}"
- };
-
- var Pos = CodeMirror.Pos;
-
- CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
- 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));
- 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;
- }
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closetag.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closetag.js
deleted file mode 100644
index e68d52d..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/closetag.js
+++ /dev/null
@@ -1,166 +0,0 @@
-// 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" : "") + "" + tagName + ">",
- 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 ? "/" : "";
- 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 (typingSlash && (tok.type == "string" || tok.string.charAt(0) != "<" ||
- tok.start != pos.ch - 1))
- return CodeMirror.Pass;
- // Kludge to get around the fact that we are not in XML mode
- // when completing in JS/CSS snippet in htmlmixed mode. Does not
- // work for other XML embedded languages (there is no general
- // way to go from a mixed mode to its current XML state).
- if (inner.mode.name != "xml") {
- if (cm.getMode().name == "htmlmixed" && inner.mode.name == "javascript")
- replacements[i] = head + "script>";
- 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;
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/continuelist.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/continuelist.js
deleted file mode 100644
index df5179f..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/continuelist.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(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 listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,
- emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,
- unorderedListRE = /[*+-]\s/;
-
- CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
- 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;
- var eolState = cm.getStateAfter(pos.line);
- var inList = eolState.list !== false;
- var inQuote = eolState.quote !== 0;
-
- var line = cm.getLine(pos.line), match = listRE.exec(line);
- if (!ranges[i].empty() || (!inList && !inQuote) || !match) {
- cm.execCommand("newlineAndIndent");
- return;
- }
- 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[5];
- var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
- ? match[2]
- : (parseInt(match[3], 10) + 1) + match[4];
-
- replacements[i] = "\n" + indent + bullet + after;
- }
- }
-
- cm.replaceSelections(replacements);
- };
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchbrackets.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchbrackets.js
deleted file mode 100644
index 70e1ae1..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchbrackets.js
+++ /dev/null
@@ -1,120 +0,0 @@
-// 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);
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchtags.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchtags.js
deleted file mode 100644
index fb1911a..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/matchtags.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// 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);
- }
- };
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/trailingspace.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/trailingspace.js
deleted file mode 100644
index fa7b56b..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/edit/trailingspace.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// 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.defineOption("showTrailingSpace", false, function(cm, val, prev) {
- if (prev == CodeMirror.Init) prev = false;
- if (prev && !val)
- cm.removeOverlay("trailingspace");
- else if (!prev && val)
- cm.addOverlay({
- token: function(stream) {
- for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
- if (i > stream.pos) { stream.pos = i; return null; }
- stream.pos = l;
- return "trailingspace";
- },
- name: "trailingspace"
- });
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/brace-fold.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/brace-fold.js
deleted file mode 100644
index 1605f6c..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/brace-fold.js
+++ /dev/null
@@ -1,105 +0,0 @@
-// 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))};
-});
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/comment-fold.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/comment-fold.js
deleted file mode 100644
index b75db7e..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/comment-fold.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// 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.registerGlobalHelper("fold", "comment", function(mode) {
- return mode.blockCommentStart && mode.blockCommentEnd;
-}, function(cm, start) {
- var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd;
- if (!startToken || !endToken) return;
- var line = start.line, lineText = cm.getLine(line);
-
- var startCh;
- for (var at = start.ch, pass = 0;;) {
- var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1);
- if (found == -1) {
- if (pass == 1) return;
- pass = 1;
- at = lineText.length;
- continue;
- }
- if (pass == 1 && found < start.ch) return;
- if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) {
- startCh = found + startToken.length;
- break;
- }
- at = found - 1;
- }
-
- var depth = 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 (pos == nextOpen) ++depth;
- else if (!--depth) { 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)};
-});
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldcode.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldcode.js
deleted file mode 100644
index 62911f9..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldcode.js
+++ /dev/null
@@ -1,149 +0,0 @@
-// 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);
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.css
deleted file mode 100644
index ad19ae2..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.css
+++ /dev/null
@@ -1,20 +0,0 @@
-.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";
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.js
deleted file mode 100644
index ed7bd87..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/foldgutter.js
+++ /dev/null
@@ -1,146 +0,0 @@
-// 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 marks[i];
- }
-
- 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;
- var folded = isFolded(cm, line);
- if (folded) folded.clear();
- else 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);
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/indent-fold.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/indent-fold.js
deleted file mode 100644
index e29f15e..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/indent-fold.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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", "indent", function(cm, start) {
- var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line);
- if (!/\S/.test(firstLine)) return;
- var getIndent = function(line) {
- return CodeMirror.countColumn(line, null, tabSize);
- };
- var myIndent = getIndent(firstLine);
- var lastLineInFold = null;
- // Go through lines until we find a line that definitely doesn't belong in
- // the block we're folding, or to the end.
- for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) {
- var curLine = cm.getLine(i);
- var curIndent = getIndent(curLine);
- if (curIndent > myIndent) {
- // Lines with a greater indent are considered part of the block.
- lastLineInFold = i;
- } else if (!/\S/.test(curLine)) {
- // Empty lines might be breaks within the block we're trying to fold.
- } else {
- // A non-empty line at an indent equal to or less than ours marks the
- // start of another block.
- break;
- }
- }
- if (lastLineInFold) return {
- from: CodeMirror.Pos(start.line, firstLine.length),
- to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length)
- };
-});
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/markdown-fold.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/markdown-fold.js
deleted file mode 100644
index ce84c94..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/markdown-fold.js
+++ /dev/null
@@ -1,49 +0,0 @@
-// 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", "markdown", function(cm, start) {
- var maxDepth = 100;
-
- function isHeader(lineNo) {
- var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0));
- return tokentype && /\bheader\b/.test(tokentype);
- }
-
- function headerLevel(lineNo, line, nextLine) {
- var match = line && line.match(/^#+/);
- if (match && isHeader(lineNo)) return match[0].length;
- match = nextLine && nextLine.match(/^[=\-]+\s*$/);
- if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2;
- return maxDepth;
- }
-
- var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1);
- var level = headerLevel(start.line, firstLine, nextLine);
- if (level === maxDepth) return undefined;
-
- var lastLineNo = cm.lastLine();
- var end = start.line, nextNextLine = cm.getLine(end + 2);
- while (end < lastLineNo) {
- if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break;
- ++end;
- nextLine = nextNextLine;
- nextNextLine = cm.getLine(end + 2);
- }
-
- return {
- from: CodeMirror.Pos(start.line, firstLine.length),
- to: CodeMirror.Pos(end, cm.getLine(end).length)
- };
-});
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/xml-fold.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/xml-fold.js
deleted file mode 100644
index 504727f..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/fold/xml-fold.js
+++ /dev/null
@@ -1,182 +0,0 @@
-// 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);
- };
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/anyword-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/anyword-hint.js
deleted file mode 100644
index 8e74a92..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/anyword-hint.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// 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 WORD = /[\w$]+/, RANGE = 500;
-
- CodeMirror.registerHelper("hint", "anyword", function(editor, options) {
- var word = options && options.word || WORD;
- var range = options && options.range || RANGE;
- var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
- var end = cur.ch, start = end;
- while (start && word.test(curLine.charAt(start - 1))) --start;
- var curWord = start != end && curLine.slice(start, end);
-
- var list = [], seen = {};
- var re = new RegExp(word.source, "g");
- for (var dir = -1; dir <= 1; dir += 2) {
- var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir;
- for (; line != endLine; line += dir) {
- var text = editor.getLine(line), m;
- while (m = re.exec(text)) {
- if (line == cur.line && m[0] === curWord) continue;
- if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) {
- seen[m[0]] = true;
- list.push(m[0]);
- }
- }
- }
- }
- return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/css-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/css-hint.js
deleted file mode 100644
index 2264272..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/css-hint.js
+++ /dev/null
@@ -1,60 +0,0 @@
-// 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("../../mode/css/css"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror", "../../mode/css/css"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
- "use strict";
-
- var pseudoClasses = {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};
-
- CodeMirror.registerHelper("hint", "css", function(cm) {
- var cur = cm.getCursor(), token = cm.getTokenAt(cur);
- 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;
- }
-
- var spec = CodeMirror.resolveMode("text/css");
-
- var result = [];
- function add(keywords) {
- for (var name in keywords)
- if (!word || name.lastIndexOf(word, 0) == 0)
- result.push(name);
- }
-
- var st = inner.state.state;
- if (st == "pseudo" || token.type == "variable-3") {
- add(pseudoClasses);
- } else if (st == "block" || st == "maybeprop") {
- add(spec.propertyKeywords);
- } else if (st == "prop" || st == "parens" || st == "at" || st == "params") {
- add(spec.valueKeywords);
- add(spec.colorKeywords);
- } else if (st == "media" || st == "media_parens") {
- add(spec.mediaTypes);
- add(spec.mediaFeatures);
- }
-
- if (result.length) return {
- list: result,
- from: CodeMirror.Pos(cur.line, start),
- to: CodeMirror.Pos(cur.line, end)
- };
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/html-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/html-hint.js
deleted file mode 100644
index c6769bc..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/html-hint.js
+++ /dev/null
@@ -1,348 +0,0 @@
-// 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("./xml-hint"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror", "./xml-hint"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
- "use strict";
-
- var langs = "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(" ");
- var targets = ["_blank", "_self", "_top", "_parent"];
- var charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"];
- var methods = ["get", "post", "put", "delete"];
- var encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
- var media = ["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]"];
- var s = { attrs: {} }; // Simple tag, reused for a whole lot of tags
-
- var data = {
- a: {
- attrs: {
- href: null, ping: null, type: null,
- media: media,
- target: targets,
- hreflang: langs
- }
- },
- abbr: s,
- acronym: s,
- address: s,
- applet: s,
- area: {
- attrs: {
- alt: null, coords: null, href: null, target: null, ping: null,
- media: media, hreflang: langs, type: null,
- shape: ["default", "rect", "circle", "poly"]
- }
- },
- article: s,
- aside: s,
- audio: {
- attrs: {
- src: null, mediagroup: null,
- crossorigin: ["anonymous", "use-credentials"],
- preload: ["none", "metadata", "auto"],
- autoplay: ["", "autoplay"],
- loop: ["", "loop"],
- controls: ["", "controls"]
- }
- },
- b: s,
- base: { attrs: { href: null, target: targets } },
- basefont: s,
- bdi: s,
- bdo: s,
- big: s,
- blockquote: { attrs: { cite: null } },
- body: s,
- br: s,
- button: {
- attrs: {
- form: null, formaction: null, name: null, value: null,
- autofocus: ["", "autofocus"],
- disabled: ["", "autofocus"],
- formenctype: encs,
- formmethod: methods,
- formnovalidate: ["", "novalidate"],
- formtarget: targets,
- type: ["submit", "reset", "button"]
- }
- },
- canvas: { attrs: { width: null, height: null } },
- caption: s,
- center: s,
- cite: s,
- code: s,
- 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: s,
- del: { attrs: { cite: null, datetime: null } },
- details: { attrs: { open: ["", "open"] } },
- dfn: s,
- dir: s,
- div: s,
- dl: s,
- dt: s,
- em: s,
- embed: { attrs: { src: null, type: null, width: null, height: null } },
- eventsource: { attrs: { src: null } },
- fieldset: { attrs: { disabled: ["", "disabled"], form: null, name: null } },
- figcaption: s,
- figure: s,
- font: s,
- footer: s,
- form: {
- attrs: {
- action: null, name: null,
- "accept-charset": charsets,
- autocomplete: ["on", "off"],
- enctype: encs,
- method: methods,
- novalidate: ["", "novalidate"],
- target: targets
- }
- },
- frame: s,
- frameset: s,
- h1: s, h2: s, h3: s, h4: s, h5: s, h6: s,
- head: {
- attrs: {},
- children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
- },
- header: s,
- hgroup: s,
- hr: s,
- html: {
- attrs: { manifest: null },
- children: ["head", "body"]
- },
- i: s,
- 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: encs,
- formmethod: methods,
- formnovalidate: ["", "novalidate"],
- formtarget: targets,
- 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: s,
- keygen: {
- attrs: {
- challenge: null, form: null, name: null,
- autofocus: ["", "autofocus"],
- disabled: ["", "disabled"],
- keytype: ["RSA"]
- }
- },
- label: { attrs: { "for": null, form: null } },
- legend: s,
- li: { attrs: { value: null } },
- link: {
- attrs: {
- href: null, type: null,
- hreflang: langs,
- media: media,
- sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
- }
- },
- map: { attrs: { name: null } },
- mark: s,
- menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
- meta: {
- attrs: {
- content: null,
- charset: charsets,
- 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: s,
- noframes: s,
- noscript: s,
- 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: s,
- param: { attrs: { name: null, value: null } },
- pre: s,
- progress: { attrs: { value: null, max: null } },
- q: { attrs: { cite: null } },
- rp: s,
- rt: s,
- ruby: s,
- s: s,
- samp: s,
- script: {
- attrs: {
- type: ["text/javascript"],
- src: null,
- async: ["", "async"],
- defer: ["", "defer"],
- charset: charsets
- }
- },
- section: s,
- select: {
- attrs: {
- form: null, name: null, size: null,
- autofocus: ["", "autofocus"],
- disabled: ["", "disabled"],
- multiple: ["", "multiple"]
- }
- },
- small: s,
- source: { attrs: { src: null, type: null, media: null } },
- span: s,
- strike: s,
- strong: s,
- style: {
- attrs: {
- type: ["text/css"],
- media: media,
- scoped: null
- }
- },
- sub: s,
- summary: s,
- sup: s,
- table: s,
- tbody: s,
- 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: s,
- th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
- thead: s,
- time: { attrs: { datetime: null } },
- title: s,
- tr: s,
- track: {
- attrs: {
- src: null, label: null, "default": null,
- kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
- srclang: langs
- }
- },
- tt: s,
- u: s,
- ul: s,
- "var": s,
- 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: s
- };
-
- var globalAttrs = {
- 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"]
- };
- function populate(obj) {
- for (var attr in globalAttrs) if (globalAttrs.hasOwnProperty(attr))
- obj.attrs[attr] = globalAttrs[attr];
- }
-
- populate(s);
- for (var tag in data) if (data.hasOwnProperty(tag) && data[tag] != s)
- populate(data[tag]);
-
- CodeMirror.htmlSchema = data;
- function htmlHint(cm, options) {
- var local = {schemaInfo: data};
- if (options) for (var opt in options) local[opt] = options[opt];
- return CodeMirror.hint.xml(cm, local);
- }
- CodeMirror.registerHelper("hint", "html", htmlHint);
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/javascript-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/javascript-hint.js
deleted file mode 100644
index 7bcbf4a..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/javascript-hint.js
+++ /dev/null
@@ -1,146 +0,0 @@
-// 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 Pos = CodeMirror.Pos;
-
- function forEach(arr, f) {
- for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
- }
-
- function arrayContains(arr, item) {
- if (!Array.prototype.indexOf) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === item) {
- return true;
- }
- }
- return false;
- }
- return arr.indexOf(item) != -1;
- }
-
- function scriptHint(editor, keywords, getToken, options) {
- // Find the token at the cursor
- var cur = editor.getCursor(), token = getToken(editor, cur);
- if (/\b(?:string|comment)\b/.test(token.type)) return;
- token.state = CodeMirror.innerMode(editor.getMode(), token.state).state;
-
- // If it's not a 'word-style' token, ignore the token.
- if (!/^[\w$_]*$/.test(token.string)) {
- token = {start: cur.ch, end: cur.ch, string: "", state: token.state,
- type: token.string == "." ? "property" : null};
- } else if (token.end > cur.ch) {
- token.end = cur.ch;
- token.string = token.string.slice(0, cur.ch - token.start);
- }
-
- var tprop = token;
- // If it is a property, find out what it is a property of.
- while (tprop.type == "property") {
- tprop = getToken(editor, Pos(cur.line, tprop.start));
- if (tprop.string != ".") return;
- tprop = getToken(editor, Pos(cur.line, tprop.start));
- if (!context) var context = [];
- context.push(tprop);
- }
- return {list: getCompletions(token, context, keywords, options),
- from: Pos(cur.line, token.start),
- to: Pos(cur.line, token.end)};
- }
-
- function javascriptHint(editor, options) {
- return scriptHint(editor, javascriptKeywords,
- function (e, cur) {return e.getTokenAt(cur);},
- options);
- };
- CodeMirror.registerHelper("hint", "javascript", javascriptHint);
-
- function getCoffeeScriptToken(editor, cur) {
- // This getToken, it is for coffeescript, imitates the behavior of
- // getTokenAt method in javascript.js, that is, returning "property"
- // type and treat "." as indepenent token.
- var token = editor.getTokenAt(cur);
- if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') {
- token.end = token.start;
- token.string = '.';
- token.type = "property";
- }
- else if (/^\.[\w$_]*$/.test(token.string)) {
- token.type = "property";
- token.start++;
- token.string = token.string.replace(/\./, '');
- }
- return token;
- }
-
- function coffeescriptHint(editor, options) {
- return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options);
- }
- CodeMirror.registerHelper("hint", "coffeescript", coffeescriptHint);
-
- var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " +
- "toUpperCase toLowerCase split concat match replace search").split(" ");
- var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " +
- "lastIndexOf every some filter forEach map reduce reduceRight ").split(" ");
- var funcProps = "prototype apply call bind".split(" ");
- var javascriptKeywords = ("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(" ");
- var coffeescriptKeywords = ("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(" ");
-
- function getCompletions(token, context, keywords, options) {
- var found = [], start = token.string, global = options && options.globalScope || window;
- function maybeAdd(str) {
- if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str);
- }
- function gatherCompletions(obj) {
- if (typeof obj == "string") forEach(stringProps, maybeAdd);
- else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
- else if (obj instanceof Function) forEach(funcProps, maybeAdd);
- for (var name in obj) maybeAdd(name);
- }
-
- if (context && context.length) {
- // If this is a property, see if it belongs to some object we can
- // find in the current environment.
- var obj = context.pop(), base;
- if (obj.type && obj.type.indexOf("variable") === 0) {
- if (options && options.additionalContext)
- base = options.additionalContext[obj.string];
- if (!options || options.useGlobalScope !== false)
- base = base || global[obj.string];
- } else if (obj.type == "string") {
- base = "";
- } else if (obj.type == "atom") {
- base = 1;
- } else if (obj.type == "function") {
- if (global.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&
- (typeof global.jQuery == 'function'))
- base = global.jQuery();
- else if (global._ != null && (obj.string == '_') && (typeof global._ == 'function'))
- base = global._();
- }
- while (base != null && context.length)
- base = base[context.pop().string];
- if (base != null) gatherCompletions(base);
- } else {
- // If not, just look in the global object and any local scope
- // (reading into JS mode internals to get at the local and global variables)
- for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
- for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);
- if (!options || options.useGlobalScope !== false)
- gatherCompletions(global);
- forEach(keywords, maybeAdd);
- }
- return found;
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/python-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/python-hint.js
deleted file mode 100644
index 1b97f6a..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/python-hint.js
+++ /dev/null
@@ -1,102 +0,0 @@
-// 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 forEach(arr, f) {
- for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
- }
-
- function arrayContains(arr, item) {
- if (!Array.prototype.indexOf) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === item) {
- return true;
- }
- }
- return false;
- }
- return arr.indexOf(item) != -1;
- }
-
- function scriptHint(editor, _keywords, getToken) {
- // Find the token at the cursor
- var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
- // If it's not a 'word-style' token, ignore the token.
-
- if (!/^[\w$_]*$/.test(token.string)) {
- token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
- className: token.string == ":" ? "python-type" : null};
- }
-
- if (!context) var context = [];
- context.push(tprop);
-
- var completionList = getCompletions(token, context);
- completionList = completionList.sort();
-
- return {list: completionList,
- from: CodeMirror.Pos(cur.line, token.start),
- to: CodeMirror.Pos(cur.line, token.end)};
- }
-
- function pythonHint(editor) {
- return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
- }
- CodeMirror.registerHelper("hint", "python", pythonHint);
-
- var pythonKeywords = "and del from not while as elif global or with assert else if pass yield"
-+ "break except import print class exec in raise continue finally is return def for lambda try";
- var pythonKeywordsL = pythonKeywords.split(" ");
- var pythonKeywordsU = pythonKeywords.toUpperCase().split(" ");
-
- var pythonBuiltins = "abs divmod input open staticmethod all enumerate int ord str "
-+ "any eval isinstance pow sum basestring execfile issubclass print super"
-+ "bin file iter property tuple bool filter len range type"
-+ "bytearray float list raw_input unichr callable format locals reduce unicode"
-+ "chr frozenset long reload vars classmethod getattr map repr xrange"
-+ "cmp globals max reversed zip compile hasattr memoryview round __import__"
-+ "complex hash min set apply delattr help next setattr buffer"
-+ "dict hex object slice coerce dir id oct sorted intern ";
- var pythonBuiltinsL = pythonBuiltins.split(" ").join("() ").split(" ");
- var pythonBuiltinsU = pythonBuiltins.toUpperCase().split(" ").join("() ").split(" ");
-
- function getCompletions(token, context) {
- var found = [], start = token.string;
- function maybeAdd(str) {
- if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str);
- }
-
- function gatherCompletions(_obj) {
- forEach(pythonBuiltinsL, maybeAdd);
- forEach(pythonBuiltinsU, maybeAdd);
- forEach(pythonKeywordsL, maybeAdd);
- forEach(pythonKeywordsU, maybeAdd);
- }
-
- if (context) {
- // If this is a property, see if it belongs to some object we can
- // find in the current environment.
- var obj = context.pop(), base;
-
- if (obj.type == "variable")
- base = obj.string;
- else if(obj.type == "variable-3")
- base = ":" + obj.string;
-
- while (base != null && context.length)
- base = base[context.pop().string];
- if (base != null) gatherCompletions(base);
- }
- return found;
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.css
deleted file mode 100644
index 924e638..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.css
+++ /dev/null
@@ -1,38 +0,0 @@
-.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;
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.js
deleted file mode 100644
index 980da52..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/show-hint.js
+++ /dev/null
@@ -1,386 +0,0 @@
-// 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 HINT_ELEMENT_CLASS = "CodeMirror-hint";
- var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active";
-
- // This is the old interface, kept around for now to stay
- // backwards-compatible.
- CodeMirror.showHint = function(cm, getHints, options) {
- if (!getHints) return cm.showHint(options);
- if (options && options.async) getHints.async = true;
- var newOpts = {hint: getHints};
- if (options) for (var prop in options) newOpts[prop] = options[prop];
- return cm.showHint(newOpts);
- };
-
- 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);
- if (!completion.options.hint) return;
-
- CodeMirror.signal(this, "startCompletion", this);
- completion.update(true);
- });
-
- function Completion(cm, options) {
- this.cm = cm;
- this.options = this.buildOptions(options);
- 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();
- CodeMirror.signal(this.cm, "endCompletion", this.cm);
- },
-
- active: function() {
- return this.cm.state.completionActive == this;
- },
-
- pick: function(data, i) {
- var completion = data.list[i];
- if (completion.hint) completion.hint(this.cm, data, completion);
- else this.cm.replaceRange(getText(completion), completion.from || data.from,
- completion.to || data.to, "complete");
- CodeMirror.signal(data, "pick", completion);
- this.close();
- },
-
- cursorActivity: function() {
- if (this.debounce) {
- cancelAnimationFrame(this.debounce);
- this.debounce = 0;
- }
-
- 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();
- }
- },
-
- update: function(first) {
- if (this.tick == null) return;
- 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) {
- if (this.data) CodeMirror.signal(this.data, "update");
- if (data && this.data && CodeMirror.cmpPos(data.from, this.data.from)) data = null;
- this.data = data;
-
- 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 {
- this.widget = new Widget(this, data);
- CodeMirror.signal(data, "shown");
- }
- }
- },
-
- buildOptions: function(options) {
- var editor = this.cm.options.hintOptions;
- var out = {};
- for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
- if (editor) for (var prop in editor)
- if (editor[prop] !== undefined) out[prop] = editor[prop];
- if (options) for (var prop in options)
- if (options[prop] !== undefined) out[prop] = options[prop];
- return out;
- }
- };
-
- function getText(completion) {
- if (typeof completion == "string") return completion;
- else return completion.text;
- }
-
- function buildKeyMap(completion, handle) {
- var baseMap = {
- Up: function() {handle.moveFocus(-1);},
- Down: function() {handle.moveFocus(1);},
- PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},
- PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},
- Home: function() {handle.setFocus(0);},
- End: function() {handle.setFocus(handle.length - 1);},
- Enter: handle.pick,
- Tab: handle.pick,
- Esc: handle.close
- };
- var custom = completion.options.customKeys;
- var ourMap = custom ? {} : baseMap;
- function addBinding(key, val) {
- var bound;
- if (typeof val != "string")
- bound = function(cm) { return val(cm, handle); };
- // This mechanism is deprecated
- else if (baseMap.hasOwnProperty(val))
- bound = baseMap[val];
- else
- bound = val;
- ourMap[key] = bound;
- }
- if (custom)
- for (var key in custom) if (custom.hasOwnProperty(key))
- addBinding(key, custom[key]);
- var extra = completion.options.extraKeys;
- if (extra)
- for (var key in extra) if (extra.hasOwnProperty(key))
- addBinding(key, extra[key]);
- return ourMap;
- }
-
- function getHintElement(hintsElement, el) {
- while (el && el != hintsElement) {
- if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el;
- el = el.parentNode;
- }
- }
-
- 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");
- hints.className = "CodeMirror-hints";
- this.selectedHint = data.selectedHint || 0;
-
- var completions = data.list;
- for (var i = 0; i < completions.length; ++i) {
- var elt = hints.appendChild(document.createElement("li")), cur = completions[i];
- var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS);
- if (cur.className != null) className = cur.className + " " + className;
- elt.className = className;
- if (cur.render) cur.render(elt, data, cur);
- else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));
- elt.hintId = i;
- }
-
- var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);
- var left = pos.left, top = pos.bottom, below = true;
- hints.style.left = left + "px";
- hints.style.top = top + "px";
- // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
- var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
- var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
- (completion.options.container || document.body).appendChild(hints);
- var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
- if (overlapY > 0) {
- var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
- if (curTop - height > 0) { // Fits above cursor
- hints.style.top = (top = pos.top - height) + "px";
- below = false;
- } else if (height > winH) {
- hints.style.height = (winH - 5) + "px";
- hints.style.top = (top = pos.bottom - box.top) + "px";
- var cursor = cm.getCursor();
- if (data.from.ch != cursor.ch) {
- pos = cm.cursorCoords(cursor);
- hints.style.left = (left = pos.left) + "px";
- box = hints.getBoundingClientRect();
- }
- }
- }
- var overlapX = box.right - winW;
- if (overlapX > 0) {
- if (box.right - box.left > winW) {
- hints.style.width = (winW - 5) + "px";
- overlapX -= (box.right - box.left) - winW;
- }
- hints.style.left = (left = pos.left - overlapX) + "px";
- }
-
- cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
- moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
- setFocus: function(n) { widget.changeActive(n); },
- menuSize: function() { return widget.screenAmount(); },
- length: completions.length,
- close: function() { completion.close(); },
- pick: function() { widget.pick(); },
- data: data
- }));
-
- if (completion.options.closeOnUnfocus) {
- var closingOnBlur;
- cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });
- cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); });
- }
-
- var startScroll = cm.getScrollInfo();
- cm.on("scroll", this.onScroll = function() {
- var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
- var newTop = top + startScroll.top - curScroll.top;
- var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);
- if (!below) point += hints.offsetHeight;
- if (point <= editor.top || point >= editor.bottom) return completion.close();
- hints.style.top = newTop + "px";
- hints.style.left = (left + startScroll.left - curScroll.left) + "px";
- });
-
- CodeMirror.on(hints, "dblclick", function(e) {
- var t = getHintElement(hints, e.target || e.srcElement);
- if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}
- });
-
- CodeMirror.on(hints, "click", function(e) {
- var t = getHintElement(hints, e.target || e.srcElement);
- if (t && t.hintId != null) {
- widget.changeActive(t.hintId);
- if (completion.options.completeOnSingleClick) widget.pick();
- }
- });
-
- CodeMirror.on(hints, "mousedown", function() {
- setTimeout(function(){cm.focus();}, 20);
- });
-
- CodeMirror.signal(data, "select", completions[0], hints.firstChild);
- return true;
- }
-
- Widget.prototype = {
- close: function() {
- if (this.completion.widget != this) return;
- this.completion.widget = null;
- this.hints.parentNode.removeChild(this.hints);
- this.completion.cm.removeKeyMap(this.keyMap);
-
- var cm = this.completion.cm;
- if (this.completion.options.closeOnUnfocus) {
- cm.off("blur", this.onBlur);
- cm.off("focus", this.onFocus);
- }
- 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);
- },
-
- changeActive: function(i, avoidWrap) {
- if (i >= this.data.list.length)
- i = avoidWrap ? this.data.list.length - 1 : 0;
- else if (i < 0)
- i = avoidWrap ? 0 : this.data.list.length - 1;
- if (this.selectedHint == i) return;
- var node = this.hints.childNodes[this.selectedHint];
- node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
- node = this.hints.childNodes[this.selectedHint = i];
- node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
- if (node.offsetTop < this.hints.scrollTop)
- this.hints.scrollTop = node.offsetTop - 3;
- else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
- this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;
- CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
- },
-
- screenAmount: function() {
- return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
- }
- };
-
- CodeMirror.registerHelper("hint", "auto", function(cm, options) {
- var helpers = cm.getHelpers(cm.getCursor(), "hint"), words;
- if (helpers.length) {
- for (var i = 0; i < helpers.length; i++) {
- var cur = helpers[i](cm, options);
- if (cur && cur.list.length) return cur;
- }
- } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
- if (words) return CodeMirror.hint.fromList(cm, {words: words});
- } else if (CodeMirror.hint.anyword) {
- return CodeMirror.hint.anyword(cm, options);
- }
- });
-
- CodeMirror.registerHelper("hint", "fromList", function(cm, options) {
- var cur = cm.getCursor(), token = cm.getTokenAt(cur);
- var to = CodeMirror.Pos(cur.line, token.end);
- if (token.string && /\w/.test(token.string[token.string.length - 1])) {
- var term = token.string, from = CodeMirror.Pos(cur.line, token.start);
- } else {
- var term = "", from = to;
- }
- var found = [];
- for (var i = 0; i < options.words.length; i++) {
- var word = options.words[i];
- if (word.slice(0, term.length) == term)
- found.push(word);
- }
-
- if (found.length) return {list: found, from: from, to: to};
- });
-
- CodeMirror.commands.autocomplete = CodeMirror.showHint;
-
- var defaultOptions = {
- hint: CodeMirror.hint.auto,
- completeSingle: true,
- alignWithWord: true,
- closeCharacters: /[\s()\[\]{};:>,]/,
- closeOnUnfocus: true,
- completeOnSingleClick: false,
- container: null,
- customKeys: null,
- extraKeys: null
- };
-
- CodeMirror.defineOption("hintOptions", null);
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/sql-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/sql-hint.js
deleted file mode 100644
index 22124b5..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/sql-hint.js
+++ /dev/null
@@ -1,254 +0,0 @@
-// 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("../../mode/sql/sql"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror", "../../mode/sql/sql"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
- "use strict";
-
- var tables;
- var defaultTable;
- var keywords;
- var CONS = {
- QUERY_DIV: ";",
- ALIAS_KEYWORD: "AS"
- };
- var Pos = CodeMirror.Pos;
-
- function getKeywords(editor) {
- var mode = editor.doc.modeOption;
- if (mode === "sql") mode = "text/x-sql";
- 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 = getText(word).substr(0, len);
- return string.toUpperCase() === sub.toUpperCase();
- }
-
- function addMatches(result, search, wordlist, formatter) {
- for (var word in wordlist) {
- if (!wordlist.hasOwnProperty(word)) continue;
- if (wordlist.slice) word = wordlist[word];
-
- if (match(search, word)) result.push(formatter(word));
- }
- }
-
- 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) {
- // 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));
- }
- }
-
- // 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(".");
-
- var alias = false;
- var aliasTable = table;
- // Check if table is available. If not, find table by Alias
- if (!getItem(tables, table)) {
- var oldTable = table;
- table = findTableByAlias(table, editor);
- if (table !== oldTable) alias = true;
- }
-
- var columns = getItem(tables, table);
- if (columns && columns.columns)
- columns = columns.columns;
-
- if (columns) {
- addMatches(result, string, columns, function(w) {
- var tableInsert = table;
- if (alias == true) tableInsert = aliasTable;
- if (typeof w == "string") {
- w = tableInsert + "." + w;
- } else {
- w = shallowClone(w);
- w.text = tableInsert + "." + w.text;
- }
- return useBacktick ? insertBackticks(w) : w;
- });
- }
-
- return start;
- }
-
- function eachWord(lineText, f) {
- if (!lineText) return;
- var excepted = /[,;]/g;
- var words = lineText.split(" ");
- for (var i = 0; i < words.length; i++) {
- f(words[i]?words[i].replace(excepted, '') : '');
- }
- }
-
- function convertCurToNumber(cur) {
- // max characters of a line is 999,999.
- return cur.line + cur.ch / Math.pow(10, 6);
- }
-
- function convertNumberToCur(num) {
- return Pos(Math.floor(num), +num.toString().split('.').pop());
- }
-
- function findTableByAlias(alias, editor) {
- var doc = editor.doc;
- var fullQuery = doc.getValue();
- var aliasUpperCase = alias.toUpperCase();
- var previousWord = "";
- var table = "";
- var separator = [];
- var validRange = {
- start: Pos(0, 0),
- end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length)
- };
-
- //add separator
- var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV);
- while(indexOfSeparator != -1) {
- separator.push(doc.posFromIndex(indexOfSeparator));
- indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1);
- }
- separator.unshift(Pos(0, 0));
- separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));
-
- //find valid range
- var prevItem = 0;
- var current = convertCurToNumber(editor.getCursor());
- for (var i=0; i< separator.length; i++) {
- var _v = convertCurToNumber(separator[i]);
- if (current > prevItem && current <= _v) {
- validRange = { start: convertNumberToCur(prevItem), end: convertNumberToCur(_v) };
- break;
- }
- prevItem = _v;
- }
-
- var query = doc.getRange(validRange.start, validRange.end, false);
-
- for (var i = 0; i < query.length; i++) {
- var lineText = query[i];
- eachWord(lineText, function(word) {
- var wordUpperCase = word.toUpperCase();
- if (wordUpperCase === aliasUpperCase && getItem(tables, previousWord))
- table = previousWord;
- if (wordUpperCase !== CONS.ALIAS_KEYWORD)
- previousWord = word;
- });
- if (table) break;
- }
- return table;
- }
-
- CodeMirror.registerHelper("hint", "sql", function(editor, options) {
- tables = (options && options.tables) || {};
- var defaultTableName = options && options.defaultTable;
- 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;
- if (token.end > cur.ch) {
- token.end = cur.ch;
- token.string = token.string.slice(0, cur.ch - token.start);
- }
-
- if (token.string.match(/^[.`\w@]\w*$/)) {
- search = token.string;
- start = token.start;
- end = token.end;
- } else {
- start = end = cur.ch;
- search = "";
- }
- if (search.charAt(0) == "." || search.charAt(0) == "`") {
- start = nameCompletion(cur, token, result, editor);
- } else {
- addMatches(result, search, tables, function(w) {return w;});
- addMatches(result, search, defaultTable, function(w) {return w;});
- 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/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/xml-hint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/xml-hint.js
deleted file mode 100644
index 9b9baa0..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/hint/xml-hint.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(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 getHints(cm, options) {
- var tags = options && options.schemaInfo;
- var quote = (options && options.quoteChar) || '"';
- if (!tags) return;
- var cur = cm.getCursor(), token = cm.getTokenAt(cur);
- if (token.end > cur.ch) {
- token.end = cur.ch;
- token.string = token.string.slice(0, cur.ch - token.start);
- }
- var inner = CodeMirror.innerMode(cm.getMode(), token.state);
- if (inner.mode.name != "xml") return;
- var result = [], replaceToken = false, prefix;
- var tag = /\btag\b/.test(token.type) && !/>$/.test(token.string);
- var tagName = tag && /^\w/.test(token.string), tagStart;
-
- if (tagName) {
- var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start);
- var tagType = /<\/$/.test(before) ? "close" : /<$/.test(before) ? "open" : null;
- if (tagType) tagStart = token.start - (tagType == "close" ? 2 : 1);
- } else if (tag && token.string == "<") {
- tagType = "open";
- } else if (tag && token.string == "") {
- tagType = "close";
- }
-
- if (!tag && !inner.state.tagName || tagType) {
- if (tagName)
- prefix = token.string;
- replaceToken = tagType;
- var cx = inner.state.context, curTag = cx && tags[cx.tagName];
- var childList = cx ? curTag && curTag.children : tags["!top"];
- if (childList && tagType != "close") {
- for (var i = 0; i < childList.length; ++i) if (!prefix || childList[i].lastIndexOf(prefix, 0) == 0)
- result.push("<" + childList[i]);
- } else if (tagType != "close") {
- for (var name in tags)
- if (tags.hasOwnProperty(name) && name != "!top" && name != "!attrs" && (!prefix || name.lastIndexOf(prefix, 0) == 0))
- result.push("<" + name);
- }
- if (cx && (!prefix || tagType == "close" && cx.tagName.lastIndexOf(prefix, 0) == 0))
- result.push("" + cx.tagName + ">");
- } else {
- // Attribute completion
- var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs;
- var globalAttrs = tags["!attrs"];
- if (!attrs && !globalAttrs) return;
- if (!attrs) {
- attrs = globalAttrs;
- } else if (globalAttrs) { // Combine tag-local and global attributes
- var set = {};
- for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm];
- for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm];
- attrs = set;
- }
- if (token.type == "string" || token.string == "=") { // A value
- var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)),
- Pos(cur.line, token.type == "string" ? token.start : token.end));
- var atName = before.match(/([^\s\u00a0=<>\"\']+)=$/), atValues;
- if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;
- if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget
- if (token.type == "string") {
- prefix = token.string;
- var n = 0;
- if (/['"]/.test(token.string.charAt(0))) {
- quote = token.string.charAt(0);
- prefix = token.string.slice(1);
- n++;
- }
- var len = token.string.length;
- if (/['"]/.test(token.string.charAt(len - 1))) {
- quote = token.string.charAt(len - 1);
- prefix = token.string.substr(n, len - 2);
- }
- replaceToken = true;
- }
- for (var i = 0; i < atValues.length; ++i) if (!prefix || atValues[i].lastIndexOf(prefix, 0) == 0)
- result.push(quote + atValues[i] + quote);
- } else { // An attribute name
- if (token.type == "attribute") {
- prefix = token.string;
- replaceToken = true;
- }
- for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || attr.lastIndexOf(prefix, 0) == 0))
- result.push(attr);
- }
- }
- return {
- list: result,
- from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur,
- to: replaceToken ? Pos(cur.line, token.end) : cur
- };
- }
-
- CodeMirror.registerHelper("hint", "xml", getHints);
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/coffeescript-lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/coffeescript-lint.js
deleted file mode 100644
index 7e39428..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/coffeescript-lint.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js
-
-// declare global: coffeelint
-
-(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("lint", "coffeescript", function(text) {
- var found = [];
- var parseError = function(err) {
- var loc = err.lineNumber;
- found.push({from: CodeMirror.Pos(loc-1, 0),
- to: CodeMirror.Pos(loc, 0),
- severity: err.level,
- message: err.message});
- };
- try {
- var res = coffeelint.lint(text);
- for(var i = 0; i < res.length; i++) {
- parseError(res[i]);
- }
- } catch(e) {
- found.push({from: CodeMirror.Pos(e.location.first_line, 0),
- to: CodeMirror.Pos(e.location.last_line, e.location.last_column),
- severity: 'error',
- message: e.message});
- }
- return found;
-});
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/css-lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/css-lint.js
deleted file mode 100644
index 1f61b47..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/css-lint.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on csslint.js from https://github.com/stubbornella/csslint
-
-// declare global: CSSLint
-
-(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("lint", "css", function(text) {
- var found = [];
- if (!window.CSSLint) return found;
- var results = CSSLint.verify(text), messages = results.messages, message = null;
- for ( var i = 0; i < messages.length; i++) {
- message = messages[i];
- var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col;
- found.push({
- from: CodeMirror.Pos(startLine, startCol),
- to: CodeMirror.Pos(endLine, endCol),
- message: message.message,
- severity : message.type
- });
- }
- return found;
-});
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/javascript-lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/javascript-lint.js
deleted file mode 100644
index d4f2ae9..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/javascript-lint.js
+++ /dev/null
@@ -1,136 +0,0 @@
-// 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";
- // declare global: JSHINT
-
- var bogus = [ "Dangerous comment" ];
-
- var warnings = [ [ "Expected '{'",
- "Statement body should be inside '{ }' braces." ] ];
-
- var errors = [ "Missing semicolon", "Extra comma", "Missing property name",
- "Unmatched ", " and instead saw", " is not defined",
- "Unclosed string", "Stopping, unable to continue" ];
-
- function validator(text, options) {
- if (!window.JSHINT) return [];
- JSHINT(text, options, options.globals);
- var errors = JSHINT.data().errors, result = [];
- if (errors) parseErrors(errors, result);
- return result;
- }
-
- CodeMirror.registerHelper("lint", "javascript", validator);
-
- function cleanup(error) {
- // All problems are warnings by default
- fixWith(error, warnings, "warning", true);
- fixWith(error, errors, "error");
-
- return isBogus(error) ? null : error;
- }
-
- function fixWith(error, fixes, severity, force) {
- var description, fix, find, replace, found;
-
- description = error.description;
-
- for ( var i = 0; i < fixes.length; i++) {
- fix = fixes[i];
- find = (typeof fix === "string" ? fix : fix[0]);
- replace = (typeof fix === "string" ? null : fix[1]);
- found = description.indexOf(find) !== -1;
-
- if (force || found) {
- error.severity = severity;
- }
- if (found && replace) {
- error.description = replace;
- }
- }
- }
-
- function isBogus(error) {
- var description = error.description;
- for ( var i = 0; i < bogus.length; i++) {
- if (description.indexOf(bogus[i]) !== -1) {
- return true;
- }
- }
- return false;
- }
-
- function parseErrors(errors, output) {
- for ( var i = 0; i < errors.length; i++) {
- var error = errors[i];
- if (error) {
- var linetabpositions, index;
-
- linetabpositions = [];
-
- // This next block is to fix a problem in jshint. Jshint
- // replaces
- // all tabs with spaces then performs some checks. The error
- // positions (character/space) are then reported incorrectly,
- // not taking the replacement step into account. Here we look
- // at the evidence line and try to adjust the character position
- // to the correct value.
- if (error.evidence) {
- // Tab positions are computed once per line and cached
- var tabpositions = linetabpositions[error.line];
- if (!tabpositions) {
- var evidence = error.evidence;
- tabpositions = [];
- // ugggh phantomjs does not like this
- // forEachChar(evidence, function(item, index) {
- Array.prototype.forEach.call(evidence, function(item,
- index) {
- if (item === '\t') {
- // First col is 1 (not 0) to match error
- // positions
- tabpositions.push(index + 1);
- }
- });
- linetabpositions[error.line] = tabpositions;
- }
- if (tabpositions.length > 0) {
- var pos = error.character;
- tabpositions.forEach(function(tabposition) {
- if (pos > tabposition) pos -= 1;
- });
- error.character = pos;
- }
- }
-
- var start = error.character - 1, end = start + 1;
- if (error.evidence) {
- index = error.evidence.substring(start).search(/.\b/);
- if (index > -1) {
- end += index;
- }
- }
-
- // Convert to format expected by validation service
- error.description = error.reason;// + "(jshint)";
- error.start = error.character;
- error.end = end;
- error = cleanup(error);
-
- if (error)
- output.push({message: error.description,
- severity: error.severity,
- from: CodeMirror.Pos(error.line - 1, start),
- to: CodeMirror.Pos(error.line - 1, end)});
- }
- }
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/json-lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/json-lint.js
deleted file mode 100644
index 9dbb616..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/json-lint.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Depends on jsonlint.js from https://github.com/zaach/jsonlint
-
-// declare global: jsonlint
-
-(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("lint", "json", function(text) {
- var found = [];
- jsonlint.parseError = function(str, hash) {
- var loc = hash.loc;
- found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
- to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
- message: str});
- };
- try { jsonlint.parse(text); }
- catch(e) {}
- return found;
-});
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.css
deleted file mode 100644
index 414a9a0..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.css
+++ /dev/null
@@ -1,73 +0,0 @@
-/* The lint marker gutter */
-.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%;
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.js
deleted file mode 100644
index 3eea203..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/lint.js
+++ /dev/null
@@ -1,207 +0,0 @@
-// 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 GUTTER_ID = "CodeMirror-lint-markers";
-
- function showTooltip(e, content) {
- var tt = document.createElement("div");
- tt.className = "CodeMirror-lint-tooltip";
- tt.appendChild(content.cloneNode(true));
- document.body.appendChild(tt);
-
- function position(e) {
- if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
- tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
- tt.style.left = (e.clientX + 5) + "px";
- }
- CodeMirror.on(document, "mousemove", position);
- position(e);
- if (tt.style.opacity != null) tt.style.opacity = 1;
- return tt;
- }
- function rm(elt) {
- if (elt.parentNode) elt.parentNode.removeChild(elt);
- }
- function hideTooltip(tt) {
- if (!tt.parentNode) return;
- if (tt.style.opacity == null) rm(tt);
- tt.style.opacity = 0;
- setTimeout(function() { rm(tt); }, 600);
- }
-
- function showTooltipFor(e, content, node) {
- var tooltip = showTooltip(e, content);
- function hide() {
- CodeMirror.off(node, "mouseout", hide);
- if (tooltip) { hideTooltip(tooltip); tooltip = null; }
- }
- 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; }
- }
- if (!tooltip) return clearInterval(poll);
- }, 400);
- CodeMirror.on(node, "mouseout", hide);
- }
-
- function LintState(cm, options, hasGutter) {
- this.marked = [];
- this.options = options;
- this.timeout = null;
- this.hasGutter = hasGutter;
- this.onMouseOver = function(e) { onMouseOver(cm, e); };
- }
-
- function parseOptions(_cm, options) {
- if (options instanceof Function) return {getAnnotations: options};
- if (!options || options === true) options = {};
- return options;
- }
-
- function clearMarks(cm) {
- var state = cm.state.lint;
- if (state.hasGutter) cm.clearGutter(GUTTER_ID);
- for (var i = 0; i < state.marked.length; ++i)
- state.marked[i].clear();
- state.marked.length = 0;
- }
-
- function makeMarker(labels, severity, multiple, tooltips) {
- var marker = document.createElement("div"), inner = marker;
- marker.className = "CodeMirror-lint-marker-" + severity;
- if (multiple) {
- inner = marker.appendChild(document.createElement("div"));
- inner.className = "CodeMirror-lint-marker-multiple";
- }
-
- if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) {
- showTooltipFor(e, labels, inner);
- });
-
- return marker;
- }
-
- function getMaxSeverity(a, b) {
- if (a == "error") return a;
- else return b;
- }
-
- function groupByLine(annotations) {
- var lines = [];
- for (var i = 0; i < annotations.length; ++i) {
- var ann = annotations[i], line = ann.from.line;
- (lines[line] || (lines[line] = [])).push(ann);
- }
- return lines;
- }
-
- function annotationTooltip(ann) {
- var severity = ann.severity;
- if (!severity) severity = "error";
- var tip = document.createElement("div");
- tip.className = "CodeMirror-lint-message-" + severity;
- tip.appendChild(document.createTextNode(ann.message));
- return tip;
- }
-
- function startLinting(cm) {
- var state = cm.state.lint, options = state.options;
- var passOptions = options.options || options; // Support deprecated passing of `options` property in options
- 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, getAnnotations(cm.getValue(), passOptions, cm));
- }
-
- function updateLinting(cm, annotationsNotSorted) {
- clearMarks(cm);
- var state = cm.state.lint, options = state.options;
-
- var annotations = groupByLine(annotationsNotSorted);
-
- for (var line = 0; line < annotations.length; ++line) {
- var anns = annotations[line];
- if (!anns) continue;
-
- var maxSeverity = null;
- var tipLabel = state.hasGutter && document.createDocumentFragment();
-
- for (var i = 0; i < anns.length; ++i) {
- var ann = anns[i];
- var severity = ann.severity;
- if (!severity) severity = "error";
- maxSeverity = getMaxSeverity(maxSeverity, severity);
-
- if (options.formatAnnotation) ann = options.formatAnnotation(ann);
- if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));
-
- if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {
- className: "CodeMirror-lint-mark-" + severity,
- __annotation: ann
- }));
- }
-
- if (state.hasGutter)
- cm.setGutterMarker(line, GUTTER_ID, makeMarker(tipLabel, maxSeverity, anns.length > 1,
- state.options.tooltips));
- }
- if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);
- }
-
- function onChange(cm) {
- var state = cm.state.lint;
- if (!state) return;
- clearTimeout(state.timeout);
- state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);
- }
-
- function popupSpanTooltip(ann, e) {
- var target = e.target || e.srcElement;
- showTooltipFor(e, annotationTooltip(ann), target);
- }
-
- function onMouseOver(cm, e) {
- var target = e.target || e.srcElement;
- if (!/\bCodeMirror-lint-mark-/.test(target.className)) return;
- var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2;
- var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client"));
- for (var i = 0; i < spans.length; ++i) {
- var ann = spans[i].__annotation;
- if (ann) return popupSpanTooltip(ann, e);
- }
- }
-
- CodeMirror.defineOption("lint", false, function(cm, val, old) {
- if (old && old != CodeMirror.Init) {
- clearMarks(cm);
- cm.off("change", onChange);
- CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
- clearTimeout(cm.state.lint.timeout);
- delete cm.state.lint;
- }
-
- if (val) {
- var gutters = cm.getOption("gutters"), hasLintGutter = false;
- for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
- var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter);
- cm.on("change", onChange);
- if (state.options.tooltips != false)
- CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
-
- startLinting(cm);
- }
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/yaml-lint.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/yaml-lint.js
deleted file mode 100644
index 3f77e52..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/lint/yaml-lint.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// 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";
-
-// Depends on js-yaml.js from https://github.com/nodeca/js-yaml
-
-// declare global: jsyaml
-
-CodeMirror.registerHelper("lint", "yaml", function(text) {
- var found = [];
- try { jsyaml.load(text); }
- catch(e) {
- var loc = e.mark;
- found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message });
- }
- return found;
-});
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.css
deleted file mode 100644
index a6a80e4..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.css
+++ /dev/null
@@ -1,112 +0,0 @@
-.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: 0px;
- 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; }
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.js
deleted file mode 100644
index 5b04b03..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/merge/merge.js
+++ /dev/null
@@ -1,775 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// declare global: diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"), require("diff_match_patch"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror", "diff_match_patch"], mod);
- else // Plain browser env
- mod(CodeMirror, diff_match_patch);
-})(function(CodeMirror, diff_match_patch) {
- "use strict";
- var Pos = CodeMirror.Pos;
- var svgNS = "http://www.w3.org/2000/svg";
-
- function DiffView(mv, type) {
- this.mv = mv;
- this.type = type;
- this.classes = type == "left"
- ? {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"};
- }
-
- DiffView.prototype = {
- constructor: DiffView,
- init: function(pane, orig, options) {
- this.edit = this.mv.edit;
- (this.edit.state.diffViews || (this.edit.state.diffViews = [])).push(this);
- this.orig = CodeMirror(pane, copyObj({value: orig, readOnly: !this.mv.options.allowEditingOriginals}, copyObj(options)));
- this.orig.state.diffViews = [this];
-
- this.diff = getDiff(asString(orig), asString(options.value));
- this.chunks = getChunks(this.diff);
- this.diffOutOfDate = this.dealigned = false;
-
- this.showDifferences = options.showDifferences !== false;
- this.forceUpdate = registerUpdate(this);
- setScrollLock(this, true, false);
- registerScroll(this);
- },
- setShowDifferences: function(val) {
- val = val !== false;
- if (val != this.showDifferences) {
- this.showDifferences = val;
- this.forceUpdate("full");
- }
- }
- };
-
- function ensureDiff(dv) {
- if (dv.diffOutOfDate) {
- dv.diff = getDiff(dv.orig.getValue(), dv.edit.getValue());
- dv.chunks = getChunks(dv.diff);
- dv.diffOutOfDate = false;
- CodeMirror.signal(dv.edit, "updateDiff", dv.diff);
- }
- }
-
- var updating = false;
- function registerUpdate(dv) {
- var edit = {from: 0, to: 0, marked: []};
- var orig = {from: 0, to: 0, marked: []};
- var debounceChange, updatingFast = false;
- function update(mode) {
- updating = true;
- updatingFast = false;
- if (mode == "full") {
- if (dv.svg) clear(dv.svg);
- if (dv.copyButtons) clear(dv.copyButtons);
- clearMarks(dv.edit, edit.marked, dv.classes);
- clearMarks(dv.orig, orig.marked, dv.classes);
- edit.from = edit.to = orig.from = orig.to = 0;
- }
- ensureDiff(dv);
- if (dv.showDifferences) {
- updateMarks(dv.edit, dv.diff, edit, DIFF_INSERT, dv.classes);
- updateMarks(dv.orig, dv.diff, orig, DIFF_DELETE, dv.classes);
- }
- makeConnections(dv);
-
- if (dv.mv.options.connect == "align")
- alignChunks(dv);
- updating = false;
- }
- function setDealign(fast) {
- if (updating) return;
- dv.dealigned = true;
- set(fast);
- }
- function set(fast) {
- if (updating || updatingFast) return;
- clearTimeout(debounceChange);
- if (fast === true) updatingFast = true;
- debounceChange = setTimeout(update, fast === true ? 20 : 250);
- }
- function change(_cm, change) {
- if (!dv.diffOutOfDate) {
- dv.diffOutOfDate = true;
- edit.from = edit.to = orig.from = orig.to = 0;
- }
- // Update faster when a line was added/removed
- setDealign(change.text.length - 1 != change.to.line - change.from.line);
- }
- dv.edit.on("change", change);
- dv.orig.on("change", change);
- dv.edit.on("markerAdded", setDealign);
- dv.edit.on("markerCleared", setDealign);
- dv.orig.on("markerAdded", setDealign);
- dv.orig.on("markerCleared", setDealign);
- dv.edit.on("viewportChange", function() { set(false); });
- dv.orig.on("viewportChange", function() { set(false); });
- update();
- return update;
- }
-
- function registerScroll(dv) {
- dv.edit.on("scroll", function() {
- syncScroll(dv, DIFF_INSERT) && makeConnections(dv);
- });
- dv.orig.on("scroll", function() {
- syncScroll(dv, DIFF_DELETE) && makeConnections(dv);
- });
- }
-
- function syncScroll(dv, type) {
- // Change handler will do a refresh after a timeout when diff is out of date
- if (dv.diffOutOfDate) return false;
- if (!dv.lockScroll) return true;
- var editor, other, now = +new Date;
- if (type == DIFF_INSERT) { editor = dv.edit; other = dv.orig; }
- else { editor = dv.orig; other = dv.edit; }
- // Don't take action if the position of this editor was recently set
- // (to prevent feedback loops)
- if (editor.state.scrollSetBy == dv && (editor.state.scrollSetAt || 0) + 50 > now) return false;
-
- var sInfo = editor.getScrollInfo();
- if (dv.mv.options.connect == "align") {
- targetPos = sInfo.top;
- } else {
- var halfScreen = .5 * sInfo.clientHeight, midY = sInfo.top + halfScreen;
- var mid = editor.lineAtHeight(midY, "local");
- var around = chunkBoundariesAround(dv.chunks, mid, type == DIFF_INSERT);
- var off = getOffsets(editor, type == DIFF_INSERT ? around.edit : around.orig);
- var offOther = getOffsets(other, type == DIFF_INSERT ? around.orig : around.edit);
- var ratio = (midY - off.top) / (off.bot - off.top);
- var targetPos = (offOther.top - halfScreen) + ratio * (offOther.bot - offOther.top);
-
- var botDist, mix;
- // Some careful tweaking to make sure no space is left out of view
- // when scrolling to top or bottom.
- if (targetPos > sInfo.top && (mix = sInfo.top / halfScreen) < 1) {
- targetPos = targetPos * mix + sInfo.top * (1 - mix);
- } else if ((botDist = sInfo.height - sInfo.clientHeight - sInfo.top) < halfScreen) {
- var otherInfo = other.getScrollInfo();
- var botDistOther = otherInfo.height - otherInfo.clientHeight - targetPos;
- if (botDistOther > botDist && (mix = botDist / halfScreen) < 1)
- targetPos = targetPos * mix + (otherInfo.height - otherInfo.clientHeight - botDist) * (1 - mix);
- }
- }
-
- other.scrollTo(sInfo.left, targetPos);
- other.state.scrollSetAt = now;
- other.state.scrollSetBy = dv;
- return true;
- }
-
- function getOffsets(editor, around) {
- var bot = around.after;
- if (bot == null) bot = editor.lastLine() + 1;
- return {top: editor.heightAtLine(around.before || 0, "local"),
- bot: editor.heightAtLine(bot, "local")};
- }
-
- function setScrollLock(dv, val, action) {
- dv.lockScroll = val;
- if (val && action != false) syncScroll(dv, DIFF_INSERT) && makeConnections(dv);
- dv.lockButton.innerHTML = val ? "\u21db\u21da" : "\u21db \u21da";
- }
-
- // Updating the marks for editor content
-
- function clearMarks(editor, arr, classes) {
- for (var i = 0; i < arr.length; ++i) {
- var mark = arr[i];
- if (mark instanceof CodeMirror.TextMarker) {
- mark.clear();
- } else if (mark.parent) {
- editor.removeLineClass(mark, "background", classes.chunk);
- editor.removeLineClass(mark, "background", classes.start);
- editor.removeLineClass(mark, "background", classes.end);
- }
- }
- arr.length = 0;
- }
-
- // FIXME maybe add a margin around viewport to prevent too many updates
- function updateMarks(editor, diff, state, type, classes) {
- var vp = editor.getViewport();
- editor.operation(function() {
- if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
- clearMarks(editor, state.marked, classes);
- markChanges(editor, diff, type, state.marked, vp.from, vp.to, classes);
- state.from = vp.from; state.to = vp.to;
- } else {
- if (vp.from < state.from) {
- markChanges(editor, diff, type, state.marked, vp.from, state.from, classes);
- state.from = vp.from;
- }
- if (vp.to > state.to) {
- markChanges(editor, diff, type, state.marked, state.to, vp.to, classes);
- state.to = vp.to;
- }
- }
- });
- }
-
- function markChanges(editor, diff, type, marks, from, to, classes) {
- var pos = Pos(0, 0);
- var top = Pos(from, 0), bot = editor.clipPos(Pos(to - 1));
- var cls = type == DIFF_DELETE ? classes.del : classes.insert;
- function markChunk(start, end) {
- var bfrom = Math.max(from, start), bto = Math.min(to, end);
- for (var i = bfrom; i < bto; ++i) {
- var line = editor.addLineClass(i, "background", classes.chunk);
- if (i == start) editor.addLineClass(line, "background", classes.start);
- if (i == end - 1) editor.addLineClass(line, "background", classes.end);
- marks.push(line);
- }
- // When the chunk is empty, make sure a horizontal line shows up
- if (start == end && bfrom == end && bto == end) {
- if (bfrom)
- marks.push(editor.addLineClass(bfrom - 1, "background", classes.end));
- else
- marks.push(editor.addLineClass(bfrom, "background", classes.start));
- }
- }
-
- var chunkStart = 0;
- for (var i = 0; i < diff.length; ++i) {
- var part = diff[i], tp = part[0], str = part[1];
- if (tp == DIFF_EQUAL) {
- var cleanFrom = pos.line + (startOfLineClean(diff, i) ? 0 : 1);
- moveOver(pos, str);
- var cleanTo = pos.line + (endOfLineClean(diff, i) ? 1 : 0);
- if (cleanTo > cleanFrom) {
- if (i) markChunk(chunkStart, cleanFrom);
- chunkStart = cleanTo;
- }
- } else {
- if (tp == type) {
- var end = moveOver(pos, str, true);
- var a = posMax(top, pos), b = posMin(bot, end);
- if (!posEq(a, b))
- marks.push(editor.markText(a, b, {className: cls}));
- pos = end;
- }
- }
- }
- if (chunkStart <= pos.line) markChunk(chunkStart, pos.line + 1);
- }
-
- // Updating the gap between editor and original
-
- function makeConnections(dv) {
- if (!dv.showDifferences) return;
-
- if (dv.svg) {
- clear(dv.svg);
- var w = dv.gap.offsetWidth;
- attrs(dv.svg, "width", w, "height", dv.gap.offsetHeight);
- }
- if (dv.copyButtons) clear(dv.copyButtons);
-
- var vpEdit = dv.edit.getViewport(), vpOrig = dv.orig.getViewport();
- var sTopEdit = dv.edit.getScrollInfo().top, sTopOrig = dv.orig.getScrollInfo().top;
- 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);
- });
-
- 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 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(chunk.origFrom, "local") - sTopOrig;
- if (dv.svg) {
- var topLpx = top;
- var topRpx = dv.edit.heightAtLine(chunk.editFrom, "local") - sTopEdit;
- if (flip) { var tmp = topLpx; topLpx = topRpx; topRpx = tmp; }
- 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;
- attrs(dv.svg.appendChild(document.createElementNS(svgNS, "path")),
- "d", "M -1 " + topRpx + curveTop + " L " + (w + 2) + " " + botLpx + curveBot + " z",
- "class", dv.classes.connect);
- }
- if (dv.copyButtons) {
- var copy = dv.copyButtons.appendChild(elt("div", dv.type == "left" ? "\u21dd" : "\u21dc",
- "CodeMirror-merge-copy"));
- var editOriginals = dv.mv.options.allowEditingOriginals;
- copy.title = editOriginals ? "Push to left" : "Revert chunk";
- copy.chunk = chunk;
- copy.style.top = top + "px";
-
- if (editOriginals) {
- 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 = {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 copyChunk(dv, to, from, chunk) {
- if (dv.diffOutOfDate) return;
- 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.
-
- var MergeView = CodeMirror.MergeView = function(node, options) {
- if (!(this instanceof MergeView)) return new MergeView(node, options);
-
- this.options = options;
- var origLeft = options.origLeft, origRight = options.origRight == null ? options.orig : options.origRight;
-
- 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");
- var leftPane = elt("div", null, "CodeMirror-merge-pane");
- wrap.push(leftPane);
- wrap.push(buildGap(left));
- }
-
- var editPane = elt("div", null, "CodeMirror-merge-pane");
- wrap.push(editPane);
-
- if (hasRight) {
- right = this.right = new DiffView(this, "right");
- wrap.push(buildGap(right));
- var rightPane = elt("div", null, "CodeMirror-merge-pane");
- wrap.push(rightPane);
- }
-
- (hasRight ? rightPane : editPane).className += " CodeMirror-merge-pane-rightmost";
-
- wrap.push(elt("div", null, null, "height: 0; clear: both;"));
-
- var wrapElt = this.wrap = node.appendChild(elt("div", wrap, "CodeMirror-merge CodeMirror-merge-" + panes + "pane"));
- this.edit = CodeMirror(editPane, copyObj(options));
-
- if (left) left.init(leftPane, origLeft, options);
- if (right) right.init(rightPane, origRight, options);
-
- 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);
- if (right) makeConnections(right);
- };
- CodeMirror.on(window, "resize", onResize);
- var resizeInterval = setInterval(function() {
- for (var p = wrapElt.parentNode; p && p != document.body; p = p.parentNode) {}
- if (!p) { clearInterval(resizeInterval); CodeMirror.off(window, "resize", onResize); }
- }, 5000);
- };
-
- function buildGap(dv) {
- var lock = dv.lockButton = elt("div", null, "CodeMirror-merge-scrolllock");
- lock.title = "Toggle locked scrolling";
- var lockWrap = elt("div", [lock], "CodeMirror-merge-scrolllock-wrap");
- CodeMirror.on(lock, "click", function() { setScrollLock(dv, !dv.lockScroll); });
- var gapElts = [lockWrap];
- if (dv.mv.options.revertButtons !== false) {
- dv.copyButtons = elt("div", null, "CodeMirror-merge-copybuttons-" + dv.type);
- CodeMirror.on(dv.copyButtons, "click", function(e) {
- var node = e.target || e.srcElement;
- if (!node.chunk) return;
- if (node.className == "CodeMirror-merge-copy-reverse") {
- copyChunk(dv, dv.orig, dv.edit, node.chunk);
- return;
- }
- copyChunk(dv, dv.edit, dv.orig, node.chunk);
- });
- gapElts.unshift(dv.copyButtons);
- }
- if (dv.mv.options.connect != "align") {
- var svg = document.createElementNS && document.createElementNS(svgNS, "svg");
- if (svg && !svg.createSVGRect) svg = null;
- dv.svg = svg;
- if (svg) gapElts.push(svg);
- }
-
- return dv.gap = elt("div", gapElts, "CodeMirror-merge-gap");
- }
-
- MergeView.prototype = {
- constuctor: MergeView,
- editor: function() { return this.edit; },
- rightOriginal: function() { return this.right && this.right.orig; },
- leftOriginal: function() { return this.left && this.left.orig; },
- setShowDifferences: function(val) {
- if (this.right) this.right.setShowDifferences(val);
- if (this.left) this.left.setShowDifferences(val);
- },
- rightChunks: function() {
- if (this.right) { ensureDiff(this.right); return this.right.chunks; }
- },
- leftChunks: function() {
- if (this.left) { ensureDiff(this.left); return this.left.chunks; }
- }
- };
-
- function asString(obj) {
- if (typeof obj == "string") return obj;
- else return obj.getValue();
- }
-
- // Operations on diffs
-
- var dmp = new diff_match_patch();
- function getDiff(a, b) {
- var diff = dmp.diff_main(a, b);
- dmp.diff_cleanupSemantic(diff);
- // The library sometimes leaves in empty parts, which confuse the algorithm
- for (var i = 0; i < diff.length; ++i) {
- var part = diff[i];
- if (!part[1]) {
- diff.splice(i--, 1);
- } else if (i && diff[i - 1][0] == part[0]) {
- diff.splice(i--, 1);
- diff[i][1] += part[1];
- }
- }
- return diff;
- }
-
- 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) {
- var part = diff[i], tp = part[0];
- if (tp == DIFF_EQUAL) {
- var startOff = startOfLineClean(diff, i) ? 0 : 1;
- var cleanFromEdit = edit.line + startOff, cleanFromOrig = orig.line + startOff;
- moveOver(edit, part[1], null, orig);
- var endOff = endOfLineClean(diff, i) ? 1 : 0;
- var cleanToEdit = edit.line + endOff, cleanToOrig = orig.line + endOff;
- if (cleanToEdit > cleanFromEdit) {
- if (i) chunks.push({origFrom: startOrig, origTo: cleanFromOrig,
- editFrom: startEdit, editTo: cleanFromEdit});
- startEdit = cleanToEdit; startOrig = cleanToOrig;
- }
- } else {
- moveOver(tp == DIFF_INSERT ? edit : orig, part[1]);
- }
- }
- if (startEdit <= edit.line || startOrig <= orig.line)
- chunks.push({origFrom: startOrig, origTo: orig.line + 1,
- editFrom: startEdit, editTo: edit.line + 1});
- return chunks;
- }
-
- function endOfLineClean(diff, i) {
- if (i == diff.length - 1) return true;
- var next = diff[i + 1][1];
- if (next.length == 1 || next.charCodeAt(0) != 10) return false;
- if (i == diff.length - 2) return true;
- next = diff[i + 2][1];
- return next.length > 1 && next.charCodeAt(0) == 10;
- }
-
- function startOfLineClean(diff, i) {
- if (i == 0) return true;
- var last = diff[i - 1][1];
- if (last.charCodeAt(last.length - 1) != 10) return false;
- if (i == 1) return true;
- last = diff[i - 2][1];
- return last.charCodeAt(last.length - 1) == 10;
- }
-
- function chunkBoundariesAround(chunks, n, nInEdit) {
- var beforeE, afterE, beforeO, afterO;
- 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 = chunk.editFrom; afterO = chunk.origFrom; }
- else if (toLocal > n) { afterE = chunk.editTo; afterO = chunk.origTo; }
- }
- 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}};
- }
-
- function collapseSingle(cm, from, to) {
- cm.addLineClass(from, "wrap", "CodeMirror-merge-collapsed-line");
- var widget = document.createElement("span");
- widget.className = "CodeMirror-merge-collapsed-widget";
- widget.title = "Identical text collapsed. Click to expand.";
- var mark = cm.markText(Pos(from, 0), Pos(to - 1), {
- inclusiveLeft: true,
- inclusiveRight: true,
- replacedWith: widget,
- clearOnEnter: true
- });
- function clear() {
- mark.clear();
- cm.removeLineClass(from, "wrap", "CodeMirror-merge-collapsed-line");
- }
- widget.addEventListener("click", clear);
- return {mark: mark, clear: 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(mv, margin) {
- if (typeof margin != "number") margin = 2;
- 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
-
- 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;
- }
-
- function clear(node) {
- for (var count = node.childNodes.length; count > 0; --count)
- node.removeChild(node.firstChild);
- }
-
- function attrs(elt) {
- for (var i = 1; i < arguments.length; i += 2)
- elt.setAttribute(arguments[i], arguments[i+1]);
- }
-
- function copyObj(obj, target) {
- if (!target) target = {};
- for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop];
- return target;
- }
-
- function moveOver(pos, str, copy, other) {
- var out = copy ? Pos(pos.line, pos.ch) : pos, at = 0;
- for (;;) {
- var nl = str.indexOf("\n", at);
- if (nl == -1) break;
- ++out.line;
- if (other) ++other.line;
- at = nl + 1;
- }
- out.ch = (at ? 0 : out.ch) + (str.length - at);
- if (other) other.ch = (at ? 0 : other.ch) + (str.length - at);
- return out;
- }
-
- function posMin(a, b) { return (a.line - b.line || a.ch - b.ch) < 0 ? a : b; }
- function posMax(a, b) { return (a.line - b.line || a.ch - b.ch) > 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/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/loadmode.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/loadmode.js
deleted file mode 100644
index 10117ec..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/loadmode.js
+++ /dev/null
@@ -1,64 +0,0 @@
-// 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"));
- });
- };
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex.js
deleted file mode 100644
index fe48c7f..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex.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(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);
-
- 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 + (returnEnd ? m[0].length : 0) : -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 < others.length; ++i) {
- var other = others[i];
- var found = indexOf(oldContent, other.open, stream.pos);
- if (found == stream.pos) {
- if (!other.parseDelimiters) stream.match(other.open);
- state.innerActive = other;
- state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0);
- 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, curInner.parseDelimiters) : -1;
- if (found == stream.pos && !curInner.parseDelimiters) {
- 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 (found == stream.pos && curInner.parseDelimiters)
- state.innerActive = state.inner = null;
-
- 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 < others.length; ++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};
- }
- };
-};
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex_test.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex_test.js
deleted file mode 100644
index d339434..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/multiplex_test.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function() {
- CodeMirror.defineMode("markdown_with_stex", function(){
- var inner = CodeMirror.getMode({}, "stex");
- var outer = CodeMirror.getMode({}, "markdown");
-
- var innerOptions = {
- open: '$',
- close: '$',
- mode: inner,
- delimStyle: 'delim',
- innerStyle: 'inner'
- };
-
- return CodeMirror.multiplexingMode(outer, innerOptions);
- });
-
- var mode = CodeMirror.getMode({}, "markdown_with_stex");
-
- function MT(name) {
- test.mode(
- name,
- mode,
- Array.prototype.slice.call(arguments, 1),
- 'multiplexing');
- }
-
- MT(
- "stexInsideMarkdown",
- "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]");
-})();
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/overlay.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/overlay.js
deleted file mode 100644
index e1b9ed3..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/overlay.js
+++ /dev/null
@@ -1,85 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Utility function that allows modes to be combined. The mode given
-// as the base argument takes care of most of the normal mode
-// functionality, but a second (typically simple) mode is used, which
-// can override the style of text. Both modes get to parse all of the
-// text, but when both assign a non-null style to a piece of code, the
-// overlay wins, unless the combine argument was true and not overridden,
-// or state.overlay.combineTokens was true, in which case the styles are
-// combined.
-
-(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.overlayMode = function(base, overlay, combine) {
- return {
- startState: function() {
- return {
- base: CodeMirror.startState(base),
- overlay: CodeMirror.startState(overlay),
- basePos: 0, baseCur: null,
- overlayPos: 0, overlayCur: null,
- streamSeen: null
- };
- },
- copyState: function(state) {
- return {
- base: CodeMirror.copyState(base, state.base),
- overlay: CodeMirror.copyState(overlay, state.overlay),
- basePos: state.basePos, baseCur: null,
- overlayPos: state.overlayPos, overlayCur: null
- };
- },
-
- token: function(stream, state) {
- if (stream != state.streamSeen ||
- Math.min(state.basePos, state.overlayPos) < stream.start) {
- state.streamSeen = stream;
- state.basePos = state.overlayPos = stream.start;
- }
-
- if (stream.start == state.basePos) {
- state.baseCur = base.token(stream, state.base);
- state.basePos = stream.pos;
- }
- if (stream.start == state.overlayPos) {
- stream.pos = stream.start;
- state.overlayCur = overlay.token(stream, state.overlay);
- state.overlayPos = stream.pos;
- }
- stream.pos = Math.min(state.basePos, state.overlayPos);
-
- // state.overlay.combineTokens always takes precedence over combine,
- // unless set to null
- if (state.overlayCur == null) return state.baseCur;
- else if (state.baseCur != null &&
- state.overlay.combineTokens ||
- combine && state.overlay.combineTokens == null)
- return state.baseCur + " " + state.overlayCur;
- else return state.overlayCur;
- },
-
- indent: base.indent && function(state, textAfter) {
- return base.indent(state.base, textAfter);
- },
- electricChars: base.electricChars,
-
- innerMode: function(state) { return {state: state.base, mode: base}; },
-
- blankLine: function(state) {
- if (base.blankLine) base.blankLine(state.base);
- if (overlay.blankLine) overlay.blankLine(state.overlay);
- }
- };
-};
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/simple.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/simple.js
deleted file mode 100644
index 795328b..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/mode/simple.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(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.defineSimpleMode = function(name, states) {
- CodeMirror.defineMode(name, function(config) {
- return CodeMirror.simpleMode(config, states);
- });
- };
-
- CodeMirror.simpleMode = function(config, states) {
- ensureState(states, "start");
- var states_ = {}, meta = states.meta || {}, hasIndentation = false;
- for (var state in states) if (state != meta && states.hasOwnProperty(state)) {
- var list = states_[state] = [], orig = states[state];
- for (var i = 0; i < orig.length; i++) {
- var data = orig[i];
- list.push(new Rule(data, states));
- if (data.indent || data.dedent) hasIndentation = true;
- }
- }
- var mode = {
- startState: function() {
- return {state: "start", pending: null,
- local: null, localState: null,
- indent: hasIndentation ? [] : null};
- },
- copyState: function(state) {
- var s = {state: state.state, pending: state.pending,
- local: state.local, localState: null,
- indent: state.indent && state.indent.slice(0)};
- if (state.localState)
- s.localState = CodeMirror.copyState(state.local.mode, state.localState);
- if (state.stack)
- s.stack = state.stack.slice(0);
- for (var pers = state.persistentStates; pers; pers = pers.next)
- s.persistentStates = {mode: pers.mode,
- spec: pers.spec,
- state: pers.state == state.localState ? s.localState : CodeMirror.copyState(pers.mode, pers.state),
- next: s.persistentStates};
- return s;
- },
- token: tokenFunction(states_, config),
- innerMode: function(state) { return state.local && {mode: state.local.mode, state: state.localState}; },
- indent: indentFunction(states_, meta)
- };
- if (meta) for (var prop in meta) if (meta.hasOwnProperty(prop))
- mode[prop] = meta[prop];
- return mode;
- };
-
- function ensureState(states, name) {
- if (!states.hasOwnProperty(name))
- throw new Error("Undefined state " + name + "in simple mode");
- }
-
- function toRegex(val, caret) {
- if (!val) return /(?:)/;
- var flags = "";
- if (val instanceof RegExp) {
- if (val.ignoreCase) flags = "i";
- val = val.source;
- } else {
- val = String(val);
- }
- return new RegExp((caret === false ? "" : "^") + "(?:" + val + ")", flags);
- }
-
- function asToken(val) {
- if (!val) return null;
- if (typeof val == "string") return val.replace(/\./g, " ");
- var result = [];
- for (var i = 0; i < val.length; i++)
- result.push(val[i] && val[i].replace(/\./g, " "));
- return result;
- }
-
- function Rule(data, states) {
- if (data.next || data.push) ensureState(states, data.next || data.push);
- this.regex = toRegex(data.regex);
- this.token = asToken(data.token);
- this.data = data;
- }
-
- function tokenFunction(states, config) {
- return function(stream, state) {
- if (state.pending) {
- var pend = state.pending.shift();
- if (state.pending.length == 0) state.pending = null;
- stream.pos += pend.text.length;
- return pend.token;
- }
-
- if (state.local) {
- if (state.local.end && stream.match(state.local.end)) {
- var tok = state.local.endToken || null;
- state.local = state.localState = null;
- return tok;
- } else {
- var tok = state.local.mode.token(stream, state.localState), m;
- if (state.local.endScan && (m = state.local.endScan.exec(stream.current())))
- stream.pos = stream.start + m.index;
- return tok;
- }
- }
-
- var curState = states[state.state];
- for (var i = 0; i < curState.length; i++) {
- var rule = curState[i];
- var matches = (!rule.data.sol || stream.sol()) && stream.match(rule.regex);
- if (matches) {
- if (rule.data.next) {
- state.state = rule.data.next;
- } else if (rule.data.push) {
- (state.stack || (state.stack = [])).push(state.state);
- state.state = rule.data.push;
- } else if (rule.data.pop && state.stack && state.stack.length) {
- state.state = state.stack.pop();
- }
-
- if (rule.data.mode)
- enterLocalMode(config, state, rule.data.mode, rule.token);
- if (rule.data.indent)
- state.indent.push(stream.indentation() + config.indentUnit);
- if (rule.data.dedent)
- state.indent.pop();
- if (matches.length > 2) {
- state.pending = [];
- for (var j = 2; j < matches.length; j++)
- if (matches[j])
- state.pending.push({text: matches[j], token: rule.token[j - 1]});
- stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0));
- return rule.token[0];
- } else if (rule.token && rule.token.join) {
- return rule.token[0];
- } else {
- return rule.token;
- }
- }
- }
- stream.next();
- return null;
- };
- }
-
- function cmp(a, b) {
- if (a === b) return true;
- if (!a || typeof a != "object" || !b || typeof b != "object") return false;
- var props = 0;
- for (var prop in a) if (a.hasOwnProperty(prop)) {
- if (!b.hasOwnProperty(prop) || !cmp(a[prop], b[prop])) return false;
- props++;
- }
- for (var prop in b) if (b.hasOwnProperty(prop)) props--;
- return props == 0;
- }
-
- function enterLocalMode(config, state, spec, token) {
- var pers;
- if (spec.persistent) for (var p = state.persistentStates; p && !pers; p = p.next)
- if (spec.spec ? cmp(spec.spec, p.spec) : spec.mode == p.mode) pers = p;
- var mode = pers ? pers.mode : spec.mode || CodeMirror.getMode(config, spec.spec);
- var lState = pers ? pers.state : CodeMirror.startState(mode);
- if (spec.persistent && !pers)
- state.persistentStates = {mode: mode, spec: spec.spec, state: lState, next: state.persistentStates};
-
- state.localState = lState;
- state.local = {mode: mode,
- end: spec.end && toRegex(spec.end),
- endScan: spec.end && spec.forceEnd !== false && toRegex(spec.end, false),
- endToken: token && token.join ? token[token.length - 1] : token};
- }
-
- function indexOf(val, arr) {
- for (var i = 0; i < arr.length; i++) if (arr[i] === val) return true;
- }
-
- function indentFunction(states, meta) {
- return function(state, textAfter, line) {
- if (state.local && state.local.mode.indent)
- return state.local.mode.indent(state.localState, textAfter, line);
- if (state.indent == null || state.local || meta.dontIndentStates && indexOf(state.state, meta.dontIndentStates) > -1)
- return CodeMirror.Pass;
-
- var pos = state.indent.length - 1, rules = states[state.state];
- scan: for (;;) {
- for (var i = 0; i < rules.length; i++) {
- var rule = rules[i];
- if (rule.data.dedent && rule.data.dedentIfLineStart !== false) {
- var m = rule.regex.exec(textAfter);
- if (m && m[0]) {
- pos--;
- if (rule.next || rule.push) rules = states[rule.next || rule.push];
- textAfter = textAfter.slice(m[0].length);
- continue scan;
- }
- }
- }
- break;
- }
- return pos < 0 ? 0 : state.indent[pos];
- };
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/colorize.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/colorize.js
deleted file mode 100644
index eb7060d..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/colorize.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// 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("./runmode"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror", "./runmode"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
- "use strict";
-
- var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/;
-
- function textContent(node, out) {
- if (node.nodeType == 3) return out.push(node.nodeValue);
- for (var ch = node.firstChild; ch; ch = ch.nextSibling) {
- textContent(ch, out);
- if (isBlock.test(node.nodeType)) out.push("\n");
- }
- }
-
- CodeMirror.colorize = function(collection, defaultMode) {
- if (!collection) collection = document.body.getElementsByTagName("pre");
-
- for (var i = 0; i < collection.length; ++i) {
- var node = collection[i];
- var mode = node.getAttribute("data-lang") || defaultMode;
- if (!mode) continue;
-
- var text = [];
- textContent(node, text);
- node.innerHTML = "";
- CodeMirror.runMode(text.join(""), mode, node);
-
- node.className += " cm-s-default";
- }
- };
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode-standalone.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode-standalone.js
deleted file mode 100644
index f4f352c..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode-standalone.js
+++ /dev/null
@@ -1,157 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-window.CodeMirror = {};
-
-(function() {
-"use strict";
-
-function splitLines(string){ return string.split(/\r?\n|\r/); };
-
-function StringStream(string) {
- this.pos = this.start = 0;
- this.string = string;
- this.lineStart = 0;
-}
-StringStream.prototype = {
- eol: function() {return this.pos >= this.string.length;},
- sol: function() {return this.pos == 0;},
- peek: function() {return this.string.charAt(this.pos) || null;},
- 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() {return this.start - this.lineStart;},
- indentation: function() {return 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; }
- }
-};
-CodeMirror.StringStream = StringStream;
-
-CodeMirror.startState = function (mode, a1, a2) {
- return mode.startState ? mode.startState(a1, a2) : true;
-};
-
-var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};
-CodeMirror.defineMode = function (name, mode) {
- if (arguments.length > 2)
- mode.dependencies = Array.prototype.slice.call(arguments, 2);
- modes[name] = mode;
-};
-CodeMirror.defineMIME = function (mime, spec) { mimeModes[mime] = spec; };
-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)) {
- spec = mimeModes[spec.name];
- }
- if (typeof spec == "string") return {name: spec};
- else return spec || {name: "null"};
-};
-CodeMirror.getMode = function (options, spec) {
- spec = CodeMirror.resolveMode(spec);
- var mfactory = modes[spec.name];
- if (!mfactory) throw new Error("Unknown mode: " + spec);
- return mfactory(options, spec);
-};
-CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min;
-CodeMirror.defineMode("null", function() {
- return {token: function(stream) {stream.skipToEnd();}};
-});
-CodeMirror.defineMIME("text/plain", "null");
-
-CodeMirror.runMode = function (string, modespec, callback, options) {
- var mode = CodeMirror.getMode({ indentUnit: 2 }, modespec);
-
- if (callback.nodeType == 1) {
- var tabSize = (options && options.tabSize) || 4;
- var node = callback, col = 0;
- node.innerHTML = "";
- callback = function (text, style) {
- if (text == "\n") {
- node.appendChild(document.createElement("br"));
- col = 0;
- return;
- }
- var content = "";
- // replace tabs
- for (var pos = 0; ;) {
- var idx = text.indexOf("\t", pos);
- if (idx == -1) {
- content += text.slice(pos);
- col += text.length - pos;
- break;
- } else {
- col += idx - pos;
- content += text.slice(pos, idx);
- var size = tabSize - col % tabSize;
- col += size;
- for (var i = 0; i < size; ++i) content += " ";
- pos = idx + 1;
- }
- }
-
- if (style) {
- var sp = node.appendChild(document.createElement("span"));
- sp.className = "cm-" + style.replace(/ +/g, " cm-");
- sp.appendChild(document.createTextNode(content));
- } else {
- node.appendChild(document.createTextNode(content));
- }
- };
- }
-
- var lines = splitLines(string), state = (options && options.state) || CodeMirror.startState(mode);
- for (var i = 0, e = lines.length; i < e; ++i) {
- if (i) callback("\n");
- var stream = new CodeMirror.StringStream(lines[i]);
- if (!stream.string && mode.blankLine) mode.blankLine(state);
- while (!stream.eol()) {
- var style = mode.token(stream, state);
- callback(stream.current(), style, i, stream.start, state);
- stream.start = stream.pos;
- }
- }
-};
-})();
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.js
deleted file mode 100644
index 07d2279..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.js
+++ /dev/null
@@ -1,72 +0,0 @@
-// 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.runMode = function(string, modespec, callback, options) {
- var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
- var ie = /MSIE \d/.test(navigator.userAgent);
- var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
-
- if (callback.nodeType == 1) {
- var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
- var node = callback, col = 0;
- node.innerHTML = "";
- callback = function(text, style) {
- if (text == "\n") {
- // Emitting LF or CRLF on IE8 or earlier results in an incorrect display.
- // Emitting a carriage return makes everything ok.
- node.appendChild(document.createTextNode(ie_lt9 ? '\r' : text));
- col = 0;
- return;
- }
- var content = "";
- // replace tabs
- for (var pos = 0;;) {
- var idx = text.indexOf("\t", pos);
- if (idx == -1) {
- content += text.slice(pos);
- col += text.length - pos;
- break;
- } else {
- col += idx - pos;
- content += text.slice(pos, idx);
- var size = tabSize - col % tabSize;
- col += size;
- for (var i = 0; i < size; ++i) content += " ";
- pos = idx + 1;
- }
- }
-
- if (style) {
- var sp = node.appendChild(document.createElement("span"));
- sp.className = "cm-" + style.replace(/ +/g, " cm-");
- sp.appendChild(document.createTextNode(content));
- } else {
- node.appendChild(document.createTextNode(content));
- }
- };
- }
-
- var lines = CodeMirror.splitLines(string), state = (options && options.state) || CodeMirror.startState(mode);
- for (var i = 0, e = lines.length; i < e; ++i) {
- if (i) callback("\n");
- var stream = new CodeMirror.StringStream(lines[i]);
- if (!stream.string && mode.blankLine) mode.blankLine(state);
- while (!stream.eol()) {
- var style = mode.token(stream, state);
- callback(stream.current(), style, i, stream.start, state);
- stream.start = stream.pos;
- }
- }
-};
-
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.node.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.node.js
deleted file mode 100644
index 8f345a3..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/runmode/runmode.node.js
+++ /dev/null
@@ -1,178 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-/* Just enough of CodeMirror to run runMode under node.js */
-
-function splitLines(string){return string.split(/\r\n?|\n/);};
-
-// Counts the column offset in a string, taking tabs into account.
-// Used mostly to find indentation.
-var 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;
- }
-};
-
-function StringStream(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; }
- }
-};
-exports.StringStream = StringStream;
-
-exports.startState = function(mode, a1, a2) {
- return mode.startState ? mode.startState(a1, a2) : true;
-};
-
-var modes = exports.modes = {}, mimeModes = exports.mimeModes = {};
-exports.defineMode = function(name, mode) {
- if (arguments.length > 2)
- mode.dependencies = Array.prototype.slice.call(arguments, 2);
- modes[name] = mode;
-};
-exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; };
-
-exports.defineMode("null", function() {
- return {token: function(stream) {stream.skipToEnd();}};
-});
-exports.defineMIME("text/plain", "null");
-
-exports.resolveMode = function(spec) {
- if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
- spec = mimeModes[spec];
- } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
- spec = mimeModes[spec.name];
- }
- if (typeof spec == "string") return {name: spec};
- else return spec || {name: "null"};
-};
-
-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;
-}
-
-// This can be used to attach properties to mode objects from
-// outside the actual mode definition.
-var modeExtensions = exports.modeExtensions = {};
-exports.extendMode = function(mode, properties) {
- var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});
- copyObj(properties, exts);
-};
-
-exports.getMode = function(options, spec) {
- var spec = exports.resolveMode(spec);
- var mfactory = modes[spec.name];
- if (!mfactory) return exports.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;
-};
-exports.registerHelper = exports.registerGlobalHelper = Math.min;
-
-exports.runMode = function(string, modespec, callback, options) {
- var mode = exports.getMode({indentUnit: 2}, modespec);
- var lines = splitLines(string), state = (options && options.state) || exports.startState(mode);
- for (var i = 0, e = lines.length; i < e; ++i) {
- if (i) callback("\n");
- var stream = new exports.StringStream(lines[i]);
- if (!stream.string && mode.blankLine) mode.blankLine(state);
- while (!stream.eol()) {
- var style = mode.token(stream, state);
- callback(stream.current(), style, i, stream.start, state);
- stream.start = stream.pos;
- }
- }
-};
-
-require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")];
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/annotatescrollbar.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/annotatescrollbar.js
deleted file mode 100644
index e62a45a..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/annotatescrollbar.js
+++ /dev/null
@@ -1,115 +0,0 @@
-// 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.defineExtension("annotateScrollbar", function(options) {
- if (typeof options == "string") options = {className: options};
- return new Annotation(this, options);
- });
-
- CodeMirror.defineOption("scrollButtonHeight", 0);
-
- function Annotation(cm, options) {
- this.cm = cm;
- 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() {
- 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 - this.buttonHeight * 2) /
- cm.heightAtLine(cm.lastLine() + 1, "local");
- if (hScale != this.hScale) {
- this.hScale = hScale;
- return true;
- }
- };
-
- Annotation.prototype.update = function(annotations) {
- this.annotations = annotations;
- this.redraw();
- };
-
- Annotation.prototype.redraw = function(compute) {
- if (compute !== false) this.computeScale();
- 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 || getY(ann.from, true) * hScale;
- var bottom = getY(ann.to, false) * hScale;
- while (i < anns.length - 1) {
- nextTop = getY(anns[i + 1].from, true) * hScale;
- if (nextTop > bottom + .9) break;
- ann = anns[++i];
- bottom = getY(ann.to, false) * 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 + this.buttonHeight) + "px; height: " + height + "px";
- elt.className = this.options.className;
- }
- this.div.textContent = "";
- this.div.appendChild(frag);
- };
-
- 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/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/scrollpastend.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/scrollpastend.js
deleted file mode 100644
index 008ae4c..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/scrollpastend.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// 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("scrollPastEnd", false, function(cm, val, old) {
- if (old && old != CodeMirror.Init) {
- cm.off("change", onChange);
- cm.off("refresh", updateBottomMargin);
- cm.display.lineSpace.parentNode.style.paddingBottom = "";
- cm.state.scrollPastEndPadding = null;
- }
- if (val) {
- cm.on("change", onChange);
- cm.on("refresh", updateBottomMargin);
- updateBottomMargin(cm);
- }
- });
-
- function onChange(cm, change) {
- if (CodeMirror.changeEnd(change).line == cm.lastLine())
- updateBottomMargin(cm);
- }
-
- function updateBottomMargin(cm) {
- var padding = "";
- if (cm.lineCount() > 1) {
- var totalH = cm.display.scroller.clientHeight - 30,
- lastLineH = cm.getLineHandle(cm.lastLine()).height;
- padding = (totalH - lastLineH) + "px";
- }
- if (cm.state.scrollPastEndPadding != padding) {
- cm.state.scrollPastEndPadding = padding;
- cm.display.lineSpace.parentNode.style.paddingBottom = padding;
- cm.setSize();
- }
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.css
deleted file mode 100644
index 5eea7aa..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.css
+++ /dev/null
@@ -1,66 +0,0 @@
-.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/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.js
deleted file mode 100644
index f78353a..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/scroll/simplescrollbars.js
+++ /dev/null
@@ -1,147 +0,0 @@
-// 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);
- };
-
- var minButtonSize = 10;
-
- Bar.prototype.update = function(scrollSize, clientSize, barSize) {
- this.screen = clientSize;
- this.total = scrollSize;
- this.size = barSize;
-
- 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"] =
- buttonSize + "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);
- };
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/match-highlighter.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/match-highlighter.js
deleted file mode 100644
index e9a2272..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/match-highlighter.js
+++ /dev/null
@@ -1,128 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Highlighting text that matches the selection
-//
-// Defines an option highlightSelectionMatches, which, when enabled,
-// will style strings that match the selection throughout the
-// document.
-//
-// The option can be set to true to simply enable it, or to a
-// {minChars, style, wordsOnly, showToken, delay} object to explicitly
-// configure it. minChars is the minimum amount of characters that should be
-// selected for the behavior to occur, and style is the token style to
-// apply to the matches. This will be prefixed by "cm-" to create an
-// actual CSS class name. If wordsOnly is enabled, the matches will be
-// highlighted only if the selected text is a word. showToken, when enabled,
-// will cause the current token to be highlighted when nothing is selected.
-// delay is used to specify how much time to wait, in milliseconds, before
-// highlighting the matches.
-
-(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 DEFAULT_MIN_CHARS = 2;
- var DEFAULT_TOKEN_STYLE = "matchhighlight";
- var DEFAULT_DELAY = 100;
- var DEFAULT_WORDS_ONLY = false;
-
- function State(options) {
- if (typeof options == "object") {
- this.minChars = options.minChars;
- this.style = options.style;
- this.showToken = options.showToken;
- this.delay = options.delay;
- this.wordsOnly = options.wordsOnly;
- }
- if (this.style == null) this.style = DEFAULT_TOKEN_STYLE;
- if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS;
- if (this.delay == null) this.delay = DEFAULT_DELAY;
- if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY;
- this.overlay = this.timeout = null;
- }
-
- CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
- if (old && old != CodeMirror.Init) {
- var over = cm.state.matchHighlighter.overlay;
- if (over) cm.removeOverlay(over);
- clearTimeout(cm.state.matchHighlighter.timeout);
- cm.state.matchHighlighter = null;
- cm.off("cursorActivity", cursorActivity);
- }
- if (val) {
- cm.state.matchHighlighter = new State(val);
- highlightMatches(cm);
- cm.on("cursorActivity", cursorActivity);
- }
- });
-
- function cursorActivity(cm) {
- var state = cm.state.matchHighlighter;
- clearTimeout(state.timeout);
- state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay);
- }
-
- function highlightMatches(cm) {
- cm.operation(function() {
- var state = cm.state.matchHighlighter;
- if (state.overlay) {
- cm.removeOverlay(state.overlay);
- state.overlay = null;
- }
- if (!cm.somethingSelected() && state.showToken) {
- var re = state.showToken === true ? /[\w$]/ : state.showToken;
- var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
- while (start && re.test(line.charAt(start - 1))) --start;
- while (end < line.length && re.test(line.charAt(end))) ++end;
- if (start < end)
- cm.addOverlay(state.overlay = makeOverlay(line.slice(start, end), re, state.style));
- return;
- }
- var from = cm.getCursor("from"), to = cm.getCursor("to");
- if (from.line != to.line) return;
- if (state.wordsOnly && !isWord(cm, from, to)) return;
- var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, "");
- if (selection.length >= state.minChars)
- cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style));
- });
- }
-
- function isWord(cm, from, to) {
- var str = cm.getRange(from, to);
- if (str.match(/^\w+$/) !== null) {
- if (from.ch > 0) {
- var pos = {line: from.line, ch: from.ch - 1};
- var chr = cm.getRange(pos, from);
- if (chr.match(/\W/) === null) return false;
- }
- if (to.ch < cm.getLine(from.line).length) {
- var pos = {line: to.line, ch: to.ch + 1};
- var chr = cm.getRange(to, pos);
- if (chr.match(/\W/) === null) return false;
- }
- return true;
- } else return false;
- }
-
- function boundariesAround(stream, re) {
- return (!stream.start || !re.test(stream.string.charAt(stream.start - 1))) &&
- (stream.pos == stream.string.length || !re.test(stream.string.charAt(stream.pos)));
- }
-
- function makeOverlay(query, hasBoundary, style) {
- return {token: function(stream) {
- if (stream.match(query) &&
- (!hasBoundary || boundariesAround(stream, hasBoundary)))
- return style;
- stream.next();
- stream.skipTo(query.charAt(0)) || stream.skipToEnd();
- }};
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.css
deleted file mode 100644
index 77932cc..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.CodeMirror-search-match {
- background: gold;
- border-top: 1px solid orange;
- border-bottom: 1px solid orange;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- opacity: .5;
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.js
deleted file mode 100644
index 8d19228..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/matchesonscrollbar.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(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"), require("./searchcursor"), require("../scroll/annotatescrollbar"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror", "./searchcursor", "../scroll/annotatescrollbar"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
- "use strict";
-
- CodeMirror.defineExtension("showMatchesOnScrollbar", function(query, caseFold, options) {
- if (typeof options == "string") options = {className: options};
- if (!options) options = {};
- return new SearchAnnotation(this, query, caseFold, options);
- });
-
- function SearchAnnotation(cm, query, caseFold, options) {
- this.cm = cm;
- this.options = options;
- var annotateOptions = {listenForChanges: false};
- for (var prop in options) annotateOptions[prop] = options[prop];
- if (!annotateOptions.className) annotateOptions.className = "CodeMirror-search-match";
- this.annotation = cm.annotateScrollbar(annotateOptions);
- this.query = query;
- this.caseFold = caseFold;
- this.gap = {from: cm.firstLine(), to: cm.lastLine() + 1};
- this.matches = [];
- this.update = null;
-
- this.findMatches();
- this.annotation.update(this.matches);
-
- var self = this;
- cm.on("change", this.changeHandler = function(_cm, change) { self.onChange(change); });
- }
-
- var MAX_MATCHES = 1000;
-
- SearchAnnotation.prototype.findMatches = function() {
- if (!this.gap) return;
- for (var i = 0; i < this.matches.length; i++) {
- var match = this.matches[i];
- if (match.from.line >= this.gap.to) break;
- if (match.to.line >= 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 > maxMatches) break;
- }
- this.gap = null;
- };
-
- function offsetLine(line, changeStart, sizeChange) {
- if (line <= changeStart) return line;
- return Math.max(changeStart, line + sizeChange);
- }
-
- SearchAnnotation.prototype.onChange = function(change) {
- var startLine = change.from.line;
- var endLine = CodeMirror.changeEnd(change).line;
- var sizeChange = endLine - change.to.line;
- if (this.gap) {
- this.gap.from = Math.min(offsetLine(this.gap.from, startLine, sizeChange), change.from.line);
- this.gap.to = Math.max(offsetLine(this.gap.to, startLine, sizeChange), change.from.line);
- } else {
- this.gap = {from: change.from.line, to: endLine + 1};
- }
-
- if (sizeChange) for (var i = 0; i < this.matches.length; i++) {
- var match = this.matches[i];
- var newFrom = offsetLine(match.from.line, startLine, sizeChange);
- if (newFrom != match.from.line) match.from = CodeMirror.Pos(newFrom, match.from.ch);
- var newTo = offsetLine(match.to.line, startLine, sizeChange);
- if (newTo != match.to.line) match.to = CodeMirror.Pos(newTo, match.to.ch);
- }
- clearTimeout(this.update);
- var self = this;
- this.update = setTimeout(function() { self.updateAfterChange(); }, 250);
- };
-
- SearchAnnotation.prototype.updateAfterChange = function() {
- this.findMatches();
- this.annotation.update(this.matches);
- };
-
- SearchAnnotation.prototype.clear = function() {
- this.cm.off("change", this.changeHandler);
- this.annotation.clear();
- };
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/search.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/search.js
deleted file mode 100644
index ed3c477..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/search.js
+++ /dev/null
@@ -1,202 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Define search commands. Depends on dialog.js or another
-// implementation of the openDialog method.
-
-// Replace works a little oddly -- it will do the replace on the next
-// Ctrl-G (or whatever is bound to findNext) press. You prevent a
-// replace by making sure the match is no longer selected when hitting
-// Ctrl-G.
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"), require("./searchcursor"), require("../dialog/dialog"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror", "./searchcursor", "../dialog/dialog"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
- "use strict";
-
- function searchOverlay(query, caseInsensitive) {
- if (typeof query == "string")
- query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
- else if (!query.global)
- query = new RegExp(query.source, query.ignoreCase ? "gi" : "g");
-
- return {token: function(stream) {
- query.lastIndex = stream.pos;
- var match = query.exec(stream.string);
- if (match && match.index == stream.pos) {
- stream.pos += match[0].length;
- return "searching";
- } else if (match) {
- stream.pos = match.index;
- } else {
- stream.skipToEnd();
- }
- }};
- }
-
- function SearchState() {
- this.posFrom = this.posTo = this.lastQuery = this.query = null;
- this.overlay = null;
- }
-
- function getSearchState(cm) {
- return cm.state.search || (cm.state.search = new SearchState());
- }
-
- function queryCaseInsensitive(query) {
- return typeof query == "string" && query == query.toLowerCase();
- }
-
- function getSearchCursor(cm, query, pos) {
- // Heuristic: if the query string is all lowercase, do a case insensitive search.
- return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
- }
-
- function persistentDialog(cm, text, deflt, f) {
- cm.openDialog(text, f, {
- value: deflt,
- selectValueOnOpen: true,
- closeOnEnter: false,
- onClose: function() { clearSearch(cm); }
- });
- }
-
- function dialog(cm, text, shortText, deflt, f) {
- if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
- else f(prompt(shortText, deflt));
- }
-
- function confirmDialog(cm, text, shortText, fs) {
- if (cm.openConfirm) cm.openConfirm(text, fs);
- else if (confirm(shortText)) fs[0]();
- }
-
- function parseQuery(query) {
- var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
- if (isRE) {
- try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); }
- catch(e) {} // Not a regular expression after all, do a string search
- }
- if (typeof query == "string" ? query == "" : query.test(""))
- query = /x^/;
- return query;
- }
-
- var queryDialog =
- 'Search:
(Use /re/ syntax for regexp search) ';
-
- function startSearch(cm, state, query) {
- state.queryText = query;
- state.query = parseQuery(query);
- cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
- state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
- cm.addOverlay(state.overlay);
- if (cm.showMatchesOnScrollbar) {
- if (state.annotate) { state.annotate.clear(); state.annotate = null; }
- state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
- }
- }
-
- function doSearch(cm, rev, persistent) {
- var state = getSearchState(cm);
- if (state.query) return findNext(cm, rev);
- var q = cm.getSelection() || state.lastQuery;
- if (persistent && cm.openDialog) {
- persistentDialog(cm, queryDialog, q, function(query, event) {
- CodeMirror.e_stop(event);
- if (!query) return;
- if (query != state.queryText) startSearch(cm, state, query);
- findNext(cm, event.shiftKey);
- });
- } else {
- dialog(cm, queryDialog, "Search for:", q, function(query) {
- if (query && !state.query) cm.operation(function() {
- startSearch(cm, state, query);
- state.posFrom = state.posTo = cm.getCursor();
- findNext(cm, rev);
- });
- });
- }
- }
-
- function findNext(cm, rev) {cm.operation(function() {
- var state = getSearchState(cm);
- var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
- if (!cursor.find(rev)) {
- cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
- if (!cursor.find(rev)) return;
- }
- cm.setSelection(cursor.from(), cursor.to());
- cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20);
- state.posFrom = cursor.from(); state.posTo = cursor.to();
- });}
-
- function clearSearch(cm) {cm.operation(function() {
- var state = getSearchState(cm);
- state.lastQuery = state.query;
- if (!state.query) return;
- state.query = state.queryText = null;
- cm.removeOverlay(state.overlay);
- if (state.annotate) { state.annotate.clear(); state.annotate = null; }
- });}
-
- var replaceQueryDialog =
- 'Replace:
(Use /re/ syntax for regexp search) ';
- var replacementQueryDialog = 'With:
';
- var doReplaceConfirm = "Replace?
Yes No Stop ";
-
- function replace(cm, all) {
- if (cm.getOption("readOnly")) return;
- var query = cm.getSelection() || getSearchState(cm).lastQuery;
- dialog(cm, replaceQueryDialog, "Replace:", query, function(query) {
- if (!query) return;
- query = parseQuery(query);
- dialog(cm, replacementQueryDialog, "Replace with:", "", function(text) {
- if (all) {
- cm.operation(function() {
- for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
- if (typeof query != "string") {
- var match = cm.getRange(cursor.from(), cursor.to()).match(query);
- cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
- } else cursor.replace(text);
- }
- });
- } else {
- clearSearch(cm);
- var cursor = getSearchCursor(cm, query, cm.getCursor());
- var advance = function() {
- var start = cursor.from(), match;
- if (!(match = cursor.findNext())) {
- cursor = getSearchCursor(cm, query);
- if (!(match = cursor.findNext()) ||
- (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
- }
- cm.setSelection(cursor.from(), cursor.to());
- cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
- confirmDialog(cm, doReplaceConfirm, "Replace?",
- [function() {doReplace(match);}, advance]);
- };
- var doReplace = function(match) {
- cursor.replace(typeof query == "string" ? text :
- text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
- advance();
- };
- advance();
- }
- });
- });
- }
-
- CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
- CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);};
- CodeMirror.commands.findNext = doSearch;
- CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
- CodeMirror.commands.clearSearch = clearSearch;
- CodeMirror.commands.replace = replace;
- CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/searchcursor.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/searchcursor.js
deleted file mode 100644
index b70242e..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/search/searchcursor.js
+++ /dev/null
@@ -1,189 +0,0 @@
-// 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 SearchCursor(doc, query, pos, caseFold) {
- this.atOccurrence = false; this.doc = doc;
- if (caseFold == null && typeof query == "string") caseFold = false;
-
- pos = pos ? doc.clipPos(pos) : Pos(0, 0);
- this.pos = {from: pos, to: pos};
-
- // The matches method is filled in based on the type of query.
- // It takes a position and a direction, and returns an object
- // describing the next occurrence of the query, or null if no
- // more matches were found.
- if (typeof query != "string") { // Regexp match
- if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
- this.matches = function(reverse, pos) {
- if (reverse) {
- query.lastIndex = 0;
- var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;
- for (;;) {
- query.lastIndex = cutOff;
- var newMatch = query.exec(line);
- if (!newMatch) break;
- match = newMatch;
- start = match.index;
- cutOff = match.index + (match[0].length || 1);
- if (cutOff == line.length) break;
- }
- var matchLen = (match && match[0].length) || 0;
- if (!matchLen) {
- if (start == 0 && line.length == 0) {match = undefined;}
- else if (start != doc.getLine(pos.line).length) {
- matchLen++;
- }
- }
- } else {
- query.lastIndex = pos.ch;
- var line = doc.getLine(pos.line), match = query.exec(line);
- var matchLen = (match && match[0].length) || 0;
- var start = match && match.index;
- if (start + matchLen != line.length && !matchLen) matchLen = 1;
- }
- if (match && matchLen)
- return {from: Pos(pos.line, start),
- to: Pos(pos.line, start + matchLen),
- match: match};
- };
- } else { // String query
- var origQuery = query;
- if (caseFold) query = query.toLowerCase();
- var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
- var target = query.split("\n");
- // Different methods for single-line and multi-line queries
- if (target.length == 1) {
- if (!query.length) {
- // Empty string would match anything and never progress, so
- // we define it to match nothing instead.
- this.matches = function() {};
- } else {
- this.matches = function(reverse, pos) {
- if (reverse) {
- var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig);
- var match = line.lastIndexOf(query);
- if (match > -1) {
- match = adjustPos(orig, line, match);
- return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
- }
- } else {
- var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig);
- var match = line.indexOf(query);
- if (match > -1) {
- match = adjustPos(orig, line, match) + pos.ch;
- return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
- }
- }
- };
- }
- } else {
- var origTarget = origQuery.split("\n");
- this.matches = function(reverse, pos) {
- var last = target.length - 1;
- if (reverse) {
- if (pos.line - (target.length - 1) < doc.firstLine()) return;
- if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return;
- var to = Pos(pos.line, origTarget[last].length);
- for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln)
- if (target[i] != fold(doc.getLine(ln))) return;
- var line = doc.getLine(ln), cut = line.length - origTarget[0].length;
- if (fold(line.slice(cut)) != target[0]) return;
- return {from: Pos(ln, cut), to: to};
- } else {
- if (pos.line + (target.length - 1) > doc.lastLine()) return;
- var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length;
- if (fold(line.slice(cut)) != target[0]) return;
- var from = Pos(pos.line, cut);
- for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln)
- if (target[i] != fold(doc.getLine(ln))) return;
- if (fold(doc.getLine(ln).slice(0, origTarget[last].length)) != target[last]) return;
- return {from: from, to: Pos(ln, origTarget[last].length)};
- }
- };
- }
- }
- }
-
- SearchCursor.prototype = {
- findNext: function() {return this.find(false);},
- findPrevious: function() {return this.find(true);},
-
- find: function(reverse) {
- var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
- function savePosAndFail(line) {
- var pos = Pos(line, 0);
- self.pos = {from: pos, to: pos};
- self.atOccurrence = false;
- return false;
- }
-
- for (;;) {
- if (this.pos = this.matches(reverse, pos)) {
- this.atOccurrence = true;
- return this.pos.match || true;
- }
- if (reverse) {
- if (!pos.line) return savePosAndFail(0);
- pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);
- }
- else {
- var maxLine = this.doc.lineCount();
- if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
- pos = Pos(pos.line + 1, 0);
- }
- }
- },
-
- from: function() {if (this.atOccurrence) return this.pos.from;},
- to: function() {if (this.atOccurrence) return this.pos.to;},
-
- replace: function(newText, origin) {
- if (!this.atOccurrence) return;
- var lines = CodeMirror.splitLines(newText);
- this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin);
- this.pos.to = Pos(this.pos.from.line + lines.length - 1,
- lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));
- }
- };
-
- // Maps a position in a case-folded line back to a position in the original line
- // (compensating for codepoints increasing in number during folding)
- function adjustPos(orig, folded, pos) {
- if (orig.length == folded.length) return pos;
- for (var pos1 = Math.min(pos, orig.length);;) {
- var len1 = orig.slice(0, pos1).toLowerCase().length;
- if (len1 < pos) ++pos1;
- else if (len1 > pos) --pos1;
- else return pos1;
- }
- }
-
- CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
- return new SearchCursor(this.doc, query, pos, caseFold);
- });
- CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) {
- return new SearchCursor(this, query, pos, caseFold);
- });
-
- CodeMirror.defineExtension("selectMatches", function(query, caseFold) {
- var ranges = [];
- var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold);
- while (cur.findNext()) {
- if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break;
- ranges.push({anchor: cur.from(), head: cur.to()});
- }
- if (ranges.length)
- this.setSelections(ranges, 0);
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/active-line.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/active-line.js
deleted file mode 100644
index 22da2e0..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/active-line.js
+++ /dev/null
@@ -1,71 +0,0 @@
-// 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);
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/mark-selection.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/mark-selection.js
deleted file mode 100644
index 5c42d21..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/mark-selection.js
+++ /dev/null
@@ -1,118 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Because sometimes you need to mark the selected *text*.
-//
-// Adds an option 'styleSelectedText' which, when enabled, gives
-// selected text the CSS class given as option value, or
-// "CodeMirror-selectedtext" when the value is not a string.
-
-(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("styleSelectedText", false, function(cm, val, old) {
- var prev = old && old != CodeMirror.Init;
- if (val && !prev) {
- cm.state.markedSelection = [];
- cm.state.markedSelectionStyle = typeof val == "string" ? val : "CodeMirror-selectedtext";
- reset(cm);
- cm.on("cursorActivity", onCursorActivity);
- cm.on("change", onChange);
- } else if (!val && prev) {
- cm.off("cursorActivity", onCursorActivity);
- cm.off("change", onChange);
- clear(cm);
- cm.state.markedSelection = cm.state.markedSelectionStyle = null;
- }
- });
-
- function onCursorActivity(cm) {
- cm.operation(function() { update(cm); });
- }
-
- function onChange(cm) {
- if (cm.state.markedSelection.length)
- cm.operation(function() { clear(cm); });
- }
-
- var CHUNK_SIZE = 8;
- var Pos = CodeMirror.Pos;
- var cmp = CodeMirror.cmpPos;
-
- function coverRange(cm, from, to, addAt) {
- if (cmp(from, to) == 0) return;
- var array = cm.state.markedSelection;
- var cls = cm.state.markedSelectionStyle;
- for (var line = from.line;;) {
- var start = line == from.line ? from : Pos(line, 0);
- var endLine = line + CHUNK_SIZE, atEnd = endLine >= to.line;
- var end = atEnd ? to : Pos(endLine, 0);
- var mark = cm.markText(start, end, {className: cls});
- if (addAt == null) array.push(mark);
- else array.splice(addAt++, 0, mark);
- if (atEnd) break;
- line = endLine;
- }
- }
-
- function clear(cm) {
- var array = cm.state.markedSelection;
- for (var i = 0; i < array.length; ++i) array[i].clear();
- array.length = 0;
- }
-
- function reset(cm) {
- clear(cm);
- var ranges = cm.listSelections();
- for (var i = 0; i < ranges.length; i++)
- coverRange(cm, ranges[i].from(), ranges[i].to());
- }
-
- function update(cm) {
- if (!cm.somethingSelected()) return clear(cm);
- if (cm.listSelections().length > 1) return reset(cm);
-
- var from = cm.getCursor("start"), to = cm.getCursor("end");
-
- var array = cm.state.markedSelection;
- if (!array.length) return coverRange(cm, from, to);
-
- var coverStart = array[0].find(), coverEnd = array[array.length - 1].find();
- if (!coverStart || !coverEnd || to.line - from.line < CHUNK_SIZE ||
- cmp(from, coverEnd.to) >= 0 || cmp(to, coverStart.from) <= 0)
- return reset(cm);
-
- while (cmp(from, coverStart.from) > 0) {
- array.shift().clear();
- coverStart = array[0].find();
- }
- if (cmp(from, coverStart.from) < 0) {
- if (coverStart.to.line - from.line < CHUNK_SIZE) {
- array.shift().clear();
- coverRange(cm, from, coverStart.to, 0);
- } else {
- coverRange(cm, from, coverStart.from, 0);
- }
- }
-
- while (cmp(to, coverEnd.to) < 0) {
- array.pop().clear();
- coverEnd = array[array.length - 1].find();
- }
- if (cmp(to, coverEnd.to) > 0) {
- if (to.line - coverEnd.from.line < CHUNK_SIZE) {
- array.pop().clear();
- coverRange(cm, coverEnd.from, to);
- } else {
- coverRange(cm, coverEnd.to, to);
- }
- }
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/selection-pointer.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/selection-pointer.js
deleted file mode 100644
index ef5e404..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/selection/selection-pointer.js
+++ /dev/null
@@ -1,98 +0,0 @@
-// 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("selectionPointer", false, function(cm, val) {
- var data = cm.state.selectionPointer;
- if (data) {
- CodeMirror.off(cm.getWrapperElement(), "mousemove", data.mousemove);
- CodeMirror.off(cm.getWrapperElement(), "mouseout", data.mouseout);
- CodeMirror.off(window, "scroll", data.windowScroll);
- cm.off("cursorActivity", reset);
- cm.off("scroll", reset);
- cm.state.selectionPointer = null;
- cm.display.lineDiv.style.cursor = "";
- }
- if (val) {
- data = cm.state.selectionPointer = {
- value: typeof val == "string" ? val : "default",
- mousemove: function(event) { mousemove(cm, event); },
- mouseout: function(event) { mouseout(cm, event); },
- windowScroll: function() { reset(cm); },
- rects: null,
- mouseX: null, mouseY: null,
- willUpdate: false
- };
- CodeMirror.on(cm.getWrapperElement(), "mousemove", data.mousemove);
- CodeMirror.on(cm.getWrapperElement(), "mouseout", data.mouseout);
- CodeMirror.on(window, "scroll", data.windowScroll);
- cm.on("cursorActivity", reset);
- cm.on("scroll", reset);
- }
- });
-
- function mousemove(cm, event) {
- var data = cm.state.selectionPointer;
- if (event.buttons == null ? event.which : event.buttons) {
- data.mouseX = data.mouseY = null;
- } else {
- data.mouseX = event.clientX;
- data.mouseY = event.clientY;
- }
- scheduleUpdate(cm);
- }
-
- function mouseout(cm, event) {
- if (!cm.getWrapperElement().contains(event.relatedTarget)) {
- var data = cm.state.selectionPointer;
- data.mouseX = data.mouseY = null;
- scheduleUpdate(cm);
- }
- }
-
- function reset(cm) {
- cm.state.selectionPointer.rects = null;
- scheduleUpdate(cm);
- }
-
- function scheduleUpdate(cm) {
- if (!cm.state.selectionPointer.willUpdate) {
- cm.state.selectionPointer.willUpdate = true;
- setTimeout(function() {
- update(cm);
- cm.state.selectionPointer.willUpdate = false;
- }, 50);
- }
- }
-
- function update(cm) {
- var data = cm.state.selectionPointer;
- if (!data) return;
- if (data.rects == null && data.mouseX != null) {
- data.rects = [];
- if (cm.somethingSelected()) {
- for (var sel = cm.display.selectionDiv.firstChild; sel; sel = sel.nextSibling)
- data.rects.push(sel.getBoundingClientRect());
- }
- }
- var inside = false;
- if (data.mouseX != null) for (var i = 0; i < data.rects.length; i++) {
- var rect = data.rects[i];
- if (rect.left <= data.mouseX && rect.right >= data.mouseX &&
- rect.top <= data.mouseY && rect.bottom >= data.mouseY)
- inside = true;
- }
- var cursor = inside ? data.value : "";
- if (cm.display.lineDiv.style.cursor != cursor)
- cm.display.lineDiv.style.cursor = cursor;
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.css
deleted file mode 100644
index c4b8a2f..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.css
+++ /dev/null
@@ -1,87 +0,0 @@
-.CodeMirror-Tern-completion {
- padding-left: 22px;
- position: relative;
- line-height: 1.5;
-}
-.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; }
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.js
deleted file mode 100644
index 42c3cde..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/tern.js
+++ /dev/null
@@ -1,699 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// Glue code between CodeMirror and Tern.
-//
-// Create a CodeMirror.TernServer to wrap an actual Tern server,
-// register open documents (CodeMirror.Doc instances) with it, and
-// call its methods to activate the assisting functions that Tern
-// provides.
-//
-// Options supported (all optional):
-// * defs: An array of JSON definition data structures.
-// * plugins: An object mapping plugin names to configuration
-// options.
-// * getFile: A function(name, c) that can be used to access files in
-// the project that haven't been loaded yet. Simply do c(null) to
-// indicate that a file is not available.
-// * fileFilter: A function(value, docName, doc) that will be applied
-// to documents before passing them on to Tern.
-// * switchToDoc: A function(name, doc) that should, when providing a
-// multi-file view, switch the view or focus to the named file.
-// * showError: A function(editor, message) that can be used to
-// override the way errors are displayed.
-// * completionTip: Customize the content in tooltips for completions.
-// Is passed a single argument—the completion's data as returned by
-// Tern—and may return a string, DOM node, or null to indicate that
-// no tip should be shown. By default the docstring is shown.
-// * typeTip: Like completionTip, but for the tooltips shown for type
-// queries.
-// * responseFilter: A function(doc, query, request, error, data) that
-// will be applied to the Tern responses before treating them
-//
-//
-// It is possible to run the Tern server in a web worker by specifying
-// these additional options:
-// * useWorker: Set to true to enable web worker mode. You'll probably
-// want to feature detect the actual value you use here, for example
-// !!window.Worker.
-// * workerScript: The main script of the worker. Point this to
-// wherever you are hosting worker.js from this directory.
-// * workerDeps: An array of paths pointing (relative to workerScript)
-// to the Acorn and Tern libraries and any Tern plugins you want to
-// load. Or, if you minified those into a single script and included
-// them in the workerScript, simply leave this undefined.
-
-(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";
- // declare global: tern
-
- CodeMirror.TernServer = function(options) {
- var self = this;
- this.options = options || {};
- var plugins = this.options.plugins || (this.options.plugins = {});
- if (!plugins.doc_comment) plugins.doc_comment = true;
- this.docs = Object.create(null);
- if (this.options.useWorker) {
- this.server = new WorkerServer(this);
- } else {
- this.server = new tern.Server({
- getFile: function(name, c) { return getFile(self, name, c); },
- async: true,
- defs: this.options.defs || [],
- plugins: plugins
- });
- }
- this.trackChange = function(doc, change) { trackChange(self, doc, change); };
-
- this.cachedArgHints = null;
- this.activeArgHints = null;
- this.jumpStack = [];
-
- this.getHint = function(cm, c) { return hint(self, cm, c); };
- this.getHint.async = true;
- };
-
- CodeMirror.TernServer.prototype = {
- addDoc: function(name, doc) {
- var data = {doc: doc, name: name, changed: null};
- this.server.addFile(name, docValue(this, data));
- CodeMirror.on(doc, "change", this.trackChange);
- return this.docs[name] = data;
- },
-
- delDoc: function(id) {
- var found = resolveDoc(this, id);
- if (!found) return;
- CodeMirror.off(found.doc, "change", this.trackChange);
- delete this.docs[found.name];
- this.server.delFile(found.name);
- },
-
- hideDoc: function(id) {
- closeArgHints(this);
- var found = resolveDoc(this, id);
- if (found && found.changed) sendDoc(this, found);
- },
-
- complete: function(cm) {
- cm.showHint({hint: this.getHint});
- },
-
- showType: function(cm, pos, c) { showContextInfo(this, cm, pos, "type", c); },
-
- showDocs: function(cm, pos, c) { showContextInfo(this, cm, pos, "documentation", c); },
-
- updateArgHints: function(cm) { updateArgHints(this, cm); },
-
- jumpToDef: function(cm) { jumpToDef(this, cm); },
-
- jumpBack: function(cm) { jumpBack(this, cm); },
-
- rename: function(cm) { rename(this, cm); },
-
- selectName: function(cm) { selectName(this, cm); },
-
- request: function (cm, query, c, pos) {
- var self = this;
- var doc = findDoc(this, cm.getDoc());
- var request = buildRequest(this, doc, query, pos);
- var extraOptions = request.query && this.options.queryOptions && this.options.queryOptions[request.query.type]
- if (extraOptions) for (var prop in extraOptions) request.query[prop] = extraOptions[prop];
-
- this.server.request(request, function (error, data) {
- if (!error && self.options.responseFilter)
- data = self.options.responseFilter(doc, query, request, error, data);
- c(error, data);
- });
- },
-
- destroy: function () {
- if (this.worker) {
- this.worker.terminate();
- this.worker = null;
- }
- }
- };
-
- var Pos = CodeMirror.Pos;
- var cls = "CodeMirror-Tern-";
- var bigDoc = 250;
-
- function getFile(ts, name, c) {
- var buf = ts.docs[name];
- if (buf)
- c(docValue(ts, buf));
- else if (ts.options.getFile)
- ts.options.getFile(name, c);
- else
- c(null);
- }
-
- function findDoc(ts, doc, name) {
- for (var n in ts.docs) {
- var cur = ts.docs[n];
- if (cur.doc == doc) return cur;
- }
- if (!name) for (var i = 0;; ++i) {
- n = "[doc" + (i || "") + "]";
- if (!ts.docs[n]) { name = n; break; }
- }
- return ts.addDoc(name, doc);
- }
-
- function resolveDoc(ts, id) {
- if (typeof id == "string") return ts.docs[id];
- if (id instanceof CodeMirror) id = id.getDoc();
- if (id instanceof CodeMirror.Doc) return findDoc(ts, id);
- }
-
- function trackChange(ts, doc, change) {
- var data = findDoc(ts, doc);
-
- var argHints = ts.cachedArgHints;
- if (argHints && argHints.doc == doc && cmpPos(argHints.start, change.to) <= 0)
- ts.cachedArgHints = null;
-
- var changed = data.changed;
- if (changed == null)
- data.changed = changed = {from: change.from.line, to: change.from.line};
- var end = change.from.line + (change.text.length - 1);
- if (change.from.line < changed.to) changed.to = changed.to - (change.to.line - end);
- if (end >= changed.to) changed.to = end + 1;
- if (changed.from > change.from.line) changed.from = change.from.line;
-
- if (doc.lineCount() > bigDoc && change.to - changed.from > 100) setTimeout(function() {
- if (data.changed && data.changed.to - data.changed.from > 100) sendDoc(ts, data);
- }, 200);
- }
-
- function sendDoc(ts, doc) {
- ts.server.request({files: [{type: "full", name: doc.name, text: docValue(ts, doc)}]}, function(error) {
- if (error) window.console.error(error);
- else doc.changed = null;
- });
- }
-
- // Completion
-
- function hint(ts, cm, c) {
- ts.request(cm, {type: "completions", types: true, docs: true, urls: true}, function(error, data) {
- if (error) return showError(ts, cm, error);
- var completions = [], after = "";
- var from = data.start, to = data.end;
- if (cm.getRange(Pos(from.line, from.ch - 2), from) == "[\"" &&
- cm.getRange(to, Pos(to.line, to.ch + 2)) != "\"]")
- after = "\"]";
-
- for (var i = 0; i < data.completions.length; ++i) {
- var completion = data.completions[i], className = typeToIcon(completion.type);
- if (data.guess) className += " " + cls + "guess";
- completions.push({text: completion.name + after,
- displayText: completion.displayName || completion.name,
- className: className,
- data: completion});
- }
-
- var obj = {from: from, to: to, list: completions};
- var tooltip = null;
- CodeMirror.on(obj, "close", function() { remove(tooltip); });
- CodeMirror.on(obj, "update", function() { remove(tooltip); });
- CodeMirror.on(obj, "select", function(cur, node) {
- remove(tooltip);
- var content = ts.options.completionTip ? ts.options.completionTip(cur.data) : cur.data.doc;
- if (content) {
- tooltip = makeTooltip(node.parentNode.getBoundingClientRect().right + window.pageXOffset,
- node.getBoundingClientRect().top + window.pageYOffset, content);
- tooltip.className += " " + cls + "hint-doc";
- }
- });
- c(obj);
- });
- }
-
- function typeToIcon(type) {
- var suffix;
- if (type == "?") suffix = "unknown";
- else if (type == "number" || type == "string" || type == "bool") suffix = type;
- else if (/^fn\(/.test(type)) suffix = "fn";
- else if (/^\[/.test(type)) suffix = "array";
- else suffix = "object";
- return cls + "completion " + cls + "completion-" + suffix;
- }
-
- // Type queries
-
- function showContextInfo(ts, cm, pos, queryName, c) {
- ts.request(cm, queryName, function(error, data) {
- if (error) return showError(ts, cm, error);
- if (ts.options.typeTip) {
- var tip = ts.options.typeTip(data);
- } else {
- var tip = elt("span", null, elt("strong", null, data.type || "not found"));
- if (data.doc)
- tip.appendChild(document.createTextNode(" — " + data.doc));
- if (data.url) {
- tip.appendChild(document.createTextNode(" "));
- var child = tip.appendChild(elt("a", null, "[docs]"));
- child.href = data.url;
- child.target = "_blank";
- }
- }
- tempTooltip(cm, tip);
- if (c) c();
- }, pos);
- }
-
- // Maintaining argument hints
-
- function updateArgHints(ts, cm) {
- closeArgHints(ts);
-
- if (cm.somethingSelected()) return;
- var state = cm.getTokenAt(cm.getCursor()).state;
- var inner = CodeMirror.innerMode(cm.getMode(), state);
- if (inner.mode.name != "javascript") return;
- var lex = inner.state.lexical;
- if (lex.info != "call") return;
-
- var ch, argPos = lex.pos || 0, tabSize = cm.getOption("tabSize");
- for (var line = cm.getCursor().line, e = Math.max(0, line - 9), found = false; line >= e; --line) {
- var str = cm.getLine(line), extra = 0;
- for (var pos = 0;;) {
- var tab = str.indexOf("\t", pos);
- if (tab == -1) break;
- extra += tabSize - (tab + extra) % tabSize - 1;
- pos = tab + 1;
- }
- ch = lex.column - extra;
- if (str.charAt(ch) == "(") {found = true; break;}
- }
- if (!found) return;
-
- var start = Pos(line, ch);
- var cache = ts.cachedArgHints;
- if (cache && cache.doc == cm.getDoc() && cmpPos(start, cache.start) == 0)
- return showArgHints(ts, cm, argPos);
-
- ts.request(cm, {type: "type", preferFunction: true, end: start}, function(error, data) {
- if (error || !data.type || !(/^fn\(/).test(data.type)) return;
- ts.cachedArgHints = {
- start: pos,
- type: parseFnType(data.type),
- name: data.exprName || data.name || "fn",
- guess: data.guess,
- doc: cm.getDoc()
- };
- showArgHints(ts, cm, argPos);
- });
- }
-
- function showArgHints(ts, cm, pos) {
- closeArgHints(ts);
-
- var cache = ts.cachedArgHints, tp = cache.type;
- var tip = elt("span", cache.guess ? cls + "fhint-guess" : null,
- elt("span", cls + "fname", cache.name), "(");
- for (var i = 0; i < tp.args.length; ++i) {
- if (i) tip.appendChild(document.createTextNode(", "));
- var arg = tp.args[i];
- tip.appendChild(elt("span", cls + "farg" + (i == pos ? " " + cls + "farg-current" : ""), arg.name || "?"));
- if (arg.type != "?") {
- tip.appendChild(document.createTextNode(":\u00a0"));
- tip.appendChild(elt("span", cls + "type", arg.type));
- }
- }
- tip.appendChild(document.createTextNode(tp.rettype ? ") ->\u00a0" : ")"));
- if (tp.rettype) tip.appendChild(elt("span", cls + "type", tp.rettype));
- var place = cm.cursorCoords(null, "page");
- ts.activeArgHints = makeTooltip(place.right + 1, place.bottom, tip);
- }
-
- function parseFnType(text) {
- var args = [], pos = 3;
-
- function skipMatching(upto) {
- var depth = 0, start = pos;
- for (;;) {
- var next = text.charAt(pos);
- if (upto.test(next) && !depth) return text.slice(start, pos);
- if (/[{\[\(]/.test(next)) ++depth;
- else if (/[}\]\)]/.test(next)) --depth;
- ++pos;
- }
- }
-
- // Parse arguments
- if (text.charAt(pos) != ")") for (;;) {
- var name = text.slice(pos).match(/^([^, \(\[\{]+): /);
- if (name) {
- pos += name[0].length;
- name = name[1];
- }
- args.push({name: name, type: skipMatching(/[\),]/)});
- if (text.charAt(pos) == ")") break;
- pos += 2;
- }
-
- var rettype = text.slice(pos).match(/^\) -> (.*)$/);
-
- return {args: args, rettype: rettype && rettype[1]};
- }
-
- // Moving to the definition of something
-
- function jumpToDef(ts, cm) {
- function inner(varName) {
- var req = {type: "definition", variable: varName || null};
- var doc = findDoc(ts, cm.getDoc());
- ts.server.request(buildRequest(ts, doc, req), function(error, data) {
- if (error) return showError(ts, cm, error);
- if (!data.file && data.url) { window.open(data.url); return; }
-
- if (data.file) {
- var localDoc = ts.docs[data.file], found;
- if (localDoc && (found = findContext(localDoc.doc, data))) {
- ts.jumpStack.push({file: doc.name,
- start: cm.getCursor("from"),
- end: cm.getCursor("to")});
- moveTo(ts, doc, localDoc, found.start, found.end);
- return;
- }
- }
- showError(ts, cm, "Could not find a definition.");
- });
- }
-
- if (!atInterestingExpression(cm))
- dialog(cm, "Jump to variable", function(name) { if (name) inner(name); });
- else
- inner();
- }
-
- function jumpBack(ts, cm) {
- var pos = ts.jumpStack.pop(), doc = pos && ts.docs[pos.file];
- if (!doc) return;
- moveTo(ts, findDoc(ts, cm.getDoc()), doc, pos.start, pos.end);
- }
-
- function moveTo(ts, curDoc, doc, start, end) {
- doc.doc.setSelection(start, end);
- if (curDoc != doc && ts.options.switchToDoc) {
- closeArgHints(ts);
- ts.options.switchToDoc(doc.name, doc.doc);
- }
- }
-
- // The {line,ch} representation of positions makes this rather awkward.
- function findContext(doc, data) {
- var before = data.context.slice(0, data.contextOffset).split("\n");
- var startLine = data.start.line - (before.length - 1);
- var start = Pos(startLine, (before.length == 1 ? data.start.ch : doc.getLine(startLine).length) - before[0].length);
-
- var text = doc.getLine(startLine).slice(start.ch);
- for (var cur = startLine + 1; cur < doc.lineCount() && text.length < data.context.length; ++cur)
- text += "\n" + doc.getLine(cur);
- if (text.slice(0, data.context.length) == data.context) return data;
-
- var cursor = doc.getSearchCursor(data.context, 0, false);
- var nearest, nearestDist = Infinity;
- while (cursor.findNext()) {
- var from = cursor.from(), dist = Math.abs(from.line - start.line) * 10000;
- if (!dist) dist = Math.abs(from.ch - start.ch);
- if (dist < nearestDist) { nearest = from; nearestDist = dist; }
- }
- if (!nearest) return null;
-
- if (before.length == 1)
- nearest.ch += before[0].length;
- else
- nearest = Pos(nearest.line + (before.length - 1), before[before.length - 1].length);
- if (data.start.line == data.end.line)
- var end = Pos(nearest.line, nearest.ch + (data.end.ch - data.start.ch));
- else
- var end = Pos(nearest.line + (data.end.line - data.start.line), data.end.ch);
- return {start: nearest, end: end};
- }
-
- function atInterestingExpression(cm) {
- var pos = cm.getCursor("end"), tok = cm.getTokenAt(pos);
- if (tok.start < pos.ch && tok.type == "comment") return false;
- return /[\w)\]]/.test(cm.getLine(pos.line).slice(Math.max(pos.ch - 1, 0), pos.ch + 1));
- }
-
- // Variable renaming
-
- function rename(ts, cm) {
- var token = cm.getTokenAt(cm.getCursor());
- if (!/\w/.test(token.string)) return showError(ts, cm, "Not at a variable");
- dialog(cm, "New name for " + token.string, function(newName) {
- ts.request(cm, {type: "rename", newName: newName, fullDocs: true}, function(error, data) {
- if (error) return showError(ts, cm, error);
- applyChanges(ts, data.changes);
- });
- });
- }
-
- function selectName(ts, cm) {
- var name = findDoc(ts, cm.doc).name;
- ts.request(cm, {type: "refs"}, function(error, data) {
- if (error) return showError(ts, cm, error);
- var ranges = [], cur = 0;
- for (var i = 0; i < data.refs.length; i++) {
- var ref = data.refs[i];
- if (ref.file == name) {
- ranges.push({anchor: ref.start, head: ref.end});
- if (cmpPos(cur, ref.start) >= 0 && cmpPos(cur, ref.end) <= 0)
- cur = ranges.length - 1;
- }
- }
- cm.setSelections(ranges, cur);
- });
- }
-
- var nextChangeOrig = 0;
- function applyChanges(ts, changes) {
- var perFile = Object.create(null);
- for (var i = 0; i < changes.length; ++i) {
- var ch = changes[i];
- (perFile[ch.file] || (perFile[ch.file] = [])).push(ch);
- }
- for (var file in perFile) {
- var known = ts.docs[file], chs = perFile[file];;
- if (!known) continue;
- chs.sort(function(a, b) { return cmpPos(b.start, a.start); });
- var origin = "*rename" + (++nextChangeOrig);
- for (var i = 0; i < chs.length; ++i) {
- var ch = chs[i];
- known.doc.replaceRange(ch.text, ch.start, ch.end, origin);
- }
- }
- }
-
- // Generic request-building helper
-
- function buildRequest(ts, doc, query, pos) {
- var files = [], offsetLines = 0, allowFragments = !query.fullDocs;
- if (!allowFragments) delete query.fullDocs;
- if (typeof query == "string") query = {type: query};
- query.lineCharPositions = true;
- if (query.end == null) {
- query.end = pos || doc.doc.getCursor("end");
- if (doc.doc.somethingSelected())
- query.start = doc.doc.getCursor("start");
- }
- var startPos = query.start || query.end;
-
- if (doc.changed) {
- if (doc.doc.lineCount() > bigDoc && allowFragments !== false &&
- doc.changed.to - doc.changed.from < 100 &&
- doc.changed.from <= startPos.line && doc.changed.to > query.end.line) {
- files.push(getFragmentAround(doc, startPos, query.end));
- query.file = "#0";
- var offsetLines = files[0].offsetLines;
- if (query.start != null) query.start = Pos(query.start.line - -offsetLines, query.start.ch);
- query.end = Pos(query.end.line - offsetLines, query.end.ch);
- } else {
- files.push({type: "full",
- name: doc.name,
- text: docValue(ts, doc)});
- query.file = doc.name;
- doc.changed = null;
- }
- } else {
- query.file = doc.name;
- }
- for (var name in ts.docs) {
- var cur = ts.docs[name];
- if (cur.changed && cur != doc) {
- files.push({type: "full", name: cur.name, text: docValue(ts, cur)});
- cur.changed = null;
- }
- }
-
- return {query: query, files: files};
- }
-
- function getFragmentAround(data, start, end) {
- var doc = data.doc;
- var minIndent = null, minLine = null, endLine, tabSize = 4;
- for (var p = start.line - 1, min = Math.max(0, p - 50); p >= min; --p) {
- var line = doc.getLine(p), fn = line.search(/\bfunction\b/);
- if (fn < 0) continue;
- var indent = CodeMirror.countColumn(line, null, tabSize);
- if (minIndent != null && minIndent <= indent) continue;
- minIndent = indent;
- minLine = p;
- }
- if (minLine == null) minLine = min;
- var max = Math.min(doc.lastLine(), end.line + 20);
- if (minIndent == null || minIndent == CodeMirror.countColumn(doc.getLine(start.line), null, tabSize))
- endLine = max;
- else for (endLine = end.line + 1; endLine < max; ++endLine) {
- var indent = CodeMirror.countColumn(doc.getLine(endLine), null, tabSize);
- if (indent <= minIndent) break;
- }
- var from = Pos(minLine, 0);
-
- return {type: "part",
- name: data.name,
- offsetLines: from.line,
- text: doc.getRange(from, Pos(endLine, 0))};
- }
-
- // Generic utilities
-
- var cmpPos = CodeMirror.cmpPos;
-
- function elt(tagname, cls /*, ... elts*/) {
- var e = document.createElement(tagname);
- if (cls) e.className = cls;
- for (var i = 2; i < arguments.length; ++i) {
- var elt = arguments[i];
- if (typeof elt == "string") elt = document.createTextNode(elt);
- e.appendChild(elt);
- }
- return e;
- }
-
- function dialog(cm, text, f) {
- if (cm.openDialog)
- cm.openDialog(text + ":
", f);
- else
- f(prompt(text, ""));
- }
-
- // Tooltips
-
- function tempTooltip(cm, content) {
- if (cm.state.ternTooltip) remove(cm.state.ternTooltip);
- var where = cm.cursorCoords();
- 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);
- }
- 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) {
- var node = elt("div", cls + "tooltip", content);
- node.style.left = x + "px";
- node.style.top = y + "px";
- document.body.appendChild(node);
- return node;
- }
-
- function remove(node) {
- var p = node && node.parentNode;
- if (p) p.removeChild(node);
- }
-
- function fadeOut(tooltip) {
- tooltip.style.opacity = "0";
- setTimeout(function() { remove(tooltip); }, 1100);
- }
-
- function showError(ts, cm, msg) {
- if (ts.options.showError)
- ts.options.showError(cm, msg);
- else
- tempTooltip(cm, String(msg));
- }
-
- function closeArgHints(ts) {
- if (ts.activeArgHints) { remove(ts.activeArgHints); ts.activeArgHints = null; }
- }
-
- function docValue(ts, doc) {
- var val = doc.doc.getValue();
- if (ts.options.fileFilter) val = ts.options.fileFilter(val, doc.name, doc.doc);
- return val;
- }
-
- // Worker wrapper
-
- function WorkerServer(ts) {
- var worker = ts.worker = new Worker(ts.options.workerScript);
- worker.postMessage({type: "init",
- defs: ts.options.defs,
- plugins: ts.options.plugins,
- scripts: ts.options.workerDeps});
- var msgId = 0, pending = {};
-
- function send(data, c) {
- if (c) {
- data.id = ++msgId;
- pending[msgId] = c;
- }
- worker.postMessage(data);
- }
- worker.onmessage = function(e) {
- var data = e.data;
- if (data.type == "getFile") {
- getFile(ts, data.name, function(err, text) {
- send({type: "getFile", err: String(err), text: text, id: data.id});
- });
- } else if (data.type == "debug") {
- window.console.log(data.message);
- } else if (data.id && pending[data.id]) {
- pending[data.id](data.err, data.body);
- delete pending[data.id];
- }
- };
- worker.onerror = function(e) {
- for (var id in pending) pending[id](e);
- pending = {};
- };
-
- this.addFile = function(name, text) { send({type: "add", name: name, text: text}); };
- this.delFile = function(name) { send({type: "del", name: name}); };
- this.request = function(body, c) { send({type: "req", body: body}, c); };
- }
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/worker.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/worker.js
deleted file mode 100644
index 887f906..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/tern/worker.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// declare global: tern, server
-
-var server;
-
-this.onmessage = function(e) {
- var data = e.data;
- switch (data.type) {
- case "init": return startServer(data.defs, data.plugins, data.scripts);
- case "add": return server.addFile(data.name, data.text);
- case "del": return server.delFile(data.name);
- case "req": return server.request(data.body, function(err, reqData) {
- postMessage({id: data.id, body: reqData, err: err && String(err)});
- });
- case "getFile":
- var c = pending[data.id];
- delete pending[data.id];
- return c(data.err, data.text);
- default: throw new Error("Unknown message type: " + data.type);
- }
-};
-
-var nextId = 0, pending = {};
-function getFile(file, c) {
- postMessage({type: "getFile", name: file, id: ++nextId});
- pending[nextId] = c;
-}
-
-function startServer(defs, plugins, scripts) {
- if (scripts) importScripts.apply(null, scripts);
-
- server = new tern.Server({
- getFile: getFile,
- async: true,
- defs: defs,
- plugins: plugins
- });
-}
-
-this.console = {
- log: function(v) { postMessage({type: "debug", message: v}); }
-};
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/wrap/hardwrap.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/wrap/hardwrap.js
deleted file mode 100644
index fe9b4dd..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/addon/wrap/hardwrap.js
+++ /dev/null
@@ -1,139 +0,0 @@
-// 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 findParagraph(cm, pos, options) {
- var startRE = options.paragraphStart || cm.getHelper(pos, "paragraphStart");
- for (var start = pos.line, first = cm.firstLine(); start > first; --start) {
- var line = cm.getLine(start);
- if (startRE && startRE.test(line)) break;
- if (!/\S/.test(line)) { ++start; break; }
- }
- var endRE = options.paragraphEnd || cm.getHelper(pos, "paragraphEnd");
- for (var end = pos.line + 1, last = cm.lastLine(); end <= last; ++end) {
- var line = cm.getLine(end);
- if (endRE && endRE.test(line)) { ++end; break; }
- if (!/\S/.test(line)) break;
- }
- return {from: start, to: end};
- }
-
- function findBreakPoint(text, column, wrapOn, killTrailingSpace) {
- for (var at = column; at > 0; --at)
- if (wrapOn.test(text.slice(at - 1, at + 1))) break;
- if (at == 0) at = column;
- var endOfText = at;
- if (killTrailingSpace)
- while (text.charAt(endOfText - 1) == " ") --endOfText;
- return {from: endOfText, to: at};
- }
-
- function wrapRange(cm, from, to, options) {
- from = cm.clipPos(from); to = cm.clipPos(to);
- var column = options.column || 80;
- var wrapOn = options.wrapOn || /\s\S|-[^\.\d]/;
- var killTrailing = options.killTrailingSpace !== false;
- var changes = [], curLine = "", curNo = from.line;
- var lines = cm.getRange(from, to, false);
- if (!lines.length) return null;
- var leadingSpace = lines[0].match(/^[ \t]*/)[0];
-
- for (var i = 0; i < lines.length; ++i) {
- var text = lines[i], oldLen = curLine.length, spaceInserted = 0;
- if (curLine && text && !wrapOn.test(curLine.charAt(curLine.length - 1) + text.charAt(0))) {
- curLine += " ";
- spaceInserted = 1;
- }
- var spaceTrimmed = "";
- if (i) {
- spaceTrimmed = text.match(/^\s*/)[0];
- text = text.slice(spaceTrimmed.length);
- }
- curLine += text;
- if (i) {
- var firstBreak = curLine.length > column && leadingSpace == spaceTrimmed &&
- findBreakPoint(curLine, column, wrapOn, killTrailing);
- // If this isn't broken, or is broken at a different point, remove old break
- if (!firstBreak || firstBreak.from != oldLen || firstBreak.to != oldLen + spaceInserted) {
- changes.push({text: [spaceInserted ? " " : ""],
- from: Pos(curNo, oldLen),
- to: Pos(curNo + 1, spaceTrimmed.length)});
- } else {
- curLine = leadingSpace + text;
- ++curNo;
- }
- }
- while (curLine.length > column) {
- var bp = findBreakPoint(curLine, column, wrapOn, killTrailing);
- changes.push({text: ["", leadingSpace],
- from: Pos(curNo, bp.from),
- to: Pos(curNo, bp.to)});
- curLine = leadingSpace + curLine.slice(bp.to);
- ++curNo;
- }
- }
- if (changes.length) cm.operation(function() {
- for (var i = 0; i < changes.length; ++i) {
- var change = changes[i];
- cm.replaceRange(change.text, change.from, change.to);
- }
- });
- return changes.length ? {from: changes[0].from, to: CodeMirror.changeEnd(changes[changes.length - 1])} : null;
- }
-
- CodeMirror.defineExtension("wrapParagraph", function(pos, options) {
- options = options || {};
- if (!pos) pos = this.getCursor();
- var para = findParagraph(this, pos, options);
- return wrapRange(this, Pos(para.from, 0), Pos(para.to - 1), options);
- });
-
- CodeMirror.commands.wrapLines = function(cm) {
- cm.operation(function() {
- var ranges = cm.listSelections(), at = cm.lastLine() + 1;
- for (var i = ranges.length - 1; i >= 0; i--) {
- var range = ranges[i], span;
- if (range.empty()) {
- var para = findParagraph(cm, range.head, {});
- span = {from: Pos(para.from, 0), to: Pos(para.to - 1)};
- } else {
- span = {from: range.from(), to: range.to()};
- }
- if (span.to.line >= at) continue;
- at = span.from.line;
- wrapRange(cm, span.from, span.to, {});
- }
- });
- };
-
- CodeMirror.defineExtension("wrapRange", function(from, to, options) {
- return wrapRange(this, from, to, options || {});
- });
-
- CodeMirror.defineExtension("wrapParagraphsInRange", function(from, to, options) {
- options = options || {};
- var cm = this, paras = [];
- for (var line = from.line; line <= to.line;) {
- var para = findParagraph(cm, Pos(line, 0), options);
- paras.push(para);
- line = para.to;
- }
- var madeChange = false;
- if (paras.length) cm.operation(function() {
- for (var i = paras.length - 1; i >= 0; --i)
- madeChange = madeChange || wrapRange(cm, Pos(paras[i].from, 0), Pos(paras[i].to - 1), options);
- });
- return madeChange;
- });
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/authors.sh b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/authors.sh
deleted file mode 100644
index b3ee99c..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/authors.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Combine existing list of authors with everyone known in git, sort, add header.
-tail --lines=+3 AUTHORS > AUTHORS.tmp
-git log --format='%aN' >> AUTHORS.tmp
-echo -e "List of CodeMirror contributors. Updated before every release.\n" > AUTHORS
-sort -u AUTHORS.tmp >> AUTHORS
-rm -f AUTHORS.tmp
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/compress b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/compress
deleted file mode 100644
index 809fbe8..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/compress
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env node
-
-// Compression helper for CodeMirror
-//
-// Example:
-//
-// bin/compress codemirror runmode javascript xml
-//
-// Will take lib/codemirror.js, addon/runmode/runmode.js,
-// mode/javascript/javascript.js, and mode/xml/xml.js, run them though
-// the online minifier at http://marijnhaverbeke.nl/uglifyjs, and spit
-// out the result.
-//
-// bin/compress codemirror --local /path/to/bin/UglifyJS
-//
-// Will use a local minifier instead of the online default one.
-//
-// Script files are specified without .js ending. Prefixing them with
-// their full (local) path is optional. So you may say lib/codemirror
-// or mode/xml/xml to be more precise. In fact, even the .js suffix
-// may be speficied, if wanted.
-
-"use strict";
-
-var fs = require("fs");
-
-function help(ok) {
- console.log("usage: " + process.argv[1] + " [--local /path/to/uglifyjs] files...");
- process.exit(ok ? 0 : 1);
-}
-
-var local = null, args = [], extraArgs = null, files = [], blob = "";
-
-for (var i = 2; i < process.argv.length; ++i) {
- var arg = process.argv[i];
- if (arg == "--local" && i + 1 < process.argv.length) {
- var parts = process.argv[++i].split(/\s+/);
- local = parts[0];
- extraArgs = parts.slice(1);
- if (!extraArgs.length) extraArgs = ["-c", "-m"];
- } else if (arg == "--help") {
- help(true);
- } else if (arg[0] != "-") {
- files.push({name: arg, re: new RegExp("(?:\\/|^)" + arg + (/\.js$/.test(arg) ? "$" : "\\.js$"))});
- } else help(false);
-}
-
-function walk(dir) {
- fs.readdirSync(dir).forEach(function(fname) {
- if (/^[_\.]/.test(fname)) return;
- var file = dir + fname;
- if (fs.statSync(file).isDirectory()) return walk(file + "/");
- if (files.some(function(spec, i) {
- var match = spec.re.test(file);
- if (match) files.splice(i, 1);
- return match;
- })) {
- if (local) args.push(file);
- else blob += fs.readFileSync(file, "utf8");
- }
- });
-}
-
-walk("lib/");
-walk("addon/");
-walk("mode/");
-
-if (!local && !blob) help(false);
-
-if (files.length) {
- console.log("Some speficied files were not found: " +
- files.map(function(a){return a.name;}).join(", "));
- process.exit(1);
-}
-
-if (local) {
- require("child_process").spawn(local, args.concat(extraArgs), {stdio: ["ignore", process.stdout, process.stderr]});
-} else {
- var data = new Buffer("js_code=" + require("querystring").escape(blob), "utf8");
- var req = require("http").request({
- host: "marijnhaverbeke.nl",
- port: 80,
- method: "POST",
- path: "/uglifyjs",
- headers: {"content-type": "application/x-www-form-urlencoded",
- "content-length": data.length}
- });
- req.on("response", function(resp) {
- resp.on("data", function (chunk) { process.stdout.write(chunk); });
- });
- req.end(data);
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/lint b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/lint
deleted file mode 100644
index 47f45f3..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/lint
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env node
-
-process.exit(require("../test/lint").ok ? 0 : 1);
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/release b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/release
deleted file mode 100644
index b782739..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/release
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env node
-
-var fs = require("fs"), child = require("child_process");
-
-var number, bumpOnly;
-
-for (var i = 2; i < process.argv.length; i++) {
- if (process.argv[i] == "-bump") bumpOnly = true;
- else if (/^\d+\.\d+\.\d+$/.test(process.argv[i])) number = process.argv[i];
- else { console.log("Bogus command line arg: " + process.argv[i]); process.exit(1); }
-}
-
-if (!number) { console.log("Must give a version"); process.exit(1); }
-
-function rewrite(file, f) {
- fs.writeFileSync(file, f(fs.readFileSync(file, "utf8")), "utf8");
-}
-
-rewrite("lib/codemirror.js", function(lib) {
- return lib.replace(/CodeMirror\.version = "\d+\.\d+\.\d+"/,
- "CodeMirror.version = \"" + number + "\"");
-});
-function rewriteJSON(pack) {
- return pack.replace(/"version":"\d+\.\d+\.\d+"/, "\"version\":\"" + number + "\"");
-}
-rewrite("package.json", rewriteJSON);
-rewrite("doc/manual.html", function(manual) {
- return manual.replace(/>version \d+\.\d+\.\d+<\/span>/, ">version " + number + "");
-});
-
-if (bumpOnly) process.exit(0);
-
-child.exec("bash bin/authors.sh", function(){});
-
-var simple = number.slice(0, number.lastIndexOf("."));
-
-rewrite("doc/compress.html", function(cmp) {
- return cmp.replace(/
HEAD<\/option>/,
- " HEAD \n
" + simple + " ");
-});
-
-rewrite("index.html", function(index) {
- return index.replace(/\.zip">\d+\.\d+<\/a>/,
- ".zip\">" + simple + "");
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/source-highlight b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/source-highlight
deleted file mode 100644
index 6d15f1a..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bin/source-highlight
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env node
-
-// Simple command-line code highlighting tool. Reads code from stdin,
-// spits html to stdout. For example:
-//
-// echo 'function foo(a) { return a; }' | bin/source-highlight -s javascript
-// bin/source-highlight -s
-
-var fs = require("fs");
-
-var CodeMirror = require("../addon/runmode/runmode.node.js");
-require("../mode/meta.js");
-
-var sPos = process.argv.indexOf("-s");
-if (sPos == -1 || sPos == process.argv.length - 1) {
- console.error("Usage: source-highlight -s language");
- process.exit(1);
-}
-var lang = process.argv[sPos + 1].toLowerCase(), modeName = lang;
-CodeMirror.modeInfo.forEach(function(info) {
- if (info.mime == lang) {
- modeName = info.mode;
- } else if (info.name.toLowerCase() == lang) {
- modeName = info.mode;
- lang = info.mime;
- }
-});
-
-if (!CodeMirror.modes[modeName])
- require("../mode/" + modeName + "/" + modeName + ".js");
-
-function esc(str) {
- return str.replace(/[<&]/g, function(ch) { return ch == "&" ? "&" : "<"; });
-}
-
-var code = fs.readFileSync("/dev/stdin", "utf8");
-var curStyle = null, accum = "";
-function flush() {
- if (curStyle) process.stdout.write("
" + esc(accum) + " ");
- else process.stdout.write(esc(accum));
-}
-
-CodeMirror.runMode(code, lang, function(text, style) {
- if (style != curStyle) {
- flush();
- curStyle = style; accum = text;
- } else {
- accum += text;
- }
-});
-flush();
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bower.json b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bower.json
deleted file mode 100644
index 903d9f5..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/bower.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "codemirror",
- "main": ["lib/codemirror.js", "lib/codemirror.css"],
- "ignore": [
- "**/.*",
- "node_modules",
- "components",
- "bin",
- "demo",
- "doc",
- "test",
- "index.html",
- "package.json",
- "mode/*/*test.js",
- "mode/*/*.html"
- ]
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/activeline.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/activeline.html
deleted file mode 100644
index 741f6c4..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/activeline.html
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
CodeMirror: Active Line Demo
-
-
-
-
-
-
-
-
-
-
-
-Active Line Demo
-
-
-
-
- Styling the current cursor line.
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/anywordhint.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/anywordhint.html
deleted file mode 100644
index 0a7caec..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/anywordhint.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
CodeMirror: Any Word Completion Demo
-
-
-
-
-
-
-
-
-
-
-
-
-Any Word Completion Demo
-
-(function() {
- "use strict";
-
- var WORD = /[\w$]+/g, RANGE = 500;
-
- CodeMirror.registerHelper("hint", "anyword", function(editor, options) {
- var word = options && options.word || WORD;
- var range = options && options.range || RANGE;
- var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
- var start = cur.ch, end = start;
- while (end < curLine.length && word.test(curLine.charAt(end))) ++end;
- while (start && word.test(curLine.charAt(start - 1))) --start;
- var curWord = start != end && curLine.slice(start, end);
-
- var list = [], seen = {};
- function scan(dir) {
- var line = cur.line, end = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir;
- for (; line != end; line += dir) {
- var text = editor.getLine(line), m;
- word.lastIndex = 0;
- while (m = word.exec(text)) {
- if ((!curWord || m[0].indexOf(curWord) == 0) && !seen.hasOwnProperty(m[0])) {
- seen[m[0]] = true;
- list.push(m[0]);
- }
- }
- }
- }
- scan(-1);
- scan(1);
- return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};
- });
-})();
-
-
-Press ctrl-space to activate autocompletion. The
-completion uses
-the anyword-hint.js
-module, which simply looks at nearby words in the buffer and completes
-to those.
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/bidi.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/bidi.html
deleted file mode 100644
index 6dd73be..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/bidi.html
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
CodeMirror: Bi-directional Text Demo
-
-
-
-
-
-
-
-
-
-
-Bi-directional Text Demo
-
-
-
- value (string or Doc)
- قيمة البداية المحرر. يمكن أن تكون سلسلة، أو. كائن مستند.
- mode (string or object)
- وضع الاستخدام. عندما لا تعطى، وهذا الافتراضي إلى الطريقة الاولى
- التي تم تحميلها. قد يكون من سلسلة، والتي إما أسماء أو ببساطة هو وضع
- MIME نوع المرتبطة اسطة. بدلا من ذلك، قد يكون من كائن يحتوي على
- خيارات التكوين لواسطة، مع name الخاصية التي وضع أسماء
- (على سبيل المثال {name: "javascript", json: true}).
- صفحات التجريبي لكل وضع تحتوي على معلومات حول ما معلمات تكوين وضع
- يدعمها. يمكنك أن تطلب CodeMirror التي تم تعريفها طرق وأنواع MIME
- الكشف على CodeMirror.modes
- و CodeMirror.mimeModes الكائنات. وضع خرائط الأسماء
- الأولى لمنشئات الخاصة بهم، وخرائط لأنواع MIME 2 المواصفات
- واسطة.
- theme (string)
- موضوع لنمط المحرر مع. يجب عليك التأكد من الملف CSS تحديد
- المقابلة .cm-s-[name] يتم تحميل أنماط (انظر
- theme الدليل في التوزيع).
- الافتراضي هو "default" ، والتي تم تضمينها في
- الألوان codemirror.css. فمن الممكن استخدام فئات متعددة
- في تطبيق السمات مرة واحدة على سبيل المثال "foo bar"
- سيتم تعيين كل من cm-s-foo و cm-s-bar
- الطبقات إلى المحرر.
-
-
-
-
-
- Demonstration of bi-directional text support. See
- the related
- blog post for more background.
-
- Note: There is
- a known
- bug with cursor motion and mouse clicks in bi-directional lines
- that are line wrapped.
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/btree.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/btree.html
deleted file mode 100644
index fc4997f..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/btree.html
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
CodeMirror: B-Tree visualization
-
-
-
-
-
-
-
-
-
-B-Tree visualization
-type here, see a summary of the document b-tree below
-
-
-
-
-
-
-
Add a lot of content
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/buffers.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/buffers.html
deleted file mode 100644
index 16ffc7d..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/buffers.html
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
CodeMirror: Multiple Buffer & Split View Demo
-
-
-
-
-
-
-
-
-
-
-
-Multiple Buffer & Split View Demo
-
-
-
-
- Select buffer:
- New buffer
-
-
-
- Select buffer:
- New buffer
-
-
-
-
- Demonstration of
- using linked documents
- to provide a split view on a document, and
- using swapDoc
- to use a single editor to display multiple documents.
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/changemode.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/changemode.html
deleted file mode 100644
index 9405932..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/changemode.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
CodeMirror: Mode-Changing Demo
-
-
-
-
-
-
-
-
-
-
-
-Mode-Changing Demo
-
-;; If there is Scheme code in here, the editor will be in Scheme mode.
-;; If you put in JS instead, it'll switch to JS mode.
-
-(define (double x)
- (* x x))
-
-
-On changes to the content of the above editor, a (crude) script
-tries to auto-detect the language used, and switches the editor to
-either JavaScript or Scheme mode based on that.
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closebrackets.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closebrackets.html
deleted file mode 100644
index d702f52..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closebrackets.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
CodeMirror: Closebrackets Demo
-
-
-
-
-
-
-
-
-
-
-
-Closebrackets Demo
-function Grid(width, height) {
- this.width = width;
- this.height = height;
- this.cells = new Array(width * height);
-}
-Grid.prototype.valueAt = function(point) {
- return this.cells[point.y * this.width + point.x];
-};
-Grid.prototype.setValueAt = function(point, value) {
- this.cells[point.y * this.width + point.x] = value;
-};
-Grid.prototype.isInside = function(point) {
- return point.x >= 0 && point.y >= 0 &&
- point.x < this.width && point.y < this.height;
-};
-Grid.prototype.moveValue = function(from, to) {
- this.setValueAt(to, this.valueAt(from));
- this.setValueAt(from, undefined);
-};
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closetag.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closetag.html
deleted file mode 100644
index 79959d2..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/closetag.html
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
CodeMirror: Close-Tag Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Close-Tag Demo
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/complete.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/complete.html
deleted file mode 100644
index cdf49db..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/complete.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
CodeMirror: Autocomplete Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-Autocomplete Demo
-
-function getCompletions(token, context) {
- var found = [], start = token.string;
- function maybeAdd(str) {
- if (str.indexOf(start) == 0) found.push(str);
- }
- function gatherCompletions(obj) {
- if (typeof obj == "string") forEach(stringProps, maybeAdd);
- else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
- else if (obj instanceof Function) forEach(funcProps, maybeAdd);
- for (var name in obj) maybeAdd(name);
- }
-
- if (context) {
- // If this is a property, see if it belongs to some object we can
- // find in the current environment.
- var obj = context.pop(), base;
- if (obj.className == "js-variable")
- base = window[obj.string];
- else if (obj.className == "js-string")
- base = "";
- else if (obj.className == "js-atom")
- base = 1;
- while (base != null && context.length)
- base = base[context.pop().string];
- if (base != null) gatherCompletions(base);
- }
- else {
- // If not, just look in the window object and any local scope
- // (reading into JS mode internals to get at the local variables)
- for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
- gatherCompletions(window);
- forEach(keywords, maybeAdd);
- }
- return found;
-}
-
-
-Press ctrl-space to activate autocompletion. Built
-on top of the show-hint
-and javascript-hint
-addons.
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/emacs.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/emacs.html
deleted file mode 100644
index c626b8d..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/emacs.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
CodeMirror: Emacs bindings demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Emacs bindings demo
-
-#include "syscalls.h"
-/* getchar: simple buffered version */
-int getchar(void)
-{
- static char buf[BUFSIZ];
- static char *bufp = buf;
- static int n = 0;
- if (n == 0) { /* buffer is empty */
- n = read(0, buf, sizeof buf);
- bufp = buf;
- }
- return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
-}
-
-
-The emacs keybindings are enabled by
-including keymap/emacs.js and setting
-the keyMap option to "emacs". Because
-CodeMirror's internal API is quite different from Emacs, they are only
-a loose approximation of actual emacs bindings, though.
-
-Also note that a lot of browsers disallow certain keys from being
-captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the
-result that idiomatic use of Emacs keys will constantly close your tab
-or open a new window.
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/folding.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/folding.html
deleted file mode 100644
index 81cbf98..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/folding.html
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
CodeMirror: Code Folding Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code Folding Demo
-
- JavaScript:
-
- HTML:
-
- Markdown:
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/fullscreen.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/fullscreen.html
deleted file mode 100644
index 1fbdc48..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/fullscreen.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
CodeMirror: Full Screen Editing
-
-
-
-
-
-
-
-
-
-
-
-
-
-Full Screen Editing
-
-
- indentWithTabs : boolean
- Whether, when indenting, the first N*tabSize
- spaces should be replaced by N tabs. Default is false.
-
- electricChars : boolean
- Configures whether the editor should re-indent the current
- line when a character is typed that might change its proper
- indentation (only works if the mode supports indentation).
- Default is true.
-
- specialChars : RegExp
- A regular expression used to determine which characters
- should be replaced by a
- special placeholder .
- Mostly useful for non-printing special characters. The default
- is /[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/.
- specialCharPlaceholder : function(char) → Element
- A function that, given a special character identified by
- the specialChars
- option, produces a DOM node that is used to represent the
- character. By default, a red dot (• )
- is shown, with a title tooltip to indicate the character code.
-
- rtlMoveVisually : boolean
- Determines whether horizontal cursor movement through
- right-to-left (Arabic, Hebrew) text is visual (pressing the left
- arrow moves the cursor left) or logical (pressing the left arrow
- moves to the next lower index in the string, which is visually
- right in right-to-left text). The default is false
- on Windows, and true on other platforms.
-
-
-
-
- Demonstration of
- the fullscreen
- addon. Press F11 when cursor is in the editor to
- toggle full screen editing. Esc can also be used
- to exit full screen editing.
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/hardwrap.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/hardwrap.html
deleted file mode 100644
index f1a870b..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/hardwrap.html
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
CodeMirror: Hard-wrapping Demo
-
-
-
-
-
-
-
-
-
-
-
-Hard-wrapping Demo
-Lorem ipsum dolor sit amet, vim augue dictas constituto ex,
-sit falli simul viderer te. Graeco scaevola maluisset sit
-ut, in idque viris praesent sea. Ea sea eirmod indoctum
-repudiare. Vel noluisse suscipit pericula ut. In ius nulla
-alienum molestie. Mei essent discere democritum id.
-
-Equidem ponderum expetendis ius in, mea an erroribus
-constituto, congue timeam perfecto ad est. Ius ut primis
-timeam, per in ullum mediocrem. An case vero labitur pri,
-vel dicit laoreet et. An qui prompta conclusionemque, eam
-timeam sapientem in, cum dictas epicurei eu.
-
-Usu cu vide dictas deseruisse, eum choro graece adipiscing
-ut. Cibo qualisque ius ad, et dicat scripta mea, eam nihil
-mentitum aliquando cu. Debet aperiam splendide at quo, ad
-paulo nostro commodo duo. Sea adhuc utinam conclusionemque
-id, quas doming malorum nec ad. Tollit eruditi vivendum ad
-ius, eos soleat ignota ad.
-
-
-Demonstration of
-the hardwrap addon.
-The above editor has its change event hooked up to
-the wrapParagraphsInRange method, so that the paragraphs
-are reflown as you are typing.
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/html5complete.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/html5complete.html
deleted file mode 100644
index 411baae..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/html5complete.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
CodeMirror: HTML completion demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- HTML completion demo
-
- Shows the XML completer
- parameterized with information about the tags in HTML.
- Press ctrl-space to activate completion.
-
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/indentwrap.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/indentwrap.html
deleted file mode 100644
index 3d3d0af..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/indentwrap.html
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
CodeMirror: Indented wrapped line demo
-
-
-
-
-
-
-
-
-
-
-Indented wrapped line demo
-
-
-
- Overview
-
- CodeMirror is a code-editor component that can be embedded in Web pages. The core library provides only the editor component, no accompanying buttons, auto-completion, or other IDE functionality. It does provide a rich API on top of which such functionality can be straightforwardly implemented. See the add-ons included in the distribution, and the CodeMirror UI project, for reusable implementations of extra features.
-
- CodeMirror works with language-specific modes. Modes are JavaScript programs that help color (and optionally indent) text written in a given language. The distribution comes with a number of modes (see the mode/ directory), and it isn't hard to write new ones for other languages.
-
-
-
- This page uses a hack on top of the "renderLine"
- event to make wrapped text line up with the base indentation of
- the line.
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/lint.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/lint.html
deleted file mode 100644
index 29936a8..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/lint.html
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
CodeMirror: Linter Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Linter Demo
-
-
- var widgets = []
-function updateHints() {
- editor.operation(function(){
- for (var i = 0; i < widgets.length; ++i)
- editor.removeLineWidget(widgets[i]);
- widgets.length = 0;
-
- JSHINT(editor.getValue());
- for (var i = 0; i < JSHINT.errors.length; ++i) {
- var err = JSHINT.errors[i];
- if (!err) continue;
- var msg = document.createElement("div");
- var icon = msg.appendChild(document.createElement("span"));
- icon.innerHTML = "!!";
- icon.className = "lint-error-icon";
- msg.appendChild(document.createTextNode(err.reason));
- msg.className = "lint-error";
- widgets.push(editor.addLineWidget(err.line - 1, msg, {coverGutter: false, noHScroll: true}));
- }
- });
- var info = editor.getScrollInfo();
- var after = editor.charCoords({line: editor.getCursor().line + 1, ch: 0}, "local").top;
- if (info.top + info.clientHeight < after)
- editor.scrollTo(null, after - info.clientHeight + 3);
-}
-
-
- [
- {
- _id: "post 1",
- "author": "Bob",
- "content": "...",
- "page_views": 5
- },
- {
- "_id": "post 2",
- "author": "Bob",
- "content": "...",
- "page_views": 9
- },
- {
- "_id": "post 3",
- "author": "Bob",
- "content": "...",
- "page_views": 8
- }
-]
-
-
- @charset "UTF-8";
-
-@import url("booya.css") print, screen;
-@import "whatup.css" screen;
-@import "wicked.css";
-
-/*Error*/
-@charset "UTF-8";
-
-
-@namespace "http://www.w3.org/1999/xhtml";
-@namespace svg "http://www.w3.org/2000/svg";
-
-/*Warning: empty ruleset */
-.foo {
-}
-
-h1 {
- font-weight: bold;
-}
-
-/*Warning: qualified heading */
-.foo h1 {
- font-weight: bold;
-}
-
-/*Warning: adjoining classes */
-.foo.bar {
- zoom: 1;
-}
-
-li.inline {
- width: 100%; /*Warning: 100% can be problematic*/
-}
-
-li.last {
- display: inline;
- padding-left: 3px !important;
- padding-right: 3px;
- border-right: 0px;
-}
-
-@media print {
- li.inline {
- color: black;
- }
-}
-
-@page {
- margin: 10%;
- counter-increment: page;
-
- @top-center {
- font-family: sans-serif;
- font-weight: bold;
- font-size: 2em;
- content: counter(page);
- }
-}
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/loadmode.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/loadmode.html
deleted file mode 100644
index 809cd90..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/loadmode.html
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
CodeMirror: Lazy Mode Loading Demo
-
-
-
-
-
-
-
-
-
-
-
-Lazy Mode Loading Demo
-Current mode: text/plain
-This is the editor.
-// It starts out in plain text mode,
-# use the control below to load and apply a mode
- "you'll see the highlighting of" this text /*change*/.
-
-Filename, mime, or mode name: change mode
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/marker.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/marker.html
deleted file mode 100644
index 3a8b850..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/marker.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
CodeMirror: Breakpoint Demo
-
-
-
-
-
-
-
-
-
-
-Breakpoint Demo
-
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
- lineNumbers: true,
- gutters: ["CodeMirror-linenumbers", "breakpoints"]
-});
-editor.on("gutterClick", function(cm, n) {
- var info = cm.lineInfo(n);
- cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker());
-});
-
-function makeMarker() {
- var marker = document.createElement("div");
- marker.style.color = "#822";
- marker.innerHTML = "●";
- return marker;
-}
-
-
-Click the line-number gutter to add or remove 'breakpoints'.
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/markselection.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/markselection.html
deleted file mode 100644
index d4c8a7a..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/markselection.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
CodeMirror: Selection Marking Demo
-
-
-
-
-
-
-
-
-
-
-
-Selection Marking Demo
-
-Select something from here. You'll see that the selection's foreground
-color changes to white! Since, by default, CodeMirror only puts an
-independent "marker" layer behind the text, you'll need something like
-this to change its colour.
-
-Also notice that turning this addon on (with the default style) allows
-you to safely give text a background color without screwing up the
-visibility of the selection.
-
-
-
- Simple addon to easily mark (and style) selected text. Docs .
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchhighlighter.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchhighlighter.html
deleted file mode 100644
index c601090..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchhighlighter.html
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
CodeMirror: Match Highlighter Demo
-
-
-
-
-
-
-
-
-
-
-
-Match Highlighter Demo
-Select this text: hardToSpotVar
- And everywhere else in your code where hardToSpotVar appears will automatically illuminate.
-Give it a try! No more hardToSpotVars.
-
-
-
- Search and highlight occurences of the selected text.
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchtags.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchtags.html
deleted file mode 100644
index 175639a..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/matchtags.html
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
CodeMirror: Tag Matcher Demo
-
-
-
-
-
-
-
-
-
-
-
-
-Tag Matcher Demo
-
-
-
-
-
-
- Put the cursor on or inside a pair of tags to highlight them.
- Press Ctrl-J to jump to the tag that matches the one under the
- cursor.
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/merge.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/merge.html
deleted file mode 100644
index c60e653..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/merge.html
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
-
CodeMirror: merge view demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-merge view demo
-
-
-
-
-The merge
-addon provides an interface for displaying and merging diffs,
-either two-way
-or three-way .
-The left (or center) pane is editable, and the differences with the
-other pane(s) are optionally shown live as you edit
-it. In the two-way configuration, there are also options to pad changed
-sections to align them, and to collapse unchanged
-stretches of text.
-
-This addon depends on
-the google-diff-match-patch
-library to compute the diffs.
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/multiplex.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/multiplex.html
deleted file mode 100644
index ca8c80a..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/multiplex.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
CodeMirror: Multiplexing Parser Demo
-
-
-
-
-
-
-
-
-
-
-
-Multiplexing Parser Demo
-
-
-
- << this is not >
- <<
- multiline
- not html
- at all : &
- >>
- this is html again
-
-
-
-
-
-
- Demonstration of a multiplexing mode, which, at certain
- boundary strings, switches to one or more inner modes. The out
- (HTML) mode does not get fed the content of the <<
- >> blocks. See
- the manual and
- the source for more
- information.
-
-
- Parsing/Highlighting Tests:
- normal ,
- verbose .
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/mustache.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/mustache.html
deleted file mode 100644
index ae4e6a8..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/mustache.html
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
CodeMirror: Overlay Parser Demo
-
-
-
-
-
-
-
-
-
-
-
-Overlay Parser Demo
-
-
-
- {{title}}
- These are links to {{things}}:
-
-
-
-
-
-
-
- Demonstration of a mode that parses HTML, highlighting
- the Mustache templating
- directives inside of it by using the code
- in overlay.js . View
- source to see the 15 lines of code needed to accomplish this.
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/panel.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/panel.html
deleted file mode 100644
index b3b0b7c..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/panel.html
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
-
CodeMirror: Panel Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Panel Demo
-
-
-
-
-
-
- The panel
- addon allows you to display panels above or below an editor.
-
- Click the links below to add panels at the given position:
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/placeholder.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/placeholder.html
deleted file mode 100644
index 432331a..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/placeholder.html
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
CodeMirror: Placeholder demo
-
-
-
-
-
-
-
-
-
-
-Placeholder demo
-
-
- The placeholder
- plug-in adds an option placeholder that can be set to
- make text appear in the editor when it is empty and not focused.
- If the source textarea has a placeholder attribute,
- it will automatically be inherited.
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/preview.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/preview.html
deleted file mode 100644
index 19e1530..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/preview.html
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
CodeMirror: HTML5 preview
-
-
-
-
-
-
-
-
-
-
-
-
-
-HTML5 preview
-
-
-
-
-
-
- HTML5 canvas demo
-
-
-
- Canvas pane goes here:
-
-
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/requirejs.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/requirejs.html
deleted file mode 100644
index 438ef9f..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/requirejs.html
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
CodeMirror: HTML completion demo
-
-
-
-
-
-
-
-
-
-
-
-
-
- RequireJS module loading demo
-
- This demo does the same thing as
- the HTML5 completion demo , but
- loads its dependencies
- with Require.js , rather than
- explicitly. Press ctrl-space to activate
- completion.
-
-
-
- Dynamically load Markdown mode
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/resize.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/resize.html
deleted file mode 100644
index 1c1ef39..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/resize.html
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
CodeMirror: Autoresize Demo
-
-
-
-
-
-
-
-
-
-
-Autoresize Demo
-
-.CodeMirror {
- border: 1px solid #eee;
- height: auto;
-}
-
-
-By setting an editor's height style
-to auto and giving
-the viewportMargin
-a value of Infinity, CodeMirror can be made to
-automatically resize to fit its content.
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/rulers.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/rulers.html
deleted file mode 100644
index 2ac4111..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/rulers.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
CodeMirror: Ruler Demo
-
-
-
-
-
-
-
-
-
-
-Ruler Demo
-
-
-
-Demonstration of
-the rulers addon, which
-displays vertical lines at given column offsets.
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/runmode.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/runmode.html
deleted file mode 100644
index 257f03d..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/runmode.html
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
CodeMirror: Mode Runner Demo
-
-
-
-
-
-
-
-
-
-
-Mode Runner Demo
-
-
-
-
- Enter your xml here and press the button below to display
- it as highlighted by the CodeMirror XML mode
-
-
- Highlight!
-
-
-
-
- Running a CodeMirror mode outside of the editor.
- The CodeMirror.runMode function, defined
- in lib/runmode.js takes the following arguments:
-
-
- text (string)
- The document to run through the highlighter.
- mode (mode spec )
- The mode to use (must be loaded as normal).
- output (function or DOM node)
- If this is a function, it will be called for each token with
- two arguments, the token's text and the token's style class (may
- be null for unstyled tokens). If it is a DOM node,
- the tokens will be converted to span elements as in
- an editor, and inserted into the node
- (through innerHTML).
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/search.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/search.html
deleted file mode 100644
index 21c3425..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/search.html
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
CodeMirror: Search/Replace Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Search/Replace Demo
-
-
- indentWithTabs : boolean
- Whether, when indenting, the first N*tabSize
- spaces should be replaced by N tabs. Default is false.
-
- electricChars : boolean
- Configures whether the editor should re-indent the current
- line when a character is typed that might change its proper
- indentation (only works if the mode supports indentation).
- Default is true.
-
- specialChars : RegExp
- A regular expression used to determine which characters
- should be replaced by a
- special placeholder .
- Mostly useful for non-printing special characters. The default
- is /[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/.
- specialCharPlaceholder : function(char) → Element
- A function that, given a special character identified by
- the specialChars
- option, produces a DOM node that is used to represent the
- character. By default, a red dot (• )
- is shown, with a title tooltip to indicate the character code.
-
- rtlMoveVisually : boolean
- Determines whether horizontal cursor movement through
- right-to-left (Arabic, Hebrew) text is visual (pressing the left
- arrow moves the cursor left) or logical (pressing the left arrow
- moves to the next lower index in the string, which is visually
- right in right-to-left text). The default is false
- on Windows, and true on other platforms.
-
-
-
-
-
- Demonstration of primitive search/replace functionality. The
- keybindings (which can be configured with custom keymaps) are:
-
- Ctrl-F / Cmd-F Start searching
- Ctrl-G / Cmd-G Find next
- Shift-Ctrl-G / Shift-Cmd-G Find previous
- Shift-Ctrl-F / Cmd-Option-F Replace
- Shift-Ctrl-R / Shift-Cmd-Option-F Replace all
- Alt-F Persistent search (dialog doesn't autoclose, enter to find next, shift-enter to find previous)
-
- Searching is enabled by
- including addon/search/search.js
- and addon/search/searchcursor.js .
- For good-looking input dialogs, you also want to include
- addon/dialog/dialog.js
- and addon/dialog/dialog.css .
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplemode.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplemode.html
deleted file mode 100644
index 49778ef..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplemode.html
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-
CodeMirror: Simple Mode Demo
-
-
-
-
-
-
-
-
-
-
-
-
-Simple Mode Demo
-
-The mode/simple
-addon allows CodeMirror modes to be specified using a relatively simple
-declarative format. This format is not as powerful as writing code
-directly against the mode
-interface , but is a lot easier to get started with, and
-sufficiently expressive for many simple language modes.
-
-This interface is still in flux. It is unlikely to be scrapped or
-overhauled completely, so do start writing code against it, but
-details might change as it stabilizes, and you might have to tweak
-your code when upgrading.
-
-Simple modes (loosely based on
-the Common
-JavaScript Syntax Highlighting Specification , which never took
-off), are state machines, where each state has a number of rules that
-match tokens. A rule describes a type of token that may occur in the
-current state, and possibly a transition to another state caused by
-that token.
-
-The CodeMirror.defineSimpleMode(name, states) method
-takes a mode name and an object that describes the mode's states. The
-editor below shows an example of such a mode (and is itself
-highlighted by the mode shown in it).
-
-
-
-Each state is an array of rules. A rule may have the following properties:
-
-
- regex : string | RegExp
- The regular expression that matches the token. May be a string
- or a regex object. When a regex, the ignoreCase flag
- will be taken into account when matching the token. This regex
- should only capture groups when the token property is
- an array.
- token : string | null
- An optional token style. Multiple styles can be specified by
- separating them with dots or spaces. When the regex for
- this rule captures groups, it must capture all of the
- string (since JS provides no way to find out where a group matched),
- and this property must hold an array of token styles that has one
- style for each matched group.
- sol : boolean
- When true, this token will only match at the start of the line.
- (The ^ regexp marker doesn't work as you'd expect in
- this context because of limitations in JavaScript's RegExp
- API.)
- next : string
- When a next property is present, the mode will
- transfer to the state named by the property when the token is
- encountered.
- push : string
- Like next, but instead replacing the current state
- by the new state, the current state is kept on a stack, and can be
- returned to with the pop directive.
- pop : bool
- When true, and there is another state on the state stack, will
- cause the mode to pop that state off the stack and transition to
- it.
- mode : {spec, end, persistent}
- Can be used to embed another mode inside a mode. When present,
- must hold an object with a spec property that describes
- the embedded mode, and an optional end end property
- that specifies the regexp that will end the extent of the mode. When
- a persistent property is set (and true), the nested
- mode's state will be preserved between occurrences of the mode.
- indent : bool
- When true, this token changes the indentation to be one unit
- more than the current line's indentation.
- dedent : bool
- When true, this token will pop one scope off the indentation
- stack.
- dedentIfLineStart : bool
- If a token has its dedent property set, it will, by
- default, cause lines where it appears at the start to be dedented.
- Set this property to false to prevent that behavior.
-
-
-The meta property of the states object is special, and
-will not be interpreted as a state. Instead, properties set on it will
-be set on the mode, which is useful for properties
-like lineComment ,
-which sets the comment style for a mode. The simple mode addon also
-recognizes a few such properties:
-
-
- dontIndentStates : array<string>
- An array of states in which the mode's auto-indentation should
- not take effect. Usually used for multi-line comment and string
- states.
-
-
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplescrollbars.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplescrollbars.html
deleted file mode 100644
index 9d40932..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/simplescrollbars.html
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
CodeMirror: Simple Scrollbar Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-Simple Scrollbar Demo
-# Custom Scrollbars
-
-This is a piece of text that creates scrollbars
-
-Lorem ipsum dolor sit amet, turpis nec facilisis neque vestibulum adipiscing, magna nunc est luctus orci a,
-aliquam duis ad volutpat nostra. Vestibulum ultricies suspendisse commodo volutpat pede sed. Bibendum odio
-dignissim, ad vitae mollis ac sed nibh quis, suspendisse diam, risus quas blandit phasellus luctus nec,
-integer nunc vitae posuere scelerisque. Lobortis quam porta conubia nulla. Et nisl ac, imperdiet vitae ac.
-Parturient sit. Et vestibulum euismod, rutrum nunc libero mauris purus convallis. Cum id adipiscing et eget
-pretium rutrum, ultrices sapien magnis fringilla sit lorem, eu vitae scelerisque ipsum aliquet, magna sed
-fusce vel.
-
-Lectus ultricies libero dolor convallis, sed etiam vel hendrerit egestas viverra, at urna mauris, eget
-vulputate dolor voluptatem, nulla eget sollicitudin. Sed tincidunt, elit sociis. Mattis mi tortor dui id
-sodales mi, maecenas nam fringilla risus turpis mauris praesent, imperdiet maecenas ultrices nonummy tellus
-quis est. Scelerisque nec pharetra quis varius fringilla. Varius vestibulum non dictum pharetra, tincidunt in
-vestibulum iaculis molestie, id condimentum blandit elit urna magna pulvinar, quam suspendisse pellentesque
-donec. Vel amet ad ac. Nec aut viverra, morbi mi neque massa, turpis enim proin. Tellus eu, fermentum velit
-est convallis aliquam velit, rutrum in diam lacus, praesent tempor pellentesque dictum semper augue. Felis
-explicabo massa amet lectus phasellus dolor. Ut lorem quis arcu neque felis ultricies, senectus vitae
-curabitur sed pellentesque et, id sed risus in sed ac accumsan, blandit arcu quam duis nunc.
-
-Sed leo sollicitudin odio vitae, purus sit egestas, justo eros inceptos auctor fermentum lectus. Ligula luctus
-turpis, quod massa vitae elementum orci, nullam fringilla elit tortor. Justo ante tempor amet quam posuere
-volutpat. Facilisis pede erat ut hac ultrices ipsum, wisi duis sit metus. Dolor vitae est sed sed vitae. Sed
-eu ligula, morbi vestibulum nunc nibh velit ut taciti, ligula elit semper sagittis in, auctor arcu vel eget.
-Mauris at vitae nec suspendisse et, aenean proin blandit suscipit. Morbi quam, dolor ultricies. Viverra
-tempus. Suspendisse sit dapibus, ac fuga aenean, magna nisl nonummy augue posuere, dictum ut fuga velit
-parturient augue interdum, mattis sit tellus.
-
-Vehicula commodo tempus curabitur eros, lacinia erat vulputate lorem vel fermentum donec, lectus sed conubia
-id pellentesque. Vel senectus donec pede aliquet dolor sit, nec vivamus justo placerat interdum maecenas,
-sodales euismod. Quis netus sapien amet, vestibulum quam nec amet lacinia, quis aliquet, tempor vivamus tellus
-enim, suscipit quis eleifend. Amet class phasellus orci pretium, risus in nulla. Neque sit ullamcorper,
-ultricies platea id nec suspendisse ac. Et elementum. Dictum nam, ut dui fermentum egestas facilisis elit
-augue, adipiscing donec ipsum erat nam pellentesque convallis, vestibulum vestibulum risus id nulla ut mauris,
-curabitur aute aptent. Ultrices orci wisi dui ipsum praesent, pharetra felis eu quis. Est fringilla etiam,
-maxime sem dapibus et eget, mi enim dignissim nec pretium, augue vehicula, volutpat proin. Et occaecati
-lobortis viverra, cum in sed, vivamus tellus. Libero at malesuada est vivamus leo tortor.
-
-
-The simplescrollbars addon defines two
-styles of non-native scrollbars: "simple" and "overlay" (click to try), which can be passed to
-the scrollbarStyle option. These implement
-the scrollbar using DOM elements, allowing more control over
-its appearance .
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/spanaffectswrapping_shim.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/spanaffectswrapping_shim.html
deleted file mode 100644
index 879d99b..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/spanaffectswrapping_shim.html
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
CodeMirror: Automatically derive odd wrapping behavior for your browser
-
-
-
-
-
-
-Automatically derive odd wrapping behavior for your browser
-
-
- This is a hack to automatically derive
- a spanAffectsWrapping regexp for a browser. See the
- comments above that variable
- in lib/codemirror.js
- for some more details.
-
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/sublime.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/sublime.html
deleted file mode 100644
index b3b5342..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/sublime.html
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
CodeMirror: Sublime Text bindings demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Sublime Text bindings demo
-
-The sublime keymap defines many Sublime Text-specific
-bindings for CodeMirror. See the code below for an overview.
-
-Enable the keymap by
-loading keymap/sublime.js
-and setting
-the keyMap
-option to "sublime".
-
-(A lot of the search functionality is still missing.)
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/tern.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/tern.html
deleted file mode 100644
index d5badfe..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/tern.html
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
CodeMirror: Tern Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Tern Demo
-// Use ctrl-space to complete something
-// Put the cursor in or after an expression, press ctrl-o to
-// find its type
-
-var foo = ["array", "of", "strings"];
-var bar = foo.slice(0, 2).join("").split("a")[0];
-
-// Works for locally defined types too.
-
-function CTor() { this.size = 10; }
-CTor.prototype.hallo = "hallo";
-
-var baz = new CTor;
-baz.
-
-// You can press ctrl-q when the cursor is on a variable name to
-// rename it. Try it with CTor...
-
-// When the cursor is in an argument list, the arguments are
-// shown below the editor.
-
-[1].reduce( );
-
-// And a little more advanced code...
-
-(function(exports) {
- exports.randomElt = function(arr) {
- return arr[Math.floor(arr.length * Math.random())];
- };
- exports.strList = "foo".split("");
- exports.intList = exports.strList.map(function(s) { return s.charCodeAt(0); });
-})(window.myMod = {});
-
-var randomStr = myMod.randomElt(myMod.strList);
-var randomInt = myMod.randomElt(myMod.intList);
-
-
-Demonstrates integration of Tern
-and CodeMirror. The following keys are bound:
-
-
- Ctrl-Space Autocomplete
- Ctrl-O Find docs for the expression at the cursor
- Ctrl-I Find type at cursor
- Alt-. Jump to definition (Alt-, to jump back)
- Ctrl-Q Rename variable
- Ctrl-. Select all occurrences of a variable
-
-
-Documentation is sparse for now. See the top of
-the script for a rough API
-overview.
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/theme.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/theme.html
deleted file mode 100644
index 93d5251..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/theme.html
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
CodeMirror: Theme Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Theme Demo
-
-function findSequence(goal) {
- function find(start, history) {
- if (start == goal)
- return history;
- else if (start > goal)
- return null;
- else
- return find(start + 5, "(" + history + " + 5)") ||
- find(start * 3, "(" + history + " * 3)");
- }
- return find(1, "1");
-}
-
-Select a theme:
- default
- 3024-day
- 3024-night
- ambiance
- base16-dark
- base16-light
- blackboard
- cobalt
- colorforth
- dracula
- eclipse
- elegant
- erlang-dark
- icecoder
- lesser-dark
- liquibyte
- material
- mbo
- mdn-like
- midnight
- monokai
- neat
- neo
- night
- paraiso-dark
- paraiso-light
- pastel-on-dark
- rubyblue
- seti
- solarized dark
- solarized light
- the-matrix
- tomorrow-night-bright
- tomorrow-night-eighties
- ttcn
- twilight
- vibrant-ink
- xq-dark
- xq-light
- yeti
- zenburn
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/trailingspace.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/trailingspace.html
deleted file mode 100644
index 1992ba3..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/trailingspace.html
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
CodeMirror: Trailing Whitespace Demo
-
-
-
-
-
-
-
-
-
-
-Trailing Whitespace Demo
-This text
- has some
-trailing whitespace!
-
-
-
-Uses
-the trailingspace
-addon to highlight trailing whitespace.
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/variableheight.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/variableheight.html
deleted file mode 100644
index d499428..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/variableheight.html
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
CodeMirror: Variable Height Demo
-
-
-
-
-
-
-
-
-
-
-
-Variable Height Demo
-# A First Level Header
-
-**Bold** text in a normal-size paragraph.
-
-And a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long, wrapped line with a piece of **big** text inside of it.
-
-## A Second Level Header
-
-Now is the time for all good men to come to
-the aid of their country. This is just a
-regular paragraph.
-
-The quick brown fox jumped over the lazy
-dog's back.
-
-### Header 3
-
-> This is a blockquote.
->
-> This is the second paragraph in the blockquote.
->
-> ## This is an H2 in a blockquote
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/vim.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/vim.html
deleted file mode 100644
index be4b857..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/vim.html
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
CodeMirror: Vim bindings demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Vim bindings demo
-
-#include "syscalls.h"
-/* getchar: simple buffered version */
-int getchar(void)
-{
- static char buf[BUFSIZ];
- static char *bufp = buf;
- static int n = 0;
- if (n == 0) { /* buffer is empty */
- n = read(0, buf, sizeof buf);
- bufp = buf;
- }
- return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
-}
-
-Key buffer:
-
-The vim keybindings are enabled by including keymap/vim.js and setting the
-keyMap option to vim.
-
-Features
-
-
- All common motions and operators, including text objects
- Operator motion orthogonality
- Visual mode - characterwise, linewise, blockwise
- Full macro support (q, @)
- Incremental highlighted search (/, ?, #, *, g#, g*)
- Search/replace with confirm (:substitute, :%s)
- Search history
- Jump lists (Ctrl-o, Ctrl-i)
- Key/command mapping with API (:map, :nmap, :vmap)
- Sort (:sort)
- Marks (`, ')
- :global
- Insert mode behaves identical to base CodeMirror
- Cross-buffer yank/paste
-
-
-For the full list of key mappings and Ex commands, refer to the
-defaultKeymap and defaultExCommandMap at the
-top of keymap/vim.js .
-
-
Note that while the vim mode tries to emulate the most useful
-features of vim as faithfully as possible, it does not strive to
-become a complete vim implementation
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/visibletabs.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/visibletabs.html
deleted file mode 100644
index 2eec337..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/visibletabs.html
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
CodeMirror: Visible tabs demo
-
-
-
-
-
-
-
-
-
-
-Visible tabs demo
-
-#include "syscalls.h"
-/* getchar: simple buffered version */
-int getchar(void)
-{
- static char buf[BUFSIZ];
- static char *bufp = buf;
- static int n = 0;
- if (n == 0) { /* buffer is empty */
- n = read(0, buf, sizeof buf);
- bufp = buf;
- }
- return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
-}
-
-
-Tabs inside the editor are spans with the
-class cm-tab, and can be styled.
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/widget.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/widget.html
deleted file mode 100644
index da39a92..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/widget.html
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
CodeMirror: Inline Widget Demo
-
-
-
-
-
-
-
-
-
-
-
-Inline Widget Demo
-
-
-
-
-This demo runs JSHint over the code
-in the editor (which is the script used on this page), and
-inserts line widgets to
-display the warnings that JSHint comes up with.
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/xmlcomplete.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/xmlcomplete.html
deleted file mode 100644
index bd452e6..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/demo/xmlcomplete.html
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
CodeMirror: XML Autocomplete Demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-XML Autocomplete Demo
-
-
-
- Press ctrl-space , or type a '<' character to
- activate autocompletion. This demo defines a simple schema that
- guides completion. The schema can be customized—see
- the manual .
-
- Development of the xml-hint addon was kindly
- sponsored
- by www.xperiment.mobi .
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/activebookmark.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/activebookmark.js
deleted file mode 100644
index 407282d..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/activebookmark.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// Kludge in HTML5 tag recognition in IE8
-document.createElement("section");
-document.createElement("article");
-
-(function() {
- if (!window.addEventListener) return;
- var pending = false, prevVal = null;
-
- function updateSoon() {
- if (!pending) {
- pending = true;
- setTimeout(update, 250);
- }
- }
-
- function update() {
- pending = false;
- var marks = document.getElementById("nav").getElementsByTagName("a"), found;
- for (var i = 0; i < marks.length; ++i) {
- var mark = marks[i], m;
- if (mark.getAttribute("data-default")) {
- if (found == null) found = i;
- } else if (m = mark.href.match(/#(.*)/)) {
- var ref = document.getElementById(m[1]);
- if (ref && ref.getBoundingClientRect().top < 50)
- found = i;
- }
- }
- if (found != null && found != prevVal) {
- prevVal = found;
- var lis = document.getElementById("nav").getElementsByTagName("li");
- for (var i = 0; i < lis.length; ++i) lis[i].className = "";
- for (var i = 0; i < marks.length; ++i) {
- if (found == i) {
- marks[i].className = "active";
- for (var n = marks[i]; n; n = n.parentNode)
- if (n.nodeName == "LI") n.className = "active";
- } else {
- marks[i].className = "";
- }
- }
- }
- }
-
- window.addEventListener("scroll", updateSoon);
- window.addEventListener("load", updateSoon);
- window.addEventListener("hashchange", function() {
- setTimeout(function() {
- var hash = document.location.hash, found = null, m;
- var marks = document.getElementById("nav").getElementsByTagName("a");
- for (var i = 0; i < marks.length; i++)
- if ((m = marks[i].href.match(/(#.*)/)) && m[1] == hash) { found = i; break; }
- if (found != null) for (var i = 0; i < marks.length; i++)
- marks[i].className = i == found ? "active" : "";
- }, 300);
- });
-})();
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/compress.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/compress.html
deleted file mode 100644
index f64f4bb..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/compress.html
+++ /dev/null
@@ -1,329 +0,0 @@
-
-
-
CodeMirror: Compression Helper
-
-
-
-
-
-
-
-
-
-
-Script compression helper
-
- To optimize loading CodeMirror, especially when including a
- bunch of different modes, it is recommended that you combine and
- minify (and preferably also gzip) the scripts. This page makes
- those first two steps very easy. Simply select the version and
- scripts you need in the form below, and
- click Compress to download the minified script
- file.
-
-
-
- Version:
- HEAD
- 5.5
- 5.4
- 5.3
- 5.2
- 5.1
- 5.0
- 4.13
- 4.12
- 4.11
- 4.10
- 4.9
- 4.8
- 4.7
- 4.6
- 4.5
- 4.4
- 4.3
- 4.2
- 4.2
- 4.1
- 4.0
- 3.23
- 3.22
- 3.21
- 3.20
- 3.19
- 3.18
- 3.16
- 3.15
- 3.14
- 3.13
- 3.12
- 3.11
- 3.1
- 3.02
- 3.01
- 3.0
- 2.38
- 2.37
- 2.36
- 2.35
- 2.34
- 2.33
- 2.32
- 2.31
- 2.3
- 2.25
- 2.24
- 2.23
- 2.22
- 2.21
- 2.2
- 2.18
- 2.16
- 2.15
- 2.13
- 2.12
- 2.11
- 2.1
- 2.02
- 2.01
- 2.0
- beta2
- beta1
-
-
-
-
- codemirror.js
-
-
- apl.js
- asn.1.js
- asterisk.js
- asciiarmor.js
- brainfuck.js
- clike.js
- clojure.js
- cmake.js
- cobol.js
- coffeescript.js
- commonlisp.js
- css.js
- cypher.js
- d.js
- dart.js
- diff.js
- django.js
- dockerfile.js
- dtd.js
- dylan.js
- ebnf.js
- ecl.js
- eiffel.js
- eml.js
- erlang.js
- factor.js
- forth.js
- fortran.js
- gfm.js
- gas.js
- gherkin.js
- go.js
- groovy.js
- haml.js
- handlebars.js
- haskell.js
- haxe.js
- htmlembedded.js
- htmlmixed.js
- http.js
- idl.js
- jade.js
- javascript.js
- jinja2.js
- julia.js
- kotlin.js
- livescript.js
- lua.js
- markdown.js
- mathematica.js
- mirc.js
- mllike.js
- modelica.js
- mumps.js
- nginx.js
- ntriples.js
- octave.js
- pascal.js
- pegjs.js
- perl.js
- php.js
- pig.js
- properties.js
- python.js
- puppet.js
- q.js
- r.js
- rpm.js
- rst.js
- ruby.js
- rust.js
- sass.js
- scala.js
- scheme.js
- shell.js
- sieve.js
- slim.js
- smalltalk.js
- smarty.js
- solr.js
- soy.js
- sparql.js
- swift.js
- spreadsheet.js
- stylus.js
- sql.js
- stex.js
- tcl.js
- textile.js
- tiddlywiki.js
- tiki.js
- toml.js
- tornado.js
- troff.js
- ttcn.js
- ttcn-cfg.js
- turtle.js
- twig.js
- vb.js
- vbscript.js
- velocity.js
- verilog.js
- vhdl.js
- xml.js
- xquery.js
- yaml.js
- z80.js
-
-
- active-line.js
- anyword-hint.js
- brace-fold.js
- closebrackets.js
- closetag.js
- colorize.js
- comment.js
- comment-fold.js
- continuecomment.js
- continuelist.js
- css-hint.js
- dialog.js
- foldcode.js
- foldgutter.js
- fullscreen.js
- hardwrap.js
- html-hint.js
- indent-fold.js
- javascript-hint.js
- javascript-lint.js
- json-lint.js
- lint.js
- loadmode.js
- markdown-fold.js
- mark-selection.js
- match-highlighter.js
- matchbrackets.js
- matchtags.js
- merge.js
- multiplex.js
- overlay.js
- placeholder.js
- rulers.js
- runmode.js
- runmode.node.js
- runmode-standalone.js
- search.js
- searchcursor.js
- show-hint.js
- simple.js
- simplescrollbars.js
- sql-hint.js
- trailingspace.js
- tern.js
- xml-fold.js
- xml-hint.js
- yaml-lint.js
-
-
- emacs.js
- sublime.js
- vim.js
-
-
-
-
- Compress with UglifyJS
-
-
- Custom code to add to the compressed file:
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/docs.css b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/docs.css
deleted file mode 100644
index 881d2aa..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/docs.css
+++ /dev/null
@@ -1,271 +0,0 @@
-@font-face {
- font-family: 'Source Sans Pro';
- font-style: normal;
- font-weight: 400;
- src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(//themes.googleusercontent.com/static/fonts/sourcesanspro/v5/ODelI1aHBYDBqgeIAH2zlBM0YzuT7MdOe03otPbuUS0.woff) format('woff');
-}
-
-body, html { margin: 0; padding: 0; height: 100%; }
-section, article { display: block; padding: 0; }
-
-body {
- background: #f8f8f8;
- font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
- line-height: 1.5;
-}
-
-p { margin-top: 0; }
-
-h2, h3, h1 {
- font-weight: normal;
- margin-bottom: .7em;
-}
-h1 { font-size: 140%; }
-h2 { font-size: 120%; }
-h3 { font-size: 110%; }
-article > h2:first-child, section:first-child > h2 { margin-top: 0; }
-
-#nav h1 {
- margin-right: 12px;
- margin-top: 0;
- margin-bottom: 2px;
- color: #d30707;
- letter-spacing: .5px;
-}
-
-a, a:visited, a:link, .quasilink {
- color: #A21313;
- text-decoration: none;
-}
-
-em {
- padding-right: 2px;
-}
-
-.quasilink {
- cursor: pointer;
-}
-
-article {
- max-width: 700px;
- margin: 0 0 0 160px;
- border-left: 2px solid #E30808;
- border-right: 1px solid #ddd;
- padding: 30px 50px 100px 50px;
- background: white;
- z-index: 2;
- position: relative;
- min-height: 100%;
- box-sizing: border-box;
- -moz-box-sizing: border-box;
-}
-
-#nav {
- position: fixed;
- padding-top: 30px;
- max-height: 100%;
- box-sizing: -moz-border-box;
- box-sizing: border-box;
- overflow-y: auto;
- left: 0; right: none;
- width: 160px;
- text-align: right;
- z-index: 1;
-}
-
-@media screen and (min-width: 1000px) {
- article {
- margin: 0 auto;
- }
- #nav {
- right: 50%;
- width: auto;
- border-right: 349px solid transparent;
- }
-}
-
-#nav ul {
- display: block;
- margin: 0; padding: 0;
- margin-bottom: 32px;
-}
-
-#nav li {
- display: block;
- margin-bottom: 4px;
-}
-
-#nav li ul {
- font-size: 80%;
- margin-bottom: 0;
- display: none;
-}
-
-#nav li.active ul {
- display: block;
-}
-
-#nav li li a {
- padding-right: 20px;
- display: inline-block;
-}
-
-#nav ul a {
- color: black;
- padding: 0 7px 1px 11px;
-}
-
-#nav ul a.active, #nav ul a:hover {
- border-bottom: 1px solid #E30808;
- margin-bottom: -1px;
- color: #E30808;
-}
-
-#logo {
- border: 0;
- margin-right: 12px;
- margin-bottom: 25px;
-}
-
-section {
- border-top: 1px solid #E30808;
- margin: 1.5em 0;
-}
-
-section.first {
- border: none;
- margin-top: 0;
-}
-
-#demo {
- position: relative;
-}
-
-#demolist {
- position: absolute;
- right: 5px;
- top: 5px;
- z-index: 25;
-}
-
-.yinyang {
- position: absolute;
- top: -10px;
- left: 0; right: 0;
- margin: auto;
- display: block;
- height: 120px;
-}
-
-.actions {
- margin: 1em 0 0;
- min-height: 100px;
- position: relative;
-}
-
-.actionspicture {
- pointer-events: none;
- position: absolute;
- height: 100px;
- top: 0; left: 0; right: 0;
-}
-
-.actionlink {
- pointer-events: auto;
- font-family: arial;
- font-size: 80%;
- font-weight: bold;
- position: absolute;
- top: 0; bottom: 0;
- line-height: 1;
- height: 1em;
- margin: auto;
-}
-
-.actionlink.download {
- color: white;
- right: 50%;
- margin-right: 13px;
- text-shadow: -1px 1px 3px #b00, -1px -1px 3px #b00, 1px 0px 3px #b00;
-}
-
-.actionlink.fund {
- color: #b00;
- left: 50%;
- margin-left: 15px;
-}
-
-.actionlink:hover {
- text-decoration: underline;
-}
-
-.actionlink a {
- color: inherit;
-}
-
-.actionsleft {
- float: left;
-}
-
-.actionsright {
- float: right;
- text-align: right;
-}
-
-@media screen and (max-width: 800px) {
- .actions {
- padding-top: 120px;
- }
- .actionsleft, .actionsright {
- float: none;
- text-align: left;
- margin-bottom: 1em;
- }
-}
-
-th {
- text-decoration: underline;
- font-weight: normal;
- text-align: left;
-}
-
-#features ul {
- list-style: none;
- margin: 0 0 1em;
- padding: 0 0 0 1.2em;
-}
-
-#features li:before {
- content: "-";
- width: 1em;
- display: inline-block;
- padding: 0;
- margin: 0;
- margin-left: -1em;
-}
-
-.rel {
- margin-bottom: 0;
-}
-.rel-note {
- margin-top: 0;
- color: #555;
-}
-
-pre {
- padding-left: 15px;
- border-left: 2px solid #ddd;
-}
-
-code {
- padding: 0 2px;
-}
-
-strong {
- text-decoration: underline;
- font-weight: normal;
-}
-
-.field {
- border: 1px solid #A21313;
-}
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/internals.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/internals.html
deleted file mode 100644
index e1ed3e9..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/internals.html
+++ /dev/null
@@ -1,503 +0,0 @@
-
-
-
CodeMirror: Internals
-
-
-
-
-
-
-
-
-
-(Re-) Implementing A Syntax-Highlighting Editor in JavaScript
-
-
- Topic: JavaScript, code editor implementation
- Author: Marijn Haverbeke
- Date: March 2nd 2011 (updated November 13th 2011)
-
-
-Caution : this text was written briefly after
-version 2 was initially written. It no longer (even including the
-update at the bottom) fully represents the current implementation. I'm
-leaving it here as a historic document. For more up-to-date
-information, look at the entries
-tagged cm-internals
-on my blog.
-
-This is a followup to
-my Brutal Odyssey to the
-Dark Side of the DOM Tree story. That one describes the
-mind-bending process of implementing (what would become) CodeMirror 1.
-This one describes the internals of CodeMirror 2, a complete rewrite
-and rethink of the old code base. I wanted to give this piece another
-Hunter Thompson copycat subtitle, but somehow that would be out of
-place—the process this time around was one of straightforward
-engineering, requiring no serious mind-bending whatsoever.
-
-So, what is wrong with CodeMirror 1? I'd estimate, by mailing list
-activity and general search-engine presence, that it has been
-integrated into about a thousand systems by now. The most prominent
-one, since a few weeks,
-being Google
-code's project hosting . It works, and it's being used widely.
-
-Still, I did not start replacing it because I was bored. CodeMirror
-1 was heavily reliant on designMode
-or contentEditable (depending on the browser). Neither of
-these are well specified (HTML5 tries
-to specify
-their basics), and, more importantly, they tend to be one of the more
-obscure and buggy areas of browser functionality—CodeMirror, by using
-this functionality in a non-typical way, was constantly running up
-against browser bugs. WebKit wouldn't show an empty line at the end of
-the document, and in some releases would suddenly get unbearably slow.
-Firefox would show the cursor in the wrong place. Internet Explorer
-would insist on linkifying everything that looked like a URL or email
-address, a behaviour that can't be turned off. Some bugs I managed to
-work around (which was often a frustrating, painful process), others,
-such as the Firefox cursor placement, I gave up on, and had to tell
-user after user that they were known problems, but not something I
-could help.
-
-Also, there is the fact that designMode (which seemed
-to be less buggy than contentEditable in Webkit and
-Firefox, and was thus used by CodeMirror 1 in those browsers) requires
-a frame. Frames are another tricky area. It takes some effort to
-prevent getting tripped up by domain restrictions, they don't
-initialize synchronously, behave strangely in response to the back
-button, and, on several browsers, can't be moved around the DOM
-without having them re-initialize. They did provide a very nice way to
-namespace the library, though—CodeMirror 1 could freely pollute the
-namespace inside the frame.
-
-Finally, working with an editable document means working with
-selection in arbitrary DOM structures. Internet Explorer (8 and
-before) has an utterly different (and awkward) selection API than all
-of the other browsers, and even among the different implementations of
-document.selection, details about how exactly a selection
-is represented vary quite a bit. Add to that the fact that Opera's
-selection support tended to be very buggy until recently, and you can
-imagine why CodeMirror 1 contains 700 lines of selection-handling
-code.
-
-And that brings us to the main issue with the CodeMirror 1
-code base: The proportion of browser-bug-workarounds to real
-application code was getting dangerously high. By building on top of a
-few dodgy features, I put the system in a vulnerable position—any
-incompatibility and bugginess in these features, I had to paper over
-with my own code. Not only did I have to do some serious stunt-work to
-get it to work on older browsers (as detailed in the
-previous story ), things
-also kept breaking in newly released versions, requiring me to come up
-with new scary hacks in order to keep up. This was starting
-to lose its appeal.
-
-
- General Approach
-
-What CodeMirror 2 does is try to sidestep most of the hairy hacks
-that came up in version 1. I owe a lot to the
-ACE editor for inspiration on how to
-approach this.
-
-I absolutely did not want to be completely reliant on key events to
-generate my input. Every JavaScript programmer knows that key event
-information is horrible and incomplete. Some people (most awesomely
-Mihai Bazon with Ymacs ) have been able
-to build more or less functioning editors by directly reading key
-events, but it takes a lot of work (the kind of never-ending, fragile
-work I described earlier), and will never be able to properly support
-things like multi-keystoke international character
-input. [see below for caveat]
-
-So what I do is focus a hidden textarea, and let the browser
-believe that the user is typing into that. What we show to the user is
-a DOM structure we built to represent his document. If this is updated
-quickly enough, and shows some kind of believable cursor, it feels
-like a real text-input control.
-
-Another big win is that this DOM representation does not have to
-span the whole document. Some CodeMirror 1 users insisted that they
-needed to put a 30 thousand line XML document into CodeMirror. Putting
-all that into the DOM takes a while, especially since, for some
-reason, an editable DOM tree is slower than a normal one on most
-browsers. If we have full control over what we show, we must only
-ensure that the visible part of the document has been added, and can
-do the rest only when needed. (Fortunately, the onscroll
-event works almost the same on all browsers, and lends itself well to
-displaying things only as they are scrolled into view.)
-
-
-
- Selection
-
-Getting and setting the selection range of a textarea in modern
-browsers is trivial—you just use the selectionStart
-and selectionEnd properties. On IE you have to do some
-insane stuff with temporary ranges and compensating for the fact that
-moving the selection by a 'character' will treat \r\n as a single
-character, but even there it is possible to build functions that
-reliably set and get the selection range.
-
-But consider this typical case: When I'm somewhere in my document,
-press shift, and press the up arrow, something gets selected. Then, if
-I, still holding shift, press the up arrow again, the top of my
-selection is adjusted. The selection remembers where its head
-and its anchor are, and moves the head when we shift-move.
-This is a generally accepted property of selections, and done right by
-every editing component built in the past twenty years.
-
-But not something that the browser selection APIs expose.
-
-Great. So when someone creates an 'upside-down' selection, the next
-time CodeMirror has to update the textarea, it'll re-create the
-selection as an 'upside-up' selection, with the anchor at the top, and
-the next cursor motion will behave in an unexpected way—our second
-up-arrow press in the example above will not do anything, since it is
-interpreted in exactly the same way as the first.
-
-No problem. We'll just, ehm, detect that the selection is
-upside-down (you can tell by the way it was created), and then, when
-an upside-down selection is present, and a cursor-moving key is
-pressed in combination with shift, we quickly collapse the selection
-in the textarea to its start, allow the key to take effect, and then
-combine its new head with its old anchor to get the real
-selection.
-
-In short, scary hacks could not be avoided entirely in CodeMirror
-2.
-
-And, the observant reader might ask, how do you even know that a
-key combo is a cursor-moving combo, if you claim you support any
-native key bindings? Well, we don't, but we can learn. The editor
-keeps a set known cursor-movement combos (initialized to the
-predictable defaults), and updates this set when it observes that
-pressing a certain key had (only) the effect of moving the cursor.
-This, of course, doesn't work if the first time the key is used was
-for extending an inverted selection, but it works most of the
-time.
-
-
- Intelligent Updating
-
-One thing that always comes up when you have a complicated internal
-state that's reflected in some user-visible external representation
-(in this case, the displayed code and the textarea's content) is
-keeping the two in sync. The naive way is to just update the display
-every time you change your state, but this is not only error prone
-(you'll forget), it also easily leads to duplicate work on big,
-composite operations. Then you start passing around flags indicating
-whether the display should be updated in an attempt to be efficient
-again and, well, at that point you might as well give up completely.
-
-I did go down that road, but then switched to a much simpler model:
-simply keep track of all the things that have been changed during an
-action, and then, only at the end, use this information to update the
-user-visible display.
-
-CodeMirror uses a concept of operations , which start by
-calling a specific set-up function that clears the state and end by
-calling another function that reads this state and does the required
-updating. Most event handlers, and all the user-visible methods that
-change state are wrapped like this. There's a method
-called operation that accepts a function, and returns
-another function that wraps the given function as an operation.
-
-It's trivial to extend this (as CodeMirror does) to detect nesting,
-and, when an operation is started inside an operation, simply
-increment the nesting count, and only do the updating when this count
-reaches zero again.
-
-If we have a set of changed ranges and know the currently shown
-range, we can (with some awkward code to deal with the fact that
-changes can add and remove lines, so we're dealing with a changing
-coordinate system) construct a map of the ranges that were left
-intact. We can then compare this map with the part of the document
-that's currently visible (based on scroll offset and editor height) to
-determine whether something needs to be updated.
-
-CodeMirror uses two update algorithms—a full refresh, where it just
-discards the whole part of the DOM that contains the edited text and
-rebuilds it, and a patch algorithm, where it uses the information
-about changed and intact ranges to update only the out-of-date parts
-of the DOM. When more than 30 percent (which is the current heuristic,
-might change) of the lines need to be updated, the full refresh is
-chosen (since it's faster to do than painstakingly finding and
-updating all the changed lines), in the other case it does the
-patching (so that, if you scroll a line or select another character,
-the whole screen doesn't have to be
-re-rendered). [the full-refresh
-algorithm was dropped, it wasn't really faster than the patching
-one]
-
-All updating uses innerHTML rather than direct DOM
-manipulation, since that still seems to be by far the fastest way to
-build documents. There's a per-line function that combines the
-highlighting, marking , and
-selection info for that line into a snippet of HTML. The patch updater
-uses this to reset individual lines, the refresh updater builds an
-HTML chunk for the whole visible document at once, and then uses a
-single innerHTML update to do the refresh.
-
-
- Parsers can be Simple
-
-When I wrote CodeMirror 1, I
-thought interruptable
-parsers were a hugely scary and complicated thing, and I used a
-bunch of heavyweight abstractions to keep this supposed complexity
-under control: parsers
-were iterators
-that consumed input from another iterator, and used funny
-closure-resetting tricks to copy and resume themselves.
-
-This made for a rather nice system, in that parsers formed strictly
-separate modules, and could be composed in predictable ways.
-Unfortunately, it was quite slow (stacking three or four iterators on
-top of each other), and extremely intimidating to people not used to a
-functional programming style.
-
-With a few small changes, however, we can keep all those
-advantages, but simplify the API and make the whole thing less
-indirect and inefficient. CodeMirror
-2's mode API uses explicit state
-objects, and makes the parser/tokenizer a function that simply takes a
-state and a character stream abstraction, advances the stream one
-token, and returns the way the token should be styled. This state may
-be copied, optionally in a mode-defined way, in order to be able to
-continue a parse at a given point. Even someone who's never touched a
-lambda in his life can understand this approach. Additionally, far
-fewer objects are allocated in the course of parsing now.
-
-The biggest speedup comes from the fact that the parsing no longer
-has to touch the DOM though. In CodeMirror 1, on an older browser, you
-could see the parser work its way through the document,
-managing some twenty lines in each 50-millisecond time slice it got. It
-was reading its input from the DOM, and updating the DOM as it went
-along, which any experienced JavaScript programmer will immediately
-spot as a recipe for slowness. In CodeMirror 2, the parser usually
-finishes the whole document in a single 100-millisecond time slice—it
-manages some 1500 lines during that time on Chrome. All it has to do
-is munge strings, so there is no real reason for it to be slow
-anymore.
-
-
- What Gives?
-
-Given all this, what can you expect from CodeMirror 2?
-
-
-
-Small. the base library is
-some 45k when minified
-now, 17k when gzipped. It's smaller than
-its own logo.
-
-Lightweight. CodeMirror 2 initializes very
-quickly, and does almost no work when it is not focused. This means
-you can treat it almost like a textarea, have multiple instances on a
-page without trouble.
-
-Huge document support. Since highlighting is
-really fast, and no DOM structure is being built for non-visible
-content, you don't have to worry about locking up your browser when a
-user enters a megabyte-sized document.
-
-Extended API. Some things kept coming up in the
-mailing list, such as marking pieces of text or lines, which were
-extremely hard to do with CodeMirror 1. The new version has proper
-support for these built in.
-
-Tab support. Tabs inside editable documents were,
-for some reason, a no-go. At least six different people announced they
-were going to add tab support to CodeMirror 1, none survived (I mean,
-none delivered a working version). CodeMirror 2 no longer removes tabs
-from your document.
-
-Sane styling. iframe nodes aren't
-really known for respecting document flow. Now that an editor instance
-is a plain div element, it is much easier to size it to
-fit the surrounding elements. You don't even have to make it scroll if
-you do not want to .
-
-
-
-On the downside, a CodeMirror 2 instance is not a native
-editable component. Though it does its best to emulate such a
-component as much as possible, there is functionality that browsers
-just do not allow us to hook into. Doing select-all from the context
-menu, for example, is not currently detected by CodeMirror.
-
-[Updates from November 13th 2011] Recently, I've made
-some changes to the codebase that cause some of the text above to no
-longer be current. I've left the text intact, but added markers at the
-passages that are now inaccurate. The new situation is described
-below.
-
-
- Content Representation
-
-The original implementation of CodeMirror 2 represented the
-document as a flat array of line objects. This worked well—splicing
-arrays will require the part of the array after the splice to be
-moved, but this is basically just a simple memmove of a
-bunch of pointers, so it is cheap even for huge documents.
-
-However, I recently added line wrapping and code folding (line
-collapsing, basically). Once lines start taking up a non-constant
-amount of vertical space, looking up a line by vertical position
-(which is needed when someone clicks the document, and to determine
-the visible part of the document during scrolling) can only be done
-with a linear scan through the whole array, summing up line heights as
-you go. Seeing how I've been going out of my way to make big documents
-fast, this is not acceptable.
-
-The new representation is based on a B-tree. The leaves of the tree
-contain arrays of line objects, with a fixed minimum and maximum size,
-and the non-leaf nodes simply hold arrays of child nodes. Each node
-stores both the amount of lines that live below them and the vertical
-space taken up by these lines. This allows the tree to be indexed both
-by line number and by vertical position, and all access has
-logarithmic complexity in relation to the document size.
-
-I gave line objects and tree nodes parent pointers, to the node
-above them. When a line has to update its height, it can simply walk
-these pointers to the top of the tree, adding or subtracting the
-difference in height from each node it encounters. The parent pointers
-also make it cheaper (in complexity terms, the difference is probably
-tiny in normal-sized documents) to find the current line number when
-given a line object. In the old approach, the whole document array had
-to be searched. Now, we can just walk up the tree and count the sizes
-of the nodes coming before us at each level.
-
-I chose B-trees, not regular binary trees, mostly because they
-allow for very fast bulk insertions and deletions. When there is a big
-change to a document, it typically involves adding, deleting, or
-replacing a chunk of subsequent lines. In a regular balanced tree, all
-these inserts or deletes would have to be done separately, which could
-be really expensive. In a B-tree, to insert a chunk, you just walk
-down the tree once to find where it should go, insert them all in one
-shot, and then break up the node if needed. This breaking up might
-involve breaking up nodes further up, but only requires a single pass
-back up the tree. For deletion, I'm somewhat lax in keeping things
-balanced—I just collapse nodes into a leaf when their child count goes
-below a given number. This means that there are some weird editing
-patterns that may result in a seriously unbalanced tree, but even such
-an unbalanced tree will perform well, unless you spend a day making
-strangely repeating edits to a really big document.
-
-
- Keymaps
-
-Above , I claimed that directly catching key
-events for things like cursor movement is impractical because it
-requires some browser-specific kludges. I then proceeded to explain
-some awful hacks that were needed to make it
-possible for the selection changes to be detected through the
-textarea. In fact, the second hack is about as bad as the first.
-
-On top of that, in the presence of user-configurable tab sizes and
-collapsed and wrapped lines, lining up cursor movement in the textarea
-with what's visible on the screen becomes a nightmare. Thus, I've
-decided to move to a model where the textarea's selection is no longer
-depended on.
-
-So I moved to a model where all cursor movement is handled by my
-own code. This adds support for a goal column, proper interaction of
-cursor movement with collapsed lines, and makes it possible for
-vertical movement to move through wrapped lines properly, instead of
-just treating them like non-wrapped lines.
-
-The key event handlers now translate the key event into a string,
-something like Ctrl-Home or Shift-Cmd-R, and
-use that string to look up an action to perform. To make keybinding
-customizable, this lookup goes through
-a table , using a scheme that
-allows such tables to be chained together (for example, the default
-Mac bindings fall through to a table named 'emacsy', which defines
-basic Emacs-style bindings like Ctrl-F, and which is also
-used by the custom Emacs bindings).
-
-A new
-option extraKeys
-allows ad-hoc keybindings to be defined in a much nicer way than what
-was possible with the
-old onKeyEvent
-callback. You simply provide an object mapping key identifiers to
-functions, instead of painstakingly looking at raw key events.
-
-Built-in commands map to strings, rather than functions, for
-example "goLineUp" is the default action bound to the up
-arrow key. This allows new keymaps to refer to them without
-duplicating any code. New commands can be defined by assigning to
-the CodeMirror.commands object, which maps such commands
-to functions.
-
-The hidden textarea now only holds the current selection, with no
-extra characters around it. This has a nice advantage: polling for
-input becomes much, much faster. If there's a big selection, this text
-does not have to be read from the textarea every time—when we poll,
-just noticing that something is still selected is enough to tell us
-that no new text was typed.
-
-The reason that cheap polling is important is that many browsers do
-not fire useful events on IME (input method engine) input, which is
-the thing where people inputting a language like Japanese or Chinese
-use multiple keystrokes to create a character or sequence of
-characters. Most modern browsers fire input when the
-composing is finished, but many don't fire anything when the character
-is updated during composition. So we poll, whenever the
-editor is focused, to provide immediate updates of the display.
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.png b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.png
deleted file mode 100644
index 9aabda1..0000000
Binary files a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.png and /dev/null differ
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.svg b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.svg
deleted file mode 100644
index 0aa6323..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/logo.svg
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
-
-
image/svg+xml
\ No newline at end of file
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/manual.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/manual.html
deleted file mode 100644
index 441afea..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/manual.html
+++ /dev/null
@@ -1,3327 +0,0 @@
-
-
-
CodeMirror: User Manual
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- User manual and reference guide
- version 5.5.0
-
-
- CodeMirror is a code-editor component that can be embedded in
- Web pages. The core library provides only the editor
- component, no accompanying buttons, auto-completion, or other IDE
- functionality. It does provide a rich API on top of which such
- functionality can be straightforwardly implemented. See
- the addons included in the distribution,
- and the list
- of externally hosted addons , for reusable
- implementations of extra features.
-
- CodeMirror works with language-specific modes. Modes are
- JavaScript programs that help color (and optionally indent) text
- written in a given language. The distribution comes with a number
- of modes (see the mode/
- directory), and it isn't hard to write new
- ones for other languages.
-
-
-
- Basic Usage
-
- The easiest way to use CodeMirror is to simply load the script
- and style sheet found under lib/ in the distribution,
- plus a mode script from one of the mode/ directories.
- (See the compression helper for an
- easy way to combine scripts.) For example:
-
- <script src="lib/codemirror.js"></script>
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="mode/javascript/javascript.js"></script>
-
- (Alternatively, use a module loader. More
- about that later. )
-
- Having done this, an editor instance can be created like
- this:
-
- var myCodeMirror = CodeMirror(document.body);
-
- The editor will be appended to the document body, will start
- empty, and will use the mode that we loaded. To have more control
- over the new editor, a configuration object can be passed
- to CodeMirror as a second
- argument:
-
- var myCodeMirror = CodeMirror(document.body, {
- value: "function myScript(){return 100;}\n",
- mode: "javascript"
-});
-
- This will initialize the editor with a piece of code already in
- it, and explicitly tell it to use the JavaScript mode (which is
- useful when multiple modes are loaded).
- See below for a full discussion of the
- configuration options that CodeMirror accepts.
-
- In cases where you don't want to append the editor to an
- element, and need more control over the way it is inserted, the
- first argument to the CodeMirror function can also
- be a function that, when given a DOM element, inserts it into the
- document somewhere. This could be used to, for example, replace a
- textarea with a real editor:
-
- var myCodeMirror = CodeMirror(function(elt) {
- myTextArea.parentNode.replaceChild(elt, myTextArea);
-}, {value: myTextArea.value});
-
- However, for this use case, which is a common way to use
- CodeMirror, the library provides a much more powerful
- shortcut:
-
- var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
-
- This will, among other things, ensure that the textarea's value
- is updated with the editor's contents when the form (if it is part
- of a form) is submitted. See the API
- reference for a full description of this method.
-
- Module loaders
-
- The files in the CodeMirror distribution contain shims for
- loading them (and their dependencies) in AMD or CommonJS
- environments. If the variables exports
- and module exist and have type object, CommonJS-style
- require will be used. If not, but there is a
- function define with an amd property
- present, AMD-style (RequireJS) will be used.
-
- It is possible to
- use Browserify or similar
- tools to statically build modules using CodeMirror. Alternatively,
- use RequireJS to dynamically
- load dependencies at runtime. Both of these approaches have the
- advantage that they don't use the global namespace and can, thus,
- do things like load multiple versions of CodeMirror alongside each
- other.
-
- Here's a simple example of using RequireJS to load CodeMirror:
-
- require([
- "cm/lib/codemirror", "cm/mode/htmlmixed/htmlmixed"
-], function(CodeMirror) {
- CodeMirror.fromTextArea(document.getElementById("code"), {
- lineNumbers: true,
- mode: "htmlmixed"
- });
-});
-
- It will automatically load the modes that the mixed HTML mode
- depends on (XML, JavaScript, and CSS). Do not use
- RequireJS' paths option to configure the path to
- CodeMirror, since it will break loading submodules through
- relative paths. Use
- the packages
- configuration option instead, as in:
-
- require.config({
- packages: [{
- name: "codemirror",
- location: "../path/to/codemirror",
- main: "lib/codemirror"
- }]
-});
-
-
-
-
- Configuration
-
- Both the CodeMirror
- function and its fromTextArea method take as second
- (optional) argument an object containing configuration options.
- Any option not supplied like this will be taken
- from CodeMirror.defaults , an
- object containing the default options. You can update this object
- to change the defaults on your page.
-
- Options are not checked in any way, so setting bogus option
- values is bound to lead to odd errors.
-
- These are the supported options:
-
-
- value : string|CodeMirror.Doc
- The starting value of the editor. Can be a string, or
- a document object .
-
- mode : string|object
- The mode to use. When not given, this will default to the
- first mode that was loaded. It may be a string, which either
- simply names the mode or is
- a MIME type
- associated with the mode. Alternatively, it may be an object
- containing configuration options for the mode, with
- a name property that names the mode (for
- example {name: "javascript", json: true}). The demo
- pages for each mode contain information about what configuration
- parameters the mode supports. You can ask CodeMirror which modes
- and MIME types have been defined by inspecting
- the CodeMirror.modes
- and CodeMirror.mimeModes objects. The first maps
- mode names to their constructors, and the second maps MIME types
- to mode specs.
-
- lineSeparator : string|null
- Explicitly set the line separator for the editor. By default
- (value null), the document will be split on CRLFs
- as well as lone CRs and LFs, and a single LF will be used as
- line separator in all output (such
- as getValue ). When a
- specific string is given, lines will only be split on that
- string, and output will, by default, use that same
- separator.
-
- theme : string
- The theme to style the editor with. You must make sure the
- CSS file defining the corresponding .cm-s-[name]
- styles is loaded (see
- the theme directory in the
- distribution). The default is "default", for which
- colors are included in codemirror.css. It is
- possible to use multiple theming classes at once—for
- example "foo bar" will assign both
- the cm-s-foo and the cm-s-bar classes
- to the editor.
-
- indentUnit : integer
- How many spaces a block (whatever that means in the edited
- language) should be indented. The default is 2.
-
- smartIndent : boolean
- Whether to use the context-sensitive indentation that the
- mode provides (or just indent the same as the line before).
- Defaults to true.
-
- tabSize : integer
- The width of a tab character. Defaults to 4.
-
- indentWithTabs : boolean
- Whether, when indenting, the first N*tabSize
- spaces should be replaced by N tabs. Default is false.
-
- electricChars : boolean
- Configures whether the editor should re-indent the current
- line when a character is typed that might change its proper
- indentation (only works if the mode supports indentation).
- Default is true.
-
- specialChars : RegExp
- A regular expression used to determine which characters
- should be replaced by a
- special placeholder .
- Mostly useful for non-printing special characters. The default
- is /[\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/.
- specialCharPlaceholder : function(char) → Element
- A function that, given a special character identified by
- the specialChars
- option, produces a DOM node that is used to represent the
- character. By default, a red dot (• )
- is shown, with a title tooltip to indicate the character code.
-
- rtlMoveVisually : boolean
- Determines whether horizontal cursor movement through
- right-to-left (Arabic, Hebrew) text is visual (pressing the left
- arrow moves the cursor left) or logical (pressing the left arrow
- moves to the next lower index in the string, which is visually
- right in right-to-left text). The default is false
- on Windows, and true on other platforms.
-
- keyMap : string
- Configures the key map to use. The default
- is "default", which is the only key map defined
- in codemirror.js itself. Extra key maps are found in
- the key map directory. See
- the section on key maps for more
- information.
-
-
- Can be used to specify extra key bindings for the editor,
- alongside the ones defined
- by keyMap . Should be
- either null, or a valid key map value.
-
- lineWrapping : boolean
- Whether CodeMirror should scroll or wrap for long lines.
- Defaults to false (scroll).
-
- lineNumbers : boolean
- Whether to show line numbers to the left of the editor.
-
- firstLineNumber : integer
- At which number to start counting lines. Default is 1.
-
- lineNumberFormatter : function(line: integer) → string
- A function used to format line numbers. The function is
- passed the line number, and should return a string that will be
- shown in the gutter.
-
- gutters : array<string>
- Can be used to add extra gutters (beyond or instead of the
- line number gutter). Should be an array of CSS class names, each
- of which defines a width (and optionally a
- background), and which will be used to draw the background of
- the gutters. May include
- the CodeMirror-linenumbers class, in order to
- explicitly set the position of the line number gutter (it will
- default to be to the right of all other gutters). These class
- names are the keys passed
- to setGutterMarker .
-
- fixedGutter : boolean
- Determines whether the gutter scrolls along with the content
- horizontally (false) or whether it stays fixed during horizontal
- scrolling (true, the default).
-
- scrollbarStyle : string
- Chooses a scrollbar implementation. The default
- is "native", showing native scrollbars. The core
- library also provides the "null" style, which
- completely hides the
- scrollbars. Addons can
- implement additional scrollbar models.
-
- coverGutterNextToScrollbar : boolean
- When fixedGutter
- is on, and there is a horizontal scrollbar, by default the
- gutter will be visible to the left of this scrollbar. If this
- option is set to true, it will be covered by an element with
- class CodeMirror-gutter-filler.
-
- inputStyle : string
- Selects the way CodeMirror handles input and focus. The core
- library defines the "textarea"
- and "contenteditable" input models. On mobile
- browsers, the default is "contenteditable". On
- desktop browsers, the default is "textarea".
- Support for IME and screen readers is better in
- the "contenteditable" model. The intention is to
- make it the default on modern desktop browsers in the
- future.
-
- readOnly : boolean|string
- This disables editing of the editor content by the user. If
- the special value "nocursor" is given (instead of
- simply true), focusing of the editor is also
- disallowed.
-
- showCursorWhenSelecting : boolean
- Whether the cursor should be drawn when a selection is
- active. Defaults to false.
-
- lineWiseCopyCut : boolean
- When enabled, which is the default, doing copy or cut when
- there is no selection will copy or cut the whole lines that have
- cursors on them.
-
- undoDepth : integer
- The maximum number of undo levels that the editor stores.
- Note that this includes selection change events. Defaults to
- 200.
-
- historyEventDelay : integer
- The period of inactivity (in milliseconds) that will cause a
- new history event to be started when typing or deleting.
- Defaults to 1250.
-
- tabindex : integer
- The tab
- index to assign to the editor. If not given, no tab index
- will be assigned.
-
- autofocus : boolean
- Can be used to make CodeMirror focus itself on
- initialization. Defaults to off.
- When fromTextArea is
- used, and no explicit value is given for this option, it will be
- set to true when either the source textarea is focused, or it
- has an autofocus attribute and no other element is
- focused.
-
-
- Below this a few more specialized, low-level options are
- listed. These are only useful in very specific situations, you
- might want to skip them the first time you read this manual.
-
-
- dragDrop : boolean
- Controls whether drag-and-drop is enabled. On by default.
-
- cursorBlinkRate : number
- Half-period in milliseconds used for cursor blinking. The default blink
- rate is 530ms. By setting this to zero, blinking can be disabled. A
- negative value hides the cursor entirely.
-
- cursorScrollMargin : number
- How much extra space to always keep above and below the
- cursor when approaching the top or bottom of the visible view in
- a scrollable document. Default is 0.
-
- cursorHeight : number
- Determines the height of the cursor. Default is 1, meaning
- it spans the whole height of the line. For some fonts (and by
- some tastes) a smaller height (for example 0.85),
- which causes the cursor to not reach all the way to the bottom
- of the line, looks better
-
-
- Controls whether, when the context menu is opened with a
- click outside of the current selection, the cursor is moved to
- the point of the click. Defaults to true.
-
- workTime , workDelay : number
- Highlighting is done by a pseudo background-thread that will
- work for workTime milliseconds, and then use
- timeout to sleep for workDelay milliseconds. The
- defaults are 200 and 300, you can change these options to make
- the highlighting more or less aggressive.
-
- pollInterval : number
- Indicates how quickly CodeMirror should poll its input
- textarea for changes (when focused). Most input is captured by
- events, but some things, like IME input on some browsers, don't
- generate events that allow CodeMirror to properly detect it.
- Thus, it polls. Default is 100 milliseconds.
-
- flattenSpans : boolean
- By default, CodeMirror will combine adjacent tokens into a
- single span if they have the same class. This will result in a
- simpler DOM tree, and thus perform better. With some kinds of
- styling (such as rounded corners), this will change the way the
- document looks. You can set this option to false to disable this
- behavior.
-
- addModeClass : boolean
- When enabled (off by default), an extra CSS class will be
- added to each token, indicating the
- (inner ) mode that produced it, prefixed
- with "cm-m-". For example, tokens from the XML mode
- will get the cm-m-xml class.
-
- maxHighlightLength : number
- When highlighting long lines, in order to stay responsive,
- the editor will give up and simply style the rest of the line as
- plain text when it reaches a certain position. The default is
- 10 000. You can set this to Infinity to turn off
- this behavior.
-
- viewportMargin : integer
- Specifies the amount of lines that are rendered above and
- below the part of the document that's currently scrolled into
- view. This affects the amount of updates needed when scrolling,
- and the amount of work that such an update does. You should
- usually leave it at its default, 10. Can be set
- to Infinity to make sure the whole document is
- always rendered, and thus the browser's text search works on it.
- This will have bad effects on performance of big
- documents.
-
-
-
-
- Events
-
- Various CodeMirror-related objects emit events, which allow
- client code to react to various situations. Handlers for such
- events can be registered with the on
- and off methods on the objects
- that the event fires on. To fire your own events,
- use CodeMirror.signal(target, name, args...),
- where target is a non-DOM-node object.
-
- An editor instance fires the following events.
- The instance argument always refers to the editor
- itself.
-
-
- "change" (instance: CodeMirror, changeObj: object)
- Fires every time the content of the editor is changed.
- The changeObj is a {from, to, text, removed,
- origin} object containing information about the changes
- that occurred as second argument. from
- and to are the positions (in the pre-change
- coordinate system) where the change started and ended (for
- example, it might be {ch:0, line:18} if the
- position is at the beginning of line #19). text is
- an array of strings representing the text that replaced the
- changed range (split by line). removed is the text
- that used to be between from and to,
- which is overwritten by this change. This event is
- fired before the end of
- an operation , before the DOM updates
- happen.
-
- "changes" (instance: CodeMirror, changes: array<object>)
- Like the "change"
- event, but batched per operation ,
- passing an array containing all the changes that happened in the
- operation. This event is fired after the operation finished, and
- display changes it makes will trigger a new operation.
-
- "beforeChange" (instance: CodeMirror, changeObj: object)
- This event is fired before a change is applied, and its
- handler may choose to modify or cancel the change.
- The changeObj object
- has from, to, and text
- properties, as with
- the "change" event. It
- also has a cancel() method, which can be called to
- cancel the change, and, if the change isn't
- coming from an undo or redo event, an update(from, to,
- text) method, which may be used to modify the change.
- Undo or redo changes can't be modified, because they hold some
- metainformation for restoring old marked ranges that is only
- valid for that specific change. All three arguments
- to update are optional, and can be left off to
- leave the existing value for that field
- intact. Note: you may not do anything from
- a "beforeChange" handler that would cause changes
- to the document or its visualization. Doing so will, since this
- handler is called directly from the bowels of the CodeMirror
- implementation, probably cause the editor to become
- corrupted.
-
- "cursorActivity" (instance: CodeMirror)
- Will be fired when the cursor or selection moves, or any
- change is made to the editor content.
-
- "keyHandled" (instance: CodeMirror, name: string, event: Event)
- Fired after a key is handled through a
- key map. name is the name of the handled key (for
- example "Ctrl-X" or "'q'"),
- and event is the DOM keydown
- or keypress event.
-
- "inputRead" (instance: CodeMirror, changeObj: object)
- Fired whenever new input is read from the hidden textarea
- (typed or pasted by the user).
-
- "electrictInput" (instance: CodeMirror, line: integer)
- Fired if text input matched the
- mode's electric patterns,
- and this caused the line's indentation to change.
-
- "beforeSelectionChange" (instance: CodeMirror, obj: {ranges, update})
- This event is fired before the selection is moved. Its
- handler may inspect the set of selection ranges, present as an
- array of {anchor, head} objects in
- the ranges property of the obj
- argument, and optionally change them by calling
- the update method on this object, passing an array
- of ranges in the same format. Handlers for this event have the
- same restriction
- as "beforeChange"
- handlers — they should not do anything to directly update the
- state of the editor.
-
- "viewportChange" (instance: CodeMirror, from: number, to: number)
- Fires whenever the view port of
- the editor changes (due to scrolling, editing, or any other
- factor). The from and to arguments
- give the new start and end of the viewport.
-
- "swapDoc" (instance: CodeMirror, oldDoc: Doc)
- This is signalled when the editor's document is replaced
- using the swapDoc
- method.
-
- "gutterClick" (instance: CodeMirror, line: integer, gutter: string, clickEvent: Event)
- Fires when the editor gutter (the line-number area) is
- clicked. Will pass the editor instance as first argument, the
- (zero-based) number of the line that was clicked as second
- argument, the CSS class of the gutter that was clicked as third
- argument, and the raw mousedown event object as
- fourth argument.
-
-
- Fires when the editor gutter (the line-number area)
- receives a contextmenu event. Will pass the editor
- instance as first argument, the (zero-based) number of the line
- that was clicked as second argument, the CSS class of the
- gutter that was clicked as third argument, and the raw
- contextmenu mouse event object as fourth argument.
- You can preventDefault the event, to signal that
- CodeMirror should do no further handling.
-
- "focus" (instance: CodeMirror)
- Fires whenever the editor is focused.
-
- "blur" (instance: CodeMirror)
- Fires whenever the editor is unfocused.
-
- "scroll" (instance: CodeMirror)
- Fires when the editor is scrolled.
-
- "scrollCursorIntoView" (instance: CodeMirror, event: Event)
- Fires when the editor tries to scroll its cursor into view.
- Can be hooked into to take care of additional scrollable
- containers around the editor. When the event object has
- its preventDefault method called, CodeMirror will
- not itself try to scroll the window.
-
- "update" (instance: CodeMirror)
- Will be fired whenever CodeMirror updates its DOM display.
-
- "renderLine" (instance: CodeMirror, line: LineHandle, element: Element)
- Fired whenever a line is (re-)rendered to the DOM. Fired
- right after the DOM element is built, before it is
- added to the document. The handler may mess with the style of
- the resulting element, or add event handlers, but
- should not try to change the state of the editor.
-
- "mousedown" ,
- "dblclick" , "contextmenu" , "keydown" , "keypress" ,
- "keyup" , "dragstart" , "dragenter" ,
- "dragover" , "drop"
- (instance: CodeMirror, event: Event)
- Fired when CodeMirror is handling a DOM event of this type.
- You can preventDefault the event, or give it a
- truthy codemirrorIgnore property, to signal that
- CodeMirror should do no further handling.
-
-
- Document objects (instances
- of CodeMirror.Doc ) emit the
- following events:
-
-
- "change" (doc: CodeMirror.Doc, changeObj: object)
- Fired whenever a change occurs to the
- document. changeObj has a similar type as the
- object passed to the
- editor's "change"
- event.
-
- "beforeChange" (doc: CodeMirror.Doc, change: object)
- See the description of the
- same event on editor instances.
-
- "cursorActivity" (doc: CodeMirror.Doc)
- Fired whenever the cursor or selection in this document
- changes.
-
- "beforeSelectionChange" (doc: CodeMirror.Doc, selection: {head, anchor})
- Equivalent to
- the event by the same
- name as fired on editor instances.
-
-
- Line handles (as returned by, for
- example, getLineHandle )
- support these events:
-
-
- "delete" ()
- Will be fired when the line object is deleted. A line object
- is associated with the start of the line. Mostly useful
- when you need to find out when your gutter
- markers on a given line are removed.
- "change" (line: LineHandle, changeObj: object)
- Fires when the line's text content is changed in any way
- (but the line is not deleted outright). The change
- object is similar to the one passed
- to change event on the editor
- object.
-
-
- Marked range handles (CodeMirror.TextMarker), as returned
- by markText
- and setBookmark , emit the
- following events:
-
-
- "beforeCursorEnter" ()
- Fired when the cursor enters the marked range. From this
- event handler, the editor state may be inspected
- but not modified, with the exception that the range on
- which the event fires may be cleared.
- "clear" (from: {line, ch}, to: {line, ch})
- Fired when the range is cleared, either through cursor
- movement in combination
- with clearOnEnter
- or through a call to its clear() method. Will only
- be fired once per handle. Note that deleting the range through
- text editing does not fire this event, because an undo action
- might bring the range back into existence. from
- and to give the part of the document that the range
- spanned when it was cleared.
- "hide" ()
- Fired when the last part of the marker is removed from the
- document by editing operations.
- "unhide" ()
- Fired when, after the marker was removed by editing, a undo
- operation brought the marker back.
-
-
- Line widgets (CodeMirror.LineWidget), returned
- by addLineWidget , fire
- these events:
-
-
- "redraw" ()
- Fired whenever the editor re-adds the widget to the DOM.
- This will happen once right after the widget is added (if it is
- scrolled into view), and then again whenever it is scrolled out
- of view and back in again, or when changes to the editor options
- or the line the widget is on require the widget to be
- redrawn.
-
-
-
-
- Key Maps
-
- Key maps are ways to associate keys with functionality. A key map
- is an object mapping strings that identify the keys to functions
- that implement their functionality.
-
- The CodeMirror distributions comes
- with Emacs , Vim ,
- and Sublime Text -style keymaps.
-
- Keys are identified either by name or by character.
- The CodeMirror.keyNames object defines names for
- common keys and associates them with their key codes. Examples of
- names defined here are Enter, F5,
- and Q. These can be prefixed
- with Shift-, Cmd-, Ctrl-,
- and Alt- to specify a modifier. So for
- example, Shift-Ctrl-Space would be a valid key
- identifier.
-
- Common example: map the Tab key to insert spaces instead of a tab
- character.
-
-
-editor.setOption("extraKeys", {
- Tab: function(cm) {
- var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
- cm.replaceSelection(spaces);
- }
-});
-
- Alternatively, a character can be specified directly by
- surrounding it in single quotes, for example '$'
- or 'q'. Due to limitations in the way browsers fire
- key events, these may not be prefixed with modifiers.
-
- Multi-stroke key bindings can be specified
- by separating the key names by spaces in the property name, for
- example Ctrl-X Ctrl-V. When a map contains
- multi-stoke bindings or keys with modifiers that are not specified
- in the default order (Shift-Cmd-Ctrl-Alt), you must
- call CodeMirror.normalizeKeyMap on it before it can
- be used. This function takes a keymap and modifies it to normalize
- modifier order and properly recognize multi-stroke bindings. It
- will return the keymap itself.
-
- The CodeMirror.keyMap object associates key maps
- with names. User code and key map definitions can assign extra
- properties to this object. Anywhere where a key map is expected, a
- string can be given, which will be looked up in this object. It
- also contains the "default" key map holding the
- default bindings.
-
- The values of properties in key maps can be either functions of
- a single argument (the CodeMirror instance), strings, or
- false. Strings refer
- to commands , which are described below. If
- the property is set to false, CodeMirror leaves
- handling of the key up to the browser. A key handler function may
- return CodeMirror.Pass to indicate that it has
- decided not to handle the key, and other handlers (or the default
- behavior) should be given a turn.
-
- Keys mapped to command names that start with the
- characters "go" or to functions that have a
- truthy motion property (which should be used for
- cursor-movement actions) will be fired even when an
- extra Shift modifier is present (i.e. "Up":
- "goLineUp" matches both up and shift-up). This is used to
- easily implement shift-selection.
-
- Key maps can defer to each other by defining
- a fallthrough property. This indicates that when a
- key is not found in the map itself, one or more other maps should
- be searched. It can hold either a single key map or an array of
- key maps.
-
- When a key map needs to set something up when it becomes
- active, or tear something down when deactivated, it can
- contain attach and/or detach properties,
- which should hold functions that take the editor instance and the
- next or previous keymap. Note that this only works for the
- top-level keymap , not for fallthrough
- maps or maps added
- with extraKeys
- or addKeyMap .
-
-
-
- Commands
-
- Commands are parameter-less actions that can be performed on an
- editor. Their main use is for key bindings. Commands are defined by
- adding properties to the CodeMirror.commands object.
- A number of common commands are defined by the library itself,
- most of them used by the default key bindings. The value of a
- command property must be a function of one argument (an editor
- instance).
-
- Some of the commands below are referenced in the default
- key map, but not defined by the core library. These are intended to
- be defined by user code or addons.
-
- Commands can also be run with
- the execCommand
- method.
-
-
- selectAll Ctrl-A (PC), Cmd-A (Mac)
- Select the whole content of the editor.
-
- singleSelection Esc
- When multiple selections are present, this deselects all but
- the primary selection.
-
- killLine Ctrl-K (Mac)
- Emacs-style line killing. Deletes the part of the line after
- the cursor. If that consists only of whitespace, the newline at
- the end of the line is also deleted.
-
- deleteLine Ctrl-D (PC), Cmd-D (Mac)
- Deletes the whole line under the cursor, including newline at the end.
-
- delLineLeft
- Delete the part of the line before the cursor.
-
- delWrappedLineLeft Cmd-Backspace (Mac)
- Delete the part of the line from the left side of the visual line the cursor is on to the cursor.
-
- delWrappedLineRight Cmd-Delete (Mac)
- Delete the part of the line from the cursor to the right side of the visual line the cursor is on.
-
- undo Ctrl-Z (PC), Cmd-Z (Mac)
- Undo the last change.
-
- redo Ctrl-Y (PC), Shift-Cmd-Z (Mac), Cmd-Y (Mac)
- Redo the last undone change.
-
- undoSelection Ctrl-U (PC), Cmd-U (Mac)
- Undo the last change to the selection, or if there are no
- selection-only changes at the top of the history, undo the last
- change.
-
- redoSelection Alt-U (PC), Shift-Cmd-U (Mac)
- Redo the last change to the selection, or the last text change if
- no selection changes remain.
-
- goDocStart Ctrl-Home (PC), Cmd-Up (Mac), Cmd-Home (Mac)
- Move the cursor to the start of the document.
-
- goDocEnd Ctrl-End (PC), Cmd-End (Mac), Cmd-Down (Mac)
- Move the cursor to the end of the document.
-
- goLineStart Alt-Left (PC), Ctrl-A (Mac)
- Move the cursor to the start of the line.
-
- goLineStartSmart Home
- Move to the start of the text on the line, or if we are
- already there, to the actual start of the line (including
- whitespace).
-
- goLineEnd Alt-Right (PC), Ctrl-E (Mac)
- Move the cursor to the end of the line.
-
- goLineRight Cmd-Right (Mac)
- Move the cursor to the right side of the visual line it is on.
-
- goLineLeft Cmd-Left (Mac)
- Move the cursor to the left side of the visual line it is on. If
- this line is wrapped, that may not be the start of the line.
-
- goLineLeftSmart
- Move the cursor to the left side of the visual line it is
- on. If that takes it to the start of the line, behave
- like goLineStartSmart .
-
- goLineUp Up, Ctrl-P (Mac)
- Move the cursor up one line.
-
- goLineDown Down, Ctrl-N (Mac)
- Move down one line.
-
- goPageUp PageUp, Shift-Ctrl-V (Mac)
- Move the cursor up one screen, and scroll up by the same distance.
-
- goPageDown PageDown, Ctrl-V (Mac)
- Move the cursor down one screen, and scroll down by the same distance.
-
- goCharLeft Left, Ctrl-B (Mac)
- Move the cursor one character left, going to the previous line
- when hitting the start of line.
-
- goCharRight Right, Ctrl-F (Mac)
- Move the cursor one character right, going to the next line
- when hitting the end of line.
-
- goColumnLeft
- Move the cursor one character left, but don't cross line boundaries.
-
- goColumnRight
- Move the cursor one character right, don't cross line boundaries.
-
- goWordLeft Alt-B (Mac)
- Move the cursor to the start of the previous word.
-
- goWordRight Alt-F (Mac)
- Move the cursor to the end of the next word.
-
- goGroupLeft Ctrl-Left (PC), Alt-Left (Mac)
- Move to the left of the group before the cursor. A group is
- a stretch of word characters, a stretch of punctuation
- characters, a newline, or a stretch of more than one
- whitespace character.
-
- goGroupRight Ctrl-Right (PC), Alt-Right (Mac)
- Move to the right of the group after the cursor
- (see above ).
-
- delCharBefore Shift-Backspace, Ctrl-H (Mac)
- Delete the character before the cursor.
-
- delCharAfter Delete, Ctrl-D (Mac)
- Delete the character after the cursor.
-
- delWordBefore Alt-Backspace (Mac)
- Delete up to the start of the word before the cursor.
-
- delWordAfter Alt-D (Mac)
- Delete up to the end of the word after the cursor.
-
- delGroupBefore Ctrl-Backspace (PC), Alt-Backspace (Mac)
- Delete to the left of the group before the cursor.
-
- delGroupAfter Ctrl-Delete (PC), Ctrl-Alt-Backspace (Mac), Alt-Delete (Mac)
- Delete to the start of the group after the cursor.
-
- indentAuto Shift-Tab
- Auto-indent the current line or selection.
-
- indentMore Ctrl-] (PC), Cmd-] (Mac)
- Indent the current line or selection by one indent unit .
-
- indentLess Ctrl-[ (PC), Cmd-[ (Mac)
- Dedent the current line or selection by one indent unit .
-
- insertTab
- Insert a tab character at the cursor.
-
- insertSoftTab
- Insert the amount of spaces that match the width a tab at
- the cursor position would have.
-
- defaultTab Tab
- If something is selected, indent it by
- one indent unit . If nothing is
- selected, insert a tab character.
-
- transposeChars Ctrl-T (Mac)
- Swap the characters before and after the cursor.
-
- newlineAndIndent Enter
- Insert a newline and auto-indent the new line.
-
- toggleOverwrite Insert
- Flip the overwrite flag.
-
- save Ctrl-S (PC), Cmd-S (Mac)
- Not defined by the core library, only referred to in
- key maps. Intended to provide an easy way for user code to define
- a save command.
-
- find Ctrl-F (PC), Cmd-F (Mac)
- findNext Ctrl-G (PC), Cmd-G (Mac)
- findPrev Shift-Ctrl-G (PC), Shift-Cmd-G (Mac)
- replace Shift-Ctrl-F (PC), Cmd-Alt-F (Mac)
- replaceAll Shift-Ctrl-R (PC), Shift-Cmd-Alt-F (Mac)
- Not defined by the core library, but defined in
- the search addon (or custom client
- addons).
-
-
-
-
-
-
- Customized Styling
-
- Up to a certain extent, CodeMirror's look can be changed by
- modifying style sheet files. The style sheets supplied by modes
- simply provide the colors for that mode, and can be adapted in a
- very straightforward way. To style the editor itself, it is
- possible to alter or override the styles defined
- in codemirror.css .
-
- Some care must be taken there, since a lot of the rules in this
- file are necessary to have CodeMirror function properly. Adjusting
- colors should be safe, of course, and with some care a lot of
- other things can be changed as well. The CSS classes defined in
- this file serve the following roles:
-
-
- CodeMirror
- The outer element of the editor. This should be used for the
- editor width, height, borders and positioning. Can also be used
- to set styles that should hold for everything inside the editor
- (such as font and font size), or to set a background. Setting
- this class' height style to auto will
- make the editor resize to fit its
- content (it is recommended to also set
- the viewportMargin
- option to Infinity when doing this.
-
- CodeMirror-focused
- Whenever the editor is focused, the top element gets this
- class. This is used to hide the cursor and give the selection a
- different color when the editor is not focused.
-
- CodeMirror-gutters
- This is the backdrop for all gutters. Use it to set the
- default gutter background color, and optionally add a border on
- the right of the gutters.
-
- CodeMirror-linenumbers
- Use this for giving a background or width to the line number
- gutter.
-
- CodeMirror-linenumber
- Used to style the actual individual line numbers. These
- won't be children of the CodeMirror-linenumbers
- (plural) element, but rather will be absolutely positioned to
- overlay it. Use this to set alignment and text properties for
- the line numbers.
-
- CodeMirror-lines
- The visible lines. This is where you specify vertical
- padding for the editor content.
-
- CodeMirror-cursor
- The cursor is a block element that is absolutely positioned.
- You can make it look whichever way you want.
-
- CodeMirror-selected
- The selection is represented by span elements
- with this class.
-
- CodeMirror-matchingbracket ,
- CodeMirror-nonmatchingbracket
- These are used to style matched (or unmatched) brackets.
-
-
- If your page's style sheets do funky things to
- all div or pre elements (you probably
- shouldn't do that), you'll have to define rules to cancel these
- effects out again for elements under the CodeMirror
- class.
-
- Themes are also simply CSS files, which define colors for
- various syntactic elements. See the files in
- the theme directory.
-
-
-
- Programming API
-
- A lot of CodeMirror features are only available through its
- API. Thus, you need to write code (or
- use addons ) if you want to expose them to
- your users.
-
- Whenever points in the document are represented, the API uses
- objects with line and ch properties.
- Both are zero-based. CodeMirror makes sure to 'clip' any positions
- passed by client code so that they fit inside the document, so you
- shouldn't worry too much about sanitizing your coordinates. If you
- give ch a value of null, or don't
- specify it, it will be replaced with the length of the specified
- line.
-
- Methods prefixed with doc. can, unless otherwise
- specified, be called both on CodeMirror (editor)
- instances and CodeMirror.Doc instances. Methods
- prefixed with cm. are only available
- on CodeMirror instances.
-
- Constructor
-
- Constructing an editor instance is done with
- the CodeMirror (place: Element|fn(Element),
- ?option: object) constructor. If the place
- argument is a DOM element, the editor will be appended to it. If
- it is a function, it will be called, and is expected to place the
- editor into the document. options may be an element
- mapping option names to values. The options
- that it doesn't explicitly specify (or all options, if it is not
- passed) will be taken
- from CodeMirror.defaults .
-
- Note that the options object passed to the constructor will be
- mutated when the instance's options
- are changed , so you shouldn't share such
- objects between instances.
-
- See CodeMirror.fromTextArea
- for another way to construct an editor instance.
-
- Content manipulation methods
-
-
- doc.getValue (?separator: string) → string
- Get the current editor content. You can pass it an optional
- argument to specify the string to be used to separate lines
- (defaults to "\n").
- doc.setValue (content: string)
- Set the editor content.
-
- doc.getRange (from: {line, ch}, to: {line, ch}, ?separator: string) → string
- Get the text between the given points in the editor, which
- should be {line, ch} objects. An optional third
- argument can be given to indicate the line separator string to
- use (defaults to "\n").
- doc.replaceRange (replacement: string, from: {line, ch}, to: {line, ch}, ?origin: string)
- Replace the part of the document between from
- and to with the given string. from
- and to must be {line, ch}
- objects. to can be left off to simply insert the
- string at position from. When origin
- is given, it will be passed on
- to "change" events , and
- its first letter will be used to determine whether this change
- can be merged with previous history events, in the way described
- for selection origins .
-
- doc.getLine (n: integer) → string
- Get the content of line n.
-
- doc.lineCount () → integer
- Get the number of lines in the editor.
- doc.firstLine () → integer
- Get the first line of the editor. This will
- usually be zero but for linked sub-views ,
- or documents instantiated with a non-zero
- first line, it might return other values.
- doc.lastLine () → integer
- Get the last line of the editor. This will
- usually be doc.lineCount() - 1,
- but for linked sub-views ,
- it might return other values.
-
- doc.getLineHandle (num: integer) → LineHandle
- Fetches the line handle for the given line number.
- doc.getLineNumber (handle: LineHandle) → integer
- Given a line handle, returns the current position of that
- line (or null when it is no longer in the
- document).
- doc.eachLine (f: (line: LineHandle))
- doc.eachLine (start: integer, end: integer, f: (line: LineHandle))
- Iterate over the whole document, or if start
- and end line numbers are given, the range
- from start up to (not including) end,
- and call f for each line, passing the line handle.
- This is a faster way to visit a range of line handlers than
- calling getLineHandle
- for each of them. Note that line handles have
- a text property containing the line's content (as a
- string).
-
- doc.markClean ()
- Set the editor content as 'clean', a flag that it will
- retain until it is edited, and which will be set again when such
- an edit is undone again. Useful to track whether the content
- needs to be saved. This function is deprecated in favor
- of changeGeneration ,
- which allows multiple subsystems to track different notions of
- cleanness without interfering.
- doc.changeGeneration (?closeEvent: boolean) → integer
- Returns a number that can later be passed
- to isClean to test whether
- any edits were made (and not undone) in the meantime.
- If closeEvent is true, the current history event
- will be ‘closed’, meaning it can't be combined with further
- changes (rapid typing or deleting events are typically
- combined).
- doc.isClean (?generation: integer) → boolean
- Returns whether the document is currently clean — not
- modified since initialization or the last call
- to markClean if no
- argument is passed, or since the matching call
- to changeGeneration
- if a generation value is given.
-
-
- Cursor and selection methods
-
-
- doc.getSelection (?lineSep: string) → string
- Get the currently selected code. Optionally pass a line
- separator to put between the lines in the output. When multiple
- selections are present, they are concatenated with instances
- of lineSep in between.
- doc.getSelections (?lineSep: string) → string
- Returns an array containing a string for each selection,
- representing the content of the selections.
-
- doc.replaceSelection (replacement: string, ?select: string)
- Replace the selection(s) with the given string. By default,
- the new selection ends up after the inserted text. The
- optional select argument can be used to change
- this—passing "around" will cause the new text to be
- selected, passing "start" will collapse the
- selection to the start of the inserted text.
- doc.replaceSelections (replacements: array<string>, ?select: string)
- The length of the given array should be the same as the
- number of active selections. Replaces the content of the
- selections with the strings in the array.
- The select argument works the same as
- in replaceSelection .
-
- doc.getCursor (?start: string) → {line, ch}
- Retrieve one end of the primary
- selection. start is a an optional string indicating
- which end of the selection to return. It may
- be "from", "to", "head"
- (the side of the selection that moves when you press
- shift+arrow), or "anchor" (the fixed side of the
- selection). Omitting the argument is the same as
- passing "head". A {line, ch} object
- will be returned.
- doc.listSelections () → array<{anchor, head}>
- Retrieves a list of all current selections. These will
- always be sorted, and never overlap (overlapping selections are
- merged). Each object in the array contains anchor
- and head properties referring to {line,
- ch} objects.
-
- doc.somethingSelected () → boolean
- Return true if any text is selected.
- doc.setCursor (pos: {line, ch}|number, ?ch: number, ?options: object)
- Set the cursor position. You can either pass a
- single {line, ch} object, or the line and the
- character as two separate parameters. Will replace all
- selections with a single, empty selection at the given position.
- The supported options are the same as for setSelection .
-
- doc.setSelection (anchor: {line, ch}, ?head: {line, ch}, ?options: object)
- Set a single selection range. anchor
- and head should be {line, ch}
- objects. head defaults to anchor when
- not given. These options are supported:
-
- scroll : boolean
- Determines whether the selection head should be scrolled
- into view. Defaults to true.
- origin : string
- Detemines whether the selection history event may be
- merged with the previous one. When an origin starts with the
- character +, and the last recorded selection had
- the same origin and was similar (close
- in time , both
- collapsed or both non-collapsed), the new one will replace the
- old one. When it starts with *, it will always
- replace the previous event (if that had the same origin).
- Built-in motion uses the "+move" origin.
- bias : number
- Determine the direction into which the selection endpoints
- should be adjusted when they fall inside
- an atomic range. Can be either -1
- (backward) or 1 (forward). When not given, the bias will be
- based on the relative position of the old selection—the editor
- will try to move further away from that, to prevent getting
- stuck.
-
-
- doc.setSelections (ranges: array<{anchor, head}>, ?primary: integer, ?options: object)
- Sets a new set of selections. There must be at least one
- selection in the given array. When primary is a
- number, it determines which selection is the primary one. When
- it is not given, the primary index is taken from the previous
- selection, or set to the last range if the previous selection
- had less ranges than the new one. Supports the same options
- as setSelection .
- doc.addSelection (anchor: {line, ch}, ?head: {line, ch})
- Adds a new selection to the existing set of selections, and
- makes it the primary selection.
-
- doc.extendSelection (from: {line, ch}, ?to: {line, ch}, ?options: object)
- Similar
- to setSelection , but
- will, if shift is held or
- the extending flag is set, move the
- head of the selection while leaving the anchor at its current
- place. to is optional, and can be passed to ensure
- a region (for example a word or paragraph) will end up selected
- (in addition to whatever lies between that region and the
- current anchor). When multiple selections are present, all but
- the primary selection will be dropped by this method.
- Supports the same options as setSelection .
- doc.extendSelections (heads: array<{line, ch}>, ?options: object)
- An equivalent
- of extendSelection
- that acts on all selections at once.
- doc.extendSelectionsBy (f: function(range: {anchor, head}) → {anchor, head}), ?options: object)
- Applies the given function to all existing selections, and
- calls extendSelections
- on the result.
- doc.setExtending (value: boolean)
- Sets or clears the 'extending' flag, which acts similar to
- the shift key, in that it will cause cursor movement and calls
- to extendSelection
- to leave the selection anchor in place.
- doc.getExtending () → boolean
- Get the value of the 'extending' flag.
-
- cm.hasFocus () → boolean
- Tells you whether the editor currently has focus.
-
- cm.findPosH (start: {line, ch}, amount: integer, unit: string, visually: boolean) → {line, ch, ?hitSide: boolean}
- Used to find the target position for horizontal cursor
- motion. start is a {line, ch}
- object, amount an integer (may be negative),
- and unit one of the
- string "char", "column",
- or "word". Will return a position that is produced
- by moving amount times the distance specified
- by unit. When visually is true, motion
- in right-to-left text will be visual rather than logical. When
- the motion was clipped by hitting the end or start of the
- document, the returned value will have a hitSide
- property set to true.
- cm.findPosV (start: {line, ch}, amount: integer, unit: string) → {line, ch, ?hitSide: boolean}
- Similar to findPosH ,
- but used for vertical motion. unit may
- be "line" or "page". The other
- arguments and the returned value have the same interpretation as
- they have in findPosH.
-
- cm.findWordAt (pos: {line, ch}) → {anchor: {line, ch}, head: {line, ch}}
- Returns the start and end of the 'word' (the stretch of
- letters, whitespace, or punctuation) at the given position.
-
-
- Configuration methods
-
-
- cm.setOption (option: string, value: any)
- Change the configuration of the editor. option
- should the name of an option ,
- and value should be a valid value for that
- option.
- cm.getOption (option: string) → any
- Retrieves the current value of the given option for this
- editor instance.
-
- cm.addKeyMap (map: object, bottom: boolean)
- Attach an additional key map to the
- editor. This is mostly useful for addons that need to register
- some key handlers without trampling on
- the extraKeys
- option. Maps added in this way have a higher precedence than
- the extraKeys
- and keyMap options,
- and between them, the maps added earlier have a lower precedence
- than those added later, unless the bottom argument
- was passed, in which case they end up below other key maps added
- with this method.
- cm.removeKeyMap (map: object)
- Disable a keymap added
- with addKeyMap . Either
- pass in the key map object itself, or a string, which will be
- compared against the name property of the active
- key maps.
-
- cm.addOverlay (mode: string|object, ?options: object)
- Enable a highlighting overlay. This is a stateless mini-mode
- that can be used to add extra highlighting. For example,
- the search addon uses it to
- highlight the term that's currently being
- searched. mode can be a mode
- spec or a mode object (an object with
- a token method).
- The options parameter is optional. If given, it
- should be an object. Currently, only the opaque
- option is recognized. This defaults to off, but can be given to
- allow the overlay styling, when not null, to
- override the styling of the base mode entirely, instead of the
- two being applied together.
- cm.removeOverlay (mode: string|object)
- Pass this the exact value passed for the mode
- parameter to addOverlay ,
- or a string that corresponds to the name propery of
- that value, to remove an overlay again.
-
- cm.on (type: string, func: (...args))
- Register an event handler for the given event type (a
- string) on the editor instance. There is also
- a CodeMirror.on(object, type, func) version
- that allows registering of events on any object.
- cm.off (type: string, func: (...args))
- Remove an event handler on the editor instance. An
- equivalent CodeMirror.off(object, type,
- func) also exists.
-
-
- Document management methods
-
- Each editor is associated with an instance
- of CodeMirror.Doc, its document. A document
- represents the editor content, plus a selection, an undo history,
- and a mode . A document can only be
- associated with a single editor at a time. You can create new
- documents by calling the CodeMirror.Doc(text, mode,
- firstLineNumber) constructor. The last two arguments are
- optional and can be used to set a mode for the document and make
- it start at a line number other than 0, respectively.
-
-
- cm.getDoc () → Doc
- Retrieve the currently active document from an editor.
- doc.getEditor () → CodeMirror
- Retrieve the editor associated with a document. May
- return null.
-
- cm.swapDoc (doc: CodeMirror.Doc) → Doc
- Attach a new document to the editor. Returns the old
- document, which is now no longer associated with an editor.
-
- doc.copy (copyHistory: boolean) → Doc
- Create an identical copy of the given doc.
- When copyHistory is true, the history will also be
- copied. Can not be called directly on an editor.
-
- doc.linkedDoc (options: object) → Doc
- Create a new document that's linked to the target document.
- Linked documents will stay in sync (changes to one are also
- applied to the other) until unlinked .
- These are the options that are supported:
-
- sharedHist : boolean
- When turned on, the linked copy will share an undo
- history with the original. Thus, something done in one of
- the two can be undone in the other, and vice versa.
- from : integer
- to : integer
- Can be given to make the new document a subview of the
- original. Subviews only show a given range of lines. Note
- that line coordinates inside the subview will be consistent
- with those of the parent, so that for example a subview
- starting at line 10 will refer to its first line as line 10,
- not 0.
- mode : string|object
- By default, the new document inherits the mode of the
- parent. This option can be set to
- a mode spec to give it a
- different mode.
-
- doc.unlinkDoc (doc: CodeMirror.Doc)
- Break the link between two documents. After calling this,
- changes will no longer propagate between the documents, and, if
- they had a shared history, the history will become
- separate.
- doc.iterLinkedDocs (function: (doc: CodeMirror.Doc, sharedHist: boolean))
- Will call the given function for all documents linked to the
- target document. It will be passed two arguments, the linked document
- and a boolean indicating whether that document shares history
- with the target.
-
-
- History-related methods
-
-
- doc.undo ()
- Undo one edit (if any undo events are stored).
- doc.redo ()
- Redo one undone edit.
-
- doc.undoSelection ()
- Undo one edit or selection change.
- doc.redoSelection ()
- Redo one undone edit or selection change.
-
- doc.historySize () → {undo: integer, redo: integer}
- Returns an object with {undo, redo} properties,
- both of which hold integers, indicating the amount of stored
- undo and redo operations.
- doc.clearHistory ()
- Clears the editor's undo history.
- doc.getHistory () → object
- Get a (JSON-serializeable) representation of the undo history.
- doc.setHistory (history: object)
- Replace the editor's undo history with the one provided,
- which must be a value as returned
- by getHistory . Note that
- this will have entirely undefined results if the editor content
- isn't also the same as it was when getHistory was
- called.
-
-
- Text-marking methods
-
-
- doc.markText (from: {line, ch}, to: {line, ch}, ?options: object) → TextMarker
- Can be used to mark a range of text with a specific CSS
- class name. from and to should
- be {line, ch} objects. The options
- parameter is optional. When given, it should be an object that
- may contain the following configuration options:
-
- className : string
- Assigns a CSS class to the marked stretch of text.
- inclusiveLeft : boolean
- Determines whether
- text inserted on the left of the marker will end up inside
- or outside of it.
- inclusiveRight : boolean
- Like inclusiveLeft,
- but for the right side.
- atomic : boolean
- Atomic ranges act as a single unit when cursor movement is
- concerned—i.e. it is impossible to place the cursor inside of
- them. In atomic ranges, inclusiveLeft
- and inclusiveRight have a different meaning—they
- will prevent the cursor from being placed respectively
- directly before and directly after the range.
- collapsed : boolean
- Collapsed ranges do not show up in the display. Setting a
- range to be collapsed will automatically make it atomic.
- clearOnEnter : boolean
- When enabled, will cause the mark to clear itself whenever
- the cursor enters its range. This is mostly useful for
- text-replacement widgets that need to 'snap open' when the
- user tries to edit them. The
- "clear" event
- fired on the range handle can be used to be notified when this
- happens.
- clearWhenEmpty : boolean
- Determines whether the mark is automatically cleared when
- it becomes empty. Default is true.
- replacedWith : Element
- Use a given node to display this range. Implies both
- collapsed and atomic. The given DOM node must be an
- inline element (as opposed to a block element).
- handleMouseEvents : boolean
- When replacedWith is given, this determines
- whether the editor will capture mouse and drag events
- occurring in this widget. Default is false—the events will be
- left alone for the default browser handler, or specific
- handlers on the widget, to capture.
- readOnly : boolean
- A read-only span can, as long as it is not cleared, not be
- modified except by
- calling setValue to reset
- the whole document. Note: adding a read-only span
- currently clears the undo history of the editor, because
- existing undo events being partially nullified by read-only
- spans would corrupt the history (in the current
- implementation).
- addToHistory : boolean
- When set to true (default is false), adding this marker
- will create an event in the undo history that can be
- individually undone (clearing the marker).
- startStyle : stringCan be used to specify
- an extra CSS class to be applied to the leftmost span that
- is part of the marker.
- endStyle : stringEquivalent
- to startStyle, but for the rightmost span.
- css : string
- A string of CSS to be applied to the covered text. For example "color: #fe3".
- title :
- stringWhen given, will give the nodes created
- for this span a HTML title attribute with the
- given value.
- shared : booleanWhen the
- target document is linked to other
- documents, you can set shared to true to make the
- marker appear in all documents. By default, a marker appears
- only in its target document.
-
- The method will return an object that represents the marker
- (with constructor CodeMirror.TextMarker), which
- exposes three methods:
- clear (), to remove the mark,
- find (), which returns
- a {from, to} object (both holding document
- positions), indicating the current position of the marked range,
- or undefined if the marker is no longer in the
- document, and finally changed (),
- which you can call if you've done something that might change
- the size of the marker (for example changing the content of
- a replacedWith
- node), and want to cheaply update the display.
-
- doc.setBookmark (pos: {line, ch}, ?options: object) → TextMarker
- Inserts a bookmark, a handle that follows the text around it
- as it is being edited, at the given position. A bookmark has two
- methods find() and clear(). The first
- returns the current position of the bookmark, if it is still in
- the document, and the second explicitly removes the bookmark.
- The options argument is optional. If given, the following
- properties are recognized:
-
- widget : ElementCan be used to display a DOM
- node at the current location of the bookmark (analogous to
- the replacedWith
- option to markText ).
- insertLeft : booleanBy default, text typed
- when the cursor is on top of the bookmark will end up to the
- right of the bookmark. Set this option to true to make it go
- to the left instead.
- shared : booleanSee
- the corresponding option
- to markText.
- handleMouseEvents : boolean
- As with markText ,
- this determines whether mouse events on the widget inserted
- for this bookmark are handled by CodeMirror. The default is
- false.
-
-
- doc.findMarks (from: {line, ch}, to: {line, ch}) → array<TextMarker>
- Returns an array of all the bookmarks and marked ranges
- found between the given positions.
- doc.findMarksAt (pos: {line, ch}) → array<TextMarker>
- Returns an array of all the bookmarks and marked ranges
- present at the given position.
- doc.getAllMarks () → array<TextMarker>
- Returns an array containing all marked ranges in the document.
-
-
- Widget, gutter, and decoration methods
-
-
- cm.setGutterMarker (line: integer|LineHandle, gutterID: string, value: Element) → LineHandle
- Sets the gutter marker for the given gutter (identified by
- its CSS class, see
- the gutters option)
- to the given value. Value can be either null, to
- clear the marker, or a DOM element, to set it. The DOM element
- will be shown in the specified gutter next to the specified
- line.
-
- cm.clearGutter (gutterID: string)
- Remove all gutter markers in
- the gutter with the given ID.
-
- doc.addLineClass (line: integer|LineHandle, where: string, class: string) → LineHandle
- Set a CSS class name for the given line. line
- can be a number or a line handle. where determines
- to which element this class should be applied, can can be one
- of "text" (the text element, which lies in front of
- the selection), "background" (a background element
- that will be behind the selection), "gutter" (the
- line's gutter space), or "wrap" (the wrapper node
- that wraps all of the line's elements, including gutter
- elements). class should be the name of the class to
- apply.
-
- doc.removeLineClass (line: integer|LineHandle, where: string, class: string) → LineHandle
- Remove a CSS class from a line. line can be a
- line handle or number. where should be one
- of "text", "background",
- or "wrap"
- (see addLineClass ). class
- can be left off to remove all classes for the specified node, or
- be a string to remove only a specific class.
-
- cm.lineInfo (line: integer|LineHandle) → object
- Returns the line number, text content, and marker status of
- the given line, which can be either a number or a line handle.
- The returned object has the structure {line, handle, text,
- gutterMarkers, textClass, bgClass, wrapClass, widgets},
- where gutterMarkers is an object mapping gutter IDs
- to marker elements, and widgets is an array
- of line widgets attached to this
- line, and the various class properties refer to classes added
- with addLineClass .
-
- cm.addWidget (pos: {line, ch}, node: Element, scrollIntoView: boolean)
- Puts node, which should be an absolutely
- positioned DOM node, into the editor, positioned right below the
- given {line, ch} position.
- When scrollIntoView is true, the editor will ensure
- that the entire node is visible (if possible). To remove the
- widget again, simply use DOM methods (move it somewhere else, or
- call removeChild on its parent).
-
- doc.addLineWidget (line: integer|LineHandle, node: Element, ?options: object) → LineWidget
- Adds a line widget, an element shown below a line, spanning
- the whole of the editor's width, and moving the lines below it
- downwards. line should be either an integer or a
- line handle, and node should be a DOM node, which
- will be displayed below the given line. options,
- when given, should be an object that configures the behavior of
- the widget. The following options are supported (all default to
- false):
-
- coverGutter : boolean
- Whether the widget should cover the gutter.
- noHScroll : boolean
- Whether the widget should stay fixed in the face of
- horizontal scrolling.
- above : boolean
- Causes the widget to be placed above instead of below
- the text of the line.
- handleMouseEvents : boolean
- Determines whether the editor will capture mouse and
- drag events occurring in this widget. Default is false—the
- events will be left alone for the default browser handler,
- or specific handlers on the widget, to capture.
- insertAt : integer
- By default, the widget is added below other widgets for
- the line. This option can be used to place it at a different
- position (zero for the top, N to put it after the Nth other
- widget). Note that this only has effect once, when the
- widget is created.
-
- Note that the widget node will become a descendant of nodes with
- CodeMirror-specific CSS classes, and those classes might in some
- cases affect it. This method returns an object that represents
- the widget placement. It'll have a line property
- pointing at the line handle that it is associated with, and the following methods:
-
- clear ()Removes the widget.
- changed ()Call
- this if you made some change to the widget's DOM node that
- might affect its height. It'll force CodeMirror to update
- the height of the line that contains the widget.
-
-
-
-
- Sizing, scrolling and positioning methods
-
-
- cm.setSize (width: number|string, height: number|string)
- Programatically set the size of the editor (overriding the
- applicable CSS
- rules ). width and height
- can be either numbers (interpreted as pixels) or CSS units
- ("100%", for example). You can
- pass null for either of them to indicate that that
- dimension should not be changed.
-
- cm.scrollTo (x: number, y: number)
- Scroll the editor to a given (pixel) position. Both
- arguments may be left as null
- or undefined to have no effect.
- cm.getScrollInfo () → {left, top, width, height, clientWidth, clientHeight}
- Get an {left, top, width, height, clientWidth,
- clientHeight} object that represents the current scroll
- position, the size of the scrollable area, and the size of the
- visible area (minus scrollbars).
- cm.scrollIntoView (what: {line, ch}|{left, top, right, bottom}|{from, to}|null, ?margin: number)
- Scrolls the given position into view. what may
- be null to scroll the cursor into view,
- a {line, ch} position to scroll a character into
- view, a {left, top, right, bottom} pixel range (in
- editor-local coordinates), or a range {from, to}
- containing either two character positions or two pixel squares.
- The margin parameter is optional. When given, it
- indicates the amount of vertical pixels around the given area
- that should be made visible as well.
-
- cm.cursorCoords (where: boolean|{line, ch}, mode: string) → {left, top, bottom}
- Returns an {left, top, bottom} object
- containing the coordinates of the cursor position.
- If mode is "local", they will be
- relative to the top-left corner of the editable document. If it
- is "page" or not given, they are relative to the
- top-left corner of the page. If mode
- is "window", the coordinates are relative to the
- top-left corner of the currently visible (scrolled)
- window. where can be a boolean indicating whether
- you want the start (true) or the end
- (false) of the selection, or, if a {line,
- ch} object is given, it specifies the precise position at
- which you want to measure.
- cm.charCoords (pos: {line, ch}, ?mode: string) → {left, right, top, bottom}
- Returns the position and dimensions of an arbitrary
- character. pos should be a {line, ch}
- object. This differs from cursorCoords in that
- it'll give the size of the whole character, rather than just the
- position that the cursor would have when it would sit at that
- position.
- cm.coordsChar (object: {left, top}, ?mode: string) → {line, ch}
- Given an {left, top} object, returns
- the {line, ch} position that corresponds to it. The
- optional mode parameter determines relative to what
- the coordinates are interpreted. It may
- be "window", "page" (the default),
- or "local".
- cm.lineAtHeight (height: number, ?mode: string) → number
- Computes the line at the given pixel
- height. mode can be one of the same strings
- that coordsChar
- accepts.
- cm.heightAtLine (line: integer|LineHandle, ?mode: string) → number
- Computes the height of the top of a line, in the coordinate
- system specified by mode
- (see coordsChar ), which
- defaults to "page". When a line below the bottom of
- the document is specified, the returned value is the bottom of
- the last line in the document.
- cm.defaultTextHeight () → number
- Returns the line height of the default font for the editor.
- cm.defaultCharWidth () → number
- Returns the pixel width of an 'x' in the default font for
- the editor. (Note that for non-monospace fonts, this is mostly
- useless, and even for monospace fonts, non-ascii characters
- might have a different width).
-
- cm.getViewport () → {from: number, to: number}
- Returns a {from, to} object indicating the
- start (inclusive) and end (exclusive) of the currently rendered
- part of the document. In big documents, when most content is
- scrolled out of view, CodeMirror will only render the visible
- part, and a margin around it. See also
- the viewportChange
- event.
-
- cm.refresh ()
- If your code does something to change the size of the editor
- element (window resizes are already listened for), or unhides
- it, you should probably follow up by calling this method to
- ensure CodeMirror is still looking as intended.
-
-
- Mode, state, and token-related methods
-
- When writing language-aware functionality, it can often be
- useful to hook into the knowledge that the CodeMirror language
- mode has. See the section on modes for a
- more detailed description of how these work.
-
-
- doc.getMode () → object
- Gets the (outer) mode object for the editor. Note that this
- is distinct from getOption("mode"), which gives you
- the mode specification, rather than the resolved, instantiated
- mode object .
-
- cm.getModeAt (pos: {line, ch}) → object
- Gets the inner mode at a given position. This will return
- the same as getMode for
- simple modes, but will return an inner mode for nesting modes
- (such as htmlmixed).
-
- cm.getTokenAt (pos: {line, ch}, ?precise: boolean) → object
- Retrieves information about the token the current mode found
- before the given position (a {line, ch} object). The
- returned object has the following properties:
-
- start The character (on the given line) at which the token starts.
- end The character at which the token ends.
- string The token's string.
- type The token type the mode assigned
- to the token, such as "keyword"
- or "comment" (may also be null).
- state The mode's state at the end of this token.
-
- If precise is true, the token will be guaranteed to be accurate based on recent edits. If false or
- not specified, the token will use cached state information, which will be faster but might not be accurate if
- edits were recently made and highlighting has not yet completed.
-
-
- cm.getLineTokens (line: integer, ?precise: boolean) → array<{start, end, string, type, state}>
- This is similar
- to getTokenAt , but
- collects all tokens for a given line into an array. It is much
- cheaper than repeatedly calling getTokenAt, which
- re-parses the part of the line before the token for every call.
-
- cm.getTokenTypeAt (pos: {line, ch}) → string
- This is a (much) cheaper version
- of getTokenAt useful for
- when you just need the type of the token at a given position,
- and no other information. Will return null for
- unstyled tokens, and a string, potentially containing multiple
- space-separated style names, otherwise.
-
- cm.getHelpers (pos: {line, ch}, type: string) → array<helper>
- Fetch the set of applicable helper values for the given
- position. Helpers provide a way to look up functionality
- appropriate for a mode. The type argument provides
- the helper namespace (see
- registerHelper ), in
- which the values will be looked up. When the mode itself has a
- property that corresponds to the type, that
- directly determines the keys that are used to look up the helper
- values (it may be either a single string, or an array of
- strings). Failing that, the mode's helperType
- property and finally the mode's name are used.
- For example, the JavaScript mode has a
- property fold containing "brace". When
- the brace-fold addon is loaded, that defines a
- helper named brace in the fold
- namespace. This is then used by
- the foldcode addon to
- figure out that it can use that folding function to fold
- JavaScript code.
- When any 'global'
- helpers are defined for the given namespace, their predicates
- are called on the current mode and editor, and all those that
- declare they are applicable will also be added to the array that
- is returned.
-
- cm.getHelper (pos: {line, ch}, type: string) → helper
- Returns the first applicable helper value.
- See getHelpers .
-
- cm.getStateAfter (?line: integer, ?precise: boolean) → object
- Returns the mode's parser state, if any, at the end of the
- given line number. If no line number is given, the state at the
- end of the document is returned. This can be useful for storing
- parsing errors in the state, or getting other kinds of
- contextual information for a line. precise is defined
- as in getTokenAt().
-
-
- Miscellaneous methods
-
-
- cm.operation (func: () → any) → any
- CodeMirror internally buffers changes and only updates its
- DOM structure after it has finished performing some operation.
- If you need to perform a lot of operations on a CodeMirror
- instance, you can call this method with a function argument. It
- will call the function, buffering up all changes, and only doing
- the expensive update after the function returns. This can be a
- lot faster. The return value from this method will be the return
- value of your function.
-
- cm.indentLine (line: integer, ?dir: string|integer)
- Adjust the indentation of the given line. The second
- argument (which defaults to "smart") may be one of:
-
- "prev"
- Base indentation on the indentation of the previous line.
- "smart"
- Use the mode's smart indentation if available, behave
- like "prev" otherwise.
- "add"
- Increase the indentation of the line by
- one indent unit .
- "subtract"
- Reduce the indentation of the line.
- <integer>
- Add (positive number) or reduce (negative number) the
- indentation by the given amount of spaces.
-
-
- cm.toggleOverwrite (?value: bool)
- Switches between overwrite and normal insert mode (when not
- given an argument), or sets the overwrite mode to a specific
- state (when given an argument).
-
- doc.lineSeparator ()
- Returns the preferred line separator string for this
- document, as per the option
- by the same name. When that option is null, the
- string "\n" is returned.
-
- cm.execCommand (name: string)
- Runs the command with the given name on the editor.
-
- doc.posFromIndex (index: integer) → {line, ch}
- Calculates and returns a {line, ch} object for a
- zero-based index who's value is relative to the start of the
- editor's text. If the index is out of range of the text then
- the returned object is clipped to start or end of the text
- respectively.
- doc.indexFromPos (object: {line, ch}) → integer
- The reverse of posFromIndex .
-
- cm.focus ()
- Give the editor focus.
-
- cm.getInputField () → Element
- Returns the input field for the editor. Will be a textarea
- or an editable div, depending on the value of
- the inputStyle
- option.
- cm.getWrapperElement () → Element
- Returns the DOM node that represents the editor, and
- controls its size. Remove this from your tree to delete an
- editor instance.
- cm.getScrollerElement () → Element
- Returns the DOM node that is responsible for the scrolling
- of the editor.
- cm.getGutterElement () → Element
- Fetches the DOM node that contains the editor gutters.
-
-
- Static properties
- The CodeMirror object itself provides
- several useful properties.
-
-
- CodeMirror.version : string
- It contains a string that indicates the version of the
- library. This is a triple of
- integers "major.minor.patch",
- where patch is zero for releases, and something
- else (usually one) for dev snapshots.
-
- CodeMirror.fromTextArea (textArea: TextAreaElement, ?config: object)
-
- The method provides another way to initialize an editor. It
- takes a textarea DOM node as first argument and an optional
- configuration object as second. It will replace the textarea
- with a CodeMirror instance, and wire up the form of that
- textarea (if any) to make sure the editor contents are put
- into the textarea when the form is submitted. The text in the
- textarea will provide the content for the editor. A CodeMirror
- instance created this way has three additional methods:
-
- cm.save ()
- Copy the content of the editor into the textarea.
-
- cm.toTextArea ()
- Remove the editor, and restore the original textarea (with
- the editor's current content).
-
- cm.getTextArea () → TextAreaElement
- Returns the textarea that the instance was based on.
-
-
-
- CodeMirror.defaults : object
- An object containing default values for
- all options . You can assign to its
- properties to modify defaults (though this won't affect editors
- that have already been created).
-
- CodeMirror.defineExtension (name: string, value: any)
- If you want to define extra methods in terms of the
- CodeMirror API, it is possible to
- use defineExtension. This will cause the given
- value (usually a method) to be added to all CodeMirror instances
- created from then on.
-
- CodeMirror.defineDocExtension (name: string, value: any)
- Like defineExtension ,
- but the method will be added to the interface
- for Doc objects instead.
-
- CodeMirror.defineOption (name: string,
- default: any, updateFunc: function)
- Similarly, defineOption can be used to define new options for
- CodeMirror. The updateFunc will be called with the
- editor instance and the new value when an editor is initialized,
- and whenever the option is modified
- through setOption .
-
- CodeMirror.defineInitHook (func: function)
- If your extention just needs to run some
- code whenever a CodeMirror instance is initialized,
- use CodeMirror.defineInitHook. Give it a function as
- its only argument, and from then on, that function will be called
- (with the instance as argument) whenever a new CodeMirror instance
- is initialized.
-
- CodeMirror.registerHelper (type: string, name: string, value: helper)
- Registers a helper value with the given name in
- the given namespace (type). This is used to define
- functionality that may be looked up by mode. Will create (if it
- doesn't already exist) a property on the CodeMirror
- object for the given type, pointing to an object
- that maps names to values. I.e. after
- doing CodeMirror.registerHelper("hint", "foo",
- myFoo), the value CodeMirror.hint.foo will
- point to myFoo.
-
- CodeMirror.registerGlobalHelper (type: string, name: string, predicate: fn(mode, CodeMirror), value: helper)
- Acts
- like registerHelper ,
- but also registers this helper as 'global', meaning that it will
- be included by getHelpers
- whenever the given predicate returns true when
- called with the local mode and editor.
-
- CodeMirror.Pos (line: integer, ?ch: integer)
- A constructor for the {line, ch} objects that
- are used to represent positions in editor documents.
-
- CodeMirror.changeEnd (change: object) → {line, ch}
- Utility function that computes an end position from a change
- (an object with from, to,
- and text properties, as passed to
- various event handlers ). The
- returned position will be the end of the changed
- range, after the change is applied.
-
-
-
-
- Addons
-
- The addon directory in the distribution contains a
- number of reusable components that implement extra editor
- functionality (on top of extension functions
- like defineOption , defineExtension ,
- and registerHelper ). In
- brief, they are:
-
-
- dialog/dialog.js
- Provides a very simple way to query users for text input.
- Adds the openDialog(template, callback, options) →
- closeFunction method to CodeMirror instances,
- which can be called with an HTML fragment or a detached DOM
- node that provides the prompt (should include an input
- or button tag), and a callback function that is called
- when the user presses enter. It returns a function closeFunction
- which, if called, will close the dialog immediately.
- openDialog takes the following options:
-
- closeOnEnter :
- If true, the dialog will be closed when the user presses
- enter in the input. Defaults to true.
- onKeyDown :
- An event handler of the signature (event, value, closeFunction)
- that will be called whenever keydown fires in the
- dialog's input. If your callback returns true,
- the dialog will not do any further processing of the event.
- onKeyUp :
- Same as onKeyDown but for the
- keyup event.
- onInput :
- Same as onKeyDown but for the
- input event.
- onClose :
- A callback of the signature (dialogInstance)
- that will be called after the dialog has been closed and
- removed from the DOM. No return value.
-
-
- Also adds an openNotification(template, options) →
- closeFunction function that simply shows an HTML
- fragment as a notification at the top of the editor. It takes a
- single option: duration, the amount of time after
- which the notification will be automatically closed. If
- duration is zero, the dialog will not be closed automatically.
-
- Depends on addon/dialog/dialog.css.
-
- search/searchcursor.js
- Adds the getSearchCursor(query, start, caseFold) →
- cursor method to CodeMirror instances, which can be used
- to implement search/replace functionality. query
- can be a regular expression or a string (only strings will match
- across lines—if they contain newlines). start
- provides the starting position of the search. It can be
- a {line, ch} object, or can be left off to default
- to the start of the document. caseFold is only
- relevant when matching a string. It will cause the search to be
- case-insensitive. A search cursor has the following methods:
-
- findNext () → boolean
- findPrevious () → boolean
- Search forward or backward from the current position.
- The return value indicates whether a match was found. If
- matching a regular expression, the return value will be the
- array returned by the match method, in case you
- want to extract matched groups.
- from () → {line, ch}
- to () → {line, ch}
- These are only valid when the last call
- to findNext or findPrevious did
- not return false. They will return {line, ch}
- objects pointing at the start and end of the match.
- replace (text: string, ?origin: string)
- Replaces the currently found match with the given text
- and adjusts the cursor position to reflect the
- replacement.
-
-
- search/search.js
- Implements the search commands. CodeMirror has keys bound to
- these by default, but will not do anything with them unless an
- implementation is provided. Depends
- on searchcursor.js, and will make use
- of openDialog when
- available to make prompting for search queries less ugly.
-
- search/matchesonscrollbar.js
- Adds a showMatchesOnScrollbar method to editor
- instances, which should be given a query (string or regular
- expression), optionally a case-fold flag (only applicable for
- strings), and optionally a class name (defaults
- to CodeMirror-search-match) as arguments. When
- called, matches of the given query will be displayed on the
- editor's vertical scrollbar. The method returns an object with
- a clear method that can be called to remove the
- matches. Depends on
- the annotatescrollbar
- addon, and
- the matchesonscrollbar.css
- file provides a default (transparent yellowish) definition of
- the CSS class applied to the matches. Note that the matches are
- only perfectly aligned if your scrollbar does not have buttons
- at the top and bottom. You can use
- the simplescrollbar
- addon to make sure of this. If this addon is loaded,
- the search addon will
- automatically use it.
-
- edit/matchbrackets.js
- Defines an option matchBrackets which, when set
- to true, causes matching brackets to be highlighted whenever the
- cursor is next to them. It also adds a
- method matchBrackets that forces this to happen
- once, and a method findMatchingBracket that can be
- used to run the bracket-finding algorithm that this uses
- internally.
-
- edit/closebrackets.js
- Defines an option autoCloseBrackets that will
- auto-close brackets and quotes when typed. By default, it'll
- auto-close ()[]{}''"", but you can pass it a string
- similar to that (containing pairs of matching characters), or an
- object with pairs and
- optionally explode properties to customize
- it. explode should be a similar string that gives
- the pairs of characters that, when enter is pressed between
- them, should have the second character also moved to its own
- line. Demo here .
-
- edit/matchtags.js
- Defines an option matchTags that, when enabled,
- will cause the tags around the cursor to be highlighted (using
- the CodeMirror-matchingtag class). Also
- defines
- a command toMatchingTag,
- which you can bind a key to in order to jump to the tag mathing
- the one under the cursor. Depends on
- the addon/fold/xml-fold.js
- addon. Demo here.
-
- edit/trailingspace.js
- Adds an option showTrailingSpace which, when
- enabled, adds the CSS class cm-trailingspace to
- stretches of whitespace at the end of lines.
- The demo has a nice
- squiggly underline style for this class.
-
- edit/closetag.js
- Defines an autoCloseTags option that will
- auto-close XML tags when '>' or '/'
- is typed, and
- a closeTag command that
- closes the nearest open tag. Depends on
- the fold/xml-fold.js addon. See
- the demo .
-
- edit/continuelist.js
- Markdown specific. Defines
- a "newlineAndIndentContinueMarkdownList" command
- command that can be bound to enter to automatically
- insert the leading characters for continuing a list. See
- the Markdown mode
- demo .
-
-
- Addon for commenting and uncommenting code. Adds three
- methods to CodeMirror instances:
-
-
- Set the lines in the given range to be line comments. Will
- fall back to blockComment when no line comment
- style is defined for the mode.
-
- Wrap the code in the given range in a block comment. Will
- fall back to lineComment when no block comment
- style is defined for the mode.
-
- Try to uncomment the given range.
- Returns true if a comment range was found and
- removed, false otherwise.
-
- The options object accepted by these methods may
- have the following properties:
-
- blockCommentStart, blockCommentEnd, blockCommentLead, lineComment: string
- Override the comment string
- properties of the mode with custom comment strings.
- padding : string
- A string that will be inserted after opening and leading
- markers, and before closing comment markers. Defaults to a
- single space.
- commentBlankLines : boolean
- Whether, when adding line comments, to also comment lines
- that contain only whitespace.
- indent : boolean
- When adding line comments and this is turned on, it will
- align the comment block to the current indentation of the
- first line of the block.
- fullLines : boolean
- When block commenting, this controls whether the whole
- lines are indented, or only the precise range that is given.
- Defaults to true.
-
- The addon also defines
- a toggleComment command ,
- which will try to uncomment the current selection, and if that
- fails, line-comments it.
-
- fold/foldcode.js
- Helps with code folding. Adds a foldCode method
- to editor instances, which will try to do a code fold starting
- at the given line, or unfold the fold that is already present.
- The method takes as first argument the position that should be
- folded (may be a line number or
- a Pos ), and as second optional
- argument either a range-finder function, or an options object,
- supporting the following properties:
-
- rangeFinder : fn(CodeMirror, Pos)
- The function that is used to find
- foldable ranges. If this is not directly passed, it will
- default to CodeMirror.fold.auto, which
- uses getHelpers with
- a "fold" type to find folding functions
- appropriate for the local mode. There are files in
- the addon/fold/
- directory providing CodeMirror.fold.brace, which
- finds blocks in brace languages (JavaScript, C, Java,
- etc), CodeMirror.fold.indent, for languages where
- indentation determines block structure (Python, Haskell),
- and CodeMirror.fold.xml, for XML-style languages,
- and CodeMirror.fold.comment, for folding comment
- blocks.
- widget : string|Element
- The widget to show for folded ranges. Can be either a
- string, in which case it'll become a span with
- class CodeMirror-foldmarker, or a DOM node.
- scanUp : boolean
- When true (default is false), the addon will try to find
- foldable ranges on the lines above the current one if there
- isn't an eligible one on the given line.
- minFoldSize : integer
- The minimum amount of lines that a fold should span to be
- accepted. Defaults to 0, which also allows single-line
- folds.
-
- See the demo for an
- example.
-
- fold/foldgutter.js
- Provides an option foldGutter, which can be
- used to create a gutter with markers indicating the blocks that
- can be folded. Create a gutter using
- the gutters option,
- giving it the class CodeMirror-foldgutter or
- something else if you configure the addon to use a different
- class, and this addon will show markers next to folded and
- foldable blocks, and handle clicks in this gutter. Note that
- CSS styles should be applied to make the gutter, and the fold
- markers within it, visible. A default set of CSS styles are
- available in:
-
- addon/fold/foldgutter.css
- .
- The option
- can be either set to true, or an object containing
- the following optional option fields:
-
- gutter : string
- The CSS class of the gutter. Defaults
- to "CodeMirror-foldgutter". You will have to
- style this yourself to give it a width (and possibly a
- background). See the default gutter style rules above.
- indicatorOpen : string | Element
- A CSS class or DOM element to be used as the marker for
- open, foldable blocks. Defaults
- to "CodeMirror-foldgutter-open".
- indicatorFolded : string | Element
- A CSS class or DOM element to be used as the marker for
- folded blocks. Defaults to "CodeMirror-foldgutter-folded".
- rangeFinder : fn(CodeMirror, Pos)
- The range-finder function to use when determining whether
- something can be folded. When not
- given, CodeMirror.fold.auto
- will be used as default.
-
- The foldOptions editor option can be set to an
- object to provide an editor-wide default configuration.
- Demo here .
-
- runmode/runmode.js
- Can be used to run a CodeMirror mode over text without
- actually opening an editor instance.
- See the demo for an example.
- There are alternate versions of the file avaible for
- running stand-alone
- (without including all of CodeMirror) and
- for running under
- node.js .
-
- runmode/colorize.js
- Provides a convenient way to syntax-highlight code snippets
- in a webpage. Depends on
- the runmode addon (or
- its standalone variant). Provides
- a CodeMirror.colorize function that can be called
- with an array (or other array-ish collection) of DOM nodes that
- represent the code snippets. By default, it'll get
- all pre tags. Will read the data-lang
- attribute of these nodes to figure out their language, and
- syntax-color their content using the relevant CodeMirror mode
- (you'll have to load the scripts for the relevant modes
- yourself). A second argument may be provided to give a default
- mode, used when no language attribute is found for a node. Used
- in this manual to highlight example code.
-
- mode/overlay.js
- Mode combinator that can be used to extend a mode with an
- 'overlay' — a secondary mode is run over the stream, along with
- the base mode, and can color specific pieces of text without
- interfering with the base mode.
- Defines CodeMirror.overlayMode, which is used to
- create such a mode. See this
- demo for a detailed example.
-
- mode/multiplex.js
- Mode combinator that can be used to easily 'multiplex'
- between several modes.
- Defines CodeMirror.multiplexingMode which, when
- given as first argument a mode object, and as other arguments
- any number of {open, close, mode [, delimStyle, innerStyle, parseDelimiters]}
- objects, will return a mode object that starts parsing using the
- mode passed as first argument, but will switch to another mode
- as soon as it encounters a string that occurs in one of
- the open fields of the passed objects. When in a
- sub-mode, it will go back to the top mode again when
- the close string is encountered.
- Pass "\n" for open or close
- if you want to switch on a blank line.
- When delimStyle is specified, it will be the token
- style returned for the delimiter tokens.
- When innerStyle is specified, it will be the token
- style added for each inner mode token.
- When parseDelimiters is true, the content of
- the delimiters will also be passed to the inner mode.
- (And delimStyle is ignored.) The outer
- mode will not see the content between the delimiters.
- See this demo for an
- example.
-
- hint/show-hint.js
- Provides a framework for showing autocompletion hints.
- Defines editor.showHint, which takes an optional
- options object, and pops up a widget that allows the user to
- select a completion. Finding hints is done with a hinting
- functions (the hint option), which is a function
- that take an editor instance and options object, and return
- a {list, from, to} object, where list
- is an array of strings or objects (the completions),
- and from and to give the start and end
- of the token that is being completed as {line, ch}
- objects. An optional selectedHint property (an
- integer) can be added to the completion object to control the
- initially selected hint.
- If no hinting function is given, the addon will
- use CodeMirror.hint.auto, which
- calls getHelpers with
- the "hint" type to find applicable hinting
- functions, and tries them one by one. If that fails, it looks
- for a "hintWords" helper to fetch a list of
- completable words for the mode, and
- uses CodeMirror.hint.fromList to complete from
- those.
- When completions aren't simple strings, they should be
- objects with the following properties:
-
- text : string
- The completion text. This is the only required
- property.
- displayText : string
- The text that should be displayed in the menu.
- className : string
- A CSS class name to apply to the completion's line in the
- menu.
- render : fn(Element, self, data)
- A method used to create the DOM structure for showing the
- completion by appending it to its first argument.
- hint : fn(CodeMirror, self, data)
- A method used to actually apply the completion, instead of
- the default behavior.
- from : {line, ch}
- Optional from position that will be used by pick() instead
- of the global one passed with the full list of completions.
- to : {line, ch}
- Optional to position that will be used by pick() instead
- of the global one passed with the full list of completions.
-
- The plugin understands the following options (the options object
- will also be passed along to the hinting function, which may
- understand additional options):
-
- hint : function
- A hinting function, as specified above. It is possible to
- set the async property on a hinting function to
- true, in which case it will be called with
- arguments (cm, callback, ?options), and the
- completion interface will only be popped up when the hinting
- function calls the callback, passing it the object holding the
- completions.
- completeSingle : boolean
- Determines whether, when only a single completion is
- available, it is completed without showing the dialog.
- Defaults to true.
- alignWithWord : boolean
- Whether the pop-up should be horizontally aligned with the
- start of the word (true, default), or with the cursor (false).
- closeOnUnfocus : boolean
- When enabled (which is the default), the pop-up will close
- when the editor is unfocused.
- customKeys : keymap
- Allows you to provide a custom key map of keys to be active
- when the pop-up is active. The handlers will be called with an
- extra argument, a handle to the completion menu, which
- has moveFocus(n), setFocus(n), pick(),
- and close() methods (see the source for details),
- that can be used to change the focused element, pick the
- current element or close the menu. Additionnaly menuSize()
- can give you access to the size of the current dropdown menu,
- length give you the number of availlable completions, and
- data give you full access to the completion returned by the
- hinting function.
- extraKeys : keymap
- Like customKeys above, but the bindings will
- be added to the set of default bindings, instead of replacing
- them.
-
- The following events will be fired on the completions object
- during completion:
-
- "shown" ()
- Fired when the pop-up is shown.
- "select" (completion, Element)
- Fired when a completion is selected. Passed the completion
- value (string or object) and the DOM node that represents it
- in the menu.
- "pick" (completion)
- Fired when a completion is picked. Passed the completion value
- (string or object).
- "close" ()
- Fired when the completion is finished.
-
- This addon depends on styles
- from addon/hint/show-hint.css. Check
- out the demo for an
- example.
-
- hint/javascript-hint.js
- Defines a simple hinting function for JavaScript
- (CodeMirror.hint.javascript) and CoffeeScript
- (CodeMirror.hint.coffeescript) code. This will
- simply use the JavaScript environment that the editor runs in as
- a source of information about objects and their properties.
-
- hint/xml-hint.js
- Defines CodeMirror.hint.xml, which produces
- hints for XML tagnames, attribute names, and attribute values,
- guided by a schemaInfo option (a property of the
- second argument passed to the hinting function, or the third
- argument passed to CodeMirror.showHint). The
- schema info should be an object mapping tag names to information
- about these tags, with optionally a "!top" property
- containing a list of the names of valid top-level tags. The
- values of the properties should be objects with optional
- properties children (an array of valid child
- element names, omit to simply allow all tags to appear)
- and attrs (an object mapping attribute names
- to null for free-form attributes, and an array of
- valid values for restricted
- attributes). Demo
- here.
-
- hint/html-hint.js
- Provides schema info to
- the xml-hint addon for HTML
- documents. Defines a schema
- object CodeMirror.htmlSchema that you can pass to
- as a schemaInfo option, and
- a CodeMirror.hint.html hinting function that
- automatically calls CodeMirror.hint.xml with this
- schema data. See
- the demo .
-
- hint/css-hint.js
- A hinting function for CSS, SCSS, or LESS code.
- Defines CodeMirror.hint.css.
-
- hint/anyword-hint.js
- A very simple hinting function
- (CodeMirror.hint.anyword) that simply looks for
- words in the nearby code and completes to those. Takes two
- optional options, word, a regular expression that
- matches words (sequences of one or more character),
- and range, which defines how many lines the addon
- should scan when completing (defaults to 500).
-
- hint/sql-hint.js
- A simple SQL hinter. Defines CodeMirror.hint.sql.
- Takes two optional options, tables, a object with
- table names as keys and array of respective column names as values,
- and defaultTable, a string corresponding to a
- table name in tables for autocompletion.
-
- search/match-highlighter.js
- Adds a highlightSelectionMatches option that
- can be enabled to highlight all instances of a currently
- selected word. Can be set either to true or to an object
- containing the following options: minChars, for the
- minimum amount of selected characters that triggers a highlight
- (default 2), style, for the style to be used to
- highlight the matches (default "matchhighlight",
- which will correspond to CSS
- class cm-matchhighlight),
- and showToken which can be set to true
- or to a regexp matching the characters that make up a word. When
- enabled, it causes the current word to be highlighted when
- nothing is selected (defaults to off).
- Demo here .
-
- lint/lint.js
- Defines an interface component for showing linting warnings,
- with pluggable warning sources
- (see json-lint.js ,
- javascript-lint.js ,
- coffeescript-lint.js ,
- and css-lint.js
- in the same directory). Defines a lint option that
- can be set to a warning source (for
- example CodeMirror.lint.javascript), or
- to true, in which
- case getHelper with
- type "lint" is used to determined a validator
- function. Such a function should, when given a document string,
- an options object, and an editor instance, return an array of {message,
- severity, from, to} objects representing problems. When
- the function has an async property with a truthy
- value, it will be called with an additional second argument,
- which is a callback to pass the array to. Depends
- on addon/lint/lint.css. A demo can be
- found here .
-
- selection/mark-selection.js
- Causes the selected text to be marked with the CSS class
- CodeMirror-selectedtext when the styleSelectedText option
- is enabled. Useful to change the colour of the selection (in addition to the background),
- like in this demo .
-
- selection/active-line.js
- Defines a styleActiveLine option that, when enabled,
- gives the wrapper of the active line the class CodeMirror-activeline,
- and adds a background with the class CodeMirror-activeline-background.
- is enabled. See the demo .
-
- selection/selection-pointer.js
- Defines a selectionPointer option which you can
- use to control the mouse cursor appearance when hovering over
- the selection. It can be set to a string,
- like "pointer", or to true, in which case
- the "default" (arrow) cursor will be used. You can
- see a demo here .
-
- mode/loadmode.js
- Defines a CodeMirror.requireMode(modename,
- callback) function that will try to load a given mode and
- call the callback when it succeeded. You'll have to
- set CodeMirror.modeURL to a string that mode paths
- can be constructed from, for
- example "mode/%N/%N.js"—the %N's will
- be replaced with the mode name. Also
- defines CodeMirror.autoLoadMode(instance, mode),
- which will ensure the given mode is loaded and cause the given
- editor instance to refresh its mode when the loading
- succeeded. See the demo .
-
- mode/meta.js
- Provides meta-information about all the modes in the
- distribution in a single file.
- Defines CodeMirror.modeInfo, an array of objects
- with {name, mime, mode} properties,
- where name is the human-readable
- name, mime the MIME type, and mode the
- name of the mode file that defines this MIME. There are optional
- properties mimes, which holds an array of MIME
- types for modes with multiple MIMEs associated,
- and ext, which holds an array of file extensions
- associated with this mode. Four convenience
- functions, CodeMirror.findModeByMIME,
- CodeMirror.findModeByExtension,
- CodeMirror.findModeByFileName
- and CodeMirror.findModeByName are provided, which
- return such an object given a MIME, extension, file name or mode name
- string. Note that, for historical reasons, this file resides in the
- top-level mode directory, not
- under addon. Demo .
-
-
- Adds a continueComments option, which sets whether the
- editor will make the next line continue a comment when you press Enter
- inside a comment block. Can be set to a boolean to enable/disable this
- functionality. Set to a string, it will continue comments using a custom
- shortcut. Set to an object, it will use the key property for
- a custom shortcut and the boolean continueLineComment
- property to determine whether single-line comments should be continued
- (defaulting to true).
-
- display/placeholder.js
- Adds a placeholder option that can be used to
- make text appear in the editor when it is empty and not focused.
- Also gives the editor a CodeMirror-empty CSS class
- whenever it doesn't contain any text.
- See the demo .
-
- display/fullscreen.js
- Defines an option fullScreen that, when set
- to true, will make the editor full-screen (as in,
- taking up the whole browser window). Depends
- on fullscreen.css . Demo
- here .
-
- scroll/simplescrollbars.js
- Defines two additional scrollbar
- models, "simple" and "overlay"
- (see demo ) that can
- be selected with
- the scrollbarStyle
- option. Depends
- on simplescrollbars.css ,
- which can be further overridden to style your own
- scrollbars.
-
- scroll/annotatescrollbar.js
- Provides functionality for showing markers on the scrollbar
- to call out certain parts of the document. Adds a
- method annotateScrollbar to editor instances that
- can be called, with a CSS class name as argument, to create a
- set of annotations. The method returns an object
- whose update method can be called with an array
- of {from: Pos, to: Pos} objects marking the ranges
- to be higlighed. To detach the annotations, call the
- object's clear method.
-
- display/rulers.js
- Adds a rulers option, which can be used to show
- one or more vertical rulers in the editor. The option, if
- defined, should be given an array of {column [, className,
- color, lineStyle, width]} objects or numbers (wich
- indicate a column). The ruler will be displayed at the column
- indicated by the number or the column property.
- The className property can be used to assign a
- custom style to a ruler. Demo
- here .
-
- display/panel.js
- Defines an addPanel method for CodeMirror
- instances, which places a DOM node above or below an editor, and
- shrinks the editor to make room for the node. The method takes
- as first argument as DOM node, and as second an optional options
- object. The Panel object returned by this method
- has a clear method that is used to remove the
- panel, and a changed method that can be used to
- notify the addon when the size of the panel's DOM node has
- changed.
- The method accepts the following options:
-
- position : string
- Controls the position of the newly added panel. The
- following values are recognized:
-
- top (default)
- Adds the panel at the very top.
- after-top
- Adds the panel at the bottom of the top panels.
- bottom
- Adds the panel at the very bottom.
- before-bottom
- Adds the panel at the top of the bottom panels.
-
-
- before : Panel
- The new panel will be added before the given panel.
- after : Panel
- The new panel will be added after the given panel.
- replace : Panel
- The new panel will replace the given panel.
-
- When using the after, before or replace options,
- if the panel doesn't exists or has been removed,
- the value of the position option will be used as a fallback.
-
- A demo of the addon is available here .
-
-
- wrap/hardwrap.js
- Addon to perform hard line wrapping/breaking for paragraphs
- of text. Adds these methods to editor instances:
-
- wrapParagraph (?pos: {line, ch}, ?options: object)
- Wraps the paragraph at the given position.
- If pos is not given, it defaults to the cursor
- position.
- wrapRange (from: {line, ch}, to: {line, ch}, ?options: object)
- Wraps the given range as one big paragraph.
- wrapParagraphsInRange (from: {line, ch}, to: {line, ch}, ?options: object)
- Wrapps the paragraphs in (and overlapping with) the
- given range individually.
-
- The following options are recognized:
-
- paragraphStart , paragraphEnd : RegExp
- Blank lines are always considered paragraph boundaries.
- These options can be used to specify a pattern that causes
- lines to be considered the start or end of a paragraph.
- column : number
- The column to wrap at. Defaults to 80.
- wrapOn : RegExp
- A regular expression that matches only those
- two-character strings that allow wrapping. By default, the
- addon wraps on whitespace and after dash characters.
- killTrailingSpace : boolean
- Whether trailing space caused by wrapping should be
- preserved, or deleted. Defaults to true.
-
- A demo of the addon is available here .
-
-
- merge/merge.js
- Implements an interface for merging changes, using either a
- 2-way or a 3-way view. The CodeMirror.MergeView
- constructor takes arguments similar to
- the CodeMirror
- constructor, first a node to append the interface to, and then
- an options object. Options are passed through to the editors
- inside the view. These extra options are recognized:
-
- origLeft and origRight : string
- If given these provide original versions of the
- document, which will be shown to the left and right of the
- editor in non-editable CodeMirror instances. The merge
- interface will highlight changes between the editable
- document and the original(s). To create a 2-way (as opposed
- to 3-way) merge view, provide only one of them.
- revertButtons : boolean
- Determines whether buttons that allow the user to revert
- changes are shown. Defaults to true.
- connect : string
- Sets the style used to connect changed chunks of code.
- By default, connectors are drawn. When this is set
- to "align", the smaller chunk is padded to
- align with the bigger chunk instead.
- collapseIdentical : boolean|number
- When true (default is false), stretches of unchanged
- text will be collapsed. When a number is given, this
- indicates the amount of lines to leave visible around such
- stretches (which defaults to 2).
- allowEditingOriginals : boolean
- Determines whether the original editor allows editing.
- Defaults to false.
- showDifferences : boolean
- When true (the default), changed pieces of text are
- highlighted.
-
- The addon also defines commands "goNextDiff"
- and "goPrevDiff" to quickly jump to the next
- changed chunk. Demo
- here .
-
- tern/tern.js
- Provides integration with
- the Tern JavaScript analysis
- engine, for completion, definition finding, and minor
- refactoring help. See the demo
- for a very simple integration. For more involved scenarios, see
- the comments at the top of
- the addon and the
- implementation of the
- (multi-file) demonstration
- on the Tern website .
-
-
-
-
- Writing CodeMirror Modes
-
- Modes typically consist of a single JavaScript file. This file
- defines, in the simplest case, a lexer (tokenizer) for your
- language—a function that takes a character stream as input,
- advances it past a token, and returns a style for that token. More
- advanced modes can also handle indentation for the language.
-
- This section describes the low-level mode interface. Many modes
- are written directly against this, since it offers a lot of
- control, but for a quick mode definition, you might want to use
- the simple mode addon .
-
- The mode script should
- call CodeMirror.defineMode to
- register itself with CodeMirror. This function takes two
- arguments. The first should be the name of the mode, for which you
- should use a lowercase string, preferably one that is also the
- name of the files that define the mode (i.e. "xml" is
- defined in xml.js). The second argument should be a
- function that, given a CodeMirror configuration object (the thing
- passed to the CodeMirror function) and an optional
- mode configuration object (as in
- the mode option), returns
- a mode object.
-
- Typically, you should use this second argument
- to defineMode as your module scope function (modes
- should not leak anything into the global scope!), i.e. write your
- whole mode inside this function.
-
- The main responsibility of a mode script is parsing
- the content of the editor. Depending on the language and the
- amount of functionality desired, this can be done in really easy
- or extremely complicated ways. Some parsers can be stateless,
- meaning that they look at one element (token ) of the code
- at a time, with no memory of what came before. Most, however, will
- need to remember something. This is done by using a state
- object , which is an object that is always passed when
- reading a token, and which can be mutated by the tokenizer.
-
- Modes that use a state must define
- a startState method on their mode
- object. This is a function of no arguments that produces a state
- object to be used at the start of a document.
-
- The most important part of a mode object is
- its token (stream, state) method. All
- modes must define this method. It should read one token from the
- stream it is given as an argument, optionally update its state,
- and return a style string, or null for tokens that do
- not have to be styled. For your styles, you are encouraged to use
- the 'standard' names defined in the themes (without
- the cm- prefix). If that fails, it is also possible
- to come up with your own and write your own CSS theme file.
-
-
A typical token string would
- be "variable" or "comment". Multiple
- styles can be returned (separated by spaces), for
- example "string error" for a thing that looks like a
- string but is invalid somehow (say, missing its closing quote).
- When a style is prefixed by "line-"
- or "line-background-", the style will be applied to
- the whole line, analogous to what
- the addLineClass method
- does—styling the "text" in the simple case, and
- the "background" element
- when "line-background-" is prefixed.
-
- The stream object that's passed
- to token encapsulates a line of code (tokens may
- never span lines) and our current position in that line. It has
- the following API:
-
-
- eol () → boolean
- Returns true only if the stream is at the end of the
- line.
- sol () → boolean
- Returns true only if the stream is at the start of the
- line.
-
- peek () → string
- Returns the next character in the stream without advancing
- it. Will return an null at the end of the
- line.
- next () → string
- Returns the next character in the stream and advances it.
- Also returns null when no more characters are
- available.
-
- eat (match: string|regexp|function(char: string) → boolean) → string
- match can be a character, a regular expression,
- or a function that takes a character and returns a boolean. If
- the next character in the stream 'matches' the given argument,
- it is consumed and returned. Otherwise, undefined
- is returned.
- eatWhile (match: string|regexp|function(char: string) → boolean) → boolean
- Repeatedly calls eat with the given argument,
- until it fails. Returns true if any characters were eaten.
- eatSpace () → boolean
- Shortcut for eatWhile when matching
- white-space.
- skipToEnd ()
- Moves the position to the end of the line.
- skipTo (ch: string) → boolean
- Skips to the next occurrence of the given character, if
- found on the current line (doesn't advance the stream if the
- character does not occur on the line). Returns true if the
- character was found.
- match (pattern: string, ?consume: boolean, ?caseFold: boolean) → boolean
- match (pattern: regexp, ?consume: boolean) → array<string>
- Act like a
- multi-character eat—if consume is true
- or not given—or a look-ahead that doesn't update the stream
- position—if it is false. pattern can be either a
- string or a regular expression starting with ^.
- When it is a string, caseFold can be set to true to
- make the match case-insensitive. When successfully matching a
- regular expression, the returned value will be the array
- returned by match, in case you need to extract
- matched groups.
-
- backUp (n: integer)
- Backs up the stream n characters. Backing it up
- further than the start of the current token will cause things to
- break, so be careful.
- column () → integer
- Returns the column (taking into account tabs) at which the
- current token starts.
- indentation () → integer
- Tells you how far the current line has been indented, in
- spaces. Corrects for tab characters.
-
- current () → string
- Get the string between the start of the current token and
- the current stream position.
-
-
- By default, blank lines are simply skipped when
- tokenizing a document. For languages that have significant blank
- lines, you can define
- a blankLine (state) method on your
- mode that will get called whenever a blank line is passed over, so
- that it can update the parser state.
-
- Because state object are mutated, and CodeMirror
- needs to keep valid versions of a state around so that it can
- restart a parse at any line, copies must be made of state objects.
- The default algorithm used is that a new state object is created,
- which gets all the properties of the old object. Any properties
- which hold arrays get a copy of these arrays (since arrays tend to
- be used as mutable stacks). When this is not correct, for example
- because a mode mutates non-array properties of its state object, a
- mode object should define
- a copyState method, which is given a
- state and should return a safe copy of that state.
-
- If you want your mode to provide smart indentation
- (through the indentLine
- method and the indentAuto
- and newlineAndIndent commands, to which keys can be
- bound ), you must define
- an indent (state, textAfter) method
- on your mode object.
-
- The indentation method should inspect the given state object,
- and optionally the textAfter string, which contains
- the text on the line that is being indented, and return an
- integer, the amount of spaces to indent. It should usually take
- the indentUnit
- option into account. An indentation method may
- return CodeMirror.Pass to indicate that it
- could not come up with a precise indentation.
-
-
-
- Finally, a mode may define either
- an electricChars or an electricInput
- property, which are used to automatically reindent the line when
- certain patterns are typed and
- the electricChars
- option is enabled. electricChars may be a string, and
- will trigger a reindent whenever one of the characters in that
- string are typed. Often, it is more appropriate to
- use electricInput, which should hold a regular
- expression, and will trigger indentation when the part of the
- line before the cursor matches the expression. It should
- usually end with a $ character, so that it only
- matches when the indentation-changing pattern was just typed, not when something was
- typed after the pattern.
-
- So, to summarize, a mode must provide
- a token method, and it may
- provide startState, copyState,
- and indent methods. For an example of a trivial mode,
- see the diff mode , for a more
- involved example, see the C-like
- mode .
-
- Sometimes, it is useful for modes to nest —to have one
- mode delegate work to another mode. An example of this kind of
- mode is the mixed-mode HTML
- mode . To implement such nesting, it is usually necessary to
- create mode objects and copy states yourself. To create a mode
- object, there are CodeMirror.getMode(options,
- parserConfig), where the first argument is a configuration
- object as passed to the mode constructor function, and the second
- argument is a mode specification as in
- the mode option. To copy a
- state object, call CodeMirror.copyState(mode, state),
- where mode is the mode that created the given
- state.
-
- In a nested mode, it is recommended to add an
- extra method, innerMode which, given
- a state object, returns a {state, mode} object with
- the inner mode and its state for the current position. These are
- used by utility scripts such as the tag
- closer to get context information. Use
- the CodeMirror.innerMode helper function to, starting
- from a mode and a state, recursively walk down to the innermost
- mode and state.
-
- To make indentation work properly in a nested parser, it is
- advisable to give the startState method of modes that
- are intended to be nested an optional argument that provides the
- base indentation for the block of code. The JavaScript and CSS
- parser do this, for example, to allow JavaScript and CSS code
- inside the mixed-mode HTML mode to be properly indented.
-
- It is possible, and encouraged, to associate
- your mode, or a certain configuration of your mode, with
- a MIME type. For
- example, the JavaScript mode associates itself
- with text/javascript, and its JSON variant
- with application/json. To do this,
- call CodeMirror.defineMIME (mime,
- modeSpec), where modeSpec can be a string or
- object specifying a mode, as in
- the mode option.
-
- If a mode specification wants to add some properties to the
- resulting mode object, typically for use
- with getHelpers , it may
- contain a modeProps property, which holds an object.
- This object's properties will be copied to the actual mode
- object.
-
- Sometimes, it is useful to add or override mode
- object properties from external code.
- The CodeMirror.extendMode function
- can be used to add properties to mode objects produced for a
- specific mode. Its first argument is the name of the mode, its
- second an object that specifies the properties that should be
- added. This is mostly useful to add utilities that can later be
- looked up through getMode .
-
-
-
- VIM Mode API
-
- CodeMirror has a robust VIM mode that attempts to faithfully
- emulate VIM's most useful features. It can be enabled by
- including keymap/vim.js
- and setting the keymap option to
- vim.
-
- Configuration
-
- VIM mode accepts configuration options for customizing
- behavior at run time. These methods can be called at any time
- and will affect all existing CodeMirror instances unless
- specified otherwise. The methods are exposed on the
- CodeMirror.Vim object.
-
-
- setOption(name: string, value: any, ?cm: CodeMirror, ?cfg: object)
- Sets the value of a VIM option. name should
- be the name of an option. If cfg.scope is not set
- and cm is provided, then sets the global and
- instance values of the option. Otherwise, sets either the
- global or instance value of the option depending on whether
- cfg.scope is global or
- local.
- getOption(name: string, ?cm: CodeMirror: ?cfg: object)
- Gets the current value of a VIM option. If
- cfg.scope is not set and cm is
- provided, then gets the instance value of the option, falling
- back to the global value if not set. If cfg.scope is provided, then gets the global or
- local value without checking the other.
-
- map(lhs: string, rhs: string, ?context: string)
- Maps a key sequence to another key sequence. Implements
- VIM's :map command. To map ; to : in VIM would be
- :map ; : . That would translate to
- CodeMirror.Vim.map(';', ':'); .
- The context can be normal,
- visual, or insert, which correspond
- to :nmap, :vmap, and
- :imap
- respectively.
-
- mapCommand(keys: string, type: string, name: string, ?args: object, ?extra: object)
- Maps a key sequence to a motion,
- operator, or action type command.
- The args object is passed through to the command when it is
- invoked by the provided key sequence.
- extras.context can be normal,
- visual, or insert, to map the key
- sequence only in the corresponding mode.
- extras.isEdit is applicable only to actions,
- determining whether it is recorded for replay for the
- . single-repeat command.
-
-
- Extending VIM
-
- CodeMirror's VIM mode implements a large subset of VIM's core
- editing functionality. But since there's always more to be
- desired, there is a set of APIs for extending VIM's
- functionality. As with the configuration API, the methods are
- exposed on CodeMirror.Vim and may
- be called at any time.
-
-
- defineOption(name: string, default: any, type: string, ?aliases: array<string>, ?callback: function (?value: any, ?cm: CodeMirror) → ?any)
- Defines a VIM style option and makes it available to the
- :set command. Type can be boolean or
- string, used for validation and by
- :set to determine which syntax to accept. If a
- callback is passed in, VIM does not store the value of the
- option itself, but instead uses the callback as a setter/getter. If the
- first argument to the callback is undefined, then the
- callback should return the value of the option. Otherwise, it should set
- instead. Since VIM options have global and instance values, whether a
- CodeMirror instance is passed in denotes whether the global
- or local value should be used. Consequently, it's possible for the
- callback to be called twice for a single setOption or
- getOption call. Note that right now, VIM does not support
- defining buffer-local options that do not have global values. If an
- option should not have a global value, either always ignore the
- cm parameter in the callback, or always pass in a
- cfg.scope to setOption and
- getOption.
-
- defineMotion(name: string, fn: function(cm: CodeMirror, head: {line, ch}, ?motionArgs: object}) → {line, ch})
- Defines a motion command for VIM. The motion should return
- the desired result position of the cursor. head
- is the current position of the cursor. It can differ from
- cm.getCursor('head') if VIM is in visual mode.
- motionArgs is the object passed into
- mapCommand() .
-
- defineOperator(name: string, fn: function(cm: CodeMirror, ?operatorArgs: object, ranges: array<{anchor, head}>) → ?{line, ch})
- Defines an operator command, similar to
- defineMotion . ranges is the range
- of text the operator should operate on. If the cursor should
- be set to a certain position after the operation finishes, it
- can return a cursor object.
-
- defineAction(name: string, fn: function(cm: CodeMirror, ?actionArgs: object))
- Defines an action command, similar to
- defineMotion . Action commands
- can have arbitrary behavior, making them more flexible than
- motions and operators, at the loss of orthogonality.
-
- defineEx(name: string, ?prefix: string, fn: function(cm: CodeMirror, ?params: object))
- Defines an Ex command, and maps it to :name.
- If a prefix is provided, it, and any prefixed substring of the
- name beginning with the prefix can
- be used to invoke the command. If the prefix is
- falsy, then name is used as the prefix.
- params.argString contains the part of the prompted
- string after the command name. params.args is
- params.argString split by whitespace. If the
- command was prefixed with a
- line range ,
- params.line and params.lineEnd will
- be set.
-
-
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/realworld.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/realworld.html
deleted file mode 100644
index 65128ad..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/realworld.html
+++ /dev/null
@@ -1,174 +0,0 @@
-
-
-
CodeMirror: Real-world Uses
-
-
-
-
-
-
-
-CodeMirror real-world uses
-
- Create a pull
- request if you'd like your project to be added to this list.
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/releases.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/releases.html
deleted file mode 100644
index 77e9896..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/releases.html
+++ /dev/null
@@ -1,1116 +0,0 @@
-
-
-
CodeMirror: Release History
-
-
-
-
-
-
-
-
-Release notes and version history
-
-
-
-
-
- Version 4.x
-
- 20-02-2015: Version 4.13 :
-
-
-
- 22-01-2015: Version 4.12 :
-
-
-
- 9-01-2015: Version 4.11 :
-
- Unfortunately, 4.10 did not take care of the
- Firefox scrolling issue entirely. This release adds two more patches
- to address that.
-
- 29-12-2014: Version 4.10 :
-
- Emergency single-patch update to 4.9. Fixes
- Firefox-specific problem where the cursor could end up behind the
- horizontal scrollbar.
-
- 23-12-2014: Version 4.9 :
-
-
-
- 22-11-2014: Version 4.8 :
-
-
-
- 20-10-2014: Version 4.7 :
-
-
- Incompatible :
- The lint addon now passes the
- editor's value as first argument to asynchronous lint functions,
- for consistency. The editor is still passed, as fourth
- argument.
- Improved handling of unicode identifiers in modes for
- languages that support them.
- More mode
- improvements: CoffeeScript
- (indentation), Verilog
- (indentation), Scala
- (indentation, triple-quoted strings),
- and PHP (interpolated
- variables in heredoc strings).
- New modes: Textile and Tornado templates .
- Experimental new way to define modes .
- Improvements to the Vim
- bindings : Arbitrary insert mode key mappings are now possible,
- and text objects are supported in visual mode.
- The mode meta-information file
- now includes information about file extensions,
- and helper
- functions findModeByMIME
- and findModeByExtension.
- New logo!
- Full list of patches .
-
-
- 19-09-2014: Version 4.6 :
-
-
-
- 21-08-2014: Version 4.5 :
-
-
-
- 21-07-2014: Version 4.4 :
-
-
- Note: Some events might now fire in slightly
- different order ("change" is still guaranteed to fire
- before "cursorActivity")
- Nested operations in multiple editors are now synced (complete
- at same time, reducing DOM reflows)
- Visual block mode for vim (<C-v>) is nearly complete
- New mode: Kotlin
- Better multi-selection paste for text copied from multiple CodeMirror selections
- Full list of patches .
-
-
- 23-06-2014: Version 4.3 :
-
-
- Several vim bindings
- improvements: search and exCommand history, global flag
- for :substitute, :global command.
- Allow hiding the cursor by
- setting cursorBlinkRate
- to a negative value.
- Make gutter markers themeable, use this in foldgutter.
- Full list of patches .
-
-
- 19-05-2014: Version 4.2 :
-
-
- Fix problem where some modes were broken by the fact that empty tokens were forbidden.
- Several fixes to context menu handling.
- On undo, scroll change , not cursor, into view.
- Rewritten Jade mode.
- Various improvements to Shell (support for more syntax) and Python (better indentation) modes.
- New mode: Cypher .
- New theme: Neo .
- Support direct styling options (color, line style, width) in the rulers addon.
- Recognize per-editor configuration for the show-hint and foldcode addons.
- More intelligent scanning for existing close tags in closetag addon.
- In the Vim bindings : Fix bracket matching, support case conversion in visual mode, visual paste, append action.
- Full list of patches .
-
-
- 22-04-2014: Version 4.1 :
-
-
- Slightly incompatible :
- The "cursorActivity"
- event now fires after all other events for the operation (and only
- for handlers that were actually registered at the time the
- activity happened).
- New command: insertSoftTab .
- New mode: Django .
- Improved modes: Verilog (rewritten), Jinja2 , Haxe , PHP (string interpolation highlighted), JavaScript (indentation of trailing else, template strings), LiveScript (multi-line strings).
- Many small issues from the 3.x→4.x transition were found and fixed.
- Full list of patches .
-
-
- 20-03-2014: Version 4.0 :
-
- This is a new major version of CodeMirror. There
- are a few incompatible changes in the API. Upgrade
- with care, and read the upgrading
- guide .
-
-
-
-
-
-
-
- Version 3.x
-
- 22-04-2014: Version 3.24 :
-
- Merges the improvements from 4.1 that could
- easily be applied to the 3.x code. Also improves the way the editor
- size is updated when line widgets change.
-
- 20-03-2014: Version 3.23 :
-
-
- In the XML mode ,
- add brackets style to angle brackets, fix
- case-sensitivity of tags for HTML.
- New mode: Dylan .
- Many improvements to the Vim bindings .
-
-
- 21-02-2014: Version 3.22 :
-
-
-
- 16-01-2014: Version 3.21 :
-
-
- Auto-indenting a block will no longer add trailing whitespace to blank lines.
- Marking text has a new option clearWhenEmpty to control auto-removal.
- Several bugfixes in the handling of bidirectional text.
- The XML and CSS modes were largely rewritten. LESS support was added to the CSS mode.
- The OCaml mode was moved to an mllike mode, F# support added.
- Make it possible to fetch multiple applicable helper values with getHelpers , and to register helpers matched on predicates with registerGlobalHelper .
- New theme pastel-on-dark .
- Better ECMAScript 6 support in JavaScript mode.
- Full list of patches .
-
-
- 21-11-2013: Version 3.20 :
-
-
-
- 21-10-2013: Version 3.19 :
-
-
-
- 23-09-2013: Version 3.18 :
-
- Emergency release to fix a problem in 3.17
- where .setOption("lineNumbers", false) would raise an
- error.
-
- 23-09-2013: Version 3.17 :
-
-
-
- 21-08-2013: Version 3.16 :
-
-
-
- 29-07-2013: Version 3.15 :
-
-
-
- 20-06-2013: Version 3.14 :
-
-
-
- 20-05-2013: Version 3.13 :
-
-
-
- 19-04-2013: Version 3.12 :
-
-
-
- 20-03-2013: Version 3.11 :
-
-
-
- 21-02-2013: Version 3.1 :
-
-
-
-
- 25-01-2013: Version 3.02 :
-
- Single-bugfix release. Fixes a problem that
- prevents CodeMirror instances from being garbage-collected after
- they become unused.
-
- 21-01-2013: Version 3.01 :
-
-
-
- 10-12-2012: Version 3.0 :
-
- New major version . Only
- partially backwards-compatible. See
- the upgrading guide for more
- information. Changes since release candidate 2:
-
-
- Rewritten VIM mode.
- Fix a few minor scrolling and sizing issues.
- Work around Safari segfault when dragging.
- Full list of patches .
-
-
- 20-11-2012: Version 3.0, release candidate 2 :
-
-
- New mode: HTTP .
- Improved handling of selection anchor position.
- Improve IE performance on longer lines.
- Reduce gutter glitches during horiz. scrolling.
- Add addKeyMap and removeKeyMap methods.
- Rewrite formatting and closetag add-ons.
- Full list of patches .
-
-
- 20-11-2012: Version 3.0, release candidate 1 :
-
-
-
- 22-10-2012: Version 3.0, beta 2 :
-
-
- Fix page-based coordinate computation.
- Fix firing of gutterClick event.
- Add cursorHeight option.
- Fix bi-directional text regression.
- Add viewportMargin option.
- Directly handle mousewheel events (again, hopefully better).
- Make vertical cursor movement more robust (through widgets, big line gaps).
- Add flattenSpans option.
- Many optimizations. Poor responsiveness should be fixed.
- Initialization in hidden state works again.
- Full list of patches .
-
-
- 19-09-2012: Version 3.0, beta 1 :
-
-
- Bi-directional text support.
- More powerful gutter model.
- Support for arbitrary text/widget height.
- In-line widgets.
- Generalized event handling.
-
-
-
-
-
-
- Version 2.x
-
- 21-01-2013: Version 2.38 :
-
- Integrate some bugfixes, enhancements to the vim keymap, and new
- modes
- (D , Sass , APL )
- from the v3 branch.
-
- 20-12-2012: Version 2.37 :
-
-
- New mode: SQL (will replace plsql and mysql modes).
- Further work on the new VIM mode.
- Fix Cmd/Ctrl keys on recent Operas on OS X.
- Full list of patches .
-
-
- 20-11-2012: Version 2.36 :
-
-
-
- 22-10-2012: Version 2.35 :
-
-
- New (sub) mode: TypeScript .
- Don't overwrite (insert key) when pasting.
- Fix several bugs in markText /undo interaction.
- Better indentation of JavaScript code without semicolons.
- Add defineInitHook function.
- Full list of patches .
-
-
- 19-09-2012: Version 2.34 :
-
-
- New mode: Common Lisp .
- Fix right-click select-all on most browsers.
- Change the way highlighting happens: Saves memory and CPU cycles. compareStates is no longer needed. onHighlightComplete no longer works.
- Integrate mode (Markdown, XQuery, CSS, sTex) tests in central testsuite.
- Add a CodeMirror.version property.
- More robust handling of nested modes in formatting and closetag plug-ins.
- Un/redo now preserves marked text and bookmarks.
- Full list of patches.
-
-
- 23-08-2012: Version 2.33 :
-
-
- New mode: Sieve .
- New getViewPort and onViewportChange API.
- Configurable cursor blink rate.
- Make binding a key to false disabling handling (again).
- Show non-printing characters as red dots.
- More tweaks to the scrolling model.
- Expanded testsuite. Basic linter added.
- Remove most uses of innerHTML. Remove CodeMirror.htmlEscape.
- Full list of patches.
-
-
- 23-07-2012: Version 2.32 :
-
- Emergency fix for a bug where an editor with
- line wrapping on IE will break when there is no
- scrollbar.
-
- 20-07-2012: Version 2.31 :
-
-
-
- 22-06-2012: Version 2.3 :
-
-
- New scrollbar implementation . Should flicker less. Changes DOM structure of the editor.
- New theme: vibrant-ink .
- Many extensions to the VIM keymap (including text objects).
- Add mode-multiplexing utility script.
- Fix bug where right-click paste works in read-only mode.
- Add a getScrollInfo method.
- Lots of other fixes .
-
-
- 23-05-2012: Version 2.25 :
-
-
- New mode: Erlang .
- Remove xmlpure mode (use xml.js ).
- Fix line-wrapping in Opera.
- Fix X Windows middle-click paste in Chrome.
- Fix bug that broke pasting of huge documents.
- Fix backspace and tab key repeat in Opera.
-
-
- 23-04-2012: Version 2.24 :
-
-
- Drop support for Internet Explorer 6 .
- New
- modes: Shell , Tiki
- wiki , Pig Latin .
- New themes: Ambiance , Blackboard .
- More control over drag/drop
- with dragDrop
- and onDragEvent
- options.
- Make HTML mode a bit less pedantic.
- Add compoundChange API method.
- Several fixes in undo history and line hiding.
- Remove (broken) support for catchall in key maps,
- add nofallthrough boolean field instead.
-
-
- 26-03-2012: Version 2.23 :
-
-
- Change default binding for tab [more]
-
- Starting in 2.23, these bindings are default:
-
Tab: Insert tab character
- Shift-tab: Reset line indentation to default
- Ctrl/Cmd-[: Reduce line indentation (old tab behaviour)
- Ctrl/Cmd-]: Increase line indentation (old shift-tab behaviour)
-
-
-
- New modes: XQuery and VBScript .
- Two new themes: lesser-dark and xq-dark .
- Differentiate between background and text styles in setLineClass .
- Fix drag-and-drop in IE9+.
- Extend charCoords
- and cursorCoords with a mode argument.
- Add autofocus option.
- Add findMarksAt method.
-
-
- 27-02-2012: Version 2.22 :
-
-
-
- 27-01-2012: Version 2.21 :
-
-
- Added LESS , MySQL ,
- Go , and Verilog modes.
- Add smartIndent
- option.
- Support a cursor in readOnly -mode.
- Support assigning multiple styles to a token.
- Use a new approach to drawing the selection.
- Add scrollTo method.
- Allow undo/redo events to span non-adjacent lines.
- Lots and lots of bugfixes.
-
-
- 20-12-2011: Version 2.2 :
-
-
-
- 21-11-2011: Version 2.18 :
- Fixes TextMarker.clear, which is broken in 2.17.
-
- 21-11-2011: Version 2.17 :
-
- Add support for line
- wrapping and code
- folding .
- Add Github-style Markdown mode.
- Add Monokai
- and Rubyblue themes.
- Add setBookmark method.
- Move some of the demo code into reusable components
- under lib/util .
- Make screen-coord-finding code faster and more reliable.
- Fix drag-and-drop in Firefox.
- Improve support for IME.
- Speed up content rendering.
- Fix browser's built-in search in Webkit.
- Make double- and triple-click work in IE.
- Various fixes to modes.
-
-
- 27-10-2011: Version 2.16 :
-
- Add Perl , Rust , TiddlyWiki , and Groovy modes.
- Dragging text inside the editor now moves, rather than copies.
- Add a coordsFromIndex method.
- API change : setValue now no longer clears history. Use clearHistory for that.
- API change : markText now
- returns an object with clear and find
- methods. Marked text is now more robust when edited.
- Fix editing code with tabs in Internet Explorer.
-
-
- 26-09-2011: Version 2.15 :
- Fix bug that snuck into 2.14: Clicking the
- character that currently has the cursor didn't re-focus the
- editor.
-
- 26-09-2011: Version 2.14 :
-
-
-
- 23-08-2011: Version 2.13 :
-
-
- 25-07-2011: Version 2.12 :
-
- Add a SPARQL mode.
- Fix bug with cursor jumping around in an unfocused editor in IE.
- Allow key and mouse events to bubble out of the editor. Ignore widget clicks.
- Solve cursor flakiness after undo/redo.
- Fix block-reindent ignoring the last few lines.
- Fix parsing of multi-line attrs in XML mode.
- Use innerHTML for HTML-escaping.
- Some fixes to indentation in C-like mode.
- Shrink horiz scrollbars when long lines removed.
- Fix width feedback loop bug that caused the width of an inner DIV to shrink.
-
-
- 04-07-2011: Version 2.11 :
-
- Add a Scheme mode .
- Add a replace method to search cursors, for cursor-preserving replacements.
- Make the C-like mode mode more customizable.
- Update XML mode to spot mismatched tags.
- Add getStateAfter API and compareState mode API methods for finer-grained mode magic.
- Add a getScrollerElement API method to manipulate the scrolling DIV.
- Fix drag-and-drop for Firefox.
- Add a C# configuration for the C-like mode .
- Add full-screen editing and mode-changing demos.
-
-
- 07-06-2011: Version 2.1 :
- Add
- a theme system
- (demo ). Note that this is not
- backwards-compatible—you'll have to update your styles and
- modes!
-
- 07-06-2011: Version 2.02 :
-
- Add a Lua mode .
- Fix reverse-searching for a regexp.
- Empty lines can no longer break highlighting.
- Rework scrolling model (the outer wrapper no longer does the scrolling).
- Solve horizontal jittering on long lines.
- Add runmode.js .
- Immediately re-highlight text when typing.
- Fix problem with 'sticking' horizontal scrollbar.
-
-
- 26-05-2011: Version 2.01 :
-
- Add a Smalltalk mode .
- Add a reStructuredText mode .
- Add a Python mode .
- Add a PL/SQL mode .
- coordsChar now works
- Fix a problem where onCursorActivity interfered with onChange.
- Fix a number of scrolling and mouse-click-position glitches.
- Pass information about the changed lines to onChange.
- Support cmd-up/down on OS X.
- Add triple-click line selection.
- Don't handle shift when changing the selection through the API.
- Support "nocursor" mode for readOnly option.
- Add an onHighlightComplete option.
- Fix the context menu for Firefox.
-
-
- 28-03-2011: Version 2.0 :
- CodeMirror 2 is a complete rewrite that's
- faster, smaller, simpler to use, and less dependent on browser
- quirks. See this
- and this
- for more information.
-
- 22-02-2011: Version 2.0 beta 2 :
- Somewhat more mature API, lots of bugs shaken out.
-
- 17-02-2011: Version 0.94 :
-
- tabMode: "spaces" was modified slightly (now indents when something is selected).
- Fixes a bug that would cause the selection code to break on some IE versions.
- Disabling spell-check on WebKit browsers now works.
-
-
- 08-02-2011: Version 2.0 beta 1 :
- CodeMirror 2 is a complete rewrite of
- CodeMirror, no longer depending on an editable frame.
-
- 19-01-2011: Version 0.93 :
-
- Added a Regular Expression parser.
- Fixes to the PHP parser.
- Support for regular expression in search/replace.
- Add save method to instances created with fromTextArea.
- Add support for MS T-SQL in the SQL parser.
- Support use of CSS classes for highlighting brackets.
- Fix yet another hang with line-numbering in hidden editors.
-
-
-
-
-
- Version 0.x
-
- 28-03-2011: Version 1.0 :
-
- Fix error when debug history overflows.
- Refine handling of C# verbatim strings.
- Fix some issues with JavaScript indentation.
-
-
- 17-12-2010: Version 0.92 :
-
- Make CodeMirror work in XHTML documents.
- Fix bug in handling of backslashes in Python strings.
- The styleNumbers option is now officially
- supported and documented.
- onLineNumberClick option added.
- More consistent names onLoad and
- onCursorActivity callbacks. Old names still work, but
- are deprecated.
- Add a Freemarker mode.
-
-
- 11-11-2010: Version 0.91 :
-
- Adds support for Java .
- Small additions to the PHP and SQL parsers.
- Work around various Webkit issues .
- Fix toTextArea to update the code in the textarea.
- Add a noScriptCaching option (hack to ease development).
- Make sub-modes of HTML mixed mode configurable.
-
-
- 02-10-2010: Version 0.9 :
-
- Add support for searching backwards.
- There are now parsers for Scheme , XQuery , and OmetaJS .
- Makes height: "dynamic" more robust.
- Fixes bug where paste did not work on OS X.
- Add a enterMode and electricChars options to make indentation even more customizable.
- Add firstLineNumber option.
- Fix bad handling of @media rules by the CSS parser.
- Take a new, more robust approach to working around the invisible-last-line bug in WebKit.
-
-
- 22-07-2010: Version 0.8 :
-
- Add a cursorCoords method to find the screen
- coordinates of the cursor.
- A number of fixes and support for more syntax in the PHP parser.
- Fix indentation problem with JSON-mode JS parser in Webkit.
- Add a minification UI.
- Support a height: dynamic mode, where the editor's
- height will adjust to the size of its content.
- Better support for IME input mode.
- Fix JavaScript parser getting confused when seeing a no-argument
- function call.
- Have CSS parser see the difference between selectors and other
- identifiers.
- Fix scrolling bug when pasting in a horizontally-scrolled
- editor.
- Support toTextArea method in instances created with
- fromTextArea.
- Work around new Opera cursor bug that causes the cursor to jump
- when pressing backspace at the end of a line.
-
-
- 27-04-2010: Version
- 0.67 :
- More consistent page-up/page-down behaviour
- across browsers. Fix some issues with hidden editors looping forever
- when line-numbers were enabled. Make PHP parser parse
- "\\" correctly. Have jumpToLine work on
- line handles, and add cursorLine function to fetch the
- line handle where the cursor currently is. Add new
- setStylesheet function to switch style-sheets in a
- running editor.
-
- 01-03-2010: Version
- 0.66 :
- Adds removeLine method to API.
- Introduces the PLSQL parser .
- Marks XML errors by adding (rather than replacing) a CSS class, so
- that they can be disabled by modifying their style. Fixes several
- selection bugs, and a number of small glitches.
-
- 12-11-2009: Version
- 0.65 :
- Add support for having both line-wrapping and
- line-numbers turned on, make paren-highlighting style customisable
- (markParen and unmarkParen config
- options), work around a selection bug that Opera
- re introduced in version 10.
-
- 23-10-2009: Version
- 0.64 :
- Solves some issues introduced by the
- paste-handling changes from the previous release. Adds
- setSpellcheck, setTextWrapping,
- setIndentUnit, setUndoDepth,
- setTabMode, and setLineNumbers to
- customise a running editor. Introduces an SQL parser. Fixes a few small
- problems in the Python
- parser. And, as usual, add workarounds for various newly discovered
- browser incompatibilities.
-
- 31-08-2009: Version 0.63 :
- Overhaul of paste-handling (less fragile), fixes for several
- serious IE8 issues (cursor jumping, end-of-document bugs) and a number
- of small problems.
-
- 30-05-2009: Version 0.62 :
- Introduces Python
- and Lua parsers. Add
- setParser (on-the-fly mode changing) and
- clearHistory methods. Make parsing passes time-based
- instead of lines-based (see the passTime option).
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/reporting.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/reporting.html
deleted file mode 100644
index 3c582d9..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/reporting.html
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
CodeMirror: Reporting Bugs
-
-
-
-
-
-
-
-Reporting bugs effectively
-
-
-
-
So you found a problem in CodeMirror. By all means, report it! Bug
-reports from users are the main drive behind improvements to
-CodeMirror. But first, please read over these points:
-
-
- CodeMirror is maintained by volunteers. They don't owe you
- anything, so be polite. Reports with an indignant or belligerent
- tone tend to be moved to the bottom of the pile.
-
- Include information about the browser in which the
- problem occurred . Even if you tested several browsers, and
- the problem occurred in all of them, mention this fact in the bug
- report. Also include browser version numbers and the operating
- system that you're on.
-
- Mention which release of CodeMirror you're using. Preferably,
- try also with the current development snapshot, to ensure the
- problem has not already been fixed.
-
- Mention very precisely what went wrong. "X is broken" is not a
- good bug report. What did you expect to happen? What happened
- instead? Describe the exact steps a maintainer has to take to make
- the problem occur. We can not fix something that we can not
- observe.
-
- If the problem can not be reproduced in any of the demos
- included in the CodeMirror distribution, please provide an HTML
- document that demonstrates the problem. The best way to do this is
- to go to jsbin.com , enter
- it there, press save, and include the resulting link in your bug
- report.
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v2.2.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v2.2.html
deleted file mode 100644
index 3948ce6..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v2.2.html
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
CodeMirror: Version 2.2 upgrade guide
-
-
-
-
-
-
-
-Upgrading to v2.2
-
-There are a few things in the 2.2 release that require some care
-when upgrading.
-
-No more default.css
-
-The default theme is now included
-in codemirror.css , so
-you do not have to included it separately anymore. (It was tiny, so
-even if you're not using it, the extra data overhead is negligible.)
-
-
Different key customization
-
-CodeMirror has moved to a system
-where keymaps are used to
-bind behavior to keys. This means custom
-bindings are now possible.
-
-Three options that influenced key
-behavior, tabMode, enterMode,
-and smartHome, are no longer supported. Instead, you can
-provide custom bindings to influence the way these keys act. This is
-done through the
-new extraKeys
-option, which can hold an object mapping key names to functionality. A
-simple example would be:
-
- extraKeys: {
- "Ctrl-S": function(instance) { saveText(instance.getValue()); },
- "Ctrl-/": "undo"
- }
-
-Keys can be mapped either to functions, which will be given the
-editor instance as argument, or to strings, which are mapped through
-functions through the CodeMirror.commands table, which
-contains all the built-in editing commands, and can be inspected and
-extended by external code.
-
-By default, the Home key is bound to
-the "goLineStartSmart" command, which moves the cursor to
-the first non-whitespace character on the line. You can set do this to
-make it always go to the very start instead:
-
- extraKeys: {"Home": "goLineStart"}
-
-Similarly, Enter is bound
-to "newlineAndIndent" by default. You can bind it to
-something else to get different behavior. To disable special handling
-completely and only get a newline character inserted, you can bind it
-to false:
-
- extraKeys: {"Enter": false}
-
-The same works for Tab. If you don't want CodeMirror
-to handle it, bind it to false. The default behaviour is
-to indent the current line more ("indentMore" command),
-and indent it less when shift is held ("indentLess").
-There are also "indentAuto" (smart indent)
-and "insertTab" commands provided for alternate
-behaviors. Or you can write your own handler function to do something
-different altogether.
-
-Tabs
-
-Handling of tabs changed completely. The display width of tabs can
-now be set with the tabSize option, and tabs can
-be styled by setting CSS rules
-for the cm-tab class.
-
-The default width for tabs is now 4, as opposed to the 8 that is
-hard-wired into browsers. If you are relying on 8-space tabs, make
-sure you explicitly set tabSize: 8 in your options.
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v3.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v3.html
deleted file mode 100644
index 5f94067..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v3.html
+++ /dev/null
@@ -1,230 +0,0 @@
-
-
-
CodeMirror: Version 3 upgrade guide
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Upgrading to version 3
-
-Version 3 does not depart too much from 2.x API, and sites that use
-CodeMirror in a very simple way might be able to upgrade without
-trouble. But it does introduce a number of incompatibilities. Please
-at least skim this text before upgrading.
-
-Note that version 3 drops full support for Internet
-Explorer 7 . The editor will mostly work on that browser, but
-it'll be significantly glitchy.
-
-
- DOM structure
-
-This one is the most likely to cause problems. The internal
-structure of the editor has changed quite a lot, mostly to implement a
-new scrolling model.
-
-Editor height is now set on the outer wrapper element (CSS
-class CodeMirror), not on the scroller element
-(CodeMirror-scroll).
-
-Other nodes were moved, dropped, and added. If you have any code
-that makes assumptions about the internal DOM structure of the editor,
-you'll have to re-test it and probably update it to work with v3.
-
-See the styling section of the
-manual for more information.
-
-
- Gutter model
-
-In CodeMirror 2.x, there was a single gutter, and line markers
-created with setMarker would have to somehow coexist with
-the line numbers (if present). Version 3 allows you to specify an
-array of gutters, by class
-name ,
-use setGutterMarker
-to add or remove markers in individual gutters, and clear whole
-gutters
-with clearGutter .
-Gutter markers are now specified as DOM nodes, rather than HTML
-snippets.
-
-The gutters no longer horizontally scrolls along with the content.
-The fixedGutter option was removed (since it is now the
-only behavior).
-
-
-<style>
- /* Define a gutter style */
- .note-gutter { width: 3em; background: cyan; }
-</style>
-<script>
- // Create an instance with two gutters -- line numbers and notes
- var cm = new CodeMirror(document.body, {
- gutters: ["note-gutter", "CodeMirror-linenumbers"],
- lineNumbers: true
- });
- // Add a note to line 0
- cm.setGutterMarker(0, "note-gutter", document.createTextNode("hi"));
-</script>
-
-
-
- Event handling
-
-Most of the onXYZ options have been removed. The same
-effect is now obtained by calling
-the on method with a string
-identifying the event type. Multiple handlers can now be registered
-(and individually unregistered) for an event, and objects such as line
-handlers now also expose events. See the
-full list here .
-
-(The onKeyEvent and onDragEvent options,
-which act more as hooks than as event handlers, are still there in
-their old form.)
-
-
-cm.on("change", function(cm, change) {
- console.log("something changed! (" + change.origin + ")");
-});
-
-
-
- markText method arguments
-
-The markText method
-(which has gained some interesting new features, such as creating
-atomic and read-only spans, or replacing spans with widgets) no longer
-takes the CSS class name as a separate argument, but makes it an
-optional field in the options object instead.
-
-
-// Style first ten lines, and forbid the cursor from entering them
-cm.markText({line: 0, ch: 0}, {line: 10, ch: 0}, {
- className: "magic-text",
- inclusiveLeft: true,
- atomic: true
-});
-
-
-
- Line folding
-
-The interface for hiding lines has been
-removed. markText can
-now be used to do the same in a more flexible and powerful way.
-
-The folding script has been
-updated to use the new interface, and should now be more robust.
-
-
-// Fold a range, replacing it with the text "??"
-var range = cm.markText({line: 4, ch: 2}, {line: 8, ch: 1}, {
- replacedWith: document.createTextNode("??"),
- // Auto-unfold when cursor moves into the range
- clearOnEnter: true
-});
-// Get notified when auto-unfolding
-CodeMirror.on(range, "clear", function() {
- console.log("boom");
-});
-
-
-
- Line CSS classes
-
-The setLineClass method has been replaced
-by addLineClass
-and removeLineClass ,
-which allow more modular control over the classes attached to a line.
-
-
-var marked = cm.addLineClass(10, "background", "highlighted-line");
-setTimeout(function() {
- cm.removeLineClass(marked, "background", "highlighted-line");
-});
-
-
-
- Position properties
-
-All methods that take or return objects that represent screen
-positions now use {left, top, bottom, right} properties
-(not always all of them) instead of the {x, y, yBot} used
-by some methods in v2.x.
-
-Affected methods
-are cursorCoords , charCoords , coordsChar ,
-and getScrollInfo .
-
-
- Bracket matching no longer in core
-
-The matchBrackets
-option is no longer defined in the core editor.
-Load addon/edit/matchbrackets.js to enable it.
-
-
- Mode management
-
-The CodeMirror.listModes
-and CodeMirror.listMIMEs functions, used for listing
-defined modes, are gone. You are now encouraged to simply
-inspect CodeMirror.modes (mapping mode names to mode
-constructors) and CodeMirror.mimeModes (mapping MIME
-strings to mode specs).
-
-
- New features
-
-Some more reasons to upgrade to version 3.
-
-
- Bi-directional text support. CodeMirror will now mostly do the
- right thing when editing Arabic or Hebrew text.
- Arbitrary line heights. Using fonts with different heights
- inside the editor (whether off by one pixel or fifty) is now
- supported and handled gracefully.
- In-line widgets. See the demo
- and the docs .
- Defining custom options
- with CodeMirror.defineOption .
-
-
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v4.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v4.html
deleted file mode 100644
index 09df00c..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/upgrade_v4.html
+++ /dev/null
@@ -1,144 +0,0 @@
-
-
-
CodeMirror: Version 4 upgrade guide
-
-
-
-
-
-
-
-
-Upgrading to version 4
-
-CodeMirror 4's interface is very close version 3, but it
-does fix a few awkward details in a backwards-incompatible ways. At
-least skim the text below before upgrading.
-
-Multiple selections
-
-The main new feature in version 4 is multiple selections. The
-single-selection variants of methods are still there, but now
-typically act only on the primary selection (usually the last
-one added).
-
-The exception to this
-is getSelection ,
-which will now return the content of all selections
-(separated by newlines, or whatever lineSep parameter you passed
-it).
-
-
-
-The beforeSelectionChange event
-
-This event still exists, but the object it is passed has
-a completely new
-interface , because such changes now concern multiple
-selections.
-
-
-
-replaceSelection's collapsing behavior
-
-By
-default, replaceSelection
-would leave the newly inserted text selected. This is only rarely what
-you want, and also (slightly) more expensive in the new model, so the
-default was changed to "end", meaning the old behavior
-must be explicitly specified by passing a second argument
-of "around".
-
-
-
-change event data
-
-Rather than forcing client code to follow next
-pointers from one change object to the next, the library will now
-simply fire
-multiple "change"
-events. Existing code will probably continue to work unmodified.
-
-
-
-showIfHidden option to line widgets
-
-This option, which conceptually caused line widgets to be visible
-even if their line was hidden, was never really well-defined, and was
-buggy from the start. It would be a rather expensive feature, both in
-code complexity and run-time performance, to implement properly. It
-has been dropped entirely in 4.0.
-
-
-
-Module loaders
-
-All modules in the CodeMirror distribution are now wrapped in a
-shim function to make them compatible with both AMD
-(requirejs ) and CommonJS (as used
-by node
-and browserify ) module loaders.
-When neither of these is present, they fall back to simply using the
-global CodeMirror variable.
-
-If you have a module loader present in your environment, CodeMirror
-will attempt to use it, and you might need to change the way you load
-CodeMirror modules.
-
-
-
-Mutating shared data structures
-
-Data structures produced by the library should not be mutated
-unless explicitly allowed, in general. This is slightly more strict in
-4.0 than it was in earlier versions, which copied the position objects
-returned by getCursor
-for nebulous, historic reasons. In 4.0, mutating these
-objects will corrupt your editor's selection.
-
-
-
-Deprecated interfaces dropped
-
-A few properties and methods that have been deprecated for a while
-are now gone. Most notably, the onKeyEvent
-and onDragEvent options (use the
-corresponding events instead).
-
-Two silly methods, which were mostly there to stay close to the 0.x
-API, setLine and removeLine are now gone.
-Use the more
-flexible replaceRange
-method instead.
-
-The long names for folding and completing functions
-(CodeMirror.braceRangeFinder, CodeMirror.javascriptHint,
-etc) are also gone
-(use CodeMirror.fold.brace, CodeMirror.hint.javascript).
-
-The className property in the return value
-of getTokenAt , which
-has been superseded by the type property, is also no
-longer present.
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/yinyang.png b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/yinyang.png
deleted file mode 100644
index 2eafd3f..0000000
Binary files a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/doc/yinyang.png and /dev/null differ
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/index.html b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/index.html
deleted file mode 100644
index bca7e02..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/index.html
+++ /dev/null
@@ -1,199 +0,0 @@
-
-
-
CodeMirror
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- CodeMirror is a versatile text editor
- implemented in JavaScript for the browser. It is specialized for
- editing code, and comes with a number of language modes and addons
- that implement more advanced editing functionality.
-
- A rich programming API and a
- CSS theming system are
- available for customizing CodeMirror to fit your application, and
- extending it with new functionality.
-
-
-
- This is CodeMirror
-
-
-
-
-
-
- Other demos...
- Autocompletion
- Code folding
- Themes
- Mixed language modes
- Bi-directional text
- Variable font sizes
- Search interface
- Vim bindings
- Emacs bindings
- Sublime Text bindings
- Tern integration
- Merge/diff interface
- Full-screen editor
- Custom scrollbars
-
-
-
-
-
-
-
-
-
-
-
- Software needs maintenance,
- maintainers need to subsist.
- Current funding status =
- You can help
per month or
-
once .
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Browser support
- The desktop versions of the following browsers,
- in standards mode (HTML5 <!doctype html>
- recommended) are supported:
-
- Firefox version 4 and up
- Chrome any version
- Safari version 5.2 and up
- Internet Explorer version 8 and up
- Opera version 9 and up
-
- Support for modern mobile browsers is experimental. Recent
- versions of the iOS browser and Chrome on Android should work
- pretty well.
-
-
-
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/emacs.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/emacs.js
deleted file mode 100644
index 3eec1e5..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/emacs.js
+++ /dev/null
@@ -1,412 +0,0 @@
-// 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 posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
-
- // Kill 'ring'
-
- var killRing = [];
- function addToRing(str) {
- killRing.push(str);
- if (killRing.length > 50) killRing.shift();
- }
- function growRingTop(str) {
- if (!killRing.length) return addToRing(str);
- killRing[killRing.length - 1] += str;
- }
- function getFromRing(n) { return killRing[killRing.length - (n ? Math.min(n, 1) : 1)] || ""; }
- function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }
-
- var lastKill = null;
-
- function kill(cm, from, to, mayGrow, text) {
- if (text == null) text = cm.getRange(from, to);
-
- if (mayGrow && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))
- growRingTop(text);
- else
- addToRing(text);
- cm.replaceRange("", from, to, "+delete");
-
- if (mayGrow) lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()};
- else lastKill = null;
- }
-
- // Boundaries of various units
-
- function byChar(cm, pos, dir) {
- return cm.findPosH(pos, dir, "char", true);
- }
-
- function byWord(cm, pos, dir) {
- return cm.findPosH(pos, dir, "word", true);
- }
-
- function byLine(cm, pos, dir) {
- return cm.findPosV(pos, dir, "line", cm.doc.sel.goalColumn);
- }
-
- function byPage(cm, pos, dir) {
- return cm.findPosV(pos, dir, "page", cm.doc.sel.goalColumn);
- }
-
- function byParagraph(cm, pos, dir) {
- var no = pos.line, line = cm.getLine(no);
- var sawText = /\S/.test(dir < 0 ? line.slice(0, pos.ch) : line.slice(pos.ch));
- var fst = cm.firstLine(), lst = cm.lastLine();
- for (;;) {
- no += dir;
- if (no < fst || no > lst)
- return cm.clipPos(Pos(no - dir, dir < 0 ? 0 : null));
- line = cm.getLine(no);
- var hasText = /\S/.test(line);
- if (hasText) sawText = true;
- else if (sawText) return Pos(no, 0);
- }
- }
-
- function bySentence(cm, pos, dir) {
- var line = pos.line, ch = pos.ch;
- var text = cm.getLine(pos.line), sawWord = false;
- for (;;) {
- var next = text.charAt(ch + (dir < 0 ? -1 : 0));
- if (!next) { // End/beginning of line reached
- if (line == (dir < 0 ? cm.firstLine() : cm.lastLine())) return Pos(line, ch);
- text = cm.getLine(line + dir);
- if (!/\S/.test(text)) return Pos(line, ch);
- line += dir;
- ch = dir < 0 ? text.length : 0;
- continue;
- }
- if (sawWord && /[!?.]/.test(next)) return Pos(line, ch + (dir > 0 ? 1 : 0));
- if (!sawWord) sawWord = /\w/.test(next);
- ch += dir;
- }
- }
-
- function byExpr(cm, pos, dir) {
- var wrap;
- if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, true))
- && wrap.match && (wrap.forward ? 1 : -1) == dir)
- return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to;
-
- for (var first = true;; first = false) {
- var token = cm.getTokenAt(pos);
- var after = Pos(pos.line, dir < 0 ? token.start : token.end);
- if (first && dir > 0 && token.end == pos.ch || !/\w/.test(token.string)) {
- var newPos = cm.findPosH(after, dir, "char");
- if (posEq(after, newPos)) return pos;
- else pos = newPos;
- } else {
- return after;
- }
- }
- }
-
- // Prefixes (only crudely supported)
-
- function getPrefix(cm, precise) {
- var digits = cm.state.emacsPrefix;
- if (!digits) return precise ? null : 1;
- clearPrefix(cm);
- return digits == "-" ? -1 : Number(digits);
- }
-
- function repeated(cmd) {
- var f = typeof cmd == "string" ? function(cm) { cm.execCommand(cmd); } : cmd;
- return function(cm) {
- var prefix = getPrefix(cm);
- f(cm);
- for (var i = 1; i < prefix; ++i) f(cm);
- };
- }
-
- function findEnd(cm, pos, by, dir) {
- var prefix = getPrefix(cm);
- if (prefix < 0) { dir = -dir; prefix = -prefix; }
- for (var i = 0; i < prefix; ++i) {
- var newPos = by(cm, pos, dir);
- if (posEq(newPos, pos)) break;
- pos = newPos;
- }
- return pos;
- }
-
- function move(by, dir) {
- var f = function(cm) {
- cm.extendSelection(findEnd(cm, cm.getCursor(), by, dir));
- };
- f.motion = true;
- return f;
- }
-
- function killTo(cm, by, dir) {
- var selections = cm.listSelections(), cursor;
- var i = selections.length;
- while (i--) {
- cursor = selections[i].head;
- kill(cm, cursor, findEnd(cm, cursor, by, dir), true);
- }
- }
-
- function killRegion(cm) {
- if (cm.somethingSelected()) {
- var selections = cm.listSelections(), selection;
- var i = selections.length;
- while (i--) {
- selection = selections[i];
- kill(cm, selection.anchor, selection.head);
- }
- return true;
- }
- }
-
- function addPrefix(cm, digit) {
- if (cm.state.emacsPrefix) {
- if (digit != "-") cm.state.emacsPrefix += digit;
- return;
- }
- // Not active yet
- cm.state.emacsPrefix = digit;
- cm.on("keyHandled", maybeClearPrefix);
- cm.on("inputRead", maybeDuplicateInput);
- }
-
- var prefixPreservingKeys = {"Alt-G": true, "Ctrl-X": true, "Ctrl-Q": true, "Ctrl-U": true};
-
- function maybeClearPrefix(cm, arg) {
- if (!cm.state.emacsPrefixMap && !prefixPreservingKeys.hasOwnProperty(arg))
- clearPrefix(cm);
- }
-
- function clearPrefix(cm) {
- cm.state.emacsPrefix = null;
- cm.off("keyHandled", maybeClearPrefix);
- cm.off("inputRead", maybeDuplicateInput);
- }
-
- function maybeDuplicateInput(cm, event) {
- var dup = getPrefix(cm);
- if (dup > 1 && event.origin == "+input") {
- var one = event.text.join("\n"), txt = "";
- for (var i = 1; i < dup; ++i) txt += one;
- cm.replaceSelection(txt);
- }
- }
-
- function addPrefixMap(cm) {
- cm.state.emacsPrefixMap = true;
- cm.addKeyMap(prefixMap);
- cm.on("keyHandled", maybeRemovePrefixMap);
- cm.on("inputRead", maybeRemovePrefixMap);
- }
-
- function maybeRemovePrefixMap(cm, arg) {
- if (typeof arg == "string" && (/^\d$/.test(arg) || arg == "Ctrl-U")) return;
- cm.removeKeyMap(prefixMap);
- cm.state.emacsPrefixMap = false;
- cm.off("keyHandled", maybeRemovePrefixMap);
- cm.off("inputRead", maybeRemovePrefixMap);
- }
-
- // Utilities
-
- function setMark(cm) {
- cm.setCursor(cm.getCursor());
- cm.setExtending(!cm.getExtending());
- cm.on("change", function() { cm.setExtending(false); });
- }
-
- function clearMark(cm) {
- cm.setExtending(false);
- cm.setCursor(cm.getCursor());
- }
-
- function getInput(cm, msg, f) {
- if (cm.openDialog)
- cm.openDialog(msg + ":
", f, {bottom: true});
- else
- f(prompt(msg, ""));
- }
-
- function operateOnWord(cm, op) {
- var start = cm.getCursor(), end = cm.findPosH(start, 1, "word");
- cm.replaceRange(op(cm.getRange(start, end)), start, end);
- cm.setCursor(end);
- }
-
- function toEnclosingExpr(cm) {
- var pos = cm.getCursor(), line = pos.line, ch = pos.ch;
- var stack = [];
- while (line >= cm.firstLine()) {
- var text = cm.getLine(line);
- for (var i = ch == null ? text.length : ch; i > 0;) {
- var ch = text.charAt(--i);
- if (ch == ")")
- stack.push("(");
- else if (ch == "]")
- stack.push("[");
- else if (ch == "}")
- stack.push("{");
- else if (/[\(\{\[]/.test(ch) && (!stack.length || stack.pop() != ch))
- return cm.extendSelection(Pos(line, i));
- }
- --line; ch = null;
- }
- }
-
- function quit(cm) {
- cm.execCommand("clearSearch");
- clearMark(cm);
- }
-
- // Actual keymap
-
- var keyMap = CodeMirror.keyMap.emacs = CodeMirror.normalizeKeyMap({
- "Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"));},
- "Ctrl-K": repeated(function(cm) {
- var start = cm.getCursor(), end = cm.clipPos(Pos(start.line));
- var text = cm.getRange(start, end);
- if (!/\S/.test(text)) {
- text += "\n";
- end = Pos(start.line + 1, 0);
- }
- kill(cm, start, end, true, text);
- }),
- "Alt-W": function(cm) {
- addToRing(cm.getSelection());
- clearMark(cm);
- },
- "Ctrl-Y": function(cm) {
- var start = cm.getCursor();
- cm.replaceRange(getFromRing(getPrefix(cm)), start, start, "paste");
- cm.setSelection(start, cm.getCursor());
- },
- "Alt-Y": function(cm) {cm.replaceSelection(popFromRing(), "around", "paste");},
-
- "Ctrl-Space": setMark, "Ctrl-Shift-2": setMark,
-
- "Ctrl-F": move(byChar, 1), "Ctrl-B": move(byChar, -1),
- "Right": move(byChar, 1), "Left": move(byChar, -1),
- "Ctrl-D": function(cm) { killTo(cm, byChar, 1); },
- "Delete": function(cm) { killRegion(cm) || killTo(cm, byChar, 1); },
- "Ctrl-H": function(cm) { killTo(cm, byChar, -1); },
- "Backspace": function(cm) { killRegion(cm) || killTo(cm, byChar, -1); },
-
- "Alt-F": move(byWord, 1), "Alt-B": move(byWord, -1),
- "Alt-D": function(cm) { killTo(cm, byWord, 1); },
- "Alt-Backspace": function(cm) { killTo(cm, byWord, -1); },
-
- "Ctrl-N": move(byLine, 1), "Ctrl-P": move(byLine, -1),
- "Down": move(byLine, 1), "Up": move(byLine, -1),
- "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
- "End": "goLineEnd", "Home": "goLineStart",
-
- "Alt-V": move(byPage, -1), "Ctrl-V": move(byPage, 1),
- "PageUp": move(byPage, -1), "PageDown": move(byPage, 1),
-
- "Ctrl-Up": move(byParagraph, -1), "Ctrl-Down": move(byParagraph, 1),
-
- "Alt-A": move(bySentence, -1), "Alt-E": move(bySentence, 1),
- "Alt-K": function(cm) { killTo(cm, bySentence, 1); },
-
- "Ctrl-Alt-K": function(cm) { killTo(cm, byExpr, 1); },
- "Ctrl-Alt-Backspace": function(cm) { killTo(cm, byExpr, -1); },
- "Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1),
-
- "Shift-Ctrl-Alt-2": function(cm) {
- var cursor = cm.getCursor();
- cm.setSelection(findEnd(cm, cursor, byExpr, 1), cursor);
- },
- "Ctrl-Alt-T": function(cm) {
- var leftStart = byExpr(cm, cm.getCursor(), -1), leftEnd = byExpr(cm, leftStart, 1);
- var rightEnd = byExpr(cm, leftEnd, 1), rightStart = byExpr(cm, rightEnd, -1);
- cm.replaceRange(cm.getRange(rightStart, rightEnd) + cm.getRange(leftEnd, rightStart) +
- cm.getRange(leftStart, leftEnd), leftStart, rightEnd);
- },
- "Ctrl-Alt-U": repeated(toEnclosingExpr),
-
- "Alt-Space": function(cm) {
- var pos = cm.getCursor(), from = pos.ch, to = pos.ch, text = cm.getLine(pos.line);
- while (from && /\s/.test(text.charAt(from - 1))) --from;
- while (to < text.length && /\s/.test(text.charAt(to))) ++to;
- cm.replaceRange(" ", Pos(pos.line, from), Pos(pos.line, to));
- },
- "Ctrl-O": repeated(function(cm) { cm.replaceSelection("\n", "start"); }),
- "Ctrl-T": repeated(function(cm) {
- cm.execCommand("transposeChars");
- }),
-
- "Alt-C": repeated(function(cm) {
- operateOnWord(cm, function(w) {
- var letter = w.search(/\w/);
- if (letter == -1) return w;
- return w.slice(0, letter) + w.charAt(letter).toUpperCase() + w.slice(letter + 1).toLowerCase();
- });
- }),
- "Alt-U": repeated(function(cm) {
- operateOnWord(cm, function(w) { return w.toUpperCase(); });
- }),
- "Alt-L": repeated(function(cm) {
- operateOnWord(cm, function(w) { return w.toLowerCase(); });
- }),
-
- "Alt-;": "toggleComment",
-
- "Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"),
- "Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"),
- "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
- "Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": quit, "Shift-Alt-5": "replace",
- "Alt-/": "autocomplete",
- "Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto",
-
- "Alt-G G": function(cm) {
- var prefix = getPrefix(cm, true);
- if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1);
-
- getInput(cm, "Goto line", function(str) {
- var num;
- if (str && !isNaN(num = Number(str)) && num == (num|0) && num > 0)
- cm.setCursor(num - 1);
- });
- },
-
- "Ctrl-X Tab": function(cm) {
- cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit"));
- },
- "Ctrl-X Ctrl-X": function(cm) {
- cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor"));
- },
- "Ctrl-X Ctrl-S": "save",
- "Ctrl-X Ctrl-W": "save",
- "Ctrl-X S": "saveAll",
- "Ctrl-X F": "open",
- "Ctrl-X U": repeated("undo"),
- "Ctrl-X K": "close",
- "Ctrl-X Delete": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), true); },
- "Ctrl-X H": "selectAll",
-
- "Ctrl-Q Tab": repeated("insertTab"),
- "Ctrl-U": addPrefixMap
- });
-
- var prefixMap = {"Ctrl-G": clearPrefix};
- function regPrefix(d) {
- prefixMap[d] = function(cm) { addPrefix(cm, d); };
- keyMap["Ctrl-" + d] = function(cm) { addPrefix(cm, d); };
- prefixPreservingKeys["Ctrl-" + d] = true;
- }
- for (var i = 0; i < 10; ++i) regPrefix(String(i));
- regPrefix("-");
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/sublime.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/sublime.js
deleted file mode 100644
index 1d9a9d8..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/sublime.js
+++ /dev/null
@@ -1,555 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// A rough approximation of Sublime Text's keybindings
-// Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/edit/matchbrackets"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/edit/matchbrackets"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
- "use strict";
-
- var map = CodeMirror.keyMap.sublime = {fallthrough: "default"};
- var cmds = CodeMirror.commands;
- var Pos = CodeMirror.Pos;
- var mac = CodeMirror.keyMap["default"] == CodeMirror.keyMap.macDefault;
- var ctrl = mac ? "Cmd-" : "Ctrl-";
-
- // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that.
- function findPosSubword(doc, start, dir) {
- if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1));
- var line = doc.getLine(start.line);
- if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0));
- var state = "start", type;
- for (var pos = start.ch, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) {
- var next = line.charAt(dir < 0 ? pos - 1 : pos);
- var cat = next != "_" && CodeMirror.isWordChar(next) ? "w" : "o";
- if (cat == "w" && next.toUpperCase() == next) cat = "W";
- if (state == "start") {
- if (cat != "o") { state = "in"; type = cat; }
- } else if (state == "in") {
- if (type != cat) {
- if (type == "w" && cat == "W" && dir < 0) pos--;
- if (type == "W" && cat == "w" && dir > 0) { type = "w"; continue; }
- break;
- }
- }
- }
- return Pos(start.line, pos);
- }
-
- function moveSubword(cm, dir) {
- cm.extendSelectionsBy(function(range) {
- if (cm.display.shift || cm.doc.extend || range.empty())
- return findPosSubword(cm.doc, range.head, dir);
- else
- return dir < 0 ? range.from() : range.to();
- });
- }
-
- cmds[map["Alt-Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); };
- cmds[map["Alt-Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); };
-
- var scrollLineCombo = mac ? "Ctrl-Alt-" : "Ctrl-";
-
- cmds[map[scrollLineCombo + "Up"] = "scrollLineUp"] = function(cm) {
- var info = cm.getScrollInfo();
- if (!cm.somethingSelected()) {
- var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local");
- if (cm.getCursor().line >= visibleBottomLine)
- cm.execCommand("goLineUp");
- }
- cm.scrollTo(null, info.top - cm.defaultTextHeight());
- };
- cmds[map[scrollLineCombo + "Down"] = "scrollLineDown"] = function(cm) {
- var info = cm.getScrollInfo();
- if (!cm.somethingSelected()) {
- var visibleTopLine = cm.lineAtHeight(info.top, "local")+1;
- if (cm.getCursor().line <= visibleTopLine)
- cm.execCommand("goLineDown");
- }
- cm.scrollTo(null, info.top + cm.defaultTextHeight());
- };
-
- cmds[map["Shift-" + ctrl + "L"] = "splitSelectionByLine"] = function(cm) {
- var ranges = cm.listSelections(), lineRanges = [];
- for (var i = 0; i < ranges.length; i++) {
- var from = ranges[i].from(), to = ranges[i].to();
- for (var line = from.line; line <= to.line; ++line)
- if (!(to.line > from.line && line == to.line && to.ch == 0))
- lineRanges.push({anchor: line == from.line ? from : Pos(line, 0),
- head: line == to.line ? to : Pos(line)});
- }
- cm.setSelections(lineRanges, 0);
- };
-
- map["Shift-Tab"] = "indentLess";
-
- cmds[map["Esc"] = "singleSelectionTop"] = function(cm) {
- var range = cm.listSelections()[0];
- cm.setSelection(range.anchor, range.head, {scroll: false});
- };
-
- cmds[map[ctrl + "L"] = "selectLine"] = function(cm) {
- var ranges = cm.listSelections(), extended = [];
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i];
- extended.push({anchor: Pos(range.from().line, 0),
- head: Pos(range.to().line + 1, 0)});
- }
- cm.setSelections(extended);
- };
-
- map["Shift-" + ctrl + "K"] = "deleteLine";
-
- function insertLine(cm, above) {
- cm.operation(function() {
- var len = cm.listSelections().length, newSelection = [], last = -1;
- for (var i = 0; i < len; i++) {
- var head = cm.listSelections()[i].head;
- if (head.line <= last) continue;
- var at = Pos(head.line + (above ? 0 : 1), 0);
- cm.replaceRange("\n", at, null, "+insertLine");
- cm.indentLine(at.line, null, true);
- newSelection.push({head: at, anchor: at});
- last = head.line + 1;
- }
- cm.setSelections(newSelection);
- });
- }
-
- cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { insertLine(cm, false); };
-
- cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { insertLine(cm, true); };
-
- function wordAt(cm, pos) {
- var start = pos.ch, end = start, line = cm.getLine(pos.line);
- while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start;
- while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end;
- return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)};
- }
-
- cmds[map[ctrl + "D"] = "selectNextOccurrence"] = function(cm) {
- var from = cm.getCursor("from"), to = cm.getCursor("to");
- var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel;
- if (CodeMirror.cmpPos(from, to) == 0) {
- var word = wordAt(cm, from);
- if (!word.word) return;
- cm.setSelection(word.from, word.to);
- fullWord = true;
- } else {
- var text = cm.getRange(from, to);
- var query = fullWord ? new RegExp("\\b" + text + "\\b") : text;
- var cur = cm.getSearchCursor(query, to);
- if (cur.findNext()) {
- cm.addSelection(cur.from(), cur.to());
- } else {
- cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0));
- if (cur.findNext())
- cm.addSelection(cur.from(), cur.to());
- }
- }
- if (fullWord)
- cm.state.sublimeFindFullWord = cm.doc.sel;
- };
-
- var mirror = "(){}[]";
- function selectBetweenBrackets(cm) {
- var pos = cm.getCursor(), opening = cm.scanForBracket(pos, -1);
- if (!opening) return;
- for (;;) {
- var closing = cm.scanForBracket(pos, 1);
- if (!closing) return;
- if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) {
- cm.setSelection(Pos(opening.pos.line, opening.pos.ch + 1), closing.pos, false);
- return true;
- }
- pos = Pos(closing.pos.line, closing.pos.ch + 1);
- }
- }
-
- cmds[map["Shift-" + ctrl + "Space"] = "selectScope"] = function(cm) {
- selectBetweenBrackets(cm) || cm.execCommand("selectAll");
- };
- cmds[map["Shift-" + ctrl + "M"] = "selectBetweenBrackets"] = function(cm) {
- if (!selectBetweenBrackets(cm)) return CodeMirror.Pass;
- };
-
- cmds[map[ctrl + "M"] = "goToBracket"] = function(cm) {
- cm.extendSelectionsBy(function(range) {
- var next = cm.scanForBracket(range.head, 1);
- if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos;
- var prev = cm.scanForBracket(range.head, -1);
- return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head;
- });
- };
-
- var swapLineCombo = mac ? "Cmd-Ctrl-" : "Shift-Ctrl-";
-
- cmds[map[swapLineCombo + "Up"] = "swapLineUp"] = function(cm) {
- var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = [];
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i], from = range.from().line - 1, to = range.to().line;
- newSels.push({anchor: Pos(range.anchor.line - 1, range.anchor.ch),
- head: Pos(range.head.line - 1, range.head.ch)});
- if (range.to().ch == 0 && !range.empty()) --to;
- if (from > at) linesToMove.push(from, to);
- else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;
- at = to;
- }
- cm.operation(function() {
- for (var i = 0; i < linesToMove.length; i += 2) {
- var from = linesToMove[i], to = linesToMove[i + 1];
- var line = cm.getLine(from);
- cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine");
- if (to > cm.lastLine())
- cm.replaceRange("\n" + line, Pos(cm.lastLine()), null, "+swapLine");
- else
- cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine");
- }
- cm.setSelections(newSels);
- cm.scrollIntoView();
- });
- };
-
- cmds[map[swapLineCombo + "Down"] = "swapLineDown"] = function(cm) {
- var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1;
- for (var i = ranges.length - 1; i >= 0; i--) {
- var range = ranges[i], from = range.to().line + 1, to = range.from().line;
- if (range.to().ch == 0 && !range.empty()) from--;
- if (from < at) linesToMove.push(from, to);
- else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;
- at = to;
- }
- cm.operation(function() {
- for (var i = linesToMove.length - 2; i >= 0; i -= 2) {
- var from = linesToMove[i], to = linesToMove[i + 1];
- var line = cm.getLine(from);
- if (from == cm.lastLine())
- cm.replaceRange("", Pos(from - 1), Pos(from), "+swapLine");
- else
- cm.replaceRange("", Pos(from, 0), Pos(from + 1, 0), "+swapLine");
- cm.replaceRange(line + "\n", Pos(to, 0), null, "+swapLine");
- }
- cm.scrollIntoView();
- });
- };
-
- map[ctrl + "/"] = "toggleComment";
-
- cmds[map[ctrl + "J"] = "joinLines"] = function(cm) {
- var ranges = cm.listSelections(), joined = [];
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i], from = range.from();
- var start = from.line, end = range.to().line;
- while (i < ranges.length - 1 && ranges[i + 1].from().line == end)
- end = ranges[++i].to().line;
- joined.push({start: start, end: end, anchor: !range.empty() && from});
- }
- cm.operation(function() {
- var offset = 0, ranges = [];
- for (var i = 0; i < joined.length; i++) {
- var obj = joined[i];
- var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), head;
- for (var line = obj.start; line <= obj.end; line++) {
- var actual = line - offset;
- if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1);
- if (actual < cm.lastLine()) {
- cm.replaceRange(" ", Pos(actual), Pos(actual + 1, /^\s*/.exec(cm.getLine(actual + 1))[0].length));
- ++offset;
- }
- }
- ranges.push({anchor: anchor || head, head: head});
- }
- cm.setSelections(ranges, 0);
- });
- };
-
- cmds[map["Shift-" + ctrl + "D"] = "duplicateLine"] = function(cm) {
- cm.operation(function() {
- var rangeCount = cm.listSelections().length;
- for (var i = 0; i < rangeCount; i++) {
- var range = cm.listSelections()[i];
- if (range.empty())
- cm.replaceRange(cm.getLine(range.head.line) + "\n", Pos(range.head.line, 0));
- else
- cm.replaceRange(cm.getRange(range.from(), range.to()), range.from());
- }
- cm.scrollIntoView();
- });
- };
-
- map[ctrl + "T"] = "transposeChars";
-
- function sortLines(cm, caseSensitive) {
- var ranges = cm.listSelections(), toSort = [], selected;
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i];
- if (range.empty()) continue;
- var from = range.from().line, to = range.to().line;
- while (i < ranges.length - 1 && ranges[i + 1].from().line == to)
- to = range[++i].to().line;
- toSort.push(from, to);
- }
- if (toSort.length) selected = true;
- else toSort.push(cm.firstLine(), cm.lastLine());
-
- cm.operation(function() {
- var ranges = [];
- for (var i = 0; i < toSort.length; i += 2) {
- var from = toSort[i], to = toSort[i + 1];
- var start = Pos(from, 0), end = Pos(to);
- var lines = cm.getRange(start, end, false);
- if (caseSensitive)
- lines.sort();
- else
- lines.sort(function(a, b) {
- var au = a.toUpperCase(), bu = b.toUpperCase();
- if (au != bu) { a = au; b = bu; }
- return a < b ? -1 : a == b ? 0 : 1;
- });
- cm.replaceRange(lines, start, end);
- if (selected) ranges.push({anchor: start, head: end});
- }
- if (selected) cm.setSelections(ranges, 0);
- });
- }
-
- cmds[map["F9"] = "sortLines"] = function(cm) { sortLines(cm, true); };
- cmds[map[ctrl + "F9"] = "sortLinesInsensitive"] = function(cm) { sortLines(cm, false); };
-
- cmds[map["F2"] = "nextBookmark"] = function(cm) {
- var marks = cm.state.sublimeBookmarks;
- if (marks) while (marks.length) {
- var current = marks.shift();
- var found = current.find();
- if (found) {
- marks.push(current);
- return cm.setSelection(found.from, found.to);
- }
- }
- };
-
- cmds[map["Shift-F2"] = "prevBookmark"] = function(cm) {
- var marks = cm.state.sublimeBookmarks;
- if (marks) while (marks.length) {
- marks.unshift(marks.pop());
- var found = marks[marks.length - 1].find();
- if (!found)
- marks.pop();
- else
- return cm.setSelection(found.from, found.to);
- }
- };
-
- cmds[map[ctrl + "F2"] = "toggleBookmark"] = function(cm) {
- var ranges = cm.listSelections();
- var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []);
- for (var i = 0; i < ranges.length; i++) {
- var from = ranges[i].from(), to = ranges[i].to();
- var found = cm.findMarks(from, to);
- for (var j = 0; j < found.length; j++) {
- if (found[j].sublimeBookmark) {
- found[j].clear();
- for (var k = 0; k < marks.length; k++)
- if (marks[k] == found[j])
- marks.splice(k--, 1);
- break;
- }
- }
- if (j == found.length)
- marks.push(cm.markText(from, to, {sublimeBookmark: true, clearWhenEmpty: false}));
- }
- };
-
- cmds[map["Shift-" + ctrl + "F2"] = "clearBookmarks"] = function(cm) {
- var marks = cm.state.sublimeBookmarks;
- if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();
- marks.length = 0;
- };
-
- cmds[map["Alt-F2"] = "selectBookmarks"] = function(cm) {
- var marks = cm.state.sublimeBookmarks, ranges = [];
- if (marks) for (var i = 0; i < marks.length; i++) {
- var found = marks[i].find();
- if (!found)
- marks.splice(i--, 0);
- else
- ranges.push({anchor: found.from, head: found.to});
- }
- if (ranges.length)
- cm.setSelections(ranges, 0);
- };
-
- map["Alt-Q"] = "wrapLines";
-
- var cK = ctrl + "K ";
-
- function modifyWordOrSelection(cm, mod) {
- cm.operation(function() {
- var ranges = cm.listSelections(), indices = [], replacements = [];
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i];
- if (range.empty()) { indices.push(i); replacements.push(""); }
- else replacements.push(mod(cm.getRange(range.from(), range.to())));
- }
- cm.replaceSelections(replacements, "around", "case");
- for (var i = indices.length - 1, at; i >= 0; i--) {
- var range = ranges[indices[i]];
- if (at && CodeMirror.cmpPos(range.head, at) > 0) continue;
- var word = wordAt(cm, range.head);
- at = word.from;
- cm.replaceRange(mod(word.word), word.from, word.to);
- }
- });
- }
-
- 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();
- for (var i = ranges.length - 1; i >= 0; i--)
- cm.replaceRange("", ranges[i].anchor, Pos(ranges[i].to().line), "+delete");
- cm.scrollIntoView();
- });
- };
-
- cmds[map[cK + ctrl + "U"] = "upcaseAtCursor"] = function(cm) {
- modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); });
- };
- cmds[map[cK + ctrl + "L"] = "downcaseAtCursor"] = function(cm) {
- modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); });
- };
-
- cmds[map[cK + ctrl + "Space"] = "setSublimeMark"] = function(cm) {
- if (cm.state.sublimeMark) cm.state.sublimeMark.clear();
- cm.state.sublimeMark = cm.setBookmark(cm.getCursor());
- };
- cmds[map[cK + ctrl + "A"] = "selectToSublimeMark"] = function(cm) {
- var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
- if (found) cm.setSelection(cm.getCursor(), found);
- };
- cmds[map[cK + ctrl + "W"] = "deleteToSublimeMark"] = function(cm) {
- var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
- if (found) {
- var from = cm.getCursor(), to = found;
- if (CodeMirror.cmpPos(from, to) > 0) { var tmp = to; to = from; from = tmp; }
- cm.state.sublimeKilled = cm.getRange(from, to);
- cm.replaceRange("", from, to);
- }
- };
- cmds[map[cK + ctrl + "X"] = "swapWithSublimeMark"] = function(cm) {
- var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
- if (found) {
- cm.state.sublimeMark.clear();
- cm.state.sublimeMark = cm.setBookmark(cm.getCursor());
- cm.setCursor(found);
- }
- };
- cmds[map[cK + ctrl + "Y"] = "sublimeYank"] = function(cm) {
- if (cm.state.sublimeKilled != null)
- cm.replaceSelection(cm.state.sublimeKilled, null, "paste");
- };
-
- map[cK + ctrl + "G"] = "clearBookmarks";
- cmds[map[cK + ctrl + "C"] = "showInCenter"] = function(cm) {
- var pos = cm.cursorCoords(null, "local");
- cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2);
- };
-
- cmds[map["Shift-Alt-Up"] = "selectLinesUpward"] = function(cm) {
- cm.operation(function() {
- var ranges = cm.listSelections();
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i];
- if (range.head.line > cm.firstLine())
- cm.addSelection(Pos(range.head.line - 1, range.head.ch));
- }
- });
- };
- cmds[map["Shift-Alt-Down"] = "selectLinesDownward"] = function(cm) {
- cm.operation(function() {
- var ranges = cm.listSelections();
- for (var i = 0; i < ranges.length; i++) {
- var range = ranges[i];
- if (range.head.line < cm.lastLine())
- cm.addSelection(Pos(range.head.line + 1, range.head.ch));
- }
- });
- };
-
- function getTarget(cm) {
- var from = cm.getCursor("from"), to = cm.getCursor("to");
- if (CodeMirror.cmpPos(from, to) == 0) {
- var word = wordAt(cm, from);
- if (!word.word) return;
- from = word.from;
- to = word.to;
- }
- return {from: from, to: to, query: cm.getRange(from, to), word: word};
- }
-
- function findAndGoTo(cm, forward) {
- var target = getTarget(cm);
- if (!target) return;
- var query = target.query;
- var cur = cm.getSearchCursor(query, forward ? target.to : target.from);
-
- if (forward ? cur.findNext() : cur.findPrevious()) {
- cm.setSelection(cur.from(), cur.to());
- } else {
- cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0)
- : cm.clipPos(Pos(cm.lastLine())));
- if (forward ? cur.findNext() : cur.findPrevious())
- cm.setSelection(cur.from(), cur.to());
- else if (target.word)
- cm.setSelection(target.from, target.to);
- }
- };
- cmds[map[ctrl + "F3"] = "findUnder"] = function(cm) { findAndGoTo(cm, true); };
- cmds[map["Shift-" + ctrl + "F3"] = "findUnderPrevious"] = function(cm) { findAndGoTo(cm,false); };
- cmds[map["Alt-F3"] = "findAllUnder"] = function(cm) {
- var target = getTarget(cm);
- if (!target) return;
- var cur = cm.getSearchCursor(target.query);
- var matches = [];
- var primaryIndex = -1;
- while (cur.findNext()) {
- matches.push({anchor: cur.from(), head: cur.to()});
- if (cur.from().line <= target.from.line && cur.from().ch <= target.from.ch)
- primaryIndex++;
- }
- cm.setSelections(matches, primaryIndex);
- };
-
- map["Shift-" + ctrl + "["] = "fold";
- map["Shift-" + ctrl + "]"] = "unfold";
- map[cK + ctrl + "0"] = map[cK + ctrl + "j"] = "unfoldAll";
-
- map[ctrl + "I"] = "findIncremental";
- map["Shift-" + ctrl + "I"] = "findIncrementalReverse";
- map[ctrl + "H"] = "replace";
- map["F3"] = "findNext";
- map["Shift-F3"] = "findPrev";
-
- CodeMirror.normalizeKeyMap(map);
-});
diff --git a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/vim.js b/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/vim.js
deleted file mode 100644
index 14897a8..0000000
--- a/backend/wordpress/wp-content/plugins/types/vendor/toolset/toolset-common/visual-editor/res/js/codemirror/keymap/vim.js
+++ /dev/null
@@ -1,5060 +0,0 @@
-// 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.
- *
- * 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.
- *
- * 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.
- * 9. Ex command implementations.
- */
-
-(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: '